/* Tibetan-Chinese Bilingual Lexicon · Refined Academic Design System (Zero Green, Zero Emojis) */
/* Bundled Official SIL Open Font License (OFL 1.1) Strict Unicode IPA Font */
@font-face {
  font-family: 'Charis SIL';
  src: url('fonts/CharisSIL-Regular.woff2') format('woff2');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Charis SIL';
  src: url('fonts/CharisSIL-Bold.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-ipa: 'Charis SIL', 'Doulos SIL', 'Gentium Plus', 'Lucida Sans Unicode', 'Segoe UI', sans-serif;
  color-scheme: light;
  --bg: #f8f8f5;
  --card: #ffffff;
  --ink: #1e251d;
  --muted: #697063;
  --line: #dedfd7;
  --accent: #8b1e0f;       /* Classical Tibetan Crimson */
  --accent-deep: #6f160a;  /* Deep Crimson */
  --accent-soft: #fbf0eb;  /* Soft Warm Linen Crimson */
  --gold: #bd8b44;         /* Muted Tibetan Gold */
  --gold-soft: #fcf6ec;    /* Soft Amber Linen */
  --blue: #2a5a7b;         /* Slate Ocean Blue for IPA */
  --slate: #475569;        /* Classic Slate Grey */
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  --font-tibetan: 'Noto Serif Tibetan', 'Microsoft Himalaya', 'Kailasa', 'Kokonor', 'Tibetan Machine Uni', 'Jomolhari', 'DDC Uchen', serif;
}

* { box-sizing: border-box; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 36px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}
.brand-mark {
  font-family: var(--font-tibetan);
  font-size: 24px;
  color: var(--accent);
  padding-right: 18px;
  border-right: 1px solid var(--line);
  letter-spacing: 0.04em;
}
.brand-copy { padding-left: 18px; flex: 1; }
.brand-copy .eyebrow {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-transform: uppercase;
}
.brand-copy .brand-title,
.brand-copy h1 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: 0.02em; color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
  margin-right: 4px;
}
.top-actions span { font-size: 11px; color: var(--muted); margin-right: 6px; }
.ghost-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all .15s ease;
}
.ghost-btn:hover { border-color: var(--accent); color: var(--accent); background: #fff; }

/* Main Shell - Screen-Matching Fluid Adaptive Architecture */
.shell {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 10px clamp(14px, 1.8vw, 28px) 14px;
  box-sizing: border-box;
  transition: max-width 0.25s cubic-bezier(0.16, 1, 0.3, 1), padding 0.25s ease;
}
.shell.contained-mode {
  max-width: 1720px;
  margin: 0 auto;
}

/* Header & Banner */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  transition: all 0.22s ease;
}
.hero-left {
  flex: 1;
  min-width: 0;
}
.kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: uppercase;
}
.hero h1,
.hero h2 {
  font-family: Georgia, "Noto Serif SC", serif;
  font-size: 24px;
  font-weight: 600;
  margin: 4px 0 6px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
  transition: font-size 0.2s ease;
}
.hero-desc {
  margin: 0;
  max-width: 960px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  transition: opacity 0.2s ease, max-height 0.2s ease;
}
.hero-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  margin-left: 20px;
}
.hero-stat {
  text-align: right;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.hero-stat strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 32px;
  line-height: 1;
  color: var(--accent);
  transition: font-size 0.2s ease;
}
.hero-stat span {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Layout Controls Bar */
.hero-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.layout-toggle-btn {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.layout-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.layout-toggle-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* Compact Hero Mode */
.hero.compact {
  align-items: center;
  margin-bottom: 6px;
  padding-bottom: 6px;
}
.hero.compact .hero-desc {
  display: none;
}
.hero.compact .kicker {
  display: inline-block;
  margin-right: 8px;
}
.hero.compact h1,
.hero.compact h2 {
  font-size: 22px;
  margin: 0;
  display: inline-block;
}
.hero.compact .hero-right {
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.hero.compact .hero-stat strong {
  font-size: 20px;
}

/* Workspace Layout - Fluid Adaptive Multi-Column Grid */
.workspace {
  --sidebar-width: 250px;
  --results-width: 290px;
  --resizer-width: 6px;
  display: grid;
  grid-template-columns: var(--sidebar-width) var(--results-width) var(--resizer-width) minmax(0, 1fr);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  height: calc(100vh - 222px);
  min-height: 560px;
  transition: grid-template-columns 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  position: relative;
}
.hero.compact + .workspace {
  height: calc(100vh - 148px);
}
.workspace.sidebar-collapsed {
  --sidebar-width: 0px !important;
}
.workspace.focus-mode {
  --sidebar-width: 0px !important;
  --results-width: 0px !important;
  --resizer-width: 0px !important;
  grid-template-columns: 0px 0px 0px minmax(0, 1fr) !important;
}
.workspace > .sidebar { grid-column: 1; }
.workspace > .results-pane { grid-column: 2; }
.workspace > .pane-resizer { grid-column: 3; }
.workspace > .detail-pane { grid-column: 4; }

/* Sidebar Filters */
.sidebar {
  padding: 16px 14px;
  border-right: 1px solid var(--line);
  background: #fafaf8;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: padding 0.22s ease, opacity 0.2s ease;
  box-sizing: border-box;
}
.workspace.sidebar-collapsed .sidebar {
  padding: 0;
  border-right: none;
  opacity: 0;
  pointer-events: none;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  margin-bottom: 14px;
  transition: border-color .15s ease;
  flex-shrink: 0;
  min-width: 0;
}
.search-box > span {
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search-box input {
  border: 0;
  outline: 0;
  width: 100%;
  min-width: 0;
  font-size: 13px;
  background: transparent;
}
.filter-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
  flex-shrink: 0;
}
.chip-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-bottom: 16px;
  overflow-y: auto;
  flex-shrink: 1;
}
.chip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 9px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  color: var(--ink);
  transition: all .12s ease;
}
.chip:hover { background: #eee; }
.chip.active { background: #fdf2ed; border-color: #eed5c9; color: var(--accent); font-weight: 600; }
.chip em { font-style: normal; font-size: 11px; color: var(--muted); }
.region-label { margin-top: 16px; flex-shrink: 0; }
.legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
  margin-bottom: 6px;
  flex-shrink: 0;
}
.legend-dot { width: 6px; height: 6px; border-radius: 50%; background: #999b94; }
.legend-dot.ready { background: var(--accent); }
.sidebar-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  flex-shrink: 0;
}

/* Results Pane */
.results-pane {
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  background: #fff;
  height: 100%;
  overflow: hidden;
  min-width: 0;
  transition: opacity 0.2s ease;
  box-sizing: border-box;
}
.workspace.focus-mode .results-pane {
  border-right: none;
  opacity: 0;
  pointer-events: none;
}
.results-head {
  padding: 11px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.results-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-toggle-btn {
  border: 1px solid var(--line);
  background: #fafaf8;
  color: var(--muted);
  border-radius: 4px;
  padding: 2px 7px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.3;
  transition: all 0.15s ease;
}
.icon-toggle-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff;
}
.text-btn { border: 0; background: transparent; font-size: 11px; color: var(--accent); cursor: pointer; padding: 0; }
.text-btn:hover { text-decoration: underline; }
.entry-list {
  overflow-y: auto;
  flex: 1;
  height: 100%;
  max-height: none;
}
.entry-card {
  padding: 12px 16px;
  border-bottom: 1px solid #f2f3ec;
  cursor: pointer;
  transition: all .12s ease;
}
.entry-card:hover { background: #fafaf6; }
.entry-card.selected { background: #fdf2ed; border-left: 3px solid var(--accent); padding-left: 13px; }
.entry-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; }
.entry-top > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 6px !important;
  min-width: 0;
  flex: 1 1 auto;
}
.entry-top .tibetan {
  font-family: var(--font-tibetan);
  font-size: 20px;
  font-weight: 600;
  color: var(--accent-deep);
  flex-shrink: 0;
  max-width: 100%;
  word-break: normal;
  overflow-wrap: break-word;
}
.entry-top .card-ipa {
  margin-left: 0;
  overflow-wrap: break-word;
}
.pos-badge {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 3px;
  background: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.card-gloss {
  font-size: 12.5px;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 3px 0;
}
.wylie { font-family: monospace; font-size: 11px; color: var(--muted); }
.card-ipa {
  font-family: var(--font-ipa);
  font-size: 12px;
  color: var(--blue);
  font-weight: 600;
  margin-left: 6px;
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
}
.card-example-preview {
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px dashed #e8eae1;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-example-preview .cep-bo {
  font-family: var(--font-tibetan);
  color: var(--accent);
  font-weight: 500;
  margin-right: 4px;
}
.card-example-preview .cep-zh {
  color: #555e50;
}

/* Draggable Splitter Handle */
.pane-resizer {
  width: 6px;
  cursor: col-resize;
  background: transparent;
  position: relative;
  transition: background 0.15s ease;
  z-index: 5;
  flex-shrink: 0;
  user-select: none;
}
.pane-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: var(--line);
  transition: all 0.15s ease;
}
.pane-resizer:hover, .pane-resizer.dragging {
  background: rgba(139, 30, 15, 0.08);
}
.pane-resizer:hover::after, .pane-resizer.dragging::after {
  background: var(--accent);
  width: 3px;
  left: 1.5px;
}
.workspace.focus-mode .pane-resizer {
  display: none;
}

/* Detail Pane - Maximized Screen Real Estate */
.detail-pane {
  padding: clamp(18px, 2vw, 32px) clamp(22px, 2.5vw, 44px);
  overflow-y: auto;
  height: 100%;
  max-height: none;
  background: #fff;
  min-width: 0;
  position: relative;
  box-sizing: border-box;
}
.exit-focus-btn {
  position: absolute;
  top: 12px;
  right: 20px;
  z-index: 50;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(139, 30, 15, 0.35);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.exit-focus-btn:hover {
  background: var(--accent-deep);
  box-shadow: 0 4px 14px rgba(139, 30, 15, 0.5);
  transform: translateY(-1px);
}
.exit-focus-btn.hidden {
  display: none !important;
}

.detail-kicker { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.register {
  font-size: 11px;
  color: var(--accent-deep);
  background: #fbf0eb;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 500;
}
.detail-title {
  font-family: var(--font-tibetan);
  font-size: 42px;
  line-height: 1.25;
  margin: 4px 0 10px;
  color: var(--accent-deep);
  display: flex;
  align-items: center;
  gap: 14px;
}
.detail-wylie { font-family: Georgia, serif; font-size: 14.5px; color: var(--muted); margin-bottom: 12px; }
.detail-meta { display: flex; gap: 8px; align-items: center; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.proper-noun-note {
  margin: 0 0 22px;
  padding: 12px 14px;
  border: 1px solid #e6d8c9;
  border-left: 3px solid var(--accent);
  background: #fffaf5;
  border-radius: 4px;
}
.proper-noun-note-head { display: flex; align-items: center; gap: 10px; }
.proper-noun-note-head .section-label { margin: 0; flex: 1; }
.proper-noun-category { font-size: 11px; color: var(--accent-deep); white-space: nowrap; }
.proper-noun-note-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 4px 0 8px; }
.proper-noun-note-grid div { min-width: 0; }
.proper-noun-note-grid dt { font-size: 10px; color: var(--muted); margin-bottom: 2px; }
.proper-noun-note-grid dd { margin: 0; color: var(--ink); font-size: 13px; overflow-wrap: anywhere; }
.proper-noun-note > p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.pos-pill {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: var(--ink);
  padding: 2px 8px;
  border-radius: 3px;
}

/* Sections */
.detail-section { margin-bottom: 30px; }
.section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after { content: ''; flex: 1; height: 1px; background: #e8eae2; }
.sense-row { display: flex; gap: 14px; margin-bottom: 12px; align-items: baseline; }
.sense-num {
  font-family: Georgia, serif;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  width: 16px;
}
.sense-content strong { font-size: 14.5px; color: var(--ink); }
.sense-content p { margin: 2px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.sense-head-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 5px 6px;
  margin-bottom: 2px;
}
.sense-tag-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
}
.sense-tag-religion { color: #8b1e0f; background: #fef2f2; border: 1px solid #fecaca; }
.sense-tag-dialect  { color: #0f766e; background: #f0fdfa; border: 1px solid #99f6e4; }
.sense-tag-vulgar   { color: #9f1239; background: #fff1f2; border: 1px solid #fecdd3; }
.sense-tag-archaic  { color: #4338ca; background: #eef2ff; border: 1px solid #c7d2fe; }
.sense-tag-meta     { color: #475569; background: #f8fafc; border: 1px solid #cbd5e1; }
.sense-source-note {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
  opacity: 0.85;
}

/* Dialect Grid */
.dialect-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dialect-card {
  border: 1px solid var(--line);
  background: #fafaf7;
  padding: 13px 15px;
  border-radius: 6px;
}
.dialect-name { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.dialect-ipa {
  font-family: var(--font-ipa);
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
  font-size: 17px;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dialect-card small { font-size: 10.5px; color: var(--muted); line-height: 1.5; display: block; }
.pending-text { font-size: 12px; color: #a4a89e; font-style: italic; margin-bottom: 6px; }
.ipa-missing { color: var(--muted); font-family: inherit; font-size: 11px; font-weight: 500; }
.dialect-card-empty { grid-column: 1 / -1; text-align: center; padding: 18px; }

/* Diachronic Mind Map Tree (Top-Down, No Emojis, Clean Alignments) */
.mindmap-tree { display: flex; flex-direction: column; position: relative; margin-top: 14px; }
.tree-level { position: relative; padding-left: 26px; margin-bottom: 16px; }
.tree-level::before { content: ''; position: absolute; left: 8px; top: 16px; bottom: -20px; width: 2px; background: #dedfd7; }
.tree-level:last-child::before { display: none; }
.tree-node-dot {
  position: absolute;
  left: 5px;
  top: 13px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  z-index: 2;
}
.tree-card {
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 16px;
}
.tree-card.root { background: #fdf5f2; border-color: #ebd0c6; }
.tree-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.tree-stage-name { font-size: 12px; font-weight: 700; color: var(--accent-deep); letter-spacing: 0.02em; }
.tree-time-tag { font-size: 10.5px; color: var(--muted); }
.tree-form-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.tree-reconstructed { font-family: Georgia, serif; font-size: 18px; font-weight: 600; color: var(--ink); }
.tree-ipa-badge {
  font-family: var(--font-ipa);
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "calt" 1;
  font-size: 13px;
  color: var(--blue);
  background: #fff;
  border: 1px solid #d8dad2;
  padding: 1px 7px;
  border-radius: 3px;
}
.tree-ref-text { font-size: 11px; color: #7f889b; margin-bottom: 6px; }
.tree-summary-text { font-size: 12px; line-height: 1.65; color: #3e423d; }
.cognates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #dedfd7;
}
.cognate-pill { background: #fff; border: 1px solid #e1e3db; border-radius: 4px; padding: 7px 10px; font-size: 11px; }
.cognate-lang { font-weight: 700; color: var(--muted); display: block; margin-bottom: 2px; }
.cognate-val { color: var(--accent-deep); font-weight: 600; }
.dialects-branch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }
.dialect-branch-card { background: #fff; border: 1px solid #e1e3db; border-radius: 5px; padding: 10px 12px; }
.dialect-branch-title { font-size: 11.5px; font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.dialect-branch-ipa { font-family: var(--font-ipa); letter-spacing: 0; font-feature-settings: "liga" 1, "calt" 1; font-size: 15px; color: var(--blue); margin-bottom: 4px; font-weight: 600; }
.dialect-branch-desc { font-size: 10.5px; color: var(--muted); line-height: 1.55; }

/* Organic Usage Section (Clean, Understandable, Academic Layout) */
.usage-section { margin-top: 28px; }
.usage-box {
  background: #fafaf7;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 20px;
  margin-bottom: 14px;
}
.usage-box-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: 0.04em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* Case Inflection Grid */
.case-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.case-card {
  background: #fff;
  border: 1px solid #e1e3db;
  border-radius: 5px;
  padding: 10px 12px;
}
.case-card-label { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.case-card-tib { font-family: var(--font-tibetan); font-size: 18px; font-weight: 600; color: var(--accent-deep); margin-bottom: 2px; }
.case-card-ipa { font-family: var(--font-ipa); letter-spacing: 0; font-feature-settings: "liga" 1, "calt" 1; font-size: 12.5px; color: var(--blue); margin-bottom: 4px; }
.case-card-desc { font-size: 10.5px; color: #4a5043; line-height: 1.5; }
.case-rule-note {
  background: #f7f7f3;
  border-left: 3px solid var(--gold);
  padding: 8px 12px;
  font-size: 11.5px;
  color: #555c4f;
  line-height: 1.6;
  margin-top: 8px;
  border-radius: 0 4px 4px 0;
}

/* Honorific & Syntax Info Boxes */
.honorific-box {
  background: #fff;
  border: 1px solid #e8e9e1;
  border-radius: 5px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.7;
  color: #2d3748;
}
.syntax-box {
  background: #fff;
  border: 1px solid #e8e9e1;
  border-radius: 5px;
  padding: 10px 14px;
  font-size: 12px;
  line-height: 1.7;
  color: #2d3748;
}

/* Authentic Collocation Cards */
.colloc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 12px;
  margin-top: 10px;
}
.colloc-card {
  background: #fff;
  border: 1px solid #e1e3db;
  border-radius: 6px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.colloc-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.colloc-phrase { font-family: var(--font-tibetan); font-size: 17px; font-weight: 700; color: var(--accent-deep); }
.colloc-ipa { font-family: var(--font-ipa); letter-spacing: 0; font-feature-settings: "liga" 1, "calt" 1; font-size: 12px; color: var(--blue); }
.colloc-mean { font-size: 12px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.colloc-ex {
  background: #f8f8f5;
  border-left: 2px solid #d6d7cf;
  padding: 6px 10px;
  border-radius: 0 4px 4px 0;
  font-size: 11.5px;
  line-height: 1.6;
}
.colloc-ex-tib { font-family: var(--font-tibetan); font-size: 13.5px; color: #1e251d; margin-bottom: 2px; }
.colloc-ex-zh { color: var(--muted); }

/* Example Sentences & Word-Level Tokens */
.example {
  background: #fafaf7;
  border: 1px solid var(--line);
  padding: 18px 20px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.example-tib {
  font-family: var(--font-tibetan);
  font-size: 22px;
  line-height: 2.2;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.tib-token {
  display: inline-block;
  padding: 1px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: all .12s ease;
  border-bottom: 1.5px solid transparent;
}
.tib-token:hover {
  background: #fdede6;
  border-bottom-color: var(--accent);
  color: var(--accent-deep);
}
.tib-token.target-word {
  font-weight: 700;
  color: var(--accent-deep);
  background: #fbf0eb;
  border-bottom-color: var(--accent);
}
.tsheg { color: #a7aaa3; user-select: none; font-size: 16px; margin: 0 1px; }
.inflection-card {
  background: #fff;
  border: 1px solid #e1e3db;
  border-left: 3px solid var(--accent);
  padding: 7px 12px;
  border-radius: 0 4px 4px 0;
  margin: 8px 0;
  font-size: 12px;
  line-height: 1.6;
  color: #3e423d;
}
.inflection-label { font-weight: 700; color: var(--accent-deep); margin-right: 6px; }
.example-ipa { font-family: var(--font-ipa); letter-spacing: 0; font-feature-settings: "liga" 1, "calt" 1; font-size: 13px; color: var(--blue); margin: 6px 0; letter-spacing: 0.02em; }
.example-zh { font-size: 13.5px; line-height: 1.65; color: #2d3748; }
.example-citation {
  display: inline;
  color: #8a99ad;
  font-size: 11px;
  font-weight: 400;
  margin-left: 8px;
  font-style: normal;
}
.vocab-jump-row {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #dedfd7;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.vocab-jump-label { font-size: 11px; color: var(--muted); margin-right: 4px; }
.vocab-chip {
  background: #fff;
  border: 1px solid #dcdfd5;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 11px;
  font-family: var(--font-tibetan);
  color: var(--accent-deep);
  cursor: pointer;
  transition: all .12s ease;
}
.vocab-chip:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.vocab-chip.current { background: #fdf2ed; border-color: #eed5c9; cursor: default; }

/* Floating Hover Preview Card (Popover) */
.lex-popover {
  position: absolute;
  background: #fff;
  border: 1px solid #d9d9d0;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  padding: 12px 15px;
  z-index: 2000;
  width: 290px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink);
  pointer-events: auto;
  transition: opacity .15s ease;
}
.lex-popover.hidden { display: none; }
.lex-popover-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid #f0f0eb;
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.lex-popover-word { font-family: var(--font-tibetan); font-size: 20px; font-weight: 700; color: var(--accent-deep); }
.lex-popover-wylie { font-size: 11px; color: var(--muted); font-family: monospace; }
.lex-popover-ipa { font-family: var(--font-ipa); letter-spacing: 0; font-feature-settings: "liga" 1, "calt" 1; color: var(--blue); font-size: 13px; margin-bottom: 6px; }
.lex-popover-tag {
  display: inline-block;
  background: #fbf0eb;
  color: var(--accent-deep);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 6px;
}
.lex-popover-desc { font-size: 11px; color: #4a5043; line-height: 1.6; margin-bottom: 10px; }
.lex-popover-actions { display: flex; gap: 6px; border-top: 1px solid #f4f4ee; padding-top: 8px; }
.lex-popover-btn {
  flex: 1;
  background: #f7f7f3;
  border: 1px solid #deded7;
  border-radius: 4px;
  padding: 5px 6px;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  color: var(--ink);
  transition: all .15s ease;
}
.lex-popover-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Audio Button & Toast */
.audio-btn {
  background: #fdf2ed;
  border: 1px solid #ebd0c6;
  color: var(--accent-deep);
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  margin-left: 8px;
  transition: all .15s ease;
  vertical-align: middle;
  line-height: 1.2;
}
.audio-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.audio-btn.playing { background: var(--accent-deep); color: #fff; }
.audio-ipa-only-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  color: var(--muted, #78716c);
  background: #f5f2ec;
  border: 1px solid #e2dbd0;
  border-radius: 4px;
  padding: 2px 7px;
  margin-left: 8px;
  vertical-align: middle;
  line-height: 1.25;
  cursor: default;
  user-select: none;
}

.dialect-field-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #64748b;
}
.dialect-field-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #334155;
}
.audio-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #2d3748;
  color: #fff;
  padding: 12px 18px;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.22);
  z-index: 9999;
  opacity: 0;
  transform: translateY(14px);
  transition: all .25s cubic-bezier(0.16,1,0.3,1);
  pointer-events: none;
  max-width: 380px;
}
.audio-toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.audio-toast b { color: #ebd0c6; }

/* Grammar Guide Modal */
.grammar-modal {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 20px 70px rgba(0,0,0,0.3);
  padding: 0;
  max-width: 1050px;
  width: calc(100vw - 60px);
  height: min(850px, calc(100vh - 60px));
  overflow: hidden;
  background: #fff;
}
.grammar-modal-content { display: flex; flex-direction: column; height: 100%; }
.grammar-modal-header {
  background: #fbfbf8;
  border-bottom: 1px solid var(--line);
  padding: 16px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.grammar-header-title { display: flex; align-items: center; gap: 14px; }
.grammar-glyph {
  font-family: var(--font-tibetan);
  font-size: 32px;
  color: var(--accent);
  padding-right: 14px;
  border-right: 1px solid var(--line);
}
.grammar-header-title h2 { margin: 0; font-size: 20px; font-family: Georgia, 'Noto Serif SC', serif; }
.grammar-header-title p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.grammar-close-btn { border: 0; background: transparent; font-size: 28px; color: var(--muted); cursor: pointer; }
.grammar-close-btn:hover { color: var(--accent); }
.grammar-modal-body { display: grid; grid-template-columns: 260px 1fr; flex: 1; overflow: hidden; }
.grammar-sidebar { border-right: 1px solid var(--line); background: #fafaf7; padding: 20px 14px; overflow-y: auto; }
.grammar-nav-label { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: 0.08em; display: block; margin-bottom: 10px; padding-left: 6px; }
.grammar-nav-btn {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: all .15s ease;
}
.grammar-nav-btn span { font-size: 12px; font-weight: 600; color: var(--ink); }
.grammar-nav-btn em { font-style: normal; font-family: var(--font-tibetan); font-size: 11px; color: var(--muted); }
.grammar-nav-btn:hover { background: #eee; }
.grammar-nav-btn.active { background: #fff; border-color: #d6d7cf; box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.grammar-nav-btn.active span { color: var(--accent-deep); }
.grammar-article { padding: 28px 36px; overflow-y: auto; }
.grammar-topic-badge { display: inline-block; background: #fdf2ed; color: var(--accent-deep); font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 3px; margin-bottom: 6px; }
.grammar-topic-h1 { font-family: Georgia, 'Noto Serif SC', serif; font-size: 24px; margin: 0 0 8px; color: var(--ink); }
.grammar-topic-desc { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0 0 24px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.grammar-sec-box { margin-bottom: 24px; }
.grammar-sec-title { font-size: 15px; font-weight: 700; color: var(--ink); margin: 0 0 10px; padding-left: 8px; border-left: 3px solid var(--accent); }
.grammar-sec-body { font-size: 13px; line-height: 1.75; color: #2d3748; }
.grammar-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 12px; }
.grammar-table th, .grammar-table td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.grammar-table th { background: #fafaf7; color: var(--muted); font-weight: 600; }
.grammar-table td strong { font-family: var(--font-tibetan); font-size: 15px; color: var(--accent-deep); }
.grammar-note { background: #fafaf7; border-left: 3px solid var(--gold); padding: 8px 12px; margin: 10px 0; font-size: 12px; color: var(--muted); line-height: 1.6; }

/* Search Suggestions */
.search-wrapper { position: relative; width: 100%; }
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: -20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
  z-index: 1000;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 0;
}
.search-suggestions.hidden { display: none; }
.suggestion-item {
  padding: 9px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid #f4f4ee;
  transition: background .12s ease;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover, .suggestion-item.active { background: #fdf2ed; }
.suggestion-top { display: flex; justify-content: space-between; align-items: baseline; }
.suggestion-tibetan { font-family: var(--font-tibetan); font-size: 18px; font-weight: 600; color: var(--accent-deep); }
.suggestion-wylie { font-size: 11px; color: var(--muted); font-family: monospace; }
.suggestion-gloss { font-size: 12px; color: var(--ink); line-height: 1.4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion-match { background: #ffe3d1; color: var(--accent-deep); font-weight: 700; border-radius: 2px; padding: 0 2px; }
.suggestion-empty { padding: 14px; font-size: 12px; color: var(--muted); text-align: center; }

/* Dialogs */
.source-line { color: #999b94; font-size: 10px; line-height: 1.6; margin-top: 21px; }
.dialog-inner { width: min(620px, calc(100vw - 40px)); padding: 34px; }
.close-dialog { float: right; border: 0; background: transparent; font-size: 24px; color: var(--muted); cursor: pointer; }
.dialog-inner h2 { font: 500 28px Georgia; margin: 9px 0 15px; }
.dialog-inner p { font-size: 13px; line-height: 1.8; color: var(--muted); }
.method-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0; }
.method-grid div { border: 1px solid var(--line); padding: 13px; border-radius: 4px; }
.method-grid strong { display: block; font-size: 12px; color: var(--ink); margin-bottom: 5px; }
.method-grid span { font-size: 11px; color: var(--muted); line-height: 1.5; }
.small-note { font-size: 11px!important; border-top: 1px solid var(--line); padding-top: 14px; }
dialog { border: 0; border-radius: 8px; box-shadow: 0 15px 60px rgba(0,0,0,0.18); padding: 0; }
dialog::backdrop { background: rgba(21, 23, 19, 0.45); }

/* Example Sentence Header & Audio Playback */
.example-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}
.ex-audio-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid #dcded4;
  background: #ffffff;
  color: #4a5043;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.ex-audio-btn:hover {
  background: #fdf2ed;
  border-color: var(--accent);
  color: var(--accent-deep);
}
.ex-audio-btn.playing {
  background: #fdf2ed;
  border-color: var(--accent);
  color: var(--accent-deep);
  box-shadow: 0 0 0 2px rgba(184, 61, 39, 0.15);
}

/* Grammar Jump Link Badges */
.grammar-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--accent-deep);
  background: #fdf5f2;
  border: 1px solid #fed7cc;
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.12s ease;
  margin-left: 8px;
}
.grammar-jump-btn:hover {
  background: #fde8e1;
  color: #722011;
  border-color: #fca58f;
}

/* Grammar Guide to Dictionary Link */
.grammar-dict-link {
  display: inline-block;
  color: var(--accent-deep);
  font-weight: 600;
  border-bottom: 1.5px dashed var(--accent);
  cursor: pointer;
  padding: 0 2px;
  transition: all 0.12s ease;
}
.grammar-dict-link:hover {
  background: #fdf2ed;
  border-bottom-style: solid;
}

/* Category Toolbar & Random Learn */
.category-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.category-mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  background: #f1f3ee;
  border-radius: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  width: 100%;
}
.cat-mode-btn {
  text-align: center;
  border: none;
  background: transparent;
  padding: 6px 4px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cat-mode-btn.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.random-learn-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #fdf5f2;
  border: 1px solid #fed7cc;
  color: var(--accent-deep);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(184, 61, 39, 0.05);
  width: 100%;
}
.random-learn-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(184, 61, 39, 0.2);
}

/* Sticky Jump Return Navigation Bar */
.jump-return-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fffaf5;
  border: 1px solid #fbd38d;
  border-left: 4px solid #dd6b20;
  border-radius: 6px;
  padding: 9px 14px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(221, 107, 32, 0.08);
  animation: slideInDown 0.2s ease-out;
}
@keyframes slideInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.jump-return-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.jump-return-badge {
  display: inline-block;
  background: #feebc8;
  color: #7b341e;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.jump-return-text {
  color: var(--ink);
}
.jump-return-text strong {
  font-family: var(--font-tibetan);
  font-size: 14px;
  color: var(--accent);
  margin: 0 3px;
}
.jump-return-gloss {
  color: var(--muted);
  font-size: 11.5px;
}
.jump-return-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #c05621;
  color: #ffffff;
  border: none;
  border-radius: 4px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(192, 86, 33, 0.3);
  letter-spacing: 0.01em;
}
.jump-return-btn:hover {
  background: #9c4221;
  box-shadow: 0 2px 6px rgba(192, 86, 33, 0.4);
  transform: translateY(-1px);
}
.jump-return-btn svg {
  flex-shrink: 0;
}

/* Lexical Network (Synonyms, Antonyms, Associations) */
.lexical-network-section {
  background: #fbfbf9;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  margin-top: 20px;
}
.lex-net-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 10px;
}
.lex-net-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lex-net-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--slate);
  letter-spacing: 0.04em;
}
.lex-net-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}
.lex-net-dot.cls { background: var(--blue); }
.lex-net-dot.syn { background: #0284c7; }
.lex-net-dot.ant { background: #e11d48; }
.lex-net-dot.assoc { background: #d97706; }

.lex-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.lex-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 12px;
  color: var(--ink);
  text-align: left;
}
.lex-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.lex-chip .chip-lemma {
  font-family: var(--font-tibetan);
  font-size: 14px;
  font-weight: 600;
}
.lex-chip .chip-ipa {
  font-family: var(--font-ipa);
  font-size: 11.5px;
  color: var(--blue);
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "calt" 1;
}
.lex-chip .chip-gloss {
  font-size: 11px;
  color: var(--muted);
}
.sense-syn-ref {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 4px;
}
.sense-syn-badge {
  font-size: 11px;
  font-weight: 600;
  color: #9a3412;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 4px;
  padding: 1px 7px;
  white-space: nowrap;
}
.sense-syn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #fffbeb;
  border: 1px solid #f5d08a;
  border-radius: 5px;
  padding: 3px 9px;
  cursor: pointer;
  color: var(--ink);
  font-size: 12.5px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.sense-syn-link:hover {
  background: #fef3c7;
  border-color: #d97706;
}
.sense-syn-bo {
  font-family: var(--font-tibetan);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-deep);
}
.sense-syn-ipa {
  font-family: var(--font-ipa);
  font-size: 12px;
  color: var(--blue);
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "calt" 1;
}
.sense-syn-zh {
  font-size: 12px;
  color: var(--muted);
}
.lex-chip .chip-tag {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 2px;
}

/* Same-Category Companion Chip (Slate Ocean Blue) */
.cls-chip {
  border-left: 3px solid var(--blue);
}
.cls-chip:hover {
  border-color: var(--blue);
  background: #f0f6fa;
}
.cls-chip .chip-lemma { color: #1d4460; }
.cls-chip .chip-tag {
  background: #e3eff7;
  color: #1d4460;
}

/* Synonyms Chip (Sky Blue) */
.syn-chip {
  border-left: 3px solid #0284c7;
}
.syn-chip:hover {
  border-color: #0284c7;
  background: #f0f9ff;
}
.syn-chip .chip-lemma { color: #0369a1; }

/* Antonyms Chip (Rose Red) */
.ant-chip {
  border-left: 3px solid #e11d48;
}
.ant-chip:hover {
  border-color: #e11d48;
  background: #fff1f2;
}
.ant-chip .chip-lemma { color: #be123c; }

/* Associations Chip (Amber) */
.assoc-chip {
  border-left: 3px solid #d97706;
}
.assoc-chip:hover {
  border-color: #d97706;
  background: #fffbeb;
}
.assoc-chip .chip-lemma { color: #b45309; }
.assoc-chip .chip-tag {
  background: #fef3c7;
  color: #92400e;
}

/* Domain Pill in Detail Meta */
.domain-pill {
  font-size: 11px;
  font-weight: 600;
  color: #1d4460;
  background: #edf5fa;
  border: 1px solid #c2d9e8;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.domain-pill:hover {
  background: #e0e7ff;
}

/* Domain Tag on List Cards */
.card-bottom-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: 4px;
}
.domain-tag {
  display: none !important;
}

/* Verified Dialect Pronunciation Badge */
.verified-status-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #854d0e;
  background: #fefce8;
  border: 1px solid #fef08a;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.02em;
}
.dialect-card.verified-card {
  border-color: #cbd5e1;
  background: #f8fafc;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}
.verified-source-note {
  display: block;
  color: #475569;
  font-size: 10.5px;
  margin-top: 6px;
  line-height: 1.4;
  border-top: 1px dashed #e2e8f0;
  padding-top: 4px;
}

/* Collocation Jump Button */
.colloc-jump-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 3px;
  font-size: 10px;
  padding: 2px 6px;
  cursor: pointer;
  color: var(--ink);
  transition: all .15s ease;
  margin-left: auto;
}
.colloc-jump-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Enhanced Popover Meta & Gloss */
.lex-popover-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.lex-popover-pos {
  font-size: 10px;
  font-weight: 700;
  color: #475569;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
}
.lex-popover-gloss {
  font-size: 11.5px;
  color: #1e293b;
  margin-bottom: 6px;
  line-height: 1.5;
  background: #fafaf9;
  padding: 4px 6px;
  border-radius: 3px;
  border-left: 2px solid var(--accent);
}

/* ==================== PRAMĀṆA & MONASTIC TEXTBOOK MODULE ==================== */
.pramana-textbook-section {
  border: 1px solid #e7ded4;
  background: #fffcf9;
  border-radius: 8px;
  padding: 16px 18px;
  margin-top: 18px;
  margin-bottom: 24px;
  box-shadow: 0 2px 8px rgba(139, 30, 15, 0.04);
}

.pramana-banner {
  background: linear-gradient(135deg, #8b1e0f 0%, #6f160a 100%);
  border-radius: 6px;
  padding: 12px 16px;
  color: #ffffff;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(111, 22, 10, 0.15);
}

.pramana-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.pramana-badge {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #fde8db;
  display: flex;
  align-items: center;
}

.pramana-stage-tag {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.03em;
}

.pramana-stage-desc {
  margin-top: 8px;
  font-size: 12.5px;
  line-height: 1.6;
  color: #fdf2e9;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 8px;
}

.pramana-card {
  background: #ffffff;
  border: 1px solid #eadfd4;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.pramana-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid #f2e9e1;
  padding-bottom: 6px;
}

/* 1. Canonical Definition */
.canonical-def-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.canonical-tibetan {
  font-family: var(--font-tibetan);
  font-size: 21px;
  line-height: 1.5;
  color: #1e293b;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.canonical-wylie {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #64748b;
  margin-bottom: 4px;
}

.canonical-trans {
  background: #fdfaf6;
  border-left: 3px solid var(--gold);
  padding: 8px 12px;
  border-radius: 0 4px 4px 0;
  margin-bottom: 4px;
}

.canonical-zh {
  font-size: 13.5px;
  line-height: 1.6;
  color: #1e293b;
}

.canonical-en {
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  margin-top: 4px;
  font-style: italic;
}

.canonical-source {
  font-size: 11.5px;
  color: #78350f;
  background: #fef8ee;
  border: 1px solid #fde68a;
  padding: 5px 10px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  line-height: 1.45;
}

.canonical-analysis {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 10px 12px;
  margin-top: 4px;
}

.analysis-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}

.analysis-body {
  font-size: 12.5px;
  line-height: 1.7;
  color: #334155;
  white-space: pre-line;
}

/* 2. Dialectic Syllogism Canvas */
.syllogism-formula-box {
  background: #fbf7f4;
  border: 1px solid #eedfd3;
  border-radius: 5px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.syllogism-tibetan {
  font-family: var(--font-tibetan);
  font-size: 19px;
  line-height: 1.5;
  color: var(--accent-deep);
  font-weight: 600;
  margin-bottom: 4px;
}

.syllogism-wylie {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 6px;
}

.syllogism-zh {
  font-size: 13px;
  font-weight: 500;
  color: #1e293b;
  line-height: 1.55;
  border-top: 1px dashed #eedfd3;
  padding-top: 6px;
}

.syllogism-tripartite-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 768px) {
  .syllogism-tripartite-grid {
    grid-template-columns: 1fr;
  }
}

.tripartite-col {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  padding: 8px 10px;
}

.tripartite-col .col-header {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid #f1f5f9;
}

.tripartite-col.subject-col {
  border-top: 3px solid #2a5a7b;
}

.tripartite-col.predicate-col {
  border-top: 3px solid var(--accent);
}

.tripartite-col.reason-col {
  border-top: 3px solid var(--gold);
}

.tripartite-col .col-content {
  font-size: 12px;
  color: #1e293b;
  line-height: 1.5;
  font-weight: 500;
}

/* Debate Response Paths */
.debate-responses-container {
  background: #fdfbf7;
  border: 1px solid #edd5be;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 12px;
}

.responses-headline {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.responses-headline span {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-deep);
}

.responses-note {
  font-size: 11px;
  color: #78716c;
}

.responses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.response-card {
  background: #ffffff;
  border: 1px solid #ded6cc;
  border-radius: 5px;
  padding: 8px 10px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.response-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(139, 30, 15, 0.08);
}

.resp-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 5px;
}

.resp-tibetan {
  font-family: var(--font-tibetan);
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 3px;
}

.resp-zh {
  font-size: 11.5px;
  font-weight: 700;
  color: #334155;
}

.resp-condition {
  font-size: 11.5px;
  line-height: 1.55;
  color: #475569;
}

.debate-insight-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 3px solid var(--slate);
  border-radius: 4px;
  padding: 10px 12px;
  margin-top: 10px;
}

.insight-label {
  font-size: 11px;
  font-weight: 700;
  color: #1e293b;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.insight-content {
  font-size: 12px;
  line-height: 1.6;
  color: #334155;
}

/* 3. Cultural & Intellectual History */
.history-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 860px) {
  .history-grid {
    grid-template-columns: 1fr;
  }
}

.history-card-item {
  background: #faf8f5;
  border: 1px solid #e7ded4;
  border-radius: 5px;
  padding: 10px 12px;
}

.hist-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
  border-bottom: 1px solid #ece4da;
  padding-bottom: 4px;
}

.history-card-item p {
  font-size: 11.5px;
  line-height: 1.65;
  color: #334155;
  margin: 0;
}



/* ==================== INTERLINEAR SENTENCE CONSTITUENTS & GRAMMAR CARDS ==================== */

/* Interlinear Sentence Layout */
.interlinear-sentence {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 6px 4px;
  line-height: 1.3;
  margin: 6px 0 10px;
}

.interlinear-token {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  vertical-align: bottom;
  padding: 1px 2px;
}

.interlinear-token .token-word {
  font-family: var(--font-tibetan);
  font-size: 20px;
  color: var(--ink);
  cursor: pointer;
  padding: 0 2px;
  border-radius: 3px;
  transition: all 0.12s ease;
  line-height: 1.2;
}

.interlinear-token .token-word:hover {
  background: #fbf0eb;
  color: var(--accent);
}

.interlinear-token .token-word.target-word {
  font-weight: 700;
  color: var(--accent-deep);
  background: #fbf0eb;
  border-bottom: 2px solid var(--accent);
}

.interlinear-tsheg {
  font-family: var(--font-tibetan);
  font-size: 16px;
  color: #94a3b8;
  user-select: none;
  margin-left: -1px;
}

/* Fine-Print Constituent Role Badges */
.token-sub-role {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.1;
  padding: 1px 4px;
  border-radius: 3px;
  margin-top: 3px;
  white-space: nowrap;
  letter-spacing: 0.02em;
  user-select: none;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.token-sub-role:hover {
  transform: translateY(-1px);
}

/* Academic Color Schemes for Sentence Constituents (Strictly Zero Green) */
.role-agent {
  color: #9a3412; /* Warm Ochre/Amber */
  background: #fff7ed;
  border: 1px solid #fed7aa;
}

.role-patient {
  color: #0369a1; /* Sky / Ocean Blue */
  background: #f0f9ff;
  border: 1px solid #bae6fd;
}

.role-locative {
  color: #1d4460; /* Slate Ocean Blue */
  background: #edf5fa;
  border: 1px solid #c2d9e8;
}

.role-origin {
  color: #7c2d12; /* Deep Ochre / Rust (Zero Green) */
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.role-verb {
  color: #9f1239; /* Deep Crimson / Rose */
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.role-evidential {
  color: #854d0e; /* Burnished Gold/Amber */
  background: #fefce8;
  border: 1px solid #fde047;
}

.role-topic {
  color: #6b21a8; /* Muted Violet */
  background: #faf5ff;
  border: 1px solid #e9d5ff;
}

.role-particle {
  color: #475569; /* Slate Grey */
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
}

/* ==================== PER-SENTENCE SYNTAX & EVIDENTIALITY CARD ==================== */
.sentence-grammar-card {
  background: #fffaf5;
  border: 1px solid #fed7aa;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 10px 0 14px;
  box-shadow: 0 1px 4px rgba(139, 30, 15, 0.04);
}

.sgc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #fed7aa;
}

.sgc-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-deep);
  text-transform: uppercase;
}

.sgc-pattern-pill {
  font-size: 11px;
  font-weight: 600;
  background: #fbf0eb;
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid #f5d0c5;
}

.sgc-evid-block {
  background: #ffffff;
  border: 1px solid #fde68a;
  border-radius: 5px;
  padding: 12px 14px;
  margin-bottom: 8px;
}

.sgc-evid-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12.5px;
  color: #92400e;
  padding-bottom: 6px;
  border-bottom: 1px dashed #fef3c7;
}

.sgc-evid-title strong {
  color: #78350f;
}

.sgc-evid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 10px 14px;
  margin-top: 10px;
}

.sgc-evid-item {
  background: #fdfbf7;
  border: 1px solid #fef3c7;
  border-radius: 4px;
  padding: 8px 10px;
}

.sgc-full-item {
  grid-column: 1 / -1;
}

.sgc-item-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 3px;
}

.sgc-item-text {
  font-size: 11.8px;
  color: #374151;
  line-height: 1.6;
}

.sgc-roles-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.sgc-role-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 2px 7px;
  color: #374151;
}

.sgc-role-item strong {
  color: var(--accent-deep);
  font-family: var(--font-tibetan);
}

.sgc-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #ffedd5;
  border-radius: 4px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.sgc-jump-btn:hover {
  background: #ffedd5;
  color: #7c2d12;
  border-color: #fed7aa;
}

/* ==================== IMPLICIT MICRO-DOMAIN BADGES & RELATED VOCABULARY ==================== */
.micro-field-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fdf6ec;
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  margin-left: 8px;
  letter-spacing: 0.02em;
}

.related-vocab-section {
  background: #fbfbf9;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  margin-top: 18px;
}

.related-vocab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.related-vocab-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 6px;
}

.related-vocab-domain-name {
  color: var(--accent);
  font-weight: 600;
}

.related-vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
}

.related-vocab-chip {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #e2e4dc;
  border-radius: 5px;
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: left;
}

.related-vocab-chip:hover {
  border-color: var(--accent);
  background: #fffaf7;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(139, 30, 15, 0.08);
}

.related-vocab-tib {
  font-family: var(--font-tibetan);
  font-size: 16px;
  font-weight: 600;
  color: var(--accent-deep);
  line-height: 1.3;
}

.related-vocab-gloss {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}


/* Headword Strict Lhasa IPA Badge */
.headword-lemma {
  font-family: var(--font-tibetan);
  font-size: 38px;
  line-height: 1.2;
  color: var(--accent-deep);
}
.headword-lhasa-ipa {
  font-family: var(--font-ipa);
  font-feature-settings: "liga" 1, "calt" 1;
  font-size: 16px;
  font-weight: 600;
  color: var(--blue);
  background-color: #f0f5fa;
  border: 1px solid #d4e0eb;
  border-radius: 6px;
  padding: 3px 10px;
  letter-spacing: 0.5px;
  vertical-align: middle;
  align-self: center;
}

/* Example Sentence Flowing & Interactive Interlinear Constituents */
.example-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 8px;
}

.example-tib {
  flex: 1;
}

.interlinear-sentence {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 8px;
  line-height: 2.2;
}

.interlinear-token {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  background: #faf8f5;
}

/* Flowing Unbroken Example Sentence (Natural Continuous Typography) */
.flowing-sentence {
  font-family: var(--font-tibetan);
  font-size: 21px;
  line-height: 2.1;
  color: #1e293b;
  margin-bottom: 12px;
  padding: 10px 14px;
  background: #fbf9f5;
  border-radius: 6px;
  border-left: 4px solid #b45309;
  letter-spacing: 0.01em;
  word-break: normal;
  overflow-wrap: break-word;
  user-select: text;
}

/* 藏文正字法音节防截断保护：严禁在单个音节内部折行（仅允许在 ་/། 后换行） */
.tib-syl {
  white-space: nowrap;
}

.sentence-word.stem-before-enclitic {
  padding-right: 0;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.sentence-word.enclitic-word {
  padding-left: 0;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.sentence-word {
  display: inline;
  cursor: pointer;
  position: relative;
  padding: 2px 2px;
  border-radius: 3px;
  transition: all 0.15s ease;
  color: #1e293b;
}

.sentence-word:hover {
  background: #f1f5f9;
  color: #9a3412;
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
}

.sentence-word.target-word {
  font-weight: 700;
  color: #991b1b;
  border-bottom: 2px solid #b91c1c;
}

.sentence-punct {
  font-family: var(--font-tibetan);
  font-size: 21px;
  color: #64748b;
  margin: 0 1px;
}

/* Hover Mini-Card Popover */
.lex-popover {
  position: absolute;
  z-index: 99999;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-top: 3px solid #b45309;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.14), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 12px 15px;
  max-width: 360px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1e293b;
  animation: popoverFadeIn 0.15s ease-out;
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.lex-popover.hidden {
  display: none !important;
}

.lex-popover-header {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 8px;
}

.lex-popover-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lex-popover-word {
  font-family: var(--font-tibetan);
  font-size: 22px;
  font-weight: 600;
  color: #0f172a;
}

.lex-popover-ipa {
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}

.lex-popover-pos {
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 1px 6px;
  border-radius: 4px;
}

.lex-popover-wylie {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.lex-popover-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.lex-popover-row {
  font-size: 12px;
  line-height: 1.5;
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}

.popover-row-label {
  font-weight: 700;
  color: #78350f;
  flex-shrink: 0;
}

.popover-role-pill {
  font-weight: 600;
  font-size: 11px;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 1px 5px;
  border-radius: 3px;
}

.popover-row-val {
  color: #334155;
}

.lex-popover-actions {
  display: flex;
  gap: 8px;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
}

.lex-popover-btn {
  flex: 1;
  padding: 5px 8px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: center;
}

.lex-popover-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

.lex-popover-btn.grammar-btn {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.lex-popover-btn.grammar-btn:hover {
  background: #ffedd5;
  border-color: #fdba74;
}

/* Verb Morphology Card (4-Tense Matrix) */
.verb-morphology-card {
  background: #fcf9f5;
  border: 1px solid #ede1d3;
  border-radius: 8px;
  padding: 14px 16px;
  margin: 14px 0;
}

.vmc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eedecb;
}

.vmc-title {
  font-size: 13px;
  font-weight: 700;
  color: #78350f;
  letter-spacing: 0.03em;
}

.vmc-transitivity {
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #fde68a;
  transition: all 0.15s ease;
}

.vmc-transitivity.tag-transitive {
  color: #991b1b;
  background: #fef2f2;
  border-color: #fecaca;
}

.vmc-transitivity.tag-intransitive {
  color: #0369a1;
  background: #f0f9ff;
  border-color: #bae6fd;
}

.vmc-transitivity.tag-neutral {
  color: #475569;
  background: #f8fafc;
  border-color: #e2e8f0;
}

.vmc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.vmc-cell {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.12s ease;
}

.vmc-cell:hover {
  border-color: #b45309;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.1);
  transform: translateY(-1px);
}

.vmc-cell-label {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 3px;
}

.vmc-cell-word {
  font-family: var(--font-tibetan);
  font-size: 20px;
  color: #0f172a;
  font-weight: 500;
}

.vmc-cell-tag {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 2px;
}

.vmc-syntax-rule {
  margin-top: 10px;
  font-size: 12.5px;
  color: #334155;
  line-height: 1.65;
  background: #fdfbf7;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #f1e9dc;
}

.vmc-syntax-rule strong {
  color: #0f172a;
  font-weight: 600;
}

/* 8-Case Nominal Declension Card (Collapsible) */
.declension-card {
  background: #faf7f2;
  border: 1px solid #ede4d6;
  border-radius: 8px;
  margin: 14px 0;
  overflow: hidden;
}

.declension-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  background: #f7f0e4;
  transition: background 0.12s ease;
}

.declension-header:hover {
  background: #f0e6d6;
}

.declension-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.declension-title {
  font-size: 13px;
  font-weight: 700;
  color: #78350f;
}

.declension-sub {
  font-size: 11px;
  color: #92400e;
}

.declension-toggle-icon {
  font-size: 11.5px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #fde68a;
}

.declension-body {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
}

.declension-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
  background: #ffffff;
}

.declension-table th {
  background: #f7f0e4;
  color: #78350f;
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
  border-bottom: 2px solid #ede4d6;
  font-size: 12px;
  letter-spacing: 0.03em;
}

.declension-table th.col-center,
.declension-table td.col-center {
  text-align: center;
  vertical-align: middle;
}

.declension-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  vertical-align: middle;
  line-height: 1.5;
}

.declension-table tbody tr:nth-child(even) {
  background: #fcfbf9;
}

.declension-table tbody tr:hover {
  background: #f9f5ee;
}

.declension-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 3px;
}

.tibetan-sub-label {
  font-family: var(--font-tibetan);
  font-size: 13px;
  color: #78350f;
  margin-top: 1px;
}

.case-status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: #78350f;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.case-role-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
}

.declension-form-cell {
  text-align: center;
  vertical-align: middle;
}

.declension-word-pill {
  cursor: pointer;
  display: inline-block;
  font-family: var(--font-tibetan);
  font-size: 24px !important;
  font-weight: 500;
  line-height: 1.5;
  color: #0f172a;
  padding: 3px 10px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.declension-word-pill:hover {
  color: #92400e;
  background: #fef3c7;
  border-color: #fde68a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.declension-particle-badge {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.declension-example-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
}

.declension-example-tib {
  font-family: var(--font-tibetan);
  font-size: 15px;
  color: #1e293b;
  line-height: 1.6;
  word-break: break-word;
}

.declension-example-tib strong {
  color: #b45309;
  font-weight: 700;
  background: #fef3c7;
  padding: 1px 4px;
  border-radius: 3px;
}

.declension-example-zh {
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}

.declension-example-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.declension-citation-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 3px;
  padding: 1px 6px;
  white-space: nowrap;
}

.declension-desc-sub {
  font-size: 11px;
  color: #64748b;
  line-height: 1.4;
}

/* Matched Inflection in Search Results */
.matched-inflection-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 1px 5px;
  border-radius: 3px;
  margin-top: 3px;
}

/* Organic Syntax Pattern Cards & Argument Structure */
.syntax-intro-box {
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  margin-bottom: 12px;
  border-radius: 0 4px 4px 0;
}
.syntax-intro-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 4px;
}
.syntax-intro-text {
  font-size: 12px;
  color: #334155;
  line-height: 1.6;
}
.syntax-pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
  margin-top: 12px;
}
.syntax-pattern-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.syntax-pattern-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
  border-color: #cbd5e1;
}
.syntax-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}
.syntax-card-badge {
  font-size: 11px;
  font-weight: 700;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  padding: 2px 7px;
  border-radius: 4px;
  white-space: nowrap;
}
.syntax-sub-btn {
  background: transparent;
  border: 1px solid #cbd5e1;
  color: #0284c7;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.syntax-sub-btn:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0369a1;
}
.syntax-formula {
  font-size: 11.5px;
  background: #f1f5f9;
  border-radius: 4px;
  padding: 3px 6px;
  color: #334155;
  overflow-x: auto;
}
.syntax-formula code {
  font-family: Consolas, 'Fira Code', monospace;
  font-size: 11px;
}
.syntax-example-tib {
  font-family: var(--font-tibetan);
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
  margin: 2px 0;
  line-height: 1.5;
}
.syntax-example-zh {
  font-size: 11.5px;
  color: #475569;
  font-style: italic;
  line-height: 1.4;
}
.syntax-card-note {
  font-size: 11px;
  color: #64748b;
  line-height: 1.5;
  border-top: 1px dashed #f1f5f9;
  padding-top: 6px;
  margin-top: 2px;
}

/* Evidentiality Cognitive Contrast Box in Sentence Card */
.sgc-contrast-box {
  margin-top: 6px;
  background: #fefce8;
  border-left: 3px solid #eab308;
  padding: 6px 10px;
  font-size: 11px;
  color: #713f12;
  line-height: 1.5;
  border-radius: 0 4px 4px 0;
}

/* ============================================================================
   MOBILE RESPONSIVE ADAPTATION (手机端适配)
   ============================================================================ */

/* Mobile Navigation Bar inside Detail Pane */
.mobile-nav-bar {
  display: none;
}

@media (max-width: 768px) {
  /* 1. Header & Top Actions */
  .topbar {
    height: auto;
    padding: 8px 12px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .brand-mark {
    font-size: 20px;
  }
  .brand-copy .brand-title,
  .brand-copy h1 {
    font-size: 15px;
  }
  .brand-copy .eyebrow {
    font-size: 9px;
  }
  .top-actions {
    width: 100%;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-bottom: 4px;
    gap: 6px;
    scrollbar-width: none;
  }
  .top-actions::-webkit-scrollbar {
    display: none;
  }
  .top-actions .status-dot,
  .top-actions span:nth-of-type(2) {
    display: none;
  }
  .top-actions .ghost-btn {
    font-size: 12px;
    padding: 6px 10px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
  }

  /* 2. Main Shell & Hero */
  .shell {
    padding: 6px 8px 24px;
  }
  .hero {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 8px;
  }
  .hero .hero-desc {
    display: none;
  }
  .hero-left {
    width: 100% !important;
    min-width: 0 !important;
  }
  .hero-left h1,
  .hero-left h2 {
    font-size: 22px !important;
    margin: 4px 0 2px !important;
    white-space: normal !important;
    word-break: normal !important;
    line-height: 1.3 !important;
  }
  .hero-left .kicker {
    font-size: 9px !important;
    margin-bottom: 2px;
    white-space: normal !important;
    word-break: normal !important;
    line-height: 1.3 !important;
  }
  .hero-right {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-top: 8px !important;
    padding-top: 6px;
    border-top: 1px solid var(--line);
  }
  .hero-stat {
    flex-direction: row;
    align-items: baseline;
    gap: 4px;
  }
  .hero-stat strong {
    font-size: 18px;
  }
  .hero-stat span {
    font-size: 11px;
  }
  .hero-controls {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
  }
  .hero-controls .layout-toggle-btn {
    font-size: 12px;
    padding: 6px 10px;
    min-height: 36px;
  }
  #toggleWidthModeBtn,
  #toggleFocusBtn {
    display: none; /* Desktop only features */
  }

  /* 3. Workspace Layout - Single Column Fluid Transition */
  .workspace {
    display: block !important;
    height: auto !important;
    min-height: calc(100vh - 130px);
    border: none;
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }
  .pane-resizer {
    display: none !important;
  }

  /* When viewing list (default mobile state) */
  .workspace:not(.mobile-detail-active) .sidebar {
    display: block;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
  }
  .workspace:not(.mobile-detail-active) .sidebar .chip-list {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
    max-height: 148px;
    overflow-y: auto;
    margin-bottom: 0;
    padding: 2px 0;
  }
  .workspace:not(.mobile-detail-active) .sidebar .chip {
    min-height: 36px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    background: #fafaf8;
    gap: 6px;
  }
  .workspace:not(.mobile-detail-active) .sidebar .cat-mode-btn,
  .workspace:not(.mobile-detail-active) .sidebar .random-learn-btn,
  .workspace:not(.mobile-detail-active) .sidebar .kb-toggle-btn {
    min-height: 36px;
  }
  .workspace:not(.mobile-detail-active) .results-pane {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100vh - 200px);
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
  }
  .results-actions .text-btn,
  .results-actions .icon-toggle-btn {
    min-height: 36px;
    min-width: 36px;
    padding: 4px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .workspace:not(.mobile-detail-active) .detail-pane {
    display: none !important;
  }

  /* When viewing detail on mobile */
  .workspace.mobile-detail-active .sidebar,
  .workspace.mobile-detail-active .results-pane {
    display: none !important;
  }
  .workspace.mobile-detail-active .detail-pane {
    display: block !important;
    width: 100% !important;
    min-height: calc(100vh - 120px);
    padding: 12px 12px 64px !important;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    box-shadow: var(--shadow);
  }

  /* Sticky Mobile Navigation Header */
  .mobile-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: -12px;
    z-index: 100;
    background: #ffffff;
    padding: 8px 12px;
    margin: -12px -12px 14px -12px;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  }
  .mobile-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--accent);
    color: #ffffff;
    border: none;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(139, 30, 15, 0.25);
    touch-action: manipulation;
  }
  .mobile-back-btn:active {
    transform: scale(0.97);
  }
  .mobile-nav-title {
    font-family: var(--font-tibetan);
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-deep);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Detail Content Scaling */
  .headword-lemma {
    font-size: 30px;
  }
  .headword-lhasa-ipa {
    font-size: 14px;
  }
  .detail-wylie {
    font-size: 12.5px;
  }
  .detail-section {
    margin-top: 14px;
    padding: 10px;
  }

  /* 8-Case Declension Table: Smooth Horizontal Swipe */
  .declension-body {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
  }
  .declension-table {
    min-width: 620px;
  }

  /* Diachronic Tree on Mobile */
  .mindmap-tree {
    padding-left: 12px;
  }
  .tree-level::before {
    left: 4px;
  }
  .tree-node-dot {
    left: -12px;
    width: 9px;
    height: 9px;
  }
  .tree-card {
    padding: 10px 12px;
  }
  .dialects-branch-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .dialect-grid {
    grid-template-columns: 1fr;
  }

  /* Touch adjustments for entry cards */
  .entry-card {
    padding: 10px 12px;
  }
  .entry-top .tibetan {
    font-size: 17px;
  }
}

/* ============================================================================
   GRAMMAR EXPANSION & ORGANIC INTERCONNECTION STYLES
   ============================================================================ */

/* Grammar Quick Link Badges in Detail Header */
.grammar-pos-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fdf5f0;
  color: var(--accent-deep);
  border: 1px solid #f4d3c6;
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.4;
}
.grammar-pos-pill:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(192, 86, 33, 0.25);
}

/* Purified Declension Table Formula & Rules */
.declension-formula-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}
.declension-formula-pill {
  font-family: monospace;
  font-size: 12px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.grammar-jump-pill {
  background: #fff;
  border: 1px solid #cbd5e1;
  color: var(--accent-deep);
  border-radius: 3px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.grammar-jump-pill:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.declension-role-desc {
  font-size: 12px;
  color: #334155;
  line-height: 1.5;
  margin-bottom: 3px;
}
.declension-sandhi-hint {
  font-size: 11px;
  color: #64748b;
  background: #f8fafc;
  border-left: 2px solid #94a3b8;
  padding: 3px 6px;
  border-radius: 0 3px 3px 0;
  margin-top: 4px;
}

/* Grammar Concordance Box at bottom of Grammar Guide */
.grammar-concordance-box {
  margin-top: 32px;
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.gcb-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
}
.gcb-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.gcb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.gcb-chip:hover {
  border-color: var(--accent);
  background: #fdf6f3;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}
.gcb-tib {
  font-family: var(--font-tibetan);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-deep);
}
.gcb-arrow {
  font-size: 11px;
  color: #64748b;
}
.gcb-chip:hover .gcb-arrow {
  color: var(--accent);
}



/* ==================== TIBETAN SMART SEGMENTER & SYNTAX ANALYZER WORKBENCH ==================== */

.segmenter-dialog {
  border: 0;
  border-radius: 10px;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.25);
  padding: 0;
  width: min(960px, 94vw);
  max-height: 88vh;
  background: #fdfcf9;
  color: var(--ink);
}

.segmenter-dialog::backdrop {
  background: rgba(18, 22, 17, 0.58);
}

.segmenter-dialog-inner {
  display: flex;
  flex-direction: column;
  max-height: 88vh;
  overflow-y: auto;
  padding: 24px 30px 30px;
}

.segmenter-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.segmenter-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.segmenter-glyph {
  font-family: var(--font-tibetan);
  font-size: 32px;
  color: var(--accent);
  background: var(--accent-soft);
  width: 52px;
  height: 52px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(139, 30, 15, 0.15);
  flex-shrink: 0;
}

.segmenter-title-group h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.segmenter-title-group p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.segmenter-close-btn {
  border: 0;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.segmenter-close-btn:hover {
  color: var(--accent);
  background: #f1ede4;
}

/* Presets Bar */
.segmenter-presets-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  background: #f5f4ed;
  border: 1px solid #e6e5da;
  padding: 10px 14px;
  border-radius: 6px;
  margin: 14px 0 12px;
}

.preset-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-btn {
  border: 1px solid #d5d4c8;
  background: #ffffff;
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff8f5;
  transform: translateY(-1px);
}

/* Textarea & Controls */
.segmenter-input-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.segmenter-textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: 'Noto Serif Tibetan', 'Noto Sans SC', sans-serif;
  font-size: 16px;
  line-height: 1.8;
  padding: 12px 14px;
  border: 1px solid #d4d5ca;
  border-radius: 6px;
  background: #ffffff;
  color: #1a1a1a;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.segmenter-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 30, 15, 0.08);
}

.segmenter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.segmenter-controls-left, .segmenter-controls-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.segmenter-btn-primary {
  background: var(--accent);
  color: #ffffff;
  border: 0;
  padding: 7px 18px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.segmenter-btn-primary:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

.segmenter-btn-ghost {
  background: transparent;
  border: 1px solid #d4d5ca;
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.segmenter-btn-ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: #ffffff;
}

/* Results Area */
.segmenter-results {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.segmenter-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
  background: #f8f7f2;
  border-radius: 6px;
  font-size: 13px;
}

.s-section-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.05em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

/* Ribbon Flow */
.segmenter-ribbon-card {
  background: #f8f7f2;
  border: 1px solid #e4e3d7;
  padding: 14px 18px;
  border-radius: 8px;
}

.segmenter-ribbon-stream {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.ribbon-token-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #d6d5c9;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.ribbon-token-chip:hover {
  border-color: var(--accent);
  background: #fff8f5;
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(0,0,0,0.06);
}

.ribbon-tib {
  font-family: var(--font-tibetan);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.ribbon-tag {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}

.tag-verb { background: #fdf0ed; color: #8b1e0f; }
.tag-genitive { background: #edf5fa; color: #1d4460; }
.tag-ergative { background: #f0fdf4; color: #15803d; }
.tag-ladon { background: #f0f9ff; color: #0369a1; }
.tag-ablative { background: #fefce8; color: #854d0e; }
.tag-connective { background: #f1f5f9; color: #334155; }
.tag-pramana { background: #fdf2f8; color: #9d174d; }
.tag-default { background: #f1f1eb; color: #475569; }

.ribbon-punct {
  font-family: var(--font-tibetan);
  font-size: 18px;
  color: #94a3b8;
  padding: 0 4px;
}

/* Detail Cards Grid */
.segmenter-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.segmenter-token-card {
  background: #ffffff;
  border: 1px solid #e1e0d4;
  border-radius: 6px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.segmenter-token-card.card-verb {
  border-left: 3px solid #8b1e0f;
}
.segmenter-token-card.card-enclitic {
  border-left: 3px solid #bd8b44;
}
.segmenter-token-card.card-particle {
  border-left: 3px solid #2a5a7b;
}

.segmenter-token-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0,0,0,0.05);
}

.card-highlight {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px rgba(139, 30, 15, 0.18) !important;
  transform: translateY(-2px);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-tib-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-tib-surface {
  font-family: var(--font-tibetan);
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
}

.card-pos-badge {
  font-size: 10.5px;
  font-weight: 600;
  background: #f1f0e8;
  color: #555c4e;
  padding: 2px 6px;
  border-radius: 3px;
}

.card-role-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-deep);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 3px;
}

.card-lemma-notice {
  font-size: 12px;
  color: #1e293b;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  border-radius: 4px;
}

.lemma-tib {
  font-family: var(--font-tibetan);
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
  margin-right: 6px;
}

.lemma-tense {
  font-size: 11px;
  color: #0284c7;
  font-weight: 600;
}

.card-sandhi-rule {
  font-size: 11px;
  color: #475569;
  background: #fafaf9;
  border-left: 2px solid var(--accent);
  padding: 4px 8px;
  border-radius: 0 3px 3px 0;
  line-height: 1.5;
}

.rule-label {
  font-weight: 700;
  color: var(--accent-deep);
}

.card-gloss {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.5;
}

.card-footer {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px dashed #e8e7de;
}

.card-jump-btn {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s ease;
}

.card-jump-btn:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

/* Search Suggestions Analyzer Prompt Banner */
.suggestion-analyzer-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fff7f5 0%, #fdf5f0 100%);
  border-bottom: 1px solid #f2dfd8;
  cursor: pointer;
  transition: background 0.15s ease;
}

.suggestion-analyzer-banner:hover {
  background: #fcedea;
}

.sab-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sab-icon {
  font-size: 18px;
  color: var(--accent);
  background: rgba(139, 30, 15, 0.1);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sab-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent-deep);
}

.sab-desc {
  font-size: 11px;
  color: #78716c;
}

.sab-btn {
  border: 1px solid var(--accent);
  background: #ffffff;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.sab-btn:hover {
  background: var(--accent);
  color: #ffffff;
}


/* ==========================================================================
   v5.1 FEATURE SUITE: Tri-Dialect Capsules, Virtual Keyboard, Favorites,
   History, Traditional Share Card, and Enhanced Segmenter Styling
   ========================================================================== */

/* 1. Tri-Dialect Capsule Badges on Detail View */
.tri-dialect-capsules {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}

.dialect-capsule {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  outline: none;
  background: #f8fafc;
  user-select: none;
}

.dialect-capsule:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.dialect-capsule:active {
  transform: translateY(0);
}

.capsule-region {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
}

.capsule-ipa {
  font-family: var(--font-mono, monospace);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.capsule-play-icon {
  font-size: 10px;
  opacity: 0.7;
}

.capsule-lhasa {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}
.capsule-lhasa:hover {
  background: #dbeafe;
  border-color: #93c5fd;
}

.capsule-kham {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}
.capsule-kham:hover {
  background: #d1fae5;
  border-color: #6ee7b7;
}

.capsule-amdo {
  background: #fff1f2;
  border-color: #fecdd3;
  color: #9f1239;
}
.capsule-amdo:hover {
  background: #ffe4e6;
  border-color: #fda4af;
}

.phonology-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 12px;
  font-size: 11px;
  color: #64748b;
  border: 1px dashed #cbd5e1;
  background: transparent;
  cursor: pointer;
  transition: all 0.12s ease;
}
.phonology-info-btn:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: rgba(139, 30, 15, 0.04);
}

/* Detail Title Row Actions (Favorite & Share Card) */
.detail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.detail-actions-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  margin-top: 4px;
}

.fav-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #d97706;
  background: #fffbeb;
  color: #b45309;
  cursor: pointer;
  transition: all 0.15s ease;
}
.fav-toggle-btn.is-fav {
  background: #d97706;
  color: #ffffff;
}
.fav-toggle-btn:hover {
  filter: brightness(0.96);
}

.share-card-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}
.share-card-btn:hover {
  background: #f8fafc;
  color: #0f172a;
  border-color: #cbd5e1;
}

/* 2. Virtual Tibetan Keyboard */
.kb-toggle-btn {
  position: static;
  transform: none;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  padding: 0 10px;
  border-radius: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  line-height: 1;
}
.kb-toggle-btn:hover {
  color: var(--accent);
  background: rgba(139, 30, 15, 0.08);
}

.search-box {
  position: relative;
}
.search-box input {
  padding-right: 4px;
}

.virtual-kb-dialog {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.22);
  background: #ffffff;
  max-width: 680px;
  width: 95vw;
}

.virtual-kb-inner {
  padding: 16px 20px;
}

.virtual-kb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}

.vkb-title {
  font-size: 13px;
  font-weight: 700;
  color: #1e293b;
}

.vkb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vkb-tab-btn {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #475569;
  cursor: pointer;
}
.vkb-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.vkb-section-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  margin: 8px 0 6px;
}

.vkb-grid-consonants {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

@media (max-width: 600px) {
  .vkb-grid-consonants {
    grid-template-columns: repeat(4, 1fr);
  }
}

.vkb-grid-vowels {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}

@media (max-width: 600px) {
  .vkb-grid-vowels {
    grid-template-columns: repeat(4, 1fr);
  }
}

.vkb-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vkb-ctrl-row {
  margin-bottom: 10px;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 8px;
}

.vkb-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 4px;
  min-height: 44px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
}
.vkb-key:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}
.vkb-key:active {
  background: #e2e8f0;
  transform: translateY(0);
}

.vkb-key .bo {
  font-family: var(--font-tibetan, var(--font-tibetan));
  font-size: 18px;
  line-height: 1.2;
  color: #0f172a;
}
.vkb-key .wy {
  font-size: 9.5px;
  color: #64748b;
  font-family: monospace;
}

.vkb-punct {
  min-width: 70px;
  font-weight: 600;
  font-size: 12px;
  color: #334155;
  background: #ffffff;
}

.vkb-ctrl {
  min-width: 60px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  background: #e2e8f0;
}

.vkb-accent {
  margin-left: auto;
  background: var(--accent);
  color: #ffffff;
  font-weight: 600;
  font-size: 11.5px;
  border-color: var(--accent);
}
.vkb-accent:hover {
  background: var(--accent-deep);
}

.vkb-vowel {
  background: #fefce8;
  border-color: #fef08a;
}
.vkb-vowel:hover {
  background: #fef9c3;
}
.vkb-vowel .bo {
  color: #854d0e;
}

.vkb-subjoined {
  background: #f0fdf4;
  border-color: #bbf7d0;
}
.vkb-subjoined .bo {
  color: #166534;
}

.vkb-panel.hidden {
  display: none !important;
}
.vkb-ctrl-row .vkb-key {
  min-width: auto;
  min-height: 36px;
  padding: 5px 10px;
  white-space: nowrap;
}

/* v9.9 Subjoined / Stacked Consonant Mode */
.vkb-subjoin-btn {
  min-width: 112px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #166534;
  background: #ecfdf5;
  border: 1.5px solid #86efac;
}
.vkb-subjoin-btn:hover {
  background: #dcfce7;
  border-color: #22c55e;
}
.vkb-subjoin-btn.vkb-subjoin-on {
  background: #15803d;
  border-color: #166534;
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.22);
}
.vkb-stack-last-btn {
  min-width: 92px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fed7aa;
}
.vkb-stack-last-btn:hover {
  background: #ffedd5;
  border-color: #fb923c;
}
.vkb-subjoin-tip {
  font-size: 11px;
  line-height: 1.55;
  color: #475569;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 3px solid #16a34a;
  border-radius: 5px;
  padding: 6px 10px;
  margin-bottom: 8px;
}
.vkb-subjoin-tip code {
  font-family: var(--font-tibetan);
  font-size: 13px;
  background: #f1f5f9;
  color: #0f172a;
  padding: 0 4px;
  border-radius: 3px;
}
.vkb-grid-consonants.vkb-subjoin-active .vkb-cons-key {
  background: #f0fdf4;
  border-color: #86efac;
}
.vkb-grid-consonants.vkb-subjoin-active .vkb-cons-key:hover {
  background: #dcfce7;
  border-color: #16a34a;
}
.vkb-grid-consonants.vkb-subjoin-active .vkb-cons-key .bo {
  color: #15803d;
}

.vkb-wylie-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 8px;
}
.vkb-wylie-table th, .vkb-wylie-table td {
  border: 1px solid #e2e8f0;
  padding: 6px 10px;
  text-align: left;
}
.vkb-wylie-table th {
  background: #f8fafc;
  color: #475569;
}
.vkb-wylie-table code {
  background: #f1f5f9;
  padding: 1px 4px;
  border-radius: 3px;
  color: #b91c1c;
}

