/* Colours, light position and the cell size (--u) are set on :root by the engine from the palette. */
:root {
  --bg: #09090b;
  --bg-hi: rgba(255, 255, 255, 0.05);
  --wall: #0e0e11;
  --wall-hi: #17171b;
  --frame-a: #3b3b42;
  --frame-b: #050506;
  --frame-edge: rgba(255, 255, 255, 0.09);
  --ui: #ecebe6;
  --panel: #17171b;
  --accent: #ff5b47;
  --lpx: 8%;
  --lpy: 0%;
  --lx: -0.7;
  --ly: -0.7;
  --langle: 135deg;
  --u: 40px;
  --fw: 8px;
  --pad-t: 16px;
  --pad-b: 16px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-quint: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --edge: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "PingFang SC", "Hiragino Sans", "Malgun Gothic", sans-serif;
  color-scheme: dark;
}
:root[data-mode="light"] {
  --bg: #e9e5dd;
  --ui: #23201b;
  --panel: #f4f1ea;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* No long-press selection or callout, no tap flash, no pull-to-refresh; js/no-gestures.js does the rest. */
html, body {
  touch-action: manipulation;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
body {
  overflow: hidden;
  background-color: var(--bg);
  font-family: var(--font);
  color: var(--ui);
  letter-spacing: -0.005em;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  transition: background-color .5s ease-out;
}
button, input { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.sr {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.noscript { position: fixed; inset: auto 0 40% 0; text-align: center; opacity: .7; }

/* Insets of the safe area as padding, read by the engine when it fits the wall. */
#sa-probe {
  position: fixed;
  visibility: hidden;
  pointer-events: none;
  padding: var(--safe-t) var(--safe-r) var(--safe-b) var(--safe-l);
}

/* Room light from the chosen source plus a vignette; an overlay so the flat colour can still fade. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(90% 80% at var(--lpx) var(--lpy), var(--bg-hi), transparent 70%),
    radial-gradient(140% 120% at 50% 45%, transparent 45%, rgba(0, 0, 0, 0.22) 100%);
  transition: background .5s ease-out;
}
:root[data-mode="light"] body::before {
  background:
    radial-gradient(90% 80% at var(--lpx) var(--lpy), var(--bg-hi), transparent 72%),
    radial-gradient(140% 120% at 50% 45%, transparent 50%, rgba(40, 30, 10, 0.10) 100%);
}

/* ===== the wall ===== */
#stage {
  position: relative;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: var(--pad-t) 0 var(--pad-b);
  transition: padding .45s var(--ease-quint);
}
#wall {
  position: relative;
  touch-action: none;
  border: var(--fw) solid transparent;
  border-radius: calc(var(--u) * 0.12 + var(--fw));
  background:
    radial-gradient(120% 110% at var(--lpx) var(--lpy), var(--wall-hi), var(--wall) 75%) padding-box,
    linear-gradient(var(--langle), var(--frame-a), var(--frame-b) 70%) border-box;
  box-shadow:
    0 0 0 1px var(--frame-edge),
    calc(var(--lx) * var(--u) * -0.35) calc(var(--ly) * var(--u) * -0.35 + var(--u) * 0.2) calc(var(--u) * 1.2) rgba(0, 0, 0, 0.45),
    inset calc(var(--lx) * var(--u) * -0.08) calc(var(--ly) * var(--u) * -0.08) calc(var(--u) * 0.25) rgba(0, 0, 0, 0.35),
    inset 0 0 0 1px rgba(0, 0, 0, 0.25);
  transition: border-radius .3s ease-out, opacity .26s ease-in, scale .26s ease-in, filter .26s ease-in;
}
:root[data-mode="light"] #wall {
  box-shadow:
    0 0 0 1px var(--frame-edge),
    calc(var(--lx) * var(--u) * -0.3) calc(var(--ly) * var(--u) * -0.3 + var(--u) * 0.18) calc(var(--u) * 1.1) rgba(60, 46, 20, 0.22),
    inset calc(var(--lx) * var(--u) * -0.06) calc(var(--ly) * var(--u) * -0.06) calc(var(--u) * 0.2) rgba(40, 30, 10, 0.16),
    inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
html.frame-none #wall { background: none; box-shadow: none; border-color: transparent; }
#wall canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: calc(var(--u) * 0.12);
  touch-action: none;
}
#fade { opacity: 0; pointer-events: none; }
#fade.out { transition: opacity .55s ease-out; }
/* While the wall rebuilds for a new size or frame it dims away; the intro then raises the new one. */
#wall.leaving { opacity: 0; scale: .985; filter: blur(2px); }

/* ===== shared glass ===== */
.glass {
  border: 1px solid color-mix(in srgb, var(--ui) 16%, transparent);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ui) 8%, transparent) inset, 0 6px 18px rgba(0, 0, 0, 0.18);
}

