/* the look layer: everything a person can bend on top of the theme. appearance.ts sets the data attributes and
   variables, this file reads them. loaded last so it wins ties with the theme and view rules */

:root { --page-w: clamp(1040px, 72vw, 1640px); --ui-zoom: 1; }

/* ---------- interface size ---------- */
/* a big desktop screen starts a step larger so text and fields keep their size to the eye; the interface size slider still wins */
@media (min-width: 2200px) and (pointer: fine) { :root { --ui-zoom: 1.15; } }
@media (min-width: 3200px) and (pointer: fine) { :root { --ui-zoom: 1.35; } }
#app { zoom: var(--ui-zoom); }
body:not(.is-web) #app { top: calc(38px / var(--ui-zoom)); }

/* ---------- page width ---------- */
html[data-width="narrow"] { --page-w: 820px; }
html[data-width="wide"] { --page-w: clamp(1360px, 88vw, 2240px); }
html[data-width="full"] { --page-w: 99999px; }

/* ---------- corners. the cut shape is what every panel, key and card is clipped to ---------- */
html[data-corners="sharp"] { --chamfer: inset(0); --chamfer-sm: inset(0); }
html[data-corners="sharp"] *, html[data-corners="sharp"] ::before, html[data-corners="sharp"] ::after { --cut-shape: inset(0); --key-shape: inset(0); }
html[data-corners="soft"] { --chamfer: inset(0 round 7px); --chamfer-sm: inset(0 round 5px); }
html[data-corners="soft"] *, html[data-corners="soft"] ::before, html[data-corners="soft"] ::after { --cut-shape: inset(0 round calc(var(--cut) * 0.55)); --key-shape: inset(0 round calc(var(--cut) * 0.55)); }
html[data-corners="round"] { --chamfer: inset(0 round 12px); --chamfer-sm: inset(0 round 9px); }
html[data-corners="round"] *, html[data-corners="round"] ::before, html[data-corners="round"] ::after { --cut-shape: inset(0 round calc(var(--cut) * 1.5 + 2px)); --key-shape: inset(0 round calc(var(--cut) * 1.5 + 2px)); }
/* the two hud brackets only suit squared corners */
html[data-corners="soft"] .panel::after, html[data-corners="round"] .panel::after { display: none; }
html[data-corners="soft"] .launcher-sheet, html[data-corners="round"] .launcher-sheet { clip-path: inset(0 round 16px); }
html[data-corners="sharp"] .launcher-sheet { clip-path: none; }
html[data-corners="sharp"] .chi-mark, html[data-corners="soft"] .chi-mark { border-radius: 50%; }

/* ---------- glass: how see-through the panels are. a custom background builds its panel from its own solid colour ---------- */
html[data-custom-bg]:root { --panel: color-mix(in srgb, var(--panel-solid) 66%, transparent); }
html[data-custom-bg][data-pattern]:not([data-pattern="none"]):root { --panel: color-mix(in srgb, var(--panel-solid) 94%, transparent); }
html[data-glass="clear"]:root { --panel: color-mix(in srgb, var(--panel-solid) 26%, transparent); }
html[data-glass="frost"]:root { --panel: color-mix(in srgb, var(--panel-solid) 56%, transparent); }
html[data-glass="solid"]:root { --panel: var(--panel-solid); }
html[data-glass="clear"] :is(.panel, .card, .tile)::before { -webkit-backdrop-filter: blur(14px) saturate(1.25); backdrop-filter: blur(14px) saturate(1.25); }
html[data-glass="frost"] :is(.panel, .card, .tile)::before { -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }

/* ---------- borders ---------- */
html[data-border="faint"]:not([data-custom-bg]) { --line: color-mix(in srgb, var(--ink) 7%, transparent); --line-2: color-mix(in srgb, var(--ink) 16%, transparent); }
html[data-border="bold"]:not([data-custom-bg]) { --line: color-mix(in srgb, var(--ink) 26%, transparent); --line-2: color-mix(in srgb, var(--ink) 48%, transparent); }

/* ---------- type switches ---------- */
html[data-caps="off"] *, html[data-caps="off"] ::before, html[data-caps="off"] ::after { text-transform: none !important; }
html[data-glitch="off"] h1.glitch { animation: none; }

/* ---------- how a page arrives ---------- */
html[data-enter="fade"] .view.entering { animation: view-fade 0.3s ease; }
html[data-enter="slide"] .view.entering { animation: view-slide 0.36s var(--spring); }
html[data-enter="none"] .view.entering { animation: none; }
@keyframes view-fade { from { opacity: 0; } }
@keyframes view-slide { from { opacity: 0; transform: translateY(28px); } }

