*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
:root{
  --canvas:#F7F5F2; --surface:#FFFFFF; --ink:#161719; --ink2:#43474C;
  --muted:#7C8188; --line:rgba(22,23,25,.08); --line2:#F0EDE8; --tint:#EEF1F7;
  --pine:#1F6B5B; --pine-soft:#E8F3F0;
  --amber:#A9660F; --amber-soft:#FDF2E2;
  --rose:#A34036; --rose-soft:#FAEAE7;
  --shadow:0 1px 2px rgba(22,23,25,.04), 0 10px 28px rgba(22,23,25,.055);
  --shadow-sm:0 1px 2px rgba(22,23,25,.05), 0 4px 12px rgba(22,23,25,.045);
  --grad:linear-gradient(135deg,#7FC4FF 0%,#A99BF7 38%,#F79BC4 68%,#FFC271 100%);

  /* Formal type / spacing / radius scale. Existing components keep their
     tuned literal values (changing those is a visual-regression risk this
     late in the build); every new surface below is built on these. */
  --fs-label:10.5px; --fs-xs:12.5px; --fs-sm:13.5px; --fs-md:14.5px;
  --fs-lg:15px; --fs-xl:17px; --fs-2xl:23px; --fs-display:27px; --fs-hero:29px;
  --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px;
  --space-5:20px; --space-6:26px; --space-7:34px; --space-8:44px;
  --radius-xs:8px; --radius-sm:14px; --radius-md:16px; --radius-lg:20px;
  --radius-card:22px; --radius-pill:999px;
}
/* Dark mode is rebound on #aime, not :root — the prototype is embedded
   into a page that keeps its own light theme, so only the phone/desktop
   canvas itself should flip. */
#aime[data-theme="dark"]{
  --canvas:#14151A; --surface:#1D1F26; --ink:#F2F0EA; --ink2:#C7C5BD;
  --muted:#9195A3; --line:#2B2E38; --line2:#363945; --tint:#242732;
  --pine:#57B184; --pine-soft:#1B3A31;
  --amber:#D8A85C; --amber-soft:#3A2E17;
  --rose:#D8705C; --rose-soft:#3A211D;
  --shadow:0 1px 2px rgba(0,0,0,.3), 0 10px 28px rgba(0,0,0,.4);
  --shadow-sm:0 1px 2px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.35);
}
#aime[data-theme="dark"]{background:var(--canvas)}
.screen{width:100%;height:100%;background:var(--canvas);overflow:hidden;position:relative;
  display:flex;flex-direction:column;font-size:15px;line-height:1.45;letter-spacing:-0.012em}
.screen::before{content:'';position:absolute;top:-180px;left:-90px;width:520px;height:400px;
  background:var(--grad);filter:blur(90px);opacity:.20;pointer-events:none}
