/* ============================================================
   iResults — Design System (compact)
   Mobile-first, flat & dense — faithful to the original layout.
   Component blocks map 1:1 to Astro components.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
    /* Brand */
    --brand-50:  #eef4fc;
    --brand-100: #dbe8fa;
    --brand-200: #b9d0f3;
    --brand-500: #2a6bc4;
    --brand-600: #174fa6;   /* primary */
    --brand-700: #123f85;
    --brand-800: #0e3266;

    /* Neutrals */
    --bg:           #f3f6fb;
    --surface:      #ffffff;
    --surface-2:    #f7fafc;
    --surface-sunk: #eef2f8;
    --border:       #dce6f2;
    --border-strong:#cdd9e8;
    --text:         #1a2433;
    --text-muted:   #5a6678;
    --text-soft:    #8a94a6;

    /* Status — three only: Live (declared today), Declared, Awaited */
    --ok-bg:   #e7f6ec;  --ok-fg:   #16793b;  --ok-dot:   #1fa14d;
    --wait-bg: #eceff4;  --wait-fg: #5a6678;  --wait-dot: #97a1b2;
    --live-bg: #fde9ec;  --live-fg: #c01f38;  --live-dot: #e23b54;

    /* Radius */
    --r-xs: 5px;
    --r-sm: 7px;
    --r:    9px;
    --r-pill: 999px;

    /* Elevation (subtle — this is a flat, bordered UI) */
    --sh-sm: 0 1px 2px rgba(20,40,80,.05);
    --sh:    0 2px 8px rgba(20,40,80,.08);
    --ring:  0 0 0 3px rgba(23,79,166,.18);

    /* Layout */
    --site-width: 1080px;
    --gutter: 0.75rem;
    --header-h: 56px;

    /* Type — LIMITED to 18 / 16 / 14 / 12 */
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --fs-xs:   12px;
    --fs-sm:   14px;
    --fs-base: 14px;   /* body — compact */
    --fs-md:   16px;
    --fs-lg:   18px;
    --fs-xl:   18px;
    --fs-2xl:  18px;

    --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- RESET ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    font-size: var(--fs-base);
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-600); text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
::selection { background: var(--brand-200); color: var(--brand-800); }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }

/* ---------- TYPOGRAPHY ---------- */
h1, h2, h3, h4 {
    line-height: 1.25;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
    text-wrap: balance;
}
h1 { font-size: var(--fs-lg); }
h2 { font-size: var(--fs-md); }
h3 { font-size: var(--fs-md); }
p  { text-wrap: pretty; }
b, strong { font-weight: 600; }
.eyebrow {
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--brand-600);
}

/* ---------- LAYOUT ---------- */
.container {
    width: 100%;
    max-width: var(--site-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
}
main.container { padding-block: 1rem 1.5rem; }
.stack > * + * { margin-top: 0.85rem; }

/* ---------- BUTTONS ---------- */
.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: var(--fs-base);
    font-weight: 600;
    line-height: 1;
    padding: 0.65rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--r-sm);
    background: var(--brand-600);
    color: #fff;
    cursor: pointer;
    transition: background .2s var(--ease), transform .12s var(--ease), border-color .2s;
    white-space: nowrap;
}
.btn:hover { background: var(--brand-700); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 1.1em; height: 1.1em; }
.btn--block { width: 100%; }
.btn--ghost { background: var(--surface); color: var(--brand-600); border-color: var(--border-strong); }
.btn--ghost:hover { background: var(--brand-50); border-color: var(--brand-200); }
.btn--soft { background: var(--brand-50); color: var(--brand-700); }
.btn--soft:hover { background: var(--brand-100); }
.btn.is-loading { pointer-events: none; }
.btn.is-loading .btn__label { visibility: hidden; }
.btn.is-loading::after {
    content: "";
    position: absolute;
    width: 1.05rem; height: 1.05rem;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- BADGES ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    line-height: 1;
    padding: 0.32rem 0.55rem;
    border-radius: var(--r-pill);
    white-space: nowrap;
}
.badge::before {
    content: "";
    width: 0.4rem; height: 0.4rem;
    border-radius: 50%;
    background: currentColor;
    flex: none;
}
.badge--ok   { background: var(--ok-bg);   color: var(--ok-fg); }
.badge--wait { background: var(--wait-bg); color: var(--wait-fg); }
.badge--live { background: var(--live-bg); color: var(--live-fg); }
.badge--ok::before   { background: var(--ok-dot); }
.badge--wait::before { background: var(--wait-dot); }
.badge--live::before { background: var(--live-dot); animation: pulse 1.6s var(--ease) infinite; }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(226,59,84,.5); }
    70%  { box-shadow: 0 0 0 5px rgba(226,59,84,0); }
    100% { box-shadow: 0 0 0 0 rgba(226,59,84,0); }
}