/* ---------- the rail on the other side ---------- */
@media (min-width: 900px) {
  html[data-rail="right"] #app { grid-template-columns: minmax(0, 1fr) 236px; }
  html[data-rail="right"] #rail { order: 2; border-right: 0; border-left: 1px solid var(--line); }
}

/* ---------- more background patterns ---------- */
[data-pattern="waves"] {
  --pat-ink: var(--line-2);
  --pat-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='60' height='24'><path d='M0 12Q15 2 30 12T60 12' fill='none' stroke='black' stroke-width='1.2'/></svg>");
}
[data-pattern="hex"] {
  --pat-ink: var(--line-2);
  --pat-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='56' height='100'><path d='M28 66L0 50V16L28 0l28 16v34L28 66v34M0 84l28 16 28-16V50L28 34 0 50z' fill='none' stroke='black' stroke-width='1'/></svg>");
}
[data-pattern="diamonds"] {
  --pat-ink: var(--line-2);
  --pat-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='34' height='34'><path d='M17 2L32 17L17 32L2 17Z' fill='none' stroke='black' stroke-width='1'/></svg>");
}
[data-pattern="cross"] {
  --pat-ink: var(--line-2);
  --pat-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='16' height='16'><path d='M4 4l4 4m0-4l-4 4' stroke='black' stroke-width='1.1'/></svg>");
}
.pattern-swatch:is([data-pattern="waves"], [data-pattern="hex"], [data-pattern="diamonds"], [data-pattern="cross"]) { background-color: var(--ink-2); outline: 0; }