.sbar{height:52px;flex:0 0 52px;display:flex;align-items:center;justify-content:space-between;padding:0 26px 0 30px;font-size:14px;font-weight:600;letter-spacing:0;position:relative}
.sbar .ic{display:flex;align-items:center;gap:6px}
.nav{padding:6px 22px 14px;display:flex;align-items:center;gap:12px;position:relative}
.nav-t{font-size:23px;font-weight:600;letter-spacing:-0.025em;flex:1}
.nav-a{font-size:13px;color:var(--muted);font-weight:500}
.orb{width:30px;height:30px;border-radius:50%;background:var(--grad);flex:0 0 30px;position:relative;box-shadow:0 2px 10px rgba(150,120,220,.35)}
.orb::after{content:'';position:absolute;inset:7px;border-radius:50%;background:var(--canvas)}
.orb.sm{width:22px;height:22px;flex:0 0 22px}.orb.sm::after{inset:5px}
.orb.solid::after{display:none}
.sub{padding:0 22px;color:var(--muted);font-size:13.5px;line-height:1.55;margin-bottom:18px;position:relative}
.body{flex:1;overflow:hidden;padding:0 20px;position:relative}
.card{background:var(--surface);border-radius:22px;padding:18px 19px;box-shadow:var(--shadow-sm)}
.card+.card{margin-top:12px}
.row{display:flex;align-items:center;gap:12px}
.between{display:flex;align-items:center;justify-content:space-between}
.glyph{width:36px;height:36px;border-radius:50%;background:var(--tint);display:flex;align-items:center;justify-content:center;flex:0 0 36px}
.glyph svg{width:17px;height:17px;stroke:var(--ink2);fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.t1{font-size:15px;font-weight:600;letter-spacing:-0.018em}
.t2{font-size:12.5px;color:var(--muted);line-height:1.5}
.mono{font-family:'DM Mono',monospace;font-size:10.5px;letter-spacing:0.1em;text-transform:uppercase}
.seg{display:flex;background:var(--tint);border-radius:999px;padding:3px;margin-top:15px}
.seg div{flex:1;text-align:center;font-size:12.5px;font-weight:500;padding:8px 0;border-radius:999px;color:var(--muted)}
.seg div.on{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(22,23,25,.13);font-weight:600}
.seg.amber div.on{background:var(--amber);color:#fff;box-shadow:0 2px 8px rgba(169,102,15,.3)}
.pill{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:600;padding:5px 10px;border-radius:999px;letter-spacing:0}
.p-pine{background:var(--pine-soft);color:var(--pine)}
.p-amber{background:var(--amber-soft);color:var(--amber)}
.p-rose{background:var(--rose-soft);color:var(--rose)}
.p-gray{background:var(--tint);color:var(--muted)}
.dot{width:6px;height:6px;border-radius:50%;background:currentColor}
.btn{display:flex;align-items:center;justify-content:center;gap:8px;height:52px;border-radius:999px;font-size:15px;font-weight:600;letter-spacing:-0.015em}
.btn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.btn-amber{background:var(--amber);color:#fff;box-shadow:0 3px 14px rgba(169,102,15,.28)}
.btn-ink{background:var(--ink);color:#fff}
.btn-ghost{background:var(--surface);color:var(--ink2);box-shadow:var(--shadow-sm)}
.btn-sm{height:34px;border-radius:999px;font-size:12.5px;padding:0 15px;display:inline-flex;align-items:center;justify-content:center;font-weight:600;background:var(--tint);color:var(--ink2)}
.actions{display:flex;gap:10px}
.actions .btn{flex:1}
.footbar{padding:14px 20px 26px;background:linear-gradient(to top,var(--canvas) 66%,rgba(247,245,242,0));position:absolute;left:0;right:0;bottom:0}
.hint{font-size:11.5px;color:var(--muted);text-align:center;margin-top:11px;line-height:1.5}
.chat{display:flex;flex-direction:column;gap:13px}
.msg{max-width:292px;padding:14px 17px;font-size:14.5px;line-height:1.5}
.msg.me{align-self:flex-end;background:var(--tint);color:var(--ink);border-radius:22px 22px 7px 22px}
.msg.ai{align-self:flex-start;background:var(--surface);border-radius:22px 22px 22px 7px;box-shadow:var(--shadow-sm)}
.lens{display:flex;align-items:center;gap:10px;margin:5px 0}
.lens .ln{flex:1;height:1px;background:var(--line)}
.lens .lt{font-family:'DM Mono',monospace;font-size:9.5px;letter-spacing:0.15em;text-transform:uppercase;color:var(--muted)}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{background:var(--surface);border-radius:999px;padding:9px 15px;font-size:13px;font-weight:500;color:var(--ink2);box-shadow:var(--shadow-sm)}
.why{display:inline-flex;align-items:center;gap:7px;font-size:11.5px;color:var(--muted);border-radius:999px;padding:6px 13px;background:var(--tint)}
.why svg{width:13px;height:13px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.divider{height:1px;background:var(--line);margin:16px 0}
.klist{display:flex;flex-direction:column;gap:10px;margin-top:13px}
.kitem{display:flex;gap:10px;font-size:13px;color:var(--ink2);line-height:1.45}
.kmark{flex:0 0 15px;margin-top:2px}
.kmark svg{width:15px;height:15px;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ok svg{stroke:var(--pine)} .no svg{stroke:var(--rose)}
.tab{display:flex;gap:7px;padding:0 20px 14px;position:relative}
.tab div{font-size:12.5px;font-weight:500;color:var(--muted);border-radius:999px;padding:7px 14px;background:var(--surface);box-shadow:var(--shadow-sm)}
.tab div.on{background:var(--ink);color:#fff;box-shadow:none}
.log{display:flex;flex-direction:column}
.logi{display:flex;gap:13px;padding:15px 2px;border-bottom:1px solid var(--line)}
.rail{display:flex;flex-direction:column;align-items:center;flex:0 0 9px;padding-top:5px}
.rail i{width:8px;height:8px;border-radius:50%;border:1.5px solid var(--muted);display:block}
.rail i.f{background:var(--pine);border-color:var(--pine)}
.rail i.a{background:var(--amber);border-color:var(--amber)}
.rail i.r{background:transparent;border-color:var(--rose)}
.time{font-family:'DM Mono',monospace;font-size:10.5px;color:var(--muted);letter-spacing:0.06em}
.btn-sm svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.nowrap{white-space:nowrap}
.gate svg{stroke:var(--amber)}
.composer{display:flex;align-items:center;gap:10px;background:var(--surface);border-radius:999px;padding:13px 16px;box-shadow:var(--shadow)}
.composer .ph{flex:1;font-size:14.5px;color:var(--muted)}
.composer .snd{width:34px;height:34px;border-radius:50%;background:var(--grad);display:flex;align-items:center;justify-content:center}
.composer .snd svg{width:15px;height:15px;stroke:#fff;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.opt{display:flex;gap:14px;padding:16px 0}
.opt+.opt{border-top:1px solid var(--line)}
.radio{width:19px;height:19px;border-radius:50%;border:1.7px solid #CFD3D9;flex:0 0 19px;margin-top:2px}
.radio.on{border:6px solid var(--pine);background:#fff}
.gsm{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.gsm span{display:inline-flex;align-items:center;gap:6px;background:var(--surface);border-radius:999px;padding:7px 12px;font-size:12px;font-weight:500;color:var(--ink2);box-shadow:var(--shadow-sm)}
.gsm svg{width:13px;height:13px;fill:none;stroke:var(--ink2);stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

/* ── Flow additions ─────────────────────────────────────────── */
.hero-orb{width:96px;height:96px;border-radius:50%;background:var(--grad);position:relative;
  box-shadow:0 10px 46px rgba(150,120,220,.4);margin:0 auto}
.hero-orb::after{content:'';position:absolute;inset:26px;border-radius:50%;background:var(--canvas)}
.big{font-size:29px;font-weight:600;letter-spacing:-.03em;line-height:1.22}
.lede{font-size:15px;color:var(--muted);line-height:1.6}
.center{text-align:center}
.steps{display:flex;flex-direction:column}
.step{display:flex;gap:13px;padding:15px 0}
.step+.step{border-top:1px solid var(--line)}
.sidx{width:23px;height:23px;border-radius:50%;background:var(--tint);color:var(--muted);
  font-size:11.5px;font-weight:700;display:flex;align-items:center;justify-content:center;flex:0 0 23px;margin-top:1px}
.sidx.on{background:var(--pine);color:#fff}
.sidx.now{background:var(--amber);color:#fff}
.tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.tag{font-size:10.5px;font-weight:600;letter-spacing:.02em;padding:4px 8px;border-radius:999px;
  background:var(--tint);color:var(--muted)}
.tag.amber{background:var(--amber-soft);color:var(--amber)}
.prog{height:5px;border-radius:999px;background:var(--tint);overflow:hidden;margin-top:14px}
.prog i{display:block;height:100%;border-radius:999px;background:var(--pine)}
.note{background:var(--tint);border-radius:16px;padding:14px 16px;font-size:13px;color:var(--ink2);line-height:1.5}
.note.amber{background:var(--amber-soft);color:var(--amber)}
.note.rose{background:var(--rose-soft);color:var(--rose)}
.note.pine{background:var(--pine-soft);color:var(--pine)}
.diff{display:flex;align-items:center;gap:12px;margin-top:14px}
.dchip{flex:1;text-align:center;border-radius:14px;padding:12px 8px;font-size:13px;font-weight:600}
.dchip.old{background:var(--tint);color:var(--muted);text-decoration:line-through}
.dchip.new{background:var(--pine-soft);color:var(--pine)}
.darr{color:var(--muted);font-size:16px}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:11px}
.dom{background:var(--surface);border-radius:18px;padding:15px 14px;box-shadow:var(--shadow-sm)}
.dom .glyph{margin-bottom:11px}
.dom .t1{font-size:14px}
.dom.sel{box-shadow:0 0 0 2px var(--pine),var(--shadow-sm)}
.banner{margin:0 20px 14px;border-radius:16px;padding:13px 15px;display:flex;gap:11px;align-items:flex-start}
.banner svg{width:16px;height:16px;flex:0 0 16px;margin-top:2px;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.banner.amber{background:var(--amber-soft);color:var(--amber)}
.banner.rose{background:var(--rose-soft);color:var(--rose)}
.banner b{font-weight:600;display:block;font-size:13.5px}
.banner span{font-size:12.5px;opacity:.85;line-height:1.45;display:block;margin-top:2px}
.kv{display:flex;justify-content:space-between;gap:16px;padding:11px 0;font-size:13.5px}
.kv+.kv{border-top:1px solid var(--line)}
.kv b{font-weight:600}
.kv span{color:var(--muted);text-align:right}
/* lock screen */
.lockbg{position:absolute;inset:0;background:linear-gradient(160deg,#2b2540 0%,#4a3a5c 34%,#8b6f86 62%,#c99a86 100%)}
.lockbg::after{content:'';position:absolute;inset:0;backdrop-filter:blur(0);background:rgba(10,8,14,.28)}
.lockwrap{position:relative;z-index:2;flex:1;display:flex;flex-direction:column;padding:0 16px}
.locktime{text-align:center;color:#fff;margin:36px 0 30px}
.locktime .d{font-size:15px;font-weight:500;opacity:.85;letter-spacing:.01em}
.locktime .t{font-size:78px;font-weight:600;letter-spacing:-.04em;line-height:1.05;margin-top:2px}
.notif{background:rgba(255,255,255,.82);border-radius:20px;padding:14px 15px;margin-bottom:10px;
  box-shadow:0 8px 26px rgba(0,0,0,.22)}
.notif-h{display:flex;align-items:center;gap:8px;font-size:12px;color:#4b4f55;font-weight:600}
.notif-h .orb{width:17px;height:17px;flex:0 0 17px}.notif-h .orb::after{inset:4px;background:rgba(255,255,255,.9)}
.notif-h .tm{margin-left:auto;font-weight:500;color:#6b7076}
.notif-t{font-size:14.5px;font-weight:600;margin-top:8px;letter-spacing:-.015em}
.notif-b{font-size:13.5px;color:#3d4147;margin-top:3px;line-height:1.45}
.notif-acts{display:flex;gap:1px;margin:14px -15px -14px;border-top:1px solid rgba(0,0,0,.09)}
.notif-acts div{flex:1;text-align:center;padding:12px 0;font-size:14px;font-weight:600;color:#1b6bd0}
.notif-acts div+div{border-left:1px solid rgba(0,0,0,.09)}
.notif-acts div.warn{color:var(--amber)}
.notif-quote{background:rgba(255,255,255,.62);border-radius:13px;padding:11px 13px;margin-top:11px;font-size:12.5px;color:#3d4147;line-height:1.45}
.lockfoot{margin-top:auto;padding-bottom:26px;display:flex;justify-content:center}
.lockbar{width:136px;height:5px;border-radius:5px;background:rgba(255,255,255,.85)}
/* desktop */
.desk{width:100%;height:100%;min-width:0;background:var(--canvas);display:flex;overflow:hidden;position:relative;
  font-size:14px;color:var(--ink);letter-spacing:-.01em}
.dside{width:242px;flex:0 0 242px;background:var(--surface);padding:26px 18px;display:flex;flex-direction:column;gap:4px;box-shadow:1px 0 0 var(--line)}
.dbrand{display:flex;align-items:center;gap:11px;padding:0 8px 24px}
.dbrand .orb{width:26px;height:26px;flex:0 0 26px}.dbrand .orb::after{inset:6px;background:var(--surface)}
.dbrand span{font-family:'Cormorant Garamond',serif;font-size:27px;font-weight:400;letter-spacing:-.01em}
.dnav{display:flex;align-items:center;gap:11px;padding:10px 12px;border-radius:11px;font-size:13.5px;font-weight:500;color:var(--ink2)}
.dnav.on{background:var(--tint);font-weight:600;color:var(--ink)}
.dnav svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.dmain{flex:1;padding:34px 40px;overflow:hidden}
.dhead{display:flex;align-items:flex-end;justify-content:space-between;margin-bottom:26px}
.dh1{font-size:27px;font-weight:600;letter-spacing:-.03em}
.dcols{display:grid;grid-template-columns:1.35fr 1fr;gap:24px}
.dcard{background:var(--surface);border-radius:20px;padding:22px 24px;box-shadow:var(--shadow-sm)}
.drow{display:flex;align-items:center;gap:14px;padding:15px 0}
.drow+.drow{border-top:1px solid var(--line)}
.dseg{display:flex;background:var(--tint);border-radius:999px;padding:3px}
.dseg div{padding:6px 15px;border-radius:999px;font-size:12.5px;font-weight:500;color:var(--muted)}
.dseg div.on{background:var(--surface);color:var(--ink);font-weight:600;box-shadow:0 1px 3px rgba(22,23,25,.13)}
.dstat{display:flex;gap:30px;margin-top:4px}
.dstat div b{display:block;font-size:26px;font-weight:600;letter-spacing:-.03em}
.dstat div span{font-size:11.5px;color:var(--muted)}
.ink{color:var(--ink)}
.darr svg{width:17px;height:17px;fill:none;stroke:var(--muted);stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;display:block}

/* ── Prototype shell ─────────────────────────────────────── */
html,body{height:100%}
body{font-family:'Inter',sans-serif;-webkit-font-smoothing:antialiased;color:var(--ink);
  background:#0c0c0b;background-image:radial-gradient(900px 520px at 50% -160px,rgba(169,155,247,.20),transparent 70%)}
.stage{min-height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;padding:26px 16px 34px}
.stage-hint{font-size:13px;line-height:1.6;color:#a8a39b;text-align:center;max-width:520px;margin:0}
.stage-hint b{color:#f0ede6;font-weight:600}
.phone{position:relative;width:402px;height:874px;max-height:calc(100vh - 130px);border-radius:46px;
  background:#0b0b0a;padding:9px;box-shadow:0 0 0 2px #26262a,0 34px 80px rgba(0,0,0,.62);flex:0 0 auto}
.phone-in{position:relative;width:100%;height:100%;border-radius:38px;overflow:hidden;background:var(--canvas)}
.phone-notch{position:absolute;top:9px;left:50%;transform:translateX(-50%);width:118px;height:26px;
  background:#0b0b0a;border-radius:0 0 15px 15px;z-index:40;pointer-events:none}
.view{flex:1;display:flex;flex-direction:column;min-height:0;position:relative}
.scroll{flex:1;overflow-y:auto;overflow-x:hidden;padding:0 20px 14px;-webkit-overflow-scrolling:touch}
.scroll::-webkit-scrollbar{width:0}
.pad-bottom{padding-bottom:118px}
/* tab bar */
.tabbar{position:absolute;left:0;right:0;bottom:0;z-index:30;display:flex;padding:9px 14px 24px;gap:6px;
  background:linear-gradient(to top,var(--canvas) 62%,rgba(247,245,242,0))}
.tabbtn{flex:1;display:flex;flex-direction:column;align-items:center;gap:4px;padding:8px 0;border:0;background:none;
  font-family:inherit;font-size:10.5px;font-weight:600;color:var(--muted);cursor:pointer;letter-spacing:.01em}
.tabbtn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.tabbtn.on{color:var(--ink)}
.tabbtn .badge{position:absolute;transform:translate(14px,-3px);width:7px;height:7px;border-radius:50%;background:var(--amber)}
/* interactive affordances */
button{font-family:inherit}
.btn,.chip,.btn-sm,.seg div,.dom,.opt,.tabbtn,.notif-acts div,.why{cursor:pointer;-webkit-tap-highlight-color:transparent}
.btn{border:0;width:100%}
.actions .btn{width:auto}
.btn:active,.chip:active,.btn-sm:active{transform:scale(.985)}
.btn,.chip,.btn-sm,.card,.seg div{transition:transform .12s,background .16s,color .16s,box-shadow .16s,opacity .16s}
.dis{opacity:.45;pointer-events:none}
/* toast */
.toast{position:absolute;left:16px;right:16px;bottom:96px;z-index:60;background:var(--ink);color:#fff;
  border-radius:16px;padding:13px 16px;font-size:13px;line-height:1.45;box-shadow:0 12px 34px rgba(0,0,0,.3);
  opacity:0;transform:translateY(10px);transition:opacity .25s,transform .25s;pointer-events:none}
.toast.show{opacity:1;transform:none}
/* sheet */
.sheet-ov{position:absolute;inset:0;z-index:70;background:rgba(12,12,11,.42);opacity:0;transition:opacity .22s;pointer-events:none}
.sheet-ov.show{opacity:1;pointer-events:auto}
.sheet-panel{position:absolute;left:0;right:0;bottom:0;z-index:80;background:var(--canvas);
  border-radius:26px 26px 0 0;padding:22px 20px 26px;transform:translateY(102%);transition:transform .3s cubic-bezier(.22,.8,.3,1);
  max-height:86%;overflow-y:auto;box-shadow:0 -16px 44px rgba(0,0,0,.22)}
.sheet-panel.show{transform:none}
.sheet-grab{width:38px;height:4px;border-radius:4px;background:var(--line);margin:0 auto 16px}
/* progress + misc */
.tick{width:19px;height:19px;border-radius:50%;background:var(--pine);display:flex;align-items:center;justify-content:center}
.tick svg{width:11px;height:11px;stroke:#fff;fill:none;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
.spin{width:19px;height:19px;border-radius:50%;border:2px solid var(--amber-soft);border-top-color:var(--amber);animation:sp .7s linear infinite}
@keyframes sp{to{transform:rotate(360deg)}}
.prog i{transition:width .5s ease}
.fade{animation:fi .3s ease both}
@keyframes fi{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:none}}
.typing{display:inline-flex;gap:4px;align-items:center;padding:4px 0}
.typing i{width:6px;height:6px;border-radius:50%;background:var(--muted);animation:bl 1.1s infinite}
.typing i:nth-child(2){animation-delay:.18s}.typing i:nth-child(3){animation-delay:.36s}
@keyframes bl{0%,60%,100%{opacity:.25;transform:translateY(0)}30%{opacity:1;transform:translateY(-3px)}}
.restart{position:absolute;top:14px;right:16px;z-index:35;border:0;background:rgba(22,23,25,.06);color:var(--ink2);
  font-size:11px;font-weight:600;padding:6px 11px;border-radius:999px;cursor:pointer}
@media (max-width:520px){
  .phone{width:100%;max-width:402px;height:min(874px,calc(100vh - 110px));border-radius:38px}
  .stage{padding:12px 10px 18px}
}

/* Layout correction: footbar and tab bar stack in normal flow inside the
   phone, so a primary action can never sit underneath the tab bar. */
.screen .footbar{position:static;left:auto;right:auto;bottom:auto;
  padding:12px 20px 10px;background:var(--canvas);flex:0 0 auto}
.screen .tabbar{position:static;background:var(--canvas);
  border-top:1px solid var(--line);padding:8px 14px 14px;flex:0 0 auto}
.screen .view{flex:1;min-height:0;display:flex;flex-direction:column}
.pad-bottom{padding-bottom:18px}
.tabbtn{position:relative}
.restart-link{border:1px solid rgba(255,255,255,.16);background:rgba(255,255,255,.04);color:#b5b0a9;
  font-family:inherit;font-size:11.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;
  padding:9px 18px;border-radius:999px;cursor:pointer;transition:color .2s,border-color .2s,background .2s}
.restart-link:hover{color:#fff;border-color:rgba(255,255,255,.4);background:rgba(255,255,255,.08)}
.page .stage{gap:16px}
.cinput{flex:1;min-width:0;border:0;background:transparent;font-family:inherit;font-size:14.5px;
  letter-spacing:-.01em;color:var(--ink);outline:none;padding:0}
.cinput::placeholder{color:var(--muted)}
.composer .snd{border:0;cursor:pointer;flex:0 0 34px}
.tab div{cursor:pointer}

/* ── Accessibility pass: buttons standing in for the old clickable
   <div data-act> elements, plus focus visibility. ────────────────── */
button{border:0;background:none;font-family:inherit;color:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}
:focus-visible{outline:2px solid var(--pine);outline-offset:2px;border-radius:6px}
.seg button,.dseg button{flex:1;text-align:center;font-size:12.5px;font-weight:500;padding:8px 0;border-radius:999px;color:var(--muted)}
.seg button.on{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(22,23,25,.13);font-weight:600}
.seg.amber button.on{background:var(--amber);color:#fff;box-shadow:0 2px 8px rgba(169,102,15,.3)}
.dseg button{padding:6px 15px}
.dseg button.on{background:var(--surface);color:var(--ink);font-weight:600;box-shadow:0 1px 3px rgba(22,23,25,.13)}
.tab button{font-size:12.5px;font-weight:500;color:var(--muted);border-radius:999px;padding:7px 14px;background:var(--surface);box-shadow:var(--shadow-sm)}
.tab button[aria-selected="true"]{background:var(--ink);color:#fff;box-shadow:none}
button.opt{width:100%;text-align:left;font:inherit}
button.opt[disabled]{opacity:.45;pointer-events:none}
.dnav{width:100%;text-align:left}

/* ── New chrome for account/auth, settings and the theme/device toggle ── */
.skiplink{color:var(--muted);font-size:12.5px;font-weight:500;text-decoration:underline;
  text-underline-offset:2px;padding:6px 4px}
.flabel{display:flex;flex-direction:column;gap:7px;font-size:12.5px;font-weight:600;color:var(--ink2)}
.finput{height:48px;border-radius:var(--radius-sm);border:1px solid var(--line);background:var(--surface);
  padding:0 15px;font-family:inherit;font-size:14.5px;color:var(--ink);outline:none;width:100%}
.finput:focus-visible{border-color:var(--pine)}
.finput::placeholder{color:var(--muted)}
.codes{display:flex;gap:9px;justify-content:center}
.codebox{width:42px;height:52px;border-radius:var(--radius-xs);border:1px solid var(--line);background:var(--surface);
  display:flex;align-items:center;justify-content:center;font-size:19px;font-weight:600;font-family:'DM Mono',monospace}
.gearbtn{position:absolute;top:8px;right:20px;width:32px;height:32px;border-radius:50%;
  background:var(--tint);color:var(--ink2);display:flex;align-items:center;justify-content:center;
  font-size:15px;line-height:1;z-index:2}
.nav:has(.gearbtn) .nav-a{padding-right:38px}
.chkrow{display:flex;align-items:center;gap:14px;padding:13px 0}
.chkrow+.chkrow{border-top:1px solid var(--line)}
.chkcol{display:flex;flex-direction:column;align-items:center;gap:5px;font-size:10px;color:var(--muted)}
.chk{width:26px;height:26px;border-radius:8px;border:1px solid var(--line);background:var(--surface);
  display:flex;align-items:center;justify-content:center}
.chk svg{width:13px;height:13px;stroke:#fff;fill:none;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
.chk.on{background:var(--pine);border-color:var(--pine)}
.linkbtn{display:block;width:100%;text-align:left;padding:12px 2px;font-size:13.5px;font-weight:600;color:var(--ink2)}
.linkbtn+.linkbtn{border-top:1px solid var(--line)}
.linkbtn.rose{color:var(--rose)}
.protoctl{position:absolute;top:14px;right:16px;z-index:36;display:flex;gap:6px}
.themebtn,.deskbtn{width:30px;height:30px;border-radius:50%;background:rgba(22,23,25,.06);
  color:var(--ink2);display:flex;align-items:center;justify-content:center;font-size:14px}
.themebtn[aria-pressed="true"],.deskbtn[aria-pressed="true"]{background:var(--ink);color:#fff}
.deskbtn svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.dcolapp{width:412px;max-width:100%;height:100%;margin:0 auto;box-shadow:0 24px 60px rgba(0,0,0,.22);
  border-radius:26px;overflow:hidden;background:var(--canvas);position:relative}
.dcolapp .screen{border-radius:26px}
.dstage{min-height:100%;display:flex;align-items:center;justify-content:center;padding:26px}
/* When the in-prototype desktop toggle is on, the phone bezel Aime draws
   around itself steps aside so the desktop shell can use the full canvas.
   100vh is the iframe's own layout viewport (its design height, set before
   ProtoEmbed's fit-to-container transform), so it resolves correctly both
   embedded and standalone. */
.stage.desktop-mode{height:100vh;min-height:100vh;justify-content:stretch}
.phone.desktop-mode{width:100%;max-width:none;height:100%;max-height:none;flex:1 1 auto;
  align-self:stretch;border-radius:16px;padding:0;background:none;box-shadow:none}
.phone.desktop-mode .phone-notch{display:none}
.phone.desktop-mode .phone-in{border-radius:16px}
