:root {
  color-scheme: dark;

  /* color */
  --frame: #B8C6D0;
  --bg: #000000;
  --surface: #0C0D0F;
  --surface-raised: #121418;
  --navy: #1F2535;
  --navy-hover: #2A3145;
  --line: rgba(255, 255, 255, 0.08);
  --text: #FFFFFF;
  --text-soft: rgba(255, 255, 255, 0.80);
  --text-muted: #7C828D;
  --text-faint: #4B5058;
  --on-light: #0A0A0A;

  /* color inside product screens only */
  --ok: #22C55E;
  --warn: #F59E0B;
  --info: #5B8DEF;
  --violet: #8B5CF6;
  --star: #FBBF24;

  /* type */
  --font: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, sans-serif;

  /* shape */
  --radius: 2px;
  --radius-md: 4px;
  --radius-pill: 999px;

  /* space */
  --gutter: 16px;
  --card-pad: 32px;
  --section-y: 160px;
  --container: 1280px;
  --container-pad: 80px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}

/* The page is black, one column. Its parts are the header, the panel and the footer. */
.sheet {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
}

/* Header: the word mark on the left, and the Sign out button on the right for a signed-in page. */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 24px var(--gutter);
}

.wordmark {
  color: var(--text);
  font-size: 22px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.top-actions {
  display: grid;
  justify-items: end;
  gap: 4px;
  margin-left: auto;
}

.top .status {
  min-height: 0;
  text-align: right;
}

/* The main part: the panel, centred in the space between the header and the footer. */
.page {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 24px var(--gutter) 48px;
}

.panel {
  display: grid;
  gap: var(--gutter);
  width: 100%;
  max-width: 440px;
  min-width: 0;
  padding: var(--card-pad);
  background: var(--surface);
  border-radius: var(--radius);
}

/* Footer: the site's pages in a row that wraps, then the company line. */
.foot {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding: 32px var(--gutter) 40px;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.foot-links a {
  color: var(--text-soft);
  text-decoration: none;
}

.foot-links a:hover {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.foot-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Type. Headings are light and tight. Body copy is the soft white or the muted grey of DESIGN.md. */
h1 {
  margin: 0;
  font-size: 32px;
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.lead {
  margin: 0;
  color: var(--text-soft);
}

.note {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

.warning {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.code {
  margin: 0;
  font-size: clamp(32px, 10vw, 40px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.price {
  margin: 0;
  font-size: 48px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.04em;
}

.unit {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
}

.status {
  min-height: 24px;
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
}

time {
  white-space: nowrap;
}

/* Links are white with a thin underline. The buttons are the only coloured controls. */
a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--text-soft);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* One focus ring for every control, the same as the site. */
:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 3px;
}

/* Chips. The active state is the navy of DESIGN.md. Refunded and disputed are quieter. */
.chip {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.10);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  text-transform: uppercase;
}

.chip[data-state="active"] {
  background: var(--navy);
  color: var(--text);
}

.chip[data-state="refunded"] {
  background: var(--surface-raised);
  color: var(--text-soft);
}

.chip[data-state="disputed"] {
  color: var(--text-soft);
}

/* Buttons. Primary is navy, secondary is white. Hover changes the fill only. Disabled keeps the shape and dims it. */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 24px;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s;
}

.button.primary {
  background: var(--navy);
  color: var(--text);
}

.button.primary:not(:disabled):hover {
  background: var(--navy-hover);
}

.button.secondary {
  background: var(--text);
  color: var(--on-light);
}

.button.secondary:not(:disabled):hover {
  background: var(--text-soft);
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

@media (prefers-reduced-motion: reduce) {
  .button {
    transition: none;
  }
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.actions .button {
  flex: 1 1 140px;
}

/* Layout helpers. */
.stack {
  display: grid;
  gap: var(--gutter);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
}

/* Form fields. The input is 16px, so a phone does not zoom in on it. */
.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field > span {
  color: var(--text-soft);
  font-size: 14px;
  letter-spacing: -0.01em;
}

.field input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface-raised);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

/* List rows: a hairline between rows, and the text and the button side by side or wrapped. */
.list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--gutter);
  padding: 16px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

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

.device {
  display: grid;
  flex: 1 1 160px;
  gap: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* The heading is larger from 600px. */
@media (min-width: 600px) {
  h1 {
    font-size: 40px;
  }
}

/* From 768px a pale frame shows around the black page, as in DESIGN.md. */
@media (min-width: 768px) {
  body {
    padding: 24px 24px 0;
    background: var(--frame);
  }

  .sheet {
    min-height: calc(100vh - 24px);
    min-height: calc(100dvh - 24px);
  }

  .top,
  .page,
  .foot {
    padding-inline: var(--card-pad);
  }
}
