/* Pocket Ruler — one stylesheet.
   Look: light = warm maple on cream paper, dark = matte graphite. Cyan marks what
   you move and what went right, amber marks estimates and warnings. */

:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --surface-2: #f0ebe3;
  --raised: #ffffff;
  --text: #2a2118;
  --muted: #6b5e50;
  --line: rgba(70, 50, 30, 0.14);
  --line-strong: rgba(70, 50, 30, 0.24);
  --cyan: #18b5d0;
  --cyan-ink: #0b6f80;
  --cyan-soft: rgba(24, 181, 208, 0.15);
  --cyan-mid: rgba(24, 181, 208, 0.3);
  --amber: #f2a33a;
  --amber-ink: #8a5300;
  --amber-soft: #fff1dc;
  --danger: #b3261e;
  --danger-soft: rgba(179, 38, 30, 0.1);
  --primary: #0a7385;
  --on-primary: #ffffff;
  --label-bg: #ffffff;
  --label-text: #1c1712;
  --wood-a: #ecd3a5;
  --wood-b: #dcb47a;
  --tick: #3b2a18;
  --shadow: 0 18px 48px -18px rgba(70, 45, 20, 0.45), 0 2px 6px -2px rgba(70, 45, 20, 0.18);
  --shadow-sm: 0 4px 14px -6px rgba(70, 45, 20, 0.35);
  --focus: 0 0 0 3px var(--bg), 0 0 0 5px var(--cyan-ink);
  --ca-accent: #0a7385; /* the accounts SDK's sheets and chip: white text on it ≥ 4.5:1 */
  --bar-h: 56px;
  --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.3, 1.35, 0.5, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-num: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16181b;
  --surface: #202328;
  --surface-2: #2a2e34;
  --raised: #262a30;
  --text: #e8eaed;
  --muted: #a2a8b0;
  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);
  --cyan-ink: #5fd3e6;
  --cyan-soft: rgba(24, 181, 208, 0.18);
  --cyan-mid: rgba(24, 181, 208, 0.34);
  --amber-ink: #f6bd6c;
  --amber-soft: #3a2f22;
  --danger: #ff8a80;
  --danger-soft: rgba(255, 138, 128, 0.12);
  --primary: #18b5d0;
  --on-primary: #06262d;
  --label-bg: #24272b;
  --label-text: #e8eaed;
  --wood-a: #30343a;
  --wood-b: #2b2e33;
  --tick: rgba(232, 234, 237, 0.85);
  --shadow: 0 22px 60px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255, 255, 255, 0.05);
  --shadow-sm: 0 6px 18px -8px rgba(0, 0, 0, 0.8);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