/* ===== top buttons ===== */
.top-bar {
  position: fixed;
  top: max(var(--edge), var(--safe-t));
  right: max(var(--edge), var(--safe-r));
  z-index: 20;
  display: flex;
  gap: 8px;
}
.top-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--ui) 16%, transparent);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
  color: var(--ui);
  cursor: pointer;
  opacity: .62;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ui) 8%, transparent) inset, 0 6px 18px rgba(0, 0, 0, 0.18);
  transition: opacity .2s ease-out, border-color .2s ease-out, background-color .4s ease-out, scale .15s ease-out;
}
.top-btn:hover { opacity: 1; border-color: color-mix(in srgb, var(--ui) 40%, transparent); }
.top-btn:active { scale: .94; }
.top-btn:focus-visible { opacity: 1; outline: 2px solid var(--accent); outline-offset: 3px; }
.top-btn[aria-expanded="true"] { opacity: 1; border-color: color-mix(in srgb, var(--accent) 60%, transparent); }
.top-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }
.top-btn svg path { transition: transform .6s var(--ease-out); transform-origin: 12px 12px; }
#cw-open[aria-expanded="true"] svg path { transform: rotate(90deg); }
#cw-addons-open svg path { transform-origin: 12px 13.2px; }
#cw-addons-open[aria-expanded="true"] svg path:first-child { transform: rotate(120deg); }
.top-btn .pin { fill: currentColor; stroke: none; }
/* The gallery's bar covers the top of a narrow frame; the buttons drop below it. */
@media (max-width: 679px) {
  html.in-frame .top-bar { top: 66px; }
}

/* ===== the add-on bar ===== */
#cw-pill {
  position: fixed;
  left: 50%;
  bottom: max(var(--edge), var(--safe-b));
  z-index: 22;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100vw - 24px - var(--safe-l) - var(--safe-r));
  min-height: 56px;
  padding: 5px 5px 5px 18px;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--ui) 16%, transparent);
  background: color-mix(in srgb, var(--panel) 74%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  backdrop-filter: blur(28px) saturate(190%);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ui) 10%, transparent) inset, 0 14px 36px -10px rgba(0, 0, 0, 0.5);
  transform: translateX(-50%);
  transition: opacity .35s ease-out, transform .5s var(--ease-quint), border-color .3s ease-out;
}
#cw-pill.gone, #cw-pill.gone.idle { opacity: 0; transform: translate(-50%, 24px); pointer-events: none; }
#cw-pill.idle:not(.gone):not(:hover):not(:focus-within) { opacity: .42; }
#cw-pill.alert { border-color: color-mix(in srgb, var(--accent) 70%, transparent); animation: pill-alert 1.4s ease-in-out infinite; }
@keyframes pill-alert {
  50% { box-shadow: 0 1px 0 color-mix(in srgb, var(--ui) 10%, transparent) inset, 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent), 0 14px 36px -10px rgba(0, 0, 0, 0.5); }
}
.pill-label {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  margin-right: 8px;
  line-height: 1.2;
}
.pill-name {
  max-width: 34vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--ui) 60%, transparent);
}
.pill-time {
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
#cw-pill[data-mode="effect"] .pill-time { font-size: 15px; }
.pill-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ui);
  cursor: pointer;
  transition: background-color .2s ease-out, scale .15s ease-out;
}
.pill-btn[hidden] { display: none; }
.pill-btn:hover { background: color-mix(in srgb, var(--ui) 10%, transparent); }
.pill-btn:active { scale: .92; }
.pill-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pill-btn.main { background: var(--accent); color: #fff; }
.pill-btn.main:hover { background: color-mix(in srgb, var(--accent) 86%, #fff); }
.pill-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.pill-btn svg .f, .act svg .f, .icon-btn svg .f { fill: currentColor; stroke: none; }

/* ===== tooltip ===== */
#cw-tip {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  padding: 7px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, #111 92%, transparent);
  color: #f3f1ec;
  font-size: 12.5px;
  line-height: 1.3;
  letter-spacing: 0;
  pointer-events: none;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 22px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(4px) scale(.97);
  transform-origin: var(--ax, 50%) 100%;
  transition: opacity .14s ease-in, transform .14s ease-in;
}
#cw-tip.below { transform: translateY(-4px) scale(.97); transform-origin: var(--ax, 50%) 0; }
#cw-tip.on { opacity: 1; transform: none; transition: opacity .18s ease-out, transform .28s var(--ease-quint); }
#cw-tip::after {
  content: "";
  position: absolute;
  left: var(--ax, 50%);
  bottom: -4px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 1px;
}
#cw-tip.below::after { bottom: auto; top: -4px; }
:root[data-mode="light"] #cw-tip { background: #23201b; }

/* ===== panels ===== */
#cw-scrim {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: radial-gradient(120% 100% at 100% 0%, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.16) 60%);
  opacity: 0;
  transition: opacity .32s ease-out;
}
:root[data-mode="light"] #cw-scrim { background: radial-gradient(120% 100% at 100% 0%, rgba(40, 30, 14, 0.2), rgba(40, 30, 14, 0.06) 60%); }
#cw-scrim.on { opacity: 1; }

