:root {
    --paper: #f2f4ef;
    --ink: #151515;
    --muted: #68645c;
    --line: #c7d0c8;
    --line-strong: #1c1c1c;
    --surface: #fbfcf8;
    --surface-alt: #dfe8e2;
    --signal: #d9412e;
    --signal-dark: #8d1d16;
    --amber: #b87412;
    --green: #287a4f;
    --blue: #245f86;
    --radius: 6px;
    --shadow: 0 24px 60px rgba(10, 26, 16, .13);
    --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
    --display: "Instrument Serif", Georgia, serif;
    --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 96px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

body {
    margin: 0;
    color: var(--ink);
    background:
        linear-gradient(90deg, rgba(21, 21, 21, .045) 1px, transparent 1px) 0 0 / 42px 42px,
        linear-gradient(180deg, var(--paper), #e4ebe6);
    font-family: var(--body);
    font-size: 16px;
}

a {
    color: inherit;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    border-bottom: 2px solid var(--line-strong);
    padding: 18px clamp(18px, 4vw, 54px);
    background: rgba(242, 244, 239, .92);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.brand {
    font-family: var(--mono);
    font-weight: 600;
    text-decoration: none;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.site-header nav,
.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
}

main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero-grid {
    display: block;
    min-height: 680px;
    padding: 82px 0 52px;
}

.hero-copy {
    max-width: 900px;
}

.hero-copy h1,
.number-hero h1,
.content-page h1,
.form-shell h1 {
    font-family: var(--display);
    font-size: clamp(54px, 8vw, 118px);
    font-weight: 400;
    line-height: .88;
    letter-spacing: 0;
    margin: 0 0 24px;
    max-width: 850px;
}

.lede,
.section-head p,
.content-page p,
.form-shell p {
    color: var(--muted);
    line-height: 1.65;
    max-width: 720px;
}

.lede {
    font-size: clamp(19px, 2vw, 24px);
}

.kicker {
    margin: 0 0 14px;
    color: var(--signal);
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.search-panel,
.notice-panel,
.metrics-grid > div,
.content-page,
.form-shell,
.admin-panel {
    background: rgba(251, 252, 248, .9);
    border: 2px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.search-panel {
    margin-top: 34px;
    padding: 18px;
}

label {
    display: grid;
    gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--muted);
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 8px;
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: #fbfcf8;
    color: var(--ink);
    padding: 14px 14px;
    font: 500 16px var(--body);
    text-transform: none;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

button,
.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border: 2px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--ink);
    color: var(--paper);
    padding: 12px 18px;
    font: 800 13px var(--mono);
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
}

button:hover,
.button-link:hover {
    background: var(--signal);
}

.text-link {
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
}

.form-error {
    margin: 10px 0 0;
    color: var(--signal-dark);
    font-weight: 700;
}

.metrics-grid span,
.number-row > span:last-child,
.risk-dial small,
.comment-list article span,
.queue-item header span {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
}

.notice-panel {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 22px 0;
    padding: 16px 18px;
    border-color: var(--signal);
}

.notice-panel.success {
    border-color: var(--green);
}

.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 34px;
    padding: 52px 0;
}

.section-head {
    border-top: 2px solid var(--line-strong);
    padding-top: 18px;
    margin-bottom: 22px;
}

.section-head h2,
.action-band h2,
.admin-panel h2 {
    margin: 0;
    font-family: var(--display);
    font-size: clamp(34px, 4vw, 56px);
    font-weight: 400;
    line-height: .96;
}

.number-list {
    border-top: 1px solid var(--line);
}

.number-row {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) auto auto;
    gap: 16px;
    align-items: center;
    min-height: 68px;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
}

.number-row:hover {
    background: rgba(217, 65, 46, .07);
}

.number-main {
    font-family: var(--mono);
    font-size: 18px;
    font-weight: 600;
}

.risk-pill {
    display: inline-flex;
    justify-content: center;
    min-width: 132px;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 6px 9px;
    font-family: var(--mono);
    font-size: 11px;
    text-transform: uppercase;
}

.risk-high {
    color: var(--signal);
}

.risk-medium {
    color: var(--amber);
}

.risk-low {
    color: var(--blue);
}

.risk-disputed,
.risk-unknown {
    color: var(--muted);
}

.empty-text {
    color: var(--muted);
    line-height: 1.6;
}

.action-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    border-block: 2px solid var(--line-strong);
    padding: 30px 0;
    margin: 28px 0 70px;
}

