/* VRCVerify dashboard — Discord-native.
 *
 * The people using this page have Discord open on the other monitor. So the
 * dashboard borrows Discord's own surface layering rather than inventing a
 * look: a dark shell, a lighter sidebar sitting on it, and lighter cards again
 * on top. An admin arriving from a slash command should feel like they moved
 * rooms, not applications.
 *
 * WHAT THAT DOES AND DOESN'T MEAN
 * -------------------------------
 * Borrowed: the three-step surface ramp, the pill-shaped nav selection, the
 * radii, the weight of the type.
 *
 * Not borrowed: blurple as decoration. Discord can afford to paint furniture
 * in its brand colour because it has no other blue to confuse it with. Here
 * blurple means exactly two things -- "this is the page you are on" and "this
 * is the button that does the thing" -- so it is never spent on a border or a
 * heading. Everything else is carried by the surface ramp and type weight.
 *
 * No framework, no CDN. One vendored font (see @font-face) and one stylesheet,
 * which is what keeps the CSP as tight as it is.
 *
 * MOTION: hover and focus fade over 120ms. That is the whole of it. Page
 * navigation is instant, nothing loops, nothing spins, nothing slides, and the
 * fades are off under prefers-reduced-motion.
 */

/* Inter, vendored into static/fonts rather than loaded from a font CDN: a
 * third party would otherwise see who opens the dashboard, and could take it
 * down by going down themselves. `font-src 'self'` in the CSP exists for this
 * one file.
 *
 * The latin subset is 48KB and deliberately does NOT include U+2713 or U+2190,
 * which is why the tick and the back arrow are inline SVG -- a glyph the font
 * lacks falls back to another family and lands at a different weight and
 * baseline, which reads as a rendering bug.
 *
 * `swap` so text paints immediately in the system face and reflows when Inter
 * arrives. On a slow connection the page is readable the whole time, which
 * matters more than avoiding one reflow. */
@font-face {
  font-family: "Inter var";
  src: url("fonts/inter-latin-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  /* Discord's light palette. The ground is genuinely grey rather than white --
   * white is reserved for the cards, and without that the ramp has nowhere to
   * go. */
  --bg: #e3e5e8;          /* page ground, the layer everything sits on */
  --chrome: #f2f3f5;      /* header bar and sidebar */
  --panel: #ffffff;       /* cards */
  --inset: #ebedef;       /* inputs: pressed into the card, not raised */
  --hover: #e3e5e8;
  --selected: #d4d7dc;

  --ink: #313338;         /* body text */
  --ink-strong: #060607;  /* headings, values, anything you scan for */
  --muted: #5c5e66;       /* descriptions. 5.4:1 on white, not decorative grey */
  --faint: #80848e;       /* the least important thing on the page */

  --line: #dfe0e3;
  --line-soft: #ebedef;

  --accent: #5865f2;
  --accent-hover: #4752c4;
  --accent-ink: #ffffff;

  /* Semantic, and separate from the accent on purpose -- "this succeeded" and
   * "this is the current page" must never be the same colour. */
  --ok: #1a8245;
  --danger: #d83c3e;
  --notice: #8a5300;
  --notice-bg: #fdf3e0;
  --notice-line: #f0c98a;

  --radius-card: 8px;
  --radius-control: 4px;

  /* The system stack is the fallback rather than an afterthought: it is what
   * renders for the ~200ms before Inter arrives, and permanently for anyone
   * whose browser refuses the font. */
  --font: "Inter var", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Checkboxes and colour inputs render in the OS blue otherwise. One property,
   * and it is a real CSS property rather than an inline style, which is the
   * only reason it is available to us. */
  accent-color: var(--accent);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1e1f22;
    --chrome: #2b2d31;
    --panel: #313338;
    --inset: #1e1f22;
    --hover: #35373c;
    --selected: #404249;

    --ink: #dbdee1;
    --ink-strong: #f2f3f5;
    --muted: #b5bac1;
    --faint: #949ba4;

    --line: #3f4147;
    --line-soft: #35373c;

    --accent: #5865f2;
    --accent-hover: #4752c4;
    --accent-ink: #ffffff;

    --ok: #23a55a;
    --danger: #f23f43;
    --notice: #f0b232;
    --notice-bg: #3a2f13;
    --notice-line: #5c4a1c;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  /* 16px is also the floor that stops iOS zooming the whole page when a select
   * or textarea takes focus -- the controls inherit from here. */
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Type. Discord runs heavier than a document would: 500 for ordinary UI text,
 * 600-700 for anything that names a thing. */
h1, h2, h3 { color: var(--ink-strong); text-wrap: balance; }
h1 { margin: 0 0 0.75rem; font-size: 1.4rem; font-weight: 700; letter-spacing: -0.01em; }
p { text-wrap: pretty; }

/* --- header bar --- */
.bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 1.25rem;
  background: var(--chrome);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink-strong);
  text-decoration: none;
  letter-spacing: -0.01em;
  margin-right: auto;
}