/* 3. Favorites & History Dialogs */
.modal-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 4px;
}

.fav-actions-bar, .history-actions-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 12px;
}

.fav-actions-bar input {
  flex: 1;
  padding: 7px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
}

.fav-list-scroll, .history-list-scroll {
  max-height: 400px;
  overflow-y: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fdfdfd;
}

.fav-item-row, .history-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.12s ease;
}
.fav-item-row:hover, .history-item-row:hover {
  background: #f8fafc;
}
.fav-item-row:last-child, .history-item-row:last-child {
  border-bottom: none;
}

.fav-item-left {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.fav-item-bo {
  font-family: var(--font-tibetan, var(--font-tibetan));
  font-size: 17px;
  font-weight: 600;
  color: #0f172a;
}
.fav-item-ipa {
  font-size: 11px;
  font-family: monospace;
  color: #2563eb;
}
.fav-item-gloss {
  font-size: 12.5px;
  color: #334155;
}
.fav-remove-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}
.fav-remove-btn:hover {
  color: #dc2626;
}

/* 4. Traditional Tibetan Share Card (雅致卡片) */
.share-card-canvas {
  background: linear-gradient(135deg, #fdfbf7 0%, #f7f1e5 100%);
  border: 2px solid #b45309;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 12px 24px -6px rgba(180, 83, 9, 0.15);
  margin: 14px 0 18px;
  text-align: center;
  position: relative;
}

.sc-tibetan-border {
  border: 1px solid #d97706;
  border-radius: 8px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.92);
}

