
:root { color-scheme: light; }
* { box-sizing: border-box; }
html, body {
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
  display: flex;
  min-height: 100vh;
}
/* Ensure consistent font across UI elements (excluding textarea for Burmese text) */
button, input, select, label, span, div, p, h1, h2, h3, h4, h5, h6 {
  font-family: inherit;
}
/* ===================== LEFT SIDEBAR MENU ===================== */
.left-menu {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 280px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.06);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, width 0.25s ease;
}
.left-menu.collapsed {
  transform: translateX(-100%);
}
/* Menu toggle - mirrors #panel-toggle on right side */
.menu-toggle {
  position: fixed;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 28px;
  height: 60px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-left: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 0 8px rgba(0,0,0,0.06);
  z-index: 1001;
  transition: left 0.25s ease;
}
.menu-toggle.menu-open {
  left: 280px;
}
.menu-toggle:hover {
  background: #f9fafb;
}
.menu-toggle svg {
  width: 16px;
  height: 16px;
  color: #6b7280;
  transition: transform 0.2s ease;
}
.menu-toggle.menu-open svg {
  transform: rotate(180deg);
}
.menu-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}
/* Menu Sections */
.menu-section {
  border-bottom: 1px solid #f3f4f6;
}
.menu-section:last-child {
  border-bottom: none;
}
.menu-section-header {
  width: 100%;
  padding: 14px 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  text-align: left;
  transition: background 0.15s ease;
}
.menu-section-header:hover {
  background: #f9fafb;
}
.menu-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
}
.menu-chevron {
  width: 18px;
  height: 18px;
  color: #9ca3af;
  transition: transform 0.2s ease;
}
.menu-section.open .menu-chevron {
  transform: rotate(180deg);
}
.menu-section-content {
  display: none;
  padding: 0 20px 16px 20px;
}
.menu-section.open .menu-section-content {
  display: block;
}
/* Menu Groups */
.menu-group {
  margin-bottom: 16px;
}
.menu-group:last-child {
  margin-bottom: 0;
}
.menu-group-title {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
/* Toggle Switches */
.menu-toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  cursor: pointer;
  font-size: 13px;
  color: #374151;
}
.menu-toggle-label input[type="checkbox"] {
  display: none;
}
.menu-toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  background: #d1d5db;
  border-radius: 10px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}
