/* DJ Sites: the portal's screens (the wizard, the progress page, the server-made pages and Scott's admin
   page). The engine control panel's own language (personal/Mark site/admin/admin.css, the redesign of
   29th September 2026): its radii, cards, notices, chips, steps and buttons, its 48 px targets, and only
   its colour roles (--pn-*, tokens.css, made by tools/portal-theme.py from DJ Sites' fixed accent). No
   colour literal here but the QR code's white, which must stay white to scan (tests check). A DJ's own
   colours appear only in the name sketch and the colour swatches, set from the engine's lists by script.
   Phone first: 320 px and up with a 16 px gutter; Scott's admin page widens from 1024 px. */

/* ------------------------------------------------------------------ foundations */
:root {
  --r-field: 10px; --r-tile: 12px; --r-card: 16px; --r-full: 999px;
  --gut: 16px;
  --sh-1: 0 1px 2px rgb(var(--pn-shadow-rgb) / .06);
  --sh-2: 0 6px 16px rgb(var(--pn-shadow-rgb) / .10);
  --sh-3: 0 16px 44px rgb(var(--pn-shadow-rgb) / .24);
  --t-quick: 140ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-display: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; min-height: 100vh; background: var(--pn-page); color: var(--pn-text);
  font: 400 17px/1.5 var(--f-body); -webkit-font-smoothing: antialiased; overflow-wrap: anywhere;
}
a { color: var(--pn-accent-text); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h1 { font: 800 28px/34px var(--f-display); letter-spacing: -.01em; }
h2 { font: 800 22px/28px var(--f-display); letter-spacing: -.01em; }
h3 { font: 700 18px/24px var(--f-body); }
p { margin: .5rem 0; }
:focus-visible { outline: 2px solid var(--pn-focus); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -80px; z-index: 60; background: var(--pn-raised); color: var(--pn-text); padding: 12px 16px; border-radius: 12px; }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ the frame */
/* The name bar scrolls away with the page: it holds nothing to tap but the name, and a bar that stayed
   on top would hide whatever a DJ moved to with the keyboard or tapped near the top (WCAG 2.4.11). */
.brand {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  min-height: 56px; padding: 4px var(--gut); background: var(--pn-page); border-bottom: 1px solid var(--pn-line);
}
.brand-name { display: inline-flex; flex-direction: column; justify-content: center; min-height: 48px; color: var(--pn-text);
  font: 800 18px/22px var(--f-display); letter-spacing: .02em; text-transform: uppercase; text-decoration: none; }
.brand-name::after { content: ""; display: block; width: 22px; height: 3px; border-radius: 2px; background: var(--pn-mark); margin-top: 4px; }
.brand .who { color: var(--pn-text-2); font-size: 15px; }
main { display: block; max-width: 640px; margin: 0 auto; padding: 16px var(--gut) 64px; }
main.wide { max-width: 1120px; }
.head { margin: 8px 0 16px; }
.head p { color: var(--pn-text-2); margin: 6px 0 0; }
.eyebrow { margin: 0 0 4px; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--pn-text-2); }
.foot { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--pn-line); color: var(--pn-text-2); font-size: 15px; }
.foot h2 { color: var(--pn-text); }
.loading { color: var(--pn-text-2); }
@media (min-width: 1024px) {
  :root { --gut: 32px; }
  h1 { font-size: 34px; line-height: 42px; }
}

/* ------------------------------------------------------------------ cards and sections */
.card { background: var(--pn-card); border: 1px solid var(--pn-line); border-radius: var(--r-card); padding: 16px; margin: 0 0 16px; box-shadow: var(--sh-1); }
.card > :first-child { margin-top: 0; }
.card h2 + p, .card h3 + p { margin-top: 6px; }
.card > h3 { margin-top: 20px; }
.card > h2 + h3 { margin-top: 12px; }
.card.quiet { background: none; box-shadow: none; }
.card.now { border-color: var(--pn-accent); box-shadow: inset 4px 0 0 var(--pn-accent), var(--sh-1); }
.q { margin: 0 0 24px; padding: 0 0 24px; border: 0; border-bottom: 1px solid var(--pn-line); min-width: 0; }
.q:last-of-type { border-bottom: 0; }
.q > legend, .q-title { display: block; padding: 0; margin: 0 0 4px; font: 800 20px/26px var(--f-display); color: var(--pn-text); }
.q-num { display: block; font: 600 14px/20px var(--f-body); color: var(--pn-text-2); margin-bottom: 2px; }
@media (min-width: 1024px) { .card { padding: 20px; } }

