/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */
@layer properties;
@layer theme, base, components, utilities;
@layer theme {
  :root, :host {
    --font-sans: ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
    'Noto Color Emoji';
    --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", monospace;
    --spacing: 0.25rem;
    --container-3xl: 48rem;
    --text-xs: 0.75rem;
    --text-xs--line-height: calc(1 / 0.75);
    --text-sm: 0.875rem;
    --text-sm--line-height: calc(1.25 / 0.875);
    --text-lg: 1.125rem;
    --text-lg--line-height: calc(1.75 / 1.125);
    --text-xl: 1.25rem;
    --text-xl--line-height: calc(1.75 / 1.25);
    --text-2xl: 2rem;
    --text-2xl--line-height: calc(2.5 / 2);
    --text-5xl: 3rem;
    --text-5xl--line-height: 1;
    --font-weight-light: 300;
    --font-weight-semibold: 600;
    --tracking-tight: -0.025em;
    --tracking-wide: 0.025em;
    --leading-relaxed: 1.625;
    --default-font-family: var(--font-sans);
    --default-mono-font-family: var(--font-mono);
    --color-sand: #e9dfc7;
    --color-sand-dark: #d6cab0;
    --color-parchment: #f5f0e3;
    --color-linen: #faf6ed;
    --color-earth-100: #ebe3cf;
    --color-earth-200: #d6cab0;
    --color-earth-300: #bfb094;
    --color-earth-400: #a39478;
    --color-earth-600: #6e614a;
    --color-ink: #1e1a13;
    --color-ink-light: #514838;
    --color-ink-muted: #8a7b60;
    --color-accent: #1c5b7a;
    --color-accent-light: #2b7a96;
    --color-accent-warm: #c45928;
    --font-display: "Awesome Serif", Georgia, "Times New Roman", serif;
    --font-body: "Red Hat Display", "Segoe UI", system-ui, sans-serif;
  }
}
@layer base {
  *, ::after, ::before, ::backdrop, ::file-selector-button {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    border: 0 solid;
  }
  html, :host {
    line-height: 1.5;
    -webkit-text-size-adjust: 100%;
    tab-size: 4;
    font-family: var(--default-font-family, ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji');
    font-feature-settings: var(--default-font-feature-settings, normal);
    font-variation-settings: var(--default-font-variation-settings, normal);
    -webkit-tap-highlight-color: transparent;
  }
  hr {
    height: 0;
    color: inherit;
    border-top-width: 1px;
  }
  abbr:where([title]) {
    -webkit-text-decoration: underline dotted;
    text-decoration: underline dotted;
  }
  h1, h2, h3, h4, h5, h6 {
    font-size: inherit;
    font-weight: inherit;
  }
  a {
    color: inherit;
    -webkit-text-decoration: inherit;
    text-decoration: inherit;
  }
  b, strong {
    font-weight: bolder;
  }
  code, kbd, samp, pre {
    font-family: var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace);
    font-feature-settings: var(--default-mono-font-feature-settings, normal);
    font-variation-settings: var(--default-mono-font-variation-settings, normal);
    font-size: 1em;
  }
  small {
    font-size: 80%;
  }
  sub, sup {
    font-size: 75%;
    line-height: 0;
    position: relative;
    vertical-align: baseline;
  }
  sub {
    bottom: -0.25em;
  }
  sup {
    top: -0.5em;
  }
  table {
    text-indent: 0;
    border-color: inherit;
    border-collapse: collapse;
  }
  :-moz-focusring {
    outline: auto;
  }
  progress {
    vertical-align: baseline;
  }
  summary {
    display: list-item;
  }
  ol, ul, menu {
    list-style: none;
  }
  img, svg, video, canvas, audio, iframe, embed, object {
    display: block;
    vertical-align: middle;
  }
  img, video {
    max-width: 100%;
    height: auto;
  }
  button, input, select, optgroup, textarea, ::file-selector-button {
    font: inherit;
    font-feature-settings: inherit;
    font-variation-settings: inherit;
    letter-spacing: inherit;
    color: inherit;
    border-radius: 0;
    background-color: transparent;
    opacity: 1;
  }
  :where(select:is([multiple], [size])) optgroup {
    font-weight: bolder;
  }
  :where(select:is([multiple], [size])) optgroup option {
    padding-inline-start: 20px;
  }
  ::file-selector-button {
    margin-inline-end: 4px;
  }
  ::placeholder {
    opacity: 1;
  }
  @supports (not (-webkit-appearance: -apple-pay-button))  or (contain-intrinsic-size: 1px) {
    ::placeholder {
      color: currentcolor;
      @supports (color: color-mix(in lab, red, red)) {
        color: color-mix(in oklab, currentcolor 50%, transparent);
      }
    }
  }
  textarea {
    resize: vertical;
  }
  ::-webkit-search-decoration {
    -webkit-appearance: none;
  }
  ::-webkit-date-and-time-value {
    min-height: 1lh;
    text-align: inherit;
  }
  ::-webkit-datetime-edit {
    display: inline-flex;
  }
  ::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
  }
  ::-webkit-datetime-edit, ::-webkit-datetime-edit-year-field, ::-webkit-datetime-edit-month-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-minute-field, ::-webkit-datetime-edit-second-field, ::-webkit-datetime-edit-millisecond-field, ::-webkit-datetime-edit-meridiem-field {
    padding-block: 0;
  }
  ::-webkit-calendar-picker-indicator {
    line-height: 1;
  }
  :-moz-ui-invalid {
    box-shadow: none;
  }
  button, input:where([type='button'], [type='reset'], [type='submit']), ::file-selector-button {
    appearance: button;
  }
  ::-webkit-inner-spin-button, ::-webkit-outer-spin-button {
    height: auto;
  }
  [hidden]:where(:not([hidden='until-found'])) {
    display: none !important;
  }
}
@layer utilities {
  .pointer-events-none {
    pointer-events: none;
  }
  .absolute {
    position: absolute;
  }
  .relative {
    position: relative;
  }
  .static {
    position: static;
  }
  .top-1\/2 {
    top: calc(1/2 * 100%);
  }
  .left-3\.5 {
    left: calc(var(--spacing) * 3.5);
  }
  .container {
    width: 100%;
    @media (width >= 40rem) {
      max-width: 40rem;
    }
    @media (width >= 48rem) {
      max-width: 48rem;
    }
    @media (width >= 64rem) {
      max-width: 64rem;
    }
    @media (width >= 80rem) {
      max-width: 80rem;
    }
    @media (width >= 96rem) {
      max-width: 96rem;
    }
  }
  .mx-auto {
    margin-inline: auto;
  }
  .mt-0\.5 {
    margin-top: calc(var(--spacing) * 0.5);
  }
  .mt-1 {
    margin-top: calc(var(--spacing) * 1);
  }
  .mt-2 {
    margin-top: calc(var(--spacing) * 2);
  }
  .mt-6 {
    margin-top: calc(var(--spacing) * 6);
  }
  .mt-8 {
    margin-top: calc(var(--spacing) * 8);
  }
  .mt-10 {
    margin-top: calc(var(--spacing) * 10);
  }
  .mt-auto {
    margin-top: auto;
  }
  .mb-1 {
    margin-bottom: calc(var(--spacing) * 1);
  }
  .mb-2 {
    margin-bottom: calc(var(--spacing) * 2);
  }
  .mb-4 {
    margin-bottom: calc(var(--spacing) * 4);
  }
  .mb-6 {
    margin-bottom: calc(var(--spacing) * 6);
  }
  .mb-8 {
    margin-bottom: calc(var(--spacing) * 8);
  }
  .mb-12 {
    margin-bottom: calc(var(--spacing) * 12);
  }
  .ml-1\.5 {
    margin-left: calc(var(--spacing) * 1.5);
  }
  .flex {
    display: flex;
  }
  .hidden {
    display: none;
  }
  .inline {
    display: inline;
  }
  .h-4 {
    height: calc(var(--spacing) * 4);
  }
  .h-5 {
    height: calc(var(--spacing) * 5);
  }
  .min-h-screen {
    min-height: 100vh;
  }
  .w-4 {
    width: calc(var(--spacing) * 4);
  }
  .w-5 {
    width: calc(var(--spacing) * 5);
  }
  .max-w-3xl {
    max-width: var(--container-3xl);
  }
  .-translate-y-1\/2 {
    --tw-translate-y: calc(calc(1/2 * 100%) * -1);
    translate: var(--tw-translate-x) var(--tw-translate-y);
  }
  .flex-wrap {
    flex-wrap: wrap;
  }
  .items-baseline {
    align-items: baseline;
  }
  .items-center {
    align-items: center;
  }
  .justify-between {
    justify-content: space-between;
  }
  .gap-1 {
    gap: calc(var(--spacing) * 1);
  }
  .gap-2 {
    gap: calc(var(--spacing) * 2);
  }
  .gap-2\.5 {
    gap: calc(var(--spacing) * 2.5);
  }
  .gap-3 {
    gap: calc(var(--spacing) * 3);
  }
  .gap-6 {
    gap: calc(var(--spacing) * 6);
  }
  .space-y-1\.5 {
    :where(& > :not(:last-child)) {
      --tw-space-y-reverse: 0;
      margin-block-start: calc(calc(var(--spacing) * 1.5) * var(--tw-space-y-reverse));
      margin-block-end: calc(calc(var(--spacing) * 1.5) * calc(1 - var(--tw-space-y-reverse)));
    }
  }
  .space-y-3 {
    :where(& > :not(:last-child)) {
      --tw-space-y-reverse: 0;
      margin-block-start: calc(calc(var(--spacing) * 3) * var(--tw-space-y-reverse));
      margin-block-end: calc(calc(var(--spacing) * 3) * calc(1 - var(--tw-space-y-reverse)));
    }
  }
  .space-y-4 {
    :where(& > :not(:last-child)) {
      --tw-space-y-reverse: 0;
      margin-block-start: calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));
      margin-block-end: calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)));
    }
  }
  .space-y-8 {
    :where(& > :not(:last-child)) {
      --tw-space-y-reverse: 0;
      margin-block-start: calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));
      margin-block-end: calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)));
    }
  }
  .border-t {
    border-top-style: var(--tw-border-style);
    border-top-width: 1px;
  }
  .border-b {
    border-bottom-style: var(--tw-border-style);
    border-bottom-width: 1px;
  }
  .border-earth-200 {
    border-color: var(--color-earth-200);
  }
  .px-6 {
    padding-inline: calc(var(--spacing) * 6);
  }
  .py-5 {
    padding-block: calc(var(--spacing) * 5);
  }
  .py-10 {
    padding-block: calc(var(--spacing) * 10);
  }
  .py-12 {
    padding-block: calc(var(--spacing) * 12);
  }
  .py-16 {
    padding-block: calc(var(--spacing) * 16);
  }
  .pt-4 {
    padding-top: calc(var(--spacing) * 4);
  }
  .pt-6 {
    padding-top: calc(var(--spacing) * 6);
  }
  .pb-6 {
    padding-bottom: calc(var(--spacing) * 6);
  }
  .pb-8 {
    padding-bottom: calc(var(--spacing) * 8);
  }
  .text-center {
    text-align: center;
  }
  .font-display {
    font-family: var(--font-display);
  }
  .font-mono {
    font-family: var(--font-mono);
  }
  .text-2xl {
    font-size: var(--text-2xl);
    line-height: var(--tw-leading, var(--text-2xl--line-height));
  }
  .text-5xl {
    font-size: var(--text-5xl);
    line-height: var(--tw-leading, var(--text-5xl--line-height));
  }
  .text-lg {
    font-size: var(--text-lg);
    line-height: var(--tw-leading, var(--text-lg--line-height));
  }
  .text-sm {
    font-size: var(--text-sm);
    line-height: var(--tw-leading, var(--text-sm--line-height));
  }
  .text-xl {
    font-size: var(--text-xl);
    line-height: var(--tw-leading, var(--text-xl--line-height));
  }
  .text-xs {
    font-size: var(--text-xs);
    line-height: var(--tw-leading, var(--text-xs--line-height));
  }
  .leading-relaxed {
    --tw-leading: var(--leading-relaxed);
    line-height: var(--leading-relaxed);
  }
  .font-light {
    --tw-font-weight: var(--font-weight-light);
    font-weight: var(--font-weight-light);
  }
  .font-semibold {
    --tw-font-weight: var(--font-weight-semibold);
    font-weight: var(--font-weight-semibold);
  }
  .tracking-tight {
    --tw-tracking: var(--tracking-tight);
    letter-spacing: var(--tracking-tight);
  }
  .tracking-wide {
    --tw-tracking: var(--tracking-wide);
    letter-spacing: var(--tracking-wide);
  }
  .text-ink {
    color: var(--color-ink);
  }
  .text-ink-light {
    color: var(--color-ink-light);
  }
  .text-ink-muted {
    color: var(--color-ink-muted);
  }
  .uppercase {
    text-transform: uppercase;
  }
  .italic {
    font-style: italic;
  }
  .no-underline {
    text-decoration-line: none;
  }
  .select-none {
    -webkit-user-select: none;
    user-select: none;
  }
}
@font-face {
  font-family: "Awesome Serif";
  src: url("/fonts/AwesomeSerif-LightRegular.woff2") format("woff2"), url("/fonts/AwesomeSerif-LightRegular.woff") format("woff");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Awesome Serif";
  src: url("/fonts/AwesomeSerif-Regular.woff2") format("woff2"), url("/fonts/AwesomeSerif-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Awesome Serif";
  src: url("/fonts/AwesomeSerif-MediumRegular.woff2") format("woff2"), url("/fonts/AwesomeSerif-MediumRegular.woff") format("woff");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Awesome Serif";
  src: url("/fonts/AwesomeSerif-SemiBoldRegular.woff2") format("woff2"), url("/fonts/AwesomeSerif-SemiBoldRegular.woff") format("woff");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Awesome Serif";
  src: url("/fonts/AwesomeSerif-BoldRegular.woff2") format("woff2"), url("/fonts/AwesomeSerif-BoldRegular.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Awesome Serif";
  src: url("/fonts/AwesomeSerifItalic-LightReg.woff2") format("woff2"), url("/fonts/AwesomeSerifItalic-LightReg.woff") format("woff");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Awesome Serif";
  src: url("/fonts/AwesomeSerifItalic-Regular.woff2") format("woff2"), url("/fonts/AwesomeSerifItalic-Regular.woff") format("woff");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Awesome Serif";
  src: url("/fonts/AwesomeSerifItalic-MedRegular.woff2") format("woff2"), url("/fonts/AwesomeSerifItalic-MedRegular.woff") format("woff");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Display";
  src: url("/fonts/RedHatDisplay-Light.ttf") format("truetype");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Display";
  src: url("/fonts/RedHatDisplay-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Display";
  src: url("/fonts/RedHatDisplay-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Display";
  src: url("/fonts/RedHatDisplay-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Display";
  src: url("/fonts/RedHatDisplay-Bold.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Display";
  src: url("/fonts/RedHatDisplay-Italic.ttf") format("truetype");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Display";
  src: url("/fonts/RedHatDisplay-LightItalic.ttf") format("truetype");
  font-weight: 300;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Display";
  src: url("/fonts/RedHatDisplay-MediumItalic.ttf") format("truetype");
  font-weight: 500;
  font-style: italic;
  font-display: swap;
}
/* Bridge old theme variables to new Onanti design tokens */
:root {
  --color-accent: var(--color-teal-600, #1c5b7a);
  --color-accent-light: var(--color-teal-500, #2b7a96);
  --color-accent-warm: var(--color-terracotta-500, #c45928);
  --color-ink: var(--text-primary, #242220);
  --color-ink-light: var(--text-secondary, #6b6658);
  --color-ink-muted: var(--text-tertiary, #a8a392);
  --color-sand: var(--surface-secondary, #f9f8f7);
  --color-sand-dark: var(--border-default, #e0ddd4);
  --color-parchment: var(--surface-primary, #ffffff);
  --color-linen: var(--surface-primary, #ffffff);
  --color-earth-100: var(--color-neutral-100, #f0eee9);
  --color-earth-200: var(--border-default, #e0ddd4);
  --color-earth-300: var(--border-strong, #c9c5b8);
  --color-earth-400: var(--color-neutral-400, #a8a392);
  --color-earth-600: var(--color-neutral-600, #6b6658);
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

@layer base {
  html {
    font-family: var(--font-body);
    color: var(--color-ink);
    background-color: var(--color-sand);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }
  ::selection {
    background-color: var(--color-accent);
    color: var(--color-linen);
  }
  input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
  }
}
@layer components {
  /* Prevent pinch-to-zoom on mobile */
  html {
    touch-action: pan-x pan-y;
  }

  .site-header {
    background-color: var(--color-sand);
    border-bottom: 1px solid var(--color-sand-dark);
  }
  .site-logo {
    font-family: var(--font-display);
    font-weight: 300;
    letter-spacing: -0.01em;
    line-height: 1;
  }
  .site-nav-link {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-ink-muted);
    transition: color 0.2s ease;
    &:hover {
      color: var(--color-ink);
    }
  }
  #site-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
  }
  .nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: var(--color-ink-muted);
  }
  @media (max-width: 767px) {
    .hidden-mobile { display: none !important; }
    .nav-toggle {
      display: flex;
      align-items: center;
      justify-content: center;
    }
    #site-nav {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: var(--color-sand);
      border-bottom: 1px solid var(--color-sand-dark);
      flex-direction: column;
      align-items: stretch;
      padding: 0.5rem 1.5rem 1rem;
      gap: 0.125rem;
      display: none !important;
      z-index: 50;
    }
    #site-nav.nav-open {
      display: flex !important;
    }
    #site-nav .site-nav-link {
      padding: 0.5rem 0;
      border-bottom: 1px solid var(--color-earth-100);
    }
    #site-nav .sign-in-btn {
      margin-top: 0.5rem;
    }
    #site-nav .user-menu {
      margin-top: 0.5rem;
    }
    .site-header > div {
      position: relative;
      justify-content: center !important;
    }
  }
  .search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background-color: var(--color-linen);
    border: 1px solid var(--color-earth-200);
    border-radius: 2px;
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 400;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    &::placeholder {
      color: var(--color-earth-400);
      font-weight: 300;
    }
    &:focus {
      outline: none;
      border-color: var(--color-accent-warm);
      box-shadow: 0 0 0 1px var(--color-accent-warm);
    }
  }
  .entry-card {
    display: block;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-earth-100);
    transition: background-color 0.2s ease;
    &:hover {
      background-color: var(--color-parchment);
    }
    &:last-child {
      border-bottom: none;
    }
  }
  .entries-container {
    background-color: var(--color-linen);
    border: 1px solid var(--color-earth-200);
    border-radius: 0.75rem;
    overflow: hidden;
  }
  .badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.15rem 0.5rem;
    border-radius: 1px;
    background-color: var(--color-earth-100);
    color: var(--color-earth-600);
    vertical-align: middle;
    position: relative;
    top: -2px;
  }
  .dict-edit-btn {
    display: inline-flex;
    align-items: center;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.15s ease;
  }
  .entry-card:hover .dict-edit-btn {
    opacity: 0.5;
  }
  .dict-edit-btn:hover {
    opacity: 1 !important;
    background: var(--color-earth-100);
  }
  .dict-edit-icon {
    color: var(--color-earth-600);
  }
  .dict-delete-btn {
    font-size: 0.8125rem;
    color: var(--color-earth-500);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color 0.15s;
  }
  .dict-delete-btn:hover {
    color: #991b1b;
  }
  .dict-delete-btn:disabled {
    opacity: 0.5;
    cursor: default;
  }
  .entry-card-bm {
    margin-left: 0.25rem;
  }
  .section-label {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-ink-muted);
    margin-bottom: 0.5rem;
  }
  .section-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
  }
  .section-toggle-btn {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.15s;
  }
  .section-toggle-btn:hover {
    opacity: 0.7;
  }
  .icaro-reference-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    margin-top: 2.5rem;
  }
  @media (min-width: 768px) {
    .icaro-reference-grid {
      grid-template-columns: 1fr 1fr;
    }
  }
  .example-block {
    padding: 1rem 1.25rem;
    background-color: var(--color-parchment);
    border-left: 3px solid var(--color-accent);
    border-radius: 0 2px 2px 0;
  }
  /* Icaro type toggle (Song / Concept) */
  .icaro-type-toggle-btn {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.25rem 0.7rem;
    border-radius: 2px;
    border: 1px solid var(--color-earth-200);
    background: transparent;
    color: var(--color-ink-muted);
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  }
  .icaro-type-toggle-btn:hover {
    border-color: var(--color-earth-400);
  }
  .icaro-type-toggle-btn.active {
    background: var(--color-accent-warm);
    color: #fff;
    border-color: var(--color-accent-warm);
  }
  .icaro-type-toggle-btn.active:hover {
    background: color-mix(in srgb, var(--color-accent-warm) 85%, black);
    border-color: color-mix(in srgb, var(--color-accent-warm) 85%, black);
  }
  /* Dictionary tab switcher */
  .dict-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--color-earth-200);
  }
  .dict-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--color-ink-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
  }
  .dict-tab svg { opacity: 0.5; transition: opacity 0.2s ease; }
  .dict-tab:hover { color: var(--color-ink); }
  .dict-tab:hover svg { opacity: 0.7; }
  .dict-tab-active {
    color: var(--color-ink);
    border-bottom-color: var(--color-earth-600);
  }
  .dict-tab-active svg { opacity: 1; }
  .alpha-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--color-ink-muted);
    border-radius: 2px;
    transition: all 0.2s ease;
    &:hover {
      background-color: var(--color-earth-100);
      color: var(--color-ink);
    }
    &.active {
      background-color: var(--color-ink);
      color: var(--color-sand);
    }
  }
  .divider {
    border: none;
    height: 1px;
    background: linear-gradient( to right, transparent, var(--color-earth-200), var(--color-earth-300), var(--color-earth-200), transparent );
  }

  /* Site Footer */
  .site-footer {
    padding: 0 1.5rem 2rem;
  }
  .site-footer-inner {
    max-width: 720px;
    margin: 0 auto;
  }
  .site-footer .divider {
    margin-bottom: 1.5rem;
  }
  .site-footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .site-footer-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 300;
    color: var(--color-ink-light, #514838);
    letter-spacing: -0.01em;
  }
  .site-footer-brand img {
    opacity: 0.7;
  }
  .site-footer-tagline {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--color-ink-muted, #8a7b60);
    font-weight: 400;
    letter-spacing: 0.02em;
  }
  .site-footer-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
  }
  .site-footer-links a {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--color-ink-muted, #8a7b60);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
  }
  .site-footer-links a:hover {
    color: var(--color-accent, #1c5b7a);
  }
  .site-footer-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--color-earth-300, #bfb094);
  }
  .back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-ink-muted);
    transition: color 0.2s ease;
    &:hover {
      color: var(--color-ink);
    }
  }
  .accent-link {
    font-family: var(--font-display);
    color: var(--color-accent);
    transition: color 0.2s ease;
    &:hover {
      color: var(--color-accent-light);
    }
  }
  /* Icaro styles */
  .icaro-card {
    display: block;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-earth-100);
    transition: background-color 0.2s ease;
    &:hover {
      background-color: var(--color-parchment);
    }
    &:last-child {
      border-bottom: none;
    }
  }
  .icaro-card-source {
    font-family: var(--font-body);
    font-size: 0.75rem;
    color: var(--color-ink-muted);
  }
  /* Icaro interactive layout */
  .icaro-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
  }
  @media (min-width: 768px) {
    .icaro-layout {
      grid-template-columns: 55% 45%;
      gap: 0;
    }
  }
  .icaro-song-col {
    min-width: 0;
  }
  @media (min-width: 768px) {
    .icaro-song-col {
      padding-right: 1.5rem;
    }
  }
  .icaro-panel {
    display: none;
  }
  @media (min-width: 768px) {
    .icaro-panel {
      display: block;
      position: sticky;
      top: 1.5rem;
      max-height: calc(100vh - 3rem);
      overflow-y: auto;
      border-left: 1px solid var(--color-earth-200);
      padding-left: 1.5rem;
    }
  }
  .icaro-panel-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 12rem;
    color: var(--color-ink-muted);
    font-style: italic;
    font-size: 0.95rem;
    text-align: center;
    padding: 2rem 1rem;
  }
  .panel-card {
    padding: 1rem 1.25rem;
    background-color: var(--color-linen);
    border: 1px solid var(--color-earth-200);
    border-radius: 2px;
    margin-bottom: 0.75rem;
    position: relative;
    animation: panelCardIn 0.2s ease-out;
  }
  @keyframes panelCardIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .panel-card-close {
    position: static;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--color-ink-muted);
    font-size: 1.1rem;
    line-height: 1;
    border-radius: 2px;
    transition: color 0.15s ease, background-color 0.15s ease;
    &:hover {
      color: var(--color-ink);
      background-color: var(--color-earth-100);
    }
  }
  .icaro-hint {
    display: block;
  }
  @media (min-width: 768px) {
    .icaro-hint {
      display: none;
    }
  }
  .song-line[data-clickable] {
    cursor: pointer;
    border-radius: 2px;
    padding: 0.125rem 0.375rem;
    margin: -0.125rem -0.375rem;
    transition: background-color 0.15s ease;
    &:hover {
      background-color: var(--color-parchment);
    }
  }
  .song-line-active {
    background-color: var(--color-earth-100) !important;
    border-left: 3px solid var(--color-accent);
    padding-left: 0.375rem;
  }
  /* Mobile drawer */
  .icaro-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .icaro-drawer-backdrop.active {
    opacity: 1;
  }
  .icaro-drawer {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    background-color: var(--color-sand);
    border-top: 1px solid var(--color-earth-300);
    border-radius: 12px 12px 0 0;
    max-height: 80vh;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
  }
  .icaro-drawer.active {
    transform: translateY(0);
  }
  .icaro-drawer-handle {
    display: none;
  }
  .icaro-drawer-content {
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    max-height: 80vh;
    padding: 0.75rem 1rem 1.5rem;
  }
  @media (max-width: 767px) {
    .icaro-drawer-backdrop {
      display: block;
      pointer-events: none;
    }
    .icaro-drawer-backdrop.active {
      pointer-events: auto;
    }
    .icaro-drawer {
      display: block;
      bottom: calc(52px + env(safe-area-inset-bottom, 0px));
      z-index: 45;
    }
    .icaro-drawer-content {
      max-height: calc(80vh - 52px - env(safe-area-inset-bottom, 0px));
      padding-bottom: 1rem;
    }
  }
  .song-section {
    position: relative;
    padding: 1rem 2rem 1rem 3.5rem;
    margin-bottom: 1.5rem;
  }
  .song-section-current {
  }
  .song-section-bracket {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .song-section-bracket::before {
    content: "";
    position: absolute;
    left: 0.75rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 8px;
    border: 2px solid var(--color-earth-300);
    border-right: none;
    border-radius: 4px 0 0 4px;
  }
  .song-repeat {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--color-ink-muted);
    text-transform: lowercase;
    position: absolute;
    left: 1.5rem;
    bottom: -0.125rem;
  }
  .song-line {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 400;
    line-height: 1.8;
    color: var(--color-ink);
  }
  .song-line-repeat {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-ink-muted);
    margin-left: 0.375rem;
    vertical-align: middle;
  }
  .phrase-card {
    padding: 1.25rem 1.5rem;
    background-color: var(--color-linen);
    border: 1px solid var(--color-earth-200);
    border-radius: 2px;
    margin-bottom: 1rem;
  }
  .morph-root {
    color: var(--color-ink);
  }
  .morph-affix-0 { color: #27ae60; }
  .morph-affix-1 { color: #8e44ad; }
  .morph-affix-2 { color: #e67e22; }
  .morph-affix-3 { color: #2980b9; }
  .morph-affix-4 { color: #c45928; }
  .morph-affix-5 { color: #c0392b; }
  .literal-translation {
    padding: 0.75rem 1rem;
    background-color: var(--color-parchment);
    border-left: 3px solid var(--color-accent);
    border-radius: 0 2px 2px 0;
    font-style: italic;
    color: var(--color-ink-light);
    margin-top: 0.75rem;
  }
  .suffix-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
  }
  .suffix-table th {
    text-align: left;
    padding: 0.5rem 0.75rem;
    background-color: var(--color-earth-100);
    color: var(--color-ink);
    font-weight: 600;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .suffix-table td {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-earth-100);
    color: var(--color-ink-light);
  }
  .suffix-table tr:last-child td {
    border-bottom: none;
  }

  /* Vocab card word + badge inline */
  .vocab-card-word {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
  }

  /* Auth UI */
  .sign-in-btn {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    padding: 0.375rem 0.875rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 2px;
    color: var(--color-ink-light);
    transition: all 0.2s ease;
    &:hover {
      background-color: var(--color-parchment);
      color: var(--color-ink);
      border-color: var(--color-ink-muted);
    }
  }
  .user-menu {
    position: relative;
  }
  .user-menu-btn {
    cursor: pointer;
    border: none;
    padding: 0;
    line-height: 0;
  }
  .user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: 2px solid var(--color-earth-200);
    transition: border-color 0.2s ease;
    display: inline-block;
  }
  .user-menu-btn:hover .user-avatar {
    border-color: var(--color-accent-warm);
  }
  .user-avatar-placeholder {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background-color: var(--color-earth-100);
    color: var(--color-ink-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
  }
  .user-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background-color: var(--color-linen);
    border: 1px solid var(--color-earth-200);
    border-radius: 2px;
    padding: 0.75rem 1rem;
    min-width: 12rem;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  }
  .user-dropdown-name {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--color-ink);
    margin-bottom: 0.125rem;
  }
  .user-dropdown-email {
    font-size: 0.75rem;
    color: var(--color-ink-muted);
    margin-bottom: 0.75rem;
  }
  .user-dropdown-logout {
    display: block;
    width: 100%;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-ink-muted);
    padding: 0.375rem 0;
    border-top: 1px solid var(--color-earth-100);
    cursor: pointer;
    transition: color 0.2s ease;
    &:hover {
      color: var(--color-ink);
    }
  }
  /* Track button */
  .track-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.8rem;
    letter-spacing: 0.02em;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 2px;
    color: var(--color-ink-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    &:hover {
      background-color: var(--color-parchment);
      color: var(--color-ink);
      border-color: var(--color-ink-muted);
    }
    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;
    }
  }
  .track-btn-active {
    background-color: var(--color-accent);
    color: var(--color-linen);
    border-color: var(--color-accent);
    &:hover {
      background-color: var(--color-accent-light);
      border-color: var(--color-accent-light);
      color: var(--color-linen);
    }
  }
  /* Progress track */
  .icaro-progress-track {
    display: flex;
    gap: 3px;
    align-items: center;
    flex-shrink: 0;
  }
  .icaro-progress-seg {
    width: 18px;
    height: 4px;
    border-radius: 2px;
    background-color: var(--color-earth-200);
    transition: background-color 0.2s ease;
  }
  .icaro-progress-seg.filled {
    background-color: var(--color-accent-warm);
  }
  .icaro-progress-seg.current {
    background-color: var(--color-accent);
  }
  .icaro-card-tracked {
    border-left: 3px solid var(--color-accent);
  }

  /* Bookmark buttons */
  .bookmark-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border: none;
    background: none;
    color: var(--color-earth-400);
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s;
  }
  .bookmark-btn:hover {
    color: var(--color-accent);
  }
  .bookmark-btn-active {
    color: var(--color-accent);
  }
  .bookmark-btn-sm svg {
    width: 14px;
    height: 14px;
  }

  /* Panel card actions (close + bookmark) */
  .panel-card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  /* Song section bookmark */
  .song-section-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.25rem;
    opacity: 1;
  }

  /* Clickable dashboard banner */
  .dashboard-banner-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
  }
  .dashboard-banner-link:hover {
    border-color: var(--color-earth-300);
    box-shadow: var(--shadow-card-hover);
  }
  .dashboard-banner-arrow {
    color: var(--color-ink-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease, color 0.2s ease;
  }
  .dashboard-banner-link:hover .dashboard-banner-arrow {
    color: var(--color-accent);
    transform: translateX(2px);
  }

  /* Review mode */
  .review-filter-label {
    width: 100%;
    max-width: 28rem;
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-ink-muted);
    margin-bottom: 0.125rem;
    text-align: right;
  }
  .review-filter-bar {
    width: 100%;
    max-width: 28rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-bottom: 0;
  }
  .review-filter-select {
    display: inline-flex;
    align-items: center;
    color: var(--color-ink-muted);
  }
  .review-filter-select select {
    appearance: none;
    -webkit-appearance: none;
    background: none;
    border: 1px solid var(--color-earth-300);
    border-radius: 4px;
    padding: 0.25rem 1.25rem 0.25rem 0.5rem;
    font-size: 0.8125rem;
    color: var(--color-ink-light);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%237a6e5e' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.375rem center;
  }
  .review-filter-select select:focus {
    outline: none;
    border-color: var(--color-accent);
  }

  .review-card-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .review-card {
    width: 100%;
    max-width: 28rem;
    height: 20rem;
    perspective: 1000px;
    cursor: pointer;
  }

  .review-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.5s;
    transform-style: preserve-3d;
  }

  .review-card-flipped {
    transform: rotateY(180deg);
  }

  .review-card-front,
  .review-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--color-earth-200);
    border-radius: 8px;
    background: var(--color-linen);
    overflow-y: auto;
    padding: 1.5rem;
  }

  .review-card-back {
    transform: rotateY(180deg);
  }

  .review-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
  }

  .review-progress-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
  }
  .review-progress-text {
    color: var(--color-ink-muted);
  }
  .review-progress-sep {
    color: var(--color-earth-300);
  }
  .review-flip-link {
    color: var(--color-accent);
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
  }
  .review-flip-link:hover {
    text-decoration: underline;
  }

  .review-comfort {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .review-comfort-btns {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
  }

  .review-comfort-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 6px;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.15s;
    background: var(--color-linen);
  }
  .review-comfort-btn:hover {
    border-color: var(--color-accent);
  }
  .review-comfort-new { border-left: 3px solid #b91c1c; }
  .review-comfort-learning { border-left: 3px solid #d97706; }
  .review-comfort-familiar { border-left: 3px solid #059669; }
  .review-comfort-mastered { border-left: 3px solid #2563eb; }

  .review-done {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Bookmarks page */
  .bookmark-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .bookmark-comfort-badge {
    margin-left: auto;
    text-transform: capitalize;
  }

  /* Dashboard */
  .dashboard-due-banner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--color-earth-100), var(--color-parchment));
    border: 1px solid var(--color-earth-200);
    border-radius: 0.75rem;
    margin-bottom: 2rem;
  }
  .dashboard-due-left {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: 1;
    min-width: 0;
  }
  .dashboard-due-number {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 2.5rem;
    line-height: 1;
    color: var(--color-accent);
    font-weight: 600;
  }
  .dashboard-due-label {
    font-size: 1rem;
    color: var(--color-ink-light);
    line-height: 1.4;
  }
  .dashboard-due-label .dashboard-due-sublabel {
    display: block;
    font-size: 0.8rem;
    color: var(--color-ink-muted);
    margin-top: 0.15rem;
  }
  .dashboard-section {
    margin-bottom: 2.5rem;
  }
  .dashboard-card {
    background-color: var(--color-linen);
    border: 1px solid var(--color-earth-200);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
    transition: opacity 0.3s ease, max-height 0.3s ease, background-color 0.2s ease;
  }
  .dashboard-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
  }
  .dashboard-card-link:hover {
    background-color: var(--color-parchment);
  }
  .dashboard-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
  }
  .dashboard-card-title {
    font-size: 0.8rem;
    color: var(--color-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.025em;
  }
  .dashboard-card-title a {
    color: var(--color-ink-muted);
    text-decoration: none;
  }
  .dashboard-card-title a:hover {
    color: var(--color-accent);
  }
  .dashboard-card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }
  .dashboard-section-lines {
    padding: 0.25rem 0;
  }
  .dashboard-section-line {
    font-family: var(--font-display, 'Playfair Display', serif);
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-ink);
  }
  .dashboard-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--color-earth-100);
    transition: opacity 0.3s ease, max-height 0.3s ease, background-color 0.2s ease;
    overflow: hidden;
  }
  .dashboard-item-link {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
  }
  .dashboard-item-link:hover {
    background-color: var(--color-parchment);
  }
  .dashboard-item:last-child {
    border-bottom: none;
  }
  .dashboard-item-content {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
    flex: 1;
  }
  .dashboard-item-content a {
    color: var(--color-ink);
    text-decoration: none;
  }
  .dashboard-item-content a:hover {
    color: var(--color-accent);
  }
  .dashboard-reveal-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-ink-muted);
    padding: 0.25rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
  }
  .dashboard-reveal-btn:hover {
    color: var(--color-accent);
  }
  .dashboard-dict-link {
    color: var(--color-ink-muted);
    padding: 0.25rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
  }
  .dashboard-dict-link:hover {
    color: var(--color-accent);
  }
  .dashboard-due-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background-color: var(--color-accent);
    color: var(--color-linen);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }
  .dashboard-unbookmark {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-accent);
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.15s;
    flex-shrink: 0;
  }
  .dashboard-unbookmark:hover {
    color: var(--color-accent-light);
  }
  .dashboard-unbookmark:disabled {
    opacity: 0.4;
    cursor: default;
  }
  .dashboard-caught-up {
    display: block;
    text-align: center;
    padding: 1.25rem 2.5rem 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--color-earth-100), var(--color-parchment));
    border: 1px solid var(--color-earth-200);
    border-radius: 0.75rem;
    margin-bottom: 2rem;
    color: var(--color-ink-light);
    position: relative;
  }
  .dashboard-caught-up .dashboard-banner-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
  }
  .dashboard-caught-up:hover .dashboard-banner-arrow {
    transform: translateY(-50%) translateX(2px);
  }

  @media (max-width: 767px) {
    .dashboard-due-banner {
      gap: 0.75rem;
      padding: 1rem 1.25rem;
    }
    .dashboard-due-left {
      gap: 0.75rem;
    }
    .dashboard-due-number {
      font-size: 2rem;
    }
    .dashboard-section-line {
      font-size: 1.05rem;
      line-height: 1.7;
    }
    .dashboard-card-header {
      flex-wrap: wrap;
    }
    .dashboard-item {
      flex-wrap: wrap;
    }
    .dashboard-item-content {
      gap: 0.1rem;
    }
  }

  /* Feedback button */
  .feedback-btn {
    font-size: 0.75rem;
    color: var(--color-ink-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: color 0.15s;
  }
  .feedback-btn:hover {
    color: var(--color-accent);
  }

  /* Feedback modal */
  .feedback-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
  }
  .feedback-modal {
    background: var(--color-linen);
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 28rem;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  }
  .feedback-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
  }
  .feedback-modal-close {
    font-size: 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-ink-muted);
    padding: 0.25rem;
  }
  .feedback-field {
    display: flex;
    flex-direction: column;
  }
  .feedback-categories {
    display: flex;
    gap: 0.375rem;
  }
  .feedback-cat-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 4px;
    background: var(--color-linen);
    cursor: pointer;
    transition: all 0.15s;
  }
  .feedback-cat-btn:hover {
    border-color: var(--color-accent);
  }
  .feedback-cat-active {
    background: var(--color-accent);
    color: var(--color-linen);
    border-color: var(--color-accent);
  }
  .feedback-textarea {
    width: 100%;
    padding: 0.625rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 6px;
    background: var(--color-linen);
    font-family: var(--font-body);
    font-size: 0.875rem;
    resize: vertical;
    color: var(--color-ink);
  }
  .feedback-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
  }
  .feedback-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
  }
  .feedback-cancel-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 6px;
    background: var(--color-linen);
    cursor: pointer;
  }
  .feedback-submit-btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border: none;
    border-radius: 6px;
    background: var(--color-accent);
    color: var(--color-linen);
    cursor: pointer;
    transition: background 0.15s;
  }
  .feedback-submit-btn:hover {
    background: var(--color-accent-light);
  }
  .feedback-submit-btn:disabled {
    opacity: 0.6;
  }
  .feedback-done {
    text-align: center;
    padding: 1rem 0;
  }

  /* Entry popup overlay */
  .entry-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    padding: 1rem;
  }
  .entry-popup-container {
    background: var(--color-linen);
    border-radius: 8px;
    max-width: 42rem;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
  }
  .entry-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-earth-200);
    flex-shrink: 0;
  }
  .entry-popup-close {
    font-size: 1.5rem;
    line-height: 1;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-ink-muted);
    padding: 0.25rem 0.5rem;
  }
  .entry-popup-close:hover {
    color: var(--color-ink);
  }
  .entry-popup-back {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-ink-muted);
    padding: 0.25rem;
    display: flex;
    align-items: center;
  }
  .entry-popup-back:hover {
    color: var(--color-ink);
  }
  .entry-popup-body {
    overflow-y: auto;
    padding: 1.5rem;
    -webkit-overflow-scrolling: touch;
  }
  @media (max-width: 640px) {
    .entry-popup-overlay {
      padding: 0;
      align-items: flex-end;
    }
    .entry-popup-container {
      max-height: 92vh;
      border-radius: 12px 12px 0 0;
      max-width: 100%;
    }
  }

  /* Admin feedback queue */
  .admin-feedback-item {
    padding: 1rem;
    border: 1px solid var(--color-earth-200);
    border-radius: 8px;
    margin-bottom: 1rem;
    background: var(--color-linen);
  }
  .admin-feedback-actions {
    display: flex;
    gap: 0.375rem;
    flex-wrap: wrap;
  }
  .admin-status-btn {
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 4px;
    background: var(--color-linen);
    cursor: pointer;
    transition: all 0.15s;
    text-transform: capitalize;
  }
  .admin-status-btn-sm {
    padding: 0.125rem 0.5rem;
    font-size: 0.625rem;
  }
  .admin-status-btn:hover {
    border-color: var(--color-accent);
  }
  .admin-status-active {
    background: var(--color-accent);
    color: var(--color-linen);
    border-color: var(--color-accent);
  }
  /* Compact icaro row */
  .admin-icaro-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-earth-200);
  }
  .admin-icaro-row:first-of-type {
    border-top: 1px solid var(--color-earth-200);
  }
  .admin-icaro-title {
    font-family: var(--font-display, Georgia, serif);
    font-size: 0.9375rem;
    color: var(--color-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }
  .admin-icaro-title:hover {
    color: var(--color-teal-600);
  }
  .admin-icaro-source {
    font-size: 0.625rem;
    color: var(--color-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .admin-icaro-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
    flex-shrink: 0;
  }
  .feedback-status-pending { background: #fef3c7; color: #92400e; }
  .feedback-status-reviewed { background: #dbeafe; color: #1e40af; }
  .feedback-status-resolved { background: #d1fae5; color: #065f46; }
  .feedback-status-dismissed { background: var(--color-earth-200); color: var(--color-ink-muted); }
  .feedback-status-approved { background: #d1fae5; color: #065f46; }
  .feedback-status-rejected { background: #fee2e2; color: #991b1b; }
  .feedback-status-active { background: #d1fae5; color: #065f46; }
  .feedback-status-suspended { background: #fee2e2; color: #991b1b; }

  /* Admin tabs */
  .admin-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--color-earth-200);
    padding-bottom: 0.5rem;
  }
  .admin-tab {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--color-ink-muted);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.15s;
  }
  .admin-tab:hover {
    color: var(--color-ink);
  }
  .admin-tab-active {
    background: var(--color-accent);
    color: var(--color-linen);
  }
  .admin-tab-active:hover {
    color: var(--color-linen);
  }
  .admin-tab-badge {
    display: inline-block;
    background: #991b1b;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    padding: 0.05rem 0.35rem;
    border-radius: 9px;
    min-width: 1rem;
    text-align: center;
    vertical-align: middle;
    margin-left: 0.25rem;
  }

  /* Admin Import */
  .admin-import-form {
    background: var(--color-linen);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--color-earth-200);
  }
  .admin-import-dropzone {
    border: 2px dashed var(--color-earth-300);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
  }
  .admin-import-dropzone:hover,
  .admin-import-dropzone-active {
    border-color: var(--color-accent);
    background: rgba(28, 91, 122, 0.04);
  }
  .admin-import-preview {
    padding: 0.75rem 0;
  }
  .admin-import-radio-group {
    display: flex;
    gap: 1.25rem;
  }
  .admin-import-radio {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--color-ink);
  }
  .admin-import-section {
    background: var(--color-linen);
    padding: 1.25rem;
    border-radius: 8px;
    border: 1px solid var(--color-earth-200);
  }
  .admin-import-table {
    width: 100%;
    border-collapse: collapse;
  }
  .admin-import-table th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--color-earth-200);
  }
  .admin-import-table td {
    padding: 0.375rem 0.5rem;
    border-bottom: 1px solid var(--color-earth-100);
  }
  .admin-import-cell {
    width: 100%;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
  }
  .admin-import-cell:focus {
    outline: none;
    border-color: var(--color-accent);
    background: #fff;
  }
  .admin-import-cell-wide {
    min-width: 200px;
  }
  .admin-import-remove-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--color-ink-muted);
    font-size: 1.125rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
  }
  .admin-import-remove-btn:hover {
    background: #fee2e2;
    color: #991b1b;
  }
  .admin-import-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 6px;
    background: #fff;
    margin-top: 0.25rem;
    font-family: inherit;
  }
  .admin-import-input:focus {
    outline: none;
    border-color: var(--color-accent);
  }
  .admin-import-textarea {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 6px;
    background: #fff;
    margin-top: 0.25rem;
    font-family: monospace;
    resize: vertical;
    line-height: 1.5;
  }
  .admin-import-textarea:focus {
    outline: none;
    border-color: var(--color-accent);
  }

  /* Audio section */
  .audio-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .audio-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border: 1px solid var(--color-earth-200);
    border-radius: 8px;
    background: var(--color-linen);
    flex-wrap: wrap;
  }
  .audio-info {
    display: flex;
    flex-direction: column;
    min-width: 8rem;
  }
  .audio-singer {
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-ink);
  }
  .audio-player {
    height: 2rem;
    flex: 1;
    min-width: 12rem;
  }
  .audio-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
  }
  .audio-section-header .section-label {
    margin-bottom: 0;
  }
  .audio-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--color-ink-muted);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: color 0.15s;
  }
  .audio-upload-icon:hover {
    color: var(--color-accent);
  }
  .audio-upload-link {
    color: var(--color-accent);
    text-decoration: none;
    font-weight: 500;
  }
  .audio-upload-link:hover {
    text-decoration: underline;
  }

  /* Audio upload form */
  .audio-upload-form {
    margin-top: 1rem;
    padding: 1.25rem;
    background: var(--color-linen);
    border: 1px solid var(--color-earth-200);
    border-radius: 10px;
  }
  .audio-dropzone {
    position: relative;
    border: 2px dashed var(--color-earth-300);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    text-align: center;
  }
  .audio-dropzone:hover {
    border-color: var(--color-accent-warm);
    background: rgba(150, 120, 84, 0.04);
  }
  .audio-dropzone-active {
    border-color: var(--color-accent) !important;
    background: rgba(122, 51, 51, 0.04) !important;
  }
  .audio-file-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    opacity: 0;
    pointer-events: none;
  }
  .audio-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }
  .audio-dropzone-icon {
    color: var(--color-ink-muted);
    opacity: 0.6;
  }
  .audio-dropzone-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
  }
  .audio-dropzone-label {
    font-size: 0.8125rem;
    color: var(--color-ink-muted);
  }
  .audio-dropzone-browse {
    color: var(--color-accent);
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .audio-dropzone-hint {
    font-size: 0.6875rem;
    color: var(--color-ink-muted);
    opacity: 0.7;
  }
  .audio-dropzone-selected {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--color-ink);
  }
  .audio-dropzone-selected svg {
    color: var(--color-accent);
    flex-shrink: 0;
  }
  .audio-file-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
  }
  .audio-file-remove {
    background: none;
    border: none;
    color: var(--color-ink-muted);
    font-size: 1.125rem;
    cursor: pointer;
    padding: 0 0.25rem;
    line-height: 1;
    flex-shrink: 0;
  }
  .audio-file-remove:hover {
    color: var(--color-accent);
  }
  .audio-form-fields {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin-top: 1rem;
  }
  .audio-form-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .audio-form-label {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--color-ink-muted);
  }
  .audio-form-optional {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    opacity: 0.7;
  }
  .audio-form-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: var(--font-body);
    background: white;
    color: var(--color-ink);
    transition: border-color 0.15s;
  }
  .audio-form-input:focus {
    outline: none;
    border-color: var(--color-accent);
  }
  .audio-form-input::placeholder {
    color: var(--color-ink-muted);
    opacity: 0.5;
  }
  .audio-form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1.25rem;
  }
  .audio-form-cancel {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 6px;
    background: var(--color-linen);
    color: var(--color-ink-muted);
    cursor: pointer;
    transition: all 0.15s;
    font-family: var(--font-body);
  }
  .audio-form-cancel:hover {
    border-color: var(--color-ink-muted);
    color: var(--color-ink);
  }
  .audio-form-submit {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    border: none;
    border-radius: 6px;
    background: var(--color-accent);
    color: var(--color-linen);
    cursor: pointer;
    transition: background 0.15s;
    font-family: var(--font-body);
    font-weight: 500;
  }
  .audio-form-submit:hover {
    background: var(--color-accent-light);
  }
  .audio-form-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  /* Raw editor audio player */
  .raw-audio-player-wrap {
    margin-bottom: 0.5rem;
  }
  .raw-audio-player {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--color-earth-200);
    border-radius: 8px;
    background: var(--color-linen);
  }
  .raw-audio-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .raw-audio-controls {
    display: flex;
    align-items: center;
    gap: 0.375rem;
  }
  .raw-audio-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-ink-muted);
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    padding: 0;
  }
  .raw-audio-btn:hover {
    background: var(--color-earth-200);
    color: var(--color-ink);
  }
  .raw-audio-play {
    background: var(--color-accent);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
  }
  .raw-audio-play:hover {
    background: var(--color-accent-light);
    color: white;
  }
  .raw-audio-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--color-earth-300);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    margin: 0 0.25rem;
  }
  .raw-audio-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  .raw-audio-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  .raw-audio-time {
    font-size: 0.6875rem;
    color: var(--color-ink-muted);
    white-space: nowrap;
    min-width: 5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
  }

  /* Contributions */
  .contrib-new-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 6px;
    background: var(--color-accent);
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
  }
  .contrib-new-btn:hover { background: var(--color-accent-light); }
  .contrib-item {
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-earth-200);
  }
  .contrib-item:last-child { border-bottom: none; }

  /* My Icaros cards */
  .my-icaro-card {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--color-earth-200);
  }
  .my-icaro-card:last-child { border-bottom: none; }
  .my-icaro-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
  }
  .my-icaro-title {
    font-family: var(--font-display);
    font-size: 1.125rem;
    color: var(--color-ink);
    text-decoration: none;
    transition: color 0.2s;
  }
  .my-icaro-title:hover { color: var(--color-accent); }
  .my-icaro-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
  }
  .my-icaro-type {
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-ink-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
  }
  .my-icaro-type:hover { color: var(--color-ink-light); }
  .my-icaro-analyzed {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--color-accent);
  }
  .my-icaro-date {
    font-size: 0.7rem;
    color: var(--color-ink-muted);
    white-space: nowrap;
  }

  /* Stepper: Draft → Ready → Shared */
  .my-icaro-stepper {
    display: flex;
    align-items: flex-start;
    margin-top: 0.625rem;
    max-width: 16rem;
  }
  .stepper-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    z-index: 1;
    flex-shrink: 0;
  }
  .stepper-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-earth-200);
    border: 2px solid var(--color-earth-200);
    transition: all 0.25s ease;
  }
  .stepper-step.active .stepper-dot {
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--color-accent) 15%, transparent);
  }
  .stepper-step.completed .stepper-dot {
    background: var(--color-accent);
    border-color: var(--color-accent);
  }
  .stepper-label {
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-earth-400);
    transition: color 0.2s;
  }
  .stepper-step.active .stepper-label { color: var(--color-accent); }
  .stepper-step.completed .stepper-label { color: var(--color-ink-light); }
  .stepper-step.clickable { cursor: pointer; }
  .stepper-step.clickable .stepper-label {
    text-decoration: underline;
    text-decoration-color: var(--color-earth-300);
    text-underline-offset: 2px;
  }
  .stepper-step.clickable:hover .stepper-dot {
    background: var(--color-accent-light);
    border-color: var(--color-accent-light);
    transform: scale(1.3);
  }
  .stepper-step.clickable:hover .stepper-label {
    color: var(--color-accent);
    text-decoration-color: var(--color-accent);
  }
  .stepper-line {
    flex: 1;
    height: 1.5px;
    background: var(--color-earth-200);
    margin-top: 3px; /* vertically center with 8px dot */
    min-width: 1.5rem;
    transition: background 0.25s ease;
  }
  .stepper-line.completed { background: var(--color-accent); }

  .my-icaro-status-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
  }
  .my-icaro-revise-btn {
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-accent);
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    padding: 0;
  }
  .my-icaro-revise-btn:hover { color: var(--color-accent-light); }
  .my-icaro-notes {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-style: italic;
    color: var(--color-ink-light);
  }
  .contrib-editor {
    max-width: 36rem;
  }
  .contrib-editor-fullheight {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 14rem);
    gap: 0.75rem;
  }
  .analyze-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: analyze-spin 0.6s linear infinite;
    vertical-align: middle;
  }
  @keyframes analyze-spin {
    to { transform: rotate(360deg); }
  }
  .contrib-preview {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--color-ink-light);
    white-space: pre-wrap;
    max-height: 8rem;
    overflow-y: auto;
    padding: 0.5rem;
    background: color-mix(in srgb, var(--color-earth-200) 30%, transparent);
    border-radius: 4px;
    margin: 0;
  }
  .feedback-status-draft { background: var(--color-earth-200); color: var(--color-ink-muted); }
  .feedback-status-private { background: var(--color-earth-200); color: var(--color-ink-muted); }
  .feedback-status-submitted { background: #fef3c7; color: #92400e; }
  .feedback-status-published { background: #c7d2fe; color: #3730a3; }
  .badge-type-song { background: #fef3c7; color: #92400e; }
  .badge-type-concept { background: #e0e7ff; color: #3730a3; }

  /* Icaro Editor Header */
  .icaro-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
  }
  .icaro-editor-title-row {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
    margin-bottom: 1rem;
  }
  .icaro-save-btn {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    border: none;
    border-radius: 6px;
    background: var(--color-accent);
    color: var(--color-linen);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s, opacity 0.15s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }
  .icaro-save-btn:hover {
    background: var(--color-accent-light);
  }
  .icaro-save-btn.saving {
    pointer-events: none;
    opacity: 0.8;
  }
  .icaro-save-btn .save-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--color-linen);
    border-radius: 50%;
    animation: save-spin 0.6s linear infinite;
  }
  .icaro-save-btn.saving .save-spinner {
    display: block;
  }
  @keyframes save-spin {
    to { transform: rotate(360deg); }
  }
  .save-btn-with-spinner {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
  }
  .save-btn-with-spinner.saving {
    pointer-events: none;
    opacity: 0.6;
  }
  .save-btn-with-spinner .save-spinner {
    display: none;
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-earth-300);
    border-top-color: var(--color-ink);
    border-radius: 50%;
    animation: save-spin 0.6s linear infinite;
  }
  .save-btn-with-spinner.saving .save-spinner {
    display: block;
  }
  .icaro-editor-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-earth-200);
  }
  .icaro-delete-btn {
    font-size: 0.8125rem;
    color: #991b1b;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.375rem 0;
    font-family: var(--font-body);
  }
  .icaro-delete-btn:hover {
    text-decoration: underline;
  }
  .analyze-spinner-dark {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(0,0,0,0.15);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: analyze-spin 0.6s linear infinite;
    vertical-align: middle;
  }

  /* Icaro Editor Layout */
  .icaro-editor-layout {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
    align-items: start;
  }
  @media (max-width: 768px) {
    .icaro-editor-layout {
      grid-template-columns: 1fr;
    }
  }
  .icaro-editor-preview {
    border: 1px solid var(--color-earth-200);
    border-radius: 8px;
    padding: 1rem;
    background: var(--color-linen);
  }
  .icaro-editor-preview .song-section {
    padding: 0.5rem 1rem;
    margin-bottom: 0.75rem;
  }
  .icaro-editor-preview .song-line {
    line-height: 1.3;
  }
  .icaro-editor-preview .song-line.clickable {
    cursor: pointer;
    padding: 0.125rem 0.5rem;
    margin: 0;
    border-radius: 4px;
    transition: background 0.15s;
  }
  .icaro-editor-preview .song-line.clickable:hover {
    background: color-mix(in srgb, var(--color-earth-200) 50%, transparent);
  }
  .icaro-editor-preview .song-line.selected {
    background: color-mix(in srgb, var(--color-accent) 15%, transparent);
    border-left: 3px solid var(--color-accent);
    padding-left: calc(0.5rem - 3px);
  }
  .icaro-editor-pane-wrap {
    position: sticky;
    top: 1rem;
  }
  .icaro-editor-pane {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }

  /* Morpheme Editor */
  .morpheme-editor-card {
    border: 1px solid var(--color-earth-200);
    border-radius: 8px;
    padding: 1.25rem;
    background: var(--color-parchment);
  }
  .morpheme-text {
    font-family: var(--font-display);
    font-size: 1.375rem;
    line-height: 1.8;
    padding: 0.5rem;
    border: 1px solid var(--color-earth-200);
    border-radius: 4px;
    background: white;
    user-select: none;
    -webkit-user-select: none;
  }
  .morpheme-char {
    display: inline-block;
    cursor: pointer;
    padding: 0 1px;
    border-radius: 2px;
    transition: background 0.1s;
  }
  .morpheme-char:hover {
    background: color-mix(in srgb, var(--color-earth-200) 60%, transparent);
  }
  .morpheme-char.selected {
    background: #fde68a;
  }

  /* Tag buttons */
  .morpheme-tag-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
  }
  .morpheme-tag-btn {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid var(--color-earth-200);
    background: white;
    cursor: pointer;
    transition: background 0.15s;
  }
  .morpheme-tag-btn:hover { background: var(--color-earth-200); }
  .morpheme-tag-root { border-color: var(--color-ink); color: var(--color-ink); }
  .morpheme-tag-suffix { border-color: #dc2626; color: #dc2626; }
  .morpheme-tag-prefix { border-color: #2563eb; color: #2563eb; }
  .morpheme-tag-btn-clear {
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--color-earth-200);
    background: transparent;
    color: var(--color-ink-muted);
    cursor: pointer;
  }

  /* Morpheme parts display */
  .morpheme-parts-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
  }
  .morpheme-part-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    background: color-mix(in srgb, var(--color-earth-200) 40%, transparent);
  }
  .morpheme-part-type {
    font-size: 0.625rem;
    font-weight: 400;
    text-transform: uppercase;
    opacity: 0.6;
  }
  .morpheme-part-remove {
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.5;
    margin-left: 0.125rem;
  }
  .morpheme-part-remove:hover { opacity: 1; }

  /* Read-only rows with pencil edit */
  .morph-readonly-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.25rem 0;
  }
  .morph-readonly-label {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-ink);
    white-space: nowrap;
  }
  .morph-readonly-value {
    flex: 1;
    font-size: 0.875rem;
    color: var(--color-ink-light);
  }
  .morph-readonly-input {
    flex: 1;
  }
  .morph-edit-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    color: var(--color-ink-muted);
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    border-radius: 4px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
  }
  .morph-edit-btn:hover {
    background: var(--color-earth-200);
    color: var(--color-ink);
  }
  .morph-edit-btn-active {
    background: var(--color-accent);
    color: white;
  }
  .morph-edit-btn-active:hover {
    background: var(--color-accent);
    color: white;
  }
  .morph-delete-btn {
    font-size: 1rem;
    color: var(--color-ink-muted);
    opacity: 0.5;
  }
  .morph-delete-btn:hover {
    background: #fee2e2;
    color: #991b1b;
    opacity: 1;
  }

  /* Morpheme inputs */
  .morpheme-input {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--color-earth-200);
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
    color: var(--color-ink);
    font-family: var(--font-body);
  }
  .morpheme-input:focus { outline: 2px solid var(--color-accent); outline-offset: -1px; }
  .morpheme-input-sm {
    padding: 0.25rem 0.375rem;
    border: 1px solid var(--color-earth-200);
    border-radius: 4px;
    font-size: 0.8125rem;
    background: white;
    color: var(--color-ink);
    font-family: var(--font-body);
  }

  /* Autocomplete suggestions */
  .morpheme-suggestions {
    border: 1px solid var(--color-earth-200);
    border-radius: 4px;
    margin-top: 0.25rem;
    background: white;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  }
  .morpheme-suggestions:empty { display: none; }
  /* Absolutely positioned dropdown inside the modal dictionary search */
  .ms-dict-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 10;
    max-height: 11rem;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  }
  /* Two-column grid for form/type and meaning/pos rows */
  .ms-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
  }
  .morpheme-suggest-group {
    padding: 0.375rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-ink-muted);
    background: var(--color-linen);
    border-bottom: 1px solid var(--color-earth-200);
  }
  .morpheme-suggestion {
    padding: 0.5rem;
    cursor: pointer;
    border-bottom: 1px solid var(--color-earth-100);
  }
  .morpheme-suggestion:hover { background: var(--color-linen); }
  .morpheme-suggestion:last-child { border-bottom: none; }

  /* Link Picker */
  .link-picker-option {
    position: relative;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s;
  }
  .link-picker-option:hover { border-color: var(--color-accent); background: var(--color-linen); }
  .link-picker-current { border-color: var(--color-accent); background: var(--color-linen-dark, #f5f0e8); }
  .link-picker-check {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: var(--color-accent);
    font-weight: 600;
  }

  /* Icaro Dictionary Grid */
  .icaro-dict-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.75rem;
  }
  .icaro-dict-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.75rem;
    border: 1px solid var(--color-earth-200);
    border-radius: 6px;
    background: var(--color-parchment);
  }

  /* Admin dictionary management */
  .admin-dict-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
  }
  .admin-dict-filters select,
  .admin-dict-filters input[type="search"] {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 4px;
    background: var(--color-linen);
    color: var(--color-ink);
  }
  .admin-dict-filters input[type="search"] {
    flex: 1;
    min-width: 160px;
  }
  .admin-dict-btn-accent {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1px solid var(--color-accent);
    border-radius: 4px;
    background: var(--color-accent);
    color: var(--color-linen);
    cursor: pointer;
    white-space: nowrap;
  }
  .admin-dict-btn-accent:hover { opacity: 0.9; }
  .admin-dict-btn-accent:disabled { opacity: 0.5; cursor: default; }
  .admin-dict-create-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
  }
  .admin-dict-input {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 4px;
    background: white;
    flex: 1;
    min-width: 80px;
  }
  .admin-dict-field {
    cursor: pointer;
    padding: 0.125rem 0.25rem;
    border-radius: 2px;
    transition: background 0.15s;
  }
  .admin-dict-field:hover {
    background: var(--color-earth-100);
  }
  .admin-dict-inline-input {
    font: inherit;
    font-size: inherit;
    padding: 0.125rem 0.375rem;
    border: 1px solid var(--color-accent);
    border-radius: 3px;
    background: white;
    outline: none;
    width: 100%;
    min-width: 120px;
  }
  .badge-verified {
    background: #d1fae5;
    color: #065f46;
    font-weight: 600;
  }
  .badge-unverified {
    background: var(--color-earth-100);
    color: var(--color-ink-muted);
    font-weight: 400;
  }
  .admin-dict-entry .admin-dict-field {
    border-bottom: 1px dashed transparent;
  }
  .admin-dict-entry .admin-dict-field:hover {
    border-bottom-color: var(--color-earth-300);
  }
  .admin-dict-meaning {
    font-size: 0.9375rem;
    line-height: 1.4;
  }
  .admin-dict-meta {
    color: var(--color-ink-muted);
    font-size: 0.75rem;
  }
  .admin-dict-analysis {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8125rem;
  }
  .admin-dict-analysis-issues {
    background: #fef2f2;
    border: 1px solid #fecaca;
  }
  .admin-dict-analysis-usage {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
  }
  .admin-dict-analysis-lang {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
  }
  .admin-dict-analysis-clean {
    background: var(--color-parchment);
    border: 1px solid var(--color-earth-200);
  }
  .admin-dict-analysis + .admin-dict-analysis {
    margin-top: 0.25rem;
  }
  /* Compact table view */
  .admin-dict-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
  }
  .admin-dict-table thead th {
    text-align: left;
    padding: 0.5rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-ink-muted);
    border-bottom: 2px solid var(--color-earth-200);
    white-space: nowrap;
  }
  .adt-cb { width: 2rem; text-align: center !important; }
  .adt-form { width: 10rem; }
  .adt-type { width: 4.5rem; }
  .adt-pos { width: 6rem; position: relative; }
  .adt-status { width: 5rem; }
  .adt-actions { width: 4.5rem; text-align: right !important; }
  .adt-row td {
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--color-earth-100);
    vertical-align: middle;
  }
  .adt-row:hover td { background: var(--color-parchment); }
  .adt-row-selected td { background: #fef3c7; }
  .adt-row-verified td { opacity: 0.7; }
  .adt-form-text {
    font-family: var(--font-display);
    font-size: 0.9375rem;
    font-weight: 600;
  }
  .adt-pos-text { color: var(--color-ink-muted); }
  .adt-issue-dot {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    line-height: 1rem;
    text-align: center;
    border-radius: 50%;
    background: #fecaca;
    color: #dc2626;
    font-size: 0.625rem;
    font-weight: 700;
    margin-left: 0.25rem;
    vertical-align: middle;
  }
  .badge-sm {
    font-size: 0.5625rem;
    padding: 0.0625rem 0.375rem;
  }
  .adt-btn {
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    border: 1px solid var(--color-earth-300);
    border-radius: 3px;
    background: var(--color-linen);
    cursor: pointer;
    transition: all 0.15s;
    line-height: 1.2;
  }
  .adt-btn:hover { border-color: var(--color-accent); }
  .adt-btn:disabled { opacity: 0.4; cursor: default; }
  .adt-btn-delete { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
  .adt-btn-delete:hover { border-color: #dc2626; color: #dc2626; background: #fee2e2; }
  .adt-btn svg { display: inline-block; width: 12px; height: 12px; vertical-align: middle; }
  .adt-analysis-row td {
    padding: 0.25rem 0.5rem 0.5rem 2.5rem;
    border-bottom: 1px solid var(--color-earth-200);
    font-size: 0.75rem;
    background: var(--color-parchment);
  }
  .adt-analysis-content { display: flex; flex-wrap: wrap; gap: 0.25rem 0.75rem; }
  .admin-dict-pagination {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    justify-content: center;
    padding: 1rem 0;
    flex-wrap: wrap;
  }
  .admin-dict-issue-error { color: #dc2626; }
  .admin-dict-issue-warning { color: #d97706; }
  .admin-dict-issue-info { color: #2563eb; }
  .text-accent { color: var(--color-accent); text-decoration: none; }
  .text-accent:hover { text-decoration: underline; }
  /* Analysis summary bar */
  .adt-summary {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: var(--color-parchment);
    border: 1px solid var(--color-earth-200);
    border-radius: 6px;
    font-size: 0.8125rem;
    flex-wrap: wrap;
  }
  .adt-summary-label {
    font-weight: 600;
    color: var(--color-ink-muted);
    text-transform: uppercase;
    font-size: 0.6875rem;
    letter-spacing: 0.05em;
  }
  .adt-summary-item { font-weight: 500; }
  /* Sortable columns */
  .adt-sortable { cursor: pointer; user-select: none; }
  .adt-sortable:hover { color: var(--color-ink); }
  .adt-sort-arrow { font-size: 0.625rem; opacity: 0.3; }
  .adt-sort-active { opacity: 1; color: var(--color-accent); }
  /* Expand link */
  .adt-expand-link {
    color: var(--color-accent);
    cursor: pointer;
    font-weight: 500;
  }
  .adt-expand-link:hover { text-decoration: underline; }
  .adt-issue-dot { cursor: pointer; }
  /* POS picker */
  .adt-pos-picker {
    position: absolute;
    z-index: 20;
    background: white;
    border: 1px solid var(--color-earth-300);
    border-radius: 6px;
    padding: 0.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    min-width: 8rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }
  .adt-pos-option {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
  }
  .adt-pos-option:hover { background: var(--color-parchment); }
  .adt-pos-option input[type="checkbox"] { margin: 0; accent-color: var(--color-accent); }
  .adt-pos-picker-actions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
    padding-top: 0.375rem;
    border-top: 1px solid var(--color-earth-100);
  }
  .adt-pos-text { cursor: pointer; }
  .adt-pos-text:hover { color: var(--color-accent); }
  @media (max-width: 640px) {
    .admin-dict-table { font-size: 0.75rem; display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .admin-dict-table thead, .admin-dict-table tbody { min-width: 28rem; display: table; width: 100%; }
    .adt-pos, .adt-status { display: none; }
    .adt-form { width: auto; }
    .adt-type { width: 3.5rem; }
    .adt-cb { width: 1.5rem; }
    .admin-dict-filters { flex-direction: column; }
    .admin-dict-filters select,
    .admin-dict-filters input[type="search"] { width: 100%; }
    .admin-dict-create-row { flex-direction: column; }
    .admin-dict-create-row .admin-dict-input { width: 100%; }
  }

  .admin-publish-btn {
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid #6366f1;
    background: #6366f1;
    color: #fff;
    cursor: pointer;
    margin-left: 0.5rem;
  }
  .admin-publish-btn:hover { background: #4f46e5; }
  .admin-publish-btn:disabled { opacity: 0.5; cursor: default; }

  /* Morpheme Suggestions */
  .suggestion-card {
    background: var(--color-linen);
    border: 1px solid var(--color-earth-200);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
  }
  .suggestion-type-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
  }
  .suggestion-type-new { background: #dbeafe; color: #1d4ed8; }
  .suggestion-type-edit { background: #fef3c7; color: #92400e; }
  .suggestion-type-delete { background: #fee2e2; color: #991b1b; }
  .suggestion-diff {
    background: var(--color-parchment);
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
  }
  .suggestion-diff-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    flex-wrap: wrap;
  }
  .suggestion-diff-label {
    font-size: 0.75rem;
    color: var(--color-ink-muted);
    min-width: 3.5rem;
    font-weight: 500;
  }
  .suggestion-diff-old {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.8125rem;
    text-decoration: line-through;
  }
  .suggestion-diff-new {
    background: #dcfce7;
    color: #166534;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-size: 0.8125rem;
  }
  .suggestion-diff-arrow {
    color: var(--color-ink-muted);
    font-size: 0.75rem;
  }
  .suggestion-delete-preview {
    background: #fee2e2;
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
    border-left: 3px solid #ef4444;
  }
  .suggestion-new-preview {
    background: #dcfce7;
    border-radius: 6px;
    padding: 0.625rem 0.75rem;
    border-left: 3px solid #22c55e;
  }

  /* Chat */
  .chat-layout {
    display: flex;
    gap: 1rem;
    height: calc(100vh - 8rem);
    min-height: 400px;
  }
  .chat-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
  .chat-new-btn {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-ink);
    background: var(--color-earth-200);
    border: 1px solid var(--color-earth-300);
    border-radius: 6px;
    cursor: pointer;
    text-align: left;
  }
  .chat-new-btn:hover {
    background: var(--color-earth-300);
  }
  .chat-session-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .chat-session-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    color: var(--color-ink-light);
    transition: background 0.15s;
  }
  .chat-session-item:hover {
    background: var(--color-earth-200);
  }
  .chat-session-active {
    background: var(--color-earth-200);
    color: var(--color-ink);
  }
  .chat-session-preview {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .chat-session-delete {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: var(--color-ink-muted);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s;
  }
  .chat-session-item:hover .chat-session-delete {
    opacity: 1;
  }
  .chat-session-delete:hover {
    background: var(--color-earth-300);
    color: var(--color-ink);
  }
  .chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  .chat-msg {
    max-width: 80%;
    padding: 0.625rem 0.875rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.5;
    font-family: var(--font-body);
  }
  .chat-msg-user {
    align-self: flex-end;
    background: var(--color-earth-600, #6b5c4f);
    color: white;
    border-bottom-right-radius: 4px;
  }
  .chat-msg-assistant {
    align-self: flex-start;
    background: var(--color-earth-200);
    color: var(--color-ink);
    border-bottom-left-radius: 4px;
  }
  .chat-msg-content {
    word-wrap: break-word;
  }
  .chat-code-block {
    background: color-mix(in srgb, var(--color-ink) 8%, transparent);
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.8125rem;
    overflow-x: auto;
    margin: 0.25rem 0;
    white-space: pre-wrap;
  }
  .chat-code-inline {
    background: color-mix(in srgb, var(--color-ink) 8%, transparent);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    font-family: monospace;
    font-size: 0.8125rem;
  }
  .chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 2rem;
    text-align: center;
  }
  .chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
  }
  .chat-suggestion {
    padding: 0.375rem 0.75rem;
    font-family: var(--font-body);
    font-size: 0.8125rem;
    color: var(--color-ink-light);
    background: var(--color-earth-200);
    border: 1px solid var(--color-earth-300);
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.15s;
  }
  .chat-suggestion:hover {
    background: var(--color-earth-300);
    color: var(--color-ink);
  }
  .chat-typing {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0.875rem;
    align-self: flex-start;
  }
  .chat-typing.hidden {
    display: none;
  }
  .chat-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-ink-muted);
    animation: chatTyping 1.4s infinite both;
  }
  .chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
  .chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }
  @keyframes chatTyping {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
  }
  .chat-input-area {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding: 0.75rem 0;
    border-top: 1px solid var(--color-earth-200);
  }
  .chat-input {
    flex: 1;
    resize: none;
    border: 1px solid var(--color-earth-300);
    border-radius: 12px;
    padding: 0.625rem 0.875rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    line-height: 1.5;
    background: white;
    color: var(--color-ink);
    outline: none;
    max-height: 120px;
    overflow-y: auto;
  }
  .chat-input:focus {
    border-color: var(--color-earth-500, #8b7b6b);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--color-earth-500, #8b7b6b) 20%, transparent);
  }
  .chat-send-btn {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: var(--color-earth-600, #6b5c4f);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s;
  }
  .chat-send-btn:hover {
    background: var(--color-earth-700, #5a4d42);
  }
  .chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }
  @media (max-width: 640px) {
    .chat-layout {
      flex-direction: column;
      height: calc(100vh - 7rem - 4.5rem - env(safe-area-inset-bottom, 0px));
    }
    .chat-sidebar {
      width: 100%;
      flex-direction: row;
      overflow-x: auto;
      gap: 0.25rem;
    }
    .chat-new-btn {
      flex-shrink: 0;
      width: auto;
    }
    .chat-session-list {
      flex-direction: row;
      overflow-y: visible;
      overflow-x: auto;
    }
    .chat-session-item {
      flex-shrink: 0;
      max-width: 150px;
    }
    .chat-msg {
      max-width: 90%;
    }
  }

  /* Landing page */
  /* Landing page — logo-derived palette */
  @keyframes landing-logo-in {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }
  @keyframes landing-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  @keyframes landing-glow-pulse {
    0%, 100% { opacity: 0.10; transform: translate(-50%, -55%) scale(1); }
    50%      { opacity: 0.18; transform: translate(-50%, -55%) scale(1.05); }
  }
  .landing-hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #091b2a 0%, #143a56 30%, #1c5b7a 60%, #2b7a96 85%, #3a9cbd 100%);
    overflow: hidden;
  }
  .landing-hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, rgba(212, 150, 58, 0.12) 0%, rgba(196, 89, 40, 0.06) 40%, transparent 70%);
    pointer-events: none;
    animation: landing-glow-pulse 6s ease-in-out infinite;
  }
  .landing-hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    background-repeat: repeat;
    background-size: 40px 40px;
    pointer-events: none;
  }
  .landing-hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 3rem 1.5rem;
    max-width: 640px;
  }
  .landing-logo {
    width: 300px;
    max-width: 70vw;
    height: auto;
    margin: 0 auto 2rem;
    border-radius: 20px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: landing-logo-in 1s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .landing-subtitle {
    font-family: 'Red Hat Display', 'Inter', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.88);
    line-height: 1.6;
    letter-spacing: 0.01em;
    margin-bottom: 2.5rem;
    animation: landing-fade-up 0.8s ease-out 0.35s both;
  }
  .landing-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2.25rem;
    background: var(--color-terracotta-500, #c45928);
    color: #fff;
    font-family: 'Red Hat Display', 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: 10px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 4px 20px rgba(196, 89, 40, 0.35);
    animation: landing-fade-up 0.8s ease-out 0.55s both;
  }
  .landing-cta:hover {
    transform: translateY(-2px);
    background: var(--color-amber-500, #d4963a);
    box-shadow: 0 8px 32px rgba(196, 89, 40, 0.4);
  }
  .landing-cta svg {
    display: inline-block;
    flex-shrink: 0;
  }
  .landing-guest-link {
    display: block;
    margin-top: 1rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.2s ease;
    animation: landing-fade-up 0.8s ease-out 0.7s both;
  }
  .landing-guest-link:hover {
    color: rgba(255, 255, 255, 0.85);
  }
  .landing-divider {
    height: 30px;
    background-repeat: repeat-x;
    background-size: 40px 30px;
    background-position: center;
    background-color: var(--surface-secondary, #f9f8f7);
  }
  .landing-features {
    padding: 5rem 1.5rem;
    background: var(--surface-secondary, #f9f8f7);
    text-align: center;
  }
  .landing-features-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 2.25rem;
    font-weight: 400;
    color: var(--color-ink, #242220);
    margin-bottom: 0.75rem;
  }
  .landing-features-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 400;
    color: var(--text-secondary, #6b6658);
    line-height: 1.5;
    margin-bottom: 3rem;
  }
  .landing-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    max-width: 820px;
    margin: 0 auto;
  }
  @media (max-width: 700px) {
    .landing-features-grid {
      grid-template-columns: 1fr;
      max-width: 400px;
    }
  }
  .landing-feature-card {
    background: var(--surface-primary, #fff);
    border: 1px solid var(--border-default, #e0ddd4);
    border-radius: 14px;
    padding: 2.25rem 1.5rem 2rem;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 8px rgba(36, 34, 32, 0.06);
  }
  .landing-feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(36, 34, 32, 0.1);
  }
  .landing-feature-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: #d0e9f2;
    color: #1a4a6e;
    margin-bottom: 1.25rem;
  }
  .landing-feature-name {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--color-ink, #242220);
    margin-bottom: 0.5rem;
  }
  .landing-feature-desc {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary, #6b6658);
    line-height: 1.55;
  }
  .landing-bottom-cta {
    padding: 4.5rem 1.5rem;
    background: var(--color-teal-50, #f0f7fa);
    text-align: center;
  }
  .landing-bottom-title {
    font-family: 'DM Serif Display', Georgia, serif;
    font-size: 1.85rem;
    font-weight: 400;
    color: var(--color-ink, #242220);
    margin-bottom: 0.5rem;
  }
  .landing-bottom-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary, #6b6658);
    margin-bottom: 2rem;
  }
  .landing-bottom-cta .landing-cta {
    background: var(--color-teal-700, #1a4a6e);
    color: #fff;
    box-shadow: 0 4px 20px rgba(26, 74, 110, 0.3);
    animation: none;
  }
  .landing-bottom-cta .landing-cta:hover {
    background: var(--color-teal-600, #1c5b7a);
    box-shadow: 0 8px 32px rgba(26, 74, 110, 0.35);
  }
  .header-logo-mark {
    width: 34px;
    height: 34px;
    object-fit: contain;
    flex-shrink: 0;
  }

  /* Bottom nav */
  .bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
    background-color: var(--color-sand);
    border-top: 1px solid var(--color-sand-dark);
    justify-content: space-around;
    align-items: center;
    padding: 0.5rem 0;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-ink-muted);
    text-decoration: none;
    padding: 0.25rem 0.75rem;
    transition: color 0.15s ease;
  }
  .bottom-nav-item svg {
    display: block;
    width: 22px;
    height: 22px;
  }
  .bottom-nav-item.active {
    color: var(--color-accent);
  }
  @media (max-width: 767px) {
    .bottom-nav {
      display: flex;
    }
    .nav-toggle {
      display: none !important;
    }
    #site-nav {
      display: none !important;
    }
    #app {
      padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }
    footer {
      padding-bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }
  }

  /* Dictionary Drawer */
  .dict-drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 199;
    opacity: 0;
    transition: opacity 0.25s ease;
  }
  .dict-drawer-backdrop.active {
    opacity: 1;
    pointer-events: auto;
  }
  .dict-drawer {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 24rem;
    max-width: 100vw;
    z-index: 200;
    background-color: var(--color-sand);
    border-left: 1px solid var(--color-sand-dark);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .dict-drawer.active {
    transform: translateX(0);
  }
  .dict-drawer-handle {
    display: none;
  }
  .dict-drawer-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-earth-200);
    flex-shrink: 0;
  }
  .dict-drawer-search-wrap {
    flex: 1;
    position: relative;
  }
  .dict-drawer-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-ink-muted);
    pointer-events: none;
    display: inline-block;
  }
  .dict-drawer-search {
    width: 100%;
    padding: 0.625rem 0.75rem 0.625rem 2.5rem;
    background-color: var(--color-linen);
    border: 1px solid var(--color-earth-200);
    border-radius: 2px;
    color: var(--color-ink);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 400;
    transition: border-color 0.2s ease;
  }
  .dict-drawer-search::placeholder {
    color: var(--color-earth-400);
    font-weight: 300;
  }
  .dict-drawer-search:focus {
    outline: none;
    border-color: var(--color-accent-warm);
    box-shadow: 0 0 0 1px var(--color-accent-warm);
  }
  .dict-drawer-pin {
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--color-ink-muted);
    padding: 0.35rem;
    flex-shrink: 0;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
    display: none;
    line-height: 0;
  }
  .dict-drawer-pin:hover {
    color: var(--color-ink);
    background-color: var(--color-earth-100, rgba(0,0,0,0.04));
  }
  .dict-drawer-pin.active {
    color: var(--color-accent);
    background-color: var(--color-accent-warm-bg, rgba(139,69,19,0.08));
    border-color: var(--color-accent-warm, var(--color-accent));
  }
  .dict-drawer-pin.active:hover {
    color: var(--color-accent-light);
  }
  .dict-drawer-pin svg {
    display: block;
  }
  /* Pinned drawer state */
  .dict-drawer.pinned {
    transform: translateX(0);
    box-shadow: none;
    border-left: 1px solid var(--color-earth-200);
  }
  body.dict-pinned {
    overflow: auto !important;
    padding-right: 24rem;
    transition: padding-right 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  body.dict-pinned .dict-drawer-backdrop {
    display: none !important;
  }
  body.dict-pinned .dict-fab {
    display: none !important;
  }
  .dict-drawer-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
  }
  .dict-drawer-body .entry-card {
    padding: 0.875rem 1rem;
  }
  .dict-drawer-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 8rem;
    color: var(--color-ink-muted);
    font-style: italic;
    font-size: 0.95rem;
    text-align: center;
    padding: 2rem 1.5rem;
  }
  .dict-drawer-entry {
    padding: 1.25rem;
  }
  .dict-drawer-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--color-ink-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
  }
  .dict-drawer-back:hover {
    color: var(--color-ink);
  }
  .dict-drawer-count {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--color-ink-muted);
    font-weight: 300;
  }

  /* Dictionary FAB */
  .dict-fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 100;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background-color: var(--color-accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  }
  .dict-fab:hover {
    background-color: var(--color-accent-light);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  }
  .dict-fab svg {
    display: inline-block;
  }

  /* Mobile dictionary drawer overrides — pin not available on mobile */
  @media (max-width: 767px) {
    .dict-drawer-pin { display: none !important; }
    body.dict-pinned { padding-right: 0; }
    .dict-drawer.pinned { transform: translateY(100%); }
    .dict-drawer.pinned.active { transform: translateY(0); }
    .dict-drawer {
      top: auto;
      left: 0;
      right: 0;
      bottom: 0;
      width: 100%;
      max-height: 85vh;
      border-left: none;
      border-top: 1px solid var(--color-earth-300);
      border-radius: 12px 12px 0 0;
      box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.1);
      transform: translateY(100%);
    }
    .dict-drawer.active {
      transform: translateY(0);
    }
    .dict-drawer-handle {
      display: flex;
      justify-content: center;
      padding: 0.75rem 0 0.25rem;
      cursor: grab;
    }
    .dict-drawer-handle::before {
      content: "";
      width: 2.5rem;
      height: 0.25rem;
      background: var(--color-earth-300);
      border-radius: 2px;
    }
    .dict-drawer-backdrop {
      display: block;
      pointer-events: none;
    }
    .dict-fab {
      display: none !important;
    }
  }

  /* Desktop: show backdrop as clickable overlay + pin button */
  @media (min-width: 768px) {
    .dict-drawer-backdrop {
      display: block;
      pointer-events: none;
    }
    .dict-drawer-pin {
      display: flex;
      align-items: center;
      justify-content: center;
    }
  }
}
@property --tw-translate-x {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}
@property --tw-translate-y {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}
@property --tw-translate-z {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}
@property --tw-space-y-reverse {
  syntax: "*";
  inherits: false;
  initial-value: 0;
}
@property --tw-border-style {
  syntax: "*";
  inherits: false;
  initial-value: solid;
}
@property --tw-leading {
  syntax: "*";
  inherits: false;
}
@property --tw-font-weight {
  syntax: "*";
  inherits: false;
}
@property --tw-tracking {
  syntax: "*";
  inherits: false;
}
@layer properties {
  @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
    *, ::before, ::after, ::backdrop {
      --tw-translate-x: 0;
      --tw-translate-y: 0;
      --tw-translate-z: 0;
      --tw-space-y-reverse: 0;
      --tw-border-style: solid;
      --tw-leading: initial;
      --tw-font-weight: initial;
      --tw-tracking: initial;
    }
  }
}