/* A solid machined plate: opaque body, hairline edge, a lit top bevel and a deep cast shadow. */
.sheet {
  --line: color-mix(in srgb, var(--ui) 10%, transparent);
  --line-hi: color-mix(in srgb, var(--ui) 16%, transparent);
  --muted: color-mix(in srgb, var(--ui) 60%, var(--panel));
  --well: color-mix(in srgb, var(--panel) 86%, #000);
  --raise: color-mix(in srgb, var(--panel) 82%, var(--ui));
  --raise-edge: color-mix(in srgb, var(--ui) 22%, transparent);
  --sheen: color-mix(in srgb, var(--ui) 5%, transparent);
  --drop: rgba(0, 0, 0, 0.55);
  position: fixed;
  z-index: 30;
  top: calc(max(var(--edge), var(--safe-t)) + 54px);
  right: max(var(--edge), var(--safe-r));
  width: min(420px, calc(100vw - 24px));
  max-height: calc(100dvh - max(var(--edge), var(--safe-t)) - 54px - max(var(--edge), var(--safe-b)));
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--sheen), transparent 140px), var(--panel);
  border: 1px solid var(--line-hi);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, var(--ui) 12%, transparent),
    inset 0 -1px 0 rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 0, 0, 0.35),
    0 30px 80px -18px var(--drop),
    0 10px 24px -8px rgba(0, 0, 0, 0.35);
  color: var(--ui);
  opacity: 0;
  transform: scale(.94);
  transform-origin: calc(100% - 22px) -32px;
  transition: opacity .18s ease-in, transform .24s ease-in;
}
#cw-addons { transform-origin: calc(100% - 74px) -32px; }
.sheet.on {
  opacity: 1;
  transform: none;
  transition: opacity .26s ease-out, transform .5s var(--ease-quint);
}
/* Stepped aside while an effect plays on the wall; the bar brings it back. */
.sheet.on.peek {
  opacity: 0;
  transform: translateY(16px) scale(.97);
  pointer-events: none;
  transition: opacity .22s ease-in, transform .3s ease-in;
}
:root[data-mode="light"] .sheet {
  --well: color-mix(in srgb, var(--panel) 90%, #6a5a3a);
  --raise: #fff;
  --raise-edge: rgba(40, 30, 10, 0.1);
  --sheen: rgba(255, 255, 255, 0.7);
  --drop: rgba(60, 46, 20, 0.32);
  --muted: color-mix(in srgb, var(--ui) 66%, var(--panel));
  border-color: rgba(40, 30, 10, 0.12);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 1px rgba(40, 30, 10, 0.04),
    0 30px 70px -20px var(--drop),
    0 8px 20px -10px rgba(60, 46, 20, 0.2);
}

/* Contents rise into place just behind the plate. */
.sheet-head, .sheet-body > * {
  opacity: 0;
  translate: 0 6px;
  transition: opacity .12s ease-in, translate .12s ease-in;
}
.sheet.on .sheet-head, .sheet.on .sheet-body > * {
  opacity: 1;
  translate: none;
  transition: opacity .4s ease-out, translate .5s var(--ease-quint);
}
.sheet.on .sheet-head { transition-delay: .04s; }
.sheet.on .sheet-body > :nth-child(1) { transition-delay: .08s; }
.sheet.on .sheet-body > :nth-child(2) { transition-delay: .12s; }
.sheet.on .sheet-body > :nth-child(3) { transition-delay: .16s; }

.sheet-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 10px 6px 22px;
}
.sheet-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
/* A small lume dot in the accent: the one bit of colour in the header. */
.sheet-title::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px 1px color-mix(in srgb, var(--accent) 60%, transparent);
}
.sheet-reset, .sheet-close {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: color .2s ease-out, background-color .2s ease-out, scale .15s ease-out;
}
.sheet-reset { padding: 0 12px; }
.sheet-close { display: grid; place-items: center; width: 44px; padding: 0; }
.sheet-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.sheet-reset:hover, .sheet-close:hover { color: var(--ui); background: var(--well); }
.sheet-reset:active, .sheet-close:active { scale: .94; }
.sheet-reset:focus-visible, .sheet-close:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; color: var(--ui); }

.sheet-body {
  display: flex;
  flex-direction: column;
  padding: 4px 18px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-hi) transparent;
  touch-action: pan-y;
}
.sheet-body::-webkit-scrollbar { width: 6px; }
.sheet-body::-webkit-scrollbar-thumb { background: var(--line-hi); border-radius: 3px; }
.sheet-body::-webkit-scrollbar-track { background: transparent; }

