/* ==========================================================================
   Lifetime Domain - public site design system ("registry" look of the homepage)
   Light is the default. Dark = <html data-theme="dark"> (saved per user / cookie).
   Shared components are prefixed ld- so they never clash with Bootstrap.
   ========================================================================== */

:root {
    --paper: #f6f5f1;
    --paper-2: #ecebe5;
    --surface: #ffffff;
    --surface-2: #fbfaf7;
    --ink: #16181d;
    --ink-2: #4a4f59;
    --ink-3: #7b808a;
    --ink-hover: #000000;
    --on-ink: #ffffff;
    --line: #e3e1da;
    --line-2: #d5d2c8;
    --accent: #0b6e4f;
    --accent-dark: #08573e;
    --accent-soft: #e3f1ea;
    --accent-line: #bfe0cf;
    --on-accent: #ffffff;
    --warn: #a15c00;
    --warn-soft: #fbf0dc;
    --warn-line: #efd6a8;
    --danger: #b42318;
    --danger-soft: #fdecea;
    --danger-line: #f3c4bf;
    --info: #1f4e8c;
    --info-soft: #e7eef8;
    --heart: #c2410c;
    --heart-soft: #fdf3ec;
    --heart-line: #f0c8b0;
    --band-bg: #16181d;
    --band-ink: #f1f0ec;
    --band-ink-2: #9a9ea8;
    --band-ink-3: #d6d5d0;
    --band-accent: #6fd3a8;
    --shadow-sm: 0 1px 0 var(--line-2), 0 8px 24px -12px rgba(22, 24, 29, 0.18);
    --shadow-md: 0 18px 40px -28px rgba(22, 24, 29, 0.35);
    --shadow-lg: 0 12px 30px -12px rgba(22, 24, 29, 0.3);
    --radius: 8px;
    --radius-sm: 6px;
    --sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    --header-h: 64px;
    /* old names still used by some inline styles */
    --primary: var(--accent);
    --text-muted: var(--ink-3);
    color-scheme: light;
}

html[data-theme="dark"] {
    --paper: #111315;
    --paper-2: #1f2327;
    --surface: #181b1f;
    --surface-2: #1c1f23;
    --ink: #ecebe6;
    --ink-2: #b3b6bc;
    --ink-3: #8a8e96;
    --ink-hover: #ffffff;
    --on-ink: #111315;
    --line: #272b30;
    --line-2: #363b42;
    --accent: #3cc493;
    --accent-dark: #62d6ab;
    --accent-soft: #12271f;
    --accent-line: #1f4a39;
    --on-accent: #04130d;
    --warn: #e3a54d;
    --warn-soft: #2a2114;
    --warn-line: #4d3b1e;
    --danger: #f2756d;
    --danger-soft: #2c1715;
    --danger-line: #55271f;
    --info: #8ab4f0;
    --info-soft: #17202c;
    --heart: #f08a5d;
    --heart-soft: #2a1a12;
    --heart-line: #553222;
    --band-bg: #0d211a;
    --band-ink: #ecebe6;
    --band-ink-2: #8fa39a;
    --band-ink-3: #c9d3ce;
    --band-accent: #6fd3a8;
    --shadow-sm: 0 1px 0 var(--line-2), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-md: 0 18px 40px -24px rgba(0, 0, 0, 0.7);
    --shadow-lg: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
}

/* ---------- Base (only for pages on the public layout: body.ld-site) ---------- */
body.ld-site {
    margin: 0;
    font-family: var(--sans);
    background: var(--paper);
    color: var(--ink);
    line-height: 1.55;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.ld-site *, body.ld-site *::before, body.ld-site *::after { box-sizing: border-box; }
body.ld-site img { max-width: 100%; height: auto; }
/* zero-specificity resets so component classes (.ld-btn etc.) always win */
:where(body.ld-site) :where(a) { color: inherit; }
:where(body.ld-site) :where(button, input, select, textarea) { font: inherit; color: inherit; }
body.ld-site :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
body.ld-site ::selection { background: var(--accent-soft); color: var(--ink); }

html { scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }

.ld-main { flex: 1 0 auto; padding-top: var(--header-h); }
.ld-container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.ld-container--narrow { max-width: 820px; }
.ld-container--tight { max-width: 480px; }

/* ---------- Type ---------- */
.ld-eyebrow {
    font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ink-3); margin: 0 0 12px;
}
.ld-eyebrow span { color: var(--line-2); margin: 0 0.4em; }