/* ============================================
   Library (Source PDFs)
   ============================================ */

.library-page {
  max-width: 48rem;
  margin: 0 auto;
}

.library-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.library-file-count {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--color-earth-500);
  font-weight: 400;
  background: var(--color-earth-100);
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  white-space: nowrap;
  margin-top: 0.25rem;
}

.library-search-wrap {
  position: relative;
  margin-bottom: 1.75rem;
}

.library-search-icon {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-earth-400);
  pointer-events: none;
}

.library-search {
  width: 100%;
  padding: 0.625rem 0.875rem 0.625rem 2.5rem;
  border: 1px solid var(--color-earth-200);
  border-radius: 0.5rem;
  background: var(--color-earth-50);
  font-size: 0.875rem;
  color: var(--color-ink);
  font-family: var(--font-body);
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.library-search:focus {
  outline: none;
  border-color: var(--color-teal-400);
  box-shadow: 0 0 0 3px rgba(43, 122, 150, 0.1);
}

.library-search::placeholder {
  color: var(--color-earth-400);
}

.library-courses {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.library-course {
  border: 1px solid var(--color-earth-200);
  border-radius: 0.75rem;
  overflow: hidden;
  background: white;
  transition: box-shadow 0.15s;
}

.library-course:hover {
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.library-course-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  text-align: left;
  transition: background 0.1s;
}

.library-course-header:hover {
  background: var(--color-earth-50);
}

.library-course-header-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.library-chevron {
  color: var(--color-earth-400);
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.library-course.collapsed .library-chevron {
  transform: rotate(-90deg);
}

.library-course-name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--color-ink);
  line-height: 1.3;
}

.library-course-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--color-earth-500);
  font-weight: 400;
  margin-top: 0.125rem;
}

