:root {
    --blue-900: #184977;
    --blue-800: #245b8f;
    --blue-700: #3f74a6;
    --blue-200: #dbe6f2;
    --blue-100: #eef3f8;
    --gold-600: #c39a49;
    --gold-100: #f4ead6;
    --text: #20364f;
    --muted: #60748e;
    --line: rgba(25, 64, 104, 0.12);
    --surface: rgba(255, 255, 255, 0.96);
    --surface-alt: #f8fbfe;
    --success: #1f7a5c;
    --danger: #bb4b4b;
    --radius-3xl: 30px;
    --radius-2xl: 24px;
    --radius-xl: 20px;
    --radius-lg: 16px;
    --shadow-lg: 0 26px 60px rgba(24, 73, 119, 0.18);
    --shadow-md: 0 18px 36px rgba(24, 73, 119, 0.12);
    --shadow-sm: 0 10px 20px rgba(24, 73, 119, 0.08);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: "Segoe UI Variable Text", "Segoe UI", Tahoma, sans-serif;
    color: var(--text);
    background:
        linear-gradient(180deg, #245b8f 0%, #6e8fb0 32%, #edf2f7 32%, #f8fafc 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(circle at 50% 12%, rgba(255, 255, 255, 0.08), transparent 20%),
        radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.05), transparent 18%);
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.page-shell {
    position: relative;
    z-index: 1;
    width: min(1240px, calc(100% - 24px));
    margin: 0 auto;
    padding: 20px 0 40px;
}

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

.panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-3xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(14px);
}

.site-header,
.hero__card,
.status-board,
.page-footer {
    opacity: 0;
    animation: fadeUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: #ffffff;
}

.site-header__copy {
    min-width: 0;
}

.site-header__eyebrow {
    margin: 0 0 8px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.84rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.site-header__title {
    margin: 0;
    font-family: "Bahnschrift SemiCondensed", "Bahnschrift", "Segoe UI", sans-serif;
    font-size: clamp(2rem, 3vw, 2.9rem);
    line-height: 1.05;
}

.site-header__subtitle {
    margin: 8px 0 0;
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    line-height: 1.7;
}

.site-header__logo {
    width: 150px;
    height: 150px;
    flex-shrink: 0;
    padding: 2px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.28);
    object-fit: contain;
    box-shadow: 0 10px 22px rgba(12, 33, 58, 0.28);
}

.page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    align-items: start;
    gap: 18px;
    margin-top: 18px;
}

.admin-layout {
    grid-template-columns: 1fr;
}

.results-column {
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 18px;
    order: 1;
}

.admin-layout .results-column {
    width: 100%;
}

.hero {
    position: relative;
    padding: 12px 0 0;
}

.hero__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(10px);
    pointer-events: none;
}

.hero__glow--one {
    inset-inline-start: 8%;
    inset-block-start: 46px;
    width: 160px;
    height: 160px;
    background: rgba(255, 255, 255, 0.08);
}

.hero__glow--two {
    inset-inline-end: 12%;
    inset-block-end: 30px;
    width: 220px;
    height: 220px;
    background: rgba(195, 154, 73, 0.08);
}

.hero__card {
    padding: clamp(24px, 3vw, 34px) clamp(20px, 2.8vw, 30px);
    text-align: center;
    animation-delay: 0.08s;
}

.hero__intro {
    max-width: 580px;
    margin: 0 auto;
}

.hero__eyebrow,
.section-heading__eyebrow,
.summary-item__label {
    margin: 0 0 12px;
    color: var(--blue-800);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero__title {
    margin: 0;
    color: var(--blue-900);
    font-family: "Bahnschrift SemiCondensed", "Bahnschrift", "Segoe UI", sans-serif;
    font-size: clamp(2.25rem, 4.6vw, 3.6rem);
    line-height: 1;
}

.hero__subtitle {
    margin: 14px 0 0;
    max-width: 650px;
    margin-inline: auto;
    color: var(--muted);
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.9;
}

.lookup-form {
    width: 100%;
    max-width: 760px;
    margin: 28px auto 0;
    text-align: right;
}

.form-label {
    display: block;
    margin-bottom: 10px;
    color: var(--text);
    font-weight: 800;
}

.form-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(172px, 210px);
    gap: 12px;
    align-items: end;
}

.input-wrap {
    display: flex;
    flex-direction: column;
}