.ld-h1 {
    font-size: clamp(1.9rem, 4.2vw, 3rem); line-height: 1.08; letter-spacing: -0.035em;
    font-weight: 750; margin: 0 0 16px; color: var(--ink);
}
.ld-h1 em, .ld-h2 em { font-style: normal; color: var(--accent); }
.ld-h2 {
    font-size: clamp(1.45rem, 2.6vw, 2.05rem); letter-spacing: -0.03em; line-height: 1.15;
    font-weight: 720; margin: 0; color: var(--ink);
}
.ld-h3 { font-size: 1.12rem; font-weight: 680; letter-spacing: -0.01em; margin: 0 0 6px; color: var(--ink); }
.ld-lead { color: var(--ink-2); font-size: 1.05rem; max-width: 62ch; margin: 0; }
.ld-muted { color: var(--ink-3); }
.ld-mono { font-family: var(--mono); }
.ld-ext { color: var(--ink-3); font-weight: 500; }
.ld-link { color: var(--ink); font-weight: 600; text-decoration: none; border-bottom: 1px solid currentColor; }
.ld-link:hover { color: var(--accent); }
.ld-accent { color: var(--accent); }

/* ---------- Page head + sections ---------- */
/* Compact page header: content starts on the first screen */
.ld-page-head { padding: 22px 0 20px; border-bottom: 1px solid var(--line); }
.ld-page-head .ld-eyebrow { margin-bottom: 6px; font-size: 0.74rem; }
.ld-page-head .ld-h1 { font-size: clamp(1.55rem, 2.6vw, 2.15rem); line-height: 1.12; margin: 0; }
.ld-page-head .ld-lead { font-size: 0.97rem; line-height: 1.5; margin-top: 6px; max-width: 70ch; }
/* Desktop/tablet: label + title left, intro right = one thin strip (only when the header is just those three) */
@media (min-width: 820px) {
    .ld-page-head > .ld-container:not(.ld-container--narrow):not(:has(> :not(.ld-eyebrow, .ld-h1, .ld-lead))) {
        display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr);
        column-gap: 56px; align-items: end;
    }
    .ld-page-head > .ld-container:not(.ld-container--narrow):not(:has(> :not(.ld-eyebrow, .ld-h1, .ld-lead))) > .ld-eyebrow,
    .ld-page-head > .ld-container:not(.ld-container--narrow):not(:has(> :not(.ld-eyebrow, .ld-h1, .ld-lead))) > .ld-h1 { grid-column: 1; }
    .ld-page-head > .ld-container:not(.ld-container--narrow):not(:has(> :not(.ld-eyebrow, .ld-h1, .ld-lead))) > .ld-lead {
        grid-column: 2; grid-row: 1 / span 2; justify-self: end; margin: 0; max-width: 52ch; padding-bottom: 3px;
    }
}
.ld-page-head--center { text-align: center; }
.ld-page-head--center .ld-lead { margin-left: auto; margin-right: auto; }

.ld-section { padding: 36px 0; border-bottom: 1px solid var(--line); }
.ld-section:last-child { border-bottom: 0; }
.ld-section--flush { border-bottom: 0; }
.ld-section-head {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap;
    margin-bottom: 24px;
}
.ld-section-head p { color: var(--ink-2); margin: 6px 0 0; max-width: 60ch; }

.ld-grid { display: grid; gap: 16px; }
.ld-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ld-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ld-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.ld-split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 56px; }
.ld-split--aside-right { grid-template-columns: minmax(0, 1fr) 320px; }

/* ---------- Panels / cards ---------- */
.ld-panel {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 24px;
}
.ld-panel--flush { padding: 0; overflow: hidden; }
.ld-panel--raised { box-shadow: var(--shadow-md); }
.ld-panel + .ld-panel { margin-top: 16px; }
.ld-panel-title { font-size: 1.05rem; font-weight: 680; margin: 0 0 12px; color: var(--ink); }
.ld-panel-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }

.ld-card {
    display: flex; flex-direction: column; gap: 6px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 18px; text-decoration: none; color: var(--ink); transition: border-color 0.15s;
}
a.ld-card:hover { border-color: var(--ink-3); }
.ld-card p { color: var(--ink-2); margin: 0; font-size: 0.95rem; }

.ld-numbered { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; }
.ld-numbered > * { padding: 22px 0 26px; border-top: 1px solid var(--line-2); }
.ld-num { font-family: var(--mono); font-size: 0.85rem; color: var(--ink-3); margin-bottom: 10px; display: block; }

/* Ledger rows (label ..... value) */
.ld-ledger { margin: 0; }
.ld-ledger-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 0.94rem; }
.ld-ledger-row:last-child { border-bottom: 0; }
.ld-ledger-row dt, .ld-ledger-row .k { color: var(--ink-3); margin: 0; }
.ld-ledger-row dd, .ld-ledger-row .v { font-weight: 600; text-align: right; margin: 0; overflow-wrap: anywhere; }

/* Dark band (guarantee style) */
.ld-band { background: var(--band-bg); color: var(--band-ink); }
.ld-band .ld-h2, .ld-band .ld-h3 { color: var(--band-ink); }
.ld-band p { color: var(--band-ink-3); }
.ld-band .ld-muted { color: var(--band-ink-2); }

/* ---------- Buttons ---------- */
.ld-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 42px; padding: 0 18px;
    background: var(--ink); color: var(--on-ink);
    border: 1px solid var(--ink); border-radius: var(--radius-sm);
    font-size: 0.95rem; font-weight: 650; line-height: 1.2; text-decoration: none; white-space: nowrap;
    cursor: pointer; transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.ld-btn:hover { background: var(--ink-hover); border-color: var(--ink-hover); color: var(--on-ink); }
.ld-btn:disabled, .ld-btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.ld-btn svg, .ld-btn i { width: 17px; height: 17px; flex-shrink: 0; }
.ld-btn--accent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ld-btn--accent:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--on-accent); }
.ld-btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.ld-btn--ghost:hover { background: var(--paper-2); border-color: var(--ink-3); color: var(--ink); }
.ld-btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.ld-btn--danger:hover { filter: brightness(0.92); background: var(--danger); color: #fff; }
.ld-btn--sm { min-height: 34px; padding: 0 12px; font-size: 0.88rem; }
.ld-btn--lg { min-height: 50px; padding: 0 26px; font-size: 1.02rem; }
.ld-btn--block { width: 100%; }
.ld-btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Forms ---------- */
.ld-field { margin-bottom: 18px; }
.ld-label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 6px; color: var(--ink); }
.ld-label .req { color: var(--danger); }
.ld-input, .ld-select, .ld-textarea {
    width: 100%; font: inherit; font-size: 1rem; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
    padding: 11px 13px; transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none; appearance: none;
}
.ld-select {
    padding-right: 36px;
    background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
    background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
    background-size: 5px 5px; background-repeat: no-repeat;
}
.ld-textarea { min-height: 130px; resize: vertical; }
.ld-input::placeholder, .ld-textarea::placeholder { color: var(--ink-3); }
.ld-input:focus, .ld-select:focus, .ld-textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ld-input.is-invalid, .ld-select.is-invalid, .ld-textarea.is-invalid { border-color: var(--danger); }
.ld-input--mono { font-family: var(--mono); }
.ld-help { display: block; color: var(--ink-3); font-size: 0.84rem; margin-top: 5px; }
.ld-error { display: block; color: var(--danger); font-size: 0.86rem; margin-top: 5px; }
.ld-check { display: inline-flex; align-items: flex-start; gap: 9px; font-size: 0.93rem; color: var(--ink-2); cursor: pointer; }
.ld-check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.ld-check a { color: var(--ink); font-weight: 600; }
.ld-input-group { position: relative; }
.ld-input-group .ld-input { padding-right: 46px; }
.ld-input-addon {
    position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
    background: none; border: 0; border-radius: 4px; color: var(--ink-3); cursor: pointer;
}
.ld-input-addon:hover { color: var(--ink); background: var(--paper-2); }
.ld-input-addon svg { width: 18px; height: 18px; }

