/* myAdvice: the client app. The Implementa look (Brand Pack v1.0 neutrals, the three-sheet mark) made
   for a phone: full screen, notch and home-bar aware, and sized in rem so iPhone text size settings apply. */
:root {
  --text: #111111;
  --muted: #6f6f6f;
  --faint: #8c8c8c;
  --grey30: #cacaca;
  --field: #d9d9d9;
  --line: #e3e3e3;
  --soft: #f4f4f4;
  --surface: #f7f7f7;
  --paper: #ffffff;
  --fill: #111111;
  --on-fill: #ffffff;
  --hero: #111111;
  --hero-text: #ffffff;
  --hero-muted: #a6a6a6;
  --mark-1: #cacaca;
  --mark-2: #8c8c8c;
  --mark-3: #111111;
  --rev-1: #4a4a4a;
  --rev-2: #8e8e8e;
  --rev-3: #ffffff;
  --ok-fg: #226546;
  --ok-bg: #eaf4ed;
  --tag-fg: #555555;
  --tag-bg: #f2f2f2;
  --err: #a32222;
  --err-bg: #fbecec;
  --accent: var(--text);
  --focus: #1d8fe8;
  --scrim: rgba(17, 17, 17, .4);
  --toast-bg: #111111;
  --toast-fg: #ffffff;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', 'Segoe UI', system-ui, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --text: #f2f2f2; --muted: #a6a6a6; --faint: #8e8e8e; --grey30: #3d3d3d; --field: #3a3a3a; --line: #2a2a2a;
    --soft: #222222; --surface: #0e0e0e; --paper: #111111; --fill: #ffffff; --on-fill: #111111; --hero: #262626;
    --mark-1: #4a4a4a; --mark-2: #8e8e8e; --mark-3: #ffffff;
    --ok-fg: #74d39e; --ok-bg: #13281c; --tag-fg: #c4c4c4; --tag-bg: #262626; --err: #ff8a7a; --err-bg: #2e1414;
    --scrim: rgba(0, 0, 0, .6); --toast-bg: #f2f2f2; --toast-fg: #111111;
    color-scheme: dark;
  }
}

/* iPhone text size (Dynamic Type) sets the base size; everything below is in rem. */
@supports (font: -apple-system-body) { html { font: -apple-system-body; } }
html, body { height: 100%; }
body { margin: 0; background: var(--paper); color: var(--text); font-family: var(--font); line-height: 1.45;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.mark { display: block; flex: none; }
.mark .m1 { fill: var(--mark-1); } .mark .m2 { fill: var(--mark-2); } .mark .m3 { fill: var(--mark-3); }
.mark.rev .m1 { fill: var(--rev-1); } .mark.rev .m2 { fill: var(--rev-2); } .mark.rev .m3 { fill: var(--rev-3); }
.mark.stepout .m2 { animation: step2 400ms ease-out both; }
.mark.stepout .m1 { animation: step1 400ms ease-out 40ms both; }
@keyframes step2 { from { transform: translate(7px, -7px); } to { transform: none; } }
@keyframes step1 { from { transform: translate(14px, -14px); } to { transform: none; } }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.applock { display: inline-flex; align-items: center; gap: 9px; }
.applock b { font-size: 1.625rem; font-weight: 800; letter-spacing: -.045em; line-height: 1; }
.applock > .mark { width: 30px; height: 30px; }
.eyebrow { margin: 0; font-size: .6875rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

/* ---------- the app frame ---------- */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--paper); overflow: hidden; }
.view { flex: 1; overflow-y: auto; overflow-x: hidden; position: relative; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; container: view / size; }
.screen { min-height: 100%; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top, 0px); box-sizing: border-box; }
.screen.in-push { animation: inPush 260ms cubic-bezier(.2, .8, .2, 1); }
.screen.in-back { animation: inBack 260ms cubic-bezier(.2, .8, .2, 1); }
.screen.in-fade { animation: inFade 180ms ease-out; }
@keyframes inPush { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes inBack { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes inFade { from { opacity: 0; } to { opacity: 1; } }
.pad { padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.bar { position: sticky; top: 0; z-index: 4; display: flex; align-items: center; gap: 10px; min-height: 56px; background: var(--paper); }
.bar-t { flex: 1; text-align: center; font-weight: 700; font-size: .9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.circ { width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: var(--soft); border-radius: 22px; color: var(--text); position: relative; flex: none; }
.circ .ico { width: 20px; height: 20px; }
.spacer { width: 44px; flex: none; }
.bar-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--line); }
.bar-prog i { display: block; height: 100%; background: var(--accent); transition: width .3s ease; }
.bar-prog .w10 { width: 10%; } .bar-prog .w20 { width: 20%; } .bar-prog .w25 { width: 25%; } .bar-prog .w33 { width: 33%; }
.bar-prog .w40 { width: 40%; } .bar-prog .w50 { width: 50%; } .bar-prog .w60 { width: 60%; } .bar-prog .w67 { width: 67%; }
.bar-prog .w75 { width: 75%; } .bar-prog .w80 { width: 80%; } .bar-prog .w100 { width: 100%; }
.body { flex: 1; display: flex; flex-direction: column; gap: 28px; padding-block: 6px 32px; }
.body.top { padding-top: 18px; }
.body.tight { padding-top: 8px; }
.foot { position: sticky; bottom: 0; z-index: 3; display: flex; flex-direction: column; gap: 6px; padding-top: 12px;
  padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)); background: linear-gradient(to bottom, transparent, var(--paper) 18px); }