/* Two sign-out forms side by side. They wrap rather than shrink on a narrow
 * screen: "Sign out everywhere" truncated to "Sign out" would be the one
 * misreading in this bar that actually costs something. */
.account { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

main { max-width: 60rem; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

.panel {
  background: var(--panel);
  border-radius: var(--radius-card);
  padding: 1.25rem 1.5rem;
}

.centered { max-width: 34rem; margin: 3rem auto; }

.muted { color: var(--muted); font-size: 0.9375rem; }

.notice {
  background: var(--notice-bg);
  color: var(--notice);
  border: 1px solid var(--notice-line);
  border-radius: var(--radius-control);
  padding: 0.7rem 0.9rem;
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.notice.ok {
  background: none;
  border-color: var(--ok);
  color: var(--ok);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 0.45rem 1.1rem;
  border: 0;
  border-radius: var(--radius-control);
  text-decoration: none;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.button:hover { background: var(--accent-hover); }

button.link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
  text-decoration: underline;
}

button.link:hover { color: var(--ink-strong); }

/* --- sidebar --- */
.nav-toggle { display: flex; }

.hamburger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  border-radius: var(--radius-control);
  background: none;
  color: var(--muted);
  cursor: pointer;
}

.hamburger:hover { background: var(--hover); color: var(--ink-strong); }

/* The three lines are an inline SVG, like every other icon here.
 *
 * They were borders on a span and two pseudo-elements, and the spacing came
 * out visibly wrong: `.bars` has `height: 0` with a 2px `border-top`, so an
 * absolutely-positioned child's `top` resolves against the *padding* box,
 * which begins below that border. The offsets that read as symmetrical in the
 * source (-5px and 3px) therefore produced a 1px gap above the middle bar and
 * a 3px gap below it.
 *
 * Three <path> lines at y=4, 8 and 12 cannot drift, need no arithmetic to
 * check, and cost nothing extra -- an inline SVG is markup, so `img-src` never
 * enters into it. */

.layout {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Login and the picker have no sidebar, so the wrapper gets out of the way
 * entirely and `main` keeps the width it always had. */
.layout.plain { display: block; max-width: none; padding: 0; }

.layout:not(.plain) main {
  flex: 1 1 auto;
  /* Without this a wide child -- the settings textarea, a long channel name --
     stops the flex item shrinking and the whole page scrolls sideways. */
  min-width: 0;
  max-width: 60rem;
  margin: 0;
  padding-left: 0;
  padding-right: 0;
}

/* 15rem expanded, 4rem collapsed: the settled convention, and wide enough that
 * a long server name has somewhere to go before it wraps. */
.sidebar {
  flex: 0 0 15rem;
  position: sticky;
  top: 1.25rem;
  margin-top: 1.5rem;
  padding: 0.6rem;
  background: var(--chrome);
  border-radius: var(--radius-card);
  overflow-wrap: anywhere;
}

.layout.collapsed .sidebar { flex-basis: 4rem; text-align: center; }

/* The rail. Every label goes, every target stays: the links keep their height
 * and remain tabbable, which is the difference between a collapsed sidebar and
 * a broken one. */
.layout.collapsed .side-text { display: none; }
.layout.collapsed .side-guild { justify-content: center; }
.layout.collapsed .side-link,
.layout.collapsed .side-back a { justify-content: center; }

.side-guild {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.5rem;
  padding: 0.35rem 0.5rem 0.75rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--ink-strong);
}

.side-guild .icon { width: 32px; height: 32px; margin: 0; flex: 0 0 auto; }
.side-guild .icon img { width: 32px; height: 32px; }
.side-guild .initial { font-size: 0.875rem; }

.side-nav { list-style: none; margin: 0; padding: 0; }

.side-link,
.side-back a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.125rem;
  border-radius: var(--radius-control);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
}

.side-link:hover,
.side-back a:hover { background: var(--hover); color: var(--ink-strong); }

/* The current section. Discord marks selection with a filled pill rather than
 * a coloured label, which leaves the brand colour free to mean "act on this"
 * everywhere else on the page. */
.side-link.current,
.side-link.current:hover {
  background: var(--selected);
  color: var(--ink-strong);
  font-weight: 600;
}

/* Section icons stand in for the labels on the rail, and only there. Expanded,
 * the label already says what the link is and a glyph beside it is decoration
 * competing with the one thing that matters. */
.side-mark { display: none; flex: 0 0 auto; }
.layout.collapsed .side-mark { display: block; }

.side-back {
  margin: 0.5rem 0 0;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

/* The back arrow is not a label substitute, so it stays in both states. */
.back-mark { flex: 0 0 auto; display: flex; }

/* --- server picker --- */
.servers {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 1.25rem;
}

.server { text-align: center; }

.server a,
.server > .icon {
  display: block;
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-control);
  padding: 0.5rem 0.25rem;
}

.server a:hover { background: var(--hover); }

.icon {
  display: block;
  width: 64px;
  height: 64px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  overflow: hidden;
  background: var(--inset);
}

.icon img { display: block; width: 64px; height: 64px; border-radius: 50%; }

.initial {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--faint);
}