.menu-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.menu-toggle-label input[type="checkbox"]:checked + .menu-toggle-switch {
  background: #3b82f6;
}
.menu-toggle-label input[type="checkbox"]:checked + .menu-toggle-switch::after {
  transform: translateX(16px);
}
/* Slider */
.menu-slider-label {
  display: block;
  padding: 8px 0;
  font-size: 13px;
  color: #374151;
}
.menu-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.menu-slider {
  flex: 1;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #e5e7eb;
  border-radius: 3px;
  outline: none;
}
.menu-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: #3b82f6;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}
.menu-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #3b82f6;
  border-radius: 50%;
  cursor: pointer;
  border: none;
}
.menu-slider-value {
  min-width: 24px;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  text-align: center;
}
.menu-reset-btn {
  padding: 4px 8px;
  font-size: 11px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  cursor: pointer;
  color: #6b7280;
}
.menu-reset-btn:hover {
  background: #e5e7eb;
}
.menu-hint {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 6px;
}
/* Menu Text (About, Bio, Contact) */
.menu-text {
  font-size: 13px;
  line-height: 1.6;
  color: #4b5563;
}
.menu-text p {
  margin: 0 0 12px 0;
}
.menu-text p:last-child {
  margin-bottom: 0;
}
.menu-text a {
  color: #2563eb;
  text-decoration: none;
}
.menu-text a:hover {
  text-decoration: underline;
}
.menu-text strong {
  color: #111827;
}
/* Main Container - fixed padding, menu overlays */
#main-container {
  flex: 1;
  padding: 24px 64px;
  overflow-y: visible;
}
#main-container.panel-open {
  margin-right: 0;
}
/* Responsive adjustments */
@media (max-width: 1200px) {
  .left-menu {
    width: 260px;
  }
  .menu-toggle.menu-open {
    left: 260px;
  }
}
@media (max-width: 900px) {
  .left-menu {
    width: 240px;
  }
  .menu-toggle.menu-open {
    left: 240px;
  }
}
@media (max-width: 700px) {
  .left-menu {
    width: 280px;
    max-width: 85vw;
  }
  .menu-toggle.menu-open {
    left: min(280px, 85vw);
  }
  #main-container {
    padding: 24px 44px;
  }
}
/* ===================== HERO BANNER ===================== */
.hero-banner {
  position: relative;
  margin-left: -64px;
  margin-right: -64px;
  margin-top: -24px;
  margin-bottom: 18px;
  height: 220px;
  overflow: hidden;
  background: #1a1209;
  border: none;
  border-radius: 0;
}
.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  display: block;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 10, 3, 0.25) 0%,
    rgba(15, 10, 3, 0.10) 35%,
    rgba(15, 10, 3, 0.15) 55%,
    rgba(15, 10, 3, 0.55) 100%
  );
  pointer-events: none;
}
.hero-header {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  padding-bottom: 28px;
  z-index: 2;
}
.hero-title {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 0, 0, 0.25);
}
@media (max-width: 700px) {
  .hero-banner {
    height: 170px;
    margin-left: -44px;
    margin-right: -44px;
  }
  .hero-header {
    padding: 14px 18px;
  }
  .hero-title {
    font-size: 17px;
    letter-spacing: 0.10em;
  }
}
#reader-app {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 18px 20px 18px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
  border: 1px solid #e5e7eb;
}
.reader-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #111827;
}
.reader-subtitle {
  font-size: 13px;
  color: #6b7280;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#display-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* Flashcard button in header */
#flashcardModeBtn {
  background: #10b981;
  border: none;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #ecfdf5;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
#flashcardModeBtn:hover {
  background: #059669;
}
/* Legacy dropdown styles - kept for compatibility */
.dropdown-section {
  padding: 6px 0;
}
.dropdown-title {
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  padding: 0 4px;
}
.dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 6px 0;
}
.grammar-overlay-panel {
  position: absolute;
  top: 0;
  right: calc(100% + 8px);
  left: auto;
  width: 320px;
  max-height: 360px;
  background: white;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  padding: 10px;
  z-index: 1100;
  overflow-y: auto;
}
.grammar-overlay-panel h4 {
  margin: 0 0 8px 0;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
}
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 4px;
  padding: 4px 0;
}
.toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  user-select: none;
}
.toggle-label:hover {
  background: #f3f4f6;
}
.toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #2563eb;
}
.toggle-label input[type="number"] {
  margin-left: auto;
  width: 56px;
  padding: 2px 6px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  color: #374151;
  background: #f9fafb;
  text-align: right;
}
.toggle-label span {
  font-size: 13px;
  color: #374151;
}
.toggle-label.threshold-setting {
  flex-wrap: nowrap;
}
.toggle-label.threshold-setting input[type="number"] {
  margin-left: auto;
}
.setting-explanation {
  font-size: 11px;
  color: #6b7280;
  padding: 4px 8px 6px 8px;
  line-height: 1.4;
}
.reset-btn {
  margin-left: 6px;
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid #d1d5db;
  background: #f9fafb;
  border-radius: 4px;
  cursor: pointer;
  color: #6b7280;
}
.reset-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
  color: #374151;
}
.reader-input-container {
  border-radius: 10px;
  border: 1px dashed #d1d5db;
  background: #f9fafb;
  padding: 10px;
}
.reader-input-container.drag-over {
  border-color: #0ea5e9;
  background: #e0f2fe;
}
.reader-input-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #6b7280;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.reader-input-label .right {
  font-weight: 500;
  font-size: 11px;
  color: #9ca3af;
}
.reader-textarea {
  width: 100%;
  border: 1px solid #d1d5db;
  outline: none;
  resize: none;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  font-size: 16px;
  line-height: 1.6;
  font-family: "Noto Sans Myanmar", "Myanmar Text", system-ui, sans-serif;
}
.reader-textarea::placeholder {
  color: #9ca3af;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.reader-pager {
  width: 100%;
  resize: none;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  padding: 0;
}