.form-label--compact {
    margin: 0 0 8px;
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    min-height: 60px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #ffffff;
    color: var(--text);
    font-size: 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92);
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.form-input::placeholder {
    color: #94a3b7;
}

.form-input:focus {
    outline: none;
    transform: translateY(-1px);
    border-color: rgba(36, 91, 143, 0.38);
    box-shadow: 0 0 0 4px rgba(63, 116, 166, 0.14);
}

.form-button {
    min-width: 180px;
    min-height: 60px;
    padding: 0 24px;
    border: 0;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, #1f67c2, #235b8f);
    color: #ffffff;
    font-family: "Bahnschrift", "Segoe UI", sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 18px 30px rgba(31, 103, 194, 0.22);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.form-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 22px 34px rgba(31, 103, 194, 0.26);
}

.form-button:disabled {
    opacity: 0.78;
    cursor: wait;
}

.captcha-box {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(248, 251, 254, 0.9);
}

.captcha-box[hidden] {
    display: none;
}

.captcha-math {
    display: grid;
    gap: 10px;
}

.captcha-math[hidden] {
    display: none;
}

.turnstile-box {
    display: flex;
    justify-content: center;
}

.turnstile-box[hidden] {
    display: none;
}

.turnstile-widget {
    width: 100%;
    min-height: 70px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.turnstile-widget > div {
    margin-inline: auto;
}

.captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.captcha-question {
    margin: 0;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px dashed rgba(36, 91, 143, 0.32);
    border-radius: 12px;
    background: #ffffff;
    color: var(--blue-900);
    direction: ltr;
    text-align: left;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.5;
}

.captcha-refresh {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(36, 91, 143, 0.26);
    border-radius: 12px;
    background: #ffffff;
    color: var(--blue-800);
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.captcha-refresh:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 18px rgba(24, 73, 119, 0.14);
}

.captcha-refresh:disabled {
    opacity: 0.66;
    cursor: not-allowed;
}

.captcha-input {
    min-height: 56px;
    font-family: Consolas, "Courier New", monospace;
}

.hero__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 18px;
}

.hero-meta,
.results-badge {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 800;
}

.hero-meta {
    background: var(--surface-alt);
    border: 1px solid var(--line);
    color: var(--blue-800);
}

.status-message {
    display: none;
    max-width: 600px;
    margin: 18px auto 0;
    padding: 14px 16px;
    border-radius: 18px;
    font-weight: 700;
    text-align: right;
}

.status-message.is-visible {
    display: block;
    animation: fadeUp 0.35s ease;
}

.status-message.is-error {
    background: rgba(187, 75, 75, 0.08);
    border: 1px solid rgba(187, 75, 75, 0.16);
    color: var(--danger);
}

.status-message.is-success {
    background: rgba(31, 122, 92, 0.08);
    border: 1px solid rgba(31, 122, 92, 0.16);
    color: var(--success);
}

.status-board {
    width: auto;
    min-width: 0;
    padding: 22px 20px;
    animation-delay: 0.14s;
    order: 2;
}

.status-board__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
}

.status-board__eyebrow {
    margin: 0 0 8px;
    color: var(--blue-800);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.status-board__title {
    margin: 0;
    color: var(--blue-900);
    font-size: 1.35rem;
    font-weight: 800;
}

.status-board__legend,
.status-board__summary,
.level-statuses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-chip,
.status-stat,
.level-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 800;
}

.legend-chip::before,
.status-stat::before,
.level-chip::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.legend-chip--live,
.status-stat--live,
.level-chip--live {
    background: rgba(31, 122, 92, 0.09);
    border: 1px solid rgba(31, 122, 92, 0.18);
    color: var(--success);
}

.legend-chip--live::before,
.status-stat--live::before,
.level-chip--live::before {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(31, 122, 92, 0.12);
}

.legend-chip--pending,
.status-stat--pending,
.level-chip--pending {
    background: rgba(187, 75, 75, 0.08);
    border: 1px solid rgba(187, 75, 75, 0.16);
    color: var(--danger);
}

.legend-chip--pending::before,
.status-stat--pending::before,
.level-chip--pending::before {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(187, 75, 75, 0.1);
}

.status-board__summary {
    margin-top: 16px;
}

.status-board__feedback,
.status-board__placeholder {
    margin: 14px 0 0;
    padding: 14px 16px;
    border-radius: 18px;
    font-weight: 700;
    text-align: center;
}

.status-board__feedback {
    border: 1px solid rgba(187, 75, 75, 0.16);
    background: rgba(187, 75, 75, 0.08);
    color: var(--danger);
}

