:root {
    --accent: #4f46e5;
    --on-accent: #ffffff;
    --bg: #f6f7fb;
    --surface: #ffffff;
    --surface-2: #f1f3f8;
    --ink: #111827;
    --ink-2: #4b5563;
    --ink-3: #6b7280;
    --line: #e2e6ee;
    --danger: #b91c1c;
    --danger-bg: #fef2f2;
    --ok: #15803d;
    --ok-bg: #f0fdf4;
    --warn: #92400e;
    --warn-bg: #fffbeb;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(17, 24, 39, .05), 0 12px 32px rgba(17, 24, 39, .07);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1218;
        --surface: #181c25;
        --surface-2: #222733;
        --ink: #f3f4f6;
        --ink-2: #c3c8d2;
        --ink-3: #9aa2b1;
        --line: #303644;
        --danger: #fca5a5;
        --danger-bg: #3b1518;
        --ok: #86efac;
        --ok-bg: #12301e;
        --warn: #fcd34d;
        --warn-bg: #33270d;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .35);
    }
}

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

[hidden] { display: none !important; }

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
}

h1, h2, h3 { line-height: 1.25; margin: 0; }

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

@media (prefers-color-scheme: dark) {
    a { color: color-mix(in srgb, var(--accent) 55%, white); }
}

button, input, select, textarea { font: inherit; color: inherit; }

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

.icon { width: 18px; height: 18px; flex: none; }

.field {
    display: block;
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
}

textarea.field { resize: vertical; }

.field:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 20px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: none;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: transform .12s ease, background-color .12s ease, box-shadow .12s ease;
}

.button:active { transform: translateY(1px); }
.button:disabled { opacity: .6; cursor: default; }

.button-primary {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}

.button-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent) 88%, black); }

.button-ghost {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink-2);
}

.button-ghost:hover { background: var(--surface-2); }

.button-danger {
    background: var(--danger);
    color: #fff;
}

@media (prefers-color-scheme: dark) {
    .button-danger { color: #1f0a0a; }
}

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-2);
    text-decoration: none;
    cursor: pointer;
}

.icon-button:hover { background: var(--surface-2); }
.icon-button.is-danger { color: var(--danger); }
.icon-button.is-danger:hover { background: var(--danger-bg); }

.prose h2 { margin: 22px 0 6px; font-size: 1.05rem; }
.prose p, .prose ul { margin: 6px 0; color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose strong { color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