/* ===== preview stage: one live clock on a lit piece of the wall ===== */
.pv {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  min-height: 128px;
  padding: 12px 22px 12px 14px;
  border-radius: 16px;
  background: radial-gradient(130% 140% at var(--lpx) var(--lpy), var(--wall-hi), var(--wall) 72%);
  box-shadow:
    inset 0 0 0 1px var(--line),
    inset calc(var(--lx) * -6px) calc(var(--ly) * -6px) 18px rgba(0, 0, 0, 0.35),
    0 1px 0 color-mix(in srgb, var(--ui) 6%, transparent);
  transition: background .5s ease-out;
}
:root[data-mode="light"] .pv {
  box-shadow:
    inset 0 0 0 1px rgba(40, 30, 10, 0.1),
    inset calc(var(--lx) * -5px) calc(var(--ly) * -5px) 16px rgba(60, 46, 20, 0.14),
    0 1px 0 #fff;
}
.pv-dial { width: 104px; height: 104px; display: block; }
.pv-cap { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pv-finish { font-size: 21px; font-weight: 300; letter-spacing: .01em; line-height: 1.15; }
.pv-mode { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pv-finish::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin-top: 10px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

/* ===== tabs: text with a sliding hairline ===== */
.tabs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  margin: 10px 0 4px;
  border-bottom: 1px solid var(--line);
}
.tab {
  min-height: 46px;
  padding: 4px 4px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  border-radius: 10px 10px 0 0;
  overflow-wrap: anywhere;
  transition: color .25s ease-out;
}
.tab:hover, .tab[aria-selected="true"] { color: var(--ui); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.tab-ind {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: calc(100% / var(--n));
  height: 2px;
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .45s var(--ease-quint);
  pointer-events: none;
}
.tab-ind::before {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  top: 0;
  bottom: 0;
  border-radius: 2px;
  background: var(--ui);
  box-shadow: 0 0 10px color-mix(in srgb, var(--ui) 35%, transparent);
}

/* Panes share one grid cell; the area glides to the height of the one shown. The padding keeps
   focus rings and glows inside the clip. */
.panes {
  position: relative;
  display: grid;
  margin: 0 -6px;
  padding: 0 6px;
  overflow: hidden;
  transition: height .42s var(--ease-quint);
}
.pane, .sub {
  grid-area: 1 / 1;
  align-self: start;
  min-width: 0;
  padding-bottom: 6px;
}
.pane {
  visibility: hidden;
  opacity: 0;
  transition: opacity .16s ease-in, visibility 0s linear .16s, transform .42s var(--ease-quint);
}
.pane.on {
  visibility: visible;
  opacity: 1;
  transition: opacity .32s ease-out .06s, visibility 0s, transform .42s var(--ease-quint);
}
/* The time sub-screen slides in from the right over the Layout tab. */
.sub {
  background: var(--panel);
  transform: translateX(104%);
  transition: transform .42s var(--ease-quint);
}
:root[data-mode="light"] .sub { background: transparent; }
.panes.sub-on .sub { transform: none; }
.panes.sub-on .pane.on { transform: translateX(-30%); opacity: 0; }

.field {
  margin: 0;
  padding: 16px 0 0;
  border: 0;
  min-width: 0;
  transition: opacity .3s ease-out;
}
.field.muted { opacity: .42; }
.field-label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px 9px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
:lang(zh) .field-label, :lang(ja) .field-label, :lang(ko) .field-label, :lang(zh) .pv-mode, :lang(ja) .pv-mode, :lang(ko) .pv-mode,
:lang(zh) .sheet-title, :lang(ja) .sheet-title, :lang(ko) .sheet-title, :lang(zh) .pill-name, :lang(ja) .pill-name, :lang(ko) .pill-name,
:lang(zh) .fx-title, :lang(ja) .fx-title, :lang(ko) .fx-title { letter-spacing: .02em; }
.pane-hint, .pane-note {
  margin: 14px 2px 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--muted);
}
.pane-note {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line);
}
.pane-note[hidden] { display: none; }

/* An info button: the tip opens on hover, focus, tap or long press. */
.help {
  position: relative;
  flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  cursor: help;
}
.help::before { content: ""; position: absolute; inset: -12px; }
.help-i {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.2px currentColor;
  font: italic 600 10px/1 Georgia, "Times New Roman", serif;
  letter-spacing: 0;
  text-transform: none;
  transition: color .2s ease-out, background-color .2s ease-out;
}
.help:hover, .help:focus-visible { color: var(--ui); }
.help:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== segments: a recessed well with one raised pill gliding under the checked option ===== */
.seg {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  padding: 3px;
  border-radius: 14px;
  background: var(--well);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), inset 0 0 0 1px var(--line), 0 1px 0 color-mix(in srgb, var(--ui) 5%, transparent);
}
:root[data-mode="light"] .seg { box-shadow: inset 0 1px 2px rgba(60, 46, 20, 0.14), inset 0 0 0 1px rgba(40, 30, 10, 0.07), 0 1px 0 #fff; }
.seg-ind {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  width: calc((100% - 6px) / var(--n));
  border-radius: 11px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--raise) 100%, var(--ui) 6%), var(--raise));
  box-shadow:
    inset 0 1px 0 var(--raise-edge),
    0 0 0 1px rgba(0, 0, 0, 0.28),
    0 2px 6px rgba(0, 0, 0, 0.3),
    0 8px 18px -8px rgba(0, 0, 0, 0.45);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .5s var(--ease-quint);
  pointer-events: none;
}
:root[data-mode="light"] .seg-ind {
  background: #fff;
  box-shadow: inset 0 -1px 0 rgba(40, 30, 10, 0.06), 0 0 0 1px rgba(40, 30, 10, 0.1), 0 2px 5px rgba(60, 46, 20, 0.14), 0 8px 16px -8px rgba(60, 46, 20, 0.25);
}
.opt {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 4px 4px;
  border-radius: 11px;
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: color .3s ease-out;
}
.opt input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.opt-text { max-width: 100%; overflow-wrap: anywhere; hyphens: auto; }
.opt:hover { color: var(--ui); }
.opt:has(input:checked) { color: var(--ui); font-weight: 500; }
.opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -1px; }

