/* ============================================================
   SmartDrive — Public site · Зарлал (official noticeboard)
   A full redesign world: paper notices pinned to a warm board,
   one stamp red, info-blue plaques, a gold seal for Premium.
   ============================================================ */

:root {
    /* Material */
    --paper:        #f3edde;
    --paper-2:      #ece2cf;
    --notice:       #fffdf5;
    --notice-2:     #faf5e7;
    --ink:          #2b2417;
    --ink-2:        #564b37;
    --ink-3:        #7b705a;
    --stamp:        #b83a2e;
    --stamp-2:      #992c22;
    --info:         #2f5d8a;
    --info-2:       #24496e;
    --gold:         #a97b1f;
    --gold-2:       #8a6416;
    --green:        #2e7d46;
    --line:         #ddd2b6;
    --line-strong:  #c6b78f;

    --r-sm: 2px;
    --r-md: 10px;
    --r-lg: 16px;

    --shadow-sm: 0 1px 2px rgba(43, 36, 23, .10), 0 3px 8px rgba(43, 36, 23, .08);
    --shadow:    0 2px 4px rgba(43, 36, 23, .10), 0 12px 26px rgba(43, 36, 23, .10);
    --shadow-lg: 0 6px 14px rgba(43, 36, 23, .12), 0 24px 52px rgba(43, 36, 23, .16);

    --font-display: "PT Serif", Georgia, "Times New Roman", serif;
    --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-mono: ui-monospace, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--ink);
    background-color: var(--paper);
    background-image: radial-gradient(rgba(43, 36, 23, .025) 1px, transparent 1.4px);
    background-size: 26px 26px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, .font-display {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.01em;
    color: var(--ink);
}

h1 { font-size: clamp(2.1rem, 4.6vw, 3.35rem); }
h2 { font-size: clamp(1.55rem, 3.1vw, 2.15rem); }
h5 { font-family: var(--font-body); font-weight: 700; letter-spacing: -0.01em; }
h6 { font-family: var(--font-body); font-weight: 700; }

p { color: var(--ink); }
.lead { font-size: 1.08rem; color: var(--ink-2); }

a { color: var(--info); text-decoration: none; }
a:hover { color: var(--info-2); text-decoration: underline; }

::selection { background: rgba(184, 58, 46, .18); }

img { max-width: 100%; }

.container { max-width: 1180px; }

section { position: relative; }

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

