:root {
    --ink: #18202f;
    --muted: #687386;
    --line: #d9e0ea;
    --paper: #ffffff;
    --surface: #f5f7fa;
    --primary: #0f766e;
    --primary-dark: #0b5f59;
    --accent: #b91c1c;
    --warning: #9a6700;
    --ok: #0f7a43;
    --focus: #2563eb;
    font-family: "NotoSansThai", "Noto Sans Thai", Tahoma, Arial, sans-serif;
}

@font-face { font-family: "NotoSansThai"; src: url("fonts/NotoSansThai-100.ttf") format("truetype"); font-style: normal; font-weight: 100; font-display: swap; }
@font-face { font-family: "NotoSansThai"; src: url("fonts/NotoSansThai-200.ttf") format("truetype"); font-style: normal; font-weight: 200; font-display: swap; }
@font-face { font-family: "NotoSansThai"; src: url("fonts/NotoSansThai-300.ttf") format("truetype"); font-style: normal; font-weight: 300; font-display: swap; }
@font-face { font-family: "NotoSansThai"; src: url("fonts/NotoSansThai-400.ttf") format("truetype"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "NotoSansThai"; src: url("fonts/NotoSansThai-500.ttf") format("truetype"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "NotoSansThai"; src: url("fonts/NotoSansThai-600.ttf") format("truetype"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "NotoSansThai"; src: url("fonts/NotoSansThai-700.ttf") format("truetype"); font-style: normal; font-weight: 700; font-display: swap; }
@font-face { font-family: "NotoSansThai"; src: url("fonts/NotoSansThai-800.ttf") format("truetype"); font-style: normal; font-weight: 800; font-display: swap; }
@font-face { font-family: "NotoSansThai"; src: url("fonts/NotoSansThai-900.ttf") format("truetype"); font-style: normal; font-weight: 900; font-display: swap; }

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--surface);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--primary-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
select,
textarea {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(37, 99, 235, .25);
    outline-offset: 2px;
}

button {
    border: 0;
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    background: var(--ink);
    color: #fff;
}

.site-header {
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 18px clamp(16px, 4vw, 48px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-width: 0;
}

.brand-block {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 260px;
    flex: 1 1 auto;
}

.brand-block > div {
    min-width: 0;
}

.brand-mark {
    width: 54px;
    height: 54px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--primary);
    font-weight: 800;
    letter-spacing: 0;
}

.brand-block h1 {
    margin: 0;
    font-size: clamp(18px, 2vw, 28px);
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.kicker,
.section-eyebrow {
    margin: 0 0 4px;
    font-size: 13px;
    color: var(--primary-dark);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.top-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.menu-toggle {
    display: none;
    width: 46px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 4px;
    flex: 0 0 auto;
}

.menu-toggle span {
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 999px;
    transition: transform .2s ease, opacity .2s ease;
}

.menu-toggle b {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

.inline-form {
    display: inline;
}

.link-button {
    background: transparent;
    color: var(--primary-dark);
    padding: 0;
}

.page-shell {
    width: min(1180px, calc(100% - 32px));
    margin: 24px auto 48px;
}

.site-footer {
    border-top: 1px solid var(--line);
    color: var(--muted);
    background: var(--paper);
    padding: 18px clamp(16px, 4vw, 48px);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.flash {
    padding: 12px 14px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    background: #fff;
}

.flash-success {
    border-color: #9bd7b5;
    color: #07542b;
    background: #ecfdf3;
}

.flash-error {
    border-color: #f0aaaa;
    color: #8c1616;
    background: #fff1f1;
}

.flash-warning {
    border-color: #ecd28d;
    color: #785000;
    background: #fffaeb;
}

.year-switcher,
.search-bar {
    display: grid;
    grid-template-columns: auto minmax(180px, 1fr) auto;
    gap: 10px;
    align-items: center;
    background: var(--paper);
    border: 1px solid var(--line);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.hero,
.admin-hero,
.auth-panel,
.section-head {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: clamp(18px, 3vw, 30px);
    margin-bottom: 18px;
}

.hero,
.admin-hero,
.auth-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 24px;
    align-items: center;
}

.hero h2,
.admin-hero h2,
.section-head h2,
.auth-panel h2 {
    margin: 0 0 8px;
    font-size: clamp(24px, 4vw, 44px);
    line-height: 1.2;
}

.muted,
.hero p,
.section-head p {
    color: var(--muted);
}

.score-box {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 20px;
    background: #f8fbfb;
    display: grid;
    gap: 4px;
    text-align: center;
}

.score-box.compact {
    padding: 14px;
}

.score-number {
    font-size: 42px;
    line-height: 1;
    font-weight: 800;
    color: var(--primary-dark);
}

.indicator-group {
    margin: 22px 0;
}

.group-heading {
    display: flex;
    gap: 12px;
    align-items: baseline;
    margin-bottom: 10px;
}

.group-heading span {
    background: var(--ink);
    color: #fff;
    border-radius: 6px;
    padding: 3px 8px;
    font-weight: 700;
}

.group-heading h3 {
    margin: 0;
    font-size: 22px;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.oit-card,
.stat-card,
.panel-form,
.table-wrap,
.security-list > div {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.oit-card {
    padding: 16px;
    min-height: 210px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-topline {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.oit-card h4 {
    margin: 0;
    font-size: 18px;
    line-height: 1.35;
}

.oit-card p {
    margin: 0;
}

.note {
    color: #414c5e;
    background: #f5f7fa;
    border-left: 3px solid var(--line);
    padding: 8px 10px;
}

.evidence-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: auto;
}

.evidence-link,
.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    padding: 10px 14px;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
}

.evidence-link:hover,
.primary-button:hover {
    background: var(--primary-dark);
    color: #fff;
    text-decoration: none;
}

.secondary-evidence {
    background: #e8f1f1;
    color: var(--primary-dark);
}

.secondary-evidence:hover {
    background: #d5e8e7;
    color: var(--primary-dark);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: 700;
    background: #edf1f7;
    color: #344054;
}

.status-published {
    background: #dcfce7;
    color: var(--ok);
}

.status-in_progress {
    background: #fff4d6;
    color: var(--warning);
}

.status-missing {
    background: #fee2e2;
    color: var(--accent);
}

.status-draft {
    background: #e9eef6;
    color: #475569;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.stat-card {
    padding: 18px;
    display: grid;
    gap: 6px;
}

.stat-card strong {
    font-size: 34px;
    color: var(--primary-dark);
}

.table-wrap {
    overflow-x: auto;
    margin: 18px 0;
}

.table-head {
    padding: 14px 16px 0;
}

.table-head h3 {
    margin: 0;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 760px;
}

th,
td {
    text-align: left;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

th {
    color: #344054;
    background: #f8fafc;
    font-weight: 800;
}

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

.admin-wide {
    margin: 18px 0;
}

.panel-form,
.stack-form {
    display: grid;
    gap: 12px;
}

.panel-form {
    padding: 18px;
}

.panel-form h3 {
    margin: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 2fr 1fr 120px;
    gap: 12px;
    align-items: end;
}

.check-line {
    display: flex;
    align-items: center;
    gap: 8px;
}

.current-file {
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    background: #f8fafc;
    display: grid;
    gap: 8px;
}


.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line);
}

.file-row:first-of-type {
    border-top: 0;
}

.file-row span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.file-row .danger-button {
    flex: 0 0 auto;
}
.check-line input {
    width: auto;
}

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

.danger-button {
    background: #fff1f1;
    color: var(--accent);
    border: 1px solid #f0aaaa;
    padding: 7px 10px;
}

.secondary-link {
    justify-self: start;
}

.security-list {
    display: grid;
    gap: 12px;
}

.security-list > div {
    padding: 16px;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 14px;
}

.empty-state {
    background: #fff;
    border: 1px dashed var(--line);
    color: var(--muted);
    border-radius: 8px;
    padding: 24px;
    text-align: center;
}

@media (max-width: 820px) {
    .hero,
    .admin-hero,
    .auth-panel,
    .admin-grid,
    .form-row,
    .security-list > div {
        grid-template-columns: 1fr;
    }

    .site-header {
        position: sticky;
        align-items: stretch;
        flex-direction: column;
        padding: 12px 16px;
        gap: 10px;
    }

    .header-main {
        width: 100%;
    }

    .brand-block {
        min-width: 0;
        gap: 10px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
        font-size: 14px;
    }

    .brand-block h1 {
        font-size: 16px;
        line-height: 1.28;
        max-width: none;
    }

    .kicker {
        font-size: 12px;
        line-height: 1.35;
    }

    .menu-toggle {
        display: inline-flex;
    }

    .year-switcher,
    .search-bar {
        grid-template-columns: 1fr;
    }

    .top-nav {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        border-top: 1px solid var(--line);
        padding-top: 10px;
    }

    .js-enabled .top-nav {
        display: none;
    }

    .js-enabled .top-nav.is-open {
        display: flex;
    }

    .top-nav a,
    .top-nav .link-button {
        width: 100%;
        min-height: 44px;
        border-radius: 8px;
        background: #f5f7fa;
        color: var(--ink);
        display: flex;
        align-items: center;
        padding: 10px 12px;
        font-weight: 700;
        text-decoration: none;
    }

    .top-nav a:hover,
    .top-nav .link-button:hover {
        background: #e8f1f1;
        color: var(--primary-dark);
    }

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

    .page-shell {
        width: min(100% - 24px, 1180px);
        margin: 16px auto 36px;
    }

    .hero h2,
    .admin-hero h2,
    .section-head h2,
    .auth-panel h2 {
        font-size: 26px;
    }

    .score-box {
        text-align: left;
    }

    .item-grid {
        grid-template-columns: 1fr;
    }

    .oit-card {
        min-height: auto;
    }

    .evidence-actions {
        flex-direction: column;
    }

    .evidence-link,
    .primary-button {
        width: 100%;
    }

    th,
    td {
        padding: 10px;
    }
}

@media (max-width: 420px) {
    .site-header {
        padding: 10px 12px;
    }

    .brand-block h1 {
        font-size: 15px;
        max-width: none;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        font-size: 13px;
    }

    .menu-toggle {
        width: 42px;
        height: 40px;
    }

    .hero,
    .admin-hero,
    .auth-panel,
    .section-head,
    .panel-form {
        padding: 16px;
    }

    .hero h2,
    .admin-hero h2,
    .section-head h2,
    .auth-panel h2 {
        font-size: 24px;
    }

    .group-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }

    .group-heading h3 {
        font-size: 20px;
    }

    .year-switcher,
    .search-bar {
        padding: 12px;
    }
}

@media (max-width: 360px) {
    .brand-block {
        gap: 8px;
    }

    .brand-mark {
        width: 34px;
        height: 34px;
        font-size: 12px;
    }

    .brand-block h1 {
        font-size: 14px;
    }

    .kicker {
        font-size: 11px;
    }

    .menu-toggle {
        width: 38px;
        height: 38px;
    }

    .page-shell {
        width: min(100% - 16px, 1180px);
    }
}

/* === 2026 UX UI Refresh === */
:root {
    --ink: #0b1220;
    --muted: #667085;
    --line: #d8e0ea;
    --paper: #ffffff;
    --surface: #eef3f8;
    --surface-2: #f8fafc;
    --primary: #0f766e;
    --primary-dark: #0b5f59;
    --primary-soft: #e7f5f2;
    --accent: #b42318;
    --accent-soft: #fff1f0;
    --warning: #b76e00;
    --warning-soft: #fff7df;
    --ok: #087443;
    --ok-soft: #e7f8ef;
    --focus: #2563eb;
    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --shadow-md: 0 10px 28px rgba(16, 24, 40, .10);
    --radius: 8px;
    --radius-sm: 6px;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background:
        linear-gradient(180deg, #f8fbfd 0, #eef3f8 320px, #f6f8fb 100%);
    color: var(--ink);
    font-size: 16px;
}

button,
a,
input,
select,
textarea {
    transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
}

button:hover,
.primary-button:hover,
.evidence-link:hover {
    transform: translateY(-1px);
}

.site-header {
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(216, 224, 234, .88);
    box-shadow: var(--shadow-sm);
    padding: 14px clamp(16px, 4vw, 40px);
}

.header-main {
    flex: 1 1 auto;
}

.brand-block {
    gap: 12px;
}

.brand-mark {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    background: var(--primary);
    box-shadow: inset 0 -10px 18px rgba(0, 0, 0, .10);
    font-size: 14px;
}

.brand-block h1 {
    font-size: clamp(20px, 2.35vw, 30px);
    font-weight: 800;
    letter-spacing: 0;
    color: #071126;
}

.kicker,
.section-eyebrow {
    color: var(--primary-dark);
    font-weight: 800;
}

.top-nav {
    gap: 6px;
    padding: 4px;
    border: 1px solid transparent;
}

.top-nav a,
.top-nav .link-button {
    border-radius: var(--radius-sm);
    min-height: 40px;
    padding: 8px 12px;
    color: #344054;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.top-nav a:hover,
.top-nav .link-button:hover {
    background: var(--primary-soft);
    color: var(--primary-dark);
    text-decoration: none;
}

.page-shell {
    width: min(1200px, calc(100% - 32px));
    margin: 22px auto 52px;
}

.flash {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    font-weight: 700;
}

.year-switcher,
.search-bar {
    border: 1px solid rgba(216, 224, 234, .96);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: rgba(255, 255, 255, .96);
    padding: 14px;
}

.year-switcher label,
.search-bar label,
.panel-form label,
.stack-form label {
    font-weight: 700;
    color: #182230;
}

input,
select,
textarea {
    min-height: 44px;
    border-radius: var(--radius-sm);
    border-color: #ccd6e2;
    color: var(--ink);
    background: #fff;
}

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

input:hover,
select:hover,
textarea:hover {
    border-color: #98a6b8;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--focus);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .14);
}

button,
.primary-button {
    min-height: 44px;
    border-radius: var(--radius-sm);
    font-weight: 800;
    box-shadow: var(--shadow-sm);
}

.hero,
.admin-hero,
.auth-panel,
.section-head {
    border: 1px solid rgba(216, 224, 234, .96);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    background: var(--paper);
    overflow: hidden;
}

.hero,
.admin-hero {
    position: relative;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 260px);
    padding: clamp(22px, 4vw, 38px);
}

.hero::before,
.admin-hero::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: linear-gradient(90deg, var(--primary), #c9971a, #a5336f);
}

.hero h2,
.admin-hero h2,
.section-head h2,
.auth-panel h2 {
    color: #071126;
    font-weight: 900;
    letter-spacing: 0;
}

.hero p,
.admin-hero p,
.auth-panel p,
.section-head p {
    font-size: 16px;
}

.score-box {
    background: #f8fbfb;
    border: 1px solid #cfdde7;
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72);
}

.score-number {
    color: #08756f;
    font-size: clamp(36px, 6vw, 48px);
}

.stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 18px;
    border-left: 5px solid var(--primary);
}

.stat-card:nth-child(2) {
    border-left-color: var(--ok);
}

.stat-card:nth-child(3) {
    border-left-color: var(--warning);
}

.stat-card:nth-child(4) {
    border-left-color: var(--accent);
}

.stat-card strong {
    font-size: 38px;
    line-height: 1;
}

.indicator-group {
    margin: 26px 0;
}

.group-heading {
    padding: 0 2px;
}

.group-heading span {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border: 1px solid #b9dfd7;
    border-radius: var(--radius-sm);
}

.group-heading h3 {
    font-weight: 900;
    color: #152033;
}

.item-grid {
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 14px;
}

.oit-card {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 16px;
    border-top: 4px solid #cbd5e1;
    min-height: 224px;
}

.oit-card:has(.status-published) {
    border-top-color: var(--ok);
}

.oit-card:has(.status-in_progress) {
    border-top-color: var(--warning);
}

.oit-card:has(.status-missing) {
    border-top-color: var(--accent);
}

.card-topline strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    min-height: 34px;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
    color: #0f172a;
    font-size: 15px;
}

.oit-card h4 {
    color: #101828;
    font-weight: 850;
}

.status-pill {
    min-height: 28px;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 800;
}

.status-published {
    background: var(--ok-soft);
    color: var(--ok);
}

.status-in_progress {
    background: var(--warning-soft);
    color: var(--warning);
}

.status-missing {
    background: var(--accent-soft);
    color: var(--accent);
}

.status-draft {
    background: #eef2f6;
    color: #475467;
}

.evidence-actions {
    gap: 8px;
}

.evidence-link,
.secondary-evidence {
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    min-height: 40px;
    padding: 9px 12px;
}

.evidence-link {
    background: var(--primary);
}

.secondary-evidence {
    border-color: #b9dfd7;
    background: var(--primary-soft);
}

.note {
    border-radius: var(--radius-sm);
    border-left-color: var(--primary);
}

.table-wrap {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-color: rgba(216, 224, 234, .96);
}

.table-head {
    padding: 16px 18px 4px;
}

.table-head h3 {
    color: #101828;
    font-weight: 900;
}

table {
    background: #fff;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f1f5f9;
    color: #344054;
    font-size: 14px;
}

td {
    color: #1d2939;
}

tbody tr:hover {
    background: #f8fafc;
}

.admin-grid {
    gap: 16px;
}

.panel-form,
.stack-form {
    gap: 14px;
}

.panel-form,
.current-file {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.panel-form h3 {
    color: #101828;
    font-weight: 900;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--line);
}

.item-editor {
    border-top: 4px solid var(--primary);
}

.current-file {
    background: #f8fafc;
}

.file-row {
    align-items: center;
}

.file-row a {
    font-weight: 700;
}

.danger-button {
    border-radius: var(--radius-sm);
    font-weight: 800;
}

.auth-panel {
    align-items: start;
}

.security-list > div {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border-left: 5px solid var(--primary);
}

.empty-state {
    border-radius: var(--radius);
    background: #fff;
}

.site-footer {
    background: #ffffff;
    border-top-color: var(--line);
}

@media (max-width: 980px) {
    .site-header {
        align-items: stretch;
        flex-direction: column;
    }

    .top-nav {
        justify-content: flex-start;
    }

    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .site-header {
        padding: 12px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
    }

    .hero,
    .admin-hero,
    .auth-panel {
        grid-template-columns: 1fr;
    }

    .top-nav a,
    .top-nav .link-button {
        justify-content: flex-start;
    }

    .year-switcher,
    .search-bar {
        gap: 10px;
    }

    .score-box {
        text-align: center;
    }

    .item-grid,
    .stat-grid {
        grid-template-columns: 1fr;
    }

    .file-row {
        align-items: stretch;
        flex-direction: column;
    }

    .file-row .danger-button {
        width: 100%;
    }
}

@media (max-width: 420px) {
    body {
        font-size: 15px;
    }

    .page-shell {
        width: min(100% - 18px, 1200px);
    }

    .hero,
    .admin-hero,
    .auth-panel,
    .section-head,
    .panel-form {
        padding: 16px;
    }

    .card-topline {
        align-items: flex-start;
        flex-direction: column;
    }

    .status-pill {
        align-self: flex-start;
    }
}