/* Finish tiles: each option a polished material chip over its name. */
.seg-tiles .opt {
  grid-template-rows: auto auto;
  gap: 7px;
  min-height: 82px;
  padding: 10px 2px 8px;
  font-size: 12px;
}
.chip {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 3px 6px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: scale .45s var(--ease-quint), box-shadow .3s ease-out;
}
.chip::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--dial);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.chip::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(60% 40% at 32% 22%, rgba(255, 255, 255, 0.55), transparent 70%),
    linear-gradient(140deg, rgba(255, 255, 255, 0.18), transparent 45%);
  mix-blend-mode: screen;
}
/* Brushed metal from a conic gradient: bands of light round the ring, as on a turned bezel. */
.chip-graphite {
  --dial: radial-gradient(circle at 40% 35%, #26262b, #0c0c0e 75%);
  background: conic-gradient(from 210deg, #4a4a52, #8e8e98 12%, #2a2a30 28%, #5c5c66 46%, #1a1a1e 62%, #7a7a84 80%, #3a3a42 92%, #4a4a52);
}
.chip-brass {
  --dial: radial-gradient(circle at 40% 35%, #2a2218, #120e09 75%);
  background: conic-gradient(from 210deg, #b48a45, #f6dc9c 12%, #7a5823 28%, #d8b06a 46%, #5a4018 62%, #ecc883 80%, #9a733a 92%, #b48a45);
}
.chip-steel {
  --dial: radial-gradient(circle at 40% 35%, #1f2a36, #0b1118 75%);
  background: conic-gradient(from 210deg, #8c99aa, #e6edf5 12%, #5a6676 28%, #b6c2d1 46%, #3e4856 62%, #d4dde8 80%, #76849a 92%, #8c99aa);
}
.chip-oxblood {
  --dial: radial-gradient(circle at 40% 35%, #3a1418, #160608 75%);
  background: conic-gradient(from 210deg, #7a2a32, #c66a72 12%, #4a1218 28%, #9a3e48 46%, #300a0e 62%, #b45660 80%, #64202a 92%, #7a2a32);
}
:root[data-mode="light"] .chip-graphite { --dial: radial-gradient(circle at 40% 35%, #f4f3ef, #d6d4cd 80%); }
:root[data-mode="light"] .chip-brass { --dial: radial-gradient(circle at 40% 35%, #fbf5e8, #e6d8bc 80%); }
:root[data-mode="light"] .chip-steel { --dial: radial-gradient(circle at 40% 35%, #f5f7fa, #d5dce5 80%); }
:root[data-mode="light"] .chip-oxblood { --dial: radial-gradient(circle at 40% 35%, #faf1ee, #e9d3cd 80%); }
:root[data-mode="light"] .chip::before { box-shadow: inset 0 2px 3px rgba(60, 40, 20, 0.3), 0 0 0 1px rgba(0, 0, 0, 0.12); }
.opt:has(input:checked) .chip {
  scale: 1.06;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45),
    0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent),
    0 4px 10px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* ===== light source: nine lamps round a small dial that shows the cast shadow ===== */
.light-plate {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 46px);
  max-width: 260px;
  margin: 0 auto;
  padding: 4px;
  border-radius: 18px;
  background: radial-gradient(90% 90% at var(--lpx) var(--lpy), var(--wall-hi), var(--wall) 80%);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: background .45s ease-out;
}
:root[data-mode="light"] .light-plate { box-shadow: inset 0 0 0 1px rgba(40, 30, 10, 0.1), inset 0 1px 3px rgba(60, 46, 20, 0.12); }
.light-disc {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  border-radius: 50%;
  background: radial-gradient(circle at calc(50% + var(--lx) * 22%) calc(50% + var(--ly) * 22%), var(--wall-hi), var(--wall) 75%);
  box-shadow:
    0 0 0 1px var(--frame-edge),
    calc(var(--lx) * -7px) calc(var(--ly) * -7px + 2px) 14px rgba(0, 0, 0, 0.55),
    inset calc(var(--lx) * -3px) calc(var(--ly) * -3px) 6px rgba(0, 0, 0, 0.4),
    inset calc(var(--lx) * 2px) calc(var(--ly) * 2px) 3px color-mix(in srgb, var(--ui) 16%, transparent);
  transition: box-shadow .5s var(--ease-quint), background .5s var(--ease-quint);
}
:root[data-mode="light"] .light-disc {
  box-shadow:
    0 0 0 1px var(--frame-edge),
    calc(var(--lx) * -7px) calc(var(--ly) * -7px + 2px) 14px rgba(60, 46, 20, 0.3),
    inset calc(var(--lx) * -3px) calc(var(--ly) * -3px) 6px rgba(60, 46, 20, 0.2),
    inset calc(var(--lx) * 2px) calc(var(--ly) * 2px) 3px #fff;
}
.light-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2px;
  height: 20px;
  margin: -18px 0 0 -1px;
  border-radius: 1px;
  background: var(--hand, var(--ui));
  transform-origin: 50% 18px;
  rotate: -40deg;
  box-shadow: calc(var(--lx) * -2px) calc(var(--ly) * -2px) 2px rgba(0, 0, 0, 0.4);
}
.light-pin::after {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 2px;
  height: 16px;
  border-radius: 1px;
  background: inherit;
  transform-origin: 50% 14px;
  rotate: 110deg;
}
.lp {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 44px;
  border-radius: 12px;
  cursor: pointer;
}
.lp input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.lp-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ui) 28%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ui) 12%, transparent);
  transition: background-color .25s ease-out, box-shadow .4s ease-out, scale .45s var(--ease-quint);
}
.lp:hover .lp-dot { background: color-mix(in srgb, var(--ui) 60%, transparent); }
.lp:has(input:checked) .lp-dot {
  scale: 1.6;
  background: #fff6e2;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, #ffd99a 80%, transparent), 0 0 16px 5px color-mix(in srgb, #ffd28a 55%, transparent);
}
:root[data-mode="light"] .lp:has(input:checked) .lp-dot {
  background: #fffaf0;
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--accent) 70%, transparent), 0 0 14px 4px rgba(255, 196, 110, 0.75);
}
.lp:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -5px; }

/* ===== switch ===== */
.switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
}
.switch-label { flex: 1; min-width: 0; cursor: pointer; }
.switch-row .field-label { padding: 0 2px; font-size: 11px; }
.switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 50px;
  height: 30px;
  margin: 0 0 0 4px;
  border-radius: 15px;
  background: var(--well);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35), inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: background-color .3s ease-out;
}
.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(180deg, #fff, #dcdad4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 0 0 .5px rgba(0, 0, 0, 0.2);
  transition: transform .4s var(--ease-quint);
}
.switch:checked { background: var(--accent); box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25); }
.switch:checked::before { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== buttons ===== */
.wide-btn, .act, .nav-row, .preset, .icon-btn, .back-btn {
  border: 0;
  background: none;
  color: var(--ui);
  cursor: pointer;
  transition: background-color .2s ease-out, box-shadow .2s ease-out, scale .15s ease-out, color .2s ease-out;
}
.wide-btn:active, .act:active, .nav-row:active, .preset:active, .icon-btn:active, .back-btn:active, .fx-chip:active, .sig-btn:active, .step-btn:active { scale: .96; }
.wide-btn:focus-visible, .act:focus-visible, .nav-row:focus-visible, .preset:focus-visible, .icon-btn:focus-visible,
.back-btn:focus-visible, .fx-chip:focus-visible, .sig-btn:focus-visible, .step-btn:focus-visible, .step-val:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.wide-btn svg, .act svg, .icon-btn svg, .back-btn svg, .nav-chev, .step-btn svg {
  flex: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wide-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line-hi);
  font-size: 13.5px;
  line-height: 1.2;
}
.wide-btn:hover { background: var(--well); }

/* Rows that open a screen: label, current value, chevron. */
.nav-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px 8px 16px;
  border-radius: 14px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  line-height: 1.2;
}
.nav-row:hover { box-shadow: inset 0 0 0 1px var(--line-hi); }
.nav-label { flex: none; font-size: 13.5px; font-weight: 500; }
.nav-value { flex: 1; min-width: 0; text-align: right; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-chev { color: var(--muted); transition: transform .3s var(--ease-quint); }
.nav-row:hover .nav-chev { transform: translateX(2px); }

/* ===== sub-screen header: a square back button with an arrow and the word ===== */
.sub-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
}
.back-btn {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 60px;
  height: 60px;
  padding: 4px;
  border-radius: 14px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line-hi);
  font-size: 11px;
  line-height: 1.2;
}
.back-btn .btn-text { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back-btn:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.sub-title { margin: 0; font-size: 17px; font-weight: 500; line-height: 1.2; }
.sub-now {
  margin: 14px 0 0;
  text-align: center;
  font-size: 34px;
  font-weight: 200;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

/* ===== drum pickers ===== */
.wheels {
  display: flex;
  gap: 8px;
  padding-top: 14px;
  transition: opacity .3s ease-out;
}
.wheels.locked { opacity: .45; pointer-events: none; }
.wheel {
  --ih: 40px;
  --vis: 5;
  --spec: 0;
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  height: calc(var(--ih) * var(--vis));
  border-radius: 16px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 2px 6px rgba(0, 0, 0, 0.28);
  outline: none;
  overflow: hidden;
  touch-action: pan-y;
}
.wheel.w-sign { flex: 1.15 1 0; }
.wheel.w-zone { flex: 1 1 100%; }
:root[data-mode="light"] .wheel { box-shadow: inset 0 0 0 1px rgba(40, 30, 10, 0.08), inset 0 2px 6px rgba(60, 46, 20, 0.12); }
.wheel:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.wheel-scroll {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  perspective: 520px;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  cursor: grab;
  touch-action: pan-y;
}
.wheel.dragging .wheel-scroll { cursor: grabbing; scroll-snap-type: none; }
.wheel-scroll::-webkit-scrollbar { display: none; }
.wheel-item {
  height: var(--ih);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  scroll-snap-align: center;
  font-size: 15px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  backface-visibility: hidden;
  will-change: transform;
}
.w-zone .wheel-item { justify-content: flex-start; padding: 0 16px; font-size: 14px; }
/* The lens: a pane of glass over the centre row. It holds a brighter, slightly magnified copy of
   the list, and its highlight slides with the speed of the spin. */
.wheel-lens {
  position: absolute;
  left: 5px;
  right: 5px;
  top: calc(var(--ih) * (var(--vis) - 1) / 2);
  height: var(--ih);
  border-radius: 12px;
  overflow: hidden;
  pointer-events: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, #fff 16%, transparent), color-mix(in srgb, #fff 3%, transparent) 48%, color-mix(in srgb, #fff 7%, transparent)),
    color-mix(in srgb, var(--panel) 40%, transparent);
  -webkit-backdrop-filter: blur(1.5px) saturate(160%) brightness(1.1);
  backdrop-filter: blur(1.5px) saturate(160%) brightness(1.1);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, #fff 40%, transparent),
    inset 0 -1px 0 color-mix(in srgb, #000 30%, transparent),
    inset 0 0 0 1px color-mix(in srgb, #fff 12%, transparent),
    0 4px 14px -4px rgba(0, 0, 0, 0.45);
}
:root[data-mode="light"] .wheel-lens {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.82));
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgba(40, 30, 10, 0.08), inset 0 0 0 1px rgba(40, 30, 10, 0.1), 0 4px 12px -4px rgba(60, 46, 20, 0.3);
}
.wheel-lens::before {
  content: "";
  position: absolute;
  inset: -40% -10%;
  background: radial-gradient(40% 60% at calc(50% + var(--spec) * 30%) calc(20% - var(--spec) * 25%), color-mix(in srgb, #fff 28%, transparent), transparent 70%);
  opacity: calc(0.45 + var(--spec) * var(--spec) * 0.55);
  z-index: 1;
}
.wheel-track { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.wheel-track .wheel-item {
  color: var(--ui);
  font-size: 17px;
  font-weight: 600;
  scroll-snap-align: none;
  will-change: auto;
}
.w-zone .wheel-track .wheel-item { font-size: 15px; }
.wheel[data-unit]::after {
  content: attr(data-unit);
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}

/* ===== dropdown ===== */
.dd { position: relative; min-width: 0; }
.dd-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 6px 12px 6px 16px;
  border: 0;
  border-radius: 14px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
  transition: box-shadow .2s ease-out;
}
.dd-btn:hover, .dd.open .dd-btn { box-shadow: inset 0 0 0 1px var(--line-hi); }
.dd-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dd-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-chev { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--ease-quint); }
.dd.open .dd-chev { transform: rotate(180deg); }
.dd-list {
  position: fixed;
  z-index: 50;
  margin: 0;
  padding: 5px;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: 0 0 0 1px var(--line-hi), 0 18px 44px -12px rgba(0, 0, 0, 0.55);
  outline: none;
  scrollbar-width: thin;
  animation: dd-in .26s var(--ease-quint);
  transform-origin: 50% 0;
  touch-action: pan-y;
}
.dd.up .dd-list { transform-origin: 50% 100%; }
@keyframes dd-in { from { opacity: 0; transform: scale(.96); } }
.dd-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 6px 10px 6px 12px;
  border-radius: 11px;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}
.dd-opt.active { background: color-mix(in srgb, var(--ui) 9%, transparent); }
.dd-name { flex: 1; min-width: 0; }
.dd-hint { color: var(--muted); font-size: 12.5px; }
.dd-check { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.dd-opt[aria-selected="true"] .dd-check { opacity: 1; }
.dd-opt[aria-selected="true"] .dd-name { font-weight: 600; }

/* ===== effects library ===== */
.fx-group { padding-top: 16px; }
.fx-title {
  margin: 0 2px 9px;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.fx-list { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 14px 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ui);
  font-size: 13px;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color .2s ease-out, box-shadow .2s ease-out, scale .15s ease-out, opacity .2s ease-out;
}
.fx-chip:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.fx-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--ui) 30%, transparent);
  transition: background-color .2s ease-out, box-shadow .3s ease-out;
}
.fx-chip.on { background: color-mix(in srgb, var(--accent) 18%, var(--well)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 60%, transparent); }
.fx-chip.on .fx-dot { background: var(--accent); box-shadow: 0 0 10px 2px color-mix(in srgb, var(--accent) 55%, transparent); animation: fx-pulse 1s ease-in-out infinite; }
@keyframes fx-pulse { 50% { opacity: .45; } }
.fx-chip[aria-disabled="true"] { opacity: .38; cursor: default; }
.fx-chip[aria-disabled="true"]:hover { box-shadow: inset 0 0 0 1px var(--line); }

