:root {
    --accent: #4f46e5;
    --accent-dark: #3d36b2;
    --accent-soft: #e4e3fb;
    --bg: #f7f8fb;
    --surface: #ffffff;
    --text: #14161c;
    --muted: #5a6070;
    --border: #e2e5ee;
    --danger: #b42318;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 18, 27, 0.06), 0 8px 24px rgba(16, 18, 27, 0.06);
    --wrap: 68rem;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d0f14;
        --surface: #161923;
        --text: #eef0f6;
        --muted: #a3a9ba;
        --border: #262b38;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.35);
    }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--surface);
    padding: 0.75rem 1rem;
    z-index: 10;
}
.skip-link:focus { left: 0; }

.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}
.site-header .wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-block: 0.9rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
}
.brand-mark { width: 30px; height: 30px; display: block; }

.nav { list-style: none; display: flex; gap: 1rem; margin: 0; padding: 0; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 600; }
.nav a:hover { color: var(--text); }

.hero { padding-block: 2.5rem 1rem; }
h1 { font-size: clamp(1.8rem, 2.5vw + 1rem, 2.6rem); line-height: 1.15; margin: 0 0 0.5rem; }
.lede { color: var(--muted); font-size: 1.1rem; margin: 0; max-width: 46rem; }

.panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-block: 1rem 3rem;
}
.panel h2 { margin-top: 0; font-size: 1.25rem; }

.field-label { display: block; font-weight: 600; margin-bottom: 0.4rem; }

textarea {
    width: 100%;
    padding: 0.9rem 1rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font: inherit;
    resize: vertical;
    min-height: 9rem;
}

.hint { color: var(--muted); font-size: 0.9rem; margin: 0.4rem 0 0; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1rem; }

.btn {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    padding: 0.55rem 1rem;
    border-radius: 10px;
    cursor: pointer;
}
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-ghost { background: transparent; color: var(--accent); }
.btn-ghost:hover { background: var(--accent-soft); color: var(--accent-dark); }

.status { margin: 1rem 0 0; color: var(--muted); }

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    gap: 0.8rem;
    margin: 1rem 0 0;
}
.stat {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.8rem 1rem;
}
.stat dt { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.stat dd { margin: 0.2rem 0 0; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }

.error { color: var(--danger); font-weight: 600; margin: 1rem 0 0; }

.site-footer {
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.9rem;
}
.site-footer .wrap { padding-block: 1.25rem; }
.site-footer p { margin: 0; }

@media (max-width: 34rem) {
    .site-header .wrap { flex-direction: column; align-items: flex-start; }
    .panel { padding: 1.1rem; }
}