/* ---------- Official masthead rail ---------- */
.top-rail {
    background: var(--ink);
    color: var(--paper);
    font-size: .72rem;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.top-rail .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: .45rem;
    padding-bottom: .45rem;
}
.top-rail a { color: #e7dfc9; }
.top-rail a:hover { color: #fff; text-decoration: none; }
.top-rail .rail-tag { color: #cfc2a2; }

/* ---------- Nav ---------- */
.sd-nav {
    background: var(--notice);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 1px 0 rgba(43, 36, 23, .04);
}
.sd-nav::after {
    content: "";
    display: block;
    height: 3px;
    background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 10px);
    opacity: .16;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: .65rem;
    padding: .35rem 0;
}
.navbar-brand .wordmark {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: .01em;
    line-height: 1;
}
.navbar-brand .wordmark small {
    display: block;
    font-family: var(--font-body);
    font-size: .56rem;
    font-weight: 600;
    letter-spacing: .24em;
    text-transform: uppercase;
    color: var(--stamp);
    margin-top: .15rem;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--ink);
    box-shadow: inset 0 0 0 3px var(--notice), inset 0 0 0 5px var(--stamp);
    color: var(--ink);
    background: var(--notice);
    flex: 0 0 auto;
}
.brand-mark svg { width: 22px; height: 22px; display: block; }

.sd-nav .nav-link {
    font-weight: 600;
    font-size: .95rem;
    color: var(--ink-2);
    padding: .6rem .9rem;
    border-radius: var(--r-sm);
}
.sd-nav .nav-link:hover { color: var(--stamp); }
.sd-nav .nav-link.active { color: var(--stamp); }
.sd-nav .navbar-toggler { border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.sd-nav .navbar-toggler:focus { box-shadow: 0 0 0 3px rgba(184, 58, 46, .25); }
.sd-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(43,36,23,0.85)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
.sd-nav .dropdown-menu {
    background: var(--notice);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow);
    padding: .5rem;
}
.sd-nav .dropdown-item { border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; }
.sd-nav .dropdown-item:hover { background: var(--paper-2); color: var(--ink); }

/* ---------- Buttons: ticket stubs + plates ---------- */
.btn-stub,
.btn-grad,
.btn-navy,
.btn-amber {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    font-weight: 700;
    font-size: 1rem;
    padding: .72rem 1.4rem;
    border-radius: var(--r-sm);
    border: 0;
    cursor: pointer;
    position: relative;
    color: #fff;
    transition: transform .12s ease, box-shadow .2s ease, background-color .2s ease, filter .2s ease;
    white-space: nowrap;
}
.btn-stub { background: var(--stamp); }
.btn-stub:hover { background: var(--stamp-2); color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-stub:active { transform: translateY(1px); box-shadow: none; }

.btn-navy { background: var(--ink); }
.btn-navy:hover { background: #3a3020; color: #fff; text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-amber {
    background: var(--ink);
    color: #f0e3b0;
    box-shadow: inset 0 0 0 1px var(--gold);
}
.btn-amber:hover { background: #221c10; color: #ffedb0; text-decoration: none; transform: translateY(-1px); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-weight: 600;
    font-size: 1rem;
    padding: .68rem 1.25rem;
    border-radius: var(--r-sm);
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--line-strong);
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
    white-space: nowrap;
}
.btn-ghost:hover { color: var(--stamp); border-color: var(--stamp); background: rgba(184, 58, 46, .04); text-decoration: none; }

.btn-lgx { padding: .9rem 1.7rem; font-size: 1.05rem; }

.btn-stub::before,
.btn-navy::before,
.btn-amber::before {
    content: "";
    position: absolute;
    left: 7px;
    top: 50%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--paper);
    transform: translateY(-50%);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, .25);
}
.btn-stub::after,
.btn-navy::after,
.btn-amber::after {
    content: "";
    position: absolute;
    right: 12px;
    top: 7px;
    bottom: 7px;
    border-left: 1px dashed rgba(255, 255, 255, .5);
}
.btn-arrow { }
.btn-arrow i { transition: transform .2s ease; }
.btn-arrow:hover i { transform: translateX(3px); }

/* ---------- Stamp seals ---------- */
.seal {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 86px;
    height: 86px;
    border-radius: 50%;
    border: 2px solid var(--stamp);
    box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 7px var(--stamp);
    color: var(--stamp);
    font-family: var(--font-body);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .14em;
    line-height: 1.35;
    transform: rotate(-6deg);
    user-select: none;
    pointer-events: none;
    background: rgba(255, 253, 245, .65);
}
.seal .seal-lg { font-size: .92rem; }
.seal .seal-sm { font-size: .5rem; letter-spacing: .2em; font-weight: 600; }

.seal-gold {
    border-color: var(--gold);
    box-shadow: inset 0 0 0 5px var(--notice), inset 0 0 0 7px var(--gold);
    color: var(--gold);
    background: rgba(255, 253, 245, .8);
}

/* ---------- Hero ---------- */
.sd-hero {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
    overflow: hidden;
}
.sd-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(43, 36, 23, .035), transparent 240px),
        radial-gradient(900px 420px at 82% -8%, rgba(184, 58, 46, .05), transparent 60%);
}

.hero-head {
    position: relative;
    padding-left: 1.1rem;
    border-left: 3px solid var(--stamp);
}
.hero-head .seal { position: absolute; top: -.35rem; right: .25rem; }
.hero-head h1 { margin: 0 0 1.1rem; text-wrap: balance; }
.hero-head .lead { margin-bottom: 1.4rem; max-width: 54ch; }

.hero-points { list-style: none; padding: 0; margin: 0 0 1.75rem; max-width: 52ch; }
.hero-points li {
    display: flex;
    gap: .65rem;
    align-items: baseline;
    padding: .5rem 0;
    border-bottom: 1px dotted var(--line-strong);
    color: var(--ink-2);
    font-weight: 500;
}
.hero-points li i { color: var(--stamp); flex: 0 0 auto; align-self: center; }

