/*
 * Cinewide's tokens (docs/UI-AUDIT.md, 2.1): the one file the site, the extension and the
 * dashboard each take into their own build. Dark only; there is no light theme.
 *
 * A test reads this file and checks every pair of text and ground the components use
 * against WCAG AA (brand/brand.test.mjs). A colour is changed here and nowhere else.
 */
:root {
  color-scheme: dark;

  /* Colour */
  --cw-bg: #08090b;
  --cw-raised: #121418;
  /* Lines that only divide: never the only edge of a control. */
  --cw-line: #23262d;
  --cw-text: #f3efe6;
  /* Quieter text, and the edge of a field. */
  --cw-text-2: #9a9da6;
  /* The one accent, with black text on it. */
  --cw-accent: #ffb547;
  --cw-on-accent: #000000;
  /* Destructive actions only. */
  --cw-danger: #ff5f57;
  --cw-on-danger: #000000;
  /* The screen of a frame: the black of a picture's bars. */
  --cw-screen: #000000;

  /* Type */
  --cw-font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cw-display-width: 125;
  --cw-display-weight: 800;
  --cw-display-tracking: -0.02em;
  --cw-body-width: 100;
  --cw-body-weight: 400;
  --cw-strong-weight: 600;
  /* The scale, from small print to the first screen's line. */
  --cw-size-xs: 0.75rem;
  --cw-size-s: 0.875rem;
  --cw-size-m: 1rem;
  --cw-size-l: 1.25rem;
  --cw-size-xl: 1.75rem;
  --cw-size-2xl: clamp(2rem, 1.4rem + 2.4vw, 3rem);
  --cw-size-3xl: clamp(2.25rem, 1.2rem + 4.2vw, 4.5rem);
  --cw-leading: 1.5;
  --cw-leading-tight: 1.05;

  /* Space and shape */
  --cw-space-1: 0.25rem;
  --cw-space-2: 0.5rem;
  --cw-space-3: 0.75rem;
  --cw-space-4: 1rem;
  --cw-space-5: 1.5rem;
  --cw-space-6: 2rem;
  --cw-space-7: 3rem;
  --cw-space-8: 4.5rem;
  --cw-radius: 6px;
  --cw-radius-l: 10px;
  /* The corner marks: their arm and their stroke. */
  --cw-mark: 14px;
  --cw-mark-stroke: 2px;
  --cw-focus: 2px;

  /* Motion: exactly one, the bars sliding out. */
  --cw-motion: 600ms;
  --cw-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/*
 * The font and the type (docs/UI-AUDIT.md, 2.2). A build puts this after tokens.css, and
 * the font at fonts/archivo.woff2 beside the stylesheet it makes.
 */
@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo.woff2') format('woff2');
  font-weight: 400 800;
  font-stretch: 100% 125%;
  font-style: normal;
  font-display: swap;
}

html {
  background: var(--cw-bg);
  color: var(--cw-text);
  font-family: var(--cw-font);
  font-size: 100%;
  font-weight: var(--cw-body-weight);
  font-stretch: 100%;
  line-height: var(--cw-leading);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--cw-bg);
  /* Chrome gives a page of an extension its own font and size on the body: the brand's
     are set here, where they are not inherited past it. */
  font-family: var(--cw-font);
  font-size: 1rem;
}

/* Display: wide, heavy and tight. */
.cw-display {
  font-stretch: 125%;
  font-weight: var(--cw-display-weight);
  letter-spacing: var(--cw-display-tracking);
  line-height: var(--cw-leading-tight);
  text-wrap: balance;
}

strong,
b {
  font-weight: var(--cw-strong-weight);
}

/* Figures that line up: ratios, prices, dates. */
.cw-tabular {
  font-variant-numeric: tabular-nums;
}

a {
  color: var(--cw-accent);
  text-underline-offset: 0.18em;
}

/* Focus always shows: the accent, apart from what it rings. */
:focus-visible {
  outline: var(--cw-focus) solid var(--cw-accent);
  outline-offset: 2px;
}