.sc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sc-crest {
  font-family: var(--font-tibetan, var(--font-tibetan));
  font-size: 13px;
  color: #92400e;
  font-weight: 600;
}

.sc-badge {
  font-size: 10.5px;
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

.sc-lemma {
  font-family: var(--font-tibetan, var(--font-tibetan));
  font-size: 38px;
  font-weight: 700;
  color: #78350f;
  line-height: 1.3;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(120, 53, 15, 0.1);
}

.sc-wylie {
  font-family: monospace;
  font-size: 13.5px;
  color: #78716c;
  margin-bottom: 10px;
}

.sc-dialects {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.sc-ipa-item {
  font-size: 11.5px;
  font-family: monospace;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 2px 8px;
  border-radius: 12px;
  color: #1e3a8a;
}

.sc-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, #d97706, transparent);
  margin: 12px 0 14px;
}

.sc-pos {
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
}

.sc-gloss {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin: 6px 0 14px;
  line-height: 1.5;
}

.sc-example-box {
  background: #ffffff;
  border-left: 3px solid #b45309;
  border-radius: 4px;
  padding: 10px 14px;
  text-align: left;
  margin-bottom: 16px;
}

.sc-ex-bo {
  font-family: var(--font-tibetan, var(--font-tibetan));
  font-size: 15px;
  color: #0f172a;
  line-height: 1.4;
}

.sc-ex-zh {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
}

.sc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px dashed #cbd5e1;
}