/* ---------- HEADER ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    height: var(--header-h);
    display: flex;
    align-items: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--sh-sm);
}
.site-header__inner {
    width: 100%;
    max-width: var(--site-width);
    margin-inline: auto;
    padding-inline: var(--gutter);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 40px; height: 40px;
    margin-left: -8px;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: background .2s var(--ease);
}
.icon-btn:hover { background: var(--surface-sunk); }
.icon-btn svg { width: 22px; height: 22px; }
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0;
    margin-right: auto;
    font-size: var(--fs-md);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--brand-600);
}
.brand b { color: inherit; font-weight: 600; }
.brand small {
    margin-left: 0.4rem;
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--text-soft);
    border: 1px solid var(--border-strong);
    padding: 0.1rem 0.3rem;
    border-radius: var(--r-xs);
    text-transform: uppercase;
}
.header-cta {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 40px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: #fff;
    background: var(--brand-600);
    padding: 0.45rem 0.75rem;
    border-radius: var(--r-pill);
    white-space: nowrap;
    transition: background .2s var(--ease);
}
.header-cta:hover { background: var(--brand-700); }
.header-cta svg { width: 1rem; height: 1rem; flex: none; }

/* ---------- NAV DRAWER ---------- */
.nav-drawer {
    position: fixed;
    inset: 0;
    z-index: 50;
    pointer-events: none;
    visibility: hidden;
}
.nav-drawer__scrim {
    position: absolute;
    inset: 0;
    background: rgba(12,22,40,.45);
    opacity: 0;
    transition: opacity .26s var(--ease);
}
.nav-drawer__panel {
    position: absolute;
    inset-block: 0;
    left: 0;
    width: min(78%, 290px);
    background: var(--surface);
    box-shadow: 0 12px 36px rgba(20,40,80,.18);
    transform: translateX(-101%);
    transition: transform .28s var(--ease);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.nav-drawer.open { pointer-events: auto; visibility: visible; }
.nav-drawer.open .nav-drawer__scrim { opacity: 1; }
.nav-drawer.open .nav-drawer__panel { transform: translateX(0); }
.nav-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding: 0 0.75rem;
    border-bottom: 1px solid var(--border);
}
.nav-list { list-style: none; }
.nav-list a {
    display: block;
    padding: 0.85rem 0.9rem;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: var(--fs-md);
    font-weight: 500;
    transition: background .16s var(--ease), color .16s var(--ease), padding-left .16s var(--ease);
}
.nav-list a:hover, .nav-list a[aria-current="page"] {
    background: var(--brand-50);
    color: var(--brand-700);
    font-weight: 600;
    padding-left: 1.1rem;
}
.nav-drawer__foot { margin-top: auto; padding: 0.9rem; border-top: 1px solid var(--border); }