/* Native PDF.js viewer mode inside sourcePager */
.reader-pager.pdfjs-native-mode {
  background: #525659;
  overflow: hidden;
  padding: 0;
  position: relative;
}
.reader-pager.pdfjs-native-mode .pdfjs-host-iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #525659;
}
.reader-pager.pdfjs-native-mode .pdfViewer {
  padding: 0;
  width: 100%;
  height: 100%;
}
.reader-pager.pdfjs-native-mode .pdfViewer .page {
  margin: 0 auto 8px auto;
  border: none;
  background: white;
}
.reader-pager.pdfjs-native-mode .pdfViewer .textLayer {
  inset: 0;
}
.reader-pager.pdfjs-native-mode .pdfViewer .canvasWrapper {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* PDF.js page containers */
.pdfjs-pages-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
}
.pdfjs-page {
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  position: relative;
  overflow: hidden;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}
.pdfjs-page-header {
  position: absolute;
  top: 4px;
  left: 8px;
  z-index: 10;
  background: rgba(255,255,255,0.85);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  color: #6b7280;
  user-select: none;
  pointer-events: none;
}
.pdfjs-page canvas {
  display: block;
  width: 100%;
  height: auto;
}
.pdfjs-page .textLayer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  opacity: 0.25;
  line-height: 1;
}
.pdfjs-page .textLayer span {
  position: absolute;
  white-space: pre;
  color: transparent;
  pointer-events: all;
}
.pdfjs-page .textLayer span::selection {
  background: rgba(0, 0, 255, 0.3);
}
.reader-doc-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 16px;
  line-height: 1.6;
  color: #111827;
  font-family: "Noto Sans Myanmar", "Myanmar Text", system-ui, sans-serif;
  padding: 12px;
}
.reader-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}
.reader-file-row .file-button {
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  color: #111827;
  cursor: pointer;
}
.reader-file-row .file-button:hover {
  border-color: #0ea5e9;
}
.file-name-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  padding: 3px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #f9fafb;
  font-size: 11px;
  color: #374151;
  max-width: 320px;
}
.file-name-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 280px;
}
.file-clear-btn {
  border: none;
  background: transparent;
  color: #6b7280;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
}
.file-clear-btn:hover { color: #111827; }

/* Original/Text view toggle switch */
.orig-view-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  padding: 4px 8px;
  border-radius: 6px;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  font-size: 11px;
  color: #374151;
}
.orig-view-toggle:hover {
  background: #e5e7eb;
}
.orig-view-toggle input[type="checkbox"] {
  display: none;
}
.orig-view-toggle .toggle-slider {
  width: 28px;
  height: 16px;
  background: #d1d5db;
  border-radius: 8px;
  position: relative;
  transition: background 0.2s;
}
.orig-view-toggle .toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.orig-view-toggle input:checked + .toggle-slider {
  background: #2563eb;
}
.orig-view-toggle input:checked + .toggle-slider::after {
  transform: translateX(12px);
}
.orig-view-toggle .toggle-text {
  font-weight: 500;
}