::selection {
  background: var(--cw-accent);
  color: var(--cw-on-accent);
}

/* Read by a screen reader, and not drawn. */
.cw-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/*
 * Cinewide's components (docs/UI-AUDIT.md, 2.3 to 2.4): classes, so that the site's HTML,
 * the extension's DOM and the dashboard's React draw the same markup. A build puts this
 * after tokens.css and base.css. The markup each expects is written above it.
 */

/* ---- The gate ---------------------------------------------------------------------------
 *
 * A 21:9 screen, a picture on it, and the bars around the picture, which slide away.
 *
 *   <figure class="cw-gate cw-gate--opens">
 *     <div class="cw-gate__screen">
 *       <img class="cw-gate__picture" src="…" alt="" />
 *       <span class="cw-gate__bar cw-gate__bar--top"></span>   (and --bottom, --left, --right)
 *     </div>
 *     <span class="cw-ratio cw-gate__label">
 *       <span class="cw-ratio__from">16 : 9</span><span class="cw-ratio__to">2.39 : 1</span>
 *     </span>
 *   </figure>
 *
 * Drawn after: the picture as the screen shows it once Smart has run, and the bars gone.
 * Before: `data-state="before"` on the gate, or a `.cw-gate-switch` checkbox before it that
 * is not checked. `cw-gate--opens` plays the one motion as the page loads.
 *
 * The numbers are of the page's own example, worked out from the engine's (`fit.ts`): a
 * 2.39 : 1 film inside a 16:9 video, on a 21:9 screen. After, the picture is as wide as the
 * screen, 21 / 2.39 / 9 = 97.6 % of its height. Before, it is as wide as the 16:9 video,
 * 16 / 21 = 76.2 % of the screen; the side bars are the rest of the width, and the bars
 * above and below the rest of the height, (100 - 97.6 × 0.762) / 2 = 12.8 %.
 */
.cw-gate {
  --cw-picture-w: 100%;
  --cw-picture-h: 97.63%;
  --cw-from: 0.7619;
  --cw-bar-x: 11.905%;
  --cw-bar-y: 12.81%;
  --cw-gate-delay: 500ms;
  position: relative;
  margin: 0;
}

.cw-gate__screen {
  position: relative;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--cw-screen);
  border-radius: 2px;
}

.cw-gate__picture {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--cw-picture-w);
  height: var(--cw-picture-h);
  object-fit: cover;
  display: block;
  transform: translate(-50%, -50%);
  transition: transform var(--cw-motion) var(--cw-ease-out);
}

/* A bar: black, with one edge of light on the side of the picture. */
.cw-gate__bar {
  position: absolute;
  background: var(--cw-screen);
  transition: transform var(--cw-motion) var(--cw-ease-out);
}

.cw-gate__bar--top,
.cw-gate__bar--bottom {
  left: 0;
  right: 0;
  height: var(--cw-bar-y);
}

.cw-gate__bar--left,
.cw-gate__bar--right {
  top: 0;
  bottom: 0;
  width: var(--cw-bar-x);
}

.cw-gate__bar--top {
  top: 0;
  box-shadow: inset 0 -1px 0 var(--cw-line);
  transform: translateY(-100%);
}

.cw-gate__bar--bottom {
  bottom: 0;
  box-shadow: inset 0 1px 0 var(--cw-line);
  transform: translateY(100%);
}

.cw-gate__bar--left {
  left: 0;
  box-shadow: inset -1px 0 0 var(--cw-line);
  transform: translateX(-100%);
}

.cw-gate__bar--right {
  right: 0;
  box-shadow: inset 1px 0 0 var(--cw-line);
  transform: translateX(100%);
}

.cw-gate__label {
  position: absolute;
  top: var(--cw-space-3);
  right: var(--cw-space-3);
}

/* Before: the picture as small as it was, and the bars in place. */
.cw-gate[data-state='before'] .cw-gate__picture,
.cw-gate-switch:not(:checked) ~ .cw-gate .cw-gate__picture {
  transform: translate(-50%, -50%) scale(var(--cw-from));
}