.name {
  display: block;
  font-size: 0.9375rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.state { display: block; font-size: 0.8rem; color: var(--faint); }

/* Servers the bot isn't in. Greyscale reads as "available but not set up",
 * which is why the whole tile is the install link. */
.server.absent .icon img { filter: grayscale(1); opacity: 0.55; }
.server.absent .name { color: var(--muted); }
.server.absent .state { color: var(--accent); }

/* --- one server's pages --- */
.guild-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.guild-head .icon { margin: 0; flex: 0 0 auto; }
.guild-head h1 { margin: 0; }
.guild-head p { margin: 0.15rem 0 0; }

/* The upgrade offer. Bordered rather than filled: it sits above settings an
 * admin came here to change, and a block loud enough to compete with them
 * would be an advertisement on a page they already paid attention to. */
.upgrade {
  margin: 1.25rem 0 0;
  padding: 0.9rem 1rem;
  background: var(--inset);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-control);
}

.upgrade h2 { font-size: 1rem; margin: 0 0 0.4rem; }
.upgrade p { margin: 0 0 0.5rem; font-size: 0.9375rem; }
.upgrade p:last-child { margin-bottom: 0; }
.upgrade a { color: var(--accent); }

/* Each settings group is its own card. Whitespace alone did not separate them:
 * the settings *inside* a group are divided by a hairline, so a group boundary
 * made of margin carried no more weight than the rows it was containing. A
 * card puts page ground between sections, which is the one separator nothing
 * inside a section can imitate. */
.panel + .panel { margin-top: 1rem; }

.group h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.blurb { margin: 0.7rem 0 0.4rem; }

.settings { margin: 0; }

.setting { padding: 0.9rem 0; border-top: 1px solid var(--line-soft); }

.setting dt {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--ink-strong);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.setting dd { margin: 0.3rem 0 0; }

.value {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-wrap: anywhere;
  /* The custom DM is free text an admin wrote; preserve their line breaks
     rather than reflowing it into something they did not write. */
  white-space: pre-wrap;
}

.value.empty { color: var(--faint); font-style: italic; }

.swatch { flex: 0 0 auto; vertical-align: middle; }

.desc, .plan { margin: 0.2rem 0 0; font-size: 0.875rem; color: var(--muted); }
.plan { font-style: italic; }

/* Locked means the bot refuses the save, so the row is visibly inert. Fields
 * that merely aren't acted on are NOT dimmed -- they are editable in Discord
 * today, and dimming them would tell an admin something untrue. */
.setting.locked .value { color: var(--faint); }

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  margin-bottom: 0.35rem;
}

select,
textarea,
input[type="color"] {
  font: inherit;
  color: var(--ink);
  background: var(--inset);
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  padding: 0.4rem 0.5rem;
  max-width: 100%;
}