.sc-source {
  font-size: 10.5px;
  color: #94a3b8;
}

.sc-seal {
  font-family: var(--font-tibetan, var(--font-tibetan));
  font-size: 13px;
  font-weight: 700;
  color: #b91c1c;
  border: 1.5px solid #b91c1c;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 1px;
  background: #fef2f2;
}

.share-card-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

/* 5. Smart Lemmatization in Search Suggestions */
.suggestion-lemma-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
  padding: 8px 12px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.suggestion-lemma-alert:hover {
  background: #dcfce7;
}

.sla-badge {
  font-size: 10.5px;
  font-weight: 700;
  background: #16a34a;
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
}

.sla-content {
  font-size: 12px;
  color: #14532d;
  flex: 1;
}
.sla-content strong {
  color: #15803d;
}

/* 6. Phonology Comparison Modal */
.phonology-comparative-table {
  margin: 14px 0;
  overflow-x: auto;
}

.phonology-tip-box {
  background: #f8fafc;
  border-left: 3px solid var(--accent);
  padding: 10px 14px;
  font-size: 12px;
  color: #334155;
  border-radius: 4px;
  line-height: 1.6;
}

/* 7. Segmenter Enhanced Modes (Verse Mode & Syntax Color Coding) */
.segmenter-mode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 6px 10px;
  background: #f8fafc;
  border-radius: 6px;
  font-size: 12px;
}

