/*
 * Classes mockups: static stylesheet.
 * Colours, type, radii and spacing are copied from @festivals/ui (engineering/packages/ui/src/theme.css)
 * and product/design/tokens/*.json (Sage palette, Atkinson Hyperlegible Next, decision 0057).
 * Themes follow theme.css: light on :root, dark under .dark or the OS preference unless .light.
 * Fonts are self-hosted (OFL-1.1, assets/fonts/OFL-LICENSE.txt); no font CDN.
 */

@font-face {
  font-family: 'Atkinson Hyperlegible Next Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range:
    U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329,
    U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2) format('woff2-variations');
  unicode-range:
    U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329,
    U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Mono Variable';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(fonts/atkinson-hyperlegible-mono-latin-wght-normal.woff2) format('woff2-variations');
}

:root {
  color-scheme: light;
  --radius: 0.75rem;
  --background: oklch(0.972 0.01 85);
  --foreground: oklch(0.22 0.012 60);
  --card: oklch(0.994 0.004 85);
  --card-foreground: oklch(0.22 0.012 60);
  --muted: oklch(0.938 0.012 85);
  --muted-foreground: oklch(0.47 0.014 60);
  --secondary: oklch(0.938 0.012 85);
  --accent: oklch(0.925 0.035 165);
  --accent-foreground: oklch(0.3 0.07 165);
  --primary: oklch(0.42 0.085 165);
  --primary-foreground: oklch(0.985 0.005 85);
  --border: oklch(0.88 0.013 85);
  --input: oklch(0.62 0.013 85);
  --ring: oklch(0.55 0.09 165);
  --destructive: oklch(0.5 0.19 27);
  --destructive-foreground: oklch(0.985 0.005 27);
  --success: oklch(0.48 0.11 150);
  --success-foreground: oklch(0.985 0.005 150);
  --warning: oklch(0.52 0.12 65);
  --info: oklch(0.5 0.12 250);
  --overlay: rgb(30 26 22 / 0.45);
  --chart-1: oklch(0.54 0.1 190);
  --chart-2: oklch(0.6 0.14 55);
  --camera: oklch(0.24 0.01 85);

  --font-sans: 'Atkinson Hyperlegible Next Variable', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'Atkinson Hyperlegible Mono Variable', ui-monospace, monospace;
  --ctl: 44px;
}

.dark {
  color-scheme: dark;
  --background: oklch(0.2 0.008 85);
  --foreground: oklch(0.95 0.004 85);
  --card: oklch(0.235 0.008 85);
  --card-foreground: oklch(0.95 0.004 85);
  --muted: oklch(0.28 0.008 85);
  --muted-foreground: oklch(0.75 0.014 85);
  --secondary: oklch(0.28 0.008 85);
  --accent: oklch(0.32 0.05 165);
  --accent-foreground: oklch(0.9 0.06 165);
  --primary: oklch(0.78 0.11 165);
  --primary-foreground: oklch(0.2 0.03 165);
  --border: oklch(0.34 0.008 85);
  --input: oklch(0.56 0.008 85);
  --ring: oklch(0.7 0.1 165);
  --destructive: oklch(0.72 0.17 27);
  --destructive-foreground: oklch(0.2 0.03 27);
  --success: oklch(0.78 0.12 150);
  --success-foreground: oklch(0.2 0.03 150);
  --warning: oklch(0.82 0.12 80);
  --info: oklch(0.78 0.1 250);
  --overlay: rgb(0 0 0 / 0.6);
  --chart-1: oklch(0.78 0.09 190);
  --chart-2: oklch(0.8 0.12 60);
}
@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    color-scheme: dark;
    --background: oklch(0.2 0.008 85);
    --foreground: oklch(0.95 0.004 85);
    --card: oklch(0.235 0.008 85);
    --card-foreground: oklch(0.95 0.004 85);
    --muted: oklch(0.28 0.008 85);
    --muted-foreground: oklch(0.75 0.014 85);
    --secondary: oklch(0.28 0.008 85);
    --accent: oklch(0.32 0.05 165);
    --accent-foreground: oklch(0.9 0.06 165);
    --primary: oklch(0.78 0.11 165);
    --primary-foreground: oklch(0.2 0.03 165);
    --border: oklch(0.34 0.008 85);
    --input: oklch(0.56 0.008 85);
    --ring: oklch(0.7 0.1 165);
    --destructive: oklch(0.72 0.17 27);
    --destructive-foreground: oklch(0.2 0.03 27);
    --success: oklch(0.78 0.12 150);
    --success-foreground: oklch(0.2 0.03 150);
    --warning: oklch(0.82 0.12 80);
    --info: oklch(0.78 0.1 250);
    --overlay: rgb(0 0 0 / 0.6);
    --chart-1: oklch(0.78 0.09 190);
    --chart-2: oklch(0.8 0.12 60);
  }
}