.reader-status {
  margin-top: 8px;
  font-size: 11px;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.reader-status span {
  white-space: nowrap;
}
.status-inline {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
}
.reader-output {
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  min-height: 140px;
  font-size: 18px;
  line-height: 2.2;
  word-wrap: break-word;
  white-space: pre-wrap;
  font-family: "Noto Sans Myanmar", "Myanmar Text", system-ui, sans-serif;
  position: relative;
  color: #111827;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: top center;
}
.reader-output.orig-view-bg {
  background-color: #f3f4f6;
  min-height: auto;
}
/* Original view positioned layout */
.orig-view-positioned {
  padding: 0 !important;
  background: transparent !important;
}
.positioned-segments-container {
  font-family: "Noto Sans Myanmar", "Myanmar Text", system-ui, sans-serif;
}
/* Structured flowing text layout (new approach) */
.orig-view-structured {
  padding: 0 !important;
  background: transparent !important;
}
.structured-text-container {
  font-family: "Noto Sans Myanmar", "Myanmar Text", system-ui, sans-serif;
  font-size: 16px;
  color: #1f2937;
}
.structured-text-container .text-block {
  margin-bottom: 0.5em;
}
.structured-text-container .text-line {
  margin: 0;
  padding: 0;
}
.structured-text-container .pdf-raw-word {
  display: inline;
  cursor: default;
  border-radius: 2px;
  padding: 1px 0;
}
.structured-text-container .pdf-raw-word:hover {
  background-color: transparent;
}
.structured-text-container .reader-token:hover {
  background-color: rgba(59, 130, 246, 0.15);
}
.structured-text-container .pdf-raw-word.seg-known {
  /* known words get subtle green underline */
}
.structured-text-container .pdf-raw-word.seg-unknown {
  background-color: rgba(251, 191, 36, 0.2);
  border-bottom: 1px dashed #f59e0b;
}
.pdfjs-textlayer-container {
  position: relative;
  overflow: auto;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  box-sizing: border-box;
  width: 100%;
}
.pdfjs-textlayer-host {
  position: relative;
  margin: 0 auto;
  width: 100%;
}
.pdfjs-textlayer-host .textLayer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 1;
  line-height: 1;
}
.pdfjs-textlayer-host .pdfjs-textlayer-clone > span {
  position: absolute;
  white-space: pre;
  transform-origin: 0 0;
  line-height: 1;
}
.pdfjs-textlayer-host .pdfjs-textlayer-clone > span .reader-token {
  position: static;
  transform: none;
}
.pdfjs-textlayer-host .pdfjs-textlayer-clone span {
  color: #111827 !important;
}
.positioned-token {
  font-family: inherit;
  position: absolute !important;
  z-index: 1 !important;
  transform: none !important;
  transition: none !important;
}
.positioned-token:hover {
  z-index: 1 !important;
  transform: none !important;
}
.positioned-token .reader-subtoken {
  position: static !important;
  display: inline !important;
}
.positioned-token .reader-subtoken:hover {
  z-index: auto !important;
}
.dep-tree-view {
  margin-top: 16px;
}
.reader-output-placeholder {
  color: #9ca3af;
  font-size: 13px;
}
.reader-token {
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.reader-token:hover {
  z-index: 20;
}
.reader-token.reader-punct {
  cursor: default;
}
.reader-token.reader-punct:hover {
  background: transparent !important;
}
.reader-token.grammar-token {
  font-weight: inherit;
}
.reader-token.unknown-token {
  color: #b91c1c;
}
.docx-preview-host .reader-token.unknown-token {
  color: #b91c1c !important;
}
#renderedText .reader-token.unknown-token {
  color: #b91c1c !important;
}
#renderedText .reader-token.unknown-token * {
  color: #b91c1c !important;
}
.reader-subtoken {
  display: inline;
  border-radius: 2px;
  position: relative;
}
.reader-subtoken.chunk-subtoken-active + .reader-subtoken.chunk-subtoken-active {
  /* Use box-shadow instead of border to avoid layout shifts */
  box-shadow: -1px 0 0 0 rgba(0, 0, 0, 0.35);
}
.reader-subtoken:hover {
  z-index: 20;
}
.reader-subtoken.unknown-subtoken {
  color: #b91c1c;
}
.docx-preview-host .reader-subtoken.unknown-subtoken {
  color: #b91c1c !important;
}
#renderedText .reader-subtoken.unknown-subtoken {
  color: #b91c1c !important;
}
#renderedText .reader-subtoken.unknown-subtoken * {
  color: #b91c1c !important;
}
.reader-token.pos-tagged {
  border-radius: 2px;
}
/* UD Dependency Visualization */
#ud-svg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
  overflow: visible;
}
.ud-dep-line {
  stroke: #6366f1;
  stroke-width: 1.4;
  fill: none;
  opacity: 0.8;
}
.ud-dep-line.root-line {
  stroke: #dc2626;
  stroke-width: 1.75;
}
.ud-dep-line.child-line {
  stroke: #e67e22;
  stroke-width: 1.4;
  opacity: 0.8;
}
.ud-dep-arrow {
  fill: #6366f1;
}
.ud-dep-arrow.root-arrow {
  fill: #dc2626;
}
.ud-dep-arrow.child-arrow {
  fill: #e67e22;
}
.ud-dep-label {
  font-size: 10px;
  font-weight: 600;
  fill: #4f46e5;
  text-anchor: middle;
  pointer-events: none;
}
.ud-dep-label.root-label {
  fill: #dc2626;
}
#phrase-boundary-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
  z-index: 1;
}
.phrase-boundary {
  position: absolute;
  border: none;
  border-bottom: 5px solid transparent;
  box-sizing: border-box;
  background: transparent;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.hover-reticle {
  position: absolute;
  border: 1px solid #000000;
  border-radius: 2px;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 40;
}
.hover-reticle-token {
  outline: 1px solid #000000;
  outline-offset: 0;
  border-radius: 2px;
}
/* DOCX original view: Word's inline styles can override outline, so use box-shadow as fallback */
.docx-preview-host .hover-reticle-token {
  outline: 1px solid #000000 !important;
  outline-offset: 0 !important;
  box-shadow: 0 0 0 1px #000000 !important;
  border-radius: 2px !important;
}
.phrase-boundary-batch {
  position: absolute;
  border: none;
  border-bottom: 5px solid;
  box-sizing: border-box;
  background: transparent;
  margin: 0;
  padding: 0;
  pointer-events: none;
}
.reader-token.ud-highlight {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
  border-radius: 2px;
}
.reader-token.ud-highlight-parent {
  outline: 2px solid #e67e22;
  outline-offset: 1px;
  border-radius: 2px;
}
.reader-token.ud-highlight-child {
  outline: 2px solid #6366f1;
  outline-offset: 1px;
  border-radius: 2px;
}
.reader-token.ud-root-highlight {
  outline: 2px solid #dc2626;
  outline-offset: 1px;
  border-radius: 2px;
}
.reader-token.ud-tagged {
  border-bottom: 2px dotted #6366f1;
}
/* Chunk highlighting styles */
.reader-token.chunk-member {
  position: relative;
}
.reader-token.chunk-head::before {
  content: attr(data-chunk-pos);
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
/* Chunk highlighting - no margin to avoid text position shift */
.reader-token.chunk-active {
}
.chunk-pos-tag {
  font-family: system-ui, -apple-system, sans-serif;
  text-transform: lowercase;
}
/* UD info badge in popup */
.ud-info-badge {
  display: inline-block;
  padding: 2px 6px;
  margin: 2px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #eef2ff;
  color: #4338ca;
  border: 1px solid #c7d2fe;
}
.ud-info-badge.upos {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}
.ud-info-badge.dep {
  background: #dbeafe;
  color: #1e40af;
  border-color: #93c5fd;
}
.ud-info-badge.root {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fca5a5;
}
.popup-ud-section {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e5e7eb;
}
.popup-ud-title {
  font-size: 10px;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
/* NER hover overlay */
#ner-hover-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0;
  pointer-events: none;
  z-index: 6;
}
/* NER Label Pills - Modern flat design with single color */
.ner-label {
  position: absolute;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  background: #3b82f6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-50%);
  --ner-tail-x: 50%;
  --ner-tail-h: 5px;
}
.ner-label::after {
  content: '';
  position: absolute;
  left: var(--ner-tail-x, 50%);
  bottom: calc(-1 * var(--ner-tail-h, 5px));
  width: 2px;
  height: var(--ner-tail-h, 5px);
  background: inherit;
  border-radius: 1px;
  transform: translateX(-50%);
}
/* Caliper bracket for multi-token NER spans */
.ner-caliper {
  position: absolute;
  pointer-events: none;
  border-style: solid;
  border-width: 2px 2px 0 2px;
  border-color: #3b82f6;
  border-radius: 2px 2px 0 0;
  opacity: 0.9;
}
/* Side Panel */
#side-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  height: 100vh;
  background: #ffffff;
  border-left: 1px solid #e5e7eb;
  box-shadow: -4px 0 20px rgba(0,0,0,0.08);
  transform: translateX(100%);
  display: flex;
  flex-direction: column;
  z-index: 1000;
}
#side-panel.open {
  transform: translateX(0);
}
#panel-toggle {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 28px;
  height: 60px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-right: none;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -2px 0 8px rgba(0,0,0,0.06);
  z-index: 1001;
}
#panel-toggle.panel-open {
  right: 380px;
}
#panel-toggle:hover {
  background: #f9fafb;
}
#panel-toggle svg {
  width: 16px;
  height: 16px;
  color: #6b7280;
}
#panel-toggle.panel-open svg {
  transform: rotate(180deg);
}
#panel-header {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #f9fafb;
}
#panel-header h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
#search-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.search-row {
  display: flex;
  gap: 6px;
  align-items: center;
}
#dict-search {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: "Noto Sans Myanmar", "Myanmar Text", system-ui, sans-serif;
  outline: none;
}
#dict-search:focus {
  border-color: #2563eb;
}
#search-btn,
#create-btn,
#view-btn {
  padding: 6px 12px;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
}
#search-btn:hover,
#create-btn:hover,
#view-btn:hover {
  background: #1d4ed8;
}
#view-btn {
  white-space: nowrap;
  align-self: flex-start;
}
#panel-content .userdict-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.userdict-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.userdict-list-controls {
  display: flex;
  gap: 6px;
  align-items: center;
}
.userdict-filter {
  padding: 6px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
  background: #ffffff;
}
.userdict-list-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.userdict-item {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}
.userdict-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.userdict-item-title {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.userdict-item-actions {
  display: flex;
  gap: 6px;
}
.userdict-item-actions button {
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  background: #f3f4f6;
  color: #374151;
  font-size: 11px;
  cursor: pointer;
}
.userdict-item-actions button:hover {
  background: #e5e7eb;
}
.userdict-item-actions .danger {
  background: #fee2e2;
  border-color: #fecaca;
  color: #991b1b;
}
.userdict-item-actions .danger:hover {
  background: #fecaca;
}
.userdict-fields {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 6px 8px;
  align-items: center;
}
.userdict-fields label {
  font-size: 11px;
  color: #6b7280;
}
.userdict-input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  font-size: 12px;
  font-family: "Noto Sans Myanmar", "Myanmar Text", system-ui, sans-serif;
}
.userdict-input[disabled] {
  background: #f9fafb;
  color: #6b7280;
}
.userdict-textarea {
  resize: vertical;
  min-height: 44px;
}
.userdict-empty {
  color: #9ca3af;
  font-size: 12px;
  text-align: center;
  padding: 10px 0;
}
#panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
}
#panel-placeholder {
  color: #9ca3af;
  font-size: 13px;
  text-align: center;
  margin-top: 40px;
}
.dict-entry {
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
}
.dict-entry:last-child {
  border-bottom: none;
}
.dict-headword {
  font-size: 18px;
  font-weight: 600;
  display: inline-flex;
  gap: 0;
  flex-wrap: wrap;
}
.headword-component {
  cursor: pointer;
  border-radius: 3px;
  padding: 0;
}
.headword-component:hover {
  background: rgba(37, 99, 235, 0.15);
}
.dict-annotation-block {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e5e7eb;
}
.dict-annotation-label {
  font-size: 11px;
  font-weight: 500;
  color: #6b7280;
  margin-bottom: 4px;
}
.dict-annotation-textarea {
  width: 100%;
  min-height: 70px;
  font-size: 12px;
  line-height: 1.4;
  border-radius: 6px;
  border: 1px solid #d1d5db;
  padding: 6px 8px;
  resize: vertical;
  box-sizing: border-box;
}
.dict-annotation-textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.35);
}
.dict-annotation-status {
  margin-top: 4px;
  font-size: 11px;
  color: #6b7280;
}
.dict-pronunciation {
  display: none;
}
.g2p-block {
  margin-top: 6px;
  padding: 8px;
  border: 1px dashed #e5e7eb;
  border-radius: 6px;
  background: #f9fafb;
}
.g2p-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #9ca3af;
  text-transform: uppercase;
  margin-bottom: 6px;
}
/* Container for all syllables - horizontal flow */
.g2p-syllables {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}
.g2p-syll {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
}
.g2p-syll-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-bottom: 4px;
}
.g2p-syll-orth {
  font-size: 20px;
  font-weight: 600;
  color: #111827;
}
.g2p-syll-roman {
  font-size: 15px;
  font-style: italic;
  color: #059669;
  font-weight: 500;
}
/* Horizontal component breakdown under each syllable */
.g2p-components {
  display: flex;
  flex-direction: row;
  gap: 2px;
  align-items: flex-start;
}
.g2p-comp {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 3px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 3px;
  min-width: 20px;
}
.g2p-comp-ch {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
}
.g2p-comp-label {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
}
/* Old table styles - keep for fallback */
.g2p-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  margin-top: 4px;
  font-size: 11px;
}
.g2p-table td {
  border: 1px solid #e5e7eb;
  padding: 2px 4px;
  vertical-align: top;
}
.g2p-cell-ch {
  width: 32px;
  font-weight: 700;
  text-align: center;
  color: #111827;
}
.g2p-cell-label {
  color: #374151;
  line-height: 1.25;
  word-break: break-word;
}
.dict-unknown {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 4px;
}
.dict-senses {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
}
.dict-fuzzy-section {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 2px dashed #f59e0b;
}
.dict-fuzzy-header {
  font-size: 11px;
  font-weight: 600;
  color: #d97706;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  padding: 2px 6px;
  background: #fffbeb;
  border-radius: 4px;
  display: inline-block;
}
.dict-fuzzy-entry {
  margin-top: 10px;
  padding: 8px;
  background: #fffbeb;
  border-radius: 6px;
  border-left: 3px solid #f59e0b;
}
.dict-fuzzy-head {
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  gap: 0;
  flex-wrap: wrap;
  color: #000;
}
.dict-fuzzy-head .headword-component {
  color: #000;
}
.dict-fuzzy-roman {
  font-style: italic;
  color: #555;
  margin-left: 6px;
}
.dict-fuzzy-percent {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 9px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
}
.dict-fuzzy-senses {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.6;
}
.panel-token {
  cursor: pointer;
  border-radius: 2px;
}
.panel-token:hover {
  background: rgba(37, 99, 235, 0.15);
}
/* Hover popup - NO SCROLLING, expand dynamically */
.popup-container {
  position: fixed;
  z-index: 1000003;
  display: none;
  pointer-events: none;
  align-items: flex-start;
  gap: 6px; /* small gap between the bubbles */
}
.grammar-popup {
  background: #fffbeb;
  color: #111827;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.20);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #fbbf24;
  display: none;
  width: auto;
  max-width: 280px;
}
.dict-popup {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.20);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  width: auto;
  max-width: 420px;
}
.ud-popup {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.20);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid #c7d2fe;
  width: auto;
  max-width: 340px;
  display: none;
}
.ud-popup .popup-ud-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.dict-popup.has-grammar {
  border-radius: 10px;
}
/* NEW: annotation popup */
.note-popup {
  background: #fefce8;
  color: #78350f;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.20);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px dashed #facc15;
  width: auto;
  max-width: 260px;
  white-space: pre-wrap;
  display: none;
}
.g2p-popup {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.20);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px dashed #10b981;
  width: auto;
  max-width: 320px;
  display: none;
}
/* Subsegment popups container */
.subsegment-popups-container {
  position: fixed;
  z-index: 1000002;
  display: none;
  pointer-events: none;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}