.ld-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 0.85rem; margin: 18px 0; }
.ld-divider::before, .ld-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* Big search box (homepage style) */
.ld-search {
    display: flex; align-items: stretch; background: var(--surface);
    border: 1.5px solid var(--ink); border-radius: var(--radius); padding: 5px;
    box-shadow: var(--shadow-sm);
}
.ld-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ld-search input {
    flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
    font-family: var(--mono); font-size: 1.05rem; color: var(--ink); padding: 11px 14px;
}
.ld-search input::placeholder { color: var(--ink-3); font-family: var(--sans); }
.ld-search button {
    flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 0; border-radius: 5px; background: var(--accent); color: var(--on-accent);
    font-weight: 650; padding: 0 22px; cursor: pointer;
}
.ld-search button:hover { background: var(--accent-dark); }
.ld-search button svg { width: 18px; height: 18px; }

/* ---------- Tables ---------- */
.ld-table-wrap { width: 100%; overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ld-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.ld-table th, .ld-table td { text-align: left; padding: 14px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ld-table tr:last-child td { border-bottom: 0; }
.ld-table th { font-size: 0.76rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); background: var(--surface-2); white-space: nowrap; }
.ld-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ld-table tfoot td { font-weight: 700; background: var(--surface-2); }

/* ---------- Alerts / pills / tags ---------- */
.ld-alert {
    display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: var(--radius-sm);
    margin-bottom: 18px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); font-size: 0.95rem;
}
.ld-alert svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; }
.ld-alert > div { flex: 1; min-width: 0; }
.ld-alert ul { margin: 6px 0 0; padding-left: 18px; }
.ld-alert--success { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-dark); }
.ld-alert--warn { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.ld-alert--danger { background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.ld-alert--info { background: var(--info-soft); border-color: var(--line-2); color: var(--info); }
.ld-alert-close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: inherit; padding: 0 2px; }

.ld-pill {
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
    font-size: 0.76rem; font-weight: 600; border-radius: 999px; padding: 2px 10px;
    background: var(--paper-2); color: var(--ink-2);
}
.ld-pill--accent { background: var(--accent-soft); color: var(--accent); }
.ld-pill--warn { background: var(--warn-soft); color: var(--warn); }
.ld-pill--danger { background: var(--danger-soft); color: var(--danger); }
.ld-pill svg { width: 13px; height: 13px; }
.ld-tag {
    display: inline-block; font-family: var(--mono); font-size: 0.84rem;
    background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; padding: 2px 8px; color: var(--ink);
}
.ld-kicker { font-size: 0.72rem; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }

/* Status icon (big circle on result pages) */
.ld-status-icon {
    width: 56px; height: 56px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--paper-2); color: var(--ink-2); margin-bottom: 18px;
}
.ld-status-icon svg { width: 28px; height: 28px; }
.ld-status-icon--success { background: var(--accent-soft); color: var(--accent); }
.ld-status-icon--warn { background: var(--warn-soft); color: var(--warn); }
.ld-status-icon--danger { background: var(--danger-soft); color: var(--danger); }

/* Empty state */
.ld-empty { text-align: center; padding: 48px 20px; color: var(--ink-2); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.ld-empty svg { width: 34px; height: 34px; color: var(--ink-3); margin-bottom: 10px; }
.ld-empty h3 { margin: 0 0 6px; color: var(--ink); font-size: 1.1rem; }
.ld-empty p { margin: 0 0 18px; }

/* ---------- FAQ (accordion) ---------- */
.ld-faq { border-top: 1px solid var(--line-2); }
.ld-faq-item { border-bottom: 1px solid var(--line-2); }
.ld-faq-q {
    width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 16px;
    background: none; border: 0; cursor: pointer; text-align: left;
    padding: 18px 0; font-size: 1.03rem; font-weight: 620; color: var(--ink);
}
.ld-faq-q:hover { color: var(--accent); }
.ld-faq-icon {
    flex-shrink: 0; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line-2); border-radius: 50%; font-size: 1.1rem; color: var(--ink-2); transition: transform 0.2s;
}
.ld-faq-item.active .ld-faq-icon { transform: rotate(45deg); }
.ld-faq-a { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s ease; }
.ld-faq-item.active .ld-faq-a { grid-template-rows: 1fr; }
.ld-faq-a > div { overflow: hidden; color: var(--ink-2); }
.ld-faq-item.active .ld-faq-a > div { padding-bottom: 18px; }