@media (pointer: coarse) {
  :root {
    --ctl: 48px;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
h1,
h2,
h3,
h4,
p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
}
ul,
ol {
  padding: 0;
  list-style: none;
}
img,
svg {
  display: block;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
a:hover {
  text-decoration-thickness: 2px;
}
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}
.no-ul {
  text-decoration: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.skip {
  position: absolute;
  left: 8px;
  top: -60px;
  z-index: 200;
  background: var(--card);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--input);
}
.skip:focus {
  top: 8px;
}
.icon {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.sm {
  width: 16px;
  height: 16px;
}
.icon.lg {
  width: 24px;
  height: 24px;
}
.icon.xl {
  width: 32px;
  height: 32px;
}

/* ---------- Type ---------- */
.display {
  font-size: 32px;
  line-height: 40px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.h1 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.h2 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}
.h3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
}
.body {
  font-size: 16px;
  line-height: 24px;
}
.sm {
  font-size: 14px;
  line-height: 20px;
}
.label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.caption {
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
}
.mono {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 20px;
}
.muted {
  color: var(--muted-foreground);
}
.semibold {
  font-weight: 600;
}
.medium {
  font-weight: 500;
}
.num {
  font-variant-numeric: tabular-nums;
}
.prose {
  max-width: 72ch;
}
.text-success {
  color: var(--success);
}
.text-warning {
  color: var(--warning);
}
.text-destructive {
  color: var(--destructive);
}

/* ---------- Layout helpers ---------- */
.stack {
  display: flex;
  flex-direction: column;
}
.row {
  display: flex;
  align-items: center;
}
.wrap {
  flex-wrap: wrap;
}
.between {
  justify-content: space-between;
}
.start {
  align-items: flex-start;
}
.grow {
  flex: 1 1 auto;
  min-width: 0;
}
.g1 {
  gap: 4px;
}
.g2 {
  gap: 8px;
}
.g3 {
  gap: 12px;
}
.g4 {
  gap: 16px;
}
.g6 {
  gap: 24px;
}
.g8 {
  gap: 32px;
}
.mt2 {
  margin-top: 8px;
}
.mt3 {
  margin-top: 12px;
}
.mt4 {
  margin-top: 16px;
}
.mt6 {
  margin-top: 24px;
}
.mt8 {
  margin-top: 32px;
}
.right {
  text-align: right;
}
.center {
  text-align: center;
}
.hide-phone {
}
@media (max-width: 767px) {
  .hide-phone {
    display: none !important;
  }
}
@media (min-width: 768px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ---------- Buttons (Design System #510) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--ctl);
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  background: none;
}
.btn:hover {
  text-decoration: none;
}
.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover {
  background: color-mix(in oklch, var(--primary), var(--foreground) 12%);
}
.btn-outline {
  background: var(--card);
  border-color: var(--input);
  color: var(--foreground);
}
.btn-outline:hover {
  background: var(--accent);
}
.btn-ghost {
  color: var(--foreground);
}
.btn-ghost:hover {
  background: var(--muted);
}
.btn-destructive {
  background: color-mix(in oklch, var(--destructive) 10%, transparent);
  color: var(--destructive);
}
.btn-destructive:hover {
  background: color-mix(in oklch, var(--destructive) 16%, transparent);
}
.btn-link {
  padding: 0;
  min-height: 44px;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.btn-lg {
  min-height: 52px;
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  padding: 0 20px;
}
.btn-block {
  width: 100%;
}
.btn-icon {
  width: var(--ctl);
  padding: 0;
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  white-space: nowrap;
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid transparent;
}
.badge .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.badge.outline {
  background: var(--card);
  border-color: var(--input);
}
.badge.success {
  background: color-mix(in oklch, var(--success) 14%, var(--card));
  color: color-mix(in oklch, var(--success), var(--foreground) 35%);
}
.badge.success .dot {
  background: var(--success);
}
.badge.warning {
  background: color-mix(in oklch, var(--warning) 16%, var(--card));
  color: color-mix(in oklch, var(--warning), var(--foreground) 45%);
}
.badge.warning .dot {
  background: var(--warning);
}
.badge.destructive {
  background: color-mix(in oklch, var(--destructive) 12%, var(--card));
  color: var(--destructive);
}
.badge.info {
  background: color-mix(in oklch, var(--info) 14%, var(--card));
  color: color-mix(in oklch, var(--info), var(--foreground) 35%);
}
.badge.solid {
  background: var(--primary);
  color: var(--primary-foreground);
}
.badge.count {
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  justify-content: center;
  background: var(--foreground);
  color: var(--background);
}

/* ---------- Surfaces ---------- */
.card {
  background: var(--card);
  color: var(--card-foreground);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.card-pad {
  padding: 24px;
}
.card-pad-sm {
  padding: 16px;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  min-height: 64px;
}
.card-body {
  padding: 20px;
}
.divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}
.list > li + li,
.list > a + a,
.list > div + div {
  border-top: 1px solid var(--border);
}
.muted-box {
  background: var(--muted);
  border-radius: 8px;
  padding: 12px 14px;
}

/* ---------- Alerts ---------- */
.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  font-size: 14px;
  line-height: 20px;
}
.alert .icon {
  margin-top: 0;
}
.alert-title {
  font-weight: 600;
}
.alert.info {
  border-color: color-mix(in oklch, var(--info) 45%, var(--border));
  background: color-mix(in oklch, var(--info) 8%, var(--card));
}
.alert.info > .icon {
  color: var(--info);
}
.alert.warning {
  border-color: color-mix(in oklch, var(--warning) 55%, var(--border));
  background: color-mix(in oklch, var(--warning) 10%, var(--card));
}
.alert.warning > .icon {
  color: var(--warning);
}
.alert.destructive {
  border-color: color-mix(in oklch, var(--destructive) 50%, var(--border));
  background: color-mix(in oklch, var(--destructive) 8%, var(--card));
}
.alert.destructive > .icon {
  color: var(--destructive);
}
.alert.success {
  border-color: color-mix(in oklch, var(--success) 50%, var(--border));
  background: color-mix(in oklch, var(--success) 8%, var(--card));
}
.alert.success > .icon {
  color: var(--success);
}

/* ---------- Forms ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.field > label,
.field-label {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
}
.field .hint {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted-foreground);
}
.field .error {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 20px;
  color: var(--destructive);
}
.input,
.textarea,
.select {
  width: 100%;
  min-height: var(--ctl);
  padding: 0 12px;
  background: var(--card);
  border: 1px solid var(--input);
  border-radius: 8px;
  font-size: 16px;
  line-height: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.input.invalid {
  border-color: var(--destructive);
  box-shadow: 0 0 0 1px var(--destructive);
}
.textarea {
  padding: 10px 12px;
  min-height: 120px;
  resize: vertical;
  display: block;
}
.input:focus,
.textarea:focus {
  outline: 2px solid var(--ring);
  outline-offset: 0;
}
.select {
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
}
.input-group {
  display: flex;
  align-items: stretch;
}
.input-group .addon {
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--input);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: var(--muted);
  color: var(--muted-foreground);
  font-size: 14px;
}
.input-group .input {
  border-radius: 0 8px 8px 0;
}
.input-group .addon.end {
  border-right: 1px solid var(--input);
  border-left: 0;
  border-radius: 0 8px 8px 0;
}
.input-group .input.has-end {
  border-radius: 8px 0 0 8px;
}
.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}
.check .box {
  width: 20px;
  height: 20px;
  margin-top: 0;
  border: 1px solid var(--input);
  border-radius: 4px;
  background: var(--card);
  flex: none;
  display: grid;
  place-items: center;
}
.check .box.on {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}
.switch {
  width: 44px;
  height: 26px;
  border-radius: 9999px;
  background: var(--input);
  position: relative;
  flex: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--card);
}
.switch.on,
.switch[aria-checked='true'] {
  background: var(--primary);
}
.switch.on::after,
.switch[aria-checked='true']::after {
  left: 21px;
  background: var(--primary-foreground);
}
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}
.radio {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--input);
  background: var(--card);
  flex: none;
  display: grid;
  place-items: center;
}
.radio.on {
  border: 2px solid var(--primary);
}
.radio.on::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
}
.radio.off-disabled {
  background: var(--muted);
}
.choice {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  cursor: pointer;
  text-decoration: none;
}
.choice.selected {
  border: 2px solid var(--primary);
  padding: 15px;
}
.choice.unavailable {
  background: var(--muted);
  cursor: not-allowed;
}
.choice .radio {
  margin-top: 2px;
}

/* Segmented control */
.seg {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  background: var(--muted);
  border-radius: 10px;
}
.seg > * {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: none;
  font-size: 14px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--muted-foreground);
  text-decoration: none;
}
.seg > [aria-pressed='true'],
.seg > [aria-selected='true'],
.seg > .on {
  background: var(--card);
  border-color: var(--input);
  color: var(--foreground);
  font-weight: 600;
}

/* Tabs (indicator on the row line) */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tabs > * {
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  background: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-foreground);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.tabs > [aria-selected='true'] {
  color: var(--foreground);
  font-weight: 600;
  border-bottom-color: var(--primary);
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 20px;
}
.table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted-foreground);
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.table tr:last-child td {
  border-bottom: 0;
}
.table .r {
  text-align: right;
}
.table tbody tr.link-row:hover {
  background: color-mix(in oklch, var(--muted) 60%, transparent);
}
.table a.cell-link {
  font-weight: 600;
  text-decoration: none;
}
.table a.cell-link:hover {
  text-decoration: underline;
}