body.lock-scroll { overflow: hidden; overscroll-behavior: none; position: fixed; inset: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ic { width: 22px; height: 22px; flex: none; display: block; }
.ic.huge { width: 56px; height: 56px; color: var(--cyan-ink); margin: 0 auto; }
:focus-visible { outline: none; box-shadow: var(--focus); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---- the top bar --------------------------------------------------------------------- */
.app { min-height: 100dvh; display: flex; flex-direction: column; }
.bar {
  position: relative; z-index: 20; display: flex; align-items: center; gap: 8px;
  min-height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left));
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.app[data-screen="calibrate"] .bar, .app[data-screen="boot"] .bar { display: none; }
.app[data-screen="landing"] .bar { border-bottom-color: transparent; background: transparent; position: sticky; top: 0; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; margin-right: auto; }
.brand-icon { width: 30px; height: 30px; border-radius: 8px; flex: none; box-shadow: var(--shadow-sm); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-text b { font-size: 16px; font-weight: 680; letter-spacing: -0.01em; white-space: nowrap; }
.brand-text small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app[data-screen="main"] .brand-text { display: none; }
.app[data-screen="main"] .brand { margin-right: 0; }
.bar-tools { display: flex; align-items: center; gap: 6px; }
.app[data-screen="main"] .bar-tools { margin-left: auto; }
.app:not([data-screen="main"]) .main-only, .app:not([data-screen="landing"]) .land-only { display: none !important; }
.seg.main-only, .unit-btn.main-only { display: flex; }
.wide-only { display: none !important; }
@media (min-width: 760px) { .app[data-screen="main"] .wide-only { display: grid !important; } .app[data-screen="main"] .brand-text { display: flex; } }
@media (max-width: 420px) { .app[data-screen="main"] .brand { display: none; } }

.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; flex: none; transition: background-color 0.15s, color 0.15s, transform 0.15s var(--spring);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:active { transform: scale(0.92); }
.app[data-screen="landing"] .chip-slot { display: none; }
@media (max-width: 440px) { .app[data-screen="landing"] .brand-text small { display: none; } }
@media (max-width: 400px) { .app[data-screen="landing"] .brand-text { display: none; } }
.chip-slot { display: grid; place-items: center; width: 44px; height: 44px; flex: none; }
.lang-pick select {
  appearance: none; -webkit-appearance: none; height: 36px; border-radius: 18px; border: 1px solid var(--line-strong);
  background: var(--surface); padding: 0 14px; font-size: 14px; color: var(--text); min-width: 44px;
}
.icon-btn .moon { display: none; }
:root[data-theme="dark"] .icon-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon { display: block; }

/* segmented mode switch with a springy thumb */
.seg {
  position: relative; align-items: stretch; padding: 3px; border-radius: 14px; background: var(--surface-2);
  border: 1px solid var(--line); min-width: 0; flex: 0 1 auto;
}
.seg-thumb {
  position: absolute; top: 3px; bottom: 3px; left: 0; width: var(--w, 0); border-radius: 11px; background: var(--raised);
  box-shadow: var(--shadow-sm); transform: translateX(var(--x, 0)); transition: transform 0.38s var(--spring), width 0.3s var(--ease-out);
}
.seg-btn {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 48px; min-height: 40px;
  padding: 0 10px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600;
  white-space: nowrap; transition: color 0.2s;
}
.seg-btn[aria-checked="true"] { color: var(--text); }
.seg-btn .lock-ic { display: none; width: 14px; height: 14px; position: absolute; right: 3px; top: 3px; color: var(--amber-ink); }
.seg-btn.locked .lock-ic { display: block; }
.seg-btn.disabled { opacity: 0.45; }
.seg-label { display: none; }
@media (min-width: 560px) { .seg-label { display: inline; } .seg-btn { padding: 0 14px; } }
.unit-btn {
  align-items: center; justify-content: center; min-width: 52px; height: 40px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: 650 15px/1 var(--font-num);
  font-variant-numeric: tabular-nums; transition: transform 0.15s var(--spring);
}
.unit-btn:active { transform: scale(0.94); }
.unit-btn.bump #unit-text { animation: bump 0.32s var(--spring); }
@keyframes bump { from { transform: translateY(6px); opacity: 0; } }
.offline-tag {
  align-self: center; font-size: 11px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; padding: 3px 8px;
  border-radius: 99px; color: var(--amber-ink); background: var(--amber-soft); white-space: nowrap;
}

/* ---- buttons --------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 14px; border: 0; font-weight: 650; font-size: 16px; text-decoration: none; white-space: nowrap;
  transition: transform 0.16s var(--spring), background-color 0.15s, opacity 0.2s, box-shadow 0.2s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 20px -10px rgba(10, 115, 133, 0.7); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn.soft { background: var(--surface-2); color: var(--text); }
.btn.soft:hover { background: var(--line-strong); }
.btn.danger { background: var(--danger); color: #fff; }
:root[data-theme="dark"] .btn.danger { color: #2a0b08; }
.btn.big { min-height: 54px; font-size: 17px; width: 100%; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn .ic { width: 20px; height: 20px; }
.link-btn { border: 0; background: none; padding: 10px 6px; min-height: 44px; color: var(--cyan-ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.round-btn {
  width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  display: grid; place-items: center; flex: none; box-shadow: var(--shadow-sm); transition: transform 0.15s var(--spring), background-color 0.15s;
  touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.round-btn:active { transform: scale(0.9); background: var(--cyan-soft); }

/* ---- landing ------------------------------------------------------------------------- */
.landing { flex: 1; padding: 8px max(16px, env(safe-area-inset-right)) calc(28px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.land-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.land-hero { text-align: center; padding-top: 6px; }
.land-title { margin: 0; font-size: clamp(34px, 9vw, 52px); line-height: 1.04; letter-spacing: -0.03em; font-weight: 760; }
.land-lead { margin: 12px auto 0; max-width: 34ch; font-size: clamp(16px, 4.2vw, 19px); color: var(--muted); text-wrap: balance; }
.teaser {
  position: relative; margin: 0 auto; width: 100%; max-width: 600px; padding: 18px 12px 14px; border-radius: 24px; background: var(--surface);
  box-shadow: var(--shadow); border: 1px solid var(--line); overflow: hidden;
}
.teaser-svg { display: block; width: 100%; height: auto; overflow: visible; }
.wood-a { stop-color: var(--wood-a); }
.wood-b { stop-color: var(--wood-b); }
.t-body { stroke: var(--line-strong); stroke-width: 0.6; }
.t-ticks { stroke: var(--tick); stroke-width: 0.6; fill: none; }
.t-nums text { fill: var(--tick); font: 600 7.5px var(--font-num); text-anchor: middle; }
.t-marker line { stroke: var(--cyan); stroke-width: 1.4; }
.t-marker circle { fill: var(--cyan-mid); stroke: var(--cyan); stroke-width: 1.6; }
.t-marker text { fill: var(--text); font: 700 8.5px var(--font); text-anchor: middle; }
.t-a { transform: translateX(48px); }
.t-b { transform: translateX(333px); }
.t-pencil { filter: drop-shadow(0 3px 2px rgba(60, 40, 20, 0.25)); }
.t-label {
  position: absolute; left: 50%; top: 10px; transform: translate(-50%, 0); padding: 7px 16px; border-radius: 99px;
  background: var(--label-bg); color: var(--label-text); font: 650 20px/1 var(--font-num); font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line); white-space: nowrap;
}
.t-caption { position: absolute; right: 14px; bottom: 6px; font-size: 11px; color: var(--muted); font-style: italic; letter-spacing: 0.02em; }
@media (prefers-reduced-motion: no-preference) {
  .teaser.play .t-a { animation: t-a 7s var(--ease-out) infinite; }
  .teaser.play .t-b { animation: t-b 7s var(--ease-out) infinite; }
  .teaser.play .t-label { animation: t-label 7s ease infinite; }
}
@keyframes t-a { 0%, 12% { transform: translateX(104px); } 40% { transform: translateX(46px); } 46%, 88% { transform: translateX(48px); } 100% { transform: translateX(104px); } }
@keyframes t-b { 0%, 16% { transform: translateX(226px); } 44% { transform: translateX(335px); } 50%, 88% { transform: translateX(333px); } 100% { transform: translateX(226px); } }
@keyframes t-label { 0%, 47% { opacity: 0; transform: translate(-50%, 8px) scale(0.86); } 54%, 86% { opacity: 1; transform: translate(-50%, 0) scale(1); } 94%, 100% { opacity: 0; transform: translate(-50%, 0) scale(0.96); } }
.land-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 680px) { .land-cards { grid-template-columns: repeat(3, 1fr); } }
.land-card { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
@media (min-width: 680px) { .land-card { flex-direction: column; } }
.lc-icon { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; color: var(--cyan-ink); background: var(--cyan-soft); }
.land-card h2 { margin: 0 0 4px; font-size: 16px; line-height: 1.3; letter-spacing: -0.01em; }
.land-card p { margin: 0; font-size: 14px; color: var(--muted); }
.land-join { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); text-align: center; }
.land-info { margin: 0 0 6px; max-width: 46ch; font-size: 15px; }
.land-offline { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--amber-soft); color: var(--amber-ink); font-size: 14px; }
.land-join .btn.big { max-width: 380px; }
.land-free { margin: 0; font-size: 13px; color: var(--muted); }

/* ---- the measuring screen ----------------------------------------------------------- */
.canvas { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; height: 100dvh; z-index: 0; pointer-events: none; display: none; }
.app[data-screen="main"] ~ .canvas { display: block; }
.main { position: fixed; left: 0; right: 0; bottom: 0; top: calc(var(--bar-h) + env(safe-area-inset-top)); z-index: 2; display: flex; flex-direction: column; }
.surface {
  position: relative; flex: 1 1 auto; min-height: 0; margin: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; overflow: hidden;
}
.app.with-panel .surface { margin-right: calc(360px + env(safe-area-inset-right)); }
.app.relayout .surface > :not(.banners), .app.relayout ~ .canvas { animation: relayout 0.25s ease; }
@keyframes relayout { from { opacity: 0; } }
.surface.switching > :not(.banners), .app.switching ~ .canvas { animation: switch-in 0.22s var(--ease-out); }
@keyframes switch-in { from { opacity: 0; transform: translateY(6px); } }

.handle {
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; padding: 0; border-radius: 50%;
  border: 2px solid var(--cyan); background: var(--cyan-soft); color: var(--text); display: grid; place-items: center;
  font: 700 12px/1 var(--font); cursor: grab; touch-action: none; will-change: transform; z-index: 3;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); transition: background-color 0.12s, box-shadow 0.15s;
}
.handle::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(6, 60, 70, 0.25); pointer-events: none; }
.handle:hover { background: rgba(24, 181, 208, 0.22); }
.handle.dragging { background: var(--cyan-mid); cursor: grabbing; }
.handle.snap { transition: transform 0.18s var(--spring); }
.handle:focus-visible { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--cyan-ink); }
.vertex-h span { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }
.prot-only { display: none; }
.surface[data-mode="protractor"] .prot-only { display: grid; }
.surface[data-mode="protractor"] .marker-h { display: none; }
.surface.locked .marker-h, .surface.locked .readout, .surface.locked .prot-only { display: none; }