.status-board__placeholder {
    border: 1px dashed rgba(36, 91, 143, 0.18);
    background: rgba(248, 251, 254, 0.88);
    color: var(--muted);
}

.status-groups {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 18px;
}

.department-status {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(248, 251, 254, 0.9);
}

.department-status--live {
    border-color: rgba(31, 122, 92, 0.18);
    background: rgba(246, 253, 250, 0.98);
}

.department-status__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.department-status__title {
    margin: 0;
    color: var(--blue-900);
    font-size: 1rem;
    font-weight: 800;
}

.department-status__count {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.department-status__count--live {
    color: var(--success);
}

.subjects-card__text,
.page-footer p {
    margin: 0;
    color: var(--muted);
    line-height: 1.85;
}

.results-panel {
    padding: clamp(22px, 3vw, 30px);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
}

.results-panel[hidden] {
    display: none;
}

.results-panel.is-visible {
    animation: revealPanel 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.results-panel__head,
.subjects-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 18px;
}

.results-panel__head {
    margin-bottom: 22px;
}

.results-panel__meta {
    display: flex;
    align-items: center;
}

.section-heading__eyebrow--accent {
    color: var(--gold-600);
}

.panel-title {
    margin: 0;
    color: var(--blue-900);
    font-family: "Bahnschrift SemiCondensed", "Bahnschrift", "Segoe UI", sans-serif;
    font-size: clamp(1.75rem, 3vw, 2.45rem);
}

.results-badge {
    background: rgba(36, 91, 143, 0.08);
    border: 1px solid rgba(36, 91, 143, 0.14);
    color: var(--blue-800);
}

.results-disclaimer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    margin-bottom: 22px;
    padding: 14px 16px;
    border: 1px solid rgba(195, 154, 73, 0.28);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(244, 234, 214, 0.72), rgba(255, 250, 242, 0.96));
    color: #7a5b1b;
    font-weight: 700;
    line-height: 1.8;
}

.results-disclaimer strong {
    color: var(--gold-600);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.summary-item {
    position: relative;
    overflow: hidden;
    padding: clamp(18px, 2vw, 20px) clamp(16px, 2vw, 18px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.96));
    box-shadow: var(--shadow-sm);
}

.summary-item::before {
    content: "";
    position: absolute;
    inset-inline: 18px;
    inset-block-start: 0;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--gold-600), var(--blue-700));
}

.summary-item__label {
    display: block;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.76rem;
}

.summary-item__value {
    margin: 0;
    color: var(--blue-900);
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.8;
    word-break: break-word;
}

.summary-item__value--mono {
    direction: ltr;
    text-align: left;
    font-family: Consolas, "Courier New", monospace;
}

.subjects-card {
    padding: clamp(18px, 2.5vw, 22px);
    border: 1px solid var(--line);
    border-radius: var(--radius-2xl);
    background: var(--surface-alt);
}

.subjects-card__title {
    margin: 0;
    color: var(--blue-900);
    font-size: 1.24rem;
}

.subjects-card__text {
    margin-top: 8px;
    font-size: 0.96rem;
    font-weight: 700;
}

.results-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #ffffff;
}

.grade-legend-note {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(36, 91, 143, 0.16);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(245, 249, 255, 0.98), rgba(236, 244, 252, 0.92));
    color: var(--blue-900);
    box-shadow: var(--shadow-sm);
}

.grade-legend-note__title {
    display: block;
    margin-bottom: 12px;
    color: var(--blue-800);
}

.grade-legend-note__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
    gap: 10px 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.grade-legend-note__item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid rgba(36, 91, 143, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.86);
    font-weight: 700;
    line-height: 1.7;
}

.grade-legend-note__code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    padding: 6px 10px;
    border: 1px solid rgba(36, 91, 143, 0.14);
    border-radius: 999px;
    background: rgba(36, 91, 143, 0.08);
    color: var(--blue-800);
    font-weight: 800;
    white-space: nowrap;
}

.grade-legend-note__item--excellent {
    border-color: rgba(31, 122, 92, 0.2);
    background: linear-gradient(180deg, rgba(240, 252, 247, 0.98), rgba(247, 255, 251, 0.92));
    color: var(--success);
}

.grade-legend-note__item--excellent .grade-legend-note__code {
    border-color: rgba(31, 122, 92, 0.22);
    background: rgba(31, 122, 92, 0.12);
    color: var(--success);
}