/* Meter */
.meter {
  height: 6px;
  border-radius: 9999px;
  background: var(--muted);
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 9999px;
}
.meter.full > span {
  background: var(--foreground);
}

/* Avatars and logos */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: var(--accent-foreground);
  font-size: 12px;
  font-weight: 600;
  flex: none;
}
.avatar.lg {
  width: 40px;
  height: 40px;
  font-size: 14px;
}
.org-logo {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex: none;
}
.org-logo.sm {
  width: 40px;
  height: 40px;
}

/* Product mark (working name, neutral wordmark) */
.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: -0.01em;
}
.mark-glyph {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-foreground);
  display: grid;
  place-items: center;
}

/* ---------- Dialog (CSS :target, no script) ---------- */
.dialog-wrap {
  position: fixed;
  inset: 0;
  z-index: 64;
  background: var(--overlay);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.dialog-wrap:target,
.dialog-wrap.open {
  display: flex;
}
.dialog {
  width: 100%;
  max-width: 28rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}
.dialog.wide {
  max-width: 36rem;
}
.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}
@media (max-width: 767px) {
  .dialog-wrap {
    align-items: flex-end;
    padding: 0;
  }
  .dialog {
    max-width: none;
    border-radius: 16px 16px 0 0;
    padding: 24px 16px calc(16px + env(safe-area-inset-bottom));
  }
  .dialog-actions {
    flex-direction: column-reverse;
  }
  .dialog-actions .btn {
    width: 100%;
  }
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 128;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 10px 10px 16px;
  border-radius: 12px;
  background: var(--foreground);
  color: var(--background);
  font-size: 14px;
  line-height: 20px;
  width: max-content;
  max-width: calc(100vw - 32px);
}
.toast .btn {
  min-height: 36px;
  color: var(--background);
  border-color: color-mix(in oklch, var(--background) 45%, transparent);
  background: transparent;
}