/* ---------- Prose (long text: policies, blog posts, about) ---------- */
.ld-prose { color: var(--ink-2); font-size: 1.03rem; line-height: 1.75; max-width: 72ch; }
.ld-prose > :first-child { margin-top: 0; }
.ld-prose h1, .ld-prose h2, .ld-prose h3, .ld-prose h4 { color: var(--ink); letter-spacing: -0.02em; line-height: 1.25; margin: 1.8em 0 0.6em; }
.ld-prose h2 { font-size: 1.5rem; font-weight: 720; }
.ld-prose h3 { font-size: 1.2rem; font-weight: 680; }
.ld-prose h4 { font-size: 1.05rem; font-weight: 650; }
.ld-prose p, .ld-prose ul, .ld-prose ol, .ld-prose blockquote, .ld-prose pre, .ld-prose table, .ld-prose figure { margin: 0 0 1.1em; }
.ld-prose ul, .ld-prose ol { padding-left: 1.4em; }
.ld-prose li { margin: 0.3em 0; }
.ld-prose strong, .ld-prose b { color: var(--ink); }
.ld-prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.ld-prose a:hover { color: var(--accent-dark); }
.ld-prose blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 18px; color: var(--ink-2); font-style: italic; }
.ld-prose code { font-family: var(--mono); font-size: 0.9em; background: var(--paper-2); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--ink); }
.ld-prose pre { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; overflow-x: auto; font-size: 0.9rem; }
.ld-prose pre code { background: none; border: 0; padding: 0; }
.ld-prose img { border-radius: var(--radius-sm); border: 1px solid var(--line); }
.ld-prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
.ld-prose table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.ld-prose th, .ld-prose td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; }
.ld-prose th { background: var(--surface-2); color: var(--ink); }