.library-course-count {
  font-size: 0.75rem;
  color: var(--color-earth-500);
  background: var(--color-earth-100);
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-weight: 500;
  flex-shrink: 0;
}

.library-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 1.75rem;
  height: 1.75rem;
  padding: 0 0.375rem;
  border: none;
  border-radius: 999px;
  background: var(--color-earth-100);
  color: var(--color-earth-500);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.library-download-btn:hover {
  background: var(--color-teal-100);
  color: var(--color-teal-700);
}

.library-download-btn.downloading {
  opacity: 0.5;
  cursor: wait;
}

.library-download-btn.downloading .library-download-icon svg {
  animation: spin 1s linear infinite;
}

.library-download-btn.downloaded {
  cursor: default;
  pointer-events: none;
}

.library-download-icon {
  display: flex;
  align-items: center;
}

.library-download-count {
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1;
}

.library-download-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1.25rem 0.625rem;
  background: var(--color-teal-50);
  border-bottom: 1px solid var(--color-earth-100);
}

.library-progress-bar {
  flex: 1;
  height: 4px;
  background: var(--color-earth-100);
  border-radius: 2px;
  overflow: hidden;
}

.library-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-teal-600);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.library-progress-text {
  font-size: 0.6875rem;
  color: var(--color-earth-500);
  white-space: nowrap;
  flex-shrink: 0;
}