.readout {
  position: absolute; left: 0; top: 0; z-index: 4; display: inline-flex; align-items: baseline; gap: 6px; padding: 9px 16px;
  border-radius: 99px; border: 1px solid var(--line); background: var(--label-bg); color: var(--label-text); box-shadow: var(--shadow);
  font: 650 20px/1.1 var(--font-num); font-variant-numeric: tabular-nums; white-space: nowrap; will-change: transform; cursor: default;
  touch-action: none;
}
.surface[data-mode="protractor"] .readout { cursor: pointer; }
.readout.est { border: 2px solid var(--amber); }
.ro-unit { font-size: 15px; font-weight: 600; color: var(--muted); }
.readout.tight .ro-unit { margin-left: -6px; font-size: 20px; color: inherit; }
.ro-extra { font-size: 15px; font-weight: 600; color: var(--muted); }
.ro-err { font-size: 15px; font-weight: 650; color: var(--amber-ink); }
.ro-approx { color: var(--amber-ink); }
.ro-tag { align-self: center; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 3px 7px; border-radius: 99px; background: var(--cyan-soft); color: var(--cyan-ink); }
.readout.pop .ro-value { animation: bump 0.28s var(--spring); }

.lens {
  position: absolute; left: 0; top: 0; width: 96px; height: 96px; margin: -48px 0 0 -48px; border-radius: 50%; z-index: 6;
  border: 2px solid var(--cyan); background: var(--bg); overflow: hidden; pointer-events: none; opacity: 0; transform: scale(0.6);
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(6, 60, 70, 0.2); will-change: transform, opacity;
}
.lens canvas { display: block; width: 96px; height: 92px; width: 100%; height: 100%; }
.lens-cross { position: absolute; left: 50%; top: 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; pointer-events: none; }
.lens-cross::before, .lens-cross::after { content: ""; position: absolute; background: var(--cyan-ink); }
.lens-cross::before { left: 0; right: 0; top: 50%; height: 1px; margin-top: -0.5px; }
.lens-cross::after { top: 0; bottom: 0; left: 50%; width: 1px; margin-left: -0.5px; }
.lens-x {
  position: absolute; left: 50%; bottom: 7px; transform: translateX(-50%); font: 700 11px/1 var(--font-num); padding: 3px 6px; border-radius: 99px;
  background: var(--primary); color: var(--on-primary); opacity: 0; transition: opacity 0.12s;
}
.lens.precise .lens-x { opacity: 1; }

