/*
 * Storybank, design direction B ("Clear"): cool white, one typeface, blue, compact.
 * Shared by the staff app and the journalist area. Chosen 20 October 2026.
 * IBM Plex Sans if the device has it, otherwise the system's own sans-serif:
 * no font is fetched from another site (nothing outside the Storybank sees who signs in).
 */
:root {
	--ground: #F4F6F9;
	--surface: #FFFFFF;
	--column: #EBEFF5;
	--inset: #F4F6F9;
	--ink: #0F172A;
	--muted: #475569;
	--line: #DDE3EC;
	--rule: #E5EAF1;
	--todo: #CBD5E1;
	--accent: #1D4ED8;
	--accent-hover: #1E40AF;
	--accent-ink: #FFFFFF;
	--accent-soft: #EEF2FF;
	--alert: #B42318;
	--alert-soft: #FEF3F2;
	--ok: #1B5E2E;
	--ok-soft: #E3F1E6;
	--warn: #6B4A00;
	--warn-soft: #FFF1C2;
	--green-bg: #E3F1E6; --green-ink: #1B5E2E;
	--yellow-bg: #FFF1C2; --yellow-ink: #6B4A00;
	--red-bg: #FBE0DE; --red-ink: #8F1D16;
	--none-bg: #EEF2F7; --none-ink: #334155;
	--radius: 6px;
	--gap: 10px;
	--font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 15px/1.5 var(--font); }
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ frame */

.sb-bar { background: var(--surface); border-bottom: 1px solid var(--line); }
.sb-bar-in { max-width: 1240px; margin: 0 auto; padding: 12px max(16px, env(safe-area-inset-left)); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.sb-brand { font-weight: 600; font-size: 19px; color: var(--ink); text-decoration: none; margin-right: auto; }
.sb-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.sb-nav a { color: var(--ink); text-decoration: none; padding: 6px 0; }
.sb-nav a[aria-current="page"] { font-weight: 600; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 2px; }
.sb-who { font-size: 14px; color: var(--muted); display: flex; gap: 14px; align-items: center; }
.sb-who a { color: var(--muted); }
.sb-main { max-width: 1240px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-left)) 48px; }
.sb-main.narrow { max-width: 880px; }
.sb-foot { max-width: 1240px; margin: 0 auto; padding: 0 16px 32px; font-size: 13px; color: var(--muted); }

/* ------------------------------------------------------------ type */

