/* workshop.css — MKT Translation Workshop (private tool) */

/* ── Page shell ─────────────────────────────────────────────────── */
.ws-body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base, system-ui, sans-serif);
  margin: 0;
  padding-left: 0 !important;  /* override sidebar padding from style.css */
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Top bar ─────────────────────────────────────────────────────── */
.ws-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--sb-bg, #1a120a);
  color: var(--sb-text, #e8d5b0);
  border-bottom: 1px solid var(--color-border, #c8a96e30);
  flex-shrink: 0;
  gap: 1rem;
}
.ws-topbar__title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
}
.ws-topbar__icon { font-size: 1.1rem; }
.ws-back-link {
  color: var(--sb-muted, #9a8060);
  text-decoration: none;
  font-size: 0.82rem;
  opacity: 0.85;
  transition: opacity 0.15s, color 0.15s;
  white-space: nowrap;
}
.ws-back-link:hover { opacity: 1; color: var(--sb-text, #e8d9bb); }
.ws-topbar__sep { color: var(--sb-muted, #9a8060); opacity: 0.4; font-size: 0.8rem; }
.ws-topbar__private {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--color-primary, #c8a96e);
  color: var(--color-on-primary, #1a1208);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}
.ws-topbar__actions { display: flex; gap: 0.5rem; align-items: center; }
.ws-btn--ghost {
  background: none !important;
  border: 1px solid transparent !important;
  color: var(--sb-muted, #9a8060) !important;
  font-size: 1rem !important;
  padding: 0.2rem 0.4rem !important;
}
.ws-btn--ghost:hover { border-color: var(--color-primary, #c8a96e) !important; color: var(--color-primary, #c8a96e) !important; }

/* Advanced tools panel (translation workflow, hidden by default) */
.sw-advanced-panel {
  background: #120d05;
  border-bottom: 1px solid #3a280e;
  padding: 0.4rem 1rem;
  flex-shrink: 0;
}
.sw-advanced-panel__inner {
  display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap;
}
.sw-advanced-panel__label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: #7a6a4a; margin-right: 0.5rem;
}

/* Study nav: recent passage buttons */
.ws-nav-btn--recent { padding: 0.3rem 0.75rem; }
.ws-nav-btn__label--ref {
  font-size: 0.8rem; font-style: italic;
  color: var(--color-primary, #c8a96e); opacity: 0.85;
}
.ws-topbar__stats {
  display: flex;
  gap: 1.25rem;
  font-size: 0.78rem;
  color: var(--sb-muted, #9a8060);
}
.ws-topbar__stat strong { color: var(--sb-text, #e8d5b0); }

/* ── Loading ─────────────────────────────────────────────────────── */
.ws-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  font-size: 0.9rem;
  color: var(--color-muted, #888);
}
.ws-loading__bar {
  margin-top: 0.5rem;
  height: 3px;
  width: 200px;
  background: var(--color-border, #c8a96e30);
  border-radius: 2px;
  overflow: hidden;
}
.ws-loading__bar-inner {
  height: 100%;
  background: var(--color-primary, #c8a96e);
  width: 40%;
  animation: ws-bar 1s ease-in-out infinite alternate;
}
@keyframes ws-bar { to { width: 85%; } }

/* ── Main layout ────────────────────────────────────────────────── */
.ws-page { display: flex; flex-direction: column; height: 100vh; overflow: hidden; position: relative; }
/* Default (study mode): no nav column — just center + dossier */
.ws-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  flex: 1;
  overflow: hidden;
}

/* Translation mode: restore the 3-column grid with nav */
.ws-page--translation .ws-layout {
  grid-template-columns: 190px 1fr 360px;
}

/* ── Mode-specific column overrides ─────────────────────────────── */
/* Word Study and Book Study hide the dossier; center column fills full width */
.ws-page--word-study .ws-layout,
.ws-page--book-study .ws-layout {
  grid-template-columns: 1fr;
}
.ws-page--word-study .ws-col--dossier,
.ws-page--book-study .ws-col--dossier {
  display: none;
}
/* Verse Study: dossier lives inside the right tab panel; hide the column */
.ws-page--verse .ws-col--dossier {
  display: none;
}

/* ── Columns ─────────────────────────────────────────────────────── */
.ws-col {
  border-right: 1px solid var(--color-border, #c8a96e20);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ws-col--dossier { border-right: none; }

/* ── Nav column — hidden by default; shown only in translation mode ── */
.ws-col--nav {
  display: none;
  background: var(--sb-bg, #1a120a);
  padding: 0.5rem 0;
  overflow-y: auto;
}
/* Translation mode reveals the nav column */
.ws-page--translation .ws-col--nav {
  display: flex;
  flex-direction: column;
}
/* Verse study mode also shows nav column for recent passage history */
.ws-page--verse .ws-col--nav {
  display: flex;
  flex-direction: column;
}
.ws-page--verse .ws-layout {
  grid-template-columns: 160px 1fr;
}
.ws-nav-section--recent {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #7a6a4a);
  padding: 0.5rem 0.75rem 0.2rem;
}
.ws-nav-btn--recent {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.3rem 0.75rem;
  background: none;
  border: none;
  color: var(--color-text, #e8dcc8);
  font-size: 0.78rem;
  cursor: pointer;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-nav-btn--recent:hover {
  background: rgba(200,169,110,0.12);
  color: var(--color-primary, #c8a96e);
}
.ws-nav-section {
  padding: 0.35rem 0.75rem 0.15rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sb-muted, #9a8060);
}
.ws-nav-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.45rem 0.75rem;
  background: none;
  border: none;
  color: var(--sb-text, #e8d5b0);
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
  border-radius: 0;
  transition: background 0.15s;
}
.ws-nav-btn:hover { background: var(--sb-hover, rgba(200,169,110,0.08)); }
.ws-nav-btn.active {
  background: var(--sb-active, rgba(200,169,110,0.16));
  color: var(--color-primary, #c8a96e);
  font-weight: 600;
}
.ws-nav-btn__icon { font-size: 0.85em; opacity: 0.7; flex-shrink: 0; }
.ws-nav-btn__label { flex: 1; line-height: 1.3; }
.ws-nav-btn__count {
  font-size: 0.7rem;
  background: var(--color-primary, #c8a96e);
  color: var(--color-on-primary, #1a1208);
  padding: 0 0.35rem;
  border-radius: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.ws-nav-divider { border: none; border-top: 1px solid var(--color-border, #c8a96e15); margin: 0.35rem 0.75rem; }

/* Progress bars in nav */
.ws-nav-progress {
  padding: 0 0.75rem 0.75rem;
}
.ws-prog-row { margin-bottom: 0.6rem; }
.ws-prog-label { font-size: 0.72rem; color: var(--sb-muted, #9a8060); margin-bottom: 0.2rem; display: flex; justify-content: space-between; }
.ws-prog-label strong { color: var(--sb-text, #e8d5b0); }
.ws-prog-bar {
  height: 5px;
  background: var(--color-border, #c8a96e20);
  border-radius: 3px;
  overflow: hidden;
}
.ws-prog-fill {
  height: 100%;
  background: var(--color-primary, #c8a96e);
  border-radius: 3px;
  transition: width 0.3s;
}

/* ── Queue column ────────────────────────────────────────────────── */
.ws-col--queue { background: var(--color-surface, #fff8f0); }
.ws-queue-header {
  padding: 0.5rem;
  border-bottom: 1px solid var(--color-border, #c8a96e20);
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
}
.ws-search {
  flex: 1;
  border: 1px solid var(--color-border, #c8a96e40);
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-size: 0.8rem;
  background: var(--color-bg, #fff);
  color: var(--color-text, #1a0a00);
  outline: none;
}
.ws-search:focus { border-color: var(--color-primary, #c8a96e); }
.ws-count {
  font-size: 0.7rem;
  color: var(--color-muted, #888);
  white-space: nowrap;
  flex-shrink: 0;
}
.ws-queue {
  flex: 1;
  overflow-y: auto;
}
.ws-queue-item {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border, #c8a96e15);
  transition: background 0.12s;
  font-size: 0.8rem;
}
.ws-queue-item:hover { background: var(--color-hover, rgba(200,169,110,0.07)); }
.ws-queue-item.active {
  background: var(--color-primary, #c8a96e);
  color: var(--color-on-primary, #1a1208);
}
.ws-queue-item__code {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: var(--color-muted, #888);
  flex-shrink: 0;
  width: 42px;
}
.ws-queue-item.active .ws-queue-item__code { color: inherit; opacity: 0.7; }
.ws-queue-item__lemma {
  font-size: 1rem;
  flex-shrink: 0;
  width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ws-queue-item__gloss {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--color-muted, #888);
  font-size: 0.76rem;
}
.ws-queue-item.active .ws-queue-item__gloss { color: inherit; opacity: 0.75; }
.ws-queue-item__status {
  font-size: 0.65rem;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.ws-queue-item.active .ws-queue-item__status { display: none; }

/* Status color badges */
.ws-status--draft     { background: #ddd; color: #555; }
.ws-status--confirmed { background: #d4edda; color: #155724; }
.ws-status--override  { background: #cce5ff; color: #004085; }
.ws-status--disputed  { background: #fff3cd; color: #856404; }
.ws-status--deferred  { background: #f8d7da; color: #721c24; }
.ws-status--locked    { background: #e2e3e5; color: #383d41; }

.ws-queue-loading, .ws-queue-error {
  padding: 1rem 0.75rem;
  font-size: 0.82rem;
  color: var(--color-muted, #888);
  font-style: italic;
}
.ws-queue-error { color: #c0392b; font-style: normal; }

.ws-nav-flag {
  padding: 0.25rem 0.75rem;
  font-size: 0.74rem;
}
.ws-nav-flag--dispute { color: #856404; }
.ws-nav-flag--defer   { color: #721c24; }
.ws-nav-flag--lock    { color: var(--sb-muted, #9a8060); }

.ws-queue-load-more {
  display: block;
  width: 100%;
  padding: 0.5rem;
  font-size: 0.78rem;
  color: var(--color-primary, #c8a96e);
  background: none;
  border: none;
  cursor: pointer;
  text-align: center;
}
.ws-queue-load-more:hover { text-decoration: underline; }

/* ── Dossier column ──────────────────────────────────────────────── */
.ws-col--dossier {
  background: var(--color-bg, #fff8f0);
  overflow-y: auto;
}
.ws-placeholder {
  padding: 3rem 2rem;
  color: var(--color-muted, #888);
  font-size: 0.9rem;
  text-align: center;
}

/* Dossier sections */
.ws-dossier { padding: 0; }

.ws-dossier-head {
  padding: 1rem 1.25rem 0.75rem;
  border-bottom: 2px solid var(--color-border, #c8a96e30);
  background: var(--color-surface, #fff8f0);
  position: sticky;
  top: 0;
  z-index: 1;
}
.ws-dossier-head__top {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.35rem;
}
.ws-dossier__code { font-family: monospace; font-size: 0.8rem; color: var(--color-muted, #888); }
.ws-dossier__lemma { font-size: 1.8rem; line-height: 1.1; }
.ws-dossier__translit { font-size: 0.9rem; color: var(--color-muted, #888); font-style: italic; }
.ws-dossier__pos {
  font-size: 0.72rem;
  padding: 0.15rem 0.4rem;
  border: 1px solid var(--color-border, #c8a96e40);
  border-radius: 3px;
  color: var(--color-muted, #888);
}
.ws-dossier__dispute {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 3px;
  font-weight: 700;
}
.ws-dispute-0 { display: none; }
.ws-dispute-1 { background: #e8f5e9; color: #2e7d32; }
.ws-dispute-2 { background: #fff8e1; color: #f57f17; }
.ws-dispute-3 { background: #fff3e0; color: #e65100; }
.ws-dispute-4 { background: #fce4ec; color: #b71c1c; }

.ws-dossier-head__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.76rem;
  color: var(--color-muted, #888);
  flex-wrap: wrap;
}
.ws-dossier-head__status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 700;
}

/* Dossier body sections */
.ws-section {
  border-bottom: 1px solid var(--color-border, #c8a96e20);
  padding: 0.75rem 1.25rem;
}
.ws-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-muted, #888);
  margin-bottom: 0.5rem;
}

/* Source columns */
.ws-sources { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 900px) { .ws-sources { grid-template-columns: 1fr; } }
.ws-source-card {
  background: var(--color-surface, #fff8f0);
  border: 1px solid var(--color-border, #c8a96e20);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
}
.ws-source-card__label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-primary, #c8a96e);
  margin-bottom: 0.25rem;
}
.ws-source-card__gloss {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.ws-source-card__def {
  font-size: 0.8rem;
  color: var(--color-text, #1a0a00);
  opacity: 0.75;
  line-height: 1.4;
}
.ws-source-card__deriv {
  font-size: 0.72rem;
  color: var(--color-muted, #888);
  margin-top: 0.25rem;
  font-style: italic;
}

/* Tiers table */
.ws-tiers { border-collapse: collapse; width: 100%; font-size: 0.83rem; }
.ws-tiers td, .ws-tiers th { padding: 0.3rem 0.5rem; vertical-align: top; }
.ws-tiers th {
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted, #888);
  white-space: nowrap;
  width: 80px;
}
.ws-tiers tr { border-bottom: 1px solid var(--color-border, #c8a96e10); }
.ws-tier-primary { font-weight: 500; }
.ws-tier-notes { color: var(--color-muted, #888); font-size: 0.78rem; font-style: italic; }
.ws-tier-label--lit  { color: #3a5c9e; }
.ws-tier-label--med  { color: #2e7d32; }
.ws-tier-label--tho  { color: #7b2d8b; }

/* Override form */
.ws-override-form { display: flex; flex-direction: column; gap: 0.6rem; }
.ws-override-row { display: flex; gap: 0.5rem; align-items: center; }
.ws-override-row label { font-size: 0.73rem; width: 80px; flex-shrink: 0; font-weight: 600; color: var(--color-muted,#888); }
.ws-override-row input {
  flex: 1;
  border: 1px solid var(--color-border, #c8a96e40);
  border-radius: 4px;
  padding: 0.28rem 0.5rem;
  font-size: 0.83rem;
  background: var(--color-bg, #fff);
  color: var(--color-text, #1a0a00);
}
.ws-override-row input:focus { outline: none; border-color: var(--color-primary, #c8a96e); }
.ws-reasoning-label { font-size: 0.73rem; font-weight: 600; color: var(--color-muted,#888); margin-bottom: 0.25rem; }
.ws-reasoning-label span { color: #c0392b; }
.ws-reasoning {
  width: 100%;
  min-height: 60px;
  border: 1px solid var(--color-border, #c8a96e40);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  font-family: inherit;
  background: var(--color-bg, #fff);
  color: var(--color-text, #1a0a00);
  resize: vertical;
  box-sizing: border-box;
}
.ws-reasoning:focus { outline: none; border-color: var(--color-primary, #c8a96e); }

/* Attested range — primary content block */
.ws-section--range { background: var(--color-surface, #fff8f0); border-left: 3px solid var(--color-primary, #c8a96e); padding-left: 0.85rem; border-radius: 0 6px 6px 0; }
.ws-semantic { font-size: 0.82rem; line-height: 1.5; color: var(--color-text,#1a0a00); opacity: 0.85; }
.ws-semantic--headline { font-size: 1rem; line-height: 1.65; opacity: 1; font-weight: 500; margin: 0.2rem 0 0; }

/* Lexical sources — subordinate to the range */
.ws-section--sources .ws-section-title { font-size: 0.65rem; opacity: 0.75; }

/* Book distribution heat map */
.ws-section--bdist {}
.ws-bdist { display: flex; flex-direction: column; gap: 0.3rem; }
.ws-bdist-row { display: flex; align-items: center; gap: 0.4rem; }
.ws-bdist-label { font-size: 0.62rem; color: var(--color-muted, #888); width: 1.4rem; flex-shrink: 0; text-align: right; }
.ws-bdist-cells { display: flex; flex-wrap: nowrap; gap: 2px; overflow-x: auto; }
.ws-bdist-cell { display: inline-block; width: 9px; height: 13px; border-radius: 2px; flex-shrink: 0; cursor: default; }
.ws-bdist-cell--zero { background: var(--color-border, #c8a96e15); }
.ws-bdist-cell--h1 { background: #c8a96e40; }
.ws-bdist-cell--h2 { background: #c8a96e80; }
.ws-bdist-cell--h3 { background: #c8a96ec0; }
.ws-bdist-cell--h4 { background: var(--color-primary, #c8a96e); }

/* Default rendering tendency — secondary */
.ws-section--tiers .ws-section-title { opacity: 0.85; }

/* Per-book defaults */
.ws-section--bookdefs {}
.ws-bookdefs-details { }
.ws-bookdefs-summary { cursor: pointer; user-select: none; list-style: none; }
.ws-bookdefs-summary::-webkit-details-marker { display: none; }
.ws-bookdefs-summary::before { content: '▸ '; font-size: 0.65rem; opacity: 0.6; }
details[open] .ws-bookdefs-summary::before { content: '▾ '; }
.ws-bookdefs-grid { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 0.5rem; }
.ws-bookdef-row { display: grid; grid-template-columns: 2.6rem 1fr 1fr 1fr; gap: 0.25rem; align-items: center; }
.ws-bookdef-abbr { font-size: 0.7rem; font-weight: 600; color: var(--color-primary, #c8a96e); text-align: right; padding-right: 0.2rem; }
.ws-bookdef-input { font-size: 0.75rem; padding: 0.18rem 0.4rem; border: 1px solid var(--color-border, #c8a96e30); border-radius: 3px; background: var(--color-bg, #fff8f0); color: var(--color-text, #1a0a00); width: 100%; }
.ws-bookdef-input:focus { outline: none; border-color: var(--color-primary, #c8a96e); background: var(--color-surface, #fff8f0); }
.ws-bookdef-input::placeholder { color: var(--color-muted, #aaa); opacity: 0.8; }

/* Decision log */
.ws-log { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.4rem; }
.ws-log-item {
  font-size: 0.78rem;
  background: var(--color-surface, #fff8f0);
  border: 1px solid var(--color-border, #c8a96e20);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
}
.ws-log-item__meta { font-size: 0.7rem; color: var(--color-muted,#888); margin-bottom: 0.15rem; }
.ws-log-empty { font-size: 0.8rem; color: var(--color-muted,#888); font-style: italic; }

/* Inform input */
.ws-inform-wrap { display: flex; flex-direction: column; gap: 0.4rem; }
.ws-inform-label { font-size: 0.78rem; color: var(--color-muted, #888); }

/* ── Action bar ──────────────────────────────────────────────────── */
.ws-actions {
  padding: 0.75rem 1.25rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  position: sticky;
  bottom: 0;
  background: var(--color-bg, #fff8f0);
  border-top: 1px solid var(--color-border, #c8a96e20);
}
.ws-action-btn {
  padding: 0.45rem 0.85rem;
  border-radius: 4px;
  border: 1px solid var(--color-border, #c8a96e40);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--color-bg, #fff);
  color: var(--color-text, #1a0a00);
  transition: background 0.15s, border-color 0.15s;
}
.ws-action-btn:hover { border-color: var(--color-primary, #c8a96e); }
.ws-action-btn--confirm { background: #d4edda; color: #155724; border-color: #c3e6cb; }
.ws-action-btn--confirm:hover { background: #c3e6cb; }
.ws-action-btn--override { background: #cce5ff; color: #004085; border-color: #b8daff; }
.ws-action-btn--override:hover { background: #b8daff; }
.ws-action-btn--inform  { background: #d1ecf1; color: #0c5460; border-color: #bee5eb; }
.ws-action-btn--inform:hover  { background: #bee5eb; }
.ws-action-btn--dispute { background: #fff3cd; color: #856404; border-color: #ffeeba; }
.ws-action-btn--dispute:hover { background: #ffeeba; }
.ws-action-btn--defer   { background: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.ws-action-btn--defer:hover   { background: #f5c6cb; }
.ws-action-btn--lock    { background: #e2e3e5; color: #383d41; border-color: #d6d8db; }
.ws-action-btn--lock:hover    { background: #d6d8db; }
.ws-action-btn--save    { background: var(--color-primary,#c8a96e); color: var(--color-on-primary,#1a1208); border-color: transparent; }
.ws-action-btn--save:hover    { opacity: 0.9; }
.ws-action-btn--cancel  { background: none; color: var(--color-muted, #888); }
.ws-action-btn--cancel:hover  { background: var(--color-hover, rgba(200,169,110,0.07)); }
.ws-action-btn:disabled { opacity: 0.4; cursor: default; }

/* ── Buttons (general) ───────────────────────────────────────────── */
.ws-btn {
  padding: 0.3rem 0.7rem;
  border-radius: 4px;
  border: 1px solid var(--color-border, #c8a96e40);
  font-size: 0.78rem;
  cursor: pointer;
  background: var(--color-bg, #fff);
  color: var(--color-text, #1a0a00);
  transition: background 0.15s;
}
.ws-btn:hover { background: var(--color-hover, rgba(200,169,110,0.07)); }
.ws-btn--sm { font-size: 0.73rem; padding: 0.25rem 0.5rem; }
.ws-btn--active { background: var(--color-primary, #8b4513); color: #fff; border-color: var(--color-primary, #8b4513); }

/* Dashboard */
.ws-dashboard { padding: 1.25rem; }
.ws-dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.ws-dash-card {
  background: var(--color-surface, #fff8f0);
  border: 1px solid var(--color-border, #c8a96e20);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}
.ws-dash-card__label { font-size: 0.72rem; color: var(--color-muted,#888); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.3rem; }
.ws-dash-card__value { font-size: 1.8rem; font-weight: 700; line-height: 1; margin-bottom: 0.2rem; }
.ws-dash-card__sub { font-size: 0.78rem; color: var(--color-muted,#888); }

/* ── Primer nav ──────────────────────────────────────────────────── */
.ws-primer-group-label {
  padding: 0.6rem 0.65rem 0.15rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted, #888);
  border-top: 1px solid var(--color-border, #c8a96e15);
  margin-top: 0.25rem;
}
.ws-primer-group-label:first-child { border-top: none; margin-top: 0; }
.ws-primer-item {
  padding: 0.35rem 0.65rem;
  gap: 0.5rem;
  cursor: pointer;
}
.ws-primer-item__icon {
  font-size: 0.85rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: var(--color-muted, #888);
}
.ws-primer-item__label {
  font-size: 0.8rem;
  flex: 1;
}
.ws-primer-item.active .ws-primer-item__icon { color: var(--color-on-primary, #1a1208); }

/* ── Primer content ──────────────────────────────────────────────── */
.ws-primer-body {
  padding: 1.25rem 1.5rem;
  max-width: 680px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--color-text, #1a0a00);
}
.ws-primer-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0.75rem 0;
}
.ws-primer-table th {
  background: var(--color-surface, #fff8f0);
  padding: 0.3rem 0.5rem;
  text-align: left;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-muted, #888);
  border-bottom: 2px solid var(--color-border, #c8a96e30);
}
.ws-primer-table td {
  padding: 0.28rem 0.5rem;
  border-bottom: 1px solid var(--color-border, #c8a96e12);
  vertical-align: top;
}
.ws-primer-table tr:nth-child(even) td { background: var(--color-surface, #fff8f0); }
.ws-primer-table td:first-child {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary, #c8a96e);
  width: 2rem;
}

.ws-primer-body h3 {
  font-size: 1.05rem;
  margin: 0 0 0.75rem;
  color: var(--color-primary, #c8a96e);
  border-bottom: 1px solid var(--color-border, #c8a96e30);
  padding-bottom: 0.4rem;
}
.ws-primer-body h4 {
  font-size: 0.88rem;
  margin: 1.1rem 0 0.3rem;
  font-weight: 700;
}
.ws-primer-body p { margin: 0.4rem 0; }
.ws-primer-body ul, .ws-primer-body ol {
  margin: 0.4rem 0;
  padding-left: 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.ws-primer-body strong { color: var(--color-primary, #c8a96e); font-weight: 700; }
.ws-primer-body em { font-style: italic; }

/* ── Contextual Renderings section ──────────────────────────────── */
.ws-section--contextual { border-top: 2px solid var(--color-primary, #c8a96e); padding-top: 0.85rem; margin-top: 0.5rem; }
.ws-section-title--contextual { font-size: 0.8rem; }
.ws-add-contextual-btn {
  display: inline-block;
  margin: 0.5rem 0 0.6rem;
  font-size: 0.8rem;
  padding: 0.3rem 0.85rem;
  border: 1px solid var(--color-primary, #c8a96e);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  color: var(--color-primary, #c8a96e);
  font-weight: 600;
  transition: background 0.12s;
}
.ws-add-contextual-btn:hover { background: var(--color-hover, rgba(200,169,110,0.1)); }
.ws-contextual-hint { font-size: 0.79rem; line-height: 1.55; }

/* ── Context overrides (original) ───────────────────────────────── */
.ws-section-note {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--color-muted, #888);
  font-style: italic;
  letter-spacing: 0;
  text-transform: none;
  margin-left: 0.4rem;
}
.ws-add-override-btn {
  float: right;
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border: 1px solid var(--color-border, #c8a96e40);
  border-radius: 3px;
  background: none;
  cursor: pointer;
  color: var(--color-primary, #c8a96e);
}
.ws-add-override-btn:hover { background: var(--color-hover, rgba(200,169,110,0.08)); }
.ws-overrides-list { display: flex; flex-direction: column; gap: 0.4rem; }
.ws-override-card {
  background: var(--color-surface, #fff8f0);
  border: 1px solid var(--color-border, #c8a96e20);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  font-size: 0.79rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem;
}
.ws-override-card__condition { font-style: italic; color: var(--color-muted, #888); font-size: 0.75rem; }
.ws-override-card__tiers { font-size: 0.8rem; }
.ws-remove-override-btn {
  grid-row: 1 / 3;
  align-self: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted, #888);
  font-size: 0.8rem;
  padding: 0.2rem;
}
.ws-remove-override-btn:hover { color: #c0392b; }
.ws-add-override-form { margin-top: 0.6rem; }

/* Dashboard framing paragraph */
.ws-dash-premise {
  font-size: 0.82rem;
  line-height: 1.65;
  color: var(--color-text, #1a0a00);
  max-width: 600px;
  margin: 0 0 1.1rem;
  padding: 0.65rem 0.85rem;
  background: var(--color-surface, #fff8f0);
  border-left: 3px solid var(--color-primary, #c8a96e);
  border-radius: 0 5px 5px 0;
}
.ws-dash-premise strong { color: var(--color-primary, #c8a96e); }
.ws-dash-premise em { font-style: italic; }

/* ── Workflow guide (dashboard) ──────────────────────────────────── */
.ws-workflow {
  margin-top: 1.25rem;
  max-width: 600px;
  background: var(--color-surface, #fff8f0);
  border: 1px solid var(--color-border, #c8a96e20);
  border-radius: 8px;
  padding: 0.85rem 1rem;
}
.ws-workflow__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-muted, #888);
  margin-bottom: 0.6rem;
}
.ws-workflow__steps {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--color-text, #1a0a00);
}
.ws-workflow__steps code {
  background: var(--color-border, #c8a96e18);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  font-family: var(--font-mono, monospace);
  font-size: 0.8em;
  color: var(--color-text, #1a0a00);
}
.ws-workflow__note {
  margin: 0.75rem 0 0;
  font-size: 0.76rem;
  color: var(--color-muted, #888);
  line-height: 1.5;
  font-style: italic;
}

/* ── Attested Uses (verse samples panel) ────────────────────────── */
.ws-attestation-details {
  margin-top: 0.5rem;
}
.ws-attestation-summary {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0.25rem 0;
  user-select: none;
  list-style: none;
}
.ws-attestation-summary::-webkit-details-marker { display: none; }
.ws-attestation-summary::before { content: '▶ '; font-size: 0.65rem; }
details[open] .ws-attestation-summary::before { content: '▼ '; }
.ws-attestation-list {
  list-style: none;
  padding: 0.25rem 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.ws-attestation-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 0.4rem;
  font-size: 0.8rem;
  border-left: 2px solid var(--color-border);
  padding-left: 0.5rem;
}
.ws-attestation-ref {
  font-weight: 700;
  color: var(--color-primary);
  font-size: 0.75rem;
  white-space: nowrap;
}
.ws-attestation-ctx {
  font-size: 0.68rem;
  color: var(--color-muted);
  background: var(--color-surface);
  border-radius: 3px;
  padding: 0 0.3rem;
  align-self: center;
  white-space: nowrap;
}
.ws-attestation-quote {
  grid-column: 1 / -1;
  font-style: italic;
  color: var(--color-text);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ws-attestation-note {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--color-muted);
  font-style: normal;
  margin-top: 0.1rem;
}

/* ── Collapsible Lexical Sources ─────────────────────────────────── */
.ws-sources-details {}
.ws-sources-summary {
  cursor: pointer;
  user-select: none;
  list-style: none;
  margin-bottom: 0;
}
.ws-sources-summary::-webkit-details-marker { display: none; }
.ws-sources-summary::before { content: '▸ '; font-size: 0.65rem; opacity: 0.6; }
details[open] .ws-sources-summary::before { content: '▾ '; }
details[open] .ws-sources-summary { margin-bottom: 0.5rem; }

/* ── LXX Bridge ──────────────────────────────────────────────────── */
.ws-section--lxx {}
.ws-lxx-bridge { display: flex; flex-direction: column; gap: 0.55rem; margin-top: 0.25rem; }
.ws-lxx-pair {
  display: grid;
  grid-template-columns: auto auto auto 1fr;
  gap: 0.4rem;
  align-items: baseline;
  font-size: 0.82rem;
  border-left: 2px solid var(--color-border, #c8a96e20);
  padding-left: 0.5rem;
}
.ws-lxx-pair__lemma {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary, #c8a96e);
}
.ws-lxx-pair__code {
  font-family: var(--font-mono, monospace);
  font-size: 0.7rem;
  color: var(--color-muted, #888);
}
.ws-lxx-pair__freq {
  font-size: 0.72rem;
  color: var(--color-muted, #888);
  background: var(--color-surface, #fff8f0);
  border: 1px solid var(--color-border, #c8a96e20);
  border-radius: 3px;
  padding: 0 0.3rem;
  white-space: nowrap;
}
.ws-lxx-pair__note {
  font-size: 0.76rem;
  color: var(--color-text, #1a0a00);
  opacity: 0.75;
  font-style: italic;
  line-height: 1.4;
}

/* ── Extrabiblical Uses (papyri / M&M) ───────────────────────────── */
.ws-extrabib-details { margin-top: 0.5rem; }
.ws-extrabib-summary {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-muted, #888);
  cursor: pointer;
  padding: 0.25rem 0;
  user-select: none;
  list-style: none;
}
.ws-extrabib-summary::-webkit-details-marker { display: none; }
.ws-extrabib-summary::before { content: '▶ '; font-size: 0.65rem; }
details[open] .ws-extrabib-summary::before { content: '▼ '; }
.ws-extrabib-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.35rem;
}
.ws-extrabib-item {
  display: grid;
  grid-template-columns: auto auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 0.4rem;
  font-size: 0.8rem;
  border-left: 2px solid var(--color-border, #c8a96e20);
  padding-left: 0.5rem;
}
.ws-extrabib-source {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-on-primary, #1a1208);
  background: var(--color-primary, #c8a96e);
  border-radius: 3px;
  padding: 0.05rem 0.3rem;
  align-self: center;
  white-space: nowrap;
}
.ws-extrabib-citation {
  font-family: var(--font-mono, monospace);
  font-size: 0.72rem;
  color: var(--color-muted, #888);
  white-space: nowrap;
  align-self: center;
}
.ws-extrabib-text {
  grid-column: 1 / -1;
  font-style: italic;
  color: var(--color-text, #1a0a00);
  opacity: 0.85;
  line-height: 1.5;
  margin-top: 0.1rem;
}
.ws-extrabib-note {
  grid-column: 1 / -1;
  font-size: 0.72rem;
  color: var(--color-muted, #888);
  margin-top: 0.15rem;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 760px) {
  /* Layout: collapse to single column; nav stays as top strip */
  .ws-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }
  .ws-col--nav {
    display: flex;
    flex-direction: row;
    overflow-x: auto;
    padding: 0.25rem;
    border-right: none;
    border-bottom: 1px solid var(--color-border, #c8a96e20);
  }
  .ws-nav-section, .ws-nav-divider, .ws-nav-progress { display: none; }
  .ws-nav-btn { flex-direction: column; align-items: center; padding: 0.3rem 0.5rem; white-space: nowrap; font-size: 0.7rem; }
  .ws-nav-btn__count { display: none; }
  .ws-col--queue, .ws-col--dossier { border-right: none; }

  /* Passage full-width: queue col expands, dossier col becomes a bottom sheet */
  .ws-col--queue { grid-column: 1; overflow-y: auto; }

  /* Dossier: fixed bottom sheet — hidden below viewport until a word is opened */
  .ws-col--dossier {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72vh;
    transform: translateY(100%);
    transition: transform 0.28s ease;
    z-index: 200;
    border-radius: 1rem 1rem 0 0;
    border-top: 2px solid var(--color-primary, #c8a96e);
    border-right: none;
    background: var(--color-bg, #fff);
    overflow-y: auto;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
  }
  /* Slide up when word is active */
  .ws-col--dossier.sw-dossier--open {
    transform: translateY(0);
  }
  /* Backdrop behind the bottom sheet */
  .sw-dossier-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.35);
    z-index: 199;
  }
  /* Drag handle + close button inside dossier on mobile */
  .sw-dossier-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem 0.25rem;
    cursor: pointer;
    position: sticky;
    top: 0;
    background: inherit;
    z-index: 1;
    border-bottom: 1px solid var(--color-border, #c8a96e20);
  }
  .sw-dossier-handle__pill {
    width: 2.5rem;
    height: 0.25rem;
    background: var(--color-border, #c8a96e60);
    border-radius: 9999px;
    margin: 0 auto;
  }
  .sw-dossier-handle__close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--color-text-muted, #888);
    padding: 0.2rem 0.4rem;
  }

  /* Tabs: horizontal scroll strip */
  .sw-passage-tabs {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .sw-passage-tabs::-webkit-scrollbar { display: none; }

  /* Discourse marker badges: show only first-letter abbreviation on mobile */
  .sw-ptile__badge { font-size: 0; padding: 0 0.2rem; }
  .sw-ptile__badge::before { content: attr(data-abbr); font-size: 0.55rem; display: inline; }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .ws-status--draft     { background: #333; color: #aaa; }
  .ws-status--confirmed { background: #1a3a22; color: #6fcf97; }
  .ws-status--override  { background: #1a2d40; color: #90caf9; }
  .ws-status--disputed  { background: #3a2e00; color: #fdd835; }
  .ws-status--deferred  { background: #3a1218; color: #ef9a9a; }
  .ws-status--locked    { background: #2a2a2a; color: #9e9e9e; }
}
[data-theme="dark"] .ws-status--draft     { background: #333; color: #aaa; }
[data-theme="dark"] .ws-status--confirmed { background: #1a3a22; color: #6fcf97; }
[data-theme="dark"] .ws-status--override  { background: #1a2d40; color: #90caf9; }
[data-theme="dark"] .ws-status--disputed  { background: #3a2e00; color: #fdd835; }
[data-theme="dark"] .ws-status--deferred  { background: #3a1218; color: #ef9a9a; }
[data-theme="dark"] .ws-status--locked    { background: #2a2a2a; color: #9e9e9e; }

/* ── SW-A: Passage Entry Bar ─────────────────────────────────────── */
.sw-passage-entry {
  flex-shrink: 0;
  background: var(--color-bg-alt, #f5efe6);
  border-bottom: 1px solid var(--color-border, #c8a96e30);
  padding: 0.5rem 0.75rem;
}
.sw-passage-entry__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.sw-ref-input {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--color-border, #c8a96e60);
  border-radius: 4px;
  background: var(--color-bg, #fff);
  color: var(--color-text);
  font-size: 0.9rem;
}
.sw-ref-input:focus {
  outline: 2px solid var(--color-primary, #8b4513);
  outline-offset: 1px;
}
.sw-study-btn {
  white-space: nowrap;
}
.sw-browse-link {
  font-size: 0.82rem;
  color: var(--color-primary, #8b4513);
  text-decoration: none;
  white-space: nowrap;
  opacity: 0.8;
}
.sw-browse-link:hover { opacity: 1; text-decoration: underline; }
.sw-version-sel {
  padding: 0.35rem 0.5rem;
  background: var(--color-bg, #fff8f0);
  border: 1px solid var(--color-border, #d4c5a9);
  border-radius: 5px;
  color: var(--color-text, #2c2218);
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}
.sw-version-sel:focus { outline: none; border-color: var(--color-primary, #c8a96e); }

/* ── Mode Bar ────────────────────────────────────────────────────── */
.sw-mode-bar {
  display: flex;
  align-items: stretch;
  background: var(--color-surface, #faf8f5);
  border-bottom: 2px solid var(--color-border, #c8a96e30);
  flex-shrink: 0;
  padding: 0 0.5rem;
  gap: 0;
}
.sw-mode-btn {
  flex: 1;
  padding: 0.55rem 0.5rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--color-text-muted, #7a6a4a);
  letter-spacing: 0.02em;
  transition: color 0.15s, border-color 0.15s;
  text-align: center;
  white-space: nowrap;
}
.sw-mode-btn:hover {
  color: var(--color-primary, #c8a96e);
}
.sw-mode-btn--active {
  color: var(--color-primary, #c8a96e);
  border-bottom-color: var(--color-primary, #c8a96e);
}

/* ── Word Study Panel (center column in word study mode) ─────────── */
.sw-word-study-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.sw-ws-header {
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--color-border, #c8a96e20);
  flex-shrink: 0;
}
.sw-ws-search-bar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.sw-ws-input {
  flex: 1;
  padding: 0.4rem 0.7rem;
  background: var(--color-bg, #fff8f0);
  border: 1px solid var(--color-border, #d4c5a9);
  border-radius: 5px;
  color: var(--color-text, #2c2218);
  font-size: 0.88rem;
}
.sw-ws-input:focus { outline: none; border-color: var(--color-primary, #c8a96e); }
/* SW-U1: body area switches between single-column and 50/50 grid when dict is open */
.sw-ws-body-area {
  flex: 1;
  overflow: hidden;
  display: flex;
}
.sw-ws-body-area--dict-open {
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.sw-ws-dict-col {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--color-border, #c8a96e30);
}
.sw-ws-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  min-width: 0;
}
/* Two-column layout for word detail — left column is wider for rich lexical content */
.sw-ws-detail {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 1.5rem;
  align-items: start;
}
@media (max-width: 900px) { .sw-ws-detail { grid-template-columns: 1fr; } }
.sw-ws-detail-left { /* rich lexical info: grammar, debates, cognates, sources */ }
.sw-ws-detail-right {
  position: sticky;
  top: 0;
}
/* Inline body text in word study sections */
.sw-ws-prose {
  font-size: 0.87rem;
  line-height: 1.65;
  color: var(--color-text, #2c2218);
  margin-bottom: 0.5rem;
}
.sw-ws-lemma-card {
  background: var(--color-bg, #fff8f0);
  border: 1px solid var(--color-border, #d4c5a9);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}
.sw-ws-lemma-word {
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text, #2c2218);
  font-family: 'Noto Serif', 'SBL Greek', serif;
}
.sw-ws-lemma-translit {
  font-size: 0.9rem;
  color: var(--color-text-muted, #7a6a4a);
  font-style: italic;
  margin-top: 0.15rem;
}
.sw-ws-lemma-gloss {
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-primary, #c8a96e);
  margin-top: 0.4rem;
}
.sw-ws-lemma-pos {
  font-size: 0.72rem;
  color: var(--color-text-muted, #7a6a4a);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.25rem;
}
.sw-ws-section-head {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-primary, #c8a96e);
  margin: 1rem 0 0.4rem;
  border-bottom: 1px solid var(--color-border, #c8a96e20);
  padding-bottom: 0.2rem;
}
.sw-ws-usage-verse {
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--color-border, #c8a96e10);
  cursor: pointer;
}
.sw-ws-usage-verse:hover .sw-ws-usage-ref { color: var(--color-primary, #c8a96e); }
.sw-ws-usage-ref {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-text-muted, #7a6a4a);
  white-space: nowrap;
  min-width: 80px;
  flex-shrink: 0;
  transition: color 0.12s;
}
.sw-ws-usage-text {
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--color-text, #2c2218);
}
.sw-ws-usage-text em { /* highlighted match word */
  font-style: normal;
  color: var(--color-primary, #c8a96e);
  font-weight: 600;
}
.sw-ws-placeholder {
  color: var(--color-text-muted, #7a6a4a);
  font-size: 0.9rem;
  text-align: center;
  padding: 3rem 2rem;
  line-height: 1.8;
}

/* ── Word Study filter chips ─────────────────────────────────────── */
.sw-ws-filters {
  display: flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem 0.35rem;
  border-bottom: 1px solid var(--color-border, #c8a96e20);
  flex-shrink: 0;
}
.sw-ws-filter-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted, #7a6a4a);
  margin-right: 0.1rem;
}
.sw-ws-filter {
  padding: 0.18rem 0.55rem;
  font-size: 0.75rem;
  border: 1px solid var(--color-border, #d4c5a9);
  border-radius: 12px;
  background: var(--color-surface, #faf8f5);
  color: var(--color-text-muted, #7a6a4a);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  user-select: none;
}
.sw-ws-filter--active {
  background: var(--color-primary, #c8a96e);
  color: #fff;
  border-color: var(--color-primary, #c8a96e);
}
.sw-ws-filter:hover:not(.sw-ws-filter--active) {
  border-color: var(--color-primary, #c8a96e);
  color: var(--color-primary, #c8a96e);
}

/* ── Dictionary / Glossary panel ─────────────────────────────────── */
.sw-dict-panel {
  background: var(--color-surface, #faf8f5);
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}
.sw-dict-list-wrap {
  overflow-y: auto;
  flex: 1;
}
.sw-dict-status {
  font-size: 0.72rem;
  color: var(--color-text-muted, #7a6a4a);
  padding: 0.3rem 0.75rem;
  border-bottom: 1px solid var(--color-border, #c8a96e10);
}
.sw-dict-list { padding: 0.25rem 0; }
.sw-dict-entry {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.28rem 0.75rem;
  cursor: pointer;
  transition: background 0.1s;
  border-radius: 3px;
}
.sw-dict-entry:hover { background: var(--color-bg, #fff8f0); }
.sw-dict-entry--active { background: rgba(200,169,110,0.12); }
.sw-dict-word {
  font-family: 'Noto Serif', 'SBL Greek', serif;
  font-size: 0.95rem;
  color: var(--color-text, #2c2218);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-dict-gloss {
  font-size: 0.8rem;
  color: var(--color-text-muted, #7a6a4a);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-dict-meta {
  font-size: 0.65rem;
  color: var(--color-text-muted, #7a6a4a);
  text-align: right;
  white-space: nowrap;
}
.sw-dict-meta--greek  { color: #3a80c4; }
.sw-dict-meta--hebrew { color: #9b6b3a; }
em.sw-dict-hi { font-style: normal; background: rgba(200,169,110,0.3); border-radius: 2px; }

/* ── Book Study Panel (center column in book study mode) ─────────── */
.sw-book-study-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.sw-book-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-border, #c8a96e20);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.sw-book-select {
  padding: 0.4rem 0.6rem;
  background: var(--color-bg, #fff8f0);
  border: 1px solid var(--color-border, #d4c5a9);
  border-radius: 5px;
  color: var(--color-text, #2c2218);
  font-size: 0.88rem;
  cursor: pointer;
}
.sw-book-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
}
.sw-book-intro-card {
  background: var(--color-bg, #fff8f0);
  border-left: 3px solid var(--color-primary, #c8a96e);
  border-radius: 0 6px 6px 0;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--color-text, #2c2218);
}
.sw-book-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--color-border, #c8a96e20);
  margin-bottom: 1rem;
}
.sw-book-tab {
  padding: 0.45rem 1rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-muted, #7a6a4a);
  cursor: pointer;
}
.sw-book-tab--active {
  color: var(--color-primary, #c8a96e);
  border-bottom-color: var(--color-primary, #c8a96e);
}
.sw-book-tab-content { font-size: 0.88rem; line-height: 1.6; }
.sw-book-html-content { padding: 0.25rem 0; }
.sw-book-html-content p { margin: 0 0 0.85rem; font-size: 0.86rem; line-height: 1.65; }
.sw-book-html-content strong { color: var(--color-text, #2c2218); }
.sw-bookvoc-row {
  border-bottom: 1px solid var(--color-border, #c8a96e10);
  padding: 0.15rem 0;
}
.sw-bookvoc-summary {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  cursor: pointer;
  padding: 0.35rem 0.25rem;
  list-style: none;
}
.sw-bookvoc-summary::-webkit-details-marker { display: none; }
.sw-bookvoc-lemma {
  font-family: 'Noto Serif', serif;
  font-size: 1rem;
  color: var(--color-text, #2c2218);
  min-width: 8rem;
}
.sw-bookvoc-translit {
  font-size: 0.8rem;
  color: var(--color-text-muted, #7a6a4a);
  font-style: italic;
  min-width: 6rem;
}
.sw-bookvoc-gloss {
  font-size: 0.82rem;
  color: var(--color-primary, #c8a96e);
  flex: 1;
}
.sw-bookvoc-code {
  font-size: 0.7rem;
  color: var(--color-text-muted, #7a6a4a);
}
.sw-bookvoc-sig {
  font-size: 0.82rem;
  line-height: 1.6;
  padding: 0.35rem 0.5rem 0.5rem 0.5rem;
  color: var(--color-text, #2c2218);
  border-left: 2px solid var(--color-primary, #c8a96e);
  margin: 0.25rem 0 0.5rem 0.5rem;
}
.sw-book-theme-chip {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: rgba(200,169,110,0.12);
  border: 1px solid var(--color-primary, #c8a96e);
  border-radius: 20px;
  font-size: 0.75rem;
  color: var(--color-primary-dark, #8a6a2c);
  margin: 0.2rem 0.25rem 0.2rem 0;
}
.sw-book-theme-block {
  margin-bottom: 1.25rem;
}
.sw-book-theme-summary {
  margin: 0.4rem 0 0.25rem;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--color-text, #2c2218);
}
.sw-book-theme-reading {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--color-text-muted, #7a6a4a);
  font-style: italic;
}
.sw-book-term-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.5rem;
  align-items: baseline;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border, #c8a96e10);
  cursor: pointer;
}
.sw-book-term-row:hover .sw-book-term-word { color: var(--color-primary, #c8a96e); }
.sw-book-term-word {
  font-family: 'Noto Serif', serif;
  font-size: 1rem;
  color: var(--color-text, #2c2218);
}
.sw-book-term-gloss {
  font-size: 0.82rem;
  color: var(--color-text-muted, #7a6a4a);
  font-style: italic;
}
.sw-book-term-count {
  font-size: 0.72rem;
  color: var(--color-text-muted, #7a6a4a);
  font-weight: 600;
}
.sw-book-idiom-row {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-border, #c8a96e10);
  font-size: 0.87rem;
}
.sw-book-idiom-phrase {
  font-weight: 600;
  color: var(--color-primary-dark, #8a6a2c);
  margin-bottom: 0.2rem;
}
.sw-book-idiom-mean { color: var(--color-text-muted, #7a6a4a); font-size: 0.82rem; }

/* ── SW-A: Panel switching ───────────────────────────────────────── */
.sw-panel { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

/* ── SW-A: Passage view ──────────────────────────────────────────── */
.sw-passage-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.sw-verse-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 1;
  overflow: hidden;
}
.sw-verse-left {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid var(--color-border, #c8a96e20);
}
.sw-verse-right {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.sw-verse-nav-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.75rem;
  background: var(--color-bg-alt, #1a120a);
  border-bottom: 1px solid var(--color-border, #c8a96e20);
}
.sw-verse-nav-btn {
  background: none;
  border: 1px solid var(--color-border, #c8a96e30);
  border-radius: 4px;
  color: var(--color-primary, #c8a96e);
  font-size: 0.78rem;
  padding: 0.2rem 0.6rem;
  cursor: pointer;
}
.sw-verse-nav-btn:hover { background: rgba(200,169,110,0.1); }
.sw-verse-nav-label {
  font-size: 0.82rem;
  color: var(--color-text-muted, #7a6a4a);
}
.sw-passage-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--color-border, #c8a96e30);
  gap: 0.5rem;
}
.sw-passage-ref-label { flex: 1; }
.sw-close-passage {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: var(--color-muted, #888);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}
.sw-close-passage:hover { background: var(--color-hover, #c8a96e20); }
/* SW-T3: word-order toggle button — same muted style as close button */
.sw-word-order-btn {
  background: none;
  border: 1px solid var(--color-border, #c8a96e40);
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--color-muted, #888);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  white-space: nowrap;
}
.sw-word-order-btn:hover { background: var(--color-hover, #c8a96e20); }
.sw-word-order-btn.ws-btn--active {
  background: var(--color-primary, #8b4513);
  color: #fff;
  border-color: var(--color-primary, #8b4513);
}
/* SW-T3: RTL tile flow for original Hebrew reading direction */
.sw-ptiles--rtl .sw-tiles-wrap { direction: rtl; }
.sw-ptiles--rtl .sw-ptile { text-align: right; }
.sw-ptiles {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
}
.sw-ptile-loading, .sw-passage-err {
  padding: 1rem;
  color: var(--color-muted, #888);
  font-style: italic;
  font-size: 0.9rem;
}
.sw-passage-err { color: var(--color-error, #c0392b); }

/* ── SW-A: Interlinear tiles ─────────────────────────────────────── */
.sw-verse-row { margin-bottom: 1.25rem; }
.sw-verse-num {
  font-size: 0.72rem;
  color: var(--color-muted, #888);
  font-weight: 600;
  margin-bottom: 0.2rem;
  display: block;
}

/* Translation text shown above interlinear tiles */
.sw-verse-translation {
  font-size: 0.97rem;
  line-height: 1.55;
  color: var(--color-text, #2c2218);
  font-family: var(--font-body, Georgia, serif);
  margin-bottom: 0.5rem;
  padding: 0.4rem 0.6rem;
  border-left: 2px solid var(--color-primary, #c8a96e);
  background: var(--color-surface, #faf8f5);
  border-radius: 0 4px 4px 0;
}

.sw-tiles-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.sw-ptile {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 0.2rem 0.35rem;
  border: 1px solid var(--color-border, #c8a96e40);
  border-radius: 4px;
  background: var(--color-bg, #fff);
  cursor: pointer;
  font-size: 0.78rem;
  min-width: 2.5rem;
  transition: background 0.1s, border-color 0.1s;
}
.sw-ptile:hover { background: var(--color-hover, #c8a96e15); border-color: var(--color-primary, #8b4513); }
.sw-ptile--active { background: var(--color-primary, #8b4513); border-color: var(--color-primary, #8b4513); color: #fff; }
.sw-ptile__lemma {
  font-family: var(--font-greek, 'SBL Greek', Georgia, serif);
  font-size: 1rem;
  line-height: 1.2;
}
.sw-ptile__eng {
  font-size: 0.7rem;
  color: var(--color-muted, #666);
  text-align: center;
}
.sw-ptile--active .sw-ptile__eng { color: rgba(255,255,255,0.85); }
.sw-ptile__s {
  font-size: 0.62rem;
  color: var(--color-primary, #8b4513);
  opacity: 0.7;
}
.sw-ptile--active .sw-ptile__s { color: rgba(255,255,255,0.7); }

/* ── SW-A: Passage tabs ──────────────────────────────────────────── */
.sw-passage-tabs {
  flex-shrink: 0;
  display: flex;
  border-top: 1px solid var(--color-border, #c8a96e30);
  background: var(--color-bg-alt, #f5efe6);
}
.sw-tab-btn {
  flex: 1;
  padding: 0.4rem 0.25rem;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--color-muted, #888);
  transition: color 0.1s, border-color 0.1s;
}
.sw-tab-btn:hover { color: var(--color-text); }
.sw-tab-btn--active { color: var(--color-primary, #8b4513); border-bottom-color: var(--color-primary, #8b4513); font-weight: 600; }
.sw-tab-content {
  flex-shrink: 0;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  color: var(--color-muted, #888);
  border-top: 1px solid var(--color-border, #c8a96e20);
}
/* In the 50/50 verse split, the tab content panel fills and scrolls */
.sw-verse-right .sw-tab-content {
  flex: 1;
  overflow-y: auto;
  flex-shrink: 1;
}
.sw-tab-stub { margin: 0; font-style: italic; }

/* ── SW-A: Depth toggle ──────────────────────────────────────────── */
.ws-dossier-head__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.sw-link-word-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
  color: var(--color-muted, #888);
  transition: color 0.15s, background 0.15s;
}
.sw-link-word-btn:hover { color: var(--color-primary, #8b4513); background: var(--color-hover, #c8a96e15); }
.sw-depth-toggle {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-bottom: 0;
}
.sw-depth-label { font-size: 0.78rem; color: var(--color-muted, #888); margin-right: 0.15rem; }
.sw-depth-btn {
  padding: 0.15rem 0.5rem;
  border: 1px solid var(--color-border, #c8a96e60);
  border-radius: 3px;
  background: none;
  cursor: pointer;
  font-size: 0.75rem;
  color: var(--color-text);
  transition: background 0.1s;
}
.sw-depth-btn:hover { background: var(--color-hover, #c8a96e15); }
.sw-depth-btn--active { background: var(--color-primary, #8b4513); color: #fff; border-color: var(--color-primary, #8b4513); }

/* ── SW-A: Translation-mode visibility ───────────────────────────── */
/* Translator-only sections hidden by default (study mode) */
.sw-trans-section { display: none; }
/* Show when dossier has sw-trans-on class (translation mode active) */
#ws-dossier.sw-trans-on .sw-trans-section { display: block; }

/* ── SW-A: Depth-based section visibility ────────────────────────── */
/* Sections with data-depth-min > current depth are hidden */
.ws-page.sw-depth-1 [data-depth-min="2"],
.ws-page.sw-depth-1 [data-depth-min="3"],
.ws-page.sw-depth-2 [data-depth-min="3"] { display: none; }

/* ── SW-A: Trans-mode toggle button state ────────────────────────── */
#sw-trans-toggle-btn[aria-pressed="true"] {
  background: var(--color-primary, #8b4513);
  color: #fff;
  border-color: var(--color-primary, #8b4513);
}

/* ── SW-B: Particle color tokens ─────────────────────────────────── */
:root {
  --sw-p-ground:    #b07d1a;   /* amber   — because/reason        */
  --sw-p-inference: #2868c0;   /* blue    — therefore/thus        */
  --sw-p-contrast:  #c03820;   /* rust    — but/however/only      */
  --sw-p-continue:  #5b7a8a;   /* slate   — and/also/still        */
  --sw-p-purpose:   #7040a8;   /* violet  — in order that         */
  --sw-p-result:    #1a8060;   /* teal    — so that/result        */
  --sw-p-condition: #7a7010;   /* olive   — if / whenever         */
  --sw-p-cause:     #a04018;   /* sienna  — because/causal        */
  --sw-p-negation:  #b01030;   /* crimson — not / never           */
  --sw-p-immediacy: #c07010;   /* gold    — behold / look         */
  --sw-p-focus:     #6030a0;   /* purple  — indeed / even / surely*/
}

/* ── SW-B: Particle tile annotation ──────────────────────────────── */
/* Colored left-border signals discourse function at a glance */
.sw-ptile[class*="sw-particle--"] {
  border-left: 3px solid;
  padding-left: 5px;
}
.sw-ptile__badge {
  display: block;
  font-size: .58rem;
  font-weight: 700;
  letter-spacing: .03em;
  text-transform: uppercase;
  opacity: .75;
  line-height: 1;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 6rem;
}

/* Particle color classes — applied to .sw-ptile */
.sw-particle--ground            { border-color: var(--sw-p-ground);    color: var(--sw-p-ground);    }
.sw-particle--inference         { border-color: var(--sw-p-inference); color: var(--sw-p-inference); }
.sw-particle--contrast          { border-color: var(--sw-p-contrast);  color: var(--sw-p-contrast);  }
.sw-particle--strong-contrast   { border-color: var(--sw-p-contrast);  color: var(--sw-p-contrast);  }
.sw-particle--adversative       { border-color: var(--sw-p-contrast);  color: var(--sw-p-contrast);  }
.sw-particle--limitation        { border-color: var(--sw-p-contrast);  color: var(--sw-p-contrast);  }
.sw-particle--limitation-assurance { border-color: var(--sw-p-contrast); color: var(--sw-p-contrast); }
.sw-particle--exception-contrast { border-color: var(--sw-p-contrast); color: var(--sw-p-contrast); }
.sw-particle--continue          { border-color: var(--sw-p-continue);  color: var(--sw-p-continue);  }
.sw-particle--additive          { border-color: var(--sw-p-continue);  color: var(--sw-p-continue);  }
.sw-particle--additive-temporal { border-color: var(--sw-p-continue);  color: var(--sw-p-continue);  }
.sw-particle--additive-intensifier { border-color: var(--sw-p-continue); color: var(--sw-p-continue); }
.sw-particle--temporal-transition { border-color: var(--sw-p-continue); color: var(--sw-p-continue); }
.sw-particle--contrast-setup    { border-color: var(--sw-p-continue);  color: var(--sw-p-continue);  }
.sw-particle--relative          { border-color: var(--sw-p-continue);  color: var(--sw-p-continue);  }
.sw-particle--entreaty          { border-color: var(--sw-p-continue);  color: var(--sw-p-continue);  }
.sw-particle--purpose           { border-color: var(--sw-p-purpose);   color: var(--sw-p-purpose);   }
.sw-particle--result            { border-color: var(--sw-p-result);    color: var(--sw-p-result);    }
.sw-particle--manner-result     { border-color: var(--sw-p-result);    color: var(--sw-p-result);    }
.sw-particle--condition         { border-color: var(--sw-p-condition); color: var(--sw-p-condition); }
.sw-particle--condition-possible { border-color: var(--sw-p-condition); color: var(--sw-p-condition); }
.sw-particle--cause             { border-color: var(--sw-p-cause);     color: var(--sw-p-cause);     }
.sw-particle--causal-or-means   { border-color: var(--sw-p-cause);     color: var(--sw-p-cause);     }
.sw-particle--content-or-cause  { border-color: var(--sw-p-cause);     color: var(--sw-p-cause);     }
.sw-particle--negation          { border-color: var(--sw-p-negation);  color: var(--sw-p-negation);  }
.sw-particle--negation-fact     { border-color: var(--sw-p-negation);  color: var(--sw-p-negation);  }
.sw-particle--negation-process  { border-color: var(--sw-p-negation);  color: var(--sw-p-negation);  }
.sw-particle--negation-prohibition { border-color: var(--sw-p-negation); color: var(--sw-p-negation); }
.sw-particle--immediacy         { border-color: var(--sw-p-immediacy); color: var(--sw-p-immediacy); }
.sw-particle--focus             { border-color: var(--sw-p-focus);     color: var(--sw-p-focus);     }

/* ── SW-B: Discourse marker toggle above tiles ───────────────────── */
.sw-markers-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.5rem;
  background: var(--color-surface, #faf6ef);
  border-bottom: 1px solid var(--color-border, #c8a96e40);
  font-size: .75rem;
  flex-wrap: wrap;
}
.sw-markers-bar__label { color: var(--color-muted, #888); font-style: italic; }
.sw-marker-legend {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  padding: .1rem .35rem;
  border-radius: 3px;
  border-left: 3px solid;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.sw-marker-legend--ground     { border-color: var(--sw-p-ground);    color: var(--sw-p-ground);    }
.sw-marker-legend--inference  { border-color: var(--sw-p-inference); color: var(--sw-p-inference); }
.sw-marker-legend--contrast   { border-color: var(--sw-p-contrast);  color: var(--sw-p-contrast);  }
.sw-marker-legend--continue   { border-color: var(--sw-p-continue);  color: var(--sw-p-continue);  }
.sw-marker-legend--purpose    { border-color: var(--sw-p-purpose);   color: var(--sw-p-purpose);   }
.sw-marker-legend--result     { border-color: var(--sw-p-result);    color: var(--sw-p-result);    }
.sw-marker-legend--condition  { border-color: var(--sw-p-condition); color: var(--sw-p-condition); }
.sw-marker-legend--negation   { border-color: var(--sw-p-negation);  color: var(--sw-p-negation);  }
.sw-marker-legend--cause      { border-color: var(--sw-p-cause);     color: var(--sw-p-cause);     }

/* ── SW-B: Grammar Significance dossier section ─────────────────── */
.sw-grammar-section {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: var(--color-surface, #faf6ef);
  border: 1px solid var(--color-border, #c8a96e30);
  border-radius: 6px;
}
.sw-grammar-section__title {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--color-muted, #888);
  margin-bottom: 0.5rem;
}

/* Particle function card — shown when selected word is a discourse particle */
.sw-particle-card {
  padding: 0.6rem 0.75rem;
  border-left: 4px solid;
  border-radius: 0 4px 4px 0;
  margin-bottom: 0.5rem;
  background: color-mix(in srgb, currentColor 6%, transparent);
}
.sw-particle-card__fn {
  font-size: .8rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.sw-particle-card__word {
  font-size: 1.2rem;
  font-family: 'Noto Serif', serif;
  margin-right: 0.35rem;
}
.sw-particle-card__plain {
  font-size: .82rem;
  line-height: 1.55;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}
.sw-particle-card__example {
  font-size: .78rem;
  color: var(--color-muted, #888);
  border-top: 1px solid var(--color-border, #c8a96e30);
  padding-top: 0.35rem;
  margin-top: 0.35rem;
}
.sw-particle-card__example-ref {
  font-weight: 600;
  color: var(--color-primary, #8b4513);
  margin-right: 0.25rem;
}

/* Morphology hint rows — shown for verbs, nouns, etc. */
.sw-morph-hints { margin-top: 0.4rem; }
.sw-morph-hint {
  padding: 0.4rem 0.5rem;
  border-left: 3px solid var(--color-border, #c8a96e60);
  margin-bottom: 0.4rem;
  font-size: .8rem;
}
.sw-morph-hint__label {
  font-weight: 700;
  font-size: .72rem;
  letter-spacing: .03em;
  color: var(--color-primary, #8b4513);
  margin-bottom: .15rem;
}
.sw-morph-hint__sig { line-height: 1.5; }
.sw-morph-hint__debate {
  margin-top: .3rem;
  font-size: .75rem;
  color: var(--color-muted, #888);
  font-style: italic;
  border-top: 1px dashed var(--color-border, #c8a96e40);
  padding-top: .25rem;
}
.sw-morph-hint__examples {
  margin-top: .3rem;
  padding-left: 1rem;
  font-size: .74rem;
  color: var(--color-muted, #777);
}
.sw-morph-hint__examples li { margin-bottom: .1rem; }

/* ── SW-C: Contested Interpretation / Grammar Debates ────────────── */
.sw-debates-section { margin-bottom: 0.5rem; }

.sw-debate-card {
  border: 1px solid var(--color-border, #c8a96e40);
  border-left: 4px solid #c03820;
  border-radius: 0 5px 5px 0;
  margin-bottom: 0.75rem;
  background: var(--color-surface, #faf6ef);
  overflow: hidden;
}

.sw-debate-card__header {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  padding: 0.55rem 0.65rem 0.35rem;
  background: #c0382010;
  border-bottom: 1px solid var(--color-border, #c8a96e30);
  flex-wrap: wrap;
}
.sw-debate-card__icon { font-size: .95rem; flex-shrink: 0; margin-top: .05rem; }
.sw-debate-card__title { font-weight: 700; font-size: .84rem; flex: 1; min-width: 0; }

.sw-debate-status {
  font-size: .64rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .15rem .4rem;
  border-radius: 3px;
  white-space: nowrap;
}
.sw-debate-status--major    { background: #c038201a; color: #c03820; }
.sw-debate-status--moderate { background: #b07d1a1a; color: #b07d1a; }
.sw-debate-status--settled  { background: #1a80601a; color: #1a8060; }

.sw-debate-card__construction {
  padding: 0.25rem 0.65rem;
  font-size: .75rem;
  color: var(--color-muted, #888);
  border-bottom: 1px solid var(--color-border, #c8a96e20);
}
.sw-debate-card__triggers {
  padding: 0.2rem 0.65rem;
  font-size: .73rem;
  color: var(--color-primary, #8b4513);
  background: var(--color-primary, #8b4513)0f;
  border-bottom: 1px solid var(--color-border, #c8a96e20);
}
.sw-debate-trigger-ref {
  font-weight: 600;
  margin: 0 .15rem;
  padding: .05rem .25rem;
  background: var(--color-primary, #8b4513)18;
  border-radius: 3px;
}

.sw-debate-positions {
  display: grid;
  gap: 0;
}
.sw-debate-position {
  padding: 0.5rem 0.65rem;
  border-bottom: 1px solid var(--color-border, #c8a96e25);
}
.sw-debate-position:last-child { border-bottom: none; }

.sw-debate-position__header {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-bottom: 0.2rem;
}
.sw-debate-position__letter {
  width: 1.2rem;
  height: 1.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary, #8b4513);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}
.sw-debate-position__label {
  font-weight: 600;
  font-size: .8rem;
  color: var(--color-heading, #2a1a0e);
}
.sw-debate-position__rendering {
  font-size: .8rem;
  font-style: italic;
  color: var(--color-primary, #8b4513);
  margin-bottom: 0.25rem;
  padding-left: 1.55rem;
}
.sw-debate-position__arg {
  font-size: .78rem;
  line-height: 1.55;
  color: var(--color-text);
  margin: 0 0 0.3rem;
  padding-left: 1.55rem;
}
.sw-debate-position__proponents {
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
  padding-left: 1.55rem;
}
.sw-proponent-chip {
  font-size: .64rem;
  font-weight: 600;
  padding: .1rem .35rem;
  background: var(--color-border, #c8a96e30);
  border-radius: 10px;
  color: var(--color-muted, #666);
  white-space: nowrap;
}

.sw-debate-card__why {
  padding: 0.45rem 0.65rem;
  font-size: .78rem;
  line-height: 1.5;
  background: #2868c008;
  border-top: 1px solid var(--color-border, #c8a96e30);
  color: var(--color-text);
}
.sw-debate-card__why strong { color: var(--color-primary, #8b4513); }

/* ── SW-D: Literary Analysis Tab ─────────────────────────────────── */
.sw-literary-tab {
  padding: 0.75rem 0.75rem 1rem;
  font-size: .82rem;
}

/* Genre badges */
.sw-genre-block {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: 0.5rem;
  align-items: center;
}
.sw-genre-badge {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: .2rem .55rem;
  border-radius: 4px;
  color: #fff;
}
.sw-genre-badge--narrative  { background: #7040a8; }
.sw-genre-badge--poetry     { background: #1a8060; }
.sw-genre-badge--prophecy   { background: #c03820; }
.sw-genre-badge--law        { background: #b07d1a; }
.sw-genre-badge--letter     { background: #2868c0; }
.sw-genre-badge--gospel     { background: #8b4513; }
.sw-genre-badge--sermon     { background: #5b7a8a; }
.sw-genre-badge--wisdom     { background: #6030a0; }
.sw-genre-sub-badge {
  font-size: .64rem;
  font-weight: 600;
  padding: .15rem .4rem;
  border-radius: 3px;
  background: var(--color-border, #c8a96e30);
  color: var(--color-muted, #666);
}
.sw-literary-note {
  margin: 0.4rem 0;
  line-height: 1.55;
  color: var(--color-text);
}
.sw-structure-note {
  margin: 0.3rem 0 0.6rem;
  line-height: 1.5;
  color: var(--color-muted, #666);
  font-size: .78rem;
}

/* Structure diagram blocks */
.sw-structure-block {
  margin: 0.75rem 0;
  border: 1px solid var(--color-border, #c8a96e40);
  border-radius: 6px;
  overflow: hidden;
}
.sw-structure-block__header {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .65rem;
  background: var(--color-surface, #faf6ef);
  border-bottom: 1px solid var(--color-border, #c8a96e30);
}
.sw-structure-icon {
  font-size: .9rem;
  opacity: .75;
  flex-shrink: 0;
}
.sw-structure-label {
  font-weight: 700;
  font-size: .82rem;
  flex: 1;
}
.sw-structure-type-badge {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: .1rem .35rem;
  border-radius: 3px;
  background: var(--color-primary, #8b4513)18;
  color: var(--color-primary, #8b4513);
}
.sw-structure-note-detail {
  padding: .4rem .65rem;
  font-size: .77rem;
  line-height: 1.5;
  color: var(--color-muted, #666);
  border-bottom: 1px solid var(--color-border, #c8a96e20);
  margin: 0;
  font-style: italic;
}

/* Element rows */
.sw-structure-elements { padding: .15rem 0; }
.sw-structure-el {
  display: grid;
  grid-template-columns: 2.2rem 4.5rem 1fr;
  align-items: baseline;
  gap: .3rem;
  padding: .25rem .65rem;
  border-bottom: 1px solid var(--color-border, #c8a96e15);
  font-size: .77rem;
}
.sw-structure-el:last-child { border-bottom: none; }
.sw-structure-el--center {
  background: var(--color-primary, #8b4513)0d;
  border-left: 3px solid var(--color-primary, #8b4513);
  font-weight: 600;
}
.sw-structure-el__id {
  font-family: monospace;
  font-size: .75rem;
  font-weight: 700;
  color: var(--color-primary, #8b4513);
  text-align: center;
}
.sw-structure-el__ref {
  font-size: .72rem;
  color: var(--color-muted, #888);
  font-style: italic;
  white-space: nowrap;
}
.sw-structure-el__label { line-height: 1.4; }

/* ── SW-E: Idiom System ──────────────────────────────────────────────────── */

/* Passage-level collapsible idioms panel (above tiles) */
.sw-idiom-panel {
  margin: 0 0 .6rem;
  border: 1px solid var(--color-primary, #8b4513);
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-primary, #8b4513)08;
}
.sw-idiom-panel__summary {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-primary, #8b4513);
  list-style: none;
  user-select: none;
}
.sw-idiom-panel__summary::-webkit-details-marker { display: none; }
.sw-idiom-panel__summary::before {
  content: '▶';
  font-size: .65rem;
  transition: transform .15s;
}
.sw-idiom-panel[open] .sw-idiom-panel__summary::before { transform: rotate(90deg); }
.sw-idiom-panel__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.4em;
  height: 1.4em;
  padding: 0 .35em;
  border-radius: 10px;
  background: var(--color-primary, #8b4513);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
}
.sw-idiom-panel__body {
  padding: .4rem .75rem .6rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  border-top: 1px solid var(--color-primary, #8b4513)30;
}
.sw-idiom-panel__item {
  padding: .4rem .6rem;
  border-left: 3px solid var(--color-primary, #8b4513);
  background: #fff8f4;
  border-radius: 0 4px 4px 0;
}
.sw-idiom-panel__item-phrase {
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-fg, #1a1209);
  margin-bottom: .2rem;
}
.sw-idiom-panel__item-plain {
  font-size: .77rem;
  color: var(--color-muted, #888);
  line-height: 1.4;
}

/* Dossier Idiom Alert section */
.sw-idiom-alert-section { margin-top: .5rem; }
.sw-idiom-alert-card {
  border-left: 4px solid var(--color-primary, #8b4513);
  background: var(--color-primary, #8b4513)07;
  border-radius: 0 6px 6px 0;
  padding: .6rem .8rem;
  margin-bottom: .5rem;
}
.sw-idiom-alert-card__phrase {
  font-size: .88rem;
  font-weight: 700;
  color: var(--color-primary, #8b4513);
  margin-bottom: .3rem;
}
.sw-idiom-alert-card__plain {
  font-size: .82rem;
  color: var(--color-fg, #1a1209);
  line-height: 1.5;
  margin-bottom: .3rem;
}
.sw-idiom-alert-card__refs {
  font-size: .73rem;
  color: var(--color-muted, #888);
  margin-top: .4rem;
}
.sw-idiom-alert-card__refs a.ref {
  color: var(--color-primary, #8b4513);
  text-decoration: none;
}
.sw-idiom-alert-card__refs a.ref:hover { text-decoration: underline; }

/* Expandable cultural details inside alert card */
.sw-idiom-details {
  margin-top: .35rem;
  font-size: .78rem;
}
.sw-idiom-details summary {
  cursor: pointer;
  color: var(--color-primary, #8b4513);
  font-size: .76rem;
  font-weight: 600;
  list-style: none;
}
.sw-idiom-details summary::-webkit-details-marker { display: none; }
.sw-idiom-details summary::before {
  content: '▶ ';
  font-size: .6rem;
}
.sw-idiom-details[open] summary::before { content: '▼ '; }
.sw-idiom-details__body {
  margin: .4rem 0 .2rem;
  padding-left: .6rem;
  border-left: 2px solid var(--color-primary, #8b4513)40;
  color: var(--color-fg, #1a1209);
  line-height: 1.55;
}
.sw-idiom-details__sig {
  margin: .3rem 0 0;
  padding-left: .6rem;
  border-left: 2px solid var(--color-primary, #8b4513)40;
  font-size: .76rem;
  color: var(--color-muted, #888);
  line-height: 1.4;
}

/* ── SW-F: Cultural Background Tab ──────────────────────────────────────── */

.sw-cultural-tab { padding: .5rem 0; }

/* Book context block */
.sw-cultural-book-ctx { margin-bottom: .8rem; }
.sw-cultural-book-ctx__hist {
  font-size: .82rem;
  line-height: 1.6;
  color: var(--color-fg, #1a1209);
  margin: .4rem 0 .5rem;
}
.sw-cultural-notes { display: flex; flex-direction: column; gap: .35rem; margin-top: .4rem; }
.sw-cultural-note {
  font-size: .79rem;
  line-height: 1.5;
  padding: .35rem .6rem;
  border-left: 3px solid var(--color-primary, #8b4513)60;
  background: var(--color-primary, #8b4513)06;
  border-radius: 0 4px 4px 0;
  color: var(--color-fg, #1a1209);
}

/* Framework accordion blocks */
.sw-framework-block {
  border: 1px solid var(--color-border, #c8a96e25);
  border-radius: 6px;
  margin-bottom: .45rem;
  overflow: hidden;
}
.sw-framework-block__summary {
  display: flex;
  align-items: center;
  padding: .5rem .75rem;
  cursor: pointer;
  font-size: .83rem;
  font-weight: 600;
  color: var(--color-fg, #1a1209);
  list-style: none;
  user-select: none;
  background: var(--color-primary, #8b4513)06;
}
.sw-framework-block__summary::-webkit-details-marker { display: none; }
.sw-framework-block__summary::before {
  content: '▶';
  font-size: .6rem;
  margin-right: .5rem;
  color: var(--color-primary, #8b4513);
  transition: transform .15s;
}
.sw-framework-block[open] .sw-framework-block__summary::before { transform: rotate(90deg); }
.sw-framework-block__body {
  padding: .5rem .75rem .65rem;
  border-top: 1px solid var(--color-border, #c8a96e25);
}
.sw-framework-block__summary-text {
  font-size: .80rem;
  line-height: 1.6;
  color: var(--color-fg, #1a1209);
  margin: 0 0 .4rem;
}
.sw-framework-block__reading {
  font-size: .79rem;
  line-height: 1.5;
  padding: .35rem .6rem;
  border-left: 3px solid #2868c0;
  background: #2868c008;
  border-radius: 0 4px 4px 0;
  margin: .4rem 0;
}
.sw-framework-block__concepts { margin-top: .5rem; display: flex; flex-direction: column; gap: .3rem; }
.sw-concept-row {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: .5rem;
  font-size: .78rem;
  padding: .25rem 0;
  border-bottom: 1px solid var(--color-border, #c8a96e15);
  align-items: baseline;
}
.sw-concept-row:last-child { border-bottom: none; }
.sw-concept-row__term { font-weight: 600; color: var(--color-primary, #8b4513); }
.sw-concept-row__def { line-height: 1.45; color: var(--color-fg, #1a1209); }
.sw-framework-block__passages {
  margin-top: .5rem;
  font-size: .73rem;
  color: var(--color-muted, #888);
}
.sw-framework-block__passages a.ref {
  color: var(--color-primary, #8b4513);
  text-decoration: none;
}
.sw-framework-block__passages a.ref:hover { text-decoration: underline; }

/* Symbols reference accordion */
.sw-symbols-ref {
  margin-top: .6rem;
  border: 1px solid var(--color-border, #c8a96e25);
  border-radius: 6px;
  overflow: hidden;
}
.sw-symbols-ref__summary {
  display: flex;
  align-items: center;
  padding: .45rem .75rem;
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  color: var(--color-muted, #888);
  list-style: none;
  user-select: none;
}
.sw-symbols-ref__summary::-webkit-details-marker { display: none; }
.sw-symbols-ref__summary::before {
  content: '▶ ';
  font-size: .6rem;
  color: var(--color-muted, #888);
}
.sw-symbols-ref[open] .sw-symbols-ref__summary::before { content: '▼ '; }
.sw-symbols-ref__body {
  border-top: 1px solid var(--color-border, #c8a96e15);
  padding: .4rem .75rem .6rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
}
.sw-symbol-cat { }
.sw-symbol-cat__label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-muted, #888);
  margin-bottom: .3rem;
  padding-bottom: .15rem;
  border-bottom: 1px solid var(--color-border, #c8a96e20);
}
.sw-symbol-row {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: .4rem;
  padding: .2rem 0;
  border-bottom: 1px solid var(--color-border, #c8a96e10);
  align-items: baseline;
  font-size: .77rem;
}
.sw-symbol-row:last-child { border-bottom: none; }
.sw-symbol-row__sym {
  font-weight: 700;
  color: var(--color-primary, #8b4513);
  text-align: center;
}
.sw-symbol-row__info { display: flex; flex-direction: column; gap: .1rem; }
.sw-symbol-row__meaning { font-weight: 600; color: var(--color-fg, #1a1209); line-height: 1.35; }
.sw-symbol-row__note { font-size: .72rem; color: var(--color-muted, #888); line-height: 1.4; }

/* ── SW-G: First-load Depth Chooser Prompt ───────────────────────────────── */

.sw-depth-prompt {
  margin: .75rem;
  padding: 1.1rem 1.25rem 1.25rem;
  border: 2px solid var(--color-primary, #8b4513);
  border-radius: 10px;
  background: var(--color-primary, #8b4513)06;
  max-width: 680px;
}
.sw-depth-prompt__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary, #8b4513);
  margin-bottom: .25rem;
}
.sw-depth-prompt__sub {
  font-size: .78rem;
  color: var(--color-muted, #888);
  margin: 0 0 .9rem;
}
.sw-depth-prompt__choices {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.sw-depth-prompt__btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .2rem;
  padding: .65rem .9rem;
  border: 1px solid var(--color-border, #c8a96e40);
  border-radius: 7px;
  background: var(--color-bg, #fff8f4);
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, background .12s;
  width: 100%;
}
.sw-depth-prompt__btn:hover {
  border-color: var(--color-primary, #8b4513);
  background: var(--color-primary, #8b4513)0d;
}
.sw-depth-prompt__btn--rec {
  border-color: var(--color-primary, #8b4513);
  background: var(--color-primary, #8b4513)08;
}
.sw-depth-prompt__btn-label {
  font-size: .9rem;
  font-weight: 700;
  color: var(--color-fg, #1a1209);
  display: flex;
  align-items: center;
  gap: .45rem;
}
.sw-depth-prompt__rec {
  font-size: .66rem;
  font-weight: 700;
  padding: .1em .45em;
  border-radius: 8px;
  background: var(--color-primary, #8b4513);
  color: #fff;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sw-depth-prompt__btn-desc {
  font-size: .76rem;
  color: var(--color-muted, #888);
  line-height: 1.4;
}

/* ── SW-O: "What to notice here" passage banner ─────────────────────────── */

.sw-notice-banner {
  margin: 0 0 .6rem;
  border: 1px solid #2868c040;
  border-radius: 6px;
  background: #2868c006;
  overflow: hidden;
}
.sw-notice-banner__summary {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .45rem .75rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
  font-size: .8rem;
}
.sw-notice-banner__summary::-webkit-details-marker { display: none; }
.sw-notice-banner__icon { font-size: .9rem; }
.sw-notice-banner__title {
  font-weight: 600;
  color: #2868c0;
  flex: 1;
}
.sw-notice-banner__count {
  font-size: .72rem;
  color: var(--color-muted, #888);
  padding: .1em .5em;
  border-radius: 8px;
  background: #2868c015;
}
.sw-notice-banner__list {
  list-style: none;
  margin: 0;
  padding: .3rem .75rem .55rem;
  border-top: 1px solid #2868c020;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.sw-notice-banner__item {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  font-size: .79rem;
}
.sw-notice-banner__item-icon { font-size: .85rem; flex-shrink: 0; line-height: 1.5; }
.sw-notice-banner__item-body { display: flex; flex-direction: column; gap: .05rem; }
.sw-notice-banner__item-label {
  font-weight: 600;
  color: var(--color-fg, #1a1209);
  line-height: 1.4;
}
.sw-notice-banner__item-detail {
  font-size: .74rem;
  color: var(--color-muted, #888);
  line-height: 1.3;
}

/* ── SW-N: Passage Notes ─────────────────────────────────────────────────── */

.sw-passage-notes {
  margin: .6rem 0 0;
  border: 1px solid var(--color-border, #c8a96e30);
  border-radius: 6px;
  overflow: hidden;
  background: var(--color-bg, #fff8f4);
}
.sw-passage-notes__summary {
  padding: .4rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  color: var(--color-muted, #888);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.sw-passage-notes__summary::-webkit-details-marker { display: none; }
.sw-passage-notes__ta {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: .5rem .75rem;
  border: none;
  border-top: 1px solid var(--color-border, #c8a96e20);
  background: transparent;
  font-family: inherit;
  font-size: .82rem;
  color: var(--color-fg, #1a1209);
  line-height: 1.5;
  resize: vertical;
  outline: none;
}
.sw-passage-notes__ta:focus {
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--color-primary, #8b4513)30;
}

/* ── SW-H: Word Family (cognate roots) ──────────────────────── */
.sw-cognate-section { margin-top: .5rem; }
.sw-cognate-root-callout {
  display: inline-flex;
  align-items: baseline;
  gap: .35rem;
  padding: .35rem .7rem;
  margin-bottom: .55rem;
  background: var(--color-primary, #8b4513)0d;
  border-left: 3px solid var(--color-primary, #8b4513);
  border-radius: 0 5px 5px 0;
  font-size: .82rem;
}
.sw-cognate-root-callout__lemma {
  font-family: var(--font-hebrew, serif);
  font-size: 1rem;
  color: var(--color-primary, #8b4513);
  direction: rtl;
}
.sw-cognate-root-callout__translit {
  font-style: italic;
  color: var(--color-muted, #888);
  font-size: .79rem;
}
.sw-cognate-root-callout__dash { color: var(--color-muted, #888); }
.sw-cognate-root-callout__meaning {
  font-weight: 600;
  color: var(--color-fg, #1a1209);
}
.sw-cognate-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.sw-cognate-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: .3rem .55rem .25rem;
  border: 1px solid var(--color-border, #c8a96e40);
  border-radius: 6px;
  background: var(--color-bg-alt, #fdf6ea);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
  user-select: none;
}
.sw-cognate-chip:hover {
  border-color: var(--color-primary, #8b4513);
  box-shadow: 0 1px 4px var(--color-primary, #8b4513)20;
}
.sw-cognate-chip:focus-visible {
  outline: 2px solid var(--color-primary, #8b4513);
  outline-offset: 2px;
}
.sw-cognate-chip--active {
  border-color: var(--color-primary, #8b4513);
  background: var(--color-primary, #8b4513)0d;
  cursor: default;
  pointer-events: none;
}
.sw-cognate-chip--root .sw-cognate-chip__code::after {
  content: ' ✦';
  font-size: .65em;
  color: var(--color-primary, #8b4513);
}
.sw-cognate-chip__lemma {
  font-family: var(--font-hebrew, serif);
  font-size: .95rem;
  line-height: 1.2;
  direction: rtl;
}
/* Greek chips don't use RTL */
[data-code^="G"] .sw-cognate-chip__lemma {
  font-family: var(--font-greek, serif);
  direction: ltr;
}
.sw-cognate-chip__gloss {
  font-size: .67rem;
  color: var(--color-muted, #888);
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.1;
}
.sw-cognate-chip__code {
  font-size: .6rem;
  color: var(--color-muted, #888);
  font-family: monospace;
  margin-top: .1rem;
}

/* ── SW-K: OT-in-NT three-column compare ───────────────────── */
.sw-ot-in-nt-panel { padding: .25rem 0; }
.sw-ot-block {
  margin-bottom: 1.1rem;
  border: 1px solid var(--color-border, #c8a96e25);
  border-radius: 7px;
  overflow: hidden;
}
.sw-ot-block__header {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  padding: .4rem .75rem;
  background: var(--color-bg-alt, #fdf6ea);
  border-bottom: 1px solid var(--color-border, #c8a96e20);
  font-size: .8rem;
}
.sw-ot-block__refs { font-weight: 600; flex: 1; }
.sw-ot-block__marker {
  color: var(--color-muted, #888);
  font-style: italic;
  font-size: .76rem;
}
.sw-ot-type-badge {
  display: inline-block;
  padding: .15rem .45rem;
  border-radius: 4px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .01em;
}
.sw-nt-type--direct    { background: #e8f5e9; color: #2e7d32; }
.sw-nt-type--typology  { background: #fff3e0; color: #e65100; }
.sw-nt-type--both      { background: #f3e5f5; color: #6a1b9a; }
.sw-nt-type--apply     { background: #e3f2fd; color: #0d47a1; }

.sw-triple-compare {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
}
.sw-triple-col {
  padding: .5rem .65rem;
  border-right: 1px solid var(--color-border, #c8a96e20);
  min-width: 0;
}
.sw-triple-col:last-child { border-right: none; }
.sw-triple-col--nt { background: #2868c006; }
.sw-triple-col__header {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--color-muted, #888);
  margin-bottom: .25rem;
}
.sw-triple-col__text {
  font-size: .8rem;
  line-height: 1.55;
  color: var(--color-fg, #1a1209);
}
.sw-triple-col__text--heb {
  direction: rtl;
  font-family: var(--font-hebrew, serif);
  font-size: .9rem;
}

.sw-ot-diffs {
  padding: .4rem .65rem;
  border-top: 1px solid var(--color-border, #c8a96e20);
  background: #fff9c430;
}
.sw-diff-highlight {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  padding: .25rem 0;
  font-size: .78rem;
  border-left: 3px solid #f59f00;
  padding-left: .5rem;
  margin-bottom: .25rem;
}
.sw-diff-highlight__word {
  font-weight: 600;
  white-space: nowrap;
  color: #b45309;
}
.sw-diff-highlight__note { color: var(--color-fg, #1a1209); line-height: 1.4; }

.sw-ot-block__note {
  padding: .45rem .65rem;
  border-top: 1px solid var(--color-border, #c8a96e20);
  font-size: .79rem;
  line-height: 1.55;
  color: var(--color-fg, #1a1209);
  font-style: italic;
}

/* ── SW-L: Second Temple Context ───────────────────────────── */
.sw-st-section { margin-top: .5rem; }
.sw-st-card {
  margin-bottom: .7rem;
  padding: .6rem .75rem;
  border: 1px solid var(--color-border, #c8a96e25);
  border-radius: 7px;
  background: var(--color-bg-alt, #fdf6ea);
}
.sw-st-card__header {
  display: flex;
  align-items: baseline;
  gap: .4rem;
  flex-wrap: wrap;
  margin-bottom: .4rem;
}
.sw-st-source-chip {
  display: inline-block;
  padding: .15rem .55rem;
  background: #7c3aed18;
  color: #6d28d9;
  border-radius: 4px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.sw-st-work {
  font-size: .75rem;
  color: var(--color-muted, #888);
  font-style: italic;
  flex: 1;
}
.sw-st-date {
  font-size: .7rem;
  color: var(--color-muted, #888);
  white-space: nowrap;
}
.sw-st-context {
  font-size: .8rem;
  line-height: 1.6;
  color: var(--color-fg, #1a1209);
  margin: 0 0 .35rem;
}
.sw-st-significance {
  font-size: .8rem;
  line-height: 1.55;
  color: var(--color-fg, #1a1209);
  font-style: italic;
  border-left: 3px solid #7c3aed40;
  padding-left: .5rem;
  margin: 0 0 .35rem;
}
.sw-st-quote {
  margin: .25rem 0 0;
  padding: .35rem .6rem;
  border-left: 3px solid #7c3aed60;
  background: #7c3aed06;
  font-size: .77rem;
  font-style: italic;
  color: var(--color-muted, #888);
  line-height: 1.5;
}

/* ── SW-J: Author Frequency heat map ───────────────────────── */
.sw-author-freq-section { margin-top: .5rem; }
.sw-author-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.sw-author-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .15rem;
  min-width: 2.8rem;
  cursor: default;
}
.sw-author-cell--peak .sw-author-cell__label { color: var(--color-primary, #8b4513); font-weight: 700; }
.sw-author-cell__bar {
  width: 100%;
  height: .6rem;
  border-radius: 3px;
}
.sw-author-heat--1 { background: var(--color-primary, #8b4513)25; }
.sw-author-heat--2 { background: var(--color-primary, #8b4513)55; }
.sw-author-heat--3 { background: var(--color-primary, #8b4513)90; }
.sw-author-heat--4 { background: var(--color-primary, #8b4513); }
.sw-author-cell__label {
  font-size: .65rem;
  color: var(--color-muted, #888);
  white-space: nowrap;
}
.sw-author-cell__peak-badge {
  font-size: .6rem;
  color: var(--color-primary, #8b4513);
  line-height: 1;
}

/* ── SW-I: Semantic Neighborhood chips ─────────────────────── */
.sw-semantic-section { margin-top: .5rem; }
.sw-semantic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  margin-bottom: .35rem;
}
.sw-semantic-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: .25rem .5rem .2rem;
  border: 1px solid #2868c030;
  border-radius: 5px;
  background: #2868c006;
  cursor: pointer;
  transition: border-color .15s;
}
.sw-semantic-chip:hover {
  border-color: #2868c0;
  background: #2868c010;
}
.sw-semantic-chip:focus-visible {
  outline: 2px solid #2868c0;
  outline-offset: 2px;
}
.sw-semantic-chip__lemma {
  font-family: var(--font-hebrew, serif);
  font-size: .9rem;
  line-height: 1.2;
  direction: rtl;
}
[data-code^="G"] .sw-semantic-chip__lemma {
  font-family: var(--font-greek, serif);
  direction: ltr;
}
.sw-semantic-chip__gloss {
  font-size: .65rem;
  color: var(--color-muted, #888);
  max-width: 6rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sw-semantic-chip__code {
  font-size: .58rem;
  color: var(--color-muted, #888);
  font-family: monospace;
}
.sw-semantic-note {
  font-size: .72rem;
  color: var(--color-muted, #888);
  font-style: italic;
  margin: 0;
}

/* ── SW-M: Synthesis Tab ──────────────────────────────────────── */
.sw-synthesis-tab {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.sw-synthesis-pericope {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #ddd);
  border-radius: 8px;
  overflow: hidden;
}
.sw-synthesis-header {
  padding: .75rem 1rem .5rem;
  background: var(--color-primary, #3b6ba5);
  color: #fff;
}
.sw-synthesis-ref {
  font-size: .7rem;
  font-family: monospace;
  opacity: .8;
  letter-spacing: .04em;
  margin-bottom: .15rem;
}
.sw-synthesis-label {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}
.sw-synthesis-section {
  padding: .7rem 1rem;
  border-top: 1px solid var(--color-border, #eee);
}
.sw-synthesis-section-title {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-primary, #3b6ba5);
  margin-bottom: .4rem;
}
.sw-synthesis-literary {
  font-size: .82rem;
  line-height: 1.55;
  color: var(--color-text, #333);
  margin: 0;
}
/* Key terms list */
.sw-synthesis-kterm-list {
  display: flex;
  flex-direction: column;
  gap: .45rem;
}
.sw-synthesis-kterm {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
}
.sw-synthesis-kterm-chip {
  flex-shrink: 0;
  padding: .18rem .45rem;
  border-radius: 4px;
  border: 1px solid var(--color-primary, #3b6ba5);
  background: transparent;
  color: var(--color-primary, #3b6ba5);
  font-size: .7rem;
  font-family: monospace;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.sw-synthesis-kterm-chip:hover {
  background: var(--color-primary, #3b6ba5);
  color: #fff;
}
.sw-synthesis-kterm-note {
  font-size: .8rem;
  line-height: 1.5;
  color: var(--color-text, #333);
}
/* Synthesis body */
.sw-synthesis-main {
  background: var(--color-surface-alt, #f9f9f9);
}
.sw-synthesis-body {
  font-size: .85rem;
  line-height: 1.65;
  color: var(--color-text, #333);
  margin: 0;
}
/* Cultural notes */
.sw-synthesis-note {
  font-size: .8rem;
  line-height: 1.5;
  color: var(--color-text, #444);
  margin: 0 0 .4rem;
}
.sw-synthesis-note:last-child { margin-bottom: 0; }
/* Intertextual connections */
.sw-synthesis-connections {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.sw-synthesis-conn {
  font-size: .8rem;
  line-height: 1.5;
  color: var(--color-text, #333);
}
/* Tradition map */
.sw-tradition-block { }
.sw-tradition-details {
  border-top: 1px solid var(--color-border, #eee);
  margin-top: .35rem;
}
.sw-tradition-details:first-of-type { border-top: none; margin-top: 0; }
.sw-tradition-era {
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  padding: .3rem 0;
  color: var(--color-primary, #3b6ba5);
  list-style: none;
}
.sw-tradition-era::marker, .sw-tradition-era::-webkit-details-marker { display: none; }
.sw-tradition-era::before { content: '▶ '; font-size: .65rem; }
details[open] > .sw-tradition-era::before { content: '▼ '; }
.sw-tradition-text {
  font-size: .8rem;
  line-height: 1.5;
  color: var(--color-text, #444);
  margin: .2rem 0 .4rem .8rem;
}
.sw-tradition-debates {
  margin: .2rem 0 .4rem .8rem;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.sw-tradition-debate {
  font-size: .8rem;
  line-height: 1.5;
  color: var(--color-text, #333);
}
.sw-tab-stub--loading {
  opacity: .6;
}

/* ── SW-N: Export Study Sheet (print layout) ───────────────── */
.sw-passage-actions {
  display: flex;
  justify-content: flex-end;
  padding: .35rem .5rem;
  border-top: 1px solid var(--color-border, #eee);
}
.sw-export-btn {
  padding: .25rem .65rem;
  border: 1px solid var(--color-primary, #3b6ba5);
  border-radius: 4px;
  background: transparent;
  color: var(--color-primary, #3b6ba5);
  font-size: .78rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sw-export-btn:hover {
  background: var(--color-primary, #3b6ba5);
  color: #fff;
}

/* Print sheet — hidden on screen, shown only in print */
#sw-print-sheet { display: none; }

@media print {
  /* Hide everything except the print sheet */
  body > *:not(#sw-print-sheet) { display: none !important; }
  #sw-print-sheet {
    display: block !important;
    padding: 1cm;
    font-family: Georgia, serif;
    font-size: 11pt;
    color: #000;
    background: #fff;
  }
  .swp-ref {
    font-size: 18pt;
    font-weight: bold;
    border-bottom: 2pt solid #333;
    margin-bottom: 0.5cm;
    padding-bottom: 0.2cm;
  }
  .swp-tiles { margin-bottom: 0.5cm; }
  .swp-dossier, .swp-synthesis, .swp-notes {
    margin-top: 0.5cm;
    page-break-inside: avoid;
  }
  .swp-dossier h3, .swp-synthesis h3, .swp-notes h3 {
    font-size: 13pt;
    border-bottom: 1pt solid #aaa;
    margin-bottom: 0.2cm;
  }
  /* Hide dossier edit controls in print */
  [data-action], .ws-add-contextual-btn, .ws-remove-override-btn,
  .ws-bookdef-input, .sw-link-word-btn, .ws-dossier-head__actions { display: none !important; }
  /* Simplify tile display for print */
  .sw-ptile { display: inline-block; margin: 2pt; border: 1pt solid #ccc; padding: 2pt 4pt; }
}

/* User synthesis notes textarea (SW-N) */
.sw-synthesis-user-notes {
  padding: .7rem 1rem;
  border-top: 2px solid var(--color-primary, #3b6ba5);
  background: var(--color-surface-alt, #f9f9f9);
  margin-top: .5rem;
}
.sw-synthesis-notes-ta {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--color-border, #ddd);
  border-radius: 4px;
  padding: .45rem .6rem;
  font-size: .82rem;
  font-family: inherit;
  resize: vertical;
  line-height: 1.5;
  color: var(--color-text, #333);
  background: var(--color-surface, #fff);
}
.sw-synthesis-notes-ta:focus {
  outline: none;
  border-color: var(--color-primary, #3b6ba5);
}

/* ── SW-N: Vocabulary Flashcard Mode ─────────────────────────── */
.sw-fc-due-badge {
  display: inline-block;
  background: #e53;
  color: #fff;
  border-radius: 9px;
  padding: 0 5px;
  font-size: .65rem;
  font-weight: 700;
  min-width: 1.3em;
  text-align: center;
  margin-left: .25rem;
  vertical-align: middle;
}
.sw-add-deck-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  padding: 0.1rem 0.2rem;
  border-radius: 3px;
  color: var(--color-muted, #888);
  transition: color .15s;
}
.sw-add-deck-btn:hover { color: #c8a500; }

/* Flashcard view — overlays the study layout */
.sw-flashcard-view {
  position: absolute;
  inset: 0;
  top: var(--topbar-h, 48px);
  background: var(--color-bg, #f8f5f0);
  display: flex;
  flex-direction: column;
  z-index: 50;
  padding: 1rem;
  box-sizing: border-box;
}
.sw-fc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .75rem;
}
.sw-fc-deck-label { font-size: .82rem; color: var(--color-muted, #888); }
.sw-fc-progress-label { font-size: .82rem; color: var(--color-primary, #3b6ba5); margin-left: 1rem; }
.sw-fc-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sw-fc-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #ddd);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  width: min(480px, 100%);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}
.sw-fc-front, .sw-fc-back {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  width: 100%;
}
.sw-fc-word {
  font-size: 2.4rem;
  font-family: 'Cardo', 'SBL Hebrew', Georgia, serif;
  color: var(--color-primary, #3b6ba5);
  line-height: 1.2;
}
.sw-fc-word--back { font-size: 1.8rem; margin-bottom: .2rem; }
.sw-fc-translit {
  font-size: 1rem;
  color: var(--color-muted, #888);
  font-style: italic;
}
.sw-fc-reveal-btn {
  margin-top: .75rem;
  padding: .4rem 1.2rem;
  border: 1px solid var(--color-primary, #3b6ba5);
  border-radius: 20px;
  background: transparent;
  color: var(--color-primary, #3b6ba5);
  font-size: .88rem;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.sw-fc-reveal-btn:hover { background: var(--color-primary, #3b6ba5); color: #fff; }
.sw-fc-pos { font-size: .78rem; color: var(--color-muted, #888); }
.sw-fc-gloss { font-size: 1.1rem; font-weight: 600; color: var(--color-text, #333); }
.sw-fc-freq { font-size: .75rem; color: var(--color-muted, #888); }
.sw-fc-samples {
  width: 100%;
  text-align: left;
  font-size: .78rem;
  color: var(--color-text, #444);
  margin: .3rem 0;
}
.sw-fc-sample { margin-bottom: .25rem; }
.sw-fc-rating-row {
  display: flex;
  gap: .5rem;
  margin-top: .75rem;
  width: 100%;
  justify-content: center;
}
.sw-fc-rate-btn {
  flex: 1;
  max-width: 90px;
  padding: .4rem .2rem;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: .78rem;
  line-height: 1.3;
  font-weight: 600;
  transition: opacity .15s;
}
.sw-fc-rate-btn:hover { opacity: .85; }
.sw-fc-rate--again { background: #ffdddd; color: #b00; border-color: #f99; }
.sw-fc-rate--hard  { background: #fff3cc; color: #7a5800; border-color: #f0c050; }
.sw-fc-rate--good  { background: #d4edda; color: #155724; border-color: #8dc99a; }
.sw-fc-rate--easy  { background: #cce5ff; color: #004085; border-color: #80b7f0; }
/* Done screen */
.sw-fc-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  width: 100%;
}
.sw-fc-done-icon { font-size: 3rem; color: #28a745; }
.sw-fc-done-msg  { font-size: 1.15rem; font-weight: 600; color: var(--color-text, #333); }
.sw-fc-done-stats { font-size: .82rem; color: var(--color-muted, #888); }
.sw-fc-done-close { margin-top: .5rem; }
/* Footer keyboard hint */
.sw-fc-footer {
  text-align: center;
  padding-top: .5rem;
}
.sw-fc-hint { font-size: .72rem; color: var(--color-muted, #888); }
.sw-fc-hint kbd {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, #ccc);
  border-radius: 3px;
  padding: 0 3px;
  font-size: .68rem;
}

/* ── Commentary Tab ──────────────────────────────────────────────── */
.sw-comm-selector {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--color-border, #c8a96e20);
  background: var(--color-surface, #f5f0e8);
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}
.sw-comm-selector__label {
  font-size: 0.75rem; font-weight: 600; color: var(--color-text-muted, #888);
  text-transform: uppercase; letter-spacing: 0.05em;
}
.sw-comm-selector__sel {
  font-size: 0.82rem; border: 1px solid var(--color-border, #c8a96e30);
  border-radius: 4px; padding: 0.2rem 0.4rem;
  background: var(--color-bg, #fff); color: var(--color-text, #2c2218);
  flex: 1; max-width: 220px;
}
.sw-comm-body { overflow-y: auto; padding: 0 0.75rem; }
.sw-comm-verse {
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border, #c8a96e15);
}
.sw-comm-verse__ref {
  font-size: 0.72rem; font-weight: 700; color: var(--color-primary, #c8a96e);
  margin-bottom: 0.25rem;
}
.sw-comm-verse__text {
  font-size: 0.88rem; line-height: 1.6; color: var(--color-text, #2c2218);
}
.sw-comm-verse__text p { margin: 0.3rem 0; }

/* ── SW-T5: Grammar tab ─────────────────────────────────────────────── */
.sw-grammar-verse { margin-bottom: 1rem; }
.sw-grammar-verse__ref {
  font-size: 0.72rem; font-weight: 600; color: var(--color-muted, #888); margin-bottom: 0.3rem;
}
.sw-grammar-table {
  width: 100%; border-collapse: collapse; font-size: 0.8rem;
}
.sw-grammar-table th {
  text-align: left; font-size: 0.7rem; color: var(--color-muted, #888);
  border-bottom: 1px solid var(--color-border, #c8a96e30); padding: 0.15rem 0.3rem;
}
.sw-grammar-table td { padding: 0.15rem 0.3rem; vertical-align: top; }
.sw-grammar-table tr:hover td { background: var(--color-hover, #c8a96e08); }
.sw-grammar-lemma {
  font-family: var(--font-greek, 'SBL Greek', Georgia, serif); font-size: 0.95rem;
}
.sw-grammar-gloss { color: var(--color-text, #2c2218); }
.sw-grammar-code { font-size: 0.7rem; color: var(--color-muted, #888); opacity: 0.7; }
.sw-grammar-particle { font-size: 0.72rem; padding: 0.05rem 0.35rem; border-radius: 3px; }
.sw-grammar-pos { font-size: 0.72rem; color: var(--color-muted, #888); font-style: italic; }
.sw-grammar-prose-section { margin-top: 1.25rem; border-top: 1px solid var(--color-border, #c8a96e30); padding-top: 0.75rem; }
.sw-grammar-prose { margin-bottom: 0.75rem; }
.sw-grammar-prose__ref {
  font-size: 0.72rem; font-weight: 600; color: var(--color-primary, #8b4513); margin-bottom: 0.35rem;
}
.sw-grammar-prose p { font-size: 0.87rem; line-height: 1.6; margin: 0.3rem 0; color: var(--color-text, #2c2218); }
.sw-grammar-no-prose { font-size: 0.8rem; font-style: italic; color: var(--color-muted, #888); margin-top: 1rem; }

/* ── SW-U5: Compact dossier "Full Word Study →" link ──────────────── */
.sw-dossier-full-link {
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border, #c8a96e20);
  text-align: center;
}
.sw-open-word-study-btn {
  font-size: 0.78rem;
  padding: 0.3rem 0.75rem;
}

/* ── Tile Hover Tooltip ────────────────────────────────────────────── */
.sw-tile-tooltip {
  position: fixed;
  z-index: 9999;
  background: var(--color-bg, #fff8f0);
  border: 1px solid var(--color-border, #d4c5a9);
  border-radius: 6px;
  padding: 0.3rem 0.65rem;
  box-shadow: 0 3px 12px rgba(0,0,0,0.15);
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  max-width: 220px;
}
.sw-tile-tooltip__lemma {
  font-family: 'Noto Serif', serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text, #2c2218);
}
.sw-tile-tooltip__gloss {
  font-size: 0.75rem;
  color: var(--color-text-muted, #7a6a4a);
  font-style: italic;
}
[hidden] { display: none !important; }

/* ── Cross-References Tab ─────────────────────────────────────────── */
.sw-xref-tab { padding: 0.25rem 0; }
.sw-xref-verse { margin-bottom: 1.1rem; }
.sw-xref-verse__ref {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--color-primary, #c8a96e);
  margin-bottom: 0.4rem;
}
.sw-xref-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.sw-xref-chip {
  display: inline-block; padding: 0.18rem 0.55rem;
  font-size: 0.78rem; font-family: var(--font-mono, 'Noto Serif', serif);
  border: 1px solid var(--color-border, #d4c5a9);
  border-radius: 3px; cursor: pointer;
  color: var(--color-text-muted, #7a6a4a);
  background: var(--color-surface, #faf8f5);
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  user-select: none;
}
.sw-xref-chip:hover, .sw-xref-chip:focus {
  background: var(--color-primary, #c8a96e);
  color: #fff; border-color: var(--color-primary, #c8a96e);
  outline: none;
}
.sw-xref-chip--mid {
  border-color: var(--color-primary-muted, #b89a5c);
  color: var(--color-primary-dark, #8a6a2c);
}
.sw-xref-chip--hi {
  border-color: var(--color-primary, #c8a96e);
  color: var(--color-primary-dark, #8a6a2c);
  background: rgba(200,169,110,0.12);
  font-weight: 600;
}

/* ── SW-O: Mobile bottom-sheet elements (desktop: hidden) ────────── */
/* These are only meaningful inside the @media (max-width: 760px) block */
.sw-dossier-backdrop { display: none; }
.sw-dossier-handle   { display: none; }