.with-tabs .foot { padding-bottom: 18px; }
.display { margin: 0; font-size: 2.125rem; line-height: 1.04; font-weight: 800; letter-spacing: -.055em; text-wrap: balance; overflow-wrap: anywhere; }
.display.xl { font-size: 2.75rem; line-height: 1; letter-spacing: -.06em; }
.title { margin: 0; font-size: 1.75rem; line-height: 1.1; font-weight: 800; letter-spacing: -.045em; text-wrap: balance; }
.h2 { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: -.04em; }
.lead { margin: 0; color: var(--muted); font-size: 1.03rem; line-height: 1.5; }
.sec-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.muted { color: var(--muted); }
.small { font-size: .84rem; }
.flush { margin: 0; }
.fine { margin: 0; color: var(--muted); font-size: .8125rem; text-align: center; }
h1:focus { outline: none; }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 700; font-size: 1.03rem; padding: 0 22px; background: var(--fill); color: var(--on-fill); text-decoration: none; transition: transform .12s ease, opacity .15s; box-sizing: border-box; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:disabled { opacity: .3; cursor: default; }
.btn.ghost { background: var(--paper); color: var(--text); border-color: var(--field); }
.btn.quiet { background: none; color: var(--text); min-height: 46px; font-weight: 650; }
.btn.danger { background: none; color: var(--err); min-height: 46px; font-weight: 650; }
.btn.light { background: #ffffff; color: #111111; }
.btn.sm { min-height: 44px; font-size: .9375rem; width: auto; padding: 0 18px; }
.btn .ico { width: 20px; height: 20px; }
.btn.busy { opacity: .6; pointer-events: none; }
.link { background: none; border: 0; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; font-weight: 650; align-self: flex-start; }

.card { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.card.padded { padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; background: none; border: 0; padding: 15px 16px; color: var(--text); text-decoration: none; box-sizing: border-box; }
.row + .row { border-top: 1px solid var(--line); }
button.row:active, a.row:active { background: var(--soft); }
.row .r-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row .r-t b { font-weight: 700; font-size: 1rem; letter-spacing: -.015em; line-height: 1.25; overflow-wrap: anywhere; }
.row .r-t small { color: var(--muted); font-size: .84rem; }
.row .chev { color: var(--faint); width: 18px; height: 18px; }
.ic { width: 42px; height: 42px; border-radius: 21px; display: grid; place-items: center; background: var(--soft); color: var(--text); flex: none; }
.ic.me { background: var(--fill); color: var(--on-fill); }
.ic.ok { background: var(--ok-bg); color: var(--ok-fg); }
.ic.big { width: 64px; height: 64px; border-radius: 22px; }
.ic.huge { width: 96px; height: 96px; border-radius: 30px; }
.ic.huge .ico { width: 44px; height: 44px; stroke-width: 1.3; }

.pill { display: inline-flex; align-items: center; align-self: flex-start; font-size: .75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--tag-bg); color: var(--tag-fg); white-space: nowrap; flex: none; }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); }
.pill.me { background: var(--fill); color: var(--on-fill); }
.bars { display: flex; gap: 3px; }
.bars i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.bars i.on { background: var(--accent); }
.bars i.now { background: var(--faint); }

