/* The design system from the canvas, as a real stylesheet.
 *
 * The prototype styles every element inline; a served page cannot, because the
 * content-security policy forbids inline style and the policy is worth more
 * than the convenience. So the tokens are copied exactly and the recurring
 * inline blocks become classes.
 *
 * Liquid Glass over Material 3: translucent layers with blur and a light top
 * edge, tonal surfaces, pills, radii 24 / 16 / 999. Manrope for the interface,
 * JetBrains Mono for anything a person copies — addresses, identifiers, numbers.
 * Accent indigo near hue 262, second teal 175. Warning is warm amber and never
 * red: a spent quota and an expired subscription are not accidents.
 */

@import url("/fonts.css");

[data-nz-theme="light"] {
  --bg: oklch(96.5% 0.008 250);
  --blob1: oklch(80% 0.09 262 / .55);
  --blob2: oklch(84% 0.07 175 / .5);
  --glass: rgba(255, 255, 255, .6);
  --glass2: rgba(255, 255, 255, .85);
  --line: rgba(20, 30, 60, .09);
  --line2: rgba(255, 255, 255, .75);
  --fg: oklch(22% 0.02 260);
  --fg2: oklch(45% 0.02 260);
  --fg3: oklch(60% 0.015 260);
  --accent: oklch(50% 0.18 262);
  --accent-fg: #fff;
  --accent-soft: oklch(50% 0.18 262 / .12);
  --teal: oklch(50% 0.11 175);
  --teal-soft: oklch(50% 0.11 175 / .14);
  --warn: oklch(58% 0.14 70);
  --warn-soft: oklch(58% 0.14 70 / .16);
  --ok: oklch(52% 0.14 150);
  --ok-soft: oklch(52% 0.14 150 / .14);
  --bad: oklch(52% 0.19 25);
  --bad-soft: oklch(52% 0.19 25 / .12);
  --shadow: 0 14px 40px -16px rgba(20, 30, 60, .22), inset 0 1px 0 rgba(255, 255, 255, .9);
  --code: oklch(93% 0.01 250);
  --knob: #fff;
  --skel: rgba(20, 30, 60, .07);
}

[data-nz-theme="dark"] {
  --bg: oklch(14% 0.015 262);
  --blob1: oklch(45% 0.13 262 / .45);
  --blob2: oklch(45% 0.1 175 / .35);
  --glass: rgba(255, 255, 255, .055);
  --glass2: rgba(255, 255, 255, .1);
  --line: rgba(255, 255, 255, .09);
  --line2: rgba(255, 255, 255, .13);
  --fg: oklch(95% 0.01 260);
  --fg2: oklch(72% 0.015 260);
  --fg3: oklch(55% 0.015 260);
  --accent: oklch(76% 0.13 262);
  --accent-fg: oklch(16% 0.05 262);
  --accent-soft: oklch(76% 0.13 262 / .16);
  --teal: oklch(76% 0.11 175);
  --teal-soft: oklch(76% 0.11 175 / .16);
  --warn: oklch(78% 0.14 75);
  --warn-soft: oklch(78% 0.14 75 / .16);
  --ok: oklch(75% 0.14 150);
  --ok-soft: oklch(75% 0.14 150 / .16);
  --bad: oklch(70% 0.17 25);
  --bad-soft: oklch(70% 0.17 25 / .16);
  --shadow: 0 16px 48px -16px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .08);
  --code: rgba(0, 0, 0, .35);
  --knob: oklch(95% 0.01 260);
  --skel: rgba(255, 255, 255, .07);
}