/* ---------- SECTION HEADING (signature blue bar) ---------- */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    background: var(--brand-600);
    color: #fff;
    padding: 0.5rem 0.5rem 0.5rem 0.85rem;
    border-radius: var(--r-sm);
    margin-bottom: 0.85rem;
    line-height: 1;
}
.section-heading h1, .section-heading h2 {
    color: #fff;
    font-size: var(--fs-md);
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.section-heading a {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: #fff;
    font-size: var(--fs-xs);
    font-weight: 600;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,.55);
    padding: 0.35rem 0.6rem;
    border-radius: var(--r-pill);
    transition: background .2s var(--ease), color .2s var(--ease);
}
.section-heading a svg { width: 0.85rem; height: 0.85rem; }
.section-heading a:hover { background: #fff; color: var(--brand-700); border-color: #fff; }

/* ---------- APP BANNER (mobile) ---------- */
.app-banner {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--brand-600);
    color: #fff;
    border-radius: var(--r);
    padding: 0.7rem 0.8rem;
}
.app-banner:hover { background: var(--brand-700); }
.app-banner__icon {
    flex: none;
    width: 38px; height: 38px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.16);
    border-radius: var(--r-sm);
}
.app-banner__icon svg { width: 22px; height: 22px; color: #fff; }
.app-banner__text { flex: 1; min-width: 0; }
.app-banner__text h3 { color: #fff; font-size: var(--fs-md); }
.app-banner__text p { font-size: var(--fs-xs); color: rgba(255,255,255,.82); }
.app-banner__cta {
    flex: none;
    font-weight: 600;
    font-size: var(--fs-xs);
    background: #fff;
    color: var(--brand-700);
    padding: 0.45rem 0.75rem;
    border-radius: var(--r-pill);
}

/* ---------- AD SLOT ---------- */
.ad-slot {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 280px;   /* reserve space for AdSense — prevents CLS */
    background: var(--surface-sunk);
    border: 1px dashed var(--border-strong);
    border-radius: var(--r-sm);
    color: var(--text-soft);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------- RESULT / DATE-SHEET CARDS ---------- */
.grid-container {
    display: grid;
    gap: 0.6rem;
}
.grid-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 0.7rem;
    transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.grid-item:hover {
    border-color: var(--brand-200);
    background: var(--surface-2);
    box-shadow: var(--sh-sm);
}
.grid-item__logo {
    flex: none;
    width: 42px; height: 42px;
    border-radius: var(--r-xs);
    border: 1px solid var(--border);
    background: #fff;
    object-fit: contain;
    padding: 3px;
}
.grid-item__body { flex: 1; min-width: 0; padding-right: 4.5rem; }
.grid-item__title {
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.grid-item__meta {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.grid-item__meta svg { width: 0.8rem; height: 0.8rem; color: var(--text-soft); flex: none; }
.grid-item .badge { position: absolute; top: 50%; right: 0.6rem; transform: translateY(-50%); }

/* ---------- STATE CARDS ---------- */
.state-item {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 0.8rem;
    transition: border-color .18s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
}
.state-item:hover { border-color: var(--brand-200); background: var(--surface-2); box-shadow: var(--sh-sm); }
.state-item__flag {
    flex: none;
    width: 38px; height: 38px;
    border-radius: var(--r-xs);
    background: var(--brand-50);
    color: var(--brand-600);
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: var(--fs-sm);
    letter-spacing: -0.02em;
}
.state-item__body { flex: 1; min-width: 0; }
.state-item h3 { font-size: var(--fs-md); margin-bottom: 0.1rem; }
.state-item p {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------- RESULT LOOKUP FORM ---------- */
.result-form {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
    box-shadow: var(--sh-sm);
}
.result-form__head {
    background: var(--brand-600);
    color: #fff;
    padding: 1rem 1.1rem;
}
.result-form__head .eyebrow { color: rgba(255,255,255,.74); }
.result-form__head h2 { color: #fff; font-size: var(--fs-lg); margin-top: 0.15rem; }
.result-form__form { padding: 1.1rem; }
.field { margin-bottom: 0.9rem; }
.field > label {
    display: block;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.4rem;
}
.field__control {
    display: flex;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-sm);
    overflow: hidden;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field__control:hover { border-color: var(--brand-200); }
.field__control:focus-within { border-color: var(--brand-500); box-shadow: var(--ring); }
.field__control input,
.field__control select {
    flex: 1;
    width: 100%;
    min-width: 0;
    border: none;
    background: transparent;
    outline: none;
    padding: 0.72rem 0.85rem;
    font-size: var(--fs-md);
    color: var(--text);
}
.field__control input::placeholder { color: var(--text-soft); }
.field__control select {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.7rem center;
    padding-right: 2.2rem;
}
.field__hint { margin-top: 0.35rem; font-size: var(--fs-xs); color: var(--text-soft); }
.field__hint b { color: var(--text-muted); }
.result-form__note {
    margin-top: 0.9rem;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    background: var(--surface-sunk);
    border-radius: var(--r-xs);
    padding: 0.6rem 0.7rem;
    line-height: 1.55;
}
.result-form__note b { color: var(--text); }
.result-form__form .btn { margin-top: 0.3rem; }

/* ---------- MARKSHEET ---------- */
.marksheet {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}
.marksheet__head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--border);
    background: var(--surface-2);
}
.marksheet__head img { width: 36px; height: 36px; flex: none; }
.marksheet__head h2 { font-size: var(--fs-md); }
.marksheet__head p { font-size: var(--fs-xs); color: var(--text-muted); }
.marksheet__head .badge { margin-left: auto; flex: none; }
.marksheet__info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0 0.9rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--border);
}
.info-row { padding: 0.35rem 0; }
.info-row dt { font-size: var(--fs-xs); color: var(--text-soft); }
.info-row dd { font-size: var(--fs-base); font-weight: 600; color: var(--text); }
.marks-table { width: 100%; border-collapse: collapse; }
.marks-table th, .marks-table td {
    padding: 0.55rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-sm);
}
.marks-table thead th {
    font-size: var(--fs-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-soft);
    font-weight: 600;
    background: var(--surface-2);
}
.marks-table td.num, .marks-table th.num { text-align: right; }
.marks-table tbody tr:last-child td { border-bottom: none; }
.marks-table .grade {
    display: inline-block;
    min-width: 1.6rem;
    text-align: center;
    font-size: var(--fs-xs);
    font-weight: 600;
    padding: 0.12rem 0.35rem;
    border-radius: var(--r-xs);
    background: var(--brand-50);
    color: var(--brand-700);
}
.marksheet__totals {
    display: flex;
    gap: 0.55rem;
    padding: 0.8rem 0.9rem;
    background: var(--surface-2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}
.stat {
    flex: 1;
    min-width: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xs);
    padding: 0.55rem 0.65rem;
}
.stat dt { font-size: var(--fs-xs); color: var(--text-soft); }
.stat dd { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.02em; }
.stat--accent { background: var(--brand-600); border-color: var(--brand-600); }
.stat--accent dt { color: rgba(255,255,255,.75); }
.stat--accent dd { color: #fff; }
.marksheet__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.8rem 0.9rem;
}

/* ---------- ARTICLE ---------- */
.article {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    overflow: hidden;
}

/* article view: cover hero */
.article-hero { position: relative; }
.article-hero__cover {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;       /* 1280×720 */
    object-fit: cover;
    background: var(--surface-sunk);
}
.article-hero__cat {
    position: absolute;
    left: 0.7rem;
    bottom: 0.7rem;
    white-space: nowrap;
    background: rgba(255,255,255,.94);
    color: var(--brand-700);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    border-radius: var(--r-pill);
    box-shadow: var(--sh-sm);
}

/* article view: header block */
.article-head { padding: 0.95rem 0.9rem 0; }
.article-head h1 { font-size: var(--fs-lg); line-height: 1.25; }
.article-byline {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 0.5rem;
    margin-top: 0.7rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--border);
    font-size: var(--fs-xs);
    color: var(--text-soft);
}
.article-byline__author {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;          /* allow author name to shrink/ellipsis */
    flex: 0 1 auto;
}
.article-byline__author > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.article-byline__author b { color: var(--text); font-weight: 600; }
.article-byline .sep { flex: none; width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.article-byline__item { display: inline-flex; align-items: center; gap: 0.3rem; flex: none; white-space: nowrap; }
.article-byline__item svg { width: 0.85rem; height: 0.85rem; }

/* article view: share bar */
.share-bar { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; flex: none; }
.share-btn {
    display: inline-grid;
    place-items: center;
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.share-btn:hover { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-700); }
.share-btn svg { width: 16px; height: 16px; }

/* article view: figure + pull-quote handled by .prose below */

/* article view: back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-muted);
}
.back-link svg { width: 1rem; height: 1rem; }
.back-link:hover { color: var(--brand-700); }

/* ---------- BREADCRUMB ---------- */
.breadcrumb {
    font-size: var(--fs-xs);
    color: var(--text-soft);
}
.breadcrumb ol {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    -webkit-overflow-scrolling: touch;
}
.breadcrumb ol::-webkit-scrollbar { display: none; }
.breadcrumb li { display: inline-flex; align-items: center; gap: 0.25rem 0.35rem; flex: none; }
.breadcrumb li:last-child { flex: 0 1 auto; min-width: 0; }
.breadcrumb a { color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.breadcrumb a:hover { color: var(--brand-700); text-decoration: underline; text-underline-offset: 2px; }
.breadcrumb svg { width: 13px; height: 13px; color: var(--text-soft); flex: none; }
.breadcrumb [aria-current="page"] {
    color: var(--text);
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- PROSE (CMS article body — class-free) ---------- */
.prose {
    padding: 0.95rem 0.9rem 1.1rem;
    color: var(--text-muted);
    font-size: var(--fs-base);
    line-height: 1.6;
}
.prose > * + * { margin-top: 0.8rem; }
.prose > :first-child { margin-top: 0; }
.prose p { color: var(--text-muted); }
.prose h2 {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    margin-top: 1.25rem;
    scroll-margin-top: 72px;
}
.prose h3 {
    font-size: var(--fs-md);
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    margin-top: 1rem;
    scroll-margin-top: 72px;
}
.prose h2 + *, .prose h3 + * { margin-top: 0.5rem; }
.prose a {
    color: var(--brand-600);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: var(--brand-200);
}
.prose a:hover { text-decoration-color: var(--brand-600); }
.prose strong, .prose b { color: var(--text); font-weight: 600; }
.prose ul, .prose ol {
    list-style: none;
    padding-left: 0;
    color: var(--text-muted);
}
.prose ol { counter-reset: li; }
.prose li {
    position: relative;
    padding: 0.45rem 0 0.45rem 2.15rem;
    border-bottom: 1px solid var(--border);
}
.prose li:last-child { border-bottom: none; }
.prose ol > li::before {
    counter-increment: li;
    content: counter(li);
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 1.55rem;
    height: 1.55rem;
    display: grid;
    place-items: center;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: var(--fs-xs);
    font-weight: 600;
    border-radius: 50%;
}
.prose ul > li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45rem;
    width: 1.55rem;
    height: 1.55rem;
    border-radius: 50%;
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23123F85' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0.8rem no-repeat,
        var(--brand-50);
}
.prose li > ul, .prose li > ol { margin-top: 0.45rem; }
.prose li > ul > li:first-child, .prose li > ol > li:first-child { padding-top: 0; }
.prose img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--r-sm);
    border: 1px solid var(--border);
}
.prose figure { margin: 1rem 0; }
.prose figcaption {
    margin-top: 0.4rem;
    font-size: var(--fs-xs);
    color: var(--text-soft);
    text-align: center;
}
.prose iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    border: 0;
    border-radius: var(--r-sm);
}
.prose blockquote {
    border-left: 3px solid var(--brand-600);
    background: var(--brand-50);
    padding: 0.8rem 0.95rem;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--brand-800);
    font-style: italic;
}
.prose blockquote > * { color: inherit; }
.prose blockquote > * + * { margin-top: 0.5rem; }
.prose blockquote cite {
    display: block;
    font-style: normal;
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--brand-700);
    opacity: 0.85;
}
.prose hr { border: 0; border-top: 1px solid var(--border); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.prose caption { caption-side: top; text-align: left; font-weight: 600; color: var(--text); padding-bottom: 0.4rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 0.5rem 0.65rem; text-align: left; }
.prose thead th { background: var(--surface-2); font-weight: 600; color: var(--text); }
.prose tbody tr:nth-child(even) { background: var(--surface-2); }

.article__body { padding: 0.9rem; }
.article__body > * + * { margin-top: 0.9rem; }
.article__body h1 { font-size: var(--fs-lg); }
.article__body h2 {
    font-size: var(--fs-md);
    padding-top: 0.9rem;
    border-top: 1px solid var(--border);
}
.article__body h1:first-child, .article__body h2:first-child { border-top: none; padding-top: 0; }
.article__body p { color: var(--text-muted); }
.article__body a { font-weight: 600; }
.article__body img { border-radius: var(--r-sm); border: 1px solid var(--border); }
.article__body iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: var(--r-sm); }
.data-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.data-table caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 0.4rem;
}
.data-table th, .data-table td {
    border: 1px solid var(--border);
    padding: 0.5rem 0.65rem;
    text-align: left;
}
.data-table thead th { background: var(--surface-2); font-weight: 600; color: var(--text); }
.data-table tbody tr:nth-child(even) { background: var(--surface-2); }
.data-table.is-center th, .data-table.is-center td { text-align: center; }
.howto-list { list-style: none; counter-reset: step; }
.howto-list li {
    display: flex;
    gap: 0.6rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
    font-size: var(--fs-sm);
}
.howto-list li:last-child { border-bottom: none; }
.howto-list li::before {
    counter-increment: step;
    content: counter(step);
    flex: none;
    width: 1.5rem; height: 1.5rem;
    display: grid;
    place-items: center;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: var(--fs-xs);
    font-weight: 600;
    border-radius: 50%;
}