.sig-list { display: grid; gap: 4px; margin-top: 10px; }
.sig-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 2px 2px 2px 12px;
  border-radius: 12px;
}
.sig-row:nth-child(odd) { background: color-mix(in srgb, var(--well) 60%, transparent); }
.sig-name { font-size: 13px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; }
.sig-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 70px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ui);
  cursor: pointer;
  transition: box-shadow .2s ease-out, scale .15s ease-out;
}
.sig-btn:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent); }
.sig-h { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sig-ic { width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sig-btn.pm .sig-ic { stroke: color-mix(in srgb, var(--ui) 70%, var(--accent)); }

/* ===== add-ons ===== */
.readout { padding: 18px 0 2px; text-align: center; }
.readout-time {
  font-size: 52px;
  font-weight: 200;
  line-height: 1;
  letter-spacing: .01em;
  font-variant-numeric: tabular-nums;
}
.readout-sub { min-height: 18px; margin-top: 8px; font-size: 12.5px; line-height: 1.3; color: var(--muted); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.preset {
  min-height: 40px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.preset:hover { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.sound-row { display: flex; gap: 8px; }
.sound-row .dd { flex: 1; }
.icon-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line);
}
.icon-btn:hover { box-shadow: inset 0 0 0 1px var(--line-hi); }
.actions { display: flex; gap: 8px; padding-top: 18px; }
.act {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line-hi);
  font-size: 14px;
  line-height: 1.2;
}
.act:hover { background: color-mix(in srgb, var(--well) 80%, var(--ui)); }
.act-main {
  flex: 1.6;
  background: var(--accent);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 6px 18px -6px color-mix(in srgb, var(--accent) 70%, transparent);
  font-weight: 600;
}
.act-main:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.steppers { display: grid; gap: 6px; }
.stepper-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 4px 4px 4px 14px;
  border-radius: 14px;
  background: var(--well);
  box-shadow: inset 0 0 0 1px var(--line);
}
.stepper-label { flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.2; }
.stepper { display: flex; align-items: center; gap: 2px; }
.step-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--ui);
  cursor: pointer;
  transition: background-color .2s ease-out, scale .15s ease-out, opacity .2s ease-out;
}
.step-btn:hover { background: color-mix(in srgb, var(--ui) 8%, transparent); }
.step-btn:disabled { opacity: .3; cursor: default; }
.step-val {
  min-width: 64px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  border-radius: 8px;
}