.cw-gate[data-state='before'] .cw-gate__bar,
.cw-gate-switch:not(:checked) ~ .cw-gate .cw-gate__bar {
  transform: none;
}

.cw-gate[data-state='before'] .cw-ratio__from,
.cw-gate-switch:not(:checked) ~ .cw-gate .cw-ratio__from {
  opacity: 1;
}

.cw-gate[data-state='before'] .cw-ratio__to,
.cw-gate-switch:not(:checked) ~ .cw-gate .cw-ratio__to {
  opacity: 0;
}

/* The one motion, as the page loads: from before to after. */
@keyframes cw-gate-picture {
  from {
    transform: translate(-50%, -50%) scale(var(--cw-from));
  }
}

@keyframes cw-gate-bar {
  from {
    transform: none;
  }
}

/* The label holds its first words until the bars are gone, then changes: no motion. */
@keyframes cw-gate-hold-shown {
  from,
  to {
    opacity: 1;
  }
}

@keyframes cw-gate-hold-hidden {
  from,
  to {
    opacity: 0;
  }
}

.cw-gate--opens .cw-gate__picture {
  animation: cw-gate-picture var(--cw-motion) var(--cw-ease-out) var(--cw-gate-delay) backwards;
}

.cw-gate--opens .cw-gate__bar {
  animation: cw-gate-bar var(--cw-motion) var(--cw-ease-out) var(--cw-gate-delay) backwards;
}

.cw-gate--opens .cw-ratio__from {
  animation: cw-gate-hold-shown calc(var(--cw-gate-delay) + var(--cw-motion)) step-end backwards;
}

.cw-gate--opens .cw-ratio__to {
  animation: cw-gate-hold-hidden calc(var(--cw-gate-delay) + var(--cw-motion)) step-end backwards;
}

/* ---- The ratio label ------------------------------------------------------------------
 *
 *   <span class="cw-ratio">2.39 : 1</span>
 *   <span class="cw-ratio"><span class="cw-ratio__from">16 : 9</span><span class="cw-ratio__to">2.39 : 1</span></span>
 */
.cw-ratio {
  display: inline-grid;
  align-items: center;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  background: var(--cw-bg);
  color: var(--cw-text);
  font-size: var(--cw-size-s);
  font-stretch: 125%;
  font-weight: var(--cw-strong-weight);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  line-height: 1.3;
  white-space: nowrap;
}

.cw-ratio__from,
.cw-ratio__to {
  grid-area: 1 / 1;
  transition: opacity 0s linear var(--cw-motion);
}

.cw-ratio__from {
  opacity: 0;
}

/* ---- Corner marks ---------------------------------------------------------------------
 *
 * The two corners of the icon, in the accent: on a gate, or on any box with `cw-corners`.
 */
.cw-corners,
.cw-gate {
  position: relative;
}

.cw-corners::before,
.cw-corners::after,
.cw-gate::before,
.cw-gate::after {
  content: '';
  position: absolute;
  z-index: 1;
  width: var(--cw-mark);
  height: var(--cw-mark);
  border: 0 solid var(--cw-accent);
  pointer-events: none;
}

.cw-corners::before,
.cw-gate::before {
  top: calc(-1 * var(--cw-mark-stroke) - 4px);
  left: calc(-1 * var(--cw-mark-stroke) - 4px);
  border-top-width: var(--cw-mark-stroke);
  border-left-width: var(--cw-mark-stroke);
}

.cw-corners::after,
.cw-gate::after {
  right: calc(-1 * var(--cw-mark-stroke) - 4px);
  bottom: calc(-1 * var(--cw-mark-stroke) - 4px);
  border-right-width: var(--cw-mark-stroke);
  border-bottom-width: var(--cw-mark-stroke);
}

/* ---- Keycaps --------------------------------------------------------------------------
 *
 *   <span class="cw-keys"><kbd class="cw-key">Alt</kbd><kbd class="cw-key">Shift</kbd><kbd class="cw-key">S</kbd></span>
 */