/* ---------- LATEST UPDATES (article list) ---------- */
/* ---------- LATEST UPDATES (article cards) ---------- */
.update-grid {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: 1fr;
}
.update-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    overflow: hidden;
    transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.update-card:hover {
    border-color: var(--brand-200);
    box-shadow: var(--sh-sm);
}
.update-card__coverwrap { position: relative; }
.update-card__cover {
    display: block;
    width: 100%;
    height: auto;                  /* let aspect-ratio drive height despite width/height attrs */
    aspect-ratio: 16 / 9;          /* 1280×720 */
    object-fit: cover;
    background: var(--surface-sunk);
}
.update-card__cat {
    position: absolute;
    left: 0.6rem;
    bottom: 0.6rem;
    white-space: nowrap;
    background: rgba(255,255,255,.94);
    color: var(--brand-700);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 0.28rem 0.55rem;
    border-radius: var(--r-pill);
    box-shadow: var(--sh-sm);
}
.update-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.75rem 0.8rem 0.8rem;
}
.update-card__title {
    font-size: var(--fs-md);
    font-weight: 600;
    line-height: 1.3;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.update-card:hover .update-card__title { color: var(--brand-700); }
.update-card__excerpt {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-top: 0.3rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.update-card__meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.65rem;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
    font-size: var(--fs-xs);
    color: var(--text-soft);
}
.update-card__meta svg { width: 0.8rem; height: 0.8rem; flex: none; }
.update-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); flex: none; }
.update-card__meta time { white-space: nowrap; }