/* ------------------------------------------------------------------ boxes */
.f { display: grid; gap: 6px; margin: 12px 0; }
.f > label, .f > .label { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--pn-text); }
.hint { color: var(--pn-text-3); font-size: 15px; line-height: 21px; margin: 0; }
input[type="text"], input[type="url"], input[type="password"], input:not([type]), textarea, select {
  width: 100%; min-width: 0; font: 17px/1.4 var(--f-body); color: var(--pn-text); background: var(--pn-sunken);
  border: 1px solid var(--pn-line-control); border-radius: var(--r-field); padding: 11px 12px; min-height: 48px;
}
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--pn-text-3); }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--pn-focus); outline-offset: 1px; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--pn-bad); box-shadow: inset 0 0 0 1px var(--pn-bad); }
.err { display: flex; gap: 8px; align-items: flex-start; color: var(--pn-bad-text); font-size: 15px; line-height: 21px; font-weight: 600; margin: 0; }
.err::before { content: "!"; display: inline-grid; place-items: center; flex: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--pn-bad-soft); color: var(--pn-bad-text); font-size: 13px; }
.ok-line { color: var(--pn-ok-text); font-weight: 600; font-size: 15px; margin: 0; }
.affix { display: flex; align-items: stretch; }
.affix input { border-top-right-radius: 0; border-bottom-right-radius: 0; flex: 1; }
.affix .suffix { display: inline-flex; align-items: center; padding: 0 10px; border: 1px solid var(--pn-line-control); border-left: 0;
  border-radius: 0 var(--r-field) var(--r-field) 0; background: var(--pn-hover); color: var(--pn-text-2); font-size: 15px; white-space: nowrap; }
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 12px 0; cursor: pointer; }
.check input { flex: none; width: 24px; height: 24px; margin: 0; accent-color: var(--pn-accent); }
.check .label { font-weight: 600; }

/* Choices: real radio buttons inside whole-card labels, so a tap anywhere picks it and a screen reader
   hears a radio group. The chosen card is marked by its edge and its tick, not by colour alone. */
