
  :root{
    /* Tell the browser this page ALREADY handles dark mode. Without this,
       Chromium's forced-dark mode recolours the page itself and inverts the
       logo SVG so its dark tile turns white. */
    color-scheme: dark;
    /* brand accents (shared by both themes) */
    --cyan:#00d6e6; --magenta:#ff2e97; --purple:#b14eff; --lime:#9ed90a;
    --warm:#ff8a4c; --warm-soft:#ffd9b0;
    /* site actions + new modals */
    --green:#2ee66b; --lightblue:#7fd4ff;
    /* DARK theme (default) */
    --bg:#0a0e1a;
    --panel:rgba(18,26,46,.62);
    --panel-solid:#121a2e;
    --text:#eef2ff;
    --muted:#9aa6c4;
    --hair:rgba(150,170,210,.14);
    --hair-strong:rgba(150,170,210,.28);
    --field:rgba(8,12,22,.55);
    --chip:rgba(0,214,230,.14);
    --overlay:rgba(4,7,15,.72);
    --glass-blur:14px;
    --shadow:0 10px 40px rgba(0,0,0,.45);
    /* Footer medical disclaimer. Pale pink on the dark panel; light mode gets its own pair below.
       Kept as variables because the rule itself is shared by both themes. */
    --disclaimer-ink:#ffd6ea; --disclaimer-bg:rgba(255,46,151,.08);
    --hero:url("assets/av_00.svg");
    --font:"Segoe UI",system-ui,-apple-system,Arial,sans-serif;
  }
  [data-theme="light"]{
    color-scheme: light;
    --bg:#eef3fb;
    --panel:rgba(255,255,255,.72);
    --panel-solid:#ffffff;
    --text:#0f1d33;
    --muted:#5a6b86;
    --hair:rgba(20,50,80,.14);
    --hair-strong:rgba(20,50,80,.28);
    --field:rgba(255,255,255,.7);
    --chip:rgba(0,150,170,.12);
    --overlay:rgba(224,232,244,.66);
    --glass-blur:16px;
    --shadow:0 10px 34px rgba(31,61,99,.14);
    /* AC, 1 Nov 2026: this panel used the DARK pair (#ffd6ea pale pink on a translucent pink tint) and
       came out at 1.03:1 — measured, not eyeballed: the pale pink covered 12% of its own box on a
       #e5daf3 backdrop. The pill is OPAQUE on purpose: a legal notice must not depend on the hero
       artwork behind it, which is exactly what made the translucent version unreadable. */
    --disclaimer-ink:#7d0a3c; --disclaimer-bg:#fff0f6;
    --hero:url("assets/av_01.svg");
  }
  *{box-sizing:border-box;}
    [hidden]{display:none !important;}
    html{scroll-behavior:smooth;}
    html, body{overflow-x:hidden;}
  body{
    margin:0; background:
      radial-gradient(1000px 680px at 88% -8%, rgba(0,214,230,.12), transparent 60%),
      radial-gradient(900px 620px at 6% 6%, rgba(22,224,192,.10), transparent 60%),
      linear-gradient(160deg, var(--bg) 0%, var(--bg) 100%);
    color:var(--text); font-family:var(--font); line-height:1.6;
    transition:background-color .4s ease, color .4s ease;
  }
  .wrap{max-width:1180px; margin:0 auto; padding:0 clamp(1rem,4vw,3rem);}
  header{padding:2.5rem 0 1rem; position:relative;}

  header{position:relative;}

  .topright{position:absolute; top:1.4rem; right:clamp(1rem,4vw,3rem); display:flex; align-items:center; gap:.6rem; z-index:5;}
  /* One uniform control size for everything in the top-right — Log in,
     Register and the theme toggle — so they read as a matched set rather
     than three differently-sized chips. */
  .topright .hdr-btn{
    box-sizing:border-box;
    height:2.15rem;
    padding:0 .95rem;
    font-size:.85rem;
    line-height:1;
    border-radius:.5rem;
    display:inline-flex; align-items:center; justify-content:center; gap:.35rem;
  }
  .theme-toggle .tt-label{font-weight:600;}


  .brand{font-weight:800; letter-spacing:.14em; font-size:2.3rem; display:flex; align-items:center; gap:.9rem;}
  .brand .logo{display:inline-flex; filter:drop-shadow(0 0 10px rgba(255,138,76,.45)); flex:none; }
  .logo-img{height:72px; width:72px; display:block; filter:drop-shadow(0 0 10px rgba(0,180,216,.35));}
  .brand-text{display:flex; flex-direction:column; line-height:1.05;}
  .brand-name{font-weight:800; letter-spacing:.14em;}
  .brand-name .wm-a{color:var(--lightblue);}
  .brand-name .wm-b{color:var(--magenta);}
  .brand-name b{color:var(--magenta); text-shadow:0 0 14px rgba(255,46,151,.7);}
  .brand-quote{font-weight:500; letter-spacing:.01em; font-size:.82rem; color:#ffd9b0; text-transform:none; margin-top:.3rem;
    text-shadow:0 0 10px rgba(255,138,76,.35); font-style:italic;}

  /* animated background glow */
  body::before{
    content:""; position:fixed; inset:0; z-index:-2; pointer-events:none;
    background:var(--hero); background-size:cover; background-position:center;
    opacity:.42; filter:saturate(1.12) blur(2px);
  }
  body::after{
    content:""; position:fixed; inset:-20%; z-index:-3; pointer-events:none;
    background:
      radial-gradient(620px 620px at 18% 28%, rgba(25,195,255,.14), transparent 60%),
      radial-gradient(520px 520px at 82% 68%, rgba(255,95,162,.12), transparent 60%),
      radial-gradient(560px 560px at 60% 92%, rgba(22,224,192,.12), transparent 60%);
    animation:drift 22s ease-in-out infinite alternate;
  }
  @keyframes drift{ from{transform:translate3d(-2%,-1%,0) scale(1);} to{transform:translate3d(2%,2%,0) scale(1.08);} }
  /* social proof strip */
  .social{display:flex; align-items:center; gap:1rem; flex-wrap:wrap; margin:1.6rem 0 0;}
  .social .avatars{display:flex;}
  .users-label{font-weight:700; color:var(--text); font-size:1.05rem; letter-spacing:.02em;}
  .social .avatars img{width:46px; height:46px; border-radius:50%; border:2px solid var(--bg);
    margin-left:-10px; box-shadow:0 0 12px rgba(0,240,255,.25); background:var(--field);}
  .social .avatars img:first-child{margin-left:0;}
  .social .stat{font-size:.92rem; color:var(--text);}
  .social .stat b{color:var(--warm); font-size:1.05rem;}
  .social .stat span{color:var(--muted);}
  /* presence counts: green when users are online, light blue for total registered */
  #onlineCount.on{color:#2ee66b; font-weight:700;}
  #offlineCount{color:#7fd4ff; font-weight:700;}
  /* micro-interactions */
  .chip{transition:transform .15s, border-color .15s, background .15s, color .15s; will-change:transform;}
  .chip:hover{transform:translateY(-2px);}
  .btn-primary{transition:transform .15s, box-shadow .15s;}
  .btn-primary:hover{transform:translateY(-2px); box-shadow:0 0 30px rgba(0,240,255,.6);}
  .btn-primary.pulse{animation:pulse 2.4s ease-in-out infinite;}
  @keyframes pulse{0%,100%{box-shadow:0 0 22px rgba(0,240,255,.4);}50%{box-shadow:0 0 34px rgba(0,240,255,.75);}}
  .match{animation:fadeUp .4s ease both;}
  .match-note{font-size:.78rem; color:var(--muted); margin:.2rem 0 .8rem; line-height:1.4;}
  @keyframes fadeUp{from{opacity:0; transform:translateY(10px);}
  @keyframes modalIn{from{opacity:0; transform:translateY(14px) scale(.97);} to{opacity:1; transform:translateY(0) scale(1);}}
to{opacity:1; transform:none;}}
  .match .mav{width:56px; height:56px; border-radius:50%; margin-right:.6rem; border:2px solid var(--cyan); box-shadow:0 0 12px rgba(0,240,255,.3); background:var(--field); object-fit:contain;lex:none;}
  .match .who{display:flex; align-items:center;}
  .match .who div{display:flex; flex-direction:column;}
  .pct{font-variant-numeric:tabular-nums;}
  h1{font-size:clamp(2rem,6vw,3.4rem); line-height:1.02; margin:0 0 1rem; font-weight:800;}
  h1 .acc{color:var(--magenta);}
  /* The leading word "Find" in the hero headline — light blue on BOTH web and phone.
     Applied via <span class="find-accent"> in index.html AND in the i18n h1 string, because
     applyLang() replaces [data-i18n] innerHTML and would otherwise wipe the span. */
  h1 .find-accent{color:var(--lightblue);}
  .lede{color:var(--muted); max-width:680px; font-size:1.05rem;}
  .disclaimer{
    margin:1.5rem 0 0; padding:.8rem 1.1rem; border-left:3px solid var(--magenta);
    background:var(--disclaimer-bg); border-radius:.4rem; font-size:.9rem; color:var(--disclaimer-ink);
  }

  .layout{display:block; padding:0 0 3rem;}
      .col-left{display:block;}
      .col-right{display:block;}

      /* ===== Matching-first two-column layout ===== */
      .hero-compact{text-align:center; padding:2.5rem 0 1.5rem; max-width:760px; margin:0 auto;}
      .hero-compact h1{font-size:clamp(2rem,5.5vw,3.2rem); line-height:1.05; margin:0 0 .8rem; font-weight:800;}
      .hero-compact .lede{margin:0 auto 1.2rem;}

      .match-layout{display:block; margin:0 0 1.6rem;}
                  .picker-col{position:static;}
                  .matches-col{min-height:200px;}

            /* ===== Full-width curved match carousel (fits one screen) ===== */
                                    .matches-col{position:relative; left:50%; transform:translateX(-50%);
                                      width:100vw; border-radius:0; border-left:none; border-right:none;
                                      min-height:0; padding-top:.5rem; padding-bottom:.5rem;}
                        .matches-col .step-head{max-width:1180px; margin-left:auto; margin-right:auto; padding:0 clamp(1rem,4vw,3rem);}
                        .carousel{position:relative; display:flex; align-items:stretch; gap:.5rem; padding:.5rem clamp(1rem,4vw,3rem);
                                                  height:min(64vh, 640px);}
                                                .match-strip{display:flex; gap:clamp(.6rem,1.2vw,1.2rem); overflow-x:auto; overflow-y:hidden; flex:1;
                                                  padding:clamp(.6rem,1.5vh,1rem) .5rem; scroll-snap-type:x mandatory; perspective:900px;
                                                  align-items:stretch; -ms-overflow-style:auto;}
                                                /* Firefox has no ::-webkit-scrollbar; give it a brand-coloured thumb instead.
   Kept OUT of the main .match-strip rule on purpose: setting scrollbar-width/scrollbar-color
   there makes Chromium ignore the ::-webkit-scrollbar-thumb rules below. */
