:root {
    color-scheme: dark;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bg: #071014;
    --panel: rgba(15, 30, 36, .9);
    --panel-strong: #10252d;
    --line: rgba(169, 230, 218, .16);
    --text: #eaf8f5;
    --muted: #98b7b2;
    --accent: #67e8c5;
    --accent-strong: #20bd96;
    --danger: #ff8e9e;
    --warning: #ffd280;
    --shadow: 0 24px 70px rgba(0, 0, 0, .32);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 12% 8%, rgba(32, 189, 150, .16), transparent 28rem),
        radial-gradient(circle at 92% 88%, rgba(45, 116, 184, .14), transparent 32rem),
        var(--bg);
}

button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.shell {
    width: min(1080px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.topbar {
    min-height: 82px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.owner-controls { display: flex; align-items: center; gap: 10px; }
.auth-card { width: min(440px, 100%); margin: 9vh auto 0; }
.checking-card { width: min(440px, 100%); margin: 9vh auto 0; text-align: center; }

.brand {
    color: inherit;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(103, 232, 197, .45);
    border-radius: 13px;
    color: #071411;
    background: linear-gradient(135deg, #8ef4d8, #30cda5);
    box-shadow: 0 10px 30px rgba(32, 189, 150, .2);
    font-weight: 850;
    letter-spacing: -.04em;
}

.brand strong, .brand small { display: block; }
.brand small { margin-top: 2px; color: var(--muted); font-size: .76rem; }

main { padding: 28px 0 64px; }
footer { padding: 22px 0 28px; color: var(--muted); font-size: .82rem; text-align: center; }

.hero { max-width: 760px; margin: 34px auto 32px; text-align: center; }
.eyebrow { color: var(--accent); font-size: .78rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 16px; font-size: clamp(2rem, 6vw, 4rem); line-height: 1.02; letter-spacing: -.055em; }
h2 { font-size: 1.35rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
.lead { color: var(--muted); line-height: 1.65; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.card {
    padding: clamp(20px, 4vw, 30px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(18, 42, 49, .94), rgba(11, 25, 31, .94));
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}
.card.subtle { box-shadow: none; background: rgba(12, 27, 33, .68); }
.stack > * + * { margin-top: 15px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 180px; }

label { display: block; color: var(--muted); font-size: .84rem; }
label > span { display: block; margin-bottom: 7px; }
input, textarea, select {
    width: 100%;
    border: 1px solid rgba(177, 224, 216, .2);
    border-radius: 12px;
    outline: none;
    color: var(--text);
    background: rgba(3, 12, 15, .72);
    transition: border-color .18s ease, box-shadow .18s ease;
}
input, select { min-height: 44px; padding: 0 13px; }
textarea { min-height: 150px; padding: 13px; line-height: 1.5; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(103, 232, 197, .12); }
input::placeholder, textarea::placeholder { color: #607d79; }
.secret-input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .02em; }

.button {
    min-height: 43px;
    padding: 0 17px;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    color: #061410;
    background: linear-gradient(135deg, #8df0d6, #36cda7);
    font-weight: 780;
    transition: transform .15s ease, opacity .15s ease, border-color .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .48; }
.button.secondary { color: var(--text); border-color: var(--line); background: rgba(23, 48, 55, .78); }
.button.ghost { color: var(--muted); border-color: var(--line); background: transparent; }
.button.danger { color: #25080d; background: linear-gradient(135deg, #ffb0bb, #ff7c8e); }
.button.small { min-height: 34px; padding: 0 12px; border-radius: 9px; font-size: .82rem; }

.badge {
    padding: 7px 11px;
    border: 1px solid rgba(103, 232, 197, .28);
    border-radius: 999px;
    color: var(--accent);
    background: rgba(32, 189, 150, .08);
    font-size: .76rem;
    font-weight: 750;
}
.muted { color: var(--muted); }
.warning { color: var(--warning); }
.danger-text { color: var(--danger); }
.fineprint { color: var(--muted); font-size: .78rem; line-height: 1.5; }

.room-head { margin-bottom: 18px; }
.room-id { color: var(--accent); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .82rem; word-break: break-all; }
.meter { width: 100%; height: 7px; overflow: hidden; border: 0; border-radius: 99px; appearance: none; background: rgba(255,255,255,.07); }
.meter::-webkit-progress-bar { border-radius: inherit; background: rgba(255,255,255,.07); }
.meter::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); transition: width .2s ease; }
.meter::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); transition: width .2s ease; }

.dropzone {
    padding: 22px;
    border: 1px dashed rgba(103, 232, 197, .35);
    border-radius: 14px;
    text-align: center;
    background: rgba(7, 21, 25, .45);
}
.dropzone.dragging { border-color: var(--accent); background: rgba(32, 189, 150, .08); }
.file-summary { margin-top: 10px; color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }

.history { margin-top: 18px; }
.history-list { display: grid; gap: 12px; }
.history-item {
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(7, 19, 23, .55);
}
.history-title { margin: 0; overflow-wrap: anywhere; }
.history-meta { margin-top: 6px; color: var(--muted); font-size: .78rem; }
.note { margin: 14px 0 0; padding: 13px; border-left: 3px solid rgba(103, 232, 197, .48); border-radius: 7px; white-space: pre-wrap; overflow-wrap: anywhere; color: #dff7f1; background: rgba(103, 232, 197, .055); }
.empty { padding: 38px 20px; color: var(--muted); text-align: center; border: 1px dashed var(--line); border-radius: 14px; }
.error-box { padding: 13px; border: 1px solid rgba(255, 142, 158, .28); border-radius: 11px; color: #ffc2cb; background: rgba(255, 70, 98, .07); }

.recovery {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(255, 210, 128, .28);
    border-radius: 14px;
    background: rgba(255, 185, 64, .06);
}
.code-box { padding: 12px; border-radius: 10px; color: #eafff9; background: #040c0f; font: .8rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; user-select: all; }

.spinner { width: 17px; height: 17px; display: inline-block; border: 2px solid rgba(255,255,255,.28); border-top-color: currentColor; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: fixed; right: 20px; bottom: 20px; max-width: min(420px, calc(100% - 40px)); padding: 13px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: #17353d; box-shadow: var(--shadow); z-index: 10; }

@media (max-width: 760px) {
    .shell { width: min(100% - 22px, 1080px); }
    .grid { grid-template-columns: 1fr; }
    .topbar { min-height: 70px; }
    .brand small { display: none; }
    main { padding-top: 12px; }
    .row.mobile-column { align-items: stretch; flex-direction: column; }
    .row.mobile-column .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
