@import url("/shared/web-punctuation.css?v=91fae76945a7");
@import url("/shared/web-hangul-font.css?v=6e95ca0b9ba8");
@import url("/shared/web-ruby.css?v=30661ba87dea");
:root { --tli-dictionary-ruby-size: 0.44em; }
.entry-headword-ruby > .entry-headword-reading {
  font-size: var(--tli-dictionary-ruby-size) !important;
}
:root {
  color-scheme: light;
  --bg: #f5f8f7;
  --surface: #ffffff;
  --surface-soft: #eef8fa;
  --text: #19272a;
  --muted: #5d6c70;
  --line: #ccdae0;
  --accent: #0a7180;
  --accent-strong: #085764;
  --focus: #2563eb;
  --warning: #a85518;
  font-family: "TLI Western Punctuation", "Tangliengim Hangul", "Noto Sans", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.brand-mark {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
}

.data-status {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.92rem;
  text-align: right;
}

.app-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 22px auto 32px;
}

.construction-notice {
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #f2d2a6;
  border-radius: 7px;
  background: #fff8ed;
  color: #7c4a12;
  font-size: 0.95rem;
  font-weight: 650;
}

.search-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 16px;
}

/* The box is the shared .tli-search (shared/web-search-box.css); these keep the dictionary's own look. */
.search-panel .tli-search { gap: 10px; }
.search-panel .tli-search-heading > label { font-size: 0.92rem; }
.search-panel .tli-search-input {
  height: 52px;
  padding: 0 50px 0 16px;
  border: 1px solid #b9c6d6;
  border-radius: 7px;
  background: #ffffff;
  color: var(--text);
  font-size: 1.08rem;
}

.search-panel .tli-search-input.hangul-ime-active {
  font-family: "TLI Western Punctuation", "Tangliengim Hangul", "TLI Extended Hanri", "Tangliengim Hanri Fallback", "Noto Sans TC", "Noto Sans CJK TC", "Noto Sans KR", "Noto Sans CJK KR", "Noto Sans", sans-serif;
}

.search-panel .tli-search-input:focus-visible {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  outline: none;
}

.search-panel .tli-search-clear {
  top: 7px;
  right: 7px;
  width: 38px;
  height: 38px;
  transform: none;
  border-radius: 6px;
  font-size: 1.7rem;
}

.search-panel .tli-search-clear:hover {
  background: #eef2f7;
  color: var(--text);
}

