/* AIHouse — arkusz stylow. Jeden plik, bez zaleznosci. */

:root {
    --bg: #faf8f5;
    --bg-elev: #ffffff;
    --bg-sunken: #f2eee8;
    --ink: #1c1a17;
    --ink-soft: #55504a;
    --ink-faint: #8b847b;
    --line: #e4ded4;
    --line-strong: #d2c9bb;
    --accent: #1f6f5c;
    --accent-soft: #e8f2ee;
    --accent-ink: #14503f;
    --warn: #a4620d;
    --warn-soft: #fbf1e2;
    --error: #a32f2a;
    --error-soft: #fbeceb;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(28, 26, 23, .05), 0 8px 24px -12px rgba(28, 26, 23, .18);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #14130f;
        --bg-elev: #1c1a17;
        --bg-sunken: #232019;
        --ink: #f2eee8;
        --ink-soft: #bdb5aa;
        --ink-faint: #8b847b;
        --line: #2e2a24;
        --line-strong: #3d382f;
        --accent: #6bbfa4;
        --accent-soft: #17322a;
        --accent-ink: #9fd9c4;
        --warn: #d79a4a;
        --warn-soft: #2c2114;
        --error: #e08a84;
        --error-soft: #2d1815;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -16px rgba(0, 0, 0, .6);
    }
}

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

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-ink); text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }

code, pre { font-family: var(--font-mono); font-size: .86em; }

/* ---------- layout ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: -.01em;
    color: var(--ink);
    text-decoration: none;
}

.topbar__mark {
    width: 20px;
    height: 20px;
    border-radius: 6px;
    background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--warn)));
}

.topbar__links { display: flex; gap: 20px; font-size: .9rem; }
.topbar__links a { color: var(--ink-soft); text-decoration: none; }
.topbar__links a:hover { color: var(--ink); }

.shell {
    max-width: 940px;
    margin: 0 auto;
    padding: 56px 24px 96px;
}

.shell--narrow { max-width: 720px; }

.footer {
    max-width: 940px;
    margin: 0 auto;
    padding: 28px 24px 56px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: .82rem;
    color: var(--ink-faint);
    border-top: 1px solid var(--line);
}

/* ---------- hero ---------- */

.hero { margin-bottom: 40px; }

.hero__eyebrow {
    margin: 0 0 14px;
    font-size: .76rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.hero__title {
    margin: 0 0 18px;
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 5.5vw, 3.4rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -.025em;
}

.hero__lead {
    margin: 0;
    max-width: 58ch;
    font-size: 1.06rem;
    color: var(--ink-soft);
}

.pagehead { margin-bottom: 32px; }
.pagehead__title {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -.02em;
}
.pagehead__lead { margin: 0; color: var(--ink-soft); }

/* ---------- prompt ---------- */

.prompt {
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--shadow);
}

.prompt__label {
    display: block;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ink-faint);
    margin-bottom: 12px;
}

.prompt__input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-family: inherit;
    font-size: 1.12rem;
    line-height: 1.55;
    resize: vertical;
    min-height: 84px;
    padding: 0;
}

.prompt__input:focus { outline: none; }
.prompt__input::placeholder { color: var(--ink-faint); }

.prompt:focus-within {
    border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
    box-shadow: var(--shadow), 0 0 0 4px var(--accent-soft);
}

.prompt__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; flex: 1 1 320px; }

.chip {
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 6px 13px;
    font: inherit;
    font-size: .82rem;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
}

.chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 11px 22px;
    font: inherit;
    font-weight: 600;
    font-size: .95rem;
    cursor: pointer;
    transition: opacity .15s, transform .05s;
}