.number-hero {
    display: grid;
    grid-template-columns: 1fr 160px;
    gap: 24px;
    align-items: end;
    padding: 44px 0 22px;
}

.number-hero h1 {
    font-size: clamp(46px, 7vw, 88px);
    line-height: .94;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
}

.number-hero-simple {
    grid-template-columns: minmax(0, 1fr);
    max-width: 920px;
}

.number-hero .kicker {
    margin-bottom: 8px;
}

.number-hero .lede {
    margin: 0;
    font-size: clamp(18px, 1.5vw, 21px);
}

.risk-dial {
    aspect-ratio: 1;
    width: 160px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: grid;
    place-items: center;
    text-align: center;
    justify-self: end;
    padding: 18px;
}

.risk-dial strong {
    font-family: var(--display);
    font-size: 54px;
    font-weight: 400;
    line-height: .8;
}

.risk-dial span {
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
}

.risk-dial small {
    font-size: 10px;
}

.number-summary-grid {
    display: grid;
    grid-template-columns: minmax(300px, .7fr) minmax(0, 1.3fr);
    gap: 18px;
    align-items: stretch;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.metrics-grid > div {
    min-height: 92px;
    padding: 14px;
}

.metrics-grid strong {
    display: block;
    margin-top: 14px;
    font-family: var(--display);
    font-size: clamp(26px, 2.5vw, 32px);
    font-weight: 400;
    line-height: .96;
}

.ofcom-panel {
    border: 2px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(251, 252, 248, .9);
    padding: 16px;
    box-shadow: var(--shadow);
}

.ofcom-panel .section-head {
    border-top: 0;
    margin-bottom: 14px;
    padding-top: 0;
}

.ofcom-panel .section-head h2 {
    font-size: clamp(32px, 4vw, 56px);
    line-height: .98;
}

.ofcom-panel .section-head p:last-child {
    margin: 12px 0 0;
    line-height: 1.45;
}

.ofcom-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
}

.ofcom-facts > div {
    min-height: 82px;
    border-top: 1px solid var(--line-strong);
    padding-top: 10px;
}

.ofcom-facts span,
.ofcom-facts em {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    font-style: normal;
    text-transform: uppercase;
}

.ofcom-facts strong {
    display: block;
    margin-top: 8px;
    font-size: 17px;
    line-height: 1.2;
}

.ofcom-facts em {
    display: block;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.interest-panel {
    margin-top: 24px;
    border: 2px solid var(--line-strong);
    border-radius: var(--radius);
    background: rgba(251, 252, 248, .9);
    padding: 22px;
    box-shadow: var(--shadow);
}

.interest-panel .section-head {
    margin-bottom: 18px;
}

.insight-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr);
    gap: 34px;
    align-items: start;
}

.interest-line-chart {
    width: 100%;
    height: auto;
    min-height: 260px;
    overflow: visible;
}

.interest-axis {
    stroke: var(--line-strong);
    stroke-width: 2.5;
}

.interest-grid-line {
    stroke: var(--line);
    stroke-width: 1;
}

.interest-line {
    fill: none;
    stroke: var(--signal);
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 5;
}

.interest-point {
    fill: var(--surface);
    stroke: var(--signal-dark);
    stroke-width: 3;
}

.interest-x-label,
.interest-y-label {
    fill: var(--muted);
    font-family: var(--mono);
    font-size: 13px;
}

.interest-x-label {
    text-anchor: middle;
}

.interest-y-label {
    text-anchor: start;
}

.pie-wrap {
    display: grid;
    grid-template-columns: minmax(180px, 240px) 1fr;
    gap: 18px;
    align-items: center;
}

