:root {
    --bg: #f2f5f1;
    --card: #ffffff;
    --ink: #102219;
    --muted: #66746c;
    --line: #dce4de;
    --brand: #19a45b;
    --brand-dark: #08773d;
    --soft: #eaf7ef;
    --danger: #b73535;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--bg);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background:
    radial-gradient(circle at 90% 4%, rgba(25, 164, 91, .1), transparent 28rem),
    var(--bg); }
button, input { font: inherit; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 28px; }
.topbar { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; margin-bottom: 26px; }
.topbar h1 { margin: 4px 0 6px; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.055em; line-height: 1; }
.topbar p, .card p { color: var(--muted); margin: 0; line-height: 1.6; }
.eyebrow, .step { color: var(--brand-dark); font-size: .72rem; letter-spacing: .13em; font-weight: 800; }
.health { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.75); font-size: .82rem; color: var(--muted); }
.health i { width: 8px; height: 8px; border-radius: 50%; background: #d29b2f; }
.health.ok i { background: var(--brand); box-shadow: 0 0 0 4px rgba(25,164,91,.12); }
.health.error i { background: var(--danger); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 10px 34px rgba(19, 42, 28, .045); }
.key-panel { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 18px; }
.card h2 { margin: 4px 0 7px; font-size: 1.08rem; letter-spacing: -.02em; }
.key-controls { display: flex; gap: 9px; width: min(520px, 100%); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding-block: 28px; }
.login-card { width: min(470px, 100%); }
.login-card h1 { margin: 8px 0 8px; font-size: clamp(2rem, 6vw, 3rem); letter-spacing: -.055em; line-height: 1; }
.login-form { margin-top: 22px; }
input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; color: var(--ink); background: #fbfcfb; outline: none; }
input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(25,164,91,.11); }
.button { border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer; font-weight: 750; transition: .18s ease; white-space: nowrap; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.primary { background: var(--brand); color: white; }
.primary:hover { background: var(--brand-dark); }
.ghost { background: #eef2ef; color: var(--ink); }
.wide { width: 100%; margin-top: 16px; }
.compact { padding: 8px 11px; font-size: .8rem; }

.notice { border-radius: 10px; padding: 12px 15px; margin-bottom: 18px; background: var(--soft); color: var(--brand-dark); font-size: .9rem; }
.notice.error { color: var(--danger); background: #fff0f0; }
.grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr); gap: 18px; }
.stack { display: grid; align-content: start; gap: 18px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.limit { font-size: .74rem; color: var(--muted); }
label:not(.choice, .dropzone) { display: block; margin: 18px 0 7px; font-size: .82rem; font-weight: 750; }
.hint { font-size: .78rem; margin-top: 7px !important; }

.choice-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.choice { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 13px; cursor: pointer; }
.choice input { width: auto; accent-color: var(--brand); }
.choice span { display: grid; gap: 3px; }
.choice strong { font-size: .84rem; }
.choice small { color: var(--muted); font-size: .72rem; }
.dropzone { min-height: 190px; border: 1.5px dashed #aabbb0; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; cursor: pointer; background: #fafcf9; text-align: center; transition: .18s ease; }
.dropzone:hover, .dropzone.dragging { border-color: var(--brand); background: var(--soft); }
.dropzone input { display: none; }
.dropzone small { color: var(--muted); }
.drop-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--soft); color: var(--brand-dark); font-size: 1.5rem; }
.result { margin-top: 14px; padding: 13px; border-radius: 10px; background: var(--soft); font-size: .82rem; overflow-wrap: anywhere; }
.result a { color: var(--brand-dark); font-weight: 700; }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 16px; }
.stats div { display: grid; gap: 2px; background: #f6f8f6; border-radius: 11px; padding: 14px; }
.stats strong { font-size: 1.35rem; }
.stats span { color: var(--muted); font-size: .76rem; }
.paths { display: grid; gap: 8px; margin-top: 16px; }
.paths code { padding: 9px 10px; border-radius: 8px; color: #31503e; background: #f2f6f3; font-size: .74rem; overflow-x: auto; }
footer { display: flex; justify-content: space-between; color: var(--muted); font-size: .74rem; padding: 22px 4px 0; }

@media (max-width: 800px) {
    .shell { padding-top: 26px; }
    .topbar, .key-panel { flex-direction: column; }
    .grid { grid-template-columns: 1fr; }
    .key-controls { width: 100%; }
}
@media (max-width: 520px) {
    .choice-row, .stats { grid-template-columns: 1fr; }
    .key-controls { flex-wrap: wrap; }
    .key-controls input { flex-basis: 100%; }
    .card { padding: 18px; }
}
