:root {
  color-scheme: light dark;
  --paper: #f6f4ee;
  --surface: #fffdf8;
  --ink: #16181d;
  --muted: #666a72;
  --line: #e1ded4;
  --accent: #0e5a5e;
  --on-accent: #fbfaf6;
  --danger: #9c2f2b;
  --live: #1d6b4c;
  --field: rgba(14, 90, 94, 0.2);
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "Cascadia Mono", ui-monospace, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101316;
    --surface: #171b1f;
    --ink: #ecebe5;
    --muted: #979ba1;
    --line: #2a2f35;
    --accent: #5fb3b3;
    --on-accent: #0d1214;
    --danger: #e08a84;
    --live: #6fc39b;
    --field: rgba(95, 179, 179, 0.2);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

/* Landing */

.landing { min-height: 100vh; display: grid; place-items: center; overflow: hidden; }

#field { position: fixed; inset: 0; width: 100%; height: 100%; }

.landing-main {
  position: relative;
  padding: 44px 56px 40px;
  text-align: center;
  background: radial-gradient(closest-side, var(--paper) 62%, transparent);
}

.landing-title {
  margin: 0;
  font: 400 clamp(52px, 11vw, 92px)/1.02 var(--serif);
  letter-spacing: -0.015em;
}

.landing-line { margin: 16px 0 28px; color: var(--muted); font-size: 17px; }

.landing-nav { display: flex; justify-content: center; gap: 28px; }

.landing-link {
  display: inline-block;
  padding: 8px 2px 5px;
  border-bottom: 1px solid var(--accent);
  font-size: 15px;
  text-decoration: none;
}

/* Console */

.console { max-width: 1060px; margin: 0 auto; padding: 0 16px 72px; }

.console-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 32px 0 20px;
  border-bottom: 1px solid var(--line);
}

.wordmark { font: 400 26px/1 var(--serif); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }

.console-note { color: var(--muted); font-size: 13px; }

.section { margin-top: 44px; }

.section-title { margin: 0 0 14px; font: 400 23px/1.2 var(--serif); }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow-x: auto; }

.empty { margin: 0; padding: 22px 20px; color: var(--muted); }

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

th {
  padding: 11px 16px 9px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }

tr:last-child td { border-bottom: 0; }

.version { font: 500 15px/1.4 var(--mono); white-space: nowrap; }

.notes { min-width: 220px; }

.nowrap { white-space: nowrap; }

.quiet { color: var(--muted); }

.mono { font-family: var(--mono); font-size: 13px; }

.state { white-space: nowrap; }
.state.live { color: var(--live); }
.state.off { color: var(--danger); }

/* Controls */

button, select, input {
  font: inherit;
  color: inherit;
}

select, input[type="text"], input[type="number"] {
  min-height: 34px;
  padding: 5px 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

input[type="number"] { width: 76px; }

select:focus-visible, input:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button {
  min-height: 34px;
  padding: 5px 13px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}

button:hover { border-color: var(--accent); }
button:disabled { opacity: 0.5; cursor: default; }

button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

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

.rollout { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 330px; }

.install-picks { flex-basis: 100%; display: grid; gap: 4px; padding: 6px 0 2px; }
.install-picks label { display: flex; align-items: center; gap: 8px; }

.license-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.license-form input[type="text"] { flex: 1 1 200px; }
.editing .license-form { padding: 2px 0; border-bottom: 0; }

.field { display: grid; gap: 3px; color: var(--muted); font-size: 12px; }
.field input { color: var(--ink); font-size: 15px; }

input[type="date"] {
  min-height: 34px;
  padding: 5px 9px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }

.installer { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; padding: 14px 16px; }

.fingerprint { overflow-wrap: anywhere; }

/* Download */

.download { max-width: 560px; margin: 0 auto; padding-top: 72px; }
.download-title { margin: 0 0 8px; font: 400 40px/1.1 var(--serif); letter-spacing: -0.01em; }
.download-form { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 16px; }
.download-form input { flex: 1 1 240px; font-family: var(--mono); letter-spacing: 0.04em; text-transform: uppercase; }
.download-error { color: var(--danger); }
.steps { margin: 18px 0; padding-left: 20px; }
.steps li { margin-bottom: 9px; }

.issued {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.issued-code { font: 500 18px/1.3 var(--mono); letter-spacing: 0.04em; }

details summary { cursor: pointer; }
details pre {
  margin: 10px 0 0;
  padding: 12px;
  background: var(--paper);
  border-radius: 6px;
  font: 12.5px/1.5 var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Sign-in */

.signin { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 18px; text-align: center; }
.signin-title { margin: 0; font: 400 34px/1.15 var(--serif); }

/* Google's button frame is light; a dark scheme here paints an opaque box behind it. */
#google-button { color-scheme: light; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 9px 15px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 7px;
}

@media (max-width: 720px) {
  table, tbody, tr, td { display: block; }
  thead { display: none; }
  tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  tr:last-child { border-bottom: 0; }
  td { padding: 4px 16px; border-bottom: 0; }
  .notes, .rollout { min-width: 0; }
}

[hidden] { display: none !important; }