h1 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.2; text-wrap: balance; }
h2 { margin: 0 0 10px; font-size: 18px; font-weight: 600; }
h3 { margin: 0 0 6px; font-size: 15px; font-weight: 600; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.back { display: inline-block; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.eyebrow { font-size: 14px; color: var(--muted); margin: 0 0 4px; }

/* ------------------------------------------------------------ layout */

.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 20px; }
.page-head h1 { margin-right: auto; }
.page-head .lede { flex: 1 0 100%; color: var(--muted); margin: 0; max-width: 72ch; }
.split { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.split > .wide { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.split > .side { flex: 1 1 300px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel > h2:first-child { margin-top: 0; }
.panel.tight { padding: 14px 16px; }
.inset { background: var(--inset); border-radius: var(--radius); padding: 14px 16px; }

/* ------------------------------------------------------------ queue */

.queue { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--gap); align-items: start; }
.col { background: var(--column); border-radius: var(--radius); padding: 10px; min-width: 0; }
.col h2 { font-size: 14px; display: flex; justify-content: space-between; margin: 2px 2px 10px; }
.col h2 span { color: var(--muted); font-weight: 400; }
.card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 12px; margin-bottom: 8px; color: var(--ink); text-decoration: none; }
.card:hover { border-color: var(--accent); color: var(--ink); }
.card strong { display: block; font-weight: 600; margin-bottom: 6px; overflow-wrap: anywhere; }
.card .meta { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
.card .flag { display: block; font-size: 13px; font-weight: 600; color: var(--alert); margin-top: 4px; }
.col .empty { font-size: 13px; color: var(--muted); padding: 4px 4px 8px; }
.col.needs-you { box-shadow: inset 0 0 0 2px var(--accent); }
.col .needs { font-size: 13px; font-weight: 600; color: var(--accent); margin: -4px 4px 8px; }
.col .more { display: block; font-size: 14px; font-weight: 600; padding: 6px 4px 2px; }
.state-links { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 var(--gap); }
.state-links .count { font-weight: 400; color: var(--muted); }
table.stories td { vertical-align: top; }
table.stories .ref { display: block; font-size: 12px; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin: var(--gap) 0; }
.queue-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.queue-tools input, .queue-tools select { width: auto; }
.queue-tools input[type=search] { width: 240px; max-width: 100%; }

/* ------------------------------------------------------------ badges */

.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 1px 9px; border-radius: 999px; background: var(--none-bg); color: var(--none-ink); white-space: nowrap; }
.risk-green { background: var(--green-bg); color: var(--green-ink); }
.risk-yellow { background: var(--yellow-bg); color: var(--yellow-ink); }
.risk-red { background: var(--red-bg); color: var(--red-ink); }
.state { background: var(--accent-soft); color: var(--accent); }
.badge.off { background: var(--alert-soft); color: var(--alert); }
.chip { display: inline-block; font-size: 13px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: #EEF2F7; margin: 0 4px 4px 0; }

/* ------------------------------------------------------------ buttons */

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--accent); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.outline { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.btn.danger { background: var(--alert); border-color: var(--alert); color: #fff; font-weight: 600; }
.btn.danger:hover { background: #912018; color: #fff; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.big { min-height: 48px; padding: 0 22px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* ------------------------------------------------------------ forms */

.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .label { font-size: 14px; font-weight: 600; }
.field .hint { font-size: 13px; color: var(--muted); margin: 0; }
.fields { display: grid; gap: 14px; }
.fields.two { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=month], input[type=search], select, textarea {
	width: 100%; font: inherit; color: var(--ink); background: var(--surface); padding: 8px 11px; border: 1px solid #C7D0DC; border-radius: var(--radius); min-height: 40px;
}
input[type=number] { max-width: 9em; }
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check.plain { border: 0; padding: 4px 0; background: none; }
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.choices .check { padding: 9px 12px; }
.risk-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.risk-choice label { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; }
.risk-choice .risk-head { display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: 16px; }
.risk-choice .risk-what { font-size: 13px; line-height: 1.45; }
.risk-choice .risk-what strong { display: block; font-weight: 600; margin-bottom: 2px; }
.risk-choice label:has(input:disabled) { opacity: .55; cursor: not-allowed; }
.risk-choice input { accent-color: var(--accent); }
.risk-choice label:has(input:checked) { outline: 2px solid var(--accent); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 120px; padding: 16px; border: 2px dashed #93A9E8; border-radius: var(--radius); background: var(--surface); text-align: center; cursor: pointer; }
.dropzone strong { color: var(--accent); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone.has-files { border-style: solid; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 14px; font-weight: 600; padding: 0; margin-bottom: 6px; }

/* ------------------------------------------------------------ data */

dl.facts { display: grid; grid-template-columns: minmax(110px, 180px) 1fr; gap: 8px 14px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; min-width: 0; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 10px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.list tr:last-child td { border-bottom: 0; }
.files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.files li { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.files .icon { flex: 0 0 28px; height: 28px; border-radius: 999px; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.files .ok .icon { background: var(--ok-soft); color: var(--ok); }
.files .wait .icon { background: #E7ECF3; color: var(--muted); }
.files .bad .icon { background: var(--red-bg); color: var(--red-ink); }
.files .body { min-width: 0; flex: 1 1 200px; }
.files .name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.files .status { display: block; font-size: 14px; }
.files .ok .status { color: var(--ok); }
.files .bad .status { color: var(--alert); }
.files .tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { padding: 10px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.history li:first-child { border-top: 0; }
.history .when { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------ notices */

.notice { padding: 12px 16px; border-radius: var(--radius); border: 1px solid #BFDBFE; background: var(--accent-soft); margin-bottom: 16px; }
.notice.success { border-color: #A7D7B5; background: var(--ok-soft); color: #14432A; }
.notice.error { border-color: #F5B5AE; background: var(--alert-soft); color: #7A1A12; }
.notice.warning { border-color: #F2D27A; background: var(--warn-soft); color: #4D3500; }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.callout { border-radius: var(--radius); padding: 14px 18px; }
.callout.red { background: var(--red-bg); color: #5C130E; }
.callout.yellow { background: var(--yellow-bg); color: #3D2B00; }
.callout.green { background: var(--green-bg); color: #123F20; }
.callout.alert { background: var(--alert-soft); color: #7A1A12; border: 1px solid #F5B5AE; }

/* ------------------------------------------------------------ guided approval */

.steps { list-style: none; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.steps li { border-top: 4px solid var(--todo); padding-top: 8px; font-size: 14px; }
.steps li.done, .steps li.now { border-top-color: var(--accent); }
.steps li b { display: block; font-weight: 600; }
.steps li.now b { color: var(--accent); }
.steps li span { color: var(--muted); }
.step { display: block; }
.js .step[hidden] { display: none; }
.step-of { font-size: 14px; font-weight: 600; color: var(--accent); margin: 0 0 6px; }
@media (max-width: 640px) {
	.sb-who > span { display: none; }
	.files .tools { margin-left: 40px; }
	.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	h1 { font-size: 24px; }
	dl.facts { grid-template-columns: 1fr; gap: 2px; }
	dl.facts dd { margin-bottom: 8px; }
	.sticky-save { position: sticky; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); margin: 0 -16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) {
	.card, .btn { transition: border-color .12s, background-color .12s; }
}

/* Narrow columns: facts stack, label above value. */
.side dl.facts { grid-template-columns: 1fr; gap: 2px; }
.side dl.facts dt { font-size: 13px; }
.side dl.facts dd { margin-bottom: 10px; }
.side dl.facts dd:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------ journalist area
 * The journalist pages predate the staff app; these map their class names
 * onto the same look. */
.area { max-width: 1120px; font-size: 16px; line-height: 1.6; }
.area h1 { font-size: 30px; margin: 4px 0 18px; }
.area h2 { margin: 22px 0 10px; }
.area .panel { margin: 0 0 16px; }
.area .panel h2:first-child { margin-top: 0; }
.area label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.area label:has(input[type=checkbox]) { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.area input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex: none; margin: 2px 0 0; }
.area .filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; align-items: end; }
.area button, .area .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.area button:hover, .area .button:hover { background: var(--accent-hover); color: var(--accent-ink); }
.area .button.quiet { background: var(--surface); color: var(--accent); }
.area .meta { color: var(--muted); font-size: 14px; }
.area .card { padding: 16px 18px; margin-bottom: 10px; }
.area .card strong { font-size: 17px; }
.area .chip { background: #EEF2F7; border-color: var(--line); }
.area dl.fields { display: grid; grid-template-columns: minmax(120px, 200px) 1fr; gap: 8px 16px; margin: 0; }
.area dl.fields dt { color: var(--muted); }
.area dl.fields dd { margin: 0; }
.area table.files { width: 100%; border-collapse: collapse; }
.area table.files td { padding: 12px 6px; border-top: 1px solid var(--rule); vertical-align: middle; }
.area .terms { white-space: pre-wrap; max-height: 280px; overflow: auto; background: var(--inset); padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.area .notice { border-left-width: 1px; }
@media (max-width: 640px) { .area dl.fields { grid-template-columns: 1fr; gap: 2px; } .area dl.fields dd { margin-bottom: 8px; } }

/* Journalist search: a search bar, filters at the side, scannable cards. */
.area .search-bar { display: flex; gap: 8px; margin: 4px 0 18px; }
.area .search-bar input[type=search] { flex: 1; min-height: 46px; font-size: 16px; }
.area .filters-panel { padding: 16px 18px; }
.area .filters-panel summary { list-style: none; cursor: pointer; }
.area .filters-panel summary::-webkit-details-marker { display: none; }
.area .filters-panel summary h2 { margin: 0; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.area .filters-panel[open] summary h2 { margin-bottom: 12px; }
.area .filters { grid-template-columns: 1fr; gap: 12px; }
.area .filters label { margin-bottom: 4px; }
.area .result-count { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.area .story-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; }
.area .story-card .who { font-weight: 600; font-size: 17px; color: var(--ink); }
.area .story-card .summary { color: var(--ink); line-height: 1.55; }
.area .story-card .facts { font-size: 14px; color: var(--muted); }
.area .story-card .chips { margin-top: 2px; }
.area .story-card .chips .chip { margin-bottom: 0; }
@media (min-width: 900px) {
	.area .filters-panel summary { pointer-events: none; }
}

/* Accessibility pass (22 October 2026). */
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto; overflow: visible; white-space: normal; padding: 10px 16px; background: var(--accent); color: var(--accent-ink); border-radius: var(--radius); font-weight: 600; }
.sb-nav a, .sb-who a { display: inline-flex; align-items: center; min-height: 32px; }
.back { display: inline-flex; align-items: center; min-height: 28px; }
.row > a:not(.btn) { display: inline-flex; align-items: center; min-height: 40px; padding: 0 4px; }
.step h2:focus { outline: none; }