.subsegment-popup {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.20);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #e5e7eb;
  width: auto;
  max-width: 320px;
}
.popup-headline {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.pos-badge {
  font-size: 10px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  color: #374151;
  border: 1px solid rgba(0,0,0,0.1);
}
.pos-badge.high {
  opacity: 1;
}
.pos-badge.medium {
  opacity: 0.85;
}
.pos-badge.low {
  opacity: 0.7;
  font-style: italic;
}
.popup-pronunciation {
  display: none;
}
.popup-section-title {
  margin-top: 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
}
.popup-grammar-entry {
  font-size: 12px;
  margin-left: 0;
  margin-top: 4px;
  padding: 4px 6px;
  border-radius: 4px;
  background: rgba(251, 191, 36, 0.1);
}
.popup-grammar-entry .type {
  font-weight: 600;
  margin-right: 4px;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 10px;
}
.popup-empty {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}
.popup-fuzzy-container {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 2px dashed #f59e0b;
}
.popup-fuzzy-header {
  font-size: 11px;
  font-weight: 600;
  color: #d97706;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  padding: 2px 6px;
  background: #fffbeb;
  border-radius: 4px;
  display: inline-block;
}
.popup-fuzzy-entry {
  font-size: 12px;
  margin-top: 4px;
  padding: 4px 6px;
  border-radius: 4px;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
}
.popup-fuzzy-percent {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 9px;
  background: #fef3c7;
  color: #92400e;
  font-size: 10px;
  font-weight: 600;
  margin-left: 6px;
}
/* Full-screen flashcard overlay */
.flashcard-overlay {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.75);
  z-index: 2000;
}
.flashcard-modal {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.45);
  max-width: 550px;
  width: calc(100% - 32px);
  max-height: 92vh;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.flashcard-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}
