/* Maya panel: sticker-style 2D vector identity from the mascot sheet (docs/notes/brand.md). Vazirmatn is self-hosted (OFL, vazirmatn-OFL.txt). */
@font-face{font-family:"Vazirmatn";src:url("/static/vazirmatn.woff2") format("woff2");font-weight:100 900;font-style:normal;font-display:swap}
:root{
  color-scheme:light;
  /* palette extracted from the mascot */
  --brand:#52C1E6;       /* Body Blue: fills, never text-on-white (2.07:1) */
  --brand-hi:#AEE6F5;    /* Highlight Cyan: rings, soft fills */
  --eye:#F9FAFB;         /* Eye White */
  --outline:#1A1A1A;     /* Outline Black */
  --alert:#FF3B3B;       /* Alert Red: fills / icons only */
  --yellow:#FFD449;      /* Accent Yellow: fills / icons only */
  /* text-safe derivatives (>= 4.5:1 on white and on their soft tints) */
  --brand-ink:#0B6E94;   /* link / accent TEXT only: 5.72:1 on white, 5.10 on --brand-soft */
  --brand-soft:#E3F5FB;
  --danger:#C62020; --danger-soft:#FFE9E7;   /* danger TEXT: 5.79 on white, 4.98 on soft (--alert is fill/icon only) */
  --warn:#7A5200; --warn-soft:#FFF4CC; --warn-line:var(--yellow);   /* warn TEXT: 6.28 on soft (--yellow is fill/icon only) */
  --ok:#1E7B4F; --ok-soft:#E5F5EC;           /* 5.25 on white, 4.65 on soft */
  /* neutrals */
  --ink:var(--outline); --bg:#F3F9FC; --surface:#fff; --muted:#4A5566; --line:#DCE6EC; --edge:#7A8D9B; /* edge: 3.44 on white (UI boundary) */
  --neutral:#EAF2F6; --ph:#E6EEF3; --ph-text:#5A6B78; --on-fill:#fff;
  --ink-20:rgba(26,26,26,.2); --scrim:rgba(26,26,26,.6); --scrim-dark:rgba(26,26,26,.88); --glass:rgba(255,255,255,.92);
  --shadow:2px 3px 0 var(--ink-20); --shadow-hard:2px 3px 0 var(--outline); --shadow-up:0 -8px 24px rgba(26,26,26,.18);
  --bd:2px solid var(--outline);
  --r-btn:12px; --r-card:16px; --r-sheet:24px;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);overflow-x:hidden}
body{font-family:Vazirmatn,Tahoma,sans-serif;font-size:16px;font-weight:500;line-height:1.6;-webkit-text-size-adjust:100%;
  -webkit-tap-highlight-color:transparent}