/* ---------- Pagination (Laravel default + simple) ---------- */
.ld-site nav[role="navigation"] svg { width: 18px; height: 18px; }
.ld-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; list-style: none; padding: 0; margin: 28px 0 0; }
.ld-pagination a, .ld-pagination span {
    display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 10px;
    border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink);
    text-decoration: none; font-weight: 600; font-size: 0.92rem;
}
.ld-pagination a:hover { border-color: var(--ink); }
.ld-pagination .active span, .ld-pagination [aria-current="page"] span { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.ld-pagination .disabled span { opacity: 0.45; }

/* ---------- Spinner / toasts ---------- */
.ld-spinner {
    width: 16px; height: 16px; border-radius: 50%; display: inline-block;
    border: 2px solid color-mix(in srgb, currentColor 30%, transparent); border-top-color: currentColor;
    animation: ld-spin 0.7s linear infinite;
}
@keyframes ld-spin { to { transform: rotate(360deg); } }
@keyframes ld-blink { 50% { opacity: 0; } }

.ld-toasts { position: fixed; top: calc(var(--header-h) + 12px); right: 16px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
.ld-toast {
    display: flex; align-items: flex-start; gap: 12px; min-width: 280px; max-width: 400px;
    background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 3px solid var(--ink-3);
    border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow-lg); font-size: 0.93rem;
}
.ld-toast--success { border-left-color: var(--accent); }
.ld-toast--error { border-left-color: var(--danger); }

/* ---------- Header ---------- */
.ld-header {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
    transition: background 0.2s, box-shadow 0.2s;
}
.ld-header.scrolled { background: color-mix(in srgb, var(--paper) 97%, transparent); box-shadow: 0 1px 0 var(--line); }
.ld-header .ld-nav {
    max-width: 1280px; margin: 0 auto; padding: 0.85rem 2rem; min-height: var(--header-h);
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.ld-header .ld-logo {
    display: flex; align-items: center; gap: 0.5rem; min-width: 0;
    color: var(--ink); text-decoration: none; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.02em;
}
.ld-header .ld-logo img { max-width: 36px; max-height: 36px; }
.ld-header .ld-nav-links { display: flex; gap: 1.75rem; list-style: none; margin: 0; padding: 0; }
.ld-header .ld-nav-links a { color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: color 0.15s; }
.ld-header .ld-nav-links a:hover, .ld-header .ld-nav-links a[aria-current="page"] { color: var(--ink); }
.ld-header .ld-nav-links a[aria-current="page"] { box-shadow: 0 2px 0 var(--accent); }
.ld-header-actions { display: flex; gap: 0.6rem; align-items: center; flex-shrink: 0; }
.ld-header .ld-cta {
    display: inline-flex; align-items: center; gap: 0.45rem;
    background: var(--ink); color: var(--on-ink); border: 1px solid var(--ink); border-radius: 6px;
    padding: 0.55rem 1rem; font-size: 0.95rem; font-weight: 600; text-decoration: none; white-space: nowrap;
    transition: background 0.15s;
}
.ld-header .ld-cta:hover { background: var(--ink-hover); }
.ld-header .ld-cta svg { width: 16px; height: 16px; }
.ld-header .ld-cta.ld-cta-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.ld-header .ld-cta.ld-cta-ghost:hover { background: var(--paper-2); }
.ld-header .ld-icon-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; background: transparent; border: 1px solid var(--line-2); border-radius: 6px;
    color: var(--ink); text-decoration: none; cursor: pointer; padding: 0; transition: background 0.15s;
}
.ld-header .ld-icon-btn:hover { background: var(--paper-2); }
.ld-header .ld-icon-btn svg { width: 19px; height: 19px; }
.ld-header .ld-icon-badge {
    position: absolute; top: -6px; right: -6px; background: var(--accent); color: var(--on-accent);
    font-size: 0.7rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.ld-header .ld-icon-badge.empty { display: none; }

/* Theme toggle: moon in light mode, sun in dark mode */
.ld-theme-toggle .ld-icon-sun { display: none; }
html[data-theme="dark"] .ld-theme-toggle .ld-icon-sun { display: block; }
html[data-theme="dark"] .ld-theme-toggle .ld-icon-moon { display: none; }

/* Mobile menu */
.ld-menu-btn { display: none !important; }
.ld-mobile-nav {
    display: none; border-top: 1px solid var(--line); background: var(--paper);
    padding: 8px 1rem 14px;
}
.ld-mobile-nav.open { display: block; }
.ld-mobile-nav a { display: block; padding: 11px 4px; color: var(--ink); text-decoration: none; font-weight: 550; border-bottom: 1px solid var(--line); }
.ld-mobile-nav a:last-child { border-bottom: 0; }

@media (max-width: 900px) {
    :root { --header-h: 58px; }
    .ld-header .ld-nav-links { display: none; }
    .ld-header .ld-nav { padding: 0.6rem 1rem; gap: 0.6rem; }
    .ld-menu-btn { display: inline-flex !important; }
}
@media (max-width: 560px) {
    .ld-header .ld-logo { font-size: 1.02rem; }
    .ld-header .ld-logo img { max-width: 30px; max-height: 30px; }
    .ld-header .ld-logo-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ld-header .ld-cta { padding: 0.45rem 0.75rem; font-size: 0.88rem; }
    .ld-header .ld-cta svg { display: none; }
    .ld-header .ld-cta-secondary-mobile-hide { display: none; }
    .ld-header .ld-icon-btn { width: 36px; height: 36px; }
    .ld-header-actions { gap: 0.4rem; }
}
@media (max-width: 400px) {
    .ld-header .ld-hide-xs { display: none; }
}

/* ---------- Footer ---------- */
.ld-footer { background: var(--paper-2); border-top: 1px solid var(--line); padding: 2.5rem 0; text-align: center; margin-top: 0; flex-shrink: 0; }
.ld-footer .ld-footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }
.ld-footer p { color: var(--ink-2); margin: 0.25rem 0; font-size: 0.92rem; }
.ld-footer a { color: var(--ink); text-decoration: none; }
.ld-footer a:hover { color: var(--accent); }
.ld-footer .ld-footer-links { margin-top: 1rem; line-height: 2; }

/* ---------- Logo animations (admin setting) ---------- */
@keyframes logo-rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes logo-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes logo-glow { 0%, 100% { filter: drop-shadow(0 0 3px rgba(11,110,79,0.35)); } 50% { filter: drop-shadow(0 0 8px rgba(11,110,79,0.6)); } }
@keyframes logo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes logo-rainbow { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
.logo-animate-rotate.logo-speed-slow { animation: logo-rotate 8s linear infinite; }
.logo-animate-rotate.logo-speed-medium { animation: logo-rotate 4s linear infinite; }
.logo-animate-rotate.logo-speed-fast { animation: logo-rotate 2s linear infinite; }
.logo-animate-pulse.logo-speed-slow { animation: logo-pulse 3s ease-in-out infinite; }
.logo-animate-pulse.logo-speed-medium { animation: logo-pulse 2s ease-in-out infinite; }
.logo-animate-pulse.logo-speed-fast { animation: logo-pulse 1s ease-in-out infinite; }
.logo-animate-glow.logo-speed-slow { animation: logo-glow 3s ease-in-out infinite; }
.logo-animate-glow.logo-speed-medium { animation: logo-glow 2s ease-in-out infinite; }
.logo-animate-glow.logo-speed-fast { animation: logo-glow 1s ease-in-out infinite; }
.logo-animate-float.logo-speed-slow { animation: logo-float 4s ease-in-out infinite; }
.logo-animate-float.logo-speed-medium { animation: logo-float 2.5s ease-in-out infinite; }
.logo-animate-float.logo-speed-fast { animation: logo-float 1.5s ease-in-out infinite; }
.logo-animate-rainbow.logo-speed-slow { animation: logo-rainbow 8s linear infinite; }
.logo-animate-rainbow.logo-speed-medium { animation: logo-rainbow 4s linear infinite; }
.logo-animate-rainbow.logo-speed-fast { animation: logo-rainbow 2s linear infinite; }
.logo-animate-all.logo-speed-slow { animation: logo-rotate 8s linear infinite, logo-pulse 3s ease-in-out infinite, logo-glow 3s ease-in-out infinite, logo-float 4s ease-in-out infinite, logo-rainbow 8s linear infinite; }
.logo-animate-all.logo-speed-medium { animation: logo-rotate 4s linear infinite, logo-pulse 2s ease-in-out infinite, logo-glow 2s ease-in-out infinite, logo-float 2.5s ease-in-out infinite, logo-rainbow 4s linear infinite; }
.logo-animate-all.logo-speed-fast { animation: logo-rotate 2s linear infinite, logo-pulse 1s ease-in-out infinite, logo-glow 1s ease-in-out infinite, logo-float 1.5s ease-in-out infinite, logo-rainbow 2s linear infinite; }

/* ---------- Utilities ---------- */
.ld-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.ld-stack > * + * { margin-top: 12px; }
.ld-center { text-align: center; }
.ld-mt-0 { margin-top: 0 !important; }
.ld-mt-2 { margin-top: 8px; }
.ld-mt-4 { margin-top: 16px; }
.ld-mt-6 { margin-top: 24px; }
.ld-mb-0 { margin-bottom: 0 !important; }
.ld-mb-4 { margin-bottom: 16px; }
.ld-mb-6 { margin-bottom: 24px; }
[x-cloak] { display: none !important; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .ld-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ld-split, .ld-split--aside-right { grid-template-columns: minmax(0, 1fr); gap: 28px; }
    .ld-numbered { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 768px) {
    .ld-container { padding: 0 16px; }
    .ld-page-head { padding: 16px 0 14px; }
    .ld-page-head .ld-lead { font-size: 0.93rem; }
    .ld-section { padding: 26px 0; }
    .ld-grid-2, .ld-grid-3 { grid-template-columns: minmax(0, 1fr); }
    .ld-panel { padding: 20px; }
    .ld-table th, .ld-table td { padding: 11px 13px; }
    .ld-footer .ld-footer-inner { padding: 0 1rem; }
}
@media (max-width: 560px) {
    .ld-grid-4, .ld-numbered { grid-template-columns: minmax(0, 1fr); }
    .ld-search input { font-size: 1rem; padding: 10px; }
    .ld-search button { padding: 0 14px; }
    .ld-toasts { left: 12px; right: 12px; }
    .ld-toast { min-width: 0; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