/* ---------- Demo controls (prototype only, like the export's "Demo controls") ---------- */
.demo {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 150;
  font-size: 14px;
}
.demo > button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  font-weight: 500;
}
.demo-panel {
  display: none;
  position: absolute;
  bottom: 48px;
  left: 0;
  width: 260px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  flex-direction: column;
  gap: 10px;
}
.demo.open .demo-panel {
  display: flex;
}
.demo-panel .seg {
  width: 100%;
}
.demo-panel .seg > * {
  flex: 1;
  justify-content: center;
  padding: 0 6px;
}
html.shot .demo {
  display: none;
}

/* ======================================================================
   Student web app (class-student-web)
   ====================================================================== */
.s-header {
  border-bottom: 1px solid var(--border);
  background: var(--background);
}
.s-header-in {
  max-width: 64rem;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}
.s-header .who {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  min-width: 0;
}
.s-header .who b {
  font-weight: 600;
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.s-main {
  max-width: 64rem;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.s-narrow {
  max-width: 30rem;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
@media (min-width: 768px) {
  .s-header-in {
    padding: 12px 32px;
  }
  .s-main {
    padding: 40px 32px 64px;
  }
  .s-narrow {
    padding: 40px 0 64px;
  }
}
.s-footer {
  border-top: 1px solid var(--border);
}
.s-footer-in {
  max-width: 64rem;
  margin: 0 auto;
  padding: 20px 16px 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--muted-foreground);
}
.s-footer a {
  color: var(--muted-foreground);
}
@media (min-width: 768px) {
  .s-footer-in {
    padding: 24px 32px 8px;
  }
}

/* Organizer hero on the public page */
.org-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 14px;
  line-height: 20px;
}
.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--primary);
}
.stars {
  display: inline-flex;
  gap: 2px;
  color: var(--foreground);
}
.stars .icon {
  width: 16px;
  height: 16px;
}
.stars .on {
  fill: currentColor;
}
.stars.lg .icon {
  width: 32px;
  height: 32px;
}

