/* A dictionary workspace: search, continuous list, full article. No landing screen. */
@font-face {
  font-family: Manrope;
  src: url("/assets/Manrope.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
@font-face {
  font-family: "PRK Long Gothic";
  src: url("/assets/PRK-LongGothic-Regular.woff2?v=2") format("woff2");
  font-weight: 400;
  font-display: swap;
  unicode-range: U+1100-11FF, U+3130-318F, U+A960-A97F, U+AC00-D7FF;
}
@font-face {
  font-family: "PRK Long Gothic";
  src: url("/assets/PRK-LongGothic-Bold.woff2?v=2") format("woff2");
  font-weight: 700;
  font-display: swap;
  unicode-range: U+1100-11FF, U+3130-318F, U+A960-A97F, U+AC00-D7FF;
}
@font-face {
  font-family: "Noto Sans KR";
  src: url("/assets/NotoSansKR.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  font-family: Manrope, "PRK Long Gothic", "Noto Sans KR", sans-serif;
  font-size: 14px;
  color-scheme: dark;
  --bg: oklch(18% 0 0);
  --paper: oklch(21% 0 0);
  --hover: oklch(27% 0 0);
  --selected: oklch(31% 0 0);
  --ink: oklch(95% 0 0);
  --muted: oklch(73% 0 0);
  --line: oklch(32% 0 0);
  --control: oklch(53% 0 0);
  --accent: oklch(88% 0 0);
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
h1,
h2,
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
a,
summary,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
  border: 0;
  background: transparent;
}
button:disabled {
  opacity: 0.5;
  cursor: default;
}
button,
a,
summary {
  transition:
    background 0.15s ease-out,
    color 0.15s ease-out;
}
button:hover:not(:disabled),
summary:hover {
  background: var(--hover);
}
button:active:not(:disabled) {
  background: var(--selected);
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input:focus-visible {
  outline: none;
}
#entry-pane:focus {
  outline: none;
}
svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
[hidden] {
  display: none !important;
}
[lang="ko"] {
  font-family: "PRK Long Gothic", Manrope, "Noto Sans KR", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.sr-only,
.dictionary-example-separator {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip {
  position: fixed;
  top: -80px;
  left: 16px;
  padding: 16px;
  background: var(--ink);
  color: var(--bg);
  z-index: 100;
}
.skip:focus {
  top: 8px;
}
.app-header {
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 16px 28px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  flex-shrink: 0;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 12px;
  white-space: nowrap;
}
.brand strong {
  font-size: 20px;
  letter-spacing: -0.6px;
}
.brand span {
  color: var(--muted);
  font-size: 12px;
}
#search-form {
  display: flex;
  gap: 12px;
  align-items: center;
  max-width: 840px;
  flex: 1;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  padding: 4px 4px 4px 16px;
  border: 1px solid var(--control);
  border-radius: 8px;
  background: var(--paper);
}
.search-box:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.search-box > svg {
  color: var(--muted);
}
.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 0;
  line-height: 1.5;
  font-size: 14px;
}
.search-box input::placeholder {
  color: var(--muted);
}
.search-box button {
  height: 36px;
  border-radius: 5px;
  padding: 0 16px;
  background: var(--hover);
  font-size: 12px;
  font-weight: 650;
}
select {
  min-height: 44px;
  border: 1px solid var(--control);
  border-radius: 6px;
  padding: 8px 28px 8px 12px;
  background: var(--bg);
  font-size: 12px;
}
#language {
  max-width: 168px;
}
.tools {
  position: relative;
  margin-left: auto;
  flex-shrink: 0;
}
.tools summary {
  min-height: 44px;
  padding: 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.tools-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  padding: 8px;
  width: 180px;
  border: 1px solid var(--control);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 12px 32px #0005;
}
.tools-menu button {
  display: block;
  text-align: left;
  width: 100%;
  padding: 12px;
  min-height: 44px;
  border-radius: 4px;
  font-size: 13px;
}
.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  flex: 1;
  min-height: 0;
}
.catalog {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-right: 1px solid var(--line);
}
.list-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
}
.list-tabs button {
  flex: 1;
  min-height: 44px;
  padding: 8px 4px;
  font-size: 12px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
}
.list-tabs button[aria-pressed="true"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
#saved-count {
  font-size: 11px;
}
.list-filter {
  padding: 16px 20px 12px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.list-filter label {
  font-size: 12px;
  color: var(--muted);
}
.list-filter select {
  flex: 1;
  min-width: 0;
}
.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.list-heading button {
  min-height: 28px;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.list-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--control) transparent;
  scrollbar-gutter: stable;
}
#results {
  padding: 0;
  margin: 0;
  list-style: none;
}
.result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.result:hover {
  background: var(--hover);
}
.result[aria-current="true"] {
  background: var(--selected);
}
.result-title {
  font-size: 22px;
  line-height: 1.55;
  font-weight: 500;
}
.result-title sup,
.entry-heading sup {
  font-family: Manrope, sans-serif;
  font-size: 0.5em;
  color: var(--muted);
  margin-left: 4px;
}
.result-preview {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-top: 4px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.result:focus-visible {
  outline-offset: -4px;
}
.load-more {
  display: block;
  border: 1px solid var(--control);
  border-radius: 6px;
  min-height: 44px;
  padding: 12px 20px;
  font-size: 12px;
  margin: 16px auto 24px;
}
.catalog-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
}
.undo-history {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--line);
}
.undo-history button {
  min-height: 44px;
  text-decoration: underline;
  color: var(--accent);
}
.entry-pane {
  min-width: 0;
  overflow: auto;
  scrollbar-gutter: stable;
  padding: 28px clamp(24px, 4vw, 64px) 56px;
  background: var(--paper);
}
.entry {
  max-width: 800px;
  margin: 0 auto;
}
.entry-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 44px;
  margin-bottom: 24px;
}
.entry-reference {
  font-size: 12px;
  color: var(--muted);
}
.entry-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.entry-actions button,
.back-to-list {
  min-height: 44px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}
