:root {
  --bg: #fbfbfa;
  --surface: #ffffff;
  --sunk: #f4f4f2;
  --line: #e6e6e3;
  --text: #16171a;
  --text2: #63656b;
  --text3: #9a9ba1;
  --accent: #5457e6;
  --accent-soft: rgba(84, 87, 230, 0.12);
  --live: #1e9e54;
  --live-soft: rgba(30, 158, 84, 0.1);
  --danger: #c0492f;
  --danger-soft: rgba(192, 73, 47, 0.1);
  --card-shadow: 0 1px 2px rgba(20, 20, 30, 0.06);
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

main {
  width: 100%;
  max-width: 26rem;
}

/* The signed-in layout: a column of cards under the navigation, top aligned,
   because from here the account is several areas rather than one decision. */
body.wide {
  display: block;
  padding: 40px 20px 64px;
}

body.wide main {
  max-width: 46rem;
  margin: 0 auto;
}

.chrome {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.chrome .mark { margin: 0; }
.chrome form { margin-left: auto; }

nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

nav a {
  padding: 5px 10px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
}

nav a:hover {
  background: var(--sunk);
  text-decoration: none;
}

nav a.here {
  background: var(--accent-soft);
  color: var(--accent);
}

body.wide h1 { margin: 0 0 6px; }
body.wide .lede { margin-bottom: 24px; }

body.wide .card { margin-bottom: 20px; }
body.wide .card:last-of-type { margin-bottom: 0; }

h2 {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 600;
}

section p { margin: 0 0 12px; }
section p:last-child { margin-bottom: 0; }

section ul {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--text2);
}

section li { margin-bottom: 8px; }

/* An action inside a card sits with its label rather than spanning the card. */
section button, .switcher button {
  width: auto;
  margin-top: 0;
}

button.small {
  padding: 6px 12px;
  font-size: 13px;
}

.switcher {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  margin-bottom: 20px;
}

.switcher label { margin-bottom: 0; }

select {
  display: block;
  margin-top: 6px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

select:focus-visible {
  outline: 2px solid var(--accent);
  border-color: transparent;
}

label.check {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  align-items: center;
}

label.check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

label.check span { color: var(--text); }
label.check .hint { grid-column: 2; margin-top: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  padding: 0 12px 8px 0;
  text-align: left;
  font-weight: 500;
  color: var(--text3);
  border-bottom: 1px solid var(--line);
}

td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tr:last-child td { border-bottom: 0; }
tr.here td { background: var(--accent-soft); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--sunk);
  color: var(--text2);
  font-size: 12px;
  font-weight: 500;
}

.tag.owner { background: var(--accent-soft); color: var(--accent); }
.tag.admin { background: var(--live-soft); color: var(--live); }

.deep-link {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.deep-link code, code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--sunk);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text2);
}

/* The code a waiting device is showing. Big, spaced, and unmistakable: the
   whole safety of the approval is that a person can compare it with the screen
   in front of them. */
.device-code {
  margin: 4px 0 20px;
  text-align: center;
}

.device-code code {
  display: inline-block;
  padding: 10px 18px;
  font-size: 26px;
  letter-spacing: 0.18em;
  color: var(--text);
}

.mark {
  display: block;
  margin: 0 0 28px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text3);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--card-shadow);
  padding: 32px;
}

h1 {
  margin: 0 0 6px;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.lede {
  margin: 0 0 24px;
  color: var(--text2);
}

/* The prototype's two-mode toggle. Two links styled as one control, because on
   this surface the modes are two routes rather than two states of one screen —
   the pill marks which page you are on, not which button was last pressed. */
.modes {
  display: flex;
  gap: 4px;
  margin: 0 0 22px;
  padding: 4px;
  border-radius: 10px;
  background: var(--sunk);
}

.modes a {
  flex: 1;
  padding: 7px 10px;
  border-radius: 7px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
}

.modes a:hover {
  color: var(--text);
  text-decoration: none;
}

.modes a.here {
  background: var(--surface);
  box-shadow: var(--card-shadow);
  color: var(--text);
}

form { margin: 0; }

/* The call to action, while the browser would refuse the post anyway.
   Presentation only: the button stays pressable, and pressing it is what makes
   the browser say which field it is unhappy about. A disabled button here would
   be a control that neither works nor explains itself. */
form.gated:has(:invalid) button[type="submit"] {
  background: var(--sunk);
  color: var(--text3);
}

label {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
}

input {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

/* One ring, not two: an outline plus a recoloured border reads as a doubled
   box on the field the page autofocuses. */
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}

.hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 400;
  color: var(--text3);
}

button {
  width: 100%;
  margin-top: 8px;
  padding: 11px 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 550;
  cursor: pointer;
}

button:hover { filter: brightness(1.08); }

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button.quiet {
  background: var(--sunk);
  border: 1px solid var(--line);
  color: var(--text);
}

.note {
  margin: 0 0 20px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.note.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.note.good {
  background: var(--live-soft);
  color: var(--live);
}

.note.plain {
  background: var(--sunk);
  color: var(--text2);
}

.rule {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--text2);
}

.rule p { margin: 0 0 8px; }
.rule p:last-child { margin-bottom: 0; }

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover { text-decoration: underline; }

dl {
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 20px;
  font-size: 14px;
}

dt { color: var(--text3); }
dd { margin: 0; font-family: var(--mono); font-size: 13px; word-break: break-all; }

footer {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text3);
  text-align: center;
}

.billing-current {
  display: grid;
  gap: 16px;
}

.billing-plan-name {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 600;
}

.billing-seats {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.billing-price {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 600;
}

.billing-upgrade fieldset.period {
  border: 0;
  margin: 0 0 12px;
  padding: 0;
}

.billing-upgrade fieldset.period legend {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text2);
}

.billing-upgrade label.check input[type="radio"] {
  width: auto;
  margin: 3px 0 0;
}

ul.plan-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}

ul.plan-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

ul.plan-list li:first-child { border-top: 0; padding-top: 0; }

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --surface: #17181c;
    --sunk: #1e1f24;
    --line: #2a2b31;
    --text: #f2f2f0;
    --text2: #a6a7ad;
    --text3: #74757c;
    --accent: #8b8dff;
    --live: #46c97f;
    --danger: #f08a6c;
    color-scheme: dark;
  }
  button { color: #101114; }
}