/* Class rows */
.day-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 20px 0 8px;
  font-size: 14px;
  font-weight: 600;
}
.day-head .muted {
  font-weight: 500;
}
.class-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 4px 16px;
  align-items: center;
  padding: 14px 16px;
  text-decoration: none;
  min-height: 72px;
}
.class-row:hover {
  background: color-mix(in oklch, var(--muted) 55%, transparent);
}
.class-row .time {
  font-weight: 600;
  font-size: 16px;
}
.class-row .time small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  line-height: 16px;
}
.class-row .title {
  font-weight: 600;
}
.class-row .meta {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted-foreground);
}
.class-row .end {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}
.class-row.cancelled .title {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Checkout */
.steps {
  font-size: 14px;
  color: var(--muted-foreground);
  font-weight: 500;
}
.sticky-pay {
  position: sticky;
  bottom: 0;
  background: var(--card);
  border-top: 1px solid var(--border);
  z-index: 16;
}
.sticky-pay-in {
  max-width: 30rem;
  margin: 0 auto;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 16px;
}
.sticky-pay .total {
  display: flex;
  flex-direction: column;
}
.sticky-pay .total b {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}
@media (min-width: 768px) {
  .sticky-pay-in {
    padding: 12px 0;
  }
}
.summary-line {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}
.summary-line + .summary-line {
  border-top: 1px solid var(--border);
}
.summary-total {
  display: flex;
  justify-content: space-between;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--foreground);
  font-weight: 600;
  font-size: 18px;
  line-height: 28px;
}
.dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 10px 16px;
  font-size: 14px;
  line-height: 20px;
}
.dl dt {
  color: var(--muted-foreground);
}
.icon-line {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.icon-line > .icon {
  margin-top: 2px;
  color: var(--muted-foreground);
}

/* Map placeholder (two-click map, 0076) */
.map-consent {
  border: 1px dashed var(--input);
  border-radius: 12px;
  background: var(--muted);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-start;
}

/* QR tile: black on white in both themes */
.qr-tile {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  display: inline-block;
}
.qr-tile img {
  width: 100%;
  height: auto;
  image-rendering: pixelated;
}
.qr-full {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 16px 32px;
  gap: 20px;
}

/* Status page icon */
.status-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--muted);
}
.status-icon.success {
  background: color-mix(in oklch, var(--success) 16%, var(--card));
  color: var(--success);
}
.status-icon.destructive {
  background: color-mix(in oklch, var(--destructive) 14%, var(--card));
  color: var(--destructive);
}
.status-icon.warning {
  background: color-mix(in oklch, var(--warning) 18%, var(--card));
  color: var(--warning);
}