/* home */
.homehead { display: flex; justify-content: space-between; align-items: center; min-height: 56px; gap: 12px; }
.firm { display: inline-flex; align-items: center; gap: 10px; font-size: .875rem; font-weight: 700; letter-spacing: -.01em; min-width: 0; }
.firm span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.firm-badge { width: 32px; height: 32px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; font-size: .6875rem; font-weight: 800; letter-spacing: .02em; color: var(--muted); flex: none; }
.hero { position: relative; overflow: hidden; background: var(--hero); color: var(--hero-text); border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.hero > .mark { position: absolute; width: 168px; height: 168px; right: -54px; top: -50px; }
.hero > * { position: relative; }
.hero > .mark { position: absolute; }
.hero .eyebrow { color: var(--hero-muted); }
.hero h2 { margin: 0; font-size: 1.5625rem; line-height: 1.1; font-weight: 800; letter-spacing: -.045em; max-width: 78%; text-wrap: balance; }
.hero p { margin: 0; color: var(--hero-muted); font-size: .9375rem; }
.hero .btn { margin-top: 6px; }
.calm { background: var(--soft); border-radius: 28px; padding: 22px; display: flex; flex-direction: column; gap: 6px; }
.calm b { font-size: 1.25rem; font-weight: 800; letter-spacing: -.04em; }
.calm span { color: var(--muted); font-size: .9375rem; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 22px; padding: 16px; border-radius: 22px; border: 1px solid var(--line); background: var(--paper); text-align: left; color: var(--text); min-height: 118px; transition: transform .12s ease; min-width: 0; }
.tile:active { transform: scale(.98); }
.tile b { font-weight: 750; font-size: 1rem; letter-spacing: -.02em; line-height: 1.2; display: block; }
.tile small { display: block; color: var(--muted); font-size: .8125rem; margin-top: 3px; line-height: 1.3; }
.adviser { padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.adv-top { display: flex; gap: 14px; align-items: center; min-width: 0; }
.adv-top > span:last-child { min-width: 0; }
.avatar { width: 56px; height: 56px; border-radius: 28px; background: var(--soft); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 800; font-size: 1.0625rem; color: var(--muted); flex: none; letter-spacing: -.02em; }
.avatar.sm { width: 42px; height: 42px; font-size: .875rem; }
.adv-top b { display: block; font-size: 1.125rem; font-weight: 800; letter-spacing: -.035em; overflow-wrap: anywhere; }
.adv-top b.big { font-size: 1.5rem; letter-spacing: -.045em; }
.adv-top small { color: var(--muted); font-size: .875rem; overflow-wrap: anywhere; }
.adv-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.adv-acts .btn { min-height: 46px; font-size: .9375rem; }
.copyline { display: flex; justify-content: space-between; gap: 12px; font-size: .875rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.copyline b { color: var(--text); font-weight: 650; user-select: all; -webkit-user-select: all; }

.banner { display: flex; gap: 12px; padding: 16px; border-radius: 20px; background: var(--soft); align-items: flex-start; }
.banner p { margin: 0; font-size: .9375rem; }
.banner .ico { margin-top: 1px; }
.banner.ok { background: var(--ok-bg); }
.banner.ok .ico { color: var(--ok-fg); }
.banner.err { background: var(--err-bg); color: var(--err); }
.banner .stack-s { flex: 1; min-width: 0; }
.note { display: flex; gap: 10px; padding: 13px 15px; border-radius: 16px; background: var(--soft); color: var(--muted); font-size: .875rem; }
.note p { margin: 0; }
.note .ico { width: 18px; height: 18px; margin-top: 2px; }
.action { position: relative; overflow: hidden; background: var(--hero); color: var(--hero-text); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.action > * { position: relative; }
.action > .mark { position: absolute; width: 120px; height: 120px; right: -40px; top: -38px; }
.action b { font-size: 1.1875rem; font-weight: 800; letter-spacing: -.035em; max-width: 80%; line-height: 1.15; }
.action p { margin: 0; color: var(--hero-muted); font-size: .9rem; max-width: 90%; }

/* forms */
.field { display: flex; flex-direction: column; gap: 9px; }
.lab { font-weight: 700; font-size: .9375rem; margin: 0; letter-spacing: -.01em; }
.help { margin: 0; color: var(--muted); font-size: .84rem; }
.err { margin: 0; color: var(--err); font-size: .875rem; font-weight: 650; }
.inp { width: 100%; box-sizing: border-box; min-height: 54px; border: 1px solid var(--field); border-radius: 16px; background: var(--paper); padding: 14px 16px; font-size: max(16px, 1.0625rem); -webkit-appearance: none; appearance: none; }
.inp:focus { border-color: var(--text); outline: none; box-shadow: 0 0 0 3px var(--soft); }
textarea.inp { min-height: 110px; resize: vertical; }
select.inp { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.has-err .inp, .has-err .amount { border-color: var(--err); }
.amount { display: flex; align-items: baseline; gap: 4px; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.amount:focus-within { border-color: var(--text); }
.amount span { font-size: 2.5rem; font-weight: 800; letter-spacing: -.04em; color: var(--faint); }
.amount input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 2.75rem; font-weight: 800; letter-spacing: -.045em; font-variant-numeric: tabular-nums; padding: 0; }
.amount input::placeholder { color: var(--grey30); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid2 > .field { min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--field); background: var(--paper); border-radius: 999px; padding: 10px 16px; font-size: .9375rem; font-weight: 600; color: var(--text); transition: transform .12s ease; min-height: 44px; }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"], .chip[aria-checked="true"] { background: var(--accent); color: var(--paper); border-color: var(--accent); }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 16px; border-radius: 20px; border: 1px solid var(--field); background: var(--paper); color: var(--text); transition: transform .12s ease; box-sizing: border-box; }
.opt:active { transform: scale(.99); }
.opt .o-t { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt .o-t b { font-weight: 700; font-size: 1rem; letter-spacing: -.015em; overflow-wrap: anywhere; }
.opt .o-t small { color: var(--muted); font-size: .84rem; }
.opt .o-check { width: 26px; height: 26px; border-radius: 13px; border: 1.5px solid var(--field); display: grid; place-items: center; flex: none; color: transparent; box-sizing: border-box; }
.opt .o-check .ico { width: 15px; height: 15px; stroke-width: 2.6; }
.opt[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.opt[aria-checked="true"] .o-check { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.file { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border: 1.5px dashed var(--field); border-radius: 20px; cursor: pointer; }
.file input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.file b { font-weight: 700; }
.file small { display: block; color: var(--muted); font-size: .84rem; }
.files { display: flex; flex-direction: column; gap: 8px; }
.fileline { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; }
.fileline .r-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.fileline b { font-weight: 650; font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fileline small { color: var(--muted); font-size: .8125rem; }
.switch-row { display: flex; gap: 14px; align-items: center; justify-content: space-between; }
.switch-row .s-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.switch-row .s-t b { font-weight: 700; }
.switch-row .s-t small { color: var(--muted); font-size: .84rem; }
.switch { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--grey30); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 14px; background: #ffffff; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); transition: transform .18s ease; }
.switch:checked { background: var(--ok-fg); }
.switch:checked::after { transform: translateX(20px); }
.otp { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp span { height: 60px; border-radius: 16px; border: 1px solid var(--field); display: grid; place-items: center; font-size: 1.625rem; font-weight: 750; font-variant-numeric: tabular-nums; background: var(--paper); }
.otp span.cur { border-color: var(--text); box-shadow: 0 0 0 3px var(--soft); }
.otp input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: 0; font-size: 16px; letter-spacing: 1em; }
.has-err .otp span { border-color: var(--err); }

.dl { margin: 0; display: flex; flex-direction: column; }
.dl div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 16px; }
.dl div + div { border-top: 1px solid var(--line); }
.dl dt { color: var(--muted); font-size: .9rem; flex: none; max-width: 45%; }
.dl dd { margin: 0; text-align: right; font-weight: 650; font-size: .9375rem; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }

.statuscard { background: var(--soft); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.statuscard b { font-size: 1.3125rem; font-weight: 800; letter-spacing: -.04em; line-height: 1.15; }
.statuscard small { color: var(--muted); font-size: .84rem; }
.tl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.tl li { display: grid; grid-template-columns: 26px 1fr; gap: 14px; position: relative; padding-bottom: 20px; }
.tl li:last-child { padding-bottom: 0; }
.tl li::before { content: ''; position: absolute; left: 12px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.tl li:last-child::before { display: none; }
.tl li.done::before { background: var(--text); }
.tl .d { width: 26px; height: 26px; border-radius: 13px; display: grid; place-items: center; box-sizing: border-box; border: 2px solid var(--grey30); background: var(--paper); position: relative; z-index: 1; }
.tl li.done .d { background: var(--text); border-color: var(--text); color: var(--paper); }
.tl li.done .d .ico { width: 14px; height: 14px; stroke-width: 2.8; }
.tl li.now .d { border-color: var(--text); }
.tl li.now .d::after { content: ''; width: 10px; height: 10px; border-radius: 5px; background: var(--text); }
.tl .t { display: flex; flex-direction: column; gap: 1px; padding-top: 2px; min-width: 0; }
.tl .t b { font-weight: 700; font-size: .97rem; }
.tl li.todo .t b { color: var(--faint); font-weight: 600; }
.tl .t small { color: var(--muted); font-size: .84rem; }
.msgs { display: flex; flex-direction: column; gap: 10px; }
.msg { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--soft); max-width: 88%; }
.msg.mine { align-self: flex-end; background: var(--paper); border: 1px solid var(--line); }
.msg p { margin: 0; font-size: .9375rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg small { color: var(--muted); font-size: .78rem; }
.steps3 { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: s; }
.steps3 li { display: flex; gap: 12px; align-items: flex-start; font-size: .9375rem; }
.steps3 li::before { counter-increment: s; content: counter(s); width: 26px; height: 26px; border-radius: 13px; background: var(--paper); border: 1px solid var(--line); display: grid; place-items: center; font-size: .8125rem; font-weight: 750; flex: none; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--soft); border-radius: 12px; padding: 4px; gap: 4px; }
.seg button { border: 0; background: none; border-radius: 9px; padding: 9px; font-weight: 760; font-size: .875rem; color: var(--muted); min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.minidoc { width: 42px; height: 50px; border-radius: 6px; border: 1px solid var(--line); background: var(--paper); flex: none; position: relative; display: flex; flex-direction: column; gap: 4px; padding: 9px 8px; box-sizing: border-box; }
.minidoc i { display: block; height: 3px; border-radius: 2px; background: var(--grey30); }
.minidoc i:nth-child(2) { width: 70%; } .minidoc i:nth-child(3) { width: 85%; }
.titlerow { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }

/* full-screen moments: welcome, sign-in, sent */
.moment { flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 28px; padding-top: 18px; padding-bottom: max(22px, env(safe-area-inset-bottom, 0px)); }
.moment > * { position: relative; z-index: 1; }
.moment > .crop { position: absolute; z-index: 0; width: 260px; height: 260px; right: -86px; bottom: 150px; pointer-events: none; }
.m-copy { display: flex; flex-direction: column; gap: 16px; max-width: 330px; margin-top: 32px; }
.m-cta { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.moment.two > .crop { bottom: 184px; }
@container view (max-height: 780px) { .moment > .crop { width: 200px; height: 200px; right: -64px; bottom: 140px; } .moment.two > .crop { bottom: 176px; } }
@container view (max-height: 699px) { .moment > .crop { display: none; } }
.done-moment { flex: 1; display: flex; flex-direction: column; gap: 26px; padding-block: 36px 24px; }
.done-moment .big { width: 88px; height: 88px; }
.centre { justify-content: center; gap: 24px; }
.plain-foot { display: flex; align-items: center; justify-content: center; gap: 7px; }
.plain-foot .mark { width: 20px; height: 20px; }
.plain-foot b { color: var(--text); font-weight: 800; letter-spacing: -.03em; }
.loading { flex: 1; display: grid; place-items: center; }
.loading .mark { width: 56px; height: 56px; }

.tabs { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; border-top: 1px solid var(--line); background: var(--paper); padding-top: 6px;
  padding-bottom: max(10px, env(safe-area-inset-bottom, 0px)); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.tabs button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .6875rem; font-weight: 650; color: var(--faint); padding: 4px 0; position: relative; min-height: 44px; }
.tabs button[aria-current="page"] { color: var(--text); }
.tabs button[aria-current="page"] .ico { stroke-width: 2.1; }
.tabs .badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--err); color: #ffffff; font-size: .65rem; font-weight: 750; line-height: 17px; text-align: center; padding: 0 4px; box-sizing: border-box; }

.sheet-wrap { position: absolute; inset: 0; z-index: 20; background: var(--scrim); display: flex; align-items: flex-end; animation: inFade 180ms ease-out; }
.sheet { width: 100%; background: var(--paper); border-radius: 28px 28px 0 0; display: flex; flex-direction: column; gap: 16px; padding-top: 10px; padding-bottom: max(24px, env(safe-area-inset-bottom, 0px)); max-height: 88%; overflow: auto; animation: sheetUp 260ms cubic-bezier(.2, .8, .2, 1); box-sizing: border-box; }
@keyframes sheetUp { from { transform: translateY(40%); opacity: .4; } to { transform: none; opacity: 1; } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--grey30); align-self: center; }
.toast { position: absolute; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 10px; background: var(--toast-bg); color: var(--toast-fg);
  padding: 10px 18px; border-radius: 999px; font-size: .9rem; font-weight: 650; box-shadow: 0 10px 28px rgba(0, 0, 0, .22); max-width: calc(100% - 32px); box-sizing: border-box; animation: toastIn 220ms ease-out; }
.toast.saved { padding-left: 12px; }
.toast .mark { width: 22px; height: 22px; }
.toast span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }
.offline { position: absolute; left: 0; right: 0; top: 0; z-index: 40; padding-top: env(safe-area-inset-top, 0px); background: var(--err-bg); color: var(--err); text-align: center; font-size: .84rem; font-weight: 650; }
.offline span { display: block; padding: 6px 16px; }

@media (min-width: 700px) {
  body { background: var(--surface); }
  .app { left: 50%; right: auto; width: 480px; transform: translateX(-50%); border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  .mark.stepout rect, .screen, .sheet, .sheet-wrap, .toast { animation: none !important; }
  .switch, .switch::after, .btn, .tile, .chip, .opt, .bar-prog i { transition: none; }
}