.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; }

/* Live-test panel — pinned notice stack */
.hero-panel {
    position: relative;
    background: var(--notice);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.hero-panel::before {
    content: "";
    position: absolute;
    top: -8px; left: 50%;
    width: 14px; height: 14px;
    border-radius: 50%;
    background: var(--stamp);
    transform: translateX(-50%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 0 0 3px var(--paper);
    z-index: 2;
}
.hero-panel::after {
    content: "";
    position: absolute;
    top: -8px; right: 16%;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--stamp-2);
    transform: translateX(-50%);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 0 0 3px var(--paper);
    z-index: 2;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.35rem;
    background: var(--info);
    color: #f2f6fb;
    border-bottom: 3px solid var(--ink);
}
.panel-head .fw-bold { letter-spacing: .04em; font-size: .95rem; }
.panel-head .small { color: #d3dfec !important; }

.pulse {
    display: inline-block;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: #ffd9a0;
    box-shadow: 0 0 0 0 rgba(255, 217, 160, .7);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 217, 160, .6); }
    70%  { box-shadow: 0 0 0 7px rgba(255, 217, 160, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 217, 160, 0); }
}

.panel-body { padding: .4rem .9rem .4rem 1.35rem; }
.test-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem .35rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink);
    transition: background-color .15s ease;
}
.test-row:last-child { border-bottom: 0; }
.test-row:hover { background: var(--paper-2); text-decoration: none; color: var(--ink); }
.t-num {
    font-family: var(--font-mono);
    font-size: .8rem;
    font-weight: 700;
    color: var(--stamp);
    background: rgba(184, 58, 46, .08);
    border-radius: 3px;
    padding: .2rem .45rem;
    flex: 0 0 auto;
}
.t-body { flex: 1 1 auto; min-width: 0; }
.t-body h6 { margin: 0 0 .15rem; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-body small { color: var(--ink-3); display: flex; align-items: center; gap: .35rem; }
.test-row > i { color: var(--line-strong); font-size: 1.2rem; flex: 0 0 auto; transition: transform .15s ease; }
.test-row:hover > i { transform: translateX(3px); color: var(--stamp); }

.panel-foot { padding: 1rem 1.35rem; border-top: 1px solid var(--line); background: var(--notice-2); }
.panel-foot .btn { width: 100%; }

/* ---------- Info plaques strip ---------- */
.plaque-strip { padding-bottom: .5rem; }
.plaque {
    display: flex;
    gap: 1rem;
    align-items: center;
    height: 100%;
    background: var(--info);
    color: #f2f6fb;
    border-radius: var(--r-md);
    padding: 1.15rem 1.35rem;
    box-shadow: var(--shadow-sm);
    position: relative;
}
.plaque::after {
    content: "";
    position: absolute;
    right: -5px; top: 50%;
    width: 16px; height: 16px;
    border-radius: 2px;
    background: var(--info-2);
    transform: translateY(-50%) rotate(45deg);
}
.plaque i { font-size: 1.7rem; color: #ffd9a0; flex: 0 0 auto; }
.plaque .pl-t {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: .01em;
    margin: 0;
}
.plaque .pl-t strong { font-weight: 800; }
.plaque .pl-s { font-size: .82rem; color: #d3dfec; margin: .1rem 0 0; }

/* ---------- Section headers (no kickers) ---------- */
.sd-section { padding: 3.5rem 0; }
.sd-section-head { max-width: 640px; margin: 0 auto 2.75rem; text-align: center; }
.sd-section-head h2 { margin: 0 0 .8rem; text-wrap: balance; }
.sd-section-head p { color: var(--ink-2); margin: 0; }

.ruled-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}
.ruled-title::before,
.ruled-title::after {
    content: "";
    flex: 0 0 3.25rem;
    height: 2px;
    background: var(--line-strong);
}
.ruled-title::after { flex: 1 1 auto; }
.ruled-title h2 { margin: 0; }

/* ---------- Feature / notice cards ---------- */
.notice-card {
    position: relative;
    background: var(--notice);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
    padding: 1.75rem 1.6rem;
    height: 100%;
    transition: transform .18s ease, box-shadow .25s ease;
}
.notice-card::before {
    content: "";
    position: absolute;
    top: -6px; left: 18px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--stamp-2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 0 0 3px var(--paper);
}
.notice-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.notice-card .f-icon {
    width: 46px; height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(184, 58, 46, .09);
    color: var(--stamp);
    font-size: 1.35rem;
    margin-bottom: 1rem;
}
.notice-card h5 { margin-bottom: .6rem; }
.notice-card p { color: var(--ink-2); margin-bottom: 0; font-size: .95rem; }

/* ---------- Premium band (gold-sealed notice) ---------- */
.premium-band {
    background: var(--notice);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.premium-band::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 5px;
    background: repeating-linear-gradient(90deg, var(--gold) 0 14px, var(--gold-2) 14px 28px);
}
.premium-band .pb-wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 2.5rem 2.5rem; }
.pb-mark { display: inline-flex; margin-bottom: 1rem; }
.premium-band h2 { color: var(--ink); margin-bottom: .5rem; }
.premium-band .pb-sub { color: var(--ink-2); margin: 0; max-width: 60ch; }
.premium-band .pb-price {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--gold-2);
    background: rgba(169, 123, 31, .1);
    border: 1px dashed var(--gold);
    border-radius: var(--r-sm);
    padding: .5rem .8rem;
    display: inline-block;
    margin-top: .9rem;
}

