/* ===== Design-Tokens ===== */
:root {
    --bg: #FAFAFA;
    --card: #FFFFFF;
    --text: #1F2328;
    --muted: #6B7280;
    --border: #E5E7EB;
    --accent: #2563EB;
    --accent-ink: #FFFFFF;
    --code-bg: #1F2937;
    --code-ink: #E5E7EB;
    --shadow: 0 8px 24px rgba(0,0,0,.08);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0F1115;
        --card: #171A20;
        --text: #EDEDED;
        --muted: #A1A1AA;
        --border: #262A33;
        --accent: #3B82F6;
        --accent-ink: #0B1020;
        --code-bg: #0E1117;
        --code-ink: #D1D5DB;
        --shadow: 0 8px 24px rgba(0,0,0,.35);
    }
}

/* ===== Base ===== */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

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

.container {
    width: min(960px, 92vw);
    margin: 0 auto;
}

/* ===== Hero ===== */
.hero {
    padding: 48px 0 24px;
}

    .hero h1 {
        margin: 0 0 8px;
        font-size: clamp(28px, 3.4vw, 40px);
        letter-spacing: -0.02em;
    }

    .hero .sub {
        margin: 0;
        color: var(--muted);
    }

/* ===== Console (Input) ===== */
.console {
    margin-top: 28px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 18px;
}

.console__form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.console__input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 10px;
    font-size: 16px;
    outline: none;
}

    .console__input:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 22%, transparent);
    }

.console__btn {
    padding: 12px 18px;
    background: var(--accent);
    color: var(--accent-ink);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

    .console__btn:disabled {
        opacity: .65;
        cursor: not-allowed;
    }

    .console__btn:hover:not(:disabled) {
        filter: brightness(0.95);
    }

.console__micro {
    margin-top: 8px;
    font-size: 12px;
    color: var(--muted);
}

/* ===== Tabs ===== */
.tabs {
    margin: 22px 0 32px;
}

.tabs__bar {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
    padding: 0 4px;
}

.tabs__btn {
    background: transparent;
    border: none;
    color: var(--muted);
    font-weight: 700;
    padding: 10px 14px;
    cursor: pointer;
    position: relative;
    border-radius: 8px;
}

    .tabs__btn.active {
        color: var(--text);
    }

        .tabs__btn.active::after {
            content: "";
            position: absolute;
            left: 10px;
            right: 10px;
            bottom: -1px;
            height: 3px;
            background: var(--accent);
            border-radius: 3px 3px 0 0;
        }

/* ===== Tabpanes ===== */
.tabpane {
    display: none;
}

    .tabpane.active {
        display: block;
    }

/* ===== Analysis: Person Cards ===== */
.person-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    box-shadow: var(--shadow);
    margin-bottom: 14px;
}

.person-card__title {
    font-weight: 700;
    margin-bottom: 10px;
}

.person-card__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 18px;
}

.kv {
    display: contents;
}

.kv__k {
    color: var(--muted);
}

.kv__v {
    font-weight: 600;
}

/* ===== Notes & States ===== */
.info-note, .error-note, .loading {
    background: var(--card);
    border: 1px dashed var(--border);
    color: var(--text);
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: var(--shadow);
}

.error-note {
    border-color: color-mix(in oklab, var(--accent) 35%, var(--border));
}

.loading {
    font-style: italic;
}

/* ===== Raw JSON ===== */
.codeblock {
    background: var(--code-bg);
    color: var(--code-ink);
    border-radius: 12px;
    padding: 16px;
    overflow: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    white-space: pre-wrap;
}

/* ===== Footer ===== */
.footer {
    padding: 24px 0 60px;
}

.footer__img {
    width: min(720px, 92vw);
    border-radius: 12px;
    box-shadow: var(--shadow);
    display: block;
    margin: 0 auto;
}

/* ===== A11y ===== */
.sr-only {
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    clip: rect(1px,1px,1px,1px);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
    .person-card__grid {
        grid-template-columns: 1fr;
    }
}
