/* The Amos Project — surface-specific styles atop TAN tokens */

html, body { margin:0; padding:0; height:100%; background: var(--color-bg-app); font-family: var(--font-sans); color: var(--color-fg); }
*, *::before, *::after { box-sizing: border-box; }

/* Linguist-review trust note — sits between the heat map and the toolbar.
   Subtle warm tint so it reads as informational, not as a card. */
.amos-review-note {
  margin: 14px 0 18px;
  padding: 10px 18px;
  background: rgba(216,163,64,.08);
  border-left: 3px solid rgba(216,163,64,.55);
  border-radius: 4px;
}

.app { display:flex; min-height: 100vh; }

/* ── Sidebar tweaks (slightly different for Amos Project) ───────── */
.amos-sidebar { width: 260px; background:#fff; border-right:1px solid rgba(6,31,39,.08); display:flex; flex-direction:column; padding: 18px 0 0; flex:none; position: sticky; top:0; height: 100vh; }
.amos-brand { display:flex; align-items:center; gap:10px; padding: 4px 20px 18px; }
.amos-brand-mark { width: 28px; height: 28px; border-radius: 6px; background: var(--tan-ink); color: var(--tan-cyan); font: 800 12px 'Inter'; display:grid; place-items:center; letter-spacing:-.03em; }
.amos-brand-word { font: 700 18px 'Inter'; letter-spacing:-.02em; color: var(--tan-ink); line-height:1.1; }
.amos-brand-word small { display:block; font: 500 8.4px 'Figtree'; letter-spacing:.14em; text-transform:uppercase; color: rgba(6,31,39,.55); margin-top:3px; }

.amos-search { margin: 4px 14px 10px; }
.amos-search .input { padding: 7px 10px; font-size: 13px; border-color: rgba(6,31,39,.12); background: rgba(6,31,39,.03); }
.amos-search .input:focus-within { background:#fff; border-color: var(--tan-cyan); }
.amos-search kbd { font-family: ui-monospace, 'SF Mono', Menlo; font-size: 10.5px; color: rgba(6,31,39,.5); border:1px solid rgba(6,31,39,.12); border-radius:3px; padding: 1px 5px; background:#fff; }

.amos-sec { padding: 14px 20px 4px; font: 600 10.5px 'Figtree'; letter-spacing:.1em; text-transform:uppercase; color: rgba(6,31,39,.42); }
.amos-item { display:flex; align-items:center; gap: 10px; padding: 6px 20px; color: rgba(6,31,39,.75); font: 500 13px 'Roboto'; cursor: pointer; border-left: 2px solid transparent; /* button reset (audit rank 3 — these are now real <button>s) */ width:100%; text-align:left; background:transparent; border-top:0; border-right:0; border-bottom:0; appearance:none; -webkit-appearance:none; }
.amos-item:focus-visible { outline: 2px solid var(--tan-cyan-700, #145F6B); outline-offset: -2px; border-radius: 4px; }
/* "Soon" tools — honestly disabled, not silent dead-ends (audit rank 6) */
.amos-item.soon { opacity: .5; cursor: default; }
.amos-item.soon:hover { background: transparent; color: rgba(6,31,39,.75); }
.amos-soon { margin-left: auto; font: 600 8.5px 'Figtree'; letter-spacing: .1em; text-transform: uppercase;
  color: var(--tan-fg-3); background: rgba(6,31,39,.06); padding: 2px 6px; border-radius: 999px; }
.amos-search .input { cursor: pointer; }
.amos-search .input input { cursor: pointer; }
.amos-item:hover { background: rgba(6,31,39,.04); color: var(--tan-ink); }
.amos-item.active { color: var(--tan-ink); background: rgba(61,202,220,.09); border-left-color: var(--tan-cyan); font-weight: 600; }
.amos-item .count { margin-left:auto; font-size: 11.5px; color: rgba(6,31,39,.5); font-variant-numeric: tabular-nums; }
.amos-item svg { flex:none; color: rgba(6,31,39,.55); }
.amos-item.active svg { color: var(--tan-cyan-600); }

.amos-tree { padding-left: 18px; }
.amos-tree .amos-item { padding-left: 34px; font-size: 12.5px; color: rgba(6,31,39,.7); }

.amos-user { margin-top:auto; padding: 14px 20px; border-top: 1px solid rgba(6,31,39,.08); display:flex; gap:10px; align-items:center; }
.amos-user .avatar { width: 30px; height: 30px; background: var(--tan-cyan); color: var(--tan-ink); font-size: 11px; }
.amos-user .name { font: 600 13px 'Roboto'; color: var(--tan-ink); }
.amos-user .role { font: 400 11px 'Roboto'; color: rgba(6,31,39,.55); }

/* ── Content region ─────────────────────────────────────── */
.amos-main { flex:1; display:flex; flex-direction:column; min-width: 0; }

.amos-topbar { display:flex; align-items:center; gap:14px; padding: 14px 40px; background:#fff; border-bottom: 1px solid rgba(6,31,39,.08); position: sticky; top: 0; z-index: 10; }
.amos-crumbs { display:flex; align-items:center; gap:8px; font-size: 12.5px; color: rgba(6,31,39,.55); font-family: 'Roboto'; }
.amos-crumbs .sep { color: rgba(6,31,39,.3); }
.amos-crumbs .here { color: var(--tan-ink); font-weight: 600; }
.amos-topbar-right { margin-left:auto; display:flex; align-items:center; gap:10px; }
.amos-icon-btn { width: 34px; height: 34px; border-radius: 6px; border: 1px solid transparent; background: transparent; color: rgba(6,31,39,.7); display: grid; place-items: center; cursor: pointer; }
.amos-icon-btn:hover { background: rgba(6,31,39,.05); color: var(--tan-ink); }

/* ── Hero ───────────────────────────────────────────────── */
.amos-hero { padding: 28px 40px 20px; background: #fff; border-bottom: 1px solid rgba(6,31,39,.08); }
.amos-hero-top { display:flex; align-items:flex-end; gap: 32px; }
.amos-hero h1 { font: 500 30px 'Roboto'; letter-spacing: -0.015em; line-height: 1.1; }
.amos-hero h1 em { font-style: normal; color: var(--tan-cyan-600); }
.amos-hero .sub { font: 400 14px 'Roboto'; color: rgba(6,31,39,.6); margin-top: 6px; max-width: 640px; line-height: 1.5; }

.amos-hero-stats { margin-left:auto; display:flex; gap: 0; border: 1px solid rgba(6,31,39,.08); border-radius: 8px; overflow:hidden; background: rgba(6,31,39,.02); }
.amos-hero-stat { padding: 10px 18px; border-right: 1px solid rgba(6,31,39,.08); min-width: 110px; }
.amos-hero-stat:last-child { border-right:0; }
.amos-hero-stat .n { font: 500 20px 'Roboto'; color: var(--tan-ink); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.amos-hero-stat .l { font: 600 10px 'Figtree'; letter-spacing: .12em; color: rgba(6,31,39,.5); text-transform: uppercase; margin-top: 2px; }

/* ── Filter/toolbar row ─────────────────────────────────── */
.amos-toolbar { display:flex; align-items:center; gap: 8px; padding: 14px 40px; background: #fff; border-bottom: 1px solid rgba(6,31,39,.08); flex-wrap: wrap; }
.amos-chip { display:inline-flex; align-items:center; gap: 6px; padding: 6px 12px; background:#fff; border:1px solid rgba(6,31,39,.14); border-radius: 999px; font: 500 12.5px 'Roboto'; color: rgba(6,31,39,.78); cursor:pointer; line-height:1; }
.amos-chip:hover { background: rgba(6,31,39,.04); }
.amos-chip.on { background: var(--tan-ink); color:#fff; border-color: var(--tan-ink); }
.amos-chip.on svg { color:#fff; }
.amos-chip .close { opacity:.6; }
.amos-chip svg { color: rgba(6,31,39,.5); }

.amos-divider-v { width:1px; height: 22px; background: rgba(6,31,39,.1); margin: 0 4px; }

.amos-view-switch { display:flex; border: 1px solid rgba(6,31,39,.14); border-radius: 6px; overflow:hidden; margin-left:auto; }
.amos-view-switch button { border:0; background:#fff; color: rgba(6,31,39,.6); padding: 6px 10px; cursor:pointer; display:grid; place-items:center; }
.amos-view-switch button.on { background: var(--tan-ink); color:#fff; }

.amos-sort { display:inline-flex; align-items:center; gap:6px; font: 500 12.5px 'Roboto'; color: rgba(6,31,39,.7); padding: 6px 10px; border: 1px solid rgba(6,31,39,.14); border-radius: 6px; background:#fff; cursor: pointer; }
.amos-sort:hover { background: rgba(6,31,39,.04); }

/* ── Tradition rails (horizontal browse) ────────────────── */
.amos-rail { padding: 24px 0 20px; }
.amos-rail-head { display:flex; align-items:baseline; gap:14px; padding: 0 40px 12px; }
.amos-rail-tag { font: 600 10.5px 'Figtree'; letter-spacing: .16em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; line-height:1.3; }
.amos-rail-title { font: 500 18px 'Roboto'; letter-spacing: -.01em; }
.amos-rail-sub { font: 400 13px 'Roboto'; color: rgba(6,31,39,.55); margin-left: 4px; }
.amos-rail-more { margin-left:auto; font: 600 12.5px 'Roboto'; color: var(--tan-cyan-600); cursor: pointer; display:inline-flex; align-items:center; gap:4px; padding: 4px 10px; border-radius:6px; }
.amos-rail-more:hover { background: rgba(61,202,220,.08); }

.amos-rail-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: 296px; gap: 14px; padding: 2px 40px 18px; overflow-x: auto; scroll-padding: 40px; scroll-snap-type: x proximity; }
.amos-rail-scroll::-webkit-scrollbar { height: 8px; }
.amos-rail-scroll::-webkit-scrollbar-thumb { background: rgba(6,31,39,.15); border-radius: 4px; }
.amos-rail-scroll::-webkit-scrollbar-track { background: transparent; }

/* ── Doc card ──────────────────────────────────────────── */
.amos-doc { background:#fff; border:1px solid rgba(6,31,39,.1); border-radius: 8px; overflow: hidden; cursor: pointer; transition: border-color var(--dur-fast), box-shadow var(--dur-fast), transform var(--dur-fast); display:flex; flex-direction: column; scroll-snap-align: start; }
.amos-doc:hover { border-color: rgba(6,31,39,.22); box-shadow: 0 6px 16px rgba(6,31,39,.08); transform: translateY(-1px); }

.amos-doc-cover { aspect-ratio: 16 / 10; position: relative; overflow: hidden; border-bottom: 1px solid rgba(6,31,39,.08); }
.amos-doc-cover .tradition-bar { position:absolute; top:0; left:0; right:0; height: 4px; background: currentColor; }
.amos-doc-cover .lang-flag { position:absolute; top:10px; right:10px; font: 600 10px 'Figtree'; letter-spacing:.1em; text-transform: uppercase; background: rgba(255,255,255,.94); color: rgba(6,31,39,.8); padding: 3px 7px; border-radius: 3px; display:inline-flex; align-items:center; gap:5px; }
.amos-doc-cover .lang-flag .dot { width:6px; height:6px; border-radius: 50%; background: currentColor; }
.amos-doc-cover .era { position:absolute; bottom: 12px; left: 14px; font: 600 10.5px 'Figtree'; letter-spacing:.16em; color: rgba(255,255,255,.9); text-transform: uppercase; }

.amos-doc-title { padding: 12px 14px 6px; font: 500 15px 'Roboto'; letter-spacing:-.005em; color: var(--tan-ink); line-height: 1.3; }
.amos-doc-by { padding: 0 14px; font: 400 12.5px 'Roboto'; color: rgba(6,31,39,.6); font-style: italic; }
.amos-doc-meta { padding: 10px 14px 12px; display:flex; align-items:center; gap: 8px; font: 400 11.5px 'Roboto'; color: rgba(6,31,39,.55); margin-top:auto; }
.amos-doc-meta .sep { color: rgba(6,31,39,.25); }
.amos-doc-meta .langs { margin-left:auto; display:flex; gap: 3px; }
.amos-doc-meta .lang-pip { font: 600 9.5px 'Figtree'; letter-spacing:.1em; color: rgba(6,31,39,.65); border:1px solid rgba(6,31,39,.14); padding: 2px 5px; border-radius: 3px; line-height:1; text-transform: uppercase; }

/* Cover art treatments per tradition */
.cov-patristic { background: linear-gradient(135deg, #7a1e16 0%, #b8443a 55%, #e8dcc4 160%); color: #b8443a; }
.cov-parabiblical { background: linear-gradient(135deg, #4a2e70 0%, #8b6d9e 55%, #e4dbff 160%); color: #8b6d9e; }
.cov-hebrew { background: linear-gradient(135deg, #1d3d1c 0%, #7a9579 55%, #d8e4d4 160%); color: #7a9579; }
.cov-greek  { background: linear-gradient(135deg, #1a3560 0%, #5b7aa8 55%, #dbe4f4 160%); color: #5b7aa8; }
.cov-latin  { background: linear-gradient(135deg, #6a4600 0%, #d4a24c 55%, #f6e8c6 160%); color: #d4a24c; }
.cov-qumran { background: linear-gradient(135deg, #2c2a24 0%, #6b6456 55%, #e8dcc4 160%); color: #b4a689; }
.cov-vernacular { background: linear-gradient(135deg, #0b3a42 0%, #26828F 55%, #e0f4f7 160%); color: #26828F; }

/* Cover decorative watermark — big initial letter */
.cov-glyph { position:absolute; inset:0; display:grid; place-items:center; font: 300 96px 'Roboto Slab', 'Roboto', serif; color: rgba(255,255,255,.14); letter-spacing:-.03em; user-select:none; pointer-events:none; }
.cov-glyph.greek { font-family: 'Roboto', serif; font-weight: 300; }
.cov-folio { position:absolute; inset: 12px; border: 1px dashed rgba(255,255,255,.18); border-radius: 4px; pointer-events:none; }

/* ── List view ─────────────────────────────────────────── */
.amos-list { margin: 0 40px 28px; background:#fff; border: 1px solid rgba(6,31,39,.1); border-radius: 8px; overflow:hidden; }
.amos-list-head, .amos-list-row { display:grid; grid-template-columns: 42px minmax(0,2.6fr) minmax(0,1.4fr) 90px 120px 110px 80px; align-items: center; gap: 14px; padding: 11px 18px; font-size: 13px; }
.amos-list-head { background: rgba(6,31,39,.02); border-bottom: 1px solid rgba(6,31,39,.08); font: 600 11px 'Figtree'; letter-spacing:.08em; text-transform: uppercase; color: rgba(6,31,39,.5); }
.amos-list-row { border-top: 1px solid rgba(6,31,39,.06); cursor: pointer; }
.amos-list-row:first-of-type { border-top: 0; }
.amos-list-row:hover { background: rgba(61,202,220,.05); }
.amos-list-row .spine { width: 26px; height: 32px; border-radius: 2px; display: grid; place-items: center; font: 700 10px 'Figtree'; color: #fff; letter-spacing:.04em; }
.amos-list-row .title { font: 500 14px 'Roboto'; color: var(--tan-ink); }
.amos-list-row .by { font: 400 12px 'Roboto'; color: rgba(6,31,39,.55); font-style: italic; margin-top: 2px; }
.amos-list-row .lang-pip { font: 600 9.5px 'Figtree'; letter-spacing:.1em; color: rgba(6,31,39,.65); border:1px solid rgba(6,31,39,.14); padding: 2px 5px; border-radius: 3px; line-height:1; text-transform: uppercase; display:inline-block; margin-right: 3px; }
.amos-list-row .muted { color: rgba(6,31,39,.6); font-variant-numeric: tabular-nums; }
.amos-list-row .tag-tier { font: 600 10px 'Figtree'; letter-spacing:.08em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; }

/* Tradition color indexing */
.trad-patristic { color: #b8443a; }
.trad-patristic-bg { background: rgba(184,68,58,.12); color: #8b2a22; }
.trad-parabiblical { color: #8b6d9e; }
.trad-parabiblical-bg { background: rgba(139,109,158,.14); color: #5e4772; }
.trad-hebrew { color: #3d5a3c; }
.trad-hebrew-bg { background: rgba(122,149,121,.16); color: #3d5a3c; }
.trad-greek { color: #5b7aa8; }
.trad-greek-bg { background: rgba(91,122,168,.14); color: #3d537a; }
.trad-latin { color: #b8862e; }
.trad-latin-bg { background: rgba(212,162,76,.18); color: #7a5a18; }
.trad-qumran { color: #8a7b58; }
.trad-qumran-bg { background: rgba(138,123,88,.14); color: #5a4f38; }
.trad-vernacular { color: #26828F; }
.trad-vernacular-bg { background: rgba(38,130,143,.12); color: #0b5a63; }

/* ── Featured collection — "One Study Worked Through" ─── */
.amos-featured { margin: 8px 40px 0; background: linear-gradient(180deg, #fff 0%, #f7fbfc 100%); border: 1px solid rgba(6,31,39,.1); border-radius: 10px; padding: 22px 26px; display:grid; grid-template-columns: 1.2fr 1fr; gap: 32px; }
.amos-featured .eyebrow { font: 600 10.5px 'Figtree'; letter-spacing: .18em; text-transform: uppercase; color: var(--tan-cyan-600); }
.amos-featured h3 { font: 500 22px 'Roboto'; letter-spacing:-.01em; margin: 8px 0 6px; line-height:1.2; }
.amos-featured h3 em { font-style: normal; color: var(--tan-cyan-600); }
.amos-featured p { font: 400 13.5px 'Roboto'; color: rgba(6,31,39,.65); line-height: 1.55; max-width: 520px; }
.amos-featured .cta { margin-top: 14px; display:inline-flex; gap: 8px; }

.amos-featured-passage { background:#fff; border: 1px solid rgba(6,31,39,.1); border-radius: 8px; padding: 16px 18px; font-family: 'Roboto Slab', 'Roboto', serif; }
.amos-featured-passage .ref { font: 600 11px 'Figtree'; letter-spacing: .14em; text-transform: uppercase; color: rgba(6,31,39,.55); }
.amos-featured-passage .greek { margin-top: 10px; font: 400 14.5px 'Roboto'; color: rgba(6,31,39,.85); line-height: 1.65; font-style: italic; }
.amos-featured-passage .en { margin-top: 10px; font: 400 13.5px 'Roboto'; color: rgba(6,31,39,.65); line-height: 1.65; }
.amos-featured-passage .chip-row { margin-top: 14px; display:flex; flex-wrap:wrap; gap: 6px; }
.amos-featured-passage .chip-row span { font: 500 11px 'Figtree'; letter-spacing:.08em; text-transform: uppercase; background: rgba(6,31,39,.05); border: 1px solid rgba(6,31,39,.08); color: rgba(6,31,39,.7); padding: 3px 8px; border-radius: 3px; }

/* ── Grid view ────────────────────────────────────────── */
.amos-grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(246px, 1fr)); gap: 16px; padding: 20px 40px 40px; }

/* ── Drawer (right-side tool/reader drawer) ──────────── */
.amos-drawer-backdrop { position: fixed; inset: 0; background: rgba(6,31,39,.25); opacity: 0; pointer-events: none; transition: opacity 240ms var(--ease-std); z-index: 120; }
.amos-drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.amos-drawer {
  position: fixed; top: 0; right: -1400px; height: 100vh;
  /* Responsive scaling: 880px floor (never cramped), scales with viewport at
     ~62%, caps at 1280px on very wide displays. max-width: 92vw leaves a thin
     sliver of the parent visible behind the drawer on any screen. */
  width: clamp(880px, 62vw, 1280px);
  max-width: 92vw;
  background:#fff; border-left: 1px solid rgba(6,31,39,.1);
  box-shadow: -18px 0 44px rgba(6,31,39,.14);
  z-index: 121; display:flex; flex-direction: column;
  transition: right 280ms var(--ease-std);
}
.amos-drawer.open.open.open { right: 0 !important; }
/* Mobile: the 880px floor + max-width:92vw still left the drawer overflowing
   and cramped on phones. Make it truly full-width here so it doesn't depend on
   the (previously dead) mobile-overrides layer. — audit rank 2 */
@media (max-width: 820px) {
  .amos-drawer { width: 100vw; max-width: 100vw; }
  .amos-drawer-body { padding: 18px 16px; }
  .amos-drawer-head { padding: 14px 16px; }
}
.amos-drawer-head { padding: 16px 24px; border-bottom: 1px solid rgba(6,31,39,.08); display:flex; align-items:center; gap: 14px; background:#fff; }
.amos-drawer-eyebrow { font: 600 10.5px 'Figtree'; letter-spacing:.14em; text-transform: uppercase; color: rgba(6,31,39,.5); }
.amos-drawer-title { font: 500 18px 'Roboto'; letter-spacing:-.005em; color: var(--tan-ink); line-height: 1.25; }
.amos-drawer-title em { font-style: italic; color: rgba(6,31,39,.55); font-weight: 400; }
.amos-drawer-actions { margin-left:auto; display:flex; gap: 6px; align-items:center; }

.amos-drawer-modes { display:flex; gap: 0; padding: 0 24px; border-bottom: 1px solid rgba(6,31,39,.08); background: #fafbfb; }
.amos-drawer-mode { font: 500 12.5px 'Roboto'; color: rgba(6,31,39,.6); padding: 10px 12px; border-bottom: 2px solid transparent; cursor:pointer; }
.amos-drawer-mode:hover { color: var(--tan-ink); }
.amos-drawer-mode.on { color: var(--tan-ink); border-bottom-color: var(--tan-cyan); font-weight: 600; }

.amos-drawer-body { flex:1; overflow:auto; padding: 22px 30px; }

/* Reader */
.reader-ref { font: 600 10.5px 'Figtree'; letter-spacing:.16em; text-transform: uppercase; color: rgba(6,31,39,.5); margin-bottom: 6px; }
.reader-view-sw { display:flex; gap: 4px; background: rgba(6,31,39,.05); border-radius: 8px; padding: 3px; margin-bottom: 16px; width: fit-content; }
.reader-view-sw button { font: 500 12.5px 'Roboto'; color: rgba(6,31,39,.7); background: transparent; border:0; padding: 6px 12px; border-radius: 5px; cursor: pointer; display:inline-flex; gap:6px; align-items:center; }
.reader-view-sw button.on { background:#fff; color: var(--tan-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(6,31,39,.06); }

.reader-passage { font-family: 'Roboto Slab', 'Roboto', Georgia, serif; font-size: 17px; line-height: 1.7; color: var(--tan-ink); }
.reader-passage .v-num { display:inline-block; vertical-align: baseline; font: 600 10px 'Figtree'; letter-spacing: .06em; color: var(--tan-cyan-600); background: rgba(61,202,220,.1); padding: 2px 5px; border-radius: 3px; margin-right: 6px; line-height: 1; position: relative; top: -2px; }
.reader-passage .verse { display:block; padding: 6px 0; border-left: 2px solid transparent; padding-left: 10px; margin-left: -10px; cursor: pointer; border-radius: 3px; transition: background var(--dur-fast), border-color var(--dur-fast); }
.reader-passage .verse:hover { background: rgba(61,202,220,.06); border-left-color: rgba(61,202,220,.4); }
.reader-passage .verse.selected { background: rgba(61,202,220,.09); border-left-color: var(--tan-cyan); }
.reader-passage .w { cursor: pointer; border-bottom: 1px dotted transparent; transition: border-color var(--dur-fast), background var(--dur-fast); padding: 0 1px; }
.reader-passage .w:hover { border-bottom-color: var(--tan-cyan); background: rgba(61,202,220,.09); }
.reader-passage .w.hot { color: var(--tan-cyan-600); font-weight: 500; border-bottom: 1px dotted var(--tan-cyan-600); }

.reader-parallel { display:grid; grid-template-columns: 1fr 1fr; gap: 1px; background: rgba(6,31,39,.08); border:1px solid rgba(6,31,39,.08); border-radius: 8px; overflow:hidden; }
.reader-parallel > div { background:#fff; padding: 16px 18px; }
.reader-parallel h5 { font: 600 10.5px 'Figtree'; letter-spacing:.14em; text-transform: uppercase; color: rgba(6,31,39,.5); margin: 0 0 10px; }

.reader-interlinear { display:grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 4px 14px; background:#fff; }
.reader-interlinear .ili { display:flex; flex-direction: column; gap: 1px; padding: 3px 4px; border-bottom: 1px solid rgba(6,31,39,.06); cursor: pointer; }
.reader-interlinear .ili:hover { background: rgba(61,202,220,.05); }
.reader-interlinear .gk { font: 500 16px 'Roboto Slab', Georgia, serif; color: var(--tan-ink); }
.reader-interlinear .morph { font: 600 9.5px 'Figtree'; letter-spacing:.08em; text-transform: uppercase; color: var(--tan-violet-deep); }
.reader-interlinear .gloss { font: 400 12.5px 'Roboto'; color: rgba(6,31,39,.7); font-style: italic; }

/* Word popover */
.word-pop { position: absolute; z-index: 50; background:#fff; border: 1px solid rgba(6,31,39,.14); border-radius: 10px; box-shadow: 0 12px 32px rgba(6,31,39,.16); padding: 16px 18px; width: 340px; font-family: 'Roboto'; }
.word-pop .wp-head { display:flex; align-items:baseline; gap: 10px; margin-bottom: 10px; }
.word-pop .wp-greek { font: 500 24px 'Roboto Slab', Georgia, serif; color: var(--tan-ink); }
.word-pop .wp-lemma { font: 400 12.5px 'Roboto'; color: rgba(6,31,39,.55); }
.word-pop .wp-morph-row { display:flex; flex-wrap:wrap; gap: 6px; margin-bottom: 12px; }
.word-pop .wp-morph-row span { font: 600 10px 'Figtree'; letter-spacing:.08em; text-transform: uppercase; color: var(--tan-violet-deep); background: rgba(142,104,255,.1); padding: 3px 7px; border-radius: 3px; }
.word-pop .wp-gloss { font: 500 14px 'Roboto'; color: var(--tan-ink); margin-bottom: 8px; }
.word-pop .wp-note { font: 400 12.5px 'Roboto'; color: rgba(6,31,39,.65); line-height: 1.55; padding-top: 10px; border-top: 1px solid rgba(6,31,39,.08); }
.word-pop .wp-foot { margin-top: 12px; display:flex; gap: 6px; }

/* Tools drawer secondary pane */
.tools-section { padding: 14px 0; border-top: 1px solid rgba(6,31,39,.08); }
.tools-section:first-child { border-top: 0; padding-top: 0; }
.tools-section h5 { font: 600 10.5px 'Figtree'; letter-spacing:.14em; text-transform: uppercase; color: rgba(6,31,39,.5); margin: 0 0 10px; display:flex; align-items:center; gap: 8px; }
.tools-section h5 .count { font-weight: 500; color: rgba(6,31,39,.4); }
.citation { padding: 12px 14px; background: rgba(6,31,39,.02); border: 1px solid rgba(6,31,39,.07); border-radius: 7px; margin-bottom: 8px; }
.citation .by { font: 500 13px 'Roboto'; color: var(--tan-ink); display:flex; align-items:baseline; gap: 8px; }
.citation .by .date { font: 400 11.5px 'Roboto'; color: rgba(6,31,39,.5); }
.citation .ref { font: 500 11.5px 'Roboto'; color: var(--tan-cyan-600); margin-top: 2px; }
.citation .quote { font-family: 'Roboto Slab', 'Roboto', Georgia, serif; font-size: 13px; color: rgba(6,31,39,.8); line-height: 1.55; margin-top: 8px; font-style: italic; border-left: 2px solid rgba(184,68,58,.4); padding-left: 12px; }

.variant-row { display:grid; grid-template-columns: 70px 1fr auto; gap: 12px; padding: 10px 0; border-top: 1px dotted rgba(6,31,39,.1); align-items: baseline; }
.variant-row:first-child { border-top: 0; }
.variant-row .witness { font: 600 11px 'Figtree'; letter-spacing:.1em; text-transform: uppercase; color: rgba(6,31,39,.65); }
.variant-row .text { font-family: 'Roboto Slab', 'Roboto', Georgia, serif; font-size: 14px; color: var(--tan-ink); line-height: 1.55; }
.variant-row .note { font: 400 11px 'Roboto'; color: rgba(6,31,39,.55); font-style: italic; }

.apparatus-box { background: #fff; border: 1px solid rgba(6,31,39,.1); border-radius: 8px; padding: 14px 16px; }
.apparatus-layer { padding: 10px 0; border-top: 1px solid rgba(6,31,39,.06); }
.apparatus-layer:first-of-type { border-top:0; padding-top: 0; }
.apparatus-layer h6 { font: 600 10.5px 'Figtree'; letter-spacing:.14em; text-transform: uppercase; color: rgba(6,31,39,.5); margin: 0 0 6px; }
.apparatus-layer p { font: 400 13px 'Roboto'; color: rgba(6,31,39,.75); line-height: 1.6; margin: 0; }

/* ── Authors view ─────────────────────────────────── */
.amos-authors { padding: 24px 40px 40px; display:flex; flex-direction: column; gap: 0; }
.author-card { display:grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 32px 0; border-bottom: 1px solid rgba(6,31,39,.08); }
.author-card:last-child { border-bottom: 0; }
.ac-supra { display:flex; align-items:center; gap: 10px; font: 600 10.5px 'Figtree'; letter-spacing:.18em; text-transform: uppercase; color: var(--tan-cyan-600); margin-bottom: 10px; }
.ac-roman { font-family: 'Roboto Slab', serif; font-weight: 400; font-size: 12px; color: rgba(6,31,39,.35); }
.ac-name { font-family: 'Roboto Slab', 'Roboto', Georgia, serif; font-weight: 400; font-size: 34px; letter-spacing:-.018em; line-height: 1; color: var(--tan-ink); margin: 0 0 4px; }
.ac-name em { font-style: italic; }
.ac-lived { font: 400 13px 'Roboto'; font-style: italic; color: rgba(6,31,39,.55); margin-bottom: 14px; }
.ac-bio { font: 400 14px/1.6 'Roboto'; color: rgba(6,31,39,.76); max-width: 520px; margin-bottom: 18px; }
.ac-bio strong { color: var(--tan-ink); font-weight: 600; }
.ac-bio em { color: var(--tan-ink); font-style: italic; }
.ac-stats { display:grid; grid-template-columns: repeat(4, auto); gap: 22px; padding: 14px 0; border-top: 1px solid rgba(6,31,39,.08); border-bottom: 1px solid rgba(6,31,39,.08); margin-bottom: 14px; }
.ac-stat .n { font-family: 'Roboto Slab', serif; font-weight: 400; font-size: 20px; color: var(--tan-ink); letter-spacing:-.01em; line-height: 1; }
.ac-stat .l { font: 600 9.5px 'Figtree'; letter-spacing:.14em; text-transform: uppercase; color: rgba(6,31,39,.5); margin-top: 5px; }
.ac-topics { display:flex; flex-wrap: wrap; gap: 5px; }
.ac-topic { font: 500 11.5px 'Roboto'; color: rgba(6,31,39,.7); background:#fff; border: 1px solid rgba(6,31,39,.12); padding: 3px 9px; border-radius: 999px; cursor: pointer; }
.ac-topic:hover { background: rgba(61,202,220,.08); border-color: rgba(61,202,220,.4); color: var(--tan-cyan-600); }

.ac-works-head { display:flex; justify-content: space-between; align-items: baseline; font: 600 10.5px 'Figtree'; letter-spacing:.18em; text-transform: uppercase; color: rgba(6,31,39,.5); padding-bottom: 10px; border-bottom: 1px solid rgba(6,31,39,.08); margin-bottom: 4px; }
.ac-works-head .r { font-weight: 500; color: rgba(6,31,39,.4); letter-spacing:.08em; }
.ac-work { display:grid; grid-template-columns: 44px 1fr auto; gap: 14px; padding: 12px 0; border-top: 1px solid rgba(6,31,39,.06); align-items: baseline; cursor: pointer; }
.ac-work:first-of-type { border-top: 0; }
.ac-work:hover { background: linear-gradient(90deg, rgba(61,202,220,.05), transparent 80%); }
.ac-spine { height: 54px; border-radius: 2px; display:grid; place-items:center; color:#fff; }
.ac-spine .g { font: 300 22px 'Roboto Slab', serif; letter-spacing:-.02em; color: rgba(255,255,255,.85); }
.ac-work .t { font-family: 'Roboto Slab', serif; font-weight: 400; font-size: 16px; color: var(--tan-ink); letter-spacing:-.005em; line-height: 1.2; margin-bottom: 2px; }
.ac-work .t em { font-style: italic; }
.ac-work .s { font: 400 12px 'Roboto'; color: rgba(6,31,39,.55); font-style: italic; }
.ac-wmeta { text-align: right; font: 400 11px 'Roboto'; color: rgba(6,31,39,.55); font-variant-numeric: tabular-nums; }
.ac-wmeta .langs { margin-top: 4px; display:flex; gap: 3px; justify-content: flex-end; }
.ac-wmeta .lp { font: 600 9px 'Figtree'; letter-spacing:.08em; text-transform: uppercase; color: rgba(6,31,39,.62); border:1px solid rgba(6,31,39,.14); padding: 2px 4px; border-radius: 2px; line-height:1; }

/* ── Translation Modes explainer band ───────────────── */
.amos-modes-band { margin: 28px 40px 0; padding: 22px 24px 24px; background: linear-gradient(180deg, #fafdfd 0%, #f3f9fa 100%); border: 1px solid rgba(6,31,39,.1); border-radius: 10px; }
.wmb-head { display:flex; justify-content: space-between; align-items: flex-end; margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid rgba(6,31,39,.08); }
.wmb-kicker { font: 600 10.5px 'Figtree'; letter-spacing:.2em; text-transform: uppercase; color: var(--tan-cyan-600); margin-bottom: 4px; }
.wmb-title { font-family: 'Roboto Slab', serif; font-weight: 400; font-size: 24px; letter-spacing:-.01em; color: var(--tan-ink); }
.wmb-title em { font-style: italic; color: var(--tan-cyan-600); }
.wmb-more { font: 600 12px 'Roboto'; color: var(--tan-cyan-600); cursor: pointer; display:inline-flex; align-items:center; gap: 4px; border: 1px solid rgba(61,202,220,.5); padding: 7px 12px; border-radius: 999px; }
.wmb-more:hover { background: rgba(61,202,220,.08); }
.wmb-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.wmb-card { background:#fff; border: 1px solid rgba(6,31,39,.08); border-radius: 8px; padding: 14px 16px 16px; cursor: pointer; transition: border-color var(--dur-fast), transform var(--dur-fast); }
.wmb-card:hover { border-color: rgba(6,31,39,.22); transform: translateY(-1px); }
.wmb-letter { font-family: 'Roboto Slab', serif; font-weight: 200; font-size: 44px; line-height: .9; letter-spacing:-.04em; color: var(--tan-cyan-600); margin-bottom: 6px; }
.wmb-k { font: 600 10px 'Figtree'; letter-spacing:.18em; text-transform: uppercase; color: rgba(6,31,39,.5); margin-bottom: 4px; }
.wmb-n { font-family: 'Roboto Slab', serif; font-weight: 400; font-size: 16px; color: var(--tan-ink); letter-spacing:-.005em; margin-bottom: 6px; }
.wmb-d { font: 400 12.5px/1.55 'Roboto'; color: rgba(6,31,39,.65); }

/* ── Upgraded featured passage (v2 pull-quote treatment) ── */
.amos-featured-passage-v2 { border-top: 1px solid rgba(6,31,39,.14); margin-top: 18px; padding-top: 18px; }
.amos-featured-passage-v2 .ref { font: 600 10.5px 'Figtree'; letter-spacing:.18em; text-transform: uppercase; color: rgba(6,31,39,.5); margin-bottom: 10px; }
.amos-featured-passage-v2 .greek { font-family: 'Roboto Slab', 'Roboto', Georgia, serif; font-size: 17px; line-height: 1.6; color: rgba(6,31,39,.88); font-style: italic; letter-spacing:-.003em; }
.amos-featured-passage-v2 .cite { font: 600 10.5px 'Figtree'; letter-spacing:.18em; text-transform: uppercase; color: rgba(6,31,39,.5); margin-top: 12px; }

/* ── Doc card: topic pills + citations row ───────────── */
.amos-doc-topics { padding: 0 14px 10px; display:flex; flex-wrap: wrap; gap: 4px; }
.amos-doc-topic { font: 500 10.5px 'Roboto'; color: rgba(6,31,39,.62); background: rgba(6,31,39,.04); padding: 2px 8px; border-radius: 999px; line-height: 1.45; }
.amos-doc-cites { padding: 0 14px 10px; display:flex; gap: 10px; align-items: center; font: 400 11px 'Roboto'; color: rgba(6,31,39,.58); border-top: 1px dashed rgba(6,31,39,.08); margin-top: 4px; padding-top: 10px; }
.amos-doc-cites .c { font-family: 'Roboto Slab', serif; font-weight: 500; color: var(--tan-ink); font-variant-numeric: tabular-nums; }
.amos-doc-cites .sep { color: rgba(6,31,39,.25); }

/* Dark theme bridges */
body.theme-scholar .author-card { border-bottom-color: rgba(255,255,255,.06); }
body.theme-scholar .ac-name { color: #e8dcc4; font-family: 'Roboto Slab', serif; }
body.theme-scholar .ac-bio { color: rgba(232,230,223,.75); }
body.theme-scholar .ac-stats { border-color: rgba(255,255,255,.08); }
body.theme-scholar .ac-stat .n { color: #e8dcc4; }
body.theme-scholar .ac-topic { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); color: rgba(232,230,223,.8); }
body.theme-scholar .ac-works-head { border-bottom-color: rgba(255,255,255,.08); color: rgba(232,230,223,.55); }
body.theme-scholar .ac-work { border-top-color: rgba(255,255,255,.05); }
body.theme-scholar .ac-work .t { color: #e8e6df; }
body.theme-scholar .amos-modes-band { background: linear-gradient(180deg, #171b22 0%, #1a1f27 100%); border-color: rgba(255,255,255,.08); }
body.theme-scholar .wmb-title { color: #e8dcc4; }
body.theme-scholar .wmb-card { background: #1d222b; border-color: rgba(255,255,255,.06); }
body.theme-scholar .wmb-n { color: #e8dcc4; }
body.theme-scholar .wmb-d { color: rgba(232,230,223,.7); }
body.theme-scholar .wmb-letter { color: #d4a24c; }

/* ── Tweaks floating panel ───────────────────────────── */
.amos-tweaks { position: fixed; right: 18px; bottom: 18px; background:#fff; border: 1px solid rgba(6,31,39,.14); border-radius: 10px; box-shadow: 0 12px 32px rgba(6,31,39,.16); padding: 12px 14px; z-index: 30; display:none; font-family: 'Roboto'; }
.amos-tweaks.on { display: block; }
.amos-tweaks h5 { font: 700 10.5px 'Figtree'; letter-spacing: .14em; text-transform: uppercase; color: rgba(6,31,39,.55); margin: 0 0 10px; }
.amos-tweaks .theme-row { display:flex; gap: 6px; }
.amos-tweaks .theme-opt { display:flex; flex-direction:column; gap: 4px; align-items:center; padding: 8px; border-radius: 7px; border: 2px solid transparent; cursor: pointer; width: 82px; }
.amos-tweaks .theme-opt:hover { background: rgba(6,31,39,.04); }
.amos-tweaks .theme-opt.on { border-color: var(--tan-cyan); background: rgba(61,202,220,.07); }
.amos-tweaks .theme-swatch { width: 54px; height: 40px; border-radius: 4px; border: 1px solid rgba(6,31,39,.12); display:grid; grid-template-rows: 12px 1fr; overflow: hidden; }
.amos-tweaks .theme-swatch > div:first-child { border-bottom: 1px solid rgba(6,31,39,.08); }
.amos-tweaks .theme-label { font: 600 10.5px 'Roboto'; color: rgba(6,31,39,.7); }

/* ── Theme: Light paper ────────────────────────────── */
body.theme-paper { background: #f6f1e8; }
body.theme-paper .amos-sidebar { background: #fbf7ee; border-right-color: rgba(120,90,40,.1); }
body.theme-paper .amos-topbar, body.theme-paper .amos-hero, body.theme-paper .amos-toolbar { background: #fbf7ee; border-bottom-color: rgba(120,90,40,.1); }
body.theme-paper .amos-doc, body.theme-paper .amos-list, body.theme-paper .amos-featured, body.theme-paper .amos-featured-passage { background: #fcfaf3; border-color: rgba(120,90,40,.14); }
body.theme-paper .amos-hero h1, body.theme-paper .reader-passage { font-family: 'Roboto Slab', 'Roboto', Georgia, serif; }
body.theme-paper .amos-drawer { background: #fcfaf3; }

/* ── Theme: Dark scholarly ─────────────────────────── */
body.theme-scholar { background: #0f1217; color: #e8e6df; }
body.theme-scholar .amos-sidebar { background: #141820; border-right-color: rgba(255,255,255,.06); }
body.theme-scholar .amos-sidebar, body.theme-scholar .amos-brand-word, body.theme-scholar .amos-user .name { color: #e8e6df; }
body.theme-scholar .amos-brand-word small, body.theme-scholar .amos-sec, body.theme-scholar .amos-user .role { color: rgba(232,230,223,.55); }
body.theme-scholar .amos-item { color: rgba(232,230,223,.75); }
body.theme-scholar .amos-item:hover { background: rgba(255,255,255,.04); color: #fff; }
body.theme-scholar .amos-item.active { background: rgba(212,162,76,.1); border-left-color: #d4a24c; color: #e8dcc4; }
body.theme-scholar .amos-item.active svg { color: #d4a24c; }
body.theme-scholar .amos-search .input { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.06); color: #e8e6df; }
body.theme-scholar .amos-search input { color: #e8e6df; }
body.theme-scholar .amos-topbar, body.theme-scholar .amos-hero, body.theme-scholar .amos-toolbar { background: #141820; border-bottom-color: rgba(255,255,255,.06); }
body.theme-scholar .amos-crumbs, body.theme-scholar .amos-crumbs .here { color: #e8e6df; }
body.theme-scholar .amos-hero h1 { color: #ece8df; font-family: 'Roboto Slab','Roboto',Georgia, serif; }
body.theme-scholar .amos-hero h1 em { color: #d4a24c; font-style: italic; }
body.theme-scholar .amos-hero .sub { color: rgba(232,230,223,.6); }
body.theme-scholar .amos-hero-stats { background: rgba(255,255,255,.02); border-color: rgba(255,255,255,.06); }
body.theme-scholar .amos-hero-stat { border-right-color: rgba(255,255,255,.06); }
body.theme-scholar .amos-hero-stat .n { color: #e8dcc4; }
body.theme-scholar .amos-hero-stat .l { color: rgba(232,230,223,.5); }
body.theme-scholar .amos-chip { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); color: rgba(232,230,223,.85); }
body.theme-scholar .amos-chip.on { background: #d4a24c; color: #141820; border-color: #d4a24c; }
body.theme-scholar .amos-chip svg { color: rgba(232,230,223,.55); }
body.theme-scholar .amos-view-switch, body.theme-scholar .amos-sort { background: rgba(255,255,255,.02); border-color: rgba(255,255,255,.08); color: rgba(232,230,223,.75); }
body.theme-scholar .amos-view-switch button { background: transparent; color: rgba(232,230,223,.6); }
body.theme-scholar .amos-view-switch button.on { background: #d4a24c; color: #141820; }
body.theme-scholar .amos-rail-title, body.theme-scholar .amos-rail-sub { color: rgba(232,230,223,.75); }
body.theme-scholar .amos-rail-more { color: #d4a24c; }
body.theme-scholar .amos-doc { background: #171b22; border-color: rgba(255,255,255,.08); }
body.theme-scholar .amos-doc-title { color: #e8e6df; }
body.theme-scholar .amos-doc-by { color: rgba(232,230,223,.55); }
body.theme-scholar .amos-doc-meta { color: rgba(232,230,223,.5); }
body.theme-scholar .amos-list { background: #171b22; border-color: rgba(255,255,255,.08); }
body.theme-scholar .amos-list-head { background: rgba(255,255,255,.02); border-color: rgba(255,255,255,.06); color: rgba(232,230,223,.5); }
body.theme-scholar .amos-list-row { border-top-color: rgba(255,255,255,.05); }
body.theme-scholar .amos-list-row .title { color: #e8e6df; }
body.theme-scholar .amos-list-row .muted { color: rgba(232,230,223,.55); }
body.theme-scholar .amos-featured { background: linear-gradient(180deg, #171b22 0%, #181e26 100%); border-color: rgba(255,255,255,.08); }
body.theme-scholar .amos-featured h3 { color: #e8dcc4; font-family: 'Roboto Slab','Roboto',Georgia, serif; }
body.theme-scholar .amos-featured h3 em { color: #d4a24c; font-style: italic; }
body.theme-scholar .amos-featured p { color: rgba(232,230,223,.65); }
body.theme-scholar .amos-featured-passage { background: #1d222b; border-color: rgba(255,255,255,.06); color: #e8e6df; font-family: 'Roboto Slab','Roboto',Georgia, serif; }
body.theme-scholar .amos-featured-passage .greek { color: #ece8df; }
body.theme-scholar .amos-featured-passage .en { color: rgba(232,230,223,.7); }
body.theme-scholar .amos-featured-passage .chip-row span { background: rgba(255,255,255,.04); border-color: rgba(255,255,255,.08); color: rgba(232,230,223,.75); }
body.theme-scholar .amos-icon-btn { color: rgba(232,230,223,.7); }
body.theme-scholar .amos-icon-btn:hover { background: rgba(255,255,255,.06); color: #fff; }
body.theme-scholar .amos-drawer { background: #141820; color: #e8e6df; }
body.theme-scholar .amos-drawer-head { background: #141820; border-bottom-color: rgba(255,255,255,.06); }
body.theme-scholar .amos-drawer-modes { background: rgba(255,255,255,.02); border-bottom-color: rgba(255,255,255,.06); }
body.theme-scholar .amos-drawer-mode { color: rgba(232,230,223,.6); }
body.theme-scholar .amos-drawer-mode.on { color: #e8dcc4; border-bottom-color: #d4a24c; }
body.theme-scholar .reader-passage { color: #ece8df; }
body.theme-scholar .reader-view-sw { background: rgba(255,255,255,.05); }
body.theme-scholar .reader-view-sw button { color: rgba(232,230,223,.7); }
body.theme-scholar .reader-view-sw button.on { background: #1f242c; color: #e8dcc4; }
body.theme-scholar .reader-parallel { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.06); }
body.theme-scholar .reader-parallel > div { background: #1d222b; }
body.theme-scholar .citation { background: rgba(255,255,255,.02); border-color: rgba(255,255,255,.06); }
body.theme-scholar .citation .by { color: #e8dcc4; }
body.theme-scholar .citation .quote { color: rgba(232,230,223,.8); }
body.theme-scholar .apparatus-box { background: #1d222b; border-color: rgba(255,255,255,.06); }
body.theme-scholar .apparatus-layer { border-top-color: rgba(255,255,255,.05); }
body.theme-scholar .apparatus-layer p { color: rgba(232,230,223,.8); }