/* ---------- FAQ (stacked notices) ---------- */
.faq-notice {
    background: var(--notice);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
    margin-bottom: .8rem;
    overflow: hidden;
}
.faq-notice .accordion-button {
    font-family: var(--font-body);
    font-weight: 700;
    color: var(--ink);
    background: transparent;
    padding: 1.15rem 1.35rem;
    border: 0;
    box-shadow: none;
}
.faq-notice .accordion-button:not(.collapsed) { color: var(--stamp); background: var(--notice-2); }
.faq-notice .accordion-button:focus { box-shadow: 0 0 0 3px rgba(184, 58, 46, .18); }
.faq-notice .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23b83a2e'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}
.faq-notice .accordion-body { color: var(--ink-2); padding: 0 1.35rem 1.25rem; }

/* ---------- Inner page header (document header) ---------- */
.page-hero {
    background: var(--notice);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    padding: 3rem 0 2.75rem;
    position: relative;
}
.page-hero::after {
    content: "";
    display: block;
    height: 3px;
    background: repeating-linear-gradient(90deg, var(--ink) 0 6px, transparent 6px 10px);
    opacity: .14;
}
.page-hero .doc-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-3);
    border-bottom: 2px solid var(--ink);
    padding-bottom: .75rem;
    margin-bottom: 1.5rem;
}
.page-hero .doc-meta .doc-stamp { color: var(--stamp); font-weight: 700; }
.page-hero h1 { margin: 0 0 .75rem; text-wrap: balance; }
.page-hero .lead { max-width: 640px; margin-bottom: 1.5rem; }
.breadcrumb { margin-bottom: 0; }
.breadcrumb-item a { color: var(--info); }
.breadcrumb-item.active { color: var(--ink-3); }
.breadcrumb-item + .breadcrumb-item::before { color: var(--line-strong); }

/* ---------- Courses: section / exam notice cards ---------- */
.section-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--notice);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
    padding: 1.6rem 1.6rem 1.5rem;
    height: 100%;
    transition: transform .18s ease, box-shadow .25s ease;
}
.section-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.section-card .c-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.1rem;
}
.c-icon {
    width: 42px; height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--info);
    color: #f2f6fb;
    font-size: 1.2rem;
}
.section-card h5 { margin-bottom: .6rem; }
.section-card p { color: var(--ink-2); font-size: .93rem; }
.c-meta {
    display: flex;
    gap: 1.25rem;
    padding: .7rem 0;
    border-top: 1px dotted var(--line-strong);
    border-bottom: 1px dotted var(--line-strong);
    margin: auto 0 1.1rem;
}
.c-meta span { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--ink-2); font-weight: 600; }
.c-meta i { color: var(--stamp); }
.c-action .btn { width: 100%; }