.choices { display: grid; gap: 8px; margin: 8px 0 0; }
@media (min-width: 560px) { .choices.two { grid-template-columns: 1fr 1fr; } }
.choice {
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; align-items: start;
  min-height: 48px; padding: 12px 14px; border: 1px solid var(--pn-line-control); border-radius: 14px; background: var(--pn-card);
  color: var(--pn-text); cursor: pointer;
}
.choice input { grid-row: span 3; width: 24px; height: 24px; margin: 0; accent-color: var(--pn-accent); }
.choice .name { font-weight: 700; line-height: 22px; }
.choice .help { color: var(--pn-text-2); font-size: 15px; line-height: 21px; }
.choice:has(input:checked) { background: var(--pn-accent-soft); border-color: var(--pn-accent); box-shadow: inset 0 0 0 1px var(--pn-accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--pn-focus); outline-offset: 2px; }
.choice .swatches { margin-top: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills .choice { grid-template-columns: auto auto; padding: 10px 16px; border-radius: var(--r-full); align-items: center; }
.pills .choice input { grid-row: auto; margin: 0; }

/* The colour set's swatches and the name sketch: the DJ's own colours, set by script from the engine's
   lists (tools/look_palettes.json). Decorative: every set is also named in words beside them. */
.swatches { display: flex; gap: 0; }
.swatches span { width: 22px; height: 22px; border-radius: 50%; box-shadow: 0 0 0 2px var(--pn-card); background: var(--sw); }
.swatches span + span { margin-left: -4px; }
.sketch { margin: 12px 0 4px; padding: 20px 16px; border-radius: var(--r-card); background: var(--wm-void, var(--pn-sunken));
  border: 1px solid var(--wm-uv, var(--pn-line)); overflow: hidden; }
.sketch .l1, .sketch .l2 { display: block; color: var(--wm-ink, var(--pn-text)); font-family: var(--wm-font, var(--f-display)); font-weight: 900;
  text-transform: uppercase; line-height: var(--wm-leading, .9); letter-spacing: var(--wm-track, -.02em); font-size: clamp(32px, 11vw, 64px); }
.sketch .l2 { color: var(--wm-uv-soft, var(--pn-accent-text)); }
.sketch .bar { display: block; width: 44px; height: 4px; border-radius: 2px; margin-top: 12px; background: var(--wm-lamp, var(--pn-mark)); }
.sketch-note { color: var(--pn-text-3); font-size: 14px; margin: 4px 0 0; }
.letter-sample { font-weight: 900; text-transform: uppercase; font-size: 20px; line-height: 24px; letter-spacing: -.01em; }

/* ------------------------------------------------------------------ buttons */
button { font: 600 17px var(--f-body); border-radius: var(--r-full); min-height: 48px; cursor: pointer; color: inherit; }
button.go, button.ghost, a.btn, a.btn-ghost, main.page button, a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 48px;
  padding: 10px 20px; border-radius: var(--r-full); font: 600 17px/1.2 var(--f-body); text-decoration: none; text-align: center;
}
button.go, a.btn, main.page button, a.button { background: var(--pn-accent); color: var(--pn-on-accent); border: 1px solid var(--pn-accent); }
button.go:hover:not([disabled]), a.btn:hover, main.page button:hover, a.button:hover { background: var(--pn-accent-hover); border-color: var(--pn-accent-hover); }
button.ghost, a.btn-ghost { background: var(--pn-raised); color: var(--pn-text); border: 1px solid var(--pn-line-strong); }
button.ghost:hover:not([disabled]), a.btn-ghost:hover { background: var(--pn-hover); }
button[disabled] { opacity: .5; cursor: default; }
button.link { background: none; border: 0; padding: 4px 8px; color: var(--pn-accent-text); text-decoration: underline; text-underline-offset: 3px; min-height: 48px; }
button.danger, a.danger { color: var(--pn-bad-text); }
button.go.danger { background: var(--pn-bad-solid); border-color: var(--pn-bad-solid); color: var(--pn-on-bad); }
button.wide, a.wide { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 0; }
.btns > * { flex: 0 1 auto; }
@media (max-width: 420px) { .btns.stack > * { flex: 1 1 100%; } }
@media (hover: none) { button.go:hover:not([disabled]) { background: var(--pn-accent); } }

