:root{
  color-scheme:light;
  --bg:#FAFAFA;
  --surface:#FFFFFF;
  --surface-2:#F9F9F9;
  --surface-3:#F3F3F3;
  --border:#EAEAEA;
  --border-2:#F1F1F1;
  --line:var(--border);
  --ink:#171717;
  --text:#3C3A3A;
  --text-2:#5E5E5E;
  --muted:#8A8A8A;
  --faint:#B0B0B0;
  --green:#6FF19C;
  --done:#16A34A;
  --r-sm:8px; --r-md:12px; --r-lg:16px; --r-xl:20px;
  /* One horizontal gutter and one vertical rhythm for every mobile screen. */
  --gutter:20px;
  --stack:16px;
  --stack-lg:26px;
  --shadow-pop:0 1px 2px rgba(0,0,0,.04), 0 8px 32px rgba(0,0,0,.10);
  --shadow-card:0 1px 2px rgba(0,0,0,.03);
  --nav-bg:rgba(255,255,255,.92);
  --scrim:rgba(0,0,0,.28);
  /* Chat surfaces live in their own tokens so a chat theme can remap them in
     one place instead of every rule fighting html[data-mood] overrides. */
  --bubble-in:#E9E9EB;
  --bubble-in-ink:#171717;
  --bubble-line:rgba(0,0,0,.06);
  --chat-ctl:#EFEFF1;
  --fs-label:12px;
  --fs-body:15px;
  --fs-title:17px;
  --fs-display:22px;
  --fs-section:15px;
  --seg-pill:#FFFFFF;
  --seg-pill-line:rgba(0,0,0,.06);
}
html[data-mood="dark"]{
  color-scheme:dark;
  --bg:#111111;
  --surface:#1A1A1A;
  --surface-2:#222222;
  --surface-3:#2A2A2A;
  --border:#2F2F2F;
  --border-2:#333333;
  --line:var(--border);
  --ink:#F5F5F5;
  --text:#D4D4D4;
  --text-2:#A3A3A3;
  --muted:#8C8C8C;
  --faint:#6B6B6B;
  --nav-bg:rgba(26,26,26,.92);
  --scrim:rgba(0,0,0,.55);
  --done:#22C55E;
  --bubble-in:#2C2C2E;
  --bubble-in-ink:#F5F5F5;
  --bubble-line:rgba(255,255,255,.08);
  --chat-ctl:#2A2A2C;
  --shadow-pop:0 1px 2px rgba(0,0,0,.2), 0 8px 32px rgba(0,0,0,.35);
  --seg-pill:#424246;
  --seg-pill-line:rgba(255,255,255,.10);
}
/* Pro/Pod color themes — soft light + thick tinted dark for each family */
html[data-theme="rose"]{
  --bg:#FFF5F7;
  --surface:#FFFFFF;
  --surface-2:#FFE8EE;
  --surface-3:#FFD6E0;
  --border:#F5C2D0;
  --border-2:#FAD4DE;
  --ink:#3B0A1A;
  --text:#5C1A2E;
  --text-2:#8A3A52;
  --muted:#A86B7E;
  --faint:#C99AAB;
  --nav-bg:rgba(255,255,255,.94);
  --done:#BE185D;
  --green:#F9A8D4;
}
html[data-theme="rose-dark"]{
  --bg:#14060C;
  --surface:#241018;
  --surface-2:#361820;
  --surface-3:#4A1E2C;
  --border:#5C2838;
  --border-2:#3A1824;
  --ink:#FFE4EC;
  --text:#F5C2D0;
  --text-2:#D48A9E;
  --muted:#B06B80;
  --faint:#8A4A60;
  --nav-bg:rgba(36,16,24,.94);
  --done:#F472B6;
  --green:#F9A8D4;
  --scrim:rgba(0,0,0,.55);
  --shadow-pop:0 1px 2px rgba(0,0,0,.25), 0 8px 32px rgba(0,0,0,.4);
}
html[data-theme="mint"]{
  --bg:#F3FBF7;
  --surface:#FFFFFF;
  --surface-2:#E6F7EF;
  --surface-3:#D4F0E3;
  --border:#B7E0CC;
  --border-2:#CDEBD9;
  --ink:#0B2E22;
  --text:#1A4636;
  --text-2:#3A6B57;
  --muted:#6A9080;
  --faint:#9BB8AC;
  --nav-bg:rgba(255,255,255,.94);
  --done:#047857;
  --green:#6EE7B7;
}
html[data-theme="mint-dark"]{
  --bg:#061812;
  --surface:#0C241C;
  --surface-2:#143028;
  --surface-3:#1C3C32;
  --border:#2A5244;
  --border-2:#1C3C32;
  --ink:#D8F5EA;
  --text:#B0E0CC;
  --text-2:#7AB89E;
  --muted:#5A9078;
  --faint:#3A6858;
  --nav-bg:rgba(12,36,28,.94);
  --done:#34D399;
  --green:#6EE7B7;
  --scrim:rgba(0,0,0,.55);
  --shadow-pop:0 1px 2px rgba(0,0,0,.25), 0 8px 32px rgba(0,0,0,.4);
}
html[data-theme="ocean"]{
  --bg:#F3F8FC;
  --surface:#FFFFFF;
  --surface-2:#E6F0F8;
  --surface-3:#D4E6F4;
  --border:#B5D0E8;
  --border-2:#CBDFF0;
  --ink:#0B1F33;
  --text:#1A3550;
  --text-2:#3A5570;
  --muted:#6A8098;
  --faint:#97A9BA;
  --nav-bg:rgba(255,255,255,.94);
  --done:#0369A1;
  --green:#7DD3FC;
}
html[data-theme="ocean-dark"]{
  --bg:#060E18;
  --surface:#0C1828;
  --surface-2:#142438;
  --surface-3:#1C3048;
  --border:#2A4460;
  --border-2:#1C3048;
  --ink:#D8EAF8;
  --text:#B0D0E8;
  --text-2:#7AA0C0;
  --muted:#5A7898;
  --faint:#3A5470;
  --nav-bg:rgba(12,24,40,.94);
  --done:#38BDF8;
  --green:#7DD3FC;
  --scrim:rgba(0,0,0,.55);
  --shadow-pop:0 1px 2px rgba(0,0,0,.25), 0 8px 32px rgba(0,0,0,.4);
}
html[data-theme="sand"]{
  --bg:#FBF7F1;
  --surface:#FFFFFF;
  --surface-2:#F3EBE0;
  --surface-3:#EADCCB;
  --border:#DCC9B0;
  --border-2:#E8D9C4;
  --ink:#2A1C0C;
  --text:#4A3518;
  --text-2:#6B5230;
  --muted:#8F7A5A;
  --faint:#B5A180;
  --nav-bg:rgba(255,255,255,.94);
  --done:#B45309;
  --green:#FCD34D;
}
html[data-theme="sand-dark"]{
  --bg:#120E08;
  --surface:#1C160E;
  --surface-2:#282014;
  --surface-3:#342A1A;
  --border:#4A3C28;
  --border-2:#342A1A;
  --ink:#F5EAD8;
  --text:#E0D0B0;
  --text-2:#B8A080;
  --muted:#8F7A5A;
  --faint:#6A5840;
  --nav-bg:rgba(28,22,14,.94);
  --done:#E7C89A;
  --green:#FCD34D;
  --scrim:rgba(0,0,0,.55);
  --shadow-pop:0 1px 2px rgba(0,0,0,.25), 0 8px 32px rgba(0,0,0,.4);
}
html[data-theme="violet"]{
  --bg:#F7F4FE;
  --surface:#FFFFFF;
  --surface-2:#EEE8FC;
  --surface-3:#E2D8FA;
  --border:#C9B8F0;
  --border-2:#D9CCF5;
  --ink:#1E1035;
  --text:#35205A;
  --text-2:#5A3A88;
  --muted:#8670A8;
  --faint:#A898C4;
  --nav-bg:rgba(255,255,255,.94);
  --done:#7C3AED;
  --green:#C4B5FD;
}
html[data-theme="violet-dark"]{
  --bg:#0E0818;
  --surface:#180F28;
  --surface-2:#241838;
  --surface-3:#302048;
  --border:#463060;
  --border-2:#302048;
  --ink:#EDE4FF;
  --text:#D4C4F5;
  --text-2:#A890D0;
  --muted:#7A68A0;
  --faint:#544878;
  --nav-bg:rgba(24,15,40,.94);
  --done:#A78BFA;
  --green:#C4B5FD;
  --scrim:rgba(0,0,0,.55);
  --shadow-pop:0 1px 2px rgba(0,0,0,.25), 0 8px 32px rgba(0,0,0,.4);
}
html[data-theme="coral"]{
  --bg:#FFF5F4;
  --surface:#FFFFFF;
  --surface-2:#FFE8E6;
  --surface-3:#FFD6D2;
  --border:#F5C0BA;
  --border-2:#FAD4D0;
  --ink:#3F1018;
  --text:#5C1E26;
  --text-2:#8A3A42;
  --muted:#A86B72;
  --faint:#C99A9E;
  --nav-bg:rgba(255,255,255,.94);
  --done:#E11D48;
  --green:#FDA4AF;
}
html[data-theme="coral-dark"]{
  --bg:#18080A;
  --surface:#280E12;
  --surface-2:#38141A;
  --surface-3:#481A22;
  --border:#5C2830;
  --border-2:#481A22;
  --ink:#FFE4E6;
  --text:#F5C2C8;
  --text-2:#D48A92;
  --muted:#B06B72;
  --faint:#8A4A50;
  --nav-bg:rgba(40,14,18,.94);
  --done:#FB7185;
  --green:#FDA4AF;
  --scrim:rgba(0,0,0,.55);
  --shadow-pop:0 1px 2px rgba(0,0,0,.25), 0 8px 32px rgba(0,0,0,.4);
}
*{box-sizing:border-box;margin:0;padding:0}
.boot{
  position:fixed;inset:0;z-index:9999;
  display:grid;place-items:center;
  background:#0a0a0a;
  transition:opacity .45s ease,visibility .45s ease;
}
.boot.gone{opacity:0;visibility:hidden;pointer-events:none;display:grid}
.boot-stage{
  position:relative;
  width:52px;height:52px;
  display:grid;place-items:center;
}
.boot-ring{
  position:absolute;inset:0;
  border-radius:50%;
  border:1.5px solid rgba(255,255,255,.12);
  border-top-color:#fff;
  border-right-color:rgba(255,255,255,.55);
  box-sizing:border-box;
  animation:bootSpin 3.2s linear infinite;
  will-change:transform;
}
.boot-mylo{
  position:relative;z-index:1;
  width:22px;height:auto;
  display:block;
  pointer-events:none;
  user-select:none;
  -webkit-user-drag:none;
}
@keyframes bootSpin{to{transform:rotate(360deg)}}
.boot-mark{display:none}

/* ---------- onboarding ---------- */
.onboard{
  position:fixed;inset:0;z-index:80;
  display:grid;place-items:stretch;
  background:#FFFFFF;
  color:var(--ink);
}
html[data-mood="dark"] .onboard{background:#111111}
.onboard.hidden{display:none}
.onboard-shell{
  width:min(440px,100%);
  margin:0 auto;
  min-height:100vh;min-height:100dvh;
  max-height:100vh;max-height:100dvh;
  display:flex;flex-direction:column;
  padding:calc(12px + env(safe-area-inset-top)) 20px 0;
  box-sizing:border-box;
  position:relative;
  overflow:hidden;
  background:inherit;
}
.onboard-bar{
  display:grid;grid-template-columns:64px 1fr 64px;align-items:center;
  gap:8px;margin-bottom:4px;min-height:40px;flex-shrink:0;
  position:relative;z-index:6;
}
.onboard-skip,.onboard-back{
  border:0;background:transparent;font:inherit;font-size:14px;font-weight:600;
  color:var(--muted);cursor:pointer;padding:8px 0;justify-self:start;
}
.onboard-back{padding:8px;border-radius:12px}
.onboard-back:active{background:var(--surface-2)}
.onboard-bar-spacer{justify-self:end}
.onboard-dots{display:flex;justify-content:center;gap:6px;align-items:center}
.onboard-dot{
  width:6px;height:6px;border-radius:99px;background:var(--border);
  transition:width .25s ease, background .25s ease;
}
.onboard-dot.is-on{width:18px;background:var(--ink)}
.onboard-main{
  flex:1;display:flex;flex-direction:column;justify-content:center;
  min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:8px 0 28px;
  position:relative;z-index:3;
}
.onboard-stage{
  display:flex;flex-direction:column;align-items:center;
  width:100%;position:relative;z-index:3;
  flex:1;min-height:0;
}
.onboard-copy{
  display:flex;flex-direction:column;align-items:center;text-align:center;
  gap:10px;margin-bottom:20px;width:100%;
  position:relative;z-index:4;
}
.onboard-hero{
  display:flex;flex-direction:column;align-items:center;text-align:center;
  gap:14px;margin-bottom:22px;flex-shrink:0;
}
.onboard-hero-compact{margin-bottom:14px;gap:8px}
.onboard-hero-compact .onboard-title{max-width:22ch}
/* Full character peek — bottom-right, no crop box */
.onboard-peek{
  position:absolute;
  right:0;
  bottom:calc(88px + env(safe-area-inset-bottom));
  width:min(172px,44vw);
  max-width:calc(100% - 24px);
  height:auto;
  max-height:44vh;
  object-fit:contain;
  object-position:bottom center;
  pointer-events:none;
  user-select:none;-webkit-user-drag:none;
  filter:drop-shadow(0 16px 28px rgba(15,23,42,.14));
  animation:onboardPeek 4s ease-in-out infinite;
  z-index:2;
  opacity:.96;
}
html[data-mood="dark"] .onboard-peek{
  filter:drop-shadow(0 16px 28px rgba(0,0,0,.45));
  opacity:.92;
}
@keyframes onboardPeek{
  0%,100%{transform:translateY(0) rotate(-2deg)}
  50%{transform:translateY(-8px) rotate(1deg)}
}
.onboard.is-persona .onboard-peek{display:none}
.onboard-kicker{
  font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);
}
.onboard-title{
  font-size:clamp(24px,5.8vw,30px);font-weight:700;letter-spacing:-.035em;
  line-height:1.18;color:var(--ink);max-width:16ch;margin:0 auto;
}
.onboard-sub{
  font-size:15px;line-height:1.45;color:var(--muted);
  max-width:30ch;margin:0 auto;
}
.onboard-hint{
  margin-top:4px;font-size:13px;line-height:1.4;color:var(--muted);
  text-align:center;max-width:34ch;margin-left:auto;margin-right:auto;
}
.onboard-choices{display:flex;flex-direction:column;gap:10px;width:100%;position:relative;z-index:4}
.onboard-choice{
  display:flex;align-items:flex-start;gap:12px;text-align:left;
  width:100%;padding:14px 16px;border-radius:18px;
  border:1.5px solid var(--border);background:var(--surface);
  cursor:pointer;color:var(--ink);font:inherit;
  transition:border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
html[data-mood="light"] .onboard-choice{background:#FFFFFF;border-color:rgba(0,0,0,.08)}
.onboard-choice:active{transform:scale(.985)}
.onboard-choice.is-on{
  border-color:var(--ink);
  box-shadow:0 0 0 1px var(--ink);
}
.onboard-choice-ico{
  width:42px;height:42px;border-radius:14px;flex-shrink:0;
  display:grid;place-items:center;background:var(--surface-2);color:var(--ink);
}
.onboard-choice-ico svg{width:20px;height:20px;display:block}
.onboard-choice-t{font-size:15px;font-weight:700;letter-spacing:-.02em;display:block}
.onboard-choice-d{font-size:12.5px;color:var(--muted);margin-top:2px;line-height:1.35;display:block}
.onboard-chips{
  display:flex;flex-wrap:wrap;gap:8px;justify-content:center;
  position:relative;z-index:4;
}
.onboard-chip{
  border:1.5px solid var(--border);background:var(--surface);
  border-radius:999px;padding:10px 16px;font:inherit;font-size:13.5px;font-weight:600;
  color:var(--ink);cursor:pointer;
  transition:border-color .15s ease, background .15s ease, color .15s ease;
}
html[data-mood="light"] .onboard-chip{background:#FFFFFF}
.onboard-chip.is-on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.onboard-personas{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;
  width:100%;padding:4px 0 12px;
  position:relative;z-index:4;
}
.onboard-persona{
  border:0;background:transparent;padding:0;cursor:pointer;text-align:center;
  min-width:0;
}
.onboard-persona-ring{
  aspect-ratio:1;border-radius:22px;
  background:linear-gradient(160deg,#F4F7FB 0%,#EEF3F8 55%,#E8EEF5 100%);
  overflow:hidden;
  display:grid;place-items:center;
  padding:8% 6% 4%;
  border:1.5px solid rgba(0,0,0,.06);
  box-sizing:border-box;
  box-shadow:0 2px 10px rgba(15,23,42,.05);
  transition:border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
html[data-mood="dark"] .onboard-persona-ring{
  background:linear-gradient(160deg,#F4F7FB 0%,#EEF3F8 100%);
  border-color:rgba(255,255,255,.16);
  box-shadow:0 4px 14px rgba(0,0,0,.28);
}
.onboard-persona.is-on .onboard-persona-ring{
  border-color:var(--ink);
  box-shadow:0 0 0 2px var(--ink);
  transform:scale(1.02);
}
.onboard-persona img{
  width:100%;height:100%;
  max-width:100%;max-height:100%;
  object-fit:contain;object-position:center bottom;
  transform:none;
  pointer-events:none;
  display:block;
}
.onboard-persona-label{
  display:block;margin-top:8px;font-size:11.5px;font-weight:600;color:var(--muted);
}
.onboard-persona.is-on .onboard-persona-label{color:var(--ink)}
.onboard-walk{
  display:flex;flex-direction:column;gap:12px;width:100%;
  position:relative;z-index:4;
}
.onboard-walk-card{
  display:flex;gap:12px;align-items:flex-start;
  padding:14px 16px;border-radius:18px;background:var(--surface);
  border:1px solid var(--border);
}
html[data-mood="light"] .onboard-walk-card{background:#FFFFFF}
.onboard-walk-n{
  width:28px;height:28px;border-radius:10px;flex-shrink:0;
  display:grid;place-items:center;background:var(--ink);color:var(--bg);
  font-size:12px;font-weight:800;
}
.onboard-walk-t{font-size:14.5px;font-weight:700}
.onboard-walk-d{font-size:12.5px;color:var(--muted);margin-top:2px;line-height:1.35}
.onboard-plans{display:flex;flex-direction:column;gap:10px;width:100%;position:relative;z-index:4}
.onboard-plan{
  text-align:left;width:100%;padding:16px;border-radius:20px;
  border:1.5px solid var(--border);background:var(--surface);
  cursor:pointer;font:inherit;color:var(--ink);
  transition:border-color .15s ease, box-shadow .15s ease;
}
html[data-mood="light"] .onboard-plan{background:#FFFFFF}
.onboard-plan.is-on{border-color:var(--ink);box-shadow:0 0 0 1px var(--ink)}
.onboard-plan.is-pro{background:var(--surface)}
.onboard-plan.is-pod{background:var(--surface)}
.onboard-plan-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.onboard-plan-name{font-size:16px;font-weight:800;letter-spacing:-.02em}
.onboard-plan-price{font-size:13px;font-weight:700;color:var(--muted)}
.onboard-plan-badge{
  font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
  padding:4px 8px;border-radius:999px;background:var(--ink);color:var(--bg);
}
.onboard-plan-list{
  list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:5px;
}
.onboard-plan-list li{
  font-size:12.5px;color:var(--text-2, var(--muted));padding-left:16px;position:relative;line-height:1.35;
}
.onboard-plan-list li::before{
  content:"";position:absolute;left:0;top:.45em;width:7px;height:7px;border-radius:50%;
  background:var(--ink);opacity:.35;
}
.onboard-foot{
  display:flex;flex-direction:column;gap:10px;
  flex-shrink:0;position:relative;z-index:20;
  isolation:isolate;
  padding:12px 0 calc(16px + env(safe-area-inset-bottom));
  margin-top:auto;
  background:inherit;
  border-top:1px solid var(--border);
}
.onboard-cta{
  width:100%;min-height:48px;border:0;border-radius:16px;
  background:var(--ink);color:var(--bg);font:inherit;font-size:15px;font-weight:700;
  cursor:pointer;position:relative;z-index:1;
}
.onboard-cta:disabled{opacity:.4;cursor:default}
.onboard-cta-ghost{
  width:100%;min-height:44px;border:1.5px solid var(--border);border-radius:16px;
  background:var(--surface);color:var(--ink);font:inherit;font-size:14px;font-weight:600;
  cursor:pointer;position:relative;z-index:1;
}
html[data-mood="dark"] .onboard-cta-ghost{
  background:var(--surface-2);
  border-color:rgba(255,255,255,.18);
}
@media (min-width:720px){
  .onboard{place-items:center;background:#F7F8FA}
  html[data-mood="dark"] .onboard{background:#0a0a0a}
  .onboard-shell{
    min-height:min(760px,100dvh);
    border-radius:28px;border:1px solid var(--border);
    background:#FFFFFF;
    box-shadow:0 24px 60px rgba(0,0,0,.12);
    overflow:hidden;
    margin:24px auto;
  }
  html[data-mood="dark"] .onboard-shell{background:#111111}
}

html,body{height:100%}
body{
  background:var(--bg);
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  color:var(--text);
  -webkit-font-smoothing:antialiased;
  font-size:var(--fs-body);
}
button,input,select,textarea{font:inherit;color:inherit;background:none;border:none;outline:none}
button{cursor:pointer}
:focus-visible{outline:2px solid var(--text-2);outline-offset:2px;border-radius:6px}
input:focus,select:focus,textarea:focus{outline:none}
.hidden{display:none!important}

button, .btn-primary, .btn-secondary, .btn-ghost, .btn-link, .btn-dark,
.chat-plus, .send, .home-fab, .home-room, .m-nav-item, .m-fab, .tick, .plus-tile,
.chat-row, .chat-tab, .char-opt, .member-row, .seg button{
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
body.sheet-open #m-chat.active,
body.sheet-open .m-nav,
body.sheet-open .m-fab,
body.sheet-open .m-mylo-fab,
body.sheet-open .home-fab,
body.sheet-open .cookie-bar{
  pointer-events:none !important;
}
body.sheet-open .m-nav{
  opacity:0;
  transform:translateY(110%);
}
body.sheet-open .cookie-bar{opacity:0;visibility:hidden}

/* ---------- shared buttons / fields ---------- */
.btn-primary,.btn-secondary,.btn-dark,.btn-ghost,.btn-link{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:48px;padding:0 18px;border-radius:12px;font-size:var(--fs-body);font-weight:500;
  transition:opacity .15s, transform .12s;
}
.btn-primary{background:var(--ink);color:var(--bg);width:100%;border:1.5px solid var(--ink)}
.btn-dark{background:var(--ink);color:var(--bg);width:auto;min-height:36px;padding:0 14px;font-size:13px;border:1.5px solid var(--ink)}
.btn-secondary{
  background:var(--surface);border:1.5px solid var(--border);color:var(--ink);width:100%;
}
html[data-mood="dark"] .btn-secondary,
html[data-mood="dark"] .btn-social{
  background:var(--surface-2);
  border-color:rgba(255,255,255,.18);
}
html[data-mood="light"] .btn-secondary,
html[data-mood="light"] .btn-social{
  background:var(--surface);
  border-color:rgba(0,0,0,.12);
}
.btn-ghost{background:var(--surface-2);color:var(--ink);min-height:36px;padding:0 13px;font-size:13px;font-weight:500;width:auto}
.btn-link{background:transparent;color:var(--text-2);font-weight:500;min-height:40px;width:100%}
.auth-or{
  display:flex;align-items:center;gap:12px;margin:16px 0 12px;
  color:var(--muted);font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;
}
.auth-or::before,.auth-or::after{content:"";flex:1;height:1px;background:var(--border)}
.auth-social{display:flex;flex-direction:column;gap:10px;margin-bottom:8px}
.btn-social{
  display:inline-flex;align-items:center;justify-content:center;gap:10px;
  width:100%;min-height:48px;padding:0 16px;border-radius:12px;
  background:var(--surface);border:1.5px solid var(--border);color:var(--ink);
  font-size:14px;font-weight:600;transition:background .15s, transform .12s;
}
.btn-social:active{transform:scale(.98)}
@media (hover:hover){
  .btn-primary:hover,.btn-dark:hover{opacity:.86}
  .btn-secondary:hover,.btn-ghost:hover{background:var(--surface-3)}
  .btn-social:hover{background:var(--surface-2)}
  .btn-link:hover{color:var(--ink)}
}
.btn-primary:active,.btn-secondary:active,.m-fab:active,.m-card:active{transform:scale(.97)}

.field{margin-bottom:16px}
.field label{display:block;font-size:var(--fs-label);color:var(--muted);font-weight:600;letter-spacing:.02em;margin-bottom:8px}
.field input,.field select{
  width:100%;height:48px;background:var(--surface-2);border:1px solid var(--border);
  border-radius:12px;padding:0 14px;font-size:var(--fs-body);transition:border-color .15s, background .15s;color:var(--ink);
}
.field input::placeholder,.field textarea::placeholder{
  color:var(--muted);opacity:.55;
}
.field input:focus,.field select:focus{background:var(--surface);border-color:var(--text-2)}
.pass-wrap{position:relative}
.pass-wrap input{padding-right:64px}
.pass-toggle{
  position:absolute;right:8px;top:50%;transform:translateY(-50%);
  min-height:28px;padding:0 8px;border-radius:8px;
  font-size:12px;font-weight:500;color:var(--text-2);background:transparent;
}
.pass-toggle:hover{color:var(--ink)}
.seg{display:flex;background:var(--surface-2);border-radius:12px;padding:3px;gap:2px;position:relative}
.seg button{
  flex:1;padding:10px 8px;border-radius:10px;font-size:13px;font-weight:500;color:var(--text-2);
  min-height:42px;position:relative;z-index:1;
}
.seg button.is-active{background:transparent;color:var(--ink)}

/* One sliding pill per segmented control — the active button stays transparent
   and this element carries the fill so switching tabs glides. */
.seg-ind{
  position:absolute;top:0;left:0;width:0;height:0;z-index:0;pointer-events:none;
  transition:transform .32s cubic-bezier(.22,1,.36,1),
             width .32s cubic-bezier(.22,1,.36,1),
             height .32s cubic-bezier(.22,1,.36,1);
}
.seg-ind[hidden]{display:none}
.seg > .seg-ind,
.chat-tabs > .seg-ind{
  background:var(--seg-pill);border-radius:10px;
  box-shadow:0 1px 2px rgba(0,0,0,.06);
  border:1px solid var(--seg-pill-line);
}
.status-seg > .seg-ind{background:var(--ink);border-radius:100px}

/* Date | Duration — clear split, no nested chrome */
.field-row{
  display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:12px;margin-bottom:16px;
  border:none;background:transparent;overflow:visible;
}
.field-row .field{
  margin-bottom:0;min-width:0;padding:0;
  border:none;border-right:none;
}
.field-row .field input,
.field-row .field select{
  width:100%;max-width:100%;box-sizing:border-box;
  background:var(--surface-2);border:1px solid var(--border);border-radius:12px;
}
/* iOS keeps date/time controls at their intrinsic width unless min-width is
   cleared, which is what made Date and Start overlap on a 393px iPhone. */
.field-row .field input[type="date"],
.field-row .field input[type="time"]{
  min-width:0;padding-left:8px;padding-right:8px;text-align:center;
}
#date-duration-row.hidden{display:none}
.invite-row{
  display:flex;align-items:center;gap:8px;width:100%;
}
.invite-row .invite-input{flex:1;min-width:0}
.invite-row .btn-ghost{flex-shrink:0}

/* ---------- gate (auth / room) ---------- */
.gate{
  min-height:100vh;min-height:100dvh;
  display:grid;place-items:start center;
  padding:max(24px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  background:var(--bg);box-sizing:border-box;
  overflow-x:hidden;overflow-y:auto;
  -webkit-overflow-scrolling:touch;
  overscroll-behavior:contain;
}
.gate-card{
  width:min(360px,100%);
  background:var(--surface);border:1px solid var(--border);
  border-radius:var(--r-xl);padding:28px 22px 26px;box-shadow:var(--shadow-card);
  overflow:visible;box-sizing:border-box;
  margin:auto 0;
  display:flex;flex-direction:column;gap:0;
  position:relative;
}
html[data-mood="dark"] .gate-card{
  background:var(--surface);
  border-color:rgba(255,255,255,.12);
  box-shadow:0 8px 28px rgba(0,0,0,.35);
}
html[data-mood="light"] .gate-card{
  background:#FFFFFF;
  border-color:rgba(0,0,0,.08);
}
/* Auth as a quiet chat with Mylo */
.auth-chat{
  display:flex;flex-direction:column;gap:14px;margin:4px 0 18px;
}
.auth-chat-row{
  display:flex;align-items:flex-end;gap:10px;
}
.auth-chat-ava{
  width:36px;height:36px;flex-shrink:0;
  object-fit:contain;object-position:center bottom;
  filter:drop-shadow(0 4px 10px rgba(15,23,42,.1));
}
.auth-bubble{
  max-width:86%;
  padding:12px 14px;
  border-radius:18px 18px 18px 6px;
  background:var(--bubble-in);
  color:var(--bubble-in-ink);
  font-size:15px;font-weight:500;line-height:1.4;
  letter-spacing:-.01em;
  animation:authBubbleIn .35s ease both;
}
html[data-mood="light"] .auth-bubble{
  background:#F0F1F3;
  color:#1a1a1a;
}
@keyframes authBubbleIn{
  from{opacity:0;transform:translateY(6px)}
  to{opacity:1;transform:none}
}
.auth-replies{display:flex;flex-direction:column;gap:10px}

/* ── The way in ────────────────────────────────────────────────────────
   Mylo thinks, types, and only then do the answers arrive. All decoration:
   with motion turned down every animation below collapses to "already there". */
.auth-chat-ava.is-in{
  animation:authAvaIn .5s cubic-bezier(.16,1.5,.3,1) both;
}
@keyframes authAvaIn{
  from{opacity:0;transform:translateY(10px) scale(.6)}
  to{opacity:1;transform:none}
}
/* the face changing is a beat of its own */
.auth-chat-ava.is-pop{animation:authAvaPop .34s cubic-bezier(.16,1.5,.3,1)}
@keyframes authAvaPop{
  0%{transform:scale(1)} 40%{transform:scale(1.16) rotate(-5deg)} 100%{transform:scale(1)}
}
/* three dots while he is "typing" */
.auth-bubble.is-thinking{display:inline-flex;align-items:center}
.auth-dots{display:inline-flex;align-items:center;gap:5px;padding:3px 2px}
.auth-dots b{
  width:7px;height:7px;border-radius:50%;background:currentColor;opacity:.3;
  animation:authDot 1.15s ease-in-out infinite;
}
.auth-dots b:nth-child(2){animation-delay:.16s}
.auth-dots b:nth-child(3){animation-delay:.32s}
@keyframes authDot{
  0%,100%{opacity:.26;transform:translateY(0)}
  45%{opacity:.8;transform:translateY(-3px)}
}
/* everything under the bubble waits its turn */
.auth-rise{
  opacity:0;
  animation:authRise .42s cubic-bezier(.16,1,.3,1) both;
  animation-delay:var(--rise-at,0ms);
}
@keyframes authRise{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:none}
}
@media (prefers-reduced-motion:reduce){
  .auth-chat-ava.is-in,.auth-chat-ava.is-pop,.auth-bubble{animation:none}
  .auth-rise{opacity:1;animation:none}
  .auth-dots b{animation:none}
}
.gate-card.is-chat .gate-brand{margin-bottom:18px}
.gate-card .auth-form-head{display:none}
.gate-card.is-form .auth-chat{margin-bottom:8px}
.home-gate{
  place-items:stretch;align-content:start;padding:0;
}
.home-shell{
  width:min(480px,100%);margin:0 auto;padding:20px 20px 100px;
  box-sizing:border-box;min-height:100vh;min-height:100dvh;position:relative;
}
.home-top{
  display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px;
}
.home-top .gate-brand{margin-bottom:0}
.home-rooms{display:flex;flex-direction:column;gap:10px;margin-top:8px}
.home-room{
  display:flex;align-items:center;gap:13px;width:100%;text-align:left;
  padding:15px 16px;border-radius:18px;border:1px solid var(--border);
  background:var(--surface);color:inherit;cursor:pointer;
  transition:transform .12s ease, border-color .15s ease, background .15s ease;
}
.home-room:active{transform:scale(.985)}
@media (hover:hover){.home-room:hover{background:var(--surface-2);border-color:var(--faint)}}
.home-room-meta{flex:1;min-width:0}
.home-room-av{
  width:46px;height:46px;border-radius:15px;background:var(--surface-2);
  border:1px solid var(--border-2);
  display:grid;place-items:center;font-size:18px;font-weight:600;color:var(--ink);
  flex-shrink:0;overflow:hidden;
}
.home-room-av img{width:100%;height:100%;object-fit:cover}
.home-room-title{font-size:15px;font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.home-room-sub{font-size:12px;color:var(--muted);margin-top:3px;text-transform:capitalize}
.home-room-go{color:var(--faint);flex-shrink:0}
.home-empty{
  padding:28px 16px;text-align:center;color:var(--muted);font-size:14px;line-height:1.45;
  border:1px dashed var(--border);border-radius:16px;
}
.home-fab{
  position:fixed;right:max(20px, env(safe-area-inset-right));
  bottom:max(24px, env(safe-area-inset-bottom));
  width:56px;height:56px;border-radius:50%;border:none;
  background:var(--ink);color:var(--bg);font-size:28px;line-height:1;
  box-shadow:0 8px 24px rgba(0,0,0,.18);cursor:pointer;z-index:20;
}
.gate-brand{display:flex;align-items:center;gap:9px;font-weight:500;color:var(--ink);margin-bottom:22px}
.brand-mark{
  width:28px;height:28px;border-radius:8px;overflow:hidden;flex-shrink:0;
  background:#171717;color:transparent;display:inline-grid;place-items:center;
  font-size:0;line-height:0;
}
.brand-mark img{
  width:100%;height:100%;object-fit:cover;display:block;
}
.brand-mark::after{content:none;display:none}
.gate h1{font-size:22px;font-weight:600;letter-spacing:-.03em;color:var(--ink);margin:0 0 8px}
.gate-sub{font-size:13.5px;color:var(--muted);margin:0 0 22px;line-height:1.5}
.or{text-align:center;font-size:12px;color:var(--muted);margin:14px 0}
.gate-card > .field{margin-bottom:18px}
.gate-card > .field:last-of-type{margin-bottom:22px}
.gate-card > .btn-primary{margin-top:4px;margin-bottom:4px;flex-shrink:0}
.gate-card .auth-or{margin:16px 0}
.gate-card .auth-social{margin-bottom:4px}
.gate-card .btn-link{margin-top:14px}
.gate-card .field > label{
  display:block;margin-bottom:8px;font-size:13px;font-weight:500;color:var(--text-2);
}
.char-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:10px;
  width:100%;
  max-width:100%;
  box-sizing:border-box;
  margin-top:2px;
}
.char-opt{
  aspect-ratio:1;border:1.5px solid rgba(0,0,0,.08);background:#FFFFFF;padding:12%;overflow:hidden;
  opacity:.55;transition:opacity .15s ease, box-shadow .15s ease;
  min-width:0;max-width:100%;border-radius:14px;
  display:grid;place-items:center;box-sizing:border-box;
}
.char-opt img{
  width:100%;height:100%;max-width:100%;max-height:100%;
  object-fit:contain;object-position:center;
  display:block;pointer-events:none;
  transform:none;
}
.char-opt.is-on{opacity:1;box-shadow:0 0 0 2px var(--ink)}
.char-opt:not(.is-on):hover{opacity:.8}

.icon-btn{
  width:40px;height:40px;min-height:40px;padding:0;border-radius:12px;
  border:1px solid var(--border);background:var(--surface);color:var(--ink);
  display:grid;place-items:center;position:relative;
}
.icon-btn .ico-sun,.icon-btn .ico-moon{display:block}
.icon-btn .ico-moon{display:none}
html[data-mood="dark"] .icon-btn .ico-sun{display:none}
html[data-mood="dark"] .icon-btn .ico-moon{display:block}
html[data-mood="dark"] .icon-btn{color:var(--ink);border-color:var(--border);background:var(--surface-2)}

/* ---------- desktop shell ---------- */
.app{display:flex;height:100dvh;height:100vh;width:100%;background:var(--bg);overflow:hidden}
.sidebar{
  width:236px;flex-shrink:0;display:flex;flex-direction:column;
  padding:20px 14px 14px;gap:0;border-right:1px solid var(--border);
  background:var(--bg);align-self:stretch;height:100%;max-height:100%;min-height:0;
}
.brand{display:flex;align-items:center;gap:9px;padding:6px 8px 20px}
.brand-name{font-size:15px;font-weight:500;letter-spacing:-.02em;color:var(--ink)}
.nav-core{display:flex;flex-direction:column;gap:0;flex:1;min-height:0;overflow-y:auto}
.side-group{margin-bottom:16px}
.side-label{
  font-size:10px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);padding:0 10px;margin-bottom:6px;
}
.nav-item{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:9px 10px;border-radius:8px;
  font-size:13.5px;font-weight:500;color:var(--text-2);text-align:left;
  position:relative;background:none;border:none;
}
.nav-item svg{flex-shrink:0;color:var(--muted)}
.nav-item .nav-caret{margin-left:auto;font-size:10px;color:var(--muted);transition:transform .15s}
.nav-item.nav-parent.is-open .nav-caret{transform:rotate(0deg)}
.nav-item.nav-parent:not(.is-open) .nav-caret{transform:rotate(-90deg)}
@media (hover:hover){.nav-item:hover{background:var(--surface-2);color:var(--ink)} .nav-item:hover svg{color:var(--ink)}}
.nav-item.is-active{background:var(--surface-3);color:var(--ink);font-weight:600}
.nav-item.is-active svg{color:var(--ink)}
.nav-item.is-section-on{color:var(--ink)}
.nav-item.is-section-on svg{color:var(--ink)}
.nav-sub{display:none;flex-direction:column;gap:1px;padding:2px 0 4px 8px}
.nav-sub.is-open{display:flex}
.nav-sub-item{
  display:flex;align-items:center;width:100%;text-align:left;
  padding:8px 10px 8px 26px;border-radius:8px;border:none;background:none;
  font-size:13px;font-weight:500;color:var(--text-2);cursor:pointer;
}
@media (hover:hover){.nav-sub-item:hover{background:var(--surface-2);color:var(--ink)}}
.nav-sub-item.is-active{background:var(--surface-3);color:var(--ink);font-weight:600}
.sidebar-foot{margin-top:auto;padding-top:16px;border-top:1px solid var(--border)}
.who-name{display:block;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.room-pill{
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:11.5px;color:var(--muted);padding:6px 8px}
.who{display:flex;align-items:center;gap:9px;padding:8px;border-radius:var(--r-sm);width:100%;border:none;background:none}
@media (hover:hover){.who:hover{background:var(--surface-3)}}
.check-row{display:flex;align-items:center;gap:10px;font-size:13.5px;color:var(--ink);cursor:pointer}
.check-row input{width:16px;height:16px;accent-color:var(--ink)}
.avatar-img,.m-avatar{
  width:36px;height:36px;border-radius:12px;object-fit:cover;object-position:center 18%;
  background:#E8EDF2;flex-shrink:0;
}
.avatar-img.is-photo,.m-avatar.is-photo{background:transparent;border-radius:inherit;object-fit:cover;object-position:center}
.m-avatar-btn{
  padding:0;border:none;background:transparent;border-radius:12px;line-height:0;
  cursor:pointer;display:block;
}
.avatar-lg{width:64px;height:64px}
.avatar-md{width:48px;height:48px}
.char-opt img,.avatar-img,.m-avatar{
  image-rendering:auto;
}
.who-name{display:block;font-size:13.5px;font-weight:500;color:var(--ink);text-align:left}
.who-sub{display:block;font-size:11px;color:var(--muted);text-align:left}

.main{flex:1;min-width:0;display:flex;flex-direction:column;background:var(--bg)}
.topbar{
  height:auto;min-height:64px;display:flex;align-items:center;gap:14px;flex-shrink:0;
  padding:16px 28px;border-bottom:1px solid var(--border);
  background:rgba(250,250,250,.9);backdrop-filter:blur(12px);position:sticky;top:0;z-index:20;
}
html[data-mood="dark"] .topbar{background:rgba(17,17,17,.9)}
.crumb{font-size:18px;font-weight:500;color:var(--ink);letter-spacing:-.02em}
.top-right{display:flex;align-items:center;gap:10px;margin-left:auto}
.canvas{
  flex:1;min-height:0;background:transparent;
  border:none;border-radius:0;
  overflow-y:auto;overflow-x:hidden;
}
.pad{padding:26px 28px 48px;max-width:1100px;margin:0 auto;width:100%;box-sizing:border-box}

/* ---------- content patterns ---------- */
.row{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;gap:12px}
.h2{font-size:var(--fs-section);font-weight:600;color:var(--ink);letter-spacing:-.02em}
.h2-sub{font-size:12px;color:var(--muted);font-weight:400;margin-left:7px}
.split{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:8px}
.card{border:1px solid var(--border);border-radius:var(--r-lg);background:var(--surface);overflow:hidden}
.card-head{display:flex;align-items:center;gap:10px;padding:14px 16px 12px}
.card-head .nm{font-size:13.5px;font-weight:500;color:var(--ink)}
.card-head .st{margin-left:auto;font-size:12px;color:var(--muted)}
.card-body{padding:0 10px 10px}
.empty{padding:28px 16px;text-align:center;font-size:13px;color:var(--muted);line-height:1.45}
.empty .empty-t{display:block;color:var(--text-2);font-weight:500;margin-bottom:4px;font-size:13.5px}

.task{
  display:flex;align-items:center;gap:12px;width:100%;
  min-height:48px;padding:10px 10px;border-radius:12px;text-align:left;
}
@media (hover:hover){.task:hover{background:var(--surface-2)}}
.task.readonly{cursor:default}
.tick{
  width:20px;height:20px;border-radius:7px;flex-shrink:0;
  border:1.5px solid #DCDCDC;display:grid;place-items:center;
}
html[data-mood="dark"] .tick{border-color:#444}
.task.done .tick{background:var(--ink);border-color:var(--ink)}
.task.done .tk-title{color:var(--muted);text-decoration:line-through;text-decoration-color:var(--border)}
.status-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0;background:var(--muted)}
.status-dot.done{background:var(--green)}
.tk-main{flex:1;min-width:0}
.tk-title{font-size:14px;font-weight:500;color:var(--text);display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tk-sub{font-size:11.5px;color:var(--muted);margin-top:2px}
.cat-chip{
  font-size:11px;font-weight:500;padding:3px 8px;border-radius:7px;
  background:var(--surface-3);color:var(--text-2);flex-shrink:0;
}
.tier-block{margin-bottom:26px}
.tier-hd{display:flex;align-items:center;gap:9px;margin-bottom:11px}
.tier-hd .t{font-size:12px;font-weight:500;color:var(--ink);letter-spacing:.04em;text-transform:uppercase}
.tier-hd .c{font-size:12px;color:var(--muted)}
.tier-hd .line{flex:1;height:1px;background:var(--border)}
.goal{
  display:flex;align-items:center;gap:12px;padding:14px;
  border:1px solid var(--border);border-radius:var(--r-md);margin-bottom:8px;min-height:52px;
}
.goal.readonly{opacity:.92}
/* Days that have passed are read-only history — dimmed so today reads first. */
.goal.is-past{opacity:.5}
.goal.is-past .tlock{opacity:.7}
.goal-t{font-size:14px;font-weight:500;color:var(--ink)}
.goal.done .goal-t{color:var(--muted);text-decoration:line-through;text-decoration-color:var(--border)}
.goal-m{font-size:12px;color:color-mix(in srgb, var(--ink) 55%, transparent);margin-top:3px}

.field-static{
  height:48px;display:flex;align-items:center;padding:0 14px;
  border-radius:12px;background:var(--surface-2);border:1px solid var(--border);
  color:var(--ink);font-size:var(--fs-body);font-variant-numeric:tabular-nums;
}
.daypart-block{margin-bottom:var(--stack-lg);max-width:100%}
.daypart-list{display:flex;flex-direction:column;gap:8px;max-width:100%}
.daypart-empty{font-size:13px;color:var(--muted);padding:4px 2px 8px}
/* Task card — inspo look: tinted icon tile · title/time/category · green check */
.tcard{
  display:flex;align-items:center;gap:13px;
  background:var(--surface);border:1px solid var(--border);border-radius:18px;
  padding:12px 14px;max-width:100%;
}
.tcard.done{opacity:.7}
.tcard.done .tcard-name{text-decoration:line-through;color:var(--muted)}
.tcard.is-missed{border-color:color-mix(in srgb, #E11D48 35%, var(--border))}
.tcard-time.is-missed-label,
.goal-m.is-missed-label,
.is-missed-label{color:#E11D48;font-weight:600}
.tmiss{
  width:28px;height:28px;border-radius:50%;flex-shrink:0;
  display:grid;place-items:center;color:#fff;background:#E11D48;border:2px solid #E11D48;
}
.goal.is-missed{border-color:color-mix(in srgb, #E11D48 35%, var(--border))}
.cal-task-row.is-missed .cal-task-check{color:#E11D48;border-color:#E11D48}
.cal-task-row.is-missed .cal-task-check svg{stroke:#E11D48}
.tcard-ic{
  width:44px;height:44px;border-radius:13px;flex-shrink:0;
  display:grid;place-items:center;font-size:17px;font-weight:700;
}
.tcard-main{
  flex:1;min-width:0;text-align:left;background:none;border:none;padding:0;color:inherit;cursor:pointer;
}
.tcard-name{
  font-size:15px;font-weight:600;color:var(--ink);letter-spacing:-.015em;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.tcard-time{font-size:12.5px;color:color-mix(in srgb, var(--ink) 55%, transparent);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.tcard-cat{display:inline-block;font-size:12px;font-weight:600;margin-top:3px}
.tcheck{
  width:28px;height:28px;border-radius:50%;flex-shrink:0;
  border:2px solid var(--faint);background:transparent;color:#fff;
  display:grid;place-items:center;transition:transform .12s;
}
.tcheck:active{transform:scale(.9)}
.tcheck.on{background:var(--done);border-color:var(--done)}
.tcheck.is-late{border-color:#E11D48;background:transparent}
.tcheck.is-late:active{transform:scale(.9)}
.tcheck.pop{animation:checkPop .28s cubic-bezier(.3,1.5,.5,1)}
@keyframes checkPop{0%{transform:scale(.7)}60%{transform:scale(1.18)}100%{transform:scale(1)}}
.pb-head{transition:left .7s cubic-bezier(.22,1,.36,1)}
.tlock{
  width:28px;height:28px;border-radius:50%;flex-shrink:0;
  display:grid;place-items:center;color:var(--muted);background:var(--surface-3);
}
/* Sub-goals (expandable checklist under a task) */
.tcard-wrap.open .tcard{border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-color:transparent}
.tcard-expand{
  display:flex;align-items:center;gap:5px;flex-shrink:0;
  min-height:28px;padding:0 8px;border-radius:100px;background:var(--surface-2);
  color:var(--text-2);border:1px solid var(--border);
}
.tcard-expand .tcard-subcount{font-size:11.5px;font-weight:600}
.tcard-expand svg{transition:transform .2s}
.tcard-expand.open svg{transform:rotate(180deg)}
.tcard-subs{
  background:var(--surface);border:1px solid var(--border);border-top:none;
  border-radius:0 0 18px 18px;padding:6px 12px 10px;margin-top:-1px;
}
.sg-item{display:flex;align-items:center;gap:11px;padding:8px 2px}
.sg-item + .sg-item, .sg-add{border-top:1px solid var(--border-2)}
.sg-check{width:24px;height:24px}
.sg-title{flex:1;min-width:0;font-size:14px;color:var(--ink);overflow-wrap:anywhere}
/* MYL-04 - user-authored strings must never shear at a container edge */
.goal-t,.goal-m,.tcard-name,.cat-name,.chat-thread-title,.ms-board-title,
.poll-q,.note-title,.msg-name,.home-room-title{overflow-wrap:anywhere}
.sg-item.done .sg-title{color:var(--muted);text-decoration:line-through;text-decoration-color:var(--border)}
.sg-del{width:28px;height:28px;border-radius:8px;flex-shrink:0;display:grid;place-items:center;color:var(--faint);background:transparent}
.sg-del:active{background:var(--surface-2)}
.sg-empty{font-size:12.5px;color:var(--muted);padding:6px 2px}
.sg-add{display:flex;align-items:center;gap:8px;padding-top:8px;margin-top:2px}
.sg-add-in{
  flex:1;min-width:0;height:38px;border-radius:11px;background:var(--surface-2);
  border:1px solid var(--border);padding:0 12px;color:var(--ink);
}
.sg-add-in:focus{background:var(--surface);border-color:var(--text-2)}
.sg-add-btn{
  width:38px;height:38px;border-radius:11px;flex-shrink:0;display:grid;place-items:center;
  background:var(--ink);color:var(--bg);border:none;
}
html[data-mood="dark"] .sg-add-btn{background:#EDEDED;color:#111}
/* Steps editor inside the system sheet */
.label-hint{font-weight:500;color:var(--muted);font-size:12px;margin-left:6px}
.rstep-list{display:flex;flex-direction:column;gap:6px;margin-bottom:8px}
.rstep-list:empty{margin:0}
.rstep-empty{font-size:13px;color:var(--muted);padding:2px 2px 4px}
.rstep-item{
  display:flex;align-items:center;gap:10px;
  padding:9px 12px;border-radius:11px;
  background:var(--surface-2);border:1px solid var(--border);
}
.rstep-dot{width:6px;height:6px;border-radius:50%;background:var(--text-2);flex-shrink:0}
.rstep-title{flex:1;min-width:0;font-size:14px;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rstep-del{
  width:26px;height:26px;flex-shrink:0;border:0;border-radius:8px;background:transparent;
  color:var(--muted);display:grid;place-items:center;cursor:pointer;
}
.rstep-del:active{background:color-mix(in srgb, var(--ink) 8%, transparent)}
/* Routine (system) */
.routine-ic{background:var(--surface-3)!important;color:var(--text-2)!important}
/* routine (system) category chips */
.rcat-row{display:flex;flex-wrap:wrap;gap:8px}
.rcat-chip{
  display:inline-flex;align-items:center;gap:7px;padding:6px 12px 6px 6px;border-radius:100px;
  background:var(--surface-2);border:1.5px solid var(--border);font-size:13px;font-weight:600;color:var(--text);
}
.rcat-chip.is-on{border-color:var(--cc);color:var(--ink);background:color-mix(in srgb, var(--cc) 10%, transparent)}
.rcat-ic{width:26px;height:26px;border-radius:8px;display:grid;place-items:center;font-size:13px;font-weight:700}
.rcat-ic svg{width:15px;height:15px}
/* Add chooser (Goal vs Routine) */
.chooser-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.chooser-tile{
  display:flex;flex-direction:column;align-items:flex-start;gap:8px;text-align:left;
  padding:16px 14px;border-radius:18px;background:var(--surface-2);border:1px solid var(--border);
}
.chooser-tile:active{transform:scale(.97)}
.chooser-tile-wide{grid-column:1/-1}
.chooser-ic{
  width:44px;height:44px;border-radius:13px;display:grid;place-items:center;
  background:var(--surface);border:1px solid var(--border);color:var(--ink);
}
.chooser-t{font-size:15px;font-weight:600;color:var(--ink)}
.chooser-list{display:flex;flex-direction:column;gap:2px;padding:4px 0 calc(18px + env(safe-area-inset-bottom))}
.chooser-row{
  display:flex;align-items:center;gap:14px;width:100%;
  padding:14px 12px;border:none;border-radius:14px;background:transparent;
  text-align:left;color:var(--ink);cursor:pointer;
}
.chooser-row:active{background:var(--surface-2)}
.chooser-row-danger .chooser-row-t{color:#D7364C}
.chooser-row-ic{
  width:40px;height:40px;border-radius:12px;display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);flex-shrink:0;
}
.chooser-row-ic-mylo{padding:0;overflow:hidden;background:var(--surface)}
.chooser-row-ic-mylo img{width:100%;height:100%;object-fit:cover;display:block}
.chooser-row-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.chooser-row-t{font-size:15px;font-weight:600;color:var(--ink);letter-spacing:-.01em}
.chooser-row-d{font-size:12.5px;color:var(--muted);line-height:1.3}
.mylo-thread{
  display:flex;flex-direction:column;gap:10px;max-height:min(36vh,280px);overflow-y:auto;
  margin-bottom:12px;padding-right:2px;
}
.mylo-bubble{
  max-width:92%;padding:10px 13px;border-radius:16px;font-size:14px;line-height:1.45;
  white-space:pre-wrap;word-break:break-word;
}
.mylo-ai{align-self:flex-start;background:var(--surface-2);color:var(--ink);border:1px solid var(--border)}
.mylo-me{align-self:flex-end;background:var(--ink);color:var(--bg)}
.mylo-bubble.is-typing{
  display:inline-flex;align-items:center;gap:5px;min-width:52px;padding-top:12px;padding-bottom:12px;
}
.mylo-drafts{display:flex;flex-direction:column;gap:8px;margin-bottom:12px}
.mylo-drafts.hidden,.mylo-confirm.hidden{display:none}
.mylo-card{
  display:flex;align-items:flex-start;justify-content:space-between;gap:10px;
  padding:12px 14px;border-radius:14px;background:var(--surface-2);border:1px solid var(--border);
}
.mylo-card-t{font-size:14px;font-weight:600;color:var(--ink)}
.mylo-card-m{font-size:12px;color:var(--muted);margin-top:3px;line-height:1.35}
.mylo-compose{display:flex;align-items:center;gap:8px;margin-top:4px}
.mylo-in{
  flex:1;min-width:0;height:44px;border-radius:22px;border:1px solid var(--border);
  background:var(--surface-2);padding:0 14px;color:var(--ink);
}
.mylo-mic,.mylo-send{
  width:44px;height:44px;border-radius:50%;display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);flex-shrink:0;
}
.mylo-mic.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.mylo-send{background:var(--ink);color:var(--bg);border-color:var(--ink)}

/* Inline Gemini-style bouncing dots in the chat bar */
.voice-dots{
  display:none;flex:1;align-items:center;justify-content:center;gap:7px;
  height:46px;min-width:0;padding:0 10px;
}
.voice-dots i{
  width:7px;height:7px;border-radius:50%;background:var(--ink);
  display:block;flex-shrink:0;opacity:.55;
  animation:geminiDot 1.05s ease-in-out infinite;
}
.voice-dots i:nth-child(1){animation-delay:0s}
.voice-dots i:nth-child(2){animation-delay:.12s}
.voice-dots i:nth-child(3){animation-delay:.24s}
.voice-dots i:nth-child(4){animation-delay:.36s}
.voice-dots i:nth-child(5){animation-delay:.48s}
@keyframes geminiDot{
  0%,100%{transform:translateY(0);opacity:.35}
  50%{transform:translateY(-7px);opacity:1}
}
.voice-stop{
  width:40px;height:40px;border-radius:50%;flex-shrink:0;
  display:none;place-items:center;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
}
.voice-stop-sq{width:12px;height:12px;border-radius:3px;background:var(--ink);display:block}
/* Listening with no speech yet → dots. Once words arrive → real input keeps them. */
.mylo-bar.is-listening:not(.has-speech) .chat-in,
.mylo-bar.is-listening:not(.has-speech) #mylo-chat-in,
.mylo-bar.is-listening:not(.has-speech) .mylo-in{display:none}
.mylo-bar.is-listening:not(.has-speech) .voice-dots{display:flex}
.mylo-bar.is-listening.has-speech .voice-dots{display:none}
.mylo-bar.is-listening.has-speech .chat-in,
.mylo-bar.is-listening.has-speech #mylo-chat-in,
.mylo-bar.is-listening.has-speech .mylo-in{display:block}
.mylo-bar.is-listening .voice-stop{display:grid}
.mylo-bar.is-listening .mylo-mic{opacity:.45;pointer-events:none}
.chat-head-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:4px}
.chat-head-row .chat-head-title{margin:0}
.mylo-chip{
  display:inline-flex;align-items:center;gap:8px;padding:6px 12px 6px 6px;
  border-radius:999px;border:1px solid var(--border);background:var(--surface-2);
  color:var(--ink);font-size:13px;font-weight:600;
}
.mylo-chip img{width:28px;height:28px;border-radius:9px;object-fit:cover;display:block}
.mylo-head-who{display:flex;align-items:flex-start;gap:12px;min-width:0}
.mylo-hints{display:flex;flex-wrap:wrap;gap:8px;margin:2px 0 4px}
.mylo-hint{
  border:1px solid var(--border);background:var(--surface-2);color:var(--ink);
  border-radius:999px;padding:8px 12px;font-size:12.5px;font-weight:600;
  flex:0 0 auto;white-space:nowrap;
}
.mylo-hint:active{transform:scale(.97)}
.mylo-hint-primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.mylo-hints-sticky{
  display:flex;flex-wrap:nowrap;gap:8px;margin:0;
  padding:0 2px 10px;
  overflow-x:auto;overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  scroll-snap-type:x proximity;
  scrollbar-width:none;
}
.mylo-hints-sticky::-webkit-scrollbar{display:none}
.mylo-hints-sticky .mylo-hint{scroll-snap-align:start}
.mylo-composer{
  padding:8px 12px calc(10px + env(safe-area-inset-bottom,0px));
  background:linear-gradient(to top, var(--bg) 70%, transparent);
  border-top:1px solid var(--border);
}
.mylo-bar{position:relative;left:auto;right:auto;bottom:auto;margin:0;padding:0;background:transparent;border:0;box-shadow:none}
.mylo-bar .send,.mylo-bar .mylo-mic{touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.mylo-scroll{padding:16px 14px 20px;gap:14px;display:flex;flex-direction:column}
.mylo-turn{display:flex;gap:10px;align-items:flex-start;max-width:100%}
.mylo-turn.mine{justify-content:flex-end}
.mylo-turn.mine .mylo-col{align-items:flex-end}
.mylo-ava,.mylo-head-ava{
  width:32px;height:32px;border-radius:11px;object-fit:cover;object-position:center 18%;flex-shrink:0;
  border:1px solid var(--border);background:#E8EDF2;
}
.mylo-head-ava{width:40px;height:40px;border-radius:12px}
.mylo-col{display:flex;flex-direction:column;gap:8px;min-width:0;max-width:min(340px,86%)}
.mylo-bubble-text{
  padding:12px 14px;border-radius:18px;font-size:15px;line-height:1.45;
  white-space:pre-wrap;word-break:break-word;color:var(--ink);
  background:var(--surface-2);border:1px solid var(--border);
}
.mylo-bubble-text a.mylo-inline-link,
.mylo-bubble a.mylo-inline-link{
  color:inherit;text-decoration:underline;text-underline-offset:2px;font-weight:600;
}
.mylo-turn.mine .mylo-bubble-text a.mylo-inline-link{color:inherit}
.mylo-turn.mine .mylo-bubble-text{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.mylo-bubble-text.is-typing{
  display:inline-flex;align-items:center;gap:5px;min-height:1.2em;
  padding-top:12px;padding-bottom:12px;min-width:52px;
}
.mylo-typing-dot{
  width:7px;height:7px;border-radius:50%;background:var(--muted);
  opacity:.45;animation:myloTypingDot 1.05s ease-in-out infinite;
}
.mylo-typing-dot:nth-child(2){animation-delay:.15s}
.mylo-typing-dot:nth-child(3){animation-delay:.3s}
@keyframes myloTypingDot{
  0%,100%{transform:translateY(0);opacity:.35}
  50%{transform:translateY(-5px);opacity:1}
}
.mylo-draft-stack{display:flex;flex-direction:column;gap:8px;width:100%}
.mylo-new-btn{
  width:36px;height:36px;padding:0;border-radius:50%;flex-shrink:0;
  display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
flex-shrink:0;margin-left:auto}
.mylo-chat .chat-thread-head{gap:10px;align-items:center}
.mylo-msg .bubble{white-space:pre-wrap;max-width:min(320px,82vw)}
.mylo-msg:not(.mine){align-items:flex-end}
.mylo-chat-row{background:linear-gradient(135deg, rgba(20,20,20,.03), rgba(20,20,20,.07))}
.mylo-head-face{
  width:44px;height:44px;border-radius:14px;object-fit:cover;flex-shrink:0;
  background:var(--surface-2);border:1px solid var(--border);
}
.mylo-card-cat{
  display:inline-block;margin-top:6px;padding:3px 8px;border-radius:999px;
  font-size:11px;font-weight:600;background:var(--surface);border:1px solid var(--border);color:var(--muted);
}
.mylo-card-kicker{
  font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin-bottom:4px;
}
.mylo-review .mylo-card{flex-direction:column;align-items:stretch}
.mylo-review-steps{
  margin:10px 0 0;padding:0 0 0 18px;color:var(--ink);font-size:13px;line-height:1.45;
}
.mylo-review-steps li{margin:2px 0}
.chooser-d{font-size:12px;color:var(--muted);line-height:1.35}

/* Today — week strip */
.wk-strip{
  position:relative;
  display:flex;gap:4px;overflow-x:auto;-webkit-overflow-scrolling:touch;
  scroll-snap-type:x proximity;scrollbar-width:none;
  background:var(--surface);border:1px solid var(--border);border-radius:20px;
  padding:10px 8px;margin-bottom:16px;
}
.wk-slider{
  position:absolute;top:10px;bottom:10px;left:0;width:0;z-index:0;
  border-radius:14px;background:var(--ink);pointer-events:none;
  transition:transform .4s cubic-bezier(.22,1,.36,1), width .4s cubic-bezier(.22,1,.36,1);
}
.wk-strip::-webkit-scrollbar{display:none}
.wk-day{
  appearance:none;border:0;background:transparent;font:inherit;cursor:pointer;color:inherit;
  flex:0 0 calc((100% - 24px) / 7);min-width:44px;max-width:56px;
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:8px 0;border-radius:14px;opacity:.4;transition:opacity .2s, transform .15s, background .15s;
  scroll-snap-align:center;
}
.wk-day.is-today{opacity:.7}
.wk-dow{font-size:11px;font-weight:600;color:var(--muted);white-space:nowrap}
.wk-num{font-size:16px;font-weight:600;color:var(--ink);letter-spacing:-.02em}
.wk-day{position:relative;z-index:1}
.wk-day.on{background:transparent;opacity:1}
.wk-day.on .wk-dow{color:color-mix(in srgb, var(--bg) 70%, transparent)}
.wk-day.on .wk-num{color:var(--bg)}
.wk-day:active{transform:scale(.96)}

.day-preview{
  display:flex;flex-direction:column;gap:12px;
  background:var(--surface);border:1px solid var(--border);border-radius:18px;
  padding:14px 16px;margin-bottom:16px;
}
.day-preview-t{font-size:16px;font-weight:700;letter-spacing:-.02em;color:var(--ink)}
.day-preview-d{font-size:13px;color:var(--muted);margin-top:3px;line-height:1.4}
.day-preview-actions{display:flex;gap:8px;flex-wrap:wrap}
.day-preview-actions .btn-dark,
.day-preview-actions .btn-ghost{min-height:40px;padding:0 14px;font-size:13px;width:auto}

/* Today — one unified progress bar with avatar heads */
.pbar-card{
  background:var(--surface);border:1px solid var(--border);border-radius:20px;
  padding:16px 16px 18px;margin-bottom:16px;
}
.pbar-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:56px}
.pbar-t{font-size:14px;font-weight:600;color:var(--ink)}
.pbar-track{
  position:relative;height:8px;border-radius:100px;background:var(--surface-3);
  margin:0;overflow:visible;
}
.pbar-track > i{display:block;height:100%;border-radius:100px;background:var(--done);transition:width .7s cubic-bezier(.22,1,.36,1)}
.pb-heads{position:absolute;inset:0}
.pb-head{
  position:absolute;bottom:calc(100% + 7px);transform:translateX(-50%);
  width:34px;height:34px;border-radius:50%;background:transparent;
  transition:left .7s cubic-bezier(.22,1,.36,1);
}
/* a small stem so a head still reads as pointing at its position */
.pb-head::after{
  content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);
  width:2px;height:7px;border-radius:2px;
  background:color-mix(in srgb, var(--ink) 22%, transparent);
}
.pb-av{
  display:block;width:34px;height:34px;border-radius:50%;overflow:hidden;
  border:1.5px solid var(--ink);
  box-shadow:0 0 0 2px var(--surface);
  background:var(--surface-2);
  box-sizing:border-box;
}
html[data-mood="dark"] .pb-av{border-color:#F5F5F5}
.pb-av .avatar-img,
.pb-av .avatar-stack,
.avatar-pb,
.avatar-stack.avatar-pb{
  width:100%;height:100%;border-radius:50%;display:block;object-fit:cover;
}
.pb-head img{width:34px;height:34px;border-radius:50%;object-fit:cover;background:var(--surface-3);display:block}
.pb-head .pb-crown{position:absolute;top:-11px;left:50%;transform:translateX(-50%);font-size:12px;color:var(--done)}
.pbar-sub{font-size:12.5px;color:var(--muted);margin-top:18px}

/* Today — To do / Completed / Pending segmented control */
.status-seg{
  display:flex;gap:3px;padding:4px;border-radius:100px;position:relative;
  background:var(--surface-2);border:1px solid var(--border);margin-bottom:6px;
}
.status-tab{
  flex:1;min-height:40px;border-radius:100px;border:none;background:transparent;
  font-size:13.5px;font-weight:600;color:color-mix(in srgb, var(--ink) 62%, transparent);
  cursor:pointer;transition:color .2s;position:relative;z-index:1;
}
.status-tab.on{background:transparent;color:var(--bg)}
/* To do: active cards on top — hold & swipe down peels them to show done underneath */
.today-pull-stack{position:relative;margin-top:4px}
.today-pull-done{
  max-height:0;overflow:hidden;opacity:0;
  transition:max-height .35s cubic-bezier(.22,1,.36,1), opacity .25s ease;
}
.today-pull-stack.is-revealed .today-pull-done{
  max-height:2400px;opacity:1;margin-bottom:14px;
}
.today-pull-stack.is-pulling .today-pull-done{transition:none}
.today-pull-done-label{
  font-size:12px;font-weight:650;letter-spacing:.04em;text-transform:uppercase;
  color:var(--muted);padding:4px 2px 10px;
}
.today-pull-front{
  position:relative;z-index:1;
  background:linear-gradient(to bottom, var(--bg) 0%, var(--bg) 12px, transparent 40px);
  transition:transform .28s cubic-bezier(.22,1,.36,1);
  touch-action:pan-y;
}
.today-pull-stack.is-pulling .today-pull-front{transition:none}
.today-pull-hint{
  font-size:11.5px;color:var(--muted);text-align:center;padding:0 8px 10px;
}
.goals-m-head{align-items:center;gap:10px}
.goals-m-head .h2{flex:1;margin:0}
.goals-more{
  width:40px;height:40px;border-radius:12px;border:1px solid var(--border);
  background:var(--surface);color:var(--ink);display:grid;place-items:center;flex-shrink:0;
}
.goals-scope-chip{
  display:inline-flex;margin:0 0 12px;padding:4px 10px;border-radius:100px;
  font-size:12px;font-weight:650;color:var(--muted);background:var(--surface-2);
}
.goal-scope-scrim{
  position:fixed;inset:0;background:rgba(0,0,0,.35);z-index:80;opacity:0;pointer-events:none;
  transition:opacity .2s;
}
.goal-scope-scrim.on{opacity:1;pointer-events:auto}
.goal-scope-drawer{
  position:fixed;top:0;right:0;bottom:0;width:min(300px,84vw);z-index:81;
  background:var(--surface);border-left:1px solid var(--border);
  padding:calc(12px + env(safe-area-inset-top,0px)) 14px 24px;
  transform:translateX(100%);transition:transform .28s cubic-bezier(.22,1,.36,1);
  display:flex;flex-direction:column;gap:6px;
}
.goal-scope-drawer.on{transform:translateX(0)}
.goal-scope-drawer-h{
  display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;padding:4px 2px 8px;
}
.goal-scope-drawer-t{font-size:16px;font-weight:700;color:var(--ink)}
.goal-scope-opt{
  display:flex;flex-direction:column;align-items:flex-start;gap:2px;width:100%;
  padding:14px 14px;border-radius:14px;border:1px solid var(--border);
  background:var(--bg);color:var(--ink);text-align:left;cursor:pointer;
}
.goal-scope-opt.on{border-color:var(--ink);background:color-mix(in srgb, var(--ink) 6%, var(--bg))}
.goal-scope-opt-t{font-size:14.5px;font-weight:650}
.goal-scope-opt-d{font-size:12px;color:var(--muted)}
.chat-row-time{font-size:11px;color:var(--muted);flex-shrink:0}
.chat-row-sub-line{display:flex;align-items:center;gap:8px;margin-top:3px;min-width:0}
.chat-row-preview{
  flex:1;min-width:0;font-size:12.5px;color:var(--muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;
}
.chat-row.has-unread .chat-row-name{font-weight:700;color:var(--ink)}
.chat-row.has-unread .chat-row-preview{color:var(--ink);font-weight:700}
.chat-row-badge{
  flex-shrink:0;min-width:18px;height:18px;padding:0 5px;border-radius:100px;
  background:var(--pip-bg,#E11D48);color:var(--pip-ink,#fff);
  font-size:10px;font-weight:600;line-height:18px;text-align:center;
}
/* The unread pip carries the plan. Free follows the theme — white on a dark
   app, black on a light one — because --ink/--bg already flip with the mood. */
/* Unread and @ pips are red on every plan again. Colouring them by plan made the
   free-plan pip white-on-dark, which reads as decoration, not as "you have
   something" — and that is exactly the one job this dot has. */
html[data-plan="free"]{--pip-bg:#E11D48;--pip-ink:#fff;--flame:#F97316}
html[data-plan="pod"]{--pip-bg:#E11D48;--pip-ink:#fff;--flame:#EC4899}
html[data-plan="pro"]{--pip-bg:#E11D48;--pip-ink:#fff;--flame:#3B82F6}

/* Apple only delivers web notifications to an installed app, so say so. */
.nset-ios{
  display:flex;flex-direction:column;gap:5px;margin:12px 0 4px;
  padding:13px 15px;border-radius:15px;
  background:color-mix(in srgb,#3B82F6 10%,var(--surface));
  border:1px solid color-mix(in srgb,#3B82F6 28%,var(--border));
}
.nset-ios-t{font-size:13.5px;font-weight:700;letter-spacing:-.01em;color:var(--ink)}
.nset-ios-d{font-size:12.5px;line-height:1.45;color:var(--muted)}
.nset-ios-d b{color:var(--ink);font-weight:700}

/* ── Lock in ───────────────────────────────────────────────────────────
   Mylo can only shut its OWN doors — games, the store, statuses. Blocking
   anything outside this app needs a native Screen Time entitlement. */
.focus-entry{
  display:flex;align-items:center;gap:12px;width:100%;
  margin:0 0 var(--stack,14px);padding:13px 14px;
  border-radius:16px;cursor:pointer;text-align:left;
  background:var(--surface);border:1px solid var(--border);
}
.focus-entry:active{transform:scale(.99);background:var(--surface-2)}
.focus-entry-ic{
  width:36px;height:36px;border-radius:12px;flex-shrink:0;display:grid;place-items:center;
  background:color-mix(in srgb,var(--ink) 8%,transparent);color:var(--ink);
}
.focus-entry-copy{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.focus-entry-copy b{font-size:14px;font-weight:700;letter-spacing:-.01em;color:var(--ink)}
.focus-entry-copy span{font-size:12.5px;color:var(--muted);line-height:1.35}
.focus-entry-go{color:var(--muted);flex-shrink:0}

.focus-sheet{
  position:fixed;inset:0;z-index:140;display:flex;align-items:flex-end;
  background:rgba(0,0,0,.45);
  backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);
}
body.focus-picking{overflow:hidden}
.focus-card{
  width:100%;max-height:88vh;overflow-y:auto;
  padding:8px 20px calc(env(safe-area-inset-bottom,0px) + 20px);
  border-radius:24px 24px 0 0;background:var(--surface);
  animation:focusUp .26s cubic-bezier(.16,1,.3,1) both;
}
@keyframes focusUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
@media (prefers-reduced-motion:reduce){.focus-card{animation:none}}
.focus-grab{width:38px;height:4px;border-radius:100px;background:var(--border);margin:0 auto 14px}
.focus-h{margin:0 0 6px;font-size:20px;font-weight:800;letter-spacing:-.03em;color:var(--ink)}
.focus-sub{margin:0 0 16px;font-size:13px;line-height:1.45;color:var(--muted)}
.focus-mins{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.focus-min{
  display:flex;flex-direction:column;align-items:center;gap:1px;
  padding:12px 0;border-radius:14px;cursor:pointer;
  background:var(--surface-2);border:1.5px solid transparent;
  font-size:19px;font-weight:800;letter-spacing:-.02em;color:var(--ink);
}
.focus-min i{font-style:normal;font-size:10px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.focus-min.on{border-color:var(--ink);background:var(--surface)}
.focus-sec{
  margin:20px 0 9px;font-size:10.5px;font-weight:800;
  letter-spacing:.1em;text-transform:uppercase;color:var(--muted);
}
.focus-todos{display:flex;flex-direction:column;gap:7px}
.focus-todo{
  display:flex;align-items:center;gap:10px;padding:11px 13px;border-radius:13px;
  cursor:pointer;text-align:left;font-size:13.5px;font-weight:600;color:var(--ink);
  background:var(--surface-2);border:1.5px solid transparent;
}
.focus-todo-dot{
  width:19px;height:19px;border-radius:50%;flex-shrink:0;
  border:2px solid var(--border);position:relative;
}
.focus-todo.on{border-color:var(--done)}
.focus-todo.on .focus-todo-dot{background:var(--done);border-color:var(--done)}
.focus-todo.on .focus-todo-dot::after{
  content:'';position:absolute;left:5px;top:2px;width:5px;height:9px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);
}
.focus-none{margin:18px 0 0;font-size:12.5px;color:var(--muted)}
.focus-acts{display:flex;gap:9px;margin-top:22px}
.focus-acts button{flex:1;min-height:48px;font-size:15px}

/* the bar that follows you around while a session runs */
#focus-bar-host{
  position:fixed;left:0;right:0;z-index:95;pointer-events:none;
  top:calc(env(safe-area-inset-top,0px) + 4px);padding:0 10px;
}
.focus-bar{
  pointer-events:auto;
  display:flex;align-items:center;gap:11px;padding:8px 8px 8px 14px;
  border-radius:100px;
  background:rgba(20,20,24,.72);color:#fff;
  backdrop-filter:blur(20px) saturate(160%);-webkit-backdrop-filter:blur(20px) saturate(160%);
  border:1px solid rgba(255,255,255,.16);
  box-shadow:0 10px 28px -10px rgba(0,0,0,.6);
}
.focus-dot{
  width:8px;height:8px;border-radius:50%;flex-shrink:0;background:#5EE39A;
  animation:focusPulse 2s ease-in-out infinite;
}
@keyframes focusPulse{0%,100%{opacity:1}50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.focus-dot{animation:none}}
.focus-copy{display:flex;flex-direction:column;gap:0;min-width:0;flex:1;line-height:1.25}
.focus-copy b{font-size:12.5px;font-weight:700;letter-spacing:-.01em}
.focus-copy span{font-size:11px;color:rgba(255,255,255,.62)}
.focus-clock{
  font-size:13.5px;font-weight:800;font-variant-numeric:tabular-nums;flex-shrink:0;
}
.focus-x{
  flex-shrink:0;padding:7px 14px;border-radius:100px;border:0;cursor:pointer;
  background:rgba(255,255,255,.16);color:#fff;font-size:12px;font-weight:700;
}
.focus-x:active{transform:scale(.94)}
/* the bar takes the top strip, so push the page under it */
body.focus-on .m-screen{padding-top:calc(env(safe-area-inset-top,0px) + 56px)}

/* ── Streaks ──────────────────────────────────────────────────────────── */
.streak-pip{
  display:inline-flex;align-items:center;gap:2px;flex-shrink:0;
  font-size:11px;font-weight:800;font-variant-numeric:tabular-nums;
  color:var(--flame,#F97316);line-height:1;
}
.streak-flag{
  position:absolute;top:9px;left:9px;z-index:2;
  display:inline-flex;align-items:center;gap:5px;
  padding:5px 10px 5px 8px;border-radius:100px;
  font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;
}
.streak-flag svg{color:var(--flame,#F97316)}
.streak-proof{
  position:absolute;left:9px;right:9px;bottom:9px;z-index:2;
  display:inline-flex;align-items:center;gap:8px;width:max-content;max-width:calc(100% - 18px);
  padding:7px 12px 7px 7px;border-radius:13px;
  font-size:12px;font-weight:650;text-align:left;
}
.streak-proof-tick{
  width:21px;height:21px;border-radius:7px;flex-shrink:0;display:grid;place-items:center;
  background:linear-gradient(160deg,#6BE8A6,#22B573);color:#04301B;
}
.img-bubble{position:relative}
.img-bubble.is-streak{box-shadow:0 0 0 2px var(--flame,#F97316)}
.img-cap{
  position:absolute;left:9px;right:9px;bottom:9px;z-index:2;
  padding:6px 10px;border-radius:11px;text-align:left;
  background:rgba(20,20,24,.5);color:#fff;font-size:12.5px;line-height:1.35;
  backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px);
}
.img-bubble.is-streak .img-cap{bottom:auto;top:9px;left:auto;right:9px;max-width:52%}
/* "someone said your name in here" — shown even when the chat is muted */
.chat-row-at{
  flex-shrink:0;width:18px;height:18px;border-radius:100px;
  background:var(--pip-bg,#E11D48);color:var(--pip-ink,#fff);
  font-size:11px;font-weight:800;line-height:18px;text-align:center;
}
.cat-list{display:flex;flex-direction:column;gap:8px}
.cat-row{
  display:flex;align-items:center;gap:12px;padding:12px 14px;
  border:1px solid var(--border);border-radius:14px;background:var(--surface);
  max-width:100%;
}
.cat-row .cat-name{flex:1;min-width:0;font-weight:500;color:var(--ink);font-size:14px}
.cat-row .cat-count{font-size:12px;color:var(--muted);flex-shrink:0}
.cat-row .btn-ghost{flex-shrink:0;min-height:32px;padding:0 10px;font-size:12px}
.swatch{width:16px;height:16px;border-radius:5px;flex-shrink:0}
.color-row{display:flex;flex-wrap:wrap;gap:8px}
.color-dot{
  width:32px;height:32px;border-radius:10px;border:2px solid transparent;
}
.color-dot.is-on{border-color:var(--ink);box-shadow:0 0 0 2px var(--surface)}

.setting-row{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 0;border-bottom:1px solid var(--border);
}
.setting-row:last-child{border-bottom:none}
.setting-t{font-size:14px;font-weight:500;color:var(--ink)}
.setting-d{font-size:12px;color:var(--muted);margin-top:2px}
.code-box{
  font-size:20px;font-weight:500;letter-spacing:.16em;color:var(--ink);
  background:var(--surface-2);border-radius:14px;padding:16px;text-align:center;margin:12px 0 18px;
}

/* ---------- calendar (Blackgold structure: month + agenda only) ---------- */
.cal-wrap{max-width:400px}
.m-cal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;gap:12px}
.m-cal-month{font-size:20px;font-weight:500;letter-spacing:-.02em;color:var(--ink)}
.m-cal-nav{display:flex;gap:8px;align-items:center}
.m-cal-today{
  min-height:32px;padding:0 12px;border-radius:100px;font-size:12.5px;font-weight:600;
  background:var(--surface);border:1px solid var(--border);color:var(--ink);
}
.m-cal-arrow{
  width:34px;height:34px;border-radius:11px;border:1px solid var(--border);
  background:var(--surface);color:var(--text-2);display:flex;align-items:center;justify-content:center;
  font-size:15px;
}
.m-cal-arrow:active{transform:scale(.92)}
.m-chips{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;margin-bottom:16px;scrollbar-width:none}
.m-chips::-webkit-scrollbar{display:none}
.m-chip{
  flex-shrink:0;font-size:12.5px;font-weight:500;color:var(--text-2);
  background:var(--surface);border:1px solid var(--border);border-radius:100px;padding:8px 14px;
}
.m-chip.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.m-monthgrid{
  background:var(--surface);border:1px solid var(--border);border-radius:18px;padding:12px;
}
.m-mg-dow{
  display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:6px;
  text-align:center;font-size:10px;font-weight:600;color:var(--muted);letter-spacing:.04em;
}
.m-mg-body{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.m-mg-cell{
  aspect-ratio:1;border-radius:10px;display:flex;flex-direction:column;
  align-items:center;justify-content:center;font-size:12.5px;font-weight:500;
  color:var(--ink);position:relative;padding:0 0 8px;width:100%;background:transparent;
  line-height:1;
}
.m-mg-cell.dim{color:var(--muted)}
.m-mg-cell.today:not(.sel){color:var(--ink);font-weight:600}
.m-mg-cell.sel{background:var(--ink);color:var(--bg)}
.m-mg-dots{display:flex;gap:2px;position:absolute;bottom:5px;left:50%;transform:translateX(-50%);min-height:4px;align-items:center}
.m-mg-dot{width:4px;height:4px;border-radius:50%}
.m-mg-cell.sel .m-mg-dot{background:var(--bg)!important}
.m-agenda-date{font-size:13px;font-weight:500;color:var(--ink);margin:18px 4px 12px}
.m-book{
  background:var(--surface);border:1px solid var(--border);border-radius:16px;
  padding:14px 14px 12px;margin-bottom:10px;
}
.m-book-body{display:flex;align-items:flex-start;gap:12px}
.m-book-main{flex:1;min-width:0}
.m-book-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-bottom:2px}
.m-book-name{font-size:14.5px;font-weight:500;color:var(--ink);letter-spacing:-.01em}
.badge{font-size:10.5px;font-weight:500;padding:3px 8px;border-radius:100px}
.m-book-svc{font-size:12.5px;color:var(--muted);line-height:1.4}
.m-book-actions{
  display:flex;align-items:center;gap:8px;margin-top:12px;padding-top:12px;
  border-top:1px solid var(--border-2);
}
.m-book-act{
  flex:0 0 auto;border:none;background:transparent;
  font-size:12.5px;font-weight:500;color:var(--text-2);
  padding:8px 12px;border-radius:100px;
}
.m-book-act.primary{margin-left:auto;background:var(--ink);color:var(--bg);padding:8px 14px}
.m-book-act.ghost{color:var(--muted);cursor:default}
.m-empty-day{text-align:center;padding:36px 16px;color:var(--muted)}
.m-empty-day p{margin-bottom:12px;font-size:13px}
.m-empty-day .qd{
  min-height:36px;padding:0 14px;border-radius:100px;background:var(--surface);
  border:1px solid var(--border);color:var(--ink);font-weight:500;font-size:12.5px;
}

/* ---------- chat ---------- */
.chat{display:flex;flex-direction:column;height:min(62vh,560px);min-height:360px}
@media (min-width:901px){
  .canvas:has(.chat-thread-surface),
  .canvas:has(.mylo-chat),
  .canvas:has(.chat-shell){
    display:flex;flex-direction:column;overflow:hidden;
  }
  .canvas:has(.chat-thread-surface) .pad,
  .canvas:has(.mylo-chat) .pad,
  .canvas:has(.chat-shell) .pad{
    flex:1;min-height:0;display:flex;flex-direction:column;
    max-width:none;width:100%;margin:0;padding:12px 24px 16px;
    box-sizing:border-box;
  }
  .chat.chat-thread-surface,
  .chat.mylo-chat,
  .chat-shell .chat{
    flex:1;min-height:0;height:auto;max-height:none;
  }
  .chat-shell{
    flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;
    max-width:720px;width:100%;
  }
  .chat.chat-thread-surface,
  .chat.mylo-chat{
    max-width:820px;width:100%;margin:0 auto;
  }
  .mylo-col{max-width:min(520px,70%)}
  .mylo-msg .bubble{max-width:min(480px,70%)}
}
.chat-scroll{flex:1;overflow-y:auto;padding:12px 2px 18px;display:flex;flex-direction:column;gap:2px}
.msg{
  max-width:76%;display:flex;flex-direction:column;gap:4px;
  min-width:0;align-self:flex-start;
}
.msg.mine{align-self:flex-end;align-items:flex-end}
/* space between different senders / time-runs, tight within a run */
.msg.run-start{margin-top:12px}
.chat-scroll > .msg:first-child{margin-top:0}
.msg-row{display:flex;align-items:flex-end;gap:8px;max-width:100%}
.msg-col{display:flex;flex-direction:column;gap:4px;min-width:0;max-width:100%}
.msg-ava,.msg-ava-spacer{
  width:28px;height:28px;flex-shrink:0;
}
.msg-ava{
  border-radius:50%;overflow:hidden;
  border:1px solid color-mix(in srgb, var(--ink) 18%, transparent);
  background:var(--surface-2);
  box-sizing:border-box;
}
.msg-ava .avatar-img,
.msg-ava .avatar-stack,
.avatar-msg,
.avatar-stack.avatar-msg{
  width:28px;height:28px;border-radius:50%;display:block;object-fit:cover;
}
.msg-name{font-size:11.5px;font-weight:600;color:var(--text-2);padding:0 6px 1px;display:inline-flex;align-items:center;gap:4px}
.msg-system{
  align-self:center;max-width:92%;margin:10px 0 4px;
  text-align:center;
}
.msg-system-text{
  font-size:12px;line-height:1.35;color:var(--muted);opacity:.72;
  letter-spacing:.01em;
}
.bubble{
  padding:11px 15px;border-radius:20px;
  background:var(--bubble-in);color:var(--bubble-in-ink);
  border:1px solid var(--bubble-line);
  font-size:15px;line-height:1.45;letter-spacing:-.01em;
  word-break:break-word;overflow-wrap:anywhere;white-space:pre-wrap;
  min-height:auto;max-width:100%;
  -webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;
}
.msg.mine .bubble{
  background:var(--ink);color:var(--bg);border-color:transparent;
}
/* tail: the outer-bottom corner tucks in on the last bubble of a run */
.msg:not(.grouped).mine .bubble{border-bottom-right-radius:7px}
.msg:not(.grouped):not(.mine) .bubble{border-bottom-left-radius:7px}
/* stacked (grouped) bubbles hug together */
.msg.grouped.mine .bubble{border-top-right-radius:8px}
.msg.grouped:not(.mine) .bubble{border-top-left-radius:8px}
.msg-meta{font-size:10.5px;color:var(--muted);padding:0 6px;letter-spacing:.02em;line-height:1.2;margin-top:1px}
.msg.mine .msg-meta{color:var(--faint)}
.chat-day{
  align-self:center;margin:14px 0 6px;
}
.chat-day span{
  font-size:11px;font-weight:600;color:var(--muted);letter-spacing:.02em;
  background:var(--surface-2);border:1px solid var(--border-2);
  padding:4px 12px;border-radius:100px;
}
.chat-bar{
  display:flex;gap:6px;align-items:center;padding:9px 10px;
  margin-top:auto;
  border:1px solid var(--border);
  border-radius:18px;
  background:var(--surface);
  box-sizing:border-box;
}
.chat-plus,.send{
  width:42px;height:42px;border-radius:15px;flex-shrink:0;
  display:grid;place-items:center;transition:transform .12s, opacity .12s;
}
.chat-plus:active,.send:active{transform:scale(.92)}
.chat-plus{
  background:var(--chat-ctl);color:var(--ink);border:1px solid var(--bubble-line);
  font-size:24px;line-height:1;font-weight:300;
}
/* WhatsApp-style field: the sticker button lives INSIDE the rounded input. */
.chat-field{
  flex:1;min-width:0;position:relative;display:flex;align-items:center;
  height:42px;border-radius:21px;background:var(--surface-2);
  border:1px solid var(--border);
  transition:border-color .15s, background .15s;
}
.chat-field:focus-within{background:var(--surface);border-color:var(--text-2)}
.chat-in{
  flex:1;min-width:0;height:100%;border:none;background:none;border-radius:21px;
  padding:0 4px 0 15px;color:var(--ink);
}
.chat-in:focus{background:none;border:none}
.chat-in::placeholder{color:var(--muted);opacity:.6}
.chat-sticker{
  width:32px;height:38px;margin-right:5px;border-radius:50%;border:0;flex-shrink:0;
  background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer;
  transition:color .15s, background .15s;
}
.chat-sticker:active{color:var(--ink);background:var(--surface-3)}
@media (hover:hover){.chat-sticker:hover{color:var(--ink)}}
/* Send only exists once there is something to send. */
.send{
  background:var(--ink);color:var(--bg);border:none;
  width:42px;height:42px;flex-shrink:0;
  transform:scale(.4);opacity:0;
  margin-left:-42px;pointer-events:none;
  transition:transform .18s cubic-bezier(.2,1.3,.4,1), opacity .14s ease, margin-left .18s ease;
}
.chat-bar.has-text .send{
  transform:scale(1);opacity:1;margin-left:0;pointer-events:auto;
}
@media (prefers-reduced-motion:reduce){
  .send{transition:opacity .1s linear}
}
.chat-head-title{font-size:var(--fs-display);font-weight:600;letter-spacing:-.03em;color:var(--ink);margin:4px 2px 14px}
.chat-tabs{
  display:flex;gap:4px;padding:3px;margin-bottom:12px;position:relative;
  background:var(--surface-2);border-radius:12px;
}
.chat-tab{
  flex:1;min-height:36px;border-radius:10px;border:none;background:transparent;
  font-size:13px;font-weight:500;color:var(--text-2);cursor:pointer;
  position:relative;z-index:1;transition:color .2s;
}
.chat-tab.on{background:transparent;color:var(--ink)}
.chat-tabs-4{gap:2px}
.chat-tabs-4 .chat-tab{font-size:12px;padding:0 4px;letter-spacing:-.01em}
.ms-av{background:color-mix(in srgb, var(--done) 16%, transparent)!important;color:var(--done)!important}
.ms-scroll{gap:2px}
.person-hero{display:flex;align-items:center;gap:14px;margin-bottom:18px}
.person-name{font-size:17px;font-weight:600;color:var(--ink);letter-spacing:-.02em}
.person-sub{font-size:12.5px;color:var(--muted);margin-top:2px}
/* You — grouped settings cards */
.setting-card{
  background:var(--surface);border:1px solid var(--border);border-radius:18px;
  padding:0 16px;margin-bottom:8px;
}
.setting-card .setting-row{border-bottom:1px solid var(--border-2)}
.setting-card .setting-row:last-child{border-bottom:none}
.m-section{font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:24px 2px 10px}
.plan-buy-row{display:flex;flex-wrap:wrap;gap:8px}
.plan-buy-row .btn-ghost,
.plan-buy-row .btn-dark{min-height:36px;padding:0 12px;font-size:13px;width:auto}
.plan-buy-row .btn-ghost:disabled,
.plan-buy-row .btn-dark:disabled{opacity:.45;pointer-events:none}

.gcal-mark{
  width:40px;height:40px;border-radius:12px;flex-shrink:0;
  display:grid;place-items:center;font-size:14px;font-weight:700;
  background:#E8F0FE;color:#1967D2;
}
html[data-mood="dark"] .gcal-mark{background:#1A2738;color:#8AB4F8}
.gcal-badge{background:#E8F0FE;color:#1967D2}
html[data-mood="dark"] .gcal-badge{background:#1A2738;color:#8AB4F8}
.gcal-book .m-book-act{text-decoration:none}
.pill-ev.gcal{
  background:#E8F0FE;color:#1967D2;text-decoration:none;
}
html[data-mood="dark"] .pill-ev.gcal{background:#1A2738;color:#8AB4F8}
/* Category rows — icon tile + three-dot menu */
.cat-ic{
  width:40px;height:40px;border-radius:12px;flex-shrink:0;
  display:grid;place-items:center;font-size:16px;font-weight:700;
}
.cat-more{
  width:36px;height:36px;border-radius:10px;flex-shrink:0;margin-left:auto;
  display:grid;place-items:center;color:var(--muted);background:transparent;
}
.cat-more:active{background:var(--surface-2)}
/* Lucide icon picker */
.icon-grid{
  display:grid;grid-template-columns:repeat(6,1fr);gap:8px;
  max-height:200px;overflow-y:auto;-webkit-overflow-scrolling:touch;
}
.icon-opt{
  aspect-ratio:1;border-radius:12px;background:var(--surface-2);border:1.5px solid transparent;
  display:grid;place-items:center;color:var(--text);
}
.icon-opt.is-on{border-color:var(--ink);background:var(--surface);color:var(--ink)}
/* Simple action-menu list (category options, etc.) */
.menu-list{display:flex;flex-direction:column;gap:2px}
.menu-item{
  width:100%;text-align:left;padding:15px 4px;border-radius:12px;
  font-size:15px;font-weight:500;color:var(--ink);background:transparent;
  border-bottom:1px solid var(--border-2);
}
.menu-item:last-child{border-bottom:none}
.menu-item:active{background:var(--surface-2)}
.menu-item.danger{color:#DC2626}
html[data-mood="dark"] .menu-item.danger{color:#F87171}
.chat-list{display:flex;flex-direction:column}
.chat-list .chat-row{
  border-radius:0;border:none;border-bottom:1px solid var(--border);
  padding:14px 4px;background:transparent;
}
.chat-list .chat-row:last-child{border-bottom:none}
.chat-list .chat-row.on{background:var(--surface-2);border-radius:12px;border-bottom-color:transparent}

.msg-card{
  min-width:220px;max-width:280px;border-radius:16px;border:1px solid var(--border);
  background:var(--surface);padding:12px 14px;color:var(--ink);
  -webkit-font-smoothing:antialiased;
}
.msg.mine .msg-card{
  border-color:var(--border);
  background:var(--surface-2);
  color:var(--ink);
}
html[data-mood="dark"] .msg.mine .msg-card{
  background:#242424;border-color:#3A3A3A;color:#F5F5F5;
}
html[data-mood="dark"] .msg:not(.mine) .msg-card{
  background:#1F1F1F;border-color:#333;color:#F5F5F5;
}
.msg-card-kicker{font-size:10.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin-bottom:6px}
.msg-card-title{font-size:14.5px;font-weight:500;color:inherit;line-height:1.35}
.msg-card-sub{font-size:12.5px;color:var(--muted);margin-top:4px}
.msg-card-actions{display:flex;gap:8px;margin-top:10px}
.msg-card-btn{
  flex:1;min-height:34px;border-radius:10px;font-size:12.5px;font-weight:500;
  background:var(--surface-3);color:var(--ink);
}
.msg-card-btn.on{background:var(--ink);color:var(--bg)}
.msg-card-btn.ghost{background:transparent;border:1px solid var(--border);color:var(--text-2)}
html[data-mood="dark"] .msg-card-btn.on{background:#EDEDED;color:#111}
.chance-card .chance-reveal{
  display:flex;align-items:center;justify-content:center;gap:10px;
  margin:8px 0 2px;font-size:13px;font-weight:600;color:var(--ink);
}
.chance-card .chance-vs{color:var(--muted);font-weight:500;font-size:11px;letter-spacing:.04em;text-transform:uppercase}
.chance-card.is-stale{opacity:.55}
.sticker-bubble{
  display:inline-flex;align-items:center;justify-content:center;
  padding:4px;border-radius:18px;background:transparent;
}
.msg.mine .sticker-bubble{background:transparent}
html[data-mood="dark"] .sticker-bubble,
html[data-mood="dark"] .msg.mine .sticker-bubble{background:transparent}
.sticker-bubble img,
.sticker-art{width:120px;height:120px;object-fit:contain;display:block;filter:drop-shadow(0 8px 16px rgba(0,0,0,.12))}
.sticker-bubble span{font-size:12px;color:var(--muted)}
.mood-chip{
  display:inline-flex;align-items:center;gap:8px;padding:10px 14px;border-radius:14px;
  background:#EFEFEF;font-size:14px;font-weight:500;color:#171717;
}
html[data-mood="dark"] .mood-chip{background:#2C2C2C;color:#F5F5F5}
.plus-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.plus-tile{
  display:flex;flex-direction:column;align-items:flex-start;gap:14px;
  padding:16px;border-radius:18px;background:var(--surface);color:var(--ink);
  font-size:13.5px;font-weight:650;border:1px solid var(--border);text-align:left;min-height:108px;
}
.plus-ic{font-size:18px;line-height:1;opacity:.85}
.sticker-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;padding:4px 2px 8px}
.sticker-opt{
  appearance:none;border:1px solid var(--border);border-radius:16px;background:#F3F5F7;
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:10px 8px 8px;cursor:pointer;
}
.sticker-opt:active{transform:scale(.97)}
.sticker-opt img{width:64px;height:64px;object-fit:contain}
.sticker-opt span{font-size:11.5px;font-weight:600;color:var(--muted)}
.mood-row{display:grid;grid-template-columns:1fr;gap:8px}
.mood-opt{
  display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:14px;
  background:var(--surface-2);text-align:left;font-size:14px;font-weight:500;color:var(--ink);
}
.mood-opt span{font-size:18px}
.pick-list{display:flex;flex-direction:column;gap:8px;max-height:50vh;overflow:auto}
.pick-item{
  display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;
  border:1px solid var(--border);background:var(--surface);text-align:left;width:100%;
}
.pick-item .t{flex:1;font-size:14px;font-weight:500;color:var(--ink)}
.pick-item .s{font-size:12px;color:var(--muted)}
.note-area{
  width:100%;min-height:220px;border-radius:14px;padding:14px;
  background:var(--surface-2);border:1px solid transparent;color:var(--ink);
  resize:vertical;line-height:1.5;
}
.note-area:focus{background:var(--surface);border-color:var(--border)}
.sheet-sm{width:min(380px,92vw)}
.sheet-tall{width:min(440px,92vw);max-height:min(88vh,720px);overflow-y:auto}
.spin-overlay{
  position:fixed;inset:0;z-index:70;display:grid;place-items:center;
  background:var(--scrim);opacity:0;pointer-events:none;transition:opacity .2s;
}
.spin-overlay.on{opacity:1;pointer-events:auto}
.spin-card{
  background:var(--surface);border-radius:20px;padding:28px 32px;text-align:center;
  box-shadow:var(--shadow-pop);min-width:200px;
}
.spin-wheel{font-size:48px;animation:spinPop 1.1s ease}
.spin-result{margin-top:12px;font-size:16px;font-weight:500;color:var(--ink)}
@keyframes spinPop{0%{transform:rotate(0) scale(.8)}60%{transform:rotate(420deg) scale(1.08)}100%{transform:rotate(540deg) scale(1)}}

.chance-overlay{
  position:fixed;inset:0;z-index:72;display:grid;place-items:end center;
  padding:16px;padding-bottom:max(16px, env(safe-area-inset-bottom));
  background:rgba(10,12,16,.45);opacity:0;pointer-events:none;transition:opacity .22s ease;
}
.chance-overlay.on{opacity:1;pointer-events:auto}
.chance-sheet{
  width:min(420px,100%);background:var(--surface);border:1px solid var(--border);
  border-radius:24px 24px 20px 20px;padding:16px 16px 18px;
  box-shadow:0 20px 50px rgba(0,0,0,.22);
  transform:translateY(24px);transition:transform .28s cubic-bezier(.16,1,.3,1);
}
.chance-overlay.on .chance-sheet{transform:translateY(0)}
.chance-sheet-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.chance-brand{font-size:13px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.chance-head{font-size:22px;font-weight:700;letter-spacing:-.03em;color:var(--ink);margin:6px 0 4px}
.chance-sub{font-size:13px;color:var(--muted);margin-bottom:16px;line-height:1.4}
.chance-picks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin-bottom:16px}
.chance-pick{
  display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:16px 8px;border-radius:18px;border:1.5px solid var(--border);
  background:var(--surface-2);cursor:pointer;font:inherit;color:inherit;
}
.chance-pick.is-on{border-color:var(--ink);box-shadow:0 0 0 1px var(--ink);background:var(--surface)}
.chance-pick.is-locked{opacity:.55;cursor:default}
.chance-pick-emoji{font-size:28px;line-height:1}
.chance-pick-label{font-size:12px;font-weight:600;color:var(--text-2)}
.chance-actions{display:flex;flex-direction:column;gap:8px}
.chance-actions .btn-primary,.chance-actions .btn-secondary{width:100%}

/* ---------- login reaction popup ---------- */
.reaction-overlay{
  position:fixed;inset:0;z-index:120;display:grid;place-items:center;padding:24px;
  background:rgba(10,12,16,.48);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);
  opacity:0;pointer-events:none;transition:opacity .28s ease;
}
.reaction-overlay.on{opacity:1;pointer-events:auto}
.reaction-card{
  position:relative;width:min(340px,92vw);text-align:center;
  background:linear-gradient(180deg,#FFFFFF 0%,#F4F7FA 100%);
  border:1px solid rgba(0,0,0,.06);border-radius:28px;
  padding:28px 22px 22px;box-shadow:0 24px 64px -20px rgba(0,0,0,.35);
  transform:translateY(18px) scale(.94);
  transition:transform .34s cubic-bezier(.16,1,.3,1);
}
.reaction-overlay.on .reaction-card{transform:translateY(0) scale(1)}
html[data-mood="dark"] .reaction-card{
  background:linear-gradient(180deg,#1E1E1E 0%,#161616 100%);
  border-color:var(--border);
}
.reaction-x{
  position:absolute;top:12px;right:12px;width:36px;height:36px;border:0;border-radius:12px;
  background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer;
}
.reaction-art{
  width:min(180px,52vw);height:min(180px,52vw);object-fit:contain;display:block;margin:4px auto 8px;
  filter:drop-shadow(0 14px 24px rgba(0,0,0,.14));
  animation:reactionPop .55s cubic-bezier(.16,1,.3,1) both;
}
.reaction-overlay[data-mood="sad"] .reaction-art{animation:reactionSad .7s ease both}
.reaction-overlay[data-mood="angry"] .reaction-art{animation:reactionMad .55s ease both}
.reaction-emoji{
  display:inline-grid;place-items:center;min-width:28px;height:28px;padding:0 8px;margin:0 auto 10px;
  border-radius:100px;font-size:14px;font-weight:700;color:#171717;background:#E8EDF2;
}
.reaction-overlay[data-mood="happy"] .reaction-emoji{background:#D8F5E4;color:#0F7A45}
.reaction-overlay[data-mood="sad"] .reaction-emoji{background:#E8EEF8;color:#3B5BDB}
.reaction-overlay[data-mood="angry"] .reaction-emoji{background:#FDE2E2;color:#C53030}
.reaction-title{
  margin:0 0 8px;font-size:22px;font-weight:750;letter-spacing:-.035em;color:var(--ink);line-height:1.2;
}
.reaction-body{
  margin:0 auto 18px;max-width:28ch;font-size:14.5px;line-height:1.45;color:var(--muted);
}
.reaction-cta{
  width:100%;min-height:48px;border:0;border-radius:16px;cursor:pointer;
  background:#171717;color:#fff;font:inherit;font-size:15px;font-weight:700;
}
html[data-mood="dark"] .reaction-cta{background:#EDEDED;color:#111}
.reaction-cta:active{transform:scale(.98)}
@keyframes reactionPop{
  0%{transform:translateY(12px) scale(.86);opacity:0}
  100%{transform:none;opacity:1}
}
@keyframes reactionSad{
  0%{transform:translateY(10px) rotate(-4deg);opacity:0}
  100%{transform:rotate(-3deg);opacity:1}
}
@keyframes reactionMad{
  0%,100%{transform:rotate(0)}
  20%{transform:rotate(-6deg) scale(1.02)}
  40%{transform:rotate(6deg)}
  60%{transform:rotate(-4deg)}
  80%{transform:rotate(3deg)}
}
body.reaction-open{overflow:hidden}

/* ---------- sheets ---------- */
.scrim{position:fixed;inset:0;background:var(--scrim);backdrop-filter:blur(4px);z-index:100;opacity:0;pointer-events:none;transition:opacity .2s}
.scrim.on{opacity:1;pointer-events:auto}
.sheet{
  position:fixed;z-index:110;left:50%;top:50%;
  width:min(420px,92vw);background:var(--surface);border-radius:var(--r-xl);
  box-shadow:var(--shadow-pop);padding:18px 20px 20px;
  opacity:0;pointer-events:none;transform:translate(-50%,-46%) scale(.97);
  transition:opacity .2s ease, transform .22s cubic-bezier(.16,1,.3,1);
}
.sheet.on{opacity:1;transform:translate(-50%,-50%);pointer-events:auto}
.sheet-grab{display:none}
.sheet-head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:16px}
.sheet h3{font-size:var(--fs-title);font-weight:600;color:var(--ink);letter-spacing:-.02em}
.sheet p{font-size:13px;color:var(--muted);margin-top:4px;line-height:1.4}
.sheet-x{
  width:36px;height:36px;border-radius:10px;border:1px solid var(--border);
  background:var(--surface);color:var(--text-2);flex-shrink:0;
}
.sheet-actions{display:flex;gap:10px;margin-top:8px}
.sheet-actions .btn-primary,.sheet-actions .btn-secondary{flex:1}

.toast{
  position:fixed;bottom:22px;left:50%;transform:translateX(-50%) translateY(8px);
  background:var(--ink);color:var(--bg);font-size:13px;font-weight:500;
  padding:10px 17px;border-radius:11px;z-index:200;
  opacity:0;pointer-events:none;transition:all .2s ease;
}
.toast.on{opacity:1;transform:translateX(-50%)}

.dash-block{margin-bottom:22px}
.room-home-list{display:flex;flex-direction:column;gap:8px}
.room-home-card{
  display:block;width:100%;text-align:left;padding:14px 16px;border-radius:14px;
  border:1px solid var(--line);background:var(--surface);color:inherit;cursor:pointer;
}
.room-home-card.on{border-color:var(--ink);background:var(--surface-2)}
.room-home-title{font-size:15px;font-weight:600;color:var(--ink)}
.room-home-sub{font-size:12px;color:var(--muted);margin-top:4px;letter-spacing:.04em}
.progress-card{
  background:var(--surface);border:1px solid var(--border);border-radius:16px;
  padding:14px 16px;margin-bottom:10px;
}
.progress-card.muted{padding:18px 16px}
.progress-top{display:flex;align-items:center;gap:12px;margin-bottom:10px}
.progress-meta{flex:1;min-width:0}
.progress-name{font-size:13.5px;font-weight:500;color:var(--ink)}
.progress-sub{font-size:12px;color:var(--muted);margin-top:2px}
.progress-pct{font-size:13px;font-weight:500;color:var(--text-2)}
.progress-track{height:6px;border-radius:100px;background:var(--surface-3);overflow:hidden}
.progress-track i{display:block;height:100%;border-radius:100px;background:var(--ink);transition:width .25s ease}

.chat-shell{display:flex;flex-direction:column;gap:14px;min-height:360px}
.chat-row-av{
  width:40px;height:40px;border-radius:14px;flex-shrink:0;
  display:grid;place-items:center;background:var(--surface-3);color:var(--ink);
  font-size:14px;font-weight:600;
}
.chat-row-av.letter{background:var(--surface-2);border:1px solid var(--border)}
.chat-row img{flex-shrink:0}
.member-row{
  display:flex;align-items:center;gap:14px;margin-bottom:12px;padding:14px 16px;
  background:var(--surface);border:1px solid var(--border);border-radius:18px;cursor:pointer;
}
@media (hover:hover){.member-row:hover{background:var(--surface-2)}}
.member-row .btn-ghost{cursor:pointer}
.chat-row{
  display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  padding:12px;border-radius:14px;border:1px solid transparent;
}
.chat-row.on,.chat-row:active{background:var(--surface-2)}
.chat-row-av{
  width:40px;height:40px;border-radius:14px;background:var(--surface-3);
  display:grid;place-items:center;color:var(--ink);flex-shrink:0;font-size:15px;
}
.chat-row-av,.chat-row-main{background:transparent;border:none;cursor:pointer;color:inherit}
.chat-row-main{flex:1;min-width:0;text-align:left;padding:0}
.chat-row-top{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.chat-row-name{font-size:14px;font-weight:500;color:var(--ink);display:inline-flex;align-items:center;gap:5px;min-width:0}
.chat-row-code{font-size:11px;color:var(--muted);letter-spacing:.06em}
.chat-row-sub{font-size:12px;color:var(--muted);margin-top:2px}
.chat-row-side{display:flex;flex-direction:column;align-items:flex-end;gap:6px;flex-shrink:0}
.chat-row-act{
  font-size:11px;font-weight:500;color:var(--muted);padding:4px 8px;border-radius:8px;
  background:var(--surface-3);
}
.chat-list-actions{margin-top:8px;padding-top:4px}
.chat-thread-head{
  display:flex;align-items:center;gap:10px;padding:12px 4px 12px;
  border-bottom:1px solid var(--border);margin-bottom:0;flex-shrink:0;
  background:var(--bg);
}
.chat-back{
  width:38px;height:38px;border-radius:50%;border:0;
  background:transparent;color:var(--ink);flex-shrink:0;
  display:grid;place-items:center;cursor:pointer;padding:0;
}
.chat-back:active{background:color-mix(in srgb, var(--ink) 8%, transparent)}
.chat-head-profile{
  display:flex;align-items:center;gap:10px;flex:1;min-width:0;
  text-align:left;background:transparent;border:none;padding:0;color:inherit;
}
.chat-head-profile .avatar-img{width:36px;height:36px;flex-shrink:0}
.chat-thread-title{font-size:15px;font-weight:600;color:var(--ink);letter-spacing:-.02em;display:inline-flex;align-items:center;gap:5px}
.chat-thread-sub{font-size:11.5px;color:var(--muted);margin-top:2px}

.poll-card{padding:14px}
.poll-opts{display:flex;flex-direction:column;gap:8px;margin-top:12px}
.poll-opt{
  width:100%;text-align:left;padding:10px 12px;border-radius:12px;
  background:var(--surface-2);border:1px solid transparent;color:var(--ink);
  transition:border-color .15s, background .15s;
}
.poll-opt.on{border-color:var(--ink);background:var(--surface)}
.poll-opt-top{display:flex;justify-content:space-between;gap:8px;font-size:13px;font-weight:500;margin-bottom:8px}
.poll-bar{height:4px;border-radius:100px;background:var(--surface-3);overflow:hidden}
.poll-bar i{display:block;height:100%;background:var(--ink);border-radius:100px;transition:width .2s ease}

.time-range-row{display:flex;align-items:center;gap:10px}
.time-range-row input{flex:1;min-width:0}
.time-range-sep{font-size:12px;color:var(--muted);flex-shrink:0}
.invite-input{
  flex:1;min-width:0;height:40px;border-radius:12px;padding:0 12px;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
}

.cookie-bar{
  position:fixed;left:16px;right:16px;bottom:16px;z-index:45;
  max-width:420px;margin:0 auto;
  background:var(--surface);border:1px solid var(--border);border-radius:16px;
  box-shadow:var(--shadow-pop);padding:14px 16px;
  display:flex;flex-direction:column;gap:12px;
}
.cookie-bar.hidden{display:none!important}
/* A slim strip, not a card parked over the content. On phones it sits above the
   nav bar instead of on top of whatever you were reading. */
@media (min-width:901px){
  .cookie-bar{flex-direction:row;align-items:center;justify-content:space-between;max-width:640px;padding:10px 12px 10px 16px;gap:16px}
  .cookie-bar .cookie-copy{margin:0}
}
@media (max-width:900px){
  .cookie-bar{bottom:calc(env(safe-area-inset-bottom,0px) + 86px);padding:12px 14px;gap:10px}
}
.wal-credits{
  display:flex;align-items:baseline;gap:7px;flex-wrap:wrap;margin-top:12px;padding-top:12px;
  border-top:1px solid color-mix(in srgb,#fff 14%,transparent);font-size:12.5px;color:var(--muted);
}
.wal-credits b{font-size:15px;color:var(--ink);font-variant-numeric:tabular-nums}
.wal-credits i{font-style:normal;opacity:.8}
.view-broke code{display:block;margin-top:8px;font-size:11px;opacity:.7;word-break:break-all}
.cookie-copy{font-size:13px;color:var(--text-2);line-height:1.45}
.cookie-actions{display:flex;gap:8px;justify-content:flex-end}
.cookie-actions .btn-dark{width:auto;min-height:36px;padding:0 14px}

.nav-badge,.m-nav-badge{
  position:absolute;top:6px;right:10px;
  min-width:16px;height:16px;padding:0 4px;
  border-radius:100px;background:#E11D48;color:#fff;
  font-size:10px;font-weight:600;line-height:16px;text-align:center;
  pointer-events:none;
}
.m-nav-badge{top:-2px;right:2px}
.nav-badge.hidden,.m-nav-badge.hidden{display:none!important}

.avatar-img.is-photo,.m-avatar.is-photo{
  border-radius:14px;object-fit:cover;background:var(--surface-3);
}
.avatar-lg.is-photo{border-radius:18px}
.tick{color:var(--bg)}
.tick svg{display:block}

/* Profile drawer (left) — premium */
.drawer-scrim{
  position:fixed;inset:0;z-index:120;
  background:rgba(8,8,8,.42);
  backdrop-filter:blur(10px) saturate(1.1);
  -webkit-backdrop-filter:blur(10px) saturate(1.1);
  border:0;padding:0;cursor:pointer;
  opacity:0;transition:opacity .28s ease;
}
body.drawer-open .drawer-scrim{opacity:1}
.drawer-scrim[hidden]{display:none!important}
.profile-drawer{
  position:fixed;top:0;left:0;bottom:0;z-index:121;
  width:min(312px,88vw);max-width:340px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.04) 0%, transparent 28%),
    var(--surface);
  border-right:1px solid var(--border);
  transform:translateX(-105%);
  transition:transform .34s cubic-bezier(.22,1,.36,1);
  pointer-events:none;display:flex;flex-direction:column;
  padding:calc(10px + env(safe-area-inset-top)) 0 calc(10px + env(safe-area-inset-bottom));
  box-shadow:
    1px 0 0 rgba(255,255,255,.03),
    24px 0 64px rgba(0,0,0,.28);
}
html[data-mood="light"] .profile-drawer{
  background:
    linear-gradient(180deg, #fff 0%, var(--surface) 40%),
    var(--surface);
  box-shadow:
    1px 0 0 rgba(0,0,0,.04),
    20px 0 48px rgba(0,0,0,.10);
}
body.drawer-open .profile-drawer{
  transform:translateX(0);pointer-events:auto;
}
.drawer-inner{
  flex:1;overflow:auto;padding:4px 14px 18px;-webkit-overflow-scrolling:touch;
  display:flex;flex-direction:column;
}
body.drawer-open .drawer-head,
body.drawer-open .drawer-nav .drawer-item,
body.drawer-open .drawer-foot{
  animation:drawerRise .45s cubic-bezier(.22,1,.36,1) both;
}
body.drawer-open .drawer-nav .drawer-item:nth-child(1){animation-delay:.04s}
body.drawer-open .drawer-nav .drawer-item:nth-child(2){animation-delay:.07s}
body.drawer-open .drawer-nav .drawer-item:nth-child(3){animation-delay:.1s}
body.drawer-open .drawer-nav .drawer-item:nth-child(4){animation-delay:.13s}
body.drawer-open .drawer-nav .drawer-item:nth-child(5){animation-delay:.16s}
body.drawer-open .drawer-nav .drawer-item:nth-child(6){animation-delay:.19s}
body.drawer-open .drawer-nav .drawer-item:nth-child(7){animation-delay:.22s}
body.drawer-open .drawer-foot{animation-delay:.26s}
@keyframes drawerRise{
  from{opacity:0;transform:translateY(8px)}
  to{opacity:1;transform:translateY(0)}
}

.drawer-head{
  display:flex;align-items:center;gap:14px;width:100%;text-align:left;
  padding:16px 10px 18px;border:0;background:transparent;color:inherit;cursor:pointer;
  border-radius:20px;margin-bottom:6px;
}
.drawer-head:active{background:var(--surface-2)}
.drawer-av-wrap{
  width:56px;height:56px;border-radius:18px;flex-shrink:0;
  display:grid;place-items:center;
  background:var(--surface-2);
  border:1px solid var(--border);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.04);
  overflow:hidden;
}
.drawer-av-wrap img{width:44px;height:44px;object-fit:contain}
.drawer-av-wrap img.is-photo{width:100%;height:100%;object-fit:cover;border-radius:17px}
.drawer-head-meta{min-width:0;flex:1}
.drawer-head-t{
  font-size:17px;font-weight:650;color:var(--ink);
  letter-spacing:-.03em;line-height:1.2;
}
.drawer-head-d{
  display:flex;align-items:center;flex-wrap:wrap;gap:6px;
  font-size:13px;color:var(--muted);margin-top:4px;
}
.drawer-plan-chip{
  display:inline-flex;align-items:center;
  font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  padding:3px 7px;border-radius:100px;line-height:1;
}
.drawer-plan-chip.plan-pro{
  color:#0A66C2;background:rgba(29,155,240,.14);border:1px solid rgba(29,155,240,.32);
}
.drawer-plan-chip.plan-pod{
  color:#C43A8C;background:rgba(255,81,191,.14);border:1px solid rgba(255,81,191,.32);
}
html[data-mood="dark"] .drawer-plan-chip.plan-pro{color:#4AA3F0}
html[data-mood="dark"] .drawer-plan-chip.plan-pod{color:#FF7AD0}

.theme-picker-profile{
  padding:4px 0 8px;
}
.theme-picker-label{
  font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  color:var(--muted);margin:12px 2px 8px;
}
/* Segmented pill mood control */
.theme-mood{
  display:grid;grid-template-columns:1fr 1fr 1fr;gap:4px;
  padding:4px;border-radius:14px;
  background:color-mix(in srgb, var(--ink) 9%, var(--surface-2));
}
.theme-mood-btn{
  min-height:38px;border-radius:11px;border:0;
  background:transparent;color:var(--text-2);font:inherit;font-size:13.5px;font-weight:650;
  cursor:pointer;transition:background .16s ease,color .16s ease;
}
.theme-mood-btn.on{
  background:var(--surface);color:var(--ink);
  box-shadow:0 2px 6px rgba(0,0,0,.18), 0 0 0 .5px rgba(0,0,0,.05);
}
.theme-color-row{
  display:flex;flex-wrap:wrap;gap:12px;padding:2px 0 4px;
}
.theme-color{
  width:38px;height:38px;border-radius:50%;border:0;
  background:var(--sw,#ccc);cursor:pointer;padding:0;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);
  transition:transform .12s ease;
}
.theme-color:active{transform:scale(.94)}
.theme-color.on{box-shadow:0 0 0 2px var(--bg), 0 0 0 4px var(--ink)}
.theme-color.is-locked{opacity:.4}

.pack-grid.is-locked{opacity:.55}
.free-feats{margin:0 0 18px;padding:0;list-style:none}
.free-feats li{display:flex;gap:8px;align-items:flex-start;font-size:13px;color:var(--text);margin-bottom:8px}
.person-actions{padding:4px 8px 18px}
.person-actions-head{display:flex;align-items:center;gap:12px;padding:4px 8px 14px}
.person-actions-t{font-size:16px;font-weight:700;color:var(--ink)}
.person-actions-d{font-size:12px;color:var(--muted);margin-top:2px}
.person-act{
  width:100%;min-height:48px;border:1px solid var(--border);border-radius:14px;
  background:var(--surface);color:var(--ink);font:inherit;font-size:14px;font-weight:600;
  text-align:left;padding:0 16px;margin-bottom:8px;cursor:pointer;
}
.person-act.is-muted{color:var(--muted);font-weight:500}
.person-act:active{transform:scale(.99)}

.drawer-nav{display:flex;flex-direction:column;gap:2px;flex:1;padding:4px 0 8px}
.drawer-sep{
  height:1px;margin:10px 8px;background:var(--border);opacity:.9;
}
.drawer-item{
  display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  padding:11px 10px;border:0;background:transparent;color:var(--ink);
  font:inherit;font-size:15px;font-weight:500;border-radius:14px;cursor:pointer;
  transition:background .15s ease;
}
.drawer-item > span:not(.drawer-ic){flex:1;letter-spacing:-.015em;text-align:left}
.drawer-item:active{background:var(--surface-2)}
@media (hover:hover){
  .drawer-item:hover{background:var(--surface-2)}
}
.drawer-ic{
  width:34px;height:34px;border-radius:11px;flex-shrink:0;
  display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--border);
  color:var(--ink);
}
.drawer-ic svg{display:block;opacity:.82}
.drawer-chev{flex-shrink:0;color:var(--faint);opacity:.7}
/* MYL-01 - pending join requests (markup existed, styles never did) */
.drawer-reqs{
  margin:2px 0 14px;padding:12px;border-radius:14px;
  background:var(--surface-2);border:1px solid var(--border);
}
.drawer-reqs[hidden]{display:none}
.drawer-reqs-h{
  font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);margin-bottom:10px;
}
.drawer-req{display:flex;flex-direction:column;gap:9px;padding:9px 0;border-top:1px solid var(--border)}
.drawer-req:first-child{border-top:0;padding-top:0}
.drawer-req-meta{display:flex;flex-direction:column;gap:1px;min-width:0}
.drawer-req-meta strong{
  font-size:14px;font-weight:600;color:var(--ink);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.drawer-req-meta span{font-size:12px;color:var(--muted)}
.drawer-req-actions{display:flex;gap:8px}
.drawer-req-actions .btn-dark,
.drawer-req-actions .btn-ghost{flex:1;min-height:38px;padding:0 12px;font-size:13.5px;border-radius:10px}
.drawer-req-empty{font-size:13px;color:var(--muted);padding:2px 0}
.drawer-foot{margin-top:auto;padding:10px 0 0;border-top:1px solid var(--border)}
.drawer-room-pill{
  display:flex;align-items:center;gap:8px;
  font-size:12px;color:var(--muted);padding:10px 12px 8px;overflow:hidden;
  text-overflow:ellipsis;white-space:nowrap;
}
.drawer-room-dot{
  width:6px;height:6px;border-radius:50%;background:#22C55E;flex-shrink:0;
  box-shadow:0 0 0 3px rgba(34,197,94,.15);
}
.drawer-item.is-danger{color:#E11D48}
.drawer-item.is-danger .drawer-ic{
  color:#E11D48;border-color:rgba(225,29,72,.2);background:rgba(225,29,72,.08);
}

.name-badge-row{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:100%}
.name-badge-row > span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.plan-badge{width:15px;height:15px;flex-shrink:0;display:block;filter:drop-shadow(0 1px 1px rgba(0,0,0,.2))}
.drawer-head .plan-badge{width:16px;height:16px}
.mylo-verify{
  width:14px;height:14px;flex-shrink:0;display:inline-block;vertical-align:middle;
  margin-left:4px;color:var(--ink);
  background:currentColor;
  -webkit-mask:url('../assets/mylo-badge.svg') center / contain no-repeat;
  mask:url('../assets/mylo-badge.svg') center / contain no-repeat;
}
.chat-row-name .plan-badge,
.chat-thread-title .plan-badge,
.chat-thread-title .mylo-verify,
.msg-name .plan-badge{width:14px;height:14px}
.chat-row-face{
  width:40px;height:40px;border-radius:12px;object-fit:cover;object-position:center 18%;
  border:1px solid var(--border);flex-shrink:0;background:#E8EDF2;
}

/* Layered avatar stacks */
.avatar-stack, .avatar-slot{
  position:relative;display:inline-grid;place-items:center;
  width:40px;height:40px;vertical-align:middle;overflow:hidden;
  border-radius:12px;                /* matches .chat-row-face, i.e. Mylo */
  flex-shrink:0;
}
.avatar-stack > img, .avatar-slot > img, .avatar-layer{
  grid-area:1 / 1;width:100%;height:100%;object-fit:contain;display:block;pointer-events:none;
}
.avatar-layer-base{
  grid-area:1 / 1;width:100%;height:100%;display:block;
  background:var(--av-color, #C8381E);
  -webkit-mask-size:contain;-webkit-mask-repeat:no-repeat;-webkit-mask-position:center;
  mask-size:contain;mask-repeat:no-repeat;mask-position:center;
}
.avatar-slot.is-photo > img, .avatar-stack.is-photo > img,
.avatar-img.is-photo{object-fit:cover;border-radius:inherit}
.avatar-md, .avatar-stack.avatar-md{width:44px;height:44px}
.avatar-lg, .avatar-stack.avatar-lg{width:64px;height:64px}
.avatar-40, .avatar-stack.avatar-40{width:40px;height:40px}
.drawer-av, .avatar-stack.drawer-av{width:44px;height:44px}
.desk-settings-face, .avatar-stack.desk-settings-face{width:68px;height:68px}
.m-avatar.avatar-slot{
  width:32px;height:32px;border-radius:50%;
  box-shadow:0 0 0 1.5px color-mix(in srgb, var(--ink) 22%, transparent);
}
.m-avatar.avatar-slot.is-photo{border-radius:50%}
.m-avatar.avatar-slot.is-photo > img{border-radius:50%;object-fit:cover}
html[data-mood="dark"] .m-avatar.avatar-slot{
  box-shadow:0 0 0 1.5px color-mix(in srgb, #fff 35%, transparent);
}
.who .avatar-slot{width:36px;height:36px}
.drawer-av-wrap .avatar-stack,
.drawer-av-wrap > .avatar-img{width:44px;height:44px}

/* Premium private profile */
.m-profile-screen.active{position:relative;z-index:30}
.profile-back-row{display:flex;align-items:center;gap:8px;margin:0 0 8px}
.profile-private-tag{
  font-size:10px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  color:var(--muted);background:var(--surface-2);border:1px solid var(--border);
  border-radius:100px;padding:5px 10px;
}
.profile-panel-kicker{
  font-size:14px;font-weight:650;letter-spacing:-.02em;color:var(--ink);flex:1;text-align:center;
}
.profile-panel-hero{margin:8px 0 18px}
.profile-panel-title{
  font-size:22px;font-weight:700;letter-spacing:-.035em;color:var(--ink);margin-bottom:6px;
}
.setting-card-quiet{background:transparent;border:0;box-shadow:none;padding:0}

/* Mobile: Snapchat-minimal profile */
.duo-profile{
  margin:0 calc(-1 * var(--gutter)) -32px;
  min-height:calc(100dvh - env(safe-area-inset-bottom));
  background:var(--bg);
  display:flex;flex-direction:column;
  color:var(--ink);
}
.duo-hero{
  position:relative;
  padding:0 20px 4px;
  background:linear-gradient(180deg, var(--surface-2) 0%, var(--bg) 62%);
}
html[data-mood="dark"] .duo-hero,
.duo-profile[data-profile-theme$="-dark"] .duo-hero,
html[data-theme$="-dark"] .duo-hero{
  background:linear-gradient(180deg, var(--surface) 0%, var(--bg) 62%);
}
/* Snapchat-style tappable cover */
.duo-cover{
  position:absolute;top:0;left:0;right:0;height:112px;
  border:0;padding:0;margin:0;pointer-events:none;display:block;
  background-size:cover;background-position:center;
  border-radius:0;
  box-shadow:inset 0 -48px 48px -36px rgba(0,0,0,.22);
}
.duo-cover[disabled]{cursor:default}
.duo-hero-bar{
  position:relative;z-index:2;
  display:flex;align-items:center;justify-content:space-between;
  min-height:48px;margin-bottom:0;padding-top:4px;
}
.duo-hero-actions{display:flex;gap:4px}
.duo-ico,.duo-back{
  width:36px;height:36px;border:0;border-radius:50%;background:transparent;
  color:var(--ink);display:grid;place-items:center;cursor:pointer;padding:0;
}
.duo-ico-onCover{
  color:#fff;background:rgba(0,0,0,.28);backdrop-filter:blur(8px);
}
.duo-ico:active{background:color-mix(in srgb, var(--ink) 8%, transparent)}
.duo-ico-onCover:active{background:rgba(0,0,0,.4)}
.duo-ico-spacer{width:36px;height:36px}
.duo-av-ring{
  width:68px;height:68px;border-radius:50%;
  border:0;background:transparent;
  display:grid;place-items:center;padding:0;
  position:relative;overflow:visible;
}
.duo-av-stage{
  position:relative;width:68px;height:68px;margin:36px auto 12px;
  border:0;background:transparent;padding:0;
}
.duo-av-stage.is-tap{cursor:pointer}
.duo-av-stage.is-tap:active{transform:scale(.97)}
.duo-av-core{
  width:100%;height:100%;border-radius:50%;overflow:hidden;
  display:grid;place-items:center;
  background:var(--surface);
  box-shadow:0 0 0 3px var(--bg), 0 6px 18px -8px rgba(0,0,0,.28);
}
.duo-av-ring.has-face .duo-av-core{
  background:#E8EDF2;
}
html[data-mood="dark"] .duo-av-ring.has-face .duo-av-core{
  background:#2C3238;
}
.duo-av-ring.has-photo .duo-av-core{
  box-shadow:0 0 0 3px var(--bg), 0 6px 18px -8px rgba(0,0,0,.28);
}
.duo-av-char{
  width:100%;height:100%;object-fit:cover;object-position:center 12%;display:block;
  transform:scale(1.05);transform-origin:50% 18%;
  background:transparent;
}
.duo-av-stack{
  width:100%;height:100%;border-radius:50%;
  transform:scale(.88) translateY(2%);
  transform-origin:center 30%;
}
.look-preview .look-preview-stack .avatar-layer,
.look-preview .look-preview-stack .avatar-layer-base{
  transform:scale(1.05) translateY(2%);
  transform-origin:center 28%;
}
.desk-look-preview.is-head .avatar-layer,
.desk-look-preview.is-head .avatar-layer-base{
  transform:scale(1.08) translateY(2%);
  transform-origin:center 28%;
}
.look-preview-suit{
  width:min(200px,52vw);height:min(200px,52vw);
  object-fit:cover;object-position:center 12%;
  transform:scale(1.05);transform-origin:center 18%;
  filter:drop-shadow(0 16px 28px rgba(0,0,0,.14));
}
.avatar-img,.m-avatar{
  width:36px;height:36px;border-radius:12px;object-fit:cover;object-position:center 14%;
  background:#E8EDF2;flex-shrink:0;
}
.duo-av-photo{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
.duo-id{text-align:center;margin:0;position:relative;z-index:2}
.duo-bio{font-size:14px;color:var(--text-2);line-height:1.45;margin:8px auto 0;max-width:300px;white-space:pre-wrap;word-break:break-word}
.duo-bio.is-empty{color:var(--muted)}
.duo-name{
  font-size:20px;font-weight:700;letter-spacing:-.03em;color:var(--ink);line-height:1.2;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
}
.duo-name .name-badge-row{justify-content:center}
.duo-user{font-size:13.5px;font-weight:500;color:var(--muted);margin-top:3px}
.duo-cta-row{
  display:flex;gap:8px;
  padding:16px 0 0;margin:0;
}
.duo-cta{
  flex:1;min-height:40px;padding:0 12px;border-radius:10px;border:0;
  background:color-mix(in srgb, var(--ink) 9%, transparent);
  color:var(--ink);font:inherit;font-size:14px;font-weight:650;letter-spacing:-.01em;
  cursor:pointer;
}
.duo-cta.is-soft{background:color-mix(in srgb, var(--ink) 9%, transparent);color:var(--ink);font-weight:650}
.duo-cta:active{transform:scale(.985);opacity:.88}
.duo-body{
  flex:1;padding:24px 20px 40px;
  background:var(--bg);
}

/* Full-page Edit profile.
   Every separator here is a row's own border-bottom — never add a border-top to a
   group as well, or the gap between the two renders as a double hairline. */
.edit-head{
  display:grid;grid-template-columns:48px 1fr 48px;align-items:center;
  margin:0 0 4px;padding:0;min-height:48px;
}
.edit-head .duo-ico{grid-column:1;justify-self:start;margin-left:-8px}
.edit-head .acct-title{grid-column:2;text-align:center;font-size:16px}
.edit-done{
  grid-column:3;justify-self:end;
  min-width:48px;min-height:44px;padding:0;border:0;background:transparent;
  color:var(--ink);font:inherit;font-size:15px;font-weight:700;cursor:pointer;text-align:right;
}
.edit-done:active{opacity:.6}
.edit-av-btn{
  display:flex;flex-direction:column;align-items:center;gap:8px;
  width:100%;border:0;background:transparent;padding:16px 0 24px;cursor:pointer;color:inherit;
}
.edit-av-ring{
  width:88px;height:88px;border-radius:50%;overflow:hidden;
  background:#E8EDF2;border:1px solid var(--border);
  display:grid;place-items:center;
}
.edit-av-ring img,.edit-av-ring .avatar-stack{
  width:100%;height:100%;object-fit:cover;object-position:center 14%;
}
.edit-av-label{font-size:14px;font-weight:650;color:var(--ink)}
.edit-av-btn:active .edit-av-ring{transform:scale(.97)}
.edit-fields,.edit-links{display:flex;flex-direction:column}
.edit-field{
  display:grid;grid-template-columns:84px 1fr;gap:14px;align-items:center;
  min-height:52px;padding:12px 0;border-bottom:1px solid var(--border);
}
.edit-field.is-bio{align-items:start}
.edit-k{font-size:15px;font-weight:600;color:var(--ink);line-height:1.4}
/* 16px minimum, otherwise iOS zooms the whole page when the field takes focus. */
.edit-field input,.edit-field textarea{
  width:100%;border:0;background:transparent;color:var(--ink);font:inherit;
  font-size:16px;padding:0;outline:none;resize:none;line-height:1.4;
}
.edit-field textarea{min-height:66px}
.edit-field input::placeholder,.edit-field textarea::placeholder{color:var(--muted)}
.edit-field input:disabled{color:var(--muted);-webkit-text-fill-color:var(--muted);opacity:1}
.edit-links{margin-top:24px}
.edit-link-row{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  width:100%;min-height:52px;padding:0;
  border:0;border-bottom:1px solid var(--border);
  background:transparent;color:var(--ink);font:inherit;font-size:15px;font-weight:600;cursor:pointer;
  text-align:left;
}
.edit-link-row:active{opacity:.6}
.edit-link-row svg{color:var(--muted);flex-shrink:0}
.duo-meta{
  display:flex;flex-wrap:wrap;gap:8px;justify-content:center;
  padding:2px 0 14px;
}
.duo-meta-pill{
  display:inline-flex;align-items:baseline;gap:4px;
  min-height:28px;padding:0 11px;border-radius:100px;
  background:var(--surface);border:1px solid var(--border);
  font-size:12px;font-weight:500;color:var(--muted);
}
.duo-meta-n{font-weight:700;color:var(--ink);font-size:13px}
.duo-sec-d{font-size:12px;color:var(--muted);margin:-4px 0 10px;line-height:1.4}
.duo-theme-card{
  background:var(--surface);border:1px solid var(--border);border-radius:16px;
  padding:8px 12px 14px;margin-bottom:12px;
}
.duo-chips{
  display:flex;flex-wrap:nowrap;gap:8px;overflow-x:auto;
  -webkit-overflow-scrolling:touch;padding:2px 0 14px;
  scrollbar-width:none;
}
.duo-chips::-webkit-scrollbar{display:none}
.duo-chip{
  flex:0 0 auto;display:inline-flex;align-items:center;gap:5px;
  min-height:28px;padding:0 10px;border-radius:100px;
  background:var(--surface);border:1px solid var(--border);
  font-size:12px;font-weight:650;color:var(--ink);
}
.duo-chip-ic{font-size:12px;line-height:1}
.duo-plan-card,.duo-row-card,.duo-nudge,.acct-banner{
  width:100%;display:flex;align-items:center;gap:12px;text-align:left;
  min-height:64px;padding:12px 14px;margin-bottom:10px;
  border-radius:18px;border:1px solid var(--border);
  background:var(--surface);color:inherit;font:inherit;cursor:pointer;
}
.duo-plan-card.is-pro,.duo-plan-card.is-pod{border-color:var(--border)}
.duo-rows{margin-top:4px}
.duo-rows .duo-row-card{margin-bottom:8px}
/* Clean stat strip */
.duo-stats{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;padding:0 0 18px;max-width:100%;
}
.duo-stat{
  min-width:0;display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:12px 6px;border-radius:14px;background:var(--surface);border:1px solid var(--border);
}
.duo-stat-ic{display:grid;place-items:center;height:18px;margin-bottom:1px}
.duo-stat-n{font-size:18px;font-weight:700;letter-spacing:-.03em;color:var(--ink);line-height:1.1}
.duo-stat-l{font-size:11px;font-weight:550;color:var(--muted)}
/* Section header with an inline control (e.g. badges toggle) */
.duo-sec-row{display:flex;align-items:center;justify-content:space-between;margin:18px 0 10px}
.duo-sec-row .duo-sec-h{margin:0}
/* iOS-style switch */
.duo-switch{
  width:46px;height:28px;border-radius:100px;border:0;flex-shrink:0;cursor:pointer;padding:0;
  background:color-mix(in srgb, var(--ink) 16%, transparent);position:relative;transition:background .18s ease;
}
.duo-switch.on{background:#34C759}
.duo-switch-dot{
  position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .18s ease;
}
.duo-switch.on .duo-switch-dot{transform:translateX(18px)}
.duo-plan-mark{
  width:36px;height:36px;border-radius:10px;flex-shrink:0;
  display:grid;place-items:center;font-size:12px;font-weight:800;
  background:#111;color:#fff;
}
html[data-mood="dark"] .duo-plan-mark{background:#EDEDED;color:#111}
.duo-plan-badge{width:28px;height:28px;flex-shrink:0}
.duo-plan-copy,.duo-row-copy,.acct-row-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.duo-plan-t,.duo-row-t,.duo-nudge-t,.acct-row-t{font-size:15px;font-weight:650;color:var(--ink);letter-spacing:-.02em}
.duo-plan-d,.duo-row-d,.duo-nudge-d,.acct-row-d{font-size:12px;font-weight:500;color:var(--muted)}
.duo-row-chev{flex-shrink:0;color:var(--faint)}
.duo-row-ic{
  width:36px;height:36px;border-radius:11px;flex-shrink:0;
  display:grid;place-items:center;
}
.duo-row-ic-token{
  display:grid;place-items:center;background:var(--surface-2);color:var(--ink);border:1px solid var(--border);
}
.duo-nudge{background:var(--surface-2)}
.duo-sec-h{
  font-size:15px;font-weight:700;letter-spacing:-.02em;color:var(--ink);
  margin:18px 0 10px;
}
.badge-rail{
  display:flex;gap:10px;overflow-x:auto;-webkit-overflow-scrolling:touch;
  padding:2px 0 8px;scrollbar-width:none;
}
.badge-rail::-webkit-scrollbar{display:none}
.badge-tile{
  flex:0 0 108px;width:108px;border:0;background:var(--surface);
  border-radius:16px;padding:12px 10px 10px;cursor:pointer;font:inherit;
  display:flex;flex-direction:column;align-items:center;gap:8px;
  box-shadow:0 1px 0 rgba(0,0,0,.04);opacity:.42;
}
.badge-tile.is-earned{opacity:1}
.badge-tile.is-pinned{box-shadow:0 0 0 1.5px var(--ink)}
.badge-tile-art{position:relative;width:56px;height:56px;display:grid;place-items:center}
.badge-tile-art img{width:52px;height:52px;display:block}
.badge-tile-new{
  position:absolute;top:-4px;right:-10px;z-index:1;
  font-size:9px;font-weight:800;letter-spacing:.04em;
  background:#1D9BF0;color:#fff;border-radius:100px;padding:2px 5px;
}
.badge-tile-t{
  font-size:11px;font-weight:600;color:#1D9BF0;text-align:center;line-height:1.25;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;
  max-width:100%;
}
html[data-mood="dark"] .badge-tile-t{color:#4AA3F0}
.duo-nick{margin-top:16px}

/* Settings / My account pages */
.acct-page{padding:0 0 28px}
.acct-head{
  display:flex;align-items:center;justify-content:space-between;
  margin:0 0 12px;min-height:44px;
}
.acct-title{font-size:17px;font-weight:700;letter-spacing:-.02em;color:var(--ink)}
.acct-lead{
  font-size:12px;line-height:1.45;color:var(--muted);margin:0 0 14px;
}
.acct-sec{
  font-size:13px;font-weight:700;color:var(--ink);margin:18px 0 8px;
}
.acct-list{
  background:var(--surface);border-radius:16px;border:1px solid var(--border);
  overflow:hidden;
}
.acct-row{
  width:100%;display:flex;align-items:center;gap:12px;text-align:left;
  padding:14px 14px;border:0;border-bottom:1px solid var(--border);
  background:transparent;color:inherit;font:inherit;cursor:pointer;
}
.acct-row:last-child{border-bottom:0}
.acct-card{
  background:var(--surface);border:1px solid var(--border);border-radius:16px;
  padding:8px 12px 14px;
}
/* Cover editor */
.cover-editor{padding:12px}
.cover-preview{height:64px;border-radius:12px;margin-bottom:12px;box-shadow:inset 0 0 0 1px rgba(0,0,0,.06)}
.cover-label{font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted);margin:10px 2px 8px}
.cover-swatches{display:flex;flex-wrap:wrap;gap:10px}
.cover-sw{
  width:44px;height:32px;border-radius:10px;border:0;cursor:pointer;padding:0;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.1);transition:transform .12s ease;
}
.cover-sw.is-solid{width:32px}
.cover-sw:active{transform:scale(.93)}
.cover-sw.on{box-shadow:0 0 0 2px var(--bg), 0 0 0 4px var(--ink)}
.cover-actions{display:flex;gap:8px;margin-top:14px}
.cover-actions .btn-ghost{flex:1;min-height:40px}
.acct-banner{
  background:linear-gradient(90deg,#F5C542 0%,#E8A838 100%);
  border:0;color:#111;margin-bottom:8px;
}
.acct-banner .duo-plan-t,.acct-banner .duo-plan-d{color:#111}
.acct-banner .duo-plan-d{opacity:.75}
.acct-banner .duo-plan-mark{background:#111;color:#F5C542}
.acct-banner .duo-row-chev{color:rgba(0,0,0,.45)}
.acct-security-card{padding:14px}
.acct-pill-on{
  flex-shrink:0;font-size:12px;font-weight:600;color:var(--done);
  padding:6px 10px;border-radius:100px;
  background:color-mix(in srgb, var(--done) 14%, transparent);
}

/* Profile-only theme tint when viewing someone else.
   Same rule as the chat themes below: no self-referencing fallbacks. Safari
   treats `--x:var(--y, var(--x))` as a cycle and drops the property entirely,
   which blanks every background in the subtree. If a --p-* is missing the
   custom property just inherits, which is the behaviour we want anyway. */
.duo-profile[data-profile-theme]{
  --bg:var(--p-bg);
  --surface:var(--p-surface);
  --surface-2:var(--p-surface-2);
  --surface-3:var(--p-surface-3);
  --border:var(--p-border);
  --ink:var(--p-ink);
  --muted:var(--p-muted);
  background:var(--bg);
}
.duo-profile[data-profile-theme="rose"]{--p-bg:#FFF5F7;--p-surface:#fff;--p-surface-2:#FFE8EE;--p-surface-3:#FFD6E0;--p-border:#F5C2D0;--p-ink:#3B0A1A;--p-muted:#A86B7E}
.duo-profile[data-profile-theme="rose-dark"]{--p-bg:#1A0810;--p-surface:#2A0E18;--p-surface-2:#3A1422;--p-surface-3:#4A1A2C;--p-border:#5C2438;--p-ink:#FFE4EC;--p-muted:#B06B80}
.duo-profile[data-profile-theme="mint"]{--p-bg:#F3FBF7;--p-surface:#fff;--p-surface-2:#E6F7EF;--p-surface-3:#D4F0E3;--p-border:#B7E0CC;--p-ink:#0B2E22;--p-muted:#6A9080}
.duo-profile[data-profile-theme="mint-dark"]{--p-bg:#061812;--p-surface:#0C241C;--p-surface-2:#143028;--p-surface-3:#1C3C32;--p-border:#2A5244;--p-ink:#D8F5EA;--p-muted:#5A9078}
.duo-profile[data-profile-theme="ocean"]{--p-bg:#F3F8FC;--p-surface:#fff;--p-surface-2:#E6F0F8;--p-surface-3:#D4E6F4;--p-border:#B5D0E8;--p-ink:#0B1F33;--p-muted:#6A8098}
.duo-profile[data-profile-theme="ocean-dark"]{--p-bg:#060E18;--p-surface:#0C1828;--p-surface-2:#142438;--p-surface-3:#1C3048;--p-border:#2A4460;--p-ink:#D8EAF8;--p-muted:#5A7898}
.duo-profile[data-profile-theme="sand"]{--p-bg:#FBF7F1;--p-surface:#fff;--p-surface-2:#F3EBE0;--p-surface-3:#EADCCB;--p-border:#DCC9B0;--p-ink:#2A1C0C;--p-muted:#8F7A5A}
.duo-profile[data-profile-theme="sand-dark"]{--p-bg:#120E08;--p-surface:#1C160E;--p-surface-2:#282014;--p-surface-3:#342A1A;--p-border:#4A3C28;--p-ink:#F5EAD8;--p-muted:#8F7A5A}
.duo-profile[data-profile-theme="violet"]{--p-bg:#F7F4FE;--p-surface:#fff;--p-surface-2:#EEE8FC;--p-surface-3:#E2D8FA;--p-border:#C9B8F0;--p-ink:#1E1035;--p-muted:#8670A8}
.duo-profile[data-profile-theme="violet-dark"]{--p-bg:#0E0818;--p-surface:#180F28;--p-surface-2:#241838;--p-surface-3:#302048;--p-border:#463060;--p-ink:#EDE4FF;--p-muted:#7A68A0}
.duo-profile[data-profile-theme="coral"]{--p-bg:#FFF5F4;--p-surface:#fff;--p-surface-2:#FFE8E6;--p-surface-3:#FFD6D2;--p-border:#F5C0BA;--p-ink:#3F1018;--p-muted:#A86B72}
.duo-profile[data-profile-theme="coral-dark"]{--p-bg:#18080A;--p-surface:#280E12;--p-surface-2:#38141A;--p-surface-3:#481A22;--p-border:#5C2830;--p-ink:#FFE4E6;--p-muted:#B06B72}

/* Chat theme (Pro) — scoped to chat screen */
/* NOTE: never write --bg:var(--c-bg, var(--bg)) here. A custom property that
   references itself (even in the fallback) is a cycle, so the whole chat
   subtree loses --bg/--ink/--surface-* and bubbles render transparent. */
#m-chat[data-chat-theme],
#m-chat .chat[data-chat-theme],
.chat-pane[data-chat-theme],
#view .chat[data-chat-theme],
#view .chat-shell[data-chat-theme]{
  --bg:var(--c-bg);
  --surface:var(--c-surface);
  --surface-2:var(--c-surface-2);
  --surface-3:var(--c-surface-3, color-mix(in srgb, var(--c-surface-2) 88%, var(--c-ink)));
  --border:var(--c-border);
  --border-2:var(--c-border);
  --ink:var(--c-ink);
  --muted:var(--c-muted);
  --text-2:color-mix(in srgb, var(--c-ink) 72%, transparent);
  --faint:color-mix(in srgb, var(--c-ink) 45%, transparent);
  --bubble-in:var(--c-surface-3, color-mix(in srgb, var(--c-surface-2) 88%, var(--c-ink)));
  --bubble-in-ink:var(--c-ink);
  --bubble-line:color-mix(in srgb, var(--c-ink) 9%, transparent);
  --chat-ctl:var(--c-surface-2);
  background:var(--bg);
  color:var(--ink);
}
#m-chat[data-chat-theme="rose"],.chat-pane[data-chat-theme="rose"],#view .chat[data-chat-theme="rose"],#view .chat-shell[data-chat-theme="rose"]{--c-bg:#FFF5F7;--c-surface:#fff;--c-surface-2:#FFE8EE;--c-border:#F5C2D0;--c-ink:#3B0A1A;--c-muted:#A86B7E}
#m-chat[data-chat-theme="rose-dark"],.chat-pane[data-chat-theme="rose-dark"],#view .chat[data-chat-theme="rose-dark"],#view .chat-shell[data-chat-theme="rose-dark"]{--c-bg:#1A0810;--c-surface:#2A0E18;--c-surface-2:#3A1422;--c-border:#5C2438;--c-ink:#FFE4EC;--c-muted:#B06B80}
#m-chat[data-chat-theme="mint"],.chat-pane[data-chat-theme="mint"],#view .chat[data-chat-theme="mint"],#view .chat-shell[data-chat-theme="mint"]{--c-bg:#F3FBF7;--c-surface:#fff;--c-surface-2:#E6F7EF;--c-border:#B7E0CC;--c-ink:#0B2E22;--c-muted:#6A9080}
#m-chat[data-chat-theme="mint-dark"],.chat-pane[data-chat-theme="mint-dark"],#view .chat[data-chat-theme="mint-dark"],#view .chat-shell[data-chat-theme="mint-dark"]{--c-bg:#061812;--c-surface:#0C241C;--c-surface-2:#143028;--c-border:#2A5244;--c-ink:#D8F5EA;--c-muted:#5A9078}
#m-chat[data-chat-theme="ocean"],.chat-pane[data-chat-theme="ocean"],#view .chat[data-chat-theme="ocean"],#view .chat-shell[data-chat-theme="ocean"]{--c-bg:#F3F8FC;--c-surface:#fff;--c-surface-2:#E6F0F8;--c-border:#B5D0E8;--c-ink:#0B1F33;--c-muted:#6A8098}
#m-chat[data-chat-theme="ocean-dark"],.chat-pane[data-chat-theme="ocean-dark"],#view .chat[data-chat-theme="ocean-dark"],#view .chat-shell[data-chat-theme="ocean-dark"]{--c-bg:#060E18;--c-surface:#0C1828;--c-surface-2:#142438;--c-border:#2A4460;--c-ink:#D8EAF8;--c-muted:#5A7898}
#m-chat[data-chat-theme="sand"],.chat-pane[data-chat-theme="sand"],#view .chat[data-chat-theme="sand"],#view .chat-shell[data-chat-theme="sand"]{--c-bg:#FBF7F1;--c-surface:#fff;--c-surface-2:#F3EBE0;--c-border:#DCC9B0;--c-ink:#2A1C0C;--c-muted:#8F7A5A}
#m-chat[data-chat-theme="sand-dark"],.chat-pane[data-chat-theme="sand-dark"],#view .chat[data-chat-theme="sand-dark"],#view .chat-shell[data-chat-theme="sand-dark"]{--c-bg:#120E08;--c-surface:#1C160E;--c-surface-2:#282014;--c-border:#4A3C28;--c-ink:#F5EAD8;--c-muted:#8F7A5A}
#m-chat[data-chat-theme="violet"],.chat-pane[data-chat-theme="violet"],#view .chat[data-chat-theme="violet"],#view .chat-shell[data-chat-theme="violet"]{--c-bg:#F7F4FE;--c-surface:#fff;--c-surface-2:#EEE8FC;--c-border:#C9B8F0;--c-ink:#1E1035;--c-muted:#8670A8}
#m-chat[data-chat-theme="violet-dark"],.chat-pane[data-chat-theme="violet-dark"],#view .chat[data-chat-theme="violet-dark"],#view .chat-shell[data-chat-theme="violet-dark"]{--c-bg:#0E0818;--c-surface:#180F28;--c-surface-2:#241838;--c-border:#463060;--c-ink:#EDE4FF;--c-muted:#7A68A0}
#m-chat[data-chat-theme="coral"],.chat-pane[data-chat-theme="coral"],#view .chat[data-chat-theme="coral"],#view .chat-shell[data-chat-theme="coral"]{--c-bg:#FFF5F4;--c-surface:#fff;--c-surface-2:#FFE8E6;--c-border:#F5C0BA;--c-ink:#3F1018;--c-muted:#A86B72}
#m-chat[data-chat-theme="coral-dark"],.chat-pane[data-chat-theme="coral-dark"],#view .chat[data-chat-theme="coral-dark"],#view .chat-shell[data-chat-theme="coral-dark"]{--c-bg:#18080A;--c-surface:#280E12;--c-surface-2:#38141A;--c-border:#5C2830;--c-ink:#FFE4E6;--c-muted:#B06B72}
#m-chat[data-chat-theme="dark"],.chat-pane[data-chat-theme="dark"],#view .chat[data-chat-theme="dark"],#view .chat-shell[data-chat-theme="dark"],
#m-chat .chat[data-chat-theme="dark"]{--c-bg:#111;--c-surface:#1A1A1A;--c-surface-2:#222;--c-surface-3:#2A2A2A;--c-border:#2F2F2F;--c-ink:#F5F5F5;--c-muted:#8C8C8C}
#m-chat[data-chat-theme="light"],.chat-pane[data-chat-theme="light"],#view .chat[data-chat-theme="light"],#view .chat-shell[data-chat-theme="light"],
#m-chat .chat[data-chat-theme="light"]{--c-bg:#FAFAFA;--c-surface:#FFFFFF;--c-surface-2:#F3F3F3;--c-surface-3:#ECECEC;--c-border:#E5E5E5;--c-ink:#171717;--c-muted:#737373}

#m-chat[data-chat-theme] .chat,
#m-chat[data-chat-theme] .chat-bar,
#m-chat .chat[data-chat-theme],
#m-chat .chat[data-chat-theme] .chat-bar{
  background:var(--bg);
  border-color:var(--border);
  color:var(--ink);
}
#m-chat[data-chat-theme] .chat-plus,
#m-chat .chat[data-chat-theme] .chat-plus{
  background:var(--surface-2);color:var(--ink);border-color:var(--border);
}
#m-chat[data-chat-theme] .chat-field,
#m-chat .chat[data-chat-theme] .chat-field{
  background:var(--surface-2);border-color:var(--border);
}
#m-chat[data-chat-theme] .chat-in,
#m-chat .chat[data-chat-theme] .chat-in{color:var(--ink)}
#m-chat[data-chat-theme] .chat-thread-title,
#m-chat .chat[data-chat-theme] .chat-thread-title{color:var(--ink)}
#m-chat[data-chat-theme] .chat-thread-sub,
#m-chat .chat[data-chat-theme] .chat-thread-sub{color:var(--muted)}

/* Achievement pin — edge of profile photo (not the Pro/Pod tick) */
.ach-pin{
  position:absolute;right:-2px;bottom:2px;z-index:3;
  width:40px;height:40px;padding:0;border:0;background:transparent;cursor:pointer;
  filter:drop-shadow(0 4px 8px rgba(0,0,0,.22));
  display:block;
}
.duo-av-stage .ach-pin{right:-4px;bottom:0}
.duo-plan-card.is-static{cursor:default}
.duo-plan-card.is-static:active{transform:none}
.ach-pin img{width:100%;height:100%;display:block;pointer-events:none}
.ach-pin:active{transform:scale(.94)}

.badge-demo-tag{
  display:inline-block;margin-left:8px;font-size:10px;font-weight:700;
  letter-spacing:.06em;text-transform:uppercase;color:#9AA3AB;
  border:1px solid #E5E5E5;border-radius:100px;padding:2px 7px;vertical-align:middle;
}
.badge-shelf{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px 8px;
  margin-bottom:8px;
}
.badge-shelf-item{
  border:0;background:none;padding:0;cursor:pointer;font:inherit;color:inherit;
  display:flex;flex-direction:column;align-items:center;gap:6px;opacity:.38;
}
.badge-shelf-item.is-earned{opacity:1}
.badge-shelf-item.is-pinned img{outline:2px solid #1CB0F6;outline-offset:2px;border-radius:10px}
.badge-shelf-item img{width:44px;height:44px;display:block}
.badge-shelf-item span{
  font-size:10px;font-weight:700;color:#9AA3AB;text-align:center;
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.badge-shelf-item.is-earned span{color:#1F2A33}
html[data-mood="dark"] .badge-shelf-item.is-earned span{color:var(--ink)}
.badge-demo-actions{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 4px}
.badge-demo-actions .btn-ghost{font-size:12px;min-height:36px;padding:0 12px}

.sheet-badge{max-height:min(92vh,720px)}
.badge-sheet-body{
  position:relative;padding:8px 22px 28px;text-align:center;
  display:flex;flex-direction:column;align-items:center;
}
.badge-sheet-glow{
  position:absolute;top:40px;left:50%;transform:translateX(-50%);
  width:180px;height:180px;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle, color-mix(in srgb, var(--badge-c,#A78BFA) 35%, transparent), transparent 70%);
}
.badge-sheet-glow.is-burst{
  width:220px;height:220px;top:20px;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--badge-c,#A78BFA) 40%, transparent), transparent 68%),
    repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--badge-c,#A78BFA) 18%, transparent) 0 8deg, transparent 8deg 22deg);
  opacity:.85;
}
.badge-sheet-art{
  position:relative;z-index:1;width:140px;height:140px;margin:12px 0 8px;
  filter:drop-shadow(0 12px 24px rgba(0,0,0,.16));
}
.badge-sheet-kicker{
  font-size:13px;font-weight:600;color:#9AA3AB;margin-top:4px;
}
.badge-sheet-earned{
  font-size:11px;font-weight:700;letter-spacing:.08em;color:#9AA3AB;margin-top:8px;
}
.badge-sheet-name{font-size:15px;font-weight:700;color:#1F2A33;margin-top:4px;position:relative;z-index:1}
html[data-mood="dark"] .badge-sheet-name{color:var(--ink)}
.badge-sheet-title{
  font-size:26px;font-weight:800;letter-spacing:-.03em;color:#1F2A33;margin-top:10px;line-height:1.15;
}
html[data-mood="dark"] .badge-sheet-title{color:var(--ink)}
.badge-sheet-d{
  font-size:14px;line-height:1.45;color:#9AA3AB;margin:8px 0 18px;max-width:300px;
}
.badge-sheet-btn{
  width:100%;max-width:360px;min-height:52px;border:0;border-radius:100px;
  background:#111;color:#fff;font:inherit;font-size:16px;font-weight:700;cursor:pointer;margin-top:8px;
}
.badge-sheet-btn.is-ghost{
  background:transparent;color:#1F2A33;border:1.5px solid #E5E5E5;margin-top:10px;
}
html[data-mood="dark"] .badge-sheet-btn.is-ghost{color:var(--ink);border-color:var(--border)}
.badge-sheet-link{
  margin-top:14px;border:0;background:none;font:inherit;font-size:14px;font-weight:600;
  color:#9AA3AB;cursor:pointer;text-decoration:underline;text-underline-offset:3px;
}
.streak-week{
  display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px;
  width:100%;max-width:340px;margin:4px 0 18px;
}
.streak-day{display:flex;flex-direction:column;align-items:center;gap:8px}
.streak-day-l{font-size:11px;font-weight:600;color:#9AA3AB}
.streak-day-m{
  width:36px;height:36px;border-radius:50%;border:1.5px solid #E5E5E5;
  display:grid;place-items:center;font-size:13px;font-weight:700;color:#1F2A33;
  background:#fff;
}
html[data-mood="dark"] .streak-day-m{background:var(--surface);border-color:var(--border);color:var(--ink)}
.streak-day.is-done .streak-day-m{border-color:transparent;background:#F3F4F6;padding:4px}
.streak-day.is-done .streak-day-m img{width:100%;height:100%;display:block}
.look-preview-char{
  width:min(220px,58vw);height:min(220px,58vw);object-fit:contain;
  filter:drop-shadow(0 16px 28px rgba(0,0,0,.14));
}
.look-char-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;
  max-height:min(36vh,280px);overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding:2px;
}
.look-char-grid .look-opt img{background:transparent}
img.desk-look-preview:not(.is-photo){
  width:120px;height:120px;object-fit:cover;object-position:center 14%;padding:0;
  background:#E8EDF2;border-radius:24px;border:1px solid var(--border);flex-shrink:0;
}

/* Token balance card */
.bal-card{
  border-radius:20px;padding:18px;color:#fff;
  background:linear-gradient(135deg,#171717 0%,#2b2b2b 100%);
  box-shadow:0 10px 24px -12px rgba(0,0,0,.5);
}
html[data-mood="dark"] .bal-card{background:linear-gradient(135deg,#232323 0%,#151515 100%);border:1px solid var(--border)}
.bal-top{display:flex;align-items:center;gap:12px}
.bal-coin{width:40px;height:40px;border-radius:12px;flex-shrink:0;display:grid;place-items:center;background:rgba(255,255,255,.12);color:#FFD27A}
.bal-meta{flex:1;min-width:0}
.bal-label{font-size:14.5px;font-weight:700;letter-spacing:-.01em}
.bal-sub{font-size:12px;color:rgba(255,255,255,.6);margin-top:2px}
.bal-topup{
  flex-shrink:0;background:#fff;color:#171717;font-size:13px;font-weight:700;
  padding:9px 15px;border-radius:100px;border:none;
}
.bal-topup:active{transform:scale(.95)}
.bal-value{
  font-size:34px;font-weight:800;letter-spacing:-.03em;margin-top:14px;
  display:flex;align-items:baseline;gap:8px;
}
.bal-value span{font-size:14px;font-weight:600;color:rgba(255,255,255,.55);letter-spacing:0}
/* Overview stat cells */
.stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.stat-cell{
  background:var(--surface-2);border:1px solid var(--border);border-radius:16px;
  padding:14px 10px;text-align:center;
}
html[data-mood="dark"] .stat-cell{background:var(--surface)}
.stat-ic{font-size:20px;line-height:1;display:block;margin-bottom:6px}
.stat-num{font-size:20px;font-weight:800;color:var(--ink);letter-spacing:-.02em}
.stat-cap{font-size:11px;font-weight:600;color:var(--muted);margin-top:2px;letter-spacing:.02em}
/* ---------- payment / plan ---------- */
.pay-section-h{font-size:13px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:22px 2px 12px}
.plan-cards{display:flex;flex-direction:column;gap:12px}
.plan-card{
  position:relative;border:1px solid var(--border);border-radius:20px;
  background:var(--surface);padding:18px;overflow:hidden;
}
.plan-card.is-featured{border-color:color-mix(in srgb, #EC4899 55%, var(--border))}
.plan-ribbon{
  position:absolute;top:20px;right:-38px;transform:rotate(45deg);
  background:#EC4899;color:#fff;font-size:9.5px;font-weight:800;letter-spacing:.05em;
  padding:5px 44px;box-shadow:0 2px 6px rgba(0,0,0,.2);
}
.plan-card-top{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.plan-card-name{display:inline-flex;align-items:center;gap:7px;font-size:18px;font-weight:800;color:var(--ink);letter-spacing:-.02em}
.plan-card-name .plan-badge{width:18px;height:18px}
.plan-current-chip{font-size:10.5px;font-weight:700;color:var(--done);background:color-mix(in srgb,var(--done) 15%,transparent);padding:3px 9px;border-radius:100px}
.plan-card-price{font-size:24px;font-weight:800;color:var(--ink);letter-spacing:-.02em;margin-bottom:14px}
.plan-card-price span{font-size:13px;font-weight:600;color:var(--muted);letter-spacing:0}
.plan-feats{list-style:none;display:flex;flex-direction:column;gap:9px;margin:0 0 16px;padding:0}
.plan-feats li{display:flex;align-items:flex-start;gap:9px;font-size:13.5px;color:var(--text);line-height:1.35}
.pf-check{flex-shrink:0;margin-top:1px;color:var(--done)}
.plan-pro .pf-check{color:#3B82F6}
.plan-pod .pf-check{color:#EC4899}
/* Current-plan status */
.plan-status{display:flex;align-items:center;gap:12px;padding:14px 16px;border-radius:18px;background:var(--surface);border:1px solid var(--border);margin-bottom:14px}
.plan-status-badge{width:40px;height:40px;flex-shrink:0;display:grid;place-items:center}
.plan-status-verified{width:34px;height:34px}
.plan-status-mark{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;font-weight:800;font-size:16px;background:#111;color:#fff}
html[data-mood="dark"] .plan-status-mark{background:#EDEDED;color:#111}
.plan-status-copy{flex:1;min-width:0}
.plan-status-t{font-size:17px;font-weight:750;letter-spacing:-.02em;color:var(--ink)}
.plan-status-d{font-size:12.5px;color:var(--muted);margin-top:1px}
/* Tokens balance card */
.tok-card{padding:16px;border-radius:18px;background:linear-gradient(150deg, color-mix(in srgb, var(--accent,#6366F1) 12%, var(--surface)) 0%, var(--surface) 70%);border:1px solid var(--border);margin-bottom:6px}
.tok-top{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.tok-label{font-size:13px;font-weight:650;color:var(--text-2)}
.tok-bal{font-size:30px;font-weight:800;letter-spacing:-.03em;color:var(--ink);line-height:1}
.tok-sub{font-size:12.5px;color:var(--muted);margin:4px 0 14px}
.tok-topup{display:flex;align-items:center;justify-content:center;gap:7px;min-height:44px;border-radius:13px;background:var(--ink);color:var(--bg);font-weight:700;font-size:14.5px;text-decoration:none}
html[data-mood="dark"] .tok-topup{background:#EDEDED;color:#111}
.tok-topup:active{transform:scale(.99)}
/* Upgrade / manage on web */
.plan-web-cta{display:flex;align-items:center;gap:12px;padding:15px 16px;border-radius:18px;background:var(--surface);border:1px solid var(--border);text-decoration:none;color:inherit;margin-top:4px}
.plan-web-cta:active{transform:scale(.995)}
.plan-web-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.plan-web-t{font-size:15px;font-weight:700;color:var(--ink)}
.plan-web-d{font-size:12.5px;color:var(--muted)}
.plan-web-cta>svg{flex-shrink:0;color:var(--faint)}
.plan-cta{
  width:100%;min-height:46px;border-radius:14px;font-size:14.5px;font-weight:700;
  background:var(--surface-2);color:var(--ink);border:1px solid var(--border);
}
.plan-cta.primary{background:var(--ink);color:var(--bg);border-color:var(--ink)}
html[data-mood="dark"] .plan-cta.primary{background:#EDEDED;color:#111}
.plan-cta:active{transform:scale(.98)}
.plan-cta.is-current{background:transparent;color:var(--muted);border-style:dashed}
/* token packs */
.pack-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.pack-card{
  position:relative;display:flex;flex-direction:column;align-items:center;gap:2px;
  padding:16px 8px 14px;border-radius:16px;border:1px solid var(--border);background:var(--surface);
}
.pack-card:active{transform:scale(.97)}
.pack-card.is-best{border-color:var(--ink)}
html[data-mood="dark"] .pack-card.is-best{border-color:var(--faint)}
.pack-tag{
  position:absolute;top:-8px;left:50%;transform:translateX(-50%);white-space:nowrap;
  font-size:9px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;
  background:var(--ink);color:var(--bg);padding:3px 8px;border-radius:100px;
}
html[data-mood="dark"] .pack-tag{background:#EDEDED;color:#111}
.pack-amt{font-size:22px;font-weight:800;color:var(--ink);letter-spacing:-.02em}
.pack-unit{font-size:11px;color:var(--muted);margin-bottom:6px}
.pack-price{font-size:13px;font-weight:700;color:var(--ink)}
.pay-note{display:flex;align-items:center;justify-content:center;gap:6px;font-size:12px;color:var(--muted);margin:16px 2px 4px}
/* ---------- integrations ---------- */
.intg-list{display:flex;flex-direction:column;gap:12px}
.intg-card{
  border:1px solid var(--border);border-radius:18px;background:var(--surface);padding:16px;
}
/* connected = neutral card + a small green dot only (no full green outline) */
.intg-card.is-connected{border-color:var(--border)}
/* coming soon = clearly inactive */
.intg-card.is-soon{opacity:.5}
.intg-card.is-soon .intg-logo{filter:grayscale(1)}
.intg-head{display:flex;align-items:center;gap:13px}
.intg-icon{width:44px;height:44px;border-radius:13px;flex-shrink:0;display:grid;place-items:center}
.intg-logo{background:#fff;border:1px solid var(--border);overflow:hidden}
.intg-logo svg{display:block}
.intg-meta{flex:1;min-width:0}
.intg-name{font-size:15.5px;font-weight:700;color:var(--ink);letter-spacing:-.01em}
.intg-status{font-size:12.5px;color:var(--muted);margin-top:2px;display:flex;align-items:center;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.intg-status.is-on{color:var(--done)}
.intg-dot{width:7px;height:7px;border-radius:50%;background:var(--done);flex-shrink:0}
.intg-more{
  width:34px;height:34px;border-radius:50%;border:0;flex-shrink:0;
  background:transparent;color:var(--muted);display:grid;place-items:center;cursor:pointer;
  transition:background .15s, color .15s;
}
.intg-more:hover{background:var(--surface-2);color:var(--ink)}
.intg-card.is-open .intg-more{background:var(--surface-2);color:var(--ink)}
.intg-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.intg-actions[hidden]{display:none}
.intg-actions .btn-ghost,.intg-actions .btn-dark,.intg-actions a{flex:1 1 auto;min-width:0;justify-content:center}
.intg-help{
  margin-top:10px;font-size:12.5px;color:var(--muted);line-height:1.4;
  background:none;border:0;padding:0;text-align:left;cursor:pointer;
}
.intg-help code{background:var(--surface-2);border:1px solid var(--border);border-radius:6px;padding:2px 7px;font-size:12px;color:var(--ink)}
.duo-nick{margin-top:22px;padding-top:8px}
.sheet-duo{padding:0 0 calc(18px + env(safe-area-inset-bottom))!important;max-height:min(94vh,920px);overflow-y:auto}
.sheet-duo .sheet-grab{margin:10px auto 0}
.sheet-duo .duo-profile{margin:0;min-height:0}
.sheet-duo .duo-back{visibility:hidden}
.sheet-full{
  left:0!important;right:0!important;top:0!important;bottom:0!important;
  width:100%!important;max-width:none!important;height:100%!important;
  max-height:none!important;margin:0!important;border-radius:0!important;
  transform:translateY(100%)!important;padding:0!important;
  overflow:auto;-webkit-overflow-scrolling:touch;
}
.sheet-full.on{transform:none!important;opacity:1;pointer-events:auto}
.sheet-full .duo-profile{
  margin:0;min-height:100%;
}
body.person-profile-open .m-nav{display:none!important}
body.person-profile-open .m-fab,
body.person-profile-open .m-mylo-fab{display:none!important}

.look-studio{display:flex;flex-direction:column;min-height:100%;margin:0 calc(-1 * var(--gutter));background:#F0F0F0}
html[data-mood="dark"] .look-studio{background:var(--bg)}
.look-studio-top{display:grid;grid-template-columns:56px 1fr 64px;align-items:center;padding:10px 12px 6px;gap:8px}
.look-x{width:40px;height:40px;border:0;border-radius:12px;background:transparent;color:var(--ink);display:grid;place-items:center;cursor:pointer}
.look-studio-title{text-align:center;font-size:17px;font-weight:700;letter-spacing:-.02em;color:var(--ink)}
.look-save{border:0;background:transparent;font:inherit;font-size:14px;font-weight:800;letter-spacing:.04em;color:var(--ink);cursor:pointer;justify-self:end;padding:8px 4px}
.look-save:disabled,.look-save:not(.is-on){color:var(--muted);cursor:default;opacity:.55}
.look-save.is-on{color:var(--ink)}
.look-preview{flex:1;display:grid;place-items:center;padding:16px 24px 12px;min-height:250px;overflow:hidden}
.look-preview.is-face .look-preview-img{transform:scale(1.5) translateY(12%)}
.look-preview.is-body .look-preview-img{transform:none}
.look-preview-img{width:min(210px,56vw);height:min(210px,56vw);object-fit:contain;filter:drop-shadow(0 16px 28px rgba(0,0,0,.14));transition:transform .28s cubic-bezier(.16,1,.3,1)}
.look-preview-stack{
  width:min(200px,52vw);height:min(200px,52vw);
  filter:drop-shadow(0 16px 28px rgba(0,0,0,.14));
  overflow:hidden;
}
.look-preview.is-face .look-preview-stack{transform:none}
.look-preview .look-preview-stack .avatar-layer,
.look-preview .look-preview-stack .avatar-layer-base{
  transform:scale(1.05) translateY(2%);
  transform-origin:center 28%;
}
.look-preview-suit{
  width:min(200px,52vw);height:min(200px,52vw);
  object-fit:cover;object-position:center 12%;
  transform:scale(1.05);transform-origin:center 18%;
  filter:drop-shadow(0 16px 28px rgba(0,0,0,.14));
}
.look-preview-photo{width:min(200px,54vw);height:min(200px,54vw);border-radius:50%;object-fit:cover;border:4px solid #fff;box-shadow:0 12px 32px rgba(0,0,0,.16)}
.look-photo-empty{display:flex;flex-direction:column;align-items:center;gap:10px;color:#9AA3AB;font-size:14px;font-weight:600}
.look-panel{background:#fff;border-radius:24px 24px 0 0;border:1px solid rgba(0,0,0,.06);border-bottom:0;padding:6px 18px calc(20px + env(safe-area-inset-bottom));box-shadow:0 -10px 36px rgba(0,0,0,.06);flex:0 0 auto;max-height:min(58vh,520px);overflow:auto;-webkit-overflow-scrolling:touch}
html[data-mood="dark"] .look-panel{background:var(--surface);border-color:var(--border)}
.look-tabs{display:flex;gap:28px;justify-content:center;border-bottom:1px solid #E5E5E5;margin-bottom:12px;padding:0 8px 0}
html[data-mood="dark"] .look-tabs{border-color:var(--border)}
.look-tab{appearance:none;border:0;background:none;font:inherit;cursor:pointer;font-size:13px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#9AA3AB;padding:14px 4px 12px;position:relative}
.look-tab.on{color:#1CB0F6}
.look-tab.on::after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;border-radius:3px 3px 0 0;background:#1CB0F6}
.look-panel-label{font-size:15px;font-weight:700;color:#1F2A33;margin:4px 2px 12px}
html[data-mood="dark"] .look-panel-label{color:var(--ink)}
.look-opt-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;max-height:min(40vh,280px);overflow-y:auto;-webkit-overflow-scrolling:touch;padding:2px}
.look-color-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px;padding:2px 2px 8px;max-height:min(40vh,280px);overflow-y:auto;-webkit-overflow-scrolling:touch}
.look-color{aspect-ratio:1;border-radius:14px;border:3px solid transparent;background:var(--swatch);cursor:pointer;padding:0;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);min-height:44px}
.look-color.is-on{border-color:#1CB0F6;box-shadow:0 0 0 2px rgba(28,176,246,.25), inset 0 0 0 1px rgba(0,0,0,.06)}
.look-opt{aspect-ratio:1;border-radius:16px;border:2.5px solid transparent;background:#FFFFFF;padding:10%;cursor:pointer;display:grid;place-items:center;overflow:hidden;min-height:56px;box-sizing:border-box}
html[data-mood="dark"] .look-opt{background:#FFFFFF;border-color:transparent}
.look-opt img{width:100%;height:100%;object-fit:contain;object-position:center;pointer-events:none;border-radius:0}
.look-opt.is-face img,
.look-opt-grid.is-face-parts .look-opt img{
  transform:scale(2.6);transform-origin:center 48%;
}
.look-opt.is-face[data-set-look="mouth"] img,
.look-opt-grid.is-face-parts .look-opt[data-set-look="mouth"] img{
  transform:scale(2.8);transform-origin:center 72%;
}
.look-cats{
  display:flex;justify-content:center;gap:10px;margin:2px 0 14px;flex-wrap:wrap;
}
.look-cat{
  width:48px;height:48px;min-width:48px;border-radius:16px;border:2.5px solid transparent;
  background:#F3F5F7;color:#555;display:grid;place-items:center;cursor:pointer;padding:0;
}
html[data-mood="dark"] .look-cat{background:var(--surface-2);color:var(--muted)}
.look-cat.is-on{border-color:#1CB0F6;color:#1CB0F6;background:rgba(28,176,246,.1)}
@media (max-width:900px){
  .look-studio{min-height:100dvh;display:flex;flex-direction:column}
  .look-preview{min-height:min(36vh,280px);flex:1 1 auto}
  .look-panel{max-height:min(58dvh,560px)}
  .look-opt-grid,.look-color-grid{max-height:min(34dvh,260px)}
  .look-cats{gap:8px}
  .look-cat{width:46px;height:46px}
}
.look-opt.is-on{border-color:#1CB0F6;background:rgba(28,176,246,.1)}
.look-opt-none{font-size:18px;color:#9AA3AB;font-weight:600}
.desk-look-preview.is-head,
.avatar-stack.desk-look-preview.is-head{
  overflow:hidden;
  background:#E8EDF2;
}
.desk-look-preview.is-head .avatar-layer,
.desk-look-preview.is-head .avatar-layer-base{
  transform:scale(1.08) translateY(2%);
  transform-origin:center 28%;
}
.look-photo-panel{padding:4px 2px 8px}
.look-photo-copy{margin:0 0 16px;font-size:13px;line-height:1.45;color:#9AA3AB}
.look-photo-cta{width:100%;min-height:52px;border:0;border-radius:16px;background:#1CB0F6;color:#fff;font:inherit;font-size:15px;font-weight:800;display:inline-flex;align-items:center;justify-content:center;gap:10px;cursor:pointer;box-shadow:0 4px 0 #1899D6}
.look-photo-cta:active{transform:translateY(2px);box-shadow:0 2px 0 #1899D6}
.look-photo-remove{width:100%;margin-top:12px;min-height:46px;border-radius:14px;border:2px solid #E5E5E5;background:#fff;color:#E11D48;font:inherit;font-size:14px;font-weight:700;cursor:pointer}
html[data-mood="dark"] .look-photo-remove{background:var(--surface);border-color:var(--border)}
.desk-look-preview.avatar-stack,.avatar-stack.desk-look-preview{width:120px;height:120px;flex-shrink:0;background:#F5F5F5;border-radius:24px;border:1px solid var(--border);padding:10px;box-sizing:border-box}
img.desk-look-preview.is-photo{width:120px;height:120px;border-radius:24px;object-fit:cover;flex-shrink:0;border:1px solid var(--border);padding:0}
.desk-look-pick .look-cats{justify-content:flex-start}
.desk-look-pick .look-opt-grid,.desk-look-pick .look-color-grid{max-height:none}
.desk-look-pick .look-tabs{justify-content:flex-start;gap:18px}

/* Desktop extensive settings */
.desk-settings{max-width:980px;margin:0 auto;width:100%}
.desk-settings-hero{
  display:flex;align-items:flex-end;justify-content:space-between;gap:24px;
  margin:4px 0 28px;padding:22px 24px;
  border-radius:24px;border:1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(28,176,246,.08), transparent 55%),
    var(--surface);
}
.desk-settings-kicker{
  font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);margin-bottom:8px;
}
.desk-settings-title{
  font-size:28px;font-weight:700;letter-spacing:-.04em;color:var(--ink);margin:0 0 6px;
}
.desk-settings-sub{margin:0;font-size:13px;color:var(--muted);line-height:1.45;max-width:42ch}
.desk-settings-av{
  width:88px;height:88px;border-radius:24px;flex-shrink:0;
  display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--border);
}
.desk-settings-face{width:68px;height:68px;object-fit:contain}
.desk-settings-face.is-photo{width:100%;height:100%;border-radius:23px;object-fit:cover}
.desk-settings-grid{
  display:grid;grid-template-columns:1fr 1fr;gap:16px;align-items:start;
}
.desk-settings-card{
  background:var(--surface);border:1px solid var(--border);border-radius:20px;
  padding:20px 20px 18px;
}
.desk-settings-span{grid-column:1 / -1}
.desk-settings-h{
  font-size:18px;font-weight:700;letter-spacing:-.03em;color:var(--ink);margin:0 0 4px;
}
.desk-look-row{display:flex;gap:18px;align-items:flex-start;margin-top:14px;flex-wrap:wrap}
.desk-look-row > .desk-look-pick{flex:1 1 280px;min-width:0}
.desk-look-preview{
  width:112px;height:112px;object-fit:contain;flex-shrink:0;
  background:var(--surface-2);border-radius:22px;border:1px solid var(--border);padding:10px;
}
.desk-look-preview.is-photo{object-fit:cover;padding:0}
.desk-look-pick{flex:1;min-width:0}
.desk-look-pick .char-grid{margin-bottom:4px}
.desk-look-pick .btn-ghost{margin-top:10px}
.desk-settings-card .cover-editor{padding:14px}
.desk-settings-card .cover-preview{height:72px}
.desk-settings-card .profile-panel-hero{margin:0 0 12px}
.desk-settings-card .profile-panel-title{font-size:18px;margin-bottom:4px}
.desk-settings-plan .profile-panel-hero{margin-bottom:8px}
.desk-settings-plan .pay-note{margin-top:14px}
.desk-settings-card > .setting-card,
.desk-settings-plan .setting-card,
.desk-settings-connect .setting-card{
  background:transparent;border:0;box-shadow:none;padding:0;margin:0;max-width:none;
}
.desk-settings-card .m-section{margin-top:16px}

/* Apps hub */
.apps-hub{max-width:640px;padding-bottom:calc(28px + env(safe-area-inset-bottom))}
.apps-hero-lite{margin:4px 0 18px}
.apps-hero-lite h2{
  margin:0 0 4px;font-size:28px;font-weight:700;letter-spacing:-.04em;color:var(--ink);
}
.apps-hero-lite p{margin:0;font-size:14px;color:var(--muted);line-height:1.4}
.apps-block{margin-bottom:26px}
.apps-h{
  margin:0 0 12px;font-size:13px;font-weight:600;color:var(--muted);
}
.apps-play-list{display:flex;flex-direction:column;gap:10px}
.apps-play-card{
  display:flex;align-items:center;gap:14px;width:100%;text-align:left;
  padding:14px 14px 14px 12px;border-radius:18px;
  background:var(--surface);border:1px solid var(--border);
  font:inherit;color:inherit;cursor:pointer;
}
.apps-play-card:active{transform:scale(.985)}
.apps-play-ic{
  width:48px;height:48px;border-radius:14px;flex-shrink:0;
  display:grid;place-items:center;font-size:22px;
  background:color-mix(in srgb, var(--app-c) 16%, var(--surface));
  color:var(--app-c);
}
.apps-play-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.apps-play-t{font-size:15.5px;font-weight:650;color:var(--ink);letter-spacing:-.02em}
.apps-play-d{font-size:12.5px;color:var(--muted);line-height:1.35}
.apps-play-go{font-size:22px;color:var(--faint);flex-shrink:0;line-height:1}
.apps-feature{
  display:flex;flex-direction:column;justify-content:flex-end;gap:14px;
  width:100%;min-height:148px;padding:16px;border:0;border-radius:18px;
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--feat-c) 55%, #111) 0%, color-mix(in srgb, var(--feat-c) 25%, #000) 100%);
  color:#fff;font:inherit;text-align:left;cursor:pointer;overflow:hidden;
}
.apps-feature:active{opacity:.92;transform:scale(.995)}
.apps-feature-kicker{font-size:12px;font-weight:600;opacity:.85}
.apps-feature-t{font-size:20px;font-weight:700;letter-spacing:-.03em;line-height:1.2;max-width:18ch}
.apps-feature-pill{
  display:flex;align-items:center;gap:10px;
  padding:8px 10px;border-radius:12px;
  background:rgba(0,0,0,.28);backdrop-filter:blur(8px);
  font-size:12px;font-weight:600;
}
.apps-tabs{
  display:grid;grid-template-columns:1fr 1fr;gap:0;
  border-bottom:1px solid var(--border);margin:0 0 18px;
}
.apps-tab{
  appearance:none;border:0;background:none;font:inherit;cursor:pointer;
  font-size:14px;font-weight:600;color:var(--muted);padding:10px 8px 12px;position:relative;
}
.apps-tab.on{color:var(--ink)}
.apps-tab.on::after{
  content:"";position:absolute;left:18%;right:18%;bottom:-1px;height:2px;background:var(--ink);border-radius:2px;
}
.apps-row{
  display:flex;gap:14px;overflow-x:auto;-webkit-overflow-scrolling:touch;
  padding:2px 2px 4px;scrollbar-width:none;
}
.apps-row::-webkit-scrollbar{display:none}
.apps-saved-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:2px}
.apps-saved-head .apps-h{margin:0 0 12px}
.apps-gear{
  width:32px;height:32px;border:0;border-radius:50%;background:transparent;color:var(--muted);
  display:grid;place-items:center;cursor:pointer;padding:0;margin-bottom:10px;
}
.apps-gear:active{color:var(--ink)}
.apps-saved-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px 10px;
}
.apps-saved-grid .app-ic-btn{width:100%}
.apps-saved-grid .app-ic-name{max-width:100%}
.app-ic-btn{
  flex:0 0 auto;width:64px;border:0;background:none;padding:0;cursor:pointer;
  display:flex;flex-direction:column;align-items:center;gap:6px;font:inherit;color:inherit;
}
.app-ic-btn:active{transform:scale(.96)}
.app-ic-btn.is-soon{opacity:.4}
.app-ic{
  width:52px;height:52px;border-radius:16px;display:grid;place-items:center;
  font-size:17px;font-weight:700;letter-spacing:-.02em;line-height:1;color:#fff;
  background:var(--app-c);
  box-shadow:none;
}
.app-ic-sm{
  width:28px;height:28px;border-radius:8px;font-size:12px;flex-shrink:0;
}
.app-ic-name{
  font-size:11px;font-weight:500;color:var(--ink);text-align:center;
  max-width:72px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* legacy tiles kept for safety */
.apps-hero{margin:4px 0 18px}
.apps-hero h2{font-size:22px;font-weight:600;letter-spacing:-.03em;margin:0 0 4px}
.apps-hero p{font-size:13px;color:var(--muted);margin:0;line-height:1.45}
.apps-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px 10px}
.app-tile{
  display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:14px 8px 10px;border-radius:18px;border:1px solid var(--border);
  background:var(--surface);color:inherit;cursor:pointer;font:inherit;
}
.app-tile:active{transform:scale(.97)}
.app-tile-ic{
  width:52px;height:52px;border-radius:16px;display:grid;place-items:center;
  font-size:22px;background:var(--surface-2);border:1px solid var(--border-2);
}
.app-tile-t{font-size:12px;font-weight:500;text-align:center;line-height:1.25;color:var(--ink)}
.app-tile.is-soon{opacity:.55}

/* ---------- mobile shell (CRM-inspired engineering) ---------- */
.mobile{display:none}

@media (max-width:900px){
  html,body{height:100%;overflow:hidden;overscroll-behavior:none}
  body{overflow:hidden}
  #app.ready{display:none!important}
  #mobile.ready{display:block;height:100%;overflow:hidden}

  .gate{
    padding:max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
    place-items:start center;
    align-content:start;
    overflow-x:hidden;
    overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    height:100%;
    min-height:100%;
  }
  .gate-card{
    width:min(360px,100%);
    max-width:360px;
    padding:24px 18px 22px;
    margin:12px auto 28px;
    overflow:visible;
  }
  /* Characters: wrapping grid with breathing room (no clip under CTA) */
  .char-grid{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:10px;
    overflow:visible;
    flex-wrap:unset;
    padding:2px 0 4px;
    scroll-snap-type:none;
  }
  .char-opt{
    flex:unset;
    width:auto;height:auto;
    aspect-ratio:1;
    scroll-snap-align:unset;
    padding:12%;
    background:#FFFFFF;
  }
  .char-opt img{transform:none;object-fit:contain;object-position:center}
  .gate-card > .field{margin-bottom:18px}
  .gate-card > #char-field{margin-bottom:24px}
  .gate-card > .btn-primary{position:relative;z-index:1}

  .m-app{
    height:100%;
    max-width:520px;margin:0 auto;position:relative;
    padding-bottom:calc(156px + env(safe-area-inset-bottom));
    overflow-x:hidden;overflow-y:auto;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-y:contain;
    touch-action:pan-y;
  }
  body.chat-thread .m-app{
    overflow:hidden;
    padding-bottom:0;
  }
  body.profile-open .m-top{display:none!important}
  body.profile-open .m-nav{display:none!important}
  body.profile-open .m-app{padding-bottom:0}
  body.profile-open #m-you.active:has(.look-studio),
  body.profile-open #m-you.active:has(.duo-profile),
  body.profile-open #m-you.active:has(.edit-page){
    position:fixed;left:0;right:0;top:0;bottom:0;
    max-width:520px;margin:0 auto;padding:0;
    display:flex;flex-direction:column;
    background:var(--bg);z-index:60;overflow:auto;
    -webkit-overflow-scrolling:touch;
    box-sizing:border-box;
  }
  body.profile-open #m-you.active:has(.edit-page){
    padding:calc(10px + env(safe-area-inset-top)) 20px calc(28px + env(safe-area-inset-bottom));
  }
  body.profile-open #m-you.active:has(.look-studio) .look-studio,
  body.profile-open #m-you.active:has(.duo-profile) .duo-profile,
  body.profile-open #m-you.active:has(.edit-page) .edit-page{
    flex:1;min-height:0;margin:0;
  }
  body.profile-open #m-you.active:has(.look-studio) .look-studio{overflow:hidden}
  body.drawer-open{overflow:hidden}

  /* FAB stays on the chat LIST (creates a milestone) but hides inside a thread */
  body.sheet-open .m-fab,
  body.sheet-open .m-mylo-fab,
  body.chat-thread .m-fab,
  body.chat-thread .m-mylo-fab{display:none!important}

  .m-top{position:sticky;top:0;z-index:40;background:linear-gradient(to bottom,var(--bg) 78%,transparent);padding:10px 18px 8px}
  .m-top-row{
    position:relative;display:flex;align-items:center;justify-content:space-between;
    min-height:40px;gap:10px;
  }
  .m-top-title{
    position:absolute;left:50%;transform:translateX(-50%);
    font-size:17px;font-weight:700;letter-spacing:-.02em;color:var(--ink);
    pointer-events:none;white-space:nowrap;
  }
  .m-top-action{
    width:36px;height:36px;border:0;border-radius:50%;padding:0;
    background:transparent;color:var(--ink);display:grid;place-items:center;cursor:pointer;flex-shrink:0;
  }
  .m-top-action:active{opacity:.65}
  .m-top-action[hidden]{display:none!important}
  .m-top-back{
    width:36px;height:36px;border:0;border-radius:50%;padding:0;
    background:transparent;color:var(--ink);display:grid;place-items:center;cursor:pointer;flex-shrink:0;
  }
  .m-top-back[hidden]{display:none!important}
  .m-top-back:active{opacity:.65}
  .m-top-actions{display:flex;align-items:center;gap:8px}
  body.chat-thread .m-top{display:none!important}
  .m-avatar-btn{
    flex-shrink:0;padding:0;border:0;background:transparent;cursor:pointer;
    border-radius:50%;line-height:0;position:relative;width:32px;height:32px;
  }
  .m-avatar-btn[hidden]{display:none!important}
  .m-avatar-btn:active{transform:scale(.96)}
  .m-avatar-badge{
    position:absolute;right:-3px;bottom:-2px;width:14px;height:14px;
    border-radius:50%;background:var(--bg);padding:1px;box-sizing:border-box;
  }
  .m-avatar-badge.hidden{display:none!important}
  .m-icbtn{
    width:40px;height:40px;border-radius:12px;background:var(--surface);
    border:1px solid var(--border);display:grid;place-items:center;color:var(--ink);font-size:16px;
  }
  .cal-wrap{max-width:none;overflow-x:auto}
  .m-avatar{width:32px;height:32px;border-radius:50%;object-fit:contain;overflow:hidden}
  .m-avatar.is-photo{border-radius:50%;object-fit:cover}
  .m-avatar.avatar-slot{
    width:32px;height:32px;border-radius:50%;
    box-shadow:0 0 0 1.5px color-mix(in srgb, var(--ink) 22%, transparent);
  }
  html[data-mood="dark"] .m-avatar.avatar-slot{
    box-shadow:0 0 0 1.5px color-mix(in srgb, #fff 35%, transparent);
  }
  .m-avatar.avatar-slot.is-photo{border-radius:50%}
  .m-avatar.avatar-slot.is-photo > img{border-radius:50%;object-fit:cover}

  .m-screen{
    display:none;padding:12px var(--gutter) 32px;
    max-width:100%;overflow-x:hidden;
    background:var(--bg);
    animation:mIn .22s ease-out;
  }
  /* Home rhythm: every top-level block sits on the same vertical step. */
  #m-today > .wk-strip,
  #m-today > .day-preview,
  #m-today > .pbar-card{margin-bottom:var(--stack)}
  #m-today > .status-seg{margin-bottom:var(--stack)}
  #m-today > .daypart-block:last-child{margin-bottom:0}
  #m-today > .empty{margin-top:var(--stack)!important}
  .m-screen.active{display:block}

  /* Chat list keeps bottom nav (WhatsApp-style). Only threads go fullscreen. */
  #m-chat.active{
    display:block;
    padding:10px 16px 28px;
    max-width:100%;
    overflow-x:hidden;
    animation:mIn .35s cubic-bezier(.16,1,.3,1);
  }
  #m-chat.active .chat-shell{
    min-height:0;
  }
  body.chat-thread #m-chat.active{
    --nav-stack:0px;
    position:fixed;left:0;right:0;top:0;bottom:0;
    max-width:520px;margin:0 auto;padding:0;
    display:flex;flex-direction:column;
    background:var(--bg);z-index:55;overflow:hidden;
    box-sizing:border-box;
  }
  body.chat-thread .m-nav{
    opacity:0;pointer-events:none;transform:translateY(110%);
  }
  body.kb-open .m-nav{opacity:0;pointer-events:none;transform:translateY(110%)}
  body.chat-thread #m-chat.active .chat{
    flex:1;min-height:0!important;height:100%!important;max-height:none!important;
    width:100%;max-width:100%;
    margin:0;border-radius:0;
    display:flex;flex-direction:column;
    padding:0 14px 0;
    box-sizing:border-box;
  }
  body.chat-thread #m-chat.active .chat-thread-head{flex-shrink:0;padding:10px 2px}
  body.chat-thread #m-chat.active .chat-scroll{
    flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;
    -webkit-overflow-scrolling:touch;
    padding:8px 2px 16px;
  }
  body.chat-thread #m-chat.active .msg{max-width:86%}
  body.chat-thread #m-chat.active .bubble{line-height:1.45;padding:11px 14px}
  body.chat-thread #m-chat.active .chat-bar{
    position:relative;left:auto;transform:none;
    width:100%;max-width:100%;
    bottom:auto;
    z-index:2;
    flex-shrink:0;
    display:flex;gap:8px;align-items:center;
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:18px;
    padding:8px;
    margin:0 0 max(8px, env(safe-area-inset-bottom, 0px));
    box-sizing:border-box;
  }
  body.chat-thread:not(.kb-open) #m-chat.active .chat-bar{
    margin-bottom:max(8px, env(safe-area-inset-bottom, 0px));
  }
  body.kb-open.chat-thread #m-chat.active .chat-bar{
    padding:8px;
    margin-bottom:8px;
  }
  body.chat-thread #m-chat.active .mylo-composer{
    flex-shrink:0;border-top:1px solid var(--border);
    padding:10px 0 max(10px, env(safe-area-inset-bottom, 0px));
    background:var(--bg);
  }
  body.chat-thread #m-chat.active .mylo-bar{
    border:0;margin:0;padding:0;background:transparent;
  }
  body.chat-thread #m-chat.active .mylo-scroll{
    padding:14px 4px 18px;gap:14px;
  }
  body.kb-open.chat-thread #m-chat.active .chat{padding-bottom:0}
  .sheet-sm,.sheet-tall{width:100%}
  .plus-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
  @keyframes mIn{from{opacity:0}to{opacity:1}}

  .m-section{font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:26px 2px 12px}
  .dash-block{margin-bottom:28px}
  .progress-card{margin-bottom:12px;padding:16px;max-width:100%}
  .split{gap:16px;grid-template-columns:1fr}
  .card-head{padding:16px 16px 12px}
  .card-body{padding:0 12px 12px}
  .task{min-height:52px;padding:12px 10px;max-width:100%}
  .chat-tabs{margin-bottom:4px}
  .chat-row{padding:14px 12px;max-width:100%}
  .msg{max-width:88%}
  .msg-card{max-width:min(280px,82vw)}
  .cookie-bar{bottom:calc(88px + env(safe-area-inset-bottom));left:14px;right:14px;max-width:492px}
  .m-card.card{
    background:transparent;border:none;border-radius:0;box-shadow:none;
    padding:0;margin-bottom:20px;max-width:100%;
  }
  .m-card.card .card-head{padding:4px 2px 10px}
  .m-card.card .card-body{padding:0}
  .m-hero{
    background:var(--surface);border:1px solid var(--border);border-radius:20px;
    padding:18px;margin-bottom:16px;max-width:100%;
  }
  .m-hero-t{font-size:15px;font-weight:500;color:var(--ink)}
  .m-hero-d{font-size:12.5px;color:var(--muted);margin-top:4px}
  .m-fab.hidden,.m-mylo-fab.hidden{display:none!important}

  .m-nav{
    position:fixed;bottom:0;left:0;right:0;z-index:50;
    background:var(--nav-bg);backdrop-filter:blur(20px) saturate(1.4);
    border-top:1px solid var(--border);
    display:flex;padding:8px 6px calc(8px + env(safe-area-inset-bottom, 0px));
    max-width:520px;margin:0 auto;
    transition:opacity .18s ease, transform .18s ease;
  }
  .m-nav-item{
    flex:1;display:flex;flex-direction:column;align-items:center;gap:2px;
    padding:2px;color:var(--muted);background:none;border:none;
    position:relative;
  }
  .m-nav-item span:last-child{font-size:10px;font-weight:500}
  .m-nav-item.on{color:var(--ink)}
  .m-nav-item.on .m-nav-ic{background:var(--surface-3)}
  .m-nav-ic{width:46px;height:28px;border-radius:100px;display:grid;place-items:center;position:relative}

  .m-fab{
    position:fixed;right:20px;bottom:calc(92px + env(safe-area-inset-bottom));z-index:55;
    width:54px;height:54px;border-radius:18px;background:var(--ink);color:var(--bg);
    display:grid;place-items:center;
    box-shadow:0 12px 28px -8px rgba(0,0,0,.28);
  }
  .m-mylo-fab{
    position:fixed;right:20px;bottom:calc(92px + env(safe-area-inset-bottom));z-index:55;
    width:54px;height:54px;border-radius:18px;padding:0;overflow:hidden;
    background:var(--surface);border:1px solid var(--border);
    display:grid;place-items:center;
    box-shadow:0 12px 28px -8px rgba(0,0,0,.22);
  }
  .m-mylo-fab{overflow:visible}
  .m-mylo-fab img{width:54px;height:54px;object-fit:cover;display:block;border-radius:16px}
  .m-mylo-fab:active,.m-fab:active{transform:scale(.97)}
  body.dual-fab .m-mylo-fab{right:84px}
  .mylo-bubble{
    position:absolute;bottom:calc(100% + 10px);right:0;
    width:max-content;max-width:66vw;white-space:nowrap;
    background:var(--ink);color:var(--bg);font-size:12.5px;font-weight:600;
    padding:8px 12px;border-radius:14px;box-shadow:0 6px 18px -6px rgba(0,0,0,.4);
    opacity:0;transform:translateY(6px) scale(.9);transform-origin:bottom right;
    transition:opacity .22s, transform .22s;pointer-events:none;
  }
  .mylo-bubble::after{content:"";position:absolute;top:100%;right:18px;border:6px solid transparent;border-top-color:var(--ink)}
  .m-mylo-fab.show-bubble .mylo-bubble{opacity:1;transform:translateY(0) scale(1)}
  .m-mylo-fab[data-mood="happy"] img{animation:myloBounce 1.5s ease-in-out infinite}
  .m-mylo-fab[data-mood="angry"] img{animation:myloShake .55s ease-in-out infinite}
  .m-mylo-fab[data-mood="sad"] img{transform:rotate(-6deg);opacity:.92}
  @keyframes myloBounce{0%,100%{transform:translateY(0)}50%{transform:translateY(-4px)}}
  @keyframes myloShake{0%,100%{transform:rotate(0)}25%{transform:rotate(-8deg)}75%{transform:rotate(8deg)}}

  .sheet{
    left:0;right:0;top:auto;bottom:0;width:100%;max-width:520px;margin:0 auto;
    border-radius:26px 26px 0 0;transform:translateY(100%);
    padding:10px 22px 0; /* match the Today page horizontal margin */
    max-height:min(92vh, 900px);
    display:flex;flex-direction:column;
    overflow:hidden;
  }
  .sheet.on{transform:translateY(0);left:0;right:0;top:auto}
  .sheet-grab{display:block;width:38px;height:4px;border-radius:4px;background:var(--border);margin:6px auto 16px;flex-shrink:0}
  .sheet > .sheet-head{flex-shrink:0}
  .sheet > .field,
  .sheet > .field-row,
  .sheet > .seg,
  .sheet > #subgoals-field,
  .sheet > .sheet-subs{flex-shrink:0}
  .sheet#sheet{
    padding-bottom:0;
  }
  .sheet#sheet .sheet-actions{
    position:sticky;bottom:0;z-index:2;
    margin:0 -20px;padding:12px 20px calc(16px + env(safe-area-inset-bottom));
    background:linear-gradient(to top, var(--surface) 70%, transparent);
    flex-shrink:0;
  }
  .sheet#sheet{
    overflow-y:auto;-webkit-overflow-scrolling:touch;
  }
  .field-row{
    grid-template-columns:1fr;
    gap:14px;
  }
  #date-duration-row,
  #time-duration-row{
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px;
  }
  @media (max-width:374px){
    #date-duration-row,
    #time-duration-row{
      grid-template-columns:1fr;
    }
  }
  .sheet-subs{
    display:flex;flex-direction:column;gap:8px;margin-bottom:10px;
    max-height:28vh;overflow-y:auto;-webkit-overflow-scrolling:touch;
  }
  .sheet-sub-row{
    display:flex;align-items:center;gap:10px;
    padding:10px 12px;border-radius:12px;background:var(--surface-2);border:1px solid var(--border);
  }
  .sheet-sub-t{flex:1;min-width:0;font-size:14px;color:var(--ink)}
  .sheet-sub-x{
    width:28px;height:28px;border:0;border-radius:8px;background:transparent;
    color:var(--muted);font-size:18px;line-height:1;cursor:pointer;
  }
  .sheet-sub-empty{font-size:12.5px;color:var(--muted);padding:4px 2px 8px}
  .sheet-sub-add{margin-top:4px}
  .cats-lead{font-size:13px;color:var(--muted);margin:0 2px 14px;line-height:1.4}
  .split{grid-template-columns:1fr}
  .toast{bottom:calc(100px + env(safe-area-inset-bottom))}
}

@media (min-width:901px){
  #mobile{display:none!important}
  #app.ready{
    display:flex!important;
  }

  /* Desktop account / apps surfaces */
  .apps-hub{max-width:680px}
  .apps-title{font-size:26px}
  .apps-saved-grid{grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:16px 12px;max-width:680px}
  .app-ic{width:52px;height:52px;border-radius:14px;font-size:18px}
  .apps-hero{max-width:720px}
  .apps-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;max-width:720px}
  .app-tile{padding:18px 12px 14px;border-radius:20px}
  .app-tile-ic{width:56px;height:56px;border-radius:18px;font-size:24px}
  /* Look studio is mobile-only — desktop uses #desk-look inline editor */
  body:not(.force-look-studio) .look-studio{display:none!important}
  .desk-settings{max-width:980px;margin:0 auto}
  .desk-settings-grid{gap:18px}
  .desk-settings-plan{grid-column:1 / -1}
  .desk-settings-plan .acct-page{padding:0;margin:0;max-width:none}
  .desk-settings-plan .acct-head{display:none}
  .desk-settings-hero{padding:26px 28px;margin-bottom:22px}
  .desk-settings-title{font-size:30px}
  .settings-drawer{min-height:0}
  /* Drawer is mobile-only; hide shell on desktop so it can't break layout */
  .profile-drawer, .drawer-scrim{display:none!important}
  .pad{padding:26px 32px 56px;max-width:1180px;margin:0 auto;width:100%;box-sizing:border-box}
  .pad:has(.desk-settings){max-width:1040px}
  .pad:has(.goals-desk){max-width:760px}
  .split{grid-template-columns:1fr 1fr;gap:16px}
  .dash-block{margin-bottom:28px}

  /* Today week strip fills the board on desktop */
  .wk-day{flex:1 1 0;min-width:0;max-width:none}
  .wk-strip{overflow-x:visible}

  /* Sheets as centered modals, not phone slide-ups */
  .sheet{
    max-height:min(90vh,900px);overflow:auto;
  }
  .sheet-full{
    left:50%!important;top:50%!important;right:auto!important;bottom:auto!important;
    width:min(560px,92vw)!important;height:auto!important;
    max-height:min(88vh,860px)!important;
    border-radius:var(--r-xl)!important;
    transform:translate(-50%,-46%) scale(.97)!important;
  }
  .sheet-full.on{transform:translate(-50%,-50%) scale(1)!important}
  .sheet-full .field-row{grid-template-columns:1fr}

  /* Desktop calendar — Black Gold CRM style */
  .desk-cal .cal-head{
    display:flex;align-items:center;justify-content:space-between;
    margin-bottom:18px;gap:16px;flex-wrap:wrap;
  }
  .desk-cal .cal-nav{display:flex;align-items:center;gap:12px}
  .desk-cal .cal-month{
    font-size:20px;font-weight:500;letter-spacing:-.02em;color:var(--ink);min-width:160px;
  }
  .desk-cal .cal-arrow{
    width:32px;height:32px;border-radius:9px;border:1px solid var(--border);
    background:var(--surface);color:var(--text-2);display:grid;place-items:center;
  }
  @media (hover:hover){.desk-cal .cal-arrow:hover{background:var(--surface-2);color:var(--ink)}}
  .desk-cal .cal-today{
    font-size:12.5px;font-weight:500;color:var(--ink);background:var(--surface);
    border:1px solid var(--border);border-radius:8px;padding:7px 14px;
  }
  .desk-cal .filters{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
  .desk-cal .filter{
    font-size:12.5px;color:var(--text-2);background:var(--surface);
    border:1px solid var(--border);border-radius:100px;padding:7px 14px;
  }
  .desk-cal .filter.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
  .desk-cal .cal-grid{
    background:var(--surface);border:1px solid var(--border);border-radius:16px;overflow:visible;
  }
  .desk-cal .cal-dow{
    display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--border);
  }
  .desk-cal .cal-dow span{
    font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;
    color:var(--muted);padding:12px;text-align:left;
  }
  .desk-cal .cal-body{display:grid;grid-template-columns:repeat(7,1fr)}
  .desk-cal .cal-cell{
    min-height:clamp(72px, 11vh, 116px);border-right:1px solid var(--border);border-bottom:1px solid var(--border);
    padding:8px;display:flex;flex-direction:column;gap:4px;position:relative;
  }
  .desk-cal .cal-cell:nth-child(7n){border-right:none}
  .desk-cal .cal-cell.dim{background:var(--surface-2)}
  .desk-cal .cal-cell-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:3px}
  .desk-cal .cal-date{font-size:12px;font-weight:500;color:var(--text-2)}
  .desk-cal .cal-cell.dim .cal-date{color:var(--muted)}
  .desk-cal .cal-cell.today .cal-date{
    display:inline-flex;align-items:center;justify-content:center;
    width:22px;height:22px;background:var(--ink);color:var(--bg);border-radius:50%;
  }
  .desk-cal .cal-add{
    width:20px;height:20px;border-radius:6px;border:none;background:transparent;
    color:var(--muted);display:grid;place-items:center;opacity:0;cursor:pointer;font-size:14px;
  }
  .desk-cal .cal-cell:hover .cal-add{opacity:1}
  .desk-cal .pill-ev{
    position:relative;display:flex;align-items:center;gap:6px;
    padding:4px 9px 4px 7px;border-radius:100px;cursor:pointer;border:none;text-align:left;
    width:100%;max-width:100%;overflow:hidden;
  }
  .desk-cal .pill-ev .pe-name{
    font-size:11.5px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
  }
  .desk-cal .pill-ev.mine{background:#EFEFEF;color:#171717}
  .desk-cal .pill-ev.theirs{background:#E4ECF5;color:#2E4E7A}
  .desk-cal .pill-ev.shared{background:#F1E4DB;color:#7A3A1C}
  .desk-cal .pill-ev.done{opacity:.55;text-decoration:line-through}
  html[data-mood="dark"] .desk-cal .pill-ev.mine{background:#2C2C2C;color:#F5F5F5}
  html[data-mood="dark"] .desk-cal .pill-ev.theirs{background:#1E2A38;color:#9DB7D6}
  html[data-mood="dark"] .desk-cal .pill-ev.shared{background:#3A2A22;color:#E0B89A}
  .desk-cal .cal-more{font-size:11px;color:var(--muted);padding:2px 4px}
}

/* Narrow desktop / laptop — stack settings & look */
@media (min-width:901px) and (max-width:1100px){
  .desk-settings-grid{grid-template-columns:1fr}
  .desk-look-row{flex-direction:column;align-items:stretch}
  .desk-look-row > .desk-look-preview,
  .desk-look-row > .avatar-stack.desk-look-preview,
  .desk-look-row > img.desk-look-preview{align-self:flex-start}
  .desk-settings-hero{flex-wrap:wrap;align-items:flex-start}
  .sidebar{width:210px}
  .pad{padding:22px 22px 48px}
}

/* ---------- milestones (chat section) ---------- */
.ms-card{
  background:var(--surface);border:1px solid var(--border);border-radius:20px;
  padding:6px 6px 8px;margin-bottom:16px;
}
.ms-head{display:flex;align-items:center;justify-content:space-between;padding:12px 12px 8px}
.ms-head-t{font-size:14px;font-weight:600;color:var(--ink);letter-spacing:-.01em}
.ms-add-btn{
  min-height:32px;padding:0 12px;border-radius:100px;
  background:var(--ink);color:var(--bg);font-size:12.5px;font-weight:600;
}
.ms-add-btn:active{transform:scale(.95)}
.ms-list{display:flex;flex-direction:column}
.ms-item{
  display:flex;align-items:center;gap:12px;padding:11px 10px;border-radius:14px;
}
.ms-item + .ms-item{border-top:1px solid var(--border-2)}
.ms-check{
  width:24px;height:24px;border-radius:8px;flex-shrink:0;
  border:1.8px solid var(--faint);background:var(--surface);
  display:grid;place-items:center;color:var(--bg);transition:transform .12s;
}
.ms-check:not(:disabled):active{transform:scale(.9)}
.ms-check.on{background:var(--ink);border-color:var(--ink)}
.ms-check:disabled{opacity:.55;cursor:default}
.ms-check.on:disabled{opacity:.8}
.ms-main{flex:1;min-width:0}
.ms-title{font-size:14.5px;font-weight:500;color:var(--ink);line-height:1.3;overflow-wrap:anywhere}
.ms-item.done .ms-title{color:var(--muted);text-decoration:line-through;text-decoration-color:var(--border)}
.ms-by{font-size:11.5px;color:var(--muted);margin-top:2px}
.ms-edit{
  width:32px;height:32px;border-radius:9px;flex-shrink:0;
  display:grid;place-items:center;color:var(--muted);background:transparent;
}
.ms-edit:active{background:var(--surface-2)}
.ms-empty{padding:22px 16px;text-align:center}
.ms-empty-t{font-size:14px;font-weight:600;color:var(--ink)}
.ms-empty-d{font-size:12.5px;color:var(--muted);line-height:1.5;margin-top:6px;max-width:280px;margin-left:auto;margin-right:auto}
.ms-empty-d b{color:var(--text-2);font-weight:600}
/* the chat-list FAB doubles as "new milestone" */
.m-fab.is-milestone{background:var(--ink)}

/* ---------- iOS-style switch (settings) ---------- */
.switch{
  width:50px;height:30px;border-radius:100px;flex-shrink:0;
  background:var(--surface-3);border:1px solid var(--border);position:relative;
  padding:0;transition:background .18s ease, border-color .18s ease;
}
.switch .switch-knob{
  position:absolute;top:2px;left:2px;width:24px;height:24px;border-radius:50%;
  background:var(--surface);box-shadow:0 1px 3px rgba(0,0,0,.22);
  transition:transform .2s cubic-bezier(.3,1.4,.5,1);
}
.switch.on{background:var(--ink);border-color:var(--ink)}
.switch.on .switch-knob{transform:translateX(20px);background:#fff}
.switch:active .switch-knob{width:27px}

/* ---------- friendlier empty states ---------- */
.empty{
  border:1px dashed var(--border);border-radius:18px;background:var(--surface-2);
  padding:30px 22px;margin:2px 0;
  display:flex;flex-direction:column;align-items:center;text-align:center;
}
.empty .empty-t{max-width:280px}
.empty > *:not(.empty-t):not(.empty-cta){max-width:280px}
.empty .empty-cta{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;margin-top:16px;
  min-height:40px;padding:0 18px;border-radius:100px;
  background:var(--ink);color:var(--bg);font-size:13px;font-weight:600;white-space:nowrap;
}
.empty .empty-cta.ghost{background:var(--surface);color:var(--ink);border:1px solid var(--border)}
.empty .empty-cta:active{transform:scale(.96)}

/* Add-goal sheet: clear breathing room between Date and Duration on phones */
@media (max-width:900px){
  #date-duration-row{gap:14px;margin-bottom:18px}
  #date-duration-row .field label{margin-bottom:10px}
}

@media (prefers-reduced-motion:reduce){
  *{transition:none!important;animation:none!important}
}

/* Calendar day person cards */
.cal-day-people{display:flex;flex-direction:column;gap:10px;margin-top:4px;padding-bottom:18px}
.cal-person-card{
  background:var(--surface);border:1px solid var(--border);border-radius:16px;overflow:hidden;
}
.cal-person-head{
  width:100%;display:flex;align-items:center;gap:12px;padding:12px 14px;
  border:0;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer;
}
.cal-person-meta{flex:1;min-width:0}
.cal-person-name{font-size:14.5px;font-weight:600;color:var(--ink)}
.cal-person-sub{font-size:12px;color:var(--muted);margin-top:2px}
.cal-person-chev{color:var(--muted);transition:transform .2s ease;flex-shrink:0}
.cal-person-card.is-open .cal-person-chev{transform:rotate(180deg)}
.cal-person-body{padding:0 12px 12px;display:flex;flex-direction:column;gap:6px}
.cal-person-body[hidden]{display:none}
.cal-task-row{
  display:flex;align-items:center;gap:10px;padding:10px 10px;border-radius:12px;
  background:var(--surface-2);
}
.cal-task-row.is-done .cal-task-t{text-decoration:line-through;color:var(--muted)}
.cal-task-check{
  width:28px;height:28px;border-radius:50%;border:0;background:var(--surface);
  display:grid;place-items:center;color:var(--done);flex-shrink:0;cursor:pointer;
}
.cal-task-ring{
  width:16px;height:16px;border-radius:50%;border:1.5px solid var(--border);display:block;
}
.cal-task-main{flex:1;min-width:0}
.cal-task-t{font-size:13.5px;font-weight:550;color:var(--ink)}
.cal-task-d{font-size:11.5px;color:var(--muted);margin-top:3px;display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.cal-task-cat{
  display:inline-flex;align-items:center;gap:5px;font-weight:600;color:var(--cc);
}
.cal-task-cat::before{content:'';width:6px;height:6px;border-radius:50%;background:var(--cc)}
.cal-task-edit{
  border:0;background:transparent;color:var(--muted);font:inherit;font-size:12px;font-weight:600;cursor:pointer;padding:6px;
}
.cal-task-empty{font-size:13px;color:var(--muted);padding:8px 4px}
.cal-cell-dots{display:flex;gap:3px;min-height:8px;margin-top:4px}
.cal-dot{width:6px;height:6px;border-radius:50%;display:block}
.desk-cal .cal-cell.sel{outline:2px solid var(--ink);outline-offset:-2px}
.desk-cal .cal-cell{cursor:pointer}

/* Room member ⋯ */
.member-more{
  width:36px;height:36px;border-radius:10px;border:0;background:transparent;color:var(--muted);
  display:grid;place-items:center;cursor:pointer;flex-shrink:0;
}
.member-more:active{background:var(--surface-2);color:var(--ink)}

/* Settings outline buttons + legal — Mylo ink, not Duo cyan */
.acct-outline-btn{
  display:block;width:100%;margin:12px 0 4px;padding:14px 16px;border-radius:14px;
  border:1.5px solid var(--border);
  background:transparent;color:var(--ink);font:inherit;font-size:13.5px;font-weight:800;
  letter-spacing:.04em;text-transform:uppercase;cursor:pointer;text-align:center;
}
.acct-outline-btn:active{transform:scale(.98);background:var(--surface-2)}
.acct-legal{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:8px;margin:16px 0 6px}
.acct-legal span{color:var(--faint)}
.acct-legal a{font-size:12px;font-weight:600;color:var(--muted);text-decoration:none}
.acct-legal a:active{text-decoration:underline}
/* Detailed settings: full-height so the footer pins to the bottom */
.settings-drawer{display:flex;flex-direction:column;min-height:calc(100dvh - 96px)}
.settings-nav{flex:1}
.settings-group-h{
  font-size:12px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;
  color:var(--muted);margin:20px 4px 8px;
}
.settings-group-h:first-child{margin-top:8px}
.settings-item-tag{
  font-size:12px;font-weight:650;color:var(--muted);margin-left:auto;padding-right:8px;flex-shrink:0;
}
.settings-foot{margin-top:auto;padding-top:16px}
.settings-logout{
  width:100%;min-height:50px;border-radius:16px;
  border:1px solid color-mix(in srgb, #E11D48 40%, var(--border));
  background:color-mix(in srgb, #E11D48 8%, transparent);color:#E11D48;
  font:inherit;font-size:15px;font-weight:700;cursor:pointer;
  display:flex;align-items:center;justify-content:center;gap:8px;
}
.settings-logout:active{background:color-mix(in srgb, #E11D48 16%, transparent)}
.acct-sec{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:20px 0 8px}
.look-preview-suit{width:min(200px,52vw);height:min(200px,52vw);object-fit:contain;filter:drop-shadow(0 16px 28px rgba(0,0,0,.14))}
#add-chooser-sheet{padding-bottom:calc(12px + env(safe-area-inset-bottom))}

/* Flat settings (structure like Duo, Mylo colors) */
.acct-page-flat .acct-list{display:none}
.acct-head-line{border-bottom:1px solid var(--border);margin:0 -4px 8px;padding:4px 4px 12px}
.acct-flat-block{display:flex;flex-direction:column}
.acct-flat-row{
  width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;
  padding:15px 2px;border:0;border-bottom:1px solid var(--border);background:transparent;color:inherit;font:inherit;
  text-align:left;cursor:pointer;text-decoration:none;
}
.acct-flat-block .acct-flat-row:last-child{border-bottom:0}
.acct-flat-t{font-size:16px;font-weight:650;color:var(--ink);letter-spacing:-.01em}
.acct-flat-row .duo-row-chev{color:var(--muted);flex-shrink:0}
.acct-rule{height:1px;background:var(--border);margin:14px 0 2px;border:0}

/* Chat theme contrast — outranks the html[data-mood] bubble rules by specificity,
   so the thread always reads against its own theme, not the app theme. */
#m-chat[data-chat-theme] .chat-scroll,
#m-chat .chat[data-chat-theme] .chat-scroll{background:var(--bg)}
#m-chat[data-chat-theme] .chat-thread-head,
#m-chat .chat[data-chat-theme] .chat-thread-head{
  background:var(--bg);border-color:var(--border);color:var(--ink);
}
#m-chat[data-chat-theme] .chat-day span,
#m-chat .chat[data-chat-theme] .chat-day span{
  background:var(--surface-2);border-color:var(--border);color:var(--muted);
}
#m-chat[data-chat-theme] .sticker-bubble,
#m-chat .chat[data-chat-theme] .sticker-bubble{background:transparent}
#m-chat[data-chat-theme] .msg-card,
#m-chat .chat[data-chat-theme] .msg-card{
  background:var(--surface);border-color:var(--border);color:var(--ink);
}

/* Profile polish — keep original avatar size */
.duo-av-stage.is-tap{border:0;background:transparent;padding:0;cursor:pointer;display:block}

/* Settings as profile side-panel (drawer) */
.settings-drawer{
  display:flex;flex-direction:column;min-height:calc(100dvh - 120px);
  padding-bottom:calc(12px + env(safe-area-inset-bottom));
}
.settings-drawer .acct-head{margin-bottom:8px}
.settings-drawer .settings-nav{flex:1;padding:4px 0 8px}
.settings-drawer a.drawer-item{text-decoration:none;color:inherit}
.settings-drawer .settings-foot{margin-top:auto}
.settings-drawer .acct-legal{margin:14px 10px 4px}

/* Plan compare cards */
.plan-compare-h{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);margin:4px 0 10px}
.plan-compare{display:flex;flex-direction:column;gap:12px}
.plan-card-cmp{
  position:relative;padding:16px;border-radius:18px;border:1px solid var(--border);
  background:var(--surface);
}
.plan-card-cmp.is-rec{border-color:color-mix(in srgb, var(--ink) 35%, var(--border))}
.plan-card-cmp.is-current{box-shadow:inset 0 0 0 1.5px var(--ink)}
.plan-card-tag{
  display:inline-block;font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
  padding:4px 8px;border-radius:8px;background:var(--ink);color:var(--bg);margin-bottom:10px;
}
.plan-card-title{font-size:20px;font-weight:800;color:var(--ink);letter-spacing:-.02em}
.plan-card-blurb{font-size:13px;color:var(--muted);margin:4px 0 12px}
.plan-card-feats{list-style:none;margin:0 0 14px;padding:0;display:flex;flex-direction:column;gap:8px}
.plan-card-feats li{display:flex;gap:8px;align-items:flex-start;font-size:13.5px;color:var(--ink)}
.plan-card-cta{
  display:flex;align-items:center;justify-content:center;min-height:44px;border-radius:12px;
  border:1.5px solid var(--border);color:var(--ink);font-weight:750;text-decoration:none;font-size:14px;
}

/* ══════════════ Games in chat (chess · cards) ══════════════ */
.game-rail{
  display:flex;gap:12px;overflow-x:auto;-webkit-overflow-scrolling:touch;
  scroll-snap-type:x mandatory;padding:2px 0 10px;margin:0 -22px;
  padding-left:22px;padding-right:22px;scrollbar-width:none;
}
.game-rail::-webkit-scrollbar{display:none}
.game-card{
  flex:0 0 74%;max-width:270px;scroll-snap-align:start;
  display:flex;flex-direction:column;align-items:flex-start;gap:4px;
  padding:18px 16px 14px;border-radius:20px;text-align:left;
  background:var(--surface);border:1px solid var(--border);
  border-top:3px solid var(--gc,var(--ink));
}
.game-card:active{transform:scale(.985)}
.game-card-ic{font-size:30px;line-height:1;color:var(--gc,var(--ink))}
.game-card-n{font-size:17px;font-weight:700;color:var(--ink);letter-spacing:-.02em}
.game-card-b{font-size:13px;color:var(--muted);line-height:1.4;min-height:36px}
.game-card-go{
  margin-top:6px;font-size:12.5px;font-weight:700;color:var(--gc,var(--ink));
  letter-spacing:.02em;
}
/* in-chat card */
.game-card-msg{display:flex;flex-direction:column;gap:10px}
.game-card-msg.is-stale{opacity:.5}
.game-msg-head{display:flex;align-items:center;gap:10px}
.game-msg-ic{
  width:34px;height:34px;border-radius:11px;flex-shrink:0;
  display:grid;place-items:center;font-size:19px;
  background:color-mix(in srgb, var(--gc,var(--ink)) 14%, transparent);
  color:var(--gc,var(--ink));
}
.game-open-btn{
  width:100%;min-height:38px;border-radius:11px;font-size:13.5px;font-weight:600;
  background:var(--surface-2);color:var(--ink);border:1px solid var(--border);
}
.game-open-btn.is-turn{background:var(--ink);color:var(--bg);border-color:var(--ink)}
html[data-mood="dark"] .game-open-btn.is-turn{background:#EDEDED;color:#111}
.chess-mini{
  display:grid;grid-template-columns:repeat(8,minmax(0,1fr));grid-template-rows:repeat(8,minmax(0,1fr));
  width:100%;max-width:180px;aspect-ratio:1;border-radius:8px;overflow:hidden;border:1px solid var(--border);
}
.cmini-sq{
  position:relative;min-width:0;min-height:0;aspect-ratio:1;
  background:#EEEED2;
}
.cmini-sq.d{background:#769656}
.cmini-sq .cpc-svg{position:absolute;inset:8%;width:auto;height:auto}
.cards-mini{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.cards-mini-suit,.cards-mini-count{font-size:12.5px;color:var(--muted)}
.pcard{
  display:inline-flex;flex-direction:column;align-items:center;justify-content:center;
  width:38px;height:52px;border-radius:7px;background:#FFFFFF;color:#141414;
  border:1px solid rgba(0,0,0,.16);box-shadow:0 1px 2px rgba(0,0,0,.12);
  font-family:inherit;line-height:1.05;flex-shrink:0;
}
.pcard b{font-size:13px;font-weight:700}
.pcard i{font-size:15px;font-style:normal}
.pcard.red{color:#C42B1C}
.pcard.big{width:54px;height:74px}
.pcard.big b{font-size:17px}
.pcard.big i{font-size:21px}
.pcard.dim{opacity:.38}
/* overlay */
.game-overlay{
  position:fixed;inset:0;z-index:150;display:block;
  background:var(--bg);opacity:0;pointer-events:none;
  transition:opacity .22s ease;
}
.game-overlay.on{opacity:1;pointer-events:auto}
.game-sheet{
  position:absolute;inset:0;display:flex;flex-direction:column;
  width:100%;max-width:560px;margin:0 auto;background:var(--bg);
  padding:calc(10px + env(safe-area-inset-top)) 18px calc(28px + env(safe-area-inset-bottom) + 12px);
  transform:translateY(14px);transition:transform .26s cubic-bezier(.16,1,.3,1);
  overflow:hidden;
  box-sizing:border-box;
}
.game-overlay.on .game-sheet{transform:translateY(0)}
.game-body{
  flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;
  overflow-y:auto;-webkit-overflow-scrolling:touch;
  padding-bottom:8px;
}
.game-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px;flex-shrink:0}
.game-brand{font-size:13px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.game-hint{font-size:12.5px;color:var(--muted);text-align:center;margin-top:12px;line-height:1.4}
/* chess board */
.cboard-meta{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  font-size:11.5px;color:var(--muted);margin-bottom:8px;
}
.cb-status{font-weight:700;color:var(--ink);text-align:center;flex:1;min-width:0}
.cb-who{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:34%}
.cboard{
  display:grid;
  grid-template-columns:repeat(8,minmax(0,1fr));
  grid-template-rows:repeat(8,minmax(0,1fr));
  width:min(100%, min(92vw, 420px));
  aspect-ratio:1;
  margin:0 auto;
  border-radius:10px;
  overflow:hidden;
  border:1px solid var(--border);
  flex-shrink:0;
  background:#c8a45a;
}
.csq{
  position:relative;
  display:block;
  border:0;padding:0;margin:0;
  min-width:0;min-height:0;
  aspect-ratio:1;
  background:#EEEED2;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.csq.d{background:#769656}
.csq.last::after{content:"";position:absolute;inset:0;background:rgba(155,199,0,.41);pointer-events:none}
.csq.sel::after{content:"";position:absolute;inset:0;background:rgba(20,85,30,.5);pointer-events:none}
.csq.tgt::before{
  content:"";position:absolute;left:50%;top:50%;width:28%;height:28%;
  transform:translate(-50%,-50%);border-radius:50%;
  background:rgba(0,0,0,.18);z-index:1;pointer-events:none;
}
.csq.tgt:has(.cpc)::before{
  width:88%;height:88%;background:none;
  border:3px solid rgba(0,0,0,.18);border-radius:50%;
}
.csq:disabled{cursor:default}
.cpc{
  position:absolute;inset:6%;
  display:grid;place-items:center;
  z-index:2;pointer-events:none;
  line-height:0;
}
.cpc-svg{width:100%;height:100%;display:block}
.cpc-g{font-size:clamp(18px,5.5vw,34px);line-height:1}
/* cards table */
.cards-table{display:flex;flex-direction:column;gap:14px}
.cards-opp{font-size:12.5px;color:var(--muted);text-align:center}
.cards-pile{display:flex;align-items:center;justify-content:center;gap:14px}
.cards-suit{font-size:13px;color:var(--muted)}
.cards-suit b{font-size:17px;color:var(--ink)}
.cards-hand{
  display:flex;gap:6px;overflow-x:auto;-webkit-overflow-scrolling:touch;
  padding:4px 2px 8px;scrollbar-width:none;
}
.cards-hand::-webkit-scrollbar{display:none}
.cards-empty{font-size:13px;color:var(--muted)}
.cards-actions{display:flex;gap:10px}
.cards-actions .btn-secondary{flex:1}
.suit-pick{
  display:flex;align-items:center;gap:8px;justify-content:center;flex-wrap:wrap;
  margin-top:14px;padding:12px;border-radius:14px;
  background:var(--surface-2);border:1px solid var(--border);
}
.suit-pick > span{font-size:13px;color:var(--muted);width:100%;text-align:center}
.suit-pick .pcard{width:44px;height:44px;border-radius:10px}

/* ══════════════ Quick to-do ══════════════ */
.todo-block{
  margin:0 0 var(--stack);padding:14px 16px 12px;border-radius:18px;
  background:var(--surface);border:1px solid var(--border);
}
.todo-head{display:flex;align-items:center;gap:10px;margin-bottom:2px}
.todo-h{font-size:14px;font-weight:700;color:var(--ink);letter-spacing:-.01em}
.todo-count{font-size:12px;color:var(--muted);margin-right:auto}
.todo-add{
  width:30px;height:30px;border-radius:50%;flex-shrink:0;
  display:grid;place-items:center;font-size:19px;line-height:1;font-weight:400;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
}
.todo-add:active{transform:scale(.94)}
.todo-list{display:flex;flex-direction:column;margin-top:8px}
.todo-row{display:flex;align-items:center;gap:11px;padding:9px 0;border-top:1px solid var(--border-2)}
.todo-row:first-child{border-top:0}
.todo-check{
  width:21px;height:21px;border-radius:50%;flex-shrink:0;
  border:1.8px solid var(--faint);background:transparent;position:relative;
}
.todo-check.on{background:var(--done);border-color:var(--done)}
.todo-check.on::after{
  content:"";position:absolute;left:6px;top:2.5px;width:5px;height:10px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);
}
.todo-t{flex:1;min-width:0;font-size:14.5px;color:var(--ink);overflow-wrap:anywhere;text-align:left}
.todo-row.done .todo-t{color:var(--muted);text-decoration:line-through}
.todo-x{
  width:26px;height:26px;border-radius:8px;flex-shrink:0;
  display:grid;place-items:center;color:var(--faint);background:transparent;border:0;
}
.todo-x:active{background:var(--surface-2);color:var(--ink)}
.todo-empty{
  display:block;width:100%;text-align:left;margin-top:8px;padding:10px 0 2px;
  font-size:13px;color:var(--muted);background:none;border:0;line-height:1.4;
}

/* ══════════════ Avatar layer fit ══════════════
   Measured with getBBox() against the shared 0 0 80 80 frame:
     base face   x10.1-69.9  (59.8 wide)
     eyes        44.0 wide  = 74% of the face
     glasses     54.0 wide  = 90% of the face
     headset     58.5 wide  = 98% of the face
   The parts were drawn to the FRAME, not to the FACE, so they overhang the
   head. Scaling about the frame centre (which is also the face centre, x40)
   seats them on the face without touching the artwork. */
:root{
  --av-eyes-scale:.80;
  --av-mouth-scale:.90;
  --av-acc-scale:.80;
}
.avatar-layer-eyes{transform:scale(var(--av-eyes-scale));transform-origin:50% 50%}
.avatar-layer-mouth{transform:scale(var(--av-mouth-scale));transform-origin:50% 50%}
.avatar-layer-accessories{transform:scale(var(--av-acc-scale));transform-origin:50% 50%}

/* Profile stat icons read as afterthoughts at 16px in a 40px tile. */
.duo-stat-ic{
  width:34px;height:34px;border-radius:11px;
  display:grid;place-items:center;flex-shrink:0;
  background:color-mix(in srgb, currentColor 14%, transparent);
}
.duo-stat-ic svg{width:20px;height:20px}

/* ── game shell: both players, iMessage style ── */
.gplayers{
  display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:10px;
  padding:2px 0 16px;flex-shrink:0;
}
.gplayer{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
.gplayer-av{
  width:46px;height:46px;border-radius:50%;display:grid;place-items:center;overflow:hidden;
  background:var(--surface-2);border:2px solid transparent;transition:border-color .2s;
}
.gplayer.is-active .gplayer-av{border-color:#58CC02;box-shadow:0 0 0 3px rgba(88,204,2,.16)}
.avatar-gp,.avatar-stack.avatar-gp{width:42px;height:42px}
.gplayer-ghost{font-size:18px;color:var(--faint)}
.gplayer-n{
  font-size:12.5px;font-weight:700;color:var(--ink);max-width:100%;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.gplayer-s{font-size:10.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.gstatus{
  font-size:13px;font-weight:700;color:var(--ink);text-align:center;
  padding:7px 12px;border-radius:100px;background:var(--surface-2);
  border:1px solid var(--border);white-space:nowrap;
}
.gboard-wrap{flex:1;min-height:0;display:flex;flex-direction:column;justify-content:center}

/* ── notifications ── */
.notif-badge{
  position:absolute;top:-3px;right:-3px;min-width:16px;height:16px;padding:0 4px;
  border-radius:100px;background:#E5484D;color:#fff;font-size:10px;font-weight:700;
  display:grid;place-items:center;line-height:1;
}
.m-top-action{position:relative}
.notif-list{display:flex;flex-direction:column;gap:2px;overflow-y:auto;flex:1;min-height:0}
.notif-row{
  display:flex;align-items:flex-start;gap:12px;padding:14px 0;
  border-top:1px solid var(--border-2);
}
.notif-row:first-child{border-top:0}
.notif-ic{
  width:38px;height:38px;border-radius:12px;flex-shrink:0;
  display:grid;place-items:center;font-size:18px;
  background:color-mix(in srgb, var(--nc,var(--ink)) 15%, transparent);color:var(--nc,var(--ink));
}
.notif-copy{flex:1;min-width:0}
.notif-t{font-size:14.5px;font-weight:600;color:var(--ink);overflow-wrap:anywhere}
.notif-b{font-size:13px;color:var(--muted);margin-top:2px;overflow-wrap:anywhere}
.notif-actions{display:flex;gap:8px;margin-top:10px}
.notif-actions .btn-dark,.notif-actions .btn-secondary{
  flex:1;min-height:38px;padding:0 14px;font-size:13.5px;border-radius:11px;
}
.notif-x{
  width:26px;height:26px;border-radius:8px;flex-shrink:0;
  display:grid;place-items:center;color:var(--faint);background:transparent;border:0;
}
.notif-x:active{background:var(--surface-2);color:var(--ink)}
.avatar-todo,.avatar-stack.avatar-todo{width:20px;height:20px}
.todo-owner{width:20px;height:20px;flex-shrink:0;opacity:.75;display:grid;place-items:center}
.todo-check:disabled{opacity:.45}

/* ── quick to-do sheet: one big field, three chips, nothing cramped ── */
.todo-form{display:flex;flex-direction:column;gap:20px;margin-bottom:20px}
.todo-big-in{
  width:100%;min-height:56px;padding:14px 16px;border-radius:14px;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
  font-weight:500;line-height:1.35;
}
.todo-big-in:focus{background:var(--surface);border-color:var(--text-2)}
.todo-big-in::placeholder{color:var(--muted);opacity:.65}
.todo-when{display:flex;flex-direction:column;gap:10px}
.todo-when-l{
  font-size:11.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;color:var(--muted);
}
.todo-when-opts{display:flex;gap:8px}
.todo-chip{
  flex:1;min-height:46px;border-radius:13px;font-size:14px;font-weight:600;
  background:var(--surface-2);border:1px solid var(--border);color:var(--text-2);
  transition:background .15s, color .15s, border-color .15s;
}
.todo-chip.is-on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
html[data-mood="dark"] .todo-chip.is-on{background:#EDEDED;color:#111;border-color:#EDEDED}

/* ── plus sheet ── */
.plus-grid{
  display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
  padding:4px 2px 8px;
}
.plus-tile{
  display:flex;flex-direction:column;align-items:flex-start;gap:14px;
  padding:16px;border-radius:18px;font-size:13.5px;font-weight:650;
  border:1px solid var(--border);background:var(--surface);color:var(--ink);
  text-align:left;min-height:108px;
}
.plus-tile:active{transform:scale(.97)}
.plus-ic{
  width:44px;height:44px;border-radius:14px;display:grid;place-items:center;
  font-size:20px;opacity:1;background:var(--surface-2);color:var(--ink);
}
.plus-tile[data-plus="sticker"] .plus-ic{background:#FFF3D6}
.plus-tile[data-plus="task"] .plus-ic{background:#E4F4FF}
.plus-tile[data-plus="note"] .plus-ic{background:#EDE8FF}
.plus-tile[data-plus="poll"] .plus-ic{background:#E5F8EE}
.plus-tile[data-plus="game"] .plus-ic{background:#FFE8E2}

/* ── app launcher rows (Apps -> Chess/Cards) ── */
.launch-list{display:flex;flex-direction:column;gap:10px}
.launch-row{
  display:flex;align-items:center;gap:14px;width:100%;text-align:left;
  padding:15px 16px;border-radius:16px;
  background:var(--surface);border:1px solid var(--border);
}
.launch-row.is-soft{opacity:.72}
.launch-row:disabled{opacity:.55;cursor:default}
.launch-ic{
  width:44px;height:44px;border-radius:14px;flex-shrink:0;
  display:grid;place-items:center;font-size:21px;
  background:color-mix(in srgb, var(--gc,var(--ink)) 15%, transparent);color:var(--gc,var(--ink));
}
.launch-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.launch-t{font-size:15px;font-weight:600;color:var(--ink)}
.launch-d{font-size:12.5px;color:var(--muted)}

/* ── add to home screen ── */
.install-hero{text-align:center;padding:4px 4px 18px}
.install-mark{width:62px;height:62px;border-radius:16px;display:block;margin:0 auto 14px;box-shadow:var(--shadow-pop)}
.install-hero h3{font-size:19px;font-weight:700;color:var(--ink);letter-spacing:-.02em;margin-bottom:6px}
.install-hero p{font-size:13.5px;color:var(--muted);line-height:1.45;max-width:34ch;margin:0 auto}
.install-steps{list-style:none;display:flex;flex-direction:column;gap:10px;margin:0 0 18px;padding:0}
.install-steps li{
  display:flex;align-items:center;gap:11px;font-size:14px;color:var(--text);
  padding:11px 13px;border-radius:13px;background:var(--surface-2);
}
.install-steps li b{color:var(--ink);font-weight:650}
.install-step-n{
  width:22px;height:22px;border-radius:50%;flex-shrink:0;
  display:grid;place-items:center;font-size:11.5px;font-weight:700;
  background:var(--ink);color:var(--bg);
}
html[data-mood="dark"] .install-step-n{background:#EDEDED;color:#111}
.install-steps-note{font-size:13.5px;color:var(--muted);text-align:center;margin-bottom:18px}

/* ══════════════ Colour Rush — 2-4 player table ══════════════ */
:root{
  --rc-r:#D4564F; --rc-g:#8CBF6A; --rc-b:#4FA3D9; --rc-y:#E8B84B; --rc-w:#3B3B4F;
}
.rush-table{
  display:flex;flex-direction:column;gap:14px;flex:1;min-height:0;
  justify-content:space-between;   /* seats top, pile centred, hand at the bottom */
}
.rush-mid{flex:1;min-height:0}

/* seats around the table */
.rseats{
  display:flex;gap:10px;justify-content:center;flex-wrap:wrap;
  padding:2px 0 4px;flex-shrink:0;
}
.rseat{
  display:flex;flex-direction:column;align-items:center;gap:3px;
  min-width:60px;padding:8px 10px;border-radius:16px;
  background:var(--surface-2);border:1.5px solid transparent;transition:border-color .2s,background .2s;
}
.rseat.is-active{border-color:#58CC02;background:color-mix(in srgb,#58CC02 10%,var(--surface))}
.rseat-av{width:38px;height:38px;border-radius:50%;overflow:hidden;display:grid;place-items:center}
.rseat-n{
  font-size:11.5px;font-weight:700;color:var(--ink);max-width:74px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.rseat-c{
  font-size:11px;font-weight:700;color:var(--muted);
  padding:1px 7px;border-radius:100px;background:var(--surface-3);
}
.rseat-c.is-low{background:#D4564F;color:#fff}

/* middle: draw pile, discard, colour dot */
.rush-mid{
  display:flex;align-items:center;justify-content:center;gap:18px;
  padding:10px 0;position:relative;
}
.rush-deck{
  width:62px;height:88px;border-radius:12px;flex-shrink:0;
  background:var(--rc-w);border:3px solid #fff;box-shadow:0 3px 10px rgba(0,0,0,.22);
  display:grid;place-items:center;cursor:pointer;
  background-image:repeating-linear-gradient(45deg,rgba(255,255,255,.07) 0 6px,transparent 6px 12px);
}
.rush-deck[aria-disabled="true"]{opacity:.5;cursor:default}
.rush-deck-n{font-size:14px;font-weight:800;color:#fff}
.rush-colour{
  width:20px;height:20px;border-radius:50%;flex-shrink:0;
  border:2.5px solid var(--surface);box-shadow:0 1px 4px rgba(0,0,0,.2);
}
.rc-dot-r{background:var(--rc-r)} .rc-dot-g{background:var(--rc-g)}
.rc-dot-b{background:var(--rc-b)} .rc-dot-y{background:var(--rc-y)}
.rc-dot-w{background:linear-gradient(135deg,var(--rc-r) 0 25%,var(--rc-y) 25% 50%,var(--rc-g) 50% 75%,var(--rc-b) 75%)}

.rush-status{
  text-align:center;font-size:13.5px;font-weight:700;color:var(--muted);flex-shrink:0;
}
.rush-status.is-you{color:#58CC02}

/* the cards themselves */
.rcard{
  position:relative;flex-shrink:0;
  width:58px;height:84px;border-radius:11px;border:3px solid #fff;
  background:var(--rc-w);box-shadow:0 2px 7px rgba(0,0,0,.2);
  display:grid;place-items:center;padding:0;overflow:hidden;
  transition:transform .16s ease, opacity .16s ease;
}
.rcard.rc-r{background:var(--rc-r)} .rcard.rc-g{background:var(--rc-g)}
.rcard.rc-b{background:var(--rc-b)} .rcard.rc-y{background:var(--rc-y)}
.rcard.rc-w{background:linear-gradient(135deg,var(--rc-r) 0 25%,var(--rc-y) 25% 50%,var(--rc-g) 50% 75%,var(--rc-b) 75%)}
/* the pale oval the numeral sits on, as in the reference kit */
.rcard::before{
  content:"";position:absolute;left:50%;top:50%;
  width:118%;height:56%;transform:translate(-50%,-50%) rotate(-32deg);
  background:rgba(255,255,255,.9);border-radius:50%;
}
.rcard-c{
  position:relative;z-index:1;font-size:26px;font-weight:800;line-height:1;
  color:var(--rc-w);letter-spacing:-.03em;
}
.rcard-m{
  position:absolute;left:5px;top:3px;z-index:1;
  font-size:11px;font-weight:800;color:#fff;line-height:1;
}
.rcard.big{width:74px;height:106px}
.rcard.big .rcard-c{font-size:34px}
.rcard.big .rcard-m{font-size:13px}
.rcard.dim{opacity:.42}
.rcard:not(.dim):active{transform:translateY(-4px) scale(1.03)}

.rush-hand{
  display:flex;gap:6px;overflow-x:auto;-webkit-overflow-scrolling:touch;
  padding:8px 2px 10px;scrollbar-width:none;flex-shrink:0;
}
.rush-hand::-webkit-scrollbar{display:none}
.rush-actions{display:flex;gap:10px;flex-shrink:0}
.rush-actions .btn-secondary{flex:1}

/* wild colour picker */
.colour-pick{
  margin-top:14px;padding:14px;border-radius:16px;text-align:center;
  background:var(--surface-2);border:1px solid var(--border);
}
.colour-pick > span{display:block;font-size:13px;color:var(--muted);margin-bottom:10px}
.colour-pick-row{display:flex;gap:12px;justify-content:center}
.rc-swatch{
  width:52px;height:52px;border-radius:14px;border:3px solid #fff;
  box-shadow:0 2px 8px rgba(0,0,0,.18);
}
.rc-swatch:active{transform:scale(.94)}
.rc-swatch.rc-r{background:var(--rc-r)} .rc-swatch.rc-g{background:var(--rc-g)}
.rc-swatch.rc-b{background:var(--rc-b)} .rc-swatch.rc-y{background:var(--rc-y)}

/* in-chat preview */
.rush-mini{display:flex;align-items:center;gap:12px}
.rush-mini-seats{display:flex;gap:8px;flex-wrap:wrap}
.rush-mini-seat{
  display:flex;align-items:center;gap:4px;padding:3px 8px 3px 3px;
  border-radius:100px;background:var(--surface-2);font-size:12px;font-weight:700;color:var(--muted);
}
.rush-mini-seat.is-on{background:color-mix(in srgb,#58CC02 16%,var(--surface-2));color:var(--ink)}
.avatar-rmini,.avatar-stack.avatar-rmini{width:20px;height:20px}

/* Every person wears the same badge as Mylo: a 12px squircle with a hairline
   border and the same ground, so the corners are always covered and a human
   avatar sits identically to the assistant's in a list. */
.avatar-img, .m-avatar, .avatar-stack, .avatar-slot,
.chat-row-av, .msg-ava{
  border-radius:12px;
  border:1px solid var(--border);
  background:#E8EDF2;
  overflow:hidden;
  box-sizing:border-box;
}
html[data-mood="dark"] .avatar-img,
html[data-mood="dark"] .m-avatar,
html[data-mood="dark"] .avatar-stack,
html[data-mood="dark"] .avatar-slot,
html[data-mood="dark"] .chat-row-av,
html[data-mood="dark"] .msg-ava{background:var(--surface-2)}
.avatar-img.is-photo, .avatar-stack.is-photo > img, .avatar-slot.is-photo > img{
  border-radius:inherit;
}
/* The round slots that are meant to be round stay round. */
.m-avatar.avatar-slot, .gplayer-av, .rseat-av, .sc-score-av,
.avatar-stack.avatar-gp, .avatar-stack.avatar-todo, .avatar-stack.avatar-rmini{
  border-radius:50%;
}

/* ══════════════ mini app shell ══════════════ */
.mini-app{display:flex;flex-direction:column;gap:18px}
.mini-head{display:flex;align-items:center;gap:10px}
.mini-back,.mini-add{
  width:34px;height:34px;border-radius:50%;flex-shrink:0;
  display:grid;place-items:center;background:var(--surface-2);
  border:1px solid var(--border);color:var(--ink);
}
.mini-add{margin-left:auto;font-size:19px;line-height:1}
.mini-t{font-size:20px;font-weight:700;letter-spacing:-.02em;color:var(--ink);margin:0}

/* head-to-head record */
.gstatus-wrap{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0}
.h2h{
  display:flex;align-items:center;gap:7px;font-size:11.5px;color:var(--muted);
  font-variant-numeric:tabular-nums;justify-content:center;
}
.h2h-p b{color:var(--ink);font-weight:700}
.h2h-x{opacity:.5}

/* ══════════════ Avatar stack integrity ══════════════
   .avatar-stack composites its layers with `grid-area:1/1`. Several sizing
   rules were overriding it to display:block, which broke the stack — the
   masked body still painted but eyes/mouth/accessories flowed out of the
   28px box and were clipped away. That is the "blank body in chat" bug.
   Sizing rules may set width/height; the display mode is not theirs to change. */
.avatar-stack,
.msg-ava .avatar-stack,
.pb-av .avatar-stack,
.avatar-stack.avatar-msg,
.avatar-stack.avatar-pb,
.avatar-stack.avatar-gp,
.avatar-stack.avatar-40,
.avatar-stack.avatar-md,
.avatar-stack.avatar-lg,
.avatar-stack.avatar-todo,
.avatar-stack.avatar-rmini,
.avatar-stack.drawer-av,
.avatar-stack.desk-settings-face{
  display:inline-grid !important;
  place-items:center;
  overflow:hidden;
}
.avatar-stack > .avatar-layer,
.avatar-stack > .avatar-layer-base{
  grid-area:1 / 1;
  width:100%;height:100%;
  display:block;
}

/* One ring for every person, matching the Mylo bot avatar, so a human and the
   assistant read as the same kind of thing in a thread. */
.msg-ava,
.chat-row-av,
.mylo-head-ava,
.auth-chat-ava{
  border-radius:50%;
  border:1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  background:var(--surface-2);
  box-sizing:border-box;
  overflow:hidden;
}

/* App artwork — the uploaded 400×400 SVGs already include their own rounded
   gradient tile, so they replace the coloured square entirely. */
img.app-ic-art{
  background:none;border:0;padding:0;
  object-fit:cover;display:block;
}
.app-ic-lg{width:52px;height:52px;border-radius:15px;flex-shrink:0}

/* game launcher: pick who you are playing */
.launch-label{
  font-size:11.5px;font-weight:700;letter-spacing:.07em;text-transform:uppercase;
  color:var(--muted);margin:16px 0 10px;
}
.launch-friends{display:flex;flex-direction:column;gap:8px;margin-bottom:6px}
.launch-friend{
  display:flex;align-items:center;gap:12px;width:100%;text-align:left;
  padding:10px 14px;border-radius:14px;font-size:14.5px;color:var(--ink);
  background:var(--surface-2);border:1.5px solid transparent;
}
.launch-friend.is-on{border-color:var(--ink);background:var(--surface)}
html[data-mood="dark"] .launch-friend.is-on{border-color:#EDEDED}

/* win / lose celebration, iMessage style */
.game-end{
  position:absolute;inset:0;z-index:5;display:grid;place-items:center;
  pointer-events:none;
}
.game-end-card{
  display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:26px 34px;border-radius:24px;
  background:color-mix(in srgb, var(--surface) 78%, transparent);
  backdrop-filter:blur(18px) saturate(140%);
  -webkit-backdrop-filter:blur(18px) saturate(140%);
  border:1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  box-shadow:0 24px 60px -18px rgba(0,0,0,.4);
  animation:gameEndPop .5s cubic-bezier(.16,1.4,.3,1) both;
}
.game-end-ic{
  width:74px;height:74px;object-fit:contain;display:block;
  filter:drop-shadow(0 8px 18px rgba(0,0,0,.28));
  animation:gameEndSpin .7s cubic-bezier(.16,1,.3,1) both;
}
.game-end-t{font-size:22px;font-weight:800;letter-spacing:-.03em;color:var(--ink)}
.game-end-s{font-size:13px;color:var(--muted)}
@keyframes gameEndPop{from{opacity:0;transform:scale(.82)}to{opacity:1;transform:scale(1)}}
@keyframes gameEndSpin{from{transform:scale(.3) rotate(-24deg)}to{transform:scale(1) rotate(0)}}
@media (prefers-reduced-motion:reduce){
  .game-end-card,.game-end-ic{animation:none}
}

/* ══════════════ Scrabble ══════════════
   The board carries its own palette rather than the theme's. A board built on
   --surface turned black in dark mode and swallowed its own letters. */
.sc-table{
  display:flex;flex-direction:column;gap:14px;flex:1;min-height:0;
  --sc-felt:#B9A98C;   /* the lines between squares */
  --sc-sq:#EFE8D8;     /* a plain square */
  --sc-ink:#111111;    /* letters on tiles: black */
  --sc-sub:#6E6E73;    /* tile values */
  --sc-tile:#FFFFFF;   /* tiles: white */
}
.sc-scores{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;flex-shrink:0}
.sc-score{
  display:flex;align-items:center;gap:8px;padding:6px 13px 6px 6px;border-radius:100px;
  background:var(--surface-2);border:1.5px solid transparent;font-size:12.5px;color:var(--muted);
  transition:border-color .18s ease,background .18s ease;
}
.sc-score.is-active{
  border-color:var(--done);
  background:color-mix(in srgb,var(--done) 12%,var(--surface));
}
.sc-score-n{font-weight:600;color:var(--ink)}
.sc-score b{font-variant-numeric:tabular-nums;color:var(--ink);font-size:15px;font-weight:800}
.sc-words-btn{
  display:inline-flex;align-items:center;gap:6px;padding:6px 12px;border-radius:100px;cursor:pointer;
  background:var(--surface-2);border:1.5px solid transparent;color:var(--ink);
  font-size:13px;font-weight:800;letter-spacing:-.01em;
}
.sc-words-btn b{
  min-width:18px;height:18px;padding:0 5px;border-radius:100px;
  background:var(--streak,#FF9600);color:#fff;font-size:10.5px;font-weight:800;line-height:18px;text-align:center;
}
.sc-words-btn:active{transform:scale(.95)}

/* Dark mode gets its own board rather than the light one dropped onto a black
   screen — that was a bright slab glaring out of the page. Dark felt, muted
   premiums, and the tiles stay cream, because cream tiles on a dark board is
   what a real board looks like at night and it keeps the letters readable. */
html[data-mood="dark"] .sc-table{
  --sc-felt:#20202A;
  --sc-sq:#32323E;
  --sc-tile:#FFFFFF;
  --sc-ink:#111111;
  --sc-sub:#6E6E73;
}
html[data-mood="dark"] .sc-sq.p-tw{background:#7C3F39} 
html[data-mood="dark"] .sc-sq.p-dw{background:#6B4A47}
html[data-mood="dark"] .sc-sq.p-tl{background:#3A5877} 
html[data-mood="dark"] .sc-sq.p-dl{background:#41586B}
html[data-mood="dark"] .sc-prem{color:rgba(255,255,255,.5)}
html[data-mood="dark"] .sc-sq.is-star .sc-prem{color:rgba(255,255,255,.42)}
html[data-mood="dark"] .sc-sq.is-open{outline-color:rgba(255,255,255,.42)}
@keyframes scOpenDark{0%,100%{outline-color:rgba(255,255,255,.42)}50%{outline-color:rgba(255,255,255,.15)}}
html[data-mood="dark"] .sc-sq.is-open{animation-name:scOpenDark}
html[data-mood="dark"] .sc-board{
  box-shadow:0 10px 30px -14px #000,inset 0 0 0 1px rgba(255,255,255,.06);
}
html[data-mood="dark"] .sc-rack{box-shadow:inset 0 2px 8px rgba(0,0,0,.5)}

.sc-board-wrap{display:flex;justify-content:center;flex-shrink:0}
.sc-board{
  display:grid;grid-template-columns:repeat(15,1fr);gap:1.5px;
  width:100%;max-width:min(92vw,430px);aspect-ratio:1;
  padding:6px;border-radius:14px;
  background:var(--sc-felt);
  box-shadow:0 10px 30px -12px rgba(0,0,0,.45),inset 0 0 0 1px rgba(0,0,0,.08);
}
.sc-sq{
  background:var(--sc-sq);border:0;padding:0;position:relative;
  display:grid;place-items:center;border-radius:2.5px;min-width:0;
  -webkit-tap-highlight-color:transparent;
}
.sc-sq.p-tw{background:#E07A6C} .sc-sq.p-dw{background:#EFAFA6}
.sc-sq.p-tl{background:#6E9CC9} .sc-sq.p-dl{background:#B3D2E8}
/* an empty square you can drop the picked tile onto */
.sc-sq.is-open{
  outline:1.5px dashed rgba(0,0,0,.38);outline-offset:-3px;
  animation:scOpen 1.6s ease-in-out infinite;
}
@keyframes scOpen{0%,100%{outline-color:rgba(0,0,0,.38)}50%{outline-color:rgba(0,0,0,.14)}}
@media (prefers-reduced-motion:reduce){.sc-sq.is-open{animation:none}}
.sc-sq:not([disabled]):active{filter:brightness(.94)}
.sc-prem{
  font-size:clamp(5px,1.75vw,8px);font-weight:800;line-height:1;
  letter-spacing:.02em;color:rgba(0,0,0,.52);
}
.sc-sq.is-star .sc-prem{font-size:clamp(9px,3vw,15px);color:rgba(0,0,0,.4)}

.sc-tile{
  position:absolute;inset:1px;border-radius:3px;background:var(--sc-tile);
  display:grid;place-items:center;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75),0 1px 2px rgba(0,0,0,.28);
}
.sc-sq.is-draft .sc-tile{
  background:#FFFFFF;box-shadow:0 0 0 2px #F59E0B,0 2px 6px rgba(0,0,0,.3);
}
.sc-tile b{
  font-size:clamp(9px,3.1vw,16px);font-weight:800;color:var(--sc-ink);line-height:1;
}
.sc-tile i{
  position:absolute;right:1.5px;bottom:0.5px;font-style:normal;
  font-size:clamp(4px,1.5vw,7px);font-weight:700;color:var(--sc-sub);line-height:1;
}
.sc-tile.is-blank b{color:#8E8E93}

.sc-note{
  font-size:12.5px;color:var(--muted);text-align:center;flex-shrink:0;
  overflow-wrap:anywhere;line-height:1.45;
}
.sc-rack{
  display:flex;gap:clamp(4px,1.2vw,6px);justify-content:center;flex-wrap:nowrap;
  padding:10px;border-radius:16px;flex-shrink:0;
  background:var(--sc-felt);
  box-shadow:inset 0 2px 6px rgba(0,0,0,.22);
}
.sc-rack-t{
  /* seven tiles must fit a 320px phone: 7 x 34 + gaps + padding */
  position:relative;width:clamp(34px,10.4vw,40px);height:clamp(40px,12vw,46px);border-radius:7px;background:var(--sc-tile);
  border:0;display:grid;place-items:center;cursor:pointer;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 2px 3px rgba(0,0,0,.3);
  transition:transform .14s cubic-bezier(.2,1.3,.4,1),box-shadow .14s ease;
  -webkit-tap-highlight-color:transparent;
}
.sc-rack-t.is-on{
  transform:translateY(-7px);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 0 0 2px #F59E0B,0 7px 12px -3px rgba(0,0,0,.45);
}
.sc-rack-t:disabled{opacity:.55;cursor:default}
.sc-rack-t b{font-size:19px;font-weight:800;color:var(--sc-ink);line-height:1}
.sc-rack-t i{
  position:absolute;right:4px;bottom:2px;font-style:normal;
  font-size:9.5px;font-weight:700;color:var(--sc-sub);line-height:1;
}
.sc-actions{display:flex;gap:8px;flex-shrink:0}
.sc-actions button{flex:1;min-height:46px;font-size:14.5px;font-weight:650}
.sc-mini{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:8px 2px 2px;font-size:12.5px;color:var(--muted);
}
.sc-mini-board{
  font-size:11px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;
  color:var(--ink);background:color-mix(in srgb,#C89B5A 18%,var(--surface));
  border:1px solid color-mix(in srgb,#C89B5A 35%,var(--border));
  border-radius:8px;padding:4px 8px;
}
.sc-mini-scores{font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
.sc-mini-bag{margin-left:auto}
.letter-pick{
  position:absolute;inset:0;z-index:12;display:flex;align-items:flex-end;justify-content:center;
  background:rgba(0,0,0,.42);
  animation:lpFade .18s ease both;
}
@keyframes lpFade{from{opacity:0}to{opacity:1}}
.letter-pick-card{
  width:100%;max-width:520px;box-sizing:border-box;
  padding:16px 16px calc(env(safe-area-inset-bottom,0px) + 16px);
  border-radius:22px 22px 0 0;background:var(--surface);
  box-shadow:0 -12px 40px -16px rgba(0,0,0,.5);
  animation:lpUp .24s cubic-bezier(.16,1,.3,1) both;
}
@keyframes lpUp{from{transform:translateY(100%)}to{transform:none}}
.letter-pick-h{display:flex;flex-direction:column;gap:2px;margin-bottom:14px;text-align:left}
.letter-pick-h b{font-size:16px;font-weight:800;color:var(--ink);letter-spacing:-.02em}
.letter-pick-h span{font-size:12.5px;color:var(--muted)}
/* six to a row: 26 letters land as 5 full rows and 2 tiles, each a real tap target */
.letter-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px}
.letter-grid button{
  aspect-ratio:1;min-height:0;border-radius:10px;cursor:pointer;
  background:#FFFFFF;color:#111111;border:0;
  font-weight:800;font-size:18px;line-height:1;
  box-shadow:inset 0 0 0 1px rgba(0,0,0,.08),0 2px 0 rgba(0,0,0,.14);
}
.letter-grid button:active{transform:translateY(1px);box-shadow:inset 0 0 0 1px rgba(0,0,0,.08)}
.letter-pick-x{
  display:block;width:100%;margin-top:14px;min-height:46px;border-radius:13px;cursor:pointer;
  border:1px solid var(--border);background:transparent;color:var(--ink);font-size:14px;font-weight:650;
}
@media (prefers-reduced-motion:reduce){.letter-pick,.letter-pick-card{animation:none}}

/* ══════════════ Standing record, on every board ══════════════ */
.scoreboard{
  display:flex;align-items:center;gap:10px;justify-content:center;
  padding:8px 14px;margin:0 auto 12px;border-radius:100px;flex-shrink:0;
  background:color-mix(in srgb, var(--ink) 5%, var(--surface-2));
  border:1px solid var(--border);width:max-content;max-width:100%;
}
.sb-k{
  font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);
}
.sb-p{display:inline-flex;align-items:center;gap:5px;font-variant-numeric:tabular-nums}
.sb-p b{font-size:15px;font-weight:800;color:var(--muted)}
.sb-p.is-top b{color:var(--ink)}

/* ══════════════ Games drawer — tiles, like iMessage ══════════════ */
.game-rail{
  display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px 12px;
  padding:4px 0 8px;margin:0;overflow:visible;
}
.game-tile{
  display:flex;flex-direction:column;align-items:center;gap:8px;
  background:none;border:0;padding:0;min-width:0;
}
.game-tile:active{transform:scale(.95)}
.game-tile-art{position:relative;display:block;width:100%;aspect-ratio:1}
.game-tile-ic{
  width:100%;height:100%;border-radius:22%;display:block;
  box-shadow:0 4px 14px -4px rgba(0,0,0,.28);
}
.game-tile-crown{
  position:absolute;top:5px;right:5px;
  padding:2px 7px 2px 5px;border-radius:100px;
  background:rgba(0,0,0,.55);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  color:#FFD84D;font-size:10.5px;font-weight:800;line-height:1.5;
  font-variant-numeric:tabular-nums;
}
.game-tile-n{
  font-size:11.5px;font-weight:700;letter-spacing:.02em;color:var(--ink);
  text-align:center;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* ══════════════ Glass: one recipe, used wherever something floats ══════════════ */
:root{
  --glass: color-mix(in srgb, var(--surface) 74%, transparent);
  --glass-line: color-mix(in srgb, var(--ink) 9%, transparent);
  --glass-blur: blur(22px) saturate(150%);
}
html[data-mood="dark"]{
  --glass: color-mix(in srgb, var(--surface) 68%, transparent);
  --glass-line: color-mix(in srgb, #fff 10%, transparent);
}
.sheet, .m-nav, .jr-dock, .ms-dock, .game-end-card, .chance-sheet, .game-sheet{
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.sheet, .chance-sheet{background:var(--glass);border:1px solid var(--glass-line)}
@supports not (backdrop-filter: blur(1px)){
  .sheet, .chance-sheet{background:var(--surface)}
}

/* ══════════════ Journal — a timeline you add to ══════════════ */
.jr-page{display:flex;flex-direction:column;gap:16px;min-height:calc(100dvh - 190px)}
.jr-top{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
.jr-date{
  display:inline-flex;align-items:center;gap:7px;
  font-size:13px;font-weight:500;color:var(--muted);letter-spacing:.01em;
}
.jr-dot{width:5px;height:5px;border-radius:50%;background:#E0704A;display:inline-block}
.jr-h1{font-size:34px;font-weight:700;letter-spacing:-.04em;color:var(--ink);margin:2px 0 0;line-height:1}
.jr-back{
  width:36px;height:36px;border-radius:50%;flex-shrink:0;display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
}
.jr-sheet{
  flex:1;padding:20px 18px 96px;border-radius:24px;
  background:var(--surface);border:1px solid var(--border);
  box-shadow:0 1px 2px rgba(0,0,0,.03);
}
.jr-line{position:relative;padding-left:16px}
.jr-line::before{
  content:"";position:absolute;left:0;top:8px;bottom:8px;width:0;
  border-left:1.5px dashed color-mix(in srgb, var(--ink) 16%, transparent);
}
.jr-node{position:relative;padding:0 0 22px 14px}
.jr-node:last-child{padding-bottom:0}
.jr-time{
  display:inline-block;margin:0 0 8px -30px;padding:3px 10px;border-radius:100px;
  font-size:11px;font-weight:500;color:var(--muted);
  background:var(--surface);
  border:1px dashed color-mix(in srgb, var(--ink) 18%, transparent);
}
.jr-body{font-size:15.5px;line-height:1.6;color:var(--text);overflow-wrap:anywhere}
.jr-blank{font-size:14.5px;color:var(--muted);line-height:1.55;padding:8px 2px}
.jr-past{margin-top:26px;padding-top:20px;border-top:1px solid var(--border-2)}
.jr-past-day{
  font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);margin-bottom:14px;
}
.jr-dock{
  position:sticky;bottom:14px;z-index:3;
  display:flex;align-items:center;gap:8px;
  margin:-78px 6px 0;padding:8px;border-radius:100px;
  background:var(--glass);border:1px solid var(--glass-line);
  box-shadow:0 12px 32px -12px rgba(0,0,0,.28);
}
.jr-dock-plus,.jr-dock-save{
  width:38px;height:38px;border-radius:50%;flex-shrink:0;display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
}
.jr-dock-save{background:var(--ink);color:var(--bg);border-color:var(--ink)}
html[data-mood="dark"] .jr-dock-save{background:#EDEDED;color:#111;border-color:#EDEDED}
.jr-dock-in{flex:1;min-width:0;height:38px;border:0;background:none;color:var(--ink);padding:0 4px}
.jr-dock-in::placeholder{color:var(--muted);opacity:.7}

/* ══════════════ Milestones ══════════════ */
.ms-boards{display:flex;flex-direction:column;gap:12px}
.ms-card{
  display:flex;flex-direction:column;gap:10px;width:100%;text-align:left;
  padding:16px;border-radius:20px;background:var(--surface);border:1px solid var(--border);
}
.ms-card:active{transform:scale(.99)}
.ms-card-top{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.ms-card-t{font-size:16px;font-weight:600;color:var(--ink);overflow-wrap:anywhere}
.ms-card-pct{font-size:13px;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums}
.ms-bar{height:6px;border-radius:100px;background:var(--surface-3);overflow:hidden}
.ms-bar > i{display:block;height:100%;border-radius:100px;background:var(--done);transition:width .5s cubic-bezier(.22,1,.36,1)}
.ms-bar-lg{height:8px;margin-bottom:18px}
.ms-card-foot{display:flex;align-items:center;justify-content:space-between;gap:10px}
.ms-card-n{font-size:12.5px;color:var(--muted)}
.ms-faces{display:inline-flex}
.ms-faces > *{margin-left:-6px;box-shadow:0 0 0 2px var(--surface)}
.ms-faces > *:first-child{margin-left:0}
.ms-add{
  width:100%;min-height:48px;border-radius:16px;font-size:14.5px;font-weight:600;
  color:var(--muted);background:none;border:1.5px dashed var(--border);
}
.ms-page{
  display:flex;flex-direction:column;gap:0;
  padding:0 16px;min-height:calc(100dvh - 190px);
}
.ms-page > .ms-bar,
.ms-page > .ms-meta{margin-left:2px;margin-right:2px}
.ms-head{display:flex;align-items:center;gap:12px;margin-bottom:14px}
.ms-head-copy{flex:1;min-width:0}
.ms-head-t{font-size:20px;font-weight:700;letter-spacing:-.02em;color:var(--ink);margin:0;overflow-wrap:anywhere}
.ms-head-d{font-size:12.5px;color:var(--muted)}
.ms-head-pct{font-size:20px;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.ms-steps{flex:1;display:flex;flex-direction:column;padding-bottom:88px}
.ms-step{display:flex;align-items:center;gap:12px;padding:13px 0;border-top:1px solid var(--border-2)}
.ms-step:first-child{border-top:0}
.ms-tick{
  width:22px;height:22px;border-radius:50%;flex-shrink:0;position:relative;
  border:1.8px solid var(--faint);background:transparent;
}
.ms-tick.on{background:var(--done);border-color:var(--done)}
.ms-tick.on::after{
  content:"";position:absolute;left:6.5px;top:3px;width:5px;height:10px;
  border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);
}
.ms-tick:disabled{opacity:.45}
.ms-step-t{flex:1;min-width:0;font-size:15px;color:var(--ink);overflow-wrap:anywhere}
.ms-step.done .ms-step-t{color:var(--muted);text-decoration:line-through}
.ms-step-by{flex-shrink:0;opacity:.8}
.ms-edit{width:28px;height:28px;border-radius:8px;flex-shrink:0;display:grid;place-items:center;
  color:var(--faint);background:none;border:0}
.ms-dock{
  position:sticky;bottom:14px;display:flex;align-items:center;gap:8px;
  padding:8px;border-radius:100px;margin-top:-70px;
  background:var(--glass);border:1px solid var(--glass-line);
  box-shadow:0 12px 32px -12px rgba(0,0,0,.28);
}
.ms-dock-in{flex:1;min-width:0;height:38px;border:0;background:none;color:var(--ink);padding:0 12px}
.ms-dock-in::placeholder{color:var(--muted);opacity:.7}
.ms-dock-add{
  width:38px;height:38px;border-radius:50%;flex-shrink:0;display:grid;place-items:center;
  background:var(--ink);color:var(--bg);border:0;
}
html[data-mood="dark"] .ms-dock-add{background:#EDEDED;color:#111}

/* ══════════════ WeSub ══════════════ */
.ws-page{display:flex;flex-direction:column;gap:22px}
.ws-hero{display:flex;flex-direction:column;gap:3px}
.ws-hero-k{font-size:12.5px;color:var(--muted)}
.ws-hero-n{font-size:40px;font-weight:800;letter-spacing:-.04em;color:var(--ink);line-height:1;font-variant-numeric:tabular-nums}
.ws-hero-sub{display:flex;align-items:center;gap:8px;font-size:12.5px;color:var(--muted);margin-top:5px}
.ws-dot{width:3px;height:3px;border-radius:50%;background:var(--faint);flex-shrink:0}
.ws-settle{padding:14px 16px;border-radius:18px;background:var(--surface-2);border:1px solid var(--border)}
.ws-settle-k{
  display:flex;align-items:center;justify-content:space-between;
  font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);margin-bottom:10px;
}
.ws-net{font-size:14px;font-weight:800;letter-spacing:0;text-transform:none;font-variant-numeric:tabular-nums}
.ws-net.is-up,.ws-settle-row b.is-up{color:#16A34A}
.ws-net.is-down,.ws-settle-row b.is-down{color:#DC2626}
.ws-settle-row{display:flex;align-items:center;gap:9px;padding:6px 0;font-size:13.5px;color:var(--text-2)}
.ws-settle-who{flex:1;min-width:0}
/* the avatar is a <span> too - never let a bare span selector stretch it */
.ws-settle-row .avatar-stack,.ws-settle-row .avatar-img{flex:0 0 auto}
.ws-settle-row b{font-variant-numeric:tabular-nums}
.ws-list-k{
  font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);margin-bottom:4px;
}
.ws-row{display:flex;align-items:center;gap:12px;padding:13px 0;border-top:1px solid var(--border-2)}
.ws-row:first-of-type{border-top:0}
.ws-mark{
  width:36px;height:36px;border-radius:11px;flex-shrink:0;display:grid;place-items:center;
  color:#fff;font-size:15px;font-weight:800;
}
.ws-copy{flex:1;min-width:0}
.ws-n{font-size:15px;font-weight:600;color:var(--ink);overflow-wrap:anywhere}
.ws-d{display:flex;align-items:center;gap:7px;font-size:12px;color:var(--muted);margin-top:2px}
.ws-payer{display:inline-flex;align-items:center;gap:5px}
.ws-amt{text-align:right;flex-shrink:0}
.ws-amt b{display:block;font-size:15px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}
.ws-amt span{display:block;font-size:11.5px;color:var(--muted);font-variant-numeric:tabular-nums}
.ws-amt .ws-out{opacity:.6}
.ws-x{width:24px;height:24px;border-radius:7px;flex-shrink:0;display:grid;place-items:center;
  color:var(--faint);background:none;border:0}
.ws-empty{
  display:flex;flex-direction:column;gap:4px;width:100%;text-align:left;
  padding:20px 18px;border-radius:18px;background:none;border:1.5px dashed var(--border);
}
.ws-empty-t{font-size:15px;font-weight:600;color:var(--ink)}
.ws-empty-d{font-size:13px;color:var(--muted);line-height:1.45}

/* ══════════════ Notification settings ══════════════ */
.nset-open{margin-right:6px}
.nset-list{display:flex;flex-direction:column}
.nset-row{
  display:flex;align-items:center;gap:14px;padding:15px 0;
  border-top:1px solid var(--border-2);cursor:pointer;position:relative;
}
.nset-row:first-child{border-top:0}
.nset-copy{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.nset-t{font-size:15px;font-weight:600;color:var(--ink)}
.nset-d{font-size:12.5px;color:var(--muted)}
.nset-sw{position:absolute;opacity:0;pointer-events:none}
.nset-track{
  width:48px;height:29px;border-radius:100px;flex-shrink:0;position:relative;
  background:var(--surface-3);transition:background .2s;
}
.nset-track::after{
  content:"";position:absolute;left:3px;top:3px;width:23px;height:23px;border-radius:50%;
  background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.28);transition:transform .2s cubic-bezier(.3,1.4,.5,1);
}
.nset-sw:checked ~ .nset-track{background:var(--done)}
.nset-sw:checked ~ .nset-track::after{transform:translateX(19px)}
.nset-sw:focus-visible ~ .nset-track{outline:2px solid var(--text-2);outline-offset:2px}
.nset-clear{
  width:100%;min-height:46px;margin-top:18px;border-radius:14px;
  font-size:14px;font-weight:600;color:#DC2626;
  background:none;border:1px solid var(--border);
}

/* ══════════════ Look presets ══════════════ */
.look-preset-grid{
  display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px 6px;
  padding:2px 0 4px;
}
.look-preset{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:8px 4px;border-radius:14px;
  background:none;border:2px solid transparent;
}
.look-preset.is-on{border-color:var(--ink);background:var(--surface)}
html[data-mood="dark"] .look-preset.is-on{border-color:#EDEDED}
.look-preset-av,.avatar-stack.look-preset-av{
  width:46px;height:46px;border-radius:14px;background:var(--surface-2);
}
.look-preset-n{font-size:10.5px;font-weight:600;color:var(--muted)}
.look-preset.is-on .look-preset-n{color:var(--ink)}

/* ══════════════ Notifications as a page ══════════════ */
.np-page{display:flex;flex-direction:column;gap:4px;min-height:calc(100dvh - 190px)}
.np-note{font-size:13px;color:var(--muted);margin:0 0 14px;line-height:1.45}
.np-list{display:flex;flex-direction:column}
.np-list .notif-row{padding:15px 0}
.np-clear{
  width:100%;min-height:46px;margin-top:20px;border-radius:14px;
  font-size:14px;font-weight:600;color:var(--muted);
  background:none;border:1px solid var(--border);
}
.np-empty{
  flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:8px;text-align:center;padding:60px 24px;
}
.np-empty-ic{
  width:70px;height:70px;border-radius:50%;display:grid;place-items:center;
  color:var(--faint);background:var(--surface-2);border:1px solid var(--border);
  margin-bottom:6px;
}
.np-empty-t{font-size:17px;font-weight:600;color:var(--ink)}
.np-empty-d{font-size:13.5px;color:var(--muted);line-height:1.5;max-width:30ch}
/* the page owns the screen while it is open — top bar becomes back · title · settings */
body.notifs-open .m-fab,
body.notifs-open .m-mylo-fab{display:none!important}
body.notifs-open .m-avatar-btn{display:none!important}

/* ══════════════════════════════════════════════════════════════════
   Chat: time, swipe-to-reply, quotes                              */

/* Time sits once per run, under the last bubble — the day divider carries the date. */
.msg-meta{
  font-size:10.5px;color:var(--muted);padding:0 8px;letter-spacing:.02em;
  line-height:1.2;margin-top:2px;opacity:.72;font-variant-numeric:tabular-nums;
}
.msg.mine .msg-meta{text-align:right;padding-right:10px}

/* The bubble slides INSIDE its own box and uncovers the cue parked behind it. The box
   itself must never move — sliding it pushed bubbles past the thread edge. */
.msg{position:relative;touch-action:pan-y}
.msg > :not(.msg-reply-cue){
  transform:translateX(var(--swipe,0px));
  transition:transform .22s cubic-bezier(.22,1,.36,1);
}
.msg.no-swipe-anim > :not(.msg-reply-cue){transition:none}
.msg.is-swiping > :not(.msg-reply-cue){will-change:transform}
.msg-reply-cue{
  position:absolute;top:50%;margin-top:-13px;z-index:0;
  width:26px;height:26px;border-radius:50%;display:grid;place-items:center;
  background:var(--surface-3);color:var(--muted);
  opacity:0;transform:scale(.6);pointer-events:none;
  transition:opacity .12s ease, transform .16s cubic-bezier(.2,1.3,.4,1);
}
.msg:not(.mine) .msg-reply-cue{left:4px}
.msg.mine .msg-reply-cue{right:4px}
.msg.is-swiping .msg-reply-cue{opacity:.55;transform:scale(.85)}
.msg.is-armed .msg-reply-cue{
  opacity:1;transform:scale(1);
  background:var(--ink);color:var(--bg);
}
/* landing spot after tapping a quote */
.msg.is-found > .msg-row > .msg-col > .bubble,
.msg.is-found > .bubble,
.msg.is-found > .msg-row > .msg-col > .msg-card,
.msg.is-found > .msg-card{
  animation:msgFound 1.3s ease;
}
@keyframes msgFound{
  0%,42%{box-shadow:0 0 0 3px color-mix(in srgb, var(--done) 55%, transparent)}
  100%{box-shadow:0 0 0 0 transparent}
}
@media (prefers-reduced-motion:reduce){
  .msg-reply-cue{transition:none}
  .msg.is-found > .msg-row > .msg-col > .bubble,.msg.is-found > .bubble{animation:none}
}

/* the quoted message, inside the bubble it answers */
.q-reply{
  display:flex;flex-direction:column;gap:1px;align-items:flex-start;text-align:left;
  width:100%;margin:-2px 0 7px;padding:6px 10px;border:0;cursor:pointer;
  border-radius:11px;border-left:2.5px solid currentColor;
  background:color-mix(in srgb, currentColor 10%, transparent);
  color:inherit;font:inherit;
}
.q-reply-who{font-size:11.5px;font-weight:700;opacity:.9;letter-spacing:-.01em}
.q-reply-t{
  font-size:12.5px;line-height:1.35;opacity:.68;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;
  overflow:hidden;max-width:100%;word-break:break-word;
}

/* composer: the reply strip lives above the bar and shares its rounding */
.chat-compose{margin-top:auto;display:flex;flex-direction:column;min-width:0}
.chat-compose .chat-bar{margin-top:0}
.reply-bar{
  display:flex;align-items:center;gap:9px;min-width:0;
  margin:0 6px -8px;padding:9px 12px 15px;
  border:1px solid var(--border);border-bottom:0;
  border-radius:16px 16px 0 0;
  background:var(--surface-2);
}
.reply-bar[hidden]{display:none}
.reply-bar-line{width:2.5px;align-self:stretch;border-radius:2px;background:var(--done);flex-shrink:0}
.reply-bar-copy{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}
.reply-bar-who{font-size:11.5px;font-weight:700;color:var(--ink);letter-spacing:-.01em}
.reply-bar-t{
  font-size:12.5px;color:var(--muted);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;
}
.reply-bar-x{
  width:24px;height:24px;border-radius:50%;flex-shrink:0;border:0;
  display:grid;place-items:center;background:var(--surface-3);color:var(--muted);cursor:pointer;
}

/* a sticker is a sticker, not a poster */
.sticker-art,.sticker-bubble img{width:96px;height:96px}

/* glass where the chrome floats over content */
.chat-bar,
.chat-thread-head{
  background:var(--glass);
  border-color:var(--glass-line);
  backdrop-filter:var(--glass-blur);
  -webkit-backdrop-filter:var(--glass-blur);
}

/* ══════════════════════════════════════════════════════════════════
   Head-to-head: a football scoreboard, not two loose numbers       */
.h2h{
  display:flex;align-items:center;justify-content:center;gap:10px;
  margin-top:10px;padding:7px 10px;border-radius:14px;
  background:color-mix(in srgb, var(--ink) 4%, var(--surface-2));
  border:1px solid var(--border);
  font-variant-numeric:tabular-nums;min-width:0;
}
.h2h-side{
  display:flex;align-items:center;gap:6px;min-width:0;flex:1;
  font-size:11.5px;color:var(--muted);
}
.h2h-side:last-of-type{flex-direction:row-reverse;text-align:right}
.h2h-side.is-lead{color:var(--ink);font-weight:600}
.h2h-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.h2h-face{
  width:22px;height:22px;flex-shrink:0;border-radius:50%;overflow:hidden;
  border:1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  background:var(--surface-3);box-sizing:border-box;display:block;
}
.avatar-h2h,.avatar-stack.avatar-h2h,.h2h-face .avatar-img,.h2h-face .avatar-stack{
  width:22px;height:22px;border-radius:50%;object-fit:cover;
}
.h2h-score{
  display:inline-flex;align-items:baseline;gap:5px;flex-shrink:0;
  font-size:17px;font-weight:800;color:var(--ink);letter-spacing:-.02em;
}
.h2h-score i{font-style:normal;font-size:13px;color:var(--muted);font-weight:600}
.h2h.is-big{margin:0;width:100%}
.h2h.is-big .h2h-score{font-size:20px}
.h2h.is-big .h2h-face,.h2h.is-big .avatar-h2h,.h2h.is-big .avatar-stack.avatar-h2h{width:26px;height:26px}
/* the overlay wrapper is just a centring box — the board inside owns the width */
.scoreboard{
  display:block;padding:0;background:none;border:0;
  width:100%;max-width:360px;margin:0 auto 12px;
}

/* ══════════════════════════════════════════════════════════════════
   Win banner on Today                                              */
.win-banner{
  position:relative;display:grid;
  grid-template-columns:auto 1fr auto;align-items:center;gap:12px;
  padding:14px 40px 14px 14px;margin-bottom:14px;border-radius:20px;
  background:var(--glass);border:1px solid var(--glass-line);
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  animation:winIn .42s cubic-bezier(.22,1,.36,1);
}
.win-banner .h2h{grid-column:1/-1;margin-top:2px}
.win-banner.is-win{
  border-color:color-mix(in srgb, var(--done) 40%, transparent);
  box-shadow:0 10px 30px -18px color-mix(in srgb, var(--done) 70%, transparent);
}
@keyframes winIn{from{opacity:0;transform:translateY(-8px) scale(.97)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.win-banner{animation:none}}
.win-ic{
  width:40px;height:40px;border-radius:14px;display:grid;place-items:center;
  font-size:20px;background:var(--surface-2);border:1px solid var(--border);flex-shrink:0;
}
.win-copy{min-width:0}
.win-t{font-size:15.5px;font-weight:700;color:var(--ink);letter-spacing:-.02em}
.win-s{font-size:12.5px;color:var(--muted);margin-top:1px}
.win-x{
  position:absolute;top:10px;right:10px;width:24px;height:24px;border:0;
  border-radius:50%;display:grid;place-items:center;cursor:pointer;
  background:var(--surface-3);color:var(--muted);
}

/* progress heads carry their own number so overlapping people stay readable */
.pb-pct{
  position:absolute;top:100%;margin-top:9px;left:50%;transform:translateX(-50%);
  font-size:9.5px;font-weight:700;color:var(--muted);letter-spacing:.01em;
  font-variant-numeric:tabular-nums;white-space:nowrap;
}
.pbar-sub{margin-top:26px}

/* ══════════════════════════════════════════════════════════════════
   Coming soon (WeSub)                                              */
.ws-soon{display:flex;flex-direction:column;gap:16px;padding-bottom:24px}
.soon-card{
  padding:22px 20px 24px;border-radius:22px;
  background:var(--glass);border:1px solid var(--glass-line);
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
}
.soon-tag{
  display:inline-block;font-size:10px;font-weight:800;letter-spacing:.1em;
  text-transform:uppercase;color:var(--muted);
  border:1px solid var(--border);border-radius:100px;padding:4px 10px;
}
.soon-t{font-size:21px;font-weight:700;letter-spacing:-.03em;color:var(--ink);margin:14px 0 8px;line-height:1.25}
.soon-p{font-size:14px;line-height:1.55;color:var(--muted);margin:0}
.soon-list{margin:16px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:9px}
.soon-list li{
  position:relative;padding-left:20px;font-size:13.5px;line-height:1.45;color:var(--text-2);
}
.soon-list li::before{
  content:"";position:absolute;left:4px;top:8px;width:6px;height:6px;
  border-radius:50%;background:var(--done);
}
.app-ic-btn{position:relative}
.app-ic-soon{
  position:absolute;top:-4px;right:2px;
  font-size:8.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
  color:var(--bg);background:var(--ink);
  padding:2px 6px;border-radius:100px;line-height:1.3;
}

/* ══════════════════════════════════════════════════════════════════
   Alerts switch in notification settings                           */
.nset-alert{
  margin-bottom:6px;padding:2px 12px;border-radius:16px;
  background:var(--surface-2);border:1px solid var(--border);
}
.nset-alert.is-on{
  border-color:color-mix(in srgb, var(--done) 45%, transparent);
  background:color-mix(in srgb, var(--done) 7%, var(--surface-2));
}
.nset-alert .nset-row{border-bottom:0}

/* ══════════════════════════════════════════════════════════════════
   Wallet — XP, level and $MYL                                      */
.wal{display:flex;flex-direction:column;gap:14px;padding-bottom:28px}
.wal-note{font-size:13px;color:var(--muted);line-height:1.5;margin:0 2px}
.wal-hero{
  position:relative;overflow:hidden;
  padding:20px 18px 18px;border-radius:24px;
  background:var(--glass);border:1px solid var(--glass-line);
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
}
/* a soft wash of the current tier's colour, so levelling up is felt not just read */
.wal-hero::before{
  content:"";position:absolute;inset:-40% -20% auto -20%;height:180px;pointer-events:none;
  background:radial-gradient(60% 100% at 50% 0%, color-mix(in srgb, var(--lv) 34%, transparent), transparent 70%);
}
.wal-hero.is-slim{padding-bottom:16px}
.wal-k{
  position:relative;font-size:10.5px;font-weight:800;letter-spacing:.11em;
  text-transform:uppercase;color:var(--muted);
}
.wal-bal{position:relative;display:flex;align-items:baseline;gap:7px;margin-top:6px}
.wal-bal b{
  font-size:38px;font-weight:800;letter-spacing:-.045em;color:var(--ink);line-height:1;
  font-variant-numeric:tabular-nums;
}
.wal-bal i{font-style:normal;font-size:14px;font-weight:700;color:var(--muted);letter-spacing:-.01em}
.wal-lv{position:relative;display:flex;align-items:center;gap:7px;margin-top:16px}
.wal-lv-dot{width:9px;height:9px;border-radius:50%;background:var(--lv);flex-shrink:0}
.wal-lv-n{font-size:14px;font-weight:700;color:var(--ink);letter-spacing:-.02em}
.wal-lv-xp{margin-left:auto;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}
.wal-track{
  position:relative;height:7px;border-radius:100px;background:var(--surface-3);
  margin-top:9px;overflow:hidden;
}
.wal-track > i{
  display:block;height:100%;border-radius:100px;background:var(--lv);
  transition:width .7s cubic-bezier(.22,1,.36,1);
}
.wal-next{position:relative;font-size:12px;color:var(--muted);margin-top:9px;line-height:1.45}

.wal-actions{display:grid;grid-template-columns:repeat(3,1fr);gap:9px}
.wal-act{
  display:flex;flex-direction:column;align-items:center;gap:7px;
  padding:14px 6px;border-radius:18px;cursor:pointer;
  background:var(--surface);border:1px solid var(--border);color:var(--ink);
  font-size:12.5px;font-weight:600;letter-spacing:-.01em;
  transition:transform .12s, background .15s;
}
.wal-act:active{transform:scale(.96)}
.wal-act-ic{
  width:34px;height:34px;border-radius:50%;display:grid;place-items:center;
  background:var(--surface-2);color:var(--ink);
}

.wal-card{
  padding:15px 16px;border-radius:20px;
  background:var(--surface);border:1px solid var(--border);
}
.wal-card-h{display:flex;align-items:baseline;justify-content:space-between;font-size:13px;color:var(--muted)}
.wal-card-h b{color:var(--ink);font-size:15px;font-weight:800;font-variant-numeric:tabular-nums}
.wal-mini{display:flex;gap:5px;margin:12px 0 10px}
.wal-pip{flex:1;height:5px;border-radius:100px;background:var(--surface-3)}
.wal-pip.on{background:var(--lv)}
.wal-card-d{font-size:12.5px;color:var(--muted);line-height:1.45}
.wal-card-d b{color:var(--ink);font-weight:700}

.wal-hist{
  padding:6px 4px 4px;border-radius:20px;
  background:var(--surface);border:1px solid var(--border);
}
.wal-hist-h{
  font-size:10.5px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);padding:10px 13px 8px;
}
.wal-row,.wal-lvrow{
  display:flex;align-items:center;gap:11px;padding:10px 13px;min-width:0;
  border-top:1px solid var(--border-2);
}
.wal-row-ic{
  width:30px;height:30px;border-radius:50%;flex-shrink:0;display:grid;place-items:center;
  font-size:11.5px;font-weight:800;background:var(--surface-2);color:var(--muted);
}
.wal-row-ic.is-in{color:var(--done);background:color-mix(in srgb, var(--done) 12%, var(--surface-2))}
.wal-row-ic.is-out{color:var(--ink)}
.wal-row-t{
  flex:1;min-width:0;font-size:13.5px;color:var(--ink);line-height:1.35;
  display:flex;flex-direction:column;gap:1px;
}
.wal-row-t i{font-style:normal;font-size:12px;color:var(--muted);line-height:1.4}
.wal-row-n{font-size:14px;font-weight:800;flex-shrink:0;font-variant-numeric:tabular-nums;color:var(--muted)}
.wal-row-n.is-in{color:var(--done)}
.wal-row-n.is-out{color:var(--ink)}
.wal-lvdot{
  width:11px;height:11px;border-radius:50%;flex-shrink:0;
  background:var(--surface-3);border:2px solid var(--border);box-sizing:border-box;
}
.wal-lvrow.is-on .wal-lvdot{background:var(--lv);border-color:var(--lv)}
.wal-lvrow.is-on .wal-row-t{font-weight:600}
.wal-empty{padding:22px 14px;text-align:center;font-size:13px;color:var(--muted);line-height:1.5}
/* history header: title on the left, filters on the right, wrapping on narrow phones */
.wal-hist-top{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;padding:2px 2px 8px}
.wal-hist-top .wal-hist-h{padding:0;margin:0}
.wal-filter{display:flex;gap:4px;flex-wrap:wrap}
.wal-fbtn{
  padding:5px 10px;border-radius:100px;border:1px solid var(--border);cursor:pointer;
  background:transparent;color:var(--muted);font-size:12px;font-weight:600;
}
.wal-fbtn.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.wal-more{
  display:block;width:100%;margin-top:6px;padding:11px;border-radius:12px;cursor:pointer;
  border:0;background:var(--surface-2);color:var(--ink);font-size:13px;font-weight:650;
}
.wal-shop{width:100%;min-height:48px;margin-top:12px}

/* send */
.wal-who{display:flex;gap:8px;flex-wrap:wrap}
.wal-chip{
  display:inline-flex;align-items:center;gap:7px;padding:7px 13px 7px 7px;
  border-radius:100px;background:var(--surface);border:1px solid var(--border);
  color:var(--ink);font-size:13px;font-weight:600;cursor:pointer;
}
.wal-chip.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.wal-amt{
  display:flex;align-items:center;gap:8px;padding:14px 18px;border-radius:20px;
  background:var(--surface);border:1px solid var(--border);
}
.wal-amt input{
  flex:1;min-width:0;border:0;background:none;color:var(--ink);
  font-size:30px;font-weight:800;letter-spacing:-.04em;padding:0;
}
.wal-amt input:focus{outline:none}
.wal-amt span{font-size:13px;font-weight:700;color:var(--muted)}
.wal-quick{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.wal-qbtn{
  padding:11px 0;border-radius:14px;cursor:pointer;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
  font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;
}
.wal-qbtn:disabled{opacity:.35}
.wal-note-in{
  padding:13px 16px;border-radius:16px;
  background:var(--surface);border:1px solid var(--border);color:var(--ink);
}
.wal-send{padding:15px;border-radius:16px;font-size:15px;font-weight:700}

/* the balance that rides in the Today top bar */
/* The top row is space-between with an absolutely-centred title, so the pill needs an
   auto margin to join the bell on the right instead of landing under the title. */
.m-myl-pill{
  display:inline-flex;align-items:baseline;gap:4px;flex-shrink:0;
  margin-left:auto;padding:6px 11px;border-radius:100px;cursor:pointer;
  background:var(--surface-2);border:1px solid var(--border);
}
.m-myl-pill b{font-size:12.5px;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.m-myl-pill i{font-style:normal;font-size:9.5px;font-weight:700;color:var(--muted)}
.m-myl-pill[hidden]{display:none}
.drawer-tag{
  margin-left:auto;font-size:11.5px;font-weight:700;color:var(--muted);
  font-variant-numeric:tabular-nums;
}
body.wallet-open .m-fab,
body.wallet-open .m-mylo-fab,
body.wallet-open .m-avatar-btn{display:none!important}

/* +XP toast that floats off the thing you just did */
.xp-pop{
  position:fixed;left:50%;bottom:120px;transform:translateX(-50%);
  z-index:90;pointer-events:none;
  padding:7px 15px;border-radius:100px;
  background:var(--ink);color:var(--bg);
  font-size:13px;font-weight:800;letter-spacing:-.01em;
  animation:xpFloat 1.4s cubic-bezier(.22,1,.36,1) forwards;
}
@keyframes xpFloat{
  0%{opacity:0;transform:translate(-50%,10px) scale(.85)}
  18%{opacity:1;transform:translate(-50%,0) scale(1)}
  70%{opacity:1;transform:translate(-50%,-26px) scale(1)}
  100%{opacity:0;transform:translate(-50%,-52px) scale(.95)}
}
@media (prefers-reduced-motion:reduce){.xp-pop{animation:none;opacity:1}}

/* profile: the level name is a word, not a count */
.duo-stat-n.is-word{font-size:15px;letter-spacing:-.02em}

/* ══════════════════════════════════════════════════════════════════
   App store                                                        */
.apps-bal{
  margin-left:auto;font-size:12px;font-weight:700;color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.store-list{display:flex;flex-direction:column;gap:10px}
.store-row{
  display:flex;align-items:center;gap:13px;padding:12px;border-radius:20px;
  background:var(--surface);border:1px solid var(--border);min-width:0;
}
.app-ic-store{width:50px;height:50px;border-radius:15px;flex-shrink:0}
.store-copy{flex:1;min-width:0}
.store-n{font-size:14.5px;font-weight:700;color:var(--ink);letter-spacing:-.02em}
.store-d{font-size:12.5px;color:var(--muted);line-height:1.4;margin-top:2px}
.store-btn{
  flex-shrink:0;padding:9px 14px;border-radius:100px;cursor:pointer;border:0;
  background:var(--ink);color:var(--bg);
  font-size:12.5px;font-weight:700;font-variant-numeric:tabular-nums;
}
.store-btn.is-short{background:var(--surface-3);color:var(--muted)}
.store-btn.is-owned{background:transparent;border:1px solid var(--border);color:var(--ink)}
.store-soon{
  flex-shrink:0;font-size:10.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted);border:1px solid var(--border);border-radius:100px;padding:5px 10px;
}
.store-done{padding:26px 14px;text-align:center;font-size:13.5px;color:var(--muted)}
.app-ic-btn.is-locked .app-ic{opacity:.45;filter:grayscale(.55)}
.app-ic-price{
  position:absolute;top:-4px;right:0;
  font-size:8.5px;font-weight:800;letter-spacing:.02em;
  color:var(--bg);background:var(--ink);
  padding:2px 6px;border-radius:100px;line-height:1.3;
  font-variant-numeric:tabular-nums;
}

/* ══════════════════════════════════════════════════════════════════
   Stakes                                                           */
.launch-bal{margin-left:auto;font-size:11.5px;font-weight:700;color:var(--muted);font-variant-numeric:tabular-nums}
.launch-label{display:flex;align-items:center}
.stake-row{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin:2px 0 14px}
.stake-btn{
  padding:10px 0;border-radius:13px;cursor:pointer;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
  font-size:12.5px;font-weight:700;font-variant-numeric:tabular-nums;
}
.stake-btn.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.stake-btn:disabled{opacity:.35}
.pot-bar{
  display:flex;align-items:center;gap:9px;margin:10px 0 0;
  padding:8px 12px;border-radius:14px;
  background:color-mix(in srgb, var(--done) 9%, var(--surface-2));
  border:1px solid color-mix(in srgb, var(--done) 32%, transparent);
}
.pot-bar.is-done{background:var(--surface-2);border-color:var(--border)}
.pot-k{font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.pot-n{font-size:14px;font-weight:800;color:var(--ink);font-variant-numeric:tabular-nums}
.pot-d{margin-left:auto;font-size:11.5px;color:var(--muted)}
.pot-btn{
  margin-left:auto;flex-shrink:0;padding:6px 12px;border-radius:100px;border:0;cursor:pointer;
  background:var(--ink);color:var(--bg);font-size:11.5px;font-weight:700;
}

/* ══════════════════════════════════════════════════════════════════
   Hold and drag a quick to-do                                      */
.todo-list{position:relative}
.todo-row{position:relative;touch-action:pan-y;transition:transform .16s cubic-bezier(.22,1,.36,1)}
.todo-grip{
  position:absolute;left:3px;top:50%;margin-top:-7px;width:3px;height:14px;
  border-radius:2px;background:var(--border);opacity:0;transition:opacity .15s;
}
.todo-list.is-reordering .todo-grip{opacity:1}
.todo-row.is-held{
  background:var(--surface);border-radius:14px;
  box-shadow:0 12px 28px -12px rgba(0,0,0,.32);
  transform:scale(1.02);transition:none;
}
.todo-row.is-dragging{transition:none;cursor:grabbing}
.todo-cap{
  flex-shrink:0;margin-right:2px;padding:3px 9px;border-radius:100px;cursor:pointer;
  background:var(--surface-3);border:0;color:var(--muted);
  font-size:11px;font-weight:700;font-variant-numeric:tabular-nums;
}

/* ══════════════════════════════════════════════════════════════════
   Today progress: legend under the track, stronger fill            */
.pbar-head{margin-bottom:56px;align-items:baseline}
.pbar-pct{
  font-size:13px;font-weight:800;color:var(--ink);
  font-variant-numeric:tabular-nums;letter-spacing:-.02em;
}
/* the old track read as two greys — give the empty half real contrast */
.pbar-track{
  height:10px;
  background:color-mix(in srgb, var(--ink) 9%, var(--surface-2));
  box-shadow:inset 0 0 0 1px var(--border-2);
}
.pbar-track > i{
  background:linear-gradient(90deg,
    color-mix(in srgb, var(--done) 80%, #fff) 0%, var(--done) 100%);
  box-shadow:0 1px 6px -1px color-mix(in srgb, var(--done) 60%, transparent);
  min-width:10px;
}
.pbar-legend{
  display:flex;flex-wrap:wrap;gap:6px 16px;margin-top:16px;
}
.pb-leg{display:inline-flex;align-items:baseline;gap:6px;font-size:12.5px;min-width:0}
.pb-leg b{font-weight:600;color:var(--ink);letter-spacing:-.01em}
.pb-leg i{font-style:normal;color:var(--muted);font-variant-numeric:tabular-nums}

/* ══════════════════════════════════════════════════════════════════
   @mentions                                                        */
/* Everything inside the field steals width from the thing you actually type in,
   so both controls are kept narrow and the input keeps the rest. */
.chat-at{
  width:26px;height:38px;flex-shrink:0;border:0;background:transparent;cursor:pointer;
  color:var(--muted);font-size:16px;font-weight:700;line-height:1;
  display:grid;place-items:center;transition:color .15s;
}
.chat-at:active{color:var(--ink)}
@media (hover:hover){.chat-at:hover{color:var(--ink)}}
.mention-pop{
  margin:0 6px -6px;padding:5px;border-radius:18px 18px 12px 12px;
  background:var(--glass);border:1px solid var(--glass-line);border-bottom:0;
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
  max-height:212px;overflow-y:auto;
}
.mention-row{
  display:flex;align-items:center;gap:9px;width:100%;padding:8px 10px;
  border:0;background:none;cursor:pointer;border-radius:12px;text-align:left;color:var(--ink);
}
.mention-row:active{background:var(--surface-3)}
@media (hover:hover){.mention-row:hover{background:var(--surface-2)}}
.mention-av{
  width:26px;height:26px;flex-shrink:0;border-radius:50%;overflow:hidden;
  background:var(--surface-3);display:block;
}
.mention-av img,.mention-av .avatar-img,.mention-av .avatar-stack{
  width:26px;height:26px;border-radius:50%;object-fit:cover;
}
.mention-n{font-size:14px;font-weight:600;letter-spacing:-.01em;min-width:0;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mention-tag{
  margin-left:auto;flex-shrink:0;font-size:10.5px;color:var(--muted);
}
.mention-hit{font-weight:700;opacity:.92}
.msg:not(.mine) .mention-hit{color:var(--done)}

/* Mylo speaking inside a normal thread */
.msg.is-mylo .bubble{
  background:color-mix(in srgb, var(--done) 8%, var(--bubble-in));
  border-color:color-mix(in srgb, var(--done) 26%, transparent);
}
.msg.is-mylo .msg-ava{border-color:color-mix(in srgb, var(--done) 40%, transparent)}

/* ══════════════════════════════════════════════════════════════════
   Wallet tabs + leaderboard                                        */
.wal-tabs{
  display:flex;gap:3px;padding:3px;border-radius:14px;
  background:var(--surface-2);border:1px solid var(--border);
}
.wal-tab{
  flex:1;padding:9px 0;border:0;border-radius:11px;cursor:pointer;
  background:transparent;color:var(--muted);
  font-size:13px;font-weight:600;letter-spacing:-.01em;
}
.wal-tab.on{background:var(--surface);color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.06)}
.lb-row{
  display:flex;align-items:center;gap:10px;padding:11px 13px;min-width:0;
  border-top:1px solid var(--border-2);
}
.lb-row:first-child{border-top:0}
.lb-row.is-me{background:color-mix(in srgb, var(--ink) 3%, transparent)}
.lb-rank{
  width:22px;flex-shrink:0;text-align:center;
  font-size:12px;font-weight:800;color:var(--muted);font-variant-numeric:tabular-nums;
}
.lb-rank.is-podium{color:var(--ink)}
.lb-face{
  width:28px;height:28px;flex-shrink:0;border-radius:50%;overflow:hidden;
  border:1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  background:var(--surface-3);box-sizing:border-box;display:block;
}
.lb-face .avatar-img,.lb-face .avatar-stack{width:26px;height:26px;border-radius:50%}
.lb-bar{
  flex:1;min-width:26px;max-width:90px;height:5px;border-radius:100px;
  background:var(--surface-3);overflow:hidden;
}
.lb-bar > i{display:block;height:100%;border-radius:100px;background:var(--lv)}

/* ══════════════════════════════════════════════════════════════════
   Calendar: to-dos beside goals                                    */
.cal-todo-group{margin-top:6px;padding-top:8px;border-top:1px solid var(--border-2)}
.cal-todo-h{
  font-size:10px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);padding:0 2px 6px;
}
.cal-task-row.is-todo .cal-task-t{font-weight:500}
.cal-task-kind{
  font-size:10.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;
  color:var(--muted);margin-right:6px;
}

/* the "Get more" tile at the end of the games rail */
.game-tile.is-more .game-tile-art{
  display:grid;place-items:center;
  border:1px dashed var(--border);border-radius:18px;
  background:var(--surface-2);
}
.game-tile-plus{font-size:24px;font-weight:300;color:var(--muted);line-height:1}

/* ══════════════════════════════════════════════════════════════════
   Tags: bold by default, tinted by the tagger's plan               */
.mention-hit{font-weight:700}
.mention-hit.is-pro{color:#3B82F6}
.mention-hit.is-pod{color:#EC4899}
/* on your own (dark) bubbles the tints need to lift off the ink */
.msg.mine .mention-hit.is-pro{color:#8AB4FF}
.msg.mine .mention-hit.is-pod{color:#FF8FC4}
.msg:not(.mine) .mention-hit{color:inherit}
.msg:not(.mine) .mention-hit.is-pro{color:#2563EB}
.msg:not(.mine) .mention-hit.is-pod{color:#DB2777}

/* ══════════════════════════════════════════════════════════════════
   Transfer receipt                                                 */
.tx-card{
  min-width:210px;padding:16px 18px 14px;border-radius:20px;text-align:center;
  background:var(--surface);border:1px solid var(--border);
}
.tx-card.is-in{
  border-color:color-mix(in srgb, var(--done) 34%, transparent);
  background:color-mix(in srgb, var(--done) 7%, var(--surface));
}
.tx-top{display:flex;align-items:center;justify-content:center;gap:10px}
.tx-face{
  width:34px;height:34px;flex-shrink:0;border-radius:50%;overflow:hidden;
  border:1px solid color-mix(in srgb, var(--ink) 14%, transparent);
  background:var(--surface-3);box-sizing:border-box;display:block;
}
.tx-face .avatar-img,.tx-face .avatar-stack{width:32px;height:32px;border-radius:50%}
.tx-arrow{color:var(--muted);display:grid;place-items:center}
.tx-amt{display:flex;align-items:baseline;justify-content:center;gap:5px;margin-top:12px}
.tx-amt b{
  font-size:26px;font-weight:800;letter-spacing:-.04em;color:var(--ink);
  font-variant-numeric:tabular-nums;line-height:1;
}
.tx-amt i{font-style:normal;font-size:12px;font-weight:700;color:var(--muted)}
.tx-who{font-size:12px;color:var(--muted);margin-top:6px}
.tx-left{font-size:11.5px;color:var(--muted);opacity:.75;margin-top:2px}
.tx-btn{
  margin-top:12px;width:100%;padding:9px 0;border:0;border-radius:100px;cursor:pointer;
  background:var(--ink);color:var(--bg);font-size:12.5px;font-weight:700;
}

/* ══════════════════════════════════════════════════════════════════
   Message menu + deleted state                                     */
.msg-menu-peek{
  font-size:13px;color:var(--muted);padding:2px 4px 12px;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.msg-menu{display:flex;flex-direction:column;gap:2px}
.msg-menu-row{
  display:flex;align-items:center;gap:12px;width:100%;padding:13px 12px;
  border:0;background:none;cursor:pointer;border-radius:14px;
  color:var(--ink);font-size:14.5px;font-weight:500;text-align:left;
}
.msg-menu-row:active{background:var(--surface-2)}
@media (hover:hover){.msg-menu-row:hover{background:var(--surface-2)}}
.msg-menu-row.is-danger{color:#DC2626}
.msg-menu-ic{width:22px;display:grid;place-items:center;flex-shrink:0}
.msg-menu-note{
  font-size:12px;color:var(--muted);line-height:1.45;padding:8px 12px 2px;
}
/* beat `.msg.mine .bubble`, which is more specific than a bare .bubble rule */
.msg .bubble.is-gone,
.msg.mine .bubble.is-gone{
  background:transparent;color:var(--muted);
  border:1px dashed var(--border);font-style:italic;font-size:13.5px;
}
.msg.is-gone .bubble{opacity:.85}

/* ══════════════════════════════════════════════════════════════════
   Desktop settings: drawers, not a wall                            */
.desk-fold{padding:0;overflow:hidden}
.desk-fold-head{
  display:flex;align-items:center;gap:14px;width:100%;
  padding:18px 20px;border:0;background:none;cursor:pointer;text-align:left;color:var(--ink);
}
.desk-fold-head:active{background:var(--surface-2)}
@media (hover:hover){.desk-fold-head:hover{background:var(--surface-2)}}
.desk-fold-copy{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
.desk-fold-t{font-size:15.5px;font-weight:650;letter-spacing:-.02em;color:var(--ink)}
.desk-fold-d{font-size:12.5px;color:var(--muted);line-height:1.4}
.desk-fold-chev{
  flex-shrink:0;color:var(--muted);
  transition:transform .2s cubic-bezier(.22,1,.36,1);
}
.desk-fold.is-open .desk-fold-chev{transform:rotate(180deg)}
.desk-fold.is-open .desk-fold-head{border-bottom:1px solid var(--border-2)}
.desk-fold-body{padding:18px 20px 20px;animation:deskFold .22s ease}
@keyframes deskFold{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){
  .desk-fold-body{animation:none}
  .desk-fold-chev{transition:none}
}

/* ══════════════════════════════════════════════════════════════════
   Read receipts — Messenger's little heads                         */
.seen-row{
  display:flex;align-items:center;gap:3px;justify-content:flex-end;
  align-self:flex-end;margin:-1px 4px 4px;min-height:16px;
  animation:seenIn .24s cubic-bezier(.22,1,.36,1);
}
@keyframes seenIn{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.seen-row{animation:none}}
.seen-face{
  width:15px;height:15px;flex-shrink:0;border-radius:50%;overflow:hidden;
  border:1px solid var(--bg);background:var(--surface-3);
  box-sizing:border-box;display:block;
}
.avatar-seen,.avatar-stack.avatar-seen,
.seen-face .avatar-img,.seen-face .avatar-stack{
  width:13px;height:13px;border-radius:50%;object-fit:cover;
}
.seen-more{font-size:9.5px;font-weight:700;color:var(--muted);margin-left:2px}

/* ══════════════════════════════════════════════════════════════════
   Photos in the thread                                             */
.img-bubble{
  display:block;padding:0;border:0;background:var(--surface-3);cursor:pointer;
  width:min(232px,68vw);border-radius:20px;overflow:hidden;line-height:0;
  box-shadow:0 1px 3px rgba(0,0,0,.08);
}
.img-bubble img{
  display:block;width:100%;height:auto;max-height:340px;object-fit:cover;
  aspect-ratio:1 / var(--ar,.75);
}
.msg:not(.grouped).mine .img-bubble{border-bottom-right-radius:7px}
.msg:not(.grouped):not(.mine) .img-bubble{border-bottom-left-radius:7px}
.img-viewer{
  position:fixed;inset:0;z-index:120;display:none;
  align-items:center;justify-content:center;padding:20px;
  background:rgba(8,8,10,.94);
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
}
.img-viewer.on{display:flex;animation:viewIn .18s ease}
@keyframes viewIn{from{opacity:0}to{opacity:1}}
.img-viewer img{max-width:100%;max-height:100%;border-radius:10px;object-fit:contain}
.img-viewer-x{
  position:absolute;top:calc(env(safe-area-inset-top,0px) + 14px);right:14px;
  width:36px;height:36px;border:0;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;color:#fff;background:rgba(255,255,255,.16);
}
body.viewer-open{overflow:hidden}

/* ══════════════════════════════════════════════════════════════════
   Voice notes                                                      */
.voice-bubble{
  display:flex;align-items:center;gap:10px;
  padding:9px 14px 9px 9px;border-radius:20px;min-width:186px;
  background:var(--bubble-in);border:1px solid var(--bubble-line);
}
.voice-bubble.is-mine{background:var(--ink);border-color:transparent}
.voice-play{
  width:32px;height:32px;flex-shrink:0;border:0;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;background:var(--ink);color:var(--bg);
}
.voice-bubble.is-mine .voice-play{background:var(--bg);color:var(--ink)}
.voice-i-pause{display:none}
.voice-bubble.is-playing .voice-i-play{display:none}
.voice-bubble.is-playing .voice-i-pause{display:block}
.voice-wave{
  flex:1;display:flex;align-items:center;gap:2px;height:22px;min-width:0;
  /* the played portion fills in as it goes */
  -webkit-mask-image:linear-gradient(90deg,#000 0,#000 var(--p,0%),rgba(0,0,0,.34) var(--p,0%));
  mask-image:linear-gradient(90deg,#000 0,#000 var(--p,0%),rgba(0,0,0,.34) var(--p,0%));
}
.voice-wave > i{
  flex:1;min-width:2px;border-radius:2px;background:var(--ink);opacity:.85;
}
.voice-bubble.is-mine .voice-wave > i{background:var(--bg)}
.voice-time{
  flex-shrink:0;font-size:11.5px;font-variant-numeric:tabular-nums;color:var(--muted);
}
.voice-bubble.is-mine .voice-time{color:color-mix(in srgb, var(--bg) 70%, transparent)}

/* recorder, in place of the composer */
.chat-bar.is-recording > *:not(.rec-strip),
.chat-bar.is-busy > *:not(.compose-busy){visibility:hidden}
.chat-bar{position:relative}
.rec-strip,.compose-busy{
  position:absolute;inset:6px;display:flex;align-items:center;gap:10px;
  padding:0 8px;border-radius:14px;background:var(--surface);
}
.rec-x,.rec-send{
  width:38px;height:38px;flex-shrink:0;border:0;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;
}
.rec-x{background:var(--surface-3);color:var(--muted)}
.rec-send{background:var(--ink);color:var(--bg)}
.rec-dot{
  width:8px;height:8px;border-radius:50%;background:#EF4444;flex-shrink:0;
  animation:recPulse 1.1s ease-in-out infinite;
}
@keyframes recPulse{0%,100%{opacity:1}50%{opacity:.25}}
.rec-time{font-size:13px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--ink);flex-shrink:0}
.rec-wave{flex:1;display:flex;align-items:center;gap:2px;height:20px;min-width:0;overflow:hidden}
.rec-wave > i{
  flex:1;min-width:2px;border-radius:2px;background:var(--ink);opacity:.5;
  height:30%;animation:recBar .7s ease-in-out infinite alternate;animation-delay:var(--d);
}
@keyframes recBar{from{height:22%}to{height:96%}}
@media (prefers-reduced-motion:reduce){
  .rec-dot,.rec-wave > i{animation:none}
}
.compose-busy{font-size:13px;color:var(--muted);justify-content:center}
.compose-spin{
  width:15px;height:15px;border-radius:50%;flex-shrink:0;
  border:2px solid var(--border);border-top-color:var(--ink);
  animation:spin .7s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* camera + mic in the bar */
.chat-icon{
  width:34px;height:38px;flex-shrink:0;border:0;background:transparent;cursor:pointer;
  color:var(--muted);display:grid;place-items:center;transition:color .15s;
}
.chat-icon:active{color:var(--ink)}
@media (hover:hover){.chat-icon:hover{color:var(--ink)}}
.mic{
  width:42px;height:42px;border-radius:15px;flex-shrink:0;
  display:grid;place-items:center;
  background:var(--chat-ctl);color:var(--ink);border:1px solid var(--bubble-line);
  transition:transform .12s, opacity .14s, width .18s ease, margin .18s ease;
}
.mic:active{transform:scale(.92)}
/* the mic gives way to Send the moment there is text */
.chat-bar.has-text .mic{
  width:0;opacity:0;margin-left:-8px;pointer-events:none;overflow:hidden;border-width:0;
}

/* ══════════════════════════════════════════════════════════════════
   Plus sheet                                                       */
.plus-grid{
  display:grid;grid-template-columns:repeat(4,1fr);gap:6px 4px;
  padding:2px 0 6px;
}
.plus-tile{
  display:flex;flex-direction:column;align-items:center;gap:8px;
  padding:12px 4px 10px;border:0;background:none;cursor:pointer;border-radius:16px;
  color:var(--ink);font-size:11.5px;font-weight:600;letter-spacing:-.01em;
  transition:transform .12s, background .15s;
}
.plus-tile:active{transform:scale(.94);background:var(--surface-2)}
@media (hover:hover){.plus-tile:hover{background:var(--surface-2)}}
.plus-ic{
  width:50px;height:50px;border-radius:17px;display:grid;place-items:center;
  background:color-mix(in srgb, var(--pc,#5AA9D6) 13%, var(--surface-2));
  color:var(--pc,#5AA9D6);
  box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--pc,#5AA9D6) 20%, transparent);
}

/* ══════════════════════════════════════════════════════════════════
   One header for every mini app                                    */
.mini-head2{
  display:grid;grid-template-columns:38px 1fr 38px;align-items:center;
  gap:10px;margin:2px 0 16px;
}
.mini-back2{
  width:38px;height:38px;border-radius:50%;display:grid;place-items:center;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);cursor:pointer;
}
.mini-title{
  margin:0;text-align:center;font-size:17px;font-weight:700;
  letter-spacing:-.02em;color:var(--ink);
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.mini-plus{
  width:38px;height:38px;border-radius:50%;display:grid;place-items:center;
  background:var(--ink);color:var(--bg);border:0;cursor:pointer;
  transition:transform .12s;
}
.mini-plus:active{transform:scale(.92)}
.mini-plus.is-ghost{background:transparent;border:0;pointer-events:none}

/* milestones */
.ms-meta{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:8px}
.ms-crew{
  display:flex;align-items:center;gap:6px;margin:14px 0 4px;padding:8px 12px;
  border-radius:100px;background:var(--surface-2);border:1px solid var(--border);
  cursor:pointer;color:var(--ink);width:max-content;max-width:100%;
}
/* faces overlap each other, never the label beside them */
.ms-crew-face{
  width:24px;height:24px;flex-shrink:0;border-radius:50%;overflow:hidden;
  border:1.5px solid var(--surface);background:var(--surface-3);
  box-sizing:border-box;display:block;
}
.ms-crew-face:not(:last-of-type){margin-right:-10px}
.ms-crew-face .avatar-img,.ms-crew-face .avatar-stack{width:21px;height:21px;border-radius:50%}
.ms-crew-n{font-size:12.5px;font-weight:600;color:var(--muted);white-space:nowrap}
.btn-secondary.is-danger{color:#DC2626;border-color:color-mix(in srgb,#DC2626 30%,transparent)}

/* journal */
.jr-datebar{margin:-6px 2px 14px}
.jr-date{font-size:13px;font-weight:600;color:var(--muted);letter-spacing:-.01em}

/* ══════════════════════════════════════════════════════════════════
   Challenge                                                        */
.ch-page{display:flex;flex-direction:column;padding:0 2px 28px}
.ch-sec{
  font-size:10.5px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;
  color:var(--muted);margin:16px 2px 8px;
}
.ch-card{
  padding:14px;border-radius:20px;margin-bottom:10px;
  background:var(--surface);border:1px solid var(--border);
  border-left:3px solid var(--cc,#EC4899);
}
.ch-card.is-done{background:color-mix(in srgb,var(--done) 7%,var(--surface))}
.ch-card.is-dead{opacity:.55}
.ch-top{display:flex;align-items:center;gap:11px;min-width:0}
.ch-face{
  width:34px;height:34px;flex-shrink:0;border-radius:50%;overflow:hidden;
  border:1px solid color-mix(in srgb,var(--ink) 14%,transparent);
  background:var(--surface-3);box-sizing:border-box;display:block;
}
.ch-face .avatar-img,.ch-face .avatar-stack{width:32px;height:32px;border-radius:50%}
.ch-copy{flex:1;min-width:0}
.ch-t{font-size:14px;font-weight:650;color:var(--ink);letter-spacing:-.01em;line-height:1.3}
.ch-d{font-size:12px;color:var(--muted);margin-top:2px}
.ch-when{font-size:11px;font-weight:700;color:var(--muted);flex-shrink:0;font-variant-numeric:tabular-nums}
.ch-badge{
  flex-shrink:0;font-size:10px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
  color:var(--bg);background:var(--done);padding:3px 9px;border-radius:100px;
}
.ch-note{font-size:12.5px;color:var(--text-2);margin:9px 0 0;line-height:1.4;font-style:italic}
.ch-bar{height:6px;border-radius:100px;background:var(--surface-3);overflow:hidden;margin:11px 0 8px}
.ch-bar > i{display:block;height:100%;border-radius:100px;background:var(--cc,#EC4899);transition:width .5s cubic-bezier(.22,1,.36,1)}
.ch-foot{display:flex;align-items:center;justify-content:space-between;gap:10px}
.ch-n{font-size:12px;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums}
.ch-claim{
  padding:7px 15px;border:0;border-radius:100px;cursor:pointer;
  background:var(--ink);color:var(--bg);font-size:12.5px;font-weight:700;
}
.ch-drop{
  padding:7px 13px;border:1px solid var(--border);border-radius:100px;cursor:pointer;
  background:transparent;color:var(--muted);font-size:12px;font-weight:600;
}
.ch-kinds{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:14px}
.ch-kind{
  display:flex;flex-direction:column;gap:3px;align-items:flex-start;text-align:left;
  padding:11px 12px;border-radius:15px;cursor:pointer;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
}
.ch-kind.on{
  background:color-mix(in srgb,var(--cc) 11%,var(--surface));
  border-color:color-mix(in srgb,var(--cc) 45%,transparent);
}
.ch-kind b{font-size:13px;font-weight:650;letter-spacing:-.01em}
.ch-kind i{font-style:normal;font-size:11px;color:var(--muted);line-height:1.35}
.ch-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:12px}
.ch-lbl{font-size:13px;font-weight:600;color:var(--ink)}
.ch-step{
  display:flex;align-items:center;gap:4px;padding:3px;border-radius:100px;
  background:var(--surface-2);border:1px solid var(--border);
}
.ch-step > span{min-width:34px;text-align:center;font-size:15px;font-weight:800;font-variant-numeric:tabular-nums}
.ch-pm{
  width:32px;height:32px;border:0;border-radius:50%;cursor:pointer;
  background:var(--surface);color:var(--ink);font-size:17px;line-height:1;
}

/* ══════════════════════════════════════════════════════════════════
   Notifications, tidied                                            */
.notif-row{
  display:flex;align-items:flex-start;gap:12px;padding:13px 14px;
  border-radius:18px;background:var(--surface);border:1px solid var(--border);
  margin-bottom:8px;
}
.notif-row.is-tappable{cursor:pointer;transition:transform .12s,background .15s}
.notif-row.is-tappable:active{transform:scale(.985);background:var(--surface-2)}
.notif-ic{
  width:36px;height:36px;flex-shrink:0;border-radius:12px;display:grid;place-items:center;
  font-size:16px;
  background:color-mix(in srgb,var(--nc,#5AA9D6) 14%,var(--surface-2));
  color:var(--nc,#5AA9D6);
}
.notif-copy{flex:1;min-width:0}
.notif-t{
  display:flex;align-items:baseline;gap:8px;
  font-size:14px;font-weight:600;color:var(--ink);letter-spacing:-.01em;line-height:1.35;
}
.notif-when{margin-left:auto;flex-shrink:0;font-size:11px;font-weight:600;color:var(--muted)}
.notif-b{font-size:12.5px;color:var(--muted);margin-top:2px;line-height:1.4}
.notif-x{
  width:24px;height:24px;flex-shrink:0;border:0;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;background:transparent;color:var(--muted);
}
.notif-x:active{background:var(--surface-3)}
.np-list{display:flex;flex-direction:column}

/* the $MYL way-in, without the number */
.m-myl-pill.is-coin{gap:5px;padding:6px 11px 6px 9px}
.myl-coin{display:grid;place-items:center;color:var(--ink)}
.m-myl-pill.is-coin i{font-size:10.5px;font-weight:800;color:var(--muted)}

/* ══════════════════════════════════════════════════════════════════
   Fixes for what the containers were doing wrong                   */

/* ── notification row: a real grid, so nothing can drift ──
   icon | copy | meta          <- one row
   actions spanning 2..3       <- second row, only when there are buttons
   Every column that holds text carries min-width:0, otherwise long copy refuses
   to shrink and pushes the whole row past its own border. */
.notif-row{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:start;
  column-gap:12px;row-gap:0;
  box-sizing:border-box;max-width:100%;
}
.notif-copy{min-width:0;grid-column:2}
.notif-t{
  display:block;font-size:14px;font-weight:600;color:var(--ink);
  letter-spacing:-.01em;line-height:1.35;
}
.notif-t,.notif-b{min-width:0;overflow-wrap:anywhere;word-break:break-word}
.notif-meta{
  grid-column:3;display:flex;align-items:center;gap:6px;
  flex-shrink:0;padding-top:1px;
}
.notif-when{
  font-size:11px;font-weight:600;color:var(--muted);
  white-space:nowrap;font-variant-numeric:tabular-nums;margin:0;
}
.notif-actions{
  grid-column:2 / -1;display:flex;gap:8px;margin-top:11px;
}
.notif-actions > button{
  flex:1 1 0;min-width:0;min-height:38px;padding:0 14px;
  font-size:13px;font-weight:600;border-radius:12px;
}
.np-list{gap:0}
.np-clear{
  width:100%;margin-top:18px;padding:13px;border-radius:16px;cursor:pointer;
  background:var(--surface);border:1px solid var(--border);
  color:#DC2626;font-size:13.5px;font-weight:600;
}

/* Holding a bubble opened the menu but the browser also painted a text selection
   over it. The gesture owns the press now — selection is off inside the thread. */
#chat-scroll .msg,
#chat-scroll .msg *{
  -webkit-user-select:none;user-select:none;-webkit-touch-callout:none;
}
#chat-scroll .msg.is-selectable,
#chat-scroll .msg.is-selectable *{-webkit-user-select:text;user-select:text}

/* progress heads: one line, overlapping, yours on top */
.pb-head{transition:left .7s cubic-bezier(.22,1,.36,1)}
.pb-av{box-shadow:0 0 0 2px var(--surface),0 2px 6px -2px rgba(0,0,0,.25)}

/* ══════════════════════════════════════════════════════════════════
   Quick to-do: yours open, everyone else folded                     */
.todo-fold{
  margin-top:10px;border-top:1px solid var(--border-2);padding-top:4px;
}
.todo-fold-head{
  display:flex;align-items:center;gap:10px;width:100%;padding:10px 2px;
  border:0;background:none;cursor:pointer;color:var(--ink);text-align:left;
}
.todo-fold-head .avatar-img,
.todo-fold-head .avatar-stack{
  width:24px;height:24px;border-radius:50%;flex-shrink:0;
}
.todo-fold-n{
  flex:1;min-width:0;font-size:13.5px;font-weight:600;letter-spacing:-.01em;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.todo-fold-c{
  flex-shrink:0;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums;
}
.todo-fold-chev{
  flex-shrink:0;color:var(--muted);
  transition:transform .2s cubic-bezier(.22,1,.36,1);
}
.todo-fold.is-open .todo-fold-chev{transform:rotate(180deg)}
@media (prefers-reduced-motion:reduce){.todo-fold-chev{transition:none}}

/* the voice fill is driven per-frame now, so it must not also ease */
.voice-wave{transition:none}


/* ══════════════════════════════════════════════════════════════════
   Other people's quick to-dos — a card each, like the calendar       */
.todo-theirs{margin-top:12px;padding-top:2px}
.todo-theirs .todo-fold-head{
  display:flex;align-items:center;gap:10px;width:100%;
  padding:12px 2px;border:0;background:none;cursor:pointer;
  color:var(--ink);text-align:left;
}
.todo-theirs .todo-list{padding-top:2px}
.todo-theirs.is-open .todo-fold-chev{transform:rotate(180deg)}

/* a ticked quick to-do stays put, just visibly done */
.todo-row.done .todo-t{text-decoration:line-through;color:var(--muted)}
.todo-row.done{opacity:.62}

/* ══════════════════════════════════════════════════════════════════
   Swipe a chat row                                                  */
/* The wrapper is just a clip; the FACE carries the row's own surface so it reads as
   a solid card sliding over the buttons rather than a hollow outline. */
.chat-swipe{
  position:relative;overflow:hidden;border-radius:16px;margin-bottom:2px;
  background:transparent;
}
.chat-swipe-face{
  position:relative;z-index:2;
  margin-left:var(--revl,0px);
  width:calc(100% - var(--rev,0px) - var(--revl,0px));
  transition:width .24s cubic-bezier(.22,1,.36,1), margin-left .24s cubic-bezier(.22,1,.36,1);
  /* fully opaque and square-cornered: a translucent or rounded face let the
     coloured action buttons behind show as slivers along the edges */
  background:var(--bg);
  border-radius:0;
  box-sizing:border-box;
}
.chat-swipe-face > .chat-row{background:var(--bg)}
/* only round the outer wrapper, and only while it is closed */
.chat-swipe{border-radius:0}
.chat-swipe.is-swiping .chat-swipe-face{transition:none}
.chat-swipe-face > .chat-row{width:100%}
/* Hidden entirely while the row is shut. Leaving them painted underneath let a
   hairline of colour show along the edges wherever rounding disagreed by a pixel. */
.row-actions{
  position:absolute;top:0;bottom:0;z-index:1;
  display:flex;align-items:stretch;
  visibility:hidden;
}
.chat-swipe.is-swiping .row-actions,
.chat-swipe.is-open-l .row-actions,
.chat-swipe.is-open-r .row-actions{visibility:visible}
.row-actions-left{left:0}
.row-actions-right{right:0}
/* Narrow enough that the row it uncovers is still recognisable behind them. */
.row-act{
  border:0;cursor:pointer;padding:0 8px;min-width:52px;
  display:grid;place-items:center;
  font-size:11px;font-weight:700;letter-spacing:-.02em;color:#fff;
}
.row-act.is-pin{background:#E0A05A}
.row-act.is-mute{background:#8A8A8A}
.row-act.is-lock{background:#5B6ABF}
.row-act.is-archive{background:#EF5B4C}
@media (prefers-reduced-motion:reduce){
  .chat-swipe-face{transition:none}
}
.chat-row-pin,.chat-row-mute{
  flex-shrink:0;color:var(--muted);display:grid;place-items:center;
}

/* ══════════════════════════════════════════════════════════════════
   Notification rows: give the border something to sit on            */
.notif-row{
  border:1px solid var(--border);
  border-radius:18px;
  padding:13px 14px;
  background:var(--surface);
  margin-bottom:8px;
  /* the grid's own columns must never be able to out-measure the row */
  width:100%;
}
.np-page,.np-list{max-width:100%;box-sizing:border-box}

/* ══════════════════════════════════════════════════════════════════
   Profile stats: room to breathe                                    */
.duo-stats{gap:12px;padding:2px 0 20px}
.duo-stat{
  gap:7px;padding:16px 8px 14px;border-radius:18px;
}
.duo-stat-ic{height:22px;margin-bottom:3px}
.duo-stat-n{font-size:19px;line-height:1.15}
.duo-stat-n.is-word{font-size:15.5px}
.duo-stat-l{font-size:11.5px;margin-top:1px;letter-spacing:.01em}

/* ══════════════════════════════════════════════════════════════════
   A mini app owns the screen — the shell's bar stands down           */
body.mini-open .m-top{display:none!important}
body.mini-open .m-screen{padding-top:calc(env(safe-area-inset-top,0px) + 10px)}
body.mini-open .m-fab,
body.mini-open .m-mylo-fab{display:none!important}

/* ══════════════════════════════════════════════════════════════════
   Stories                                                           */
.story-rail{
  display:flex;gap:14px;overflow-x:auto;padding:2px 2px 14px;
  scrollbar-width:none;-webkit-overflow-scrolling:touch;
}
.story-rail::-webkit-scrollbar{display:none}
.story-cell{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  border:0;background:none;cursor:pointer;flex-shrink:0;width:64px;
  color:var(--ink);
}
.story-ring{
  position:relative;width:60px;height:60px;border-radius:50%;
  display:grid;place-items:center;
  /* the ring is the badge colour; a seen story fades to a plain outline */
  background:conic-gradient(var(--ring,#EC4899) 0turn, var(--ring,#EC4899) 1turn);
  padding:2.5px;box-sizing:border-box;
}
.story-cell.is-seen .story-ring{background:var(--border)}
.story-ring.is-add{background:var(--border-2)}
.story-face{
  width:100%;height:100%;border-radius:50%;overflow:hidden;display:block;
  border:2.5px solid var(--bg);box-sizing:border-box;background:var(--surface-2);
}
.story-face .avatar-img,.story-face .avatar-stack{width:100%;height:100%;border-radius:50%}
.story-plus{
  position:absolute;right:-1px;bottom:-1px;width:22px;height:22px;border-radius:50%;
  display:grid;place-items:center;font-size:15px;line-height:1;
  background:var(--ink);color:var(--bg);border:2px solid var(--bg);
}
.story-cell.is-mini .story-ring{width:46px;height:46px;background:transparent;border:1.5px dashed var(--border)}
.story-cell.is-mini .story-plus{position:static;width:20px;height:20px;border:0}
.story-name{
  font-size:11px;color:var(--muted);max-width:100%;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* viewer */
.story-viewer{
  position:fixed;inset:0;z-index:130;background:#000;
  display:flex;align-items:center;justify-content:center;
}
body.story-open{overflow:hidden}
.story-img{max-width:100%;max-height:100%;object-fit:contain}
.story-bars{
  position:absolute;top:calc(env(safe-area-inset-top,0px) + 10px);left:10px;right:10px;
  display:flex;gap:4px;z-index:3;
}
.story-bar{
  flex:1;height:2.5px;border-radius:2px;background:rgba(255,255,255,.34);overflow:hidden;
  box-shadow:0 1px 3px rgba(0,0,0,.45);
}
.story-bar.is-done{background:#fff}
.story-bar.is-now > i{display:block;height:100%;background:#fff;animation:storyFill 6s linear forwards}
@keyframes storyFill{from{width:0}to{width:100%}}
@media (prefers-reduced-motion:reduce){.story-bar.is-now > i{animation:none;width:100%}}
.story-head{
  position:absolute;top:calc(env(safe-area-inset-top,0px) + 22px);left:12px;right:12px;
  display:flex;align-items:center;gap:9px;z-index:3;color:#fff;
}
.story-head-face{width:30px;height:30px;border-radius:50%;overflow:hidden;flex-shrink:0}
.story-head-face .avatar-img,.story-head-face .avatar-stack{width:30px;height:30px;border-radius:50%}
.story-head-n{font-size:13.5px;font-weight:600}
.story-head-t{font-size:12px;opacity:.7}
.story-del,.story-x{
  border:0;background:rgba(255,255,255,.14);color:#fff;cursor:pointer;
  width:32px;height:32px;border-radius:50%;display:grid;place-items:center;
}
.story-del{margin-left:auto}
.story-x{margin-left:6px}
.story-del + .story-x{margin-left:6px}
.story-head > .story-x:not(.story-del + .story-x){margin-left:auto}
.story-nav{position:absolute;top:0;bottom:0;width:34%;border:0;background:none;cursor:pointer;z-index:2}
.story-nav.is-prev{left:0}
.story-nav.is-next{right:0}
.story-cap,.story-proof{
  position:absolute;left:16px;right:16px;z-index:3;color:#fff;
}
/* clears the reply bar / seen row that now sits along the bottom */
.story-cap{bottom:calc(env(safe-area-inset-bottom,0px) + 78px);font-size:14px;line-height:1.4;text-shadow:0 1px 8px rgba(0,0,0,.6)}
.story-proof{
  bottom:calc(env(safe-area-inset-bottom,0px) + 128px);
  display:inline-flex;align-items:center;gap:10px;width:max-content;max-width:82%;
  padding:10px 14px 10px 10px;border-radius:17px;text-align:left;
}
.story-proof-tick{
  width:27px;height:27px;border-radius:9px;display:grid;place-items:center;
  background:linear-gradient(160deg,#6BE8A6,#22B573);color:#04301B;flex-shrink:0;
  box-shadow:0 3px 9px -2px rgba(0,0,0,.5);
}
.story-proof-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.story-proof-t{
  font-size:13.5px;font-weight:700;letter-spacing:-.01em;line-height:1.3;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.story-proof-s{
  font-size:9.5px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;
  color:rgba(255,255,255,.62);white-space:nowrap;
}
.story-seen{
  position:absolute;bottom:calc(env(safe-area-inset-bottom,0px) + 14px);left:16px;z-index:6;
  display:flex;align-items:center;gap:5px;color:#fff;font-size:11.5px;opacity:.9;
  border:0;background:none;cursor:pointer;padding:6px 4px;
  text-shadow:0 1px 6px rgba(0,0,0,.6);
}
.story-seen:active{opacity:.6}

/* ── reply to somebody else's story, Instagram style ── */
.story-reply{
  position:absolute;left:12px;right:12px;z-index:6;
  bottom:calc(env(safe-area-inset-bottom,0px) + 12px);
  display:flex;align-items:center;gap:8px;
}
.story-reply-in{
  flex:1;min-width:0;height:46px;padding:0 18px;border-radius:100px;
  background:rgba(20,20,24,.42);color:#fff;
  backdrop-filter:blur(20px) saturate(165%);-webkit-backdrop-filter:blur(20px) saturate(165%);
  border:1px solid rgba(255,255,255,.32);
}
.story-reply-in::placeholder{color:rgba(255,255,255,.7)}
.story-reply-in:focus{outline:none;border-color:rgba(255,255,255,.6);background:rgba(20,20,24,.62)}
.story-heart,.story-send{
  width:44px;height:44px;border-radius:50%;border:0;flex-shrink:0;cursor:pointer;
  display:grid;place-items:center;background:none;color:#fff;
  filter:drop-shadow(0 2px 6px rgba(0,0,0,.6));
}
.story-heart:active,.story-send:active{transform:scale(.9)}
.story-heart.is-on{color:#FF3B5C;animation:storyHeart .42s cubic-bezier(.16,1.5,.3,1)}
@keyframes storyHeart{0%{transform:scale(1)}45%{transform:scale(1.35)}100%{transform:scale(1)}}
@media (prefers-reduced-motion:reduce){.story-heart.is-on{animation:none}}

/* ── who viewed it — inside the overlay, not a .sheet (z-index 110 < 130) ── */
.story-viewers{
  position:absolute;left:0;right:0;bottom:0;z-index:8;max-height:62%;
  display:flex;flex-direction:column;
  border-radius:22px 22px 0 0;padding:8px 0 calc(env(safe-area-inset-bottom,0px) + 8px);
  background:rgba(20,20,24,.82);
  backdrop-filter:blur(26px) saturate(160%);-webkit-backdrop-filter:blur(26px) saturate(160%);
  border-top:1px solid rgba(255,255,255,.16);color:#fff;
  animation:storyPanelUp .26s cubic-bezier(.16,1,.3,1) both;
}
@keyframes storyPanelUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
@media (prefers-reduced-motion:reduce){.story-viewers{animation:none}}
.story-viewers-grab{
  width:38px;height:4px;border-radius:100px;background:rgba(255,255,255,.32);
  margin:2px auto 10px;flex-shrink:0;
}
.story-viewers-h{
  display:flex;align-items:center;gap:10px;padding:0 18px 12px;flex-shrink:0;
  font-size:15px;letter-spacing:-.02em;
}
.story-viewers-likes{
  display:inline-flex;align-items:center;gap:4px;
  font-size:12.5px;font-weight:600;color:#FF3B5C;
}
.story-viewers-x{
  margin-left:auto;border:0;background:none;color:rgba(255,255,255,.6);
  font-size:26px;line-height:1;cursor:pointer;padding:0 2px;
}
.story-viewers-list{overflow-y:auto;padding:0 18px;-webkit-overflow-scrolling:touch}
.story-viewer-row{display:flex;align-items:center;gap:12px;padding:9px 0}
.story-viewer-face{width:36px;height:36px;border-radius:50%;overflow:hidden;flex-shrink:0}
.story-viewer-face .avatar-img,.story-viewer-face .avatar-stack{width:36px;height:36px;border-radius:50%}
.story-viewer-n{flex:1;min-width:0;font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.story-viewer-heart{color:#FF3B5C;flex-shrink:0}
.story-viewers-none{padding:0 18px 18px;margin:0;font-size:13px;color:rgba(255,255,255,.6)}
/* the story a reply is answering, shown in the thread */
.story-quote{
  display:flex;align-items:center;gap:9px;margin-bottom:7px;
  padding:5px 10px 5px 5px;border-radius:12px;
  background:color-mix(in srgb,var(--ink) 8%,transparent);
  font-size:11.5px;font-weight:600;color:var(--muted);
}
.story-quote img{width:30px;height:40px;border-radius:7px;object-fit:cover;flex-shrink:0}
.story-seen-f{width:20px;height:20px;border-radius:50%;overflow:hidden;margin-right:-7px;border:1.5px solid #000}
.story-seen-f .avatar-img,.story-seen-f .avatar-stack{width:17px;height:17px;border-radius:50%}
.story-seen > span{margin-left:10px}

/* composer sheet */
.story-todos{display:flex;flex-wrap:wrap;gap:7px}
.story-todo{
  padding:8px 13px;border-radius:100px;cursor:pointer;font-size:12.5px;font-weight:600;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
  max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.story-todo.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.story-none{font-size:12.5px;color:var(--muted)}

/* ══════════════════════════════════════════════════════════════════
   View once                                                         */
/* ── "Enable notifications" strip ──────────────────────────────────────
   Snapchat puts this under the chat header rather than in a toast, and it is
   the right call: a toast is gone before you can act on it. */
.notif-nudge{
  display:flex;align-items:center;gap:9px;flex-shrink:0;
  padding:9px 12px;background:var(--surface-2);
  border-bottom:1px solid var(--border);
  font-size:12.5px;line-height:1.35;color:var(--muted);
}
.notif-nudge-ic{display:grid;place-items:center;flex-shrink:0;color:var(--muted)}
.notif-nudge-t{flex:1;min-width:0}
.notif-nudge-go{
  border:0;background:none;padding:0;cursor:pointer;
  color:#3B82F6;font-size:12.5px;font-weight:700;
}
.notif-nudge-go:active{opacity:.6}
.notif-nudge-x{
  width:24px;height:24px;border-radius:50%;border:0;cursor:pointer;flex-shrink:0;
  display:grid;place-items:center;background:none;color:var(--muted);
}
.notif-nudge-x:active{background:var(--surface-3)}

/* ── Photo waiting in the composer ─────────────────────────────────────
   Sits above the input like the reply bar, so you can type a line to go with
   it before it goes anywhere. Tapping the thumbnail hands it to the editor. */
.pend-strip{
  display:flex;align-items:center;gap:11px;padding:8px 10px;margin-bottom:7px;
  border-radius:15px;background:var(--surface-2);border:1px solid var(--border);
}
.pend-strip[hidden]{display:none!important}
.pend-thumb{
  position:relative;width:44px;height:44px;border-radius:11px;overflow:hidden;
  flex-shrink:0;border:0;padding:0;cursor:pointer;background:var(--surface-3);
}
.pend-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.pend-edit{
  position:absolute;right:2px;bottom:2px;width:17px;height:17px;border-radius:50%;
  display:grid;place-items:center;background:rgba(0,0,0,.62);color:#fff;
}
.pend-copy{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}
.pend-copy b{font-size:13px;font-weight:700;letter-spacing:-.01em;color:var(--ink)}
.pend-copy span{font-size:11.5px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pend-x{
  width:30px;height:30px;border-radius:50%;border:0;cursor:pointer;flex-shrink:0;
  display:grid;place-items:center;background:none;color:var(--muted);
}
.pend-x:active{background:var(--surface-3)}

/* ── Streak in the thread ─────────────────────────────────────────────
   Deliberately small. It sizes to its own words (max-content is a definite
   width, so it cannot collapse the way the old card did), and it borrows the
   chat bubble's own surface instead of drawing a card of its own. */
.pick-sec{
  margin:12px 4px 6px;font-size:10.5px;font-weight:800;letter-spacing:.1em;
  text-transform:uppercase;color:var(--muted);
}
.streak-msg{
  flex:none;width:max-content;max-width:78vw;
  display:inline-flex;align-items:center;gap:8px;
  padding:8px 8px 8px 10px;border-radius:18px;cursor:pointer;
  background:var(--bubble-in);color:var(--ink);border:1px solid var(--bubble-line);
  font-size:14px;font-weight:650;letter-spacing:-.01em;
}
.streak-msg.is-mine{background:var(--bubble-out,var(--ink));color:var(--bubble-out-ink,var(--bg));border-color:transparent}
.streak-msg:active{transform:scale(.97)}
.sm-ic{
  width:26px;height:26px;border-radius:50%;display:grid;place-items:center;flex-shrink:0;
  color:var(--streak,#FF9600);
  background:color-mix(in srgb,var(--streak,#FF9600) 16%,transparent);
}
.sm-ic svg{width:15px;height:15px}
/* unopened: a slow breath on the flame, nothing louder */
.streak-msg.is-live .sm-ic{animation:smBreath 2.4s ease-in-out infinite}
@keyframes smBreath{0%,100%{box-shadow:0 0 0 0 color-mix(in srgb,var(--streak,#FF9600) 35%,transparent)}50%{box-shadow:0 0 0 5px transparent}}
.sm-state{
  font-size:11px;font-weight:700;padding:3px 8px;border-radius:100px;
  background:color-mix(in srgb,currentColor 10%,transparent);opacity:.85;
}
.streak-msg.is-spent{cursor:default}
.streak-msg.is-spent .sm-ic{color:currentColor;background:color-mix(in srgb,currentColor 10%,transparent);opacity:.55}
.streak-msg.is-spent .sm-t{opacity:.6}
@media (prefers-reduced-motion:reduce){.streak-msg.is-live .sm-ic{animation:none}}
.img-once-note{
  position:absolute;bottom:calc(env(safe-area-inset-bottom,0px) + 20px);left:0;right:0;
  text-align:center;color:rgba(255,255,255,.7);font-size:12.5px;
}

/* to-do that needs proof */
.todo-proof{
  display:flex;align-items:flex-start;gap:11px;cursor:pointer;
  padding:12px 2px 2px;
}
.todo-proof input{position:absolute;opacity:0;pointer-events:none}
.todo-proof-box{
  width:22px;height:22px;border-radius:7px;flex-shrink:0;margin-top:1px;
  border:1.5px solid var(--border);background:var(--surface-2);
  display:grid;place-items:center;transition:background .15s,border-color .15s;
}
.todo-proof input:checked + .todo-proof-box{
  background:var(--ink);border-color:var(--ink);
}
.todo-proof input:checked + .todo-proof-box::after{
  content:"";width:11px;height:6px;border-left:2px solid var(--bg);border-bottom:2px solid var(--bg);
  transform:rotate(-45deg) translate(1px,-1px);
}
.todo-proof-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.todo-proof-copy b{font-size:13.5px;font-weight:600;color:var(--ink)}
.todo-proof-copy i{font-style:normal;font-size:12px;color:var(--muted);line-height:1.4}
.todo-proof-tag{
  display:inline-grid;place-items:center;margin-left:6px;vertical-align:-2px;
  color:var(--muted);
}

/* ══════════════════════════════════════════════════════════════════
   Voice call                                                        */
.chat-call{
  width:38px;height:38px;flex-shrink:0;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;margin-left:auto;
  background:var(--surface-2);border:1px solid var(--border);color:var(--ink);
}
.chat-call:active{transform:scale(.93)}
.call-overlay{
  position:fixed;inset:0;z-index:140;display:grid;place-items:center;
  background:var(--glass);
  backdrop-filter:blur(26px) saturate(140%);-webkit-backdrop-filter:blur(26px) saturate(140%);
}
.call-card{
  display:flex;flex-direction:column;align-items:center;gap:6px;
  padding:34px 30px;border-radius:28px;text-align:center;
  background:var(--surface);border:1px solid var(--border);
  box-shadow:0 30px 70px -30px rgba(0,0,0,.5);
  min-width:min(300px,84vw);
}
.call-face{
  width:88px;height:88px;border-radius:50%;overflow:hidden;display:block;margin-bottom:10px;
  border:2px solid var(--border);background:var(--surface-2);box-sizing:border-box;
}
.call-face .avatar-img,.call-face .avatar-stack{width:100%;height:100%;border-radius:50%}
.call-n{font-size:20px;font-weight:700;letter-spacing:-.03em;color:var(--ink)}
.call-s{font-size:13.5px;color:var(--muted);font-variant-numeric:tabular-nums;min-height:19px}
.call-actions{display:flex;gap:18px;margin-top:22px}
.call-btn{
  width:58px;height:58px;border-radius:50%;border:0;cursor:pointer;
  display:grid;place-items:center;color:#fff;
  transition:transform .12s;
}
.call-btn:active{transform:scale(.92)}
.call-btn.is-end{background:#EF4444}
.call-btn.is-answer{background:#22C55E}
.call-btn.is-mute{background:var(--surface-3);color:var(--ink)}
.call-btn.is-mute.on{background:var(--ink);color:var(--bg)}

/* ══════════════════════════════════════════════════════════════════
   Story composer — a page, not a sheet                              */
.story-compose{
  position:fixed;inset:0;z-index:135;display:flex;flex-direction:column;
  background:#000;color:#fff;
}
body.story-compose-open{overflow:hidden}
/* The v1 gallery rules were removed here — they reused Scrabble's .sc-* names
   and were repainting the board tiles. The composer owns .sy-* now. */
.sy-x{
  width:44px;height:44px;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;
  background:rgba(20,20,24,.42);color:#fff;
  backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);
  border:1px solid rgba(255,255,255,.22);
  box-shadow:0 8px 22px -10px rgba(0,0,0,.6);
}
.sy-x.is-ghost{background:transparent;pointer-events:none}
.sy-x.is-float{position:absolute;top:14px;left:14px;z-index:4}

/* edit step */
.sy-stage{
  position:relative;flex:1;min-height:0;overflow:hidden;
  display:grid;place-items:center;background:#000;
}
/* Everything in the stage shares one cell. Without this, any child that loses
   its absolute positioning silently opens a new row and halves the picture. */
.sy-stage > *{grid-area:1 / 1}
.sy-photo{width:100%;height:100%;object-fit:contain}
.sy-tools{
  position:absolute;top:14px;right:14px;z-index:4;
  display:flex;flex-direction:column;gap:10px;
}
.sy-tool{
  width:44px;height:44px;border-radius:50%;cursor:pointer;
  display:grid;place-items:center;
  background:rgba(20,20,24,.42);color:#fff;
  backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);
  border:1px solid rgba(255,255,255,.22);
  box-shadow:0 8px 22px -10px rgba(0,0,0,.6);
}
.sy-tool:active{transform:scale(.93)}
/* the to-do chip you drag onto the picture */
/* .glass lives at the very end of this file — see the note there. */
.sy-chip{
  position:absolute;transform:translate(-50%,-50%);z-index:5;cursor:grab;
  display:inline-flex;align-items:center;gap:10px;text-align:left;
  padding:10px 14px 10px 10px;border-radius:17px;
  max-width:min(84%,300px);touch-action:none;
}
.sy-chip.is-dragging{cursor:grabbing;transform:translate(-50%,-50%) scale(1.05)}
.sy-chip-tick{
  width:27px;height:27px;border-radius:9px;flex-shrink:0;
  display:grid;place-items:center;
  background:linear-gradient(160deg,#6BE8A6,#22B573);color:#04301B;
  box-shadow:0 3px 9px -2px rgba(0,0,0,.5);
}
.sy-chip-body{display:flex;flex-direction:column;gap:2px;min-width:0}
.sy-chip-t{
  font-size:13.5px;font-weight:700;letter-spacing:-.01em;line-height:1.3;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}
.sy-chip-s{
  font-size:9.5px;font-weight:800;letter-spacing:.1em;text-transform:uppercase;
  color:rgba(255,255,255,.62);white-space:nowrap;
}
.sy-chip-x{
  position:absolute;right:9px;top:50%;transform:translateY(-50%);
  width:19px;height:19px;border-radius:50%;display:grid;place-items:center;
  background:rgba(0,0,0,.16);font-size:14px;line-height:1;
}
.sy-foot{
  display:flex;flex-direction:column;align-items:stretch;gap:11px;flex-shrink:0;
  padding:12px 14px calc(env(safe-area-inset-bottom,0px) + 14px);
}
.sy-capbar{
  display:flex;align-items:center;gap:6px;min-height:52px;
  padding:0 6px 0 18px;border-radius:100px;
  background:rgba(255,255,255,.10);border:1px solid rgba(255,255,255,.16);
}
.sy-capbar:focus-within{border-color:rgba(255,255,255,.42);background:rgba(255,255,255,.14)}
.sy-cap{
  flex:1;min-width:0;border:0;background:none;color:#fff;
  padding:14px 0;font-size:16px;   /* 16px or iOS zooms the page on focus */
}
.sy-cap::placeholder{color:rgba(255,255,255,.55)}
.sy-cap:focus{outline:none}
/* the view-once "1", sitting in the caption bar the way WhatsApp does it */
.sy-once{
  width:40px;height:40px;border-radius:50%;border:0;cursor:pointer;flex-shrink:0;
  display:grid;place-items:center;background:none;color:rgba(255,255,255,.75);
}
.sy-once.on{background:#fff;color:#000}
.sy-once:active{transform:scale(.92)}
.sy-sendrow{display:flex;align-items:center;gap:12px}
.sy-dest{
  flex:1;min-width:0;display:inline-flex;align-items:center;gap:9px;
  padding:9px 16px 9px 9px;border-radius:100px;
  background:rgba(255,255,255,.12);font-size:14px;font-weight:600;
}
.sy-dest > span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sy-dest-face{width:28px;height:28px;border-radius:50%;overflow:hidden;flex-shrink:0}
.sy-dest-face .avatar-img,.sy-dest-face .avatar-stack{width:28px;height:28px;border-radius:50%}
.sy-send{
  width:52px;height:52px;border-radius:50%;border:0;cursor:pointer;flex-shrink:0;
  display:grid;place-items:center;background:#fff;color:#000;
}
.sy-send:active{transform:scale(.93)}

/* a placed proof chip in the viewer sits where it was dropped */
.story-proof.is-placed{
  left:auto;right:auto;bottom:auto;
  transform:translate(-50%,-50%);
  position:absolute;
}

/* ══════════════════════════════════════════════════════════════════
   Story composer v2 — one page, a 9:16 frame you can pinch          */
.sy-stage{position:relative;flex:1;min-height:0;overflow:hidden;display:grid;place-items:center;background:#000}
.sy-frame{
  position:relative;width:100%;height:100%;overflow:hidden;touch-action:none;
  /* Zoom out past the edges of the picture and you land on the picture's own
     colours rather than a black void — sampled in sampleStoryGradient(). */
  background:linear-gradient(160deg,var(--sy-g1,#2A2A2E),var(--sy-g2,#111114));
}
.sy-photo{
  position:absolute;left:50%;top:50%;
  /* Contain, not cover: the shot opens whole, and you zoom IN to crop it. */
  max-width:100%;max-height:100%;width:auto;height:auto;
  transform-origin:center;will-change:transform;user-select:none;-webkit-user-drag:none;
  box-shadow:0 18px 50px -18px rgba(0,0,0,.55);
}
/* overlays you drop on the picture */
/* Positioning only. This rule sits BELOW .sy-chip and .sy-timer in the file, so
   a blanket button reset here quietly stripped their padding and background and
   left the cards looking squashed and, on a pale photo, invisible. Only the
   sticker actually wants a bare button, so the reset lives with the sticker. */
.sy-ov{
  position:absolute;transform:translate(-50%,-50%);z-index:5;cursor:grab;
  touch-action:none;
}
.sy-sticker{border:0;padding:0;background:none;box-shadow:none}
.sy-ov.is-dragging{transform:translate(-50%,-50%) scale(1.06);cursor:grabbing}
.sy-ov-x{
  position:absolute;top:-8px;right:-8px;width:20px;height:20px;border-radius:50%;
  display:grid;place-items:center;background:rgba(0,0,0,.62);color:#fff;
  font-size:14px;line-height:1;
}
/* The green-pill chip that used to live here is gone. It was a second copy of
   .sy-chip further down the file, so it quietly beat the glass version and put
   the flat green card back on the picture. Glass is defined once, above. */
.sy-sticker img{width:104px;height:104px;object-fit:contain;display:block;
  filter:drop-shadow(0 6px 16px rgba(0,0,0,.45))}
/* background, blur and border come from .glass */
.sy-timer{
  display:flex;flex-direction:column;align-items:center;gap:1px;
  padding:13px 21px;border-radius:20px;
}
.sy-timer-n{font-size:30px;font-weight:800;letter-spacing:-.04em;line-height:1}
.sy-timer-l{font-size:11px;text-transform:uppercase;letter-spacing:.1em;opacity:.75}

/* tool trays live inside the overlay — a .sheet would render behind it */
.sy-tray{
  position:absolute;left:0;right:0;bottom:0;z-index:8;
  padding:14px 16px calc(env(safe-area-inset-bottom,0px) + 18px);
  border-radius:22px 22px 0 0;
  background:rgba(22,22,22,.97);color:#fff;
  backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);
  animation:trayUp .2s cubic-bezier(.22,1,.36,1);
  max-height:56%;overflow-y:auto;
}
@keyframes trayUp{from{transform:translateY(18px);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion:reduce){.sy-tray{animation:none}}
.sy-tray-h{
  display:flex;align-items:center;justify-content:space-between;
  font-size:13px;font-weight:700;letter-spacing:-.01em;margin-bottom:12px;
}
.sy-tray-x{border:0;background:none;color:rgba(255,255,255,.6);font-size:22px;line-height:1;cursor:pointer}
.sy-tray-wrap{display:flex;flex-wrap:wrap;gap:8px}
.sy-tray .story-todo{background:rgba(255,255,255,.12);border-color:transparent;color:#fff}
.sy-tray .story-none{color:rgba(255,255,255,.55)}
.sy-tray-note{font-size:11.5px;color:rgba(255,255,255,.5);margin:12px 0 0}
.sy-tray-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.sy-tray-st{
  aspect-ratio:1;border:0;border-radius:16px;cursor:pointer;
  background:rgba(255,255,255,.1);display:grid;place-items:center;padding:8px;
}
.sy-tray-st img{width:100%;height:100%;object-fit:contain}
.sy-tool.on{background:#fff;color:#000}
.sy-tool.is-fire.on{background:var(--flame,#F97316);color:#fff}
.sy-send.is-busy{opacity:.5}

/* overlays as the viewer sees them */
.story-ov-st{
  position:absolute;transform:translate(-50%,-50%);z-index:3;
  width:104px;height:104px;object-fit:contain;
  filter:drop-shadow(0 6px 16px rgba(0,0,0,.45));
}
.story-ov-timer{
  position:absolute;transform:translate(-50%,-50%);z-index:3;
  display:flex;flex-direction:column;align-items:center;gap:1px;
  padding:13px 21px;border-radius:20px;
}
.story-ov-timer b{font-size:30px;font-weight:800;letter-spacing:-.04em;line-height:1}
.story-ov-timer i{font-style:normal;font-size:11px;text-transform:uppercase;letter-spacing:.1em;opacity:.75}

/* ══════════════════════════════════════════════════════════════════
   Status: folded away until you pull                                */
/* Collapsed statuses ride beside the page title, Telegram-style. */
.m-story-chip{
  display:flex;align-items:center;flex-shrink:0;
  border:0;background:none;cursor:pointer;padding:0 8px 0 0;margin-left:6px;
}
.m-story-f{
  width:26px;height:26px;border-radius:50%;overflow:hidden;flex-shrink:0;
  margin-right:-10px;box-sizing:border-box;
  border:2px solid var(--ring,var(--ink));background:var(--surface-2);
}
.m-story-f:last-child{margin-right:0}
/* it doubles as the "collapse again" control once the drawer is out */
.m-story-chip.is-open{opacity:.55}
.m-story-chip:active{transform:scale(.94)}
.m-story-f .avatar-img,.m-story-f .avatar-stack{width:100%;height:100%;border-radius:50%}
/* The 0fr/1fr grid trick collapses here because the rail inside scrolls
   horizontally, so its measured height goes to nothing. A max-height is less
   elegant but actually works with a scrolling child. */
.chat-drawer{
  max-height:0;overflow:hidden;
  transition:max-height .3s cubic-bezier(.22,1,.36,1),opacity .2s ease;
  opacity:0;
}
.chat-drawer.is-open{max-height:190px;opacity:1}
@media (prefers-reduced-motion:reduce){.chat-drawer{transition:none}}

/* ══════════════════════════════════════════════════════════════════
   Notifications, Instagram-style: a face first, grouped by age       */
.np-sec{
  font-size:13px;font-weight:700;letter-spacing:-.01em;color:var(--ink);
  margin:18px 2px 10px;
}
.np-sec:first-child{margin-top:2px}
.notif-row{
  border:0;background:transparent;padding:10px 4px;margin-bottom:0;
  border-radius:14px;
}
.notif-row.is-tappable:active{background:var(--surface-2)}
.notif-ic{
  position:relative;width:44px;height:44px;border-radius:50%;
  background:color-mix(in srgb,var(--nc,#5AA9D6) 14%,var(--surface-2));
  color:var(--nc,#5AA9D6);font-size:17px;
}
.notif-ic.has-face{background:var(--surface-2);overflow:visible}
.notif-ic .avatar-img,.notif-ic .avatar-stack{width:44px;height:44px;border-radius:50%}
.notif-dot{
  position:absolute;right:-2px;bottom:-2px;
  width:19px;height:19px;border-radius:50%;display:grid;place-items:center;
  font-size:9.5px;background:var(--nc,#5AA9D6);color:#fff;
  border:2px solid var(--bg);box-sizing:content-box;
}
.notif-t{font-weight:500}
.notif-t strong{font-weight:700}
.notif-meta{padding-top:12px}
.np-list{gap:0;display:flex;flex-direction:column}

/* the collapsed status chip sits inside the centred title */
.m-top-title.has-story-chip{display:inline-flex;align-items:center;gap:8px}

/* ══════════════════════════════════════════════════════════════════
   Chat list — one spacing scale, used everywhere on this screen.
   Every gap below comes from these four values, so the vertical
   rhythm is fixed rather than improvised per element.               */
.chat-shell{
  --cl-gutter:16px;   /* left/right page margin        */
  --cl-gap:14px;      /* between major blocks          */
  --cl-row:12px;      /* inside a row, and row->row    */
  --cl-tight:8px;     /* between tight siblings        */
  display:flex;flex-direction:column;gap:var(--cl-gap);
}

/* header controls */
.m-chat-edit{
  flex-shrink:0;border:0;cursor:pointer;
  padding:8px 14px;border-radius:100px;
  background:var(--surface-2);color:var(--ink);
  font-size:14px;font-weight:600;letter-spacing:-.01em;
}
.m-chat-edit.is-done{background:var(--ink);color:var(--bg)}
.m-chat-acts{
  display:flex;align-items:center;gap:2px;flex-shrink:0;margin-left:auto;
  padding:3px;border-radius:100px;background:var(--surface-2);
}
.m-chat-act{
  width:34px;height:34px;border-radius:50%;border:0;cursor:pointer;
  display:grid;place-items:center;background:transparent;color:var(--ink);
}
.m-chat-act:active{background:var(--surface-3)}

/* story rail spacing follows the same scale */
.story-rail{gap:var(--cl-gutter);padding:var(--cl-tight) 2px var(--cl-row)}
.chat-drawer.is-open{max-height:190px;opacity:1}
.chat-tabs{margin-bottom:0}
.chat-list{display:flex;flex-direction:column;gap:2px}
.chat-list .chat-row{padding:var(--cl-row) var(--cl-tight)}

/* edit mode */
.chat-editbar{
  position:fixed;left:0;right:0;bottom:0;z-index:60;
  display:flex;align-items:center;gap:var(--cl-tight);
  padding:var(--cl-row) var(--cl-gutter) calc(env(safe-area-inset-bottom,0px) + var(--cl-row));
  background:var(--glass);border-top:1px solid var(--glass-line);
  backdrop-filter:var(--glass-blur);-webkit-backdrop-filter:var(--glass-blur);
}
.chat-editbtn{
  flex:1;min-height:44px;border-radius:14px;cursor:pointer;
  background:var(--surface);border:1px solid var(--border);color:var(--ink);
  font-size:14px;font-weight:600;letter-spacing:-.01em;
}
.chat-editbtn:disabled{opacity:.4}
.chat-editbtn.is-danger{color:#DC2626}
body.chat-screen .chat-shell.is-editing{padding-bottom:78px}
.chat-pick{
  display:flex;align-items:center;gap:var(--cl-row);
  padding:0 var(--cl-tight);border-radius:14px;cursor:pointer;
}
.chat-pick:active{background:var(--surface-2)}
.chat-pick-dot{
  width:22px;height:22px;border-radius:50%;flex-shrink:0;
  border:1.5px solid var(--border);box-sizing:border-box;
  display:grid;place-items:center;transition:background .15s,border-color .15s;
}
.chat-pick.is-on .chat-pick-dot{background:var(--done);border-color:var(--done)}
.chat-pick.is-on .chat-pick-dot::after{
  content:"";width:10px;height:5px;
  border-left:2px solid #fff;border-bottom:2px solid #fff;
  transform:rotate(-45deg) translate(1px,-1px);
}
.chat-pick-body{flex:1;min-width:0}
.chat-pick-body .chat-row{width:100%;padding-left:0}

/* ── Panels above the keyboard (see bindKeyboardSafety) ───────────────── */
@media (max-width:900px){
  body.kb-up .sheet.on{
    bottom:var(--kb-safe,0px);
    max-height:calc(var(--vv-h,100vh) - 8px);
    transition:bottom .14s ease, opacity .2s ease, transform .22s cubic-bezier(.16,1,.3,1);
  }
  body.kb-up .focus-sheet{padding-bottom:var(--kb-safe,0px)}
  body.kb-up .focus-card{max-height:calc(var(--vv-h,100vh) - 8px)}
}

/* ── Scrabble words ──────────────────────────────────────────────────── */
#scw-host{position:absolute;inset:0;pointer-events:none;z-index:6}
#scw-host > *{pointer-events:auto}
.scw-chip{
  position:absolute;left:50%;top:calc(env(safe-area-inset-top,0px) + 54px);transform:translateX(-50%);
  display:flex;flex-direction:column;align-items:center;gap:1px;
  padding:9px 18px;border-radius:16px;cursor:pointer;max-width:86%;
  animation:scwIn .32s cubic-bezier(.16,1.4,.3,1) both;
}
.scw-chip b{font-size:16px;font-weight:800;letter-spacing:.06em}
.scw-chip span{font-size:11.5px;opacity:.75}
@keyframes scwIn{from{opacity:0;transform:translate(-50%,-10px) scale(.94)}to{opacity:1;transform:translate(-50%,0)}}
.scw-scrim{position:absolute;inset:0;background:rgba(0,0,0,.22)}
.scw-drawer{
  position:absolute;top:0;right:0;bottom:0;width:min(78%,320px);
  display:flex;flex-direction:column;
  background:var(--surface);border-left:1px solid var(--border);
  box-shadow:-18px 0 40px -24px rgba(0,0,0,.6);
  padding:calc(env(safe-area-inset-top,0px) + 14px) 0 calc(env(safe-area-inset-bottom,0px) + 10px);
  animation:scwSlide .26s cubic-bezier(.16,1,.3,1) both;
}
@keyframes scwSlide{from{transform:translateX(100%)}to{transform:none}}
.scw-head{display:flex;align-items:center;justify-content:space-between;padding:0 16px 10px;font-size:15px;color:var(--ink)}
.scw-x{border:0;background:none;color:var(--muted);font-size:26px;line-height:1;cursor:pointer}
.scw-list{flex:1;overflow-y:auto;padding:0 16px;-webkit-overflow-scrolling:touch}
.scw-item{padding:12px 0;border-top:1px solid var(--border-2,var(--border))}
.scw-item.is-focus{background:color-mix(in srgb,var(--streak,#FF9600) 9%,transparent);margin:0 -16px;padding:12px 16px;border-radius:12px}
.scw-word{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.scw-word b{font-size:15px;font-weight:800;letter-spacing:.05em;color:var(--ink)}
.scw-word span{font-size:11.5px;color:var(--muted);flex-shrink:0}
.scw-def{margin:5px 0 0;font-size:13px;line-height:1.45;color:var(--ink);opacity:.88}
.scw-def i{font-style:italic;color:var(--muted)}
.scw-def.is-wait{color:var(--muted);opacity:1}
@media (prefers-reduced-motion:reduce){.scw-chip,.scw-drawer{animation:none}}

/* ── To-dos that are settled ───────────────────────────────────────────── */
.todo-row.is-locked .todo-check{cursor:default}
.todo-row.is-missed .todo-t{color:var(--muted)}
.todo-row.is-missed .todo-check{border-style:dashed;opacity:.55}
.todo-missed{
  flex-shrink:0;font-size:10.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:#E5484D;padding:3px 8px;border-radius:100px;
  background:color-mix(in srgb,#E5484D 12%,transparent);
}

/* ── Streak card (home) ──────────────────────────────────────────────────
   Plan colour: orange on free, pink on Pod, blue on Pro. */
:root{--streak:#FF9600;--streak-soft:#FFB547}
html[data-plan="pod"]{--streak:#EC4899;--streak-soft:#F472B6}
html[data-plan="pro"]{--streak:#3B82F6;--streak-soft:#60A5FA}
.streak-card{
  margin:0 0 var(--stack,14px);padding:16px 16px 14px;border-radius:20px;
  background:var(--surface);border:1px solid var(--border);
}
.streak-card-top{display:flex;align-items:baseline;gap:7px;margin-bottom:14px}
.streak-card-flame{color:var(--streak);align-self:center;display:grid}
.streak-card-n{font-size:24px;font-weight:800;letter-spacing:-.04em;color:var(--ink);line-height:1}
.streak-card-u{font-size:13px;font-weight:600;color:var(--muted)}
.streak-card-week{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;justify-items:center}
.sw-day{display:flex;flex-direction:column;align-items:center;gap:7px}
.sw-l{font-size:12px;font-weight:700;color:var(--muted);letter-spacing:.01em}
.sw-day.is-today .sw-l{color:var(--streak)}
.sw-dot{
  width:34px;height:34px;border-radius:50%;display:grid;place-items:center;
  background:var(--surface-3);color:#fff;
}
.sw-day.is-done .sw-dot{background:var(--streak);color:#1b1206}
html[data-mood="dark"] .sw-day.is-done .sw-dot{color:#141414}
.sw-day.is-missed .sw-dot{background:transparent;border:2px dashed color-mix(in srgb,var(--muted) 55%,transparent)}
.sw-day.is-open .sw-dot{background:transparent;border:2px solid var(--streak)}
.streak-card-msg{margin:12px 0 0;text-align:center;font-size:13.5px;font-weight:500;color:var(--ink);opacity:.85}

/* ── Day done ─────────────────────────────────────────────────────────── */
.daydone{
  position:fixed;inset:0;z-index:170;display:grid;place-items:center;
  --dd:#FF9600;--dd-hi:#FFE14D;--dd-ink:#fff;
  background:var(--dd);color:var(--dd-ink);
  opacity:0;transition:opacity .26s ease;
}
.daydone.plan-pod{--dd:#EC4899;--dd-hi:#FFD1E8}
.daydone.plan-pro{--dd:#2F6FEB;--dd-hi:#CFE2FF}
.daydone.on{opacity:1}
body.daydone-open{overflow:hidden}
.daydone-body{
  width:min(100%,440px);padding:calc(env(safe-area-inset-top,0px) + 30px) 24px calc(env(safe-area-inset-bottom,0px) + 24px);
  display:flex;flex-direction:column;align-items:center;text-align:center;
  min-height:100%;justify-content:center;
}
.daydone-hero{position:relative;width:190px;height:200px;margin-bottom:12px}
.daydone-fire{
  position:absolute;inset:0;width:100%;height:100%;
  fill:var(--dd-hi);opacity:.92;
  filter:drop-shadow(0 0 30px color-mix(in srgb,var(--dd-hi) 70%,transparent));
}
.daydone-mylo{
  position:absolute;left:50%;bottom:22px;width:112px;height:112px;object-fit:contain;
  transform:translateX(-50%);
}
.daydone.on .daydone-hero{animation:ddPop .6s cubic-bezier(.16,1.5,.3,1) both}
@keyframes ddPop{from{transform:scale(.4) rotate(-8deg);opacity:0}to{transform:none;opacity:1}}
.daydone-n{
  font-size:clamp(84px,26vw,120px);font-weight:900;letter-spacing:-.05em;line-height:.95;
  color:var(--dd-hi);
}
.daydone.on .daydone-n{animation:ddUp .5s .15s cubic-bezier(.16,1,.3,1) both}
@keyframes ddUp{from{transform:translateY(16px);opacity:0}to{transform:none;opacity:1}}
.daydone-u{font-size:24px;font-weight:800;letter-spacing:-.02em;margin-top:6px}
.daydone-week{width:100%;margin-top:34px}
.daydone-labels{display:grid;grid-template-columns:repeat(7,1fr);font-size:14px;font-weight:700;margin-bottom:10px;opacity:.9}
.daydone-labels .is-today{opacity:1;text-decoration:underline;text-underline-offset:4px}
.daydone-track{
  display:grid;grid-template-columns:repeat(7,1fr);align-items:center;justify-items:center;
  padding:9px 0;border-radius:100px;
  background:color-mix(in srgb,#000 12%,transparent);
}
.dd-slot{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;color:var(--dd)}
.dd-slot.is-done{background:var(--dd-hi)}
.dd-slot.is-missed,.dd-slot.is-empty,.dd-slot.is-open{background:color-mix(in srgb,#fff 22%,transparent)}
.daydone-msg{margin:22px 0 0;font-size:16px;font-weight:600;line-height:1.4;max-width:30ch}
.daydone-acts{display:flex;flex-direction:column;gap:10px;width:100%;margin-top:34px}
.daydone-share,.daydone-go{
  width:100%;min-height:54px;border-radius:16px;border:0;cursor:pointer;
  font-size:15px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;
}
.daydone-share{background:#fff;color:var(--dd);box-shadow:0 4px 0 color-mix(in srgb,#000 15%,transparent)}
.daydone-go{background:transparent;color:#fff;border:2px solid color-mix(in srgb,#fff 45%,transparent)}
.daydone-share:active,.daydone-go:active{transform:translateY(2px)}
@media (prefers-reduced-motion:reduce){
  .daydone,.daydone.on .daydone-hero,.daydone.on .daydone-n{animation:none;transition:none}
}

/* ══════════════════════════════════════════════════════════════════════════
   Glass — LAST ON PURPOSE

   Anything sitting on top of somebody's photo has to stay legible over a white
   sky and a black shadow alike. A translucent DARK scrim plus a blur guarantees
   that contrast rather than hoping the picture cooperates; a flat coloured pill
   only ever worked over half the photos people actually post.

   It has to be the last rule in the file because it is applied ALONGSIDE other
   single-class rules — .sy-ov, for one, resets `background:none` on the overlay
   buttons, and being further down the file it silently won, which left the
   to-do card as white text on a white photo. Equal specificity means source
   order decides, so glass goes last and always wins.
   ══════════════════════════════════════════════════════════════════════════ */
.glass{
  background:rgba(20,20,24,.42);
  backdrop-filter:blur(20px) saturate(165%);
  -webkit-backdrop-filter:blur(20px) saturate(165%);
  border:1px solid rgba(255,255,255,.22);
  box-shadow:0 12px 34px -14px rgba(0,0,0,.62),inset 0 1px 0 rgba(255,255,255,.16);
  color:#fff;
}
/* Without a blur the scrim is doing all the work, so it has to be heavier. */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){
  .glass{background:rgba(18,18,22,.74)}
}


/* ---- Rooms directory (browse open rooms) ---- */
.browse-link{display:block;width:100%;text-align:center;margin-top:12px;font-size:13px;color:var(--muted)}
.browse-cats{display:flex;gap:6px;flex-wrap:wrap;margin:0 0 12px}
.browse-cats button{height:30px;padding:0 12px;border-radius:999px;border:1px solid var(--border);background:var(--surface-2);color:var(--muted);font-size:12.5px;font-weight:500}
.browse-cats button.on{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.browse-list{display:grid;gap:10px;max-height:min(60vh,520px);overflow:auto;padding-bottom:6px}
.browse-empty{padding:26px 10px;text-align:center;font-size:13.5px;color:var(--muted)}
.browse-card{display:grid;grid-template-columns:1fr auto;gap:10px 12px;align-items:center;padding:12px 14px;border-radius:14px;background:var(--surface);border:1px solid var(--border)}
.browse-card .bt{font-size:14.5px;font-weight:600;color:var(--ink);display:flex;align-items:center;gap:8px}
.browse-card .bt .cat{font-size:10.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);padding:3px 7px;border-radius:99px;border:1px solid var(--border);font-weight:500}
.browse-card .bb{font-size:13px;color:var(--muted);margin-top:3px;grid-column:1 / -1}
.browse-card .bm{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--muted);grid-column:1}
.browse-card .bm .faces{display:flex}
.browse-card .bm .faces img,.browse-card .bm .faces span{width:22px;height:22px;border-radius:50%;background:var(--surface-2);border:2px solid var(--surface);margin-left:-7px;object-fit:contain}
.browse-card .bm .faces img:first-child,.browse-card .bm .faces span:first-child{margin-left:0}
.browse-card .btn-dark{grid-column:2;grid-row:1}
.browse-card .btn-dark[disabled]{opacity:.55}
.open-row{display:grid;gap:8px;margin-top:6px}
.open-row .open-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.open-row select,.open-row input{width:100%;min-height:38px;border-radius:10px;border:1px solid var(--border);background:var(--surface-2);color:var(--ink);padding:0 12px;font:inherit;font-size:14px}
.open-row .open-grid{display:grid;grid-template-columns:1fr 92px;gap:8px}