.cw-keys {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.25em;
  vertical-align: middle;
}

.cw-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.9em;
  padding: 0.15em 0.5em 0.2em;
  border: 1px solid var(--cw-line);
  border-bottom-width: 3px;
  border-radius: 5px;
  background: var(--cw-raised);
  color: var(--cw-text);
  font-family: var(--cw-font);
  font-size: 0.8em;
  font-weight: var(--cw-strong-weight);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

/* On an amber button the keycaps are drawn in black. */
.cw-button--primary .cw-key {
  border-color: rgb(0 0 0 / 0.55);
  background: transparent;
  color: var(--cw-on-accent);
}

/* ---- Buttons ----------------------------------------------------------------------------
 *
 *   <button class="cw-button cw-button--primary">…</button>   the one thing to press
 *   <button class="cw-button cw-button--secondary">…</button>
 *   <a class="cw-button cw-button--outline">…</a>          beside a primary action
 *   <button class="cw-button cw-button--danger">…</button>    destructive actions only
 *   <button class="cw-icon-button" aria-label="…"><svg …/></button>
 *   <div class="cw-segmented" role="group" aria-label="…">
 *     <button class="cw-segmented__item" aria-pressed="true">…</button> …
 *   </div>
 */
.cw-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--cw-space-2);
  min-height: 44px;
  padding: 0 var(--cw-space-5);
  border: 1px solid transparent;
  border-radius: var(--cw-radius);
  font: inherit;
  font-weight: var(--cw-strong-weight);
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

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

.cw-button--primary:hover {
  background: #ffc46e;
}

.cw-button--secondary {
  background: var(--cw-raised);
  border-color: var(--cw-line);
  color: var(--cw-text);
}

.cw-button--secondary:hover {
  border-color: var(--cw-text-2);
}

/* Beside a primary action: the same button, drawn by its edge alone. */
.cw-button--outline {
  background: transparent;
  border-color: var(--cw-text-2);
  color: var(--cw-text);
}

.cw-button--outline:hover {
  border-color: var(--cw-text);
}

.cw-button--danger {
  background: var(--cw-danger);
  color: var(--cw-on-danger);
}

/* The one large button: Smart. */
.cw-button--large {
  min-height: 56px;
  font-size: var(--cw-size-l);
  font-stretch: 125%;
  font-weight: var(--cw-display-weight);
  letter-spacing: var(--cw-display-tracking);
}

.cw-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.cw-icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: var(--cw-radius);
  background: transparent;
  color: var(--cw-text-2);
  cursor: pointer;
}

.cw-icon-button:hover {
  background: var(--cw-raised);
  color: var(--cw-text);
}

.cw-icon-button svg {
  width: 20px;
  height: 20px;
}

.cw-segmented {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: calc(var(--cw-radius) + 3px);
  background: var(--cw-raised);
}

.cw-segmented__item {
  flex: 1 1 0;
  min-height: 38px;
  padding: 0 var(--cw-space-4);
  border: 0;
  border-radius: var(--cw-radius);
  background: transparent;
  color: var(--cw-text-2);
  font: inherit;
  font-weight: var(--cw-strong-weight);
  cursor: pointer;
}

.cw-segmented__item:hover {
  color: var(--cw-text);
}

.cw-segmented__item[aria-pressed='true'] {
  background: var(--cw-line);
  color: var(--cw-text);
  box-shadow: inset 0 -2px 0 var(--cw-accent);
}

/* ---- The toast ------------------------------------------------------------------------
 *
 * What Cinewide says on the video, in one line, with the ratio where there is one.
 *
 *   <div class="cw-toast" role="status"><span class="cw-toast__mark"></span>Bars removed<span class="cw-ratio">2.39 : 1</span></div>
 */