.flashcard-close-btn {
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 20px;
  line-height: 1;
  color: #9ca3af;
}
.flashcard-close-btn:hover {
  background: #f3f4f6;
  color: #4b5563;
}
.flashcard-grade-buttons {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}
.flashcard-grade-btn {
  padding: 10px 24px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.flashcard-grade-unknown {
  background: #fee;
  color: #991b1b;
}
.flashcard-grade-unknown:hover {
  background: #fdc;
}
.flashcard-grade-known {
  background: #efe;
  color: #166534;
}
.flashcard-grade-known:hover {
  background: #dfd;
}
.flashcard-grade-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.flashcard-word {
  font-size: 36px;
  line-height: 1.3;
  text-align: center;
  padding: 24px 12px;
  font-weight: 500;
  background: #f9fafb;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
}
.flashcard-show-answer-btn {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.flashcard-show-answer-btn:hover {
  background: #2563eb;
}
.flashcard-show-answer-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}
.flashcard-answer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}
.flashcard-section {
  padding: 10px 12px;
  background: #f9fafb;
  border-radius: 6px;
}
.flashcard-section:empty {
  display: none;
}
.flashcard-message {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  font-style: italic;
}
.flashcard-stats {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
}
.flashcard-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
  margin-bottom: 8px;
}
.flashcard-g2p {
  font-size: 13px;
  color: #4b5563;
  line-height: 1.6;
}
/* Center and enlarge pronunciation in flashcards */
#flashcardPronunciation .g2p-block {
  text-align: center;
  margin: 0 auto;
}
#flashcardPronunciation .g2p-title {
  font-size: 14px;
}
#flashcardPronunciation .g2p-syllables {
  justify-content: center;
}
#flashcardPronunciation .g2p-syll-roman {
  font-size: 32px;
}
#flashcardPronunciation .g2p-syll-orth {
  font-size: 36px;
}
.flashcard-roman {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  color: #1f2937;
}
.flashcard-pos {
  font-size: 12px;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 8px;
}
.flashcard-sense-list {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.6;
}
.flashcard-sense-list li {
  margin-bottom: 4px;
}
.flashcard-grammar-entry {
  padding: 8px;
  background: white;
  border-radius: 6px;
  margin-bottom: 6px;
  border-left: 3px solid #3b82f6;
}
.flashcard-grammar-entry:last-child {
  margin-bottom: 0;
}
.flashcard-grammar-category {
  font-size: 11px;
  font-weight: 600;
  color: #3b82f6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.flashcard-grammar-gloss {
  font-size: 13px;
  color: #374151;
  margin-top: 4px;
}
.flashcard-annotation-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 13px;
  font-family: system-ui, -apple-system, sans-serif;
  resize: vertical;
  min-height: 70px;
}
.flashcard-annotation-textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}
.flashcard-loading,
.flashcard-error {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  padding: 20px;
}

