:root {
    --ink: #1a1714;
    --muted: #6d655c;
    --line: #e6dfd4;
    --paper: #f6f3ee;
    --card: #fffcf8;
    --sand: #c9842a;
    --sand-ink: #3d2910;
    --night: #14120f;
    --cream: #f3ecdf;
    --danger: #9f1239;
    --sans: system-ui, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.site,
body.gate,
body.app {
    margin: 0;
    min-height: 100dvh;
    color: var(--ink);
    background: var(--paper);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.5;
}

a { color: inherit; }

img { max-width: 100%; }

.wrap {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}

.nav {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    height: 72px;
    background: rgba(246, 243, 238, 0.9);
    border-bottom: 1px solid transparent;
    backdrop-filter: blur(14px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    font-weight: 650;
    letter-spacing: -0.03em;
}

.brand img { height: 28px; width: auto; }

.nav-cta {
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 620;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--night);
    color: var(--cream);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 48px;
    align-items: end;
    padding: 64px 0 28px;
}

.eyebrow {
    margin: 0 0 14px;
    font-size: 0.78rem;
    font-weight: 680;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sand-ink);
}

h1, h2, p { margin: 0; }

h1, h2 {
    font-weight: 650;
    letter-spacing: -0.02em;
}

.hero h1 {
    font-size: clamp(2.3rem, 4vw, 3.3rem);
    line-height: 1.08;
}

.lede {
    max-width: 38rem;
    margin-top: 22px;
    font-size: 1.12rem;
    color: var(--muted);
}

.metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 36px 0 0;
    padding: 0;
    list-style: none;
}

.metrics li {
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.metrics strong {
    display: block;
    font-size: 1.15rem;
    font-weight: 650;
}

.metrics span {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.92rem;
}

.panel {
    padding: 28px 26px 26px;
    border-radius: 28px;
    background:
        radial-gradient(420px 180px at 100% 0%, rgba(201, 132, 42, 0.35), transparent 70%),
        var(--night);
    color: var(--cream);
    box-shadow: 0 24px 60px rgba(20, 18, 15, 0.16);
}

.panel h2 {
    font-size: 1.45rem;
    line-height: 1.2;
}

.panel .note {
    margin-top: 8px;
    color: rgba(243, 236, 223, 0.72);
}

.panel form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 22px;
}

.panel label,
.field label,
.adder label {
    font-size: 0.75rem;
    font-weight: 680;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.panel input,
.field input,
.adder input {
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 14px;
    padding: 0 14px;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.panel button,
.adder button[type="submit"],
.field button {
    height: 52px;
    margin-top: 6px;
    border: 0;
    border-radius: 14px;
    background: var(--sand);
    color: var(--sand-ink);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.panel button:hover,
.adder button[type="submit"]:hover { filter: brightness(1.05); }

.sd-error { color: #ffb4c4; font-weight: 650; }

.access {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.access li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(243, 236, 223, 0.16);
}

.access a { color: #fff; }

.rail {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
    margin: 18px auto 72px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.rail article h2 {
    margin: 28px 0 8px;
    font-size: 1.15rem;
    letter-spacing: -0.03em;
}

.rail p { color: var(--muted); }

.idx {
    font-size: 0.85rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    color: var(--sand);
}

body.gate {
    display: grid;
    place-items: center;
    padding: 32px 16px;
    background:
        radial-gradient(700px 320px at 50% -10%, rgba(201, 132, 42, 0.28), transparent 60%),
        var(--night);
    color: var(--cream);
}

.gate-card {
    width: min(440px, 100%);
    padding: 32px 28px;
    border-radius: 28px;
    background: var(--card);
    color: var(--ink);
}

.gate-card .brand { margin-bottom: 28px; }

.gate-card h1 {
    font-size: 1.8rem;
    line-height: 1.15;
}

.gate-card h1 span {
    display: block;
    margin-top: 4px;
}

.gate-card .until {
    margin-top: 8px;
    color: var(--muted);
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 18px;
}

.field .sd-error { color: var(--danger); }

.appbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 72px;
    padding: 12px 0;
    background: rgba(246, 243, 238, 0.92);
    backdrop-filter: blur(14px);
}

.appbar .who { text-decoration: none; }

.appbar .who strong {
    display: block;
    letter-spacing: -0.03em;
}

.appbar .who span {
    color: var(--muted);
    font-size: 0.85rem;
}

.appnav {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.appnav a {
    text-decoration: none;
    font-weight: 620;
    font-size: 0.95rem;
}

.appnav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--sand); }

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 36px;
    align-items: start;
    padding: 28px 0 72px;
}

.workspace h1 {
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    line-height: 1.15;
}

.help {
    max-width: 40rem;
    margin-top: 14px;
    color: var(--muted);
}

.workspace .sd-error {
    margin-top: 14px;
    color: var(--danger);
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 22px 0 0;
    padding: 0;
    list-style: none;
}

.chips li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px 6px 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
}

.chips form { margin: 0; }

.chips button {
    border: 0;
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--paper);
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    cursor: pointer;
}

.chips button:hover { color: var(--danger); }

.adder {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
    margin-top: 18px;
}

.adder label { flex: 1 1 100%; }

.adder input { flex: 1 1 160px; width: auto; border: 1px solid var(--line); }

.adder button { padding: 0 18px; }

.preview h2 {
    font-size: 1rem;
    letter-spacing: -0.02em;
}

.preview .help { margin-top: 6px; font-size: 0.95rem; }

.device {
    width: min(300px, 100%);
    margin-top: 18px;
    padding: 12px;
    border-radius: 36px;
    background: var(--night);
    box-shadow: 0 20px 50px rgba(20, 18, 15, 0.18);
}

.device-screen {
    padding: 22px 16px 16px;
    border-radius: 26px;
    background: #eef1f3;
    color: var(--ink);
}

.device-screen p { margin: 0; }

.device-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #66707a;
}

.device-title {
    margin-top: 4px !important;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.fake-input,
.fake-start,
.device-times span {
    border-radius: 12px;
}

.fake-input {
    margin-top: 8px;
    padding: 12px;
    background: #fff;
    color: #8b949c;
}

.device-times {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.device-times span {
    padding: 10px 12px;
    background: #fff;
    font-weight: 700;
}

.fake-start {
    margin-top: 14px;
    padding: 12px;
    text-align: center;
    background: #111;
    color: #fff;
    font-weight: 700;
}

.sheet {
    padding-bottom: 64px;
}

.sheet h1 {
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    line-height: 1.15;
}

.table-wrap {
    margin-top: 22px;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 14px 16px;
    text-align: left;
    white-space: nowrap;
}

th {
    font-size: 0.75rem;
    font-weight: 680;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
}

td { border-top: 1px solid var(--line); }

.empty {
    margin-top: 18px;
    color: var(--muted);
}

@media (max-width: 900px) {
    .hero,
    .workspace,
    .rail { grid-template-columns: 1fr; }
    .hero { padding-top: 36px; }
    .metrics { grid-template-columns: 1fr; }
    .appbar { align-items: flex-start; flex-direction: column; }
    .rail { margin-bottom: 48px; }
}