.actions {
  position: absolute; z-index: 8; display: flex; gap: 10px;
  right: calc(14px + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom));
}
.app.with-panel .actions { right: calc(374px + env(safe-area-inset-right)); }
.app[data-orient="landscape"] .actions { bottom: auto; top: 12px; }
.app[data-orient="portrait"][data-side="right"] .actions { right: auto; left: calc(14px + env(safe-area-inset-left)); }
.act-btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font-weight: 650; box-shadow: var(--shadow-sm); transition: transform 0.15s var(--spring);
}
.act-btn.primary { background: var(--primary); color: var(--on-primary); border-color: transparent; }
.act-btn:active { transform: scale(0.95); }
.act-btn .ic { width: 20px; height: 20px; }
@media (max-width: 400px) { #act-history span { display: none; } #act-history { padding: 0 13px; } }

.banners { position: absolute; z-index: 9; top: 10px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 24px), 520px); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.app[data-orient="portrait"][data-side="left"] .banners { left: 128px; right: 10px; width: auto; transform: none; }
.app[data-orient="portrait"][data-side="right"] .banners { left: 10px; right: 128px; width: auto; transform: none; }
.banner {
  pointer-events: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px 10px 14px; border-radius: 14px;
  background: var(--amber-soft); color: var(--amber-ink); border: 1px solid rgba(242, 163, 58, 0.55); font-size: 14px; font-weight: 550;
  box-shadow: var(--shadow-sm); animation: drop-in 0.24s var(--ease-out);
}
.banner p { margin: 0; flex: 1 1 180px; }
.banner .btn { min-height: 40px; font-size: 14px; padding: 0 12px; }
.banner .btn.soft { background: rgba(255, 255, 255, 0.55); }
:root[data-theme="dark"] .banner .btn.soft { background: rgba(255, 255, 255, 0.08); }
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } }
.slide-strip {
  flex: none; padding: 6px max(14px, env(safe-area-inset-right)) 6px max(14px, env(safe-area-inset-left)); text-align: center; font-size: 13px; line-height: 1.3; font-weight: 650;
  background: var(--amber); color: #3d2600;
}
.slide-panel {
  position: absolute; z-index: 7; bottom: 76px; left: 50%; transform: translateX(-50%); width: min(calc(100% - 120px), 400px); min-width: 200px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 18px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.app[data-orient="portrait"][data-side="left"] .slide-panel { left: calc(50% + 36px); }
.app[data-orient="portrait"][data-side="right"] .slide-panel { left: calc(50% - 36px); }
.app[data-orient="landscape"] .slide-panel { bottom: auto; top: 12px; left: 16px; transform: none; width: min(calc(100% - 360px), 380px); }
.sp-msg { margin: 0; font-size: 15px; font-weight: 600; text-wrap: balance; }
.sp-msg.warn { color: var(--amber-ink); }
.sp-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sp-ring { width: 44px; height: 44px; }
.sp-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.sp-track { fill: none; stroke: var(--line-strong); stroke-width: 3; }
.sp-fill { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: calc(97.4 * (1 - var(--p, 0))); }
.pulse { position: absolute; z-index: 1; pointer-events: none; opacity: 0; border-radius: 8px;
  background: linear-gradient(var(--pulse-dir, 180deg), transparent, rgba(24, 181, 208, 0.45), transparent); }
.pulse.run { animation: pulse 0.7s ease-out; }
@keyframes pulse { 0% { opacity: 0.9; transform: translate(var(--pulse-from, 0)); } 100% { opacity: 0; transform: translate(var(--pulse-to, 0)); } }
.locked-card {
  position: absolute; z-index: 7; left: 50%; top: 42%; transform: translate(-50%, -50%); width: min(calc(100% - 120px), 340px);
  display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px 18px; border-radius: 22px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.app[data-orient="portrait"][data-side="left"] .locked-card { left: calc(50% + 36px); }
.app[data-orient="portrait"][data-side="right"] .locked-card { left: calc(50% - 36px); }
.locked-card p { margin: 0; font-weight: 550; }
.big-ic { width: 34px; height: 34px; color: var(--amber-ink); }
.app.pre-morph ~ .canvas, .app.pre-morph .surface > :not(.banners), .app.pre-morph .actions { opacity: 0; }
.app.post-morph ~ .canvas, .app.post-morph .surface > :not(.banners), .app.post-morph .actions { transition: opacity 0.22s ease; }
.morph { position: fixed; left: 0; top: 0; z-index: 30; pointer-events: none; opacity: 0; border: 1.5px solid var(--cyan); background: rgba(24, 181, 208, 0.06); transform-origin: 0 0; transition: opacity 0.22s ease; }
.morph::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(var(--grain, 180deg), var(--wood-a), var(--wood-b)); opacity: 0; transition: opacity 0.45s ease 0.1s; }
.morph.run { opacity: 1; transition: transform 0.6s var(--ease-out), border-radius 0.6s var(--ease-out); }
.morph.run::before { opacity: 1; }

/* ---- calibration ---------------------------------------------------------------------- */
.cal { position: fixed; inset: 0; z-index: 25; background: var(--bg); touch-action: none; user-select: none; -webkit-user-select: none; }
.cal-stage { position: absolute; inset: 0; }
.cal-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.cal-shape { fill: rgba(127, 127, 127, 0.04); stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 6 5; transition: stroke 0.2s, fill 0.2s; display: none; }
.cal-shape.on { display: block; }
.cal-line { fill: none; }
.cal.fit-ok .cal-shape { stroke: var(--cyan); stroke-dasharray: none; fill: rgba(24, 181, 208, 0.06); }
.cal.fit-off .cal-shape { stroke: var(--amber); stroke-dasharray: none; fill: rgba(242, 163, 58, 0.07); }
.cal.dragging .cal-shape { stroke: var(--muted); stroke-dasharray: 6 5; fill: rgba(127, 127, 127, 0.04); }
.cal-check { opacity: 0; transform: translate(var(--cx, 0), var(--cy, 0)) scale(0.8); transform-box: view-box; }
.cal-check circle { fill: var(--cyan); }
.cal-check path { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; }
.cal.fit-ok:not(.dragging) .cal-check { opacity: 1; transform: translate(var(--cx, 0), var(--cy, 0)) scale(1); transition: opacity 0.15s, transform 0.3s var(--spring); }
.cal.fit-ok:not(.dragging) .cal-check path { stroke-dashoffset: 0; transition: stroke-dashoffset 0.25s ease-out 0.05s; }
.cal-dim {
  position: absolute; left: 0; top: 0; transform: translate(var(--x, 0), var(--y, 0)) translate(-50%, -50%); padding: 4px 10px; border-radius: 99px;
  background: var(--surface); border: 1px solid var(--line); font: 650 13px/1.2 var(--font-num); font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; pointer-events: none;
}
.cal-h { transform: translate(var(--x, 0), var(--y, 0)); }
.cal-h span { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); }
.cal-top {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 6px;
  padding: calc(6px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left));
  background: linear-gradient(var(--bg) 70%, transparent);
}
.tabs { flex: 1; display: flex; justify-content: center; gap: 4px; padding: 3px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; max-width: 460px; margin: 0 auto; }
.tab { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 2px 6px; border: 0; border-radius: 11px; background: transparent; color: var(--muted); font-size: 14px; line-height: 1.12; font-weight: 600; text-wrap: balance; overflow-wrap: anywhere; transition: background-color 0.2s, color 0.2s; }
@media (max-width: 420px) { .tab { font-size: 13px; } }
.tab[aria-selected="true"] { background: var(--raised); color: var(--text); box-shadow: var(--shadow-sm); }
.cal-panel {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 18px max(16px, env(safe-area-inset-right)) calc(12px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(transparent, var(--bg) 30%);
}
.cal-caption { margin: 0; text-align: center; font-weight: 600; font-size: 15px; max-width: 44ch; text-wrap: balance; }
.cal-caption.ok { color: var(--cyan-ink); }
.cal-caption.off { color: var(--amber-ink); }
.cal-extra { display: flex; gap: 10px; align-items: flex-end; width: min(100%, 420px); }
.cal-error { margin: 0; color: var(--amber-ink); font-size: 14px; font-weight: 600; text-align: center; }
.cal-row { display: flex; align-items: center; gap: 14px; }
.cal-save { min-width: 150px; }
.cal-scale { margin: 0; font: 12px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; }
.cal.landscape .cal-panel { flex-direction: row; flex-wrap: wrap; justify-content: center; padding-top: 8px; gap: 6px 14px; }
.cal.landscape .cal-caption { flex-basis: 100%; }

/* ---- fields -------------------------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.field.grow { flex: 1; }
.field input, .field select, .field textarea, .search input {
  min-height: 48px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  font-size: 16px; font-weight: 500; width: 100%;
}
.field select { appearance: none; -webkit-appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; }
.field textarea { padding: 12px 14px; min-height: 0; resize: none; }
.field input:focus, .field select:focus, .search input:focus, .field textarea:focus { outline: none; border-color: var(--cyan-ink); box-shadow: 0 0 0 3px var(--cyan-soft); }

/* ---- sheets ---------------------------------------------------------------------------- */
dialog.sheet {
  border: 0; padding: 10px 20px calc(20px + env(safe-area-inset-bottom)); width: 100%; max-width: 560px; max-height: min(88dvh, 820px);
  margin: auto auto 0; border-radius: 24px 24px 0 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
  overflow: auto; overscroll-behavior: contain; animation: sheet-up 0.28s var(--ease-out);
}
dialog.sheet.tall { height: min(88dvh, 820px); }
dialog.sheet::backdrop { background: rgba(20, 14, 8, 0.38); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fade-in 0.28s ease; }
:root[data-theme="dark"] dialog.sheet::backdrop { background: rgba(0, 0, 0, 0.55); }
dialog.sheet.closing { animation: sheet-down 0.22s ease-in forwards; }
dialog.sheet.closing::backdrop { animation: fade-out 0.22s ease forwards; }
dialog.sheet.dragged { animation: none; transition: none; }
dialog.sheet.settle { transition: transform 0.25s var(--ease-out); }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@media (min-width: 700px) and (min-height: 560px) {
  dialog.sheet:not(.panel) { margin: auto; border-radius: 24px; padding-bottom: 22px; animation: card-in 0.26s var(--ease-out); }
  dialog.sheet:not(.panel).closing { animation: card-out 0.18s ease-in forwards; }
  dialog.sheet:not(.panel) .grab { display: none; }
}
@keyframes card-in { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
@keyframes card-out { to { opacity: 0; transform: translateY(10px) scale(0.98); } }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-strong); margin: 0 auto 10px; }
dialog.sheet h2 { margin: 6px 0 14px; font-size: 20px; letter-spacing: -0.01em; }
.det-head, .hist-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.det-head h2, .hist-head h2 { margin: 4px 0; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.hist-head h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 460px) { #hist-export span { display: none; } #hist-export { padding: 0 12px; } }
.det-head .icon-btn, .hist-head .icon-btn { margin-right: -10px; }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.sheet-actions .btn { flex: 1 1 0; }
.sheet-actions.col { flex-direction: column; }
.lead { color: var(--muted); margin: 0 0 8px; }
.note { margin: 12px 0 0; padding: 12px 14px; border-radius: 13px; background: var(--surface-2); font-size: 14px; }
.note.warn { background: var(--amber-soft); color: var(--amber-ink); font-weight: 550; }
.save-value { margin: 14px 0 0; font: 650 22px/1.2 var(--font-num); font-variant-numeric: tabular-nums; }
.save-value small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.wel-art { display: grid; place-items: center; padding: 8px 0 4px; }
.wel-art svg { width: 210px; height: auto; }
.wa-body { fill: var(--wood-b); stroke: var(--line-strong); }
.wa-tick { stroke: var(--tick); stroke-width: 1.4; }
.wa-marker { stroke: var(--cyan); stroke-width: 2; }

/* history: a sheet on phones, a side panel beside the ruler on wide screens */
dialog.panel { display: flex; flex-direction: column; height: min(88dvh, 820px); padding-bottom: 0; }
dialog.panel:not([open]) { display: none; }
@media (min-width: 900px) {
  dialog.panel {
    position: fixed; inset: calc(var(--bar-h) + env(safe-area-inset-top)) env(safe-area-inset-right) 0 auto; margin: 0; width: 360px; max-width: 360px; height: auto;
    max-height: none; border-radius: 0; border-left: 1px solid var(--line); box-shadow: none; animation: panel-in 0.26s var(--ease-out); padding: 12px 16px 0; z-index: 15;
  }
  dialog.panel.closing { animation: panel-out 0.2s ease-in forwards; }
  dialog.panel .grab { display: none; }
}
@keyframes panel-in { from { transform: translateX(100%); } }
@keyframes panel-out { to { transform: translateX(100%); } }
.hist-count { font: 600 13px var(--font-num); color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.search { position: relative; display: block; margin: 8px 0 10px; }
.search .ic { position: absolute; left: 13px; top: 13px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 44px; -webkit-appearance: none; appearance: none; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.chip { min-height: 38px; min-width: 48px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line-strong); background: transparent; color: var(--text); font-size: 14px; font-weight: 600; transition: background-color 0.15s, color 0.15s, border-color 0.15s; }
.chip[aria-checked="true"] { background: var(--primary); border-color: transparent; color: var(--on-primary); }
.hist-list { list-style: none; margin: 4px -20px 0; padding: 0 0 calc(16px + env(safe-area-inset-bottom)); flex: 1; overflow: auto; overscroll-behavior: contain; }
@media (min-width: 900px) { .hist-list { margin: 4px -16px 0; } }
.hist-list:empty { flex: 0 0 auto; }
.hist-item { position: relative; overflow: hidden; content-visibility: auto; contain-intrinsic-size: auto 70px; }
.hist-item .hi-del { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding-right: 22px; background: var(--danger); color: #fff; font-weight: 650; gap: 8px; }
.hist-row {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; width: 100%;
  padding: 12px 20px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; touch-action: pan-y;
  transition: background-color 0.12s;
}
.hist-row.swiping { transition: none; }
.hist-row.back { transition: transform 0.25s var(--ease-out); }
.hist-row:hover { background: var(--surface-2); }
.hr-name { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-value { grid-row: span 2; font: 650 16px var(--font-num); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hr-meta { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); min-width: 0; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 99px; background: var(--amber-soft); color: var(--amber-ink); text-transform: uppercase; }
.badge.cyan { background: var(--cyan-soft); color: var(--cyan-ink); }
.hist-empty { text-align: center; color: var(--muted); padding: 34px 12px; margin: 0; }
.det-value { margin: 4px 0 10px; font: 700 30px/1.15 var(--font-num); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.det-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; font-size: 14px; }
.det-meta dt { color: var(--muted); }
.det-meta dd { margin: 0; overflow-wrap: anywhere; }
.det-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.tile-btn { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; min-height: 72px; border-radius: 16px; border: 0; background: var(--surface-2); color: var(--text); font-size: 13px; font-weight: 600; transition: transform 0.15s var(--spring); }
.tile-btn:active { transform: scale(0.95); }
.tile-btn.danger { color: var(--danger); background: var(--danger-soft); }
.det-manual textarea { width: 100%; margin-top: 8px; border-radius: 12px; border: 1px solid var(--cyan-ink); padding: 10px; background: var(--surface); }

/* settings */
.set-list { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); min-height: 60px; }
.set-row > span { font-weight: 550; }
.set-row.stack { flex-direction: column; align-items: stretch; }
.set-head { margin: 18px 0 2px; font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.mini-seg { display: flex; padding: 3px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); flex: none; }
.set-row.stack .mini-seg { flex: 1 1 auto; }
.set-row > span, .set-row > label { flex: 1 1 auto; min-width: 0; }
.mini-seg button { flex: 1 1 auto; min-height: 38px; min-width: 44px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.mini-seg button[aria-checked="true"] { background: var(--raised); color: var(--text); box-shadow: var(--shadow-sm); }
.switch { position: relative; width: 52px; height: 32px; flex: none; appearance: none; -webkit-appearance: none; margin: 0; border-radius: 16px; background: var(--line-strong); cursor: pointer; transition: background-color 0.2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.25s var(--spring); }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(20px); }
.set-row select { max-width: 52%; min-height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 12px; }
.version { color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* help */
.help-body { padding-bottom: 8px; }
.help-sec { padding: 6px 0 14px; border-bottom: 1px solid var(--line); }
.help-sec:last-child { border-bottom: 0; }
.help-sec h3 { margin: 12px 0 8px; font-size: 17px; }
.help-sec h4 { margin: 12px 0 4px; font-size: 14px; color: var(--muted); }
.help-sec p, .help-sec li { font-size: 15px; color: var(--text); }
.help-sec ul { padding-left: 20px; margin: 6px 0; }
.help-sec li { margin: 4px 0; }
.help-ill svg { width: 100%; max-width: 300px; height: auto; display: block; margin: 4px auto 8px; }
.hi-screen { fill: var(--surface-2); stroke: var(--line-strong); }
.hi-card { fill: #3b5bdb; opacity: 0.22; }
.hi-outline { fill: none; stroke: var(--cyan); stroke-width: 2; }
.hi-handle { fill: var(--cyan-mid); stroke: var(--cyan); stroke-width: 2; }
.hi-arrow { stroke: var(--cyan-ink); stroke-width: 2; stroke-linecap: round; }
.hi-ruler { fill: var(--wood-b); }
.hi-tick { stroke: var(--tick); stroke-width: 1.4; }
.hi-marker { stroke: var(--cyan); stroke-width: 2; }
.hi-lens { fill: var(--surface); stroke: var(--cyan); stroke-width: 2.4; }
.hi-cross { stroke: var(--cyan-ink); stroke-width: 1; }
.keys { width: 100%; border-collapse: collapse; font-size: 14px; }
.keys th { text-align: left; padding: 8px 12px 8px 0; white-space: nowrap; vertical-align: top; font-weight: 500; }
.keys td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.keys tr:last-child td { border-bottom: 0; }
kbd { display: inline-block; min-width: 26px; padding: 2px 6px; border-radius: 7px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface-2); font: 600 12px/1.4 var(--font-num); text-align: center; }

/* profiles */
.prof-list { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.prof-item { padding: 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.prof-item.current { border-color: var(--cyan); box-shadow: 0 0 0 1px var(--cyan) inset; }
.pi-top { display: flex; align-items: center; gap: 10px; }
.pi-top .ic { color: var(--muted); }
.pi-name { font-weight: 650; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.pi-meta { margin: 4px 0 10px 32px; font-size: 13px; color: var(--muted); }
.pi-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-left: 32px; }
.pi-actions .btn { min-height: 40px; font-size: 14px; padding: 0 12px; }
.pi-actions .btn.danger { background: var(--danger-soft); color: var(--danger); }
.pi-rename { display: flex; gap: 8px; margin: 8px 0 0 32px; }
.pi-rename input { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); padding: 0 12px; }
.conf-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.conf-list button { text-align: left; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line-strong); background: var(--surface); }
.conf-list button[aria-pressed="true"] { border-color: var(--cyan); background: var(--cyan-soft); }
.conf-list small { display: block; color: var(--muted); }

/* toasts */
.app[data-screen="main"][data-orient="landscape"] ~ .toasts { bottom: calc(130px + env(safe-area-inset-bottom)); }
.toasts { position: fixed; z-index: 2147483001; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: max-content; max-width: calc(100% - 32px); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; border-radius: 16px; min-height: 48px;
  background: #2a2118; color: #f6f3ee; box-shadow: var(--shadow); font-size: 15px; font-weight: 550; animation: toast-in 0.2s var(--ease-out);
  pointer-events: none;
}
.toast button { pointer-events: auto; }
:root[data-theme="dark"] .toast { background: #e8eaed; color: #16181b; }
.toast.out { animation: toast-out 0.18s ease-in forwards; }
.toast button { min-height: 36px; padding: 0 12px; border-radius: 10px; border: 0; background: rgba(255, 255, 255, 0.14); color: #7fe0ef; font-weight: 700; }
:root[data-theme="dark"] .toast button { background: rgba(0, 0, 0, 0.08); color: #0a7385; }
.toast:not(:has(button)) { padding-right: 16px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }

/* first-run tour */
.tour {
  position: fixed; z-index: 40; left: 0; top: 0; width: min(300px, calc(100vw - 32px)); padding: 14px 16px 10px; border-radius: 18px;
  background: var(--surface); color: var(--text); border: 1px solid var(--cyan); box-shadow: var(--shadow); animation: card-in 0.25s var(--ease-out);
}
.tour-text { margin: 0 0 6px; font-size: 15px; font-weight: 550; }
.tour-foot { display: flex; align-items: center; gap: 4px; }
.tour-step { font-size: 12px; color: var(--muted); margin-right: auto; }

/* reduced motion: only short crossfades */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.1s !important; animation-iteration-count: 1 !important; transition-duration: 0.1s !important; transition-delay: 0s !important; scroll-behavior: auto !important; }
  dialog.sheet, dialog.sheet:not(.panel), dialog.panel { animation-name: fade-in !important; }
  dialog.sheet.closing, dialog.panel.closing, dialog.sheet:not(.panel).closing { animation-name: fade-out !important; }
  .toast, .banner, .tour { animation-name: fade-in !important; }
  .surface.switching > *, .app.switching ~ .canvas { animation-name: relayout !important; }
  .seg-thumb, .switch::after, .handle.snap { transition-timing-function: linear !important; }
  .pulse.run { animation: none !important; }
}