.report-pie-chart {
    width: 100%;
    height: auto;
    overflow: visible;
}

.report-pie-base {
    fill: none;
    stroke: var(--surface-alt);
    stroke-width: 36;
}

.report-pie-slice {
    fill: none;
    stroke-width: 36;
    transform: rotate(-90deg);
    transform-origin: 100px 100px;
}

.report-pie-total {
    fill: var(--ink);
    font-family: var(--display);
    font-size: 42px;
    text-anchor: middle;
}

.report-pie-label {
    fill: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
    text-anchor: middle;
    text-transform: uppercase;
}

.pie-legend {
    display: grid;
    border-top: 1px solid var(--line);
}

.pie-legend div {
    display: grid;
    grid-template-columns: 14px 1fr auto;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

.pie-legend span {
    width: 14px;
    height: 14px;
    border: 1px solid var(--line-strong);
}

.pie-legend strong {
    font-size: 14px;
    font-weight: 700;
}

.pie-legend em {
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12px;
    font-style: normal;
}

.comment-list article {
    border-bottom: 1px solid var(--line);
    padding: 0 0 18px;
    margin-bottom: 18px;
}

.comment-list p {
    margin-bottom: 0;
    line-height: 1.65;
}

.comments-panel {
    margin: 52px 0;
}

.actions {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.content-page,
.form-shell {
    margin: 64px auto;
    padding: clamp(22px, 4vw, 42px);
    max-width: 900px;
}

.content-page h1,
.form-shell h1 {
    font-size: clamp(48px, 6vw, 86px);
}

.stack-form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.stack-form button {
    justify-self: start;
}

.check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: var(--ink);
    font-family: var(--body);
    font-size: 15px;
    font-weight: 500;
    text-transform: none;
}

.check-row input {
    width: auto;
    margin-top: 3px;
}

.admin-shell {
    max-width: 1160px;
}

.compact-form {
    max-width: 420px;
}

.admin-bar {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    border-block: 2px solid var(--line-strong);
    padding: 12px 0;
    font-family: var(--mono);
    font-size: 12px;
    text-transform: uppercase;
}

.queue-list {
    display: grid;
    gap: 18px;
    margin-top: 24px;
}

.queue-item,
.request-row {
    border: 2px solid var(--line-strong);
    background: #fbfcf8;
    padding: 18px;
}

.queue-item header {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
}

.private-note {
    background: var(--surface-alt);
    padding: 12px;
}

.review-form {
    display: grid;
    gap: 12px;
}

.decision-row,
.inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: end;
}

.decision-row button:nth-child(2) {
    background: var(--amber);
}

.decision-row button:nth-child(3) {
    background: var(--green);
}

.decision-row button:nth-child(4),
.decision-row button:nth-child(5) {
    background: #fbfcf8;
    color: var(--ink);
}

.admin-panel {
    margin-top: 28px;
    padding: 18px;
}

.request-row {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px clamp(18px, 4vw, 54px);
    border-top: 2px solid var(--line-strong);
    color: var(--muted);
}

.site-footer strong {
    color: var(--ink);
}

@media (max-width: 820px) {
    .site-header,
    .site-footer,
    .action-band,
    .queue-item header {
        align-items: flex-start;
        flex-direction: column;
    }

    .hero-grid,
    .split-section,
    .number-hero,
    .number-summary-grid,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .hero-grid {
        min-height: auto;
        padding-top: 48px;
    }

    .search-row,
    .number-row {
        grid-template-columns: 1fr;
    }

    .risk-dial {
        justify-self: start;
        width: min(160px, 100%);
    }

    .metrics-grid strong {
        margin-top: 12px;
    }

    .ofcom-facts {
        grid-template-columns: 1fr;
    }

    .ofcom-facts > div {
        min-height: auto;
    }

    .interest-line-chart {
        min-width: 760px;
    }

    .interest-panel {
        overflow-x: auto;
    }

    .insight-grid,
    .pie-wrap {
        grid-template-columns: 1fr;
    }

    button,
    .button-link,
    .stack-form button {
        width: 100%;
    }
}