select:hover, textarea:hover { border-color: var(--line); }
select:focus, textarea:focus { border-color: var(--accent); outline: none; }

input[type="color"] { padding: 0.15rem; width: 3.5rem; height: 2.25rem; }

textarea {
  display: block;
  width: 100%;
  resize: vertical;
  line-height: 1.5;
}

.actions { margin: 1.1rem 0 0; }

.badge {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-control);
}

.badge.premium { background: var(--accent); color: var(--accent-ink); }
.badge.inactive { background: var(--inset); color: var(--muted); }

.warn {
  margin: 0.45rem 0 0;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-control);
  background: var(--notice-bg);
  border: 1px solid var(--notice-line);
  color: var(--notice);
  font-size: 0.875rem;
}

code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--inset);
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
}

footer {
  max-width: 78rem;
  margin: 0 auto;
  padding: 0 1.25rem 2rem;
  color: var(--faint);
  font-size: 0.85rem;
}

/* --- overview --- */
.tiles {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
  gap: 0.6rem;
}

.tile {
  padding: 0.85rem 0.9rem;
  background: var(--inset);
  border-radius: var(--radius-control);
}

.tile-value {
  display: block;
  color: var(--ink-strong);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  /* Tabular figures so a row of counts lines up on the digits rather than
   * wandering with the glyph widths. */
  font-variant-numeric: tabular-nums;
}

.tile-label {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--muted);
}

.tile-note { display: block; margin-top: 0.3rem; font-size: 0.78rem; }

/* A window with nothing behind it, and a read that failed. Both are muted, and
 * they say different things -- see overview_view.py for why they must not
 * become the same tile. Neither is dimmed as far as a real zero would look
 * wrong: a count of 0 is a true answer and keeps full contrast. */
.tile-blank .tile-value { color: var(--faint); }

.tile-unknown .tile-value {
  color: var(--faint);
  /* The words "Couldn't check" in the size meant for two digits. */
  font-size: 1rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0;
}

/* The one suggested action. Accented like the upgrade box, because it is the
 * same kind of thing: a prompt on a page you came to read. */
.next-step { border-left: 3px solid var(--accent); }

.setup { list-style: none; margin: 0; padding: 0; }

.setup-row {
  display: grid;
  grid-template-columns: 1.25rem minmax(8rem, auto) 1fr;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.9375rem;
}

.setup-state { color: var(--ok); display: flex; align-items: center; }
.setup-row.off .setup-state { color: var(--faint); }
.setup-label { font-weight: 600; color: var(--ink-strong); }
.setup-note { font-size: 0.85rem; }

/* Only a *required* piece that is missing. The tick and cross alone would
 * otherwise read as four pass/fail results, and three of these are ordinary
 * choices rather than faults. */
.setup-row.missing .setup-state { color: var(--notice); }

/* --- change history --- */
.audit { list-style: none; margin: 0; padding: 0; }