.badge-free, .badge-premium, .badge-draft {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: .28rem .7rem;
    border-radius: 3px;
    border: 1px solid transparent;
}
.badge-free { color: var(--info-2); background: rgba(47, 93, 138, .1); border-color: rgba(47, 93, 138, .35); }
.badge-premium { color: var(--gold-2); background: rgba(169, 123, 31, .1); border-color: rgba(169, 123, 31, .45); }
.badge-draft { color: var(--ink-3); background: rgba(123, 112, 90, .1); border-color: var(--line-strong); }

/* Road sign cards */
.sign-card {
    position: relative;
    background: var(--notice);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .25s ease;
}
.sign-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.sign-card::before {
    content: "";
    position: absolute;
    top: -6px; right: 18px;
    width: 11px; height: 11px;
    border-radius: 50%;
    background: var(--stamp-2);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 0 0 3px var(--paper);
    z-index: 2;
}
.sign-img {
    background:
        linear-gradient(180deg, rgba(47, 93, 138, .05), transparent),
        var(--paper-2);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.4rem;
    min-height: 132px;
}
.sign-img img { max-height: 104px; filter: drop-shadow(0 6px 10px rgba(43, 36, 23, .18)); }
.sign-body { padding: 1rem 1.15rem 1.15rem; }
.sign-body h6 { margin-bottom: .5rem; font-size: .92rem; }

/* Category tabs */
.cat-tab {
    font-weight: 600;
    color: var(--ink-2);
    border: 1px solid var(--line-strong);
    background: var(--notice) !important;
    border-radius: 3px;
}
.cat-tab:hover { border-color: var(--stamp); color: var(--stamp); }
.cat-tab.active {
    color: #fff !important;
    background: var(--stamp) !important;
    border-color: var(--stamp);
}

/* Intro box (SEO prose under listings) */
.intro-box {
    background: var(--notice);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
    padding: 2rem 2.25rem;
}
.intro-box h2 { margin-bottom: 1rem; }
.intro-box .lead { color: var(--ink); }
.intro-checks { list-style: none; padding: 0; margin: 1.25rem 0 0; }
.intro-checks li {
    display: flex;
    gap: .6rem;
    align-items: baseline;
    padding: .35rem 0;
    color: var(--ink-2);
    font-weight: 500;
}
.intro-checks li i { color: var(--stamp); flex: 0 0 auto; }