@supports not selector(::-webkit-scrollbar){
  .match-strip{ scrollbar-width:thin; scrollbar-color:var(--lightblue) rgba(255,255,255,.08); }
}
.match-strip::-webkit-scrollbar{height:10px;}
.match-strip::-webkit-scrollbar-track{background:rgba(255,255,255,.07); border-radius:99px;}
.match-strip::-webkit-scrollbar-thumb{background:var(--lightblue); border-radius:99px; border:2px solid transparent; background-clip:content-box;}
.match-strip::-webkit-scrollbar-thumb:hover{filter:brightness(1.18);}
                                                .carousel::-webkit-scrollbar{display:none; width:0; height:0;}
                                                .match-strip .match{flex:0 0 clamp(220px, 26vw, 340px); scroll-snap-align:center; margin:0; align-self:stretch;
                                                  display:flex; flex-direction:column; justify-content:flex-start;
                                                  transition:transform .25s ease, opacity .25s ease;}
                                                .match-strip .match .top{justify-content:flex-start; margin-bottom:1.3rem;}
                                                                        .match-strip .match .mav{width:92px; height:92px; margin-right:1.4rem;}
                                                                        .match-strip .match .who b{font-size:1.1rem;}
                                                                        .match-strip .match .who small{font-size:.9rem;}
                                                                        .match-strip .match .pct{font-size:1.9rem;}
                                                                        .match-strip .match .shared{font-size:.95rem;}
                                                                        .match-strip .match .bar{margin:1.1rem 0;}
                                                .match-strip .match .shared{flex:1; display:flex; flex-direction:column; justify-content:center; overflow:hidden;}
                        .match-strip .match .card-syms{font-size:.95rem; margin-bottom:.3rem;}
                        .match-strip .match .card-syms b{color:var(--text);}
                        /* GUEST DEMO (4 Nov 2026): the ten examples a signed-out visitor sees. Dashed
                           border + an "example" tag so a card cannot be mistaken for a member, no pointer
                           and no hover glow because the card does nothing when it is clicked. Colours come
                           from the theme tokens only — a colour picked for one theme is invisible in the
                           other (the disclaimer bug of 1 Nov 2026). */
                        .match-strip .match.ex-card{cursor:default; border-style:dashed; border-color:var(--hair-strong);}
                        .match-strip .match.ex-card:hover{border-color:var(--hair-strong); background:none; transform:none; box-shadow:none;}
                        .match-strip .match.ex-card .ex-tag{flex:none; font-size:.72rem; letter-spacing:.06em; text-transform:uppercase;
                          color:var(--muted); border:1px dashed var(--hair-strong); border-radius:99px; padding:.15rem .5rem;}
                        .match-strip .match.ex-card .ex-cond{margin:.25rem 0; font-weight:700; color:var(--muted); font-size:1rem;}
                        .guest-demo-note{margin:.2rem 0 .9rem; padding:.65rem .95rem; border-radius:.9rem;
                          background:var(--panel); border:1px dashed var(--hair-strong); color:var(--muted);
                          font-size:.95rem; line-height:1.4;}
                        .guest-demo-note b{color:var(--text);}
                        .guest-demo-note .guest-demo-cta{display:block; margin-top:.35rem; color:var(--text);}
                        .match-strip .match .card-cond{margin:.25rem 0; font-weight:700; color:var(--cyan); font-size:1rem;}
                        .match-strip .match .card-bio{margin:.3rem 0 .6rem; color:var(--muted); font-size:.9rem; line-height:1.35;
                          overflow:hidden; display:-webkit-box; -webkit-line-clamp:5; -webkit-box-orient:vertical;}
                        .match-strip .match .bar{margin:.8rem 0 0;}
                                                .match-strip .match .match-status{margin-top:.8rem;}
                                                .match-strip .empty{flex:0 0 100%; text-align:center; padding:2rem 0;}
                                                /* diary view bar (when viewing another user's diary) */
                                                                                                .bio-viewbar{display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap;
                                                                                                  margin:0 0 1.2rem; padding:.7rem 1rem; border:1px solid var(--cyan); border-radius:.8rem;
                                                                                                  background:rgba(0,214,230,.08);}
                                                                                                .bio-viewbar span{font-weight:700; color:var(--cyan);}
                                                                                                .bio-viewbar .btn{padding:.35rem .8rem; font-size:.85rem;}
                                                                                                .bioreadonly .bio-composer{display:none;}
                                                                                                .car-arrow{flex:none; align-self:center; width:clamp(36px,4vw,48px); height:clamp(36px,4vw,48px); border-radius:50%; border:1px solid var(--hair-strong);
                          background:var(--panel); color:var(--cyan); font-size:1.6rem; line-height:1; cursor:pointer;
                          display:flex; align-items:center; justify-content:center; transition:.15s; box-shadow:var(--shadow);}
                        .car-arrow:hover{border-color:var(--cyan); background:var(--panel-solid); transform:scale(1.06);}
                        .car-arrow:disabled{opacity:.35; cursor:default; transform:none;}

      .site-header{display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:1rem; padding:1.6rem 0 1rem;}
      .site-header .brand{font-size:1.9rem;}
      .site-header .logo-img{height:52px; width:52px; border-radius:12px; object-fit:cover;}
      .site-header .topright{position:static; display:flex; align-items:center; gap:.6rem;}

      .step{background:var(--panel); border:1px solid var(--hair); border-radius:1.1rem; padding:1.6rem; margin:0 0 1.6rem; backdrop-filter:blur(var(--glass-blur)); -webkit-backdrop-filter:blur(var(--glass-blur)); box-shadow:var(--shadow);}
      .step-head{display:flex; align-items:center; gap:.7rem; margin:0 0 1.1rem;}
      /* header invites badge */
      .invites-btn{ position:relative; display:inline-flex; align-items:center; gap:.35rem; }
      .inv-badge{ min-width:1.1rem; height:1.1rem; padding:0 .3rem; border-radius:99px; display:inline-flex;
        align-items:center; justify-content:center; font-size:.68rem; font-weight:800;
        background:var(--magenta); color:#fff; }
      /* invites block inside the Friends window */
      .invites-block{ margin:0 0 .9rem; padding:.6rem .7rem; border:1px solid rgba(255,46,151,.4);
        border-radius:.6rem; background:rgba(255,46,151,.07); }
      .invites-head{ font-size:.75rem; font-weight:800; letter-spacing:.06em; text-transform:uppercase;
        color:var(--magenta); margin-bottom:.45rem; }
      .inv-item{ display:flex; align-items:center; gap:.5rem; padding:.35rem 0; }
      .inv-item + .inv-item{ border-top:1px solid var(--hair); }
      .inv-item .inv-name{ flex:1; font-size:.86rem; }
      .inv-item .inv-name b{ display:block; }
      .inv-item .inv-name small{ color:var(--muted); font-size:.75rem; }
      .inv-item .btn{ font-size:.74rem; padding:.3rem .6rem; }
      .inv-empty{ color:var(--muted); font-size:.82rem; }
      .match-count{font-size:.82rem; font-weight:700; letter-spacing:.02em;
        color:var(--magenta); background:rgba(255,46,151,.12); border:1px solid rgba(255,46,151,.42);
        border-radius:99px; padding:.25rem .7rem; white-space:nowrap;}
      /* "View list" is a PHONE affordance: on desktop the carousel already fits the rail, so the
         button stays display:none. The phone media query below turns it on. */
      .view-list-btn{display:none}
      /* ===== Full match list view (phone only) — added 25 Oct 2026 ===== */
      .match-list-view{position:fixed; inset:0; z-index:300; display:flex; flex-direction:column;
        background:var(--bg); animation:fadeUp .2s ease both;}
      .match-list-head{position:sticky; top:0; z-index:1; display:flex; align-items:center; gap:.7rem;
        padding:.9rem 1rem .75rem; background:rgba(10,14,22,.97); border-bottom:1px solid var(--hair);
        backdrop-filter:blur(12px); -webkit-backdrop-filter:blur(12px);}
      .match-list-title{margin:0; font-size:1.05rem; font-weight:800; display:flex; align-items:center; gap:.6rem; flex-wrap:wrap;}
      .match-list-close{margin-left:auto; flex:none; min-width:44px; min-height:44px; display:inline-flex;
        align-items:center; justify-content:center; background:rgba(255,255,255,.06); border:1px solid var(--hair-strong);
        color:var(--text); border-radius:.6rem; font-size:1.05rem; line-height:1; cursor:pointer;}
      .match-list-body{flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
        padding:1rem 1rem calc(2.2rem + env(safe-area-inset-bottom, 0px));}
      /* Cards here are stacked full-width, not carousel slides: the .match-strip sizing does not
         apply outside .match-strip, so only the stack spacing needs stating. */
      .match-list-body .match{margin:0 0 .9rem; width:auto;}
      .match-list-body .match:last-child{margin-bottom:0;}
      .match-list-body .match .mav{width:64px; height:64px; margin-right:.8rem;}
      .step-head h2{margin:0; font-size:1.25rem;}
      .step-num{display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:50%; background:var(--cyan); color:#03121a; font-weight:800; font-size:.95rem; flex:none;}
      .step-body{max-width:720px;}
      

            .account{margin:0 0 1.6rem;}
      .account-card{display:flex; align-items:center; gap:1rem; flex-wrap:wrap; background:var(--panel); border:1px solid var(--hair); border-radius:1.1rem; padding:1.1rem 1.4rem; backdrop-filter:blur(var(--glass-blur)); -webkit-backdrop-filter:blur(var(--glass-blur)); box-shadow:var(--shadow);}
      .account-card .profile-av{width:64px; height:64px; flex:none;}
      .account-info{display:flex; flex-direction:column; min-width:120px;}
      .account-info .profile-name{margin:0; font-size:1.05rem;}
      .account-info .profile-bio{margin:0; text-align:left; max-width:280px;}
      .account-links{display:flex; gap:.5rem; flex-wrap:wrap; margin-left:auto;}
      .account-actions{display:flex; gap:.5rem; flex-wrap:wrap;}
      /* GUEST GATE (AC, 3 Nov 2026): a signed-out visitor cannot search or pick symptoms, and has no
         profile to show. The controls stay on screen (so the feature reads as existing) but dim, and
         the note above them is the only thing that says why. Classes are toggled by applyGuestGate(). */
      .guest-gate{margin:0 0 .9rem; padding:.6rem .85rem; border:1px solid var(--hair-strong);
        border-left:3px solid var(--cyan); border-radius:.6rem; background:var(--panel);
        color:var(--text); font-size:.88rem; line-height:1.35;}
      .picker-gated .controls .search{opacity:.45;}
      .picker-gated .controls .search input{color:var(--muted); cursor:default;}
      /* Scope note (AC, 3 Nov 2026): ONLY the search attempt is closed to a guest. The ▾ arrow, the
         "How I Feel" chips, "Add your own symptom" and the Find button keep their full weight — a guest
         is meant to use them. Do not dim the whole picker again. */
      /* A guest has no profile: the avatar and the name/bio leave. The Friends / Games / Radar buttons
         stay — those are doors into the site, not a member's own data. */
      .account-guest .profile-av,
      .account-guest .account-info{display:none;}
      .blocked-panel{margin-top:.8rem; padding:.8rem 1.2rem; border:1px solid var(--hair); border-radius:.8rem; background:rgba(255,93,143,.05);}
      .blocked-panel h3{margin:0 0 .4rem; font-size:.9rem; color:var(--muted);}

      .legal-links{margin:.4rem 0;}
      .legal-links a{color:var(--cyan); text-decoration:none;}
      .legal-links a:hover{text-decoration:underline;}

  .panel{background:var(--panel); border:1px solid var(--hair); border-radius:1rem; padding:1.3rem; backdrop-filter:blur(var(--glass-blur)); -webkit-backdrop-filter:blur(var(--glass-blur)); box-shadow:var(--shadow);}
  .panel h2{margin:0 0 1rem; font-size:1.15rem;}

  .controls{display:flex; gap:.7rem; flex-wrap:wrap; align-items:center; margin-bottom:1.2rem;}
  .search{flex:1; min-width:200px; display:flex; align-items:center; gap:.5rem;
    background:var(--field); border:1px solid var(--hair-strong); border-radius:.5rem; padding:.5rem .8rem;}
  .search input{border:none; background:transparent; color:var(--text); font-size:.95rem; width:100%; outline:none; font-family:var(--font);}
  .search svg{flex:none; opacity:.6;}

  /* ---- Symptom dropdown: anchored under the ▾ arrow, at least 24 rows visible, scrolls for the rest ---- */
  .sym-field{position:relative; flex:1; min-width:220px; display:flex; align-items:center; gap:.45rem;}
  .sym-field .search{flex:1; min-width:0;}
  .sym-arrow{flex:none; display:inline-flex; align-items:center; justify-content:center;
    width:2.1rem; height:2.05rem; padding:0; border:1px solid var(--hair-strong); border-radius:.5rem;
    background:var(--field); color:var(--muted); font-size:.9rem; line-height:1; cursor:pointer; transition:.15s;}
  .sym-arrow:hover{border-color:var(--cyan); color:var(--cyan);}
  .sym-arrow[aria-expanded="true"]{border-color:var(--cyan); color:var(--cyan); background:var(--chip);}
  .sym-caret{display:block; transition:transform .15s;}
  .sym-arrow[aria-expanded="true"] .sym-caret{transform:rotate(180deg);}
  .sym-drop{position:absolute; top:calc(100% + .3rem); right:0; width:min(340px,92vw);
    max-height:min(calc(24 * 1.75rem + .7rem), calc(100vh - 7rem)); overflow-y:auto; overscroll-behavior:contain;
    background:var(--panel-solid); border:1px solid var(--hair-strong); border-radius:.6rem;
    box-shadow:0 18px 40px rgba(0,0,0,.55); padding:.35rem; z-index:60; box-sizing:border-box;}
  .sym-row{display:flex; align-items:center; gap:.5rem; height:1.75rem; padding:0 .6rem; border-radius:.4rem;
    font-size:.9rem; color:var(--text); cursor:pointer; white-space:nowrap;}
  .sym-row:hover, .sym-row.hl{background:var(--chip); color:var(--cyan);}
  .sym-row.on{color:var(--cyan); font-weight:600;}
  .sym-row .tick{margin-left:auto; color:var(--cyan); font-size:.8rem;}
  .sym-drop .empty-row{padding:.7rem .6rem; color:var(--muted); font-size:.85rem;}
  /* The panel must paint OVER the "2. Matches" section. Each .step is its own stacking
     context (backdrop-filter), and .matches-col also carries a transform, so the
     panel's own z-index is trapped inside the picker — the PICKER COLUMN has to be
     lifted instead. Specificity beats the .picker-col{position:static} rule below it. */
  .step.picker-col{position:relative; z-index:20;}
  /* While the panel is OPEN, lift the picker above the fixed layers that would otherwise
     cover it: the bottom toolbar (80) and the chat dock (85). A deliberately-opened
     dropdown should read as the top layer, like a native select popup. Kept just BELOW
     the modal overlays (90), which must always win. */
  .step.picker-col.drop-open{z-index:89;}

  .custom-fill{display:flex; align-items:center; gap:.6rem; margin-top:.7rem; flex-wrap:wrap;}
  .custom-fill.locked{opacity:.5; pointer-events:none;}

  .cat{margin-bottom:1.2rem;}
  .cat h3{margin:0 0 .6rem; font-size:.92rem; color:var(--cyan); letter-spacing:.05em;
    display:flex; align-items:center; gap:.5rem;}
  .cat h3 .cnt{color:var(--muted); font-weight:400; font-size:.78rem; letter-spacing:0;}
  .chips{display:flex; flex-wrap:wrap; gap:.5rem;}
  .chip{
    display:inline-flex; align-items:center; gap:.45rem; cursor:pointer; user-select:none;
    border:1px solid var(--hair-strong); border-radius:999px; padding:.4rem .85rem;
    font-size:.86rem; color:var(--muted); transition:.15s;
  }
  .chip:hover{border-color:var(--cyan); color:var(--text);}
  .chip.on{position:relative; background:var(--chip); border-color:var(--cyan); color:var(--cyan); font-weight:600;}
  .chip input{display:none;}
  /* hover deselect badge */
  .chip .x{position:absolute; top:-9px; right:-9px; width:20px; height:20px; border-radius:50%;
    background:var(--panel-solid); border:1px solid var(--pink); color:var(--pink); font-size:.8rem; line-height:18px;
    text-align:center; cursor:pointer; opacity:0; transform:scale(.6); transition:opacity .15s, transform .15s;
    box-shadow:0 0 10px rgba(255,93,143,.5);}
  .chip.on:hover .x{opacity:1; transform:scale(1);}
  .chip .x:hover{background:var(--pink); color:#fff;}
  /* Touch devices have no hover: keep the deselect badge always visible. */
  @media (hover:none){
    .chip .x{opacity:1; transform:scale(1);}
  }

  .actions{display:flex; gap:.8rem; flex-wrap:wrap; margin-top:.4rem;}
  .btn{display:inline-block; padding:.7rem 1.3rem; border-radius:.5rem; text-decoration:none;
    font-weight:700; font-size:.92rem; border:none; cursor:pointer; transition:.15s;}
  .btn-primary{background:var(--cyan); color:#03121a; box-shadow:0 0 22px rgba(0,240,255,.4);}
  .btn-primary:hover{transform:translateY(-2px);}
  .btn-ghost{background:transparent; border:1px solid var(--hair-strong); color:var(--text);}
  .btn-ghost:hover{border-color:var(--cyan); color:var(--cyan);}
  .counter{color:var(--muted); font-size:.9rem; margin:1rem 0 0;}
  .counter b{color:var(--lime);}

  .results h2{display:flex; align-items:center; justify-content:space-between;}
  .match{border:1px solid var(--hair); border-radius:.7rem; padding:1rem; margin-bottom:.8rem; transition:.2s;}
  .match{cursor:pointer; transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;}
  .match:hover{border-color:rgba(0,240,255,.6); background:rgba(0,240,255,.06); transform:scale(1.03); box-shadow:0 6px 22px rgba(0,180,216,.25); z-index:2;}
  .match .top{display:flex; align-items:center; justify-content:space-between; gap:1rem;}
  .match .who{font-weight:700;}
  .match .who small{display:block; color:var(--muted); font-weight:400; font-size:.8rem;}
  .pct{font-size:1.5rem; font-weight:800; color:var(--lime); white-space:nowrap;}
  .bar{height:6px; border-radius:99px; background:var(--hair-strong); margin:.7rem 0 .6rem; overflow:hidden;}
  .bar > i{display:block; height:100%; background:linear-gradient(90deg,var(--cyan),var(--lime));}
  .shared{font-size:.82rem; color:var(--muted);}
  .shared b{color:var(--text);}
  .soon{margin-top:1rem; padding:.9rem 1.1rem; border:1px dashed rgba(177,78,255,.4);
    border-radius:.6rem; color:#e3d4ff; font-size:.88rem;}
  footer{border-top:1px solid var(--hair); padding:2rem 0; color:var(--muted); font-size:.88rem;}
  .empty{color:var(--muted); font-style:italic; padding:1rem 0;}
  .hidden{display:none;}

  /* Register modal */
  /* overflow-y:auto matters: the sign-up form is ~950px tall on a small phone, so with the default
     overflow:visible the top ("Join Folkpeer" title) and the bottom (submit button) were clipped by
     the viewport with no way to scroll to them. Measured at 320x640: modal top -157, bottom 797. */
  /* z-index must beat the phone tab bar (86) and the Me/Chats sheets (120), otherwise the fixed
     bottom bar paints ON TOP of the sign-up form and covers the text under it. Measured before:
     overlayZ 50 < barZ 86, and elementFromPoint at the bar's centre returned the BAR while the auth
     modal was open. .modal-overlay already sits at 90, so 50 here was simply inconsistent. */
  #regOverlay{position:fixed; inset:0; background:var(--overlay); backdrop-filter:blur(10px);
    display:flex; align-items:flex-start; justify-content:center; z-index:130; padding:1rem;
    overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;}
  #regOverlay.hidden{display:none;}
  /* margin:auto (not align-items:center) centres the card when it fits and, when it is taller than
     the screen, keeps its top edge reachable instead of clipping it above the scroll origin. */
  .reg-modal{width:min(420px,94vw); background:var(--panel); border:1px solid rgba(0,240,255,.3);
    border-radius:1rem; padding:1.6rem 1.6rem 1.3rem; box-shadow:0 0 50px rgba(0,240,255,.25); position:relative;
    margin:auto;}
  .reg-modal h2{margin:.2rem 0 .3rem; font-size:1.4rem;}
  .reg-modal .sub{color:var(--muted); font-size:.9rem; margin:0 0 1.1rem;}
  .reg-modal label{display:block; font-size:.82rem; color:var(--muted); margin:.8rem 0 .3rem;}
  .reg-modal input[type=text],.reg-modal input[type=email],.reg-modal input[type=password]{
    width:100%; padding:.7rem .8rem; border-radius:.5rem; border:1px solid var(--hair-strong);
    background:var(--field); color:var(--text); font-size:.95rem; font-family:var(--font);}
  .reg-modal input:focus{outline:none; border-color:var(--cyan); box-shadow:0 0 0 2px rgba(0,240,255,.25);}
  .reg-modal .pw-wrap{position:relative;}
  .reg-modal .toggle{position:absolute; right:.6rem; top:50%; transform:translateY(-50%); cursor:pointer;
    color:var(--cyan); font-size:.78rem; user-select:none;}
  .meter{height:6px; border-radius:99px; background:var(--hair-strong); margin-top:.5rem; overflow:hidden;}
  .meter > i{display:block; height:100%; width:0; transition:width .2s, background .2s;}
  .meter-label{font-size:.74rem; color:var(--muted); margin-top:.3rem;}
  .reg-err{color:#ff6b8a; font-size:.8rem; min-height:1.1rem; margin-top:.5rem;}
  .reg-ok{color:var(--lime); font-size:.85rem; margin-top:.6rem; text-align:center;}


  .stat-dot{display:inline-block; width:9px; height:9px; border-radius:50%; background:var(--lime); box-shadow:0 0 8px rgba(198,255,0,.7);}
  .stat-dot.on{background:#39ff88;}
  /* offline is RED now (AC, 31 Oct 2026: "when a friend is online is the dot light green or red? should
     be red"). It used to be a grey-blue that read as "no information" rather than "not here". */
  .stat-dot.off{background:#ff4d5e; box-shadow:0 0 8px rgba(255,77,94,.55);}
  .stat-dot.unknown{background:#5a6480; box-shadow:none;}
  .badge-off{font-size:.72rem; color:var(--warm-soft); border:1px solid rgba(255,138,76,.5); border-radius:999px; padding:.1rem .5rem;}
  .match-status{margin-top:.5rem; display:flex; align-items:center; gap:.4rem;}
  /* inline match expander (replaces the old modal popup) */
  /* always-visible card actions: View diary (left) · Begin chat (right) */
  /* profile: country opt-in */
  .pf-hint{ color:var(--muted); font-weight:400; font-size:.78rem; }
  /* The toggle row: LEFT aligned, the marker in front of its own label. The doubled specificity is
     REQUIRED — `.pf-field input{width:100%}` and `.pf-field > label{display:block}` otherwise win, the
     checkbox stretches across the whole row and the tick looks CENTRED (AC, 30 Oct 2026). */
  .pf-field .pf-toggle{ display:flex; align-items:center; justify-content:flex-start; gap:.5rem;
    font-size:.88rem; color:var(--text); margin:.35rem 0 .5rem; cursor:pointer; text-align:left; }
  .pf-field .pf-toggle input[type="checkbox"]{ width:1.05rem; height:1.05rem; flex:0 0 auto; margin:0;
    padding:0; accent-color:var(--cyan); cursor:pointer; }
  #pfCountry:disabled{ opacity:.45; cursor:not-allowed; }
  .match .card-actions{ display:flex; justify-content:flex-start; align-items:center; gap:.5rem;
    margin-top:auto; padding-top:.9rem; }
  .match .card-actions .btn{ flex:0 0 auto; font-size:.82rem; padding:.45rem .85rem; }
  /* clickable condition on a card + its explanation popup */
  .match .card-cond{ cursor:help; display:inline-block; }
  .match .card-cond:hover{ color:#fff; border-bottom:1px dotted rgba(0,214,230,.55); }
  #condPop{ position:fixed; z-index:60; max-width:280px; background:#0d1626; border:1px solid var(--cyan); border-radius:.55rem; padding:.6rem .75rem; box-shadow:0 12px 34px rgba(0,0,0,.62); font-size:.82rem; line-height:1.45; color:var(--text); }
  #condPop b{ display:block; color:var(--cyan); margin-bottom:.25rem; font-size:.86rem; }
  #condPop span{ color:var(--muted); }
  .save-note{font-size:.8rem; color:var(--muted); margin:.8rem 0 0; padding:.6rem .8rem; border:1px dashed rgba(255,138,76,.35); border-radius:.5rem; background:rgba(255,138,76,.05);}
  .show-more{width:100%; margin-top:.4rem; text-align:center; font-size:.85rem;}
  .show-more .chev{display:inline-block;}
  /* Profile avatar above Matches */
  .profile-top{display:flex; flex-direction:column; align-items:center; margin-top:-10px; margin-bottom:.4rem;}
  .profile-av{width:180px; height:180px; border-radius:50%; padding:0; border:2px solid var(--cyan);
    background:rgba(0,240,255,.12); cursor:pointer; overflow:hidden; box-shadow:0 0 18px rgba(0,240,255,.35);
    transition:.15s;}
  .profile-av:hover{box-shadow:0 0 28px rgba(0,240,255,.6);}
  .profile-av img{width:100%; height:100%; object-fit:contain; display:block;}
  .profile-name{margin-top:.4rem; font-weight:700; color:var(--text); font-size:1rem;}
  .profile-bio{margin-top:.2rem; color:var(--muted); font-size:.82rem; max-width:240px; text-align:center; line-height:1.3; min-height:.1rem;}
  .pf-field textarea{width:100%; background:var(--field); border:1px solid rgba(0,240,255,.25); border-radius:.5rem; color:var(--text); padding:.5rem .6rem; font:inherit; resize:vertical;}
  .pf-avatars img{border:2px solid transparent;}
  .pf-avatars img.sel{border-color:var(--cyan); box-shadow:0 0 0 2px rgba(0,240,255,.35);}
  .profile-modal{width:min(560px,94vw);}
    .pf-sub{color:var(--muted); font-size:.85rem; margin:-.4rem 0 1rem; line-height:1.4;}
    .pf-av-wrap{display:flex; justify-content:flex-start; margin:.4rem 0 1rem;}
    .pf-preview{width:96px; height:96px; border-radius:50%; object-fit:contain; border:2px solid var(--cyan);
      box-shadow:0 0 16px rgba(0,240,255,.3);}
    .pf-grid{display:grid; grid-template-columns:1fr 1fr; gap:.9rem;}
    @media(max-width:480px){ .pf-grid{grid-template-columns:1fr;} }
    .pf-field{margin-bottom:.9rem;}
    .pf-field > label{display:block; font-size:.82rem; color:var(--muted); margin-bottom:.3rem;}
    .pf-field input, .pf-field select{width:100%; padding:.6rem .7rem; border-radius:.5rem;
      border:1px solid var(--hair-strong); background:var(--field); color:var(--text);
      font-family:var(--font); font-size:.95rem;}
    .pf-field input:focus, .pf-field select:focus{outline:none; border-color:var(--cyan);}
    .pf-count{color:var(--cyan); font-weight:600; font-size:.78rem; margin-left:.3rem;}
    .pf-avatars{display:grid; grid-template-columns:repeat(6,1fr); gap:.5rem;
      max-height:230px; overflow-y:auto; padding:.4rem; border:1px solid var(--hair);
      border-radius:.6rem; background:rgba(0,0,0,.12);}
    .pf-avatars img{width:100%; aspect-ratio:1; border-radius:50%; object-fit:contain; cursor:pointer;
      border:2px solid transparent; transition:.12s;}
    .pf-avatars img:hover{border-color:var(--cyan);}
    .pf-avatars img.sel{border-color:var(--lime); box-shadow:0 0 12px rgba(198,255,0,.5);}
  .pf-err{color:var(--pink); font-size:.82rem; min-height:1rem; margin-bottom:.4rem;}
  .pf-actions{display:flex; gap:.7rem; justify-content:flex-end;}
  .pf-actions .btn{width:auto; margin-top:0;}
  /* Delete account, LAST in the form (under Cancel & Save): a hairline separates a destructive footnote
     from the form's own actions (AC, 30 Oct 2026). It stays quiet until pressed, then opens an INLINE
     two-step confirm in the app's existing danger colour. */
  .pf-delete{margin-top:1rem; padding-top:.9rem; border-top:1px solid var(--hair);}
  /* BOTH danger buttons (the trigger AND "Yes, delete my account" inside the confirm box) — a
     descendant selector on purpose: the Yes button is a child of the confirm box, not of .pf-delete. */
  .pf-delete .pf-danger{width:auto; background:rgba(255,138,138,.14); border:1px solid rgba(255,138,138,.5); color:#ff8a8a;}
  .pf-delete .pf-danger:hover{border-color:#ff8a8a;}
  .pf-delete #pfDeleteConfirm{margin-top:.7rem; padding:.7rem .8rem; border:1px solid rgba(255,138,138,.35);
    border-radius:.5rem; background:rgba(255,138,138,.06);}
  .pf-delete #pfDeleteConfirm .pf-hint{display:block; margin:0 0 .1rem; line-height:1.4;}
  .pf-delete #pfDeleteConfirm .pf-actions{margin-top:.6rem;}

  .reg-demo{margin-top:1rem; font-size:.72rem; color:var(--muted); text-align:center; border-top:1px dashed var(--hair); padding-top:.7rem;}
  .reg-terms{display:flex; align-items:flex-start; gap:.5rem; margin-top:.8rem; font-size:.82rem; line-height:1.35;}
  .reg-terms input{margin-top:.15rem;}
  .reg-tc{margin-top:.6rem; padding:.8rem 1rem; border:1px solid var(--hair); border-radius:.7rem; background:rgba(0,0,0,.15); font-size:.78rem; color:var(--muted); max-height:200px; overflow:auto;}
  .reg-tc h3{margin:0 0 .5rem; font-size:.9rem; color:var(--text);}
  .reg-modal .btn{width:100%; margin-top:1rem; text-align:center;}
  .reg-close{position:absolute; top:.7rem; right:.9rem; color:var(--muted); cursor:pointer; font-size:1.2rem; background:none; border:none;}

  /* Generic modal overlay (profile editor) */
  .modal-overlay{position:fixed; inset:0; background:var(--overlay); backdrop-filter:blur(10px);
    display:flex; align-items:center; justify-content:center; z-index:90; padding:1rem; overflow:auto;}
  .modal-overlay[hidden]{display:none;}
  .modal{width:min(460px,94vw); max-height:92vh; overflow:auto; background:var(--panel); animation:modalIn .34s ease both;
    border:1px solid rgba(0,240,255,.3); border-radius:1rem; padding:1.6rem 1.6rem 1.3rem;
    box-shadow:0 0 50px rgba(0,240,255,.25); position:relative;}
  .modal h2{margin:.2rem 0 1rem; font-size:1.4rem;}
  .modal-x{position:absolute; top:.7rem; right:.9rem; color:var(--muted); cursor:pointer;
      font-size:1.2rem; background:none; border:none; line-height:1;}

        .match-modal{width:min(420px,94vw);}
  .mm-head{display:flex; align-items:center; gap:.8rem; margin-bottom:.6rem;}
  .mm-av{width:64px; height:64px; border-radius:50%; object-fit:cover; border:1px solid var(--hair);}
  .mm-meta{color:var(--muted); font-size:.85rem;}
  .mm-pct{margin-left:auto; font-size:1.4rem; font-weight:800; color:var(--cyan);}
  .mm-bar{height:8px; border-radius:6px; background:var(--hair); overflow:hidden; margin:.3rem 0 .7rem;}
  .mm-bar > i{display:block; height:100%; background:linear-gradient(90deg,#00f0ff,#1de9b6);}
  .mm-shared{color:var(--text); font-size:.92rem; margin:.2rem 0 .9rem;}
  .mm-shared b{color:var(--lime);}
  .mm-actions{display:flex; gap:.6rem;}
  .mm-actions .btn{flex:1; justify-content:center;}
  .mm-note{margin:.8rem 0 0; color:var(--muted); font-size:.82rem; text-align:center;}
  .chat-win{position:fixed; left:auto; right:1.2rem; bottom:1.2rem; width:min(360px,92vw); height:min(480px,82vh);
    /* resize:none on purpose: the browser's native CSS grip needs a MOUSE, so a phone could never resize
       a box, and it ignores our own clamp. The custom .chat-resize grip below does it for mouse and touch. */
    min-width:200px; min-height:150px; max-width:94vw; max-height:94vh; resize:none;
    background:var(--panel-solid); border:1px solid rgba(0,240,255,.35); border-radius:1rem;
    box-shadow:0 0 40px rgba(0,240,255,.22); display:flex; flex-direction:column; z-index:80; overflow:hidden;
    animation:modalIn .3s ease both;}
  /* OPAQUE by default (2026-10-22, AC): the animated page must not bleed through a chatbox or
     the commands window. The ⋯ menu can switch a window back to the translucent glass look
     (the `glass` class); the old `.solid` class is harmless and stays supported. */
  .chat-win .chat-head{ background:rgba(0,240,255,.08); }
  .chat-win .chat-thread{ background:transparent; }
  .chat-win .chat-input{ background:rgba(10,14,26,.85); }
  .chat-win .gp-members{ background:transparent; }
  .chat-win.glass{ background:var(--panel); }
  .chat-win.glass .chat-head{ background:rgba(0,240,255,.05); }
  .chat-win.glass .chat-input{ background:var(--bg); }
  .chat-win.glass .gp-members{ background:rgba(0,0,0,.12); }
  .chat-win.solid{ background:var(--panel-solid); }
  /* Resize grip, bottom-right corner (25 Oct 2026). A REAL element rather than a CSS corner, because
     touch-action cannot be set for just one corner of a scrolling box: without touch-action:none the
     browser would scroll the message thread instead of resizing. */
  .chat-resize{position:absolute; right:0; bottom:0; width:24px; height:24px; z-index:6;
    cursor:nwse-resize; touch-action:none; -webkit-user-select:none; user-select:none;}
  .chat-resize::after{content:""; position:absolute; right:3px; bottom:3px; width:10px; height:10px;
    border-right:2px solid rgba(0,240,255,.65); border-bottom:2px solid rgba(0,240,255,.65);
    border-radius:0 0 3px 0;}
  .chat-resize:hover::after{border-color:var(--cyan);}
  /* nothing to resize when the box is full screen (its position is forced) or minimized */
  .chat-win.chat-full .chat-resize, .chat-win.minimized .chat-resize{display:none;}
  .chat-head{display:flex; align-items:center; gap:.6rem; padding:.7rem .8rem; border-bottom:1px solid var(--hair); cursor:move; background:rgba(0,240,255,.05); flex:0 0 auto;
    /* touch-action:none is what makes a phone drag possible: without it the browser claims the gesture
       for scrolling and the window never moves. user-select stops a mouse drag selecting the title. */
    touch-action:none; -webkit-user-select:none; user-select:none;}
  .chat-av{width:38px; height:38px; border-radius:50%; object-fit:cover; border:1px solid var(--hair); cursor:pointer;}
  /* The header avatar is a BUTTON (it opens this member's options — the diary) so a keyboard and a
     thumb can both reach it. It must add no box of its own or the header's 0.6rem gap and its
     vertical alignment change. */
  .chat-av-btn{background:none; border:0; padding:0; margin:0; display:inline-flex; align-items:center;
    border-radius:50%; cursor:pointer;}
  .chat-av-btn:hover .chat-av{border-color:var(--cyan); box-shadow:0 0 0 2px rgba(0,240,255,.28);}
  .chat-av-btn:focus-visible{outline:2px solid var(--cyan); outline-offset:2px;}
  .chat-title{display:flex; flex-direction:column; line-height:1.15; min-width:0; flex:1 1 auto;}
  /* A narrowed box must not let the name wrap and push the – × ⋯ buttons sideways; truncate instead. */
  .chat-title b, .chat-title small{white-space:nowrap; overflow:hidden; text-overflow:ellipsis; display:block; max-width:100%;}
  .chat-title small{color:var(--muted); font-size:.74rem;}
  .chat-win-btns{margin-left:auto; display:flex; gap:.3rem; position:relative;}
  .chat-ic{background:none; border:1px solid var(--hair); color:var(--text); border-radius:.5rem; width:28px; height:28px; cursor:pointer; font-size:1rem; line-height:1;}
  .chat-ic:hover{border-color:var(--cyan); color:var(--cyan);}
  .chat-menu{position:absolute; top:2.4rem; right:0; z-index:5; min-width:9rem; background:var(--panel); border:1px solid var(--hair); border-radius:.6rem; padding:.3rem; box-shadow:0 8px 24px rgba(0,0,0,.4); display:flex; flex-direction:column; gap:.15rem;}
  .chat-menu-item{display:flex; align-items:center; gap:.4rem; width:100%; text-align:left; background:none; border:none; color:var(--text); padding:.45rem .6rem; border-radius:.4rem; cursor:pointer; font-size:.82rem; line-height:1.1;}
  .chat-menu-item:hover{background:rgba(0,240,255,.12); color:var(--cyan);}
  /* A small box must keep its Send button (fix 25 Oct 2026). `.chat-input` used flex:1 with the default
     `min-width:auto`, and a text <input> has an intrinsic minimum (measured: it stopped shrinking at
     193px) — so the input refused to shrink and pushed Send outside the box, where
     `.chat-win{overflow:hidden}` clipped it. Measured: 280px box -> button inside; 250px -> 27px past the
     edge; 200px -> 77px past. The row and header must also NOT shrink, or a SHORT box pushes them out of
     the bottom: the thread gives up height (min-height:0) and the name truncates instead of wrapping. */
  .chat-thread{flex:1 1 auto; min-height:0; overflow:auto; padding:.8rem; display:flex; flex-direction:column; gap:.5rem;}
  .chat-msg{max-width:80%; padding:.5rem .7rem; border-radius:.8rem; font-size:.9rem; line-height:1.35;}
  .chat-msg.me{align-self:flex-end; background:linear-gradient(90deg,#00b4d8,#1de9b6); color:#04121a; border-bottom-right-radius:.2rem;}
  .chat-msg.them{align-self:flex-start; background:var(--hair-strong); color:var(--text); border-bottom-left-radius:.2rem;}
  .chat-msg.sys{align-self:center; background:transparent; color:var(--muted); font-size:.76rem; font-style:italic;}
  .chat-input-row{display:flex; gap:.5rem; padding:.6rem; border-top:1px solid var(--hair); flex:0 0 auto; align-items:center;}
  .chat-input{flex:1 1 auto; min-width:0; background:var(--bg); border:1px solid var(--hair); color:var(--text); border-radius:.6rem; padding:.5rem .7rem;}
  .chat-send{flex:0 0 auto; white-space:nowrap; padding:.5rem .9rem;}
  /* the duplicate .chat-input/.chat-send lines were merged into the rules above (min-width:0 makes the
     input shrinkable, flex:0 0 auto keeps the Send button its natural size) */
  /* Full-screen chat: fills the viewport (⋯ menu → Full screen, or double-click the title bar).
     !important so the class beats the inline geometry that cascade/drag write. */
  .chat-win.chat-full{ left:0 !important; top:0 !important; right:0 !important; bottom:0 !important;
    width:auto !important; height:auto !important; min-width:0 !important; min-height:0 !important;
    max-width:none !important; max-height:none !important; border-radius:0 !important;
    resize:none !important; z-index:9000 !important; animation:none;}
  .chat-win.chat-full .chat-head{cursor:default;}
  .chat-win.chat-full .chat-thread{padding:1rem 1.3rem;}
  .chat-win.chat-full .chat-msg{max-width:min(680px,80%);}
  .chat-win.minimized{height:auto;}
  .chat-win.minimized .chat-thread, .chat-win.minimized .chat-input-row{display:none;}
  .chat-dock{position:fixed; right:1.2rem; bottom:1.2rem; left:1.2rem; z-index:85; display:flex; flex-wrap:wrap; justify-content:flex-end; gap:.5rem; max-width:calc(100vw - 2.4rem);}
  .chat-dock-item{display:flex; align-items:center; gap:.5rem; background:var(--panel); border:1px solid rgba(0,240,255,.35);
    border-radius:.8rem; padding:.5rem .7rem; cursor:pointer; box-shadow:0 0 20px rgba(0,240,255,.18); max-width:180px;}
  .chat-dock-item b{white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
  .chat-dock-item img{width:32px; height:32px; border-radius:50%; object-fit:cover;}
  .chat-dock-item b{font-size:.85rem;}
  .chat-dock-item .x{margin-left:auto; color:var(--muted); cursor:pointer; border:none; background:none; font-size:1rem;}

  /* WhatsApp-style blocked chat state: window stays open, marked, input disabled */
  .chat-blocked-banner{background:var(--amber-bg, rgba(255,179,71,.15)); color:var(--amber, #ffb347);
    font-size:.78rem; padding:.5rem .7rem; border-bottom:1px solid rgba(255,179,71,.3); text-align:center;}
  .chat-win.blocked .chat-head{opacity:.85;}

  /* Blocked-users panel: a normal in-flow card so it never overlaps other content */

  .blocked-panel h2{margin:0 0 .2rem; font-size:1.15rem;}
  .blocked-empty{color:var(--muted); font-size:.85rem;}
  .blocked-row{display:flex; align-items:center; justify-content:space-between; gap:.6rem;
    padding:.55rem .7rem; border:1px solid var(--hair); border-radius:.6rem; background:rgba(255,93,143,.06); margin-top:.5rem;}
  .blocked-row .bname{display:flex; align-items:center; gap:.5rem; font-weight:600; font-size:.92rem;}
  .blocked-row .bav{width:30px; height:30px; border-radius:50%; object-fit:contain; border:1px solid var(--hair);}
  .blocked-row .bmeta{color:var(--muted); font-size:.74rem;}
  .unblock-btn{background:none; border:1px solid var(--cyan); color:var(--cyan); border-radius:.5rem;
    padding:.35rem .7rem; cursor:pointer; font-size:.82rem; white-space:nowrap;}
  .unblock-btn:hover{background:rgba(0,240,255,.12);}

  .match{position:relative;}
  .chat-dock-item .x{margin-left:auto; color:var(--muted); cursor:pointer; border:none; background:none; font-size:1rem;}

  /* WhatsApp-style blocked chat state: window stays open, marked, input disabled */
  .chat-blocked-banner{background:var(--amber-bg, rgba(255,179,71,.15)); color:var(--amber, #ffb347);
    font-size:.78rem; padding:.5rem .7rem; border-bottom:1px solid rgba(255,179,71,.3); text-align:center;}
  .chat-win.blocked .chat-head{opacity:.85;}

  /* Blocked-users panel: a normal in-flow card so it never overlaps other content */
chat-dock-item .x{margin-left:auto; color:var(--muted); cursor:pointer; border:none; background:none; font-size:1rem;}

  /* WhatsApp-style blocked chat state: window stays open, marked, input disabled */
  .chat-blocked-banner{background:var(--amber-bg, rgba(255,179,71,.15)); color:var(--amber, #ffb347);
    font-size:.78rem; padding:.5rem .7rem; border-bottom:1px solid rgba(255,179,71,.3); text-align:center;}
  .chat-win.blocked .chat-head{opacity:.85;}

  /* Blocked-users panel: a normal in-flow card so it never overlaps other content */

  .bio-inner.blurred{filter:blur(6px); pointer-events:none; user-select:none;}
  .bio-gate{display:none; text-align:center; padding:1.4rem 0;}
  .bio-gate.show{display:block;}
  .bio-login-note{color:var(--muted); font-size:.85rem; margin-top:.6rem;}
  .bio-head{display:flex; align-items:center; justify-content:space-between; gap:1rem;}
  .bio-sub{color:var(--muted); font-size:.88rem; margin:.2rem 0 1rem;}
  .bio-composer textarea{width:100%; min-height:84px; resize:vertical; padding:.7rem .8rem; border-radius:.5rem;
    border:1px solid var(--hair-strong); background:var(--field); color:var(--text); font-family:var(--font); font-size:.92rem;}
  .bio-composer textarea:focus{outline:none; border-color:var(--cyan); box-shadow:0 0 0 2px rgba(0,240,255,.22);}
  .bio-actions{display:flex; align-items:center; gap:.7rem; margin-top:.6rem; flex-wrap:wrap;}
  .bio-upload{display:inline-flex; align-items:center; gap:.4rem; cursor:pointer; color:var(--cyan); font-size:.85rem;
    border:1px solid rgba(0,240,255,.35); padding:.4rem .7rem; border-radius:.5rem;}
  .bio-upload input{display:none;}
  /* Image button with the media disclaimer directly UNDER it, small gap. */
  .bio-upload-block{display:flex; flex-direction:column; align-items:flex-start; gap:.35rem;}
  .bio-consent{display:inline-flex; align-items:center; gap:.45rem; font-size:.78rem; color:var(--muted); cursor:pointer; max-width:420px;}
  .bio-consent input{flex:0 0 auto; margin:0;}
  .bio-rules{font-size:.72rem; color:var(--muted); margin:.4rem 0 0; line-height:1.4; max-width:520px;}
  /* The toast sits ABOVE the fixed bottom navigation bar (both widths since 27 Oct 2026). At
     bottom:1.4rem it landed inside the bar's 63px strip, so the game-invite refusal ("Only members
     with an account can be invited.") was printed on top of the tab labels and could not be read
     (AC, 27 Oct 2026). Same 66px constant as the page padding and the sheet insets, so the three
     move together if the bar's height ever changes. */
  #toast{position:fixed; left:50%; bottom:calc(66px + env(safe-area-inset-bottom, 0px) + .9rem); transform:translateX(-50%) translateY(1rem); background:var(--surface); color:var(--text); border:1px solid var(--hair); padding:.7rem 1.1rem; border-radius:.7rem; box-shadow:0 10px 30px rgba(0,0,0,.45); opacity:0; transition:opacity .25s, transform .25s; z-index:200; max-width:90vw; font-size:.85rem;}
  #toast.show{opacity:1; transform:translateX(-50%) translateY(0);}
  .pf-blocked{margin-top:1rem; border-top:1px solid var(--hair); padding-top:.8rem;}
  .pf-blocked h3{font-size:.9rem; margin:0 0 .5rem; color:var(--muted);}
  .post-actions .report{background:none; border:1px solid var(--hair); color:#ff8aa0; border-radius:.5rem; padding:.25rem .6rem; margin-left:.5rem; cursor:pointer; font-size:.78rem;}
  .post-actions .report:hover{border-color:#ff8aa0;}
  .bio-fname{color:var(--muted); font-size:.78rem; flex:1; min-width:80px;}
  .bio-feed{margin-top:1.2rem; display:flex; flex-direction:column; gap:.9rem;}
  .post{border:1px solid var(--hair); border-radius:.7rem; padding:.9rem 1rem; background:var(--panel);}
  .post .meta{display:flex; justify-content:space-between; align-items:center; color:var(--muted); font-size:.76rem; margin-bottom:.5rem;}
  .post .meta .ts{color:var(--warm-soft);}
  .post .body{font-size:.94rem; white-space:pre-wrap; word-break:break-word;}
  .post .media{margin-top:.6rem; max-width:100%; border-radius:.5rem; display:block;}
  .post .media.video{max-height:320px;}
  .reactions{margin-top:.55rem;}
  .help-btn{background:none; border:1px solid var(--hair-strong); color:var(--muted); border-radius:.6rem; padding:.28rem .7rem; cursor:pointer; font-size:.82rem; font-family:var(--font); transition:border-color .15s, color .15s;}
  .help-btn:hover{border-color:var(--pink,#ff2e97); color:var(--text);}
  .help-btn.on{border-color:var(--pink,#ff2e97); color:var(--pink,#ff2e97);}
  .help-btn span{font-variant-numeric:tabular-nums;}
  .bio-gear{display:inline-flex; align-items:center; justify-content:center; width:34px; height:34px; padding:0; background:none; border:1px solid var(--hair-strong); border-radius:.55rem; color:var(--muted); cursor:pointer; transition:border-color .15s, color .15s;}
  .bio-gear:hover{color:var(--text); border-color:var(--cyan);}
  .bio-gear svg{display:block;}
  .feed-sort{display:flex; gap:.4rem; margin:1.1rem 0 .2rem;}
  .sort-btn{background:none; border:1px solid var(--hair-strong); color:var(--muted); border-radius:.6rem; padding:.25rem .8rem; cursor:pointer; font-size:.8rem; font-family:var(--font);}
  .sort-btn:hover{color:var(--text); border-color:var(--cyan);}
  .sort-btn.on{color:var(--cyan); border-color:var(--cyan);}

  .replies{margin-top:.7rem; border-top:1px solid var(--hair); padding-top:.6rem; display:flex; flex-direction:column; gap:.6rem;}
  .replies-title{font-size:.78rem; color:var(--muted); letter-spacing:.05em; text-transform:uppercase;}
  .reply{background:var(--field); border-radius:.5rem; padding:.6rem .7rem;}
  .reply .meta{display:flex; justify-content:space-between; font-size:.74rem; color:var(--muted); margin-bottom:.25rem;}
  .reply .meta .ts{color:var(--warm-soft);}
  .reply .body{font-size:.88rem; white-space:pre-wrap; word-break:break-word;}
  .reply-box{margin-top:.7rem; display:flex; flex-direction:column; gap:.4rem;}
  .reply-input{width:100%; min-height:46px; resize:vertical; padding:.5rem .6rem; border-radius:.5rem; border:1px solid var(--hair-strong); background:var(--field); color:var(--text); font-family:var(--font); font-size:.86rem;}
  .reply-actions{display:flex; gap:.5rem; align-items:center;}
  .reply-as{background:var(--field); color:var(--text); border:1px solid var(--hair-strong); border-radius:.5rem; padding:.35rem .5rem; font-family:var(--font); font-size:.82rem;}
  .del-reply{background:none; border:none; color:var(--muted); cursor:pointer; font-size:.74rem; text-decoration:underline;}
  .post .del{background:none; border:none; color:var(--muted); cursor:pointer; font-size:.78rem; text-decoration:underline;}
  /* Game */
  .topright-extra{display:flex; justify-content:flex-start; gap:.5rem; margin-bottom:.2rem;}
  /* Friends / Games / RADAR share this so all three render the SAME size.
     box-sizing is border-box, so min-width is the full button width. */
  .games-btn{font-weight:700; letter-spacing:.1em; font-size:.78rem; padding:.4rem .8rem; opacity:.85;
             display:inline-block; min-width:5.4rem; text-align:center;}
  .games-btn:hover{opacity:1;}
  .game-solo{margin-top:.4rem;}
  .game-info{font-size:.85rem; color:var(--muted); margin-bottom:.7rem;}
  .gm-grid{display:grid; grid-template-columns:repeat(4,1fr); gap:.5rem; max-width:340px;}
  .gm-cell{aspect-ratio:1; border-radius:.5rem; border:1px solid var(--hair); background:var(--field);
    display:flex; align-items:center; justify-content:center; font-size:1.4rem; cursor:pointer; color:var(--cyan); user-select:none;
    transition:transform .12s, background .12s;}
  .gm-cell.flip{background:rgba(0,240,255,.12); border-color:var(--cyan); transform:scale(1.04);}
  .gm-cell.done{visibility:hidden;}

  /* ===== Group-chat picker ===== */
  .group-picker{width:min(420px,94vw); max-height:90vh; overflow:auto;}
  .group-picker h2{margin:0 0 .3rem;}
  .gp-hint{margin:0 0 .6rem; color:var(--muted); font-size:.9rem;}
  .gp-hint b{color:var(--cyan);}
  .gp-list{display:flex; flex-direction:column; gap:.3rem; max-height:46vh; overflow:auto; margin-bottom:.5rem;}
  .gp-row{display:flex; align-items:center; gap:.6rem; padding:.4rem .5rem; border-radius:.5rem; cursor:pointer; border:1px solid transparent;}
  .gp-row:hover{background:rgba(0,240,255,.08);}
  .gp-row.sel{background:rgba(0,240,255,.14); border-color:var(--cyan);}
  .gp-row img{width:34px; height:34px; border-radius:50%;}
  .gp-row .gpn{flex:1;}
  .gp-row .gpn small{color:var(--muted);}
  .gp-row .gpcheck{width:18px; height:18px; border-radius:4px; border:2px solid var(--muted); display:flex; align-items:center; justify-content:center; font-size:.8rem; color:var(--cyan);}
  .gp-row.sel .gpcheck{border-color:var(--cyan);}
  .gp-row.gp-fixed{opacity:.5; cursor:default; background:rgba(0,240,255,.06); pointer-events:none;}
  .gp-count{font-size:.82rem; color:var(--muted); margin:0 0 .5rem;}
  .gp-actions{display:flex; gap:.5rem; align-items:center;}
  .gp-name{flex:1;}

  /* ===== Group chat header (member avatars) ===== */
  .chat-head .gp-avs{display:flex; align-items:center;}
  /* Group windows: the header name gets the space instead of the avatar strip. Measured at the default
     360px window, "My groupchat: RMFANS" needs 181px but the strip (116px) + buttons (94px) left 104px,
     so the name always truncated to "My groupc…" and the initials never appeared (AC, 25 Oct 2026).
     The .gp-members row directly under the header still shows every member's avatar. */
  .chat-win.chat-group .chat-head .gp-avs{display:none;}
  .chat-head .gp-avs img{width:26px; height:26px; border-radius:50%; margin-left:-8px; border:2px solid var(--panel);}
  .chat-head .gp-avs img:first-child{margin-left:0;}

  /* ---- Slash-commands window + voice recorder (reuse .chat-win/.chat-head for drag) ---- */
  .cmds-win, .voice-win{width:min(340px,92vw); height:auto; max-height:min(460px,80vh);}
  /* Commands header: the title takes the free space so the × sits at the RIGHT edge instead of
     hugging the word "Commands" (AC, 25 Oct 2026). Chat windows get this from .chat-title's
     flex:1; the Commands header uses a plain <b>, so it needs the same rule scoped to itself. */
  .cmds-win .chat-head b{flex:1 1 auto;}
  .cmds-body, .voice-body{padding:.8rem .9rem; display:flex; flex-direction:column; gap:.55rem;}
  .cmds-sub{color:var(--muted); font-size:.8rem; margin:0;}
  .cmds-hint, .voice-hint{color:var(--muted); font-size:.74rem; margin:0;}
  .cmds-list{display:flex; flex-direction:column; gap:.35rem; overflow:auto;}
  .cmd-row{display:flex; align-items:baseline; gap:.55rem; text-align:left; background:var(--field);
    border:1px solid var(--hair-strong); border-radius:.55rem; padding:.45rem .6rem; cursor:pointer; font-family:var(--font);}
  .cmd-row:hover{border-color:var(--cyan);}
  .cmd-row code{color:var(--cyan); font-size:.82rem; white-space:nowrap;}
  .cmd-row span{color:var(--muted); font-size:.76rem;}
  .voice-status{font-size:.86rem; color:var(--text);}
  .voice-btns{display:flex; gap:.4rem; flex-wrap:wrap;}
  .voice-file{display:flex; flex-direction:column; gap:.3rem; font-size:.78rem; color:var(--muted);}
  .voice-file input{font-size:.76rem; color:var(--text);}
  .chat-msg img.chat-media{max-width:100%; border-radius:.5rem; display:block; margin-top:.3rem;}
  .chat-msg audio{max-width:100%; margin-top:.3rem;}
  .chat-title .gp-meta{color:var(--muted); font-weight:400; font-size:.75rem;}
/* Saved-group notice: the leader kept the room and this member has to answer. */
.gp-save-notice{display:flex; align-items:center; gap:.5rem; flex-wrap:wrap;
  background:rgba(34,211,238,.12); border-bottom:1px solid rgba(34,211,238,.35);
  color:var(--text); font-size:.78rem; padding:.5rem .7rem;}
.gp-save-notice span{flex:1 1 auto; min-width:140px;}
.gp-save-notice .btn{font-size:.72rem; padding:.25rem .6rem; border-radius:6px;
  border:1px solid var(--line); background:transparent; color:var(--text); cursor:pointer;}
.gp-save-notice .btn.btn-primary{background:var(--cyan); color:#08131f; border-color:var(--cyan); font-weight:600;}

  /* ===== Member action menu (click a group member) ===== */
  .member-action-menu{position:fixed; z-index:9000; min-width:190px;
    background:var(--panel, #141b22); border:1px solid var(--line);
    border-radius:10px; padding:.25rem; display:flex; flex-direction:column;
    box-shadow:0 12px 30px rgba(0,0,0,.45);}
  .member-action-menu .member-action{display:flex; align-items:center; gap:.5rem;
    width:100%; text-align:left; background:transparent; border:0; cursor:pointer;
    color:var(--text); font-size:.82rem; padding:.5rem .6rem; border-radius:7px;}
  .member-action-menu .member-action:hover{background:rgba(255,255,255,.07);}

/* ---- games: the request card, the chooser, and the board window ---- */
.game-invite{margin:.45rem .15rem; padding:.55rem .7rem; border:1px solid rgba(0,240,255,.35);
  border-radius:.7rem; background:rgba(0,240,255,.06);}
.game-invite.outgoing{opacity:.85; border-style:dashed;}
.game-invite .gi-line{font-size:.82rem; line-height:1.45;}
.game-invite .gi-btns{display:flex; gap:.45rem; margin-top:.5rem;}
.game-invite .gi-ok{color:var(--cyan); font-size:.8rem;}
.game-invite .gi-no{color:var(--muted); font-size:.8rem;}
.game-pick-menu{position:fixed; z-index:9001; min-width:200px; background:var(--panel, #141b22);
  border:1px solid var(--line); border-radius:10px; padding:.25rem; display:flex; flex-direction:column;
  box-shadow:0 12px 30px rgba(0,0,0,.45);}
.game-pick-menu .gp-head{padding:.3rem .6rem .35rem; font-size:.7rem; color:var(--muted);
  text-transform:uppercase; letter-spacing:.05em;}
.game-win{width:min(760px,92vw); height:min(680px,78vh); z-index:95;}
.game-win .game-frame{flex:1 1 auto; width:100%; min-height:0; border:0; background:#070b16;}
  .gp-member{cursor:pointer;}
  .gp-member:hover{background:rgba(255,255,255,.05); border-radius:6px;}
  /* Your own row opens nothing — don't advertise a click. */
  .gp-member.gp-you{cursor:default;}
  .gp-member.gp-you:hover{background:transparent;}

  /* ===== Group member list ===== */
    .gp-members{max-height:140px; overflow:auto; border-bottom:1px solid var(--line); padding:.3rem .5rem; background:rgba(0,0,0,.12);}
    .gp-member{display:flex; align-items:center; gap:.5rem; padding:.25rem .2rem; border-radius:.4rem;}
    .gp-member img{width:24px; height:24px; border-radius:50%; border:1px solid var(--line);}
    .gp-member .gpm-name{flex:1; font-size:.85rem;}
    .gp-member-sys{font-size:.78rem; color:var(--muted); padding:.2rem 0;}

/* ===== Site action buttons (bottom-left) =====
   One horizontal row: About me · Contact · Donate · Games · Flu Radar.
   `right` is set so the row has a bounded width and wraps instead of running
   off the screen on narrow viewports. */
.site-actions{position:fixed; left:1.2rem; right:1.2rem; bottom:1.2rem; display:flex; flex-direction:row;
  flex-wrap:wrap; align-items:center; gap:.5rem; z-index:80;}
.site-btn{font:inherit; font-size:.9rem; color:var(--text); background:var(--panel); border:1px solid var(--hair-strong);
  border-radius:.7rem; padding:.55rem .9rem; cursor:pointer; backdrop-filter:blur(8px); box-shadow:var(--shadow);
  transition:transform .15s, border-color .15s, background .15s; text-align:center;
  display:inline-flex; align-items:center; justify-content:center; text-decoration:none; white-space:nowrap;}
.site-btn:hover{transform:translateY(-2px); border-color:var(--cyan); background:var(--panel-solid);}
.site-btn.icon-btn{display:inline-flex; align-items:center; justify-content:center; padding:.5rem .6rem;}
.site-btn.icon-btn svg{display:block;}
.options-pop .opt-sub{color:var(--muted); font-size:.88rem; margin:.2rem 0 1rem;}
.options-pop .opt-section{margin-bottom:.6rem;}
.options-pop .opt-section h3{font-size:.76rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:0 0 .3rem;}
.options-pop .opt-row{display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.6rem 0; border-top:1px solid var(--hair);}
.options-pop .opt-row label{font-size:.92rem;}
.options-pop select{background:var(--field); color:var(--text); border:1px solid var(--hair-strong); border-radius:.5rem; padding:.3rem .5rem; font-family:var(--font); font-size:.85rem;}
.options-pop input[type=checkbox]{width:18px; height:18px; accent-color:var(--cyan);}
.options-pop .opt-hint{color:var(--muted); font-size:.78rem; margin:.5rem 0 0;}
.options-pop .opt-needlogin{color:var(--warm-soft); font-size:.85rem; margin-top:.7rem;}
.options-pop .opt-saved{color:var(--cyan); font-size:.82rem; margin-top:.5rem;}
.options-pop .opt-confirm-actions{display:flex; gap:.5rem; justify-content:flex-end; margin-top:.7rem; flex-wrap:wrap;}
.options-pop .opt-danger{background:rgba(255,138,138,.14); border-color:rgba(255,138,138,.5); color:#ff8a8a;}
.options-pop .opt-danger:hover{border-color:#ff8a8a;}
/* Narrow screens: shrink the row so all three still sit on ONE line.
   Below ~380px three labelled buttons cannot fit at a legible size, so the
   row wraps at that point rather than overflowing or hiding a button. */
@media (max-width:620px){
  .site-actions{left:.7rem; right:.7rem; bottom:.7rem; gap:.35rem;}
  .site-btn{font-size:.72rem; padding:.42rem .55rem; border-radius:.55rem;}
}

/* About me page — AC's own text, hard-coded in the markup on purpose: an i18n entry would be
   overwritten at runtime and silently revert (see the i18n pitfall). The old hero/avatar/facts
   rules are gone with those elements; av_00.svg stays because the hero still uses it. */
.about-page{width:min(560px,94vw);}
.about-body p{margin:0 0 .9rem; font-size:1.02rem; line-height:1.55;}
.about-body p:last-child{margin-bottom:0;}
.about-sign{color:var(--muted);}

/* Contact popup */
.contact-pop{width:min(440px,94vw);}
.field-label{display:block; font-size:.85rem; color:var(--muted); margin:.6rem 0 .25rem;}
.field{width:100%; font:inherit; color:var(--text); background:var(--field); border:1px solid var(--hair-strong);
  border-radius:.6rem; padding:.6rem .7rem; resize:vertical;}
.field:focus{outline:none; border-color:var(--cyan);}
.contact-pop .btn{margin-top:1rem; width:100%;}
.contact-note{margin:.8rem 0 0; color:var(--green); font-size:.9rem;}

/* ===== Medicines (profile list, public info panel, member list) ===== */
.med-add{display:flex; gap:.5rem; align-items:center; margin:.35rem 0 .5rem;}
.med-add input{flex:1; min-width:0; background:var(--field); border:1px solid var(--hair-strong); border-radius:.5rem;
  color:var(--text); font-family:var(--font); font-size:.9rem; padding:.5rem .7rem; outline:none;}
.med-add input:focus{border-color:var(--cyan);}
.med-suggest{margin:-.2rem 0 .5rem; border:1px solid var(--hair-strong); border-radius:.5rem;
  background:var(--panel-solid); overflow:hidden; z-index:5;}
.med-sug-row{display:flex; flex-direction:column; gap:.1rem; padding:.45rem .6rem; cursor:pointer; border-bottom:1px solid var(--hair);}
.med-sug-row:last-child{border-bottom:none;}
.med-sug-row:hover{background:var(--chip);}
.med-sug-row b{font-size:.88rem;}
.med-sug-row small{color:var(--muted); font-size:.74rem;}
.med-chips{display:flex; flex-wrap:wrap; gap:.4rem; align-items:center;}
.med-chip{display:inline-flex; align-items:center; gap:.3rem; border:1px solid var(--hair-strong); border-radius:999px;
  padding:.28rem .5rem .28rem .7rem; font-size:.84rem; background:rgba(255,255,255,.03);}
.med-chip.on{border-color:var(--cyan); background:var(--chip);}
.med-chip .mn{cursor:pointer;}
.med-chip.on .mn{color:var(--cyan); font-weight:600;}
.med-chip .eye, .med-chip .x{background:transparent; border:none; color:var(--muted); cursor:pointer; font-size:.85rem; line-height:1; padding:0 .1rem;}
.med-chip .eye:hover, .med-chip .x:hover{color:var(--cyan);}
.med-note{color:var(--muted); font-size:.78rem; margin:.5rem 0 0; line-height:1.35;}
.med-pub{background:var(--chip); border:1px solid var(--cyan); color:var(--cyan); border-radius:999px;
  padding:.25rem .6rem; font:inherit; font-size:.8rem; cursor:pointer;}
.med-pub:hover{background:var(--panel-solid);}
.med-pop{width:min(560px,94vw);}
.med-pop h3{margin:1rem 0 .5rem; font-size:.95rem; color:var(--muted);}
/* AC removed the "You take this" label from a medicine of your own, so the heading is empty there: without
   this an empty h3 still reserved 1rem + .5rem above the member list and the modal looked padded out. */
.med-pop h3:empty{margin:0;}
.med-cls{margin:.1rem 0 .6rem; color:var(--cyan); font-weight:600; font-size:.9rem;}
.med-use{margin:0 0 .5rem; font-size:.95rem;}
.med-src{margin:0 0 .4rem; color:var(--muted); font-size:.74rem; line-height:1.35;}
.med-members{display:flex; flex-direction:column; gap:.4rem;}
.med-member{display:flex; align-items:center; gap:.6rem; padding:.45rem .5rem; border:1px solid var(--hair); border-radius:.6rem;}
.med-member .mmav{width:34px; height:34px; border-radius:50%; object-fit:cover; flex:none;}
.med-member .mmwho{display:flex; flex-direction:column; min-width:0; flex:1;}
.med-member .mmwho small{color:var(--muted); font-size:.75rem;}
.med-member .mmact{display:flex; gap:.4rem; flex:none;}
.med-member .mmact .btn{padding:.35rem .7rem; font-size:.8rem;}
.med-more{align-self:flex-start; margin-top:.2rem;}
/* Invite composer — only rendered at the moment an invite is sent, then removed. */
.inv-compose{display:flex; flex-wrap:wrap; gap:.4rem; align-items:center; margin:.35rem 0 .55rem;
  padding:.5rem .6rem; border:1px solid var(--cyan); border-radius:.6rem; background:var(--chip);}
.inv-compose input{flex:1; min-width:180px; background:var(--field); border:1px solid var(--hair-strong);
  border-radius:.5rem; color:var(--text); font-family:var(--font); font-size:.86rem; padding:.45rem .6rem; outline:none;}
.inv-compose input:focus{border-color:var(--cyan);}
.inv-compose .btn{padding:.4rem .8rem; font-size:.82rem;}
.inv-note{margin:.25rem 0 0; padding:.35rem .6rem; border-left:2px solid var(--cyan); color:var(--text);
  font-size:.84rem; font-style:italic; background:rgba(0,240,255,.06); border-radius:.35rem;}

/* Centred invite sheet — used for the SENDER's message box and the RECIPIENT's invite prompt.
   Reuses .modal-overlay/.modal (the app's one popup pattern, which is already centred on any screen),
   so on a phone the message is fully visible instead of squeezed into a corner column: the old inline
   composer had a 180px-min-width input inside a ~115px column — "only sees half of the message"
   (AC, 31 Oct 2026). z-index above the chat windows, the dock and the mobile tab bar. */
.invite-sheet{z-index:9500;}
.invite-sheet .modal{width:min(420px,92vw); text-align:left;}
.invite-sheet h2{margin:.1rem 0 .6rem; font-size:1.15rem;}
.invite-sheet .inv-lead{margin:0 0 .2rem; color:var(--text); font-size:.9rem; line-height:1.5;}
.invite-sheet .inv-note{margin:.7rem 0 0;}
.invite-sheet input{width:100%; margin-top:.7rem; background:var(--field); border:1px solid var(--hair-strong);
  border-radius:.5rem; color:var(--text); font-family:var(--font); font-size:.92rem; padding:.55rem .7rem; outline:none;}
.invite-sheet input:focus{border-color:var(--cyan);}
/* ===== End-to-end keys row + recovery-code sheet (Phase 1b→v2, docs/E2E_SCOPE.md) ============== */
.e2e-line{ display:flex; align-items:center; gap:.5rem; flex-wrap:wrap; }
#e2eFingerprint{ font-family:var(--mono,monospace); letter-spacing:.06em; }
.e2e-sheet .modal{ width:min(460px,92vw); text-align:left; }
/* The recovery code is the one string in this app a member is asked to WRITE DOWN, so it gets the most
   legible treatment in the sheet: monospace, letter-spaced, selectable as a unit, and it WRAPS rather
   than scrolling sideways — a code whose end you cannot see is a code you cannot copy by hand. */
.e2e-sheet .e2e-code{ margin:.7rem 0 .5rem; padding:.7rem .75rem; background:var(--field);
  border:1px dashed var(--hair-strong); border-radius:.5rem; color:var(--text);
  font-family:var(--mono,monospace); font-size:.98rem; letter-spacing:.08em; line-height:1.5;
  word-break:break-word; user-select:all; -webkit-user-select:all; }
.e2e-sheet .e2e-copy{ margin:0 0 .6rem; }
.e2e-sheet .e2e-code-in{ width:100%; margin-top:.55rem; background:var(--field);
  border:1px solid var(--hair-strong); border-radius:.5rem; color:var(--text);
  font-family:var(--mono,monospace); font-size:.95rem; letter-spacing:.06em;
  padding:.55rem .7rem; outline:none; text-transform:uppercase; }
.e2e-sheet .e2e-code-in:focus{ border-color:var(--cyan); }
/* ===== End-to-end message states in a thread (Phase 1c, docs/E2E_SCOPE.md §6b) =================
   Two things have to be visible inside the bubble itself, because both are about what actually
   happened to THAT message:
     .e2e-locked — this device cannot open it (no key here, own message reopened elsewhere, wrong key).
                   Styled as information, not as an error: nothing is broken and nothing is lost, the
                   words simply are not readable here. Never blank: a blank bubble reads as data loss.
     .chat-note  — the message went out UNENCRYPTED and says so. Deliberately quiet (small, muted,
                   separated by a hairline) so it informs without shaming, but it is never hidden. */
.chat-msg.e2e-locked{ background:transparent; border:1px dashed var(--hair-strong); color:var(--muted); }
.chat-msg.e2e-locked .e2e-body{ font-style:italic; }
.chat-msg .chat-note{ margin-top:.35rem; padding-top:.3rem; border-top:1px solid var(--hair);
  font-size:.72rem; line-height:1.35; opacity:.75; font-style:normal; }

.invite-sheet .inv-actions{display:flex; gap:.5rem; justify-content:flex-end; flex-wrap:wrap; margin-top:1.1rem;}
.invite-sheet.inv-received .modal{border-color:rgba(255,46,151,.45); box-shadow:0 0 50px rgba(255,46,151,.22);}
/* The RECEIVED invite FLOATS and DRAGS (AC, 31 Oct 2026: "make it draggable and not interfere with
   user current activity/screen what its doing"). Deliberately NOT .modal-overlay: that class lays a
   full-screen dimmed backdrop over whatever the member was doing. This is a small panel on top of the
   page — the page underneath stays tappable — and its header drags it out of the way. */
.invite-sheet.invite-float{position:fixed; left:50%; top:34%; transform:translate(-50%,-50%); width:min(420px,92vw);}
.invite-sheet.invite-float .modal{width:100%; cursor:default;}
.inv-drag{display:flex; align-items:center; gap:.55rem; margin:0 0 .55rem; cursor:grab;
  touch-action:none; user-select:none; -webkit-user-select:none;}
.inv-drag:active{cursor:grabbing;}
.inv-drag h2{margin:0; font-size:1.05rem;}
.inv-grip{flex:0 0 auto; width:26px; height:4px; border-radius:2px; background:var(--hair-strong);}
/* His layout, exactly: Accept first, then Decline — same size, same style — and "I'll think about it"
   on its own row beneath them. */
.invite-sheet.inv-received .inv-actions{display:grid; grid-template-columns:1fr 1fr; gap:.5rem;
  justify-content:stretch; margin-top:1.05rem;}
.invite-sheet.inv-received .inv-actions .btn{width:100%; padding:.7rem .6rem;}
.invite-sheet.inv-received .inv-think{display:block; width:100%; margin-top:.5rem; padding:.6rem .8rem;
  font-size:.85rem; color:var(--muted);}

/* Donate popup */
.donate-pop{width:min(440px,94vw); text-align:center;}
.donate-sub{color:var(--muted); margin:0 0 1.2rem;}
.donate-options{display:grid; gap:.7rem; margin-bottom:1rem;}
.donate-link{display:block; font:inherit; font-weight:600; text-decoration:none; color:var(--text);
  background:var(--field); border:1px solid var(--hair-strong); border-radius:.7rem; padding:.9rem 1rem;
  transition:transform .15s, border-color .15s, background .15s;}
.donate-link:hover{transform:translateY(-2px); border-color:var(--warm); background:var(--panel-solid);}
.donate-note{color:var(--muted); font-size:.82rem; margin:.2rem 0 0;}
/* ---- Phone: show one whole match card, arrows hidden (swipe to scroll) ---- */
@media (max-width:640px){
  .carousel{gap:0; padding:.5rem .6rem;}
  .car-arrow{display:none;}
  .match-strip{gap:.6rem; padding:.6rem .5rem;}
  .match-strip .match{flex:0 0 min(72vw, 280px);}
  .match-strip .match .mav{width:64px; height:64px; margin-right:.8rem;}
  .match-strip .match .who b{font-size:1rem;}
  .match-strip .match .pct{font-size:1.5rem;}
  .match-strip .match .card-bio{font-size:.85rem;}
}

/* ===== Friends: a FLOATING WINDOW, not a modal =====
   Reuses .chat-win / .chat-head so it inherits the chat boxes' look AND their
   global drag handler (initChatDrag is delegated on .chat-head), and so the
   page behind stays fully clickable. */
.friends-win{width:min(400px,92vw); height:min(560px,80vh);}

/* ===== CHATS WINDOW (AC, 28 Oct 2026) =====
   "the chats menu box also need to be draggable and the same style as friendlist box … a 'pending
   invites' list on the right side". It is a real .chat-win now, so the drag, the resize grip and the
   front-stacking all come from the existing machinery — nothing bespoke. Two classes in the selector on
   purpose: `.chat-win.chats-win` must beat the ≤640px `.chat-win` sizing rule, which sets right/bottom
   for phone chat boxes. */
.chat-win.chats-win{width:min(560px,94vw); height:min(440px,70vh);
  right:1rem; bottom:calc(66px + env(safe-area-inset-bottom, 0px) + .7rem);}
.chats-win .chat-head .chat-ic{margin-left:auto;}
.chats-body{padding:.7rem .8rem .8rem; gap:.5rem;}
/* Column split. 28 Oct 2026: "De breedte of the box should decrease 25% while open chats box make up for
   it" — the invites column was 44%, then 33%. Superseded 31 Oct 2026 by AC looking at the seeded demo:
   "make the breedte van open chats en pending chats invites even groot" — the two columns are equal now,
   on the web AND on a phone, and the widths are kept in step through the one `--chats-split` value so a
   later tweak cannot make them drift apart again. */
.chats-cols{display:grid; grid-template-columns:var(--chats-split,1fr 1fr); gap:.55rem;
  flex:1; min-height:0; min-width:0;}
.chats-col{display:flex; flex-direction:column; min-width:0; min-height:0; overflow:auto;
  background:rgba(255,255,255,.02); border:1px solid var(--hair); border-radius:.7rem; padding:.5rem .55rem;}
/* the pending-invites column is the one that must be findable at a glance */
.chats-inv-col{background:rgba(255,46,151,.06); border-color:rgba(255,46,151,.35);}
.chats-col .invites-head{margin:0 0 .35rem;}
/* OPEN CHATS is a mark, so it carries the app's cyan (--cyan #00d6e6), the same colour as the condition
   chips and the avatar rings. "Pending chat invites" keeps --magenta from the shared .invites-head rule. */
.chats-col .chats-open-head{color:var(--cyan);}
.chats-col .me-list{gap:.25rem;}
.chats-col .chats-row-open{padding:.45rem .2rem;}
/* Search over the open chats: the Friends panel's field, sized for this narrower column (the column is
   ~166px on a phone) and never allowed to shrink the rows below it. */
.chats-search{width:100%; box-sizing:border-box; margin:0 0 .4rem; padding:.4rem .55rem; border-radius:.5rem;
  border:1px solid var(--hair-strong); background:var(--field); color:var(--text); font:inherit; font-size:.82rem;}
.chats-search:focus{outline:none; border-color:var(--cyan);}
@media (max-width:640px){
  .chat-win.chats-win{width:min(94vw,430px); height:min(430px,64vh);}
  /* SIDE BY SIDE on a phone too — open chats LEFT, Pending invites RIGHT, same as the web version
     (AC, 31 Oct 2026: "it should be left open chats and right box pending chat invites, same as
     webversion"). An earlier build stacked them with the invites on top. Two EQUAL columns (31 Oct 2026):
     MEASURED 166px each with the sheet at min(94vw,430px) on a 390px screen, and the invite buttons
     (Accept / Decline) sit in a 2-column grid inside that width without clipping. The invite column's
     padding matches the chats column here too, or the two blocks LOOK unequal by 2px even though the
     grid says otherwise (measured 150 vs 152 before this line was added). */
  .chats-cols{grid-template-columns:var(--chats-split,1fr 1fr); gap:.4rem;}
  .chats-col{padding:.45rem .45rem;}
  .chats-inv-col{padding:.45rem .45rem;}
  /* the same block shape on a phone, with the two answers still EQUAL width (measured, not eyeballed:
     grid 1fr 1fr) and a little less padding so both words still fit the narrow column */
  .chats-invite-acts{ gap:.3rem; margin-top:.4rem; }
  .chats-invite-acts .btn{ padding:.34rem .3rem; font-size:.72rem; }
  /* Friends LEFT, pending invites RIGHT — on a phone too (AC, 31 Oct 2026: "I want the Friends menu left
     and right side pending chat invites, maybe make the pending chat invite box larger so all the text
     can be structured more neatly"). The invite column takes the LARGER share here (46%, against the chat
     menu's 40%) because in this panel the name, the sentence and any message all have to read in full,
     and the window widens with it. Nothing waiting = one plain column, exactly as before. */
  .friends-win.with-invites{width:min(680px,96vw);}
  .friends-win.with-invites .friends-cols{grid-template-columns:1fr minmax(150px,46%); gap:.45rem;}
  .friends-side{order:0; max-height:none;}
}
/* The friends panel's × sits directly in .chat-head (no .chat-win-btns wrapper like
   chat windows have), so it needs its own push to the right edge. */
/* Saved diaries: same chrome as the friends box (29 Oct 2026). Placed to the LEFT of where the chats menu
   opens (that one is bottom-right) so opening both does not stack one exactly on top of the other. */
.chat-win.diary-win{width:min(420px,94vw); height:min(400px,66vh);
  left:1rem; bottom:calc(66px + env(safe-area-inset-bottom, 0px) + .7rem);}
.diary-win .chat-head .chat-ic{margin-left:auto;}
.diary-win .friends-body{padding:.7rem .8rem .8rem;}
@media (max-width:640px){
  .chat-win.diary-win{width:min(94vw,420px); height:min(400px,62vh);}
}
.friends-win .chat-head .friends-close{margin-left:auto;}
.friends-win .chat-head b{font-size:.95rem;}
.friends-body{display:flex; flex-direction:column; gap:.6rem; padding:.8rem; flex:1; min-height:0; overflow:hidden;}
/* Friends on the LEFT, pending invites on the RIGHT (AC, 31 Oct 2026). The single-column default keeps
   the panel exactly as it was when nothing is waiting; the side column only exists when there is
   something to answer, and then the WINDOW WIDENS so the invite text has room to lay out neatly
   instead of wrapping into a strip you have to decipher. */
.friends-cols{display:grid; grid-template-columns:1fr; gap:.6rem; flex:1; min-height:0; min-width:0;}
.friends-col{display:flex; flex-direction:column; gap:.5rem; min-height:0; min-width:0;}
.friends-side{display:flex; flex-direction:column; gap:.55rem; min-height:0; overflow:auto; padding-right:.1rem;}
/* DESKTOP ONLY: the widened window and the real right-hand column. Scoped with a min-width query so it
   cannot out-specify the phone's single-column rule below (found by measurement: the two-column rule
   won on a 390px screen because a `.friends-win.with-invites` selector beats a bare `.friends-cols`). */
@media (min-width:641px){
  /* The invite box is the LARGER half here on purpose (AC, 31 Oct 2026: "make the pending chat invite box
     larger so all the text can be structured more neatly") — the window widens with it rather than
     squeezing the friends list. */
  .friends-win.with-invites{width:min(680px,94vw);}
  .friends-win.with-invites .friends-cols{grid-template-columns:1fr minmax(260px,46%);}
}
/* A pending invite in this panel is the same tidy block as the one in the chat menu: who + what they
   want across the top, the two answers side by side and equal underneath. */
.inv-item{display:grid; grid-template-columns:1fr 1fr; gap:.35rem; padding:.55rem 0; border-top:1px solid var(--hair);}
.inv-item:first-child{border-top:none;}
.inv-item .inv-name, .inv-item .inv-note{grid-column:1 / -1;}
.inv-item .btn{width:100%; text-align:center;}
.friends-sub{color:var(--muted); font-size:.84rem; margin:0;}
.friends-search{width:100%; padding:.55rem .7rem; border-radius:.6rem; border:1px solid var(--hair-strong);
  background:var(--field); color:var(--text); font:inherit;}
.friends-search:focus{outline:none; border-color:var(--cyan);}
.friends-list{display:flex; flex-direction:column; gap:.4rem; overflow:auto; flex:1; min-height:0; padding-right:.15rem;}
.f-item{display:flex; align-items:center; gap:.7rem; padding:.55rem .7rem; border-radius:.6rem;
  background:var(--field); border:1px solid transparent; cursor:pointer; position:relative;}
/* MUTUAL friendship = pink outline (AC, 31 Oct 2026: "if 2 person have eachother as friend the outline
   becomes pink light color"). The server only stores a friendship once BOTH sides agreed, so a row in a
   signed-in member's list is mutual by construction; a local demo entry is not and gets no ring. */
.f-item.mutual{border-color:rgba(255,158,210,.45);}
.f-item.mutual .f-av, .f-item.mutual .f-av-init{box-shadow:0 0 0 2px rgba(255,158,210,.85);
  border-color:rgba(255,158,210,.85);}
.f-item:hover{border-color:var(--cyan);}
/* ONE-SIDED (AC, 31 Oct 2026: "show some one sided friends and some mutal friends"): the friendship
   exists on this side only, so it gets a dashed hairline instead of the pink ring — the ring means
   both sides are in. Dashed, not red: nothing here is an error. */
.f-item.one-sided{border-style:dashed; border-color:var(--hair-strong);}
.f-item.blocked{opacity:.7;}
.f-av{width:36px; height:36px; border-radius:50%; flex:none; object-fit:contain;
  background:var(--panel-solid); border:1px solid var(--hair-strong);}
.f-av-init{width:36px; height:36px; border-radius:50%; flex:none; display:flex; align-items:center;
  justify-content:center; font-weight:700; color:var(--cyan); background:rgba(0,214,230,.14);
  border:1px solid var(--hair-strong);}
.f-meta{display:flex; flex-direction:column; min-width:0;}
.f-name{font-weight:600; font-size:.95rem;}
.f-sub{font-size:.76rem; color:var(--muted); display:flex; align-items:center;}
.f-dot{width:8px; height:8px; border-radius:50%; display:inline-block; margin-right:.35rem;}
.f-dot.on{background:#39ff14; box-shadow:0 0 8px #39ff14;}
.f-dot.off{background:#ff4d5e; box-shadow:0 0 7px rgba(255,77,94,.6);}
/* "unknown" is not "offline": a local demo entry has no server-side presence, and claiming somebody is
   offline because we cannot see them is the kind of small untruth this app does not do. */
.f-dot.unknown{background:var(--muted); box-shadow:none;}
.f-menu-btn{margin-left:auto; background:none; border:1px solid var(--hair-strong); color:var(--muted);
  border-radius:.5rem; width:30px; height:30px; font-size:1rem; line-height:1; cursor:pointer; flex:none;}
.f-menu-btn:hover{border-color:var(--cyan); color:var(--cyan);}
.f-menu{position:absolute; top:2.3rem; right:.6rem; z-index:10; min-width:158px; background:var(--panel-solid);
  border:1px solid var(--hair-strong); border-radius:.6rem; padding:.3rem; display:flex;
  flex-direction:column; gap:.2rem; box-shadow:var(--shadow);}
.f-menu.up{top:auto; bottom:2.3rem;}
.f-menu-item{background:none; border:none; text-align:left; padding:.5rem .6rem; border-radius:.4rem;
  cursor:pointer; font:inherit; font-size:.85rem; color:var(--text);}
.f-menu-item:hover{background:rgba(0,214,230,.12);}
.f-menu-item.danger{color:#ff8a8a;}
.f-gate{padding:1.6rem 1.2rem; text-align:center; color:var(--muted);
  border:1px dashed var(--hair-strong); border-radius:.8rem;}
.f-gate h3{color:var(--text); margin:.2rem 0 .5rem; font-size:1rem;}
.f-gate p{margin:.2rem 0 .9rem; font-size:.88rem;}
.friends-note{margin:0; padding-top:.6rem; border-top:1px solid var(--hair);
  color:var(--muted); font-size:.74rem; flex:none;}

/* the Find / Clear button row */
.actions{flex-wrap:wrap}

/* ===== Bottom navigation bar (added 25 Oct 2026 as a phone-only design; on EVERY width
   since 27 Oct 2026 — AC: "I like the menu bar down the screen and how it works, the web
   version should also have that").
   The bar, its five tabs and what each tab opens were NEVER width-dependent in JS — the
   handler only ever ran because CSS hid the bar above 640px. Now the same bar is the app's
   navigation everywhere, so web and phone cannot drift apart.
   Two consequences, both deliberate and both matching what the phone already did:
     1. the fixed site-actions bar (About / Contact / Updates / Donate) is hidden everywhere,
        because its entries are proxied in the Me sheet (single-sourced, no duplicates);
     2. the minimized-chat dock is lifted above the bar instead of sitting at the very bottom
        (z-index 85 < the bar's 86 — it would otherwise be buried under it). On phones the dock
        stays hidden: there the Chat tab owns that job.
   Measurements that drove the original phone version: header was 144px tall, 22 controls were
   under 44x44, Friends/Games/Radar sat at y=1602 (two screens down) and the fixed bar covered
   the bottom of the page (padding-bottom was 0). */
.tabbar{display:flex; position:fixed; left:0; right:0; bottom:0; z-index:86;
  background:rgba(10,14,22,.95); backdrop-filter:blur(12px); border-top:1px solid var(--hair-strong);
  padding:.3rem .25rem calc(.3rem + env(safe-area-inset-bottom, 0px));}
.tabbar[hidden]{display:none}
.tab-btn{position:relative; flex:1 1 0; min-height:52px; display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:2px; background:none; border:0; color:var(--muted); font:inherit;
  font-size:.68rem; letter-spacing:.02em; border-radius:.6rem; padding:.3rem .15rem; cursor:pointer;}
.tab-btn svg{width:22px; height:22px; display:block}
.tab-btn.on{color:var(--lightblue)}
.tab-btn.on svg{filter:drop-shadow(0 0 6px rgba(127,212,255,.45))}
/* Nothing hides behind the fixed bar. 66px = the 52px tab plus the bar's own padding — measured,
   and re-measured on a phone after every change to .tab-btn. */
body{padding-bottom:calc(66px + env(safe-area-inset-bottom, 0px))}
.site-actions{display:none}                                          /* its entries live in the Me sheet */
/* The minimized-chat DOCK is hidden at EVERY width (final word, AC 27 Oct 2026: "do fix on the web version
   that minimized chats go into the chatmenu and no longer as box right under the screen"). A minimized chat
   is reached from the Chat tab menu on web AND phone — the corner chips are retired everywhere, so there is
   exactly one place to look.
   If the dock is ever wanted again on web, un-hide it here AND restore the lift
   (`bottom:calc(66px + env(safe-area-inset-bottom, 0px) + .6rem)`): its z-index 85 sits BELOW the bar's 86,
   so it would otherwise be buried under the tab bar. The chips are still built by saveChatState/
   renderChatDock, so un-hiding is this one rule. */
.chat-dock{display:none !important}
/* The tab-bar sheets must NOT cover the bar itself: a sheet that swallows the bar leaves the user
   stuck (measured on a phone: friends/diary/me taps were intercepted by an open chats sheet). They
   stop 66px short of the bar, so their z-index can sit above the floating windows — which it must,
   because bringToFront() pushes a window to inline z-index 91+ and an open window was painting over
   the Me sheet (the Contact row's tap hit the window instead). */
/* #diarySheet left this rule on 29 Oct 2026: it is a floating .chat-win now (see .chat-win.diary-win), so
    pinning an inset here would stretch it across the page again. */
#meSheet{inset:0 0 calc(66px + env(safe-area-inset-bottom, 0px)) 0; z-index:120}
/* THE CHAT MENU IS A POP-UP BOX, NOT A FULL SHEET (AC, 27 Oct 2026: "The chat menu when clicked should
   open like a pop-up box while on the same page"). It is a compact floating panel in the bottom-right
   corner, just above the tab bar, and the overlay behind it is transparent so the page stays visible and
   readable while the menu is open — clicking anywhere outside still closes it (the overlay click handler
   in app.js), it just no longer dims or blurs the page. The .modal child keeps its own border/shadow, so
   it reads as a panel rather than a page. */
/* #chatsSheet is NO LONGER a modal overlay: since 28 Oct 2026 it is a floating .chat-win (drag its
   header, same look as the friends box). The overlay rules that pinned it to the corner are gone with the
   .modal child — see .chat-win.chats-win below for its size and place. */
/* The invite section inside the chat menu: a labelled list above the open chats. */
.chats-invites{margin:0; padding:0; border:0; background:none}
.chats-invites-head{font-size:.78rem; font-weight:700; letter-spacing:.04em; text-transform:uppercase;
  color:var(--pink, #ff2e97); margin-bottom:.35rem}
/* Each pending invite is ONE tidy block: the name and "wants to chat with you" (and any message) read
   left to right on top, with Accept and Decline side by side UNDER them, equal width. AC, 31 Oct 2026:
   "this text 'wants to chat with you' should be orderly structured from left to right with the text and
   under accept and decline. In the mobile version those accept and decline should be same sizes." A
   column of these has to stay scannable when hundreds are waiting, so every row has the same shape:
   who -> what they want -> the two answers, in the same place every time. */
.chats-invite-row{ display:block; padding:.5rem 0; border-top:1px solid var(--hair) }
.chats-invite-row:first-of-type{border-top:none}
.chats-invite-who{ display:flex; flex-direction:row; align-items:baseline; flex-wrap:wrap;
  gap:.3rem; min-width:0 }
.chats-invite-who b{ font-size:.9rem; }
.chats-invite-who small{ font-size:.74rem; color:var(--muted); }
.chats-invite-who .inv-note{ flex:1 1 100%; margin:.35rem 0 0; }
.chats-invite-acts{ display:grid; grid-template-columns:1fr 1fr; gap:.4rem; margin-top:.5rem; }
.chats-invite-acts .btn{ width:100%; padding:.4rem .5rem; font-size:.78rem; text-align:center; }
/* Desktop: cap and centre the tabs so they keep the phone's thumb-sized rhythm instead of
   stretching into five 280px cells. The BAR itself stays full width. */
@media (min-width:641px){
  .tabbar{justify-content:center}
  .tab-btn{flex:0 1 132px}
}
.me-list{display:flex; flex-direction:column; gap:.5rem; margin:.2rem 0 0}
/* Chat sheet rows: name left, close × hard against the right end.
     The row is the flex container; the open-button grows and the × never shrinks. */
.chats-row{display:flex; align-items:center; gap:.4rem; width:100%;}
.chats-row-open{display:flex; align-items:center; gap:.55rem; flex:1 1 auto; min-width:0;
  background:none; border:0; color:var(--text); font:inherit; text-align:left; cursor:pointer;
  padding:.55rem .2rem; border-radius:.5rem;}
.chats-row-open:hover{background:rgba(0,240,255,.07);}
.chats-row-av{width:30px; height:30px; border-radius:50%; object-fit:cover; flex:0 0 auto;}
.chats-row-name{flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.chats-row-x{flex:0 0 auto; margin-left:auto; width:32px; height:32px; display:flex; align-items:center;
  justify-content:center; background:none; border:0; color:var(--muted); font-size:1.1rem; line-height:1;
  cursor:pointer; border-radius:.45rem;}
.chats-row-x:hover{background:rgba(255,90,90,.15); color:#ff8a8a;}
/* Chat-tab count badge (0 chats -> hidden, so the tab shows its plain logo). */
/* Chat count badge: cyan fill with a red/pink contour from the first active chat (AC, 25 Oct 2026).
   The badge only renders when the count is >= 1 (hidden at 0), so "from count 1" is simply the badge's
   normal look. The ring is a two-layer box-shadow so the pill keeps its exact size (a border would
   shift the text and change the 1.05rem height); the outer pink ring sits outside the cyan glow. */
.tab-badge{position:absolute; top:2px; left:calc(50% + 5px); min-width:1.05rem; height:1.05rem;
  padding:0 .28rem; border-radius:99px; background:var(--cyan); color:#04121a; font-size:.62rem;
  font-weight:700; line-height:1.05rem; text-align:center;
  box-shadow:0 0 0 2px #ff4d7d, 0 0 8px rgba(0,240,255,.55);
  pointer-events:none;}

/* A group member whose action menu is open. Pink ring matches the badge so "this one is selected"
   reads the same way across the app. */
.gp-member.gp-selected{border-radius:.55rem; box-shadow:0 0 0 2px #ff4d7d;}
.me-item{display:inline-flex; align-items:center; width:100%; min-height:48px; justify-content:flex-start;
  text-align:left; font-size:.95rem;}

@media (max-width:640px){
  /* Auth card on a phone: slimmer padding + smaller heading so the form needs less scrolling.
     Width is already safe (94vw, measured 288-380px against 320-412px screens); this only trims height. */
  #regOverlay{padding:.7rem}
  .reg-modal{padding:1.1rem 1.1rem .9rem; border-radius:.85rem}
  .reg-modal h2{font-size:1.2rem}
  .reg-modal .sub{margin-bottom:.8rem}
  /* The bar itself, its tab buttons and the sheet insets are BASE rules now (see the bottom
     navigation block above) — the same bar is on every width. Only phone-only bits stay here. */
  /* the dock is hidden at EVERY width now (see the base .chat-dock rule): the Chat tab owns minimized
     chats on web and phone alike, so this phone rule is redundant — kept as a note only. */
  /* the resize grip needs a thumb-sized target on a phone (mouse is fine with 24px) */
  .chat-resize{width:34px; height:34px;}
  .brand-quote{display:none}                                           /* it made the phone header 144px tall */
  .site-header{padding-top:.55rem; padding-bottom:.55rem}
  /* thumb-sized controls (desktop keeps its compact hover-sized buttons) */
  .hdr-btn{min-height:44px; padding:.5rem .75rem}
  .btn, .account-links .btn, .sym-arrow{min-height:44px}
  input:not([type=checkbox]):not([type=radio]), select, textarea{min-height:44px}
  label.search{min-height:44px}
  .step.picker-col .actions .btn{flex:1 1 0}
  .sort-btn{min-height:38px; padding:.35rem .7rem}
  /* Matches header row. "2 Matches [99 matches] [View list]" does NOT fit a 320px screen with
     desktop spacing: measured at 320px the button's right edge sat at 354 — 34px past the screen,
     so the last of "View list" was cut off. Reduced gap/padding/font keeps one line fitting at
     320px; flex-wrap is the fallback for very large text settings so nothing is ever clipped. */
  /* The pill must sit ON THE SAME ROW as "2 Matches [99 matches]", immediately after the count.
     Measured at 320px: the desktop-sized row needs ~327px in a 267px box, so the pill used to drop
     to a second row (the reported "sits under the number"). These sizes bring the row to ~256px,
     so one row fits even at 320px; flex-wrap stays as a safety net for very large text settings. */
  .step-head{flex-wrap:wrap; gap:.25rem}
  .matches-col .step-head{padding:0 .5rem}
  .matches-col .step-head h2{font-size:1rem}
  .match-count{font-size:.68rem; padding:.15rem .4rem}
  .view-list-btn{flex:none}
  /* The "View list" affordance: next to the red match count, thumb-sized, phone only. */
  .view-list-btn{display:inline-flex; align-items:center; justify-content:center; gap:.2rem;
    min-height:28px; font-size:.68rem; font-weight:700; letter-spacing:.02em; white-space:nowrap;
    padding:.15rem .4rem; border-radius:99px; cursor:pointer;
    background:rgba(255,46,151,.12); border:1px solid rgba(255,46,151,.42); color:var(--magenta);}
  .modal-x{min-width:44px; min-height:44px}
  #optionsBtn{min-width:44px; min-height:44px}
  /* Floating windows must open ABOVE the tab bar, not on top of it. Measured before this fix:
     the friends window opened bottom-anchored at 1.2rem (bottom edge 825) and covered the Diary
     and Me tabs (bar top 781), so those taps were intercepted by friends-body. */
  .chat-win{width:min(94vw, 420px); bottom:calc(78px + env(safe-area-inset-bottom, 0px)); height:min(480px, 66vh)}
  .friends-win{height:min(560px, 62vh)}
}

/* ===== Up to 3 conditions per member (AC, 25 Oct 2026) ===== */
/* Profile form: the Add button + counter row, and the removable chips under it. */
.pf-cond-row{ display:flex; align-items:center; gap:.6rem; margin:.45rem 0 .35rem; }
.pf-cond-row .btn{ font-size:.82rem; padding:.35rem .7rem; }
.pf-cond-chips{ display:flex; flex-wrap:wrap; gap:.35rem; }
.cond-chip{ display:inline-flex; align-items:center; gap:.4rem; font-size:.82rem;
  background:rgba(0,240,255,.12); border:1px solid rgba(0,240,255,.45); color:var(--text);
  border-radius:999px; padding:.22rem .55rem; }
.cond-chip .x{ background:none; border:0; color:var(--muted); font-size:.95rem; line-height:1;
  cursor:pointer; padding:0 .1rem; }
.cond-chip .x:hover{ color:#fff; }

/* Match card: condition chips sit in one row under the shared-symptoms line. */
.match .card-conds{ display:flex; flex-wrap:wrap; gap:.3rem; margin:.25rem 0 .3rem; }
.match .card-conds .card-cond{ cursor:help; display:inline-block; font-weight:700; color:var(--cyan);
  font-size:.86rem; background:rgba(0,214,230,.1); border:1px solid rgba(0,214,230,.35);
  border-radius:999px; padding:.12rem .5rem; }
.match .card-conds .card-cond:hover{ color:#fff; border-color:rgba(0,214,230,.75); }

/* Diary: a viewed member's conditions, same look and tap-to-explain as their medicines. */
#bioViewConds .post-cond, .post-conds .post-cond, #myDiaryConds .post-cond{ display:inline-block; font-size:.8rem; cursor:help;
  color:var(--cyan); background:rgba(0,214,230,.1); border:1px solid rgba(0,214,230,.35);
  border-radius:999px; padding:.12rem .5rem; margin:0 .25rem .25rem 0; font-family:inherit; }
#bioViewConds .post-cond:hover, .post-conds .post-cond:hover, #myDiaryConds .post-cond:hover{ color:#fff; border-color:rgba(0,214,230,.75); }
.post-conds{ margin:.2rem 0 .35rem; }

/* Group picker: custom group name (create only). */
.gp-name-wrap{ margin:.5rem 0 .2rem; }
.gp-name-wrap input{ width:100%; padding:.6rem .75rem; border-radius:.5rem; font-size:.92rem;
  background:rgba(255,255,255,.06); border:1px solid rgba(255,255,255,.18); color:var(--text); }
.gp-name-wrap input:focus{ outline:none; border-color:var(--cyan); box-shadow:0 0 0 2px rgba(0,240,255,.2); }
.gp-name-wrap input::placeholder{ color:var(--muted); }

/* ===== Diary viewbar: ordered condition/medicine rows, heart + save (AC, 25 Oct 2026) ===== */
.bio-viewbar-actions{ display:flex; align-items:center; gap:.4rem; flex-wrap:wrap; margin-left:auto; }
/* Back sits last: its own row, spanning the full width, at the very bottom of the diary box. */
.bio-back-row{ flex:1 1 100%; order:6; display:flex; align-items:center;
  margin-top:.5rem; padding-top:.55rem; border-top:1px solid rgba(255,255,255,.08); }
.bio-heart, .bio-save{ font-size:.82rem !important; padding:.3rem .65rem !important; }
.bio-heart{ color:#ff6b9d !important; border-color:rgba(255,107,157,.4) !important; }
.bio-heart.on{ background:rgba(255,107,157,.16) !important; border-color:#ff6b9d !important; color:#ff8fb3 !important; }
.bio-save{ color:var(--cyan) !important; border-color:rgba(0,240,255,.35) !important; }
.bio-save.on{ background:rgba(0,240,255,.12) !important; border-color:var(--cyan) !important; }

/* Two labelled rows: "Conditions" then "Medicines", each chips row on its own line. */
.bio-chips{ display:flex; flex-direction:column; gap:.35rem; flex:1 1 100%; order:5; }
.bio-chip-row{ display:flex; align-items:center; gap:.45rem; flex-wrap:wrap; }
.bio-chip-label{ font-size:.72rem; text-transform:uppercase; letter-spacing:.06em;
  color:var(--muted); font-weight:700; min-width:5.4rem; }

/* Conditions: the smaller pills. */
#bioViewConds .post-cond{ font-size:.76rem !important; padding:.09rem .44rem !important; }

/* Medicines: only slightly larger than conditions — the old .86rem made the gap too big. */
#bioViewMeds .med-pub, #bioViewMeds .post-cond{ font-size:.80rem !important; padding:.12rem .48rem !important; }

/* ===== Your OWN diary panel (AC, 27 Oct 2026) =====
   Same three rows as a member's diary (conditions, medicines, hearts), but for you. It reads as YOURS and
   not as a captured member: a cyan label instead of the plain "Viewing X's diary", your medicines chip in
   the same cyan, and a hearts count that is NOT a button (you cannot love your own diary — the server
   refuses, so a toggle here would be a lie). */
.bio-viewbar.bio-mine{ border-color:rgba(0,240,255,.35); }
.bio-mine-label{ font-family:var(--mono,monospace); text-transform:uppercase; letter-spacing:.1em;
  font-size:.74rem; font-weight:700; color:var(--cyan); }
/* The own-diary chips: SIZE only here, the LOOK comes from the shared rule above. Before 28 Oct 2026 this
   container was missing from that selector list, so these chips fell through to the browser's default
   button styling — a grey box with white letters, which is what AC saw next to the diary's chips
   ("in users own diary the conditions boxstyle is different grey with white ltters, they should look like
   how other conditions are stylistic displayed"). Any new conditions container must be added to the
   selector list above, not styled from scratch. */
#myDiaryConds .post-cond{ font-size:.76rem !important; padding:.09rem .44rem !important; }
#myDiaryMeds .med-pub{ font-size:.80rem !important; padding:.12rem .48rem !important; }
/* A medicine you have NOT switched on for others used to be drawn with a dashed border and muted
   text. AC, 31 Oct 2026: "by my medicine the medicine boxes are dotted lines and grey text, should be
   same style as my condition boxes". He is right — next to the solid condition chips, half the
   medicine list read as disabled or broken, and both are just lists of things about him.
   So the chip now wears the SAME look as #myDiaryConds .post-cond, and what marks it as not-shared is
   the 🚫 inside it — the very icon the profile editor already uses for "hidden from other members"
   (👁 = visible, 🚫 = hidden), so the vocabulary stays one thing across the app. */
#myDiaryMeds .med-pub{ color:var(--cyan); background:rgba(0,214,230,.1); border:1px solid rgba(0,214,230,.35); }
#myDiaryMeds .med-pub:hover{ color:#fff; border-color:rgba(0,214,230,.75); }
#myDiaryMeds .med-priv{ font-size:.82em; line-height:1; opacity:.8; }
.bio-hearts-received{ display:inline-flex; align-items:center; gap:.28rem; font-size:.82rem;
  color:#ff6b9d; border:1px solid rgba(255,107,157,.35); border-radius:999px; padding:.3rem .7rem; }
/* The count is EMPTY at zero (AC, 27 Oct 2026), so the pill is just the heart — keep the gap from leaving
   a hole next to it. From one on, the number sits beside the heart. */
.bio-hearts-received .bio-heart-ic{ font-size:.92rem; line-height:1; }

/* ===== Heart messages (AC, 31 Oct 2026) ========================================================
   A heart may carry a short anonymous note: "he or she can sent a short message (capped to small
   number of words) or it can be left blanc. When hovering on the heart with cursor list of heart
   messages are shown. On phone its toggle button to see list of messages."
   Mouse: hover the heart and the list appears. Phone: no hover exists at all, so the ▾ toggle is the
   only way in — it shows only when somebody actually wrote something, and stays out of the way
   otherwise. */
.bio-heart-wrap{ display:inline-flex; align-items:center; gap:.25rem; }
.heart-notes-toggle{ display:none; background:none; border:1px solid var(--hair-strong); color:var(--muted);
  border-radius:999px; font-size:.7rem; line-height:1; padding:.22rem .42rem; cursor:pointer; }
.heart-notes-toggle:hover{ color:#ff6b9d; border-color:rgba(255,107,157,.45); }
.heart-notes-toggle[hidden]{ display:none !important; }
@media (hover: none){ .heart-notes-toggle:not([hidden]){ display:inline-flex; } }
.heart-notes-pop{ position:fixed; z-index:9600; width:min(320px,86vw); max-height:min(300px,50vh);
  display:flex; flex-direction:column; background:var(--panel-solid); border:1px solid rgba(255,107,157,.4);
  border-radius:.7rem; box-shadow:0 0 34px rgba(255,46,151,.22); overflow:hidden; }
.hn-head{ padding:.5rem .7rem; font-size:.74rem; text-transform:uppercase; letter-spacing:.07em;
  color:#ff6b9d; font-weight:700; border-bottom:1px solid var(--hair); }
.hn-body{ overflow:auto; padding:.15rem 0; }
.hn-row{ padding:.45rem .7rem; border-bottom:1px solid var(--hair); }
.hn-row:last-child{ border-bottom:none; }
.hn-text{ font-size:.85rem; line-height:1.45; color:var(--text); overflow-wrap:anywhere; }
.hn-when{ margin-top:.2rem; font-size:.7rem; color:var(--muted); }
.hn-empty{ padding:.7rem; font-size:.82rem; color:var(--muted); }
.hn-foot{ padding:.45rem .7rem; font-size:.7rem; color:var(--muted); border-top:1px solid var(--hair); }
/* the writing sheet borrows the invite sheet's centred look; only the field + counter are its own */
.heart-sheet .heart-note-input{ width:100%; margin-top:.7rem; background:var(--field);
  border:1px solid var(--hair-strong); border-radius:.5rem; color:var(--text); font-family:var(--font);
  font-size:.92rem; padding:.55rem .7rem; outline:none; }
.heart-sheet .heart-note-input:focus{ border-color:var(--cyan); }
.heart-note-count{ margin:.35rem 0 0; font-size:.74rem; color:var(--muted); text-align:right; }
.heart-note-count.over{ color:#ff6b9d; font-weight:700; }
#myDiaryHearts:empty{ display:none; }
#myDiaryHearts{ font-weight:700; font-variant-numeric:tabular-nums; }
.sr-only{ position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden;
  clip:rect(0 0 0 0); white-space:nowrap; border:0; }

/* Condition members panel reuses the medicine panel's look; give it a title colour. */
#condModal .modal h2{ color:var(--cyan); }
#condMembers .med-member .mm-diary{ font-size:.78rem; padding:.28rem .6rem; }
#condMembers .med-member .mm-hello{ font-size:.78rem; padding:.28rem .6rem; }

@media (max-width:600px){
  .bio-viewbar{ flex-wrap:wrap; }
  .bio-viewbar-actions{ margin-left:0; }
}

/* ===== If you're in crisis (28 Oct 2026) =====
   A help screen, so it is read, not decorated: left-aligned text, real tap targets, and no colour that
   reads as a warning. The numbers are links (tel:) because a phone must be able to dial them. */
.crisis-pop{ width:min(460px, 96vw); text-align:left; }
.crisis-pop h2{ margin-bottom:.5rem; }
.crisis-lead{ color:var(--muted); font-size:.88rem; margin:0 0 .9rem; line-height:1.45; }
.crisis-list{ list-style:none; margin:0 0 .9rem; padding:0; display:flex; flex-direction:column; gap:.6rem; }
.crisis-list li{ background:rgba(255,255,255,.03); border:1px solid var(--hair); border-radius:.6rem;
  padding:.55rem .7rem; display:flex; flex-direction:column; gap:.15rem; }
.crisis-list b{ font-size:.88rem; }
.crisis-list span{ font-size:.84rem; color:var(--muted); line-height:1.45; }
.crisis-list a{ color:var(--cyan); text-decoration:underline; }
.crisis-note{ font-size:.82rem; color:var(--muted); margin:0; line-height:1.45; }
.crisis-note b{ color:var(--text); }

/* ===== Two-factor panel (1 Nov 2026) ==========================================
   The secret and the recovery codes are read off a screen and typed somewhere else, so they get a mono
   face and letter-spacing: letter shapes that cannot be confused are the difference between a working
   setup and a support message. */
.twofa-secret{
  font-family:var(--mono,monospace); font-size:1.02rem; letter-spacing:.14em; word-break:break-all;
  background:rgba(0,240,255,.07); border:1px solid rgba(0,240,255,.3); border-radius:.5rem;
  padding:.6rem .7rem; margin:.45rem 0 .2rem; user-select:all;
}
.twofa-codes{
  display:grid; grid-template-columns:1fr 1fr; gap:.3rem .9rem;
  font-family:var(--mono,monospace); letter-spacing:.08em; margin:.5rem 0 .3rem;
}
.twofa-hint{ color:var(--muted); font-size:.84rem; margin:.3rem 0 .2rem; }
.twofa-on{ color:var(--cyan); }
