:root {
    --navy-900: #0a1a33;
    --navy-800: #0f2444;
    --navy-700: #163257;
    --gold-500: #c8a24b;
    --gold-600: #b8912f;
    --ink: #1c2430;
    --muted: #5a6675;
    --line: #dfe3ea;
    --surface: #ffffff;
    --canvas: #eef1f5;
    --focus: #2b6cb0;
    --danger: #9b2c2c;

    --maxw: 1180px;
    --radius: 8px;
    --shadow: 0 1px 2px rgba(15, 36, 68, .06), 0 8px 24px rgba(15, 36, 68, .08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body {
    background: var(--canvas);
    color: var(--ink);
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--navy-700); }
a:hover { color: var(--navy-800); }

:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Skip link ---------- */

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 100;
    background: #fff;
    color: var(--navy-800);
    padding: 10px 16px;
    font-weight: 600;
    border: 2px solid var(--gold-600);
    border-radius: 0 0 6px 0;
}
.skip-link:focus {
    left: 0;
}

/* ---------- Page shell ---------- */

.page {
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

/* ---------- Header ---------- */

.site-header {
    background: linear-gradient(180deg, var(--navy-800), var(--navy-900));
    color: #fff;
}

.site-header__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.site-header__eyebrow {
    margin: 0 0 2px;
    font-size: .8rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--gold-500);
    font-weight: 600;
}

.site-header__title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
    color: #fff;
}

.site-header__rule {
    height: 4px;
    background: linear-gradient(90deg, var(--gold-600), var(--gold-500) 60%, var(--gold-600));
}

.badge {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
}

.badge svg { width: 100%; height: 100%; display: block; }
.badge__ring { fill: none; stroke: var(--gold-500); stroke-width: 4; }
.badge__star { fill: var(--gold-500); }
.badge__center { fill: var(--navy-900); stroke: var(--gold-600); stroke-width: 2; }

/* ---------- Main ---------- */

.site-main {
    flex: 1 0 auto;
    width: 100%;
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 22px 24px 32px;
}

/* ---------- Toolbar ---------- */

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    box-shadow: var(--shadow);
}

.toolbar__status {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.toolbar__updated { color: var(--ink); }
.toolbar__note {
    color: var(--muted);
    font-size: .9rem;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}

.dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}
.dot--live { background: #2f855a; box-shadow: 0 0 0 3px rgba(47, 133, 90, .18); }
.dot--warn { background: var(--gold-600); box-shadow: 0 0 0 3px rgba(184, 145, 47, .2); }

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

/* ---------- Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 15px;
    font-size: .95rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    transition: background-color .12s ease, border-color .12s ease, color .12s ease;
}
.btn__icon { font-size: 1.05em; line-height: 1; }

.btn--primary {
    background: var(--navy-800);
    color: #fff;
    border-color: var(--navy-800);
}
.btn--primary:hover { background: var(--navy-700); color: #fff; }

.btn--ghost {
    background: #fff;
    color: var(--navy-800);
    border-color: var(--line);
}
.btn--ghost:hover { border-color: var(--navy-700); color: var(--navy-800); }

.btn:disabled { opacity: .55; cursor: default; }

/* ---------- PDF frame ---------- */

.pdf-frame {
    background: #33415a;
    border: 1px solid var(--line);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    height: calc(100vh - 300px);
    min-height: 520px;
}

.pdf-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.mobile-hint {
    margin: 12px 2px 0;
    font-size: .9rem;
    color: var(--muted);
}

/* ---------- Notice / error card ---------- */

.notice {
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--gold-600);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px 26px;
    max-width: 640px;
}
.notice__title { margin: 0 0 8px; font-size: 1.2rem; color: var(--navy-800); }
.notice__meta { color: var(--muted); font-size: .9rem; }
.notice .btn { margin-top: 8px; }

/* ---------- Footer ---------- */

.site-footer {
    flex-shrink: 0;
    background: var(--navy-900);
    color: #c8d2e0;
    border-top: 4px solid var(--gold-600);
}
.site-footer__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: 20px 24px;
    font-size: .88rem;
}
.site-footer__inner p { margin: 0 0 8px; }
.site-footer__meta { color: #8fa1b8; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
    .site-header__title { font-size: 1.2rem; }
    .toolbar { flex-direction: column; align-items: stretch; }
    .toolbar__actions .btn { flex: 1 1 auto; justify-content: center; }
    .toolbar__note { padding-left: 0; border-left: none; }
    .pdf-frame { height: calc(100vh - 340px); min-height: 440px; }
}