.entry-actions button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.back-to-list {
  display: none;
}
.entry-heading {
  font-size: 44px;
  line-height: 1.5;
  font-weight: 600;
  letter-spacing: -1px;
  overflow-wrap: anywhere;
}
.entry-grammar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  margin-top: 8px;
}
.entry-grammar em {
  color: var(--accent);
  font-synthesis: style;
}
.entry-variants {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin-top: 12px;
}
.meaning-index {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.meaning-index summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
}
.meaning-index nav {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
}
.meaning-index a {
  padding: 8px 0;
  display: flex;
  gap: 12px;
  line-height: 1.7;
  min-height: 36px;
}
.meaning-index a:hover {
  color: var(--ink);
}
.meaning-index a > span:first-child {
  color: var(--accent);
}
.dictionary-reading {
  max-width: 68ch;
  font-size: 17px;
  line-height: 1.85;
  margin-top: 28px;
  overflow-wrap: anywhere;
  hyphens: none;
}
.dictionary-block {
  margin: 0;
}
.dictionary-definition {
  font-size: 18px;
  line-height: 1.8;
}
.dictionary-block + .dictionary-block {
  margin-top: 20px;
}
.dictionary-meaning {
  font-size: 18px;
  font-weight: 550;
  line-height: 1.8;
  position: relative;
  padding-left: 36px;
  scroll-margin-top: 24px;
}
.dictionary-marker {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--accent);
  font-weight: 500;
}
.dictionary-meaning:not(:first-child) {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.dictionary-meaning:not(:first-child) > .dictionary-marker {
  top: 24px;
}
.dictionary-example-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.dictionary-example-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dictionary-example-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
  line-height: 1.85;
  font-size: 16px;
}
.dictionary-example-source {
  font-weight: 500;
}
.dictionary-example-translation {
  color: color-mix(in oklch, var(--ink) 80%, var(--muted));
}
.dictionary-example-unpaired {
  grid-column: 1/-1;
}
.dictionary-definition-line { display: block; }
.dictionary-definition-line + .dictionary-definition-line { margin-top: 8px; }
.dictionary-qualifier {
  font-style: italic;
  font-synthesis: style;
  color: var(--accent);
  font-weight: 400;
}
.dictionary-pronunciation {
  color: var(--muted);
}
.qualifier-legend {
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding-top: 8px;
  font-size: 13px;
  color: var(--muted);
}
.qualifier-legend summary {
  min-height: 44px;
  cursor: pointer;
  padding: 12px 0;
}
.qualifier-legend dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 24px;
  line-height: 1.8;
}
.qualifier-legend dd {
  margin: 0;
}
.qualifier-legend dt {
  font-style: italic;
  color: var(--accent);
}
.entry-footnote {
  margin-top: 32px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.reading-note {
  font-size: 13px;
  line-height: 1.8;
  margin-top: 24px;
}
.reading-note summary {
  min-height: 44px;
  padding: 12px 0;
  cursor: pointer;
}
.reading-note p + p {
  margin-top: 12px;
}
.empty,
.error {
  padding: 24px 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.entry-pane > .empty,
.entry-pane > .error {
  max-width: 800px;
  margin: auto;
  padding: 24px 0;
}
.empty h1,
.error h1,
.empty h2,
.error h2 {
  font-size: 20px;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 12px;
}
.error button {
  min-height: 44px;
  border: 1px solid var(--control);
  padding: 8px 16px;
  margin-top: 16px;
  border-radius: 6px;
}
.entry-pane[aria-busy="true"] {
  cursor: progress;
}
.loading {
  padding: 28px 20px;
  color: var(--muted);
  font-size: 13px;
}
.notice {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  align-items: center;
  background: var(--ink);
  color: var(--bg);
  border-radius: 8px;
  padding: 8px 12px 8px 20px;
  max-width: calc(100vw - 32px);
  font-size: 13px;
  z-index: 20;
  box-shadow: 0 8px 32px #0004;
}
.notice button {
  font-size: 24px;
  color: var(--bg);
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}
.notice button:focus-visible {
  outline-color: var(--bg);
}
.notice button:hover {
  background: color-mix(in oklch, var(--bg) 10%, var(--ink));
}
.about-text {
  max-width: 65ch;
  font-size: 15px;
  line-height: 1.9;
}
.about-text h1 {
  font-size: 28px;
  margin: 16px 0 24px;
}
.about-text h2 {
  font-size: 18px;
  margin: 32px 0 12px;
}
.about-text p {
  color: var(--muted);
  margin-top: 12px;
}
@media (min-width: 1700px) {
  .workspace {
    grid-template-columns: 380px minmax(0, 1fr);
  }
  .entry {
    margin-left: clamp(0px, 5vw, 96px);
  }
}
@media (max-width: 1100px) {
  .app-header {
    gap: 20px;
    padding-inline: 20px;
  }
  .brand {
    display: block;
  }
  .brand span {
    display: block;
    margin-top: 2px;
  }
  .workspace {
    grid-template-columns: 300px minmax(0, 1fr);
  }
  .entry-pane {
    padding-inline: 28px;
  }
  .dictionary-example-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .entry-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }
  .entry-heading {
    font-size: 36px;
  }
  #language {
    max-width: 140px;
  }
}
@media (max-width: 720px) {
  .app-header {
    display: grid;
    grid-template-columns: 1fr auto;
    padding: 12px 16px;
    gap: 12px;
  }
  .brand {
    display: flex;
    gap: 8px;
  }
  .brand strong {
    font-size: 18px;
  }
  .brand span {
    font-size: 11px;
    margin: 0;
  }
  .tools {
    grid-row: 1;
    grid-column: 2;
  }
  .tools summary {
    padding: 8px;
    min-height: 40px;
  }
  #search-form {
    grid-column: 1/-1;
    gap: 8px;
    max-width: none;
  }
  .search-box {
    gap: 8px;
    padding-left: 12px;
  }
  .search-box input {
    font-size: 16px;
    padding-block: 8px;
  }
  .search-box button {
    min-height: 40px;
    padding-inline: 12px;
  }
  #language {
    font-size: 12px;
    width: 100px;
    min-height: 48px;
    padding-left: 8px;
    padding-right: 20px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .catalog {
    flex: 1;
    border-right: 0;
  }
  .entry-pane {
    display: none;
    flex: 1;
    padding: 16px 20px 40px;
    min-height: 0;
  }
  .workspace.has-selection .catalog {
    display: none;
  }
  .workspace.has-selection .entry-pane {
    display: block;
  }
  .back-to-list {
    display: inline-flex;
    padding: 8px;
  }
  .entry-toolbar {
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .entry-reference {
    display: none;
  }
  .entry-actions {
    margin-left: auto;
  }
  .entry-actions button {
    padding: 8px 12px;
  }
  .entry-actions .share-label {
    display: none;
  }
  .entry-heading {
    font-size: 36px;
  }
  .list-tabs {
    padding-top: 0;
  }
  .list-filter {
    padding-top: 12px;
  }
  .result {
    padding: 12px 20px;
  }
  .list-heading {
    min-height: 40px;
  }
  .dictionary-reading {
    margin-top: 24px;
    font-size: 16px;
  }
  .dictionary-example-row {
    font-size: 16px;
    padding: 12px 0;
  }
  .dictionary-meaning {
    font-size: 18px;
  }
  .meaning-index {
    margin-top: 20px;
  }
  .notice {
    bottom: 16px;
    width: max-content;
  }
}
@media (max-width: 380px) {
  .brand span {
    font-size: 10px;
  }
  #language {
    width: 88px;
  }
  .search-box > svg {
    display: none;
  }
  .search-box button {
    padding-inline: 10px;
  }
  .entry-actions button {
    padding-inline: 10px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .result[aria-current="true"],
  .list-tabs button[aria-pressed="true"] {
    outline: 2px solid Highlight;
    outline-offset: -3px;
  }
}
