/* Telugu: Mandali, kept on our own server (only the Telugu letters; Latin text keeps the system font). */
@font-face {
    font-family: "Mandali";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("../fonts/mandali-telugu.woff2") format("woff2");
    unicode-range: U+0951-0952, U+0964-0965, U+0B83, U+0C00-0C7F, U+1CD5-1CD6, U+1CD8, U+1CDA, U+1CF2, U+200C-200D, U+25CC;
}

/*
 * AP7AM Admin design system.
 * One small stylesheet: tokens, the app shell (top bar, sidebar, content), and the components every
 * screen uses (cards, buttons, forms, tables, badges, alerts). Mobile first: below 960px the sidebar
 * becomes a drawer, grids stack, and tables turn into cards or scroll.
 */
:root {
    --bg: #f3f5f9;
    --surface: #ffffff;
    --text: #172033;
    --muted: #5d6b82;
    --line: #dfe5ee;
    --line-strong: #c7d0de;
    --primary: #1f5eff;
    --primary-dark: #1648cc;
    --primary-soft: #eaf0ff;
    --success: #0f7b53;
    --success-soft: #e4f5ec;
    --danger: #c0262d;
    --danger-soft: #fdeceb;
    --warn: #a35a00;
    --warn-soft: #fff3dc;
    --nav: #0f1c3a;
    --nav-hover: #1a2b54;
    --nav-text: #c9d3ea;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
    --shadow-lg: 0 8px 24px rgba(16, 24, 40, .14);
    --surface-2: #fafbfd;
    --title: #000;
    --track: #e6e9f2;
    --bar: #7b8cff;
    --ink-danger: #b00020;
    --ink-warn: #b45309;
    --hl-today: #fffde7;
    --hl-small: #fdecea;
    --gap-a: #e0e0e0;
    --gap-b: #ffcdd2;
    --gap-c: #f8bbd0;
    /* Every second row of a list is shaded, as in the old admin (its W3.CSS "striped" tables: #f1f1f1). */
    --zebra: #f1f1f1;
    --zebra-hover: #fff7c7;   /* the pale yellow the old admin showed under the mouse */
    --topbar-h: 56px;
    --sidebar-w: 248px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Mandali", "Noto Sans Telugu", "Nirmala UI", sans-serif;
    --font-te: "Mandali", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Telugu", "Nirmala UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* The top bar stays in view, so a link such as #row_123 must not scroll its target underneath it. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.te { font-family: var(--font-te); font-size: 17px; line-height: 1.55; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.radio-list { display: grid; gap: 6px; margin-bottom: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.inline-form { display: inline; margin: 0; }

/* ---------- App shell ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
    display: flex; align-items: center; gap: 12px; padding: 0 16px;
    background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #1f5eff, #6a8dff); color: #fff; display: grid; place-items: center; font-size: 13px; font-weight: 800; letter-spacing: .3px; }
.topbar-links { display: flex; gap: 2px; margin-left: 12px; }
.topbar-links a { padding: 6px 10px; border-radius: var(--radius-sm); color: var(--muted); font-size: 13px; }
.topbar-links a:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.topbar-spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 700; font-size: 13px; text-transform: uppercase; }
.menu-toggle { display: inline-grid; }

.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: calc(100vh - var(--topbar-h)); }
.shell { transition: grid-template-columns .18s ease; }
/* A wide screen can fold the menu away to the left to give the page the whole width (remembered per browser). */
@media (min-width: 961px) {
    html.nav-collapsed .shell { grid-template-columns: 0 minmax(0, 1fr); }
    html.nav-collapsed .sidebar { visibility: hidden; padding-left: 0; padding-right: 0; overflow: hidden; }
}
.sidebar { background: var(--nav); color: var(--nav-text); padding: 14px 10px 24px; position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
.nav-title { margin: 16px 10px 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #7f8db0; font-weight: 700; }
.nav-title:first-child { margin-top: 4px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 1px 0; border-radius: var(--radius-sm); color: var(--nav-text); font-size: 13.5px; }
.nav-link:hover { background: var(--nav-hover); color: #fff; text-decoration: none; }
.nav-link.active { background: var(--primary); color: #fff; }
.nav-link svg { flex: none; opacity: .9; }
.scrim { display: none; }

.content { padding: 20px 24px 40px; min-width: 0; max-width: 1500px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.page-head h1 { font-size: 22px; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Cards, grids ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { font-size: 15px; }
.card-body { padding: 16px; }
.card-foot { padding: 12px 16px; border-top: 1px solid var(--line); background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }
.card.tight .card-body { padding: 12px 14px; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: start; }
.grid > .card + .card { margin-top: 0; }
.col-side, .col-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; grid-column: span 12; }
.col-side > .card, .col-main > .card { margin-top: 0; }
.source-list { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; } .span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; line-height: 1.2; text-decoration: none; min-height: 36px; }
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:focus-visible, .input:focus-visible, select:focus-visible, textarea:focus-visible, input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: #0b6444; }
.btn-danger { background: var(--surface); border-color: #efb4b6; color: var(--danger); }
.btn-danger:hover { background: var(--danger-soft); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-soft); }
.btn-sm { padding: 4px 10px; min-height: 28px; font-size: 12.5px; }
.btn-icon { padding: 6px; min-height: 30px; min-width: 30px; }
.icon-btn { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--muted); border-radius: var(--radius-sm); display: inline-grid; place-items: center; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.icon-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: #2b3650; }
.label .req { color: var(--danger); }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.input, select.input, textarea.input, input[type=text], input[type=url], input[type=number], input[type=password], input[type=search], select, textarea {
    width: 100%; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: #fff; color: var(--text); font: inherit; min-height: 38px;
}
input[type=file] { font: inherit; max-width: 100%; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; accent-color: var(--primary); }
textarea { resize: vertical; }
.input.te, textarea.te { font-family: var(--font-te); font-size: 17px; }
.field-row { display: grid; grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); gap: 12px; }
.field-row .field { margin-bottom: 0; }
.field-inline { display: flex; gap: 8px; align-items: flex-start; }
.field-inline .grow { flex: 1; min-width: 0; }
.field-error { color: var(--danger); font-size: 12.5px; margin-top: 4px; font-weight: 500; }
.has-error { border-color: var(--danger) !important; box-shadow: 0 0 0 1px var(--danger); }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { position: relative; }
.pill input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.pill:hover span { background: hsl(var(--h, 0) 85% 86%); }
.pill input:checked + span { background: hsl(var(--h, 0) 70% 40%) !important; border-color: hsl(var(--h, 0) 70% 32%) !important; color: #fff !important; }
.rate { display: inline-block; min-width: 24px; padding: 1px 7px; border-radius: 6px; text-align: center; font-weight: 600; background: hsl(var(--h, 0) 80% 88%); color: hsl(var(--h, 0) 70% 24%); }
.day-separator-cell { background: #c4dff4; color: #640303; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; font-size: 12px; padding: 6px 14px !important; }
.pill span { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; background: hsl(var(--h, 0) 85% 93%); border: 1px solid hsl(var(--h, 0) 55% 70%); border-radius: var(--radius-sm); font-weight: 600; }
.pill input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
details.more { border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fafbfd; }
details.more > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; color: var(--muted); }
details.more[open] > summary { border-bottom: 1px solid var(--line); }
details.more .more-body { padding: 14px; }

.action-bar { position: sticky; bottom: 0; z-index: 20; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 16px; margin: 16px -4px 0; background: rgba(255, 255, 255, .96); backdrop-filter: blur(4px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.action-bar .grow { flex: 1; }

/* ---------- Badges, alerts ---------- */
.final-edit { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 4px; background: #c9f0d8; color: #0a5c33; font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-violet { background: rgba(124, 58, 237, .1); color: #6d28d9; }
button.badge { border: 0; cursor: pointer; font-family: inherit; }
button.badge:hover { filter: brightness(.95); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: var(--radius); margin-bottom: 14px; border: 1px solid; font-weight: 500; }
.alert-success { background: var(--success-soft); border-color: #b9e3cf; color: #0b5c3e; }
.alert-error { background: var(--danger-soft); border-color: #f3c2c4; color: #8f1d22; }
.alert-warning { background: var(--warn-soft); border-color: #f1d9a5; color: #7a4300; }
.alert-info { background: var(--primary-soft); border-color: #c5d6ff; color: #1a3d99; }
.alert .close { margin-left: auto; background: none; border: 0; font-size: 18px; line-height: 1; cursor: pointer; color: inherit; opacity: .7; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 9px 10px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr.zebra { background: var(--zebra); }
.table tbody tr:hover, .table tbody tr.zebra:hover { background: var(--zebra-hover); }
#stories-table tr.zebra td.cell-actions { background: var(--zebra); }
#stories-table tr:hover td.cell-actions { background: var(--zebra-hover); }
.table tr.is-busy td { background: var(--warn-soft); }
.table .title-cell { min-width: 240px; max-width: 520px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-empty { text-align: center; color: var(--muted); padding: 24px !important; }
.thumb { width: 56px; height: 40px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line); background: #eef1f6; }

/* ---------- Pager ---------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 12px; }
.pager .current { color: var(--muted); }
.pager .disabled { color: var(--line-strong); }

/* ---------- Filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .input { width: auto; min-width: 200px; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: linear-gradient(160deg, #0f1c3a, #1c3a8a); }
.auth-card { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 28px; box-shadow: var(--shadow-lg); }
.auth-card h1 { font-size: 20px; margin: 10px 0 18px; }

/* ---------- Picture card / misc ---------- */
.picture-preview { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fafbfd; }
.picture-preview img { width: 96px; height: 64px; object-fit: cover; border-radius: 4px; }
.sources .field-inline { align-items: flex-start; }
.ai-panel { background: linear-gradient(180deg, #f2f7ff, #fff); border-color: #cfdcff; }
.chip { display: inline-block; margin: 3px 4px 3px 0; padding: 5px 11px; border: 1px solid #bcd0ff; background: #fff; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; color: #1a3d99; }
.chip:hover { background: var(--primary-soft); }
.site-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 0 0 10px; }
.site-links .chip { margin: 0; padding: 3px 8px; font-size: 12.5px; text-decoration: none; }
@media (max-width: 1500px) { .site-links { gap: 4px; } .site-links .chip { padding: 2px 7px; font-size: 12px; } }
.field .site-links { margin: 6px 0 0; }
.diff-text { white-space: pre-wrap; word-break: break-word; }
.diff-text .label, .diff-field .label { margin-bottom: 2px; }
.diff-field { padding: 10px 16px; border-top: 1px solid var(--line); }
.diff-field:first-child { border-top: 0; }
.diff-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.diff-cols > div + div { border-left: 1px solid var(--line); }
.version-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; color: var(--muted); font-size: 13px; }
@media (max-width: 960px) { .diff-cols { grid-template-columns: minmax(0, 1fr); } .diff-cols > div + div { border-left: 0; border-top: 1px solid var(--line); } }
.diff ins { background: #d6f5e3; text-decoration: none; } .diff del { background: #fbd9db; }

/* ---------- Drawer extras ---------- */
.only-narrow { display: none; }
.quick-links a { display: block; padding: 7px 10px; border-radius: var(--radius-sm); color: #aab6d4; font-size: 13px; }
.quick-links a:hover { background: var(--nav-hover); color: #fff; text-decoration: none; }

/* ---------- Attendance ---------- */
.today-times { display: grid; grid-template-columns: 110px 1fr; gap: 10px 12px; align-items: center; margin: 0; }
.today-times dt { color: var(--muted); font-weight: 600; }
.today-times dd { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 36px; }
.summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; margin: 0; }
.summary dt, .summary dd { margin: 0; padding: 7px 16px; border-top: 1px solid var(--line); }
.summary dt:first-of-type, .summary dd:first-of-type { border-top: 0; }
.summary dd { text-align: right; font-variant-numeric: tabular-nums; }
.in-chip { display: inline-block; min-width: 26px; padding: 2px 8px; border-radius: 6px; font-weight: 600; text-align: center; background: #eef1f7; }
.in-green { background: #c9f0d8; color: #0a5c33; }
.in-white { background: #fff; border: 1px solid var(--line-strong); }
.in-orange { background: #ffe0b3; color: #8a4b00; }
.in-red { background: #ffc9c9; color: #8f1d1d; }
.colour-counts { display: flex; gap: 6px; justify-content: flex-end; }
td.colour-counts { display: table-cell; text-align: left; white-space: nowrap; }
td.colour-counts .in-chip { margin-right: 4px; }
.table td.is-open { background: #fbf6c9; }
.table td.hours-ok { background: #dcf6e4; }
.table td.adj-pos { background: #dcf6e4; } .table td.adj-neg { background: #fde0e0; }
.table tr.is-off td { background: #fafbfd; color: var(--muted); }
.notes-cell .badge { margin-right: 3px; }
.dialog { border: 0; border-radius: var(--radius); padding: 22px; width: min(480px, 94vw); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(10, 18, 40, .45); }
.dialog h2 { font-size: 17px; margin-bottom: 12px; }
.dialog .check.block { display: flex; margin: 6px 0; }
.dialog .input { margin-top: 8px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 16px; }

/* ---------- Responsive ---------- */
/* A wide screen puts the story (left) beside what it is about (right), so every required field shows at once. */
@media (min-width: 1100px) {
    .col-main { grid-column: span 7; order: 1; }
    .col-side { grid-column: span 5; order: 2; }
    .grid > .more { order: 3; }
}
@media (max-width: 1500px) {
    .hide-lg { display: none !important; }
}
@media (max-width: 1180px) {
    .hide-md { display: none !important; }
    .topbar-links { display: none; }
    .only-narrow { display: block; }
}
@media (max-width: 960px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .menu-toggle { display: inline-grid; }
    .sidebar { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); height: 100vh; transform: translateX(-102%); transition: transform .2s ease; padding-top: 18px; }
    body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 50; background: rgba(10, 18, 40, .45); }
    .content { padding: 14px 12px 40px; }
    .grid > [class*="span-"] { grid-column: span 12; }
    .page-head h1 { font-size: 19px; }
    .user-chip .name { display: none; }
}
@media (max-width: 720px) {
    .hide-sm { display: none !important; }
    .field-row { grid-template-columns: minmax(0, 1fr); }
    .field-row.keep { grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr)); }
    /* Ratings of 1-10 as two even rows of five: big enough to tap. */
    .pills { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .pill span { display: grid; height: 40px; }
    .filters .input { width: 100%; min-width: 0; }
    .action-bar { margin: 12px -2px 0; }
    .action-bar .btn { flex: 1 1 auto; }
    /* A list becomes a stack of cards: each cell shows its own label. */
    table.table-cards thead { display: none; }
    table.table-cards, table.table-cards tbody, table.table-cards tr, table.table-cards td { display: block; width: 100%; }
    table.table-cards tr { border-bottom: 8px solid var(--bg); padding: 8px 4px; }
    table.table-cards td { border: 0; padding: 4px 10px; display: flex; gap: 10px; align-items: baseline; }
    table.table-cards td::before { content: attr(data-label); flex: 0 0 84px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
    table.table-cards td.day-separator-cell { display: block; }
    table.table-cards td.day-separator-cell::before { content: none; }
    table.table-cards td.title-cell { min-width: 0; max-width: none; font-size: 16px; }
    table.table-cards td.title-cell::before, table.table-cards td.cell-actions::before, table.table-cards td[data-label=""]::before { content: none; }
    table.table-cards td.cell-actions { justify-content: flex-start; flex-wrap: wrap; }
}

/* ---------- Roles: assignments ---------- */
.assignment { display: inline-flex; align-items: center; gap: 0; margin: 2px 6px 2px 0; border: 1px solid var(--line-strong); border-radius: 999px; background: #fff; overflow: hidden; }
.assignment-role { padding: 3px 4px 3px 11px; font-weight: 600; }
.assignment-scope { margin: 0 4px; padding: 1px 8px; border-radius: 999px; background: #eef1f7; color: var(--muted); font-size: 12px; }
.assignment-scope.is-limited { background: #e3edff; color: #1a3d99; }
.assignment-x { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; padding: 3px 9px 3px 4px; color: var(--muted); }
.assignment-x:hover { color: var(--danger); }
.assignment form, form.assignment { margin: 2px 6px 2px 0; }
.assign-form { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.assign-form .input { width: auto; min-width: 120px; flex: 1 1 130px; }
.more-actions summary { cursor: pointer; color: var(--primary); font-size: 13px; margin: 4px 0; }
.preset-grid { display: grid; grid-template-columns: minmax(90px, 1.4fr) repeat(auto-fit, minmax(60px, 1fr)); gap: 6px 8px; align-items: center; margin: 6px 0 14px; }
.preset-grid .center { text-align: center; }
.dialog-wide { width: min(980px, 96vw); max-height: 94vh; overflow: auto; }
.inline-crop-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.inline-crop-grid img { display: block; max-width: 100%; }
@media (max-width: 720px) { .inline-crop-grid { grid-template-columns: minmax(0, 1fr); } }
.matrix th, .matrix td { padding: 8px 12px; }
.matrix .center { text-align: center; }
.matrix .is-all { background: #f1f6ff; }
.matrix input[type=checkbox] { width: 17px; height: 17px; }

/* ---------- AI: prompt versions ---------- */
details.version { border-top: 1px solid var(--line); }
details.version > summary { cursor: pointer; padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.version-body { margin: 0 16px 10px; padding: 10px 12px; background: #fafbfd; border: 1px solid var(--line); border-radius: var(--radius-sm); font-family: ui-monospace, monospace; font-size: 12.5px; white-space: pre-wrap; word-break: break-word; max-height: 360px; overflow: auto; }
.version-body .same { color: var(--muted); }
.version-body ins, .version-body del { display: block; }
.price-form { flex-wrap: nowrap; align-items: center; }
.price-box { display: inline-flex; align-items: center; gap: 4px; }
.price-box .input { width: 86px; min-width: 0; flex: 0 0 auto; }

/* A small menu that opens when the pointer is over it (or it is focused/tapped): used for the status of a story. */
.hover-menu { position: relative; display: inline-block; }
.hover-menu > button { cursor: pointer; }
.hover-menu-list { display: none; position: absolute; left: 0; top: 100%; z-index: 30; min-width: 120px; padding: 4px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.hover-menu:hover .hover-menu-list, .hover-menu:focus-within .hover-menu-list { display: block; }
.hover-menu-list .inline-form { display: block; }
.hover-menu-list button { display: block; width: 100%; padding: 6px 10px; border: 0; border-radius: 4px; background: transparent; font: inherit; text-align: left; color: var(--text); cursor: pointer; }
.hover-menu-list button:hover, .hover-menu-list button:focus { background: var(--primary-soft); }
/* Optional columns, switched on by a button. */
.col-timing { display: none; }
.show-timing .col-timing { display: table-cell; }
/* Text that shows as many letters as the column has room for, the rest on hover. */
.clip { display: block; max-width: 11ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-cell .clip + .clip { font-size: 11.5px; }
/* Status as a small round button: a symbol, the word only on a phone. */
.status-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; font-size: 13px; line-height: 1; }
button.status-btn { cursor: pointer; }
.status-live { color: var(--success); background: var(--success-soft); border-color: #b6e0c8; }
.status-unpublished { color: var(--muted); background: #eef1f6; }
.status-unlisted { color: var(--warn); background: var(--warn-soft); border-color: #f0d08a; }
.status-word { display: none; }
/* How well a story is read, as a tint on its title (the old admin did the same for people who may not see the numbers). */
.id-chip { display: inline-block; padding: 1px 7px; border-radius: 10px; text-decoration: none; }
.id-chip.views-top { background: #7fd29a; color: #0b3d22; } .id-chip.views-high { background: #a9e0bb; } .id-chip.views-good { background: #d3f0dd; }
.id-chip.views-low { background: #fbd5d5; } .id-chip.views-poor { background: #f29a9a; color: #5c1010; }
.id-cell { white-space: nowrap; }
/* The person under a time (posted by, edited by). */
.stamp-by { display: block; font-size: 12px; line-height: 1.3; }
/* A dot beside a story number: green = the English version is posted, amber = someone is translating it. */
.en-dot { margin-left: 1px; font-size: 10px; line-height: 1; vertical-align: super; text-decoration: none; }
.words-chip { display: inline-block; margin-left: 4px; padding: 0 5px; border-radius: 4px; background: var(--bg); border: 1px solid var(--line); color: var(--muted); font: 11px/1.5 var(--font); vertical-align: middle; }
.en-done { color: #19a45b; }
.en-busy { color: #e0a100; }
/* A row that opens to show everything about it (the arrow sits beside Edit). */
.expand-btn { color: var(--muted); font-size: 14px; }
.expand-btn:hover { background: var(--primary-soft); color: var(--primary); }
tr.row-detail > td { background: var(--bg); padding: 14px 18px; border-bottom: 1px solid var(--line-strong); }
.detail-head { font-size: 17px; margin-bottom: 12px; overflow-wrap: anywhere; }
.detail-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.detail-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 6px; }
.detail-card h4 { margin: 0 0 6px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.detail-list { margin: 0; }
.detail-list > div { display: flex; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.detail-list > div:first-child { border-top: 0; }
.detail-list dt { flex: 0 0 92px; color: var(--muted); font-size: 12.5px; }
.detail-list dd { margin: 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
/* The way a story came to the site, in the details of a live story: one line per step, coloured by what happened. */
.detail-card-wide { grid-column: 1 / -1; }
.sc-timeline { list-style: none; margin: 0; padding: 0 0 6px; }
.sc-tl { position: relative; display: flex; gap: 10px; align-items: baseline; padding: 5px 0 5px 18px; border-left: 2px solid var(--line); margin-left: 5px; font-size: 13px; line-height: 1.5; }
.sc-tl-dot { position: absolute; left: -7px; top: 9px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); border: 2px solid var(--surface); }
.sc-tl-at { flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.sc-tl-what { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.sc-tl-write .sc-tl-dot { background: var(--primary); }
.sc-tl-edit .sc-tl-dot { background: #7c3aed; }
.sc-tl-ok .sc-tl-dot { background: var(--success); }
.sc-tl-note .sc-tl-dot { background: var(--warn); }
.sc-tl-flag .sc-tl-dot, .sc-tl-back .sc-tl-dot { background: var(--danger); }
.sc-tl-live .sc-tl-dot { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.sc-tl-live .sc-tl-what { font-weight: 600; }
.sc-tl-ai .sc-tl-dot { background: #0891b2; }
.sc-tl-items { list-style: none; margin: 4px 0 2px; padding: 0; display: grid; gap: 3px; }
.sc-tl-item { font-size: 12.5px; color: var(--text); padding: 3px 8px; border-radius: 6px; background: var(--bg); overflow-wrap: anywhere; }
.sc-tl-mark { font-weight: 700; white-space: nowrap; }
.sc-tl-item-ai .sc-tl-mark, .sc-tl-item-editor .sc-tl-mark { color: var(--success); }
.sc-tl-item-left .sc-tl-mark { color: var(--warn); }
.detail-spacer { flex: 1; }

@media (max-width: 720px) {
    table.table-cards td.col-timing, table.table-cards.show-timing td.col-timing { display: none; }
    table.table-cards.show-timing td.col-timing { display: flex; }
    table.table-cards .status-word { display: inline; margin-left: 6px; }
    table.table-cards .status-btn { width: auto; min-width: 26px; border-radius: 13px; padding: 0 10px 0 0; justify-content: start; grid-auto-flow: column; align-items: center; }
    table.table-cards .clip { max-width: none; }
    table.table-cards tr.row-detail > td { display: block; }
    .detail-list dt { flex-basis: 84px; }
    table.table-cards td.hide-sm, table.table-cards td.hide-md, table.table-cards td.hide-lg { display: none !important; }
}

/* Comments pop-up */
.comments-dialog { padding: 0; width: min(640px, 96vw); }
.comments-dialog .dialog-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.comments-dialog .dialog-head h2 { margin: 0; flex: 1; }
.comment-list { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow-y: auto; }
.comment-list li { padding: 10px 18px; border-bottom: 1px solid var(--line); }
.comment-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12.5px; }
.comment-tools { margin-left: auto; display: inline-flex; gap: 6px; }
.comment-body { margin-top: 3px; overflow-wrap: anywhere; }
.comment-form { display: flex; gap: 8px; align-items: flex-start; padding: 12px 18px; background: var(--bg); }
.comment-form textarea { flex: 1; }

/* Top story: a filled green star when it is on. */
.top-star { color: var(--muted); opacity: .55; }
.top-star.is-on { color: #19a45b; opacity: 1; }
.top-star.is-on svg { fill: currentColor; }
/* Edit and the arrow stay in reach when a wide list scrolls sideways. */
#stories-table th:last-child, #stories-table td.cell-actions { position: sticky; right: 0; z-index: 2; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(16, 24, 40, .18); }
#stories-table tr.is-busy td.cell-actions { background: #fff6e0; }
@media (max-width: 720px) { #stories-table td.cell-actions, #stories-table th:last-child { position: static; box-shadow: none; } }

/* Live stories: tighter columns, so the title gets the room. Cells beside the title lose most of their side padding; the title column grows into what is left. */
#stories-table th, #stories-table td { padding-left: 4px; padding-right: 4px; }
#stories-table td.words-cell { color: var(--muted); white-space: nowrap; }
#stories-table th:first-child, #stories-table td:first-child { padding-left: 8px; }
#stories-table td.title-cell, #stories-table th.title-cell { min-width: 420px; max-width: none; width: 100%; padding-left: 8px; padding-right: 10px; }
@media (max-width: 1200px) { #stories-table td.title-cell { min-width: 300px; } }
@media (max-width: 720px) { #stories-table th, #stories-table td { padding-left: 0; padding-right: 0; } }

/* Edit and the arrow are apart (with a line between), so the wrong one is not hit by accident. */
#stories-table td.cell-actions { padding-left: 14px; }
#stories-table td.cell-actions .icon-btn { width: 32px; height: 32px; }
#stories-table td.cell-actions .expand-btn { margin-left: 18px; position: relative; }
#stories-table td.cell-actions .expand-btn::before { content: ""; position: absolute; left: -10px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }

/* AI tag suggestions above a tags box */
.tag-suggest { margin: 0 0 6px; }
.tag-suggest-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-suggest-chips { margin-top: 4px; }
.debug-toggle.is-on { background: var(--warn-soft, #fff4d6); border-color: var(--warn, #c98a00); color: var(--warn, #8a5a00); }
.meta-generate { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.meta-generating { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--primary); }
.ai-working::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 6px; vertical-align: -1px; border: 2px solid var(--line-strong, #c9d2e3); border-top-color: var(--primary); border-radius: 50%; animation: ai-working .8s linear infinite; }
@keyframes ai-working { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ai-working::before { animation-duration: 2.4s; } }
.tag-suggest-chips .chip.is-used { background: var(--success-soft); border-color: #b6e0c8; color: var(--success); cursor: default; }

/* Menu search and the Back button */
.nav-search { padding: 0 4px 8px; position: sticky; top: -14px; z-index: 3; background: var(--nav); }
.nav-search input { width: 100%; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid #2c3d6b; background: #162447; color: #e8eeff; font: inherit; font-size: 13px; }
.nav-search input::placeholder { color: #7f8db0; }
.nav-search input:focus { outline: 2px solid var(--primary); border-color: transparent; }
.nav-search-empty { padding: 8px 10px; color: #aab6d4; font-size: 12.5px; }
.nav-link[hidden], .nav-title[hidden], .sidebar details[hidden] { display: none !important; }
.back-btn { display: inline-block; white-space: nowrap; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--primary); font-size: 13px; font-weight: 600; flex: none; }
.back-btn:hover { background: var(--primary-soft); text-decoration: none; }
.topbar > .back-btn { margin-left: 12px; margin-right: -6px; }

.hover-menu-right { left: auto; right: 0; min-width: 190px; }
.hover-menu-list .menu-link { display: block; padding: 7px 12px; border-radius: 4px; color: var(--text); text-decoration: none; white-space: nowrap; }
.hover-menu-list .menu-link:hover, .hover-menu-list .menu-link:focus { background: var(--primary-soft); color: var(--primary-dark); }

/* Story titles in the lists read as normal (black) text; they are still links, underlined when pointed at. */
td.title-cell > a:not(.badge), .detail-head a:not(.badge) { color: var(--text); text-decoration: none; }
td.title-cell > a:not(.badge):hover, .detail-head a:not(.badge):hover { text-decoration: underline; }
td.title-cell > a:not(.badge):visited, .detail-head a:not(.badge):visited { color: var(--text); }

/* The chat button sits at the bottom right: leave room under the page so the last rows can be scrolled clear of it. */
.content { padding-bottom: 84px; }

.posted-by-box { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.posted-by-box .input { width: 170px; padding: 3px 8px; }

/* Production check */
.pc-verdict .card-body { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; font-size: 16px; }
.pc-verdict { margin-bottom: 16px; border-left: 6px solid var(--line-strong); }
.pc-verdict.pc-success { border-left-color: #19a45b; } .pc-verdict.pc-warn { border-left-color: #e0a100; } .pc-verdict.pc-danger { border-left-color: #e5484d; }
.pc-dot { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 700; color: #fff; }
.pc-dot-ok { background: #19a45b; } .pc-dot-warn { background: #e0a100; } .pc-dot-fail { background: #e5484d; } .pc-dot-info { background: #7f8db0; }
.pc-hand { margin: 0; padding: 12px 18px 12px 34px; display: grid; gap: 8px; }

.pc-live h3 { margin: 14px 0 6px; font-size: 15px; } .pc-live h3:first-child { margin-top: 0; }
.pc-live ul, .pc-live ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; }

/* Left menu: groups fold and unfold. */
.nav-tools { display: flex; justify-content: flex-end; gap: 4px; padding: 0 6px 2px; }
.nav-tools button { border: 0; background: transparent; color: #8fb0ff; font: inherit; font-size: 11.5px; cursor: pointer; padding: 2px 6px; border-radius: 4px; }
.nav-tools button:hover { background: var(--nav-hover); color: #fff; }
.nav-title.nav-fold { display: flex; justify-content: space-between; align-items: center; cursor: pointer; border-radius: var(--radius-sm); padding: 3px 0; user-select: none; }
.nav-title.nav-fold:hover { color: #fff; }
.nav-title.nav-fold::after { content: "▾"; font-size: 12px; }
.nav-title.nav-fold.is-folded::after { content: "▸"; }
.nav-link.is-folded { display: none; }
.sidebar.is-searching .nav-link.is-folded { display: flex; }
.sidebar.is-searching .nav-tools { display: none; }

/* Home page: sections of panels. */
.day-nav { display: flex; gap: 6px; align-items: center; }
.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.dash-section { margin-bottom: 22px; }
.dash-title { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px; }
.dash-section .card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dash-section .card-head h3 { margin: 0; font-size: 15px; }
.dash-pages { margin: 8px 0 24px; }
.dash-pages > summary { cursor: pointer; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: var(--surface); display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
a.kpi[href]:hover { border-color: var(--primary); text-decoration: none; }
.kpi .kpi-label { font-size: 12px; color: var(--muted); }
.kpi .kpi-value { font-size: 26px; font-weight: 700; line-height: 1.1; }
.kpi .kpi-note { font-size: 12px; color: var(--muted); }
.kpi .up { color: var(--success); } .kpi .down { color: var(--danger); }
.kpi.is-alert { border-color: #f0b8b6; background: var(--danger-soft); }
.kpi.is-alert .kpi-value { color: var(--danger); }
.kpi.is-ok .kpi-value { color: var(--success); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 38px; margin-top: 6px; }
.bars i { flex: 1; min-width: 3px; background: #c7d6fb; border-radius: 2px 2px 0 0; min-height: 2px; }
.bars i.is-day { background: var(--primary); }
.bars.is-tall { height: 120px; }
.bars[data-guide] { position: relative; cursor: crosshair; touch-action: pan-y; }
.bars[data-guide] i { transition: filter .08s, opacity .08s; }
.bars[data-guide] i.is-reached { filter: brightness(.82); }
.bars-guide { display: block; position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--text); pointer-events: none; z-index: 2; }
.bars-guide[hidden] { display: none; }
.bars-guide b { position: absolute; right: 0; top: -22px; padding: 1px 7px; border-radius: 4px; background: var(--text); color: var(--surface); font-size: 11px; line-height: 18px; white-space: nowrap; }
.bars-guide b.is-below { top: 3px; }
/* The small charts in the home page tiles: the level line runs on into a strip to the right of the bars, and its tag sits in that strip, so it never covers a bar. */
.bars.is-mini { margin-right: 66px; }
.bars.is-mini .bars-guide { right: -66px; }
.bars.is-mini .bars-guide b, .bars.is-mini .bars-guide b.is-below { top: -9px; right: 0; left: auto; width: 62px; text-align: center; font-size: 10.5px; padding: 1px 4px; box-sizing: border-box; }
.bars-guide-v { display: block; position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px dashed var(--text); pointer-events: none; z-index: 2; }
.bars-guide-v[hidden] { display: none; }
.bars-guide-v b { position: absolute; top: 100%; left: 0; transform: translateX(-50%); margin-top: 5px; padding: 1px 7px; border-radius: 4px; background: var(--text); color: var(--surface); font-size: 11px; line-height: 18px; white-space: nowrap; }
.bars-guide-v b:empty { display: none; }
.bars-guide-v b.is-left { transform: translateX(-12px); }
.bars-guide-v b.is-right { transform: translateX(calc(-100% + 12px)); }
.bars[data-guide] i.is-hover { outline: 1px solid var(--text); outline-offset: -1px; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.rank li:last-child { border-bottom: 0; }
.rank .rank-n { width: 20px; color: var(--muted); font-size: 12px; text-align: right; flex: none; }
.rank .rank-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .rank-v { flex: none; font-weight: 600; font-variant-numeric: tabular-nums; }
.dash-note { color: var(--muted); font-size: 12px; margin-top: 8px; }

/* AI day report on the home page. */
.report-start { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.ai-report { margin-bottom: 18px; border-color: #c7d6fb; }
.ai-report .report-tools { display: flex; gap: 6px; }
.report-body { max-width: 860px; line-height: 1.55; }
.report-body h2 { font-size: 15px; margin: 16px 0 4px; color: var(--primary-dark); }
.report-body h2:first-child { margin-top: 0; }
.report-body p, .report-body ul { margin: 0 0 8px; }
@media print { body.printing-report .sidebar, body.printing-report .topbar, body.printing-report .page-head, body.printing-report .quick-actions, body.printing-report .dash-section, body.printing-report .dash-pages, body.printing-report .report-tools { display: none !important; } body.printing-report .shell { display: block; } }

/* Writer scorecards: shaded number pills, small ranks. */
.sc-table th, .sc-table td { vertical-align: middle; }
.sc-table td.num, .sc-table th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.sc-table tbody tr:hover { background: var(--bg); }
.sc-cell { display: inline-block; min-width: 3.4em; padding: 2px 9px; border-radius: 999px; text-align: center; font-weight: 600; }
.sc-trend { display: inline-block; width: 1.2em; margin-left: 4px; font-size: 11px; text-align: left; }
.sc-rank { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; font-size: 11px; font-weight: 700; line-height: 18px; color: #000; border: 1px solid #d5dae3; background: #f1f3f7; }
.sc-best { max-width: 260px; }
/* Story titles are black everywhere (in the dark theme, the light text colour): list rows, the reading view, review pages, dashboard lists, scorecards. */
.story-link, .story-link:visited,
td.title-cell a:not(.badge):not(.btn), .detail-head a:not(.badge):not(.btn), h2.te a, a.te:not(.btn):not(.badge):not(.chip),
.rank-t a, [data-test="duplicate"] > a { color: var(--title); text-decoration: none; }
.story-link { font-weight: 500; }
.story-link:hover, td.title-cell a:not(.badge):not(.btn):hover, .detail-head a:not(.badge):not(.btn):hover, h2.te a:hover, a.te:not(.btn):not(.badge):not(.chip):hover, .rank-t a:hover, [data-test="duplicate"] > a:hover { text-decoration: underline; }
td.title-cell a:not(.badge):not(.btn):visited, .detail-head a:not(.badge):not(.btn):visited, h2.te a:visited, a.te:not(.btn):not(.badge):not(.chip):visited, .rank-t a:visited { color: var(--title); }

/* Coloured section headings: a tinted strip with a colour edge, the heading in the colour. Use class "card-head tone-blue" (amber, blue, green, violet, teal, rose). */
.card-head[class*="tone-"] { background: color-mix(in srgb, var(--tone) 9%, var(--surface)); border-left: 4px solid var(--tone); border-top-left-radius: var(--radius); }
.card-head[class*="tone-"] h2, .card-head[class*="tone-"] h3 { color: var(--tone-ink, var(--tone)); }
.tone-amber { --tone: #d97706; --tone-ink: #a35a00; }
.tone-blue { --tone: #1f5eff; --tone-ink: #1648cc; }
.tone-green { --tone: #0f9d6b; --tone-ink: #0f7b53; }
.tone-violet { --tone: #7c3aed; --tone-ink: #6d28d9; }
.tone-teal { --tone: #0e90a8; --tone-ink: #0e7490; }
.tone-rose { --tone: #db2777; --tone-ink: #be185d; }

.theme-toggle { font-size: 16px; line-height: 1; }