@keyframes nzIn { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes nzPop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes nzShimmer { 0% { background-position: -400px 0; } 100% { background-position: 400px 0; } }
@keyframes nzSpin { to { transform: rotate(360deg); } }
@keyframes nzBlob { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(4%, 6%) scale(1.08); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

* { box-sizing: border-box; }

/* The browser hides [hidden] with display:none from its own stylesheet, which
   any author display rule outranks. Most things here are flex or grid. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
}

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

/* The two slow colour fields behind the glass. Without something to refract,
   translucency reads as flat grey. */
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blobs i {
  position: absolute;
  width: 52vmax;
  height: 52vmax;
  border-radius: 50%;
  filter: blur(80px);
  animation: nzBlob 22s ease-in-out infinite;
}
.blobs i:first-child { background: var(--blob1); top: -18vmax; left: -12vmax; }
.blobs i:last-child { background: var(--blob2); bottom: -20vmax; right: -14vmax; animation-delay: -11s; }

/* Shell ------------------------------------------------------------------ */

.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 22px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border-bottom: 1px solid var(--line2);
}

.brand {
  font: 800 17px/1 Manrope;
  letter-spacing: -.02em;
  color: var(--fg);
}
.brand:hover { text-decoration: none; }
.brand span { color: var(--accent); }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.who { font: 500 12.5px/1 Manrope; color: var(--fg3); }

.shell { display: grid; grid-template-columns: 232px 1fr; gap: 22px; padding: 22px; align-items: start; }
@media (max-width: 860px) { .shell { grid-template-columns: 1fr; padding: 16px; } }

.side {
  position: sticky;
  top: 78px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px;
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--line2);
  box-shadow: var(--shadow);
  border-radius: 24px;
}
@media (max-width: 860px) { .side { position: static; flex-direction: row; overflow-x: auto; } }

.side .group {
  font: 700 10.5px/1 Manrope;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--fg3);
  padding: 12px 10px 6px;
}
@media (max-width: 860px) { .side .group { display: none; } }

.side a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 14px;
  font: 600 13.5px/1 Manrope;
  color: var(--fg2);
  white-space: nowrap;
}
.side a:hover { background: var(--glass2); text-decoration: none; }
.side a.on { background: var(--accent-soft); color: var(--accent); }

main { min-width: 0; display: flex; flex-direction: column; gap: 18px; animation: nzIn .4s ease both; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 18px; }
.wide { grid-column: 1 / -1; }

/* Surfaces --------------------------------------------------------------- */

.card {
  background: var(--glass);
  backdrop-filter: blur(24px) saturate(1.5);
  -webkit-backdrop-filter: blur(24px) saturate(1.5);
  border: 1px solid var(--line2);
  box-shadow: var(--shadow);
  border-radius: 24px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.card.dashed { border: 1px dashed var(--line); box-shadow: none; align-items: center; text-align: center; padding: 36px 28px; }
.card.narrow { max-width: 430px; margin: 8vh auto; }

h1 { margin: 0; font: 800 26px/1.15 Manrope; letter-spacing: -.02em; }
h2 { margin: 0; font: 700 11px/1 Manrope; letter-spacing: .1em; text-transform: uppercase; color: var(--fg3); }
h3 { margin: 0; font: 700 17px/1.2 Manrope; }

p { margin: 0; font: 500 13.5px/1.55 Manrope; }
.muted { color: var(--fg2); }
.hint { font: 500 12.5px/1.45 Manrope; color: var(--fg3); }
.big { font: 800 30px/1 Manrope; letter-spacing: -.02em; }
.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

.head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }

/* Controls --------------------------------------------------------------- */

button, .btn {
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: var(--accent-fg);
  font: 600 14px/1 Manrope;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
button.tonal, .btn.tonal { background: var(--accent-soft); color: var(--accent); }
button.outline { background: transparent; border: 1px solid var(--line); color: var(--fg); }
button.plain { background: var(--fg); color: var(--bg); }
button.danger { height: 38px; padding: 0 14px; background: transparent; border: 1px solid var(--bad-soft); color: var(--bad); font-size: 13px; }
button.small { height: 38px; padding: 0 14px; font-size: 13px; }
button.ghost { background: transparent; color: var(--fg2); }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

input[type=text], input[type=email], input[type=password], select {
  height: 44px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--code);
  color: var(--fg);
  font: 500 14px/1 Manrope;
  min-width: 0;
}
input[type=text], input.mono { font-family: "JetBrains Mono", ui-monospace, Menlo, monospace; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
input::placeholder { color: var(--fg3); }

label.field { display: flex; flex-direction: column; gap: 6px; font: 600 12.5px/1.3 Manrope; color: var(--fg2); }

/* The spring switch from the canvas. */
.switch {
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  flex: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: background .22s cubic-bezier(.2, .9, .3, 1.3);
}
.switch::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--knob);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
  transition: left .22s cubic-bezier(.2, .9, .3, 1.3);
}
.switch[aria-checked="true"] { background: var(--accent); }
.switch[aria-checked="true"]::after { left: 22px; }

.chip {
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass2);
  color: var(--fg);
  font: 600 13px/1 Manrope;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }

/* Status, banners -------------------------------------------------------- */