.grade-legend-note__item--very-good {
    border-color: rgba(36, 91, 143, 0.18);
    background: linear-gradient(180deg, rgba(243, 248, 255, 0.98), rgba(248, 251, 255, 0.92));
    color: var(--blue-800);
}

.grade-legend-note__item--very-good .grade-legend-note__code {
    border-color: rgba(36, 91, 143, 0.2);
    background: rgba(36, 91, 143, 0.1);
    color: var(--blue-800);
}

.grade-legend-note__item--good {
    border-color: rgba(195, 154, 73, 0.22);
    background: linear-gradient(180deg, rgba(255, 250, 240, 0.98), rgba(255, 252, 246, 0.92));
    color: var(--gold-600);
}

.grade-legend-note__item--good .grade-legend-note__code {
    border-color: rgba(195, 154, 73, 0.22);
    background: rgba(195, 154, 73, 0.12);
    color: var(--gold-600);
}

.grade-legend-note__item--pass {
    border-color: rgba(195, 154, 73, 0.18);
    background: linear-gradient(180deg, rgba(250, 245, 232, 0.98), rgba(255, 250, 242, 0.92));
    color: #8a6b2d;
}

.grade-legend-note__item--pass .grade-legend-note__code {
    border-color: rgba(195, 154, 73, 0.18);
    background: rgba(195, 154, 73, 0.1);
    color: #8a6b2d;
}

.grade-legend-note__item--fail {
    border-color: rgba(187, 75, 75, 0.2);
    background: linear-gradient(180deg, rgba(255, 241, 241, 0.98), rgba(255, 248, 248, 0.92));
    color: var(--danger);
}

.grade-legend-note__item--fail .grade-legend-note__code {
    border-color: rgba(187, 75, 75, 0.24);
    background: rgba(187, 75, 75, 0.12);
    color: var(--danger);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
}

.results-table th,
.results-table td {
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    text-align: right;
}

.results-table thead th {
    background: rgba(36, 91, 143, 0.06);
    color: var(--blue-900);
    font-size: 0.92rem;
    font-weight: 800;
}

.results-table__subject {
    direction: ltr;
    text-align: left;
    font-weight: 700;
    color: var(--blue-900);
    letter-spacing: 0.01em;
    word-break: break-word;
}

.results-table tbody tr {
    opacity: 0;
    transform: translateY(10px);
    animation: fadeUp 0.45s ease forwards;
}

.results-table tbody tr.results-table__row--static {
    opacity: 1;
    transform: none;
    animation: none;
}

.results-table tbody tr:last-child td {
    border-bottom: 0;
}

.results-table tbody tr:hover {
    background: rgba(219, 230, 242, 0.45);
}

.grade-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 118px;
    max-width: 100%;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-weight: 800;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.grade-chip--excellent {
    background: linear-gradient(180deg, rgba(31, 122, 92, 0.16), rgba(31, 122, 92, 0.08));
    border-color: rgba(31, 122, 92, 0.22);
    color: var(--success);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 8px 18px rgba(31, 122, 92, 0.12);
}

.grade-chip--very-good {
    background: linear-gradient(180deg, rgba(36, 91, 143, 0.14), rgba(36, 91, 143, 0.08));
    border-color: rgba(36, 91, 143, 0.2);
    color: var(--blue-800);
}

.grade-chip--good {
    background: linear-gradient(180deg, rgba(195, 154, 73, 0.18), rgba(195, 154, 73, 0.08));
    border-color: rgba(195, 154, 73, 0.22);
    color: var(--gold-600);
}

.grade-chip--pass {
    background: linear-gradient(180deg, rgba(195, 154, 73, 0.12), rgba(244, 234, 214, 0.75));
    border-color: rgba(195, 154, 73, 0.18);
    color: #8a6b2d;
}

.grade-chip--weak {
    background: linear-gradient(180deg, rgba(187, 75, 75, 0.18), rgba(187, 75, 75, 0.08));
    border-color: rgba(187, 75, 75, 0.24);
    color: var(--danger);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 18px rgba(187, 75, 75, 0.1);
}

.grade-chip--fail {
    background: linear-gradient(180deg, rgba(187, 75, 75, 0.18), rgba(187, 75, 75, 0.08));
    border-color: rgba(187, 75, 75, 0.24);
    color: var(--danger);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 8px 18px rgba(187, 75, 75, 0.1);
}