/* ---------- Contact ---------- */
.contact-info-card {
    background: var(--info);
    color: #f2f6fb;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-sm);
    padding: 1.6rem 1.7rem;
    height: 100%;
}
.contact-info-card .c-icon {
    width: 46px; height: 46px;
    background: rgba(255, 255, 255, .14);
    color: #ffd9a0;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}
.contact-info-card h5 { color: #fff; }
.contact-info-card p, .contact-info-card small { color: #d3dfec; }
.contact-info-card a { color: #fff; text-decoration: underline; }

.contact-map { border: 1px solid var(--line); box-shadow: var(--shadow-sm); border-radius: var(--r-md); }

.contact-form { background: var(--notice); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--shadow-sm); padding: 1.75rem; }

.form-control, .form-select {
    background-color: var(--notice);
    border: 1px solid var(--line-strong);
    border-radius: var(--r-sm);
    color: var(--ink);
    font-weight: 500;
}
.form-control:focus, .form-select:focus {
    background-color: var(--notice);
    border-color: var(--stamp);
    box-shadow: 0 0 0 3px rgba(184, 58, 46, .14);
    color: var(--ink);
}
.form-floating > label { color: var(--ink-3); }

/* ---------- Legal docs (prose) ---------- */
.prose {
    background: var(--notice);
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    box-shadow: var(--shadow-sm);
    padding: 3rem 3rem;
}
.prose h2, .prose h3, .prose h4 { margin-bottom: .75rem; }
.prose h3 { font-size: 1.25rem; }
.prose h4 { font-size: 1.05rem; }
.prose p, .prose li { color: var(--ink); }
.prose ul { padding-left: 1.1rem; }
.prose li { margin-bottom: .35rem; }
.prose .alert { border-radius: var(--r-sm); background: rgba(169, 123, 31, .08); border: 1px dashed var(--gold); color: var(--ink); }
.prose .table { --bs-table-bg: transparent; color: var(--ink); }
.prose .table th { font-family: var(--font-body); font-weight: 700; background: var(--paper-2); color: var(--ink); }
.prose .table td, .prose .table th { border-color: var(--line); padding: .75rem; }
.doc-head {
    border-bottom: 2px solid var(--ink);
    padding-bottom: 1.1rem;
    margin-bottom: 2rem;
}
.doc-head .doc-kind {
    font-family: var(--font-body);
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--stamp);
    display: inline-block;
    border: 1px solid var(--stamp);
    border-radius: 3px;
    padding: .18rem .55rem;
    margin-bottom: .9rem;
}

/* ---------- Footer (back of the board) ---------- */
.sd-footer {
    background: var(--ink);
    color: #d9d0b8;
    margin-top: 4rem;
}
.sd-footer h6 {
    color: #f0e9d4;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .8rem;
    padding-bottom: .6rem;
    border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.sd-footer .f-brand { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.sd-footer .f-brand .wordmark { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: #f0e9d4; }
.sd-footer .brand-mark { border-color: #f0e9d4; box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 5px var(--stamp); color: #f0e9d4; }
.sd-footer p { color: #c9bfa4; }
.sd-footer .f-link {
    display: block;
    color: #c9bfa4;
    padding: .28rem 0;
    font-weight: 500;
    font-size: .94rem;
}
.sd-footer .f-link:hover { color: #ffd9a0; text-decoration: none; }
.sd-footer .social { display: flex; gap: .6rem; }
.sd-footer .social a {
    width: 38px; height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
    color: #e7dfc9;
    font-size: 1rem;
    transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.sd-footer .social a:hover { border-color: #ffd9a0; color: var(--ink); background: #ffd9a0; text-decoration: none; }
.sd-footer .f-contact li { display: flex; gap: .6rem; align-items: baseline; margin-bottom: .55rem; }
.sd-footer .f-contact i { color: #ffd9a0; }
.sd-footer .f-contact a { color: #e7dfc9; }
.sd-footer .f-contact a:hover { color: #fff; }
.sd-copyright {
    border-top: 1px solid rgba(255, 255, 255, .14);
    color: #b7ab8e;
    font-size: .86rem;
}
.sd-copyright a { color: #e7dfc9; }
.sd-copyright a:hover { color: #fff; text-decoration: none; }

/* ---------- Back to top + spinner ---------- */
.back-to-top {
    position: fixed;
    right: 1.4rem;
    bottom: 1.4rem;
    width: 46px; height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--stamp);
    color: #fff;
    border-radius: 50%;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease, visibility .25s;
    z-index: 1050;
}
.back-to-top.show { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--stamp-2); color: #fff; }

#spinner {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--paper);
    z-index: 9999;
    transition: opacity .45s ease, visibility .45s;
}
#spinner.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.spinner-ring {
    width: 44px; height: 44px;
    border-radius: 50%;
    border: 3px solid var(--line-strong);
    border-top-color: var(--stamp);
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reveal + hero settle (the one authored moment) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.2, .7, .2, 1), transform .6s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

.hero-panel { animation: settle .7s cubic-bezier(.18, .89, .26, 1.12) both; }
@keyframes settle {
    from { opacity: 0; transform: translateY(-14px) rotate(-.6deg); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
    .reveal { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .sd-hero { padding-top: 2.75rem; padding-bottom: 2.75rem; }
    .hero-head .seal { width: 62px; height: 62px; font-size: .7rem; right: 0; }
    .hero-panel { margin-top: 1rem; }
    .premium-band .pb-wrap { flex-direction: column; align-items: flex-start; padding: 2rem 1.6rem; }
    .plaque::after { display: none; }
}

@media (max-width: 767.98px) {
    .sd-section { padding: 2.75rem 0; }
    .intro-box { padding: 1.5rem 1.35rem; }
    .prose { padding: 1.75rem 1.35rem; }
    .page-hero { padding: 2.25rem 0; }
    .hero-actions .btn-lgx { width: 100%; }
    .top-rail .rail-tag { display: none; }
}

/* Utility for the torn-stub CTA inside cards */
.c-action .btn-stub { width: 100%; }