.cw-toast {
  display: inline-flex;
  align-items: center;
  gap: var(--cw-space-3);
  padding: var(--cw-space-2) var(--cw-space-2) var(--cw-space-2) var(--cw-space-4);
  border-radius: var(--cw-radius-l);
  background: var(--cw-raised);
  color: var(--cw-text);
  font-size: var(--cw-size-s);
  font-weight: var(--cw-strong-weight);
  line-height: 1.3;
  box-shadow: 0 6px 24px rgb(0 0 0 / 0.5);
}

/* A corner of the icon, small, before the words. */
.cw-toast__mark {
  width: 10px;
  height: 10px;
  border-top: 2px solid var(--cw-accent);
  border-left: 2px solid var(--cw-accent);
  flex: none;
}

.cw-toast .cw-ratio {
  background: var(--cw-bg);
}

/* ---- The store's state: a label with an amber dot, not a button -------------------------- */
.cw-status {
  display: inline-flex;
  align-items: center;
  gap: var(--cw-space-2);
  color: var(--cw-text-2);
  font-size: var(--cw-size-s);
  font-weight: var(--cw-strong-weight);
}

.cw-status::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cw-accent);
  flex: none;
}

/* ---- No motion where the viewer asks for none: the after state shows ----------------- */
@media (prefers-reduced-motion: reduce) {
  .cw-gate *,
  .cw-ratio__from,
  .cw-ratio__to {
    animation: none !important;
    transition: none !important;
  }
}

/* The dashboard, in the round "The Gate" (docs/UI-AUDIT.md, U4). The build puts the brand's
   tokens, type and parts (brand/) before this file: what is here is the page's own layout,
   on those tokens. Dark only, as the brand is. */
* {
  box-sizing: border-box;
}

body {
  color: var(--cw-text);
  font-size: var(--cw-size-m);
}

/* The test build's banner (QA-LOG A4): only the test dashboard has it. */
.test-build {
  margin: 0;
  padding: var(--cw-space-2) var(--cw-space-5);
  background: var(--cw-accent);
  color: var(--cw-on-accent);
  font-weight: 600;
  text-align: center;
}

/* ---- The top bar: the name; who is signed in, signing out, the other language ---------- */
.top,
main {
  max-width: 760px;
  margin: 0 auto;
  padding-inline: var(--cw-space-5);
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--cw-space-3) var(--cw-space-5);
  padding-block: var(--cw-space-4);
  border-bottom: 1px solid var(--cw-line);
}

.name {
  display: inline-flex;
  align-items: center;
  gap: var(--cw-space-2);
  font-size: var(--cw-size-l);
  font-stretch: 125%;
  font-weight: var(--cw-display-weight);
  letter-spacing: var(--cw-display-tracking);
}

.name img {
  display: block;
  border-radius: 5px;
}

.top__end {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--cw-space-2) var(--cw-space-4);
  min-width: 0;
  font-size: var(--cw-size-s);
}

/* The address, whole: on a phone it takes a line of its own rather than lose its end. */
.who {
  min-width: 0;
  color: var(--cw-text-2);
  overflow-wrap: anywhere;
}

.top a,
.top button.link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

h1 {
  margin: var(--cw-space-6) 0 var(--cw-space-4);
  color: var(--cw-text-2);
  font-size: var(--cw-size-m);
  font-weight: var(--cw-strong-weight);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

p {
  margin: 0 0 var(--cw-space-3);
  overflow-wrap: anywhere;
}

.muted {
  color: var(--cw-text-2);
  font-size: var(--cw-size-s);
}

.problem {
  color: var(--cw-danger);
  font-size: var(--cw-size-s);
}

/* ---- The plan band: the plan, large, and its one next action ---------------------------- */
.band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--cw-space-5);
  margin: 0 0 var(--cw-space-6);
  padding: var(--cw-space-6);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius-l);
  background: var(--cw-raised);
}

/* The corners stand inside the band and the card, so that nothing reaches past their
   edge; they are quiet until Pro is held, then the accent's. */
.band::before,
.card--pro::before {
  top: var(--cw-space-2);
  left: var(--cw-space-2);
}

.band::after,
.card--pro::after {
  right: var(--cw-space-2);
  bottom: var(--cw-space-2);
}