/* ---------- fonts the look studio can pick. files are bundled and only download once a look uses them ---------- */
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../assets/fonts/atkinson-hyperlegible-400.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("../assets/fonts/atkinson-hyperlegible-700.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("../assets/fonts/opendyslexic-400.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "OpenDyslexic"; src: url("../assets/fonts/opendyslexic-700.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../assets/fonts/fredoka-400.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Fredoka"; src: url("../assets/fonts/fredoka-600.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../assets/fonts/lora-400.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../assets/fonts/lora-700.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("../assets/fonts/space-mono-400.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("../assets/fonts/space-mono-700.woff2") format("woff2"); font-weight: 600 900; font-display: swap; }
@font-face { font-family: "Special Elite"; src: url("../assets/fonts/special-elite-400.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../assets/fonts/caveat-500.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../assets/fonts/caveat-700.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }
@font-face { font-family: "Patrick Hand"; src: url("../assets/fonts/patrick-hand-400.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "VT323"; src: url("../assets/fonts/vt323-400.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Press Start 2P"; src: url("../assets/fonts/press-start-2p-400.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../assets/fonts/orbitron-500.woff2") format("woff2"); font-weight: 400 600; font-display: swap; }
@font-face { font-family: "Orbitron"; src: url("../assets/fonts/orbitron-700.woff2") format("woff2"); font-weight: 700 900; font-display: swap; }

/* some faces run small or wide, so they get their own sizes where it matters */
html[data-font="terminal"] body, html[data-font="hand"] body { font-size: 17px; }
html[data-font="hand"] h1 { font-size: 42px; }
html[data-font="arcade"] h1 { font-size: 22px; line-height: 1.35; }
html[data-font="arcade"] .station span { font-size: 13px; }
html[data-font="arcade"] .launcher-title { font-size: 20px; }
html[data-font="scifi"] h1 { font-size: 30px; letter-spacing: 0.02em; }
html[data-font="scifi"] .station span { font-size: 19px; }
html[data-font="dyslexia"] body { font-size: 14px; }

/* ---------- density: how much air sits around things ---------- */
html[data-density="compact"] .view { gap: 10px; }
html[data-density="compact"] :is(.panel, fieldset.panel) { padding: 11px; }
html[data-density="compact"] .station { min-height: 40px; }
html[data-density="roomy"] .view { gap: 24px; }
html[data-density="roomy"] :is(.panel, fieldset.panel) { padding: 22px; }
html[data-density="roomy"] .station { min-height: 54px; }

/* ---------- content hugs the menu instead of sitting in the middle (wide screens only) ---------- */
@media (min-width: 900px) {
  html[data-align="left"] :is(.view, #pane-bar) { padding-left: 28px; padding-right: max(28px, calc(100% - var(--page-w) - 28px)); }
  html[data-align="left"] :is(#view-references, #view-gesture, #view-web, #view-chat) { padding-inline: 22px; }
}

/* ---------- the radio dock on phones and portrait tablets can sit on top ---------- */
@media (max-width: 899px) {
  html[data-dock="top"] #dock { bottom: auto; top: max(12px, env(safe-area-inset-top)); }
  html[data-dock="top"] #screen { padding-top: calc(104px + env(safe-area-inset-top)); }
  html[data-dock="top"] .view { padding-bottom: 40px; }
}

/* ---------- accessibility ---------- */
html[data-contrast="high"]:root {
  --ink-2: var(--ink);
  --ink-3: color-mix(in srgb, var(--ink) 88%, var(--bg));
  --line: color-mix(in srgb, var(--ink) 40%, transparent);
  --line-2: color-mix(in srgb, var(--ink) 70%, transparent);
}
html[data-focus="bold"] :focus-visible { outline: 4px solid var(--chi); outline-offset: 3px; }
html[data-spacing="loose"] body { letter-spacing: 0.03em; word-spacing: 0.14em; line-height: 1.8; }
html[data-spacing="loose"] :is(p, li, .hint, textarea, input, select) { line-height: 1.8; }

/* ---------- the look studio in setup ---------- */
/* the studio follows the page width pick too, so the choice is visible right here */
.studio { display: flex; flex-direction: column; gap: 14px; max-width: min(100%, var(--page-w)); }
.studio-box { --cut: 14px; display: flex; flex-direction: column; gap: 16px; }
.studio-box > h2 { margin: 0; color: var(--ink-2); }
.studio .hint, .g-hint { margin: 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.group { display: flex; flex-direction: column; gap: 8px; }
.g-title { margin: 0; font: 700 12px/1.2 var(--font-label); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); }
.studio-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.studio select, .studio input:not([type="range"], [type="checkbox"], [type="color"]), .studio textarea { min-height: 44px; }

/* tabs */
.look-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 0; border-bottom: 1px solid var(--line-2); }
.look-tabs::-webkit-scrollbar { display: none; }
.look-tab {
  flex: none; min-height: 46px; padding: 0 16px; border: 0; background: none; cursor: pointer; color: var(--ink-2);
  font: 700 12px var(--font-label); letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap;
  box-shadow: inset 0 -3px 0 transparent; transition: color 0.14s, box-shadow 0.14s, background 0.14s;
}
.look-tab:hover { color: var(--ink); background: var(--panel-hi); }
.look-tab[aria-selected="true"] { color: var(--chi); box-shadow: inset 0 -3px 0 var(--chi); background: var(--chi-dim); }
.look-panel { display: flex; flex-direction: column; gap: 14px; }

/* choice buttons, selected is a filled key with a tick so colour is not the only signal */
.choice-row { display: flex; flex-wrap: wrap; gap: 6px; }
.opt {
  --cut: 8px; clip-path: var(--cut-shape);
  min-height: 44px; padding: 0 14px; border: 0; cursor: pointer; color: var(--ink);
  background: var(--panel-hi); box-shadow: inset 0 0 0 1px var(--line-2);
  font: 600 12px var(--font-label); letter-spacing: 0.08em; text-transform: uppercase;
  transition: background 0.12s, color 0.12s, box-shadow 0.12s, transform 0.12s;
}
.opt:hover { background: var(--chi-dim); box-shadow: inset 0 0 0 1px var(--chi); }
.opt:active { transform: scale(0.97); }
.opt[aria-pressed="true"] { color: var(--chi-ink); background: var(--chi); box-shadow: none; }
.opt[aria-pressed="true"]::before { content: "✓ "; }
.opt.danger { color: var(--red); }
.opt:disabled { opacity: 0.45; cursor: not-allowed; }

/* sliders: label, value and reset on one line, the track below, the explanation under it */
.slider-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px; }
.slider-row .g-title { grid-column: 1; }
.slider-row output { grid-column: 2; min-width: 4ch; text-align: right; font: 700 13px var(--font-label); color: var(--chi); font-variant-numeric: tabular-nums; }
.slider-row .undo { grid-column: 3; min-width: 44px; min-height: 36px; border: 0; background: none; color: var(--ink-2); cursor: pointer; font: 600 11px var(--font-label); letter-spacing: 0.08em; text-transform: uppercase; }
.slider-row .undo:hover:not(:disabled) { color: var(--chi); }
.slider-row .undo:disabled { opacity: 0.3; cursor: default; }
.slider-row input[type="range"] { grid-column: 1 / -1; width: 100%; height: 36px; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: pointer; }
.slider-row .g-hint { grid-column: 1 / -1; }
.slider-row.off { opacity: 0.5; }
.slider-row.off input { cursor: not-allowed; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; background: linear-gradient(90deg, var(--chi) var(--fill, 0%), var(--line-2) var(--fill, 0%)); }
input[type="range"]::-moz-range-track { height: 6px; background: var(--line-2); }
input[type="range"]::-moz-range-progress { height: 6px; background: var(--chi); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; margin-top: -9px; background: var(--chi); border: 3px solid var(--bg); box-shadow: 0 0 0 1.5px var(--chi); border-radius: 0; clip-path: polygon(0 0, 70% 0, 100% 30%, 100% 100%, 0 100%); }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; background: var(--chi); border: 3px solid var(--bg); border-radius: 0; box-shadow: 0 0 0 1.5px var(--chi); }

/* a notice that explains why something is not doing anything */
.notice { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 12px; font-size: 13px; color: var(--ink); background: var(--chi-dim); box-shadow: inset 3px 0 0 var(--chi); }
.notice .pill { min-height: 40px; }

/* colours */
.color-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch-btn { position: relative; width: 44px; height: 44px; padding: 0; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-2); }
.swatch-btn:hover { box-shadow: inset 0 0 0 2px var(--ink); }
.swatch-btn[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--bg), 0 0 0 3px var(--ink); }
.swatch-btn[aria-pressed="true"]::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; font: 700 18px/1 system-ui; color: #fff; mix-blend-mode: difference; }
.swatch-btn.none { background: repeating-linear-gradient(45deg, var(--line-2) 0 2px, transparent 2px 8px); }
.color-pick { position: relative; width: 44px; height: 44px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-2); background: conic-gradient(#f33, #ff3, #3f3, #3ff, #33f, #f3f, #f33); cursor: pointer; }
.color-pick:focus-within { outline: 2px solid var(--chi); outline-offset: 2px; }
.color-pick input { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); opacity: 0; cursor: pointer; border: 0; padding: 0; }
.color-name { font: 600 12px var(--font-label); letter-spacing: 0.06em; color: var(--ink-2); }

/* presets: a little face showing the colours, the corners and the type */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.preset-cell { position: relative; display: flex; }
.preset-card {
  --cut: 10px; clip-path: var(--cut-shape);
  flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 44px; padding: 8px 8px 10px; border: 0; text-align: left; cursor: pointer;
  color: var(--ink); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: box-shadow 0.12s, transform 0.12s;
}
.preset-card:hover { box-shadow: inset 0 0 0 1px var(--chi); }
.preset-card:active { transform: scale(0.98); }
.preset-card[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--chi); background: linear-gradient(180deg, var(--chi-dim), transparent), var(--panel); }
.pc-face { display: flex; align-items: center; gap: 8px; height: 54px; padding: 0 10px; background: var(--pc-bg); color: var(--pc-ink); border-radius: var(--pc-r); font: 600 24px/1 var(--pc-font); overflow: hidden; box-shadow: inset 0 0 0 1px rgba(128, 128, 128, 0.35); }
.pc-face i { flex: none; width: 30px; height: 16px; background: var(--pc-acc); border-radius: var(--pc-r); }
.pc-face b { flex: 1; font-weight: inherit; white-space: nowrap; overflow: hidden; }
.pc-name { font: 700 12px/1.2 var(--font-label); letter-spacing: 0.08em; text-transform: uppercase; }
.pc-blurb { font-size: 12px; line-height: 1.35; color: var(--ink-2); }
.pc-on { position: absolute; top: 12px; right: 12px; padding: 2px 6px; font: 700 10px var(--font-label); letter-spacing: 0.1em; text-transform: uppercase; background: var(--chi); color: var(--chi-ink); }
.preset-cell .x { position: absolute; top: 4px; right: 4px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center; border: 0; background: var(--panel-solid); color: var(--ink); cursor: pointer; font-size: 18px; line-height: 1; box-shadow: inset 0 0 0 1px var(--line-2); }
.preset-cell .x:hover { background: var(--red); color: #fff; }

/* theme and pattern pickers share the same selected look */
.theme-card[aria-pressed="true"], .pattern-chip[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--chi); }
.theme-card .theme-blurb { color: var(--ink-2); }
.code-box, .studio textarea.code-box { width: 100%; min-height: 84px; resize: vertical; font: 12px/1.4 var(--font-code); word-break: break-all; }
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.auto-grid label { display: flex; flex-direction: column; gap: 4px; font: 700 12px var(--font-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); }

/* the live preview: a tiny copy of the app that follows every choice, sticky so it stays in view while you tweak */
.look-preview {
  zoom: calc(1 / var(--ui-zoom));
  position: sticky; top: 0; z-index: 8; display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0; height: 124px; overflow: hidden;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 18px -12px rgba(0, 0, 0, 0.6);
}
.pv-rail { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 12px 0; border-right: 1px solid var(--line); background: var(--panel-hi); }
.pv-rail i { width: 24px; height: 6px; background: var(--ink-3); }
.pv-rail i:first-child { background: var(--chi); box-shadow: 0 0 8px var(--chi); }
.pv-main { position: relative; display: flex; padding: 10px 10px 0; overflow: hidden; }
.pv-page { width: 78%; margin-inline: auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
html[data-width="narrow"] .pv-page { width: 60%; }
html[data-width="wide"] .pv-page { width: 92%; }
html[data-width="full"] .pv-page { width: 100%; }
html[data-align="left"] .pv-page { margin-inline: 0 auto; }
html .look-preview .pv-page h1 { font-size: 18px; line-height: 1.1; letter-spacing: 0; }
html .look-preview .pv-card h2 { font-size: 10px; }
.pv-card { --cut: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.pv-card p { margin: 0; font-size: 13px; line-height: 1.3; color: var(--ink-2); }
.pv-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pv-row .pill, .pv-row .chip { min-height: 28px; padding: 0 12px; font-size: 11px; }
.pv-card h2 { display: none; }
.pv-dock { display: none; position: absolute; left: 10px; right: 10px; height: 22px; background: var(--panel-solid); box-shadow: inset 0 0 0 1px var(--line-2); align-items: center; justify-content: space-around; }
.pv-dock i { width: 16px; height: 6px; background: var(--ink-3); }
.pv-dock i:nth-child(2) { background: var(--chi); }
.pv-tag { position: absolute; right: 8px; top: 6px; padding: 1px 6px; font: 700 10px var(--font-label); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); background: var(--panel-solid); }
@media (min-width: 900px) {
  html[data-rail="right"] .look-preview { grid-template-columns: minmax(0, 1fr) 52px; }
  html[data-rail="right"] .pv-rail { order: 2; border-right: 0; border-left: 1px solid var(--line); }
}
@media (max-width: 899px) {
  .look-preview { grid-template-columns: minmax(0, 1fr); height: 120px; }
  .pv-rail { display: none; }
  .pv-dock { display: flex; bottom: 8px; }
  html[data-dock="top"] .pv-dock { bottom: auto; top: 8px; }
  html[data-dock="top"] .pv-main { padding-top: 38px; }
  .pv-main { padding-bottom: 34px; }
  html[data-dock="top"] .pv-main { padding-bottom: 0; }
}

/* a message that shows where you are looking, not at the top of a long page */
.look-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 120; max-width: min(92vw, 420px);
  padding: 12px 18px; background: var(--chi); color: var(--chi-ink); font: 700 13px var(--font-label); letter-spacing: 0.06em; text-align: center;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: transform 0.22s var(--spring), opacity 0.22s;
}
.look-toast.show { transform: translate(-50%, 0); opacity: 1; }
@media (max-width: 899px) { .look-toast { bottom: calc(100px * var(--ui-zoom) + env(safe-area-inset-bottom)); } }
@media (max-width: 899px) { html[data-dock="top"] .look-toast { bottom: calc(24px + env(safe-area-inset-bottom)); } }

/* ---------- tap effects ---------- */
.fx-ripple { position: fixed; z-index: 200; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; pointer-events: none; border: 2px solid var(--chi); animation: fx-ripple 0.55s ease-out forwards; }
@keyframes fx-ripple { to { transform: scale(5); opacity: 0; } }
.fx-spark { position: fixed; z-index: 200; width: 8px; height: 8px; margin: -4px 0 0 -4px; pointer-events: none; background: var(--chi); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); animation: fx-spark 0.7s ease-out forwards; }
@keyframes fx-spark { to { transform: translate(var(--dx), var(--dy)) rotate(180deg) scale(0.2); opacity: 0; } }
html.calm .fx-ripple, html.calm .fx-spark { display: none; }

.pattern-chip { --cut: 8px; clip-path: var(--cut-shape); }
.pattern-chip:hover, .theme-card:hover { box-shadow: inset 0 0 0 1px var(--chi); }

html:not([data-font="signal"]) .key-label { font-size: 0.9em; letter-spacing: 0; }