/* ===== phones: bottom sheets that slide up from the edge, with a grab bar ===== */
@media (max-width: 619px) {
  .sheet {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: auto;
    max-height: calc(100dvh - max(var(--safe-t), 24px) - 16px);
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    padding-bottom: var(--safe-b);
    transform: translateY(100%);
    transform-origin: 50% 100%;
    transition: opacity .2s ease-in .1s, transform .3s cubic-bezier(.4, 0, 1, 1);
  }
  #cw-addons { transform-origin: 50% 100%; }
  .sheet.on { transition: opacity .16s ease-out, transform .52s var(--ease-quint); }
  .sheet.on.peek { transform: translateY(100%); opacity: 1; transition: transform .4s cubic-bezier(.4, 0, 1, 1); }
  .sheet::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 36px;
    height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: var(--line-hi);
  }
  #cw-scrim { background: rgba(0, 0, 0, 0.36); }
  :root[data-mode="light"] #cw-scrim { background: rgba(40, 30, 14, 0.2); }
  .sheet-head { padding: 14px 8px 2px 18px; }
  .sheet-body { padding: 2px 14px 18px; }
  .pv { min-height: 108px; gap: 14px; padding: 8px 16px 8px 10px; }
  .pv-dial { width: 88px; height: 88px; }
  .pv-finish { font-size: 19px; }
  .readout-time { font-size: 46px; }
  .tab { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  body, body::before, #stage, #wall, #fade.out, .top-btn, .top-btn svg path, #cw-scrim, .sheet, .sheet.on, .sheet.on.peek,
  .sheet-head, .sheet-body > *, .sheet.on .sheet-head, .sheet.on .sheet-body > *, .pane, .pane.on, .panes, .sub,
  .opt, .seg-ind, .tab-ind, .chip, .switch, .switch::before, .lp-dot, .light-disc, .light-plate, .pv,
  #cw-pill, #cw-tip, #cw-tip.on, .nav-chev, .dd-chev { transition: none !important; }
  #wall.leaving { filter: none; scale: none; }
}