.code-inputs {
  display: flex;
  gap: 8px;
}
.code-inputs span {
  flex: 1;
  height: 56px;
  max-width: 52px;
  border: 1px solid var(--input);
  border-radius: 8px;
  background: var(--card);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 500;
}
.code-inputs span.focus {
  outline: 2px solid var(--ring);
  outline-offset: 0;
}

.banner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  background: var(--muted);
  color: var(--foreground);
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  padding: 8px 16px;
}
.banner.preview {
  background: var(--foreground);
  color: var(--background);
  font-weight: 500;
}

/* ======================================================================
   Organizer dashboard (class-organizer-web)
   ====================================================================== */
.o-top {
  height: 64px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  background: var(--background);
  position: sticky;
  top: 0;
  z-index: 16;
}
.o-top .user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  min-height: 44px;
  padding: 0 8px;
  border-radius: 8px;
  text-decoration: none;
}
.o-shell {
  display: grid;
  grid-template-columns: 256px 1fr;
  min-height: calc(100vh - 64px);
}
.o-side {
  border-right: 1px solid var(--border);
  padding: 20px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.o-side .org {
  padding: 4px 12px 16px;
}
.o-side .org b {
  display: block;
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--foreground);
}
.nav-item:hover {
  background: var(--muted);
}
.nav-item[aria-current='page'] {
  background: var(--accent);
  color: var(--accent-foreground);
  font-weight: 600;
}
.nav-item .icon {
  width: 18px;
  height: 18px;
}
.nav-item .badge {
  margin-left: auto;
}
.nav-sep {
  border-top: 1px solid var(--border);
  margin: 12px 0;
}
.nav-group {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
  padding: 12px 12px 4px;
}
.o-main {
  padding: 32px;
  min-width: 0;
}
.page-wide {
  max-width: 80rem;
}
.page-form {
  max-width: 45rem;
}
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.page-head .sub {
  font-size: 14px;
  line-height: 20px;
  color: var(--muted-foreground);
  margin-top: 4px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: var(--muted-foreground);
  text-decoration: none;
  min-height: 32px;
  margin-bottom: 8px;
}
.back:hover {
  color: var(--foreground);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.stat {
  padding: 20px;
}
.stat .k {
  font-size: 14px;
  color: var(--muted-foreground);
}
.stat .v {
  font-size: 28px;
  line-height: 36px;
  font-weight: 600;
  margin: 4px 0 2px;
}
.stat .s {
  font-size: 14px;
  color: var(--muted-foreground);
}
.o-phonebar {
  display: none;
}
@media (max-width: 1023px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 767px) {
  .o-top {
    display: none;
  }
  .o-phonebar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 60px;
    padding: 0 8px 0 4px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--background);
    z-index: 16;
  }
  .o-phonebar .sec {
    display: flex;
    flex-direction: column;
    line-height: 18px;
  }
  .o-phonebar .sec small {
    font-size: 12px;
    color: var(--muted-foreground);
    font-weight: 500;
  }
  .o-phonebar .sec b {
    font-size: 15px;
    font-weight: 600;
  }
  .o-shell {
    display: block;
  }
  .o-side {
    display: none;
  }
  .o-main {
    padding: 16px 16px 96px;
  }
  .page-head {
    margin-bottom: 16px;
  }
  .table-phone-cards thead {
    display: none;
  }
}
/* Phone drawer */
.drawer {
  display: none;
}
.drawer.open {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 64;
  background: var(--overlay);
}
.drawer.open .drawer-panel {
  width: min(320px, 86vw);
  height: 100%;
  background: var(--background);
  border-right: 1px solid var(--border);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: auto;
}