.band::before,
.band::after {
  border-color: var(--cw-text-2);
  transition: border-color var(--cw-motion) var(--cw-ease-out);
}

.band--pro::before,
.band--pro::after {
  border-color: var(--cw-accent);
}

.band__words {
  flex: 1 1 18rem;
  min-width: 0;
}

.band__name {
  margin: 0 0 var(--cw-space-2);
  font-size: var(--cw-size-2xl);
}

.band__words p:last-child {
  margin-bottom: 0;
}

/* ---- Cards ------------------------------------------------------------------------------ */
.card {
  margin: 0 0 var(--cw-space-5);
  padding: var(--cw-space-5);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius-l);
  background: var(--cw-raised);
}

.card__title {
  margin: 0 0 var(--cw-space-4);
  font-size: var(--cw-size-l);
  font-weight: var(--cw-strong-weight);
}

.card .cw-button--secondary {
  background: var(--cw-bg);
}

/* "Get Pro": the largest card while Pro is not held. */
.card--pro {
  padding: var(--cw-space-6);
  border-color: var(--cw-text-2);
}

.card--pro .card__title {
  color: var(--cw-accent);
  font-size: var(--cw-size-s);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pro-lead {
  margin: 0 0 var(--cw-space-5);
  font-size: var(--cw-size-xl);
}

.pro-points {
  display: grid;
  gap: var(--cw-space-3);
  margin: 0 0 var(--cw-space-5);
  padding: 0;
  list-style: none;
}

.pro-points li {
  position: relative;
  padding: 0 0 0 var(--cw-space-5);
  border-top: 0;
}

/* Each line's mark: the icon's corner, in the accent. */
.pro-points li::before {
  content: '';
  position: absolute;
  top: 0.45em;
  left: 0;
  width: 0.6em;
  height: 0.6em;
  border-top: 2px solid var(--cw-accent);
  border-left: 2px solid var(--cw-accent);
}

.buy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--cw-space-3) var(--cw-space-4);
  margin: 0 0 var(--cw-space-4);
}

.price {
  font-size: var(--cw-size-l);
  font-weight: var(--cw-strong-weight);
}

/* The thank-you: the gate's one motion, on a picture the stylesheet draws. */
.thanks .cw-gate {
  max-width: 360px;
  margin: 0 0 var(--cw-space-4);
}