.library-course-body {
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.library-course.collapsed .library-course-body {
  max-height: 0 !important;
}

.library-module-header {
  padding: 0.5rem 1.25rem 0.375rem;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-teal-600);
  border-top: 1px solid var(--color-earth-100);
  background: var(--color-teal-50);
}

.library-file-list {
  border-top: 1px solid var(--color-earth-100);
}

.library-file {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 1.25rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s;
  border-bottom: 1px solid var(--color-earth-50);
}

.library-file:last-child {
  border-bottom: none;
}

.library-file:hover {
  background: var(--color-earth-50);
}

.library-file-icon {
  flex-shrink: 0;
  color: var(--color-terracotta-400);
  opacity: 0.7;
}

.library-file:hover .library-file-icon {
  opacity: 1;
}

.library-file-info {
  flex: 1;
  min-width: 0;
}

.library-file-name {
  display: block;
  font-size: 0.8125rem;
  color: var(--color-ink);
  font-weight: 400;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-file-meta {
  display: block;
  font-size: 0.6875rem;
  color: var(--color-earth-500);
  margin-top: 0.0625rem;
}

.library-file-open {
  flex-shrink: 0;
  color: var(--color-earth-300);
  transition: color 0.1s;
}

.library-file:hover .library-file-open {
  color: var(--color-teal-500);
}

/* Loading dots */
.library-loading {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 3rem 0;
}

.library-loading-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-earth-300);
  animation: library-pulse 1.2s ease-in-out infinite;
}