.verse-layout-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-tibetan, var(--font-tibetan));
  font-size: 18px;
  line-height: 1.8;
  padding: 12px 16px;
  background: #fcf9f5;
  border-radius: 8px;
  border: 1px solid #ede1d3;
}

.verse-line {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px;
  border-bottom: 1px dashed #f1e4d3;
  padding-bottom: 4px;
}

.syntax-role-agent {
  background: #eff6ff !important;
  border-color: #93c5fd !important;
  color: #1e40af !important;
}

.syntax-role-patient {
  background: #ecfdf5 !important;
  border-color: #6ee7b7 !important;
  color: #065f46 !important;
}

.syntax-role-verb {
  background: #fef2f2 !important;
  border-color: #fca5a5 !important;
  color: #991b1b !important;
}

.syntax-role-particle {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: #475569 !important;
}


/* Touch and Mobile Click Enhancements */
.entry-card, .suggestion-item {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  user-select: none;
}

@media (max-width: 768px) {
  .workspace:not(.mobile-detail-active) .sidebar {
    overflow: visible !important;
  }
  .search-wrapper {
    position: relative;
    z-index: 999;
  }
  .search-suggestions {
    position: absolute !important;
    top: calc(100% + 4px) !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    max-height: 55vh !important;
    z-index: 99999 !important;
    box-shadow: 0 12px 36px rgba(0,0,0,0.3) !important;
    -webkit-overflow-scrolling: touch;
  }
  .suggestion-item {
    min-height: 48px;
    padding: 12px 14px;
  }
}


/* Virtual Keyboard Live Input Box Styling */
.search-box-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
}
.search-box-wrap .search-box {
  flex: 1;
}
.kb-toggle-btn {
  background: var(--card, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent, #8b1e0f);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.kb-toggle-btn:hover {
  background: var(--accent-soft, #fff5f3);
  border-color: var(--accent, #8b1e0f);
}

.vkb-display-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  background: #fdfaf6;
  border: 1px solid #ebd8c8;
  border-radius: 8px;
  padding: 8px 12px;
}

.vkb-input-wrapper {
  position: relative;
  flex: 1;
}

.vkb-live-input {
  width: 100%;
  padding: 8px 32px 8px 12px;
  font-family: var(--font-tibetan, var(--font-tibetan));
  font-size: 22px;
  font-weight: 600;
  color: #78350f;
  background: #ffffff;
  border: 1.5px solid #d97706;
  border-radius: 6px;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}
.vkb-live-input:focus {
  border-color: #b45309;
  box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.vkb-action-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}
.vkb-action-clear:hover {
  color: #ef4444;
}

.vkb-action-search {
  padding: 10px 18px;
  background: var(--accent, #8b1e0f);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
  box-shadow: 0 2px 6px rgba(139, 30, 15, 0.25);
}
.vkb-action-search:hover {
  background: #6b1509;
}


/* Virtual Keyboard Refinements */
.search-box-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  width: 100%;
  margin-bottom: 14px;
}
.search-box-wrap .search-box {
  flex: 1;
  margin-bottom: 0 !important;
}
.kb-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--card, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 6px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent, #8b1e0f);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.kb-toggle-btn:hover {
  background: var(--accent-soft, #fff5f3);
  border-color: var(--accent, #8b1e0f);
}
.virtual-kb-dialog {
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.vkb-key {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}


/* ==========================================================================
   ADVANCED LINGUISTIC FEATURES STYLING (v6.1)
   ========================================================================== */

/* 1. Grammar Sentinel Warning Box */
.grammar-sentinel-alert {
  margin: 8px 0 12px;
  padding: 10px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 4px solid #d97706;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.55;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.08);
}
.grammar-sentinel-alert.hidden {
  display: none !important;
}
.grammar-sentinel-alert .sentinel-badge {
  font-weight: 700;
  font-size: 11px;
  margin-bottom: 4px;
  display: inline-block;
}
.grammar-sentinel-alert .sentinel-badge.error { color: #b45309; }
.grammar-sentinel-alert .sentinel-badge.success { color: #15803d; }
.grammar-sentinel-alert .sentinel-text {
  color: #78350f;
  margin-bottom: 4px;
}
.grammar-sentinel-alert .sentinel-canon {
  font-size: 11px;
  color: #92400e;
  font-family: var(--font-tibetan, serif);
  background: #fef3c7;
  padding: 4px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}
.grammar-sentinel-alert .sentinel-fix-btn {
  display: inline-block;
  padding: 4px 10px;
  background: #d97706;
  color: #ffffff;
  font-weight: 600;
  font-size: 11.5px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.grammar-sentinel-alert .sentinel-fix-btn:hover {
  background: #b45309;
}

/* 2. Syllable Anatomy X-Ray Section */
.anatomy-section {
  margin: 16px 0 20px;
  background: #fafaf9;
  border: 1px solid #e7e5e4;
  border-radius: 8px;
  padding: 14px 16px;
}
.anatomy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f5f5f4;
}
.anatomy-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #292524;
  letter-spacing: 0.02em;
}
.anatomy-badge {
  font-size: 10px;
  font-weight: 600;
  background: #e7e5e4;
  color: #57534e;
  padding: 2px 8px;
  border-radius: 12px;
}
.anatomy-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}
.anatomy-syllable-card {
  background: #ffffff;
  border: 1px solid #e7e5e4;
  border-radius: 6px;
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.anatomy-s-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}
.anatomy-s-lemma {
  font-family: var(--font-tibetan, var(--font-tibetan));
  font-size: 26px;
  font-weight: 600;
  color: var(--accent, #8b1e0f);
  line-height: 1.2;
}
.anatomy-s-idx {
  font-size: 11px;
  font-weight: 600;
  color: #78716c;
}
.anatomy-parts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}
.part-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.02em;
}
.part-prefix { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.part-super { background: #d1fae5; color: #047857; border: 1px solid #a7f3d0; }
.part-root { background: #fee2e2; color: #b91c1c; border: 1.5px solid #fca5a5; font-size: 11px; }
.part-sub { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }
.part-vowel { background: #fbf0eb; color: #8b1e0f; border: 1px solid #e6c6bc; }
.part-suffix { background: #cffafe; color: #0e7490; border: 1px solid #a5f3fc; }
.part-post { background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0; }

.anatomy-deductions {
  margin: 0;
  padding-left: 16px;
  font-size: 11px;
  color: #57534e;
  line-height: 1.55;
}
.anatomy-deductions li {
  margin-bottom: 3px;
}

/* 3. Bidirectional Honorific Mirror Box */
.honorific-mirror-box {
  margin: 14px 0;
  background: #fdfaf6;
  border: 1px solid #ebd8c8;
  border-radius: 8px;
  padding: 12px 16px;
}
.hm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.hm-tag {
  font-size: 11px;
  font-weight: 700;
  color: #9a3412;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hm-type {
  font-size: 10.5px;
  background: #fed7aa;
  color: #7c2d12;
  padding: 1px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.hm-target-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #431407;
}
.hm-jump-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1.5px solid #ea580c;
  color: #c2410c;
  padding: 4px 12px;
  border-radius: 6px;
  font-family: var(--font-tibetan, var(--font-tibetan));
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.hm-jump-btn span {
  font-family: var(--font-sans, sans-serif);
  font-size: 11px;
  color: #ea580c;
  font-weight: 700;
}
.hm-jump-btn:hover {
  background: #fff7ed;
  border-color: #9a3412;
  transform: translateY(-1px);
}
.hm-cherzhe {
  margin-top: 6px;
  font-size: 12px;
  color: #78350f;
}
.hm-cz-val {
  font-family: var(--font-tibetan, serif);
  font-size: 15px;
  color: #9a3412;
}

/* 4. Proto-Sino-Tibetan Cognate Lens */
.pst-cognate-box {
  margin: 16px 0;
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 14px 16px;
}
.pst-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pst-title {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}
.pst-badge {
  font-size: 10px;
  background: #e2e8f0;
  color: #475569;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}
.pst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}
.pst-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
}
.pst-k {
  display: block;
  font-size: 10px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 3px;
}
.pst-v {
  font-size: 13px;
  color: #0f172a;
}
.pst-highlight {
  color: #0284c7;
  font-family: monospace;
}
.pst-hanzi {
  font-size: 18px;
  color: #b91c1c;
  font-weight: 700;
}
.pst-note {
  font-size: 11px;
  color: #475569;
  line-height: 1.5;
  background: #ffffff;
  padding: 6px 10px;
  border-radius: 4px;
  border: 1px dashed #cbd5e1;
}

/* 5. Poetic Rhyme Modal Dialog */
.rhyme-modal-dialog {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.22);
  background: #ffffff;
  max-width: 720px;
  width: 95vw;
  max-height: 90vh;
}
.rhyme-modal-inner { padding: 18px 22px; }
.rhyme-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.rhyme-modal-title { font-size: 13.5px; font-weight: 700; color: var(--accent-deep); }
.rhyme-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: #faf7f2;
  border: 1px solid var(--line);
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.rf-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 140px;
}
.rf-group label {
  font-size: 11px;
  font-weight: 600;
  color: #6b21a8;
}
.rf-group select {
  padding: 6px 10px;
  border: 1px solid #d8b4fe;
  border-radius: 6px;
  background: #ffffff;
  font-size: 12.5px;
  color: #3b0764;
  outline: none;
}
.rhyme-results-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: #64748b;
  margin-bottom: 10px;
}
.rhyme-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}
.rhyme-card-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 8px 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.rhyme-card-item:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  transform: translateY(-1px);
}
.rhyme-card-lemma {
  font-family: var(--font-tibetan, serif);
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-deep);
  display: block;
}
.rhyme-card-gloss {
  font-size: 11px;
  color: #475569;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}

/* 6. Rabjung Calendar Modal Dialog */
.calendar-modal-dialog {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 40px -10px rgba(0,0,0,0.22);
  background: #ffffff;
  max-width: 640px;
  width: 95vw;
}
.calendar-modal-inner { padding: 18px 22px; }
.calendar-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.calendar-modal-title { font-size: 13.5px; font-weight: 700; color: #0e7490; }
.calendar-tool-intro {
  font-size: 12px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 14px;
  background: #f0fdfa;
  padding: 10px 14px;
  border-radius: 6px;
  border: 1px solid #ccfbf1;
}
.calendar-calc-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
}
.cc-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.cc-input-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
}
.cc-input-row input {
  padding: 6px 12px;
  font-size: 16px;
  font-weight: 700;
  color: #0e7490;
  border: 1.5px solid #0891b2;
  border-radius: 6px;
  width: 120px;
  outline: none;
}
.cc-quick-landmarks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  font-size: 11px;
  color: #64748b;
}
.calendar-result-display {
  background: #ffffff;
  border: 1.5px solid #0891b2;
  border-radius: 8px;
  padding: 14px 16px;
}
.crd-title {
  font-family: var(--font-tibetan, serif);
  font-size: 26px;
  font-weight: 700;
  color: #0e7490;
  margin-bottom: 4px;
}
.crd-zh {
  font-size: 15px;
  font-weight: 700;
  color: #155e75;
  margin-bottom: 6px;
}
.crd-meta {
  font-size: 12px;
  color: #475569;
}


