:root {
    color-scheme: dark;
    --bg: #080c12;
    --surface: #111823;
    --surface-2: #161f2c;
    --line: #263244;
    --text: #f4f7fb;
    --muted: #95a3b6;
    --orange: #f7931a;
    --orange-2: #ffb34f;
    --green: #4fd6a3;
    --red: #ff6d7a;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 80% 0%, rgba(247, 147, 26, .12), transparent 28rem),
        linear-gradient(145deg, #090d14, var(--bg));
    color: var(--text);
    font-size: 16px;
    line-height: 1.5;
}

button, input, textarea { font: inherit; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 56px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand h1, .card h2 { margin: 0; letter-spacing: -.025em; }
.brand h1 { font-size: 1.35rem; }
.brand p { margin: 2px 0 0; color: var(--muted); font-size: .92rem; }
.coin { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: var(--orange); color: #16100a; font-size: 1.65rem; font-weight: 800; box-shadow: 0 10px 30px rgba(247, 147, 26, .18); }
.card, .metric { border: 1px solid var(--line); background: rgba(17, 24, 35, .92); box-shadow: 0 18px 55px rgba(0, 0, 0, .22); }
.card { border-radius: 20px; padding: 24px; }
.summary-grid { display: grid; grid-template-columns: .8fr 1.35fr 1.25fr .8fr; gap: 12px; margin-bottom: 16px; }
.metric { min-width: 0; border-radius: 16px; padding: 16px 18px; }
.metric span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .98rem; }
.ok { color: var(--green); }
.warn { color: var(--orange-2); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .65fr); gap: 16px; align-items: start; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.eyebrow { display: block; margin-bottom: 5px; color: var(--orange-2); font-size: .75rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
textarea { width: 100%; min-height: 520px; resize: vertical; border: 1px solid var(--line); border-radius: 14px; outline: 0; padding: 18px; background: #0a1018; color: #dce7f6; font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: .9rem; line-height: 1.65; tab-size: 2; }
textarea:focus, input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(247, 147, 26, .13); }
.form-footer { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-top: 16px; }
.form-footer span { max-width: 34rem; color: var(--muted); font-size: .85rem; }
.button { appearance: none; border: 1px solid transparent; border-radius: 11px; padding: 10px 15px; color: var(--text); cursor: pointer; font-weight: 700; transition: transform .15s ease, border-color .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--orange); color: #17100a; }
.button-primary:hover { background: var(--orange-2); }
.button-quiet { border-color: var(--line); background: var(--surface-2); }
.button-quiet:hover { border-color: #3a485c; }
.guide-card ol { list-style: none; margin: 22px 0; padding: 0; counter-reset: steps; }
.guide-card li { display: grid; grid-template-columns: 34px 1fr; column-gap: 12px; margin-bottom: 18px; counter-increment: steps; }
.guide-card li::before { content: counter(steps); grid-row: 1 / 3; display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid rgba(247, 147, 26, .35); border-radius: 10px; color: var(--orange-2); font-weight: 800; }
.guide-card li b { font-size: .95rem; }
.guide-card li span { color: var(--muted); font-size: .86rem; }
.feed-box { border: 1px solid var(--line); border-radius: 14px; padding: 15px; background: #0a1018; }
.feed-box > span { display: block; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.feed-box code { display: block; overflow-wrap: anywhere; margin: 8px 0; color: #dce7f6; }
.text-button { border: 0; padding: 0; background: transparent; color: var(--orange-2); cursor: pointer; font-weight: 700; }
.hint { margin: 18px 0 0; color: var(--muted); font-size: .84rem; }
.alert { border: 1px solid; border-radius: 14px; margin-bottom: 16px; padding: 13px 16px; }
.alert-success { border-color: rgba(79, 214, 163, .35); background: rgba(79, 214, 163, .09); color: #baf5df; }
.alert-error { border-color: rgba(255, 109, 122, .35); background: rgba(255, 109, 122, .09); color: #ffc7cc; }
.alert ul { margin: 8px 0 0; padding-left: 20px; }
.login-card, .centered { width: min(470px, 100%); margin: 10vh auto 0; }
.login-card p, .centered p { color: var(--muted); }
.login-form { display: grid; gap: 10px; margin-top: 22px; }
.login-form label { font-weight: 700; }
.login-form input { width: 100%; border: 1px solid var(--line); border-radius: 11px; outline: 0; padding: 12px 14px; background: #0a1018; color: var(--text); }
.login-form .button { margin-top: 8px; }
.status { display: inline-block; border-radius: 999px; padding: 5px 10px; font-size: .75rem; font-weight: 750; }
.status-error { background: rgba(255, 109, 122, .12); color: #ffc7cc; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
code { font-family: "SFMono-Regular", Consolas, monospace; }

@media (max-width: 900px) {
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .workspace { grid-template-columns: 1fr; }
    .guide-card { order: -1; }
}

@media (max-width: 560px) {
    .shell { width: min(100% - 20px, 1180px); padding-top: 18px; }
    .brand p { display: none; }
    .summary-grid { grid-template-columns: 1fr; }
    .card { padding: 18px; border-radius: 16px; }
    .form-footer { align-items: stretch; flex-direction: column; }
    .form-footer .button { width: 100%; }
    textarea { min-height: 440px; font-size: .82rem; }
}