/* The switch itself is the shared one; the dictionary only keeps its own colour and weight. */
.search-panel .hangul-keyboard-toggle { color: #475569; font-size: 0.9rem; font-weight: 800; }
.search-panel .hangul-keyboard-toggle:hover,
.search-panel .hangul-keyboard-toggle:focus-visible,
.search-panel .hangul-keyboard-toggle[aria-pressed="true"] { color: var(--accent-strong); }
.search-panel .hangul-keyboard-toggle[aria-pressed="true"] .toggle-switch { background: var(--accent); }

.search-panel .hanri-candidate-menu {
  top: calc(100% + 4px);
  left: 0;
}

.category-browser {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 2px 0;
}

.category-title {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.category-button {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 750;
}

.category-button:hover,
.category-button:focus-visible,
.category-button[aria-pressed="true"] {
  border-color: rgba(15, 118, 110, 0.55);
  background: #eef8fa;
  color: var(--accent-strong);
  outline: none;
}

.summary-bar {
  display: flex;
  justify-content: space-between;
  padding: 14px 2px 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.results {
  display: grid;
  gap: 10px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--muted);
}

.page-button {
  min-width: 34px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 750;
}

.page-button:hover:not(:disabled),
.page-button.current {
  border-color: rgba(15, 118, 110, 0.55);
  background: #eef8fa;
  color: var(--accent-strong);
}

.page-button:disabled {
  color: #a8b3c2;
  cursor: not-allowed;
}

.page-ellipsis {
  min-width: 26px;
  text-align: center;
  font-weight: 750;
}

.entry {
  display: grid;
  grid-template-columns: minmax(180px, 0.75fr) minmax(0, 2fr);
  gap: 18px;
  align-items: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  box-shadow: none;
}

.entry-main {
  min-width: 0;
}

.hanri {
  margin: 0;
  font-family: "TLI Western Punctuation", "Tangliengim Hangul", "TLI Menu Hanri", "TLI Extended Hanri", "Tangliengim Hanri Fallback", "Noto Sans TC", "Noto Sans CJK TC", "Noto Sans", sans-serif;
  font-size: 34px;
  font-weight: 800;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.entry-headword-ruby {
  white-space: nowrap;
}

.entry-headword-ruby .entry-headword-reading {
  color: #334155;
  font-family: "TLI Western Punctuation", "Tangliengim Hangul", "Noto Sans KR", "Noto Sans CJK KR", "Noto Sans", sans-serif;
  font-weight: 750;
}

.hangul-reading-unit {
  display: inline-block;
  min-width: 1em;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0;
}

.entry-headword-hangul {
  font-family: "TLI Western Punctuation", "Tangliengim Hangul", "Noto Sans KR", "Noto Sans CJK KR", "Noto Sans", sans-serif;
}

.latin-apostrophe {
  font-family: "TLI Western Punctuation", Calibri, "Segoe UI", Arial, sans-serif;
  font-variant-east-asian: normal;
  letter-spacing: 0;
}

.entry-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.83rem;
}

.readings {
  display: grid;
  gap: 7px;
}

.reading {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1.15fr) auto;
  gap: 16px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 6px;
  background: #f7faf9;
  overflow: hidden;
}

.reading-field {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.field-label {
  color: #7b8797;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hangul-tone {
  position: relative;
  display: inline-block;
  min-width: 0;
  margin-top: 0.08em;
  line-height: 1.15;
  ruby-position: over;
}

.hangul-tone .tone-mark {
  position: absolute;
  top: calc(-0.84em - 4px);
  left: 50%;
  transform: translateX(-50%);
  color: #1f2937;
  font-family: "TLI Western Punctuation", Calibri, Arial, sans-serif;
  font-size: 1.02em;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.inline-upper-tone {
  font-family: "TLI Western Punctuation", Calibri, Arial, sans-serif;
  font-size: 0.82em;
  font-weight: 800;
  margin-left: 0.02em;
  vertical-align: 0.08em;
}

.lomari {
  font-family: "TLI Western Punctuation", "TLI Noto Sans", sans-serif;
  color: #475569;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.english-gloss {
  color: #475569;
  font-size: 0.98rem;
  overflow-wrap: anywhere;
}

.reading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.audio-reading,
.copy-reading {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #cbd6e2;
  border-radius: 6px;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.audio-reading:hover,
.copy-reading:hover {
  border-color: rgba(15, 118, 110, 0.5);
  color: var(--accent-strong);
}

.audio-reading:disabled {
  border-color: #e2e8f0;
  color: #a8b3c2;
  cursor: not-allowed;
}

.audio-reading.playing {
  border-color: rgba(15, 118, 110, 0.5);
  color: var(--accent-strong);
}

.more-readings,
.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
}

.empty-state {
  display: grid;
  gap: 6px;
}

.empty-state strong {
  color: var(--text);
}

.empty-state.error {
  border-color: rgba(168, 85, 24, 0.3);
  color: var(--warning);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  padding: 10px 12px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 7px;
  background: #ffffff;
  color: var(--accent-strong);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.16);
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateY(6px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: 0.86rem;
  text-align: center;
}

.lock-dictionary-button {
  margin-left: 10px;
  font-size: inherit;
}

@media (max-width: 720px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
  }

  .data-status {
    text-align: left;
  }

  .app-shell {
    width: min(100% - 20px, 1120px);
    margin-top: 14px;
  }

  .search-panel {
    padding: 13px;
  }

  .search-panel .tli-search-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .category-browser {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .entry,
  .reading {
    grid-template-columns: 1fr;
  }

  .entry {
    gap: 12px;
    padding: 14px;
  }

  .hanri { font-size: 28px; }

  .reading {
    gap: 8px;
  }

  .reading-actions {
    justify-content: space-between;
  }

  .pagination {
    flex-wrap: wrap;
  }

  .site-footer {
    display: grid;
    gap: 8px;
  }

  .lock-dictionary-button {
    justify-self: center;
    margin-left: 0;
  }

}