/* ==========================================================================
   Verb Inflection Retrospective Banner & Verb Workbench Dialog (v6.4)
   ========================================================================== */
.verb-retrospective-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-left: 4px solid #0284c7;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.vrb-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.vrb-badge {
  background: #e0f2fe;
  color: #0369a1;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid #bae6fd;
}

.vrb-desc {
  font-size: 12.5px;
  color: #0f172a;
}

.vrb-desc strong {
  color: #0369a1;
  font-family: var(--font-tibetan);
  font-size: 14px;
}

.vrb-jump-btn {
  background: #ffffff;
  color: #0284c7;
  border: 1px solid #0284c7;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.vrb-jump-btn:hover {
  background: #0284c7;
  color: #ffffff;
}

/* Verb Modal Dialog */
.verb-modal-dialog {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 960px;
  width: 95vw;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  background: var(--surface);
  color: var(--text);
}

.verb-modal-dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
}

.verb-modal-inner {
  padding: 20px 24px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.verb-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.verb-modal-title {
  font-size: 15px;
  font-weight: 700;
  color: #0369a1;
  letter-spacing: 0.02em;
}

.verb-modal-intro {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.verb-filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

#verbFilterInput {
  flex: 1;
  min-width: 240px;
  padding: 6px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
  background: var(--input-bg, #ffffff);
  color: var(--text);
}

#verbFilterInput:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.verb-filter-tabs {
  display: flex;
  gap: 6px;
}

.v-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11.5px;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.v-tab:hover {
  border-color: #0284c7;
  color: #0284c7;
}

.v-tab.active {
  background: #e0f2fe;
  color: #0369a1;
  border-color: #bae6fd;
  font-weight: 600;
}

.verb-table-wrap {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  max-height: calc(85vh - 190px);
}

.verb-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12.5px;
}

.verb-table thead {
  position: sticky;
  top: 0;
  background: #f8fafc;
  z-index: 2;
  border-bottom: 1px solid var(--border);
}

.verb-table th {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

.verb-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft, #f1f5f9);
  vertical-align: middle;
}

.verb-table tr:hover {
  background: rgba(2, 132, 199, 0.03);
}

.vt-cell-lemma, .vt-cell-tense {
  font-family: var(--font-tibetan);
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.vt-cell-lemma:hover, .vt-cell-tense:hover {
  color: #0284c7;
  text-decoration: underline;
}

.vt-cell-meaning {
  max-width: 240px;
  line-height: 1.4;
}

.vt-jump-btn {
  background: transparent;
  color: #0284c7;
  border: 1px solid #bae6fd;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.vt-jump-btn:hover {
  background: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}


/* ==========================================================================
   梵藏汉英四语对勘学术卡片 (Sanskrit Quadrilingual Alignment Card)
   ========================================================================== */
.sanskrit-quad-card {
  margin: 14px 0 16px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.03) 100%);
  border: 1px solid rgba(217, 119, 6, 0.28);
  border-left: 4px solid #b45309;
  border-radius: 8px;
  padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(180, 83, 9, 0.05);
}

.sqc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(217, 119, 6, 0.15);
  padding-bottom: 8px;
}