/* Colour plus sign plus word: colour alone is not a message. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 600 11.5px/1 Manrope;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--code);
  color: var(--fg2);
  white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.bad { background: var(--bad-soft); color: var(--bad); }

.banner {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 16px;
  border-radius: 16px;
  font: 500 13px/1.45 Manrope;
  background: var(--warn-soft);
  color: var(--warn);
}
.banner.info { background: var(--accent-soft); color: var(--accent); }
.banner.bad { background: var(--bad-soft); color: var(--bad); }
.banner .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; margin-top: 6px; }

/* The status hero on the overview: the card that says whether it is working. */
.hero { border-radius: 24px; padding: 22px; display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; border: 1px solid var(--line2); }
.hero.ok { background: var(--ok-soft); border-color: var(--ok-soft); }
.hero.warn { background: var(--warn-soft); border-color: var(--warn-soft); }
.hero .what { flex: 1 1 260px; display: flex; flex-direction: column; gap: 6px; }
.hero h3 { font-size: 19px; }

/* Copy block ------------------------------------------------------------- */

.copy { display: flex; gap: 8px; align-items: stretch; }
.copy code {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
  border-radius: 12px;
  background: var(--code);
  border: 1px solid var(--line);
  font: 500 12.5px/1.5 "JetBrains Mono", ui-monospace, Menlo, monospace;
  word-break: break-all;
}
.copy button { flex: none; width: 108px; height: auto; border-radius: 12px; font-size: 12.5px; padding: 0; }
.copy button.done { background: var(--ok); color: #fff; }

/* Lists ------------------------------------------------------------------ */

.rows { display: flex; flex-direction: column; }
.rows > li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  list-style: none;
}
.rows > li:last-child { border-bottom: 0; }
.rows .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
ul.rows { margin: 0; padding: 0; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font: 500 11.5px/1 "JetBrains Mono", ui-monospace, Menlo, monospace;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--code);
  color: var(--fg2);
}

/* Wizard ----------------------------------------------------------------- */

.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.steps .step { display: flex; align-items: center; gap: 8px; font: 600 12.5px/1 Manrope; color: var(--fg3); }
.steps .n {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--code);
  color: var(--fg3);
  font: 700 12px/1 Manrope;
}
.steps .step.on .n { background: var(--accent); color: var(--accent-fg); }
.steps .step.on { color: var(--fg); }
.steps .step.done .n { background: var(--ok-soft); color: var(--ok); }

/* Usage ------------------------------------------------------------------ */

.bar { height: 10px; border-radius: 999px; background: var(--code); overflow: hidden; border: 1px solid var(--line); }
.bar > i { display: block; height: 100%; background: var(--accent); }
.bar.full > i { background: var(--warn); }

.days { display: flex; align-items: flex-end; gap: 4px; height: 140px; }
.days > div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.days .col { width: 100%; border-radius: 6px 6px 3px 3px; background: var(--accent-soft); }
.days .col > i { display: block; width: 100%; border-radius: 6px 6px 3px 3px; background: var(--accent); }
.days .lbl { font: 500 10px/1 "JetBrains Mono", ui-monospace, Menlo, monospace; color: var(--fg3); }

.numbers { display: flex; gap: 24px; flex-wrap: wrap; }
.numbers > div { min-width: 110px; display: flex; flex-direction: column; gap: 2px; }
.numbers .k { font: 600 11px/1 Manrope; letter-spacing: .06em; text-transform: uppercase; color: var(--fg3); }

/* Loading ---------------------------------------------------------------- */

.skel {
  border-radius: 24px;
  background: linear-gradient(90deg, var(--skel) 0, var(--glass2) 40%, var(--skel) 80%);
  background-size: 400px 100%;
  animation: nzShimmer 1.4s linear infinite;
}
.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: nzSpin .8s linear infinite;
  flex: none;
}

/* Accordion -------------------------------------------------------------- */

details { border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--glass2); }
details + details { margin-top: 8px; }
summary { cursor: pointer; font: 600 13.5px/1.3 Manrope; }
details ol { margin: 10px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
details li { font: 500 13px/1.5 Manrope; color: var(--fg2); }

.qr {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px;
  flex: none;
}

.foot { padding: 0 22px 36px; font: 500 12.5px/1.6 Manrope; color: var(--fg3); max-width: 78ch; }
.foot strong { color: var(--fg2); }