/* ------------------------------------------------------------------ notices, chips, lamps */
.notice {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; align-items: start; margin: 0 0 16px; padding: 16px;
  border: 1px solid var(--pn-line); border-radius: var(--r-card); background: var(--pn-card); color: var(--pn-text);
  box-shadow: inset 4px 0 0 var(--pn-accent), var(--sh-1);
}
.notice > .tile { grid-row: span 3; }
.notice > :not(.tile) { grid-column: 2; }
.notice h2, .notice h3 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 700; }
.notice p { margin: 2px 0 0; color: var(--pn-text); }
.notice.bad { background: var(--pn-bad-soft); border-color: transparent; box-shadow: inset 4px 0 0 var(--pn-bad); }
.notice.warn { background: var(--pn-warn-soft); border-color: transparent; box-shadow: inset 4px 0 0 var(--pn-warn); }
.notice.ok { background: var(--pn-ok-soft); border-color: transparent; box-shadow: inset 4px 0 0 var(--pn-ok); }
.notice.info { background: var(--pn-info-soft); border-color: transparent; box-shadow: inset 4px 0 0 var(--pn-info); }
.tile { display: inline-grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--r-tile); background: var(--pn-accent-soft); color: var(--pn-accent-text); font-weight: 800; }
.tile.ok { background: var(--pn-ok-soft); color: var(--pn-ok-text); box-shadow: inset 0 0 0 1px var(--pn-ok); }
.tile.warn { background: var(--pn-warn-soft); color: var(--pn-warn-text); box-shadow: inset 0 0 0 1px var(--pn-warn); }
.tile.bad { background: var(--pn-bad-soft); color: var(--pn-bad-text); box-shadow: inset 0 0 0 1px var(--pn-bad); }
.tile.info { background: var(--pn-info-soft); color: var(--pn-info-text); box-shadow: inset 0 0 0 1px var(--pn-info); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 26px; padding: 2px 10px; border-radius: var(--r-full);
  font-size: 14px; line-height: 18px; font-weight: 700; background: var(--pn-pressed); color: var(--pn-text-2);
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.chip.ok { background: var(--pn-ok-soft); color: var(--pn-ok-text); }
.chip.warn { background: var(--pn-warn-soft); color: var(--pn-warn-text); }
.chip.bad { background: var(--pn-bad-soft); color: var(--pn-bad-text); }
.chip.info { background: var(--pn-info-soft); color: var(--pn-info-text); }
.lamp { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 0 14px 0 12px; border-radius: var(--r-full);
  font-weight: 600; font-size: 15px; background: var(--pn-hover); color: var(--pn-text-2); }
.lamp .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pn-text-3); flex: none; }
.lamp.ok { background: var(--pn-ok-soft); color: var(--pn-ok-text); } .lamp.ok .dot { background: var(--pn-ok); }
.lamp.busy { background: var(--pn-info-soft); color: var(--pn-info-text); } .lamp.busy .dot { background: var(--pn-info); animation: breathe 1.6s var(--ease) infinite; }
.lamp.bad { background: var(--pn-bad-soft); color: var(--pn-bad-text); } .lamp.bad .dot { background: var(--pn-bad); }
.lamp.warn { background: var(--pn-warn-soft); color: var(--pn-warn-text); } .lamp.warn .dot { background: var(--pn-warn); }
@keyframes breathe { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.6); opacity: .55; } }

/* ------------------------------------------------------------------ steps: the progress list and a task's numbered steps */
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 0; }
.step + .step { border-top: 1px solid var(--pn-line); }
.step .ring { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--pn-line-control);
  font-size: 14px; font-weight: 800; color: var(--pn-on-accent); }
.step.s-done .ring { background: var(--pn-ok); box-shadow: none; }
.step.s-done .ring::before { content: ""; width: 10px; height: 6px; border-left: 2.5px solid var(--pn-on-bad); border-bottom: 2.5px solid var(--pn-on-bad); transform: translateY(-1px) rotate(-45deg); }
.step.s-now .ring { box-shadow: inset 0 0 0 3px var(--pn-accent); }
.step.s-now .ring::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--pn-accent); }
.step .label { flex: 1; min-width: 0; }
.step.s-done .label { color: var(--pn-text-2); }
.step.s-now .label { font-weight: 700; }
.step .state { color: var(--pn-text-3); font-size: 14px; }
.todo { list-style: none; margin: 12px 0 0; padding: 0; counter-reset: todo; }
.todo > li { position: relative; padding: 0 0 20px 44px; counter-increment: todo; }
.todo > li::before { content: counter(todo); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 50%; background: var(--pn-accent-soft-2); color: var(--pn-accent-text); font-weight: 800; font-size: 15px; }
.todo > li.done::before { content: ""; background: var(--pn-ok); }
.todo > li.done::after { content: ""; position: absolute; left: 10px; top: 9px; width: 10px; height: 6px; border-left: 2.5px solid var(--pn-on-bad);
  border-bottom: 2.5px solid var(--pn-on-bad); transform: rotate(-45deg); }
.todo h3 { margin: 2px 0 2px; }
.todo p { margin: 4px 0; color: var(--pn-text-2); }
.todo .btns { margin-top: 8px; }

/* ------------------------------------------------------------------ copy lines, nameservers, the key box */
/* A value and its Copy button side by side; on a narrow phone the button goes under it, so a nameserver
   is never broken in the middle. */
