/* Tau Square Studio. A calm, light work surface with the academy's navy and
   gold. Decision colours: green include, amber maybe, red exclude. */

:root {
    --navy: #0b1530; --navy-2: #141f3d; --gold: #c8a96b; --gold-ink: #7a5b22; --gold-bg: #f6efe1;
    --ink: #0b1220; --text: #1f2633; --muted: #5d6576; --line: #dfe3ea; --line-2: #eceff4;
    --bg: #f4f5f8; --card: #fff;
    --green: #1d7a46; --green-bg: #e8f6ee; --amber: #9a6212; --amber-bg: #fff4e0; --red: #b42318; --red-bg: #fdecea;
    --blue: #1f5fbf; --blue-bg: #eaf1fd;
    --radius: 10px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 1px rgba(15, 23, 42, .03);
    font: 15px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--text);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); display: flex; flex-direction: column; }
a { color: var(--blue); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 26px; letter-spacing: -.01em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 1em; }
p { margin: 0 0 .75em; }
kbd { display: inline-block; min-width: 1.6em; padding: 0 .35em; margin-left: .35em; border: 1px solid currentColor; border-radius: 4px; font: 600 11px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; opacity: .75; text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grow { flex: 1; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 10; background: #fff; padding: 6px 10px; }

/* Frame */
.topbar { display: flex; align-items: center; gap: 16px; padding: 0 20px; height: 56px; background: var(--navy); color: #fff; flex: none; }
.brand { color: #fff; text-decoration: none; font-size: 16px; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.brand b { color: var(--gold); font-weight: 600; }
.brand-mark { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; background: var(--navy-2); color: var(--gold); font: 600 15px Georgia, serif; }
/* Academy | Studio: the same switch as on the academy's dashboard. */
.switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid #39425a; border-radius: 9px; background: var(--navy-2); flex: none; }
.switch > * { padding: 5px 10px; border-radius: 6px; font-size: 12.5px; font-weight: 600; color: #aeb6cc; text-decoration: none; white-space: nowrap; }
.switch a:hover { color: #fff; }
.switch .on { background: rgba(200, 169, 107, .16); color: var(--gold); }
.review-name { color: #c5cbe0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The front door (views/welcome.js): navy and gold, like the academy. */
.welcome { min-height: calc(100vh - 56px); display: grid; place-items: center; padding: 56px 20px; color: #c9d0db;
    background: radial-gradient(ellipse 60% 45% at 50% 0%, rgba(200, 169, 107, .2), transparent 70%), radial-gradient(ellipse 50% 60% at 0% 100%, rgba(15, 106, 120, .4), transparent 70%), radial-gradient(ellipse 45% 55% at 100% 85%, rgba(122, 63, 176, .3), transparent 70%), #070b14; }
.welcome-card { width: min(560px, 100%); text-align: center; }
.welcome-orb { width: 84px; height: 84px; margin: 0 auto 22px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #f1dfae, #c8a96b 55%, #7a5b22); color: #03070c; font: italic 500 32px/1 Georgia, 'Times New Roman', serif; box-shadow: 0 0 60px rgba(200, 169, 107, .45); }
.welcome-k { margin: 0 0 12px; font: 600 12px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.welcome h1 { margin: 0 0 14px; color: #fff; font: 400 34px/1.2 Georgia, 'Times New Roman', serif; letter-spacing: -.01em; }
.welcome h1 em { color: var(--gold); }
.welcome p { color: #c9d0db; font-size: 15.5px; }
.welcome b { color: #fff; }
.welcome a { color: var(--gold); }
.welcome-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 8px; }
.welcome .btn { height: 44px; padding: 0 20px; }
.welcome .btn.primary { background: var(--gold); color: #03070c; }
.welcome .btn.primary:hover { background: #d9be85; }
.welcome .btn.ghost { background: transparent; color: #fff; border-color: #39425a; }
.welcome .btn.ghost:hover { border-color: #8a93ab; }
.welcome-foot { margin-top: 30px !important; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .1); font-size: 14px !important; }
.banner.trial { display: block; border: 1px solid #e9d9b5; background: var(--gold-bg); color: #4a3a17; margin-bottom: 20px; }
.banner.trial a { color: var(--gold-ink); font-weight: 600; }
.who { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c5cbe0; }
.who[hidden] { display: none; }
.who select { height: 32px; border-radius: 6px; border: 1px solid #39425a; background: var(--navy-2); color: #fff; padding: 0 8px; }

/* Saving and sync indicator */
.sync { position: relative; }
.sync[hidden] { display: none; }
.sync-pill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: 16px; border: 1px solid #39425a; background: var(--navy-2); color: #fff; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.sync-pill:hover { border-color: #56607a; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; flex: none; }
.tone-green .sync-dot { background: #34c27a; }
.tone-blue .sync-dot { background: #5b9cff; animation: pulse 1s ease-in-out infinite; }
.tone-amber .sync-dot { background: #f2b33d; }
.tone-red .sync-dot { background: #ff6b5e; }
.tone-red { border-color: #8a3a35; }
.sync-detail { color: #aeb6cc; }
@keyframes pulse { 50% { opacity: .35; } }
.sync-panel { position: absolute; right: 0; top: 40px; width: min(380px, 92vw); background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 14px 16px; z-index: 40; font-size: 13.5px; }
.sync-panel h3 { margin: 0 0 8px; font-size: 15px; }
.sync-panel h4 { margin: 12px 0 4px; }
.sync-facts { display: grid; gap: 7px; margin: 0 0 12px; }
.sync-facts > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; }
.sync-facts dt { color: var(--muted); font-weight: 600; }
.sync-facts dd { margin: 0; }
.sync-good { color: var(--green); font-weight: 600; }
.sync-bad { color: var(--red); font-weight: 600; }
.sync-recent { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; font-size: 12.5px; }

/* The account in the top bar */
.account { position: relative; }
.account > .btn.ghost { color: #fff; border-color: #39425a; background: var(--navy-2); }
.page > .card + .muted.small { margin-top: 10px; }
.acct-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px 0 4px; border-radius: 16px; border: 1px solid #39425a; background: var(--navy-2); color: #fff; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.acct-chip:hover { border-color: #56607a; }
.acct-avatar { width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: var(--navy); font-weight: 700; font-size: 11px; display: grid; place-items: center; }
.acct-plan.warn { color: #f2b33d; }
.acct-dot { min-width: 18px; height: 18px; border-radius: 9px; background: #ff6b5e; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.acct-panel { position: absolute; right: 0; top: 40px; width: min(380px, 92vw); background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(15, 23, 42, .18); padding: 14px 16px; z-index: 40; font-size: 13.5px; }
.acct-panel h3 { margin: 12px 0 6px; font-size: 14px; }
.acct-who { margin: 0 0 10px; display: grid; }
.acct-rows { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px 10px; margin: 0 0 10px; }
.acct-rows dt { color: var(--muted); font-weight: 600; }
.acct-rows dd { margin: 0; }
.acct-invites { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.acct-invites li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.acct-actions { justify-content: space-between; margin-top: 12px; }
.signin { max-width: 440px; }
.signin .field { margin: 12px 0 4px; }
.signin-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; margin: 14px 0 10px; }
.signin-or::before, .signin-or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.signin-google { width: 100%; justify-content: center; }
.place p { margin: 6px 0 10px; }
.place .badge { margin-right: 6px; }
.gate { padding-top: 60px; }
.gate-card { padding: 26px 28px; }
.gate-card h1 { font-size: 24px; margin: 0 0 10px; }
.gate-actions { margin-top: 16px; flex-wrap: wrap; }
.folder-ask { max-width: 560px; }

/* Coding sheet */
.coding-strip { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 14px; color: var(--muted); margin: -4px 0 6px; }
.coding-strip b { color: var(--ink); }
.suggest { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-top: 10px; display: grid; gap: 10px; }
.suggest-side { background: var(--bg); border-radius: 8px; padding: 10px 12px; }
.planned-list { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 6px; }
.planned-list li { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; border-bottom: 1px solid var(--line-2); padding-bottom: 6px; }
#planAdd input { flex: 1; min-width: 0; font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; }
.coding-table td { vertical-align: top; }
.coding-table select { font: inherit; font-size: 13px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; max-width: 230px; display: block; margin-bottom: 4px; background: #fff; }
.coding-table tr.off { opacity: .5; }
.coding-table .badge { margin: 3px 4px 0 0; }
.grid-scroll { overflow-x: auto; }
.coding-grid th.vert { height: 150px; white-space: nowrap; vertical-align: bottom; padding: 0 4px 8px; }
.coding-grid th.vert span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); font-weight: 600; font-size: 12.5px; text-transform: none; letter-spacing: 0; }
.coding-grid td.mark { text-align: center; font-size: 15px; }
.coding-grid tr.three td:first-child { box-shadow: inset 3px 0 0 var(--gold); }
.cell-both { color: var(--green); }
.cell-one { color: var(--amber); }
.sheet-download { margin: 0 0 14px; }
.sheet-tabs { display: grid; gap: 14px; }
.sheet-tabs .card { margin: 0; }
.sheet-cols { margin-top: 6px; font-size: 13.5px; }
.sheet-cols td { padding: 6px 10px; }
.sheet-cols td.col-name { width: 38%; font-weight: 600; }
.sheet-cols code, .sheet-tab .col-group code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; font-weight: 500; word-break: break-all; }
.sheet-cols tr.col-group td { background: var(--bg); padding-top: 9px; }
.codebook { margin: 8px 0 12px; padding-left: 22px; display: grid; gap: 7px; }
.codebook li .row { display: inline-flex; margin: 0 0 0 8px; gap: 8px; }
#ruleAdd input { flex: 1; min-width: 0; font: inherit; padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; }
.coding-body h3 { margin: 18px 0 0; font-size: 15px; }
.rule-suggest { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.rule-suggest li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13.5px; }
.lock-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; margin-top: 10px; }
.lock-form .lock-note { grid-column: 1 / -1; }
.lock-form select, .lock-form input { width: 100%; }
.versions { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 8px; }
@media (max-width: 820px) { .lock-form { grid-template-columns: minmax(0, 1fr); } .sheet-cols td.col-name { width: 45%; } }

/* People on this review */
.invite-form { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: end; }
.invite-form .field { margin: 0; }
.colead-ask { display: flex; gap: 14px; align-items: center; justify-content: space-between; background: var(--gold-bg); border: 1px solid #ecd9b0; color: var(--text); margin: 14px 0 4px; }
.colead-ask p { margin: 2px 0 0; color: var(--muted); }
.people-list { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; gap: 2px; }
.person { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 2px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.person-who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.person-state { display: flex; align-items: center; gap: 14px; }
.colead-check { margin: 0; font-weight: 600; }
.colead-check.fixed { opacity: .6; }
.colead-rules { font-size: 13.5px; margin: 6px 0; }
.colead-rules summary { cursor: pointer; font-weight: 600; }
.colead-rules ul { margin: 6px 0; padding-left: 20px; color: var(--muted); }
@media (max-width: 820px) { .invite-form { grid-template-columns: minmax(0, 1fr); } .colead-ask { display: block; } .colead-ask .row { margin-top: 8px; } }
.layout { flex: 1; min-height: 0; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.layout:has(.rail[hidden]) { grid-template-columns: minmax(0, 1fr); }
.rail { background: #fff; border-right: 1px solid var(--line); padding: 18px 12px; overflow: auto; }
.rail[hidden] { display: none; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.steps a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: 14px; }
.steps a:hover { background: var(--bg); }
.steps a[aria-current="page"] { background: var(--gold-bg); color: var(--ink); font-weight: 600; }
.step-n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line-2); font-size: 12px; font-weight: 600; flex: none; }
[aria-current="page"] .step-n { background: var(--gold); color: var(--navy); }
.step-label { flex: 1; }
.step-badge { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--bg); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.rail-later { margin: 22px 10px 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.later { list-style: none; margin: 0; padding: 0 10px; color: #9aa3b2; font-size: 13.5px; display: grid; gap: 6px; }
.rail-home { display: block; margin: 22px 10px 0; font-size: 13px; color: var(--muted); text-decoration: none; }
.view { overflow: auto; outline: none; }
.page { max-width: 1120px; margin: 0 auto; padding: 28px 28px 80px; }
.page.narrow { max-width: 820px; }
.page.wide { max-width: 1320px; padding-top: 18px; }
.page-head { margin-bottom: 20px; }
.page-head .lead { color: var(--muted); max-width: 72ch; font-size: 15.5px; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-ink); margin-bottom: 6px; }
.section-title { margin: 28px 0 12px; }

/* Building blocks */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card { margin-top: 14px; }
.stack { display: grid; gap: 14px; }
.stack > .card + .card { margin-top: 0; }
.stack-sm { display: grid; gap: 8px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.row.wrap { flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-2 > .card + .card, .grid-3 > .card + .card { margin-top: 0; }
.tight { gap: 10px; }
.indent { margin-left: 26px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 4px; height: 38px; padding: 0 16px; border-radius: 8px; font-family: inherit; font-size: 14px; font-weight: 600; line-height: 1; cursor: pointer; border: 1px solid transparent; text-decoration: none; white-space: nowrap; }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn.primary { background: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: #c4cad6; }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger-text { color: var(--red); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn:focus-visible, .reason:focus-visible, a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.file-btn { position: relative; }
.field { display: grid; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 12px; }
.field input, .field textarea, .field select, .map-grid select, .reviewer-row input {
    font-family: inherit; font-size: 14.5px; font-weight: 400; line-height: 1.45; color: var(--text); padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; width: 100%; }
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .reviewer-row input:focus { outline: 2px solid var(--gold); outline-offset: 0; border-color: var(--gold); }
.field input:disabled, .field textarea:disabled { background: var(--bg); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 6px 0 10px; }
.check input { margin-top: 4px; }
.radio { display: flex; gap: 6px; align-items: center; font-size: 13px; white-space: nowrap; }
.reviewer-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto auto; gap: 10px; align-items: center; }
.sticky-save { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 6px; display: flex; gap: 12px; align-items: center; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--line-2); color: var(--text); white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.amber { background: var(--amber-bg); color: var(--amber); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--blue); }
.badge.gold { background: var(--gold-bg); color: var(--gold-ink); }
.chip { font-size: 12px; color: var(--muted); border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.chip.gold { border-color: var(--gold); color: var(--gold-ink); background: var(--gold-bg); }
.banner { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.banner.amber { background: var(--amber-bg); color: #6b4510; border: 1px solid #f0d9ad; }
.banner.red { background: var(--red-bg); color: var(--red); display: block; }
.note { background: var(--blue-bg); color: #1d3f78; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; }
.form-error { color: var(--red); font-weight: 600; font-size: 13.5px; }
.empty { text-align: center; padding: 34px 20px; }
.empty p { color: var(--muted); }
.next-step { margin-top: 22px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.table-card { padding: 8px 12px; }
.table-card h2 { padding: 10px 0 0 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 18px 0 16px; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-family: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--gold); }
.count { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--line-2); font-size: 12px; margin-left: 4px; }
.pager { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.progress { height: 8px; background: var(--line-2); border-radius: 999px; overflow: hidden; flex: 1; min-width: 120px; }
.progress span { display: block; height: 100%; background: var(--gold); border-radius: 999px; transition: width .2s; }
.progress.small { height: 6px; min-width: 100px; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 50; justify-items: end; }
.toast { background: var(--navy); color: #fff; padding: 9px 14px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 8px 24px rgba(0,0,0,.18); transition: opacity .4s; max-width: min(560px, 92vw); }
.toast.error { background: var(--red); }
.toast.out { opacity: 0; }
dialog.ask { border: 0; border-radius: 12px; padding: 0; width: min(500px, 92vw); box-shadow: 0 24px 60px rgba(0,0,0,.3); }
dialog.ask::backdrop { background: rgba(11, 21, 48, .45); }
dialog.ask form { padding: 22px; }
dialog.ask textarea { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; margin-top: 4px; }
.ask-body { color: var(--muted); }
.ask-error { color: var(--red); font-size: 13px; margin-top: 6px; }
.ask-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Your reviews */
.review-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.review-card h2 a { color: var(--ink); text-decoration: none; }
.review-card h2 a:hover { text-decoration: underline; }

/* Import */
.dropzone { display: grid; place-items: center; gap: 4px; padding: 34px 20px; border: 2px dashed #c4cad6; border-radius: 12px; background: #fff; cursor: pointer; text-align: center; color: var(--muted); }
.dropzone strong { color: var(--ink); font-size: 16px; }
.dropzone.over, .dropzone:hover { border-color: var(--gold); background: var(--gold-bg); }
#staged:not(:empty) { margin-top: 16px; }
.staged-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.warnings { background: var(--amber-bg); color: #6b4510; border-radius: 8px; padding: 8px 12px 8px 28px; margin: 8px 0 14px; font-size: 13.5px; }
.preview { margin: 0 0 14px; padding-left: 20px; font-size: 13.5px; }
.mapping { margin-bottom: 12px; }
.mapping summary { cursor: pointer; font-weight: 600; font-size: 13.5px; }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin-top: 10px; font-size: 13px; }
.map-grid label { display: grid; gap: 4px; }

/* Duplicates */
.stats { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.stats > div { display: grid; }
.stat { font-size: 26px; font-weight: 700; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stats-action { margin-left: auto; justify-items: end; gap: 4px; }
.pair-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.compare th:first-child { width: 150px; color: var(--muted); font-weight: 600; font-size: 13px; }
.compare td { width: calc((100% - 150px) / 2); }
.compare tr.differs td { background: #fff8e8; }
.group-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.group-list li { display: flex; justify-content: space-between; gap: 14px; padding: 10px; border-radius: 8px; border: 1px solid var(--line-2); }
.group-list li.primary { border-color: #ead9b4; background: #fffcf5; }
.g-title { font-weight: 600; margin-top: 4px; }
.g-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; }

/* Screening */
.screen-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.screen-count { font-size: 13.5px; color: var(--muted); }
.screen-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.record { padding: 26px 30px; }
.record-meta { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rec-title { font-size: 21px; line-height: 1.35; margin-bottom: 10px; }
.rec-authors { color: var(--text); margin-bottom: 4px; }
.rec-cite { color: var(--muted); font-size: 13.5px; }
.rec-cite a { color: var(--blue); }
.dot { color: #b3b9c6; margin: 0 6px; }
.abstract { font-size: 16px; line-height: 1.7; color: #1b2230; margin: 18px 0; max-width: 78ch; }
.abstract p { margin-bottom: .8em; }
.ab-label { color: var(--ink); }
.rec-keywords { font-size: 13.5px; color: var(--muted); }
mark.kw-in { background: #d9f2e2; color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -2px 0 #6cc08f; }
mark.kw-out { background: #fbe0dc; color: inherit; border-radius: 3px; padding: 0 1px; box-shadow: inset 0 -2px 0 #e58b7f; }
.decide { position: sticky; top: 14px; }
.decision-buttons { display: grid; gap: 8px; }
.decision-buttons.two { grid-template-columns: 1fr 1fr; margin-top: 10px; }
.decision-buttons .btn { height: 46px; font-size: 15px; justify-content: space-between; border: 2px solid transparent; }
.btn.include { background: var(--green-bg); color: var(--green); border-color: #bfe4cd; }
.btn.maybe { background: var(--amber-bg); color: var(--amber); border-color: #f0d9ad; }
.btn.exclude { background: var(--red-bg); color: var(--red); border-color: #f4c4bd; }
.btn.include:hover, .btn.include.chosen { background: var(--green); color: #fff; }
.btn.maybe:hover, .btn.maybe.chosen { background: #b7791f; color: #fff; }
.btn.exclude:hover, .btn.exclude.chosen { background: var(--red); color: #fff; }
.your-decision { font-size: 13.5px; background: var(--bg); padding: 8px 10px; border-radius: 8px; margin: 12px 0 0; }
.decide h3 { margin-top: 18px; font-size: 13.5px; }
.reasons { display: grid; gap: 4px; }
.reason { text-align: left; font-family: inherit; font-size: 13.5px; line-height: 1.3; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 6px 8px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.reason kbd { margin: 0; }
.reason:hover { border-color: #c4cad6; }
.reason.on { background: var(--red-bg); border-color: #f4c4bd; color: var(--red); font-weight: 600; }
.note-field { margin-top: 14px; }
.criteria { margin-top: 6px; font-size: 13.5px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.criteria summary { cursor: pointer; font-weight: 600; }
.criteria ul { margin: 4px 0; padding-left: 18px; }
.criteria ul.crit-list { padding-left: 0; list-style: none; }
.crit-list li { margin: 3px 0; }
.ck { display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 1px 5px; border-radius: 4px; margin-right: 2px; vertical-align: 1px; }
.ck.in { color: var(--green); background: var(--green-bg); }
.ck.out { color: var(--red); background: var(--red-bg); }
.fw-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: end; }
.fw-row p { margin: 0 0 14px; }
.fw-help { margin: 0 0 14px; font-size: 14px; }
.fw-help summary { cursor: pointer; color: var(--blue); }
.fw-help th { white-space: nowrap; }
fieldset.crit-part { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px 2px; margin: 0; min-width: 0; }
.crit-part legend { padding: 0 6px; font-weight: 600; }
.crit-letter { display: inline-block; min-width: 22px; padding: 1px 5px; margin-right: 8px; border-radius: 6px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; text-align: center; }
.crit-part textarea { min-height: 52px; }
.nav-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.keys-help { position: fixed; right: 24px; bottom: 24px; width: 340px; z-index: 20; box-shadow: 0 18px 48px rgba(0,0,0,.2); }
.keys-help dl { display: grid; grid-template-columns: 54px 1fr; gap: 6px 10px; margin: 0; font-size: 13.5px; }
.keys-help dt { font-weight: 700; font-family: ui-monospace, Menlo, Consolas, monospace; }
.keys-help dd { margin: 0; }
.done { text-align: center; padding: 40px 20px; }
.votes { display: grid; gap: 10px; }
.vote { display: grid; gap: 3px; padding: 10px; border: 1px solid var(--line-2); border-radius: 8px; }

/* Agreement and PRISMA */
.kappa-grid { display: flex; gap: 30px; flex-wrap: wrap; margin: 10px 0 16px; }
.kappa-grid > div { display: grid; }
.twobytwo { max-width: 520px; margin-bottom: 8px; }
.twobytwo th { font-weight: 600; font-size: 13px; text-transform: none; letter-spacing: 0; }
.methods { margin: 8px 0 12px; padding: 14px 16px; background: var(--bg); border-left: 3px solid var(--gold); border-radius: 0 8px 8px 0; font-size: 14.5px; line-height: 1.65; }
.ai-use { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.ai-use h3 { margin: 0 0 2px; }
.prisma-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.prisma-card { overflow: auto; padding: 12px; }
.prisma-card svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }

@media (max-width: 1100px) {
    .screen-grid, .prisma-layout { grid-template-columns: minmax(0, 1fr); }
    .decide { position: static; }
}
@media (max-width: 820px) {
    .layout { grid-template-columns: minmax(0, 1fr); }
    .rail { border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
    .steps { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; }
    .rail-later, .later, .rail-home { display: none; }
    .grid-2, .grid-3, .fw-row { grid-template-columns: minmax(0, 1fr); }
    .sync-detail { display: none; }
    .sync-pill { padding: 0 10px; }
}
@media (max-width: 480px) {
    .topbar { gap: 10px; padding: 0 12px; }
    .who select { max-width: 120px; }
    .sync-label { display: none; }
    /* No room for the switch: the account panel links back to the academy instead. */
    .acct-plan, .brand-name, .switch { display: none; }
    .acct-chip { padding-right: 4px; }
    .sync-pill { padding: 0 11px; }
    .fw-row p { margin-top: -6px; }
    .page { padding: 18px 16px 60px; }
    .record { padding: 18px; }
    .reviewer-row { grid-template-columns: 1fr 70px; }
    .review-name { display: none; }
    .who-label { display: none; }
    .toasts { left: 12px; right: 12px; bottom: 78px; justify-items: stretch; }
    /* Decide with a thumb: the three buttons stay at the bottom of the screen. */
    .decide .decision-buttons { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; grid-template-columns: repeat(3, 1fr); background: #fff; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(15, 23, 42, .08); }
    .decide .decision-buttons.two { grid-template-columns: 1fr 1fr; }
    .decide .decision-buttons .btn { height: 50px; justify-content: center; }
    .decide .decision-buttons kbd { display: none; }
    .page.wide { padding-bottom: 96px; }
}

/* Full texts */
.ft-tools { margin: 16px 0; align-items: stretch; }
.ft-tools .dropzone { height: 100%; }
.ft-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ft-row { display: flex; justify-content: space-between; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.ft-main { min-width: 0; }
.ft-title { font-weight: 600; color: var(--ink); text-decoration: none; }
.ft-title:hover { text-decoration: underline; }
.ft-status { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ft-actions { display: flex; gap: 6px; align-items: flex-start; flex-wrap: wrap; justify-content: flex-end; flex: none; }
.file-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; background: var(--green-bg); color: var(--green); border-radius: 999px; padding: 2px 4px 2px 10px; }
.chip-x { border: 0; background: none; color: inherit; font-size: 15px; line-height: 1; cursor: pointer; padding: 0 6px; }
.match-card { margin-top: 14px; border-color: #f0d9ad; background: #fffaf0; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-2); }
.match-row select { width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 7px; font: inherit; font-size: 13.5px; }
.tabs.sub { margin-top: 0; border-bottom-style: dashed; }

/* Reader */
.ft-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
.reader-card { padding: 0; overflow: hidden; }
.reader-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.reader-bar select { max-width: 60%; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13px; }
.find { display: flex; align-items: center; gap: 8px; }
.find input { width: 190px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: 13.5px; }
.reader-slot { height: calc(100vh - 205px); min-height: 420px; overflow: auto; background: #e9ebf0; padding: 18px; position: relative; }
.reader-empty { margin: 18vh auto 0; max-width: 360px; text-align: center; color: var(--muted); }
.reader-status { padding: 20px; }
.pdf-page { position: relative; margin: 0 auto 14px; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.pdf-page canvas { display: block; }
.pdf-page-no { position: absolute; top: 4px; right: 6px; font-size: 11px; color: #9aa3b2; }
.hl { position: absolute; pointer-events: none; border-radius: 2px; background: rgba(255, 214, 0, .34); mix-blend-mode: multiply; }
.hl.strong { background: rgba(255, 153, 0, .55); outline: 2px solid #e07b00; }
::highlight(quote) { background-color: rgba(255, 214, 0, .45); }
::highlight(quote-strong) { background-color: rgba(255, 153, 0, .6); }
.hl-block { background: rgba(255, 214, 0, .3); }
.oa-article { background: #fff; max-width: 760px; margin: 0 auto; padding: 28px 34px; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); font-size: 15.5px; line-height: 1.65; }
.oa-article h3 { font-size: 17px; margin-top: 1.4em; }
.oa-article h4 { text-transform: none; letter-spacing: 0; font-size: 15px; color: var(--ink); }
.oa-table, .oa-fig { margin: 16px 0; font-size: 13.5px; }
.oa-table figcaption, .oa-fig figcaption { margin-bottom: 6px; }
.table-scroll { overflow-x: auto; }
.oa-table table { border-collapse: collapse; width: 100%; }
.oa-table td, .oa-table th { border: 1px solid var(--line); padding: 4px 8px; text-align: left; vertical-align: top; }
.oa-table th { background: var(--bg); }
.ft-rec-title { font-size: 16.5px; line-height: 1.35; margin: 4px 0 6px; }
.ft-grid .decide { max-height: calc(100vh - 120px); overflow: auto; }
.check.contact { margin-top: 12px; font-size: 13.5px; }

/* AI */
.ai-panel { margin-top: 14px; border-top: 1px solid var(--line-2); padding-top: 12px; }
.ai-panel h3 { margin: 0 0 6px; font-size: 13.5px; }
.ai-criteria { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; }
.ai-criteria li { display: grid; gap: 4px; }
.ai-row { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ai-criteria .src { margin-top: 2px; }
.src { text-align: left; font-family: inherit; font-size: 12.5px; line-height: 1.45; color: var(--text); background: #f6f7f9; border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; cursor: pointer; }
.src b { color: var(--muted); font-weight: 600; margin-right: 6px; }
.src:hover { border-color: var(--gold); }
.banner.small { font-size: 13px; padding: 8px 10px; display: block; }
.banner.green { background: var(--green-bg); color: #145c34; border: 1px solid #bfe3cc; }

/* Power calculator */
.pw-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; margin: 14px 0 6px; align-items: start; }
.pw-form .an-set input, .pw-form .an-set select { font: inherit; font-size: 13.5px; font-weight: 400; color: var(--text); padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; width: 100%; max-width: none; }
.pw-effect { display: grid; gap: 3px; }
.pw-stats .stat { font-size: 24px; }
.pw-stats .stat-label { max-width: 230px; }
@media (max-width: 820px) { .pw-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .pw-form { grid-template-columns: minmax(0, 1fr); } }

/* Extraction */
.verify { max-height: calc(100vh - 120px); overflow: auto; }
.vactive { border: 1px solid var(--line); border-left: 4px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 10px 0 14px; display: grid; gap: 8px; }
.vactive.light-red { border-left-color: var(--red); }
.vactive.light-amber { border-left-color: var(--amber); }
.vactive.light-green { border-left-color: var(--green); }
.vactive-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.vactive p { margin: 0; }
.vais { display: grid; gap: 8px; }
.vai { display: grid; gap: 4px; font-size: 13.5px; }
.vai-value { font-weight: 700; margin-left: 4px; }
.vreasons { margin: 0; padding-left: 18px; font-size: 13px; color: #8a3b12; display: grid; gap: 2px; }
.vform { display: grid; gap: 8px; }
.vform .field { margin: 0; }
.vgroup { margin: 14px 0 6px; font-size: 13.5px; }
.vcells { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.vcell { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 6px; cursor: pointer; font-size: 13.5px; }
.vcell:hover { background: var(--bg); }
.vcell.on { background: var(--gold-bg); outline: 1px solid var(--gold); }
.vcell.done { color: var(--muted); }
.vcell-name { overflow: hidden; text-overflow: ellipsis; }
.vcell-value { font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #c9ced8; display: inline-block; }
.dot.red { background: var(--red); }
.dot.amber { background: var(--amber); }
.dot.green { background: var(--green); }
.dot.done { background: transparent; border: 2px solid var(--green); width: 6px; height: 6px; }
.vdone { margin-top: 10px; }
.vdone summary { cursor: pointer; font-size: 13.5px; font-weight: 600; }
.method-summary p { margin: 0 0 6px; }
.stage.green { border-left: 4px solid var(--green); }
.stage.red { border-left: 4px solid var(--red); }
.kappa-big { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin: 6px 0 10px; }
.kappa-big b { font-size: 30px; }
.light-form { align-items: end; margin-top: 12px; }
.light-form .field { margin: 0; }
.light-form .grow { flex: 1; min-width: 220px; }
.extract-table td, .diff-table td { vertical-align: top; }
.diff-table td:first-child { white-space: nowrap; }

/* Studies */
.study-report { padding: 10px; border: 1px solid var(--line-2); border-radius: 8px; }
.study h3 { margin: 0; }

@media (max-width: 1100px) {
    .ft-grid { grid-template-columns: minmax(0, 1fr); }
    .reader-slot { height: 70vh; }
}
@media (max-width: 820px) {
    .ft-row { flex-direction: column; }
    .ft-actions { justify-content: flex-start; }
    .match-row { grid-template-columns: minmax(0, 1fr); }
    .reader-slot { height: 60vh; padding: 8px; }
    .oa-article { padding: 18px; }
}

/* Analysis */
.r-status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 10px; margin: -6px 0 16px; }
.r-dot { width: 8px; height: 8px; border-radius: 50%; background: #c4cad6; flex: none; }
.r-status.starting .r-dot { background: var(--gold); animation: pulse 1.2s ease-in-out infinite; }
.r-status.ready .r-dot { background: var(--green); }
.r-status.failed { color: var(--red); border-color: #f4c4bd; }
.r-status.failed .r-dot { background: var(--red); }
@keyframes pulse { 50% { opacity: .3; } }
.an-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; align-items: start; }
.an-side { position: sticky; top: 12px; display: grid; gap: 10px; }
.an-side-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.an-list { display: grid; gap: 6px; }
.an-item { display: grid; gap: 2px; padding: 9px 11px; border-radius: 8px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--text); }
.an-item:hover { border-color: #c4cad6; }
.an-item[aria-current="page"] { border-color: var(--gold); background: var(--gold-bg); }
.an-name { font-weight: 600; color: var(--ink); font-size: 14px; }
.an-meta { font-size: 12px; color: var(--muted); }
.an-main { min-width: 0; }
.an-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.an-head h2 { font-size: 21px; margin: 0 0 2px; }
.an-head-actions { display: flex; gap: 6px; }
.an-tabs { overflow-x: auto; scrollbar-width: thin; margin-top: 12px; }
.an-tabs button { white-space: nowrap; }
.an-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.grid-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
table.grid { border-collapse: collapse; font-size: 13.5px; min-width: 100%; }
table.grid th { font-size: 12px; color: var(--muted); font-weight: 700; text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--line); background: #fafbfc; white-space: nowrap; }
table.grid th.g-head { text-align: center; color: var(--ink); border-bottom: 1px solid var(--line-2); }
table.grid td { padding: 2px 3px; border-bottom: 1px solid var(--line-2); }
table.grid .g-use { text-align: center; width: 40px; }
table.grid tr.off td { background: #f6f7f9; }
table.grid tr.off .cell { color: #9aa3b2; text-decoration: line-through; }
table.grid tr.bad td { background: #fff6f5; }
.cell { font: inherit; font-size: 13.5px; width: 96px; padding: 6px 7px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--text); }
.cell.num { width: 74px; text-align: right; font-variant-numeric: tabular-nums; }
.cell.wide { width: 190px; }
.cell.narrow { width: 62px; }
select.cell { width: 128px; padding: 5px 4px; }
.cell:hover { border-color: var(--line); }
.cell:focus { outline: none; border-color: var(--gold); background: #fff; box-shadow: 0 0 0 2px rgba(200, 169, 107, .25); }
.cell.invalid { border-color: #e9a59c; background: #fff1ef; }
td.derived { color: var(--muted); font-size: 13px; padding: 0 8px; white-space: nowrap; }
.grid-empty { padding: 18px !important; text-align: center; }
.row-x, .col-menu { border: 0; background: none; color: #9aa3b2; font-size: 17px; line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.row-x:hover { color: var(--red); background: var(--red-bg); }
.col-menu { font-size: 13px; padding: 0 4px; }
.col-menu:hover { color: var(--ink); background: var(--bg); }
.issues { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.issue { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; font-size: 13.5px; border: 1px solid; }
.issue p { margin: 0 0 4px; }
.issue.block { background: var(--red-bg); border-color: #f4c4bd; color: #7f1d16; }
.issue.warn { background: var(--amber-bg); border-color: #f0d9ad; color: #6b4510; }
.issue.info { background: var(--blue-bg); border-color: #cddcf5; color: #1d3f78; }
.issue.acked { background: #f6f7f9; border-color: var(--line); color: var(--text); }
.issue-tag { flex: none; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, .7); margin-top: 1px; }
.issue-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.link-btn { border: 0; background: none; color: var(--blue); text-decoration: underline; cursor: pointer; font: inherit; padding: 0; }
.an-settings { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 14px 16px; margin-bottom: 14px; }
.an-set { display: grid; gap: 4px; font-size: 12px; font-weight: 700; color: var(--muted); }
.an-set select, .an-set input:not([type]) { font: inherit; font-size: 13.5px; font-weight: 400; color: var(--text); padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: #fff; max-width: 330px; }
.an-set.check-set { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); font-size: 13px; }
.an-summary { margin-bottom: 14px; }
.an-big { font-size: 26px; font-weight: 700; color: var(--ink); margin: 0 0 2px; font-variant-numeric: tabular-nums; }
.an-big span { font-size: 17px; font-weight: 500; color: var(--text); }
.an-sub { color: var(--muted); font-size: 14px; }
.an-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 18px; margin: 12px 0 0; }
.an-stats div { border-top: 1px solid var(--line-2); padding-top: 8px; }
.an-stats dt { font-size: 12px; font-weight: 700; color: var(--muted); }
.an-stats dd { margin: 2px 0 0; font-size: 14px; }
.an-stats small { color: var(--muted); }
.an-fig { margin-top: 14px; }
.an-fig h3 { margin: 0; }
.an-figtools { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-right: 6px; }
.an-figtools .an-set { font-size: 11.5px; }
.fp-opts { margin-top: 10px; border: 1px solid var(--line-2); border-radius: 8px; background: #fafbfc; }
.fp-opts > summary { cursor: pointer; padding: 8px 12px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.fp-opts[open] > summary { border-bottom: 1px solid var(--line-2); }
.fp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 18px; padding: 12px; }
.fp-grid fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; align-content: start; }
.fp-grid legend { font-size: 12px; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.fp-grid .radio { white-space: normal; font-size: 13px; }
.fp-layout { gap: 8px !important; }
.fp-layout .an-set input { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; width: 100%; }
.an-soon { margin-top: 8px; padding: 10px 12px; border: 1px dashed #c4cad6; border-radius: 8px; background: #fff; }
.an-soon ul { margin: 4px 0 0; padding-left: 16px; font-size: 13px; color: var(--muted); display: grid; gap: 2px; }
.an-empty .an-soon { text-align: left; max-width: 360px; margin: 18px auto 0; }
.an-plot { overflow-x: auto; margin-top: 12px; }
.an-plot svg { display: block; max-width: 100%; height: auto; }
.table thead th.nocase { text-transform: none; }
.an-controls { display: grid; gap: 12px; margin-bottom: 14px; }
.an-radios, .an-mods { border: 0; padding: 0; margin: 0; display: flex; gap: 6px 16px; flex-wrap: wrap; align-items: center; }
.an-radios legend, .an-mods legend { font-size: 12px; font-weight: 700; color: var(--muted); padding: 0; margin-bottom: 4px; width: 100%; }
.an-ref { font-size: 12.5px; color: var(--muted); margin-left: -8px; margin-right: 8px; }
.an-ref select { font: inherit; font-size: 12.5px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 5px; }
.an-test { margin: 10px 10px 4px; }
.an-notes { font-size: 13px; color: var(--muted); padding-left: 20px; margin: 10px 0; }
.an-notes li { margin-bottom: 3px; }
.an-wait { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.an-blocked h3 { margin-top: 0; }
.r-notes { margin-top: 14px; font-size: 13px; color: var(--muted); }
.r-notes summary { cursor: pointer; }
.rcode { background: #0f172a; color: #e2e8f0; padding: 14px; border-radius: 8px; overflow: auto; max-height: 460px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.refs { font-size: 13.5px; padding-left: 20px; margin: 0; display: grid; gap: 4px; }
.table tr.flag td { background: #fff6f5; }
.an-empty { max-width: 640px; }
dialog.wide-ask { width: min(620px, 94vw); }
.ask-form { display: grid; gap: 4px; margin-top: 10px; max-height: 64vh; overflow: auto; }
.kind-pick { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.kind-pick legend { font-size: 13.5px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.kind-pick.compact { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.kind-opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.kind-opt:has(input:checked) { border-color: var(--gold); background: var(--gold-bg); }
.kind-opt input { margin-top: 3px; }
.kind-opt span { display: grid; gap: 1px; font-size: 13.5px; }
.kind-opt small { color: var(--muted); }
.sd-out { margin: 4px 0 0; }

@media (max-width: 1000px) {
    .fp-grid { grid-template-columns: minmax(0, 1fr); }
    .an-layout { grid-template-columns: minmax(0, 1fr); }
    .an-side { position: static; }
    .an-list { grid-auto-flow: column; grid-auto-columns: minmax(180px, max-content); overflow-x: auto; }
}
@media (max-width: 820px) {
    .an-head { flex-direction: column; }
    .an-settings { padding: 12px; }
    .an-set select { max-width: 100%; }
    .an-big { font-size: 22px; }
    .an-plot svg { max-width: none; }
}

/* Risk of bias (step 11) */
.rob-part { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; background: #fff; }
.rob-part-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; background: none; font: inherit; font-size: 14px; text-align: left; cursor: pointer; color: var(--ink); border-radius: 8px; }
.rob-part-head:hover { background: var(--bg); }
.rob-part-name { flex: 1; min-width: 0; }
.rob-part-head .count { margin-left: auto; }
.rob-part-body { padding: 4px 12px 12px; display: grid; gap: 10px; }
.rob-overall { border-color: var(--gold); }
.rob-overall h3 { display: flex; align-items: center; gap: 8px; margin: 6px 0 0; }
.rob-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; white-space: nowrap; background: var(--line-2); color: var(--text); }
.rob-pill.risk-low, .opt.lvl.on.risk-low, .gb-low { background: #2b8a3e; color: #fff; border-color: #2b8a3e; }
.rob-pill.risk-some, .opt.lvl.on.risk-some, .gb-some { background: #e8a800; color: #111827; border-color: #e8a800; }
.rob-pill.risk-high, .opt.lvl.on.risk-high, .gb-high { background: #c92a2a; color: #fff; border-color: #c92a2a; }
.rob-pill.risk-critical, .opt.lvl.on.risk-critical, .gb-critical { background: #5c1010; color: #fff; border-color: #5c1010; }
.rob-pill.risk-unclear, .opt.lvl.on.risk-unclear { background: #8f9ba8; color: #fff; border-color: #8f9ba8; }
.rob-pill.none { background: var(--line-2); color: var(--muted); font-weight: 600; }
.rob-qs { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rob-q { border: 1px solid var(--line-2); border-radius: 7px; padding: 8px 10px; display: grid; gap: 6px; }
.rob-q.on { outline: 2px solid var(--gold); border-color: var(--gold); }
.rob-q.answered { background: #fbfbfc; }
.rob-q-text { font-size: 13.5px; }
.rob-q-text .muted { display: block; margin-top: 1px; }
.rob-opts { display: flex; flex-wrap: wrap; gap: 4px; }
.rob-opts.stack { display: grid; }
.opt { font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; text-align: left; }
.opt:hover:not(:disabled) { border-color: var(--gold); }
.opt.on { background: var(--navy); border-color: var(--navy); color: #fff; }
.opt:disabled { cursor: default; opacity: .75; }
.rob-fact { font-size: 13px; display: grid; gap: 4px; padding: 8px 10px; background: var(--bg); border-radius: 7px; }
.rob-fact-label { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.rob-ai { display: grid; gap: 3px; }
.rob-computed { font-size: 13px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 7px; }
.rob-computed ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.rob-judgement { font-size: 13.5px; }
.rob-note { margin: 0; }
.rob-other { font-size: 13.5px; margin: 8px 0; }
.rob-other summary, .rob-settings summary, .grade-settings summary { cursor: pointer; font-weight: 600; }
.src.bad { border-color: var(--red); background: var(--red-bg); }
.stars { color: var(--gold-ink); letter-spacing: 1px; }
.rob-ans { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 12.5px; color: var(--muted); }
.rob-figures { display: grid; gap: 18px; }
.rob-figure { margin: 0; }
.fig-scroll { overflow-x: auto; }
.fig-scroll svg { display: block; max-width: none; }
.rob-tools select, .rob-table select, .grade-table select { font: inherit; font-size: 13px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; max-width: 260px; background: #fff; }
.rob-settings { margin: 12px 0; }
.check-list { display: grid; gap: 2px; }
.check-list .check { margin: 2px 0; }

/* Certainty of the evidence, GRADE (step 13) */
.grade-pill { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.grade-pill.g-high { background: var(--green-bg); color: var(--green); }
.grade-pill.g-moderate { background: var(--blue-bg); color: var(--blue); }
.grade-pill.g-low { background: var(--amber-bg); color: var(--amber); }
.grade-pill.g-verylow { background: var(--red-bg); color: var(--red); }
.grade-table tr.confirmed td:first-child { box-shadow: inset 3px 0 0 var(--green); }
.grade-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin-top: 6px; background: var(--line-2); max-width: 260px; }
.grade-bar span { display: block; height: 100%; }
.gb-unclear, .gb-none { background: #c5cbd3; }
.grade-statement { font-style: italic; margin: 12px 0 0; }
.grade-settings { margin-top: 12px; font-size: 13.5px; }
.sof td, .sof th { font-size: 13.5px; }
.sof-notes { font-size: 12.5px; color: var(--muted); padding-left: 22px; display: grid; gap: 2px; }