/* ---------- PAGINATION ---------- */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
}
.pagination a, .pagination span {
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    display: grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    background: var(--surface);
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-muted);
    transition: border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease);
}
.pagination a:hover { border-color: var(--brand-200); background: var(--brand-50); color: var(--brand-700); }
.pagination [aria-current="page"] { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.pagination .is-disabled { opacity: 0.45; pointer-events: none; }

/* ---------- TABS ---------- */
.tabs {
    display: flex;
    gap: 0.2rem;
    background: var(--surface-sunk);
    padding: 0.2rem;
    border-radius: var(--r-sm);
    margin-bottom: 0.85rem;
}
.tab {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-muted);
    border-radius: var(--r-xs);
    cursor: pointer;
    transition: background .16s var(--ease), color .16s var(--ease);
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--brand-700); box-shadow: var(--sh-sm); }
.tabpanel[hidden] { display: none; }

/* ---------- SKELETON ---------- */
.skeleton {
    position: relative;
    overflow: hidden;
    background: var(--surface-sunk);
    border-radius: var(--r-xs);
}
.skeleton::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.7), transparent);
    animation: shimmer 1.3s infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 0.7rem;
}
.skel-logo { width: 42px; height: 42px; border-radius: var(--r-xs); flex: none; }
.skel-lines { flex: 1; }
.skel-line { height: 0.65rem; margin-bottom: 0.45rem; }
.skel-line.w-70 { width: 70%; }
.skel-line.w-40 { width: 40%; margin-bottom: 0; }