.copyline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.copyline > code, .copyline > output, .copyline > input { flex: 1 1 210px; min-width: 0; }
.copyline code, .copyline output { display: block; min-height: 48px; padding: 12px; border-radius: var(--r-field); background: var(--pn-sunken);
  border: 1px solid var(--pn-line); font: 600 15px/24px ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--pn-text); overflow-wrap: anywhere; }
.said { color: var(--pn-ok-text); font-weight: 600; font-size: 15px; min-height: 22px; margin: 0; }
.guide { margin: 8px 0 0; }
.guide summary { display: flex; align-items: center; min-height: 48px; cursor: pointer; font-weight: 700; color: var(--pn-accent-text); }
.guide ol, .guide ul { margin: 4px 0 8px; padding-left: 1.4rem; }
.guide li { margin: 4px 0; }

/* ------------------------------------------------------------------ You're live */
.live-url { font: 800 20px/28px var(--f-display); margin: 4px 0 0; }
.qr { width: min(240px, 70vw); margin: 16px auto 4px; padding: 0; background: #FFFFFF; border-radius: 12px; }
.qr svg { display: block; width: 100%; height: auto; }
.qr-note { text-align: center; color: var(--pn-text-2); font-size: 15px; margin: 0; }

/* ------------------------------------------------------------------ the SoundCloud check */
.sc-you { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; align-items: center; margin: 12px 0 0; padding: 12px;
  border: 1px solid var(--pn-line); border-radius: var(--r-card); background: var(--pn-sunken); }
.sc-you img { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; grid-row: span 2; background: var(--pn-hover); }
.sc-you .name { font-weight: 700; }
.sc-you .btns { grid-column: 1 / -1; margin: 4px 0 0; }

/* ------------------------------------------------------------------ the error summary (Check and build) */
.summary { margin: 0 0 20px; padding: 16px; border-radius: var(--r-card); background: var(--pn-bad-soft); box-shadow: inset 4px 0 0 var(--pn-bad); }
.summary h2 { font-size: 19px; line-height: 24px; }
.summary ul { margin: 8px 0 0; padding-left: 1.2rem; }
.summary li { margin: 6px 0; }
.summary a { color: var(--pn-text); font-weight: 600; }

/* ------------------------------------------------------------------ Scott's admin page */
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li { display: grid; gap: 4px; padding: 12px 0; border-top: 1px solid var(--pn-line); }
.rows > li:first-child { border-top: 0; }
.rows .top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.rows .name { font-weight: 700; }
.rows .sub { color: var(--pn-text-2); font-size: 15px; }
.rows .btns { margin-top: 4px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.cols { display: grid; gap: 0 24px; }
@media (min-width: 1024px) {
  .cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .cols > .span { grid-column: 1 / -1; }
}
.confirm { margin: 8px 0 0; padding: 12px; border-radius: 12px; background: var(--pn-bad-soft); }
.confirm p { margin: 0 0 4px; }

/* ------------------------------------------------------------------ the server-made pages (invite, privacy, sign-in) */
main.page h1 { margin: 8px 0 12px; }
main.page h2 { margin: 24px 0 8px; font-size: 20px; }
main.page ul { padding-left: 1.2rem; }
main.page li { margin: 6px 0; }
main.page .small { font-size: 15px; color: var(--pn-text-2); }
main.page code { display: block; overflow-wrap: anywhere; padding: 12px; background: var(--pn-sunken); border-radius: 10px; font-size: 16px; }
main.page form { margin: 16px 0; }
main.page label { display: block; font-weight: 600; margin: 0 0 6px; }

/* ------------------------------------------------------------------ less motion, forced colours */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
  .lamp.busy .dot { animation: none; }
}
@media (forced-colors: active) {
  .choice:has(input:checked) { outline: 2px solid Highlight; }
  .lamp .dot, .chip::before, .step.s-done .ring, .step.s-now .ring::before { forced-color-adjust: none; background: CanvasText; }
  .qr { forced-color-adjust: none; }
}