button,input,textarea,select{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{opacity:.55;cursor:default}
:focus-visible{outline:3px solid var(--brand-ink);outline-offset:2px}
h1,h2,h3,p{margin:0}
a{color:var(--brand-ink)}
.sr{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.hidden{display:none!important}
.ltr{direction:ltr;unicode-bidi:isolate}
svg.i{flex:none;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}

/* ---------- layout ---------- */
#app{max-width:600px;margin:0 auto;min-height:100vh;min-height:100dvh;display:flex;flex-direction:column}
.screen{flex:1;display:flex;flex-direction:column;gap:16px;padding:8px 16px 16px}
.screen.tight{gap:12px}
.topbar{display:flex;align-items:center;gap:8px;min-height:48px}
.topbar .grow{flex:1;min-width:0}
.brand{display:flex;align-items:center;gap:8px;color:var(--brand-ink)}
.brand b{font-size:22px;font-weight:800}
.h1{font-size:22px;font-weight:700;line-height:1.6}
.h2{font-size:16px;font-weight:700;line-height:1.6}
.sub{font-size:13px;color:var(--muted);line-height:1.5}
.muted{color:var(--muted)}
.small{font-size:13px}

/* ---------- buttons ---------- */
.icon-btn{width:48px;height:48px;border-radius:var(--r-btn);background:var(--surface);border:var(--bd);box-shadow:var(--shadow);
  display:flex;align-items:center;justify-content:center;flex:none;color:var(--ink);padding:0}
.icon-btn.sm{width:48px;height:48px}
.btn{min-height:48px;border-radius:var(--r-btn);padding:0 14px;display:flex;align-items:center;justify-content:center;gap:8px;
  font-size:16px;font-weight:600;background:var(--surface);color:var(--ink);border:var(--bd);box-shadow:var(--shadow)}
.btn.primary{background:var(--brand);color:var(--ink);font-weight:800;box-shadow:var(--shadow-hard)}   /* ink on Body Blue 8.4:1; white would be 2.07:1 */
.btn.primary.danger{background:var(--danger);color:var(--on-fill)}
.btn.big{min-height:52px}
/* Button tiers (one rule for every screen):
   1 primary  .btn.primary          filled: the one main action of a screen / sheet / bar
   2 bordered .btn                  secondary actions, «بستن», «پایان کار»
   3 destructive outline .btn.danger «لغو», delete, revoke (a filled .btn.primary.danger only inside a confirm sheet)
   4 text link .btn.quiet            only for inline skips inside a sheet or a card («جواب دیگری دارم», «کد ندارم», «کپی»);
     never the only way out of a sheet or a bar. Every tap target is at least 48 x 48 css px. */
.btn.quiet{background:transparent;border:0;box-shadow:none;color:var(--brand-ink);font-weight:700;min-height:48px;min-width:72px;padding:0 12px}
.btn.danger:not(.primary){background:var(--surface);color:var(--danger);border-color:var(--danger);font-weight:700}
.btn.sm{font-size:14px}
.btn.grow{flex:1}
.mic{width:56px;height:56px;border-radius:50%;background:var(--brand);color:var(--ink);border:var(--bd);box-shadow:var(--shadow);display:flex;align-items:center;
  justify-content:center;flex:none;padding:0}
.mic.sm{width:48px;height:48px}
.mic.rec{background:var(--alert);animation:pulse 1.2s infinite}
@keyframes pulse{50%{opacity:.6}}
.send{width:48px;height:48px;border-radius:var(--r-btn);background:var(--brand-soft);color:var(--brand-ink);border:2px solid var(--brand-ink);display:flex;
  align-items:center;justify-content:center;flex:none;padding:0}
.send.sm{width:48px;height:48px}
.chip{font-size:14px;font-weight:500;min-height:48px;padding:0 12px;border-radius:999px;background:var(--surface);
  border:1.5px solid var(--edge);display:flex;align-items:center;gap:8px;color:var(--ink);text-align:start}
.chip svg{color:var(--brand-ink)}
.pill{display:inline-flex;align-items:center;gap:6px;padding:0 12px;min-height:32px;border-radius:999px;background:var(--surface);
  border:1.5px solid var(--edge);font-size:13px;flex:none;max-width:45%;overflow:hidden;white-space:nowrap}
.pill bdi{overflow:hidden;text-overflow:ellipsis}
.fchip{font-size:14px;font-weight:500;min-height:48px;padding:0 16px;border-radius:999px;background:var(--surface);color:var(--ink);
  border:1.5px solid var(--edge)}
.fchip[aria-pressed="true"]{background:var(--brand);color:var(--ink);border:var(--bd);font-weight:800}
.suggest{font-size:14px;font-weight:600;color:var(--brand-ink);min-height:48px;padding:0 16px;border-radius:999px;background:var(--brand-soft);border:1.5px solid var(--brand-ink)}

/* ---------- cards ---------- */
.card{background:var(--surface);border:var(--bd);border-radius:var(--r-card);padding:16px;display:flex;flex-direction:column;gap:12px;box-shadow:var(--shadow)}
.card.flat{padding:0;gap:0;overflow:hidden}
.card.amber{background:var(--warn-soft);color:var(--warn)}
.card.green{background:var(--ok-soft);color:var(--ok)}
.card.red{background:var(--danger-soft);color:var(--danger)}
.card.blue{background:var(--brand-soft);color:var(--brand-ink);padding:10px 16px;flex-direction:row;align-items:center;gap:12px}
.err{color:var(--danger);font-size:14px}
.divider{height:1px;background:var(--line)}
.kv{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:15px}
.kv .k{color:var(--muted)}
.kv.total{font-size:17px;font-weight:800}
.thumb{border-radius:var(--r-btn);background:var(--ph);color:var(--muted);display:flex;align-items:center;justify-content:center;flex:none;
  overflow:hidden;font-size:11px;text-align:center}
.thumb img{width:100%;height:100%;object-fit:cover}

/* ---------- home ---------- */
.composer textarea{width:100%;height:80px;border:0;outline:0;resize:none;background:transparent;padding:0;font-size:16px;
  font-weight:500;line-height:1.6;color:var(--ink)}
.composer textarea::placeholder,.inline-composer input::placeholder{color:var(--ph-text)}
.row{display:flex;align-items:center;gap:12px}
.row.between{justify-content:space-between}
.chips{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.list a,.list .item{display:flex;align-items:center;gap:12px;padding:10px 12px;min-height:56px;text-decoration:none;color:inherit;
  border-bottom:1px solid var(--line);background:none;border-left:0;border-right:0;border-top:0;width:100%;text-align:start}
.list > :last-child{border-bottom:0}
.st-ico{width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;flex:none}
.st-done{background:var(--ok-soft);color:var(--ok)}
.st-need{background:var(--warn-soft);color:var(--warn)}
.st-stop{background:var(--neutral);color:var(--muted)}
.st-run{background:var(--brand-soft);color:var(--brand-ink)}
.st-fail{background:var(--danger-soft);color:var(--danger)}
.li-text{display:flex;flex-direction:column;min-width:0;flex:1}
.li-title{font-size:15px;font-weight:500;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.li-meta{font-size:13px;color:var(--muted);line-height:1.5;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.trust{margin-top:auto;display:flex;align-items:center;justify-content:center;gap:8px;color:var(--muted);font-size:13px;text-align:center}

/* ---------- run screens «دستیار» (running / result / peek; design: run-ux) ---------- */
.rv{flex:1;display:flex;flex-direction:column;min-height:100vh;min-height:100dvh}
.rv-body{padding-bottom:16px}
.rv-top{align-items:flex-start}
.rv-tt{flex:1;min-width:0;display:flex;flex-direction:column;padding-top:2px}
.rv-tt h1{font-size:16px;font-weight:700;line-height:1.55;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.rv-tt span{font-size:13px;color:var(--muted);line-height:1.5}
.rv-hero{display:flex;flex-direction:column;align-items:center;gap:12px;padding-top:4px}
.rv-halo{width:120px;height:120px;border-radius:50%;background:var(--brand-soft);display:flex;align-items:center;justify-content:center;position:relative;flex:none}
.rv-halo::after{content:"";position:absolute;inset:-6px;border-radius:50%;border:2px solid var(--brand-hi);animation:rv-pulse 2.4s ease-in-out infinite}
.rv-halo.need{background:var(--warn-soft)}
.rv-halo.need::after{border-color:var(--yellow)}
.rv-halo.calm{background:var(--neutral)}
.rv-halo.calm::after{border-color:var(--line);animation:none}
@keyframes rv-pulse{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(1.08);opacity:.35}}
.rv-bubble{background:var(--surface);border:var(--bd);border-radius:var(--r-card);box-shadow:var(--shadow);padding:10px 16px;text-align:center;font-size:16px;
  font-weight:700;line-height:1.7;max-width:340px;min-height:48px;transition:opacity .3s;overflow-wrap:anywhere}
.rv-bubble.need{background:var(--yellow)}
.rv-bubble.fade{opacity:0}
.rv-prog{display:flex;flex-direction:column;gap:6px}
.rv-prow{display:flex;justify-content:space-between;gap:8px;font-size:13px;font-weight:700;min-height:20px}
.rv-prow span:last-child{color:var(--muted);font-weight:500}
.rv-pbar{height:8px;border-radius:4px;background:var(--line);overflow:hidden}
.rv-pbar i{display:block;height:100%;border-radius:4px;background:var(--brand);transition:width .6s ease-out}
.rv-pbar.y i{background:var(--yellow)}
.rv-calm{display:flex;gap:10px;align-items:flex-start;font-size:13px;color:var(--muted);line-height:1.7;padding:0 4px}
.rv-calm svg{color:var(--brand-ink);margin-top:2px}
.rv-bar{padding:8px 16px 16px}
.rv-peek{align-self:stretch}
.rv-bar .btn.danger{flex:none;min-width:88px}
.rv-close{flex:none;min-width:96px}
/* «دیدن صفحه» sheet */
.rv-shot{border:var(--bd);border-radius:var(--r-card);overflow:hidden;background:var(--surface);display:flex;flex-direction:column}
.rv-urlbar{height:30px;flex:none;background:var(--neutral);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:center;gap:6px;font-size:12px;color:var(--muted);padding:0 16px}
.rv-urlbar bdi{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rv-shot-in{position:relative;height:min(52vh,460px)}
.rv-shot-img{display:block;width:100%;height:100%;border:0;padding:0;background:var(--surface);cursor:zoom-in}
.rv-shot-img img{width:100%;height:100%;object-fit:cover;object-position:top;display:block}
.live-img{flex:1;min-height:0;position:relative;background:var(--surface);border:0;padding:0;width:100%;display:block}
.live-img img{width:100%;height:100%;object-fit:cover;object-position:top;display:block}
.live-empty,.private{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;
  color:var(--muted);font-size:14px;padding:16px;text-align:center}
.private{background:var(--neutral)}
/* result */
.rv-status{display:flex;flex-direction:column;align-items:center;text-align:center;gap:4px;padding-top:2px}
.rv-status h1{font-size:22px;font-weight:800;line-height:1.5}
.rv-status.ok h1{color:var(--ok)}
.rv-status.fail h1{color:var(--danger)}
.rv-status p{font-size:14px;color:var(--muted);line-height:1.7;max-width:420px}
.rv-facts{background:var(--surface);border:var(--bd);border-radius:var(--r-card);box-shadow:var(--shadow);overflow:hidden;display:flex;flex-direction:column}
.rv-item{display:flex;gap:12px;align-items:center;padding:12px 14px;border-bottom:1px solid var(--line)}
.rv-item:last-child{border-bottom:0}
.rv-item b{font-size:15px;line-height:1.6;overflow-wrap:anywhere}
.rv-thumb{width:44px;height:44px;border-radius:10px;background:var(--brand-soft);color:var(--brand-ink);flex:none;display:flex;align-items:center;justify-content:center}
.rv-row{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 14px;min-height:48px;font-size:14px;color:var(--ink);text-decoration:none}
.rv-row+.rv-row{border-top:1px solid var(--line)}
.rv-row>span:first-child{color:var(--muted)}
.rv-row b{font-weight:800;text-align:end}
.rv-link{justify-content:flex-start;gap:6px;font-weight:700;color:var(--brand-ink)}
.rv-row.rv-link>span:first-child{color:var(--brand-ink)}
.rv-copy{display:inline-flex;align-items:center;gap:6px;min-height:48px;padding:0 10px;border:0;border-radius:8px;background:var(--brand-soft);color:var(--ink);font-weight:800;font-variant-numeric:tabular-nums}
.rv-copy svg{color:var(--brand-ink)}
.rv-summary{font-size:15px;line-height:1.85;padding:0 2px}
.rv-reportbox{display:flex;flex-direction:column;gap:6px;min-width:0}
.rv-report-l{margin:0;padding:0 2px;font-size:13px;font-weight:800;color:var(--muted)}
.rv-report{font-size:15px;line-height:1.85;padding:0 2px;display:flex;flex-direction:column;gap:8px;min-width:0;overflow-wrap:anywhere}
.rv-report p,.rv-report blockquote{margin:0}
.rv-report ol,.rv-report ul{margin:0;padding-inline-start:22px;display:flex;flex-direction:column;gap:6px}
.rv-report ol{list-style-type:persian}
.rv-report li>ol,.rv-report li>ul{margin-top:6px}
.rv-report b{font-weight:800}
.rv-report a{overflow-wrap:anywhere}
.rv-report a.u{direction:ltr;unicode-bidi:isolate;word-break:break-all}
.rv-opt{display:flex;gap:10px;align-items:center;padding:10px 14px;min-height:56px;border-bottom:1px solid var(--line);color:var(--ink);text-decoration:none}
.rv-opt:last-child{border-bottom:0}
.rv-opt.pick{background:var(--brand-soft);box-shadow:inset -4px 0 0 var(--brand-ink)}
.rv-opt-t{display:flex;flex-direction:column;min-width:0;flex:1}
.rv-opt-t b{font-size:15px;display:flex;align-items:center;flex-wrap:wrap;gap:6px;overflow-wrap:anywhere}
.rv-opt-s{font-size:13px;color:var(--muted)}
.rv-pr{font-weight:800;font-size:14px;white-space:nowrap}
.rv-opt-go{display:flex;align-items:center;gap:4px;flex:none;font-size:13px;font-weight:700;color:var(--brand-ink)}
.rv-pill{font-size:12px;font-weight:700;line-height:20px;padding:0 8px;border-radius:999px;background:var(--ok-soft);color:var(--ok)}
.rv-src{display:flex;align-items:center;gap:6px;min-height:48px;font-size:14px;font-weight:700;color:var(--brand-ink);text-decoration:none;padding:0 2px}
.rv-vote{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:48px;padding:0 4px;font-size:15px}
.rv-chips{display:flex;flex-wrap:wrap;gap:8px}
.rv-why{background:var(--danger-soft);border-radius:var(--r-card);padding:12px 14px;font-size:15px;line-height:1.85;color:var(--ink);display:flex;flex-direction:column}
.rv-why b{font-size:13px;color:var(--danger)}
.rv-note{background:var(--warn-soft);color:var(--warn);border-radius:var(--r-card);padding:12px 14px;font-size:15px;line-height:1.8}
.rv-compose{display:flex;flex-direction:column;gap:6px}
.rv-prev{background:var(--surface);border:1.5px solid var(--edge);border-radius:var(--r-card);padding:4px 16px}
.rv-prev>summary{cursor:pointer;font-size:14px;min-height:48px;display:flex;align-items:center}
.rv-prev-i{border-top:1px solid var(--line);font-size:14px}
.rv-prev-i>summary{cursor:pointer;display:flex;flex-direction:column;align-items:flex-start;gap:2px;padding:10px 0;list-style:none}
.rv-prev-i>summary::-webkit-details-marker{display:none}
.rv-prev-i>summary b{font-size:14px;line-height:1.5}
.rv-prev-body{display:flex;flex-direction:column;gap:12px;padding:0 0 12px}
.rv-prev-body .rv-status{min-height:0;padding:8px 0}
.rv-prev-body .rv-status .mrig,.rv-prev-body .rv-status .mascot{width:72px!important;height:72px!important}
@media (prefers-reduced-motion:reduce){.rv-halo::after{animation:none}.rv-bubble,.rv-pbar i{transition:none}}
/* Android picture-in-picture (window.mayaPip): only the compact run view is visible */
#pip{display:none}
body.pip #app,body.pip #overlay,body.pip #handback,body.pip .toast,body.pip .offline-banner,body.pip .lightbox{display:none!important}
body.pip{padding-top:0!important;background:var(--surface)}
body.pip #pip{display:flex;position:fixed;inset:0;flex-direction:column;justify-content:space-between;gap:6px;padding:10px 12px;background:var(--surface);color:var(--ink);
  font-size:13px;line-height:1.55;overflow:hidden}
body.pip #pip.need{background:var(--yellow)}
body.pip #pip.done{background:var(--ok-soft)}
body.pip #pip.fail{background:var(--danger-soft)}
.pip-top{display:flex;align-items:center;gap:9px;min-width:0}
.pip-top b{font-size:13px;font-weight:800;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.pip-meta{display:flex;justify-content:space-between;gap:8px;font-size:11.5px;font-weight:700;color:var(--muted);white-space:nowrap;overflow:hidden}
#pip.need .pip-meta{color:var(--ink)}
#pip.fail .pip-top b{color:var(--danger)}
#pip.done .pip-top b{color:var(--ok)}
#pip .rv-pbar{height:6px}
.s-ico{width:22px;height:22px;border-radius:50%;flex:none;box-sizing:border-box;display:flex;align-items:center;justify-content:center}
.s-ico.done{background:var(--ok-soft);color:var(--ok)}
@keyframes spin{to{transform:rotate(360deg)}}
@media (prefers-reduced-motion:reduce){.mic.rec{animation:none}}
.bottombar{position:sticky;bottom:0;flex:none;background:var(--surface);border-top:var(--bd);padding:10px 16px 16px;display:flex;flex-direction:column;gap:10px;z-index:3}
.bottombar .row{gap:8px}
.notice{display:flex;align-items:center;gap:10px;font-size:13px;color:var(--muted);line-height:1.6}

/* ---------- sheets / overlays ---------- */
.scrim{position:fixed;inset:0;background:var(--scrim);z-index:20}
.sheet{position:fixed;left:0;right:0;bottom:0;max-width:600px;margin:0 auto;background:var(--surface);border-radius:var(--r-sheet) var(--r-sheet) 0 0;
  padding:8px 16px 16px;display:flex;flex-direction:column;gap:12px;box-shadow:var(--shadow-up);border:var(--bd);border-bottom:0;z-index:21;max-height:92vh;overflow:auto}
.grab-zone{position:sticky;top:-8px;z-index:1;flex:none;height:32px;margin:-8px -16px -12px;display:flex;align-items:center;justify-content:center;
  background:var(--surface);border-radius:var(--r-sheet) var(--r-sheet) 0 0;touch-action:none;cursor:grab}
.grab{width:40px;height:4px;border-radius:999px;background:var(--edge)}
.sheet.no-grab{padding-top:20px}
.opt{display:flex;align-items:center;gap:10px;min-height:72px;padding:8px 12px;border-radius:var(--r-card);border:2px solid var(--edge);background:var(--surface);cursor:pointer}
.opt:has(input:checked){border-color:var(--ink);background:var(--brand-soft);box-shadow:0 0 0 4px var(--brand-hi)}
.opt input{width:20px;height:20px;margin:0;accent-color:var(--brand-ink);flex:none}
.opt .t{font-size:15px;font-weight:700;overflow-wrap:anywhere}
.tag{font-size:12px;font-weight:700;color:var(--muted);background:var(--neutral);border-radius:999px;padding:0 10px;line-height:22px;white-space:nowrap}
.tag.first{color:var(--brand-ink);background:var(--brand-soft)}
.check{display:flex;align-items:center;gap:10px;min-height:48px;font-size:14px}
.check input{width:22px;height:22px;margin:0;accent-color:var(--brand-ink);flex:none}
.field{width:100%;height:48px;border-radius:var(--r-btn);border:1.5px solid var(--edge);background:var(--surface);padding:0 14px;font-size:16px}
.code-big{background:var(--brand-soft);border-radius:var(--r-btn);min-height:72px;display:flex;align-items:center;justify-content:center;
  font-size:34px;font-weight:800;color:var(--brand-ink);letter-spacing:8px}
.boxes{display:flex;gap:8px;justify-content:center;direction:ltr}
.boxes input{font-size:22px;font-weight:700;text-align:center;width:52px;height:56px;border-radius:var(--r-btn);border:1.5px solid var(--edge);background:var(--surface);padding:0}
.boxes input:focus{border:2px solid var(--ink)}
.lightbox{position:fixed;inset:0;background:var(--scrim-dark);display:flex;align-items:center;justify-content:center;z-index:40;border:0;padding:0;width:100%;cursor:zoom-out}
.lb-close{position:absolute;top:max(12px,env(safe-area-inset-top));inset-inline-end:12px;width:48px;height:48px;border-radius:50%;border:2px solid var(--ink);
  background:var(--surface);color:var(--ink);display:flex;align-items:center;justify-content:center;padding:0}
.thumb-btn{border:0;padding:0;overflow:hidden;cursor:zoom-in}
.lightbox img{max-width:96vw;max-height:94vh}
.handback{position:fixed;top:0;left:0;right:0;z-index:50;background:var(--brand);color:var(--ink);display:flex;align-items:center;justify-content:center;
  gap:8px;min-height:48px;border:0;border-bottom:var(--bd);width:100%;font-size:16px;font-weight:800}
body.has-handback{padding-top:48px}
.toast{position:fixed;bottom:96px;left:50%;transform:translateX(-50%);background:var(--ink);color:var(--on-fill);border-radius:var(--r-btn);padding:8px 16px;font-size:14px;z-index:60}

/* ---------- shared: follow-up composer, vote buttons, switches ---------- */
.inline-composer{display:flex;align-items:center;gap:8px;background:var(--surface);border:var(--bd);box-shadow:var(--shadow);border-radius:var(--r-card);padding:6px}
.inline-composer input{flex:1;min-width:0;height:44px;border:0;outline:0;background:transparent;font-size:16px}
.vote{width:48px;height:48px;border-radius:var(--r-btn);background:var(--surface);border:1.5px solid var(--edge);display:flex;align-items:center;justify-content:center;padding:0}
.vote[aria-pressed="true"]{border-width:2px}
.vote.up{color:var(--ok)}.vote.up[aria-pressed="true"]{border-color:var(--ok);background:var(--ok-soft)}
.vote.down{color:var(--danger)}.vote.down[aria-pressed="true"]{border-color:var(--danger);background:var(--danger-soft)}
.switch{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;width:100%;background:none;border:0;padding:0;text-align:start}
.switch .track{width:48px;height:28px;border-radius:999px;background:var(--neutral);border:2px solid var(--edge);position:relative;flex:none;transition:background .15s}
.switch .track::after{content:"";position:absolute;top:1px;right:1px;width:20px;height:20px;border-radius:50%;background:var(--surface);border:2px solid var(--edge);box-sizing:border-box;transition:right .15s}
.switch[aria-checked="true"] .track{background:var(--brand);border-color:var(--ink)}
.switch[aria-checked="true"] .track::after{right:21px;border-color:var(--ink)}

/* ---------- mascot (assets: mascot-<state>.png, mascot-head-<name>.png; docs/notes/brand.md) ---------- */
.mascot{display:block;flex:none;object-fit:contain;user-select:none;-webkit-user-drag:none;pointer-events:none}
/* live face rig: the static PNG is the base layer (no layout jump, and the fallback if the rig cannot load); the canvas
   fades in over it once the atlas is ready, then the PNG is hidden. Only the face moves, never the whole body. */
.mrig{position:relative;display:block;flex:none}
.mrig>img{position:absolute;inset:0;width:100%;height:100%}
.mrig>canvas{position:absolute;inset:0;width:100%;height:100%;opacity:0;pointer-events:none}
.mrig.on>canvas{opacity:1}
.mrig.on>img{visibility:hidden}
.hero{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:8px 0}
.hero .h1{font-size:22px}
.hero-row{display:flex;align-items:center;gap:12px}
.hero-row .grow{flex:1;min-width:0}
.home-hero .h1{font-size:20px}
#rig-status{margin-top:-8px}
.sheet-head{display:flex;align-items:center;gap:12px}
.sheet-head .h1{flex:1;min-width:0}
.empty{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:16px 8px}
.empty p{color:var(--muted);font-size:15px}
.center-screen{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:24px 16px}
.center-screen .h1{font-size:22px}
.center-screen p{color:var(--muted)}
.center-screen .btn{min-width:200px}
.center-screen .starting-task{color:var(--ink);font-size:17px;line-height:1.8;max-width:100%;overflow-wrap:anywhere;display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.tip{display:flex;align-items:center;gap:12px;background:var(--brand-soft);border:1.5px solid var(--brand-ink);border-radius:var(--r-card);padding:8px 14px;
  font-size:14px;line-height:1.7;color:var(--ink)}
.tip b{color:var(--brand-ink)}
.errline{display:flex;align-items:center;gap:8px;color:var(--danger);font-size:14px}
.st-ico{overflow:hidden}
.starv{display:flex;color:var(--ink)}
.starv svg{fill:var(--yellow);stroke:var(--ink);stroke-width:1.5}
.ob-points{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px;text-align:start;width:100%}
.ob-points li{display:flex;align-items:center;gap:12px;font-size:15px;background:var(--surface);border:1.5px solid var(--edge);border-radius:var(--r-btn);padding:8px 12px;min-height:48px}
.ob-points svg{color:var(--brand-ink)}
.offline-banner{position:sticky;top:0;z-index:45;display:flex;align-items:center;justify-content:center;gap:10px;min-height:48px;padding:4px 16px;
  background:var(--warn-soft);color:var(--warn);border-bottom:var(--bd);font-size:14px;font-weight:700;text-align:start}
@media (min-width:900px){#app{max-width:680px}}

/* ---------- chat mode «گفتگو» (additive; tokens only; docs/chat-mode.md) ---------- */
/* mode switch (home) and tabs (history): same visual language as .fchip[aria-pressed] */
.seg{display:grid;grid-template-columns:1fr 1fr;gap:4px;padding:4px;background:var(--surface);border:var(--bd);border-radius:var(--r-card);box-shadow:var(--shadow)}
.seg-b{min-height:48px;border-radius:12px;border:2px solid transparent;background:transparent;font-size:16px;font-weight:600;color:var(--ink);
  display:flex;align-items:center;justify-content:center;gap:8px;padding:0 8px}
.seg-b[aria-checked="true"],.seg-b[aria-selected="true"]{background:var(--brand);border-color:var(--ink);font-weight:800}
.modehint{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);line-height:1.5;margin-top:-4px}
.modehint svg{color:var(--brand-ink)}
/* messages */
.msgs{display:flex;flex-direction:column;gap:16px}
.msg-u{align-self:flex-start;max-width:88%;background:var(--brand-soft);border:1.5px solid var(--brand-ink);border-radius:16px;border-end-start-radius:4px;
  padding:8px 14px;font-size:16px;line-height:1.7;overflow-wrap:anywhere}
.msg-a{display:flex;gap:8px;align-items:flex-start}
.msg-a>.mascot{margin-top:2px}
.msg-a-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:8px}
/* shopping chat: the assistant's run inside the conversation (inline run blocks, app.js runMsg) */
.msg-run{display:flex;flex-direction:column;gap:8px;min-width:0}
.msg-u.run-ans{margin-top:-8px;border-style:dashed}   /* a typed answer to the run block above it */
.rb{display:flex;flex-direction:column;gap:12px;min-width:0}
.rb-top{display:flex;align-items:center;gap:8px;font-size:14px;color:var(--muted);min-width:0}
.rb-top svg{flex:none}
.rb-t{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700;color:var(--ink)}
.rb-hero{display:flex;align-items:center;gap:12px;min-width:0}
.rb-face{flex:none;display:flex}
.rb-hero .rv-bubble{flex:1;min-width:0;text-align:start}
.rb-q{font-size:15px;line-height:1.7;white-space:pre-wrap;overflow-wrap:anywhere;color:var(--ink)}
.rb-acts{display:flex;flex-direction:column;gap:8px}
.rb-acts.row{flex-direction:row;flex-wrap:wrap}
.rb-acts.row .btn{flex:1 1 auto}
.rb-need,.rb-done{gap:12px}
.rb-confirm .kv span:last-child{text-align:end;min-width:0;overflow-wrap:anywhere}
.shopping-slot:empty,.shopping-panel [hidden],.shopping-facts:empty,.shopping-actions:empty,.shopping-status:empty,.shopping-time:empty{display:none}
.shopping-panel,.shopping-list{display:flex;flex-direction:column;gap:12px;min-width:0}
.shopping-heading,.shopping-title,.shopping-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.shopping-heading{justify-content:space-between}
.shopping-time{font-size:13px;color:var(--muted)}
.shopping-status,.shopping-uncertainty{padding:8px 12px;border-radius:var(--r-btn);font-size:14px}
.shopping-status{background:var(--brand-soft);color:var(--brand-ink)}
.shopping-card{gap:10px;overflow-wrap:anywhere}
.shopping-card.picked{border-color:var(--brand-ink)}
.shopping-head{display:flex;align-items:start;gap:12px;min-width:0}
.shopping-head>div{flex:1;min-width:0}
.shopping-photo{width:64px;height:64px}
.shopping-photo img{object-fit:contain}
.shopping-badge{border-radius:999px;padding:2px 8px;font-size:13px;font-weight:700}
.shopping-badge.unverified,.shopping-uncertainty{background:var(--warn-soft);color:var(--warn)}
.shopping-badge.picked{background:var(--ok-soft);color:var(--ok)}
.shopping-facts{margin:0;display:grid;gap:4px;font-size:14px}
.shopping-facts>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:8px}
.shopping-facts dd{margin:0;text-align:end}
.shopping-facts dt{color:var(--muted)}
.shopping-prices{padding:8px 12px;border-radius:var(--r-btn);background:var(--neutral)}
.shopping-prices dd{font-weight:700}
.shopping-note{font-size:14px}
.shopping-source{min-height:48px;display:inline-flex;align-items:center;gap:5px;font-size:14px;min-width:0}
.shopping-source bdi{overflow-wrap:anywhere}
.shopping-select{margin-inline-start:auto}
.shopping-revise,.shopping-feedback{border:1px solid var(--edge);border-radius:var(--r-btn);background:var(--surface);padding:0 12px}
.shopping-revise summary{cursor:pointer;min-height:48px;align-content:center;color:var(--brand-ink);font-weight:700}
.shopping-revise-form,.shopping-feedback{display:flex;flex-direction:column;gap:8px;padding-block:12px}
.shopping-revise-form label{display:flex;flex-direction:column;gap:4px}
.shopping-revise-form textarea{resize:vertical;min-height:64px}
.shopping-feedback .btn{min-width:64px}
.ans{background:var(--surface);border:var(--bd);border-radius:var(--r-card);border-start-start-radius:4px;box-shadow:var(--shadow);padding:12px 14px;
  font-size:16px;line-height:1.8;display:flex;flex-direction:column;gap:8px;overflow-wrap:anywhere;min-width:0}
.ans p,.ans blockquote{margin:0}
.ans ol,.ans ul{margin:0;padding-inline-start:22px;display:flex;flex-direction:column;gap:6px}
.ans ol{list-style-type:persian}
.ans li>ol,.ans li>ul{margin-top:6px}
.ans b{font-weight:800}
.ans a{overflow-wrap:anywhere}
.md-h{font-weight:800;font-size:17px}
.md-hr{border:0;border-top:1px solid var(--line);margin:4px 0;width:100%}
.md-q{border-inline-start:3px solid var(--brand-hi);padding-inline-start:10px;color:var(--muted)}
.md-tbl{overflow-x:auto;max-width:100%;border:1px solid var(--line);border-radius:12px}
.md-tbl table{border-collapse:collapse;font-size:14px;line-height:1.6;min-width:100%}
.md-tbl th,.md-tbl td{padding:6px 10px;border-bottom:1px solid var(--line);text-align:start;vertical-align:top}
.md-tbl th{background:var(--neutral);font-weight:800}
.md-tbl tr:last-child td{border-bottom:0}
.ic{display:inline-block;direction:ltr;unicode-bidi:isolate;background:var(--neutral);border-radius:6px;padding:0 6px;font:13px/1.8 ui-monospace,Menlo,monospace;overflow-wrap:anywhere}
.code{direction:ltr;text-align:left;background:var(--neutral);border:1px solid var(--line);border-radius:12px;overflow:hidden;margin:2px 0;max-width:100%}
.code-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 4px 0 12px;min-height:44px;border-bottom:1px solid var(--line);font-size:12px;color:var(--muted)}
.code-head .btn.quiet{min-height:48px;font-size:13px}
.code pre{margin:0;padding:10px 12px;font:13px/1.7 ui-monospace,Menlo,monospace;overflow-x:auto;color:var(--ink)}
.md-flow{background:none;border:0;box-shadow:none;border-radius:0;padding:0;font-size:15px;line-height:1.75;flex:1}
.ans a.u{direction:ltr;unicode-bidi:isolate;overflow-wrap:anywhere;word-break:break-all}
.md-img{display:block;padding:0;border:0;background:none;max-width:100%;margin:4px 0;cursor:zoom-in}
.md-img img{display:block;max-width:100%;max-height:340px;border-radius:12px;border:1px solid var(--line);background:var(--neutral);object-fit:contain}
.ans-actions{display:flex;align-items:center;gap:8px}
.ans-actions .vote{border-color:var(--edge);color:var(--ink)}
.ans-actions .vote[aria-pressed="true"]{border-width:2px}
.ans-actions .vote.up[aria-pressed="true"]{border-color:var(--ok);background:var(--ok-soft);color:var(--ok)}
.ans-actions .vote.down[aria-pressed="true"]{border-color:var(--danger);background:var(--danger-soft);color:var(--danger)}
/* thinking: live block, the collapsed pill, and the prettified reasoning */
.think-live{background:var(--brand-soft);border:1.5px solid var(--brand-ink);border-radius:var(--r-card);border-start-start-radius:4px;display:flex;flex-direction:column;overflow:hidden}
.think-head{display:flex;align-items:center;gap:10px;min-height:52px;padding:0 6px 0 14px;width:100%;background:none;border:0;text-align:start;color:var(--ink)}
.think-head .t{flex:1;font-size:15px;font-weight:700;color:var(--brand-ink)}
.think-head .sec{font-size:14px;color:var(--ink);font-variant-numeric:tabular-nums;font-weight:600}
.think-head .chev{display:flex;width:48px;height:48px;align-items:center;justify-content:center;color:var(--brand-ink)}
.think-head[aria-expanded="true"] .chev{transform:rotate(180deg)}
.think-scroll{padding:0 10px 10px;max-height:220px;overflow-y:auto;overscroll-behavior:contain}
.think-wait{margin:0;font-size:14px;color:var(--brand-ink);padding:0 4px 4px}
.think-chip{align-self:flex-start;min-height:48px;padding:0 14px;border-radius:999px;background:var(--surface);border:1.5px solid var(--edge);color:var(--muted);
  font-size:14px;font-weight:500;display:flex;align-items:center;gap:8px}
.think-chip .chev{display:flex}
.think-chip[aria-expanded="true"] .chev{transform:rotate(180deg)}
.think-body{background:var(--neutral);border-inline-start:3px solid var(--brand-hi);border-radius:12px;padding:10px;max-width:100%}
.rs{display:flex;flex-direction:column;gap:8px;font-size:14px;line-height:1.75;color:var(--ink);min-width:0}
.rs-label{font-size:12px;font-weight:700;color:var(--brand-ink)}
.rs-step{display:flex;gap:10px;align-items:flex-start;background:var(--surface);border:1.5px solid var(--line);border-radius:12px;padding:8px 10px;min-width:0}
.rs-n{flex:none;width:26px;height:26px;border-radius:50%;background:var(--brand);color:var(--ink);border:1.5px solid var(--ink);font-size:13px;font-weight:800;
  display:flex;align-items:center;justify-content:center;line-height:1}
.rs-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.rs-t{font-weight:800;overflow-wrap:anywhere}
.rs-p{margin:0;overflow-wrap:anywhere}
.rs-plain{display:flex;flex-direction:column;gap:2px;padding:0 4px;overflow-wrap:anywhere;min-width:0}
.rs .sp{margin-top:6px}
.rs-li{display:flex;gap:8px;align-items:baseline;min-width:0}
.rs-li::before{content:"•";color:var(--brand-ink);font-weight:800;flex:none}
.rs-li.num::before{content:attr(data-m);font-weight:700;font-variant-numeric:tabular-nums}
.rs-tx{min-width:0;overflow-wrap:anywhere}
.rs-p.math{font:13px/1.7 ui-monospace,Menlo,monospace;color:var(--muted);overflow-wrap:anywhere}
.rs b{font-weight:800}
/* composer in chat screens */
.bottombar .inline-composer textarea{flex:1;min-width:0;height:44px;border:0;outline:0;background:transparent;font-size:16px;resize:none;padding:10px 0;line-height:1.6}
.bottombar .inline-composer textarea::placeholder{color:var(--ph-text)}
.inline-composer.locked{background:var(--neutral);box-shadow:none;border-color:var(--edge)}
.send.stop{width:auto;padding:0 14px;gap:6px;font-weight:800;font-size:15px;background:var(--danger-soft);color:var(--danger);border-color:var(--danger)}
.chat-foot{margin:0;font-size:12px;color:var(--muted);text-align:center;line-height:1.6}
.chat-foot:empty{display:none}
/* error / limit cards inside the conversation */
.state-card{display:flex;flex-direction:column;gap:10px}
.state-card .row{align-items:flex-start}
.state-card h2{font-size:16px;font-weight:800}
.state-card p{font-size:14px;line-height:1.8;color:var(--ink)}
.state-card .acts{display:flex;gap:8px;flex-wrap:wrap}
.state-card .acts .btn{flex:1;min-width:0;padding:0 8px;font-size:15px}
.msgs .card{min-width:0}
.rs-draft{border-inline-start:3px solid var(--brand-hi);padding-inline-start:8px;margin-block:2px;background:var(--neutral);border-radius:6px;display:flex;flex-direction:column;gap:2px;min-width:0}
.rs bdi{unicode-bidi:isolate}

/* link preview cards under the result text */
.lp-list{display:flex;flex-direction:column;gap:8px;margin-top:6px}
.lp-slot:empty{display:none}
.lp{display:flex;align-items:center;gap:10px;padding:8px;border:var(--bd);border-radius:var(--r-btn);background:var(--surface);color:var(--ink);text-decoration:none;min-height:56px}
.lp:focus-visible{outline:2px solid var(--brand-ink);outline-offset:2px}
.lp-img{width:72px;height:72px;flex:none;border-radius:8px;overflow:hidden;background:var(--ph)}
.lp-img img{width:100%;height:100%;object-fit:cover;display:block}
.rv-gallery{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.rv-gimg{display:block;padding:0;border:0;border-radius:8px;overflow:hidden;background:var(--ph);aspect-ratio:1/1;min-height:44px;cursor:zoom-in}
.rv-gimg img{width:100%;height:100%;object-fit:cover;display:block}
.lp-tx{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.lp-t{font-size:14px;font-weight:700;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.lp-h{font-size:12px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* saved logins entry (app only; docs/notes/saved-logins.md): button + helper line, same rhythm as the memory slot */
.saved-logins{display:flex;flex-direction:column;gap:6px}

/* ---------- memory: settings switch + «مشخصات من» form (docs/memory.md §8; additive) ---------- */
.mem-slot{display:flex;flex-direction:column;gap:8px}
.mem-slot:empty{display:none}
.pf-form{display:flex;flex-direction:column;gap:14px;min-width:0}
.owner-login{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:24px 16px}
.owner-login>.card{width:100%;max-width:380px;padding:24px;gap:24px}
.owner-login .hero img{object-fit:contain}
.pf{display:flex;flex-direction:column;gap:6px;min-width:0}
.pf>label{font-size:14px;font-weight:700}
.pf input[type=text],.pf input[type=tel],.pf input[type=email],.pf select,.pf textarea{width:100%;min-width:0;min-height:48px;border-radius:var(--r-btn);
  border:1.5px solid var(--edge);background:var(--surface);padding:0 12px;font-size:16px}   /* 16px: iOS WebView must not zoom on focus */
.pf textarea{padding:10px 12px;line-height:1.6;resize:vertical;min-height:72px}
.pf input.pf-ltr{text-align:right}
.pf input:focus-visible,.pf select:focus-visible,.pf textarea:focus-visible{outline:3px solid var(--brand-ink);outline-offset:1px;border-color:var(--ink)}
.pf [aria-invalid="true"]{border:2px solid var(--danger);background:var(--danger-soft)}
.pf .err{font-size:13px}
.pf-addrs{display:flex;flex-direction:column;gap:12px}
.addr{display:flex;flex-direction:column;gap:10px;padding:12px;border:1.5px solid var(--line);border-radius:var(--r-card);background:var(--bg);min-width:0}
.pf-addr-foot{justify-content:space-between;flex-wrap:wrap;gap:8px}
.pf-rm{min-height:48px;padding:0 12px}
.pf-actions{position:sticky;bottom:-16px;background:var(--surface);padding:10px 0 22px;margin-bottom:-16px;display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line);z-index:2}
.pf-status{display:flex;align-items:center;gap:6px;min-height:22px}
.pf-status.ok{color:var(--ok);font-weight:700}
.pf-status.bad{color:var(--danger);font-weight:700}
.pf-actions .row .btn{min-width:0}
@media (prefers-reduced-motion:reduce){.switch .track,.switch .track::after{transition:none}}

/* ---------- accounts, plans, paywall, star wall (static/account.js; docs/release-bazaar.md §5) ---------- */
.plan-card{gap:8px}
.plan-card .acts{display:flex;flex-wrap:wrap;gap:8px}
.plan-f{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:4px;font-size:14px}
.plan-f li{position:relative;padding-inline-start:20px;line-height:1.6}
.plan-f li::before{content:"";position:absolute;inset-inline-start:2px;top:.6em;width:8px;height:8px;border-radius:50%;background:var(--brand)}
.plan{display:flex;flex-direction:column;gap:8px;padding:12px 14px;border-radius:var(--r-card);border:2px solid var(--edge);background:var(--surface)}
.plan.cur{border-color:var(--ink);background:var(--brand-soft)}
.plan-t{margin:0;font-size:17px;font-weight:800}
.plan-p{font-weight:800;color:var(--brand-ink);text-align:end}
.plan-p .sub{font-weight:500}
.rate{display:flex;flex-direction:column;gap:12px}
.rate .stars{display:flex;justify-content:center;gap:4px;direction:ltr}
.rate .star{width:52px;height:52px;border-radius:50%;border:0;background:transparent;color:var(--edge);display:flex;align-items:center;justify-content:center;padding:0;cursor:pointer}
.rate .star svg{fill:none;stroke:currentColor;stroke-width:1.6}
.rate .star.on{color:#E8A400}
.rate .star.on svg{fill:currentColor;stroke:var(--ink)}
.rate .star:disabled{cursor:default}
.rate textarea{width:100%;min-height:72px;border-radius:var(--r-btn);border:1.5px solid var(--edge);background:var(--surface);padding:10px 12px;font-size:16px;line-height:1.6;resize:vertical}
.rate-area{display:flex;flex-direction:column;gap:10px}
