:root {
    color-scheme: light;
    --page: #f8fafc;
    --surface: #fdfefe;
    --ink: #0f172a;
    --muted: #475569;
    --line: #cbd5e1;
    --soft-line: #e2e8f0;
    --accent: #0f766e;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: system-ui, -apple-system, "Segoe UI", sans-serif; line-height: 1.6; }
body.site-page { display: flex; flex-direction: column; min-height: 100vh; }
.site-page > main { flex: 1; width: 100%; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
a { text-decoration: none !important; text-underline-offset: .2em; }
.page-width { max-width: 1248px; margin-inline: auto; padding-inline: 1.5rem; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--soft-line); }
.site-header nav { display: flex; justify-content: space-between; align-items: center; min-height: 76px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; gap: .5rem; min-height: 44px; font-family: "Fraunces", Georgia, serif; font-size: 1.25rem; font-weight: 750; letter-spacing: -.025em; text-decoration: none; white-space: nowrap; }
.brand-logo { display: block; flex-shrink: 0; width: 32px; height: 32px; }
.brand-prefix { color: #b91c1c; }
.site-menu-inner { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-menu-inner a { display: inline-flex; align-items: center; min-height: 44px; font-size: .875rem; font-weight: 600; }
.site-header a:hover, .site-header [aria-current="page"] { color: var(--accent); }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--soft-line); border-radius: 10px; background: transparent; color: var(--ink); cursor: pointer; }
.nav-toggle:hover { border-color: var(--line); }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 2px; border-radius: 2px; background-color: currentColor; transition: transform .25s ease, background-color .2s ease; }
.nav-toggle-bars { position: relative; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-open .nav-toggle-bars { background-color: transparent; }
.nav-open .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }
@media (min-width: 641px) {
    .site-header .nav-toggle { display: none !important; }
}
.site-footer { margin-top: 3rem; border-top: 1px solid var(--line); padding-block: 1.5rem; color: var(--muted); font-size: .8125rem; }
.site-footer p { margin: .75rem 0; }
.site-footer a, .information-content a { color: var(--accent); text-decoration: underline !important; }
.footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1.5rem; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; }
.back-to-top { position: fixed; right: max(1rem, env(safe-area-inset-right)); bottom: max(1rem, env(safe-area-inset-bottom)); display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 9999px; background: linear-gradient(135deg, rgb(255 255 255 / .9), rgb(226 232 240 / .55)); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); color: var(--muted); font-size: 1.5rem; line-height: 1; text-decoration: none; box-shadow: inset 0 1px 0 rgb(255 255 255 / .95), 0 2px 6px rgb(15 23 42 / .06); z-index: 10; transition: border-color .2s ease, box-shadow .2s ease, color .2s ease; }
.back-to-top[hidden] { display: none; }
.back-to-top:hover { border-color: var(--accent); box-shadow: inset 0 1px 0 rgb(255 255 255 / .95), 0 3px 8px rgb(15 23 42 / .1); color: var(--ink); }
.site-page [data-pwa-install][hidden], .pwa-install-offer[hidden] { display: none !important; }
.pwa-install-offer { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; padding-bottom: 1rem; }
.pwa-install-offer p { margin: 0; color: inherit; }
.pwa-status:empty { display: none; }
.pwa-status { padding: .75rem 1rem; border: 1px solid var(--line); border-radius: .5rem; }
.information-main { padding-block: 1.5rem; }
.information-content { max-width: 76ch; margin-inline: auto; }
.information-content h2 { margin: 2rem 0 .75rem; font-size: 1.375rem; line-height: 1.3; }
.information-content p, .information-content li { color: var(--muted); }
.information-content li + li { margin-top: .5rem; }
.contact-form { display: grid; gap: 1.25rem; margin-top: 2rem; }
.contact-form input, .contact-form textarea { width: 100%; padding: .75rem; border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); color: var(--ink); font: inherit; }
.contact-form textarea { resize: vertical; }
.contact-form button { justify-self: start; }
.contact-form [aria-invalid="true"] { border-color: #9f1239; }
.contact-trap { display: none; }
.contact-notice { padding: 1rem; margin-block: 1.5rem; border: 1px solid var(--accent); border-radius: .5rem; }
.contact-error { border-color: #9f1239; }
.field-error { color: #9f1239; font-size: .875rem; }
.contact-notice p { margin: 0; }
.maintenance-notice { border-bottom: 1px solid #fcd34d; background: #fef3c7; color: #7c2d12; font-size: .875rem; }
.maintenance-notice .page-width { padding-block: .6rem; font-weight: 600; }
.skip-link { position: absolute; left: 1rem; top: 1rem; transform: translateY(-200%); padding: .75rem 1rem; background: var(--ink); color: var(--surface); z-index: 100; }
.skip-link:focus { transform: none; }
:where(a, button, input, textarea, select, summary, [tabindex]):focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.site-page :where(button, input:not([type="hidden"]), select) { min-height: 24px; }
.site-page form a { display: inline-flex; align-items: center; min-height: 44px; }
.site-page input::placeholder { color: var(--muted); opacity: 1; }
.site-page :where(input, select) { min-width: 0; max-width: 100%; border-color: #64748b; }
.site-page label { font-size: .8125rem; color: var(--muted); font-weight: 600; }
.field { display: flex; flex-direction: column; gap: .375rem; min-width: 0; }
.page-heading { padding-block: 1.5rem 2rem; }
.page-heading h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); font-weight: 650; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 .75rem; }
.page-heading p { color: var(--muted); max-width: 70ch; margin: 0; }
.site-page button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: .625rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 9999px;
    background: linear-gradient(135deg, rgb(255 255 255 / .9), rgb(226 232 240 / .55));
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .95), 0 2px 6px rgb(15 23 42 / .06);
    color: var(--muted);
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.site-page button:hover {
    border-color: var(--accent);
    box-shadow: inset 0 1px 0 rgb(255 255 255 / .95), 0 3px 8px rgb(15 23 42 / .1);
    color: var(--ink);
}
.site-page button:active { box-shadow: inset 0 1px 3px rgb(15 23 42 / .1); }
.site-page .report-card { box-shadow: none; }
.site-page .report-card::before { display: none; }
body#page-top .site-footer { padding-bottom: 5rem; }
.page-loading-overlay[hidden] { display: none; }
.market-loading[hidden] { display: none; }
.market-loading { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; background: rgb(248 250 252 / .94); }
.market-loading-card { width: min(100%, 11rem); padding: .875rem 1rem; border: 1px solid var(--soft-line); border-radius: 12px; background: var(--surface); color: var(--muted); text-align: center; }
.market-loading-card p { margin: .5rem 0 0; font-size: .75rem; font-weight: 600; }
.market-loading-bars { display: grid; gap: .3rem; }
.market-loading-bars span { height: .4rem; border-radius: 3px; background: var(--line); animation: market-loading-pulse 1.2s ease-in-out infinite; }
.market-loading-bars span:nth-child(2) { width: 85%; animation-delay: .15s; }
.market-loading-bars span:nth-child(3) { width: 65%; animation-delay: .3s; }
@keyframes market-loading-pulse { 50% { opacity: .35; } }
.site-page [aria-disabled="true"] { opacity: .5; pointer-events: none; }
.site-page .text-slate-500 { color: var(--muted); }
.site-page .text-emerald-600 { color: var(--accent); }
.site-page .text-rose-600 { color: #9f1239; }
.site-page main { overflow-wrap: anywhere; }
.server-summary { margin-top: 1rem; color: var(--muted); font-size: .875rem; }
.project-index { margin-block: 2rem; }
.project-index ul { list-style: none; padding: 0; }
.project-index li { padding: 1rem 0; border-bottom: 1px solid var(--soft-line); }
.project-index a { font-weight: 600; }
.project-index p { margin: .25rem 0; color: var(--muted); font-size: .875rem; }
.pagination-links { display: flex; flex-wrap: wrap; gap: 1.5rem; padding-block: 1rem; }
.pagination-links a { display: inline-flex; align-items: center; min-height: 44px; }
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    padding: 0 .55rem;
    border-radius: 9999px;
    border: 1px solid transparent;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    white-space: nowrap;
}
.status-ok { color: #166534; background: #dcfce7; border-color: #86efac; }
.status-warning { color: #92400e; background: #fef3c7; border-color: #fcd34d; }
.status-info { color: #1d4ed8; background: #dbeafe; border-color: #93c5fd; }

.admin-page { padding-block: 1.5rem 2.25rem; }
.admin-hero {
    margin: 0 0 1rem;
    padding: 1.25rem 1.25rem 1rem;
    border: 1px solid var(--soft-line);
    border-radius: 12px;
    background: var(--surface);
}
.admin-hero h1 { margin: 0 0 .35rem; font-size: clamp(1.55rem, 2.4vw, 2rem); letter-spacing: -.02em; }
.admin-hero p { margin: 0; color: var(--muted); max-width: 80ch; }
.admin-alert-stack { display: grid; gap: .75rem; margin-bottom: 1rem; }
.admin-action-bar {
    position: sticky;
    top: .75rem;
    z-index: 30;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
    margin: 0 0 1rem;
    padding: .55rem;
    border: 1px solid var(--soft-line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface) 92%, white 8%);
    backdrop-filter: blur(6px);
}
.admin-quick-form { margin: 0; }
.admin-quick-link,
.admin-quick-button {
    display: inline-flex;
    align-items: center;
    gap: .38rem;
    min-height: 2.2rem;
    padding: .35rem .7rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: .79rem;
    font-weight: 650;
    text-decoration: none;
    cursor: pointer;
}
.admin-quick-link:hover,
.admin-quick-button:hover { border-color: #64748b; background: #f8fafc; }
.admin-quick-link[aria-current="page"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.admin-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .75rem; margin: .75rem 0; }
.admin-facts div { padding: .65rem .75rem; border: 1px solid var(--soft-line); border-radius: 10px; }
.admin-facts dt { color: var(--muted); font-size: .78rem; }
.admin-facts dd { margin: .2rem 0 0; font-weight: 650; }
.admin-quick-button { font-family: inherit; }
.admin-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.admin-card {
    grid-column: span 6;
    margin: 0;
    padding: 1.1rem 1.15rem;
    border: 1px solid var(--soft-line);
    border-radius: 12px;
    background: var(--surface);
}
.admin-card h2 { margin: 0 0 .8rem; font-size: 1.05rem; letter-spacing: -.01em; }
.admin-section-title { display: flex; align-items: center; gap: .45rem; }
.admin-section-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 999px;
    background: #e2e8f0;
    font-size: .78rem;
    flex-shrink: 0;
}
.admin-card p { margin: .35rem 0; }
.admin-card--primary { grid-column: span 8; }
.admin-card--wide { grid-column: span 12; }
.admin-card--narrow { max-width: 600px; margin: 0 auto; }
.admin-form { display: grid; gap: .75rem; max-width: 40rem; }
.admin-form button {
    justify-self: start;
    min-height: 40px;
    padding: .5rem .9rem;
    border: 1px solid #0f172a;
    border-radius: 10px;
    background: #0f172a;
    color: #fff;
    font-weight: 650;
    font-size: .86rem;
    cursor: pointer;
}
.admin-form button:hover { background: #1e293b; border-color: #3b1e1e; color: #ff7070; }
.admin-form button:active { transform: translateY(1px); }
.admin-card :where(input, select) {
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: .45rem .6rem;
    background: #fff;
    color: var(--ink);
}
.admin-card table { font-size: .9rem; }
.admin-card th, .admin-card td { vertical-align: top; }
.admin-card code { font-size: .82rem; padding: .08rem .28rem; border-radius: 5px; background: #e2e8f0; }
@media (max-width: 640px) {
    .page-width { padding-inline: 1rem; }
    .site-header nav { min-height: 68px; flex-wrap: wrap; gap: .25rem .75rem; padding-block: .5rem; }
    .brand { font-size: 1.125rem; }
    .site-menu-inner { gap: .75rem; }
    .site-menu-inner a { font-size: .75rem; }
    .site-header.nav-ready nav { row-gap: 0; }
    .site-header.nav-ready .nav-toggle { display: inline-flex !important; }
    .site-header.nav-ready .site-menu { flex-basis: 100%; display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .28s ease, visibility 0s linear .28s; }
    .site-header.nav-open .site-menu { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows .28s ease, visibility 0s; }
    .site-header.nav-ready .site-menu-inner { min-height: 0; overflow: hidden; flex-direction: column; gap: 0; opacity: 0; transition: opacity .2s ease; }
    .site-header.nav-open .site-menu-inner { opacity: 1; }
    .site-header.nav-ready .site-menu-inner a { min-height: 48px; font-size: .9375rem; border-top: 1px solid var(--soft-line); }
}
@media (max-width: 920px) {
    .admin-card, .admin-card--primary, .admin-card--wide { grid-column: span 12; }
    .admin-action-bar { top: .5rem; }
}
@media (max-width: 480px) {
    .admin-action-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        padding: .45rem;
        gap: .45rem;
    }
    .admin-action-bar::-webkit-scrollbar { height: 6px; }
    .admin-action-bar::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 999px; }
    .admin-quick-form,
    .admin-quick-link,
    .admin-quick-button { flex: 0 0 auto; }
    .admin-quick-link,
    .admin-quick-button { min-height: 2rem; padding: .28rem .6rem; font-size: .75rem; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
    body.site-page { display: block; min-height: auto; }
    .site-header, .site-footer, .skip-link, .no-print, .market-loading { display: none !important; }
}
