:root {
    color-scheme: light;
    --ink: #18202b;
    --muted: #647184;
    --line: #d9e0e8;
    --bg: #f6f8fb;
    --panel: #ffffff;
    --blue: #005eb8;
    --green: #1d7f5f;
    --amber: #a65f00;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.5;
    padding-bottom: 72px;
}

a {
    color: var(--blue);
}

.topbar {
    align-items: center;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 28px clamp(18px, 4vw, 56px);
}

.topbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.navlinks {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.navlinks a {
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.topbar.compact {
    padding-block: 18px;
}

.eyebrow {
    color: var(--green);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    margin: 0 0 4px;
    text-transform: uppercase;
}

h1 {
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.05;
    margin: 0;
}

main {
    margin: 0 auto;
    max-width: 1180px;
    padding: 26px clamp(18px, 4vw, 56px) 56px;
}

.button,
button,
.pagination a {
    background: var(--blue);
    border: 0;
    color: white;
    cursor: pointer;
    display: inline-flex;
    font-weight: 700;
    min-height: 42px;
    padding: 10px 16px;
    text-decoration: none;
}

.button.secondary {
    background: #eef2f6;
    color: var(--ink);
}

.back {
    color: var(--ink);
    font-weight: 700;
}

.stats {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 18px;
}

.stats div,
.release,
.detail {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.stats div {
    padding: 16px;
}

.stats strong {
    display: block;
    font-size: 24px;
}

.stats span,
.result-meta,
.release p,
.release dt,
.detail-meta dt,
.attachments span {
    color: var(--muted);
}

.filters {
    align-items: stretch;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(280px, 2fr) repeat(4, minmax(150px, 1fr));
    margin: 16px 0;
}

.filters button,
.filters .button {
    justify-content: center;
}

.insights {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 16px 0;
}

.insights > div {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
}

.insights h2 {
    font-size: 17px;
    margin: 0 0 12px;
}

.directorate-panel {
    grid-template-columns: 1fr;
}

.bar-row {
    align-items: center;
    color: var(--ink);
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(96px, 140px) minmax(100px, 1fr) minmax(92px, max-content);
    min-height: 34px;
    position: relative;
    text-decoration: none;
}

.bar-row b {
    background: #b7d8f6;
    display: block;
    height: 10px;
    max-width: 100%;
}

.bar-row em {
    color: var(--muted);
    font-style: normal;
    min-width: 92px;
    text-align: right;
    white-space: nowrap;
}

.timeline-row {
    grid-template-columns: minmax(96px, 140px) minmax(100px, 1fr) 128px;
}

.timeline-row em {
    align-items: baseline;
    display: grid;
    gap: 12px;
    grid-template-columns: 54px 54px;
    justify-content: end;
    min-width: 128px;
}

.timeline-row em span {
    text-align: right;
    white-space: nowrap;
}

.mini-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-chips a,
.profile-grid a {
    background: #f1f4f8;
    color: var(--ink);
    text-decoration: none;
}

.mini-chips a {
    padding: 5px 8px;
}

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

.profile-grid a {
    border-left: 4px solid var(--green);
    display: block;
    padding: 10px;
}

.profile-grid strong,
.profile-grid span {
    display: block;
}

.profile-grid span {
    color: var(--muted);
    font-size: 13px;
}

input,
select {
    border: 1px solid var(--line);
    border-radius: 0;
    font: inherit;
    min-height: 42px;
    padding: 9px 10px;
    width: 100%;
}

.result-meta {
    margin: 18px 0 10px;
}

.results {
    display: grid;
    gap: 12px;
}

.release {
    display: grid;
    gap: 24px;
    grid-template-columns: minmax(0, 1fr) 300px;
    padding: 18px;
}

.release h2 {
    font-size: 20px;
    line-height: 1.25;
    margin: 0 0 8px;
}

.release p {
    margin: 0 0 12px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chips span {
    background: #edf7f3;
    color: #12513d;
    font-size: 13px;
    font-weight: 700;
    padding: 4px 8px;
}

.chips .chip-days {
    background: #fff4df;
    color: #744200;
}

.chips .chip-deadline {
    background: #fde8e8;
    color: #a32020;
}

.chips .chip-exemption {
    background: #eef2ff;
    color: #263f8f;
    cursor: help;
}

.chips .chip-score {
    background: #e9f5ff;
    color: #004b89;
}

.chips .chip-flag {
    background: #f7eefd;
    color: #65308f;
}

.chips .chip-risk {
    background: #2b1b1b;
    color: #ffffff;
}

.chips .chip-dimension {
    background: #f1f4f8;
    color: #394150;
}

.hot-release {
    border-left: 5px solid #a32020;
}

dl {
    margin: 0;
}

dt {
    font-size: 12px;
    font-weight: 700;
    margin-top: 8px;
    text-transform: uppercase;
}

dd {
    margin: 0;
}

code {
    background: #f1f4f8;
    color: var(--ink);
    padding: 2px 5px;
}

.pagination {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 22px;
}

.detail {
    padding: clamp(20px, 4vw, 42px);
}

.detail h2 {
    border-top: 1px solid var(--line);
    font-size: 22px;
    margin: 28px 0 8px;
    padding-top: 22px;
}

.detail-meta {
    display: grid;
    gap: 8px 24px;
    grid-template-columns: 140px minmax(0, 1fr);
    margin-top: 22px;
}

.detail-meta dt {
    margin: 0;
}

.attachments {
    list-style: none;
    padding: 0;
}

.attachments li {
    border-top: 1px solid var(--line);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px 0;
}

.notice {
    background: #eaf7ef;
    border: 1px solid #b9ddc5;
    color: #14532d;
    padding: 12px 14px;
}

.import-progress {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: 8px 8px 0 0;
    bottom: 0;
    box-shadow: 0 -6px 18px rgba(24, 32, 43, 0.08);
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(220px, max-content) minmax(160px, 1fr);
    left: 50%;
    max-width: min(820px, calc(100vw - 28px));
    padding: 10px 14px 12px;
    position: fixed;
    transform: translateX(-50%);
    width: 100%;
    z-index: 20;
}

.import-progress strong,
.import-progress span {
    display: block;
    line-height: 1.25;
}

.import-progress strong {
    font-size: 14px;
}

.import-progress span {
    color: var(--muted);
    font-size: 12px;
}

.import-progress b {
    background: #edf2f7;
    display: block;
    height: 9px;
    overflow: hidden;
}

.import-progress i {
    background: var(--green);
    display: block;
    height: 100%;
}

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

@media (max-width: 850px) {
    .topbar,
    .release,
    .attachments li {
        display: block;
    }

    .button {
        margin-top: 16px;
    }

    .stats,
    .filters,
    .insights,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .detail-meta {
        grid-template-columns: 1fr;
    }

    .import-progress {
        grid-template-columns: 1fr;
    }
}
