:root {
  --bg: linear-gradient(180deg, #f2ebdc 0%, #e8dfcc 42%, #ded2ba 100%);
  --card: rgba(255, 251, 241, 0.9);
  --card-strong: rgba(255, 253, 247, 0.96);
  --text: #33251a;
  --muted: #6f5b45;
  --line: rgba(116, 91, 62, 0.28);
  --blue: #725122;
  --blue-2: #8a6730;
  --cyan: #ad8a4f;
  --green: #49613e;
  --warn: #8a3e1e;
  --shadow: 0 10px 24px rgba(58, 41, 24, 0.14);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);

  color: var(--text);
  font: 16px/1.5 "Noto Serif", "Palatino Linotype", "Times New Roman", serif;
  position: relative;
  min-height: 100vh;
}

.bg-glow {
  position: fixed;
  pointer-events: none;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 999px;
  filter: blur(75px);
  opacity: .34;
}
.bg-glow-left { background: #c4ad78; top: -120px; left: -80px; }
.bg-glow-right { background: #9a7a48; top: 120px; right: -100px; }

.container { max-width: 1140px; margin: 0 auto; padding: 1.2rem; }
.site-main { padding-top: .8rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: .75rem;
}

.header-shell {
  padding-top: 0;
  padding-bottom: 0;
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  border: 1px solid var(--line);
  background: linear-gradient(130deg, rgba(254,249,239,.95), rgba(247,236,213,.86));
  border-radius: 18px;
  padding: .75rem .95rem;
  box-shadow: 0 10px 28px rgba(65, 46, 25, 0.2);
}

.site-brand {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .75rem;
}

.brand-mark {
  font-family: "Noto Serif", "Palatino Linotype", serif;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: .8rem;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #fff7e5;
  background: linear-gradient(135deg, #5f4421, #8b6732 55%, #b99759);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 14px rgba(91, 66, 32, .35);
}

.brand-copy { display: grid; gap: .05rem; }
.brand-copy strong { font-size: 1.08rem; letter-spacing: .03em; }
.brand-copy small { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; }

.site-nav {
  display: inline-flex;
  gap: .5rem;
  flex-wrap: nowrap;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: thin;
  padding: .2rem;
  border-radius: 999px;
  background: rgba(165, 132, 79, 0.14);
  border: 1px solid rgba(138, 103, 48, 0.35);
}

.nav-link {
  text-decoration: none;
  color: #3f2d1b;
  border-radius: 999px;
  padding: .42rem .9rem;
  font-weight: 700;
  font-size: .93rem;
  letter-spacing: .01em;
  transition: transform .2s ease, box-shadow .25s ease, background .25s ease, color .25s ease;
}

.nav-link:hover {
  background: rgba(255,255,255,.8);
  color: var(--blue-2);
  transform: translateY(-1px);
}

.nav-link.is-active {
  color: #fff8ea;
  background: linear-gradient(135deg, var(--blue), var(--blue-2) 60%, var(--cyan));
  box-shadow: 0 6px 14px rgba(94, 66, 31, 0.35);
}

h1, h2, h3 { line-height: 1.12; margin-top: 1.1rem; font-family: "Noto Serif", "Palatino Linotype", serif; }
h1 { font-size: clamp(2rem, 3vw, 2.65rem); letter-spacing: -.02em; }
code { background: #eef2ff; padding: .1rem .3rem; border-radius: 4px; }

.card {
  background: var(--card);
  border: 1px solid rgba(152, 121, 76, 0.35);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 1rem;
  margin: 0.7rem 0 1rem;

}

.hero {
  background: linear-gradient(140deg, var(--card-strong), rgba(248, 250, 252, 0.88));
  padding: 1.1rem 1.2rem;
}

.hero h1 { margin: 0; }
.kicker { margin: 0 0 .25rem; color: var(--blue); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .76rem; }
.lead { margin: .45rem 0 0; color: #334155; font-size: 1.13rem; max-width: 72ch; }

.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: .7rem; margin-bottom: 1rem; }
.stat-card {
  background: linear-gradient(180deg, #ffffff, #f8faff);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: .65rem .8rem;
  display: flex;
  flex-direction: column;
}
.stat-label { font-size: .78rem; color: var(--muted); }
.stat-card strong { font-size: 1.2rem; color: var(--blue-2); }

.field { margin-bottom: .75rem; }
.field label { display: block; margin-bottom: .35rem; }
input[type="text"], select, input[type="file"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: .56rem .7rem;
  background: rgba(255,255,255,.95);
  color: var(--text);
}
input[type="text"]:focus, select:focus {
  outline: 2px solid #c7d2fe;
  border-color: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .1);
}

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(220px, 1fr)); gap: .8rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(180px, 1fr)); gap: .8rem; }
@media (max-width: 900px) {
  .grid-2, .grid-3, .stats-grid { grid-template-columns: 1fr; }
}

.inline, .inline-group { display: inline-flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.inline-group { margin: .45rem 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: .5rem; }
.startup-actions { display: flex; align-items: end; }
.divider { text-align: center; color: var(--muted); font-size: .85rem; margin: .5rem 0 .8rem; }

.btn {
  border: 1px solid #b69871;
  border-radius: 11px;
  background: #fffaf0;
  color: #3a2b1d;
  padding: .58rem .9rem;
  cursor: pointer;
  font-weight: 700;
  transition: transform .2s ease, box-shadow .2s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 16px rgba(82, 58, 30, 0.2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff; border-color: transparent; }
.btn-success { background: linear-gradient(135deg, #0f766e, #14b8a6); color: #fff; border-color: transparent; }
.btn-warn { background: #fff7ed; color: var(--warn); border-color: #fed7aa; }

.help { color: var(--muted); font-size: .92rem; }
.status { background: #0f172a; color: #e2e8f0; border-radius: 10px; padding: .8rem; white-space: pre-wrap; overflow-x: auto; margin: 0; font-size: .9rem; }
.status.muted, .muted { color: var(--muted); background: transparent; padding: 0; }
.status.loading-note {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  color: #3f2d1b;
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.22);
  border-radius: 10px;
  padding: .55rem .7rem;
}
.loading-bar {
  width: 150px;
  height: 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, .35);
  overflow: hidden;
  position: relative;
}
.loading-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 44%;
  background: linear-gradient(90deg, #4f46e5, #06b6d4);
  border-radius: 999px;
  animation: loading-sweep 1.2s ease-in-out infinite;
}
@keyframes loading-sweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(260%); }
}

.collapsible-table details > summary {
  list-style: none;
  cursor: pointer;
  padding: .45rem .6rem;
  font-size: .86rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 9px;
  margin-bottom: .45rem;
  background: #fff;
}
.collapsible-table details > summary::-webkit-details-marker { display: none; }
.preview-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .45rem; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; max-height: 500px; background: #fff; }
table.preview { border-collapse: collapse; width: max-content; min-width: 100%; font-size: .9rem; }
table.preview th, table.preview td { border-bottom: 1px solid #eef2f7; padding: .38rem .5rem; text-align: left; }
table.preview th { position: sticky; top: 0; background: #f8fafc; z-index: 1; }
.small-muted { color: var(--muted); font-size: .85rem; }

.viz-wrap { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: .8rem; min-height: 160px; }
.viz-item { margin-bottom: .45rem; }
.viz-row { display: grid; grid-template-columns: minmax(180px, 360px) 1fr auto; gap: .55rem; align-items: center; }
.viz-label { color: #374151; font-size: .88rem; overflow: visible; white-space: normal; word-break: break-word; line-height: 1.25; }
.viz-bar { height: 12px; border-radius: 999px; background: linear-gradient(90deg, #4f46e5, #38bdf8); }
.viz-value { font-weight: 600; font-size: .85rem; }

.analysis-wrap { border: 1px solid var(--line); border-radius: 12px; background: #fff; padding: .8rem; min-height: 120px; margin-top: .7rem; }

.tab-row {
  display: inline-flex;
  gap: .45rem;
  margin: .2rem 0 .55rem;
  background: rgba(165, 132, 79, 0.14);
  border: 1px solid rgba(138, 103, 48, 0.35);
  border-radius: 999px;
  padding: .25rem;
}
.tab-btn {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #3f2d1b;
  font-weight: 700;
  padding: .42rem .9rem;
  cursor: pointer;
}
.tab-btn:hover { background: rgba(255,255,255,.85); color: var(--blue-2); }
.tab-btn.is-active {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--blue-2) 60%, var(--cyan));
  box-shadow: 0 8px 18px rgba(79, 70, 229, 0.32);
}
.panel-card { display: none; }
.panel-card.is-active { display: block; }
.analysis-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: .55rem; }
.analysis-card { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 10px; padding: .55rem; }
.analysis-card .label { color: var(--muted); font-size: .78rem; display: block; }
.analysis-card .value { font-weight: 700; color: #1e293b; }
.mini-table { width: 100%; border-collapse: collapse; margin-top: .55rem; font-size: .85rem; }
.mini-table th, .mini-table td { border-bottom: 1px solid #eef2f7; text-align: left; padding: .35rem; }
.mini-table th { background: #f8fafc; }

.viz-legend { margin-top: .7rem; border-top: 1px dashed #dbe5f0; padding-top: .55rem; }
.viz-legend h4 { margin: 0 0 .4rem; font-size: .86rem; color: #334155; }
.viz-dot { width: 10px; height: 10px; border-radius: 999px; background: #4f46e5; display: inline-block; margin-right: .5rem; }


.cluster-svg {
  width: 100%;
  height: auto;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

#clusterHeatmap .table-wrap {
  max-height: 420px;
}

#clusterFeatures td {
  vertical-align: top;
}


.zoomable { position: relative; }
.zoom-btn {
  position: absolute;
  top: .45rem;
  right: .45rem;
  z-index: 3;
  border: 1px solid #cbd5e1;
  background: rgba(255,255,255,.93);
  color: #3f2d1b;
  border-radius: 999px;
  font-weight: 700;
  font-size: .74rem;
  padding: .22rem .55rem;
  cursor: pointer;
}
.zoom-modal { position: fixed; inset: 0; display: none; z-index: 2000; }
.zoom-modal.open { display: block; }
.zoom-backdrop { position: absolute; inset: 0; background: rgba(15,23,42,.62); }
.zoom-dialog {
  position: absolute;
  inset: 4vh 4vw;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.zoom-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem .8rem;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
}
.zoom-body { padding: .75rem; overflow: auto; }
.zoom-body .cluster-svg { min-width: 980px; }


textarea.big-textarea {
  width: 100%;
  min-height: 170px;
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: .62rem .72rem;
  background: rgba(255,255,255,.96);
  color: var(--text);
  font: 15px/1.5 "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}
textarea.big-textarea:focus {
  outline: 2px solid #c7d2fe;
  border-color: #a5b4fc;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .1);
}

#syntaxPhrase {
  white-space: pre;
  overflow: auto;
}

#prosodyAlignment td,
#syntaxTable td {
  vertical-align: top;
}






.card h2 {
  display: flex;
  align-items: center;
  gap: .45rem;
}
.card h2::before {
  content: "";
  width: 8px;
  height: 24px;
  border-radius: 999px;
  background: linear-gradient(180deg, #4f46e5, #06b6d4);
}
.viz-wrap {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.analysis-wrap {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}


.hero {
  border: 1px solid rgba(79, 70, 229, 0.22);
  box-shadow: 0 20px 40px rgba(79, 70, 229, 0.12);
}
.analysis-card {
  background: linear-gradient(180deg, #ffffff, #f8fbff);
}
.viz-wrap h3 {
  margin-top: 0;
  padding-bottom: .35rem;
  border-bottom: 1px dashed #d8e3f2;
}
.table-wrap {
  background: linear-gradient(180deg, #ffffff, #fbfdff);
}

.load-progress {
  position: relative;
  height: 1.6rem;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  margin: .7rem 0 1rem;
}
.load-progress::after {
  content: "";
  position: absolute;
  top: 0;
  left: -40%;
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--blue-2), transparent);
  animation: load-progress-slide 1.1s ease-in-out infinite;
}
.load-progress > span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--muted);
}
@keyframes load-progress-slide {
  0%   { left: -40%; }
  100% { left: 100%; }
}


/* ============================================================================
 *  MOPSOS additions: info buttons, advanced toggles, pager, D3 tooltips
 * ========================================================================== */

/* Tab description + info button row under each hero */
.tab-desc { margin: .55rem 0 0; color: #4b3b29; font-size: 1.02rem; max-width: 78ch; }
.tab-meta-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .7rem; }

.info-btn {
  border: 1px solid var(--blue-2);
  background: rgba(138, 103, 48, 0.10);
  color: var(--blue);
  border-radius: 999px;
  padding: .3rem .8rem;
  font-weight: 700;
  font-size: .85rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.info-btn::before { content: "ⓘ"; font-size: .95rem; }
.info-btn:hover { background: rgba(138, 103, 48, 0.18); }
.info-btn.is-open { background: linear-gradient(135deg, var(--blue), var(--blue-2)); color: #fff8ea; border-color: transparent; }

.info-panel {
  margin-top: .7rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.7);
  padding: .85rem 1rem;
  color: #4b3b29;
  font-size: .95rem;
  line-height: 1.55;
}
.info-panel h4 { margin: .2rem 0 .35rem; font-size: 1rem; }
.info-panel ul { margin: .35rem 0 .2rem 1.1rem; padding: 0; }
.info-panel li { margin: .18rem 0; }
.info-panel code { background: #efe7d6; }

/* Advanced features toggle + panel */
.adv-toggle {
  border: 1px dashed var(--blue-2);
  background: transparent;
  color: var(--blue);
  border-radius: 11px;
  padding: .5rem .85rem;
  font-weight: 700;
  cursor: pointer;
}
.adv-toggle:hover { background: rgba(138, 103, 48, 0.10); }
.adv-panel {
  margin-top: .7rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(250, 246, 237, 0.6);
  padding: .85rem;
}

/* Pagination */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-bottom: .55rem;
  padding: .4rem .15rem;
}
.pager-info { color: var(--muted); font-size: .88rem; }
.pager-controls { display: inline-flex; flex-wrap: wrap; gap: .35rem; }
.btn-sm { padding: .32rem .6rem; font-size: .82rem; border-radius: 9px; }

/* Inline code chip used to show raw morphology codes next to human labels */
.code-chip {
  display: inline-block;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .72rem;
  color: var(--muted);
  background: #efe7d6;
  border-radius: 5px;
  padding: 0 .3rem;
  margin-left: .25rem;
}

/* D3 chart surface + shared tooltip */
.d3-svg { display: block; }
.d3-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 3000;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 8px;
  padding: .4rem .55rem;
  font-size: .82rem;
  line-height: 1.35;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .35);
  transition: opacity .12s ease;
  max-width: 280px;
}
.d3-tooltip strong { color: #fff; }

/* "What to view" selector row used on phonology / morphotactics */
.view-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .8rem;
  margin-bottom: .2rem;
}
.view-picker .field { margin-bottom: 0; flex: 1 1 240px; }

/* Sub-menu (menu-within-menu) for pos/number/case value choice */
.submenu-row { margin-top: .6rem; display: none; }
.submenu-row.is-active { display: block; }

/* SQL filter builder layout on morphology */
.filter-builder .btn-row { margin-top: .25rem; }

/* metric cards (phonology + stylometry summaries) */
.analysis-card .metric { font-weight: 700; font-size: 1.15rem; color: #1e293b; line-height: 1.15; }
.analysis-card .metric-label { color: var(--muted); font-size: .78rem; display: block; margin-top: .15rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 999px; margin-right: .35rem; vertical-align: middle; }

/* --- nav dropdown (Analyses menu) --- */
.nav-dropdown { position: relative; display: inline-flex; }
.nav-dropdown-toggle {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: .3rem;
}
.nav-dropdown-toggle .caret { font-size: .7em; transition: transform .2s ease; }
.nav-dropdown-toggle[aria-expanded="true"] .caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: fixed;
  z-index: 1000;
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .35rem;
  border-radius: 14px;
  background: var(--card, #fffdf8);
  border: 1px solid rgba(138, 103, 48, 0.35);
  box-shadow: 0 16px 36px rgba(94, 66, 31, 0.28);
}
.nav-dropdown-menu[hidden] { display: none; }
.nav-dropdown-menu .nav-link { white-space: nowrap; }

/* --- custom-SQL textarea inside the Quick filter --- */
#qfSqlInput, #phonSql {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: .85rem;
  line-height: 1.5;
  padding: .7rem .8rem;
  white-space: pre;
  border-radius: 10px;
  border: 1px solid rgba(138, 103, 48, 0.35);
  background: #fffdf8;
}
.filter-group .grid-3 { margin-bottom: .2rem; }
kbd {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 4px;
  padding: 0 .3rem;
  font-size: .8em;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

/* ============================================================================
   THEME REDESIGN: "Mopsus": black-figure clay on cool marble, Aegean teal,
   gilt hairlines. Type: Fraunces (display) · IBM Plex Sans (UI) · Plex Mono.
   Appended last so these tokens/components win over the originals.
   ========================================================================== */
:root {
  --marble: #eef1f4;
  --bg: radial-gradient(1100px 560px at 12% -12%, #f6f8f9 0%, #e9eef1 48%, #dce5ea 100%);
  --card: #ffffff;
  --card-strong: #ffffff;
  --text: #161a22;
  --muted: #5b6772;
  --line: rgba(20, 40, 52, 0.14);
  --ink: #161a22;
  --clay: #c0512c;
  --clay-deep: #9c3f22;
  --aegean: #155b6e;
  --aegean-2: #1c7d96;
  --gold: #c2a14e;
  --bronze: #93763d;
  --greek: "Cardo", "Gentium Plus", "New Athena Unicode", "GFS Didot", Georgia, "Times New Roman", serif;
  /* remap legacy tokens to the new palette */
  --blue: #155b6e;
  --blue-2: #1c7d96;
  --cyan: #c2a14e;
  --green: #2f6b4f;
  --warn: #b23a1e;
  --shadow: 0 12px 30px rgba(20, 35, 45, 0.12);
}

body { font-family: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--text); }

h1, h2, h3 { font-family: "Fraunces", "Iowan Old Style", Georgia, serif; font-weight: 600; letter-spacing: -0.01em; }
.kicker { font-family: "IBM Plex Sans", sans-serif; color: var(--clay); }

code, .status, .code-chip,
#qfSqlInput, #phonSql { font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
code { background: rgba(21, 91, 110, 0.08); color: var(--aegean); }

.bg-glow-left { background: #bcd0d6; }
.bg-glow-right { background: #d8b98a; opacity: .26; }

/* header + brand */
.header-inner {
  background: linear-gradient(140deg, #ffffff, #f3f7f8 72%);
  border: 1px solid var(--line);
  border-top: 3px solid var(--clay);
  box-shadow: 0 10px 30px rgba(20, 40, 52, 0.12);
}
.brand-mark {
  font-family: "Fraunces", Georgia, serif;
  border-radius: 50%;
  color: #faf4e6;
  background: radial-gradient(120% 120% at 35% 25%, #d2693f, #c0512c 55%, #9c3f22);
  border: 1.5px solid var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 6px 14px rgba(156, 63, 34, 0.4);
}
.brand-copy strong { font-family: "Fraunces", Georgia, serif; font-weight: 600; }

/* nav */
.site-nav { background: rgba(21, 91, 110, 0.08); border: 1px solid rgba(21, 91, 110, 0.2); }
.nav-link { color: var(--ink); font-weight: 600; }
.nav-link:hover { background: #fff; color: var(--aegean); }
.nav-link.is-active,
.nav-dropdown-toggle.is-active {
  color: #fff;
  background: linear-gradient(135deg, var(--aegean), var(--aegean-2));
  box-shadow: 0 6px 14px rgba(21, 91, 110, 0.3);
}
.nav-dropdown-toggle.is-active { color: #fff; }

/* hero with gilt hairline signature */
.hero { background: linear-gradient(140deg, #ffffff, #f3f7f8); border-color: var(--line); position: relative; overflow: hidden; }
.hero::after {
  content: "";
  position: absolute; left: 1.2rem; right: 1.2rem; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold) 12%, var(--gold) 88%, transparent);
  opacity: .55;
}

/* cards / fields / focus */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
input[type="text"]:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(21, 91, 110, 0.4);
  border-color: var(--aegean);
  box-shadow: 0 0 0 4px rgba(21, 91, 110, 0.12);
}

/* buttons */
.btn { border: 1px solid rgba(20, 40, 52, 0.2); background: #fff; color: var(--ink); border-radius: 10px; }
.btn:hover:not(:disabled) { box-shadow: 0 8px 16px rgba(20, 40, 52, 0.16); }
.btn-primary { background: linear-gradient(135deg, var(--aegean), var(--aegean-2)); color: #fff; border-color: transparent; }
.btn-primary:hover:not(:disabled) { box-shadow: 0 8px 18px rgba(21, 91, 110, 0.34); }
.btn-success { background: linear-gradient(135deg, #2f6b4f, #3f8a63); color: #fff; border-color: transparent; }

/* viz + loading accents */
.viz-bar { background: linear-gradient(90deg, var(--aegean), var(--gold)); }
.loading-bar::after { background: linear-gradient(90deg, var(--aegean), var(--gold)); }
.load-progress::after { background: linear-gradient(90deg, transparent, var(--aegean-2), transparent); }
.status.loading-note { color: var(--ink); background: rgba(21, 91, 110, 0.08); border-color: rgba(21, 91, 110, 0.22); }

/* stat / analysis cards */
.stat-card strong { color: var(--aegean); }
.analysis-card .metric { color: var(--aegean); font-size: 1.25rem; font-weight: 700; }
.analysis-card .metric-label { color: var(--muted); font-size: .78rem; }
.analysis-card .value { color: var(--ink); }
table.preview th { background: #f3f7f8; }

/* figure download toolbar (added to every D3 chart) */
.fig-toolbar { display: flex; justify-content: flex-end; gap: .4rem; margin: -.2rem 0 .4rem; }
.fig-dl {
  font: 600 .76rem/1 "IBM Plex Sans", sans-serif;
  padding: .34rem .62rem;
  border-radius: 8px;
  border: 1px solid rgba(20, 40, 52, 0.2);
  background: #fff;
  color: var(--aegean);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: .3rem;
}
.fig-dl:hover { background: rgba(21, 91, 110, 0.08); border-color: var(--aegean); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ===== Scansion: line scansion rendering ================================= */
.scan-passage { display: flex; flex-direction: column; gap: .55rem; }
.scan-line {
  padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, rgba(21,91,110,0.03), rgba(194,161,78,0.04));
}
.scan-ref { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .15rem; }
.scan-ds { color: var(--clay); font-weight: 600; letter-spacing: .12em; }
.scan-greek { font-family: var(--greek); font-size: 1.16rem; line-height: 1.5; color: var(--text); margin-bottom: .35rem; }
.scan-feet { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .1rem .25rem; font-family: "IBM Plex Mono", ui-monospace, monospace; }
.scan-foot { display: inline-flex; flex-direction: column; align-items: center; padding: 0 .15rem; }
.scan-marks { font-size: 1.05rem; line-height: 1.1; color: var(--aegean); letter-spacing: .04em; }
.scan-flab { font-size: .66rem; color: var(--bronze); }
.scan-div { color: var(--line); padding: 0 .1rem; align-self: stretch; }
.scan-words { margin-top: .35rem; font-size: .98rem; color: var(--text); line-height: 1.7; }
.scan-words sub { color: var(--clay); font-size: .62em; font-weight: 600; }
.scan-ex { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .82rem; color: var(--muted); padding: .12rem 0; border-bottom: 1px dotted var(--line); }

/* ===== Morphology: paradigm table ======================================== */
.paradigm-table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.paradigm-table th, .paradigm-table td { border: 1px solid var(--line); padding: .35rem .55rem; text-align: left; vertical-align: top; }
.paradigm-table thead th { background: rgba(21,91,110,0.07); color: var(--aegean); font-weight: 600; }
.paradigm-table tbody th { background: rgba(194,161,78,0.08); color: var(--bronze); white-space: nowrap; }
.paradigm-table .pdg-form { font-family: var(--greek); color: var(--text); }
.paradigm-table .pdg-c { color: var(--muted); font-size: .78rem; margin-left: .3rem; }
.paradigm-table .pdg-gap { color: var(--line); }

/* ===== Scansion: per-syllable alignment ================================== */
.syl-scan { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .15rem .35rem; margin-top: .15rem; }
.syl-foot { display: inline-flex; align-items: flex-end; gap: .12rem; padding-bottom: .9rem; position: relative; }
.syl-col { display: inline-flex; flex-direction: column; align-items: center; min-width: 1.1rem; }
.syl-mark { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 1.2rem; height: 1.1rem; line-height: 1.1rem; display: flex; align-items: center; justify-content: center; color: var(--aegean); }
.syl-txt { font-family: var(--greek); font-size: 1.08rem; line-height: 1.3; color: var(--text); }
.syl-col.syn { background: rgba(192,81,44,0.10); border-radius: 5px; padding: 0 .12rem; }
.syl-col.syn .syl-txt { color: var(--clay); border-bottom: 2px solid var(--clay); }
.syl-col.dia .syl-txt { color: var(--aegean-2); border-bottom: 1px dotted var(--aegean-2); }
.syl-flab { position: absolute; bottom: 0; left: 0; right: 0; text-align: center; font-size: .66rem; color: var(--bronze); }
.syl-div { align-self: stretch; color: var(--line); padding-bottom: .9rem; }

/* ===== Scansion: word autocomplete combobox ============================== */
.combo { position: relative; }
.combo-menu { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px);
  background: var(--card-strong); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; }
.combo-item { display: flex; justify-content: space-between; align-items: baseline; gap: .6rem;
  padding: .32rem .6rem; cursor: pointer; }
.combo-item:hover { background: rgba(21,91,110,0.08); }
.combo-form { font-family: var(--greek); font-size: 1.02rem; color: var(--text); }
.combo-meta { font-size: .76rem; color: var(--muted); white-space: nowrap; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem .7rem; }

/* ===== All-forms dropdown + How-to-cite page ============================ */
.combo-all { width: 100%; }
.combo-all option { font-family: var(--greek); }
.cite-page h2 { font-family: "Fraunces", Georgia, serif; font-size: 1.05rem; color: var(--aegean); margin: 1.1rem 0 .4rem; }
.cite-page h2:first-child { margin-top: 0; }
.cite-text { max-width: 72ch; color: var(--text); font-size: .98rem; line-height: 1.6; margin: 0 0 .4rem; }
.cite-bib-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1rem; }
.cite-bib-head h2 { margin: 0; }
.cite-pre { margin: .5rem 0 0; padding: .8rem .9rem; background: var(--card-strong, #fff); border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: .82rem; line-height: 1.5; color: var(--text); white-space: pre; }

/* Under-construction marks for tabs still being built */
.wip-mark { font-size: .8em; }
.wip-badge { display: inline-block; vertical-align: middle; margin-left: .5rem; padding: .18rem .55rem; border: 1px solid var(--line); border-radius: 999px; background: var(--card-strong, #fff); font-family: "IBM Plex Sans", sans-serif; font-size: .72rem; font-weight: 600; letter-spacing: .02em; color: var(--muted, #666); white-space: nowrap; }

/* Word-level scansion line (each word under its stored metrical marks) */
.scan-wordscan { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .15rem .55rem; margin-top: .15rem; }
.scan-w { display: inline-flex; flex-direction: column; align-items: center; position: relative; }
.scan-wm { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 1.18rem; line-height: 1; height: 1.05rem; color: var(--aegean); letter-spacing: .04em; white-space: nowrap; }
.scan-wt { font-family: var(--greek); font-size: 1.08rem; line-height: 1.3; color: var(--text); }
.scan-w sub { color: var(--clay); font-size: .62rem; font-weight: 600; line-height: 1; margin-top: .08rem; }
.scan-w.elided .scan-wm { color: var(--muted); }
.scan-w.unk .scan-wm { color: var(--bronze); }
.scan-w.unk .scan-wt { color: var(--muted); }

/* Clickable word links + the attestation popup */
.wlink { cursor: pointer; border-bottom: 1px dotted var(--aegean); }
.wlink:hover { color: var(--aegean); }
.word-inline { position: relative; margin-top: .8rem; padding: .7rem .9rem; border: 1px solid var(--line); border-left: 3px solid var(--aegean); border-radius: 9px; background: rgba(37,99,235,.04); }
.word-inline-close { position: absolute; top: .4rem; right: .4rem; }
.word-inline-word { font-family: var(--greek); font-size: 1.25rem; margin: 0 1.6rem .2rem 0; }

/* the looked-up compound inside a scanned line */
.scan-w.hit .scan-wt { color: var(--clay); font-weight: 600; }
.scan-w.hit .scan-wm { color: var(--clay); }

/* Foot boundaries, caesurae, and diaeresis in the word-level scansion */
.scan-wm .scan-fdiv { color: var(--muted); opacity: .55; font-size: .82em; }
.scan-junc { align-self: flex-end; padding-bottom: .1rem; font-size: 1.05rem; line-height: 1.3; }
.scan-junc.scan-fdiv { color: var(--muted); opacity: .7; }
.scan-junc.scan-caes { color: var(--clay); font-weight: 600; }
.scan-junc.scan-bdia { color: var(--bronze); font-weight: 700; }

/* Keep long text inside its panel everywhere */
.card, .info-panel, .word-inline, .help, .small-muted { overflow-wrap: break-word; }
.status { word-break: break-word; }
.scan-ex { white-space: normal; overflow-wrap: anywhere; }
.paradigm-table td, .paradigm-table th { overflow-wrap: anywhere; }
.combo-menu { max-width: 100%; }
.scan-wordscan { max-width: 100%; }

/* Compact-by-default figures with an Enlarge toggle in the toolbar */
/* The figure panel keeps the full card width; only the drawing itself is
 * rendered compact, and Enlarge lets it fill the panel. */
.fig-fit { max-width: none; max-height: none; overflow: visible; }
.fig-fit svg.d3-svg { display: block; max-width: min(560px, var(--nat-w, 560px)); max-height: 380px; height: auto; }
.fig-fit.fig-full svg.d3-svg { max-width: 100%; max-height: none; }

/* Whole-line pattern with the compound's feet highlighted */
.cmp-patt { font-family: "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .18em; }
.cmp-patt-foot.hit { color: var(--clay); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }

/* Caesura whose position is uncertain (two third-foot breaks) */
.scan-junc.scan-caes-unc { opacity: .55; border-bottom: 1px dotted var(--clay); }

/* ============================================================================
 * MoPSoS STYLE GUIDE THEMING
 * Fonts: Fraunces (Regular) for titles, IBM Plex Sans for body.
 * Text #000 on white cards; each tab carries its own palette
 * (accent / secondary accent / page background) via body classes.
 * --acc-ink is a darkened accent for text-sized uses (links, kickers)
 * so the pale palettes (Scansion yellow, Syntax pink) stay readable.
 * ========================================================================== */
body { --acc:#0097da; --acc2:#7fcbec; --pgbg:#cceaf7; --acc-ink:#0074a8; --on-acc:#ffffff; }
body.page-morphology, body.page-morphotactics { --acc:#0097da; --acc2:#7fcbec; --pgbg:#cceaf7; --acc-ink:#0074a8; --on-acc:#ffffff; }
body.page-phonology { --acc:#239938; --acc2:#91cc9b; --pgbg:#d3ebd7; --acc-ink:#1d7e2f; --on-acc:#ffffff; }
body.page-syntax { --acc:#e7a2c8; --acc2:#f3d0e3; --pgbg:#faecf4; --acc-ink:#b25a8d; --on-acc:#000000; }
body.page-prosody { --acc:#f9dc78; --acc2:#fbedbc; --pgbg:#fef8e4; --acc-ink:#8a6d0b; --on-acc:#000000; }
body.page-clustering { --acc:#a61c00; --acc2:#d28d7f; --pgbg:#edd2cc; --acc-ink:#a61c00; --on-acc:#ffffff; }
body.page-cite { --acc:#000000; --acc2:#b7b7b7; --pgbg:#ededed; --acc-ink:#000000; --on-acc:#ffffff; }

body {
  background: var(--pgbg);
  color: #000;
  font-family: "IBM Plex Sans", system-ui, -apple-system, sans-serif;
  --text: #000; --ink: #000; --muted: #4a4a4a;
}
.bg-glow { display: none; }

h1, h2, h3, h4 { font-family: "Fraunces", "Iowan Old Style", Georgia, serif; font-weight: 400; color: #000; }
.hero h1 { font-size: clamp(2.5rem, 5.5vw, 4.1rem); letter-spacing: -0.015em; }
.kicker { color: var(--acc-ink); }
a { color: var(--acc-ink); }
code { background: var(--pgbg); color: #000; }

.site-header { background: rgba(255,255,255,.88); border-bottom: 1px solid var(--acc2); }
.brand-mark { background: var(--acc); color: var(--on-acc); }
.nav-link { color: #000; }
.nav-link:hover { background: var(--pgbg); color: var(--acc-ink); }
.nav-link.is-active, .nav-dropdown-toggle.is-active { background: var(--acc); color: var(--on-acc); }
.nav-dropdown-menu { background: #fff; border: 1px solid var(--acc2); }

.card { background: #ffffff; border: 1px solid var(--acc2); box-shadow: 0 8px 22px rgba(0,0,0,.06); }
.hero { background: #ffffff; border-top: 5px solid var(--acc); }
.info-btn { color: var(--acc-ink); border-color: var(--acc2); background: #fff; }
.info-btn:hover { background: var(--pgbg); }
.info-panel { background: var(--pgbg); border: 1px solid var(--acc2); }
.viz-wrap { background: #fff; border: 1px solid var(--acc2); }
.analysis-card { background: #fff; border: 1px solid var(--acc2); }
.analysis-card .metric { color: var(--acc-ink); }
.table-wrap { border-color: var(--acc2); background: #fff; }
.paradigm-table th { background: var(--pgbg); color: #000; }
.word-inline { border-color: var(--acc2); border-left: 3px solid var(--acc); background: var(--pgbg); }

.btn { background: var(--acc); color: var(--on-acc); border: 1px solid transparent; }
.btn:hover { filter: brightness(.94); background: var(--acc); color: var(--on-acc); }
.btn:disabled { background: #e5e7eb; color: #8a8a8a; filter: none; }
.fig-dl { background: #fff; border: 1px solid var(--acc2); color: #000; }
.fig-dl:hover { background: var(--pgbg); }

input[type="text"], input[type="number"], select, textarea { background: #fff; border: 1px solid var(--acc2); color: #000; }
input[type="text"]:focus, input[type="number"]:focus, select:focus, textarea:focus { outline: 2px solid var(--acc); outline-offset: 0; }
.combo-menu { background: #fff; border-color: var(--acc2); }
.combo-item:hover { background: var(--pgbg); }

.scan-wm { color: var(--acc-ink); }
.btn-warn { background: #fff7ed; color: #8a3e1e; border: 1px solid #fed7aa; }
.btn-warn:hover { background: #ffedd5; filter: none; color: #8a3e1e; }
.hero { border-color: var(--acc2); border-top: 5px solid var(--acc); }

/* ============================================================================
 * MOCKUP LAYOUT: collapsible panels, colored pill navigation, landing page
 * ========================================================================== */
.panel { background: #fff; border: 1.5px solid var(--acc); border-radius: 14px; margin: .8rem 0; box-shadow: 0 6px 16px rgba(0,0,0,.05); }
.panel-head { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: none; border: 0; cursor: pointer; padding: .7rem 1.1rem; text-align: left; }
.panel-title { font-family: "Fraunces", Georgia, serif; font-weight: 400; font-size: 1.55rem; color: #000;
  display: flex; align-items: center; gap: .55rem; }
.panel-title::before { content: ""; width: 6px; height: 1.15em; border-radius: 3px; background: var(--acc); flex: 0 0 auto; }
.panel-toggle { font-family: "IBM Plex Sans", sans-serif; font-size: .95rem; color: #222; white-space: nowrap; }
.panel-body { padding: 0 1.1rem 1.1rem; }
.panel-body > .card { border: 0; box-shadow: none; background: transparent; padding-left: 0; padding-right: 0; }
.panel-body > .card + .card { border-top: 1px solid var(--acc2); border-radius: 0; margin-top: .4rem; }
.panel-info { margin: .2rem 0 .6rem; }

/* Colored pill navigation (each tab keeps its own palette everywhere) */
.pill-nav { background: #fff; border: 1px solid #c9c9c9; border-radius: 16px; padding: .5rem .65rem;
  display: flex; align-items: center; gap: .55rem; flex-wrap: wrap; box-shadow: 0 4px 12px rgba(0,0,0,.05); }
.nav-logo { display: flex; align-items: center; }
.nav-logo img { display: block; }
.pill { border-radius: 999px; padding: .42rem 1.2rem; font-family: "Fraunces", Georgia, serif; font-size: 1.05rem;
  color: #000; text-decoration: none; border: 2px solid transparent; line-height: 1.2; }
.pill:hover { filter: brightness(.96); }
.pill-morph { background: #cceaf7; }
.pill-phon  { background: #d3ebd7; }
.pill-syn   { background: #faecf4; }
.pill-scan  { background: #fef8e4; }
.pill-styl  { background: #edd2cc; }
.pill-cite  { background: #ededed; }
.pill-morph.is-active { border-color: #0097da; }
.pill-phon.is-active  { border-color: #239938; }
.pill-syn.is-active   { border-color: #e7a2c8; }
.pill-scan.is-active  { border-color: #f9dc78; }
.pill-styl.is-active  { border-color: #a61c00; }
.pill-cite.is-active  { border-color: #000000; }
.pill .wip-mark { font-size: .75em; }
.site-header { background: transparent; border-bottom: 0; box-shadow: none; }

/* Landing page */
body.page-home { --acc:#0097da; --acc2:#c9c9c9; --pgbg:#ffffff; --acc-ink:#0074a8; --on-acc:#fff; background: #fff; }
.landing { max-width: 1060px; margin: 0 auto; padding: 3.5rem 1rem 4rem; text-align: center; }
.landing-title { font-family: "Fraunces", Georgia, serif; font-weight: 400; font-size: clamp(3.4rem, 8vw, 5.2rem); margin: 0; }
.landing-head { width: fit-content; max-width: 100%; margin: 0 auto; }
.landing-sub { font-family: "Fraunces", Georgia, serif; font-size: clamp(1rem, 3vw, 1.7rem); margin: .55rem 0 1.3rem; white-space: nowrap; }
.landing-intro { width: 0; min-width: 100%; margin: .45rem 0; font-size: .88rem; color: #000; text-align: left; }
.landing-grid { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2.2rem 2.5rem;
  max-width: 760px; margin: 2.6rem auto 0; }
.landing-logo { grid-row: 1 / span 2; grid-column: 2; width: 210px; height: auto; }
.landing-pill { display: inline-block; padding: .55rem 1.6rem; font-size: 1.15rem; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.landing-pill.pill-morph { border-color: #7fcbec; }
.landing-pill.pill-phon  { border-color: #91cc9b; }
.landing-pill.pill-syn   { border-color: #f3d0e3; }
.landing-pill.pill-scan  { border-color: #fbedbc; }
.landing-pill.pill-styl  { border-color: #d28d7f; }
.landing-pill.pill-cite  { border-color: #b7b7b7; }
.landing-row { display: flex; justify-content: center; gap: 2.2rem; margin-top: 2.6rem; }
@media (max-width: 700px) {
  .landing-grid { display: flex; flex-direction: column; align-items: center; gap: .8rem; margin-top: 1.6rem; }
  .landing-logo { order: -1; width: 130px; margin-bottom: .4rem; }
  .landing-logo .mopsos-logo { width: 130px; height: 130px; }
  .landing-grid .landing-pill, .landing-row .landing-pill { display: block; width: min(78vw, 300px); text-align: center; }
  .landing-row { flex-direction: column; align-items: center; gap: .8rem; margin-top: .8rem; }
  .landing-sub { white-space: normal; }
}


/* MoPSoS logo: quadrants light up on landing-pill hover and on section pages */
.nav-logo .mopsos-logo { width: 40px; height: 40px; display: block; }
.landing-logo .mopsos-logo { width: 220px; height: 220px; }
.mopsos-logo .lp { transition: opacity .18s ease; }
.mopsos-logo .lp .lp-quad { transition: opacity .18s ease; }
.mopsos-logo.dim .lp:not(.lit) { opacity: .22; }
.mopsos-logo .lp.lit .lp-quad { opacity: .6; }
body.page-morphology .nav-logo .lp:not(.lp-morph),
body.page-morphotactics .nav-logo .lp:not(.lp-morph) { opacity: .3; }
body.page-morphology .nav-logo .lp-morph .lp-quad,
body.page-morphotactics .nav-logo .lp-morph .lp-quad { opacity: .6; }
body.page-phonology .nav-logo .lp:not(.lp-phon) { opacity: .3; }
body.page-phonology .nav-logo .lp-phon .lp-quad { opacity: .6; }
body.page-syntax .nav-logo .lp:not(.lp-syn) { opacity: .3; }
body.page-syntax .nav-logo .lp-syn .lp-quad { opacity: .6; }
body.page-prosody .nav-logo .lp:not(.lp-scan) { opacity: .3; }
body.page-prosody .nav-logo .lp-scan .lp-quad { opacity: .6; }

/* A panel can carry the palette of its CONTENT rather than the page: the CSS
 * variables re-cascade to everything inside it (border, tick, buttons, info). */
.panel.theme-morph { --acc:#0097da; --acc2:#7fcbec; --pgbg:#cceaf7; --acc-ink:#0074a8; --on-acc:#fff; }
.panel.theme-phon  { --acc:#239938; --acc2:#91cc9b; --pgbg:#d3ebd7; --acc-ink:#1d7e2f; --on-acc:#fff; }
.panel.theme-syn   { --acc:#e7a2c8; --acc2:#f3d0e3; --pgbg:#faecf4; --acc-ink:#b25a8d; --on-acc:#000; }
.panel.theme-scan  { --acc:#f9dc78; --acc2:#fbedbc; --pgbg:#fef8e4; --acc-ink:#8a6d0b; --on-acc:#000; }
.panel.theme-styl  { --acc:#a61c00; --acc2:#d28d7f; --pgbg:#edd2cc; --acc-ink:#a61c00; --on-acc:#fff; }
.panel.theme-cite  { --acc:#000000; --acc2:#b7b7b7; --pgbg:#ededed; --acc-ink:#000; --on-acc:#fff; }

/* Section dividers inside a panel: each card is one section of the same panel.
 * A full-width accent rule plus a tinted heading band makes each new section
 * unmistakable while staying inside the one panel. */
.panel-body > .card + .card { border-top: 3px solid var(--acc); margin-top: 1.5rem; padding-top: 1.15rem; border-radius: 0; }
.panel-body > .card > h2 { display: flex; align-items: center; gap: .5rem; background: var(--pgbg);
  padding: .4rem .65rem; border-radius: 9px; margin-bottom: .7rem; }
.panel-body > .card > h2::before { content: ""; width: 5px; height: 1em; border-radius: 2.5px; background: var(--acc); flex: 0 0 auto; }

.grid-2 > .viz-wrap.fig-full, .grid-3 > .viz-wrap.fig-full { grid-column: 1 / -1; }

/* Mobile logo size must win over the desktop 220px rule above (cascade order) */
@media (max-width: 700px) {
  .landing-logo { width: 140px; display: flex; justify-content: center; }
  .landing-logo .mopsos-logo { width: 140px; height: 140px; }
}

/* ============================================================================
 * PAGE-SCHEME CONSISTENCY: every page carries one accent palette (--acc /
 * --acc2 / --pgbg / --acc-ink), but chrome from the two earlier themes (the
 * brown original and the Aegean-teal "Mopsus" redesign) still leaked through:
 * near-black status boxes, teal info/advanced toggles, cream panels, brown
 * info-panel text, indigo kbd chips, teal cite headings. Appended last so
 * these re-statements win and every element reads from the page palette.
 * (Data-encoding colors are deliberately untouched: the Okabe-Ito chart
 * palette and the clay/bronze caesura markers carry meaning, not chrome.)
 * ========================================================================== */
/* status / SQL boxes: page tint instead of the near-black terminal look */
.status { background: var(--pgbg); color: #000; border: 1px solid var(--acc2); }
.status.muted, .muted { background: transparent; border: 0; }
.status.loading-note { color: #000; background: var(--pgbg); border-color: var(--acc2); }

/* info button + panel: accent when open; body text in ink, chips on white */
.info-btn.is-open,
.panel-info .info-btn.is-open,
.tab-meta-row .info-btn.is-open { background: var(--acc); color: var(--on-acc); border-color: transparent; }
.info-panel { color: #000; }
.info-panel code { background: #fff; }

/* advanced toggles + panels: dashed accent outline, page-tint body */
.adv-toggle { background: transparent; border: 1px dashed var(--acc); color: var(--acc-ink); }
.adv-toggle:hover { background: var(--pgbg); color: var(--acc-ink); filter: none; }
.adv-panel { border: 1px solid var(--acc2); background: var(--pgbg); }

/* view picker box, loading bar, kbd chips, table header tints */
.view-picker { border: 1px solid var(--acc2); background: #fff; }
.load-progress { background: var(--pgbg); border: 1px solid var(--acc2); }
.load-progress::after { background: linear-gradient(90deg, transparent, var(--acc), transparent); }
kbd { background: #fff; border-color: var(--acc2); }
table.preview th { background: var(--pgbg); }
.mini-table th { background: var(--pgbg); }
/* paradigm tables: the Aegean-teal column headers and gold/bronze row
 * headers (e.g. Compound / Beta Code / Segmentation in the compound
 * lookup) join the page palette */
.paradigm-table thead th { background: var(--pgbg); color: #000; }
.paradigm-table tbody th { background: var(--pgbg); color: #000; }
.tab-desc { color: #000; }

/* chart tooltip: white card with the page accent instead of slate black */
.d3-tooltip { background: #fff; color: #000; border: 1.5px solid var(--acc); box-shadow: 0 8px 18px rgba(0,0,0,.18); }
.d3-tooltip strong { color: var(--acc-ink); }

/* warn-style buttons (e.g. the zoom Close) join the page palette too */
.btn-warn { background: #fff; color: var(--acc-ink); border: 1px solid var(--acc2); }
.btn-warn:hover { background: var(--pgbg); color: var(--acc-ink); filter: none; }

/* How to Cite: headings in page ink (they were Aegean teal), the BibTeX
 * heading gets the same highlighted band as every other section title even
 * though it sits inside the .cite-bib-head flex row, and the BibTeX block
 * itself borders in the page accent. */
.cite-page h2 { color: #000; }
.cite-pre { border-color: var(--acc2); background: #fff; }
.panel-body > .card > .cite-bib-head > h2 { display: flex; align-items: center; gap: .5rem; background: var(--pgbg);
  padding: .4rem .65rem; border-radius: 9px; }
.panel-body > .card > .cite-bib-head > h2::before { content: ""; width: 5px; height: 1em; border-radius: 2.5px; background: var(--acc); flex: 0 0 auto; }