/* ===================== LEGACY LEGEND DROPDOWN (deprecated) ===================== */
.legend-dropdown {
  display: none; /* Now integrated into left menu */
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.10);
  padding: 14px;
  min-width: 420px;
  max-width: 480px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  z-index: 1001;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  margin: 6px 0 0 0;
}
@media (max-width: 1100px) {
  .legend-dropdown { left: 0; }
}

/* POS Shading Grid */
.legend-pos-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
.left-menu .legend-pos-grid {
  grid-template-columns: 1fr;
}
.legend-pos-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 5px;
}
.legend-pos-swatch {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.legend-pos-label {
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  min-width: 46px;
}
.legend-pos-desc {
  font-size: 11px;
  color: #6b7280;
}

/* UD Dependency Lines */
.legend-ud-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.legend-ud-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: 5px;
}
.legend-ud-svg {
  width: 50px;
  height: 20px;
  flex-shrink: 0;
}
.legend-ud-label {
  font-size: 12px;
  font-weight: 600;
  min-width: 50px;
}
.legend-ud-desc {
  font-size: 11px;
  color: #6b7280;
}

/* DEP Tags List */
.legend-dep-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.legend-dep-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 4px 6px;
}
.legend-dep-pill {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 500;
  background-color: #e5e7eb;
  color: #374151;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  flex-shrink: 0;
  min-width: 65px;
  text-align: center;
}
.legend-dep-desc {
  font-size: 11px;
  color: #374151;
  line-height: 1.4;
}

/* NER Tags Grid */
.legend-ner-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
}
.left-menu .legend-ner-grid {
  grid-template-columns: 1fr;
}
.legend-ner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 6px;
}
.legend-ner-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #ffffff;
  background: #3b82f6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.legend-ner-desc {
  font-size: 11px;
  color: #6b7280;
}

/* Broken Token */
.legend-broken-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px;
}
.legend-broken-token {
  font-size: 16px;
  color: #b91c1c;
  font-weight: 500;
  flex-shrink: 0;
}
.legend-broken-desc {
  font-size: 11px;
  color: #6b7280;
}