.grade-chip--neutral {
    background: rgba(36, 91, 143, 0.08);
    border-color: rgba(36, 91, 143, 0.14);
    color: var(--blue-800);
}

.page-footer {
    margin-top: 18px;
    padding: 10px 8px 0;
    text-align: center;
    animation-delay: 0.24s;
}

.page-footer p {
    font-size: 0.95rem;
}

.page-footer p + p {
    margin-top: 4px;
}

.page-footer__credit {
    position: relative;
    display: inline-grid;
    gap: 4px;
    justify-items: center;
    min-width: min(100%, 460px);
    margin-top: 16px !important;
    padding: 18px 28px 16px;
    border: 1px solid rgba(36, 91, 143, 0.12);
    border-radius: 22px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(244, 248, 252, 0.96));
    box-shadow: 0 18px 40px rgba(24, 73, 119, 0.12);
    overflow: hidden;
}

.page-footer__credit::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 132px;
    height: 3px;
    border-radius: 999px;
    transform: translateX(-50%);
    background: linear-gradient(90deg, rgba(195, 154, 73, 0.1), rgba(195, 154, 73, 0.95), rgba(195, 154, 73, 0.1));
}

.page-footer__credit-label {
    color: var(--gold-600);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.page-footer__credit-role {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.75;
}

.page-footer__credit-name {
    color: var(--blue-900);
    font-family: "Bahnschrift SemiCondensed", "Bahnschrift", "Segoe UI", sans-serif;
    font-size: 1.22rem;
    font-weight: 900;
    letter-spacing: 0.015em;
}

.noscript-banner {
    width: min(1080px, calc(100% - 32px));
    margin: 16px auto 0;
    padding: 16px 18px;
    border: 1px solid rgba(187, 75, 75, 0.18);
    border-radius: 18px;
    background: rgba(255, 239, 239, 0.96);
    color: var(--danger);
    font-weight: 700;
    text-align: center;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes revealPanel {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.99);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 980px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .status-board {
        order: 2;
    }

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

@media (max-width: 720px) {
    .page-shell,
    .noscript-banner {
        width: min(100% - 16px, 1240px);
    }

    .page-shell {
        padding-top: 16px;
        padding-bottom: 36px;
    }

    .site-header {
        align-items: center;
        flex-direction: column;
        gap: 14px;
        text-align: center;
    }

    .site-header__copy {
        text-align: center;
    }

    .page-layout {
        gap: 16px;
    }

    .hero {
        padding-top: 4px;
    }

    .hero__glow {
        display: none;
    }

    .hero__card,
    .status-board,
    .results-panel,
    .subjects-card {
        padding: 20px;
        border-radius: 22px;
    }

    .status-board {
        width: 100%;
    }

    .form-group {
        grid-template-columns: 1fr;
    }

    .form-button {
        width: 100%;
    }

    .captcha-row {
        grid-template-columns: 1fr;
    }

    .captcha-refresh {
        width: 100%;
    }

    .hero__meta,
    .status-board__head,
    .results-panel__head,
    .subjects-card__head {
        align-items: stretch;
        flex-direction: column;
    }

    .status-groups {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .page-shell,
    .noscript-banner {
        width: min(100% - 12px, 1240px);
    }

    .site-header__logo {
        width: 76px;
        height: 76px;
    }

    .site-header__title {
        font-size: 1.9rem;
    }

    .site-header__subtitle,
    .hero__subtitle,
    .subjects-card__text,
    .page-footer p {
        font-size: 0.93rem;
    }

    .status-board__title {
        font-size: 1.08rem;
    }

    .hero__card,
    .status-board,
    .results-panel,
    .subjects-card {
        padding: 18px 16px;
    }

    .form-input,
    .form-button {
        min-height: 54px;
    }

    .legend-chip,
    .status-stat,
    .level-chip,
    .hero-meta,
    .results-badge {
        width: 100%;
        justify-content: center;
    }

    .page-footer__credit {
        width: 100%;
        min-width: 0;
        padding: 16px 18px 15px;
    }

    .results-disclaimer {
        align-items: flex-start;
    }

    .grade-legend-note {
        padding: 16px;
    }

    .grade-legend-note__list {
        grid-template-columns: 1fr;
    }

    .results-table-wrap {
        overflow: visible;
        border: 0;
        background: transparent;
    }

    .results-table,
    .results-table tbody,
    .results-table tr,
    .results-table td {
        display: block;
        width: 100%;
    }

    .results-table {
        min-width: 0;
    }

    .results-table thead {
        display: none;
    }

    .results-table tbody {
        display: grid;
        gap: 12px;
    }

    .results-table tbody tr {
        padding: 16px;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: #ffffff;
        box-shadow: var(--shadow-sm);
    }

    .results-table td {
        padding: 0;
        border: 0;
    }

    .results-table td + td {
        margin-top: 12px;
    }

    .results-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--muted);
        font-size: 0.76rem;
        font-weight: 800;
        letter-spacing: 0.04em;
    }

    .grade-chip {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 420px) {
    .site-header__title {
        font-size: 1.65rem;
    }

    .hero__title {
        font-size: 1.9rem;
    }

    .summary-item {
        padding: 18px 16px;
    }
}

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

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .site-header,
    .hero__card,
    .status-board,
    .results-panel,
    .page-footer,
    .results-table tbody tr {
        opacity: 1;
        transform: none;
    }
}

.admin-shell .status-message {
    max-width: 760px;
}

.admin-layout .status-board {
    display: none;
}

.admin-nav {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.admin-nav__link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 16px;
    border: 1px solid rgba(36, 91, 143, 0.16);
    border-radius: 16px;
    background: rgba(248, 251, 254, 0.92);
    color: var(--blue-900);
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.admin-nav__link:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.admin-nav__link--active {
    background: linear-gradient(135deg, #1f67c2, #235b8f);
    border-color: transparent;
    color: #ffffff;
}

.admin-login-form {
    max-width: 860px;
}

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

.admin-form-grid--filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 18px;
}

.admin-form-grid--three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-hero-actions {
    margin-top: 18px;
}

.admin-setup-note {
    margin-top: 20px;
}

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

.admin-toolbar__button {
    min-width: 164px;
    min-height: 44px;
    padding-inline: 18px;
    font-size: 0.96rem;
    box-shadow: 0 12px 24px rgba(31, 103, 194, 0.18);
}

.results-badge--link {
    text-decoration: none;
}

.admin-table-card {
    margin-top: 18px;
}

.admin-results-table td:last-child {
    min-width: 250px;
}

.admin-action-group {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 120px;
    gap: 10px;
    align-items: center;
}

.admin-row-select {
    min-height: 46px;
    padding-inline: 12px;
}

.admin-row-button {
    min-width: 0;
    min-height: 46px;
    padding-inline: 14px;
    font-size: 0.92rem;
    box-shadow: 0 12px 22px rgba(31, 103, 194, 0.16);
}

.admin-reset-button {
    min-width: 140px;
    justify-content: center;
}

.admin-side-card {
    display: grid;
    gap: 10px;
    min-height: 110px;
}

.admin-side-card__value {
    margin: 0;
    color: var(--blue-900);
    font-size: 1.02rem;
    font-weight: 800;
    line-height: 1.8;
}

.admin-side-card--live {
    border-color: rgba(31, 122, 92, 0.18);
    background: rgba(246, 253, 250, 0.98);
}

.admin-side-card--pending {
    border-color: rgba(187, 75, 75, 0.18);
    background: rgba(255, 247, 247, 0.98);
}

.admin-side-card--neutral {
    border-color: var(--line);
    background: rgba(248, 251, 254, 0.9);
}

.admin-side-card--live .admin-side-card__value {
    color: var(--success);
}

.admin-side-card--pending .admin-side-card__value {
    color: var(--danger);
}

.admin-summary-grid {
    margin-top: 18px;
}

.admin-statistics-grid {
    display: grid;
    gap: 16px;
}

.admin-level-card {
    display: grid;
    gap: 16px;
}

.admin-level-summary,
.admin-stat-row__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.admin-level-departments {
    display: grid;
    gap: 12px;
}

.admin-stat-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.82);
}

.admin-stat-row__title {
    display: block;
    color: var(--blue-900);
    margin-bottom: 6px;
}

.admin-stat-row__meta {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

@media (max-width: 980px) {
    .admin-form-grid--filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .admin-form-grid,
    .admin-form-grid--filters,
    .admin-action-group {
        grid-template-columns: 1fr;
    }

    .admin-form-grid--three {
        grid-template-columns: 1fr;
    }

    .admin-toolbar {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .admin-toolbar__button {
        width: 100%;
    }

    .admin-stat-row {
        flex-direction: column;
    }
}

@media (max-width: 560px) {
    .admin-results-table td:last-child {
        min-width: 0;
    }

    .admin-action-group {
        gap: 8px;
    }
}
