/* Shared styling for the LabintheWild jsPsych replications. */
:root {
  --litw-accent: #2b6cb0;
  --litw-accent-dark: #1f4e79;
  --litw-bg: #f7f8fa;
  --litw-card: #ffffff;
  --litw-text: #1a202c;
  --litw-muted: #718096;
  --litw-good: #2f855a;
  --litw-bad: #c53030;
}

body {
  background: var(--litw-bg);
  color: var(--litw-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

.jspsych-content { max-width: 900px; }

/* generic containers used by inline HTML in the experiments */
.litw-wrap { max-width: 760px; margin: 0 auto; text-align: left; }
.litw-wrap.center { text-align: center; }
.litw-title { font-size: 1.6rem; font-weight: 700; margin: 0.2rem 0 0.8rem; }
.litw-sub { color: var(--litw-muted); margin-bottom: 1rem; }
.litw-note { color: var(--litw-muted); font-size: 0.85rem; }
.litw-sim { color: var(--litw-muted); font-size: 0.82rem; font-style: italic; }
.litw-bar > .fill, .litw-bar > .you { transition: left 0.4s ease, width 0.4s ease; }

/* feedback / results card */
.litw-card {
  background: var(--litw-card);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.4rem 1.6rem;
  margin: 1rem auto;
  max-width: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
.litw-score-big {
  font-size: 3rem;
  font-weight: 800;
  color: var(--litw-accent);
  line-height: 1.1;
}
.litw-score-label { color: var(--litw-muted); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.8rem; }

/* social-comparison bar */
.litw-bar { position: relative; height: 16px; background: #e2e8f0; border-radius: 8px; margin: 0.6rem 0 0.2rem; }
.litw-bar > .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--litw-accent); border-radius: 8px; }
.litw-bar > .you { position: absolute; top: -6px; width: 3px; height: 28px; background: var(--litw-accent-dark); }

.litw-correct { color: var(--litw-good); font-weight: 700; }
.litw-incorrect { color: var(--litw-bad); font-weight: 700; }

/* ============================================================================
   Measure-explore "Code" view: calculation-code styling (shared cd-* classes).
   ========================================================================== */
.cd-intro { color: var(--litw-muted); font-size: 0.9rem; line-height: 1.55; margin: 0 0 1rem; }
.cd-io { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.85rem; margin: 0.3rem 0; }
.cd-io b { color: var(--litw-accent-dark); }
.cd-sec { border: 1px solid #e2e8f0; border-radius: 10px; margin: 0.9rem 0; overflow: hidden; }
.cd-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.55rem 0.8rem; background: #f1f5f9; font-weight: 600; }
.cd-badge { font-size: 0.7rem; font-weight: 700; padding: 0.12rem 0.55rem; border-radius: 999px; color: #334155; }
.cd-sec-body { padding: 0.7rem 0.8rem; }
.cd-lab { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--litw-muted); margin: 0.7rem 0 0.3rem; }
.cd-sec-body .cd-lab:first-child { margin-top: 0; }
.code-panel pre { margin: 0.2rem 0; background: #0f172a; border-radius: 8px; padding: 0.7rem 0.8rem; overflow-x: auto; }
.code-panel pre code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre;
  color: #e2e8f0; font-size: 0.8rem; line-height: 1.5;
}
.cd-out { background: #eef2ff; border-left: 4px solid #6366f1; border-radius: 8px; padding: 0.5rem 0.75rem; font-size: 0.9rem; }
.cd-out-big { font-weight: 800; color: var(--litw-accent); font-size: 1.15rem; margin-bottom: 0.15rem; }

/* "Code" view: the right-hand panel showing the selected measure's source. */
.code-panel {
  border: 1px solid #cbd5e0; border-radius: 12px; background: var(--litw-card);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08); padding: 1rem 1.1rem 1.3rem;
  max-height: calc(100vh - 3rem); overflow-y: auto;
}
.code-panel .cd-intro { margin-top: 0; }
.cd-pipeline { margin-top: 1rem; border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; }
.cd-pipeline > summary { cursor: pointer; padding: 0.55rem 0.8rem; font-weight: 600; font-size: 0.85rem; color: var(--litw-text); }
.cd-pipeline[open] > summary { border-bottom: 1px solid #e2e8f0; }
.cd-pipeline > .cd-sec { margin: 0.8rem; }

/* ============================================================================
   Shared study "chrome": intro (directions) + results cards. Every build uses
   LITW.introCard / LITW.resultCard so all studies share one visual language
   (mirrors the website_aesthetics polish).
   ========================================================================== */

/* frame the intro + results as compact, survey.html-style cards */
.litw-card.litw-intro, .litw-card.litw-result { max-width: 640px; padding: 1.5rem 1.7rem; }
.litw-intro .litw-title { margin-top: 0; }
.litw-intro .litw-sub { margin-bottom: 0.6rem; line-height: 1.55; }

/* section header + numbered "how it works" list */
.litw-sec-h {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--litw-muted); margin: 1rem 0 0.5rem;
}
.litw-steps { list-style: none; margin: 0.2rem 0; padding: 0; }
.litw-steps li { display: flex; gap: 0.7rem; align-items: flex-start; margin: 0.6rem 0; line-height: 1.5; }
.litw-steps .n {
  flex: 0 0 1.55rem; height: 1.55rem; border-radius: 999px;
  background: var(--litw-accent); color: #fff; font-size: 0.82rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 0.06rem;
}
.litw-cue { color: var(--litw-accent-dark); font-weight: 600; margin: 1.1rem 0 0; }

/* highlighted callout ("What you'll be scored on" / "Your Score") */
.litw-scored {
  background: #eef2ff; border-left: 4px solid #6366f1; border-radius: 8px;
  padding: 0.9rem 1.1rem; margin: 1.1rem 0 0.2rem; text-align: left;
}
.litw-scored-h {
  font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: #4338ca; margin-bottom: 0.4rem;
}
.litw-scored p { margin: 0.25rem 0; font-size: 0.92rem; line-height: 1.5; }
.litw-scored-note { color: #4338ca; }
/* within-format "how to read this" gloss, set off from the description above */
.litw-readas {
  margin: 0.6rem 0 0; padding-top: 0.55rem; border-top: 1px dashed #c7d2fe;
  font-size: 0.9rem; line-height: 1.5; color: #3730a3;
}
.litw-readas-h {
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  font-size: 0.72rem; color: #4338ca; margin-right: 0.35rem;
}

/* results headline: big ordinal + a smaller "percentile" word, with spacing */
.litw-result .litw-score-label { margin-bottom: 0.35rem; }
.litw-headline { display: flex; align-items: baseline; justify-content: center; gap: 0.4rem; margin: 0 0 0.9rem; }
.litw-pctl { font-size: 1.1rem; font-weight: 600; color: var(--litw-muted); }
.litw-result .litw-bar { margin: 0 0 0.75rem; }
.litw-cmp { margin: 0; font-size: 0.98rem; line-height: 1.5; }

/* ground the sparse intro/results screens near the top instead of floating in
   the vertical center of the viewport (scoped so interactive task screens keep
   jsPsych's default centering) */
.jspsych-content-wrapper:has(.litw-intro),
.jspsych-content-wrapper:has(.litw-result) { align-items: flex-start; padding-top: 8vh; }
.jspsych-content-wrapper:has(.litw-intro) > .jspsych-content,
.jspsych-content-wrapper:has(.litw-result) > .jspsych-content { margin: 0 auto !important; }

/* generic buttons (jspsych-btn already exists; this is for inline HTML) */
.litw-btn {
  background: var(--litw-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1.1rem;
  font-size: 1rem;
  cursor: pointer;
}
.litw-btn:hover { background: var(--litw-accent-dark); }

/* stimulus helpers */
.litw-stim-frame { border: 1px solid #cbd5e0; border-radius: 8px; overflow: hidden; display: inline-block; }
/* real website screenshots (website_aesthetics) */
.wa-frame { padding: 0; line-height: 0; background: #fff; }
.wa-shot { display: block; width: 620px; max-width: 90vw; aspect-ratio: 4 / 3; height: auto; object-fit: cover; object-position: top center; background: #f1f3f6; }
/* real Wikipedia lead photos (wikipedia_images) */
.wiki-shot { display: block; width: 280px; max-width: 42vw; aspect-ratio: 8 / 5; height: auto; object-fit: cover; border-radius: 6px; background: #f1f3f6; }
/* real food photos (nutrition_knowledge) */
.meal-frame { line-height: 0; }
.meal-shot { display: block; width: 220px; max-width: 40vw; aspect-ratio: 4 / 3; height: auto; object-fit: cover; border-radius: 8px; margin: 0 auto .4rem; background: #f1f3f6; }
/* SVG scene-icon writing prompts (stories_personality) */
.story-strip { display: inline-flex; align-items: center; gap: 6px; }
.story-strip .arw { color: #a0aec0; font-size: 1.1rem; }
.wa-shot[src] { min-height: 0; }

/* small tables used in some debriefs */
.litw-table { border-collapse: collapse; margin: 0.5rem auto; }
.litw-table td, .litw-table th { border: 1px solid #e2e8f0; padding: 0.35rem 0.7rem; text-align: center; }

/* prompt box (formality, nlpositionality, rl_decisions) */
.lf-prompt {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 0.9rem 1.1rem; margin: 0.6rem auto; max-width: 620px; font-size: 1.1rem;
}

/* rl_decisions */
.rl-persona { background: #ebf4ff; border-radius: 10px; padding: 0.8rem 1rem; margin: 0.4rem auto 0.8rem; max-width: 620px; font-weight: 600; }
.rl-sets { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }
.rl-set { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 0.8rem 1rem; min-width: 230px; }
.rl-set-h { font-weight: 700; color: var(--litw-accent); margin-bottom: 0.3rem; }
.rl-assist { background: #fffaf0; border: 1px solid #f6e05e; border-radius: 10px; padding: 0.7rem 1rem; margin: 0.4rem auto; max-width: 620px; text-align: left; }

/* stories_personality */
.story-traits { max-width: 520px; margin: 0.6rem auto; text-align: left; }
.story-trait { margin: 0.4rem 0; }
.story-trait .lbl { display: flex; justify-content: space-between; font-size: 0.9rem; }
.story-trait .track { height: 14px; background: #e2e8f0; border-radius: 7px; overflow: hidden; }
.story-trait .bar { height: 100%; background: var(--litw-accent); border-radius: 7px; transition: width 0.5s ease; }
textarea.story-box { width: 100%; max-width: 620px; min-height: 160px; border: 1px solid #cbd5e0; border-radius: 10px; padding: 0.7rem; font: inherit; }

/* mouse_motor */
.mouse-arena { position: relative; width: 640px; height: 420px; max-width: 92vw; margin: 0.6rem auto; background: #fff; border: 1px solid #cbd5e0; border-radius: 10px; cursor: crosshair; overflow: hidden; }
.mouse-target { position: absolute; border-radius: 50%; background: var(--litw-accent); box-shadow: 0 0 0 4px rgba(43,108,176,0.18); }
.mouse-home { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: #48bb78; transform: translate(-50%, -50%); }

/* ===== site chrome (platform pages: landing / admin / studies / gallery) ===== */
.site-nav { background: #fff; border-bottom: 1px solid #e2e8f0; }
.site-nav .inner { max-width: 1100px; margin: 0 auto; display: flex; align-items: center; gap: 1.2rem; padding: 0.7rem 1.1rem; flex-wrap: wrap; }
.site-nav .brand { font-weight: 800; color: var(--litw-accent-dark); margin-right: auto; }
.site-nav a { color: #4a5568; text-decoration: none; font-size: 0.92rem; font-weight: 600; }
.site-nav a:hover, .site-nav a.active { color: var(--litw-accent); }
.page { max-width: 1100px; margin: 0 auto; padding: 1.4rem 1.1rem; }

/* landing / consent hero */
.hero { max-width: 720px; margin: 2rem auto; background: #fff; border: 1px solid #e2e8f0; border-radius: 16px; padding: 2rem 2.2rem; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.hero h1 { font-size: 1.9rem; margin: 0 0 0.6rem; }
.hero .lead { color: var(--litw-muted); font-size: 1.05rem; }
.consent-box { background: var(--litw-bg); border: 1px solid #e2e8f0; border-radius: 10px; padding: 1rem 1.1rem; margin: 1.1rem 0; font-size: 0.92rem; max-height: 240px; overflow: auto; }
.btn-row { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.litw-btn.secondary { background: #edf2f7; color: #2d3748; }
.litw-btn.secondary:hover { background: #e2e8f0; }
.litw-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.muted-link { color: var(--litw-muted); font-size: 0.85rem; }

/* admin portal */
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 1.2rem; }
.admin-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1.1rem 1.2rem; }
.admin-card h2 { margin: 0 0 0.8rem; font-size: 1.15rem; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.admin-table th, table.admin-table td { border-bottom: 1px solid #edf2f7; padding: 0.5rem 0.6rem; text-align: left; vertical-align: middle; }
table.admin-table th { color: var(--litw-muted); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.03em; }
.pill { display: inline-block; padding: 0.1rem 0.5rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.pill.on { background: #c6f6d5; color: #22543d; }
.pill.off { background: #fed7d7; color: #742a2a; }
.pill.done { background: #bee3f8; color: #2a4365; }
.pill.pending { background: #e2e8f0; color: #4a5568; }
.mini-bar { height: 8px; background: #edf2f7; border-radius: 4px; overflow: hidden; min-width: 80px; }
.mini-bar > span { display: block; height: 100%; background: var(--litw-accent); }
select.admin-select, input.admin-input, textarea.admin-input { font: inherit; padding: 0.35rem 0.5rem; border: 1px solid #cbd5e0; border-radius: 7px; }
.toolbar { display: flex; gap: 0.7rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs { display: flex; gap: .3rem; flex-wrap: wrap; margin: .2rem 0 .8rem; border-bottom: 1px solid #e2e8f0; }
.tabs button { font: inherit; font-weight: 600; font-size: .88rem; border: 1px solid transparent; border-bottom: none; background: transparent; color: #4a5568; padding: .45rem .9rem; border-radius: 8px 8px 0 0; cursor: pointer; margin-bottom: -1px; }
.tabs button:hover { color: var(--litw-accent); }
.tabs button.active { color: var(--litw-accent-dark); background: #fff; border-color: #e2e8f0; }
.tabs button .count { color: var(--litw-muted); font-weight: 400; font-size: .8rem; }
.exp-split { display: flex; align-items: flex-start; }
.exp-split .exp-left { flex: none; border-right: 2px solid #cbd5e0; }
.exp-split .exp-right { flex: 1 1 auto; min-width: 0; }
.exp-split .exp-scroll { overflow-x: auto; }
.exp-split table { margin: 0; }
.exp-split .tabs { margin: 0 0 0; }
/* measure column headers: fixed-height label so every select-all checkbox aligns */
table.admin-table th.m-col { vertical-align: bottom; text-align: center; }
table.admin-table th.m-col .m-label { display: block; font-size: .7rem; line-height: 1.05; min-height: 2.4rem; white-space: normal; font-weight: 600; }
input.measure-all { display: block; margin: .3rem auto 0; cursor: pointer; }
/* body: center every measure checkbox the same way */
table.admin-table td input.exp-measure { display: block; margin: 0 auto; }
.notice { padding: 0.6rem 0.9rem; border-radius: 8px; font-size: 0.88rem; margin: 0.6rem 0; }
.notice.ok { background: #c6f6d5; color: #22543d; }
.notice.err { background: #fed7d7; color: #742a2a; }

/* admin auth overlay (studies / gallery gate) */
.auth-overlay { position: fixed; inset: 0; background: rgba(26,32,44,0.55); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 1rem; }
.auth-card { background: #fff; border-radius: 14px; padding: 1.6rem 1.8rem; width: 100%; max-width: 380px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }

/* studies page */
.tier-table-wrap { overflow-x: auto; }
table.studies-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
table.studies-table th, table.studies-table td { border: 1px solid #e2e8f0; padding: 0.5rem 0.6rem; text-align: left; vertical-align: top; }
table.studies-table th { background: #f1f5f9; position: sticky; top: 0; }
table.studies-table tr:nth-child(even) td { background: #fafbfc; }
/* trust survey tables (survey.html) */
table.survey-table td, table.survey-table th { padding: 0.4rem 0.45rem; vertical-align: middle; }
table.survey-table th { text-align: center; }
table.survey-table td input[type="radio"] { margin: 0; cursor: pointer; }
.survey-build { padding: 1rem 1.1rem; }
.survey-scored { background: #eef2ff; border-left: 3px solid #6366f1; border-radius: 6px; padding: 0.5rem 0.7rem; font-size: 0.9rem; }
/* section subheader + the divider between the before/after blocks */
table.survey-table tr.survey-sec td { background: #f8fafc; font-size: 0.84rem; color: #334155; text-align: left; }
table.survey-table tr.survey-sec:nth-child(even) td { background: #f8fafc; }
table.survey-table tr.survey-split td { padding: 0; height: 0; border: 0; border-top: 4px solid #334155; background: #334155; }
/* in-study Likert questionnaires (LITW.trustTrial / LITW.knowledgeTrial):
   a standard survey-likert layout — plain evenly-spaced radios with the point
   number beneath each and endpoint anchors above; no boxed pills. */
.litw-survey { max-width: 620px; margin: 0.4rem auto 0; text-align: left; }
.litw-lk-anchors { display: flex; justify-content: space-between; font-size: 0.78rem; color: #64748b; margin: 0.1rem 0 0.5rem; }
.litw-lk-item { padding: 0.7rem 0; border-top: 1px solid #eef2f7; }
.litw-lk-item:first-of-type { border-top: 0; }
.litw-lk-q { font-size: 0.95rem; line-height: 1.4; margin-bottom: 0.55rem; }
.litw-lk-scale { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.3rem; align-items: start; }
/* number span is first in markup; column-reverse puts the radio on top, number below */
.litw-lk-opt { display: flex; flex-direction: column-reverse; align-items: center; gap: 0.35rem; padding: 0.15rem 0; cursor: pointer; }
.litw-lk-num { font-size: 0.8rem; color: #64748b; }
.litw-lk-opt:hover .litw-lk-num { color: var(--litw-accent-dark); }
.litw-lk-opt input { margin: 0; cursor: pointer; width: 1.05rem; height: 1.05rem; accent-color: var(--litw-accent); }
.litw-trust-score { text-align: center; font-size: 1.05rem; margin: 0 0 0.7rem; }
/* rendered markdown grid (measures page) */
#grid h1 { font-size: 1.5rem; margin: 1rem 0 .4rem; }
#grid h2 { font-size: 1.2rem; margin: 1.4rem 0 .4rem; }
#grid p { color: #4a5568; font-size: .92rem; }
#grid hr { border: none; border-top: 1px solid #e2e8f0; margin: 1.2rem 0; }
table.md-table { font-size: .8rem; }
table.md-table th { font-size: .72rem; white-space: nowrap; }
table.md-table td { white-space: nowrap; }

/* measure explore page */
.explore-controls { display: flex; gap: 1.5rem; align-items: flex-end; flex-wrap: wrap; background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem 1.2rem; margin: 1rem 0; }
.explore-controls .ctl { display: flex; flex-direction: column; gap: .35rem; }
.explore-controls .ctl.grow { flex: 1 1 320px; min-width: 260px; }
.explore-controls label { font-size: .85rem; font-weight: 600; color: #2d3748; }
.explore-controls select.admin-input { min-width: 240px; }
.explore-controls input[type=range] { width: 100%; }
.slider-ends { display: flex; justify-content: space-between; font-size: .72rem; color: #718096; }
#val-readout { color: #2b6cb0; }
.explore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .8rem; margin-top: 1rem; }
.measure-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: .7rem .85rem; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.measure-card:hover { border-color: #90cdf4; }
.measure-card.selected { border-color: var(--litw-accent, #3182ce); box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.25); }
.measure-card .mc-head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-bottom: .45rem; }
.measure-card .mc-label { font-weight: 700; font-size: .82rem; color: #1a202c; }
.measure-card .mc-out { font-size: .95rem; color: #2d3748; line-height: 1.4; }

/* view toggle + two-panel layout */
.view-toggle { margin-top: .4rem; }
.explore-body { margin-top: .6rem; }
.explore-body .explore-right, .explore-body .explore-right-code { display: none; }
.explore-body.mode-split, .explore-body.mode-code { display: flex; gap: 1.2rem; align-items: flex-start; }
.explore-body.mode-split .explore-left, .explore-body.mode-code .explore-left { flex: 0 0 42%; min-width: 300px; }
.explore-body.mode-split .explore-left .explore-grid, .explore-body.mode-code .explore-left .explore-grid { grid-template-columns: 1fr; }
.explore-body.mode-split .explore-right { display: block; flex: 1 1 auto; min-width: 0; position: sticky; top: 1rem; }
.explore-body.mode-code .explore-right-code { display: block; flex: 1 1 auto; min-width: 0; position: sticky; top: 1rem; }
.preview-caption { font-size: .82rem; color: #718096; margin: .2rem 0 .5rem; }

/* browser-chrome frame around the actual results page */
.page-frame { border: 1px solid #cbd5e0; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.08); background: #fff; }
.page-frame .page-chrome { display: flex; align-items: center; gap: .4rem; background: #edf2f7; border-bottom: 1px solid #e2e8f0; padding: .5rem .7rem; }
.page-frame .page-chrome .dot { width: 11px; height: 11px; border-radius: 50%; background: #cbd5e0; }
.page-frame .page-chrome .dot.r { background: #fc8181; }
.page-frame .page-chrome .dot.y { background: #f6e05e; }
.page-frame .page-chrome .dot.g { background: #68d391; }
.page-frame .page-chrome .url { margin-left: .5rem; font-size: .75rem; color: #718096; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-frame .page-view { background: #f7fafc; padding: 1.6rem 1.2rem; }
.page-frame .preview-tag { text-align: center; font-size: .78rem; color: #718096; margin-top: 1rem; }

.study-detail { background: #fff; border: 1px solid #e2e8f0; border-radius: 12px; padding: 1rem 1.2rem; margin: 0.8rem 0; }
.study-detail h3 { margin: 0 0 0.2rem; }
.study-detail .cite { color: var(--litw-muted); font-size: 0.85rem; margin-bottom: 0.5rem; }
.study-detail dl { display: grid; grid-template-columns: 160px 1fr; gap: 0.25rem 0.8rem; margin: 0; font-size: 0.9rem; }
.study-detail dt { color: var(--litw-muted); font-weight: 600; }
.badge { display: inline-block; font-size: 0.72rem; border-radius: 6px; padding: 0.1rem 0.45rem; margin-left: 0.3rem; }
.badge.built { background: #c6f6d5; color: #22543d; }
.badge.partly { background: #fefcbf; color: #744210; }
.badge.no { background: #fed7d7; color: #742a2a; }
.filter-row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; margin: 0.8rem 0; }

/* clickable study name -> opens the detail drawer */
button.study-link { font: inherit; font-weight: 700; color: #1a73e8; background: transparent; border: none; padding: 0; text-align: left; cursor: pointer; text-decoration: underline; }
button.study-link:hover { color: #0b5cd6; }
button.study-link::after { content: " \203a"; color: var(--litw-muted); font-weight: 400; text-decoration: none; }

/* detail drawer / sidebar */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(26,32,44,0.4); opacity: 0; pointer-events: none; transition: opacity .2s ease; z-index: 900; }
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: 440px; max-width: 92vw; background: #fff; box-shadow: -6px 0 28px rgba(0,0,0,.18); transform: translateX(100%); transition: transform .25s ease; z-index: 901; overflow-y: auto; padding: 1.6rem 1.6rem 2.4rem; }
.drawer.open { transform: translateX(0); }
.drawer-close { position: absolute; top: .5rem; right: .8rem; border: none; background: transparent; font-size: 1.8rem; line-height: 1; cursor: pointer; color: #718096; }
.drawer-close:hover { color: #2d3748; }
.drawer h3 { margin: 0 1.4rem .2rem 0; font-size: 1.25rem; }
.drawer .cite { color: var(--litw-muted); font-size: .85rem; margin-bottom: .7rem; }
.drawer dl { display: grid; grid-template-columns: 130px 1fr; gap: .3rem .8rem; margin: .9rem 0 0; font-size: .9rem; }
.drawer dt { color: var(--litw-muted); font-weight: 600; }
.drawer .drawer-h { margin: 1.2rem 0 .35rem; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--litw-accent); border-bottom: 1px solid #edf0f4; padding-bottom: .25rem; }
.drawer .drawer-h:first-of-type { margin-top: 1rem; }
.drawer p { font-size: .92rem; line-height: 1.5; margin: .35rem 0; }
.drawer .method-list { margin: .35rem 0 .2rem; padding-left: 1.2rem; }
.drawer .method-list li { font-size: .9rem; line-height: 1.45; margin-bottom: .35rem; }

/* segmented tab buttons (e.g. Results trust tier drill-down) */
.seg { font: inherit; font-size: .85rem; padding: .3rem .8rem; border: 1px solid #cbd5e1; background: #fff; color: #334155; border-radius: 999px; cursor: pointer; }
.seg:hover { border-color: #94a3b8; }
.seg.active { background: #1a73e8; border-color: #1a73e8; color: #fff; font-weight: 600; }

/* dependency-free SVG charts on the Results page */
.chart-wrap { overflow-x: auto; margin: .6rem 0 1rem; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1rem; font-size: .85rem; color: #334155; margin: .35rem 0 .2rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend i { display: inline-block; width: 16px; height: 10px; border-radius: 2px; }