.thanks__picture {
  background:
    radial-gradient(ellipse at 70% 80%, #ffb547 0%, rgba(255, 181, 71, 0) 55%),
    linear-gradient(180deg, #1d2a3f 0%, #3a3346 55%, #6b4a35 100%);
}

/* ---- Your data: sync, the site choices and the presets, one list ------------------------- */
.group {
  padding-top: var(--cw-space-4);
  border-top: 1px solid var(--cw-line);
}

.group + .group,
.card__title + .group {
  margin-top: var(--cw-space-4);
}

.card__title + .group {
  padding-top: 0;
  border-top: 0;
}

h3 {
  margin: 0 0 var(--cw-space-3);
  color: var(--cw-text-2);
  font-size: var(--cw-size-xs);
  font-weight: var(--cw-strong-weight);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

ul {
  margin: 0 0 var(--cw-space-3);
  padding: 0;
  list-style: none;
}

li {
  padding: var(--cw-space-3) 0;
  border-top: 1px solid var(--cw-line);
}

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

.line {
  display: flex;
  align-items: center;
  gap: var(--cw-space-3);
  margin: 0 0 var(--cw-space-2);
  min-width: 0;
}

.line .item {
  margin: 0;
}

.item {
  font-weight: var(--cw-strong-weight);
}

/* A line's mark: a site's first letter, or a preset's corners, drawn here. */
.mark {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius);
  background: var(--cw-bg);
  color: var(--cw-text);
  font-size: var(--cw-size-s);
  font-stretch: 125%;
  font-weight: var(--cw-display-weight);
}

.mark--preset {
  color: var(--cw-accent);
}

.what {
  margin: var(--cw-space-2) 0 0;
}

.as-of {
  margin-bottom: var(--cw-space-2);
}

#per-title {
  margin: var(--cw-space-4) 0 0;
  padding-top: var(--cw-space-4);
  border-top: 1px solid var(--cw-line);
}

/* ---- Account: the provider's pages, the export, deleting -------------------------------- */
.row-block {
  padding-block: var(--cw-space-4);
  border-top: 1px solid var(--cw-line);
}

.card__title + .row-block {
  padding-top: 0;
  border-top: 0;
}

.row-block:last-child {
  padding-bottom: 0;
}

/* Deleting the account: the destructive red, by its edge until it is asked once more. */
.cw-button--danger.delete {
  background: transparent;
  border-color: var(--cw-danger);
  color: var(--cw-danger);
}

/* ---- Forms -------------------------------------------------------------------------------- */
form {
  display: grid;
  gap: var(--cw-space-2);
}

label {
  color: var(--cw-text-2);
  font-size: var(--cw-size-s);
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 var(--cw-space-3);
  border: 1px solid var(--cw-text-2);
  border-radius: var(--cw-radius);
  background: var(--cw-bg);
  color: var(--cw-text);
  font: inherit;
}

/* The sign-in's own buttons: the accent for the one that goes on. */
button.primary {
  min-height: 44px;
  padding: 0 var(--cw-space-5);
  border: 0;
  border-radius: var(--cw-radius);
  background: var(--cw-accent);
  color: var(--cw-on-accent);
  font: inherit;
  font-weight: var(--cw-strong-weight);
  cursor: pointer;
}

button:disabled,
select:disabled,
input:disabled {
  opacity: 0.55;
  cursor: default;
}

/* A site's choice, and a preset's name with "Save" and "Delete": the field has a line, the
   buttons the next. */
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--cw-space-2);
  align-items: center;
}

.row label {
  grid-column: 1 / -1;
}

form.row {
  grid-template-columns: 1fr 1fr;
}

form.row input {
  grid-column: 1 / -1;
}

.ask p {
  margin-bottom: var(--cw-space-2);
}

.ask .row,
.row.two {
  grid-template-columns: 1fr 1fr;
}

details {
  margin: 0 0 var(--cw-space-3);
}

summary {
  color: var(--cw-accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

details p {
  margin: var(--cw-space-2) 0 0;
}

button.link {
  padding: var(--cw-space-1) 0;
  border: 0;
  background: none;
  color: var(--cw-accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--cw-space-1) var(--cw-space-5);
  margin: var(--cw-space-1) 0 0;
}

/* The sign-in's form, on its own: a card of its own. */
#email-form,
#code-form {
  padding: var(--cw-space-5);
  border: 1px solid var(--cw-line);
  border-radius: var(--cw-radius-l);
  background: var(--cw-raised);
}

main {
  padding-bottom: var(--cw-space-7);
}

noscript p {
  max-width: 760px;
  margin: var(--cw-space-5) auto;
  padding: 0 var(--cw-space-5);
}

/* A phone: the top bar in two rows, the name and the other language, then the address and
   "Sign out"; the buttons of a card as wide as it, and the two answers to deleting one
   above the other. */
@media (max-width: 560px) {
  .top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0 var(--cw-space-4);
  }

  .top__end {
    display: contents;
  }

  .top .name {
    grid-area: 1 / 1;
  }

  #other-language {
    grid-area: 1 / 2;
    justify-self: end;
  }

  #signed-in-as {
    grid-area: 2 / 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #sign-out {
    grid-area: 2 / 2;
    justify-self: end;
  }

  .who__label {
    display: none;
  }

  #delete-form .row.two {
    grid-template-columns: 1fr;
  }

  .top,
  main {
    padding-inline: var(--cw-space-4);
  }

  .band,
  .card--pro {
    padding: var(--cw-space-5);
  }

  .buy-row .cw-button,
  .cw-button--danger.delete {
    width: 100%;
  }

  .buy-row .cw-button--large {
    font-size: var(--cw-size-m);
  }
}