.sqc-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sqc-tag {
  display: inline-flex;
  align-items: center;
  background: #92400e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sqc-cat {
  font-size: 12px;
  font-weight: 600;
  color: #b45309;
  background: rgba(245, 158, 11, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}

.sqc-copy-btn {
  background: #fff;
  border: 1px solid rgba(180, 83, 9, 0.3);
  color: #92400e;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sqc-copy-btn:hover {
  background: #fef3c7;
  border-color: #b45309;
  color: #78350f;
  transform: translateY(-1px);
}

.sqc-hero {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.sqc-iast {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: #78350f;
  letter-spacing: 0.02em;
}

.sqc-devanagari {
  font-family: 'Noto Sans Devanagari', Arial, sans-serif;
  font-size: 19px;
  color: #b45309;
  font-weight: 500;
}

.sqc-matrix {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 14px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(217, 119, 6, 0.16);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.sqc-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sqc-label {
  font-size: 11px;
  font-weight: 700;
  color: #92400e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.sqc-val {
  font-size: 13.5px;
  color: var(--ink, #1c1917);
  line-height: 1.4;
}

.sqc-iast-val {
  font-family: 'Crimson Pro', Georgia, serif;
  font-weight: 600;
  color: #78350f;
}

.sqc-tib-val {
  font-family: var(--font-tibetan);
  font-size: 15px;
  color: #8b1e0f;
}

.sqc-source {
  font-size: 12px;
  color: #78350f;
  line-height: 1.45;
  background: rgba(255, 255, 255, 0.45);
  padding: 4px 8px;
  border-radius: 4px;
}
.sqc-source strong {
  color: #92400e;
}

/* Suggestion tag for Sanskrit matches */
.suggestion-sk-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid rgba(217, 119, 6, 0.3);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  font-family: 'Crimson Pro', Georgia, serif;
}

@media (max-width: 640px) {
  .sqc-matrix {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .sqc-iast {
    font-size: 20px;
  }
}


/* ==========================================================================
   Tibetan Tokenizer & Syntax Analyzer Workbench (智能分词与句法剖析工作台 - v6.8)
   ========================================================================== */

.segmenter-dialog {
  width: 92vw;
  max-width: 980px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 0;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.25);
  background: var(--bg-surface, #ffffff);
  color: var(--ink, #1e293b);
  overflow: hidden;
}

.segmenter-dialog::backdrop {
  background: rgba(15, 23, 42, 0.62);
}

.segmenter-dialog-inner {
  padding: 22px 24px;
  max-height: 88vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.segmenter-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.segmenter-title-group {
  display: flex;
  align-items: center;
  gap: 14px;
}

.segmenter-glyph {
  font-family: var(--font-tibetan);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent, #991b1b);
  background: #fef2f2;
  border: 1px solid #fecaca;
  width: 50px;
  height: 50px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.segmenter-title-group h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink, #0f172a);
  margin: 0 0 3px 0;
}

.segmenter-title-group p {
  font-size: 12px;
  color: #64748b;
  margin: 0;
}

.segmenter-close-btn {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.12s;
}

.segmenter-close-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

/* Preset examples */
.segmenter-presets-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.preset-label {
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  flex-shrink: 0;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-btn {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  color: #334155;
  cursor: pointer;
  transition: all 0.12s;
}

.preset-btn:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

/* Input area */
.segmenter-input-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.segmenter-textarea {
  width: 100%;
  font-family: var(--font-tibetan);
  font-size: 17px;
  line-height: 1.8;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1.5px solid #cbd5e1;
  background: #ffffff;
  color: var(--ink, #0f172a);
  resize: vertical;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.segmenter-textarea:focus {
  outline: none;
  border-color: var(--accent, #991b1b);
  box-shadow: 0 0 0 3px rgba(153, 27, 27, 0.1);
}

.segmenter-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.segmenter-controls-left,
.segmenter-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.segmenter-btn-primary {
  background: var(--accent, #991b1b);
  color: #ffffff;
  border: none;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.12s;
}

.segmenter-btn-primary:hover {
  opacity: 0.9;
}

.segmenter-btn-ghost {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #475569;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
}

.segmenter-btn-ghost:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0f172a;
}

/* Results layout */
.segmenter-results {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 4px;
}

.segmenter-empty {
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 13.5px;
  background: #f8fafc;
  border-radius: 8px;
}

.s-section-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.ribbon-count-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #991b1b);
  background: #fee2e2;
  padding: 2px 8px;
  border-radius: 10px;
}

/* Ribbon Stream & Tooltip Chips */
.segmenter-ribbon-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
}

.segmenter-ribbon-stream {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  line-height: 2.2;
}

.ribbon-punct {
  font-family: var(--font-tibetan);
  font-size: 20px;
  color: #94a3b8;
  padding: 0 2px;
}

.ribbon-token-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.ribbon-token-chip:hover {
  border-color: var(--accent, #991b1b);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.ribbon-tib {
  font-family: var(--font-tibetan);
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
}

.ribbon-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 3px;
}

.tag-default { background: #f1f5f9; color: #475569; }
.tag-verb { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.tag-genitive { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.tag-ergative { background: #fdf2f8; color: #be185d; border: 1px solid #fbcfe8; }
.tag-ladon { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.tag-ablative { background: #fefce8; color: #a16207; border: 1px solid #fef08a; }
.tag-connective { background: #f0f6fa; color: #1d4460; border: 1px solid #c8dceb; }
.tag-pramana { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }

.role-agent { border-left: 3.5px solid #be185d; }
.role-patient { border-left: 3.5px solid #15803d; }
.role-modifier { border-left: 3.5px solid #1d4ed8; }
.role-ablative { border-left: 3.5px solid #a16207; }
.role-reason { border-left: 3.5px solid #c2410c; }
.role-predicate { border-left: 3.5px solid #b91c1c; }
.role-evidential { border-left: 3.5px solid var(--blue); }

/* Floating Tooltip */
.chip-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #f8fafc;
  padding: 9px 12px;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  z-index: 1000;
  min-width: 170px;
  max-width: 260px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, transform 0.15s ease;
  text-align: left;
}

.chip-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #0f172a;
}

.ribbon-token-chip:hover .chip-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(-2px);
}

.chip-tt-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  padding-bottom: 3px;
  margin-bottom: 4px;
}

.chip-tt-head strong {
  font-family: var(--font-tibetan);
  font-size: 15px;
  color: #ffffff;
}

.chip-tt-pos {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 500;
}

.chip-tt-lemma {
  font-size: 11px;
  color: #38bdf8;
  margin-bottom: 2px;
}

.chip-tt-lemma b {
  font-family: var(--font-tibetan);
  font-size: 12px;
}

.chip-tt-role {
  font-size: 11px;
  color: #fbbf24;
  font-weight: 600;
  margin-bottom: 2px;
}

.chip-tt-gloss {
  font-size: 11px;
  color: #cbd5e1;
  line-height: 1.4;
  margin-bottom: 3px;
}

.chip-tt-hint {
  font-size: 9.5px;
  color: #64748b;
  text-align: right;
}

/* Interlinear Glossing */
.segmenter-interlinear-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
}

.interlinear-container {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 8px 2px;
  overflow-x: auto;
  min-width: max-content;
}

.interlinear-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  border-right: 1px dashed #e2e8f0;
  padding-right: 12px;
  min-width: 45px;
}

.interlinear-col.punct-col {
  min-width: 20px;
  border-right: none;
}

.int-line-tib {
  font-family: var(--font-tibetan);
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
}

.int-line-gloss {
  font-size: 11.5px;
  color: #334155;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.int-line-pos {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

/* Detailed Cards Section */
.segmenter-detail-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.segmenter-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.segmenter-token-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.segmenter-token-card.card-verb {
  border-left: 4px solid #ef4444;
}

.segmenter-token-card.card-particle {
  border-left: 4px solid #3b82f6;
}

.segmenter-token-card.card-enclitic {
  border-left: 4px solid var(--gold);
}

.card-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-tib-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.card-tib-surface {
  font-family: var(--font-tibetan);
  font-size: 21px;
  font-weight: 700;
  color: #0f172a;
}

.card-pos-badge {
  font-size: 11px;
  font-weight: 600;
  background: #f1f5f9;
  color: #475569;
  padding: 1px 6px;
  border-radius: 4px;
}

.card-role-tag {
  font-size: 11px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: 2px 6px;
  border-radius: 4px;
}

.card-lemma-notice {
  font-size: 12px;
  color: #334155;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lemma-badge {
  font-size: 10px;
  background: #cbd5e1;
  color: #0f172a;
  padding: 1px 4px;
  border-radius: 2px;
  font-weight: 600;
}

.lemma-tib {
  font-family: var(--font-tibetan);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent, #991b1b);
}

.lemma-tense {
  font-size: 11px;
  color: #b91c1c;
  font-weight: 600;
}

.card-syntax-role {
  font-size: 11.5px;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.syntax-badge {
  font-size: 10px;
  background: #f59e0b;
  color: #ffffff;
  padding: 1px 4px;
  border-radius: 2px;
}

.card-sandhi-rule {
  font-size: 11.5px;
  color: #1d4460;
  background: #edf5fa;
  border: 1px solid #c2d9e8;
  padding: 4px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rule-badge {
  font-size: 10px;
  background: var(--blue);
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 2px;
}

.card-gloss {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.5;
}

.card-footer {
  margin-top: auto;
  padding-top: 4px;
}

.card-jump-btn {
  width: 100%;
  padding: 6px 10px;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  font-size: 11.5px;
  font-weight: 600;
  color: #0284c7;
  cursor: pointer;
  transition: all 0.12s;
}

.card-jump-btn:hover {
  background: #e0f2fe;
  border-color: #38bdf8;
  color: #0369a1;
}

.card-highlight {
  animation: segCardPulse 1.8s ease;
}

@keyframes segCardPulse {
  0% { box-shadow: 0 0 0 0 rgba(153, 27, 27, 0.5); transform: scale(1.02); }
  70% { box-shadow: 0 0 0 8px rgba(153, 27, 27, 0); transform: scale(1); }
  100% { box-shadow: 0 0 0 0 rgba(153, 27, 27, 0); }
}

@media (max-width: 640px) {
  .segmenter-dialog-inner {
    padding: 16px;
  }
  .segmenter-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Site SEO Semantic Academic Footer */
.site-seo-footer {
  margin-top: 56px;
  padding: 44px 32px 36px;
  background: #fdfbf7;
  border-top: 1px solid var(--line);
  color: var(--ink-secondary);
  font-size: 13px;
  line-height: 1.8;
}
.site-seo-footer .seo-footer-container {
  max-width: 1400px;
  margin: 0 auto;
}
.site-seo-footer .seo-footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1.1fr 1fr;
  gap: 36px;
  margin-bottom: 30px;
}
@media (max-width: 960px) {
  .site-seo-footer .seo-footer-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}
.seo-col h3 {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
}
.seo-col h3::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}
.seo-col p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12.5px;
}
.seo-link-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.seo-link-cluster a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #fff;
  border: 1px solid #e7e5e4;
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.15s ease;
}
.seo-link-cluster a:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.seo-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.seo-col ul li {
  margin-bottom: 7px;
}
.seo-col ul li a {
  color: var(--accent);
  text-decoration: none;
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.seo-col ul li a:hover {
  text-decoration: underline;
}
.seo-footer-bottom {
  border-top: 1px dashed var(--line);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 12px;
}



/* ==========================================================================
   V7.6 SCHOLARLY EDITORIAL OVERHAUL (DE-AI-FICATION & CLASSICAL TYPOGRAPHY)
   ========================================================================== */

/* 1. Topbar & Restrained Monastic/Academic Navigation */
.topbar {
  padding: 10px 24px;
  background: rgba(251, 248, 243, 0.96);
  border-bottom: 1px solid #e2d9cc;
}

.brand-sub {
  font-size: 12px;
  color: #78716c;
  font-weight: 500;
  letter-spacing: 0.05em;
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid #d6cfc2;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-divider {
  display: inline-block;
  width: 1px;
  height: 16px;
  background: #d6cfc2;
  margin: 0 4px;
}

.ghost-btn {
  background: #fdfbf8;
  border: 1px solid #dcd4c6;
  color: #3f3a34;
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  border-radius: 4px;
  box-shadow: none;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ghost-btn:hover {
  background: #f5efe6;
  border-color: var(--accent);
  color: var(--accent);
  transform: none;
}

/* 2. Compact Hero Banner */
.hero.compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 8px 24px;
  background: #f7f3eb;
  border-bottom: 1px solid #e5dec9;
  min-height: 0;
}

.hero.compact .hero-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.hero.compact h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #292524;
  letter-spacing: 0.04em;
}

.hero.compact .hero-desc {
  margin: 0;
  font-size: 12px;
  color: #78716c;
}

.hero.compact .hero-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero.compact .hero-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  color: #57534e;
}

.hero.compact .hero-stat strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
}

.hero.compact .hero-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 3. Authentic Lexicographical Detail Header */
.entry-headword-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  margin-bottom: 18px;
  border-bottom: 2px solid #e6dfd3;
}

.entry-headword-header .detail-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.headword-main-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.entry-headword-header .detail-title,
.entry-headword-header .detail-lemma,
.entry-headword-header .headword-lemma {
  font-family: var(--font-tibetan);
  font-size: 42px;
  line-height: 1.25;
  font-weight: 700;
  color: #1c1917;
  margin: 0;
  letter-spacing: 0.01em;
}

.headword-phonetics-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.detail-wylie-inline {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  color: #44403c;
  background: #f5f2eb;
  border: 1px solid #e2dbd0;
  padding: 2px 9px;
  border-radius: 3px;
}

.headword-ipa-pill,
.headword-lhasa-ipa {
  font-family: var(--font-ipa);
  font-size: 15px;
  font-weight: 600;
  color: #7f1d1d;
  background: #fbf4f2;
  border: 1px solid #e6cbc5;
  padding: 2px 10px;
  border-radius: 3px;
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
}

.entry-headword-header .detail-meta {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-en-gloss {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e5dec9;
  font-size: 13.5px;
  line-height: 1.55;
  color: #57534e;
  font-style: italic;
}

/* 4. Unified Section Headers */
.detail-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #ebe4d8;
}

.detail-section .section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: #57534e;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.detail-section .section-label .phonology-info-btn {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.detail-section .section-label .phonology-info-btn:hover {
  text-decoration: underline;
}

/* 5. De-AI-fied Syllable Structure (Zero Rainbow Pills, Compact Editorial Grid) */
.tibetan-anatomy-card {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.anatomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.anatomy-syllable-card {
  background: #fdfbf8;
  border: 1px solid #e5dec9;
  border-radius: 5px;
  padding: 10px 12px;
  box-shadow: none;
}

.anatomy-syllable-card:hover {
  border-color: #d1c7b7;
  box-shadow: none;
}

.syllable-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #ece5d8;
}

.syllable-glyph {
  font-family: var(--font-tibetan);
  font-size: 24px;
  font-weight: 700;
  color: #1c1917;
  line-height: 1.1;
}

.syllable-index {
  font-size: 11px;
  color: #78716c;
  background: #f5f2eb;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 500;
}

.syllable-parts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Replace rainbow part-pills with classical Tibetan ink & vermilion hierarchy */
.part-pill {
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 3px;
  font-weight: 500;
  box-shadow: none;
}

.part-root {
  background: #fbf0ed !important;
  color: #8b1e0f !important;
  border: 1px solid #dfb9b0 !important;
  font-weight: 700 !important;
}

.part-vowel {
  background: #faf4e8 !important;
  color: #78350f !important;
  border: 1px solid #e5d3b3 !important;
}

.part-prefix,
.part-super,
.part-sub,
.part-suffix,
.part-post {
  background: #f5f3ef !important;
  color: #44403c !important;
  border: 1px solid #dcd7ce !important;
}

/* 6. De-AI-fied Lexical Network Chips (Restrained Paper & Vermilion) */
.cls-chip,
.syn-chip,
.ant-chip,
.assoc-chip {
  background: #fdfbf8 !important;
  border: 1px solid #e5dec9 !important;
  border-left: 2.5px solid #8b1e0f !important;
  border-radius: 4px !important;
  box-shadow: none !important;
}

.cls-chip:hover,
.syn-chip:hover,
.ant-chip:hover,
.assoc-chip:hover {
  background: #f6f1e9 !important;
  border-color: #c7bba8 !important;
  border-left-color: #6f160a !important;
  transform: none !important;
}

.cls-chip .chip-lemma,
.syn-chip .chip-lemma,
.ant-chip .chip-lemma,
.assoc-chip .chip-lemma {
  color: #1c1917 !important;
}

.cls-chip .chip-tag,
.assoc-chip .chip-tag {
  background: #f2ece1 !important;
  color: #57534e !important;
}

/* 7. Clean Example Items */
.example-item {
  background: #fdfbf8;
  border: 1px solid #e7e0d3;
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: 12px 14px;
}

/* Eliminate stacked triple horizontal lines under headword header */
.entry-headword-header .detail-meta {
  border-bottom: none !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

.entry-headword-header + .detail-section,
.honorific-mirror-box + .detail-section {
  border-top: none !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* Native Tibetan Definition (བོད་ཡིག་འགྲེལ་བཤད) from Bod-rgya tshig-mdzod chen-mo */
.sense-bo-def {
  font-family: "Noto Serif Tibetan", "Microsoft Himalaya", serif;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--accent-deep, #5c2618);
  margin: 3px 0 3px 0;
  opacity: 0.92;
}

/* ==================== v8.1 Particle Paradigm Matrix & Example Grammar Strip ==================== */
.particle-paradigm-card {
  background: var(--paper, #fcfaf5);
  border: 1px solid var(--line, #e5ddd0);
  border-radius: 6px;
  padding: 14px 16px;
}
.ppc-header {
  margin-bottom: 10px;
}
.ppc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-deep, #6e160a);
  margin-bottom: 4px;
}
.ppc-canon {
  font-size: 12.5px;
  color: var(--muted, #665e52);
  font-family: 'Noto Serif Tibetan', 'Noto Sans SC', serif;
  line-height: 1.6;
}
.ppc-formula-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  background: rgba(139, 30, 15, 0.04);
  border-left: 3px solid var(--accent, #8b1e0f);
  padding: 6px 10px;
  margin-bottom: 12px;
  font-size: 12.5px;
}
.ppc-tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #8b1e0f);
  white-space: nowrap;
}
.ppc-formula-row code {
  font-family: 'Noto Serif Tibetan', 'Noto Sans SC', sans-serif;
  color: var(--ink, #1f1a15);
}
.ppc-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 10px;
}
.ppc-matrix-table th {
  text-align: left;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.025);
  border-bottom: 1px solid var(--line, #e5ddd0);
  color: var(--muted, #665e52);
  font-weight: 600;
  font-size: 11.5px;
}
.ppc-matrix-table td {
  padding: 6px 8px;
  border-bottom: 1px solid rgba(229, 221, 208, 0.6);
  vertical-align: middle;
}
.ppc-matrix-table tr.is-current-particle {
  background: rgba(139, 30, 15, 0.06);
}
.ppc-form-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff;
  border: 1px solid var(--line, #d8cebe);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 14px;
  font-family: 'Noto Serif Tibetan', serif;
  color: var(--ink, #1f1a15);
  cursor: pointer;
}
.ppc-form-btn:hover {
  border-color: var(--accent, #8b1e0f);
  color: var(--accent, #8b1e0f);
}
.ppc-form-btn.current {
  border-color: var(--accent, #8b1e0f);
  background: var(--accent, #8b1e0f);
  color: #fff;
  font-weight: 600;
}
.ppc-curr-dot {
  font-style: normal;
  font-size: 10px;
  font-family: 'Noto Sans SC', sans-serif;
  opacity: 0.92;
}
.ppc-ex-cell {
  font-family: 'Noto Serif Tibetan', 'Noto Sans SC', serif;
  font-size: 13.5px;
  color: var(--ink, #2b241d);
}
.ppc-contrast-note {
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink, #2b241d);
  border-top: 1px dashed var(--line, #e5ddd0);
  padding-top: 8px;
}

.example-grammar-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed rgba(139, 30, 15, 0.14);
}
.example-grammar-strip.minimal {
  justify-content: flex-end;
  border-top: 0;
  padding-top: 2px;
  margin-top: 4px;
}
.egs-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.egs-label {
  font-size: 11px;
  color: var(--muted, #786f63);
  font-weight: 600;
  margin-right: 2px;
}
.egs-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 1px 7px;
  border: 1px solid var(--line, #dfd6c7);
  border-radius: 3px;
  background: #fdfbf7;
  font-size: 11.5px;
  color: var(--ink, #2b241d);
  cursor: pointer;
}
.egs-pill:hover {
  border-color: var(--accent, #8b1e0f);
  color: var(--accent, #8b1e0f);
}
.egs-pill strong {
  font-family: 'Noto Serif Tibetan', serif;
  font-size: 13px;
  color: var(--accent-deep, #6e160a);
}
.egs-pill span {
  color: var(--muted, #665e52);
}
.ex-seg-btn {
  background: transparent;
  border: 1px solid rgba(139, 30, 15, 0.28);
  color: var(--accent, #8b1e0f);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}
.ex-seg-btn:hover {
  background: rgba(139, 30, 15, 0.06);
}
.dec-coda-tag {
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #8b1e0f);
  background: rgba(139, 30, 15, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
}
.anatomy-deductions {
  margin: 8px 0 0;
  padding: 8px 0 0;
  border-top: 1px dashed var(--line, #e5ddd0);
  font-size: 12.5px;
  color: #44403c;
  line-height: 1.75;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.anatomy-ded-row {
  display: block;
  word-break: break-word;
}
.anatomy-ded-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-deep, #6b1509);
  background: #f8eee9;
  border: 1px solid #e8cfc4;
  border-radius: 3px;
  padding: 0 6px;
  margin-right: 6px;
  vertical-align: baseline;
  line-height: 1.55;
}
.anatomy-ded-text {
  color: #44403c;
}
.ling-ipa {
  font-family: var(--font-ipa);
  font-size: 13px;
  font-weight: 600;
  color: var(--blue, #1d4ed8);
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "calt" 1;
  font-variant-ligatures: common-ligatures contextual;
  white-space: nowrap;
}
.ling-bo {
  font-family: var(--font-tibetan);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--accent-deep, #6b1509);
  line-height: 1.3;
  margin: 0 1px;
}

/* v10.1 Verb Tense Direct Jump & Highlight */
.verb-direct-jump-banner {
  background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
  border: 1px solid #f59e0b;
}
.vmc-cell.vmc-cell-matched {
  border: 2px solid var(--accent, #8b1e0f) !important;
  background: #fff7f3 !important;
  box-shadow: 0 0 0 3px rgba(139, 30, 15, 0.12);
}

/* v10.1 Zero-Dead-End Not-Found UI */
.empty-list-card {
  margin: 12px;
  padding: 16px 14px;
  background: #fafaf7;
  border: 1px dashed #d6d3cb;
  border-radius: 8px;
  text-align: center;
}
.empty-list-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  word-break: break-word;
}
.empty-list-sub {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.55;
  margin: 0 0 12px;
}
.empty-list-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.empty-list-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 5px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
}
.empty-list-btn:hover { background: #f1f5f9; }
.empty-list-btn.accent {
  background: var(--accent, #8b1e0f);
  border-color: var(--accent, #8b1e0f);
  color: #ffffff;
}
.not-found-panel {
  max-width: 780px;
  margin: 8px auto 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.nf-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  background: #fdfbf7;
  border: 1px solid #e6dfd1;
  border-left: 4px solid var(--accent, #8b1e0f);
  border-radius: 8px;
}
.nf-glyph {
  font-family: var(--font-tibetan);
  font-size: 34px;
  color: var(--accent, #8b1e0f);
  background: #fbf0eb;
  border: 1px solid #ead1c7;
  border-radius: 8px;
  min-width: 60px;
  padding: 8px 12px;
  text-align: center;
  line-height: 1.25;
}
.nf-hero-copy h3 {
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--ink);
}
.nf-query-bo {
  font-family: var(--font-tibetan);
  font-size: 20px;
  color: var(--accent-deep);
}
.nf-hero-copy p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
}
.nf-filter-rescue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 7px;
  font-size: 12.5px;
  color: #78350f;
}
.nf-card {
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid var(--line, #e5e5de);
  border-radius: 8px;
}
.nf-card-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.nf-card-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}
.nf-chip-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.nf-jump-card {
  text-align: left;
  padding: 10px 12px;
  background: #fafaf7;
  border: 1px solid #e2dfd5;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.nf-jump-card:hover {
  border-color: var(--accent, #8b1e0f);
  background: #fff9f5;
  transform: translateY(-1px);
}
.nf-jc-top {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 4px;
}
.nf-jc-bo {
  font-family: var(--font-tibetan);
  font-size: 19px;
  font-weight: 600;
  color: var(--accent-deep);
}
.nf-jc-ipa {
  font-family: var(--font-ipa);
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
}
.nf-jc-wylie {
  font-size: 11px;
  color: var(--muted);
  font-family: monospace;
}
.nf-jc-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: #166534;
  background: #dcfce7;
  border-radius: 4px;
  padding: 1px 6px;
}
.nf-jc-gloss {
  font-size: 12px;
  color: var(--ink);
  line-height: 1.45;
}
.nf-jc-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}
.nf-seg-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.nf-seg-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #e2dfd5;
  background: #fafaf7;
}
.nf-seg-chip.matched {
  cursor: pointer;
  border-color: #d8c2b7;
  background: #fffaf7;
}
.nf-seg-chip.matched:hover {
  border-color: var(--accent, #8b1e0f);
  background: #fbf0eb;
}
.nf-seg-chip.raw {
  opacity: 0.78;
}
.nf-seg-bo {
  font-family: var(--font-tibetan);
  font-size: 17px;
  font-weight: 600;
  color: var(--accent-deep);
}
.nf-seg-ipa {
  font-family: var(--font-ipa);
  font-size: 11.5px;
  color: var(--blue);
}
.nf-seg-zh {
  font-size: 11.5px;
  color: #475569;
}
.nf-live-ipa-bar {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  background: #fafaf7;
  border: 1px solid #e5e2d8;
  border-radius: 6px;
}
.nf-bo-sample {
  font-family: var(--font-tibetan);
  font-size: 22px;
  color: var(--accent-deep);
}
.nf-ipa-val {
  font-family: var(--font-ipa);
  font-size: 16px;
  font-weight: 600;
  color: var(--blue);
}
.nf-ipa-note {
  font-size: 11px;
  color: var(--muted);
  background: #f1f5f9;
  padding: 2px 7px;
  border-radius: 10px;
}
.nf-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 2px;
}
.nf-btn-primary, .nf-btn-accent {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  background: var(--accent, #8b1e0f);
  color: #ffffff;
  cursor: pointer;
}
.nf-btn-primary:hover, .nf-btn-accent:hover { background: var(--accent-deep, #6b1509); }
.nf-btn-secondary {
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
}
.nf-btn-secondary:hover { background: #f8fafc; border-color: #94a3b8; }
.nf-btn-link {
  border: none;
  background: transparent;
  color: var(--accent, #8b1e0f);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.nf-btn-link:hover { text-decoration: underline; }
.nf-tips-footer {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.65;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}
.nf-tips-footer code {
  font-family: var(--font-tibetan), monospace;
  font-size: 13px;
  background: #f1f5f9;
  color: var(--accent-deep);
  padding: 1px 5px;
  border-radius: 3px;
}

/* Cloud Audio CDN active on public static Space (Valendir/tibetan-dict-audio) — keep all audio buttons visible */

/* Contextual Sentence-Meaning Popover Enhancements (v9.5) */
.lex-popover { width: 320px; max-width: 92vw; }
.lex-popover-row-primary { background: #fffbf5; border-left: 3px solid #9a3412; padding: 5px 8px; border-radius: 0 4px 4px 0; }
.popover-ctx-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.popover-row-val-strong { color: #0f172a; font-weight: 600; }
.lex-popover-row-secondary { font-size: 11.5px; padding: 2px 4px; opacity: 0.85; }
.popover-row-label.muted, .popover-row-val.muted { color: #64748b; font-weight: 500; }
.colloc-ex-tib .flowing-sentence { font-size: 1.05rem; }

/* v9.8 Universal IPA Pills across Suggestions, Verbs, Declension, Favorites, Segmenter */
.suggestion-ipa {
  font-family: var(--font-ipa);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--blue);
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "calt" 1;
}
.vmc-cell-ipa,
.vt-cell-ipa,
.dec-cell-ipa,
.seg-card-ipa,
.int-line-ipa {
  font-family: var(--font-ipa);
  font-size: 11.5px;
  color: #7f1d1d;
  font-weight: 500;
  letter-spacing: 0;
  font-feature-settings: "liga" 1, "calt" 1;
  line-height: 1.3;
}
.vmc-cell-ipa { margin-top: 2px; }
.vt-cell-ipa { display: block; margin-top: 2px; font-size: 11px; color: var(--blue); }
.dec-cell-ipa { display: block; margin-top: 2px; font-size: 11px; color: var(--blue); }
.seg-card-ipa { margin-left: 6px; color: var(--blue); font-size: 12px; font-weight: 600; }
.int-line-ipa { font-size: 10.5px; color: var(--blue); margin-top: 1px; }
.fav-item-wylie { font-family: monospace; font-size: 11px; color: var(--muted); }

/* v10.2 Crisp Tibetan Typography inside Verb Jump Banners & Autocomplete Alerts */
.verb-retrospective-banner [lang="bo"],
.suggestion-lemma-alert [lang="bo"] {
  font-family: var(--font-tibetan);
  font-size: 16.5px;
  font-weight: 600;
  color: var(--accent-deep, #6b1509);
  line-height: 1.3;
  margin: 0 2px;
}
.verb-homograph-banner {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* v10.3 Instant Audio Loading / Playing Feedback */
@keyframes audioPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.audio-btn.loading,
.ex-audio-btn.loading {
  background: #fef3c7;
  border-color: #f59e0b;
  color: #92400e;
  animation: audioPulse 0.9s ease-in-out infinite;
}


/* === v10.9 Unified Yi-Editorial Design System & Native light-dark() === */
:root {
  color-scheme: light dark;
  --bg: light-dark(#f8f6f0, #12100f);
  --card: light-dark(#ffffff, #1b1816);
  --surface: light-dark(#ffffff, #1b1816);
  --surface-alt: light-dark(#f3efe6, #241f1c);
  --surface-hover: light-dark(#faf5ec, #2a2420);
  --ink: light-dark(#1a1715, #f1ece4);
  --muted: light-dark(#645c54, #a89f96);
  --line: light-dark(#dfd8cc, #362f2a);
  --accent: light-dark(#8b1e0f, #e05a54);
  --accent-deep: light-dark(#6f160a, #f07b75);
  --accent-soft: light-dark(#fbf0eb, #311918);
  --gold: light-dark(#bd8b44, #e4ad48);
  --gold-soft: light-dark(#fcf6ec, #2c2314);
  --blue: light-dark(#2a5a7b, #74b9e6);
  --slate: light-dark(#475569, #94a3b8);
  --shadow: light-dark(0 4px 18px rgba(0, 0, 0, 0.05), 0 4px 22px rgba(0, 0, 0, 0.45));
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

.theme-label-to-light { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-label-to-dark { display: none; }
  :root:not([data-theme="light"]) .theme-label-to-light { display: inline; }
}
:root[data-theme="dark"] .theme-label-to-dark { display: none; }
:root[data-theme="dark"] .theme-label-to-light { display: inline; }

.dialect-note {
  margin-top: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 5px;
}

/* Harmonized surfaces using tokens instead of hardcoded white */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.hero,
.sidebar,
.results-pane,
.detail-pane,
.dialect-card,
.entry-card,
.sense-item,
.example-card,
.dialog-inner,
dialog {
  background-color: var(--card);
  color: var(--ink);
  border-color: var(--line);
}
.search-box,
.search-box input,
.entry-item,
.chip,
.ghost-btn,
.layout-toggle-btn,
.cat-mode-btn,
.random-learn-btn,
.share-card-btn,
.fav-toggle-btn {
  color: var(--ink);
  border-color: var(--line);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .search-box,
  :root:not([data-theme="light"]) .search-suggestions,
  :root:not([data-theme="light"]) .dialect-card,
  :root:not([data-theme="light"]) .sense-item,
  :root:not([data-theme="light"]) .example-card,
  :root:not([data-theme="light"]) .seo-footer,
  :root:not([data-theme="light"]) .ghost-btn,
  :root:not([data-theme="light"]) .layout-toggle-btn,
  :root:not([data-theme="light"]) .chip,
  :root:not([data-theme="light"]) .entry-item {
    background-color: var(--surface-alt);
    color: var(--ink);
    border-color: var(--line);
  }
  :root:not([data-theme="light"]) .entry-item.active,
  :root:not([data-theme="light"]) .entry-item:hover {
    background-color: var(--accent-soft);
    border-color: var(--accent);
  }
  :root:not([data-theme="light"]) input,
  :root:not([data-theme="light"]) select,
  :root:not([data-theme="light"]) textarea {
    background-color: var(--surface-alt);
    color: var(--ink);
    border-color: var(--line);
  }
}
:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .search-suggestions,
:root[data-theme="dark"] .dialect-card,
:root[data-theme="dark"] .sense-item,
:root[data-theme="dark"] .example-card,
:root[data-theme="dark"] .seo-footer,
:root[data-theme="dark"] .ghost-btn,
:root[data-theme="dark"] .layout-toggle-btn,
:root[data-theme="dark"] .chip,
:root[data-theme="dark"] .entry-item {
  background-color: var(--surface-alt);
  color: var(--ink);
  border-color: var(--line);
}
:root[data-theme="dark"] .entry-item.active,
:root[data-theme="dark"] .entry-item:hover {
  background-color: var(--accent-soft);
  border-color: var(--accent);
}
:root[data-theme="dark"] input,
:root[data-theme="dark"] select,
:root[data-theme="dark"] textarea {
  background-color: var(--surface-alt);
  color: var(--ink);
  border-color: var(--line);
}

/* ==================== v11.1 DAILY READER & SINO-TIBETAN ETYMOLOGY ==================== */
:root {
  --jade: #1d6f5c;
  --jade-deep: #145345;
  --jade-soft: #ebf7f3;
  --jade-border: #b6dfd2;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --jade: #4fd1b5;
    --jade-deep: #7ee3cd;
    --jade-soft: #132a25;
    --jade-border: #255348;
  }
}
:root[data-theme="dark"] {
  --jade: #4fd1b5;
  --jade-deep: #7ee3cd;
  --jade-soft: #132a25;
  --jade-border: #255348;
}
@supports (color: light-dark(white, black)) {
  :root {
    --jade: light-dark(#1d6f5c, #4fd1b5);
    --jade-deep: light-dark(#145345, #7ee3cd);
    --jade-soft: light-dark(#ebf7f3, #132a25);
    --jade-border: light-dark(#b6dfd2, #255348);
  }
}

/* Prevent background page scrolling under modal dialogs (MWG prevent-page-scroll-under-modal-dialog) */
dialog:modal {
  overscroll-behavior: contain;
}
dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

/* Topbar flagship action pills */
.ghost-btn.accent-pill-btn {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.ghost-btn.accent-pill-btn:hover {
  background: var(--accent);
  color: #ffffff;
}
.ghost-btn.jade-pill-btn {
  border-color: var(--jade-border);
  color: var(--jade);
  background: var(--jade-soft);
  font-weight: 600;
}
.ghost-btn.jade-pill-btn:hover,
.ghost-btn.jade-pill-btn.active {
  background: var(--jade);
  border-color: var(--jade);
  color: #ffffff;
}

/* Homepage Welcome Launch Cards */
.home-launch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 720px;
  margin: 22px auto 0;
  text-align: left;
}
.home-launch-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}
.home-launch-card.crimson { border-left: 4px solid var(--accent); }
.home-launch-card.jade { border-left: 4px solid var(--jade); }
.home-launch-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}
.home-launch-card.crimson:hover { border-color: var(--accent); background: var(--accent-soft); }
.home-launch-card.jade:hover { border-color: var(--jade); background: var(--jade-soft); }
.hlc-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.home-launch-card.crimson .hlc-kicker { color: var(--accent); }
.home-launch-card.jade .hlc-kicker { color: var(--jade); }
.hlc-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}
.hlc-desc {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

/* Reader Return Banner in Detail Pane */
.reader-return-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  font-size: 12.5px;
}
.rrb-info { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rrb-badge {
  background: var(--accent);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.rrb-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.rrb-btn {
  background: var(--accent);
  color: #ffffff;
  border: 0;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.rrb-btn:hover { background: var(--accent-deep); }
.rrb-dismiss {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
}

/* ==================== SINO-TIBETAN ETYMOLOGY PLATE & BADGES ==================== */
.card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.etym-card-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--jade);
  background: var(--jade-soft);
  border: 1px solid var(--jade-border);
  white-space: nowrap;
  flex-shrink: 0;
}
.etym-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--jade);
  background: var(--jade-soft);
  border: 1px solid var(--jade-border);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.etym-hero-pill:hover {
  background: var(--jade);
  color: #ffffff;
}
.section-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.section-label-row .section-label { margin-bottom: 0; }
.etym-sec-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--jade);
  background: var(--jade-soft);
  border: 1px solid var(--jade-border);
  padding: 2px 9px;
  border-radius: 999px;
}
.etym-plate-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.etym-plate-card {
  background: var(--card);
  border: 1px solid var(--jade-border);
  border-left: 4px solid var(--jade);
  border-radius: 10px;
  padding: 14px 16px;
}
.etym-plate-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.etym-match-pair {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.etym-bo-word {
  font-family: var(--font-tibetan);
  font-size: 24px;
  line-height: 1.5;
  color: var(--ink);
}
.etym-bo-hl {
  display: inline-block;
  background: var(--jade-soft);
  color: var(--jade-deep);
  border: 1px solid var(--jade-border);
  border-radius: 6px;
  padding: 0 7px;
  line-height: 1.35;
  font-weight: 700;
}
.etym-bo-dim { color: var(--muted); }
.etym-tsheg { color: var(--muted); }
.etym-arrow {
  font-size: 16px;
  font-weight: 700;
  color: var(--jade);
}
.etym-oc-char-wrap {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  flex-wrap: wrap;
}
.etym-oc-kicker {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--jade);
  background: var(--jade-soft);
  padding: 2px 7px;
  border-radius: 4px;
}
.etym-oc-hanzi {
  font-family: "Noto Serif SC", "Songti SC", Georgia, serif;
  font-size: 26px;
  line-height: 1.1;
  color: var(--accent);
}
.etym-oc-gloss {
  font-size: 13px;
  color: var(--muted);
}
.etym-same-root-btn {
  border: 1px solid var(--jade-border);
  background: var(--jade-soft);
  color: var(--jade);
  padding: 4px 11px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.etym-same-root-btn:hover {
  background: var(--jade);
  color: #ffffff;
}
.etym-recon-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}
.etym-recon-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
.etym-recon-sys {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.etym-recon-ipa {
  font-family: var(--font-ipa);
  font-size: 17px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.01em;
}
.etym-recon-meta {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}
.etym-recon-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  color: var(--ink);
  background: var(--card);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.etym-witness-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.etym-wit-pill {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--font-ipa);
}
.etym-wit-pill strong {
  font-family: inherit;
  color: var(--muted);
  margin-right: 3px;
}
.etym-wit-pill.highlight {
  background: var(--jade-soft);
  border-color: var(--jade-border);
  color: var(--jade-deep);
}
.etym-wit-pill.highlight strong { color: var(--jade); }
.etym-note-row {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 5px;
}
.etym-cite-row {
  font-size: 11.5px;
  color: var(--muted);
}

/* ==================== AUTHENTIC TIBETAN DAILY READER DIALOG ==================== */
.daily-reader-dialog {
  width: min(1320px, 96vw);
  height: min(880px, 92vh);
  max-width: 96vw;
  max-height: 92vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}
.daily-reader-dialog::backdrop {
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
}
.dr-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--bg);
}
.dr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.dr-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent);
}
.dr-header h2 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}
.dr-header-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dr-mode-seg {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
}
.dr-mode-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  cursor: pointer;
}
.dr-mode-btn.active {
  background: var(--accent);
  color: #ffffff;
}
.dr-close-btn {
  position: static;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.dr-close-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Single-row scrollable category tablist (MWG tabs pattern) */
.dr-cat-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 20px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.dr-cat-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scroll-snap-type: inline proximity;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
}
.dr-cat-tabs::-webkit-scrollbar { display: none; }
.dr-cat-tab {
  position: relative;
  flex: none;
  scroll-snap-align: start;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.dr-cat-tab[aria-selected="true"] {
  color: var(--accent);
}
.dr-cat-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 8px 0;
  border-block-end: 3px solid var(--accent);
}
.dr-tab-cnt {
  font-size: 11px;
  opacity: 0.75;
  margin-left: 2px;
}
.dr-search-wrap {
  flex-shrink: 0;
  width: 240px;
}
.dr-search-wrap input {
  width: 100%;
  padding: 6px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 12.5px;
}

/* 3-Column Studio Body */
.dr-body {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr) 348px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.dr-sidebar {
  border-right: 1px solid var(--line);
  background: var(--card);
  overflow-y: auto;
  padding: 10px;
}
.dr-doc-list { display: flex; flex-direction: column; gap: 8px; }
.dr-doc-item {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.dr-doc-item:hover { border-color: var(--accent); }
.dr-doc-item.active {
  background: var(--accent-soft);
  border-color: var(--accent);
}
.dr-doc-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}
.dr-lvl-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--gold-soft);
  color: var(--gold);
  border: 1px solid var(--line);
}
.dr-native-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.dr-audio-pill,
.dr-cat-mini,
.dr-cat-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--line);
}
.dr-doc-title-zh {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.35;
}
.dr-doc-title-bo {
  font-family: var(--font-tibetan);
  font-size: 15px;
  color: var(--accent-deep);
  margin-top: 2px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dr-doc-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* Center Reading Canvas */
.dr-main {
  overflow-y: auto;
  padding: 18px 22px 28px;
  background: var(--bg);
}
.dr-art-head {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.dr-art-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.dr-art-title-bo {
  margin: 4px 0 2px;
  font-family: var(--font-tibetan);
  font-size: 26px;
  line-height: 1.5;
  color: var(--accent-deep);
}
.dr-art-title-zh {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}
.dr-art-source {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.dr-art-grammar {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  font-size: 12.5px;
  color: var(--ink);
}
.dr-art-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.dr-tool-btn {
  padding: 6px 12px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.dr-tool-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.dr-tool-btn.primary.playing {
  background: var(--accent-deep);
}
.dr-tool-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}
.dr-tip-hint {
  font-size: 11.5px;
  color: var(--muted);
  margin-left: auto;
}
.dr-cog-dot-legend {
  color: var(--jade);
  font-weight: 600;
  border-bottom: 2px dotted var(--jade);
}

/* Interactive Sentences */
.dr-sentences-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dr-sent-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px 16px;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.dr-sent-card.is-speaking {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.dr-sent-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.dr-sent-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  padding-top: 9px;
  flex-shrink: 0;
}
.dr-sent-bo {
  flex: 1;
  font-family: var(--font-tibetan);
  font-size: 22px;
  line-height: 2.2;
  color: var(--ink);
  word-break: normal;
  overflow-wrap: break-word;
}
.dr-word {
  display: inline;
  cursor: pointer;
  padding: 2px 2px;
  border-radius: 4px;
  transition: background 0.14s ease, color 0.14s ease;
}
.dr-word.has-cognate {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-decoration-color: var(--jade);
  text-underline-offset: 5px;
}
.dr-word.is-particle {
  color: var(--blue);
}
.dr-word:hover,
.dr-word:focus-visible {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 5px;
}
.dr-word.is-selected {
  background: var(--accent-soft);
  color: var(--accent-deep);
  box-shadow: inset 0 -2.5px 0 var(--accent);
  border-radius: 4px;
  text-decoration: none;
}
.dr-word.stem-before-enclitic { padding-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.dr-word.enclitic-word { padding-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.dr-punct { color: var(--muted); }
.dr-sent-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 6px;
}
.dr-sent-audio-btn {
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.dr-sent-audio-btn:hover { background: var(--accent); color: #ffffff; }
.dr-sent-seg-btn {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
}
.dr-sent-seg-btn:hover { border-color: var(--ink); color: var(--ink); }
.dr-sent-zh {
  margin-top: 8px;
  padding-left: 26px;
  font-size: 14.5px;
  color: var(--ink);
  line-height: 1.6;
}
.dr-reveal-zh-btn {
  margin-top: 8px;
  margin-left: 26px;
  padding: 4px 11px;
  border-radius: 6px;
  border: 1px dashed var(--line);
  background: var(--bg);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}
.dr-reveal-zh-btn:hover { border-color: var(--accent); color: var(--accent); }
.dr-sent-note {
  margin-top: 6px;
  margin-left: 26px;
  padding: 6px 10px;
  border-radius: 6px;
  background: var(--bg);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
}

/* Key Vocab Strip */
.dr-vocab-section {
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.dr-vocab-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
}
.dr-vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.dr-vocab-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.dr-vocab-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.dr-vc-bo { font-family: var(--font-tibetan); font-size: 17px; color: var(--accent-deep); }
.dr-vc-ipa { font-family: var(--font-ipa); font-size: 11px; color: var(--blue); }
.dr-vc-zh { font-size: 12px; color: var(--muted); }

/* Right Live Word Inspector Panel */
.dr-inspector {
  border-left: 1px solid var(--line);
  background: var(--card);
  overflow-y: auto;
  padding: 16px;
}
.dr-insp-mobile-bar { display: none; }
.dr-insp-empty {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
}
.dr-insp-glyph {
  font-family: var(--font-tibetan);
  font-size: 46px;
  color: var(--accent);
  opacity: 0.7;
  margin-bottom: 8px;
}
.dr-insp-empty h4 { margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.dr-insp-empty p { font-size: 12.5px; line-height: 1.65; margin: 0 0 8px; }
.dr-insp-sub { font-size: 11.5px; opacity: 0.85; }
.dr-insp-quick { margin-top: 18px; text-align: left; }
.dr-insp-quick-lbl { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.dr-insp-quick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dr-hist-pill {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
}
.dr-hist-pill:hover,
.dr-hist-pill.current { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

.dr-insp-head {
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 12px;
}
.dr-insp-lemma-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.dr-insp-lemma {
  font-family: var(--font-tibetan);
  font-size: 30px;
  line-height: 1.35;
  color: var(--accent-deep);
}
.dr-insp-surf {
  font-size: 12px;
  color: var(--muted);
}
.dr-insp-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.dr-insp-wylie {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--muted);
}
.dr-insp-pos {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
}
.dr-fav-btn {
  padding: 2px 8px;
  border-radius: 5px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  font-size: 11.5px;
  cursor: pointer;
}
.dr-fav-btn.saved { border-color: var(--gold); color: var(--gold); background: var(--gold-soft); }
.dr-insp-verb-banner {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--gold-soft);
  border: 1px solid var(--gold);
  font-size: 12px;
  margin-bottom: 10px;
  color: var(--ink);
}
.dr-insp-colloq-box {
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  margin-bottom: 10px;
}
.dr-insp-colloq-txt { font-size: 13px; color: var(--ink); line-height: 1.55; }
.dr-insp-section { margin-bottom: 12px; }
.dr-insp-sec-lbl {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 4px;
}
.dr-insp-gloss {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.6;
}
.dr-insp-gloss-en {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.dr-insp-grammar-box {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
}
.dr-insp-desc { font-size: 12.5px; color: var(--ink); line-height: 1.55; }
.dr-insp-ipa-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.dr-ipa-cell {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dr-ipa-pt { font-size: 10.5px; color: var(--muted); }
.dr-ipa-val { font-family: var(--font-ipa); font-size: 12.5px; color: var(--blue); font-weight: 600; }
.dr-insp-etym-box {
  background: var(--jade-soft);
  border: 1px solid var(--jade-border);
  border-left: 3px solid var(--jade);
  border-radius: 8px;
  padding: 9px 11px;
  margin-bottom: 12px;
}
.dr-insp-etym-head {
  font-size: 11px;
  font-weight: 700;
  color: var(--jade);
  margin-bottom: 6px;
}
.dr-insp-etym-row { margin-bottom: 6px; }
.dr-insp-etym-row:last-child { margin-bottom: 0; }
.dr-etym-pair { display: block; font-size: 14px; color: var(--ink); }
.dr-etym-ipa { display: block; font-family: var(--font-ipa); font-size: 12px; color: var(--blue); margin-top: 2px; }
.dr-etym-note { font-size: 11.5px; color: var(--muted); margin-top: 3px; line-height: 1.5; }
.dr-insp-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.dr-jump-main-btn {
  width: 100%;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dr-jump-main-btn:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
}
.dr-open-grammar-btn { width: 100%; padding: 7px 12px; border-radius: 8px; }
.dr-insp-trail {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

/* Mobile Responsive Daily Reader & Etymology Plate */
@media (max-width: 900px) {
  .home-launch-grid,
  .etym-recon-grid {
    grid-template-columns: 1fr;
  }
  .daily-reader-dialog {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  .dr-header { padding: 10px 12px; gap: 8px; }
  .dr-kicker { display: none; }
  .dr-header h2 { font-size: 15.5px; white-space: nowrap; }
  .dr-header-controls { gap: 6px; }
  .dr-mode-btn { white-space: nowrap; font-size: 11px; padding: 5px 8px; }
  .dr-close-btn { width: 28px; height: 28px; flex-shrink: 0; }
  .dr-cat-bar { padding: 0 12px; flex-wrap: wrap; gap: 6px; }
  .dr-search-wrap { width: 100%; padding-bottom: 8px; }
  .dr-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    position: relative;
  }
  .dr-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    max-height: 132px;
    padding: 8px 10px;
  }
  .dr-doc-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
  }
  .dr-doc-item {
    min-width: 210px;
    max-width: 230px;
    flex-shrink: 0;
  }
  .dr-main { padding: 12px 12px 90px; }
  .dr-sent-bo { font-size: 20px; line-height: 2.1; }
  .dr-tip-hint { margin-left: 0; width: 100%; }
  .dr-inspector {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 62dvh;
    border-left: 0;
    border-top: 2px solid var(--accent);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 32px rgba(0, 0, 0, 0.25);
    transform: translateY(105%);
    transition: transform 0.22s ease;
    z-index: 20;
  }
  .dr-inspector.mobile-open {
    transform: translateY(0);
  }
  .dr-insp-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
  }
  .dr-insp-mobile-close {
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--ink);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11.5px;
    cursor: pointer;
  }
}
