
  /* ============ TOKENS ============ */
  :root{
    /* The phone's own furniture: status bar / notch, home indicator, rounded
       corners. The page is viewport-fit=cover and the installed app runs with
       a translucent status bar, so it is drawn underneath all of that, and
       anything pinned to a screen edge has to step in by these. They are 0 in
       a desktop browser. */
    --safe-top:env(safe-area-inset-top,0px);
    --safe-right:env(safe-area-inset-right,0px);
    --safe-bottom:env(safe-area-inset-bottom,0px);
    --safe-left:env(safe-area-inset-left,0px);
    --bg-0:#eaf7ef;
    --bg-1:#f6fbf8;
    --surface:#ffffff;
    --surface-2:#f3faf6;
    --tile-bg:#fcfffd;
    --border:#d3eedc;
    --border-strong:#bfe3cc;
    --text:#0f3f2a;
    --text-muted:#5c7a6c;
    --text-faint:#8ba99a;
    --primary:#1e7b4d;
    --primary-hover:#176140;
    --primary-tint:#d3eedc;
    --primary-tint-2:#eaf7ef;
    --on-primary:#ffffff;
    --accent:#e6bb0a;
    --accent-hover:#c29b06;
    --on-accent:#2e2200;
    --danger:#c0392b;
    --danger-tint:#fbe6e3;
    --rank-p:#d64550;
    --rank-p-tint:#fbe2e2;
    --rank-a:#e6ac0a;
    --rank-a-tint:#fff3d1;
    --rank-b:#2f8f6f;
    --rank-b-tint:#e1f2ea;
    --rank-c:#6f8c81;
    --rank-c-tint:#e9f1ed;
    --shadow-sm:0 1px 2px rgba(15,63,42,.06), 0 1px 1px rgba(15,63,42,.04);
    --shadow-md:0 6px 20px rgba(15,63,42,.10), 0 2px 6px rgba(15,63,42,.06);
    --shadow-lg:0 20px 48px rgba(15,63,42,.18), 0 6px 16px rgba(15,63,42,.10);
    --radius-sm:4px;
    --radius-md:6px;
    --radius-lg:8px;
    --radius-xl:8px;
    --font-display:"Outfit",-apple-system,"Segoe UI",sans-serif;
    --font-body:"Plus Jakarta Sans",-apple-system,"Segoe UI",sans-serif;
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --bg-0:#0b2b1d;
      --bg-1:#0f3524;
      --surface:#123a27;
      --surface-2:#0f3524;
      --tile-bg:#173f2b;
      --border:#1e4c35;
      --border-strong:#286048;
      --text:#e7f5ee;
      --text-muted:#9fc3b1;
      --text-faint:#6f9483;
      --primary:#4fbf8a;
      --primary-hover:#6fd4a3;
      --primary-tint:#1a4732;
      --primary-tint-2:#153c2a;
      --on-primary:#06231702;
      --on-primary:#062317;
      --accent:#f0c94a;
      --accent-hover:#f7db7f;
      --on-accent:#2e2200;
      --danger:#e07a6d;
      --danger-tint:#3a1f1c;
      --rank-p:#e8837a;
      --rank-p-tint:#3d211e;
      --rank-a:#f0c94a;
      --rank-a-tint:#3a3011;
      --rank-b:#5fce9f;
      --rank-b-tint:#173a2c;
      --rank-c:#8fae9f;
      --rank-c-tint:#1c3229;
      --shadow-sm:0 1px 2px rgba(0,0,0,.3);
      --shadow-md:0 6px 20px rgba(0,0,0,.35);
      --shadow-lg:0 20px 48px rgba(0,0,0,.5);
    }
  }
  :root[data-theme="dark"]{
    --bg-0:#0b2b1d;
    --bg-1:#0f3524;
    --surface:#123a27;
    --surface-2:#0f3524;
    --tile-bg:#173f2b;
    --border:#1e4c35;
    --border-strong:#286048;
    --text:#e7f5ee;
    --text-muted:#9fc3b1;
    --text-faint:#6f9483;
    --primary:#4fbf8a;
    --primary-hover:#6fd4a3;
    --primary-tint:#1a4732;
    --primary-tint-2:#153c2a;
    --on-primary:#062317;
    --accent:#f0c94a;
    --accent-hover:#f7db7f;
    --on-accent:#2e2200;
    --danger:#e07a6d;
    --danger-tint:#3a1f1c;
    --rank-p:#e8837a;
    --rank-p-tint:#3d211e;
    --rank-a:#f0c94a;
    --rank-a-tint:#3a3011;
    --rank-b:#5fce9f;
    --rank-b-tint:#173a2c;
    --rank-c:#8fae9f;
    --rank-c-tint:#1c3229;
    --shadow-sm:0 1px 2px rgba(0,0,0,.3);
    --shadow-md:0 6px 20px rgba(0,0,0,.35);
    --shadow-lg:0 20px 48px rgba(0,0,0,.5);
  }

  /* ============ DRAGONOWL HUB TOKENS (docs/hub.md) ============
     The Hub's own design language, Capacities-style: square-ish corners,
     neutral greys, hairline borders, quiet shadows. New Hub screens
     (public/hub/**) use ONLY these, so they look the same whatever board
     palette Tasking has painted on <html>. The radius pass on Tasking's own
     CSS is a separate job: these don't change any existing rule. */
  :root{
    --hub-radius-sm:4px;          /* chips, inputs, small buttons */
    --hub-radius-md:6px;          /* cards, nav items, menus */
    --hub-radius-lg:8px;          /* dialogs, sheets, large panels */
    --hub-radius-card:6px;
    --hub-gray-0:#ffffff;
    --hub-gray-50:#fafafa;
    --hub-gray-100:#f4f4f5;
    --hub-gray-200:#e8e8ea;
    --hub-gray-300:#d4d4d8;
    --hub-gray-400:#a1a1aa;
    --hub-gray-500:#71717a;
    --hub-gray-600:#52525b;
    --hub-gray-700:#3f3f46;
    --hub-gray-800:#27272a;
    --hub-gray-900:#18181b;
    --hub-bg:#fbfbfa;             /* page */
    --hub-surface:#ffffff;        /* cards */
    --hub-surface-2:#f6f6f5;      /* insets, table stripes, code */
    --hub-sidebar:#f7f7f6;        /* the left nav */
    --hub-text:#1f1f22;
    --hub-text-muted:#62626a;
    --hub-text-faint:#9a9aa2;
    --hub-border:rgba(0,0,0,.08);
    --hub-border-strong:rgba(0,0,0,.14);
    --hub-hover:rgba(0,0,0,.04);
    --hub-active:rgba(0,0,0,.07);
    --hub-accent:#1e7b4d;         /* DragonOwl green; text on it is --hub-on-accent */
    --hub-accent-tint:rgba(30,123,77,.10);
    --hub-on-accent:#ffffff;
    --hub-danger:#c0392b;
    --hub-warn:#b7791f;
    --hub-ok:#1e7b4d;
    --hub-focus:0 0 0 2px rgba(30,123,77,.35);
    --hub-shadow-sm:0 1px 2px rgba(0,0,0,.05);
    --hub-shadow-md:0 2px 8px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --hub-shadow-lg:0 12px 32px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.05);
    --hub-font:-apple-system,BlinkMacSystemFont,"Segoe UI",Inter,Roboto,"Helvetica Neue",sans-serif;
    --hub-font-size:14px;
    --hub-nav-w:232px;            /* left nav, open */
    --hub-nav-rail:52px;          /* left nav, collapsed to icons */
    --hub-space-1:4px; --hub-space-2:8px; --hub-space-3:12px; --hub-space-4:16px; --hub-space-5:24px; --hub-space-6:32px;
  }
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){
      --hub-bg:#191919;
      --hub-surface:#202020;
      --hub-surface-2:#262626;
      --hub-sidebar:#1d1d1d;
      --hub-text:#ececec;
      --hub-text-muted:#a3a3a3;
      --hub-text-faint:#6e6e6e;
      --hub-border:rgba(255,255,255,.08);
      --hub-border-strong:rgba(255,255,255,.14);
      --hub-hover:rgba(255,255,255,.05);
      --hub-active:rgba(255,255,255,.09);
      --hub-accent:#4fbf8a;
      --hub-accent-tint:rgba(79,191,138,.14);
      --hub-on-accent:#062317;
      --hub-danger:#e07a6d;
      --hub-warn:#e0b25a;
      --hub-ok:#4fbf8a;
      --hub-focus:0 0 0 2px rgba(79,191,138,.45);
      --hub-shadow-sm:0 1px 2px rgba(0,0,0,.4);
      --hub-shadow-md:0 2px 8px rgba(0,0,0,.45);
      --hub-shadow-lg:0 12px 32px rgba(0,0,0,.55);
    }
  }
  :root[data-theme="dark"]{
    --hub-bg:#191919;
    --hub-surface:#202020;
    --hub-surface-2:#262626;
    --hub-sidebar:#1d1d1d;
    --hub-text:#ececec;
    --hub-text-muted:#a3a3a3;
    --hub-text-faint:#6e6e6e;
    --hub-border:rgba(255,255,255,.08);
    --hub-border-strong:rgba(255,255,255,.14);
    --hub-hover:rgba(255,255,255,.05);
    --hub-active:rgba(255,255,255,.09);
    --hub-accent:#4fbf8a;
    --hub-accent-tint:rgba(79,191,138,.14);
    --hub-on-accent:#062317;
    --hub-danger:#e07a6d;
    --hub-warn:#e0b25a;
    --hub-ok:#4fbf8a;
    --hub-focus:0 0 0 2px rgba(79,191,138,.45);
    --hub-shadow-sm:0 1px 2px rgba(0,0,0,.4);
    --hub-shadow-md:0 2px 8px rgba(0,0,0,.45);
    --hub-shadow-lg:0 12px 32px rgba(0,0,0,.55);
  }

  /* ============ PERSONAL BOARD — canary-yellow reskin ============
     Same tonal roles as the default (Work) green theme, hue-shifted to
     gold/canary so the two boards read as visibly different at a glance.
     Only the neutral + primary greens move; rank colours, accent and
     danger stay put because they're semantic, not board identity.
     Applied by data-board="personal" on <html> (set in render()). */
  :root[data-board="personal"]{
    --bg-0:#faf6e6;
    --bg-1:#fdfbf1;
    --surface:#ffffff;
    --surface-2:#fbf8ec;
    --tile-bg:#fffef8;
    --border:#ece0ad;
    --border-strong:#ddcd8c;
    --text:#3d3410;
    --text-muted:#77693e;
    --text-faint:#a99f74;
    --primary:#9c7c0a;
    --primary-hover:#7d6208;
    --primary-tint:#f3e7b0;
    --primary-tint-2:#faf3d7;
    --on-primary:#ffffff;
  }
  @media (prefers-color-scheme: dark){
    :root[data-board="personal"]:not([data-theme="light"]){
      --bg-0:#2a2306;
      --bg-1:#322909;
      --surface:#392f0c;
      --surface-2:#322909;
      --tile-bg:#3e3410;
      --border:#4b3f12;
      --border-strong:#5f5019;
      --text:#f6f1df;
      --text-muted:#c6b98d;
      --text-faint:#948970;
      --primary:#d8bd45;
      --primary-hover:#e6cf6a;
      --primary-tint:#463a17;
      --primary-tint-2:#3b3216;
      --on-primary:#241d05;
    }
  }
  :root[data-board="personal"][data-theme="dark"]{
    --bg-0:#2a2306;
    --bg-1:#322909;
    --surface:#392f0c;
    --surface-2:#322909;
    --tile-bg:#3e3410;
    --border:#4b3f12;
    --border-strong:#5f5019;
    --text:#f6f1df;
    --text-muted:#c6b98d;
    --text-faint:#948970;
    --primary:#d8bd45;
    --primary-hover:#e6cf6a;
    --primary-tint:#463a17;
    --primary-tint-2:#3b3216;
    --on-primary:#241d05;
  }

  /* ---- Board-toggle motion ----
     The incoming board slides + fades in from the side its tab sits on;
     .board-switch-* is emitted once per switchBoard() (see renderBoard) and
     cleared on the next render. Separately, .palette-glide is added to <html>
     for ~480ms around any board OR light/dark change (see beginPaletteGlide)
     so the recolour eases instead of snapping. box-shadow / transform are
     left out of the glide so hover lifts still feel instant. */
  @keyframes boardSwitchIn{
    from{opacity:0;transform:translateX(var(--board-dx,10px));}
    to{opacity:1;transform:translateX(0);}
  }
  .board-switch{animation:boardSwitchIn .3s cubic-bezier(.22,.61,.36,1);}
  .board-switch-personal{--board-dx:-14px;}
  .board-switch-work{--board-dx:14px;}
  :root.palette-glide *,
  :root.palette-glide *::before,
  :root.palette-glide *::after{
    transition:background-color .38s ease, border-color .38s ease, color .38s ease, fill .38s ease !important;
  }
  @media (prefers-reduced-motion: reduce){
    .board-switch{animation:none;}
    :root.palette-glide *,
    :root.palette-glide *::before,
    :root.palette-glide *::after{transition:none !important;}
  }

  *{box-sizing:border-box;}
  html,body{height:100%;}
  body{
    margin:0;
    background:
      radial-gradient(1200px 600px at 10% -10%, var(--primary-tint-2), transparent 60%),
      var(--bg-0);
    color:var(--text);
    font-family:var(--font-body);
    -webkit-font-smoothing:antialiased;
  }
  /* A user's custom Personal-board palette (Settings) is derived from one seed
     colour and set as inline CSS vars on <html> — see applyPersonalBg(). */
  #app{min-height:100vh;display:flex;flex-direction:column;padding:var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);}
  /* Behind the phone's status bar. Its clock and battery are drawn in white
     (black-translucent), so they need something dark under them whatever the
     theme, and the page must not scroll through them. No inset → no height. */
  body::before{content:"";position:fixed;top:0;left:0;right:0;height:var(--safe-top);background:#0f3f2a;z-index:9000;pointer-events:none;}
  h1,h2,h3,.display{font-family:var(--font-display);}
  ::selection{background:var(--primary-tint);}
  button{font-family:inherit;}
  input,textarea,select{font-family:inherit;}
  a{color:inherit;}

  .visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);}

  /* ============ LOGO ============ */
  .logo-mark{
    width:1em;height:1em;border-radius:22%;
    background:var(--primary);
    display:inline-flex;align-items:center;justify-content:center;
    flex-shrink:0;
    box-shadow:var(--shadow-sm);
  }
  .logo-mark svg{width:60%;height:60%;}

  /* ============ PROFILE PICKER ============ */
  .picker-screen{
    flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;
    padding:48px 20px;gap:28px;text-align:center;
  }
  .picker-logo{width:88px;height:88px;font-size:88px;}
  .picker-card{
    background:var(--surface);
    border:1px solid var(--border);
    border-radius:var(--radius-xl);
    box-shadow:var(--shadow-lg);
    padding:32px;
    width:min(420px,92vw);
    display:flex;flex-direction:column;gap:18px;
  }
  .picker-title{font-size:1.05rem;font-weight:700;letter-spacing:.02em;color:var(--text);margin:0;}
  .picker-sub{font-size:.85rem;color:var(--text-muted);margin:-10px 0 4px;}
  .profile-option{
    display:flex;align-items:center;gap:14px;
    padding:14px 16px;border-radius:var(--radius-md);
    border:1.5px solid var(--border);
    background:var(--surface-2);
    cursor:pointer;text-align:left;
    transition:border-color .15s ease, transform .1s ease, box-shadow .15s ease;
  }
  .profile-option:hover{border-color:var(--primary);box-shadow:var(--shadow-sm);transform:translateY(-1px);}
  .profile-option:focus-visible{outline:2px solid var(--primary);outline-offset:2px;}
  .avatar{
    width:42px;height:42px;border-radius:50%;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;
    font-family:var(--font-display);font-weight:700;color:#fff;font-size:1rem;
  }
  .profile-option .name{font-weight:700;font-size:.98rem;color:var(--text);}
  .profile-option .role{font-size:.78rem;color:var(--text-muted);}
  .brandline{display:flex;flex-direction:column;align-items:center;gap:4px;}
  .brandline .wordmark{font-family:var(--font-display);font-weight:800;letter-spacing:.04em;font-size:1.05rem;text-transform:uppercase;}
  .brandline .tagline{font-style:italic;color:var(--text-muted);font-size:.85rem;}
  .picker-note{font-size:.75rem;color:var(--text-faint);max-width:360px;line-height:1.5;}

  /* ============ APP SHELL ============ */
  .topbar{
    display:flex;align-items:center;gap:16px;
    padding:10px 18px;background:var(--surface);
    border-bottom:1px solid var(--border);
    position:sticky;top:var(--safe-top);z-index:20;
    /* Safety net: html,body deliberately clip horizontal overflow so the app
       never shows a page-wide sideways scrollbar. But on some devices (e.g.
       a larger default "Screen zoom" display setting, which narrows the
       effective CSS viewport without changing the physical screen size) the
       topbar's fixed-width items (logo, board tabs, tally, bell, profile
       chip) can still add up to more than the viewport. Letting the topbar
       itself scroll means that content stays reachable by a swipe instead
       of being invisibly cut off on the right.
    */
    overflow-x:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;
  }
  .topbar::-webkit-scrollbar{display:none;}
  .brand{display:flex;align-items:center;gap:9px;font-family:var(--font-display);font-weight:800;font-size:1.05rem;letter-spacing:.01em;}
  .brand .logo-mark{font-size:30px;}
  .board-tabs{display:flex;gap:4px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-lg);padding:3px;margin-left:8px;}
  .board-tab{
    border:none;background:transparent;padding:7px 16px;border-radius:var(--radius-md);
    font-weight:700;font-size:.85rem;color:var(--text-muted);cursor:pointer;
    transition:background .15s ease, color .15s ease;
  }
  .board-tab.active{background:var(--primary);color:var(--on-primary);}
  .board-tab{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}
  .board-tab.dragging{opacity:.85;box-shadow:0 4px 14px rgba(0,0,0,.35);transform:translateY(-1px);cursor:grabbing;position:relative;z-index:2;}
  .board-tabs.reordering{cursor:grabbing;}
  .topbar-spacer{flex:1;}
  .done-tally-wrap{position:relative;flex-shrink:0;}
  .done-tally{
    display:flex;align-items:center;gap:11px;white-space:nowrap;cursor:pointer;
    padding:5px 15px 5px 7px;border-radius:var(--radius-md);font:inherit;color:var(--text);
    background:linear-gradient(180deg, var(--surface-2), color-mix(in srgb, var(--accent) 8%, var(--surface-2)));
    border:1px solid var(--border);transition:border-color .12s ease, box-shadow .12s ease, transform .12s ease;
  }
  .done-tally:hover{border-color:var(--accent);}
  .done-tally .dt-burst{
    width:30px;height:30px;border-radius:50%;flex-shrink:0;
    background:var(--primary);color:var(--on-primary);
    display:flex;align-items:center;justify-content:center;font-size:1rem;font-weight:900;
    box-shadow:0 0 0 3px color-mix(in srgb, var(--primary) 22%, transparent);
  }
  .done-tally .dt-col{display:flex;flex-direction:column;align-items:flex-start;line-height:1;}
  .done-tally .dt-n{
    font-family:var(--font-display);font-size:1.3rem;font-weight:800;letter-spacing:-.01em;
    color:var(--accent-hover);
  }
  .done-tally .dt-cap{font-size:.55rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint);margin-top:2px;}
  .done-tally .dt-div{width:1px;align-self:stretch;background:var(--border);margin:3px 0;}
  /* Third column: shared tasks the other person finished — reads distinct from your own. */
  .done-tally .dt-shared .dt-n{font-size:1.05rem;color:var(--text-muted);display:flex;align-items:center;gap:3px;}
  @keyframes dtPop{ 0%{transform:scale(1);} 28%{transform:scale(1.14);} 55%{transform:scale(.97);} 100%{transform:scale(1);} }
  @keyframes dtGlow{ 0%{box-shadow:0 0 0 0 color-mix(in srgb, var(--accent) 65%, transparent);} 100%{box-shadow:0 0 0 14px transparent;} }
  .done-tally.dt-pop{ animation:dtPop .5s ease, dtGlow .9s ease-out; }
  .done-tally.dt-pop .dt-burst{ animation:dtPop .5s ease .04s; }
  /* Every 10th completion this week: full-screen confetti rain + party Hibou. */
  .owl-party{position:fixed;inset:0;z-index:9990;display:flex;align-items:center;justify-content:center;padding:16px;
    background:radial-gradient(circle at 50% 45%, rgba(230,187,10,.28), rgba(11,43,29,.55) 70%);cursor:pointer;
    animation:owlFade .35s ease both;}
  .owl-party.out{animation:owlFade .45s ease reverse both;}
  .owl-party-card{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;
    background:#fff;border-radius:var(--radius-lg);padding:18px 22px 20px;width:min(380px,100%);
    box-shadow:0 24px 60px rgba(0,0,0,.35), 0 0 0 6px color-mix(in srgb, var(--accent) 70%, transparent);
    animation:owlPopIn .7s cubic-bezier(.2,1.6,.4,1) both;}
  .owl-party-card img{width:100%;height:auto;display:block;transform-origin:50% 90%;animation:owlDance 1.1s ease-in-out .6s infinite;}
  .owl-party-count{font-family:var(--font-display);font-weight:900;font-size:4rem;line-height:1;color:#0f3f2a;
    animation:owlCount .6s cubic-bezier(.2,1.8,.4,1) .45s both;}
  .owl-party-cap{font-family:var(--font-display);font-weight:800;font-size:1.05rem;color:#5c7a6c;text-transform:uppercase;letter-spacing:.08em;text-align:center;}
  @keyframes owlFade{ from{opacity:0;} to{opacity:1;} }
  @keyframes owlPopIn{ 0%{transform:scale(.2) rotate(-14deg);opacity:0;} 100%{transform:scale(1) rotate(0);opacity:1;} }
  @keyframes owlDance{ 0%,100%{transform:rotate(-5deg) translateY(0);} 25%{transform:rotate(0) translateY(-10px);} 50%{transform:rotate(5deg) translateY(0);} 75%{transform:rotate(0) translateY(-10px);} }
  @keyframes owlCount{ 0%{transform:scale(0);} 100%{transform:scale(1);} }
  @media (prefers-reduced-motion: reduce){ .owl-party,.owl-party-card,.owl-party-card img,.owl-party-count{animation:none;} }

  .done-tally-panel{
    /* Fixed (not absolute) so it isn't clipped by .topbar's own
       overflow-x:auto (the mobile horizontal-scroll safety net below —
       overflow-x set to anything but visible forces overflow-y to auto
       too, which was cutting this panel off since it pops out past the
       topbar's bottom edge). top/right are set in JS from the button's
       getBoundingClientRect() whenever the panel opens or the window
       resizes — see syncHeaderPanelPositions(). */
    position:fixed;z-index:60;width:290px;
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
    box-shadow:var(--shadow-lg);padding:6px;
    opacity:0;transform:translateY(-6px);pointer-events:none;
    transition:opacity .12s ease, transform .12s ease;
    max-height:min(64vh,440px);overflow-y:auto;
  }
  .done-tally-panel::before{content:"";position:absolute;left:0;right:0;top:-10px;height:10px;}  /* hover bridge */
  .done-tally-wrap:hover .done-tally-panel,
  .done-tally-wrap.open .done-tally-panel{ opacity:1;transform:translateY(0);pointer-events:auto; }
  .dtp-head{font-family:var(--font-display);font-weight:800;font-size:.9rem;padding:8px 8px 9px;color:var(--text);}
  .dtp-group{font-size:.58rem;font-weight:800;text-transform:uppercase;letter-spacing:.07em;color:var(--text-faint);padding:9px 8px 4px;}
  .dtp-row{
    display:flex;align-items:center;gap:9px;width:100%;text-align:left;font:inherit;
    border:none;background:none;cursor:pointer;padding:8px;border-radius:var(--radius-sm);color:var(--text);
  }
  .dtp-row:hover{background:var(--primary-tint-2);}
  .dtp-tick{color:var(--primary);font-weight:900;flex-shrink:0;font-size:.85rem;}
  .dtp-shared .dtp-tick{font-size:.8rem;}
  .dtp-shared .dtp-when{max-width:44%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .dtp-title{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.82rem;font-weight:600;}
  .dtp-when{flex-shrink:0;font-size:.67rem;color:var(--text-muted);font-weight:600;}
  .dtp-empty{padding:18px 12px;font-size:.82rem;color:var(--text-muted);text-align:center;line-height:1.6;}

  /* Header bell — shared-item activity */
  .notif-wrap{position:relative;flex-shrink:0;}
  .notif-bell{position:relative;font-size:1rem;line-height:1;}
  .notif-bell.dt-pop{ animation:dtPop .5s ease, dtGlow .9s ease-out; }
  .notif-badge{
    position:absolute;top:-5px;right:-5px;min-width:16px;height:16px;padding:0 4px;
    border-radius:999px;background:var(--danger);color:#fff;font-size:.62rem;font-weight:800;
    display:flex;align-items:center;justify-content:center;border:1.5px solid var(--surface);
  }
  .notif-panel{
    /* Fixed, not absolute — see the matching comment on .done-tally-panel
       above; same clipping issue, same fix. */
    position:fixed;z-index:60;width:320px;
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
    box-shadow:var(--shadow-lg);padding:6px;
    opacity:0;transform:translateY(-6px);pointer-events:none;
    transition:opacity .12s ease, transform .12s ease;
    max-height:min(70vh,480px);overflow-y:auto;
  }
  .notif-panel::before{content:"";position:absolute;left:0;right:0;top:-10px;height:10px;}
  .notif-wrap.open .notif-panel{ opacity:1;transform:translateY(0);pointer-events:auto; }
  .np-head{
    display:flex;align-items:center;justify-content:space-between;gap:8px;
    font-weight:800;font-size:.78rem;padding:8px 8px 9px;color:var(--text);
  }
  .np-head button{
    border:none;background:none;color:var(--primary);font:inherit;font-size:.72rem;font-weight:700;
    cursor:pointer;padding:2px 4px;
  }
  .np-row{
    display:flex;align-items:flex-start;gap:9px;width:100%;text-align:left;font:inherit;
    border:none;background:none;cursor:pointer;padding:9px 8px;border-radius:var(--radius-sm);color:var(--text);
  }
  .np-row:hover{background:var(--primary-tint-2);}
  .np-row.unread{background:color-mix(in srgb, var(--primary) 8%, var(--surface));}
  .np-avatar{
    flex-shrink:0;width:24px;height:24px;border-radius:50%;color:#fff;font-size:.66rem;font-weight:800;
    display:flex;align-items:center;justify-content:center;margin-top:1px;
  }
  .np-body{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;}
  .np-text{font-size:.8rem;line-height:1.4;font-weight:500;overflow-wrap:anywhere;}
  .np-when{font-size:.66rem;color:var(--text-muted);font-weight:600;}
  .np-dot{flex-shrink:0;width:7px;height:7px;border-radius:50%;background:var(--primary);margin-top:6px;}
  .np-empty{padding:20px 14px;font-size:.8rem;color:var(--text-muted);text-align:center;line-height:1.6;}
  /* Samantha's bell carries every notification (server/bell.js): the Hub's own rows get an icon, a second line, and the version row */
  .np-avatar.np-ico{background:var(--surface-2, var(--primary-tint-2));color:var(--text);font-size:.8rem;}
  .np-sub{font-size:.74rem;line-height:1.35;color:var(--text-muted);white-space:pre-line;overflow-wrap:anywhere;
    display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;}
  .np-ver{display:flex;align-items:center;gap:9px;width:100%;text-align:left;font:inherit;color:var(--text);
    margin:0 0 4px;padding:8px;border:none;border-radius:var(--radius-sm);background:var(--primary-tint-2);font-size:.78rem;}
  .np-ver .np-text{font-size:.78rem;}
  .np-ver-ico{flex-shrink:0;width:24px;text-align:center;font-weight:800;color:var(--primary);}
  button.np-ver{cursor:pointer;background:color-mix(in srgb, var(--danger) 12%, var(--surface));}
  button.np-ver:hover{background:color-mix(in srgb, var(--danger) 18%, var(--surface));}
  .icon-btn{
    border:1px solid var(--border);background:var(--surface);color:var(--text);
    width:34px;height:34px;border-radius:var(--radius-lg);display:inline-flex;align-items:center;justify-content:center;
    cursor:pointer;transition:background .15s ease,border-color .15s ease;
  }
  .icon-btn:hover{background:var(--surface-2);border-color:var(--border-strong);}
  .profile-chip{
    display:flex;align-items:center;gap:8px;border:1px solid var(--border);
    background:var(--surface-2);border-radius:var(--radius-md);padding:5px 12px 5px 5px;cursor:pointer;
  }
  .profile-chip .avatar{width:26px;height:26px;font-size:.7rem;}
  .profile-chip .who{font-size:.82rem;font-weight:700;}
  .profile-chip .role-tag{font-size:.65rem;color:var(--text-muted);font-weight:600;text-transform:uppercase;letter-spacing:.04em;}
  /* Header "Help" button + the Hibou IT-request board it opens. */
  @media (min-width:861px){ .icon-btn.wide-hide{display:none;} }
  .help-btn{width:auto;gap:5px;padding:0 11px;font-size:.8rem;font-weight:700;white-space:nowrap;flex-shrink:0;}
  .help-hero{display:flex;align-items:center;gap:16px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:12px 16px;}
  /* The art has a white background, so it always sits on its own white disc
     (reads as a badge in dark mode rather than a stray white box). */
  .help-hero img{width:132px;height:132px;object-fit:contain;flex-shrink:0;background:#fff;border-radius:50%;padding:6px;box-shadow:var(--shadow-sm, 0 1px 3px rgba(0,0,0,.12));}
  .help-hero h2{margin:0 0 4px;font-size:1.3rem;font-weight:800;}
  .help-hero p{margin:0;font-size:.8rem;color:var(--text-muted);line-height:1.45;}
  .help-form{display:flex;flex-direction:column;gap:12px;}
  .help-form textarea{min-height:96px;resize:vertical;font:inherit;}
  .help-err{font-size:.78rem;font-weight:700;color:var(--rank-p);}
  .help-list{display:flex;flex-direction:column;gap:6px;max-height:34vh;overflow-y:auto;}
  .help-row{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px 10px;}
  .help-row-top{display:flex;align-items:center;gap:8px;}
  .help-row-top .rank-chip{width:auto;min-width:52px;padding:0 7px;font-size:.64rem;margin-top:0;}
  .help-row-title{flex:1;min-width:0;font-weight:700;font-size:.86rem;overflow-wrap:anywhere;}
  .help-row-meta{font-size:.68rem;color:var(--text-muted);font-weight:600;margin-top:3px;}
  .help-all{margin-top:10px;align-self:flex-start;}
  .help-row-scope{font-size:.76rem;color:var(--text-muted);margin-top:4px;white-space:pre-wrap;overflow-wrap:anywhere;}
  [data-helpdesk-view] .help-list{max-height:none;overflow:visible;}
  .help-row-how{font-size:.76rem;margin-top:4px;white-space:pre-wrap;overflow-wrap:anywhere;}
  .help-row-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:8px;}
  .help-resolve{margin-top:8px;display:flex;flex-direction:column;gap:6px;}
  .help-resolve textarea{min-height:72px;resize:vertical;font:inherit;font-size:.9rem;width:100%;box-sizing:border-box;padding:9px 11px;border:1.5px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-1);color:var(--text);}
  .help-resolve textarea:focus{outline:none;border-color:var(--primary);}
  .help-status{font-size:.64rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;padding:2px 7px;border-radius:var(--radius-sm);white-space:nowrap;}
  .help-status.open{background:var(--rank-a-tint);color:#8a6d00;}
  .help-status.done{background:var(--rank-b-tint);color:var(--rank-b);}
  .help-status.closed,.help-status.cancelled{background:var(--surface);color:var(--text-muted);border:1px solid var(--border);}
  /* the asker's own request: Edit / Completed / Cancel while open, Hide once finished */
  .help-list.editing{max-height:none;overflow:visible;}
  .help-mine{flex-wrap:wrap;}
  .help-mine .btn{min-height:36px;padding:6px 12px;font-size:.8rem;}
  .help-edit input[type=text]{font:inherit;font-size:.9rem;width:100%;box-sizing:border-box;padding:9px 11px;border:1.5px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-1);color:var(--text);}
  .help-edit input[type=text]:focus{outline:none;border-color:var(--primary);}
  .help-edit .hm-label{font-size:.7rem;font-weight:800;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;}
  .help-edit .rank-pick-btn{padding:7px 2px;font-size:.78rem;}
  .help-ask{font-size:.8rem;font-weight:600;}
  /* screenshots and files on a request: the form's picker (also paste / drop) and each row's chips */
  .help-files{display:flex;flex-direction:column;gap:8px;}
  .help-files.drag .attach-drop{border-color:var(--primary);color:var(--primary);}
  .help-row-files{margin-top:6px;gap:6px;}
  .help-row-files .attach-chip{padding:4px 8px;font-size:.72rem;max-width:100%;}
  .help-row-files .attach-dl{overflow-wrap:anywhere;}
  /* the Request board's "Hide completed" filter, top right of the list (prefs.helpHideDone) */
  .help-board-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;}
  .help-board-head .completed-group-title{margin:0;}
  .help-board-head .shared-switch{margin-left:0;}
  .help-done-title{font-size:.7rem;font-weight:800;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;margin:8px 2px 0;}
  /* a request Patrick promoted to William (server/william.js): its case and stage */
  .help-case{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:6px;font-size:.74rem;font-weight:700;color:var(--primary);}
  .help-case .help-bar{display:inline-grid;grid-template-columns:repeat(5,14px);gap:2px;}
  .help-case .help-bar i{height:5px;border-radius:2px;background:var(--border);}
  .help-case .help-bar i.on{background:var(--primary);}
  .help-case .help-bar.done i{background:var(--rank-b);}
  .help-fix{margin-top:6px;display:flex;flex-direction:column;gap:4px;font-size:.76rem;white-space:pre-wrap;overflow-wrap:anywhere;}
  .help-promote .seg{display:flex;gap:6px;flex-wrap:wrap;}
  .help-promote .seg button{border:1.5px solid var(--border);background:var(--surface-2);color:var(--text);border-radius:var(--radius-sm);padding:7px 14px;font:inherit;font-weight:700;cursor:pointer;min-height:36px;}
  .help-promote .seg button.on{border-color:var(--primary);color:var(--primary);background:var(--bg-1);}
  .help-promote select,.help-promote textarea{font:inherit;font-size:max(16px,.9rem);width:100%;box-sizing:border-box;padding:9px 11px;border:1.5px solid var(--border);border-radius:var(--radius-sm);background:var(--bg-1);color:var(--text);}
  .help-promote textarea{min-height:80px;resize:vertical;}
  .help-promote label.tick{display:flex;gap:8px;align-items:center;font-size:.86rem;font-weight:600;}

  .body-row{flex:1;display:flex;min-height:0;}

  /* ============ LHSNB ============ */
  .lhsnb{
    width:194px;flex-shrink:0;background:var(--bg-1);border-right:1px solid var(--border);
    padding:16px 9px;display:flex;flex-direction:column;gap:14px;
    transition:width .15s ease, padding .15s ease;overflow:hidden;
  }
  .lhsnb.collapsed{width:0;padding-left:0;padding-right:0;border-right:none;}
  .lhsnb-title{font-size:.68rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--text-faint);padding:0 5px;}
  .lhsnb-item{
    position:relative;display:flex;align-items:center;gap:8px;padding:7px 8px 7px 17px;border-radius:var(--radius-sm);
    font-size:.85rem;font-weight:600;color:var(--text);cursor:pointer;border:1px solid transparent;
    white-space:nowrap;
  }
  .lhsnb-item:hover{background:var(--surface);border-color:var(--border);}
  .lhsnb-item.active{background:var(--primary-tint);color:var(--primary-hover);}
  .lhsnb-item .lhsnb-drag{
    position:absolute;left:4px;top:50%;transform:translateY(-50%);
    color:var(--text-faint);font-size:.8rem;line-height:1;cursor:grab;
    opacity:0;transition:opacity .12s ease;
  }
  .lhsnb-item:hover .lhsnb-drag{opacity:.65;}
  .lhsnb-item .lhsnb-drag svg{width:9px;height:14px;display:block;}
  .lhsnb-item .lhsnb-drag circle{fill:currentColor;}
  .lhsnb-item .lhsnb-ico{display:inline-flex;flex-shrink:0;color:var(--text-faint);}
  .lhsnb-item .lhsnb-ico svg{
    width:17px;height:17px;fill:none;stroke:currentColor;
    stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;
  }
  .lhsnb-item:hover .lhsnb-ico{color:var(--text-muted);}
  .lhsnb-item.active .lhsnb-ico{color:var(--primary-hover);}
  .lhsnb-item .lhsnb-label{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;}
  .lhsnb-item .lhsnb-badge{margin-left:auto;align-self:center;}
  .lhsnb-item.dragging{opacity:.4;}
  .lhsnb-item.drop-above{box-shadow:0 -2px 0 var(--primary);}
  .lhsnb-item.drop-below{box-shadow:0 2px 0 var(--primary);}
  .lhsnb-empty{font-size:.76rem;color:var(--text-faint);padding:6px 6px;line-height:1.5;}


  /* ============ BOARD ============ */
  .board-wrap{flex:1;min-width:0;display:flex;flex-direction:column;}
  .board-header{
    display:flex;align-items:center;gap:10px;padding:14px 20px 10px;
  }
  .board-header h1{font-size:1.3rem;margin:0;font-weight:700;}
  .board-header .sub{font-size:.8rem;color:var(--text-muted);}
  /* Samantha's Delegated switch (SHARED_OFF): items delegated to someone else stay off her boards until she turns it on. */
  .shared-switch{display:inline-flex;align-items:center;gap:5px;min-height:36px;margin-left:8px;padding:3px 12px;border:1px solid var(--border);border-radius:999px;background:var(--surface);color:var(--text-muted);font:inherit;font-size:.78rem;font-weight:600;cursor:pointer;white-space:nowrap;vertical-align:middle;}
  .shared-switch b{color:var(--text);}
  .shared-switch.on{border-color:var(--primary);color:var(--text);}
  .shared-switch.on b{color:var(--primary);}
  .shared-switch[disabled]{cursor:default;opacity:.6;}
  /* Samantha's Personal / Work: Overview | Board above the title of both (renderOverviewSwitch) */
  .ov-switch-row{display:flex;padding:14px 20px 0;}
  .ov-switch-row + .board-header{padding-top:8px;}
  .view-toggle.ov-switch{margin-left:0;}
  .view-toggle.ov-switch button{min-height:36px;min-width:96px;padding:6px 18px;font-size:.86rem;}
  .view-toggle.ov-switch button:focus-visible{outline:2px solid var(--primary);outline-offset:1px;}
  /* Directory users (sub-boards): the board menu as chips under the title. */
  .board-tabs-none{display:none;}
  .board-menu-row{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;padding:0 20px 8px;}
  .board-menu-row::-webkit-scrollbar{display:none;}
  .board-menu-chip, .head-pending{
    display:inline-flex;align-items:center;gap:6px;flex:0 0 auto;border:1.5px solid var(--border);background:var(--bg-1);
    border-radius:999px;padding:5px 11px;font:inherit;font-size:.78rem;font-weight:700;color:var(--text-muted);cursor:pointer;white-space:nowrap;
  }
  .board-menu-chip:hover, .head-pending:hover{border-color:var(--primary);color:var(--text);}
  .board-menu-chip.active{background:var(--primary-tint);border-color:var(--primary);color:var(--primary-hover);}
  .board-menu-chip .lhsnb-ico, .head-pending .lhsnb-ico{display:inline-flex;}
  .board-menu-chip .lhsnb-ico svg, .head-pending .lhsnb-ico svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
  .board-menu-chip .lhsnb-badge, .head-pending .lhsnb-badge{margin-left:2px;}
  /* Samantha's Pending in the top bar (pendingHeadPill): a board-menu chip's look, its own class so nothing takes it for one */
  .topbar > .head-pending, .hub-view-head > .head-pending{flex-shrink:0;}
  /* Today's copy on a phone: the clock and the count, so the bell, tally, eye and owl still fit */
  @media (max-width: 600px){
    .hub-view-head > .head-pending{padding:5px 8px;gap:4px;}
    .hub-view-head > .head-pending .head-pending-word{display:none;}
  }
  @media (max-width: 440px){   /* nine things in the head: closer together so it still fits at 360px */
    .hub-view-head:has(> .head-pending){gap:4px;padding:0 10px;}
    .hub-view-head:has(> .head-pending) .hub-view-title{flex-shrink:0;}
    .hub-view-head:has(> .head-pending) .hub-view-title > span:last-child{display:none;}   /* the calendar icon says Today; no clipped "T…" */
  }
  @media (max-width: 380px){ .hub-view-head:has(> .head-pending) .hub-view-title{display:none;} }
  /* Samantha's Pending list rows with Completed (renderPendingBody): on a phone the three buttons go under the text */
  .pending-acts{display:flex;gap:6px;flex:0 0 auto;}
  @media (max-width:600px){
    .quicklist-row.pending-row{flex-wrap:wrap;}
    .pending-row .pending-acts{flex:1 1 100%;justify-content:flex-end;}
  }
  .board-search-wrap{position:relative;flex:1 1 220px;min-width:140px;max-width:360px;}
  .board-search-input{
    width:100%;border:1.5px solid var(--border);border-radius:var(--radius-md);padding:7px 30px 7px 12px;
    font:inherit;font-size:.82rem;background:var(--bg-1);color:var(--text);
  }
  .board-search-input:focus{outline:none;border-color:var(--primary);}
  .board-search-wrap .close-x{position:absolute;right:4px;top:50%;transform:translateY(-50%);font-size:1rem;}
  .board-search-results{padding:12px 20px 20px;max-width:820px;}
  .header-actions{margin-left:auto;display:flex;align-items:center;gap:8px;}
  .add-menu-wrap{position:relative;}
  .dictate-btn{position:relative;}
  .dictate-btn.listening{background:var(--danger-tint);border-color:var(--danger);color:var(--danger);animation:micPulse 1.4s ease-in-out infinite;}
  @keyframes micPulse{
    0%{box-shadow:0 0 0 0 rgba(192,57,43,.35);}
    70%{box-shadow:0 0 0 9px rgba(192,57,43,0);}
    100%{box-shadow:0 0 0 0 rgba(192,57,43,0);}
  }
  .dictate-panel{display:flex;flex-direction:column;gap:14px;align-items:center;text-align:center;padding:6px 4px 2px;}
  .dictate-board-switch{margin-left:0;align-self:center;}
  .dictate-type-row{display:flex;gap:8px;width:100%;}
  .dictate-type-row button{
    flex:1;border:1.5px solid var(--border);background:var(--bg-1);border-radius:var(--radius-md);
    padding:14px 6px;font-size:.85rem;font-weight:700;color:var(--text);cursor:pointer;
    display:flex;flex-direction:column;align-items:center;gap:6px;
  }
  .dictate-type-row button:hover{border-color:var(--primary);color:var(--primary);}
  .dictate-type-row .dot{width:10px;height:10px;}
  .dictate-mic-big{
    width:64px;height:64px;border-radius:50%;background:var(--surface-2);color:var(--text-muted);
    display:flex;align-items:center;justify-content:center;font-size:1.8rem;flex-shrink:0;
  }
  .dictate-mic-big.listening{
    background:var(--danger);color:#fff;
    animation:micPulse 1.4s ease-in-out infinite;
  }
  .dictate-status{font-size:.8rem;font-weight:700;color:var(--text-muted);text-transform:uppercase;letter-spacing:.04em;}
  .dictate-transcript{
    min-height:64px;width:100%;border:1.5px solid var(--border);border-radius:var(--radius-sm);
    background:var(--bg-1);padding:12px 14px;font-size:.95rem;color:var(--text);text-align:left;line-height:1.5;
  }
  .dictate-transcript:empty:before{content:"Listening…";color:var(--text-faint);}
  .dictate-transcript .interim{color:var(--text-faint);}
  .dictate-error{font-size:.8rem;color:var(--danger);background:var(--danger-tint);border-radius:var(--radius-sm);padding:10px 12px;width:100%;text-align:left;}
  .dictate-actions{display:flex;gap:8px;width:100%;}
  .dictate-actions button{flex:1;}
  .add-btn{
    width:38px;height:38px;border-radius:var(--radius-lg);border:none;background:var(--primary);color:var(--on-primary);
    font-size:1.4rem;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;
    box-shadow:var(--shadow-sm);transition:background .15s ease, transform .1s ease;
  }
  .add-btn:hover{background:var(--primary-hover);transform:translateY(-1px);}
  /* Per-column "new item of this type" button, sits in each column header */
  .col-add{
    margin-left:auto;flex-shrink:0;width:26px;height:26px;border-radius:var(--radius-lg);border:none;
    background:var(--primary);color:var(--on-primary);font-size:1.1rem;line-height:1;cursor:pointer;
    display:flex;align-items:center;justify-content:center;transition:background .15s ease, transform .1s ease;
  }
  .col-add:hover{background:var(--primary-hover);transform:translateY(-1px);}
  .col-add + .col-chevron{margin-left:6px;}
  .add-dropdown{
    position:absolute;right:0;top:46px;background:var(--surface);border:1px solid var(--border);
    border-radius:var(--radius-md);box-shadow:var(--shadow-lg);padding:6px;min-width:170px;z-index:30;
  }
  .add-dropdown button{
    display:flex;align-items:center;gap:9px;width:100%;text-align:left;border:none;background:none;
    padding:9px 10px;border-radius:var(--radius-sm);font-size:.86rem;font-weight:600;color:var(--text);cursor:pointer;
  }
  .add-dropdown button:hover{background:var(--primary-tint-2);}
  .dot{width:9px;height:9px;border-radius:50%;flex-shrink:0;}

  .columns{
    flex:1;display:flex;gap:0;padding:0 16px 16px;min-height:0;
  }
  .column{
    display:flex;flex-direction:column;min-width:0;background:var(--tile-bg);
    border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;
    box-shadow:var(--shadow-sm);
  }
  .column + .resizer + .column{}
  .resizer{
    width:14px;flex-shrink:0;cursor:col-resize;position:relative;display:flex;align-items:center;justify-content:center;
  }
  .resizer::after{content:"";width:3px;height:32px;border-radius:3px;background:var(--border-strong);}
  .resizer:hover::after,.resizer.active::after{background:var(--primary);}
  .column-header{
    display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--border);
    background:var(--surface);position:relative;
  }
  .col-add-menu{
    position:absolute;right:10px;top:calc(100% + 3px);z-index:40;
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
    box-shadow:var(--shadow-lg);padding:6px;min-width:190px;
  }
  .col-add-menu button{
    display:flex;align-items:center;gap:9px;width:100%;text-align:left;border:none;background:none;
    padding:9px 10px;border-radius:var(--radius-sm);font-size:.85rem;font-weight:600;color:var(--text);cursor:pointer;
  }
  .col-add-menu button:hover{background:var(--primary-tint-2);}
  .col-add-menu .ta-hint{margin-left:auto;font-size:.66rem;font-weight:600;color:var(--text-faint);}
  .column-header h2{font-size:.86rem;margin:0;font-weight:800;letter-spacing:.02em;}
  /* Collapsible tiles (all viewports). The wrapper around toolbar + body is a
     grid whose single row animates 1fr -> 0fr; flex:1 only while open so a
     collapsed column shrinks to just its header. On phones every column also
     starts collapsed on load (see loadColCollapsed). */
  .column-header{cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;}
  .column-collapse{
    display:grid;grid-template-rows:1fr;min-height:0;
    transition:grid-template-rows .28s ease;
  }
  .column:not(.collapsed) .column-collapse{flex:1;}
  .column.collapsed .column-collapse{grid-template-rows:0fr;}
  .column-collapse-inner{display:flex;flex-direction:column;min-height:0;overflow:hidden;}
  .column.collapsed .column-header{border-bottom:none;}
  .col-chevron{
    display:block;margin-left:auto;flex-shrink:0;width:18px;height:18px;color:var(--text-muted);
    transition:transform .22s ease;
  }
  .column:not(.collapsed) .col-chevron{transform:rotate(180deg);}
  @media (prefers-reduced-motion: reduce){ .column-collapse{transition:none;} }
  .column-count{
    font-size:.7rem;font-weight:700;color:var(--text-muted);background:var(--surface-2);
    border-radius:var(--radius-sm);padding:1px 8px;
  }
  .view-toggle{margin-left:auto;display:flex;gap:2px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:2px;}
  .view-toggle button{
    border:none;background:transparent;font-size:.7rem;font-weight:700;padding:4px 9px;border-radius:var(--radius-sm);cursor:pointer;color:var(--text-muted);
  }
  .view-toggle button.active{background:var(--primary);color:var(--on-primary);}
  /* Reminders list time-window filter (Day / Week / Month / All) */
  .rem-range{
    display:flex;gap:3px;background:var(--surface-2);border:1px solid var(--border);
    border-radius:var(--radius-md);padding:3px;position:sticky;top:0;z-index:2;flex-shrink:0;
  }
  .rem-range button{
    flex:1;border:none;background:transparent;color:var(--text-muted);cursor:pointer;
    font-size:.72rem;font-weight:700;padding:5px 4px;border-radius:var(--radius-sm);line-height:1;
  }
  .rem-range button:hover{color:var(--text);}
  .rem-range button.active{background:var(--primary);color:var(--on-primary);}
  .column-toolbar{display:flex;gap:6px;padding:8px 10px;border-bottom:1px solid var(--border);background:var(--surface);}
  .col-search{
    flex:1;min-width:0;border:1.5px solid var(--border);border-radius:var(--radius-md);padding:6px 12px;
    font-size:.78rem;background:var(--bg-1);color:var(--text);
  }
  .col-search:focus{outline:none;border-color:var(--primary);}
  .filter-btn{
    border:1.5px solid var(--border);background:var(--bg-1);color:var(--text-muted);border-radius:var(--radius-md);
    padding:6px 11px;font-size:.78rem;cursor:pointer;display:flex;align-items:center;gap:5px;white-space:nowrap;
  }
  .filter-btn:hover{border-color:var(--border-strong);}
  .filter-btn.active{border-color:var(--primary);color:var(--primary);background:var(--primary-tint-2);}
  .filter-badge{
    background:var(--primary);color:var(--on-primary);border-radius:999px;font-size:.64rem;font-weight:800;
    padding:0 5px;min-width:15px;text-align:center;line-height:1.5;
  }
  .filter-popover{
    position:absolute;right:0;top:36px;background:var(--surface);border:1px solid var(--border);
    border-radius:var(--radius-md);box-shadow:var(--shadow-lg);padding:10px;min-width:190px;z-index:35;
    max-height:280px;overflow-y:auto;
  }
  .filter-group + .filter-group{margin-top:8px;padding-top:8px;border-top:1px solid var(--border);}
  .filter-group-title{font-size:.65rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint);margin-bottom:5px;}
  .filter-check{display:flex;align-items:center;gap:7px;font-size:.8rem;padding:3px 2px;color:var(--text);cursor:pointer;}
  .filter-check input{width:14px;height:14px;flex-shrink:0;}
  .column-body{flex:1;min-height:0;overflow-y:auto;padding:10px;display:flex;flex-direction:column;gap:8px;}

  /* ---- Pinned-to-top strip (Projects + Tasks tiles, either board) ----
     Sits outside .column-collapse so pinned cards stay visible when the tile
     is minimized. */
  .pinned-strip{
    flex-shrink:0;display:flex;flex-direction:column;gap:8px;
    padding:8px 10px 10px;background:var(--surface-2);border-bottom:1px solid var(--border);
    max-height:70vh;overflow-y:auto;
  }
  .pinned-strip-label{
    font-size:.6rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;
    color:var(--text-muted);display:flex;align-items:center;gap:4px;
  }
  .pin-btn{
    position:absolute;top:5px;right:5px;border:none;background:none;cursor:pointer;
    font-size:.82rem;line-height:1;padding:3px;opacity:.22;filter:grayscale(1);
    transition:opacity .12s ease;
  }
  .card:hover .pin-btn{opacity:.55;}
  .pin-btn.on{opacity:1;filter:none;}
  /* Expand a card in place (Projects + Tasks): ⤢ beside the pin. Per-device. */
  .xp-btn{
    position:absolute;top:5px;right:27px;border:none;background:none;cursor:pointer;
    font-size:.82rem;line-height:1;padding:3px;opacity:.35;color:var(--text);
    transition:opacity .12s ease;
  }
  .card:hover .xp-btn,.xp-btn.on{opacity:.85;}
  @media (max-width:860px){ .xp-btn{opacity:.6;} }
  .card.xp{flex-wrap:wrap;}
  .card.has-xp .title{padding-right:44px;}
  .card-x{flex:0 0 100%;min-width:0;cursor:default;display:flex;flex-direction:column;gap:8px;
    border-top:1px solid var(--border);padding-top:8px;margin-top:2px;}
  .card-x .xp-notes{font-size:.8rem;line-height:1.45;color:var(--text-muted);white-space:pre-wrap;max-height:40vh;overflow-y:auto;word-break:break-word;}
  .card-x .xp-h{font-size:.62rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;color:var(--text-muted);}
  .card-x .xp-kid{font-size:.8rem;display:flex;gap:6px;align-items:baseline;cursor:pointer;}
  .card-x .xp-kid:hover{text-decoration:underline;}
  .card-x .xp-more{font-size:.72rem;color:var(--text-muted);}
  .card-x .lv-wrap{margin:0;padding:8px;}
  @media (max-width:860px){ .pin-btn{opacity:.5;} .card:hover .pin-btn{opacity:.5;} }

  .column-empty{color:var(--text-faint);font-size:.8rem;text-align:center;padding:26px 10px;line-height:1.5;}

  /* ============ CARDS ============ */
  .card{
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
    padding:10px 12px;cursor:pointer;box-shadow:var(--shadow-sm);position:relative;
    display:flex;align-items:flex-start;gap:9px;transition:box-shadow .15s ease, transform .1s ease;
  }
  .card:hover{box-shadow:var(--shadow-md);transform:translateY(-1px);}
  /* Optional per-project tree colour — dashboard cards only (the edit modal
     keeps the standard scheme). --tc is the project's chosen hex. */
  .card.tc{
    border-left:4px solid var(--tc);
    border-color:color-mix(in srgb, var(--tc) 40%, var(--border));
    border-left-color:var(--tc);
    background:color-mix(in srgb, var(--tc) 8%, var(--surface));
  }
  .card.tc.done{background:color-mix(in srgb, var(--tc) 4%, var(--surface));}
  /* Linked-items highlight: a static ring you toggle from a card's "N linked"
     badge (no longer a flash). Coexists with the tree colour. */
  .card.link-hl{box-shadow:0 0 0 2px var(--primary), var(--shadow-sm);}
  .card.link-hl:hover{box-shadow:0 0 0 2px var(--primary), var(--shadow-md);}
  .mini-tag.link-badge.on{background:var(--primary);color:var(--on-primary);text-decoration:none;}
  /* Samantha's hover list beside a card: what it's linked to */
  .lh-pop{position:fixed;z-index:90;width:min(300px,calc(100vw - 16px));max-height:min(60vh,440px);overflow-y:auto;
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);box-shadow:var(--shadow-lg);
    padding:8px;display:flex;flex-direction:column;gap:2px;}
  .lh-h{font-size:.64rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--text-muted);padding:6px 6px 2px;}
  .lh-row{display:flex;align-items:center;gap:7px;width:100%;text-align:left;border:none;background:none;color:var(--text);
    font:inherit;font-size:.82rem;padding:6px;border-radius:var(--radius-md);cursor:pointer;}
  .lh-row:hover,.lh-row:focus-visible{background:var(--primary-tint);}
  .lh-row.lh-sub{padding-left:24px;}
  .lh-ico{flex-shrink:0;width:1.1em;text-align:center;}
  .lh-t{flex:1;min-width:0;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .lh-d{flex-shrink:0;font-size:.7rem;color:var(--text-muted);}
  .lh-note{font-size:.72rem;color:var(--text-faint);padding:6px 6px 2px;}
  .rank-chip{
    flex-shrink:0;width:22px;height:22px;border-radius:var(--radius-md);display:flex;align-items:center;justify-content:center;
    font-family:var(--font-display);font-weight:800;font-size:.72rem;margin-top:1px;
  }
  .card .title{font-size:.87rem;font-weight:600;line-height:1.35;color:var(--text);word-break:break-word;}
  .card .meta-row{display:flex;gap:6px;margin-top:4px;flex-wrap:wrap;}

  /* Completion checkbox + done state */
  .card-check{
    flex-shrink:0;width:18px;height:18px;margin-top:2px;cursor:pointer;
    accent-color:var(--primary);
  }
  .card-check:disabled{cursor:not-allowed;opacity:.4;}
  .card.done{opacity:.66;}
  .card.done .title{text-decoration:line-through;color:var(--text-faint);}
  .quicklist-row.done .qtitle{text-decoration:line-through;color:var(--text-faint);}
  .ql-check{flex-shrink:0;width:15px;height:15px;cursor:pointer;accent-color:var(--primary);}
  .ql-drag{flex-shrink:0;cursor:grab;color:var(--text-faint);font-size:.9rem;line-height:1;user-select:none;padding:0 1px;}
  .ql-drag:active{cursor:grabbing;}
  .quicklist-row[draggable="true"]{cursor:default;}
  .quicklist-row.dragging{opacity:.4;}
  .quicklist-row.drop-above{box-shadow:0 -2px 0 var(--primary);}
  .quicklist-row.drop-below{box-shadow:0 2px 0 var(--primary);}

  /* Project progress bar (project cards + project edit modal) */
  .pj-progress-wrap{display:flex;align-items:center;gap:8px;margin-top:8px;}
  .pj-progress{
    flex:1;height:6px;border-radius:999px;background:var(--surface-2);
    border:1px solid var(--border);overflow:hidden;
  }
  .pj-progress-fill{
    height:100%;border-radius:999px;background:var(--primary);
    transition:width .35s cubic-bezier(.22,.61,.36,1);
  }
  .pj-progress-fill.full{background:var(--rank-b);}
  .pj-pct{font-size:.66rem;font-weight:800;color:var(--text-muted);white-space:nowrap;letter-spacing:.02em;}
  .pj-progress-wrap.lg .pj-progress{height:10px;}
  .pj-progress-wrap.lg .pj-pct{font-size:.78rem;color:var(--text);}
  .completed-group-title{
    font-size:.68rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
    color:var(--text-faint);margin:12px 0 4px;
  }
  .completed-group-title:first-child{margin-top:0;}
  .cmp-editable{cursor:pointer;}
  .cmp-editable:hover{color:var(--primary-hover);}
  .arc-nested{margin-left:18px;border-left:2px solid var(--border);}
  .arc-purge{color:var(--text-faint);font-size:.66rem;font-weight:700;white-space:nowrap;}

  /* Pending (forwarded-email projects) */
  .lhsnb-badge{
    display:inline-block;min-width:16px;padding:0 5px;margin-left:4px;border-radius:999px;
    background:var(--accent);color:var(--on-accent);font-size:.62rem;font-weight:800;text-align:center;
  }
  .ingest-warn{color:var(--danger);font-weight:700;}
  .board-choice{display:flex;gap:8px;}
  .board-choice-btn{
    flex:1;padding:9px 10px;border-radius:var(--radius-sm);border:1.5px solid var(--border);
    background:var(--bg-1);color:var(--text-muted);font-weight:700;font-size:.85rem;cursor:pointer;
  }
  .board-choice-btn.on{background:var(--primary);border-color:var(--primary);color:var(--on-primary);}
  .board-choice.wrap{flex-wrap:wrap;gap:6px;}
  .board-choice.wrap + .board-choice.wrap{margin-top:6px;}
  .board-choice.wrap .board-choice-btn{flex:0 1 auto;min-width:0;max-width:100%;padding:7px 12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .board-choice.wrap .board-choice-btn.sub{font-weight:600;}
  .board-choice-btn:disabled{opacity:.45;cursor:not-allowed;}

  /* Settings */
  .settings-section{margin-top:4px;}
  .settings-section + .settings-section{margin-top:16px;}
  .swatch-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center;}
  .swatch{
    width:30px;height:30px;border-radius:var(--radius-lg);border:2px solid var(--border);cursor:pointer;padding:0;
    box-shadow:var(--shadow-sm);
  }
  .swatch.on{border-color:var(--primary);box-shadow:0 0 0 2px var(--primary);}
  .swatch.removable{
    display:flex;align-items:center;justify-content:center;color:#fff;font-size:1rem;line-height:1;
    text-shadow:0 1px 2px rgba(0,0,0,.55);
  }
  .swatch.removable::after{content:"×";opacity:0;transition:opacity .1s ease;}
  .swatch.removable:hover{border-color:var(--danger);box-shadow:0 0 0 2px var(--danger);}
  .swatch.removable:hover::after{opacity:1;}
  .swatch-none{
    background:var(--surface);color:var(--text-faint);font-size:.9rem;line-height:1;
    display:flex;align-items:center;justify-content:center;border-style:dashed;
  }
  .swatch-custom{position:relative;width:30px;height:30px;border-radius:var(--radius-lg);overflow:hidden;border:2px dashed var(--border-strong);cursor:pointer;padding:0;}
  /* Settings → Board colours: one row per board, name + wheel (+ Default once it has its own colour) */
  .board-bg-list{display:flex;flex-direction:column;gap:4px;}
  .board-bg-row{display:grid;grid-template-columns:minmax(0,1fr) 34px 5.5em;align-items:center;gap:10px;min-height:38px;}
  .board-bg-row.sub{padding-left:calc(18px * var(--depth, 1));}
  .board-bg-row.has-glyph{grid-template-columns:minmax(0,1fr) 34px 34px 5.5em;}
  .board-glyph-btn{width:34px;height:34px;border-radius:8px;border:1px solid var(--border);background:var(--surface);color:var(--text);display:grid;place-items:center;cursor:pointer;padding:0;}
  .board-glyph-btn.is-default{color:var(--text-muted);}
  .board-glyph-btn svg{width:18px;height:18px;}
  .board-glyph-btn:focus-visible,.glyph-opt:focus-visible{outline:2px solid var(--primary);outline-offset:2px;}
  .glyph-emoji{font-size:17px;line-height:1;}
  .glyph-panel{margin:4px 0 10px;padding:10px;border:1px solid var(--border);border-radius:10px;background:var(--surface-2, var(--surface));display:flex;flex-direction:column;gap:10px;}
  .glyph-preview{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:8px;background:var(--surface);color:var(--text);font-size:.92rem;min-height:40px;}
  .glyph-preview-ico{width:20px;height:20px;display:grid;place-items:center;}
  .glyph-preview-ico svg{width:20px;height:20px;}
  .glyph-preview-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .glyph-grid,.glyph-emoji-row{display:grid;grid-template-columns:repeat(auto-fill,minmax(38px,1fr));gap:4px;}
  .glyph-grid{max-height:220px;overflow-y:auto;}
  .glyph-opt{height:38px;border-radius:8px;border:1px solid transparent;background:none;color:var(--text);display:grid;place-items:center;cursor:pointer;padding:0;}
  .glyph-opt svg{width:20px;height:20px;}
  .glyph-opt:hover{background:var(--surface);}
  .glyph-opt.on{border-color:var(--primary);background:var(--surface);}
  .glyph-emoji-in{width:100%;}
  .glyph-actions{display:flex;align-items:center;gap:8px;}
  /* Share With (Samantha): who "Share with …" offers on that board's items — a small line under the
     board's name, by its wheel; tap it for a tick box per person */
  .board-bg-cell{display:flex;flex-direction:column;align-items:flex-start;min-width:0;gap:1px;}
  .board-bg-cell .board-bg-name{max-width:100%;}
  .board-share{position:relative;max-width:100%;}
  .board-share-btn{appearance:none;border:0;background:none;padding:1px 0;font:inherit;font-size:.76rem;color:var(--primary);cursor:pointer;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;}
  .board-share-btn:hover{text-decoration:underline;}
  .board-share-btn:focus-visible{outline:2px solid var(--primary);outline-offset:2px;border-radius:4px;}
  .board-share-pop{position:absolute;left:0;top:calc(100% + 4px);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-lg);padding:10px;min-width:210px;z-index:35;}
  .board-share-pop[hidden]{display:none;}
  .field .board-share-pop label.filter-check{font-size:.88rem;font-weight:500;text-transform:none;letter-spacing:0;color:var(--text);padding:5px 2px;}
  .board-share-pop .created-note{margin-top:6px;}
  .board-bg-name{font-size:.92rem;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .board-bg-row.sub .board-bg-name{color:var(--text-muted);}
  .board-bg-wheel{
    position:relative;width:34px;height:34px;border-radius:50%;border:none;padding:0;cursor:pointer;box-shadow:var(--shadow-sm);
    background:conic-gradient(#e5484d,#f5a524,#e9d63a,#46a758,#12a594,#3e63dd,#8e4ec6,#d6409f,#e5484d);
  }
  .board-bg-wheel::after{content:"";position:absolute;inset:7px;border-radius:50%;background:var(--c, var(--surface));box-shadow:0 0 0 2px var(--surface);}
  .board-bg-wheel:focus-visible{outline:2px solid var(--primary);outline-offset:2px;}
  .board-bg-reset{justify-self:start;font-size:.8rem;padding:4px 8px;}
  .board-bg-reset[hidden]{display:none;}
  /* Settings → Sub-boards (Samantha): a name box per life area + Delete, then a box to add one */
  .sub-board-list{display:flex;flex-direction:column;gap:6px;}
  .sub-board-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;}
  .sub-board-row.sub{padding-left:calc(18px * (var(--depth, 1) - 1));}
  .sub-board-root{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:.75rem;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:var(--text-faint);margin:6px 0 0;}
  .sub-board-plus{flex:none;width:36px;height:36px;border-radius:50%;border:1px solid var(--border);background:var(--surface);color:var(--text);font-size:1.25rem;line-height:1;cursor:pointer;display:grid;place-items:center;padding:0;}
  .sub-board-plus:hover{border-color:var(--border-strong);}
  .sub-board-plus[aria-expanded="true"]{border-color:var(--border-strong);background:var(--surface-2);}
  .sub-board-add{margin-top:2px;}
  .sub-board-add[hidden]{display:none;}
  .sb-del-choice{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0 2px;font-size:.92rem;color:var(--text);cursor:pointer;}
  .sb-del-choice input[type=radio]{margin:0;}
  .sb-del-choice select{flex:1 1 10em;min-width:0;border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:7px 9px;font-size:.9rem;background:var(--bg-1);color:var(--text);}
  .sb-del-choice select:focus{outline:none;border-color:var(--primary);}
  .sb-del-count{margin:0 0 4px;color:var(--text);font-size:.92rem;line-height:1.45;}

  /* Custom colour wheel popover — replaces the native <input type=color>
     (whose OS picker is a saturation/value square + a hue bar) with a
     hue/saturation disc so picking a colour is a wheel, not a bar. Angle
     around the disc is hue, distance from centre is saturation; lightness
     is a separate slider since a single 2D disc can't encode all three HSL
     channels. Appended to <body> (not the modal) with position:fixed so it
     survives the settings modal repainting its whole innerHTML on every
     change (paintSettings rebuilds the DOM each call). */
  .wheel-pop{
    position:fixed;z-index:500;width:192px;padding:14px;box-sizing:border-box;
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
    box-shadow:var(--shadow-lg);display:flex;flex-direction:column;align-items:center;gap:10px;
  }
  .wheel-canvas-wrap{position:relative;width:160px;height:160px;touch-action:none;}
  .wheel-canvas{border-radius:50%;display:block;}
  .wheel-dot{
    position:absolute;width:14px;height:14px;margin:-7px 0 0 -7px;border-radius:50%;
    border:2px solid #fff;box-shadow:0 0 0 1px rgba(0,0,0,.35),var(--shadow-sm);pointer-events:none;
  }
  .wheel-light-row{display:flex;align-items:center;gap:8px;width:100%;}
  .wheel-light-row input[type=range]{flex:1;}
  .wheel-hex-row{width:100%;}
  .wheel-hex-row input{
    width:100%;box-sizing:border-box;font:inherit;font-size:.82rem;text-align:center;
    padding:6px 8px;border-radius:var(--radius-sm);border:1px solid var(--border);
    background:var(--bg-1);color:var(--text);text-transform:uppercase;
  }

  /* Recurring reminders */
  .recur-tag{background:var(--primary-tint);color:var(--primary-hover);}
  .recur-sub{font-size:.8rem;color:var(--text-muted);display:flex;align-items:center;gap:6px;margin-top:2px;}
  .recur-sub input[type=number]{width:60px;border:1.5px solid var(--border);border-radius:var(--radius-lg);padding:5px 7px;font:inherit;background:var(--bg-1);color:var(--text);}
  .recur-end{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:8px;font-size:.84rem;color:var(--text-muted);}
  .recur-end-lbl{font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--text-faint);}
  .field .recur-end select,.field .recur-end input[type=date]{width:auto;padding:6px 9px;font-size:.86rem;}
  .recur-end input[type=number]{width:68px;border:1.5px solid var(--border);border-radius:var(--radius-lg);padding:6px 7px;font:inherit;background:var(--bg-1);color:var(--text);}
  .recur-end-hint{font-size:.76rem;color:var(--text-muted);margin-top:6px;line-height:1.4;}
  .recur-end-hint.warn{color:var(--danger);}
  .recur-days{display:flex;gap:4px;margin-top:4px;}
  .recur-day{
    width:30px;height:30px;border-radius:var(--radius-lg);border:1.5px solid var(--border);background:var(--bg-1);
    color:var(--text-muted);font-weight:800;font-size:.72rem;cursor:pointer;
  }
  .recur-day.on{background:var(--primary);border-color:var(--primary);color:var(--on-primary);}
  .app-toast{
    position:fixed;left:50%;bottom:calc(24px + var(--safe-bottom));transform:translate(-50%,16px);
    background:var(--text);color:var(--bg-1);font-size:.82rem;font-weight:700;
    padding:10px 16px;border-radius:var(--radius-md);box-shadow:var(--shadow-lg);
    opacity:0;pointer-events:none;transition:opacity .2s ease, transform .2s ease;z-index:9999;
    max-width:90vw;text-align:center;
  }
  .app-toast.show{opacity:1;transform:translate(-50%,0);}
  .mini-tag{font-size:.65rem;font-weight:700;color:var(--text-muted);background:var(--surface-2);border-radius:5px;padding:1px 6px;}
  .mini-tag.delegate-tag.to-me{color:var(--primary-hover);background:var(--primary-tint);}
  .mini-tag.link-badge{cursor:pointer;text-decoration:underline dotted;text-underline-offset:2px;}
  .mini-tag.link-badge:hover{background:var(--primary-tint);color:var(--primary-hover);}
  .share-pill-row{display:flex;justify-content:flex-end;margin-top:6px;}
  .share-pill{font-size:.62rem;font-weight:700;color:var(--primary-hover);background:var(--primary-tint);border-radius:5px;padding:1px 6px;display:inline-flex;align-items:center;gap:3px;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis;}


  /* ============ CALENDAR ============ */
  .cal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:5px;padding:4px 2px;}
  .cal-dow{font-size:.62rem;font-weight:800;color:var(--text-faint);text-align:center;text-transform:uppercase;padding-bottom:2px;}
  .cal-cell{
    aspect-ratio:1/1;border-radius:var(--radius-lg);border:1px solid var(--border);background:var(--surface);
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;cursor:pointer;
    font-size:.72rem;font-weight:700;color:var(--text-muted);position:relative;
  }
  .cal-cell.muted{opacity:.35;cursor:default;}
  .cal-cell.today{border-color:var(--primary);color:var(--primary);}
  .cal-cell.selected{background:var(--primary-tint);border-color:var(--primary);}
  .cal-dots{display:flex;gap:2px;}
  .cal-dots span{width:5px;height:5px;border-radius:50%;}
  .cal-dots span.virt{opacity:.45;box-shadow:0 0 0 1px var(--surface) inset;}
  .cal-dots span.ov{background:transparent !important;box-shadow:0 0 0 1.5px var(--text-muted) inset;}
  .cal-recur{position:absolute;top:2px;right:3px;font-size:.6rem;line-height:1;opacity:.9;}
  .card.virtual{border-style:dashed;opacity:.82;cursor:pointer;}
  .card.virtual:hover{opacity:1;}
  .card.overlay-card{border-style:dashed;opacity:.86;cursor:pointer;}
  .card.overlay-card:hover{opacity:1;}
  .mini-tag.overlay-tag{background:var(--primary-tint);color:var(--primary);font-weight:800;}
  .cal-overlay-row{
    display:flex;align-items:center;gap:6px;font-size:.7rem;font-weight:700;color:var(--text-muted);
    padding:2px 4px 8px;cursor:pointer;user-select:none;
  }
  .cal-overlay-row input{width:14px;height:14px;cursor:pointer;margin:0;}
  .cal-overlay-row b{color:var(--text);}
  .cal-dots span.gc{border-radius:2px;}
  .cal-gcal-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 4px 8px;flex-wrap:wrap;}
  .cal-gcal-actions{display:flex;gap:6px;}
  .cal-gcal-row .ghost-btn{padding:3px 9px;font-size:.72rem;}
  .card.gcal-card{border-left:4px solid var(--evc,#1a73e8);cursor:default;}
  .rank-chip.gcal-chip{background:var(--surface-2);color:var(--text-muted);}
  .cal-month-nav{display:flex;align-items:center;justify-content:space-between;padding:2px 4px 8px;}
  .cal-month-nav strong{font-family:var(--font-display);font-size:.82rem;}
  .cal-day-list{padding:8px 2px 2px;display:flex;flex-direction:column;gap:6px;}

  /* ============ MODAL ============ */
  .modal-overlay{
    position:fixed;inset:0;background:rgba(11,43,29,.45);backdrop-filter:blur(2px);
    display:flex;align-items:flex-start;justify-content:center;z-index:100;overflow-y:auto;
    padding:calc(4vh + var(--safe-top)) calc(16px + var(--safe-right)) calc(4vh + var(--safe-bottom)) calc(16px + var(--safe-left));
  }
  .modal{
    background:var(--surface);border-radius:var(--radius-xl);box-shadow:var(--shadow-lg);
    width:min(640px,100%);padding:26px 26px 22px;display:flex;flex-direction:column;gap:16px;
    margin-bottom:4vh;
  }
  .modal-head{display:flex;align-items:flex-start;gap:12px;}
  .modal-head h2{margin:0;font-size:1.15rem;font-weight:800;flex:1;}
  .modal-head .type-pill{
    font-size:.65rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;
    background:var(--primary-tint);color:var(--primary-hover);padding:3px 9px;border-radius:var(--radius-sm);
  }
  .close-x{border:none;background:none;font-size:1.3rem;color:var(--text-muted);cursor:pointer;line-height:1;padding:2px;}
  .modal-back{
    border:none;background:none;color:var(--primary-hover);font-weight:700;font-size:.8rem;
    cursor:pointer;padding:2px 0;align-self:center;
  }
  .modal-back:hover{text-decoration:underline;}
  .quicklist-row.sub-editable{cursor:pointer;}
  .quicklist-row.sub-editable:hover{border-color:var(--primary);}
  .qextra{color:var(--text-faint);font-weight:600;}
  .sub-add-details{align-self:flex-start;font-size:.76rem;padding:5px 9px;}
  .field{display:flex;flex-direction:column;gap:6px;}
  .field label{font-size:.72rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--text-faint);}
  .field input[type=text],.field input[type=date],.field select,.field textarea{
    border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:9px 11px;font-size:.9rem;
    background:var(--bg-1);color:var(--text);width:100%;
  }
  .field input:focus,.field select:focus,.field textarea:focus{outline:none;border-color:var(--primary);}
  .font-row{display:flex;gap:8px;}
  .font-row #setFont{flex:1;min-width:0;}
  .font-row #setTextSize{width:auto;flex:0 0 auto;}
  .row2{display:grid;grid-template-columns:1fr 1fr;gap:12px;}
  .rank-picker{display:flex;gap:8px;}
  .rank-pick-btn{
    flex:1;border:1.5px solid var(--border);background:var(--bg-1);border-radius:var(--radius-sm);
    padding:9px 4px;text-align:center;cursor:pointer;font-family:var(--font-display);font-weight:800;font-size:.85rem;color:var(--text-muted);
  }
  .rank-pick-btn small{display:block;font-family:var(--font-body);font-weight:600;font-size:.6rem;margin-top:2px;text-transform:none;letter-spacing:0;}
  .rank-pick-btn.sel-P.selected{background:var(--rank-p-tint);border-color:var(--rank-p);color:var(--rank-p);}
  .rank-pick-btn.sel-A.selected{background:var(--rank-a-tint);border-color:var(--rank-a);color:#8a6d00;}
  .rank-pick-btn.sel-B.selected{background:var(--rank-b-tint);border-color:var(--rank-b);color:var(--rank-b);}
  .rank-pick-btn.sel-C.selected{background:var(--rank-c-tint);border-color:var(--rank-c);color:var(--rank-c);}
  .rank-pick-btn.sel-F.selected{background:var(--surface-2);border-color:var(--border-strong);color:var(--text-muted);}

  .cat-row{display:flex;gap:8px;}
  .cat-row select{flex:1;}
  .ghost-btn{
    border:1.5px dashed var(--border-strong);background:transparent;color:var(--text-muted);
    border-radius:var(--radius-sm);padding:8px 12px;font-size:.8rem;font-weight:700;cursor:pointer;white-space:nowrap;
  }
  .ghost-btn:hover{border-color:var(--primary);color:var(--primary);}
  .tag-row{display:flex;gap:6px;align-items:flex-start;}
  .tag-row .tag-field{flex:1;min-width:0;}
  .tag-field{display:flex;flex-wrap:wrap;gap:6px;border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:8px;background:var(--bg-1);}
  .tag-pill{
    display:flex;align-items:center;gap:5px;background:var(--surface);border:1px solid var(--border);
    border-radius:var(--radius-sm);padding:3px 9px 3px 10px;font-size:.76rem;font-weight:700;color:var(--text);
  }
  .tag-pill button{border:none;background:none;cursor:pointer;color:inherit;opacity:.6;font-size:.85rem;line-height:1;}
  .tag-input{border:none;background:none;outline:none;flex:1;min-width:90px;font-size:.82rem;color:var(--text);}
  .tag-suggest-wrap{position:relative;}
  .tag-suggest{
    position:absolute;left:0;right:0;top:100%;margin-top:4px;z-index:40;
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);
    box-shadow:var(--shadow-md);max-height:170px;overflow-y:auto;
  }
  .tag-suggest-item{padding:8px 11px;font-size:.82rem;font-weight:600;color:var(--text);cursor:pointer;}
  .tag-suggest-item:hover,.tag-suggest-item.active{background:var(--primary-tint-2);color:var(--primary-hover);}
  .tag-suggest-empty{padding:8px 11px;font-size:.76rem;color:var(--text-faint);}
  .share-box{border:1.5px dashed var(--primary);background:var(--primary-tint-2);border-radius:var(--radius-sm);padding:10px;display:flex;flex-direction:column;gap:8px;}
  .share-box .share-head{font-size:.72rem;font-weight:800;color:var(--primary-hover);display:flex;align-items:center;gap:6px;}
  .switch{position:relative;display:inline-block;width:34px;height:19px;flex-shrink:0;}
  .switch input{opacity:0;width:0;height:0;}
  .switch .slider{position:absolute;cursor:pointer;inset:0;background:var(--border-strong);border-radius:999px;transition:.15s;}
  .switch .slider::before{content:"";position:absolute;height:14px;width:14px;left:2.5px;top:2.5px;background:#fff;border-radius:50%;transition:.15s;}
  .switch input:checked + .slider{background:var(--primary);}
  .switch input:checked + .slider::before{transform:translateX(15px);}
  .switch-label{font-size:.76rem;font-weight:600;color:var(--text-muted);display:flex;align-items:center;gap:7px;}

  .rte-toolbar{display:flex;gap:4px;border:1.5px solid var(--border);border-bottom:none;border-radius:var(--radius-sm) var(--radius-sm) 0 0;padding:5px;background:var(--bg-1);}
  .rte-toolbar button{
    width:28px;height:28px;border:1px solid transparent;background:transparent;border-radius:6px;cursor:pointer;
    font-weight:800;font-size:.8rem;color:var(--text-muted);
  }
  .rte-toolbar button:hover{background:var(--surface);border-color:var(--border);}
  .rte-body{
    border:1.5px solid var(--border);border-top:none;border-radius:0 0 var(--radius-sm) var(--radius-sm);
    min-height:90px;padding:10px 11px;font-size:.86rem;line-height:1.55;background:var(--bg-1);color:var(--text);
  }
  .rte-body:focus{outline:none;}
  .rte-body ul{margin:4px 0;padding-left:20px;}
  .rte-body[data-empty=true]:before{content:attr(data-placeholder);color:var(--text-faint);}

  .attach-drop{
    display:block;width:100%;font:inherit;
    border:1.5px dashed var(--border-strong);border-radius:var(--radius-sm);padding:14px;text-align:center;
    color:var(--text-muted);font-size:.8rem;cursor:pointer;background:var(--bg-1);
  }
  .attach-drop:hover{border-color:var(--primary);}
  .attach-list{display:flex;flex-wrap:wrap;gap:8px;}
  .attach-chip{
    display:flex;align-items:center;gap:6px;background:var(--surface-2);border:1px solid var(--border);
    border-radius:var(--radius-sm);padding:6px 9px;font-size:.76rem;font-weight:600;
  }
  .attach-chip button{border:none;background:none;color:var(--text-muted);cursor:pointer;font-size:.85rem;}
  .attach-chip a.attach-dl{color:var(--primary);text-decoration:none;}
  .attach-chip a.attach-dl:hover{text-decoration:underline;}
  .attach-pending{color:var(--text-faint);font-style:normal;font-weight:500;}

  /* Attach menu: File / URL / Another item — replaces the trigger in place
     while open (same "swap, don't overlay" convention as the Agenda action
     panels), and reused wherever attachments can be added. */
  .attach-menu{
    display:flex;flex-wrap:wrap;align-items:center;gap:6px;
    background:var(--bg-1);border:1px dashed var(--border-strong);border-radius:var(--radius-sm);padding:8px;
  }
  .attach-menu button:not(.close-x){
    display:flex;align-items:center;gap:6px;border:1px solid var(--border);background:var(--surface);
    color:var(--text);border-radius:var(--radius-lg);padding:6px 10px;font-size:.78rem;font-weight:700;cursor:pointer;white-space:nowrap;
  }
  .attach-menu button:not(.close-x):hover{background:var(--primary-tint-2);border-color:var(--primary);}
  .attach-menu-form{flex-wrap:nowrap;}
  .attach-menu-form input[type=text]{flex:1;min-width:120px;}
  .attach-item-pick-wrap{position:relative;flex:1;min-width:160px;}
  /* Voice note: the recorder panel (asking → recording → preview) and the
     player on any audio chip. */
  .attach-voice{align-items:center;}
  .attach-voice-dot{width:10px;height:10px;border-radius:50%;background:var(--text-faint);flex-shrink:0;}
  .attach-voice-dot.live{background:var(--danger);animation:micPulse 1.4s ease-in-out infinite;}
  .attach-voice-status{flex:1;min-width:0;font-size:.78rem;font-weight:600;color:var(--text-muted);}
  .attach-voice-status strong{color:var(--text);font-variant-numeric:tabular-nums;}
  .attach-voice-err{color:var(--danger);}
  .attach-voice-preview{flex-wrap:wrap;}
  .attach-voice-preview audio{flex:1 1 100%;height:34px;}
  .attach-audio-wrap{display:flex;flex-direction:column;gap:5px;flex:1;min-width:0;}
  .attach-audio-wrap audio{width:100%;max-width:380px;height:32px;}
  .attach-chip:has(.attach-audio-wrap){flex:1 1 100%;align-items:flex-start;}

  .quicklist{display:flex;flex-direction:column;gap:6px;}
  .quicklist-row{display:flex;gap:6px;align-items:center;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:7px 9px;}
  .quicklist-row .qtitle{flex:1;font-size:.82rem;font-weight:600;}
  .quicklist-row .qmeta{font-size:.68rem;color:var(--text-muted);font-weight:700;}
  /* "N completed" — collapses a project's finished tasks so they don't bury
     the open ones; tap to expand for this modal visit. */
  .ql-donetoggle{
    display:flex;align-items:center;gap:6px;width:100%;text-align:left;font:inherit;
    border:none;background:none;color:var(--text-muted);font-size:.78rem;font-weight:700;
    cursor:pointer;padding:7px 9px;
  }
  .ql-donetoggle:hover{color:var(--text);}
  .ql-donetoggle .chev{display:inline-block;transition:transform .15s ease;font-size:.72rem;}
  .ql-donetoggle.open .chev{transform:rotate(90deg);}
  .quick-add-row{display:flex;gap:6px;}
  .quick-add-row input{flex:1;}
  .quick-add-row select,.quick-add-row input[type=date]{width:118px;}
  .quick-add-row .qadd-time{width:112px;flex:none;}
  /* Quick-add "Add" button: a solid, obvious tap target (there's no Enter key
     on a phone keyboard), sitting at the end of the row. */
  .qadd-btn{
    flex-shrink:0;border:none;background:var(--primary);color:var(--on-primary);
    border-radius:var(--radius-sm);padding:9px 16px;font-size:.82rem;font-weight:800;
    cursor:pointer;white-space:nowrap;
  }
  .qadd-btn:hover{background:var(--primary-hover);}

  .modal-actions{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:4px;}
  .btn{border:none;border-radius:var(--radius-sm);padding:10px 18px;font-weight:700;font-size:.86rem;cursor:pointer;}
  .btn-primary{background:var(--accent);color:var(--on-accent);}
  .btn-primary:hover{background:var(--accent-hover);}
  .btn-secondary{background:var(--surface-2);color:var(--text);border:1.5px solid var(--border);}
  .btn-secondary:hover{background:var(--primary-tint-2);}
  .btn-danger{background:transparent;color:var(--danger);}
  .btn-danger:hover{background:var(--danger-tint);}
  .created-note{font-size:.7rem;color:var(--text-faint);}
  .created-note a{color:var(--primary);text-decoration:none;}
  .created-note a:hover{text-decoration:underline;}

  .banner{
    background:var(--primary-tint-2);border-bottom:1px solid var(--border);color:var(--primary-hover);
    font-size:.78rem;text-align:center;padding:7px 14px;
  }
  .banner b{font-weight:800;}
  .viewas-banner{background:#3b2a05;color:#ffe9a8;border-bottom-color:#6b4d0a;position:sticky;top:var(--safe-top);z-index:60;}
  .viewas-exit{margin-left:10px;padding:2px 12px;border-radius:var(--radius-sm);border:1px solid #ffe9a8;background:transparent;color:#ffe9a8;font:inherit;font-weight:700;cursor:pointer;}
  .viewas-exit:hover{background:#ffe9a8;color:#3b2a05;}
  /* Hide text (Samantha): the eye in the header, amber like View as's banner while it's on */
  .hide-text-btn{flex-shrink:0;}
  .hide-text-btn svg{width:18px;height:18px;display:block;}
  .hide-text-btn.on, .hub-icon-btn.hide-text-btn.on{
    width:auto;display:inline-flex;align-items:center;gap:6px;padding:0 10px;
    background:#3b2a05;color:#ffe9a8;border-color:#6b4d0a;font:inherit;font-size:.8rem;font-weight:700;white-space:nowrap;
  }
  .hide-text-btn.on:hover, .hub-icon-btn.hide-text-btn.on:hover{background:#4d3807;color:#ffe9a8;}
  .hub-view-head .hide-text-btn{margin-left:auto;}
  /* the top bar's tally on Samantha's Today, a little shorter to sit in the 48px head */
  @media (min-width:1021px){
    .hub-view-head .done-tally{padding:2px 13px 2px 4px;}
    .hub-view-head .done-tally .dt-burst{width:26px;height:26px;font-size:.9rem;}
  }
  .hub-text-hidden-note{max-width:440px;margin:48px auto;text-align:center;line-height:1.5;}
  @media (max-width: 780px){   /* a full-screen view's header has no room for the words */
    .meet-head .hide-text-btn.on{width:34px;padding:0;justify-content:center;}
    .meet-head .hide-text-btn.on span{display:none;}
  }
  .hub-text-hidden-note .hide-text-btn{margin:14px auto 0;}

  /* ============ MEETING MINUTES ============ */
  /* Full-screen views start below the status bar and pad their own bottom
     past the home indicator (.meet-shell here, .gh-view in js/greenhouse.js). */
  .modal-overlay.fullbleed{padding:var(--safe-top) var(--safe-right) 0 var(--safe-left);align-items:stretch;overflow:hidden;}
  /* Today, Notes and the Vault open BELOW the top bar (not over it) so its tabs
     stay reachable, and to the right of the left menu when it is showing on the page:
     --head-bottom / --menu-right are those edges, kept by syncHead(). */
  .modal-overlay.fullbleed.under-head{top:var(--head-bottom,0px);left:var(--menu-right,0px);padding-top:0;}
  /* Notes-only install (/notes/): just the Notes screen, no top bar, menu or close button */
  html.notes-only .topbar, html.notes-only .lhsnb, html.notes-only #notesOverlay .meet-head .close-x{display:none !important;}
  /* ...and with no top bar to sit under, the screen starts below the phone's status bar */
  html.notes-only .modal-overlay.fullbleed.under-head{top:var(--safe-top);left:0;}
  html.notes-only .modal-overlay.fullbleed.under-head .meet-shell{min-height:calc(100vh - var(--safe-top));max-height:calc(100vh - var(--safe-top));}
  .modal-overlay.fullbleed.under-head .meet-shell{
    min-height:calc(100vh - var(--head-bottom,0px));max-height:calc(100vh - var(--head-bottom,0px));
  }
  /* DragonOwl Hub: a Tasking screen (Notes, Vault, Mail, Helpdesk, Daily Brief)
     moved into the Hub's main pane (public/hub/tasking/index.js) is part of the
     page there, not an overlay. The Hub's view head names it, so the screen's
     own title and ✕ are hidden; it fills the pane below that head. */
  .hub-view-body.hub-pane-host{padding:0;}
  .modal-overlay.fullbleed.hub-pane-screen{position:relative;inset:auto;z-index:auto;display:block;padding:0;background:none;backdrop-filter:none;overflow:visible;}
  .hub-pane-screen > .meet-shell{
    min-height:calc(100dvh - 48px - var(--safe-top));max-height:calc(100dvh - 48px - var(--safe-top));
    padding-bottom:var(--safe-bottom);
  }
  .hub-pane-screen > .meet-shell > .meet-head > h2,
  .hub-pane-screen > .meet-shell > .meet-head > .close-x{display:none;}
  .hub-pane-screen > .meet-shell > .meet-head:not(:has(> :not(h2):not(.close-x):not(.spacer))){display:none;}
  .hub-pane-screen .vt-shell{height:calc(100dvh - 48px - var(--safe-top));}
  .hub-pane-screen .vt-bar > h2, .hub-pane-screen .vt-bar > [data-act="close"]{display:none;}
  /* Full-screen Tasking views (Meeting Minutes, Diet, Peer Support Hours, the
     Greenhouse, …) opened from the nested board menu sit beside the Hub nav,
     not over it, so the nav stays usable on a wide screen. */
  @media (min-width:861px){
    html.hub-on .modal-overlay.fullbleed:not(.hub-pane-screen){left:var(--hub-nav-w);}
    html.hub-on.hub-rail .modal-overlay.fullbleed:not(.hub-pane-screen){left:var(--hub-nav-rail);}
  }
  /* Recovery in the Hub pane */
  .hub-rec{padding:0;}
  .hub-rec-head{padding:10px 16px 0;font-size:.82rem;color:var(--text-muted);font-weight:600;}
  .hub-rec .rec-board-area{min-height:calc(100dvh - 90px - var(--safe-top));}
  .meet-shell{
    width:100%;max-width:none;border-radius:0;background:var(--bg-0);
    display:flex;flex-direction:column;min-height:calc(100vh - var(--safe-top));max-height:calc(100vh - var(--safe-top));
    padding-bottom:var(--safe-bottom);
  }
  .meet-head{
    display:flex;align-items:center;gap:10px;flex-wrap:wrap;
    padding:12px 18px;background:var(--surface);border-bottom:1px solid var(--border);
  }
  .meet-head h2{font-size:1.05rem;margin:0;font-weight:800;display:flex;align-items:center;gap:8px;}
  .meet-head .spacer{flex:1;}
  .meet-head input[type=date],.meet-head select,.meet-head input.qadd-time{
    border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:6px 9px;font:inherit;
    background:var(--bg-1);color:var(--text);font-size:.82rem;
  }
  .meet-search-wrap{position:relative;flex:1 1 200px;min-width:140px;max-width:320px;}
  .meet-search-input{
    width:100%;border:1.5px solid var(--border);border-radius:var(--radius-md);padding:7px 30px 7px 12px;
    font:inherit;font-size:.82rem;background:var(--bg-1);color:var(--text);
  }
  .meet-search-input:focus{outline:none;border-color:var(--primary);}
  .meet-search-wrap .close-x{position:absolute;right:4px;top:50%;transform:translateY(-50%);font-size:1rem;}
  .meet-search-result{
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
    padding:10px 12px;margin-bottom:8px;
  }
  .meet-search-result-head{display:flex;align-items:center;gap:8px;cursor:pointer;}
  .search-hits{margin-top:6px;display:flex;flex-direction:column;gap:2px;}
  /* One expandable row — collapsed is a scannable one-liner; expanding
     reveals the full text and the only button that actually navigates away. */
  .search-hit{background:var(--surface-2);border-radius:var(--radius-sm);}
  .search-hit-row{display:flex;align-items:center;}
  .search-hit-row > input[type=checkbox]{flex-shrink:0;margin-left:8px;}
  .search-hit-head{
    display:flex;align-items:center;gap:7px;flex:1;min-width:0;text-align:left;font:inherit;
    border:none;background:none;color:var(--text-muted);font-size:.8rem;line-height:1.4;
    cursor:pointer;padding:6px 8px;overflow-wrap:anywhere;
  }
  .search-hit-head:hover{color:var(--text);}
  .search-hit-head .chev{flex-shrink:0;transition:transform .15s ease;font-size:.7rem;color:var(--text-faint);}
  .search-hit.open .search-hit-head .chev{transform:rotate(90deg);}
  .search-hit-body{padding:0 8px 10px 27px;}
  .search-hit-full{font-size:.82rem;color:var(--text);line-height:1.55;overflow-wrap:anywhere;margin-bottom:6px;}
  .search-meta{font-size:.72rem;color:var(--text-faint);font-weight:600;margin-bottom:8px;}
  .meet-status{
    font-size:.62rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;
    padding:3px 9px;border-radius:var(--radius-sm);
  }
  .meet-status.active{background:var(--primary-tint);color:var(--primary-hover);}
  .meet-status.review{background:var(--rank-a-tint);color:#8a6d00;}
  .meet-status.finalized{background:var(--surface-2);color:var(--text-muted);}
  .meet-body{flex:1;display:flex;gap:0;min-height:0;overflow:hidden;}
  .meet-col{flex:1;min-width:0;display:flex;flex-direction:column;overflow-y:auto;padding:16px;}
  .meet-col + .meet-col{border-left:1px solid var(--border);background:var(--bg-1);}
  .meet-col-title{
    font-size:.68rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
    color:var(--text-faint);margin:0 0 10px;
  }
  .meet-addbar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px;}
  .meet-addbar button{
    border:1.5px dashed var(--border-strong);background:transparent;color:var(--text-muted);
    border-radius:var(--radius-sm);padding:8px 12px;font-size:.8rem;font-weight:700;cursor:pointer;
  }
  .meet-addbar button:hover{border-color:var(--primary);color:var(--primary);}
  .meet-tile{
    background:var(--surface);border:1px solid var(--border);border-left:4px solid var(--rank-b);
    border-radius:var(--radius-md);padding:12px;margin-bottom:10px;box-shadow:var(--shadow-sm);
  }
  .meet-tile.t-project{border-left-color:var(--primary);}
  .meet-tile.t-task{border-left-color:var(--rank-a);}
  .meet-tile.t-reminder{border-left-color:var(--rank-b);}
  .meet-tile-head{display:flex;align-items:center;gap:8px;margin-bottom:8px;}
  .meet-tile-head .type-pill{
    font-size:.6rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;
    background:var(--surface-2);color:var(--text-muted);padding:2px 7px;border-radius:var(--radius-sm);
  }
  .meet-tile-head .spacer{flex:1;}
  /* "Discussed" card: Agenda items logged as talked-about, with room for
     talking notes — a permanent part of this meeting's record. */
  .meet-tile.meet-discussed{border-left-color:var(--text-faint);}
  .meet-discussed-row{padding:9px 0;border-top:1px solid var(--border);}
  .meet-discussed-row:first-child{padding-top:0;border-top:none;}
  .meet-discussed-head{display:flex;align-items:center;gap:8px;margin-bottom:6px;}
  .meet-discussed-head .t-title{font-weight:700;font-size:.86rem;flex:1;min-width:0;overflow-wrap:anywhere;}
  .meet-discussed-notes-ro{font-size:.82rem;color:var(--text-muted);line-height:1.55;white-space:pre-wrap;}
  .meet-tile input[type=text],.meet-tile textarea,.meet-tile input[type=date],.meet-tile select{
    width:100%;border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:8px 10px;
    font:inherit;font-size:.86rem;background:var(--bg-1);color:var(--text);
  }
  .meet-tile textarea{min-height:52px;resize:vertical;}
  /* child quick-add: keep it a tidy row, not stacked full-width fields */
  .meet-tile .quick-add-row{align-items:center;}
  .meet-tile .quick-add-row select{width:auto;flex:0 0 96px;}
  .meet-tile .quick-add-row input[type=text]{width:auto;flex:1;min-width:0;}
  .meet-tile .quick-add-row .qadd-btn{flex:0 0 auto;}
  /* inline-editable sub-item title (fix a typo without delete + re-add) */
  .meet-tile .quicklist-row input.meet-child-edit{
    flex:1;min-width:0;width:auto;border:1px solid transparent;border-radius:6px;
    background:transparent;padding:2px 6px;font-family:inherit;font-size:.82rem;font-weight:600;color:var(--text);
  }
  .meet-tile .quicklist-row input.meet-child-edit:hover{border-color:var(--border-strong);}
  .meet-tile .quicklist-row input.meet-child-edit:focus{outline:none;border-color:var(--primary);background:var(--bg-1);}
  /* "Delegate to" picker on a meeting draft tile */
  .meet-tile .meet-delegate{display:flex;align-items:center;gap:8px;margin-top:8px;}
  .meet-tile .meet-delegate label{
    flex:0 0 auto;font-size:.6rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);
  }
  .meet-tile .meet-delegate select{flex:1;min-width:0;}
  .meet-tile-ro .meet-delegate{margin-top:8px;}
  .meet-tile-ro .meet-delegate select{padding:5px 8px;font-size:.8rem;}
  /* per-sub-item delegate override */
  .meet-tile .quicklist-row{flex-wrap:wrap;}
  .meet-tile .quicklist-row .meet-child-edit,
  .meet-tile .quicklist-row .qtitle{flex:1 1 60%;}
  .meet-tile .quicklist-row select.meet-child-share{
    flex:0 0 auto;width:auto;padding:3px 6px;font-size:.72rem;font-weight:700;
    border:1px solid var(--border);border-radius:6px;background:var(--bg-1);color:var(--text-muted);
  }
  .meet-ro-children{margin-top:10px;display:flex;flex-direction:column;gap:6px;}
  .meet-ro-children > label{
    font-size:.6rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--text-muted);
  }
  .meet-tile .row2 input{width:100%;}
  .meet-tile .row2{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px;}
  .meet-tile .rank-picker{margin-top:8px;}
  .meet-tile-ro{font-size:.86rem;}
  .meet-tile-ro .t-title{font-weight:700;}
  .meet-tile-ro .t-meta{font-size:.72rem;color:var(--text-muted);margin-top:3px;}
  /* Meeting minutes tile — free rich-text notes for the whole meeting. */
  .meet-minutes.meet-tile{border-left-color:var(--text-muted);}
  .meet-minutes .rte-toolbar{border-radius:var(--radius-sm) var(--radius-sm) 0 0;}
  .meet-minutes .rte-body{
    border-radius:0 0 var(--radius-sm) var(--radius-sm);min-height:140px;
    max-height:none;overflow:visible;white-space:pre-wrap;
  }
  .meet-minutes .rte-body[contenteditable="false"]{background:var(--surface-2);color:var(--text-muted);}
  .meet-minutes .rte-body:empty:before{content:attr(data-placeholder);color:var(--text-faint);}
  .meet-minutes .rte-body p{margin:0 0 6px;}
  .meet-attach{margin-top:8px;display:flex;flex-direction:column;gap:3px;}
  .meet-attach label{font-size:.62rem;font-weight:800;letter-spacing:.05em;text-transform:uppercase;color:var(--text-faint);}
  .meet-attach select{
    width:100%;border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:7px 9px;
    font:inherit;font-size:.82rem;background:var(--bg-1);color:var(--text);
  }
  .meet-ongoing-card{
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
    padding:10px 12px;margin-bottom:8px;
  }
  .meet-ongoing-head{display:flex;align-items:center;gap:8px;cursor:pointer;}
  .meet-ongoing-head .t-title{font-weight:700;font-size:.86rem;flex:1;min-width:0;}
  .meet-ongoing-head .chev{transition:transform .18s ease;color:var(--text-muted);font-size:.8rem;}
  .meet-ongoing-card.open .meet-ongoing-head .chev{transform:rotate(90deg);}
  .meet-hier{margin-top:8px;padding-left:10px;border-left:2px solid var(--border);}
  .meet-empty{color:var(--text-faint);font-size:.82rem;padding:20px 4px;line-height:1.5;}
  .meet-tabs{display:none;}

  /* ---- Agenda: a running backlog above the meetings list, pinned atop an
     active meeting's canvas. ---- */
  .agenda-wrap{margin-bottom:20px;padding-bottom:16px;border-bottom:1px solid var(--border);}
  .agenda-row{
    display:flex;align-items:center;gap:8px;background:var(--surface-2);border:1px solid var(--border);
    border-radius:var(--radius-sm);padding:8px 9px;margin-bottom:6px;
  }
  .agenda-row.dragging{opacity:.4;}
  .agenda-row.drop-above{box-shadow:0 -2px 0 var(--primary);}
  .agenda-row.drop-below{box-shadow:0 2px 0 var(--primary);}
  .agenda-drag{cursor:grab;color:var(--text-faint);flex-shrink:0;font-size:.85rem;}
  .agenda-title{flex:1;min-width:0;font-size:.84rem;font-weight:600;cursor:text;overflow-wrap:anywhere;}
  .agenda-title-input{flex:1;min-width:0;font:inherit;font-size:.84rem;font-weight:600;}
  .agenda-meta{font-size:.68rem;color:var(--text-muted);font-weight:700;flex-shrink:0;white-space:nowrap;}
  .agenda-actions{display:flex;align-items:center;gap:4px;flex-shrink:0;}
  .agenda-actions button{
    border:1px solid var(--border);background:var(--surface);color:var(--text-muted);
    border-radius:var(--radius-lg);padding:5px 9px;font-size:.72rem;font-weight:700;cursor:pointer;white-space:nowrap;
  }
  .agenda-actions button:hover{background:var(--primary-tint-2);border-color:var(--primary);color:var(--primary-hover);}
  .agenda-actions .agenda-attach-btn{
    display:inline-flex;align-items:center;justify-content:center;width:26px;padding:5px 0;
    border:1px solid var(--border);background:var(--surface);border-radius:var(--radius-lg);cursor:pointer;
  }
  .agenda-actions .agenda-attach-btn:hover{background:var(--primary-tint-2);border-color:var(--primary);}
  .agenda-actions .close-x{border:none;background:none;color:var(--text-faint);padding:5px 6px;}
  .agenda-panel{
    display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:8px 9px;margin:-2px 0 6px;
    background:var(--bg-1);border:1px dashed var(--border-strong);border-radius:var(--radius-sm);
  }
  .agenda-panel select{flex:1;min-width:140px;}
  .agenda-attachlist{display:flex;flex-wrap:wrap;gap:6px;padding:0 0 8px 22px;margin-top:-4px;}

  /* ---- Top bar: it has nine controls, and must never run off the right edge.
     In full it needs ~990px; trimmed (no Help label, tally without captions)
     ~770px; below that it becomes two rows. Measured, not guessed — if a
     control is added, re-measure .topbar's scrollWidth at these widths. ---- */
  @media (max-width: 1020px){
    .topbar{gap:10px;padding:9px 12px;}
    .board-tabs{margin-left:0;flex-shrink:0;}
    .topbar-spacer{min-width:0;}
    .help-btn{padding:0;width:34px;}
    .help-btn .help-btn-label{display:none;}
    .done-tally{gap:6px;padding:4px 11px 4px 5px;}
    .done-tally .dt-burst{width:24px;height:24px;font-size:.85rem;box-shadow:none;}
    .done-tally .dt-n{font-size:1.02rem;}
    .done-tally .dt-cap{display:none;}     /* compacts to the burst + numbers (🤝 marks the shared one) */
    .done-tally .dt-shared .dt-n{font-size:.9rem;}
    .done-tally .dt-div{margin:2px 0;}
  }
  /* Phones and narrow windows. One row used to push Help, the menu, the gear
     and the sign-out chip past the right edge, reachable only by swiping the
     bar sideways. Two rows instead:
        [logo] [Personal|Work] ……………… [bell] [avatar]
        [done tally] ……………………… [help] [menu] [gear]
     ::after is the row break and `order` does the rest, so the markup (and
     the desktop bar) are untouched. The break is a line of its own, so the
     4px row-gap applies twice: 8px between the rows. */
  @media (max-width: 780px){
    .topbar{flex-wrap:wrap;row-gap:4px;}
    .topbar::after{content:"";order:5;flex-basis:100%;height:0;}
    .topbar > .brand{order:1;}
    .topbar > .board-tabs{order:2;}
    .topbar > .topbar-spacer{order:3;}
    .topbar > .head-pending{order:4;}
    .topbar > .notif-wrap{order:4;}
    .topbar > #profileChip{order:4;}
    .topbar > .done-tally-wrap{order:6;margin-right:auto;}
    .topbar > .hide-text-btn{order:7;}
    .topbar > #helpBtn{order:7;}
    .topbar > #lhsnbToggle{order:8;}
    .topbar > #settingsBtn{order:9;}
  }

  /* ---- Top bar, part 2 (Today tab; four boards). The bar was sized for two
     boards. Patrick has four, plus the Today tab: so below 1100px the wordmark
     goes (as it already does on phones), a bar with four or more boards also
     tightens its tabs and takes the two-row layout up to 1180px, and on a phone
     the tabs get a row of their own. Measured 360–1280px for both layouts. ---- */
  @media (max-width: 1100px){
    .brand{gap:0;font-size:0;}
    .brand .logo-mark{font-size:30px;}
  }
  @media (max-width: 1320px){
    :root[data-many-boards] .brand{gap:0;font-size:0;}
    :root[data-many-boards] .brand .logo-mark{font-size:30px;}
    :root[data-many-boards] .board-tab{padding:7px 12px;}
  }
  @media (max-width: 1180px){
    :root[data-many-boards] .topbar{flex-wrap:wrap;row-gap:4px;}
    :root[data-many-boards] .topbar::after{content:"";order:5;flex-basis:100%;height:0;}
    :root[data-many-boards] .topbar > .brand{order:1;}
    :root[data-many-boards] .topbar > .board-tabs{order:2;}
    :root[data-many-boards] .topbar > .topbar-spacer{order:3;}
    :root[data-many-boards] .topbar > .head-pending{order:4;}
    :root[data-many-boards] .topbar > .notif-wrap{order:4;}
    :root[data-many-boards] .topbar > #profileChip{order:4;}
    :root[data-many-boards] .topbar > .done-tally-wrap{order:6;margin-right:auto;}
    :root[data-many-boards] .topbar > #helpBtn{order:7;}
    :root[data-many-boards] .topbar > #lhsnbToggle{order:8;}
    :root[data-many-boards] .topbar > #settingsBtn{order:9;}
  }
  @media (max-width: 780px){
    :root[data-many-boards] .topbar::before{content:"";order:7;flex-basis:100%;height:0;}
    :root[data-many-boards] .topbar > .board-tabs{order:6;flex:1 1 100%;max-width:100%;overflow-x:auto;scrollbar-width:none;margin-left:0;}
    :root[data-many-boards] .topbar > .board-tabs::-webkit-scrollbar{display:none;}
    :root[data-many-boards] .board-tab{flex:1 0 auto;padding:7px 10px;font-size:.8rem;white-space:nowrap;}
    :root[data-many-boards] .topbar > .topbar-spacer{flex:1;}
    :root[data-many-boards] .topbar > .done-tally-wrap{order:8;}
    :root[data-many-boards] .topbar > #helpBtn{order:9;}
    :root[data-many-boards] .topbar > #lhsnbToggle{order:10;}
    :root[data-many-boards] .topbar > #settingsBtn{order:11;}
  }

  /* Samantha's ☰ (NAV_TOP_USERS, Patrick 2026-11-15): first at the top left, before the logo, where the
     menu's D lands when it slides open. Same weight as the many-boards rules above, so it comes after them. */
  @media (max-width: 860px){
    :root[data-nav-top] .topbar > #lhsnbToggle{order:-1;}
  }

  @media (max-width: 430px){
    :root[data-many-boards] .board-tab{padding:7px 5px;font-size:.74rem;}
    :root[data-many-boards] .topbar > .board-tabs{padding:3px 2px;}
  }

  @media (max-width: 860px){
    /* Fit-to-width: the app scrolls only up and down, never sideways. */
    html,body{overflow-x:clip;}
    .topbar,.board-header,.board-wrap,.columns,.column,.column-header,.column-toolbar{max-width:100%;}

    .columns{flex-direction:column;padding:0 12px 12px;gap:12px;}
    .resizer{display:none;}
    .column{width:100% !important;min-height:0;}
    .lhsnb{position:fixed;left:0;top:var(--safe-top);bottom:0;z-index:40;box-shadow:var(--shadow-lg);padding-bottom:calc(16px + var(--safe-bottom));padding-left:calc(9px + var(--safe-left));}
    .lhsnb.collapsed{display:none;}
    .row2{grid-template-columns:1fr;}

    .help-hero{padding:10px 12px;gap:12px;}
    .help-hero img{width:84px;height:84px;}
    .done-tally-panel{width:min(280px,84vw);}
    /* Bell drop-down: only its width is set here. Where it hangs comes from
       syncHeaderPanelPositions(), which sets top/right inline (so a top/right
       written here would simply lose) and keeps the panel on the screen. */
    .notif-panel{width:min(340px,calc(100vw - 24px));max-width:none;}

    /* Board header wraps: title + actions on one line, subtitle drops below. */
    .board-header{flex-wrap:wrap;padding:12px 14px 6px;column-gap:10px;row-gap:2px;}
    .ov-switch-row{padding:12px 14px 0;}
    .ov-switch-row + .board-header{padding-top:6px;}
    .board-header h1{font-size:1.12rem;order:1;}
    .board-header .header-actions{order:2;margin-left:auto;}
    .board-header .sub{order:3;flex-basis:100%;margin-top:2px;}
    .board-header .board-search-wrap{order:4;flex-basis:100%;max-width:none;margin-top:6px;}
    .board-menu-row{padding:0 14px 6px;}
    .board-search-results{padding:10px 12px 16px;}

    /* Column + modal-list controls wrap rather than overflow their box. */
    .column-header{flex-wrap:wrap;row-gap:6px;}
    .quicklist-row{flex-wrap:wrap;}
    .quicklist-row .qtitle{min-width:0;word-break:break-word;}
    .agenda-row{flex-wrap:wrap;row-gap:6px;}
    .agenda-row .agenda-title,.agenda-row .agenda-title-input{min-width:0;flex-basis:100%;word-break:break-word;}
    .modal{padding:22px 17px 18px;}
    .modal-overlay{padding:calc(3vh + var(--safe-top)) calc(10px + var(--safe-right)) calc(3vh + var(--safe-bottom)) calc(10px + var(--safe-left));}

    /* Collapse mechanism is global now; these are the phone-only trims.
       On phones every column also starts collapsed on load (loadColCollapsed). */
    .column.collapsed .view-toggle{display:none;}
    .view-toggle{margin-left:0;}
    .column-body{overflow-y:visible;}
  }
  /* Phones: drop the wordmark and profile text so the top bar never overflows. */
  @media (max-width: 560px){
    .brand{gap:0;font-size:0;}
    .brand .logo-mark{font-size:25px;}
    .board-tab{padding:7px 12px;font-size:.8rem;}
    #profileChip{padding:4px;gap:0;flex-shrink:0;}
    #profileChip > span:not(.avatar){display:none;}
    .board-header .sub{font-size:.75rem;}

    /* Sub-item quick-add: the fields wrap and shrink to the modal width, and
       the "Add" button gets its own full-width line so it's an easy tap
       (no Enter key on a phone keyboard). */
    .quick-add-row{flex-wrap:wrap;}
    .quick-add-row > input,.quick-add-row > select{min-width:0;}
    .quick-add-row > input[type=text]{flex:1 1 130px;}
    .quick-add-row > input[type=date],
    .quick-add-row > .qadd-time,
    .quick-add-row > select{flex:1 1 70px;width:auto;}
    .quick-add-row > .qadd-btn{flex:1 1 100%;padding:12px 16px;margin-top:2px;}

    /* Tags field: same treatment — full-width "Add" under the input. */
    .tag-row{flex-wrap:wrap;}
    .tag-row > .qadd-btn{flex:1 1 100%;padding:12px 16px;margin-top:2px;}

    /* Meeting workspace: stack the two panes, switch with a segmented toggle. */
    .meet-shell{max-height:none;}
    .meet-body{flex-direction:column;overflow:visible;}
    .meet-col{overflow-y:visible;}
    .meet-col + .meet-col{border-left:none;border-top:1px solid var(--border);}
    .meet-body[data-tab="canvas"] .meet-col.ongoing{display:none;}
    .meet-body[data-tab="ongoing"] .meet-col.canvas{display:none;}
    .meet-tabs{
      display:flex;gap:2px;background:var(--surface-2);border:1px solid var(--border);
      border-radius:var(--radius-md);padding:2px;margin:10px 16px 0;
    }
    .meet-tabs button{
      flex:1;border:none;background:transparent;font-size:.78rem;font-weight:700;
      padding:7px 10px;border-radius:var(--radius-sm);cursor:pointer;color:var(--text-muted);
    }
    .meet-tabs button.on{background:var(--primary);color:var(--on-primary);}
  }
  @media (max-width: 860px) and (prefers-reduced-motion: reduce){
    .column-collapse{transition:none;}
  }

  /* Scroll chevrons — replaces native scrollbars app-wide with small
     always-visible up/down/left/right buttons, injected by
     scrollChevrons.js onto every scrollable element. */
  .dgo-scroll-host{scrollbar-width:none;-ms-overflow-style:none;}
  .dgo-scroll-host::-webkit-scrollbar{display:none;}
  .dgo-chevron-wrap{position:sticky;z-index:40;pointer-events:none;}
  .dgo-chevron-wrap-y-prev,.dgo-chevron-wrap-y-next{height:0;display:flex;justify-content:center;}
  .dgo-chevron-wrap-y-prev{top:0;}
  .dgo-chevron-wrap-y-next{bottom:0;}
  .dgo-chevron-wrap-y-prev .dgo-chevron-btn{transform:translateY(4px);}
  .dgo-chevron-wrap-y-next .dgo-chevron-btn{transform:translateY(calc(-100% - 4px));}
  .dgo-chevron-wrap-x-prev,.dgo-chevron-wrap-x-next{width:0;display:flex;align-items:center;}
  .dgo-chevron-wrap-x-prev{left:0;}
  .dgo-chevron-wrap-x-next{right:0;}
  .dgo-chevron-wrap-x-prev .dgo-chevron-btn{transform:translateX(4px);}
  .dgo-chevron-wrap-x-next .dgo-chevron-btn{transform:translateX(calc(-100% - 4px));}
  .dgo-chevron-hidden{display:none;}
  .dgo-chevron-btn{
    pointer-events:auto;width:22px;height:22px;flex-shrink:0;border-radius:999px;
    display:flex;align-items:center;justify-content:center;border:none;
    background:rgba(15,23,42,.55);color:#fff;cursor:pointer;
    box-shadow:0 1px 4px rgba(0,0,0,.3);transition:opacity .15s ease,background-color .15s ease;
  }
  .dgo-chevron-btn:hover:not(:disabled){background:rgba(15,23,42,.8);}
  .dgo-chevron-btn:disabled{opacity:.25;cursor:default;}
  .dgo-chevron-btn-fixed{position:fixed;right:calc(20px + var(--safe-right));width:36px;height:36px;z-index:100;}
  .dgo-chevron-fixed-up{bottom:calc(76px + var(--safe-bottom));}
  .dgo-chevron-fixed-down{bottom:calc(32px + var(--safe-bottom));}

  /* ============ PEER SUPPORT HOURS ============ */
  .psh-tabs{display:flex;gap:4px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:3px;}
  .psh-tab{
    border:none;background:transparent;padding:7px 14px;border-radius:var(--radius-sm);
    font-weight:700;font-size:.8rem;color:var(--text-muted);cursor:pointer;
  }
  .psh-tab.active{background:var(--primary);color:var(--on-primary);}
  .psh-body{flex:1;overflow:auto;padding:16px 18px 40px;}
  .psh-panel{max-width:920px;}
  .psh-card{
    background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);
    padding:14px 16px;margin-bottom:14px;box-shadow:var(--shadow-sm);
  }
  .psh-card h3{margin:0 0 10px;font-size:.92rem;font-weight:800;}
  .psh-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:10px 14px;}
  .psh-field label{
    display:block;font-size:.65rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
    color:var(--text-faint);margin-bottom:4px;
  }
  .psh-field input, .psh-field select, .psh-field textarea{
    width:100%;padding:8px 10px;border:1.5px solid var(--border);border-radius:var(--radius-sm);
    background:var(--bg-1);color:var(--text);font-size:.9rem;font-family:inherit;
  }
  .psh-field input:focus, .psh-field select:focus, .psh-field textarea:focus{outline:none;border-color:var(--primary);}
  .psh-check{display:flex;align-items:center;gap:7px;font-size:.82rem;color:var(--text);}
  .psh-bar{height:9px;border-radius:999px;background:var(--surface-2);overflow:hidden;margin:5px 0 3px;}
  .psh-bar span{display:block;height:100%;background:var(--primary);border-radius:999px;}
  .psh-bar.short span{background:var(--rank-b);}
  .psh-stat{display:flex;justify-content:space-between;gap:10px;font-size:.85rem;padding:5px 0;border-top:1px solid var(--border);}
  .psh-stat:first-of-type{border-top:none;}
  .psh-stat b{font-variant-numeric:tabular-nums;}
  .psh-note{font-size:.76rem;color:var(--text-muted);margin:6px 0 0;line-height:1.45;}
  .psh-warn{
    font-size:.78rem;color:var(--danger);background:var(--danger-tint);
    border-radius:var(--radius-sm);padding:8px 10px;margin-top:8px;
  }
  .psh-row{
    display:flex;align-items:baseline;gap:10px;padding:8px 0;border-top:1px solid var(--border);font-size:.86rem;
  }
  .psh-row:first-child{border-top:none;}
  .psh-row .psh-when{color:var(--text-faint);font-size:.76rem;min-width:84px;font-variant-numeric:tabular-nums;}
  .psh-row .psh-what{flex:1;}
  .psh-row .psh-hrs{font-weight:800;font-variant-numeric:tabular-nums;}
  .psh-row.excluded{opacity:.62;}
  .psh-pill{
    font-size:.6rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;
    background:var(--surface-2);color:var(--text-muted);padding:2px 7px;border-radius:var(--radius-sm);white-space:nowrap;
  }
  .psh-pill.school{background:var(--rank-b-tint);color:var(--rank-b);}
  .psh-pill.sent{background:var(--primary-tint);color:var(--primary);}
  .psh-pill.amended{background:var(--danger-tint);color:var(--danger);}
  .psh-month{
    font-size:.68rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;
    color:var(--text-faint);margin:14px 0 4px;
  }
  .psh-answer{display:flex;gap:10px;align-items:flex-start;padding:9px 0;border-top:1px solid var(--border);}
  .psh-answer:first-of-type{border-top:none;}
  .psh-answer .psh-q{flex:1;font-size:.82rem;}
  .psh-answer .psh-a{font-weight:800;font-variant-numeric:tabular-nums;white-space:pre-wrap;}
  .psh-answer .psh-detail{font-size:.76rem;color:var(--text-muted);margin-top:3px;white-space:pre-wrap;}
  @media (max-width:640px){
    .psh-body{padding:12px 12px 40px;}
    .psh-row{flex-wrap:wrap;}
  }

  /* ============ DIET ============ */
  /* Reuses the Peer Support Hours shell (.psh-*); these are the pieces it
     adds — stat tiles, the HTML column charts and the export card.
     Chart colours are their own tokens, checked per mode with a palette
     validator (lightness band, CVD separation, contrast) rather than the
     UI accents, which are tuned for text and pills, not bars. */
  :root{--diet-in:#1e7b4d;--diet-under:#b07d0c;--diet-over:#c0392b;--diet-added:#1e7b4d;--diet-natural:#7a4fb5;}
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){--diet-in:#2d955f;--diet-under:#b48f26;--diet-over:#bd5346;--diet-added:#33a06c;--diet-natural:#8a7fd8;}
  }
  :root[data-theme="dark"]{--diet-in:#2d955f;--diet-under:#b48f26;--diet-over:#bd5346;--diet-added:#33a06c;--diet-natural:#8a7fd8;}
  .diet-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:10px;margin:8px 0 12px;}
  .diet-tile{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:10px 12px;min-width:0;}
  .diet-tile .l{font-size:.65rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--text-faint);}
  .diet-tile .v{font-size:1.25rem;font-weight:700;color:var(--text);margin-top:2px;line-height:1.2;overflow-wrap:anywhere;}
  .diet-tile.hero .v{font-size:2.1rem;line-height:1.05;}
  .diet-tile .s{font-size:.72rem;color:var(--text-muted);margin-top:3px;line-height:1.35;}
  .diet-sub{font-size:.74rem;color:var(--text-muted);font-weight:500;}
  .diet-src{font-size:.62rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;color:var(--text-faint);margin-left:4px;}
  .diet-meter{height:9px;border-radius:999px;background:var(--primary-tint);overflow:hidden;margin-top:4px;}
  .diet-meter span{display:block;height:100%;background:var(--primary);border-radius:999px;}
  .diet-pill.ok{background:var(--primary-tint);color:var(--primary);}
  .diet-pill.under{background:var(--rank-a-tint);color:var(--rank-a);}
  .diet-pill.over{background:var(--danger-tint);color:var(--danger);}
  .diet-day{display:flex;align-items:baseline;gap:10px;margin:14px 0 2px;font-size:.78rem;}
  .diet-day:first-of-type{margin-top:0;}
  .diet-day-date{font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--text-faint);font-size:.68rem;}
  .diet-day-total{color:var(--text-muted);font-variant-numeric:tabular-nums;}
  .diet-row .psh-when{min-width:64px;}
  .diet-actions{display:inline-flex;gap:6px;}
  .diet-legend{display:flex;flex-wrap:wrap;gap:6px 14px;font-size:.74rem;color:var(--text-muted);margin:0 0 6px;}
  /* ---- Daily Brief (public/js/emailbrief.js) — yesterday's email in four
     columns. Reuses the full-bleed shell (.meet-shell / .meet-head / .psh-body);
     column accents are the rank tokens (Urgent = P, Today = A, This Week = B). */
  .eb-board{font-weight:600;color:var(--text-muted);font-size:.85rem;}
  .eb-datenav{display:flex;align-items:center;gap:4px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:2px;}
  .eb-nav{border:none;background:transparent;width:30px;height:28px;border-radius:var(--radius-sm);font-size:1.1rem;font-weight:800;color:var(--text);cursor:pointer;}
  .eb-nav:hover:not(:disabled){background:var(--surface);}
  .eb-nav:disabled{opacity:.3;cursor:default;}
  .eb-date{font-weight:700;font-size:.82rem;padding:0 6px;white-space:nowrap;}
  .eb-toggle{display:flex;align-items:center;gap:6px;font-size:.78rem;color:var(--text-muted);cursor:pointer;}
  .eb-body{padding-bottom:60px;}
  .eb-runs{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px;}
  .eb-run{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:8px 12px;font-size:.78rem;flex:1 1 260px;min-width:0;}
  .eb-run.err{border-color:var(--danger);}
  .eb-acct{font-weight:800;margin-right:8px;word-break:break-all;}
  .eb-stats{color:var(--text-muted);}
  .eb-runerr{color:var(--danger);margin-top:4px;}
  .eb-runnote{color:var(--text-muted);margin-top:4px;}
  .eb-learned{margin-top:6px;}
  .eb-learned summary{cursor:pointer;color:var(--primary);font-weight:700;}
  .eb-learned ul{margin:6px 0 0 18px;padding:0;line-height:1.45;}
  .eb-earlier{font-size:.8rem;color:var(--text-muted);margin:0 0 12px;}
  .eb-link{border:none;background:none;padding:0;color:var(--primary);font:inherit;font-weight:700;cursor:pointer;text-decoration:underline;text-underline-offset:2px;}
  .eb-cols{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:start;}
  .eb-col{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);padding:10px;min-width:0;}
  .eb-colhead{display:flex;align-items:center;gap:8px;margin:2px 2px 10px;}
  .eb-colhead h3{margin:0;font-size:.82rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;flex:1;}
  .eb-dot{width:10px;height:10px;border-radius:50%;background:var(--text-faint);flex:none;}
  .eb-col-urgent .eb-dot{background:var(--rank-p);}
  .eb-col-today .eb-dot{background:var(--rank-a);}
  .eb-col-week .eb-dot{background:var(--rank-b);}
  .eb-count{font-size:.72rem;font-weight:800;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:1px 8px;color:var(--text-muted);}
  .eb-col-urgent .eb-count{background:var(--rank-p-tint);color:var(--rank-p);border-color:transparent;}
  .eb-none{font-size:.78rem;color:var(--text-faint);padding:8px 4px;}
  .eb-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:11px 12px;margin-bottom:9px;box-shadow:var(--shadow-sm);font-size:.84rem;min-width:0;overflow-wrap:anywhere;}
  .eb-col-urgent .eb-card{border-left:4px solid var(--rank-p);}
  .eb-col-today .eb-card{border-left:4px solid var(--rank-a);}
  .eb-card.handled{opacity:.55;}
  .eb-meta{display:flex;align-items:baseline;gap:6px;font-size:.74rem;color:var(--text-muted);margin-bottom:3px;flex-wrap:wrap;}
  .eb-from{font-weight:800;color:var(--text);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .eb-acct-tag{background:var(--primary-tint);color:var(--primary);border-radius:var(--radius-sm);padding:0 7px;font-weight:700;font-size:.68rem;}
  .eb-when{margin-left:auto;white-space:nowrap;}
  .eb-subject{font-weight:800;line-height:1.3;margin-bottom:4px;}
  .eb-summary{line-height:1.45;color:var(--text);}
  .eb-why{font-size:.76rem;color:var(--text-muted);margin-top:5px;font-style:italic;}
  .eb-tag{display:inline-block;font-size:.66rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;background:var(--surface-2);color:var(--text-muted);border-radius:var(--radius-sm);padding:2px 8px;margin-top:6px;}
  .eb-suggest{display:flex;flex-direction:column;gap:5px;margin-top:9px;}
  .eb-chip{text-align:left;border:1.5px dashed var(--primary);background:var(--primary-tint-2);color:var(--text);border-radius:var(--radius-sm);padding:6px 9px;font:inherit;font-size:.78rem;cursor:pointer;line-height:1.35;}
  .eb-chip:hover{background:var(--primary-tint);}
  .eb-due{color:var(--text-muted);font-weight:700;margin-left:4px;}
  .eb-created{display:flex;flex-direction:column;gap:3px;margin-top:8px;font-size:.76rem;color:var(--primary);font-weight:700;}
  .eb-drafttoggle{display:block;margin-top:8px;font-size:.78rem;}
  .eb-draft{margin-top:6px;padding:8px 10px;border-left:3px solid var(--primary);background:var(--bg-1);border-radius:0 var(--radius-sm) var(--radius-sm) 0;white-space:pre-wrap;font-size:.8rem;line-height:1.45;}
  .eb-actions{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-top:10px;padding-top:9px;border-top:1px solid var(--border);}
  .eb-gap{flex:1;}
  .eb-btn{border:1px solid var(--border);background:var(--surface-2);color:var(--text);border-radius:var(--radius-sm);padding:5px 9px;font:inherit;font-size:.74rem;font-weight:700;cursor:pointer;text-decoration:none;white-space:nowrap;}
  .eb-btn:hover{border-color:var(--primary);}
  .eb-ghost{background:transparent;}
  .eb-primary{background:var(--primary);color:var(--on-primary);border-color:var(--primary);}
  .eb-move{border:1px solid var(--border);background:transparent;color:var(--text);border-radius:var(--radius-sm);padding:4px 4px;font:inherit;font-size:.74rem;max-width:110px;}
  .eb-state{font-size:.74rem;font-weight:800;color:var(--text-muted);}
  /* archive / label in Gmail from the card (applied by his Mac's inbox-agent poller) */
  .eb-mail{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin-top:8px;}
  .eb-mail:empty{display:none;}
  .eb-btn:disabled,.eb-move:disabled{opacity:.5;cursor:default;}
  .eb-mailstate{font-size:.72rem;font-weight:700;color:var(--text-muted);}
  .eb-mailstate.ok{color:var(--success,#1b7f3b);}
  .eb-mailstate.bad{color:var(--danger);}
  .eb-form{margin-top:10px;padding:10px;border:1.5px solid var(--primary);border-radius:var(--radius-sm);background:var(--bg-1);display:flex;flex-direction:column;gap:7px;}
  .eb-formhead{font-size:.7rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--text-faint);}
  .eb-form input{width:100%;padding:7px 9px;border:1.5px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--text);font:inherit;font-size:.84rem;min-width:0;}
  .eb-form input:focus{outline:none;border-color:var(--primary);}
  .eb-formrow{display:flex;gap:6px;align-items:center;flex-wrap:wrap;}
  .eb-formrow input{flex:1 1 120px;width:auto;}
  .eb-hint{font-size:.72rem;color:var(--text-faint);}
  @media (max-width:1100px){ .eb-cols{grid-template-columns:repeat(2,minmax(0,1fr));} }
  @media (max-width:640px){
    .eb-cols{grid-template-columns:minmax(0,1fr);}
    .eb-datenav{order:5;}
    .eb-date{font-size:.78rem;}
  }

  /* ---- Mail (public/js/mail.js) — the Work board's Mail tab. Reuses the
     full-bleed shell (.meet-shell / .meet-head / .psh-tabs); the rest is
     its own: a thread list beside a reading pane, a composer that docks
     bottom-right (full screen on a phone). ---- */
  .mail-shell{position:relative;}
  .mail-head{gap:8px;}
  .mail-folders{flex-wrap:nowrap;}
  .mail-folders .psh-tab{white-space:nowrap;}
  .mail-tab-n{display:inline-block;min-width:18px;padding:0 5px;margin-left:3px;border-radius:999px;background:var(--accent);color:var(--on-accent);font-size:.66rem;line-height:18px;text-align:center;vertical-align:1px;}
  .psh-tab.active .mail-tab-n{background:var(--on-primary);color:var(--primary);}
  .mail-search-wrap{position:relative;flex:0 1 240px;min-width:120px;margin:0;}
  .mail-search{width:100%;border:1.5px solid var(--border);border-radius:var(--radius-md);padding:7px 30px 7px 12px;font:inherit;font-size:.82rem;background:var(--surface);color:var(--text);-webkit-appearance:none;}
  .mail-search:focus{outline:none;border-color:var(--primary);}
  .mail-search-clear{position:absolute;right:4px;top:50%;transform:translateY(-50%);font-size:1rem;}
  .mail-btn{border:1.5px solid var(--border);background:var(--surface);color:var(--text);border-radius:var(--radius-md);padding:6px 12px;font:inherit;font-size:.8rem;font-weight:700;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;gap:5px;white-space:nowrap;line-height:1.2;}
  .mail-btn:hover{border-color:var(--border-strong);background:var(--surface-2);}
  .mail-btn.primary{background:var(--primary);border-color:var(--primary);color:var(--on-primary);}
  .mail-btn.primary:hover{background:var(--primary-hover);border-color:var(--primary-hover);}
  .mail-btn.danger{color:var(--danger);}
  .mail-btn.quiet{border-color:transparent;background:transparent;color:var(--text-muted);}
  .mail-btn[disabled]{opacity:.6;cursor:default;}
  .mail-link{border:none;background:none;color:var(--primary);font:inherit;font-size:.8rem;font-weight:700;cursor:pointer;padding:0 2px;text-decoration:underline;}
  .mail-refresh.spin{animation:mailspin 1s linear infinite;}
  @keyframes mailspin{to{transform:rotate(360deg);}}
  .mail-notes{padding:0 18px;}
  .mail-notes[hidden]{display:none;}
  .mail-note{margin:10px 0 0;padding:9px 12px;border-radius:var(--radius-sm);background:var(--rank-a-tint);color:var(--text);font-size:.8rem;line-height:1.45;}
  .mail-body{flex:1;display:flex;min-height:0;}
  .mail-side{width:220px;flex:0 0 220px;border-right:1px solid var(--border);overflow:auto;background:var(--surface-2);padding:6px 0 20px;}
  .mail-side-head{display:flex;align-items:center;justify-content:space-between;padding:6px 8px 6px 14px;font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint);}
  .mail-side-add{border:none;background:none;color:var(--primary);font-size:1.15rem;line-height:1;cursor:pointer;padding:2px 6px;border-radius:6px;}
  .mail-side-add:hover{background:var(--surface);}
  .mail-side-empty{padding:8px 14px;font-size:.78rem;line-height:1.5;color:var(--text-muted);}
  .mail-side-empty .mail-btn{margin-top:10px;}
  .mail-node{display:flex;align-items:center;gap:2px;min-height:32px;padding-right:4px;margin:0 6px;border-radius:var(--radius-sm);cursor:pointer;font-size:.85rem;color:var(--text);}
  .mail-node:hover{background:var(--surface);}
  .mail-node.active{background:var(--primary-tint);font-weight:800;}
  .mail-node.dropping{background:var(--primary-tint);outline:2px dashed var(--primary);outline-offset:-2px;}
  .mail-caret{flex:0 0 20px;width:20px;border:none;background:none;color:var(--text-muted);cursor:pointer;font-size:.8rem;padding:0;line-height:28px;}
  .mail-caret.none{display:inline-block;cursor:default;}
  .mail-node-name{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .mail-node-total{font-size:.7rem;color:var(--text-faint);font-variant-numeric:tabular-nums;}
  .mail-node-more{border:none;background:none;color:var(--text-muted);cursor:pointer;font-size:1rem;line-height:1;padding:4px 6px;border-radius:6px;opacity:0;}
  .mail-node:hover .mail-node-more,.mail-node.active .mail-node-more,.mail-node-more:focus{opacity:1;}
  .mail-node-more:hover{background:var(--border);}
  @media (hover:none){.mail-node-more{opacity:1;}}
  .mail-treebtn{display:none;}
  .mail-row.dragging{opacity:.45;}
  .mail-folder-pill.filed{background:var(--primary-tint);color:var(--primary);text-transform:none;letter-spacing:0;font-size:.68rem;}
  .mail-menu{position:fixed;z-index:40;min-width:200px;max-width:min(320px,calc(100vw - 16px));max-height:min(420px,calc(100vh - 24px));overflow:auto;background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius-md);box-shadow:var(--shadow-lg);padding:5px;}
  .mail-menu-item{display:block;width:100%;text-align:left;border:none;background:none;color:var(--text);font:inherit;font-size:.84rem;padding:8px 12px;border-radius:var(--radius-sm);cursor:pointer;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .mail-menu-item:hover{background:var(--surface-2);}
  .mail-menu-item.on{font-weight:800;color:var(--primary);}
  .mail-menu-item.danger{color:var(--danger);}
  .mail-menu-sep{height:1px;background:var(--border);margin:5px 4px;}
  .mail-menu-title{padding:6px 12px 4px;font-size:.66rem;font-weight:800;text-transform:uppercase;letter-spacing:.06em;color:var(--text-faint);}
  .mail-menu-note{padding:6px 12px;font-size:.78rem;color:var(--text-faint);}
  .mail-dlg-back{position:absolute;inset:0;z-index:50;background:rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;padding:16px;}
  .mail-dlg{background:var(--surface);border:1px solid var(--border-strong);border-radius:var(--radius-md);box-shadow:var(--shadow-lg);padding:16px;width:min(360px,100%);display:flex;flex-direction:column;gap:12px;}
  .mail-dlg input{border:1.5px solid var(--border);border-radius:var(--radius-sm);padding:9px 10px;font:inherit;font-size:.95rem;background:var(--surface);color:var(--text);}
  .mail-dlg input:focus{outline:none;border-color:var(--primary);}
  .mail-dlg-btns{display:flex;justify-content:flex-end;gap:8px;}
  .mail-list{width:360px;flex:0 0 360px;border-right:1px solid var(--border);overflow:auto;background:var(--surface);}
  .mail-read{flex:1;min-width:0;overflow:auto;padding:0 0 40px;}
  .mail-read-empty{color:var(--text-faint);font-size:.85rem;padding:60px 20px;text-align:center;}
  .mail-row{display:flex;gap:4px;padding:10px 10px 10px 4px;border-bottom:1px solid var(--border);cursor:pointer;align-items:flex-start;}
  .mail-row:hover{background:var(--surface-2);}
  .mail-row.selected{background:var(--primary-tint);}
  .mail-row.unread{box-shadow:inset 3px 0 0 var(--primary);}
  .mail-row-main{flex:1;min-width:0;}
  .mail-row-top{display:flex;align-items:baseline;gap:6px;font-size:.8rem;color:var(--text-muted);}
  .mail-from{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--text);}
  .mail-row.unread .mail-from,.mail-row.unread .mail-subject{font-weight:800;}
  .mail-count-n{font-size:.7rem;color:var(--text-faint);}
  .mail-date{font-size:.72rem;color:var(--text-faint);white-space:nowrap;font-variant-numeric:tabular-nums;}
  .mail-subject{font-size:.86rem;color:var(--text);margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .mail-snippet{font-size:.76rem;color:var(--text-muted);margin-top:1px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .mail-clip{font-size:.75rem;}
  .mail-folder-pill{display:inline-block;font-size:.62rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em;padding:1px 6px;border-radius:var(--radius-sm);background:var(--surface-2);color:var(--text-muted);vertical-align:middle;}
  .mail-star{border:none;background:none;color:var(--text-faint);font-size:1.05rem;line-height:1;cursor:pointer;padding:3px 5px;flex:0 0 auto;}
  .mail-star.on{color:var(--accent);}
  .mail-star.big{font-size:1.3rem;}
  .mail-row-x{border:none;background:none;color:var(--text-faint);cursor:pointer;font-size:.9rem;padding:2px 6px;}
  .mail-more{display:block;width:100%;border:none;background:var(--surface-2);color:var(--primary);font:inherit;font-weight:700;font-size:.8rem;padding:10px;cursor:pointer;}
  .mail-trash-note{font-size:.74rem;color:var(--text-faint);padding:12px;line-height:1.5;}
  .mail-thread-head{position:sticky;top:0;z-index:2;background:var(--bg-0);padding:10px 18px 8px;border-bottom:1px solid var(--border);}
  .mail-thread-head h3{margin:6px 0 0;font-size:1.05rem;font-weight:800;line-height:1.3;overflow-wrap:anywhere;}
  .mail-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;}
  .mail-actions .mail-star{margin-left:auto;}
  .mail-back{display:none;border:1.5px solid var(--border);background:var(--surface);border-radius:999px;width:32px;height:32px;font-size:1.2rem;line-height:1;cursor:pointer;color:var(--text);flex:0 0 auto;}
  .mail-msgs{padding:10px 18px 0;}
  .mail-msg{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);margin:0 0 10px;overflow:hidden;}
  .mail-msg.trashed{opacity:.7;}
  .mail-msg-head{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;}
  .mail-msg.collapsed .mail-msg-head{cursor:pointer;padding:9px 14px;align-items:center;}
  .mail-avatar{flex:0 0 32px;width:32px;height:32px;border-radius:50%;background:var(--primary-tint);color:var(--primary);font-weight:800;display:flex;align-items:center;justify-content:center;font-size:.9rem;}
  .mail-avatar.me{background:var(--accent);color:var(--on-accent);}
  .mail-msg-who{flex:1;min-width:0;font-size:.86rem;line-height:1.35;}
  .mail-msg-addr{color:var(--text-muted);font-size:.78rem;}
  .mail-msg-to{color:var(--text-muted);font-size:.76rem;overflow-wrap:anywhere;}
  .mail-msg-snip{display:block;color:var(--text-muted);font-size:.76rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
  .mail-msg-date{font-size:.72rem;color:var(--text-faint);white-space:nowrap;}
  .mail-msg-images{font-size:.76rem;color:var(--text-muted);padding:0 14px 8px;}
  .mail-frame{display:block;width:100%;border:none;background:#fff;min-height:120px;height:400px;}
  .mail-text{padding:4px 14px 12px;font-size:.92rem;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere;}
  .mail-text .mail-q{color:var(--text-muted);border-left:3px solid var(--border-strong);padding-left:10px;margin-left:2px;white-space:pre-wrap;}
  .mail-text a{color:var(--primary);}
  .mail-msg-atts{display:flex;flex-wrap:wrap;gap:6px;padding:6px 14px 4px;}
  .mail-att{display:inline-flex;align-items:center;gap:5px;border:1px solid var(--border);border-radius:var(--radius-sm);padding:4px 10px;font-size:.78rem;color:var(--text);text-decoration:none;background:var(--surface-2);max-width:100%;}
  .mail-att span{color:var(--text-faint);font-size:.7rem;}
  .mail-msg-foot{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:8px 14px 12px;}
  .mail-foot-note{font-size:.74rem;color:var(--text-faint);}
  .mail-compose{position:absolute;right:18px;bottom:0;width:min(600px,calc(100% - 36px));height:min(640px,calc(100% - 70px));display:flex;flex-direction:column;background:var(--surface);border:1px solid var(--border-strong);border-bottom:none;border-radius:var(--radius-md) var(--radius-md) 0 0;box-shadow:var(--shadow-lg);z-index:5;}
  .mail-compose-head{display:flex;align-items:center;gap:8px;padding:10px 12px;border-bottom:1px solid var(--border);font-size:.9rem;}
  .mail-compose-fields{display:grid;grid-template-columns:auto 1fr;gap:4px 10px;align-items:center;padding:8px 12px;border-bottom:1px solid var(--border);}
  .mail-compose-fields label{font-size:.68rem;font-weight:800;text-transform:uppercase;letter-spacing:.05em;color:var(--text-faint);}
  .mail-compose-fields input,.mail-compose-fields select{width:100%;border:none;border-bottom:1px solid var(--border);background:transparent;padding:5px 2px;font:inherit;font-size:.86rem;color:var(--text);border-radius:0;}
  .mail-compose-fields input:focus,.mail-compose-fields select:focus{outline:none;border-bottom-color:var(--primary);}
  .mail-compose-row{display:flex;align-items:center;gap:6px;min-width:0;}
  .mail-compose-row input{flex:1;min-width:0;}
  .mail-compose-static{font-size:.86rem;color:var(--text-muted);padding:5px 2px;}
  #mcText{flex:1;min-height:140px;resize:none;border:none;padding:12px;font:inherit;font-size:.92rem;line-height:1.5;background:transparent;color:var(--text);}
  #mcText:focus{outline:none;}
  .mail-compose-atts{display:flex;flex-wrap:wrap;gap:6px;padding:0 12px 6px;}
  .mail-compose-atts:empty{display:none;}
  .mail-att.chip{padding-right:6px;}
  .mail-chip-x{border:none;background:none;color:var(--text-faint);cursor:pointer;font-size:.8rem;padding:0 2px;}
  .mail-compose-foot{display:flex;align-items:center;gap:8px;padding:10px 12px;border-top:1px solid var(--border);}
  .mail-attach{cursor:pointer;}
  .mail-draft-state{font-size:.72rem;color:var(--text-faint);}
  @media (max-width:860px){
    .mail-head{padding:10px 12px;gap:6px;}
    .mail-head h2{display:none;}
    .mail-folders{order:5;width:100%;overflow-x:auto;scrollbar-width:none;}
    .mail-search-wrap{flex:1 1 100px;}
    .mail-body{position:relative;}
    .mail-list{width:100%;flex:1 1 auto;border-right:none;}
    .mail-side{display:none;width:100%;flex:1 1 auto;border-right:none;}
    .mail-treebtn{display:inline-block;order:-1;}
    .mail-shell.tree .mail-side{display:block;}
    .mail-shell.tree .mail-list,.mail-shell.tree .mail-read{display:none !important;}
    .mail-node{min-height:42px;font-size:.95rem;}
    .mail-read{display:none;}
    .mail-shell.reading .mail-list{display:none;}
    .mail-shell.reading .mail-read{display:block;}
    .mail-back{display:inline-flex;align-items:center;justify-content:center;}
    .mail-msgs{padding:8px 10px 0;}
    .mail-thread-head{padding:8px 10px 6px;}
    .mail-compose{right:0;left:0;width:100%;height:100%;max-height:100%;border-radius:0;border:none;}
  }

  .diet-legend span{display:inline-flex;align-items:center;gap:6px;}
  .diet-sw{display:inline-block;width:12px;height:12px;border-radius:3px;background:var(--surface-2);}
  .diet-sw.in{background:var(--diet-in);}
  .diet-sw.added{background:var(--diet-added);}
  .diet-sw.under{background:var(--diet-under);}
  .diet-sw.over{background:var(--diet-over);}
  .diet-sw.natural{background:var(--diet-natural);}
  .diet-sw.band{background:var(--primary-tint);border:1px solid var(--border);}
  .diet-sw.line{height:0;border-top:2px solid var(--diet-under);border-radius:0;}
  /* The chart: a y-axis column and the plot; columns are flex slots. */
  .diet-chart{display:flex;gap:6px;height:var(--diet-h,170px);margin:6px 0 26px;}
  .diet-y{position:relative;width:26px;flex:none;font-size:.66rem;color:var(--text-faint);font-variant-numeric:tabular-nums;}
  .diet-y span{position:absolute;right:0;transform:translateY(50%);}
  .diet-plot{position:relative;flex:1;min-width:0;border-bottom:1px solid var(--border);}
  .diet-grid{position:absolute;left:0;right:0;border-top:1px solid var(--border);opacity:.6;}
  .diet-band{position:absolute;left:0;right:0;background:var(--primary-tint);opacity:.55;}
  .diet-line{position:absolute;left:0;right:0;border-top:2px solid var(--diet-under);}
  .diet-line span{position:absolute;right:0;top:-1.05rem;z-index:1;font-size:.66rem;color:var(--text-muted);background:var(--surface);padding:0 3px;border-radius:3px;}
  .diet-cols{position:absolute;inset:0;display:flex;align-items:stretch;gap:2px;}
  .diet-col{position:relative;flex:1 1 0;min-width:0;display:flex;justify-content:center;border-radius:3px;outline:none;cursor:default;}
  .diet-col:hover,.diet-col:focus-visible{background:var(--primary-tint-2);}
  .diet-col.today{background:var(--primary-tint-2);}
  .diet-bar{width:100%;max-width:24px;height:100%;display:flex;flex-direction:column-reverse;gap:2px;}
  .diet-seg{display:block;width:100%;flex:none;}
  .diet-seg:last-child{border-radius:4px 4px 0 0;}
  .diet-seg.in{background:var(--diet-in);}
  .diet-seg.added{background:var(--diet-added);}
  .diet-seg.under{background:var(--diet-under);}
  .diet-seg.over{background:var(--diet-over);}
  .diet-seg.natural{background:var(--diet-natural);}
  .diet-col:hover .diet-seg,.diet-col:focus-visible .diet-seg{filter:brightness(1.12);}
  .diet-col.future .diet-bar{background:repeating-linear-gradient(135deg,transparent 0 3px,var(--border) 3px 4px);opacity:.35;border-radius:4px 4px 0 0;}
  .diet-x{position:absolute;top:100%;left:0;margin-top:4px;font-size:.64rem;color:var(--text-faint);white-space:nowrap;}
  .diet-col:last-child .diet-x{left:auto;right:0;}
  .diet-mark{position:absolute;left:50%;transform:translate(-50%,-5px);font-size:.66rem;font-weight:800;line-height:1;}
  .diet-mark.over{color:var(--diet-over);}
  .diet-tip{position:absolute;top:-6px;transform:translateY(-100%);max-width:260px;background:var(--text);color:var(--bg-0);font-size:.74rem;line-height:1.35;padding:6px 9px;border-radius:var(--radius-sm);box-shadow:var(--shadow-sm);pointer-events:none;z-index:2;}
  .diet-table-wrap{margin-top:4px;font-size:.78rem;}
  .diet-table-wrap summary{cursor:pointer;color:var(--text-muted);font-weight:700;}
  .diet-table{width:100%;border-collapse:collapse;margin-top:8px;font-variant-numeric:tabular-nums;}
  .diet-table th,.diet-table td{text-align:left;padding:5px 8px;border-top:1px solid var(--border);}
  .diet-table th{font-size:.64rem;letter-spacing:.06em;text-transform:uppercase;color:var(--text-faint);border-top:none;}
  .diet-export summary{display:flex;align-items:baseline;gap:10px;cursor:pointer;list-style:none;}
  .diet-export summary::-webkit-details-marker{display:none;}
  .diet-export summary h3{margin:0;}
  .diet-export summary::before{content:"▸";color:var(--text-faint);font-size:.8rem;}
  .diet-export[open] summary::before{content:"▾";}
  .diet-cols-pick{display:flex;flex-wrap:wrap;gap:6px 16px;margin:12px 0 4px;}
  .diet-export .btn.disabled{opacity:.5;pointer-events:none;}
  @media (max-width:640px){
    .diet-tiles{grid-template-columns:repeat(2,1fr);}
    .diet-tile.hero{grid-column:span 2;}
    .diet-row{display:grid;grid-template-columns:64px minmax(0,1fr) auto;grid-template-areas:"when what amt" "when actions actions";column-gap:10px;row-gap:6px;align-items:baseline;}
    .diet-row .psh-when{grid-area:when;min-width:0;}
    .diet-row .psh-what{grid-area:what;min-width:0;}
    .diet-row .psh-hrs{grid-area:amt;white-space:nowrap;}
    .diet-row .diet-actions{grid-area:actions;justify-self:end;}
    .diet-chart{height:150px;}
    .diet-x{font-size:.58rem;}
  }
  /* ============ RECOVERY ============ */
  /* The Recovery board ($RB): a tab strip, then Today's columns or a screen full-width (public/js/recovery.js mountBoard). */
  .board-switch-recovery{--board-dx:14px;}
  .rec-board-area{flex:1;min-height:0;display:flex;flex-direction:column;}
  .rec-screen{flex:1;min-height:0;overflow:auto;padding:0 16px 24px;}
  .rec-screen .psh-panel{max-width:none;}
  .rec-logcards{display:flex;flex-direction:column;gap:10px;}
  .rec-logcards .rec-logcard.dragging{opacity:.3;border-style:dashed;}
  .rec-logcards.rec-tile-ghost{position:fixed;z-index:1000;pointer-events:none;opacity:.92;box-shadow:var(--shadow-lg);border-radius:var(--radius-lg);}
  .rec-logcards.rec-tile-ghost .rec-logcard-head{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);}
  @media (max-width:860px){ .rec-screen{padding:0 12px 20px;} }
  /* a board page (Samantha's Recip-ez under Nourishment): a tab of its own where the columns go */
  .board-page-area{flex:1;min-height:0;display:flex;flex-direction:column;}
  .board-page{flex:1;min-height:0;overflow:auto;padding:0 16px 24px;}
  @media (max-width:860px){ .board-page{padding:0 12px 20px;} }
  /* Each column is at least as wide as the tab is on a phone, so its cards lay out as they do there; six of
     them fit a wide screen and scroll sideways on a narrower one. A column with a form open gets more room. */
  .rec-board{overflow-x:auto;overflow-y:hidden;gap:12px;scroll-snap-type:x proximity;}
  .rec-board .column{flex:1 0 330px;min-width:330px;max-width:560px;scroll-snap-align:start;}
  .rec-board .column.rec-wide{flex:2 0 480px;min-width:480px;max-width:760px;}
  .rec-board .column-header h2{white-space:nowrap;}
  .rec-board .column-sub{margin-left:auto;display:inline-flex;align-items:center;gap:6px;font-size:.72rem;font-weight:600;color:var(--text-muted);min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
  .rec-board .rec-bnav{display:inline-flex;gap:3px;}
  .rec-board .rec-bnav .ghost-btn{padding:1px 8px;font-size:.82rem;line-height:1.4;}
  .rec-board .column-body{gap:10px;}
  .rec-board .psh-card{margin:0;}
  .rec-board .psh-panel{padding:0;}
  .rec-board .diet-tiles{grid-template-columns:1fr;gap:8px;}
  .rec-board .rec-sechead{margin:4px 0 0;}
  /* the Log column's cards: one per loggable item, folding like a column */
  .rec-logcard{padding:0;overflow:hidden;}
  /* the head is a bar: it fills left to right with the day's completion (--fill, in the item's colour --kc) */
  .rec-logcard-head{display:flex;align-items:center;gap:8px;padding:9px 8px 9px 12px;cursor:pointer;user-select:none;
    background:linear-gradient(90deg,color-mix(in srgb,var(--kc,var(--primary)) 32%,transparent) var(--fill,0%),transparent var(--fill,0%));}
  .rec-logcard-head:hover{filter:brightness(1.06);}
  .rec-logcard-head .rec-ico{font-size:1.2rem;line-height:1;}
  .rec-logcard-head strong{font-size:.95rem;}
  .rec-logcard-head .rec-brow-sub{margin-left:auto;font-size:.74rem;color:var(--text-muted);white-space:nowrap;}
  .rec-logcard-head .col-chevron{margin-left:0;}
  .rec-logcard-plus{flex:none;width:28px;height:28px;border-radius:50%;border:1px solid var(--border);background:var(--surface);color:var(--text);font:inherit;font-size:1.2rem;line-height:1;display:inline-flex;align-items:center;justify-content:center;padding:0 0 2px;cursor:pointer;}
  .rec-logcard-plus:hover{background:var(--primary);color:var(--on-primary);border-color:var(--primary);}
  .rec-logcard .col-chevron{transform:rotate(180deg);}
  .rec-logcard.collapsed .col-chevron{transform:none;}
  .rec-logcard-body{padding:4px 12px 10px;border-top:1px solid var(--border);}
  .rec-logcard-figs{padding:6px 0 4px;}
  .rec-logcard-figs .rec-minis{margin-top:0;gap:5px;}
  .rec-logcard-figs .rec-mini{font-size:.74rem;}
  .rec-logcard-figs .rec-mini-bar{height:7px;}
  .rec-targets .rec-minis{gap:6px;margin:0 0 4px;} .rec-targets .rec-mini{font-size:.76rem;} .rec-targets .rec-mini-bar{height:7px;} .rec-targets .rec-mini-l{max-width:48%;}
  .rec-targets details{margin-top:6px;} .rec-targets summary{font-weight:700;font-size:.8rem;cursor:pointer;margin-bottom:6px;}
  .rec-logcard-figs .rec-spark{margin-top:0;} .rec-logcard-figs .rec-spark svg{height:40px;} .rec-logcard-figs .rec-spark-v{font-size:.95rem;}
  .rec-logcard-figs .rec-slots{margin-top:0;gap:6px;} .rec-logcard-figs .rec-slot{width:20px;height:20px;line-height:18px;font-size:.78rem;}
  .rec-logcard-figs .rec-check{margin-top:0;font-size:1.1rem;}
  .rec-logcard .rec-list .psh-row{padding:7px 0;}
  /* entry rows in a 330 px column: the actions drop to their own line instead of squeezing the text */
  .rec-board .rec-row{flex-wrap:wrap;gap:4px 8px;}
  .rec-board .rec-row .psh-when{min-width:38px;font-size:.8rem;}
  .rec-board .rec-row .psh-what{flex:1 1 60%;min-width:0;}
  .rec-board .rec-row .diet-actions{flex:0 0 100%;display:flex;justify-content:flex-end;gap:6px;margin:0;}
  .rec-board .rec-row .diet-actions .ghost-btn,.rec-board .rec-row .diet-actions .btn{padding:3px 9px;font-size:.78rem;}
  .rec-logcard .psh-note{margin:6px 0 2px;}
  /* the Food D-Base (the tab's last screen, the board's last column) */
  .rec-fdb-modes{margin:0 0 8px;flex-wrap:wrap;}
  .rec-fdb-add .rec-inline{display:flex;gap:6px;margin:6px 0;} .rec-fdb-add .rec-inline input{flex:1;min-width:0;}
  .rec-fdb-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(96px,1fr));gap:6px;margin:6px 0;}
  .rec-fdb-grid.wide{grid-template-columns:repeat(auto-fill,minmax(130px,1fr));}
  .rec-fdb-grid label{display:flex;flex-direction:column;gap:2px;font-size:.7rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;color:var(--text-muted);}
  .rec-fdb-grid input{width:100%;min-width:0;font:inherit;font-size:.9rem;padding:5px 7px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);color:var(--text);}
  .rec-fdb-prev{margin-top:8px;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface-2);}
  .rec-fdb-prev .rec-item-top{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
  .rec-fdb-row .rec-fdb-link{font-size:.78rem;margin-left:4px;}
  .rec-fdb-edit{margin-top:6px;}
  [data-fdb-list]{margin-top:6px;}
  .rec-brows{display:flex;flex-direction:column;gap:6px;}
  .rec-brow{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);cursor:pointer;font:inherit;color:inherit;text-align:left;}
  .rec-brow:hover{border-color:var(--primary);background:var(--primary-tint);}
  .rec-brow .rec-ico{font-size:1.25rem;line-height:1;}
  .rec-brow .rec-brow-l{font-weight:700;}
  .rec-brow .rec-brow-sub{margin-left:auto;font-size:.74rem;color:var(--text-muted);white-space:nowrap;}
  @media (max-width:860px){ .rec-board{overflow:visible;} .rec-board .column,.rec-board .column.rec-wide{flex:auto;min-width:0;max-width:none;} }
  /* Reuses the Peer Support Hours / Diet shell and tiles; these are the
     pieces it adds. Chart colours follow the thing measured (pain is always
     blue, doses always orange …) and were checked per mode with the palette
     validator against the card surfaces. */
  :root{--rec-pain:#2a78d6;--rec-dose:#eb6834;--rec-fluids:#1baf7a;--rec-activity:#eda100;--rec-mood:#e87ba4;--rec-sleep:#4a3aa7;--rec-food:#0f98a8;}
  @media (prefers-color-scheme: dark){
    :root:not([data-theme="light"]){--rec-pain:#3987e5;--rec-dose:#d95926;--rec-fluids:#199e70;--rec-activity:#c98500;--rec-mood:#d55181;--rec-sleep:#9085e9;--rec-food:#1a9db0;}
  }
  :root[data-theme="dark"]{--rec-pain:#3987e5;--rec-dose:#d95926;--rec-fluids:#199e70;--rec-activity:#c98500;--rec-mood:#d55181;--rec-sleep:#9085e9;--rec-food:#1a9db0;}
  .rec-dayhead{display:flex;align-items:center;gap:10px;margin:0 0 10px;}
  .rec-daytitle{flex:1;text-align:center;line-height:1.25;}
  .rec-daytitle strong{display:block;font-size:1.05rem;}
  .rec-daytitle span{font-size:.74rem;color:var(--text-muted);}
  .rec-quick{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;margin:0 0 12px;}
  .rec-quick button{display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 2px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--text);font:inherit;font-size:.72rem;font-weight:600;cursor:pointer;}
  .rec-quick button:hover{background:var(--surface-2);}
  .rec-quick .rec-ico{font-size:1.15rem;line-height:1;}
  .rec-quick button{align-items:stretch;justify-content:flex-start;}
  .rec-quick .rec-ico,.rec-quick .rec-qlabel{align-self:center;}
  .rec-quick button{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}
  .rec-quick button.dragging{opacity:.3;border-style:dashed;}
  .rec-tile-ghost{position:fixed;z-index:10000;pointer-events:none;display:block;margin:0;}
  .rec-tile-ghost button{width:100%;box-shadow:0 12px 28px rgba(0,0,0,.28);transform:scale(1.04);background:var(--surface-2);}
  .rec-tilehint{margin:-6px 0 12px;font-size:.72rem;color:var(--text-faint);}
  /* rounds of physio */
  .rec-rounds .rec-rslot{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--border);}
  .rec-rounds .rec-rslot:first-child{border-top:0;padding-top:0;}
  .rec-rslot-ico{font-size:1.2rem;flex:none;}
  .rec-rslot-main{flex:1;min-width:0;display:flex;flex-wrap:wrap;gap:2px 8px;align-items:baseline;}
  .rec-rslot-done{color:var(--rec-fluids);font-weight:600;} .rec-rslot-now{color:var(--rec-activity);font-weight:600;}
  .rec-rslot-foot{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;border-top:1px solid var(--border);padding-top:10px;margin-top:6px;}
  .rec-rslot-foot .psh-note{flex:1;min-width:200px;margin:0;}
  .rec-round-grid{display:grid;gap:4px 3px;align-items:center;margin:2px 0 12px;font-size:.72rem;color:var(--text-faint);}
  .rec-round-col{text-align:center;} .rec-round-row{padding-right:6px;white-space:nowrap;}
  .rec-round-cell{display:block;height:12px;border-radius:4px;background:var(--surface-2);border:1px solid var(--border);}
  .rec-round-cell.done{background:var(--rec-activity);border-color:var(--rec-activity);}
  .rec-round-cell.skipped{background:repeating-linear-gradient(45deg,var(--surface-2),var(--surface-2) 3px,var(--border) 3px,var(--border) 5px);}
  .rec-round-cell.now{outline:2px solid var(--primary);outline-offset:1px;}
  .rec-round-now{text-align:center;}
  .rec-ptanim.rec-round-art{width:100%;max-width:360px;height:170px;margin:4px auto 8px;cursor:default;}
  .rec-round-name{font-size:1.25rem;font-weight:700;margin:2px 0;}
  .rec-round-reps{font-size:1.05rem;color:var(--text-muted);margin:0 0 6px;}
  .rec-round-done{display:block;width:100%;font-size:1.05rem;padding:14px 12px;margin:12px 0 8px;}
  .rec-round-pain{justify-content:center;}
  /* pain through the day */
  .rec-heat-wrap{overflow-x:auto;}
  .rec-heat{border-collapse:separate;border-spacing:2px;width:100%;table-layout:fixed;font-size:.68rem;}
  .rec-heat th{font-weight:600;color:var(--text-faint);padding:0 0 2px;text-align:center;}
  .rec-heat td{text-align:center;padding:0;height:17px;border-radius:3px;background:var(--surface-2);color:var(--text-faint);}
  .rec-heat td.day{text-align:left;padding:0 4px;white-space:nowrap;width:62px;background:transparent;color:var(--text-muted);}
  .rec-heat td.has{color:var(--text);font-weight:600;}
  .rec-heat tr.avg td{font-weight:700;color:var(--text);}
  .rec-heat tr.avg td.day{color:var(--text-muted);}
  /* the small progress under a tile: one row per thing measured */
  .rec-minis{display:flex;flex-direction:column;gap:3px;width:100%;margin-top:4px;}
  .rec-spark{display:flex;align-items:center;gap:6px;width:100%;margin-top:4px;}
  .rec-spark svg{flex:1;min-width:0;height:26px;overflow:visible;}
  .rec-spark-axis{stroke:var(--border);stroke-width:1;} .rec-spark-tick{stroke:var(--border);stroke-width:.6;stroke-dasharray:1.5 2;}
  .rec-spark-line{fill:none;stroke:var(--rec-pain);stroke-width:1.2;vector-effect:non-scaling-stroke;}
  .rec-spark-dot{fill:var(--rec-pain);stroke:var(--surface);stroke-width:1;}
  .rec-spark-dose{stroke:var(--rec-dose);stroke-width:1.6;vector-effect:non-scaling-stroke;} .rec-spark-dose.unscored{stroke:var(--text-faint);}
  .rec-spark-v{flex:none;font-size:.8rem;font-weight:700;color:var(--text);}
  .rec-mini{display:flex;align-items:center;gap:4px;font-size:.58rem;line-height:1;color:var(--text-muted);font-weight:600;min-width:0;}
  .rec-mini-s{display:none;}
  .rec-mini-l{flex:0 0 auto;max-width:34%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:left;}
  .rec-mini-bar{flex:1 1 auto;height:5px;border-radius:999px;background:var(--primary-tint);overflow:hidden;min-width:14px;}
  .rec-mini-bar i{display:block;height:100%;background:var(--primary);border-radius:999px;}
  .rec-mini.limit .rec-mini-bar{background:color-mix(in srgb,var(--rec-dose) 18%,transparent);}
  .rec-mini.limit .rec-mini-bar i{background:var(--rec-dose);}
  .rec-mini.near .rec-mini-bar{background:var(--rank-a-tint);} .rec-mini.near .rec-mini-bar i{background:var(--rank-a);}
  .rec-mini.over .rec-mini-bar{background:var(--danger-tint);} .rec-mini.over .rec-mini-bar i{background:var(--danger);}
  .rec-mini.over .rec-mini-v{color:var(--danger);}
  .rec-mini.done .rec-mini-v{color:var(--primary);}
  /* the Activity tile: minutes by where the leg was */
  /* vitamins and supplements: the kind switch on the form, nutrient rows, Today's Take rows */
  .rec-kindswitch{margin:0 0 10px;}
  .rec-nrows{display:flex;flex-direction:column;gap:6px;}
  .rec-nrow{display:flex;gap:6px;align-items:center;}
  .rec-nrow select{flex:1;min-width:0;font:inherit;padding:6px 8px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-1);color:var(--text);}
  .rec-nrow input{width:110px;font:inherit;padding:6px 8px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-1);color:var(--text);}
  .rec-nrow .ghost-btn{padding:4px 9px;}
  .rec-supprow{align-items:center;}
  .rec-supprow .rec-slots{margin:0 8px 0 0;}
  .rec-supprow.done .psh-what strong{color:var(--primary);}
  .rec-supp{border-left:3px solid var(--rec-fluids);}
  /* the physio checklist (the Physio form) and the programme editor (Settings) */
  .rec-ptlist{margin:0 0 10px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);}
  .rec-pt{display:flex;align-items:flex-start;gap:10px;padding:9px 10px;border-top:1px solid var(--border);}
  .rec-pt:first-child{border-top:0;}
  .rec-pt.on{background:var(--primary-tint);}
  .rec-pt-tick{flex:none;width:26px;height:26px;margin-top:1px;padding:0;border-radius:var(--radius-md);border:2px solid var(--border-strong);background:var(--bg-1);color:transparent;font:inherit;font-size:.95rem;font-weight:800;line-height:22px;text-align:center;cursor:pointer;}
  .rec-pt.on .rec-pt-tick{background:var(--primary);border-color:var(--primary);color:#fff;}
  .rec-pt-main{flex:1;min-width:0;}
  .rec-pt-name{display:block;width:100%;padding:0;border:0;background:none;text-align:left;font:inherit;font-size:.92rem;font-weight:700;color:var(--text);cursor:pointer;overflow-wrap:anywhere;}
  .rec-pt-cue{margin-top:2px;font-size:.76rem;color:var(--text-muted);}
  .rec-pt-nums{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:5px;}
  .rec-pt-num{display:inline-flex;align-items:center;gap:4px;font-size:.74rem;color:var(--text-muted);}
  .rec-pt-num input{width:58px;font:inherit;font-size:.86rem;padding:4px 6px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-1);color:var(--text);}
  .rec-pt-x{color:var(--text-faint);}
  .rec-ptedit{display:flex;flex-direction:column;gap:8px;margin:6px 0;}
  .rec-ptrow{display:flex;gap:8px;align-items:flex-start;padding:8px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);}
  .rec-ptrow-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:5px;}
  .rec-ptrow-main input[type="text"]{width:100%;font:inherit;padding:6px 8px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--bg-1);color:var(--text);}
  .rec-ptrow-actions{display:flex;flex-direction:column;gap:4px;}
  .rec-ptrow-actions .ghost-btn{padding:4px 8px;min-width:0;}
  .rec-mini.leg-up .rec-mini-bar i{background:var(--primary);}
  .rec-mini.leg-level .rec-mini-bar{background:color-mix(in srgb,var(--rec-activity) 18%,transparent);} .rec-mini.leg-level .rec-mini-bar i{background:var(--rec-activity);}
  .rec-mini.leg-down .rec-mini-bar{background:color-mix(in srgb,var(--rec-dose) 18%,transparent);} .rec-mini.leg-down .rec-mini-bar i{background:var(--rec-dose);}
  .rec-mini.leg-moving .rec-mini-bar{background:color-mix(in srgb,var(--rec-fluids) 18%,transparent);} .rec-mini.leg-moving .rec-mini-bar i{background:var(--rec-fluids);}
  .rec-mini-v{flex:0 0 auto;font-variant-numeric:tabular-nums;white-space:nowrap;}
  button.rec-mini-btn{background:none;border:0;padding:3px 0;margin:0;width:100%;font-family:inherit;cursor:pointer;text-align:left;border-radius:6px;}
  button.rec-mini-btn:hover,button.rec-mini-btn:focus-visible{background:var(--primary-tint);outline:none;}
  .rec-nbox{position:fixed;inset:0;z-index:10000;background:rgba(10,10,12,.55);display:flex;align-items:center;justify-content:center;padding:16px;}
  .rec-nbox-card{background:var(--surface,var(--bg,#fff));color:var(--text);border-radius:var(--radius-lg);max-width:460px;width:100%;max-height:82vh;overflow:auto;padding:14px 16px;box-shadow:0 12px 40px rgba(0,0,0,.35);}
  .rec-nbox-top{display:flex;align-items:center;justify-content:space-between;gap:8px;} .rec-nbox-top h3{margin:0;font-size:1.05rem;}
  .rec-nbox-top button{background:none;border:0;font-size:1.2rem;cursor:pointer;color:var(--text-muted);padding:6px;}
  .rec-nlist{list-style:none;margin:6px 0 0;padding:0;} .rec-nlist li{display:flex;justify-content:space-between;gap:10px;padding:7px 0;border-top:1px solid var(--border,rgba(128,128,128,.25));}
  .rec-nl-main{display:flex;flex-direction:column;min-width:0;} .rec-nl-main small,.rec-nl-v small{color:var(--text-muted);font-size:.74rem;}
  .rec-nl-v{display:flex;flex-direction:column;align-items:flex-end;white-space:nowrap;font-variant-numeric:tabular-nums;font-weight:600;}
  .rec-slots{display:flex;gap:3px;justify-content:center;margin-top:4px;}
  .rec-slot{width:13px;height:13px;border-radius:50%;border:1px solid var(--border);font-size:.55rem;line-height:11px;text-align:center;font-style:normal;color:#fff;}
  .rec-slot.done{background:var(--primary);border-color:var(--primary);}
  .rec-check{display:block;text-align:center;font-size:.9rem;line-height:1;margin-top:4px;color:var(--text-faint);}
  .rec-check.done{color:var(--primary);font-weight:700;}
  .rec-alert{border:1px solid var(--danger);background:var(--danger-tint);color:var(--text);border-radius:var(--radius-sm);padding:10px 12px;margin:0 0 10px;font-size:.84rem;}
  .rec-alert.warn{border-color:var(--rank-a);background:var(--rank-a-tint);}
  .rec-alert strong{display:block;margin-bottom:3px;}
  .rec-contacts{white-space:pre-line;font-size:.78rem;margin-top:6px;font-weight:600;}
  .rec-sechead{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:14px 0 6px;}
  .rec-sechead h3{margin:0;font-size:.95rem;}
  .rec-med{margin:0 0 8px;}
  .rec-med.max{border-color:var(--danger);}
  .rec-medhead{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;}
  .rec-status{margin-top:6px;font-weight:600;font-size:.84rem;}
  .rec-med.ok .rec-status{color:var(--primary);}
  .rec-med.wait .rec-status{color:var(--rank-a);}
  .rec-med.max .rec-status{color:var(--danger);}
  .rec-list{padding:4px 12px;}
  .rec-row{align-items:flex-start;}
  .rec-row .rec-ico{flex:none;margin:0 6px;}
  .rec-row .psh-when{min-width:46px;font-variant-numeric:tabular-nums;font-weight:700;}
  /* Tasking items card: one row per open Recovery-category item, sub-items indented under their project */
  .rec-tasks{padding:4px 12px;}
  .rec-tasks-empty{padding:12px 14px;}
  .rec-tasks p{margin:0;}
  .rec-task{display:flex;align-items:flex-start;gap:9px;padding:8px 0;border-top:1px solid var(--border);transition:opacity .25s ease;}
  .rec-task:first-child{border-top:none;}
  .rec-task.sub{padding-left:30px;}
  .rec-task.done{opacity:.4;}
  .rec-tick{flex:none;width:20px;height:20px;margin-top:1px;padding:0;border-radius:50%;border:2px solid var(--border-strong);background:var(--bg-1);color:transparent;font:inherit;font-size:.8rem;font-weight:800;line-height:1;cursor:pointer;}
  .rec-tick:hover{border-color:var(--primary);color:var(--primary);}
  .rec-task.done .rec-tick{background:var(--primary);border-color:var(--primary);color:#fff;}
  .rec-task .rank-chip{margin-top:0;}
  .rec-task-proj{flex:none;width:22px;text-align:center;font-size:.95rem;line-height:22px;}
  .rec-task-main{flex:1;min-width:0;}
  .rec-task-title{display:block;width:100%;padding:0;border:0;background:none;text-align:left;font:inherit;font-size:.9rem;font-weight:600;line-height:1.35;color:var(--text);cursor:pointer;overflow-wrap:anywhere;}
  .rec-task-title:hover{text-decoration:underline;}
  .rec-task-meta{display:flex;flex-wrap:wrap;gap:3px 12px;margin-top:2px;font-size:.74rem;color:var(--text-muted);}
  .rec-task-meta .overdue{color:var(--danger);font-weight:700;}
  .rec-task-meta .soon{color:var(--primary);font-weight:700;}
  .rec-zone{font-size:.62rem;background:var(--surface-2);color:var(--text-muted);}
  .rec-form{margin:0 0 12px;}
  .rec-seg{display:flex;flex-wrap:wrap;gap:5px;}
  .rec-seg button{min-width:2.2rem;padding:6px 10px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);color:var(--text);font:inherit;font-size:.82rem;font-weight:600;cursor:pointer;}
  .rec-seg button.active{background:var(--primary);border-color:var(--primary);color:#fff;}
  /* a pain scale's half steps: smaller and quieter between the whole numbers */
  .rec-seg button.half{min-width:1.9rem;padding:6px 5px;font-size:.7rem;font-weight:500;color:var(--text-muted);border-style:dashed;}
  .rec-seg button.half.active{color:#fff;border-style:solid;}
  .rec-sw{display:inline-block;width:11px;height:11px;border-radius:50%;border:1px solid rgba(0,0,0,.2);margin-right:5px;vertical-align:-1px;}
  .rec-urine .rec-sw{width:18px;height:18px;margin-right:4px;vertical-align:-4px;} .rec-urine .rec-seg button{padding:5px 9px 5px 7px;}
  .rec-sw-big{width:14px;height:14px;margin-right:5px;vertical-align:-2px;}
  .rec-ends{display:flex;justify-content:space-between;font-size:.68rem;color:var(--text-faint);margin-top:3px;}
  .rec-inline{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
  .rec-toggle{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;margin:6px 0;padding:8px 10px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);color:var(--text);font:inherit;font-size:.84rem;font-weight:600;text-align:left;cursor:pointer;}
  .rec-toggle small{display:block;font-weight:400;color:var(--text-muted);font-size:.72rem;}
  .rec-toggle i{flex:none;width:34px;height:20px;border-radius:999px;background:var(--border);position:relative;transition:background .15s;}
  .rec-toggle i::after{content:"";position:absolute;top:2px;left:2px;width:16px;height:16px;border-radius:50%;background:#fff;transition:transform .15s;box-shadow:0 1px 2px rgba(0,0,0,.3);}
  .rec-toggle.on{border-color:var(--primary);}
  .rec-toggle.on i{background:var(--primary);}
  .rec-toggle.on i::after{transform:translateX(14px);}
  .rec-rule{background:var(--surface-2);border-radius:var(--radius-lg);padding:6px 10px;margin:0 0 8px;}
  .rec-grid3{grid-template-columns:repeat(3,1fr);}
  .rec-ul{margin:6px 0 0;padding-left:18px;font-size:.84rem;}
  .rec-ul li{margin:4px 0;}
  .rec-call{border-color:var(--danger);}
  .rec-tablewrap{overflow-x:auto;padding:0;}
  .rec-tablewrap table{width:100%;}
  .rec-ranges{display:inline-flex;}
  .rec-chart{display:block;margin:4px 0;}
  /* Trends: a tapped pain score shows its entry under the chart */
  .rec-chart .rec-pt,.rec-chart .rec-pt-hit{cursor:pointer;}
  .rec-chart .rec-pt:focus-visible{outline:none;stroke:var(--primary)!important;stroke-width:3;}
  .rec-chart .rec-pt.sel{stroke-width:2.5;}
  /* Trends: the overview chart — chips pick the lines, the readout gives the day's real numbers */
  .rec-ov-chips{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px;}
  .rec-ov-chip{display:inline-flex;align-items:center;gap:7px;padding:5px 11px 5px 9px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface-2);color:var(--text-muted);font:inherit;font-size:.8rem;font-weight:700;line-height:1.2;cursor:pointer;}
  .rec-ov-chip small{font-size:.72rem;font-weight:500;color:var(--text-faint);}
  .rec-ov-chip.on{background:var(--surface);color:var(--text);border-color:var(--border-strong);box-shadow:var(--shadow-sm);}
  .rec-ov-sw{display:inline-block;width:18px;height:0;border-top:3px solid;border-radius:2px;opacity:.4;}
  .rec-ov-chip.on .rec-ov-sw{opacity:1;}
  .rec-ov{display:block;width:100%;overflow:hidden;}
  .rec-ov-svg{display:block;width:100%;height:auto;touch-action:pan-y;}
  .rec-ov-pt.sel{stroke-width:3;}
  .rec-ov-lbl{font-size:11px;font-weight:700;fill:var(--text);paint-order:stroke;stroke:var(--surface);stroke-width:3px;stroke-linejoin:round;}
  .rec-ov-read{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;min-height:1.6rem;margin:4px 0 6px;font-size:.84rem;color:var(--text-muted);}
  .rec-ov-read strong{color:var(--text);margin-right:2px;}
  .rec-ov-read span{display:inline-flex;align-items:center;gap:6px;}
  .rec-ov-read b{color:var(--text);}
  .rec-pick{margin:6px 0 2px;}
  .rec-pick-head{display:flex;align-items:center;gap:6px;font-size:.92rem;margin:0 0 6px;}
  .rec-pick-head strong{font-size:1.15rem;}
  .rec-pick .psh-card{margin:0;}
  .rec-pick .rec-link{font:inherit;background:none;border:none;color:var(--text-muted);cursor:pointer;padding:2px 6px;}
  .rec-subs{margin:8px 0;}
  .rec-meter{margin-top:6px;}
  .rec-form textarea{width:100%;min-height:3.2rem;font:inherit;}
  .btn-danger{background:var(--danger);color:#fff;border-color:var(--danger);}
  /* Food lookup: the typed meal + Break it down, the tools row, the search
     panel, one card per food with its amount, and the totals */
  .rec-foodrow{display:flex;gap:6px;align-items:stretch;}
  /* the Food form's ingredient lines, saved-meal chips, save-as-meal */
  .rec-lineshead{display:flex;flex-direction:column;gap:2px;margin:0 0 6px;} .rec-lineshead label{font-size:.72rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--text-faint);} .rec-lineshead .psh-note{margin:0;}
  .rec-lines{display:flex;flex-direction:column;gap:6px;margin:0 0 8px;}
  .rec-line{display:flex;gap:6px;align-items:center;} .rec-line input{flex:1;min-width:0;} .rec-line.busy input{opacity:.6;} .rec-line [hidden]{display:none !important;}
  .rec-histpick{border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);margin:4px 0 8px;overflow:hidden;}
  .rec-histpick-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px;font-size:.78rem;color:var(--text-muted);border-bottom:1px solid var(--border);}
  .rec-histpick-list{max-height:40vh;overflow-y:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;}
  .rec-histpick-item{display:block;width:100%;text-align:left;padding:11px 12px;min-height:44px;border:0;border-bottom:1px solid var(--border);background:transparent;color:var(--text);font:inherit;}
  .rec-histpick-item:last-child{border-bottom:0;}
  .rec-line .ghost-btn{padding:6px 9px;min-width:0;} .rec-line-busy{font-size:.78rem;color:var(--text-muted);white-space:nowrap;}
  .rec-mealchips{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 10px;}
  .rec-chip{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);color:var(--text);font:inherit;font-size:.82rem;font-weight:600;cursor:pointer;}
  .rec-chip:hover{background:var(--surface-2);} .rec-chip small{color:var(--text-faint);font-weight:600;}
  .rec-savemeal{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:8px 0 10px;} .rec-savemeal input{flex:1;min-width:220px;}
  .rec-item-star{padding:2px 6px;min-width:0;border:0;background:none;font-size:.95rem;cursor:pointer;line-height:1;}
  .rec-conf{font-size:.68rem;font-weight:700;padding:1px 6px;border-radius:var(--radius-sm);background:color-mix(in srgb,var(--rec-fluids) 18%,transparent);color:var(--rec-fluids);white-space:nowrap;}
  .rec-conf.low{background:color-mix(in srgb,var(--rank-a) 22%,transparent);color:var(--rank-a);}
  .rec-item-fix{margin:4px 0 6px;padding:8px 10px;border:1px dashed var(--rank-a);border-radius:var(--radius-lg);font-size:.8rem;color:var(--text-muted);}
  .rec-fixrow{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:6px;} .rec-fixrow input{flex:1;min-width:180px;}
  .rec-pill-low{border:0;cursor:pointer;background:color-mix(in srgb,var(--rank-a) 22%,transparent);color:var(--rank-a);font-weight:700;}
  /* Home Care: the supplies list, dressing changes and their photos */
  .rec-care-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:6px;}
  .rec-care-head h3{margin:0;}
  .rec-supplies{padding:2px 10px;margin:6px 0;}
  .rec-supply{align-items:center;}
  .rec-supply-main{flex:1;display:flex;align-items:center;gap:9px;cursor:pointer;min-width:0;padding:4px 0;}
  .rec-supply-main input{width:1.15rem;height:1.15rem;flex:none;accent-color:var(--primary);}
  .rec-supply-text{overflow-wrap:anywhere;}
  .rec-supply.done .rec-supply-text{text-decoration:line-through;color:var(--text-faint);}
  .rec-supply-x{padding:2px 8px;color:var(--text-faint);}
  .rec-supply-add{display:flex;gap:8px;margin-top:8px;}
  .rec-supply-add input{flex:1;min-width:0;font:inherit;padding:8px 10px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--surface);color:var(--text);}
  .rec-change{padding:10px 0;border-top:1px solid var(--border);}
  .rec-change-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;}
  .rec-change-note{margin:6px 0 0;white-space:pre-wrap;overflow-wrap:anywhere;font-size:.9rem;}
  .rec-phs{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0 2px;}
  .rec-ph{position:relative;width:84px;height:84px;padding:0;border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;background:var(--surface-2,var(--surface));cursor:pointer;flex:none;}
  .rec-ph img{width:100%;height:100%;object-fit:cover;display:block;}
  .rec-ph-edit{cursor:default;}
  .rec-ph-x{position:absolute;top:3px;right:3px;width:24px;height:24px;border:0;border-radius:50%;background:rgba(0,0,0,.65);color:#fff;font-size:.75rem;line-height:1;cursor:pointer;}
  .rec-lightbox{position:fixed;inset:0;z-index:10000;background:rgba(10,10,12,.93);color:#f2f2f2;display:flex;flex-direction:column;}
  .rec-lb-top{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 14px;font-size:.9rem;}
  .rec-lb-top button,.rec-lb-stage button{border:0;background:rgba(255,255,255,.14);color:#fff;border-radius:50%;width:42px;height:42px;font-size:1.3rem;cursor:pointer;flex:none;}
  .rec-lb-stage button:disabled{opacity:.25;cursor:default;}
  .rec-lb-stage{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 8px;}
  .rec-vid{background:#1b1f1d;}
  .rec-play{position:absolute;right:5px;bottom:5px;width:24px;height:24px;border-radius:50%;background:rgba(0,0,0,.62);color:#fff;font-size:.65rem;display:flex;align-items:center;justify-content:center;padding-left:2px;pointer-events:none;}
  .rec-lb-stage video{flex:1;min-width:0;max-width:100%;max-height:100%;background:#000;}
  .rec-lb-stage img{flex:1;min-width:0;max-width:100%;max-height:100%;object-fit:contain;}
  .rec-lb-note{max-height:26vh;overflow:auto;padding:10px 16px 16px;font-size:.9rem;white-space:pre-wrap;}
  .rec-lb-note p{margin:0 0 6px;}
  @media(max-width:640px){.rec-lb-stage button{width:36px;height:36px;}.rec-ph{width:76px;height:76px;}}
  .rec-lownote{margin:-4px 0 10px;}
  .rec-item-rename{margin:4px 0 8px;} .rec-item-rename label{display:flex;gap:8px;align-items:center;font-size:.8rem;color:var(--text-muted);} .rec-item-rename input{flex:1;min-width:0;}
  .rec-headline{margin:6px 0 4px;} .rec-headline summary{cursor:pointer;font-size:.82rem;color:var(--text-muted);margin:0 0 6px;}
  .rec-foodrow input{flex:1;min-width:0;}
  .rec-foodrow .btn{white-space:nowrap;}
  .rec-foodtools{display:flex;flex-wrap:wrap;gap:6px;margin:-2px 0 8px;}
  .rec-foodsearch{border:1px solid var(--primary);border-radius:var(--radius-sm);background:var(--surface);padding:8px;margin:0 0 10px;}
  .rec-foodsearch .rec-inline{flex-wrap:nowrap;}
  .rec-foodsearch input{flex:1;min-width:0;font:inherit;padding:7px 10px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-1);color:var(--text);}
  .rec-foodlist{display:flex;flex-direction:column;max-height:300px;overflow:auto;margin-top:6px;}
  .rec-foodlist button{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;width:100%;padding:7px 6px;border:0;border-top:1px solid var(--border);background:none;color:var(--text);font:inherit;font-size:.84rem;text-align:left;cursor:pointer;}
  .rec-foodlist button:first-child{border-top:0;}
  .rec-foodlist button:hover,.rec-foodlist button:focus{background:var(--surface-2);outline:none;}
  .rec-foodlist button small{flex:1 1 100%;color:var(--text-muted);font-size:.74rem;}
  .rec-items{margin:0 0 12px;border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);}
  .rec-item,.rec-items-total{padding:8px 10px;border-top:1px solid var(--border);}
  .rec-item:first-child{border-top:0;}
  .rec-item.unresolved{background:var(--rank-a-tint);}
  .rec-items-total{background:var(--surface-2);border-radius:0 0 var(--radius-sm) var(--radius-sm);}
  .rec-item-top{display:flex;align-items:center;gap:8px;}
  .rec-item-name{flex:1;min-width:0;padding:0;border:0;background:none;text-align:left;font:inherit;font-size:.92rem;font-weight:700;color:var(--text);cursor:pointer;overflow-wrap:anywhere;}
  .rec-item-name::before{content:"▸ ";color:var(--text-faint);}
  .rec-item-name[aria-expanded="true"]::before{content:"▾ ";}
  .rec-item-src{flex:none;font-size:.62rem;font-weight:700;letter-spacing:.03em;text-transform:uppercase;padding:2px 6px;border-radius:var(--radius-sm);background:var(--surface-2);color:var(--text-muted);}
  .rec-item-src.label{background:var(--primary-tint);color:var(--primary);}
  .rec-item-src.own{background:var(--primary-tint);color:var(--primary);}
  .rec-item-src.web{background:var(--primary-tint);color:var(--primary);}
  .rec-item-src.estimate{background:var(--rank-a-tint);color:#8a6d00;}
  .rec-item-x{flex:none;width:26px;height:26px;padding:0;border:0;border-radius:50%;background:none;color:var(--text-muted);font:inherit;font-size:.95rem;cursor:pointer;}
  .rec-item-x:hover{background:var(--danger-tint);color:var(--danger);}
  .rec-item-qty{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:5px;}
  .rec-item-qty input{width:70px;font:inherit;padding:5px 7px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-1);color:var(--text);}
  .rec-weigh{display:inline-flex;align-items:center;gap:3px;font-size:.84rem;}
  .rec-weigh input{width:78px !important;}
  .rec-weigh.todo input{border-color:var(--rank-a);} .rec-weigh.on input{border-color:var(--primary);}
  .rec-batch{margin-bottom:10px;} .rec-batch-head{display:flex;flex-wrap:wrap;align-items:center;gap:6px;justify-content:space-between;}
  .rec-batch-chip{font-size:.74rem;font-weight:700;padding:2px 8px;border-radius:var(--radius-sm);background:var(--primary-tint);color:var(--text);}
  .rec-batch-chip.soon{background:var(--rank-a-tint);} .rec-batch-chip.over{background:var(--danger-tint);color:var(--danger);} .rec-batch.over{border-color:var(--danger);}
  .rec-batch-log{flex-wrap:wrap;} .rec-batch-log input,.rec-batch details input{width:130px;font:inherit;padding:6px 8px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-1);color:var(--text);}
    /* Recovery: Next up and the check-in banner */
    .rec-nextrow .psh-what strong { font-weight: 600; }
    .rec-nextrow { align-items: center; flex-wrap: nowrap; }
    .rec-nextrow .psh-what { flex: 1 1 0; min-width: 0; }
    .rec-nextrow .btn, .rec-nextrow button { flex: none; }
    .rec-nextrow.now { border-left: 3px solid var(--rec-dose, #c0683a); padding-left: 9px; }
    .rec-flow { border-left: 3px solid var(--rec-mood, #8a6bbf); }
    .rec-flow-steps { margin: 4px 0 8px; font-size: 13px; color: var(--text-faint, #888); }
    .rec-flow-steps .cur { color: var(--text, inherit); font-weight: 600; }
    .rec-flow-steps .done { text-decoration: line-through; }

  .rec-cook{margin-top:10px;}
  .rec-item-qty select{max-width:230px;font:inherit;font-size:.84rem;padding:5px 7px;border:1px solid var(--border);border-radius:var(--radius-lg);background:var(--bg-1);color:var(--text);}
  .rec-item-g{font-size:.78rem;color:var(--text-muted);font-variant-numeric:tabular-nums;}
  .rec-item-meta{margin-top:4px;font-size:.78rem;color:var(--text-muted);}
  .rec-item-match{color:var(--text-faint);}
  .rec-item-warn{color:#8a6d00;font-weight:700;}
  .rec-link{padding:0;border:0;background:none;color:var(--primary);font:inherit;text-decoration:underline;cursor:pointer;}
  .rec-item-detail{margin-top:8px;}
  .rec-item-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}
  .rec-ntable{width:100%;font-size:.82rem;}
  .rec-ntable td:nth-child(2){white-space:nowrap;font-variant-numeric:tabular-nums;}
  .rec-ngroup td{padding-top:8px;font-size:.68rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--text-muted);}
  .rec-dv{min-width:120px;}
  .rec-dvbar{display:inline-block;vertical-align:middle;width:64px;height:7px;margin-right:6px;border-radius:999px;background:var(--primary-tint);overflow:hidden;}
  .rec-dvbar i{display:block;height:100%;background:var(--primary);border-radius:999px;}
  .rec-dvv{font-variant-numeric:tabular-nums;font-size:.78rem;}
  .rec-dv.near .rec-dvbar{background:var(--rank-a-tint);} .rec-dv.near .rec-dvbar i{background:var(--rank-a);}
  .rec-dv.over .rec-dvbar{background:var(--danger-tint);} .rec-dv.over .rec-dvbar i{background:var(--danger);} .rec-dv.over .rec-dvv{color:var(--danger);font-weight:700;}
  .rec-dv.done .rec-dvv{color:var(--primary);font-weight:700;}
  .rec-nutrition .rec-nsum{margin:0 0 8px;font-weight:600;font-size:.9rem;}
  .rec-plate{display:flex;height:14px;border-radius:999px;overflow:hidden;background:var(--surface-2);margin:4px 0 6px;}
  .rec-plate i{display:block;height:100%;}
  .rec-plate i + i{box-shadow:-2px 0 0 var(--surface);}
  .rec-platelegend{margin-bottom:4px;}
  .rec-ndetails{margin-top:8px;}
  .rec-ndetails summary{cursor:pointer;font-weight:600;font-size:.86rem;}
  .rec-entry-foods{margin:3px 0 0;font-size:.8rem;color:var(--text);line-height:1.45;}
  /* the live camera for labels: viewfinder with a frame guide, then the buttons */
  .rec-cam{border:1px solid var(--primary);border-radius:var(--radius-sm);background:var(--surface);padding:8px;margin:0 0 10px;}
  .rec-cam-view{position:relative;width:100%;aspect-ratio:3/4;max-height:68vh;background:#000;border-radius:var(--radius-lg);overflow:hidden;}
  .rec-cam-view video,.rec-cam-view img{display:block;width:100%;height:100%;object-fit:cover;}
  .rec-cam-guide{position:absolute;inset:8% 7%;border:2px dashed rgba(255,255,255,.8);border-radius:var(--radius-lg);pointer-events:none;box-shadow:0 0 0 999px rgba(0,0,0,.28);}
  .rec-cam-status{position:absolute;left:0;right:0;bottom:0;padding:9px;background:rgba(0,0,0,.6);color:#fff;text-align:center;font-weight:600;font-size:.9rem;}
  .rec-cam-actions{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;}
  @media (min-width:700px){ .rec-cam-view{aspect-ratio:4/3;max-width:640px;margin:0 auto;} }
  .psh-warn{color:var(--danger);font-size:.82rem;margin:0 0 8px;}
  /* Desktop: the whole width, and everything a size up — the shell's
     920px panel and small type suit a sidebar list, not a day's log. */
  @media (min-width:1000px){
    .rec-screen .psh-panel{max-width:none;}
    .rec-screen .psh-body{padding:22px 32px 48px;font-size:1.05rem;}
    .rec-screen .meet-head h2{font-size:1.35rem;}
    .rec-screen .psh-tab{font-size:.95rem;padding:8px 16px;}
    .rec-screen .rec-daytitle strong{font-size:1.4rem;}
    .rec-screen .rec-daytitle span{font-size:.95rem;}
    .rec-screen .rec-dayhead .ghost-btn{font-size:1.1rem;padding:8px 16px;}
    .rec-screen .rec-quick{grid-template-columns:repeat(5,1fr);gap:12px;}
    .rec-screen .rec-mini-l{max-width:40%;}
    .rec-screen .rec-quick button{font-size:.92rem;padding:12px 6px;gap:5px;}
    .rec-screen .rec-quick .rec-ico{font-size:1.6rem;}
    .rec-screen .rec-mini{font-size:.74rem;gap:6px;}
    .rec-screen .rec-minis{gap:4px;margin-top:6px;}
    .rec-screen .rec-spark svg{height:36px;} .rec-screen .rec-spark-v{font-size:.95rem;}
    .rec-screen .rec-mini-bar{height:7px;}
    .rec-screen .rec-slot{width:18px;height:18px;line-height:16px;font-size:.72rem;}
    .rec-screen .rec-slots{gap:5px;margin-top:6px;}
    .rec-screen .rec-check{font-size:1.2rem;margin-top:6px;}
    .rec-screen .rec-alert{font-size:1.02rem;padding:14px 16px;}
    .rec-screen .rec-contacts{font-size:.95rem;}
    .rec-screen .diet-tiles{grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:14px;}
    .rec-screen .diet-tile{padding:14px 16px;}
    .rec-screen .diet-tile .l{font-size:.78rem;}
    .rec-screen .diet-tile .v{font-size:1.75rem;}
    .rec-screen .diet-tile .s{font-size:.9rem;}
    .rec-screen .diet-meter{height:11px;}
    .rec-screen .rec-sechead h3{font-size:1.2rem;}
    .rec-screen .rec-sechead{margin:20px 0 8px;}
    .rec-screen .diet-sub{font-size:.9rem;}
    .rec-screen .psh-card{padding:16px 18px;}
    .rec-screen .psh-card h3{font-size:1.15rem;}
    .rec-screen .rec-med strong{font-size:1.25rem;}
    .rec-screen .rec-status{font-size:1.02rem;}
    .rec-screen .psh-note{font-size:.92rem;}
    .rec-screen .rec-rule{font-size:.95rem;padding:8px 12px;}
    .rec-screen .psh-pill{font-size:.78rem;}
    .rec-screen .psh-row{padding:10px 0;}
    .rec-screen .rec-row .psh-when{min-width:60px;font-size:1.02rem;}
    .rec-screen .rec-row .rec-ico{font-size:1.2rem;margin:0 10px;}
    .rec-screen .rec-row .psh-what{font-size:1.02rem;line-height:1.4;}
    .rec-screen .ghost-btn{font-size:.92rem;}
    .rec-screen .btn{font-size:.98rem;padding:9px 16px;}
    .rec-screen .psh-field label{font-size:.8rem;}
    .rec-screen .psh-field input,.rec-screen .psh-field select,.rec-screen .psh-field textarea,.rec-screen .rec-form textarea{font-size:1.02rem;padding:9px 11px;}
    .rec-screen .rec-seg button{font-size:.98rem;padding:8px 13px;min-width:2.6rem;}
    .rec-screen .rec-seg button.half{font-size:.82rem;padding:8px 8px;min-width:2.2rem;}
    .rec-screen .rec-ends{font-size:.8rem;}
    .rec-screen .rec-toggle{font-size:.98rem;padding:10px 12px;}
    .rec-screen .rec-toggle small{font-size:.82rem;}
    .rec-screen .rec-ul{font-size:.98rem;}
    .rec-screen .rec-ul li{margin:6px 0;}
    .rec-screen .diet-table{font-size:.98rem;}
    .rec-screen .diet-table th{font-size:.74rem;}
    .rec-screen .diet-table th,.rec-screen .diet-table td{padding:7px 10px;}
    .rec-screen .diet-legend{font-size:.88rem;}
    .rec-screen .diet-table-wrap summary{font-size:.95rem;}
    .rec-screen .meet-empty{font-size:1rem;}
    .rec-screen .psh-warn{font-size:.95rem;}
    .rec-screen .rec-tasks{padding:6px 16px;}
    .rec-screen .rec-tasks-empty{padding:16px 18px;}
    .rec-screen .rec-task{padding:10px 0;gap:11px;}
    .rec-screen .rec-item-name{font-size:1.02rem;}
    .rec-screen .rec-pt-name{font-size:1.02rem;}
    .rec-screen .rec-pt-cue,.rec-screen .rec-pt-num{font-size:.88rem;}
    .rec-screen .rec-item-meta,.rec-screen .rec-item-g{font-size:.9rem;}
    .rec-screen .rec-ntable{font-size:.95rem;}
    .rec-screen .rec-foodlist button{font-size:.95rem;}
    .rec-screen .rec-foodlist button small{font-size:.82rem;}
    .rec-screen .rec-entry-foods{font-size:.92rem;}
    .rec-screen .rec-nutrition .rec-nsum{font-size:1rem;}
    .rec-screen .rec-task.sub{padding-left:36px;}
    .rec-screen .rec-tick{width:24px;height:24px;font-size:.95rem;}
    .rec-screen .rec-task .rank-chip{width:25px;height:25px;font-size:.8rem;}
    .rec-screen .rec-task-title{font-size:1.05rem;}
    .rec-screen .rec-task-meta{font-size:.88rem;}
  }
  @media (max-width:600px){
    .rec-tasks-where{display:none;}
    .rec-quick .rec-qlabel{font-size:.62rem;}
    .rec-mini-l{display:none;}
    .rec-mini-s{display:inline;flex:0 0 auto;width:2.7em;text-align:left;}
    .rec-mini{font-size:.52rem;}
    .rec-grid3{grid-template-columns:1fr 1fr;}
    .rec-medhead{flex-direction:column;}
  }