/* ---------- TOAST ---------- */
.toast-stack {
    position: fixed;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    z-index: 80;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    width: min(92%, 360px);
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    background: var(--text);
    color: #fff;
    padding: 0.7rem 0.85rem;
    border-radius: var(--r-sm);
    box-shadow: 0 12px 32px rgba(20,40,80,.22);
    font-size: var(--fs-sm);
    font-weight: 500;
    pointer-events: auto;
    animation: toast-in .28s var(--ease);
}
.toast.out { animation: toast-out .22s var(--ease) forwards; }
.toast svg { width: 1.1rem; height: 1.1rem; flex: none; }
.toast--ok { background: #14532d; }
.toast--ok svg { color: #6ee7a0; }
.toast--err { background: #6e1322; }
.toast--err svg { color: #ff9aab; }
.toast--info svg { color: var(--brand-200); }
@keyframes toast-in  { from { opacity: 0; transform: translateY(10px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }

/* ---------- EMPTY / 404 ---------- */
.empty {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
}
.empty__icon {
    width: 56px; height: 56px;
    margin: 0 auto 0.8rem;
    display: grid;
    place-items: center;
    background: var(--brand-50);
    color: var(--brand-600);
    border-radius: 50%;
}
.empty__icon svg { width: 26px; height: 26px; }
.empty h3 { margin-bottom: 0.25rem; }
.empty p { color: var(--text-muted); max-width: 34ch; margin: 0 auto 1rem; font-size: var(--fs-sm); }
.page-404 {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: radial-gradient(120% 80% at 50% -10%, var(--brand-50), transparent 60%), var(--bg);
    text-align: center;
}
.page-404__code {
    font-size: clamp(4rem, 20vw, 7rem);
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.04em;
    color: var(--brand-600);
}
.page-404 h1 { font-size: var(--fs-lg); margin: 0.5rem 0 0.3rem; }
.page-404 p { color: var(--text-muted); margin-bottom: 1.25rem; font-size: var(--fs-sm); }

/* ---------- ABOUT + DISCLAIMER ---------- */
.section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 0.9rem;
}
.section h2 { font-size: var(--fs-md); margin-bottom: 0.6rem; }
.section p { color: var(--text-muted); margin-bottom: 0.7rem; text-align: justify; }
.section p:last-child { margin-bottom: 0; }
.section a { font-weight: 600; }
.disclaimer {
    font-size: var(--fs-xs);
    line-height: 1.6;
    color: var(--text-soft);
    background: var(--surface-sunk);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 0.75rem 0.85rem;
    text-align: justify;
}
.disclaimer b { color: var(--text-muted); letter-spacing: 0.03em; }

/* ---------- FOOTER ---------- */
.site-footer {
    margin-top: 1.5rem;
    background: #0f1726;
    color: rgba(255,255,255,.6);
    text-align: center;
    padding: 1.5rem var(--gutter);
}
.site-footer__inner { max-width: var(--site-width); margin-inline: auto; }
.site-footer p { font-size: var(--fs-xs); margin-bottom: 0.75rem; }
.footer-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.4rem 1rem;
    list-style: none;
}
.footer-links a { color: rgba(255,255,255,.7); font-size: var(--fs-xs); }
.footer-links a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- UTILITIES ---------- */
/* .hide-desktop is shown by default; the desktop breakpoint hides it. */
[hidden] { display: none !important; }

/* ---------- DESKTOP ---------- */
@media (min-width: 720px) {
    :root { --gutter: 1rem; }
    .grid-container { grid-template-columns: repeat(2, 1fr); }
    .grid-container--3 { grid-template-columns: repeat(3, 1fr); }
    .marksheet__info { grid-template-columns: repeat(3, 1fr); }
    .update-grid { grid-template-columns: repeat(2, 1fr); }
    .hide-desktop { display: none; }
}

@media (min-width: 1000px) {
    .update-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