.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .btn--primary { color: #10241d; } }
.btn--primary:hover { opacity: .9; }
.btn[disabled] { opacity: .55; cursor: progress; }

.btn__spinner { display: none; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-busy .btn__spinner { display: inline-block; }

@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- statbar ---------- */

.statbar {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    margin-top: 22px;
    padding: 0 4px;
}

.statbar__item { display: flex; flex-direction: column; }
.statbar__item strong { font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.statbar__item span { font-size: .78rem; color: var(--ink-faint); }
.statbar__item--flag strong { font-family: var(--font-sans); font-size: .9rem; color: var(--ink-soft); }

/* ---------- wyniki ---------- */

.results { margin-top: 44px; display: flex; flex-direction: column; gap: 18px; }

.summary {
    background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
    border-radius: var(--radius);
    padding: 20px 22px;
}

.summary__title {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--accent-ink);
}

.summary p { margin: 0 0 10px; color: var(--ink-soft); }
.summary p:last-child { margin-bottom: 0; }
.summary ul { margin: 8px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: .92rem; }

.card {
    display: flex;
    gap: 20px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px 22px;
    box-shadow: var(--shadow);
}

.card__score {
    flex: 0 0 auto;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft);
    color: var(--accent-ink);
    font-family: var(--font-display);
    line-height: 1;
}

.card__score-value { font-size: 1.35rem; font-weight: 600; }
.card__score small { font-size: .6rem; opacity: .7; }

.card__body { min-width: 0; flex: 1; }

.card__title { margin: 0 0 4px; font-size: 1.06rem; font-weight: 600; line-height: 1.35; }
.card__link { color: var(--ink); text-decoration: none; }
.card__link:hover { text-decoration: underline; }

.card__headline { margin: 0 0 12px; color: var(--ink-soft); font-size: .93rem; }

.card__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin: 0 0 14px;
    font-size: .86rem;
}
.card__facts div { display: flex; gap: 6px; align-items: baseline; }
.card__facts dt { color: var(--ink-faint); }
.card__facts dd { margin: 0; font-weight: 600; }

.card__reasons, .card__concerns { margin: 0 0 10px; padding-left: 18px; font-size: .9rem; color: var(--ink-soft); }
.card__reasons li::marker { color: var(--accent); }
.card__concerns { color: var(--warn); }
.card__concerns li::marker { color: var(--warn); }
.card__reasons:empty, .card__concerns:empty { display: none; }

.card__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
    font-size: .74rem;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--bg-sunken);
    color: var(--ink-soft);
    border: 1px solid var(--line);
}

/* ---------- panel techniczny ---------- */

.techbox {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--bg-sunken);
    padding: 4px 18px;
}

.techbox summary {
    cursor: pointer;
    padding: 12px 0;
    font-size: .85rem;
    font-weight: 600;
    color: var(--ink-soft);
    list-style: none;
}
.techbox summary::-webkit-details-marker { display: none; }
.techbox summary::before { content: '▸ '; color: var(--ink-faint); }
.techbox[open] summary::before { content: '▾ '; }

.techbox__meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: .78rem; color: var(--ink-faint); padding-bottom: 10px; }

.code {
    margin: 0 0 14px;
    padding: 14px 16px;
    background: var(--bg-elev);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    white-space: pre;
    font-size: .8rem;
    line-height: 1.5;
    color: var(--ink-soft);
}

/* ---------- komunikaty ---------- */

.notice {
    border-radius: var(--radius);
    padding: 16px 20px;
    border: 1px solid var(--line);
    background: var(--bg-elev);
    margin: 20px 0;
    font-size: .93rem;
}
.notice p:first-child { margin-top: 0; }
.notice p:last-child, .notice ol:last-child { margin-bottom: 0; }
.notice ol { margin: 8px 0 0; padding-left: 22px; }
.notice li { margin-bottom: 4px; }
.notice--success { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.notice--error { background: var(--error-soft); border-color: color-mix(in srgb, var(--error) 30%, transparent); color: var(--error); }
.notice--info { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.notice--info .code { background: var(--bg-elev); }

/* ---------- instalator ---------- */

.steps { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-elev); }

.steps__item {
    display: flex;
    align-items: baseline;
    gap: 14px;
    padding: 11px 18px;
    border-bottom: 1px solid var(--line);
    font-size: .9rem;
}
.steps__item:last-child { border-bottom: 0; }
.steps__label { flex: 0 0 230px; font-weight: 500; }
.steps__detail { color: var(--ink-faint); font-size: .84rem; }

.steps__item::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: 0 0 auto;
    background: var(--line-strong);
}
.steps__item--ok::before { background: var(--accent); }
.steps__item--warn::before { background: var(--warn); }
.steps__item--fail::before { background: var(--error); }

.empty {
    text-align: center;
    padding: 48px 20px;
    color: var(--ink-faint);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
}

@media (max-width: 640px) {
    .shell { padding: 36px 18px 72px; }
    .card { flex-direction: column; gap: 14px; }
    .card__score { width: 50px; height: 50px; }
    .steps__label { flex-basis: 100%; }
    .steps__item { flex-wrap: wrap; }
}