/* Week list (organizer schedule) */
.occ-row {
  display: grid;
  grid-template-columns: 112px 1fr 180px 150px 32px;
  gap: 16px;
  align-items: center;
  padding: 14px 20px;
  text-decoration: none;
  min-height: 72px;
}
.occ-row:hover {
  background: color-mix(in oklch, var(--muted) 55%, transparent);
}
.occ-row .when b {
  display: block;
  font-weight: 600;
}
.occ-row .when span {
  font-size: 14px;
  color: var(--muted-foreground);
}
.occ-row .what b {
  font-weight: 600;
}
.occ-row .what div {
  font-size: 14px;
  color: var(--muted-foreground);
  line-height: 20px;
}
.occ-row .cap {
  font-size: 14px;
}
.occ-row.is-cancelled .what b {
  text-decoration: line-through;
}
.week-title {
  margin-left: 8px;
  white-space: nowrap;
}
@media (max-width: 767px) {
  .occ-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: 'when mark' 'what what' 'cap cap';
    gap: 4px 12px;
    padding: 14px 16px;
  }
  .occ-row .when {
    grid-area: when;
    display: flex;
    gap: 8px;
    align-items: baseline;
  }
  .occ-row .what {
    grid-area: what;
  }
  .occ-row .capc {
    grid-area: cap;
    display: flex;
    flex-wrap: wrap;
    gap: 0 8px;
    align-items: baseline;
    margin-top: 4px;
  }
  .occ-row .markc {
    grid-area: mark;
  }
  .occ-row .chev {
    display: none;
  }
  .week-title {
    font-size: 18px;
    margin-left: 4px;
  }
}

/* Check-in */
.checkin-list .item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  min-height: 64px;
}
.checkin-list .item .who {
  flex: 1;
  min-width: 0;
}
.checkin-list .item .who b {
  font-weight: 600;
  display: block;
}
.checkin-list .item .who span {
  font-size: 14px;
  color: var(--muted-foreground);
}
.scan-stage {
  position: relative;
  background: var(--camera);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  max-height: 62vh;
  display: grid;
  place-items: center;
}
.scan-stage .frame {
  width: 64%;
  aspect-ratio: 1;
  position: relative;
}
.scan-stage .frame i {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 4px solid #ffffff;
}
.scan-stage .frame i:nth-child(1) {
  top: 0;
  left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 12px 0 0 0;
}
.scan-stage .frame i:nth-child(2) {
  top: 0;
  right: 0;
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 12px 0 0;
}
.scan-stage .frame i:nth-child(3) {
  bottom: 0;
  left: 0;
  border-right: 0;
  border-top: 0;
  border-radius: 0 0 0 12px;
}
.scan-stage .frame i:nth-child(4) {
  bottom: 0;
  right: 0;
  border-left: 0;
  border-top: 0;
  border-radius: 0 0 12px 0;
}
.scan-stage .phone-in-view {
  position: absolute;
  inset: 16% 18%;
  background: #ffffff;
  border-radius: 8px;
  padding: 8%;
  opacity: 0.92;
  transform: rotate(-4deg);
}
.scan-stage .cap {
  position: absolute;
  bottom: 16px;
  left: 0;
  right: 0;
  text-align: center;
  color: #ffffff;
  font-weight: 500;
  font-size: 14px;
}
.result {
  border-radius: 16px;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 2px solid var(--border);
  background: var(--card);
}
.result .outcome {
  display: flex;
  gap: 14px;
  align-items: center;
}
.result .outcome .status-icon {
  width: 56px;
  height: 56px;
}
.result .outcome b {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
}
.result.ok {
  border-color: var(--success);
  background: color-mix(in oklch, var(--success) 7%, var(--card));
}
.result.warn {
  border-color: var(--warning);
  background: color-mix(in oklch, var(--warning) 8%, var(--card));
}
.result.bad {
  border-color: var(--destructive);
  background: color-mix(in oklch, var(--destructive) 6%, var(--card));
}
.result.neutral {
  border-color: var(--input);
}
.person-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}
.person-line + .person-line {
  border-top: 1px solid var(--border);
}

