/* The account site's look: the app's own tokens (its typeface, palettes,
   radii, field and button sizes) and the parts of its components the site
   uses, copied from the app's styles (tokens.css, base.css, components.css,
   signin.css), with the dark palette following the system's choice. */

@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/albert-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --bg: #fbfaf8;
  --paper: #ffffff;
  --ink: #1b1a18;
  --ink-soft: #43403a;
  --muted: #6b675f;
  --faint: #8e8a82;
  --line: #ebe9e4;
  --green: #166f6b;
  --green-dark: #125a57;
  --green-bg: #e6f1ef;
  --amber: #8b6022;
  --amber-bg: #f8f0de;
  --red: #9b3b25;
  --red-bg: #f8e8e2;
  --on-accent: #ffffff;
  --hover-tint: #1b1a180a;
  --raised: #f0efeb;
  --raised-line: #dfdcd5;
  --field-inset: #ffffff;
  --field-line: #dfdcd5;
  --button-tint: #1b1a180f;
  --button-tint-hover: #1b1a181a;
  --sans: "Albert Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --field-height: 44px;
  --field-pad-y: 10px;
  --field-font: 16px;
  --radius-card: 12px;
  --radius-control: 10px;
  --row-inset: 16px;
  --row-height: 52px;
  --control-height: var(--field-height);
  --control-pad-x: 16px;
  --control-pad-x-small: 12px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #18181a;
    --paper: #222225;
    --ink: #ededef;
    --ink-soft: #c8c8cb;
    --muted: #a2a2a6;
    --faint: #8a8a8e;
    --line: #2c2c2f;
    --green: #63b8b0;
    --green-dark: #7bc9c1;
    --green-bg: #2b3738;
    --amber: #e4b96f;
    --amber-bg: #3d372f;
    --red: #ef927c;
    --red-bg: #3f3231;
    --on-accent: #131315;
    --hover-tint: #ffffff0c;
    --raised: #313136;
    --raised-line: #414147;
    --field-inset: #232326;
    --field-line: transparent;
    --button-tint: #ffffff17;
    --button-tint-hover: #ffffff24;
    color-scheme: dark;
  }
}

/* Under a fine pointer, a desk's sizes in proportion to the 14px text. */
@media (hover: hover) and (pointer: fine) {
  :root {
    --field-height: 34px;
    --field-pad-y: 6px;
    --field-font: 14px;
    --control-pad-x: 12px;
    --control-pad-x-small: 10px;
  }
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.5;
}
a, button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
a { color: var(--green); }
a:focus-visible, button:focus-visible, h1:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
h1:focus { outline: none; }
code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--button-tint);
  font-family: var(--mono);
  font-size: 0.92em;
}

/* Buttons: a secondary action's tint, a form's one main action in the
   accent, a destructive confirm in red, and a link-styled one. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--control-height);
  padding: 0 var(--control-pad-x);
  border: 0;
  border-radius: var(--radius-control);
  background: var(--button-tint);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.button:hover { background: var(--button-tint-hover); }
.button:disabled,
.button:disabled:hover {
  background: var(--button-tint);
  color: var(--faint);
  filter: none;
  cursor: default;
}
.button-small { padding: 0 var(--control-pad-x-small); font-size: 13px; }
.button-primary { background: var(--green); color: var(--on-accent); }
.button-primary:hover { background: var(--green-dark); }
.button-danger { background: var(--red); color: var(--on-accent); }
.button-danger:hover { background: var(--red); filter: brightness(0.92); }
.button-wide { width: 100%; min-height: 44px; }
.link-button {
  min-height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--green);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.link-button:hover { text-decoration: underline; }
.link-button:disabled { color: var(--faint); cursor: default; text-decoration: none; }

/* Fields */
.form { display: grid; gap: 16px; }
.form-field { display: grid; gap: 6px; }
.form-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.form-input {
  width: 100%;
  min-width: 0;
  min-height: var(--field-height);
  padding: var(--field-pad-y) calc(var(--row-inset) - 1px);
  border: 1px solid var(--field-line);
  border-radius: var(--radius-control);
  background: var(--raised);
  color: var(--ink);
  font: inherit;
  font-size: var(--field-font);
  line-height: 1.4;
}
.form-input:focus { outline: none; }
.form-input:focus-visible { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.form-input-code {
  min-height: 52px;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-align: center;
}
.form-note { margin: 0; color: var(--muted); }
.form-reason { margin: 0; color: var(--red); text-wrap: pretty; }
.form-reason.is-quiet { color: var(--muted); }

/* The page */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 640px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
}
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
}
.site-brand img { border-radius: 8px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  color: var(--muted);
  font-weight: 500;
  text-decoration: none;
}
.site-nav a:hover { background: var(--hover-tint); color: var(--ink); }
.site-nav a[aria-current="page"] { background: var(--button-tint); color: var(--ink); }
.site-main {
  display: grid;
  gap: 24px;
  max-width: 640px;
  margin: 0 auto;
  padding: 32px max(16px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.site-main > section { display: grid; gap: 24px; min-width: 0; }
.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.2;
}
.page-lede { margin: -12px 0 0; color: var(--muted); font-size: 15px; text-wrap: pretty; }
.page-lede strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

/* The sign-in page: one centered column, as the app's sign-in screen. */
.signin {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.signin-column { display: grid; gap: 24px; width: 100%; max-width: 360px; }
.signin-column > section { display: grid; gap: 20px; }
.signin-head { display: grid; gap: 8px; }
.signin-icon { border-radius: 16px; }
.signin-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 13px;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--raised-line); }
.button-google svg { flex: none; }