.library-loading-dot:nth-child(2) { animation-delay: 0.15s; }
.library-loading-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes library-pulse {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .library-header {
    flex-direction: column;
    gap: 0.5rem;
  }

  .library-file-count {
    margin-top: 0;
  }

  .library-course-header {
    padding: 0.875rem 1rem;
  }

  .library-module-header {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .library-file {
    padding: 0.5rem 1rem;
  }

  .library-file-name {
    font-size: 0.75rem;
  }
}

/* Electron desktop: draggable title bar + traffic light padding */
body.electron .site-header {
  -webkit-app-region: drag;
  padding-top: 38px; /* space below macOS traffic lights */
}

/* Electron: drag bar for pages without .site-header (e.g. login) */
body.electron .electron-drag-bar {
  -webkit-app-region: drag;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  z-index: 100;
}

body.electron .site-header > div {
  padding-left: 80px; /* space for macOS traffic lights */
}

body.electron .site-header a,
body.electron .site-header button,
body.electron .site-header nav,
body.electron .site-header input,
body.electron .site-header .avatar-circle {
  -webkit-app-region: no-drag;
}

/* Sync button */
.sync-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #aaa;
  cursor: pointer;
  font-size: 0.75rem;
  font-family: var(--font-body);
  transition: color 0.2s ease;
  margin-right: 4px;
}