/* Setup checklist */
.check-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  text-decoration: none;
  min-height: 72px;
}
.check-item:hover {
  background: color-mix(in oklch, var(--muted) 55%, transparent);
}
.check-item .tick {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  border: 2px solid var(--input);
}
.check-item .tick.done {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-foreground);
}

/* ======================================================================
   Index and pitch
   ====================================================================== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.gallery a.card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  text-decoration: none;
  min-height: 112px;
}
.gallery a.card:hover {
  border-color: var(--input);
  background: color-mix(in oklch, var(--accent) 35%, var(--card));
}
.gallery .ids {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}
.tag {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  background: var(--background);
}
.num-badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 22px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--foreground);
  color: var(--background);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
}

.phone-frame {
  width: 300px;
  height: 620px;
  border-radius: 40px;
  border: 10px solid oklch(0.22 0.012 60);
  background: var(--background);
  overflow: hidden;
  position: relative;
  flex: none;
}
.dark .phone-frame {
  border-color: oklch(0.36 0.008 85);
}
@media (prefers-color-scheme: dark) {
  :root:not(.light) .phone-frame {
    border-color: oklch(0.36 0.008 85);
  }
}
.phone-frame iframe {
  width: 390px;
  height: 820px;
  border: 0;
  transform: scale(0.7179);
  transform-origin: 0 0;
  pointer-events: none;
}

/* Full-page screenshots: sticky bars sit at the end of the page instead of mid-capture. */
html.shot .sticky-pay,
html.shot .o-top,
html.shot .o-phonebar {
  position: static;
}

/* Fields side by side align on their labels; segmented controls keep their own width. */
.row > .field {
  align-self: flex-start;
}
.field > .seg {
  align-self: flex-start;
}

/* Phone: tables become stacked rows (first cell left, a pinned status or amount right). */
@media (max-width: 767px) {
  .table.stacked thead {
    display: none;
  }
  .table.stacked,
  .table.stacked tbody {
    display: block;
  }
  .table.stacked tr {
    display: flex;
    flex-wrap: wrap;
    gap: 2px 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
  }
  .table.stacked tr:last-child {
    border-bottom: 0;
  }
  .table.stacked td {
    display: block;
    padding: 0;
    border: 0;
    flex: 1 1 100%;
    order: 2;
    text-align: left;
  }
  .table.stacked td:first-child {
    flex: 1 1 0;
    order: 0;
    min-width: 0;
  }
  .table.stacked td.pin {
    flex: 0 0 auto;
    order: 1;
    text-align: right;
  }
  .table.stacked td.acts {
    margin-top: 6px;
  }
  .table.stacked td.acts .row {
    justify-content: flex-start !important;
  }
  .table.stacked td:not(:first-child):not(.pin) {
    color: var(--muted-foreground);
    font-size: 14px;
  }
}
@media (max-width: 767px) {
  .table.stacked td[data-label]:not(:first-child):not(.pin):not(.acts)::before {
    content: attr(data-label) ': ';
  }
}
.link-kind {
  width: 10rem;
  flex: none;
}
@media (max-width: 767px) {
  .link-kind {
    width: 8rem;
    padding: 0 10px;
  }
}

/* Prototype notice at the end of every screen. */
.proto-note {
  max-width: 64rem;
  margin: 0 auto;
  padding: 12px 16px 72px;
  text-align: center;
  font-size: 14px;
  line-height: 20px;
  color: var(--muted-foreground);
}
html.shot .proto-note {
  padding-bottom: 16px;
}