/* A card of rows, the app's grouped list: a row is its title over one
   muted line of state, with one action at the right. */
.card-block { display: grid; gap: 6px; min-width: 0; }
.card-heading { margin: 0; padding: 0 var(--row-inset); color: var(--muted); font-size: 13px; font-weight: 500; }
.card-foot { margin: 0 var(--row-inset); color: var(--muted); font-size: 13px; text-wrap: pretty; }
.card {
  margin: 0;
  padding: 0;
  list-style: none;
  border-radius: var(--radius-card);
  background: var(--raised);
  overflow: hidden;
}
.card > :not([hidden]) ~ :not([hidden]) {
  background-image: linear-gradient(var(--raised-line), var(--raised-line));
  background-position: var(--row-inset) 0;
  background-size: calc(100% - 2 * var(--row-inset)) 1px;
  background-repeat: no-repeat;
}
.card-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  min-height: var(--row-height);
  padding: 12px var(--row-inset);
}
.card-main { display: grid; flex: 1 1 0; gap: 3px; min-width: 0; }
.card-title { font-weight: 500; overflow-wrap: anywhere; }
.card-state { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; overflow-wrap: anywhere; }
.card-state.is-bad { color: var(--red); }
.card-fact { display: grid; gap: 3px; margin: 0; padding: 12px var(--row-inset); }
.card-fact dt { color: var(--muted); font-size: 13px; }
.card-fact dd { margin: 0; overflow-wrap: anywhere; }
.card-button {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--row-height);
  padding: 0 var(--row-inset);
  border: 0;
  background-color: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.card-button:hover:not(:disabled) { background-color: var(--hover-tint); }
.card-button:disabled { color: var(--faint); cursor: default; }
.card-button.is-danger:not(:disabled) { color: var(--red); }

/* A state with its dot: green when the computer answers, red when not, a
   ring while the page checks. */
.dot-state { display: flex; align-items: flex-start; gap: 8px; }
.dot-state::before {
  content: "";
  flex: none;
  margin-top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
}
.dot-state[data-state="yes"]::before { background: var(--green); }
.dot-state[data-state="no"]::before { background: var(--red); }

/* The inline confirm under a destructive row, the app's shape. */
.confirm {
  display: grid;
  gap: 10px;
  padding: 12px var(--row-inset);
  border-radius: var(--radius-control);
  background: var(--amber-bg);
  color: var(--amber);
}
.confirm p { margin: 0; overflow-wrap: anywhere; text-wrap: pretty; }
.confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* A notice at the top of a page: what just happened. */
.notice {
  margin: 0;
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--green-bg);
  color: var(--ink);
  text-wrap: pretty;
}

/* The address being chosen. */
.address {
  display: grid;
  gap: 16px;
  padding: 24px var(--row-inset);
  border-radius: var(--radius-card);
  background: var(--raised);
}
.address-name {
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.address-name span { color: var(--muted); font-weight: 500; }
.address-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.address.is-busy .address-name { opacity: 0.45; transition: opacity 120ms ease; }

/* The install command. */
.command {
  display: grid;
  gap: 12px;
  padding: 16px var(--row-inset);
  border-radius: var(--radius-card);
  background: var(--raised);
}
.command-text {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--field-line);
  border-radius: var(--radius-control);
  background: var(--field-inset);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  user-select: all;
  -webkit-user-select: all;
}
.command-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.command-actions .button-primary { min-width: 88px; }

/* What the page is waiting for, with its spinner. */
.waiting {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}
.spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--raised-line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner { animation: none; border-top-color: var(--raised-line); border-right-color: var(--green); }
  .address.is-busy .address-name { transition: none; }
}
.expired {
  display: grid;
  gap: 12px;
  padding: 16px var(--row-inset);
  border-radius: var(--radius-card);
  background: var(--amber-bg);
  color: var(--amber);
}
.expired p { margin: 0; text-wrap: pretty; overflow-wrap: anywhere; }
.expired strong { font-weight: 600; }
.expired code { background: var(--hover-tint); color: inherit; }
.expired .button { justify-self: start; }

@media (max-width: 479.98px) {
  .site-main { padding-top: 24px; }
  .page-title { font-size: 26px; }
  .address-name { font-size: 22px; }
  .address-actions .button { flex: 1 1 0; }
}