.sync-btn:hover {
  color: #888;
}

.sync-btn:disabled {
  cursor: default;
}

.sync-btn.syncing svg {
  animation: spin 0.8s linear infinite;
  color: #999;
}

.sync-btn.sync-done {
  color: #aaa;
}

.sync-btn.sync-error {
  color: var(--color-terracotta, #c45a3c);
}

.sync-label {
  font-variant-numeric: tabular-nums;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* --- Source Library --- */
.library-course-group {
  border: 1px solid var(--color-earth-200);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--color-linen);
}
.library-course-group summary {
  user-select: none;
}
.library-doc-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.library-doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--color-ink);
  font-size: 0.875rem;
  transition: background 0.1s;
}
.library-doc-row:hover {
  background: var(--color-earth-100);
}
.library-doc-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.library-status-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.library-file-edit {
  color: var(--color-ink-muted, #6b7280);
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.15s;
}
.library-file:hover .library-file-edit {
  opacity: 1;
}
.library-status-unreviewed { background: #e5e7eb; color: #374151; }
.library-status-extracted { background: #dbeafe; color: #1d4ed8; }
.library-status-edited { background: #fef3c7; color: #92400e; }
.library-status-imported { background: #d1fae5; color: #065f46; }
.library-status-skipped { background: #f3f4f6; color: #9ca3af; }

/* === Library Editor (led-*) === */

.led-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 4rem;
}

/* Toolbar */
.led-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid var(--color-earth-200);
  background: var(--color-earth-50);
  flex-wrap: wrap;
}
.led-toolbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.led-toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.led-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 6px;
  color: var(--color-ink-muted);
  transition: background 0.15s, color 0.15s;
  flex-shrink: 0;
}
.led-back:hover {
  background: var(--color-earth-200);
  color: var(--color-ink);
}
.led-title-group {
  min-width: 0;
}
.led-title {
  font-family: var(--font-display, Georgia, serif);
  font-size: 1rem;
  font-weight: 500;
  color: var(--color-ink);
  margin: 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.led-breadcrumb {
  font-size: 0.6875rem;
  color: var(--color-ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Status select */
.led-status-select {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background: #e5e7eb;
  color: #374151;
}
.led-status-unreviewed { background: #e5e7eb; color: #374151; }
.led-status-extracted { background: #dbeafe; color: #1d4ed8; }
.led-status-edited { background: #fef3c7; color: #92400e; }
.led-status-imported { background: #d1fae5; color: #065f46; }
.led-status-skipped { background: #f3f4f6; color: #9ca3af; }

/* Buttons */
.led-btn {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
}
.led-btn:disabled {
  opacity: 0.5;
  cursor: default;
}
.led-btn-ghost {
  background: transparent;
  color: var(--color-ink-muted);
  border: 1px solid var(--color-earth-300);
}
.led-btn-ghost:hover:not(:disabled) {
  background: var(--color-earth-100);
  color: var(--color-ink);
}
.led-btn-import {
  background: var(--color-teal-600);
  color: #fff;
}
.led-btn-import:hover:not(:disabled) {
  background: var(--color-teal-700);
}
.led-btn-save {
  background: var(--color-ink);
  color: var(--color-linen);
}
.led-btn-save:hover:not(:disabled) {
  background: var(--color-ink-light);
}

/* Save indicator */
.led-save-indicator {
  font-size: 0.6875rem;
  opacity: 0;
  transition: opacity 0.3s;
}
.led-save-ok {
  color: #065f46;
  opacity: 1;
}
.led-save-err {
  color: #991b1b;
  opacity: 1;
}

/* Workspace (split panes) */
.led-workspace {
  display: grid;
  grid-template-columns: 1fr 6px 1fr;
  height: calc(100vh - 3.25rem);
  height: calc(100dvh - 3.25rem);
  overflow: hidden;
}

/* Panes */
.led-pane {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.led-pane-pdf {
  background: #525659;
}
.led-pdf-frame {
  width: 100%;
  height: 100%;
  border: none;
}

/* Resize handle */
.led-resize-handle {
  background: var(--color-earth-200);
  cursor: col-resize;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.led-resize-handle:hover {
  background: var(--color-earth-300);
}
.led-resize-grip {
  width: 2px;
  height: 2rem;
  border-radius: 2px;
  background: var(--color-earth-400);
}

/* Editor pane */
.led-pane-editor {
  background: var(--color-earth-50);
  padding: 0;
}
.led-editor-header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-earth-200);
  flex-shrink: 0;
}
.led-editor-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-ink-muted);
}
.led-editor-hint {
  font-size: 0.625rem;
  color: var(--color-earth-400);
  font-family: "SF Mono", "Fira Code", monospace;
}

/* Textarea */
.led-textarea {
  width: 100%;
  flex: 1;
  min-height: 0;
  padding: 0.75rem;
  font-family: "SF Mono", "Fira Code", "Fira Mono", "Cascadia Code", monospace;
  font-size: 0.8125rem;
  line-height: 1.7;
  border: none;
  background: #fff;
  color: var(--color-ink);
  resize: none;
  tab-size: 4;
  outline: none;
}
.led-textarea::placeholder {
  color: var(--color-earth-300);
}
.led-textarea:focus {
  box-shadow: inset 0 0 0 2px var(--color-teal-200);
}
.led-textarea-notes {
  flex: none;
  height: 4rem;
  background: var(--color-earth-50);
  font-family: inherit;
  font-size: 0.8125rem;
  line-height: 1.5;
}

/* Collapsible sections in editor */
.led-notes-section {
  border-top: 1px solid var(--color-earth-200);
  flex-shrink: 0;
}
.led-notes-toggle {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-ink-muted);
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  user-select: none;
}
.led-notes-toggle:hover {
  color: var(--color-ink);
}

/* Extracted text preview */
.led-extracted-preview {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.75rem;
  line-height: 1.5;
  padding: 0.75rem;
  background: var(--color-earth-50);
  max-height: 12rem;
  overflow-y: auto;
  white-space: pre-wrap;
  color: var(--color-ink-muted);
  margin: 0;
}

/* Import results */
.led-import-progress {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: var(--color-ink-muted);
}
.led-import-result {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  border-top: 1px solid var(--color-earth-200);
}
.led-import-ok {
  color: #065f46;
  background: #ecfdf5;
}
.led-import-err {
  color: #991b1b;
  background: #fef2f2;
}

/* Conflict resolution */
.led-conflicts {
  border-top: 1px solid var(--color-earth-200);
  background: #fffbeb;
  display: flex;
  flex-direction: column;
  max-height: 60vh;
}
.led-conflicts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-earth-200);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: #fffbeb;
  z-index: 1;
}
.led-conflicts-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: #92400e;
}
.led-conflicts-list {
  overflow-y: auto;
  flex: 1;
}
.led-conflict {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-earth-200);
}
.led-conflict:last-of-type {
  border-bottom: none;
}
.led-conflict-word {
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--color-ink);
  margin-bottom: 0.25rem;
}
.led-conflict-type {
  font-weight: 400;
  color: var(--color-ink-muted);
  font-size: 0.75rem;
}
.led-conflict-row {
  padding: 0.125rem 0;
}
.led-conflict-option {
  display: flex;
  align-items: baseline;
  gap: 0.375rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.led-conflict-option input[type="radio"] {
  margin: 0;
  flex-shrink: 0;
}
.led-conflict-label {
  font-weight: 600;
  color: var(--color-ink-muted);
  min-width: 3.5rem;
  text-transform: uppercase;
  font-size: 0.625rem;
  letter-spacing: 0.04em;
}
.led-conflict-value {
  color: var(--color-ink);
  flex: 1;
}
.led-conflict-source {
  color: var(--color-ink-muted);
  font-size: 0.625rem;
  margin-left: 0.5rem;
}

/* Mobile: stack vertically */
@media (max-width: 768px) {
  .led-workspace {
    grid-template-columns: 1fr;
    grid-template-rows: 40vh 0 1fr;
    height: calc(100vh - 3.25rem);
    height: calc(100dvh - 3.25rem);
  }
  .led-resize-handle {
    display: none;
  }
  .led-toolbar {
    padding: 0.375rem 0.5rem;
  }
  .led-title {
    font-size: 0.875rem;
  }
}
