/* Layout: one centred column, like walking down a workshop counter. Step rail, big heading, the critter on its stage, then the tools for that step. */
:root {
  --paper: #F2F0EB;
  --stage: #E6E2DA;
  --card: #FAF9F6;
  --ink: #1C1A18;
  --muted: #827E77;
  --line: #DAD6CC;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 22px 72px;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.wrap { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }

.top { display: grid; justify-items: center; gap: 2px; }
.brand { display: block; line-height: 0; }
.brand img { height: 30px; width: auto; display: block; }
.tag { font-size: 13px; color: var(--muted); }

.rail { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 2px; }
.rail button { border: 0; background: none; padding: 6px 10px; border-radius: 10px; font: 500 13px var(--body); color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.rail button i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.rail button.done i { background: var(--ink); }
.rail button[aria-current="step"] { background: var(--ink); color: var(--paper); }
.rail button[aria-current="step"] i { background: var(--paper); }
.rail button:disabled { opacity: .5; cursor: default; }

.head { display: grid; gap: 6px; justify-items: center; }
h1 { font: 600 clamp(32px, 6vw, 46px)/1.02 var(--display); letter-spacing: -.035em; margin: 0; text-wrap: balance; }
.sub { margin: 0; color: var(--muted); max-width: 46ch; text-wrap: balance; }

.stage {
  position: relative; width: 100%; height: 440px; border-radius: 28px; overflow: hidden;
  background: radial-gradient(55% 60% at 50% 40%, #F4F1EB 0%, var(--stage) 70%, #DED9CF 100%);
  display: grid; place-items: center;
}
.stage canvas.critter { width: min(390px, 86%); aspect-ratio: 1; max-width: 100%; cursor: pointer; touch-action: manipulation; }
.stage.sewing canvas.critter { cursor: crosshair; }
.caption { position: absolute; bottom: 14px; left: 0; right: 0; margin: 0; font: 500 12px var(--body); color: var(--muted); }
.bob { animation: bob 3.6s ease-in-out infinite; transform-origin: 50% 95%; }
.bob.grumpy { animation: huff 4s ease-in-out infinite; }
.bob.sleepy { animation: bob 5.5s ease-in-out infinite; }
@keyframes bob { 50% { transform: scale(.99, 1.015); } }
@keyframes huff { 0%, 70%, 100% { transform: none; } 75% { transform: scale(1.03, .97); } 80% { transform: rotate(-1.5deg); } 86% { transform: rotate(1.5deg); } 92% { transform: none; } }
.squish { animation: squish .45s cubic-bezier(.3, 1.6, .5, 1) !important; }
@keyframes squish { 30% { transform: scale(1.08, .9); } 60% { transform: scale(.97, 1.04); } }
.jump { animation: jump .7s cubic-bezier(.3, 1.4, .5, 1) !important; }
@keyframes jump { 35% { transform: translateY(-34px) scale(.96, 1.05); } 70% { transform: none scale(1.06, .94); } }
.fibre { position: absolute; width: 20px; height: 16px; pointer-events: none; border-radius: 50%;
  background: radial-gradient(circle at 40% 45%, #fff 0 35%, rgba(255,255,255,.7) 55%, rgba(255,255,255,0) 72%); }
.tube { position: absolute; left: 0; bottom: 18%; width: 22%; height: 18px; border-radius: 0 10px 10px 0; background: linear-gradient(#FFFFFF, #D9D4CA); box-shadow: inset 0 -2px 0 rgba(0,0,0,.06); }
.flying-heart { position: fixed; z-index: 50; width: 56px; height: 52px; pointer-events: none; }

.controls { width: 100%; max-width: 640px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.go { border: 0; background: var(--ink); color: var(--paper); border-radius: 14px; padding: 13px 24px; font: 500 15px var(--body); }
.go:disabled { opacity: .3; cursor: default; }
.ghost { border: 1px solid var(--line); background: transparent; border-radius: 12px; padding: 9px 15px; font: 500 13.5px var(--body); }
.ghost:disabled { opacity: .35; cursor: default; }
.hint { margin: 0; font-size: 13px; color: var(--muted); }
.label { margin: 0 0 8px; font: 600 11.5px var(--body); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }

.choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: 100%; }
@media (max-width: 560px) { .choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.choice { border: 1.5px solid var(--line); background: var(--card); border-radius: 18px; padding: 8px 6px 12px; display: grid; justify-items: center; gap: 2px; font: 500 14px var(--body); }
.choice canvas { width: 100%; max-width: 110px; aspect-ratio: 1; }
.choice[aria-pressed="true"] { border-color: var(--ink); }

.toggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: 14px; padding: 3px; gap: 3px; background: var(--card); flex-wrap: wrap; justify-content: center; }
.toggle button { border: 0; background: transparent; border-radius: 11px; padding: 8px 14px; font: 500 13.5px var(--body); color: var(--muted); }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.swatches { display: grid; grid-template-columns: repeat(6, 44px); gap: 10px; justify-content: center; }
.swatch { width: 44px; height: 44px; border: 0; padding: 0; background: none; border-radius: 12px; position: relative; }
.swatch canvas { width: 44px; height: 44px; display: block; border-radius: 12px; box-shadow: 0 2px 6px -2px rgba(30,20,10,.35); }
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -4px; border: 1.5px solid var(--ink); border-radius: 15px; }

/* Stuffing machine */
.machine { display: flex; align-items: flex-end; gap: 4px; padding: 14px 22px 0; }
.drum {
  width: 132px; height: 132px; border-radius: 50%; position: relative; overflow: hidden;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.95), rgba(255,255,255,.55) 45%, rgba(214,208,198,.6) 100%);
  box-shadow: inset 0 0 0 6px #CFC9BE, inset 0 0 0 7px rgba(0,0,0,.08), 0 10px 22px -14px rgba(0,0,0,.4);
}
.drum .swirl { position: absolute; inset: 14px; animation: spin 7s linear infinite; }
.drum.on .swirl { animation-duration: .9s; }
.drum .swirl span { position: absolute; width: 34px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 45% 45%, #fff 0 40%, rgba(255,255,255,.8) 60%, rgba(255,255,255,0) 72%); }
@keyframes spin { to { transform: rotate(360deg); } }
.drum .level { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(transparent, rgba(255,255,255,.65)); transition: height .2s; }
.lever { position: relative; width: 70px; height: 150px; touch-action: none; }
.lever .slot { position: absolute; left: 8px; bottom: 12px; width: 34px; height: 64px; border-radius: 10px; background: #D8D2C7; box-shadow: inset 0 2px 4px rgba(0,0,0,.15); }
.lever .arm { position: absolute; left: 21px; bottom: 40px; width: 8px; height: 92px; border-radius: 4px; background: linear-gradient(90deg, #BDB6AA, #E8E4DC, #A9A296); transform-origin: 50% 100%; transform: rotate(-28deg); transition: transform .45s cubic-bezier(.3, 1.6, .5, 1); cursor: grab; }
.lever .arm.held { transition: none; cursor: grabbing; }
.lever .knob { position: absolute; left: 50%; top: -14px; width: 28px; height: 28px; margin-left: -14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #5A5650, #1C1A18 70%); box-shadow: 0 3px 6px rgba(0,0,0,.3); }
.lever .pivot { position: absolute; left: 15px; bottom: 34px; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #F2EFEA, #A39C90); }
.gauge { width: min(360px, 100%); display: grid; gap: 6px; }
.gauge-bar { height: 4px; border-radius: 2px; background: var(--line); position: relative; overflow: hidden; }
.gauge-bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--ink); border-radius: 2px; }
.gauge-read { display: flex; justify-content: space-between; font: 500 12.5px var(--body); color: var(--muted); font-variant-numeric: tabular-nums; }
.gauge-read span:first-child { color: var(--ink); }

.ceremony { width: 100%; border: 1.5px dashed var(--line); border-radius: 22px; padding: 18px; display: grid; justify-items: center; gap: 10px; }
.ceremony h2 { font: 600 22px/1.1 var(--display); letter-spacing: -.02em; margin: 0; }
.heart-btn { border: 0; background: transparent; padding: 0; width: 92px; height: 84px; }
.heart-btn svg { width: 100%; height: 100%; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.heart-btn.beat svg { animation: beat .35s; }
@keyframes beat { 40% { transform: scale(1.18); } }
.warmth { display: flex; gap: 6px; }
.warmth i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.warmth i.on { background: #C8463F; }

.threads { display: flex; gap: 8px; justify-content: center; }
.thread { width: 28px; height: 28px; border-radius: 50%; border: 0; padding: 0; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); position: relative; }
.thread[aria-pressed="true"]::after { content: ""; position: absolute; inset: -4px; border: 1.5px solid var(--ink); border-radius: 50%; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; align-items: center; }

.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 20px; width: min(460px, 100%); text-align: left; }
.fields .wide { grid-column: 1 / -1; }
@media (max-width: 480px) { .fields { grid-template-columns: minmax(0, 1fr); } }
.field { display: grid; gap: 2px; min-width: 0; }
.field span { font: 600 11.5px var(--body); color: var(--muted); letter-spacing: .1em; text-transform: uppercase; }
input[type="text"] { width: 100%; border: 0; border-bottom: 1.5px solid var(--line); background: transparent; padding: 9px 0; font: 400 17px var(--body); color: var(--ink); outline: none; border-radius: 0; }
input[type="text"]:focus { border-bottom-color: var(--ink); }
input::placeholder { color: #B9B4AB; }

/* Birth certificate */
.cert { width: min(460px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 26px 26px 22px; display: grid; gap: 14px; box-shadow: 0 16px 30px -24px rgba(0,0,0,.4); position: relative; }
.cert::before { content: ""; position: absolute; inset: 7px; border: 1px solid var(--line); border-radius: 3px; pointer-events: none; }
.cert-k { margin: 0; font: 600 11px var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.cert h2 { font: 600 34px/1 var(--display); letter-spacing: -.03em; margin: 0; }
.cert dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 5px 16px; margin: 0; text-align: left; font-size: 14px; }
.cert dt { color: var(--muted); }
.cert dd { margin: 0; font-weight: 500; display: flex; align-items: center; gap: 6px; min-width: 0; }
.cert dd .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--c); flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.1); }
.cert .wish { font: 500 18px/1.3 var(--display); margin: 0; letter-spacing: -.01em; }
.link { display: flex; gap: 8px; width: min(460px, 100%); align-items: center; }
.link input { font-size: 14px; }

/* Their side */
.their { width: 100%; margin-top: 48px; display: grid; gap: 18px; justify-items: center; }
.their h2 { font: 600 32px/1.05 var(--display); letter-spacing: -.03em; margin: 0; }
.journey { display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: center; font: 500 13px var(--body); color: var(--muted); }
.journey span.now { color: var(--ink); }
.browser { width: 100%; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; position: relative; text-align: center; box-shadow: 0 24px 50px -36px rgba(0,0,0,.45); }
.chrome { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #EFEDE8; border-bottom: 1px solid var(--line); }
.dots { display: flex; gap: 6px; flex: none; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #D6D2C9; }
.url { flex: 1; min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font: 400 12.5px var(--body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.tb { width: 32px; height: 32px; border: 0; padding: 0; background: transparent; border-radius: 8px; position: relative; flex: none; display: grid; place-items: center; }
.tb:hover { background: #E2DFD8; }
.tb canvas { width: 28px; height: 28px; }
.tb .badge { position: absolute; right: -3px; bottom: -1px; background: #C8463F; color: #fff; font: 600 8.5px/1 var(--body); padding: 2px 3px; border-radius: 4px; }
.viewport { min-height: 440px; background: var(--paper); display: grid; place-items: center; padding: 28px 18px; position: relative; }
.gift { display: grid; gap: 12px; justify-items: center; max-width: 380px; }
.gift h3 { font: 600 28px/1.05 var(--display); letter-spacing: -.03em; margin: 0; text-wrap: balance; }
.gift p { margin: 0; color: var(--muted); }
.box { margin-top: 18px; width: 170px; height: 150px; border: 0; padding: 0; background: none; position: relative; }
.box .roof { position: absolute; left: 6px; right: 6px; top: 0; height: 58px; background: #C9B188; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.box .walls { position: absolute; left: 18px; right: 18px; top: 56px; bottom: 0; background: #D9C4A0; border-radius: 0 0 4px 4px; box-shadow: 0 12px 22px -14px rgba(0,0,0,.45); }
.box .window { position: absolute; left: 50%; top: 22px; width: 44px; height: 36px; margin-left: -22px; border-radius: 22px 22px 4px 4px; background: #F6EFE2; box-shadow: inset 0 2px 4px rgba(0,0,0,.12); }
.box .handle { position: absolute; left: 50%; top: -14px; width: 40px; height: 22px; margin-left: -20px; border: 5px solid #B39B73; border-bottom: 0; border-radius: 20px 20px 0 0; }
.box:hover { transform: rotate(-2deg); }
.gift canvas.big { width: 220px; height: 220px; max-width: 100%; }
.pop { animation: pop .6s cubic-bezier(.3, 1.4, .5, 1); }
@keyframes pop { from { transform: scale(.4) translateY(40px); opacity: 0; } }
.popup { position: absolute; top: 46px; right: 8px; width: 240px; max-width: calc(100% - 16px); z-index: 4; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px; box-shadow: 0 18px 40px -16px rgba(0,0,0,.35); }
.popup-head { display: flex; justify-content: space-between; font: 600 12px var(--body); padding: 0 2px 8px; }
.popup-head span:last-child { color: var(--muted); font-weight: 500; }
.popup-stage { background: var(--stage); border-radius: 8px; display: grid; justify-items: center; padding: 10px 6px 8px; gap: 2px; }
.popup-stage canvas { width: 150px; height: 150px; }
.note { font: 500 13px var(--body); background: #fff; border-radius: 999px; padding: 3px 11px; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.popup-meta { font: 500 13px var(--body); padding: 8px 2px 0; display: flex; justify-content: space-between; gap: 8px; }
.popup-meta span { color: var(--muted); font-weight: 400; font-size: 12px; }
.toast { position: absolute; top: 10px; left: 10px; width: 270px; max-width: calc(100% - 20px); z-index: 5; text-align: left; background: rgba(250,249,246,.97); border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; display: flex; gap: 10px; align-items: center; box-shadow: 0 12px 30px -14px rgba(0,0,0,.35); animation: slide .35s ease-out; }
.toast canvas { width: 38px; height: 38px; flex: none; }
.toast b { display: block; font: 600 13px var(--body); }
.toast span { font-size: 12px; color: var(--muted); }
@keyframes slide { from { transform: translateY(-14px); opacity: 0; } }
.remote { width: min(520px, 100%); display: grid; gap: 12px; justify-items: center; }
.remote[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.chip { border: 1.5px solid var(--line); background: transparent; border-radius: 999px; padding: 5px 12px; font: 500 12.5px var(--body); color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- site additions ---------- */
a.go, a.ghost { text-decoration: none; display: inline-block; color: inherit; }
a.go { color: var(--paper); }
.stage .bubble { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); background: #fff; border-radius: 16px; padding: 7px 15px; font: 500 15px var(--body); box-shadow: 0 2px 0 rgba(0,0,0,.05); z-index: 2; white-space: nowrap; max-width: 90%; overflow: hidden; text-overflow: ellipsis; animation: pop .35s ease-out; }
.stage .bubble::after { content: ""; position: absolute; left: 50%; bottom: -5px; width: 10px; height: 10px; background: #fff; transform: translateX(-50%) rotate(45deg); }
.share { width: min(460px, 100%); display: grid; gap: 18px; text-align: left; }
.share .label { margin-bottom: 4px; }
.share .hint { margin-top: 6px; }
.status { min-height: 20px; font-size: 13px; color: var(--muted); margin: 0; }
.note-row { display: flex; gap: 8px; width: min(420px, 100%); align-items: center; }
.conn { width: 100%; max-width: 640px; border: 1.5px solid var(--line); border-radius: 22px; background: var(--card); padding: 18px 20px; display: grid; gap: 12px; text-align: left; }
.conn-top { display: flex; gap: 12px; align-items: center; }
.conn-top b { display: block; font: 600 19px/1.2 var(--display); letter-spacing: -.02em; }
.conn-top span { font-size: 13.5px; color: var(--muted); }
.pulse { width: 11px; height: 11px; border-radius: 50%; flex: none; background: #D9A23A; animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(217,162,58,.55); } 100% { box-shadow: 0 0 0 12px rgba(217,162,58,0); } }
.conn.on .pulse { background: #4F9A6A; animation: none; box-shadow: 0 0 0 4px rgba(79,154,106,.18); }
.conn .link { width: 100%; }
.arrived { position: fixed; z-index: 60; left: 50%; top: 18px; transform: translateX(-50%); width: min(380px, calc(100% - 32px)); background: var(--ink); color: var(--paper); border-radius: 18px; padding: 12px 14px; display: flex; gap: 12px; align-items: center; text-align: left; box-shadow: 0 18px 40px -18px rgba(0,0,0,.5); animation: drop .5s cubic-bezier(.3, 1.4, .5, 1); }
.arrived canvas { width: 46px; height: 46px; flex: none; }
.arrived b { display: block; font: 600 16px var(--display); }
.arrived span { font-size: 13px; opacity: .75; }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } }
.tabs { display: flex; gap: 4px; margin-top: 10px; background: var(--stage); border-radius: 999px; padding: 3px; }
.tabs a { font-size: 13px; color: var(--muted); text-decoration: none; padding: 5px 12px; border-radius: 999px; }
.tabs a[aria-current] { background: var(--card); color: var(--ink); }
.desktop .wrap { padding-top: 14px; gap: 16px; }
.desktop .stage { height: 300px; }
.desktop h1 { font-size: 28px; }
.shelf { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.shelf span { margin-right: 4px; }
.shelf a { color: var(--ink); text-decoration: none; border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 11px; background: var(--card); }
.shelf a:hover { border-color: var(--ink); }
.maker-link { border: 0; background: none; padding: 4px; font: 500 13px var(--body); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
.pin-box { display: grid; gap: 10px; justify-items: center; width: min(320px, 100%); }
.pin-box input { text-align: center; font-size: 26px; letter-spacing: .5em; }
.mine { width: 100%; max-width: 640px; border: 1.5px solid var(--line); border-radius: 22px; background: var(--card); padding: 18px 20px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; text-align: left; }
.mine b { display: block; font: 600 19px/1.2 var(--display); letter-spacing: -.02em; }
.mine span { font-size: 13.5px; color: var(--muted); }
.empty { display: grid; gap: 14px; justify-items: center; padding: 60px 0; }

/* "Put it on your phone" card (install.js) */
.phone-card { width: 100%; max-width: 420px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px 20px; display: grid; gap: 10px; text-align: left; }
.phone-card[hidden] { display: none; }
.phone-card h3 { margin: 0; font: 600 18px/1.2 var(--display); letter-spacing: -.02em; }
.phone-card p { margin: 0; color: var(--muted); font-size: 14px; }
.phone-card .row { justify-content: flex-start; flex-wrap: wrap; gap: 8px; }
.phone-card .row:empty { display: none; }
.phone-card .status:empty { display: none; }
.steps-mini { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }
.steps-mini .ico { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; background: var(--stage); color: #0A84FF; vertical-align: -6px; }
.steps-mini .ico svg { width: 14px; height: 14px; }
.pc-on { display: flex; align-items: center; gap: 8px; color: var(--ink) !important; }
.pc-on .pulse { background: #4F9A6A; animation: none; box-shadow: 0 0 0 4px rgba(79,154,106,.18); }

/* Mac app chrome (desktop.js) */
.dk-close { position: fixed; top: 10px; right: 12px; z-index: 5; width: 28px; height: 28px; border: 0; border-radius: 50%; background: var(--stage); color: var(--ink); font: 400 20px/1 var(--body); cursor: pointer; }
.dk-close:hover { background: var(--line); }
.dk-foot { max-width: 420px; margin: 8px auto 0; padding: 0 16px 14px; display: grid; gap: 10px; }
.dk-switch { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.dk-switch[hidden] { display: none; }
.dk-switch .status { grid-column: 1 / -1; margin: 0; }
.dk-switch input { min-width: 0; font: inherit; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); }
.dk-switch .go { padding: 9px 16px; }
.dk-bar { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
.dk-bar button { border: 0; background: none; color: var(--muted); font: 500 13px var(--body); cursor: pointer; padding: 4px 0; }
.dk-bar button:hover { color: var(--ink); }

/* Settings gear in the header (the Mac app uses its tabs instead) */
.top { position: relative; width: 100%; max-width: 560px; justify-self: center; }
.gear { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); }
.gear:hover { color: var(--ink); background: var(--stage); }
.gear svg { width: 22px; height: 22px; }
.desktop .gear { display: none; }
.welcome { margin: 0; text-align: center; color: var(--muted); font-size: 15px; }

/* Settings page */
.settings { display: grid; gap: 14px; width: 100%; max-width: 460px; margin: 0 auto; }
.set { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px; display: grid; gap: 12px; justify-items: start; }
.set h2 { margin: 0; font: 600 20px/1.2 var(--display); letter-spacing: -.02em; }
.set .sub { margin: 0; text-align: left; }
.set .note-row, .set .pin-box { width: 100%; }
.set .phone-card { border: 0; padding: 0; background: none; max-width: none; }
.items { display: grid; gap: 8px; width: 100%; }
.item { width: 100%; display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; }
.item .thumb { width: 56px; height: 56px; border-radius: 14px; background: var(--stage); display: grid; place-items: center; overflow: hidden; }
.item .thumb canvas { width: 50px; height: 50px; }
.item b { display: block; font-weight: 600; }
.item span { color: var(--muted); font-size: 13px; }
.item .go, .item .ghost { padding: 8px 14px; font-size: 14px; }
.danger { color: #B4473F !important; }
.item > div { text-align: left; min-width: 0; }

/* Bottom tabs (install.js tabBar) */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(3, 1fr); background: rgba(250, 249, 246, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 4px 0; color: var(--muted); text-decoration: none; font: 500 11px var(--body); min-width: 0; }
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar a[aria-current] { color: var(--ink); }
.tabbar svg { width: 24px; height: 24px; }
body.has-tabbar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