.audit li {
  padding: 0.55rem 0;
  border-top: 1px solid var(--line-soft);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.audit-what { font-weight: 600; color: var(--ink-strong); margin-right: 0.4rem; }
.audit-who { display: block; font-size: 0.825rem; color: var(--faint); }

.panel-post {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.panel-post label { font-size: 0.9375rem; font-weight: 500; }
.panel-post .desc { flex-basis: 100%; margin: 0; }

/* Available to a screen reader, absent from the page. Used for the tick and
 * cross, which are decorative marks carrying real meaning. */
.offscreen {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* --- accessibility and input --- */

/* The browser default focus ring disappears against several of the surfaces
 * above. This is the one style on the page that must never be subtle. */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

select:focus-visible, textarea:focus-visible { outline-offset: 0; }

/* Touch. 44px is the smallest target a finger hits reliably, and it applies
 * only to coarse pointers so a mouse still gets the tighter rhythm. */
@media (pointer: coarse) {
  .side-link,
  .side-back a { min-height: 44px; }
  .hamburger { width: 44px; height: 44px; }
  button.link { padding: 0.5rem 0; }
  .button { min-height: 44px; }
}

/* --- narrow screens --- */
/* Below this the sidebar would take a third of the screen from the content it
 * exists to navigate, so it becomes a full-width strip above it instead. */
@media (max-width: 48rem) {
  .layout { flex-direction: column; gap: 0; padding: 0 0.75rem; }
  .sidebar {
    flex-basis: auto;
    width: 100%;
    position: static;
    margin-top: 1rem;
    text-align: left;
  }
  .layout.collapsed .sidebar { flex-basis: auto; text-align: left; }
  /* The rail makes no sense as a horizontal strip -- labels come back. */
  .layout.collapsed .side-text { display: inline; }
  .layout.collapsed .side-mark { display: none; }
  .side-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; }
  .side-nav li { flex: 1 1 auto; }
  .side-link { justify-content: center; }
  .layout.collapsed .side-link { justify-content: center; }
  .side-back { display: block; }
  main { padding: 1rem 0 2rem; }
  .panel { padding: 1rem 1.1rem; }
  .setup-row { grid-template-columns: 1.25rem 1fr; }
  .setup-note { grid-column: 2; }
}

/* --- motion ---
 *
 * Narrow by intent: colour fades on the things you point at, and a cross-fade
 * between pages. Nothing loops, nothing spins, nothing moves in space, and
 * none of it runs for a reader who has asked for less. A dashboard that
 * animates while you are trying to read a number is a dashboard arguing with
 * its own purpose. */
@media (prefers-reduced-motion: no-preference) {
  a,
  .button,
  button.link,
  .side-link,
  .hamburger,
  .server a,
  select,
  textarea {
    transition: background-color 120ms ease, color 120ms ease,
                border-color 120ms ease;
  }
}

/* No @view-transition here, deliberately.
 *
 * Cross-document view transitions were tried and removed: they cross-faded the
 * whole page on every navigation, which put a delay between clicking a section
 * and being able to read it. Moving between Overview and Settings is something
 * an admin does repeatedly and impatiently, and a transition that is pleasant
 * once is friction the tenth time. Navigation is instant. */

/* --- Subscriptions ------------------------------------------------------ *
 * Three plan cards side by side, stacking on narrow screens. No colour is
 * written inline anywhere on this page: `style-src 'self'` drops inline styles
 * SILENTLY, so a swatch written as style="" would simply not apply and nothing
 * would say so. */
/* auto-fit, NOT repeat(3, ...). The plans are whatever active prices Stripe
 * returns, so a hardcoded three broke the layout the moment a fourth plan was
 * created -- which is the one thing the Stripe-driven plan list exists to make
 * easy. minmax lets them wrap on a phone instead of squeezing to nothing. */
.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: 0.75rem;
  margin: 1rem 0 0;
  align-items: stretch;
}

/* Each card is a form of its own, so the button posts one plan and the plan
 * cannot be swapped between clicking and submitting. */
.plan {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
  padding: 1.15rem 1.15rem 1rem;
  background: var(--inset);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  position: relative;
}

/* `highlight` in a price's metadata. Presentational only -- it changes no
 * price and nothing the server will accept. */
.plan-featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.plan-badge {
  position: absolute;
  top: -0.6rem;
  left: 1.15rem;
  margin: 0;
  padding: 0.1rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
}

.plan h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 0;
  color: var(--muted);
}

/* The figure, read from Stripe on the render that shows it. Baseline-aligned
 * with its period so the cards line up across differing amount widths. */
.plan-price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0.15rem 0 0;
}

.plan-amount {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.plan-period { font-size: 0.8125rem; color: var(--faint); }

/* Stated as a claim about the plan, never as arithmetic -- no amount appears
 * anywhere in this repo. Stripe knows what it charges, and a second copy of a
 * price on a page about money is a second thing to be wrong. */
.plan-saving {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ok);
  font-weight: 500;
}

/* Keeps the buttons on one baseline when only some plans have a saving. */
.plan-saving-none { visibility: hidden; }

/* The trial, when a price's metadata names one. Distinct from the saving --
 * one is a discount on what you pay, the other is a period where you do not --
 * so it does not reuse --ok, which reads as "money off". */
.plan-trial {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
}

.plan .button { margin-top: auto; align-self: stretch; }

.plan-notes {
  margin: 1rem 0 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.plan-notes li { margin: 0.3rem 0; }

@media (max-width: 40rem) {
  .plans { grid-template-columns: 1fr; }
}
