  :root{
    --bg:#14161b; --surface:#1b1e25; --surface2:#21252e; --line:#2a2f3a;
    --text:#e7e9ee; --muted:#878d9a; --accent:#5b7cfa; --accent-weak:#5b7cfa26;
    --hard:#6e8bff; --hard-bg:#5b7cfa22; --soft:#34c08a; --soft-bg:#34c08a1f;
    --weekend:#e0a35a; --done:#6b7280; --danger:#e06666;
    --base:17px; --radius:12px;
    --atmo:
      radial-gradient(120% 80% at 50% -10%, rgba(91,124,250,.07) 0%, transparent 55%),
      radial-gradient(140% 120% at 50% 0%, #1c2029 0%, #14161b 48%, #0e0f13 100%);
  }
  html[data-theme="light"]{
    /* soft neutral paper, NOT bleach white — white surfaces float on a light gray (GitHub/Linear/iOS feel) */
    --bg:#eef0f4; --surface:#ffffff; --surface2:#e7eaf0; --line:#dfe3ea;
    --text:#1f2329; --muted:#767c88; --accent:#4c6ef5; --accent-weak:#4c6ef518;
    --hard:#3a55d6; --hard-bg:#e7ecff; --soft:#1d9d6e; --soft-bg:#e1f6ee;
    --weekend:#c47d28; --done:#9aa0aa; --danger:#c0392b;
    --atmo:
      radial-gradient(120% 80% at 50% -10%, rgba(76,110,245,.05) 0%, transparent 55%),
      radial-gradient(140% 120% at 50% 0%, #f7f8fb 0%, #eef0f4 55%, #e3e6ed 100%);
  }
  *{ box-sizing:border-box; }
  html,body{ height:100%; }
  html{ font-size:var(--base); background:var(--bg); }
  body{ margin:0; background:transparent; color:var(--text); font:1rem/1.4 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; -webkit-font-smoothing:antialiased; }
  /* Atmospheric background: a fixed full-viewport layer behind everything — a soft vignette (lighter
     top-center fading to darker edges) plus a faint accent glow bleeding from the top. Adds depth
     without banding; the translucent bar/list let it show through (inspired by casacontroller). */
  body::before{ content:''; position:fixed; inset:0; z-index:-1; pointer-events:none; background:var(--atmo); }
  .wrap{ max-width:900px; margin:0 auto; height:100vh; height:100dvh; display:flex; flex-direction:column; box-sizing:border-box; }
  /* The verify-email banner is a fixed bar at top:0; reserve space for it so it never overlays (and blocks
     clicks on) the header controls (date picker, context switcher, …). border-box keeps the app at 100dvh. */
  .wrap.verifybar{ padding-top:34px; }
  .wrap.weekmode{ max-width:1600px; }   /* the 7-column week needs the room; day view stays single-column at 900 */
  .daywrap{ flex:1; min-height:0; overflow-y:auto; padding:0 18px 16px;   /* the scroll region (app-shell) */
            scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
  .daywrap::-webkit-scrollbar{ width:7px; }

  /* ---- week view (doc 29): 7-day agenda, columns on desktop / stacked on mobile ---- */
  .weekwrap{ flex:1; min-height:0; display:flex; flex-direction:column; padding:0 18px 12px; }
  .weekstage{ flex:1; min-height:0; display:flex; gap:10px; overflow:hidden; }
  .weekgrid{ flex:1; min-height:0; display:grid; grid-template-columns:repeat(var(--wd,5),1fr); gap:10px; overflow:hidden; }
  .weekbacklog{ flex:0 0 200px; border-style:dashed; }
  .weekbacklog .bhead{ padding:10px 12px; }
  .weekbacklog .bhead .wdow{ font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
  .weekcol{ min-width:0; display:flex; flex-direction:column; border:1px solid var(--line); border-radius:12px; background:var(--surface); overflow:hidden; }
  .weekcol.wtoday{ border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
  .weekcol.we{ background:color-mix(in srgb, var(--surface2) 50%, var(--surface)); }
  .weekcol.drop{ border-color:var(--accent); border-style:solid; background:color-mix(in srgb, var(--accent) 12%, var(--surface)); box-shadow:0 0 0 1px var(--accent); }
  .wcell[draggable="true"]{ cursor:grab; }
  .wcell.drag{ opacity:.4; }
  .weekhead{ display:flex; align-items:baseline; gap:6px; border:none; background:none; cursor:pointer; color:var(--text);
             padding:10px 12px 6px; text-align:left; width:100%; }
  .weekhead:hover{ color:var(--accent); }
  .weekhead .wdow{ font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); }
  .weekcol.wtoday .weekhead .wdow{ color:var(--accent); }
  .weekhead .wdom{ font-size:1.05rem; font-weight:700; }
  .weekhead .wcount{ margin-left:auto; font-size:.72rem; color:var(--muted); font-variant-numeric:tabular-nums; }
  .wload{ height:3px; margin:0 12px 6px; background:var(--line); border-radius:2px; overflow:hidden; }
  .wfill{ height:100%; background:var(--accent); opacity:.7; }
  .wcells{ flex:1; min-height:0; overflow-y:auto; padding:2px 8px 10px; display:flex; flex-direction:column; gap:4px;
           scrollbar-width:thin; scrollbar-color:var(--line) transparent; }
  .wcell{ display:flex; align-items:baseline; gap:6px; padding:6px 8px; border-radius:8px; border:1px solid transparent; cursor:pointer; font-size:.86rem; }
  .wcell:hover{ background:var(--surface2); }
  .weekwrap.kbnav .wcell:hover:not(.sel){ background:transparent; }
  .wcell.sel{ border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
  .wcell.done .wt{ color:var(--done); }
  .wcell.cancelled .wt{ text-decoration:line-through; color:var(--muted); }
  .wcell .wtime{ font-size:.72rem; color:var(--accent); font-variant-numeric:tabular-nums; flex:0 0 auto; }
  .wcell .wt{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .wcell .wkk{ flex:0 0 auto; color:var(--accent); opacity:.8; display:inline-flex; }
  .wcell .wkk svg{ width:.85rem; height:.85rem; fill:none; stroke:currentColor; stroke-width:2; }
  .wempty{ color:var(--muted); opacity:.4; text-align:center; padding:10px 0; font-size:.85rem; }
  @media (max-width:640px){
    .dategroup .flens{ display:none !important; }           /* …and moves into the ⋯ menu on mobile (no room in the bar) */
    .dategroup .date{ flex-shrink:1; min-width:0; }         /* backstop: let the date shrink/ellipsize before it pushes the day-nav arrows off screen at a large text size */
    .dategroup .date h1{ overflow:hidden; text-overflow:ellipsis; }
    .tb-menu .mflens{ display:flex !important; }
    .weekstage{ flex-direction:column; overflow:visible; }
    .weekbacklog{ flex:0 0 auto; order:1; }                 /* backlog drops below the days on mobile */
    .weekgrid{ grid-template-columns:1fr; gap:8px; overflow:visible; }
    .weekwrap{ overflow-y:auto; }
    .weekcol{ overflow:visible; }
    .wcells{ overflow:visible; }
  }
  .daywrap::-webkit-scrollbar-thumb{ background:var(--line); border-radius:4px; }
  .daywrap::-webkit-scrollbar-track{ background:transparent; }

  .bar{ position:sticky; top:0; z-index:6; background:transparent; backdrop-filter:blur(14px);
        display:flex; flex-wrap:wrap; align-items:center; gap:6px; padding:16px 2px 12px; }
  .date{ cursor:pointer; padding:4px 8px; border-radius:10px; flex-shrink:0; }
  .date:hover{ background:var(--surface2); }
  .date h1{ font-size:1.18rem; font-weight:650; margin:0; letter-spacing:-.01em; white-space:nowrap; }
  .date.weekend h1{ color:var(--weekend); }
  .date .sub{ color:var(--muted); font-size:.82rem; margin-top:1px; white-space:nowrap; }
  .dategroup{ display:flex; align-items:center; gap:2px; flex-basis:100%; }   /* date + nav on their own row 1 (all widths) */
  .dategroup .date{ margin-right:auto; }   /* RIGHT-align the nav arrows so they stay put as the date text width changes (repeat-clickable) */
  .baricons{ display:flex; align-items:center; gap:6px; flex-wrap:nowrap; width:100%; }   /* the action toolbar on row 2 */
  @media (max-width:640px){
    .bar{ row-gap:8px; padding-top:12px; }
    .dategroup{ flex-basis:100%; }                             /* date + day-nav on row 1 */
    .baricons{ width:100%; margin-left:0; overflow:visible; gap:4px; }   /* actions on their own 2nd row; visible so the "…" menu isn't clipped */
    .barbtn .bl{ display:none; }                               /* icons-only on mobile to save space */
    .barbtn{ padding:0; width:34px; justify-content:center; }
    .barmore .tb-menu{ right:0; max-width:calc(100vw - 20px); }  /* keep the menu on-screen on narrow widths */
    .barmore{ margin-left:auto; }                             /* no avatar on mobile → the ⋯ anchors the far right */
  }
  /* labelled action-bar buttons (icon + name); the overflow kebab floats to the right */
  .barbtn{ display:inline-flex; align-items:center; gap:7px; border:none; background:none; color:var(--muted);
           height:34px; padding:0 11px; border-radius:9px; cursor:pointer; font-size:.85rem; white-space:nowrap; flex:0 0 auto; }
  .barbtn:hover{ background:var(--surface2); color:var(--text); }
  .barbtn.active{ background:var(--accent); color:#fff; }
  .barbtn .bi{ display:inline-flex; }
  .barbtn .bi svg{ width:1rem; height:1rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; display:block; }
  /* desktop: the ⋯ sits inline right after the other actions — the account avatar (margin-left:auto) anchors
     the far right. On mobile there's no avatar, so the ⋯ takes the far-right anchor instead (media query above). */
  .barmore .tb-menu{ min-width:210px; white-space:nowrap; }  /* wider so labels don't wrap */
  .barmore .tb-menu button.on{ color:var(--accent); }        /* filter-this-view is active */
  .ic{ border:none; background:none; color:var(--muted); font-size:1.05rem; width:34px; height:34px; border-radius:9px; cursor:pointer; display:inline-flex; align-items:center; justify-content:center; }
  .ic:hover{ color:var(--text); }
  /* icon sizes in rem so they scale with the chosen base font-size (1rem = the user's base px) */
  .ic svg, .alert svg, .pfx svg, .ibtn svg, .tb-menu .i svg, .acctpop .i svg, .go svg{ width:1rem; height:1rem; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; display:block; }
  /* the ✦ sparkles icon (research/AI affordances): inherit color like every other icon — several .aii
     contexts only set its SIZE, so without this it fell back to the default black fill */
  .aii svg{ fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  .ic svg.dots{ fill:currentColor; stroke:none; }
  .box svg{ width:.76rem; height:.76rem; fill:none; stroke:currentColor; stroke-width:2.6; stroke-linecap:round; stroke-linejoin:round; }
  .ibtn{ display:inline-flex; vertical-align:-3px; } .pfx svg{ width:.9rem; height:.9rem; }
  .ic:hover{ background:var(--surface2); color:var(--text); }
  .ic.active{ background:var(--accent); color:#fff; }
  .ic.sm{ font-size:.8rem; width:28px; }
  .row .drill{ color:var(--accent); width:24px; height:28px; opacity:.85; flex:0 0 auto; }   /* has sub-tasks -> stands out */
  .row .drill:hover{ color:var(--accent); opacity:1; background:none; }

  /* spine focus breadcrumb — stacked on the absolute top of the bar, full width (Brain-style) */
  .crumbs{ display:flex; flex-direction:column; align-items:flex-start; gap:1px; min-width:0; flex-basis:100%; width:100%; overflow:hidden; margin-bottom:6px; }
  .crumbs .seg.flens{ align-self:flex-start; margin-top:6px; }   /* List | Timeline lens toggle under the breadcrumb */
  .ftl .seclabel.ftday{ display:flex; align-items:baseline; gap:8px; color:var(--soft); cursor:pointer; }   /* click a day-header to move the cursor there */
  @media (hover:hover){ .ftl .seclabel.ftday:hover span:first-child{ color:var(--soft-hi,var(--fg)); } }
  .tb-menu .mflens{ display:none; }                          /* the root Day/Timeline toggle lives in the bar on desktop… */
  /* multi-day / all-day span (doc 32) */
  .spanchip{ display:inline-flex; align-items:center; gap:4px; font-size:.72rem; color:var(--accent);
    background:color-mix(in srgb, var(--accent) 12%, transparent); padding:1px 7px; border-radius:6px; font-variant-numeric:tabular-nums; }
  .spanrow{ gap:10px; align-items:center; } .spanrow .spanend{ color:var(--muted); font-size:.82rem; }
  /* location (doc 32) */
  .locchip{ display:inline-flex; align-items:center; gap:2px; font-size:.72rem; color:var(--muted); }
  .locrow .locval{ display:inline-flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .locrow .locname{ color:var(--text); text-decoration:none; border-bottom:1px dashed var(--line); }
  .locrow .locname:hover{ border-bottom-color:var(--accent); }
  .locrow .joinlink{ font-size:.74rem; color:var(--accent); text-decoration:none; border:1px solid color-mix(in srgb,var(--accent) 40%,transparent); padding:1px 8px; border-radius:6px; }
  .ic.mini{ width:26px; height:26px; }
  /* people / attendees (doc 32) */
  .attrow{ flex-wrap:wrap; gap:6px; align-items:center; }
  .attchip{ display:inline-flex; align-items:center; gap:5px; font-size:.8rem; background:var(--surface2,var(--surface)); border:1px solid var(--line); border-radius:20px; padding:2px 4px 2px 10px; }
  .attchip.declined{ opacity:.5; text-decoration:line-through; } .attchip.tentative{ border-style:dashed; }
  .attchip.accepted{ border-color:color-mix(in srgb, var(--ok,#3fb950) 55%, var(--line)); }
  .attchip .attname{ cursor:pointer; } .attchip .rsvpmark{ font-size:.72rem; color:var(--muted); margin-right:1px; }
  .attchip .attx{ border:none; background:none; color:var(--muted); cursor:pointer; font-size:1rem; line-height:1; padding:0 4px; }
  .attchip .attx:hover{ color:var(--danger); }
  .attinput{ flex:1; min-width:110px; background:none; border:none; border-bottom:1px dashed var(--line); color:var(--text); font-size:.82rem; padding:3px 2px; outline:none; }
  .attinput:focus{ border-bottom-color:var(--accent); }
  .attmeta{ font-size:.72rem; color:var(--muted); }
  .ftl .seclabel.ftday .ftmin{ margin-left:auto; color:var(--muted); font-weight:500; font-variant-numeric:tabular-nums; }
  .ftl .row.done .box{ color:var(--muted); }
  .ftl .ftcount{ color:var(--muted); font-variant-numeric:tabular-nums; }   /* "· N" rollup of a branch's completions that day */
  .ftl .row.ftcell{ cursor:pointer; }
  /* container marker (doc 25 §14.5): a subtle "unfinished inside — drill to find it" dot (merge-tool style),
     not a checkbox (a container isn't binary-done) and not a pie. Accent = open descendants; hollow = all done. */
  .cdot{ width:18px; height:18px; flex:0 0 auto; box-sizing:border-box; position:relative; align-self:flex-start; margin-top:1px; cursor:pointer; }
  .cdot::after{ content:''; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%); width:10px; height:10px; border-radius:50%; box-shadow:inset 0 0 0 1.6px var(--muted); }
  .cdot.open::after{ background:var(--accent); box-shadow:0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }   /* unfinished inside: filled accent dot with a soft halo */
  @media (hover:hover){ .cdot:hover::after{ box-shadow:0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); } }
  .ftl .row .dchip{ color:var(--muted); font-size:.72rem; }
  .ftl .ftgrp.cur{ position:relative; }   /* the cursor day (shared with the Day lens) — nav jumps highlight this group */
  .ftl .ftgrp.cur::before{ content:''; position:absolute; left:-11px; top:2px; bottom:2px; width:3px; border-radius:3px; background:var(--accent); }
  .ftl .ftgrp.cur .seclabel.ftday span:first-child{ color:var(--accent); }
  .crumbs .crumb{ border:none; background:none; cursor:pointer; color:var(--muted); text-align:left;
        max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; border-radius:7px; }
  .crumbs .crumb.home{ width:34px; height:30px; display:inline-flex; align-items:center; justify-content:flex-start; padding:0 4px; }
  .crumbs .crumb.home svg{ width:1.05rem; height:1.05rem; fill:none; stroke:currentColor; stroke-width:2; }
  .crumbs .crumbrow{ display:flex; align-items:center; gap:1px; width:100%; }   /* full width so the doc icon rides the right edge like a task row */
  .crumbs .crumb.line{ display:flex; align-items:center; gap:5px; font-size:1.05rem; font-weight:700; padding:1px 4px;
        margin-left:calc(var(--depth, 0) * 15px); max-width:calc(100% - var(--depth,0) * 15px); min-width:0; }
  /* right-aligned doc icon on the focused parent — matched to the task-row doc icon (.row .open: 24×28).
     margin-right nudges it left so its right edge lines up with the row icons below: .bar pads 2px on the
     side while the day rows sit at daywrap(18px)+row(11px), a fixed 10px difference regardless of width. */
  .crumbs .crumbdoc{ width:24px; height:28px; flex:0 0 auto; margin-left:auto; margin-right:10px; }
  .crumbs .crumbdoc.filled{ color:var(--text); opacity:.8; }     /* lined doc = the parent has notes (mirrors .row .open.filled) */
  .crumbs .crumb.line .ct{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .crumbs .crumb.cur{ color:var(--accent); }   /* the parent whose sub-events you're viewing — stands out */
  .crumbs .crumb:hover{ color:var(--accent); }
  .crumbs .sep{ color:var(--muted); opacity:.55; font-weight:400; flex:0 0 auto; }

  .seclabel{ color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.07em; margin:20px 6px 6px; display:flex; align-items:center; }
  .seclabel.schedrop{ color:var(--accent); }   /* drag an untimed row into the Scheduled block to give it a time */
  /* due-ish (flexible recurrence nudges) */
  .seclabel.due{ color:var(--soft); gap:5px; }
  .seclabel.due svg{ width:.85rem; height:.85rem; fill:none; stroke:currentColor; stroke-width:2; }
  .dueblock{ border:1px solid color-mix(in srgb, var(--soft) 35%, var(--line)); border-radius:var(--radius);
             background:color-mix(in srgb, var(--soft) 6%, transparent); padding:2px 6px 6px; margin-bottom:6px; }
  .duerow{ display:flex; align-items:center; gap:11px; padding:8px 6px; border-radius:9px; cursor:pointer; }
  .duerow:hover{ background:var(--surface2); }   /* the row opens the detail (like a normal task) — the box still completes, the × snoozes */
  .duerow .duet{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .duerow .duechip{ flex:0 0 auto; font-size:.74rem; color:var(--soft); font-variant-numeric:tabular-nums; }
  .duerow .duechip.over{ color:var(--weekend); }
  .duerow .duex{ flex:0 0 auto; border:none; background:none; color:var(--muted); cursor:pointer; font-size:1.1rem; line-height:1; padding:0 4px; border-radius:6px; }
  .duerow .duex:hover{ color:var(--text); background:var(--surface2); }
  /* mobile: the verbose due-chip (never shrinks) crushed the title — drop it to its own line so the title reads in full */
  @media (max-width:640px){
    .duerow{ flex-wrap:wrap; row-gap:1px; }
    .duerow .duet{ order:1; }
    .duerow .duex{ order:2; }
    .duerow .duechip{ order:3; flex:1 0 100%; padding-left:29px; }   /* line 2, indented under the title (box + gap) */
  }
  .row{ display:flex; align-items:flex-start; gap:11px; padding:10px 11px; border-radius:var(--radius); border:1px solid transparent; touch-action:pan-y; scroll-margin-top:108px;
        -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; transition:transform .14s ease; }   /* no long-press text-select; rows slide to make room */
  .row .txt{ -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; -webkit-tap-highlight-color:transparent; }   /* declared ON the title (not just inherited); no long-press selection / callout / tap-glow */
  .row .txt[contenteditable="true"]{ -webkit-user-select:text; user-select:text; -webkit-touch-callout:default; }   /* …but allow selection while editing the title */
  @media (hover:hover){ .row[data-rid]{ cursor:grab; } }   /* desktop: reorderable rows hint draggable (drag to reorder, like the timeline) */
  .row.lift{ z-index:9; position:relative; background:var(--surface); box-shadow:0 6px 18px #0006, 0 0 0 1px var(--accent); cursor:grabbing; transition:none; }   /* lifted row follows the finger directly */
  .row.landed{ animation:rowland .8s ease; }   /* brief accent pulse where a dragged row just landed (drop confirmation) */
  @keyframes rowland{ 0%{ background:color-mix(in srgb, var(--accent) 32%, transparent); box-shadow:0 0 0 1px var(--accent); } 100%{ background:transparent; box-shadow:none; } }
  .row.sel{ background:var(--surface); border-color:var(--accent); box-shadow:0 0 0 1px var(--accent); }
  .row.sel.lead{ box-shadow:0 0 0 2px var(--accent); }   /* the anchor row of a multi-selection reads slightly stronger */
  .row.hov{ background:color-mix(in srgb, var(--accent) 10%, var(--surface)); border-color:color-mix(in srgb, var(--accent) 55%, transparent); }   /* hovered in the timeline */
  .row.cut{ opacity:.45; }   /* cut to the clipboard, awaiting paste */
  .row:hover{ background:var(--surface); }
  .daywrap.kbnav .row:hover:not(.sel){ background:transparent; }   /* during keyboard nav, only the selection highlights */
  .box{ width:1.12rem; height:1.12rem; margin-top:1px; border:1.7px solid var(--muted); border-radius:6px; flex:0 0 auto; cursor:pointer;
        display:flex; align-items:center; justify-content:center; font-size:12px; color:#fff; transition:.12s; }
  .box:hover{ border-color:var(--accent); }
  .row.done .box{ background:var(--accent); border-color:var(--accent); color:#fff; }
  .chip{ font-size:.72rem; font-weight:700; padding:2px 8px; border-radius:999px; flex:0 0 auto; margin-top:1px; white-space:nowrap; }
  .chip.hard{ background:var(--hard-bg); color:var(--hard); }
  .chip.soft{ background:var(--soft-bg); color:var(--soft); }
  .chip.pending{ background:#0000; color:var(--muted); font-weight:500; opacity:.7; }
  .txt{ flex:1; min-width:0; outline:none; font-size:1rem; line-height:1.4; overflow-wrap:anywhere; word-break:break-word; cursor:pointer; }
  .txt[contenteditable="true"]{ cursor:text; }   /* text caret while editing; hand pointer when it's a click-to-open */
  /* Two-line rows: box + title on the top line, meta below. align-items:flex-start so a
     title that WRAPS to two lines doesn't drag the box to the block's vertical middle;
     each control is then nudged to sit centered on the FIRST text line (.txt's 1.4rem line
     box). Font-relative, so it holds at any text size and for 1-line or multi-line titles. */
  .row:has(.rowtop){ flex-direction:column; align-items:stretch; gap:2px; }
  .rowtop{ display:flex; align-items:flex-start; gap:11px; }
  .rowtop .box{ margin-top: calc((1.4rem - 1.12rem) / 2); }
  .rowtop .open{ margin-top: calc((1.4rem - 28px) / 2); }
  .rowtop .alert{ margin-top: calc((1.4rem - 1.4em) / 2); }
  .rowmeta{ margin-left:calc(1.12rem + 11px); display:flex; align-items:center; gap:8px; font-size:.78rem; color:var(--muted); }
  .rowmeta .time{ font-weight:600; cursor:pointer; border-radius:5px; } .rowmeta .time:hover{ background:var(--accent-weak); }
  .rowmeta .time.hard{ color:var(--hard); } .rowmeta .time.soft{ color:var(--soft); }
  .tzorigin{ color:var(--muted); font-size:.72rem; font-weight:500; white-space:nowrap; }   /* faint "· City" origin hint on an anchored event shown in your zone */
  .rowmeta .dchip{ font-weight:600; color:var(--muted); }
  .rowmeta .pchip{ min-width:0; max-width:22rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
        color:var(--muted); opacity:.85; }
  /* each segment truncates on its own so one long title can't blow out the row; the path middle collapses to … */
  .rowmeta .pchip .pclink{ cursor:pointer; display:inline-block; max-width:11rem; overflow:hidden;
        text-overflow:ellipsis; white-space:nowrap; vertical-align:bottom; }
  .rowmeta .pchip .pclink:hover{ color:var(--accent); }
  .rowmeta .pchip .pcsep{ opacity:.6; }   /* breadcrumb separator between ancestor segments */
  .rowmeta .pchip .pcmore{ cursor:default; opacity:.7; }   /* the collapsed-middle "…" (hover for hidden sections) */
  .rowmeta .tag{ flex:0 0 auto; padding:1px 7px; border-radius:999px; font-size:.72rem; font-weight:600; cursor:pointer;
        color:var(--accent); background:var(--accent-weak); }
  .rowmeta .tag:hover{ background:color-mix(in srgb, var(--accent) 22%, transparent); }
  .rowmeta .tag.inh, .detailtags .tag.inh{ background:transparent; color:var(--muted); border:1px dashed var(--line); font-weight:500; }

  /* detail-view tag editor */
  .detailtags{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin:14px 0 4px; }
  .detailtags .tag{ display:inline-flex; align-items:center; gap:4px; padding:2px 4px 2px 9px; border-radius:999px;
        font-size:.78rem; font-weight:600; color:var(--accent); background:var(--accent-weak); }
  .detailtags .tag > span{ cursor:pointer; }
  .detailtags .tag .x{ border:none; background:none; color:var(--accent); opacity:.6; cursor:pointer; font-size:1rem; line-height:1; padding:0 3px; border-radius:50%; }
  .detailtags .tag .x:hover{ opacity:1; background:color-mix(in srgb, var(--accent) 25%, transparent); }
  .detailtags .tagadd{ border:none; background:none; outline:none; color:var(--text); font-size:.82rem; width:8rem; padding:3px 4px; }
  /* add-tag suggestions (shown only while focused): dashed = your vocabulary, solid+sparkle = AI proposal */
  .tagsugg{ display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
  .tagsuggchip{ display:inline-flex; align-items:center; gap:4px; border:1px dashed var(--line); background:none; color:var(--muted); border-radius:999px; padding:3px 10px; font-size:.8rem; cursor:pointer; }
  .tagsuggchip:hover{ border-style:solid; border-color:var(--accent); color:var(--accent); }
  .tagsuggchip.ai{ border-style:solid; border-color:color-mix(in srgb, var(--accent) 45%, var(--line)); color:var(--accent); background:color-mix(in srgb, var(--accent) 10%, transparent); }
  .tagsuggchip.ai:hover{ background:color-mix(in srgb, var(--accent) 20%, transparent); }
  .tagsuggchip .aii{ display:inline-flex; }
  .tagsuggchip .aii svg{ width:.72rem; height:.72rem; fill:none; stroke:currentColor; stroke-width:2; }
  .detailtags .tagadd::placeholder{ color:var(--muted); }

  /* reminder row (detail) */
  .remind{ display:flex; align-items:center; gap:10px; margin:14px 0 4px; flex-wrap:wrap; }
  .remind .bell{ color:var(--muted); display:inline-flex; }
  .remind .bell svg{ width:1rem; height:1rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  .rset{ font-size:.85rem; display:inline-flex; align-items:center; gap:6px; }
  .rset b{ font-weight:600; }
  .rset .x{ border:none; background:none; color:var(--accent); opacity:.6; cursor:pointer; font-size:1rem; line-height:1; padding:0 4px; border-radius:50%; }
  .rset .x:hover{ opacity:1; background:color-mix(in srgb, var(--accent) 25%, transparent); }
  .carrynote{ display:flex; align-items:center; gap:7px; margin-top:9px; font-size:.82rem; color:var(--muted); cursor:pointer; flex:1 0 100%; }
  .carrynote input{ accent-color:var(--accent); width:15px; height:15px; cursor:pointer; }
  .remind .ralarm{ margin-left:auto; border:1.5px solid var(--line); background:var(--surface); color:var(--text); border-radius:9px; padding:5px 8px; font-size:.8rem; color-scheme:dark light; }
  .remind.repeat{ margin:4px 0; }
  .recsel{ border:1.5px solid var(--line); background:var(--surface); color:var(--text); border-radius:9px; padding:5px 8px; font-size:.8rem; cursor:pointer; color-scheme:dark light; }
  /* custom weekday-set picker (any subset of days) */
  .daypick{ flex:1 0 100%; display:flex; align-items:center; gap:5px; margin-top:2px; padding-left:26px; }
  .daypick .dpchip{ width:26px; height:26px; border:1.5px solid var(--line); background:var(--surface); color:var(--muted); border-radius:50%; font-size:.75rem; font-weight:600; cursor:pointer; padding:0; }
  .daypick .dpchip:hover{ border-color:var(--accent); color:var(--text); }
  .daypick .dpchip.on{ background:var(--accent); border-color:var(--accent); color:#fff; }
  .daypick .dpset{ margin-left:4px; border:1.5px solid var(--accent); background:var(--accent); color:#fff; border-radius:8px; padding:4px 12px; font-size:.78rem; font-weight:600; cursor:pointer; }
  .daypick .dpset:hover{ filter:brightness(1.1); }
  .daypick .dpcancel{ margin-left:2px; border:none; background:none; color:var(--muted); cursor:pointer; font-size:1.15rem; line-height:1; padding:0 4px; }
  .daypick .dpcancel:hover{ color:var(--text); }
  /* edit-scope (this occurrence vs the series) */
  .applyseries{ flex:1 0 100%; display:flex; align-items:center; gap:6px; margin-top:4px; padding-left:26px; }
  .applyseries .aslbl{ color:var(--muted); font-size:.78rem; margin-right:2px; }
  .applyseries button{ border:1.5px solid var(--line); background:var(--surface); color:var(--text); border-radius:8px; padding:4px 11px; font-size:.78rem; cursor:pointer; }
  .applyseries button:hover{ border-color:var(--accent); color:var(--accent); }
  /* recurrence chip on a row */
  .rowmeta .rchip{ flex:0 0 auto; display:inline-flex; align-items:center; gap:3px; color:var(--accent); font-weight:600; }
  .rowmeta .rchip svg{ width:.82rem; height:.82rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

  /* connections (settings) */
  .connrow{ display:flex; align-items:center; gap:10px; padding:10px 0; border-bottom:1px solid var(--line); }
  .connlabel{ font-size:.9rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .connstate{ font-size:.74rem; color:var(--muted); }
  .connstate.healthy{ color:var(--ok, #2e9e5b); }
  .connstate.unhealthy{ color:var(--danger); }
  .connstate.linking{ color:var(--accent); }
  .connadd{ display:flex; align-items:center; gap:10px; margin-top:14px; }
  .connadd input{ flex:1; min-width:0; border:1.5px solid var(--line); background:var(--surface); color:var(--text);
                  border-radius:11px; padding:9px 12px; font-size:.88rem; outline:none; }
  .connadd input:focus{ border-color:var(--accent); }
  /* token sharing + usage (llm) */
  .sharepanel{ padding:12px 0 16px 0; border-bottom:1px solid var(--line); }
  .grantlist{ margin-top:10px; display:flex; flex-direction:column; gap:6px; }
  .grantrow{ display:flex; align-items:center; gap:8px; font-size:.85rem; }
  .grantrow .x{ margin-left:auto; border:none; background:none; color:var(--accent); opacity:.6; cursor:pointer; font-size:1rem; line-height:1; padding:0 6px; border-radius:50%; }
  .grantrow .x:hover{ opacity:1; background:color-mix(in srgb, var(--accent) 25%, transparent); }
  .usagehead{ margin-top:14px; font-size:.74rem; text-transform:uppercase; letter-spacing:.04em; color:var(--muted); }
  .usagelist{ margin-top:6px; display:flex; flex-direction:column; gap:4px; }
  .usagerow{ display:flex; align-items:center; gap:10px; font-size:.82rem; }
  .usagerow .who{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .usagerow .num{ font-variant-numeric:tabular-nums; color:var(--muted); }
  .llmform{ border:1px solid var(--line); border-radius:12px; padding:14px; background:var(--surface); }
  .llmgrid{ display:grid; grid-template-columns:1fr 1fr; gap:8px; }
  .llmgrid input{ border:1.5px solid var(--line); background:var(--bg); color:var(--text); border-radius:9px; padding:8px 10px; font-size:.85rem; outline:none; min-width:0; }
  .llmgrid input:focus{ border-color:var(--accent); }
  /* Connections, grouped into cards (AI / Reminders / Calendars) */
  .setlede{ color:var(--muted); font-size:.82rem; margin:0 0 6px; text-align:left; line-height:1.45; }
  .conngroup{ border:1px solid var(--line); border-radius:14px; padding:13px 15px; margin:14px 0; background:var(--surface); }
  .conghead{ display:flex; gap:11px; align-items:flex-start; margin-bottom:4px; }
  .congicon{ color:var(--accent); flex:0 0 auto; margin-top:1px; line-height:0; }
  .congicon svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; display:block; }
  .congtitle{ font-weight:650; font-size:.95rem; }
  .congdesc{ color:var(--muted); font-size:.78rem; line-height:1.45; margin-top:1px; }
  .congnote{ color:var(--muted); font-size:.74rem; line-height:1.45; margin:11px 0 0; }
  .conninfo{ flex:1; min-width:0; }
  .connmeta{ display:flex; gap:8px; align-items:center; font-size:.75rem; color:var(--muted); margin-top:3px; }
  .tagpill{ border:1px solid var(--line); color:var(--accent); border-radius:6px; padding:0 7px; font-size:.72rem; font-weight:600; line-height:1.7; }
  .emptyhint{ color:var(--muted); font-size:.78rem; margin:6px 0 0; }
  .emptyhint code, .congnote code{ background:var(--accent-weak); border-radius:4px; padding:1px 5px; font-size:.92em; }
  /* MCP tool servers (doc 37 slice 1) — collapsible card: header summarizes, tools drill in on click */
  .mcpcard{ border:1px solid var(--line); border-radius:12px; margin-bottom:8px; overflow:hidden; }
  .mcpcard.open{ border-color:color-mix(in srgb, var(--accent) 35%, var(--line)); }
  .mcphead{ display:flex; align-items:center; gap:9px; padding:9px 11px; cursor:pointer; }
  .mcphead:hover{ background:var(--surface2); }
  .mcphead .conninfo{ flex:1; min-width:0; }
  .mcpchev{ display:flex; color:var(--muted); transition:transform .15s ease; flex:0 0 auto; }
  .mcpchev svg{ width:1rem; height:1rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  .mcpchev.open{ transform:rotate(90deg); }
  .mcpcount{ color:var(--soft); font-size:.76rem; white-space:nowrap; }
  .mcptools{ display:flex; flex-direction:column; gap:2px; padding:2px 12px 12px 12px; }
  .mcptoolshead{ color:var(--muted); font-size:.74rem; margin:2px 0 8px; }
  .mcptool{ display:flex; gap:11px; align-items:flex-start; padding:8px 0; border-top:1px solid var(--line); }
  .mcptool:first-of-type{ border-top:none; }
  .mcptool.off{ opacity:.55; }
  .mcptbody{ flex:1; min-width:0; }
  .mcptname{ font-weight:600; font-family:ui-monospace,monospace; font-size:.82rem; }
  .mcptdesc{ color:var(--muted); font-size:.78rem; margin-top:1px; }
  /* on/off SWITCH — the primary "let the agent use this tool" control (distinct from the ask-me checkbox) */
  .mcpsw{ position:relative; display:inline-flex; flex:0 0 auto; width:34px; height:20px; cursor:pointer; margin-top:1px; }
  .mcpsw input{ position:absolute; inset:0; opacity:0; margin:0; cursor:pointer; }
  .mcpswt{ position:absolute; inset:0; background:var(--line); border-radius:999px; transition:background .15s; }
  .mcpswt::after{ content:''; position:absolute; top:2px; left:2px; width:16px; height:16px; border-radius:50%; background:#fff; transition:transform .15s; }
  .mcpsw input:checked + .mcpswt{ background:var(--accent); }
  .mcpsw input:checked + .mcpswt::after{ transform:translateX(14px); }
  /* behavior line (shown only when the tool is ON): the ask-me override for reads, a fixed note for actions */
  .mcpask{ display:inline-flex; gap:6px; align-items:center; font-size:.76rem; color:var(--text); margin-top:6px; cursor:pointer; }
  .mcpask input{ margin:0; }
  .mcpaskfixed{ display:inline-flex; gap:5px; align-items:center; font-size:.76rem; color:var(--weekend); margin-top:6px; }
  .mcpaskico{ display:inline-flex; } .mcpaskico svg{ width:.85rem; height:.85rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  .connform{ display:flex; flex-direction:column; gap:9px; padding:8px 0; }
  .connform .pwin{ max-width:420px; }
  .connaddbtn{ border:1px dashed var(--line); background:none; color:var(--accent); border-radius:10px; height:38px; padding:0 14px; font-size:.84rem; cursor:pointer; margin-top:12px; width:100%; }
  .connaddbtn:hover{ border-color:var(--accent); background:var(--accent-weak); }
  .conngroup .llmform{ border:none; background:var(--bg); padding:12px; margin-top:10px; }
  .conngroup .sharepanel{ border-bottom:none; padding-bottom:4px; }
  /* small text buttons across the connection rows */
  .chip{ border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:9px; height:33px; padding:0 13px; font-size:.8rem; cursor:pointer; white-space:nowrap; display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto; }
  .chip:hover:not(:disabled){ border-color:var(--accent); }
  .chip:disabled{ opacity:.45; cursor:default; }
  .chip.solid{ background:var(--accent); border-color:var(--accent); color:#fff; }
  .chip.solid:hover:not(:disabled){ filter:brightness(1.06); }
  .chip.muted{ color:var(--muted); cursor:default; }
  .chip.danger:hover:not(:disabled){ border-color:var(--danger); color:var(--danger); }

  /* .ics import-detail */
  .impsum{ display:flex; flex-direction:column; gap:4px; padding:14px 16px; border:1px solid var(--line); border-radius:12px; background:var(--surface); }
  .impcal{ font-weight:600; font-size:1rem; }
  .impsample{ margin-top:16px; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
  .improw{ padding:8px 14px; font-size:.86rem; border-bottom:1px solid var(--line); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .impsample .hint{ padding:8px 14px; margin:0; }

  /* tag lens "track as a goal" bar + goals browser */
  .tagtrack{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin:0 0 14px; max-width:760px; }

  /* keyboard-shortcuts help */
  .kbhelp{ display:grid; grid-template-columns:1fr 1fr; gap:10px 40px; max-width:760px; }
  .kbsec{ color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.07em; margin:14px 0 4px; }
  .kbsec:first-child{ margin-top:0; }
  .kbrow{ display:flex; align-items:center; gap:12px; padding:5px 0; font-size:.92rem; }
  .kbrow .keys{ flex:0 0 auto; min-width:96px; display:flex; align-items:center; gap:3px; }
  .kbrow .dim, .kbhelp .dim, .hint .dim{ color:var(--muted); }
  kbd{ display:inline-block; min-width:1.1em; text-align:center; padding:2px 6px; border-radius:6px;
       border:1px solid var(--line); border-bottom-width:2px; background:var(--surface);
       font:600 .8rem/1.2 ui-monospace,Menlo,Consolas,monospace; color:var(--text); }
  @media (max-width:640px){ .kbhelp{ grid-template-columns:1fr; } .kbtips{ display:none; } }

  /* detail-view sub-tasks checklist */
  .subtasks{ margin:18px 0 6px; }
  .subhead{ display:flex; align-items:center; gap:10px; margin-bottom:6px; }
  .subhead .lbl{ color:var(--muted); font-size:.72rem; text-transform:uppercase; letter-spacing:.07em; }
  .subhead .prog{ display:flex; align-items:center; gap:6px; font-size:.78rem; color:var(--muted); font-variant-numeric:tabular-nums; }
  .subhead .donut{ width:14px; height:14px; border-radius:50%;
        background:conic-gradient(var(--accent) var(--p,0%), var(--line) 0); }
  .subrow{ display:flex; align-items:center; gap:11px; padding:7px 2px; }
  .subrow .cbox{ width:1rem; height:1rem; border:1.7px solid var(--muted); border-radius:5px; flex:0 0 auto; cursor:pointer;
        display:flex; align-items:center; justify-content:center; }
  .subrow.done .cbox{ background:var(--accent); border-color:var(--accent); }
  .subrow .cbox svg{ width:.7rem; height:.7rem; fill:none; stroke:#fff; stroke-width:2.6; }
  .subrow .t{ flex:1; min-width:0; cursor:pointer; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .subrow.done .t{ color:var(--done); }
  .subrow .d{ font-size:.74rem; color:var(--muted); white-space:nowrap; }
  .subrow .kk{ display:inline-flex; opacity:.45; } .subrow .kk svg{ width:.9rem; height:.9rem; fill:none; stroke:currentColor; stroke-width:2; }
  .subadd{ display:flex; align-items:center; gap:9px; padding:6px 2px; }
  .subadd .pfx{ color:var(--muted); width:17px; text-align:center; }
  .subadd input{ flex:1; border:none; background:none; outline:none; color:var(--text); font-size:1rem;
        border-bottom:1px solid transparent; padding:2px 0; }
  .subadd input:focus{ border-bottom-color:var(--line); }
  .rowmeta .pchip:hover{ opacity:1; }
  .rowmeta .emos{ margin-left:auto; font-size:.95rem; white-space:nowrap; line-height:1; }
  .row.done .txt{ color:var(--done); }
  .row.done .chip{ opacity:.5; }
  .empty{ color:var(--muted); text-align:center; padding:56px 0; }
  /* backlog grooming view */
  .blcrumbs{ display:flex; flex-wrap:wrap; align-items:center; gap:2px; margin:2px 0 6px; }
  .blcrumbs .blc{ border:none; background:none; color:var(--muted); font-size:.82rem; cursor:pointer; padding:2px 4px; display:inline-flex; align-items:center; gap:3px; }
  .blcrumbs .blc.cur{ color:var(--text); font-weight:600; }
  .blcrumbs .blc .sep{ color:var(--line); }
  .bllist{ max-width:900px; }
  /* tags sit on their OWN line beneath the title (matching the main day view's .rowmeta), all viewports —
     keeps titles uncrushed and the two views consistent */
  /* A long backlog (hundreds of rows) is heavy to paint/composite on a real (esp. Retina) display, so rapid
     ⇧↑/↓ reordering could saturate the compositor and stutter. content-visibility skips layout+paint for the
     off-screen rows; `auto` in contain-intrinsic-size makes the browser remember each row's real rendered
     height, so scroll position AND the drag hit-test geometry (getBoundingClientRect on every row) stay exact. */
  .blrow{ align-items:center; flex-wrap:wrap; row-gap:4px; content-visibility:auto; contain-intrinsic-size:auto 44px; }
  .blrow .blgrip{ color:var(--muted); opacity:.5; font-size:.9rem; line-height:1; flex:0 0 auto; letter-spacing:-2px; }
  .blrow .txt{ flex:1 1 auto; min-width:0; }
  .blrow .bltags{ display:flex; flex-wrap:wrap; gap:5px; align-items:center; min-width:0;
        order:2; flex-basis:100%; margin-left:calc(0.9rem + 11px); }   /* line 2, indented under the title */
  /* same accent pill as the main day view (.rowmeta .tag) — backlog tags were unstyled plain text */
  .blrow .bltags .tag{ flex:0 0 auto; padding:1px 7px; border-radius:999px; font-size:.72rem; font-weight:600;
        cursor:pointer; color:var(--accent); background:var(--accent-weak); }
  .blrow .bltags .tag:hover{ background:color-mix(in srgb, var(--accent) 22%, transparent); }
  .blrow.picked{ background:color-mix(in srgb, var(--accent) 9%, transparent); }
  .blpick{ width:22px; height:22px; border:1.5px solid var(--line); border-radius:6px; display:inline-flex; align-items:center; justify-content:center; cursor:pointer; color:#fff; flex:0 0 auto; }
  .blpick.on{ background:var(--accent); border-color:var(--accent); }
  .blpick svg{ width:.8rem; height:.8rem; fill:none; stroke:currentColor; stroke-width:3; }
  /* persistent "Today" tray */
  @media (min-width:700px){ .daywrap.planning{ padding-right:312px; box-sizing:border-box; } }
  .picktray{ position:fixed; right:0; top:0; height:100vh; height:var(--vvh,100dvh); width:300px; background:var(--surface); border-left:1px solid var(--line);
             z-index:18; display:flex; flex-direction:column; box-shadow:-8px 0 24px #0003; padding:16px 14px calc(16px + env(safe-area-inset-bottom)); }
  .pthandle{ display:none; }
  .pthead{ font-size:.85rem; color:var(--muted); margin-bottom:10px; }   .pthead b{ color:var(--accent); }
  .pthead .ptclear{ float:right; cursor:pointer; text-decoration:underline; }
  .pthead .ptchev{ display:none; }
  .ptlist{ flex:1; overflow-y:auto; }
  .ptempty{ color:var(--muted); font-size:.82rem; padding:20px 4px; line-height:1.4; }
  .ptrow{ display:flex; align-items:center; gap:5px; padding:7px 2px; border-bottom:1px solid var(--line); }
  .ptrow .ptn{ color:var(--muted); font-size:.76rem; flex:0 0 auto; width:1.5rem; }
  .ptrow .ptt{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:.86rem; }
  .ptrow .ic{ width:26px; height:26px; font-size:.7rem; }
  .picktray .go{ margin-top:12px; width:100%; }
  @media (max-width:640px){ .picktray{ top:auto; bottom:0; left:0; width:100%; height:auto; max-height:54vh; border-left:none;
             border-top:1px solid var(--line); border-radius:16px 16px 0 0; box-shadow:0 -8px 24px #0004; padding-top:8px; }
    .picktray.min{ max-height:none; }   /* collapsed: just the handle + count + commit */
    .pthandle{ display:block; width:40px; height:4px; border-radius:3px; background:var(--line); margin:2px auto 10px; }
    .pthead{ cursor:pointer; margin-bottom:8px; }
    .pthead .ptchev{ display:inline; float:right; margin-left:8px; color:var(--muted); } }

  .dock{ position:relative; flex:0 0 auto; background:transparent; backdrop-filter:blur(14px);
         padding:12px 18px calc(12px + env(safe-area-inset-bottom)); }
  /* proposal cards (enrich / recurrence / captime / …) overlay ABOVE the dock so their appearance never
     resizes the .daywrap list — a mid-click reflow would otherwise drop the click (bug 019FAF20). The
     container is click-through; only the cards themselves capture pointer events. */
  .dockprops{ position:absolute; left:0; right:0; bottom:100%; padding:0 18px; pointer-events:none;
              display:flex; flex-direction:column; }
  .dockprops .recprop{ pointer-events:auto; }
  .dock .inner{ max-width:900px; margin:0 auto; display:flex; gap:8px; align-items:center; }
  /* slice 3: proposed-recurrence chip above the capture input */
  .recprop{ max-width:900px; margin:0 auto 8px; display:flex; align-items:center; gap:8px; font-size:.85rem;
            background:var(--accent-weak); border:1.5px solid var(--accent); border-radius:12px; padding:7px 10px; }
  .recprop .rp-i{ display:inline-flex; color:var(--accent); }
  .recprop .rp-i svg{ width:1rem; height:1rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  .recprop .rp-t{ flex:1; min-width:0; color:var(--text); }   .recprop .rp-t b{ color:var(--accent); font-weight:600; }
  .recprop .rp-set{ border:none; background:var(--accent); color:#fff; border-radius:8px; padding:5px 14px; font-size:.82rem; font-weight:600; cursor:pointer; }
  .recprop .rp-x{ border:none; background:none; color:var(--muted); font-size:1.15rem; line-height:1; cursor:pointer; padding:0 4px; }
  /* AI capture enrichment card: a row of pre-checked chips you accept in one tap */
  .enrichcard .enrichitems{ flex:1; min-width:0; display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
  .enrichcard .enrichitem{ display:inline-flex; align-items:center; gap:5px; background:var(--surface); border:1px solid var(--line); border-radius:999px; padding:3px 11px 3px 8px; font-size:.82rem; color:var(--text); cursor:pointer; user-select:none; }
  .enrichcard .enrichitem input{ accent-color:var(--accent); width:14px; height:14px; cursor:pointer; margin:0; }
  .enrichcard .enrichitem.off{ opacity:.5; text-decoration:line-through; }
  .field{ flex:1; min-width:0; display:flex; align-items:center; gap:8px; background:var(--surface); border:1.5px solid var(--line); border-radius:14px; padding:11px 14px; transition:.15s; }
  .field:focus-within{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-weak); }
  /* nav-first: a subtle 'i' keycap hints how to enter the capture bar; it fades out once the bar is focused */
  .field .capkey{ flex:0 0 auto; margin-left:auto; font:600 .72rem/1 var(--mono,ui-monospace,monospace); color:var(--muted);
    border:1px solid var(--line); border-bottom-width:2px; border-radius:5px; padding:2px 6px; background:var(--surface2,var(--surface));
    cursor:pointer; user-select:none; transition:opacity .12s; }
  .field .capkey:hover{ color:var(--text); border-color:var(--accent); }
  .field:focus-within .capkey{ opacity:0; pointer-events:none; }
  /* ambient context cue (doc 33): the capture field carries the active context's colour (border tint + '+' + focus ring) */
  .field.ctxon{ border-color:color-mix(in srgb, var(--ctx) 42%, var(--line)); }
  .field.ctxon .pfx{ color:var(--ctx); }
  .field.ctxon:focus-within{ border-color:var(--ctx); box-shadow:0 0 0 4px color-mix(in srgb, var(--ctx) 22%, transparent); }
  /* persistent search bar in the Find results (keep-typing-to-re-search) */
  .findbar{ display:flex; align-items:center; gap:10px; margin-bottom:10px; padding:9px 13px; background:var(--surface);
    border:1.5px solid var(--line); border-radius:14px; }
  .findbar:focus-within{ border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-weak); }
  .findpfx{ display:flex; color:var(--muted); flex-shrink:0; } .findpfx svg{ width:17px; height:17px; }
  .findinput{ flex:1; min-width:0; background:none; border:none; outline:none; color:var(--text); font-size:1rem; }
  .findcount{ color:var(--muted); font-size:.8rem; white-space:nowrap; flex-shrink:0; }
  .findsort{ flex-shrink:0; background:var(--surface2); color:var(--muted); border:1px solid var(--line); border-radius:8px;
    font-size:.8rem; padding:3px 6px; cursor:pointer; outline:none; }
  .findsort:hover{ color:var(--text); }
  .findsort:focus-visible{ border-color:var(--accent); }
  .rset .rser{ color:var(--soft); margin-left:4px; cursor:help; }   /* ↻ = repeats with the series */
  /* notes templates (doc 34): suggest/compliance chips + menu + manager */
  .tplbar{ display:flex; align-items:center; gap:8px; margin-bottom:6px; min-height:26px; }
  .tplchip{ display:inline-flex; align-items:center; gap:6px; border:1px dashed var(--line); background:none;
    color:var(--soft); border-radius:999px; padding:3px 11px; cursor:pointer; font-size:.8rem; }
  .tplchip:hover{ border-color:var(--soft); }
  .tplchip.ok{ border-style:solid; color:var(--muted); }
  .tplchip.suggest{ border-color:color-mix(in srgb, var(--accent) 45%, var(--line)); color:var(--text); }
  .tplchip .aii svg{ width:12px; height:12px; }
  .tplmiss{ color:var(--weekend); }
  .tplchip.pinned{ border-style:solid; color:var(--muted); }
  .tplchip.pinned .tpi svg{ width:12px; height:12px; }
  .tplchip.pinned .tplx{ opacity:.5; font-size:.68rem; margin-left:1px; }
  .tplchip.pinned:hover .tplx{ opacity:1; }
  /* the "pin this template to every occurrence?" nudge — subtle, dismissable, opt-in */
  .tplassign{ display:flex; align-items:center; gap:9px; margin:2px 0 10px; padding:8px 12px; font-size:.82rem;
    border:1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-radius:9px;
    background:color-mix(in srgb, var(--accent) 7%, transparent); }
  .tplassign .tai{ display:inline-flex; color:var(--accent); } .tplassign .tai svg{ width:14px; height:14px; }
  .tplassign .tat{ flex:1; min-width:0; }
  .tplassign .go.mini{ width:auto; height:28px; padding:0 12px; font-size:.8rem; }
  .tplassign .lnk.mini{ background:none; border:none; color:var(--muted); cursor:pointer; font-size:.8rem; padding:0 4px; }
  .tplassign .lnk.mini:hover{ color:var(--text); }
  /* Discovery hint (doc 37 §7, anti-Clippy): a tiny ✦ on rows the research agent could take — click opens the detail */
  .dlghint{ color:color-mix(in srgb, var(--accent) 55%, var(--muted)); cursor:pointer; font-size:.8rem; line-height:1; }
  .dlghint:hover{ color:var(--accent); }
  /* research in flight on this row: the ✦ pulses in the accent until the run finishes */
  .dlghint.researching{ color:var(--accent); animation:dlgpulse 1.15s ease-in-out infinite; }
  @keyframes dlgpulse{ 0%,100%{ opacity:.45; transform:scale(1); } 50%{ opacity:1; transform:scale(1.25); } }
  @media (prefers-reduced-motion: reduce){ .dlghint.researching{ animation:none; opacity:1; } }
  /* "Research this" agent (doc 37 slice 0): affordance bar + working state + the proposal card */
  .agentbar{ display:flex; align-items:center; gap:10px; margin:2px 0 10px; font-size:.84rem; }
  .agentforce{ display:flex; align-items:center; gap:8px; margin:2px 0 8px; }   /* subtle "Research anyway" for non-flagged events */
  .agentforcebtn{ display:inline-flex; align-items:center; gap:6px; border:none; background:none; color:var(--muted); border-radius:7px; padding:3px 9px; cursor:pointer; font-size:.82rem; opacity:.7; }
  .agentforcebtn:hover:not(:disabled){ color:var(--accent); opacity:1; background:var(--surface2); }
  .agentforcebtn .aii svg{ width:.85rem; height:.85rem; }
  .agentbar.working{ color:var(--muted); }
  .agentbar .lnk, .agentacts .lnk{ background:none; border:none; color:var(--muted); cursor:pointer; font-size:.82rem; padding:0 4px; }
  .agentbar .lnk:hover, .agentacts .lnk:hover{ color:var(--text); }
  .agenterr{ color:var(--weekend); font-size:.78rem; }
  .aspin{ width:12px; height:12px; border:2px solid var(--line); border-top-color:var(--accent); border-radius:50%;
    display:inline-block; animation:aspin .8s linear infinite; }
  @keyframes aspin{ to{ transform:rotate(360deg); } }
  .agentcard{ border:1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius:11px;
    background:color-mix(in srgb, var(--accent) 5%, transparent); padding:12px 14px; margin:2px 0 12px;
    display:flex; flex-direction:column; gap:9px; }
  .agenthead{ display:flex; align-items:center; gap:8px; }
  .agenthead .aii{ display:inline-flex; color:var(--accent); } .agenthead .aii svg{ width:14px; height:14px; }
  .agenttrust{ margin-left:auto; color:var(--muted); font-size:.72rem; white-space:nowrap; }
  .agentsum{ margin:0; font-size:.88rem; }
  .agentnotes{ max-height:260px; overflow:auto; border-top:1px dashed var(--line); padding-top:8px; font-size:.85rem; }
  .agentsublabel{ font-size:.76rem; font-weight:600; color:var(--muted); margin-bottom:4px; }
  .agentsub{ display:flex; align-items:baseline; gap:8px; font-size:.85rem; padding:2px 0; cursor:pointer; }
  .agentacts{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
  .agentnote{ color:var(--muted); font-size:.74rem; }
  /* write-gate (slice 2): staged external actions — visually set apart from subtasks; args shown verbatim */
  .agentactions{ border-left:3px solid var(--weekend); padding-left:10px; }
  .agentactconn{ color:var(--muted); font-size:.78rem; }
  .agentactargs{ display:block; font-size:.74rem; color:var(--soft); word-break:break-all; }
  .agentactnote{ margin-top:4px; text-align:left; }
  /* parse-guarded mermaid: a broken diagram shows a calm notice + its source (never mermaid's error bomb) */
  .mmfix{ background:var(--surface); border:1px dashed var(--line); border-radius:9px; padding:10px 12px; }
  .mmfixnote{ color:var(--muted); font-size:.78rem; margin-bottom:6px; }
  .mmfix pre{ margin:0; overflow:auto; } .mmfix code{ font-size:.78rem; }
  .agentqs{ border-left:3px solid var(--accent); padding:4px 0 4px 10px; display:flex; flex-direction:column; gap:8px; }
  .agentqrow{ display:flex; flex-direction:column; gap:4px; }
  .agentq{ font-size:.86rem; }
  .agentqact{ display:flex; gap:8px; align-items:center; } .agentqact .pwin{ flex:1; min-width:0; }
  .agentwarn{ color:var(--weekend); font-size:.8rem; border:1px dashed var(--weekend); border-radius:8px; padding:6px 10px; }
  .agentrefine{ display:flex; gap:8px; align-items:center; }
  .agentrefine .pwin{ flex:1; min-width:0; }
  .agentrefine .chip{ white-space:nowrap; }
  .tplpick{ position:relative; }
  .tplmenu{ position:absolute; top:calc(100% + 4px); right:0; z-index:40; min-width:210px; background:var(--surface);
    border:1px solid var(--line); border-radius:12px; padding:5px; box-shadow:0 10px 30px rgba(0,0,0,.35); }
  .tplmenu button{ display:flex; align-items:center; gap:8px; width:100%; border:none; background:none; color:var(--text);
    padding:7px 10px; border-radius:8px; cursor:pointer; font-size:.86rem; text-align:left; }
  .tplmenu button:hover{ background:var(--surface2); }
  .tplmenu .sugg{ color:var(--accent); }
  .tplmenu .aii svg{ width:12px; height:12px; }
  .tplsep{ height:1px; background:var(--line); margin:5px 4px; }
  .tplico.pulse{ color:var(--accent); animation:tplpulse 2s ease-in-out infinite; }   /* a template suggestion is waiting */
  @keyframes tplpulse{ 0%,100%{ opacity:.55; transform:scale(1);} 50%{ opacity:1; transform:scale(1.12);} }
  .tplmgr{ display:flex; flex-direction:column; gap:10px; width:100%; max-width:var(--cw); padding:0 18px 24px; box-sizing:border-box; }
  .tplrow{ display:flex; align-items:center; gap:10px; background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
  .tplinfo{ flex:1; min-width:0; cursor:pointer; }
  .tplname{ font-weight:600; }
  .tplmeta{ color:var(--muted); font-size:.8rem; display:flex; gap:12px; margin-top:2px; }
  .tpledit{ display:flex; flex-direction:column; gap:10px; width:100%; max-width:var(--cw); padding:0 18px 24px; box-sizing:border-box; }
  .tplbody{ min-height:300px; font-family:ui-monospace,monospace; font-size:.9rem; }
  .field.drag{ border-color:var(--accent); border-style:dashed; box-shadow:0 0 0 4px var(--accent-weak); }
  .field.child{ border-color:var(--accent); }
  .childhint{ display:inline-flex; align-items:center; gap:4px; font-size:.78rem; color:var(--accent); background:var(--accent-weak);
              border-radius:8px; padding:2px 8px; cursor:pointer; white-space:nowrap; max-width:45%; overflow:hidden; text-overflow:ellipsis; flex:0 0 auto; }
  .field input{ flex:1; min-width:0; border:none; background:none; color:var(--text); font-size:1rem; outline:none; }
  .dock .inner{ min-width:0; }
  .field .pfx{ color:var(--muted); }
  .go{ border:none; background:var(--accent); color:#fff; border-radius:11px; min-width:46px; height:46px; font-size:1.1rem; font-weight:700; cursor:pointer; display:flex; align-items:center; justify-content:center; }
  .go svg{ width:1.15rem; height:1.15rem; }
  .intro{ animation:pulse 1.1s ease-in-out 2; }
  @keyframes pulse{ 0%,100%{ box-shadow:0 0 0 0 var(--accent-weak);} 50%{ box-shadow:0 0 0 8px var(--accent-weak);} }
  .hint{ color:var(--muted); font-size:.76rem; text-align:center; margin-top:9px; }

  .hitlist{ width:100%; max-width:760px; box-sizing:border-box; padding:0 7px; }   /* fit the viewport (was a centered 760px block → clipped both edges on mobile) */
  .hit{ display:flex; align-items:baseline; gap:10px; padding:10px 11px; border-radius:var(--radius); cursor:pointer; }
  @media (max-width:560px){ .hit .d{ width:84px; } .hit .rp{ max-width:8rem; } }   /* tighten fixed columns on a phone */
  .hit:hover{ background:var(--surface); }
  .hit.sel{ background:var(--surface); box-shadow:0 0 0 1px var(--accent); }   /* keyboard-highlighted search result */
  .hit .d{ color:var(--muted); font-size:.78rem; flex:0 0 auto; width:118px; }
  .hit.done .t{ color:var(--done); }
  .hit.cancelled .t{ text-decoration:line-through; color:var(--muted); }
  .hit .t{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .hit .rp{ color:var(--muted); font-size:.78rem; flex:0 0 auto; white-space:nowrap; max-width:14rem; overflow:hidden; text-overflow:ellipsis; }
  .hit .hitctx{ width:8px; height:8px; border-radius:50%; background:var(--ctx,var(--muted)); flex:0 0 auto; align-self:center;   /* a result from another context */
    box-shadow:0 0 0 2px color-mix(in srgb, var(--ctx,var(--muted)) 20%, transparent); }
  /* Search results = full rows (a lens on the main view). A leading date/state label gives cross-date context. */
  .srow .srdate{ flex:0 0 auto; width:100px; color:var(--muted); font-size:.78rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; align-self:center; }
  .srow .hitctx{ width:8px; height:8px; border-radius:50%; background:var(--ctx,var(--muted)); flex:0 0 auto; align-self:center;
    box-shadow:0 0 0 2px color-mix(in srgb, var(--ctx,var(--muted)) 20%, transparent); }
  @media (max-width:560px){ .srow .srdate{ width:66px; } }
  /* Logbook (done review) */
  .logbar{ display:flex; align-items:center; gap:10px; width:100%; max-width:760px; margin:2px 0 12px; flex-wrap:wrap; }
  .logranges{ display:inline-flex; gap:4px; }
  .logranges button{ border:1.5px solid var(--line); background:var(--surface); color:var(--muted); border-radius:8px; padding:5px 11px; font-size:.8rem; cursor:pointer; }
  .logranges button:hover{ color:var(--text); }
  .logranges button.on{ background:var(--accent); border-color:var(--accent); color:#fff; }
  .logfilter{ flex:1; min-width:180px; border:1.5px solid var(--line); background:var(--surface); color:var(--text); border-radius:8px; padding:6px 10px; font-size:.85rem; }
  .logcount{ color:var(--muted); font-size:.78rem; flex:0 0 auto; }
  .logtime{ color:var(--accent); font-size:.78rem; font-weight:600; flex:0 0 auto; font-variant-numeric:tabular-nums; }
  .loggrp{ margin-bottom:12px; }
  .logday{ display:flex; align-items:baseline; justify-content:space-between; color:var(--muted); font-size:.74rem; text-transform:uppercase; letter-spacing:.04em; font-weight:600; padding:2px 11px; border-bottom:1px solid var(--line); margin-bottom:3px; }
  .logday .logdaymin{ color:var(--accent); font-variant-numeric:tabular-nums; }
  .loggrp .hit .tag{ flex:0 0 auto; }
  .loggrp .hit .logmin{ flex:0 0 auto; color:var(--accent); font-size:.76rem; font-variant-numeric:tabular-nums; margin-left:auto; }

  /* center cover content in the same 900px column as the main view (.wrap), instead of left-aligned;
     show the same atmospheric background as the day view (pinned to the viewport) */
  .cover{ position:fixed; inset:0; z-index:20; background:var(--atmo); background-attachment:fixed; display:flex; flex-direction:column; align-items:center; overflow:auto; }
  /* Assistant as a RIGHT-SIDE PANEL on wide screens: the main view (and any other cover, e.g. the event detail)
     shift left to make room; the main column + the panel are centered as a pair. Below this width it stays a
     full-screen overlay (the .cover default above). --aix = the equal side margin that centers the pair. */
  :root{ --ai-w:380px; }
  @media (min-width:1120px){
    .wrap.aiside{ --aix:max(0px, calc((100vw - 720px - var(--ai-w))/2)); max-width:720px; margin-left:var(--aix); margin-right:0; }
    .wrap.aiside .cover.assist-cover{ inset:auto; top:0; bottom:0; left:auto; right:var(--aix); width:var(--ai-w);
        background:var(--bg); border-left:1px solid var(--line); box-shadow:-10px 0 28px #0004; }
    .wrap.aiside .cover.assist-cover .top, .wrap.aiside .cover.assist-cover .amsgs, .wrap.aiside .cover.assist-cover .adock .inner{ max-width:none; }
    .wrap.aiside .cover:not(.assist-cover){ left:var(--aix); right:calc(var(--ai-w) + var(--aix)); }   /* other covers sit in the main column, beside the panel */
    .wrap.aiside .barbtn .bl{ display:none; }                  /* the docked main column is narrow → icons-only bar (no overflow) */
    .wrap.aiside .barbtn{ padding:0; width:34px; justify-content:center; }
    .wrap.aiside .daywrap{ overflow-x:hidden; }                /* belt-and-suspenders: never a horizontal scrollbar in the day list */
    /* THREE-COLUMN: mini-month (left) + main (center) + assistant (right), kept as ONE CENTERED CLUSTER so the
       panels sit right next to the main view (short eye-travel). Extra width goes to the OUTER margins, never
       between the columns. The main shrinks before the panels do. Higher specificity than .wrap.aiside → wins. */
    .wrap.aiside.hascal{ --aix:0px;
      --main3: min(720px, calc(100vw - var(--calw) - var(--ai-w) - 2*var(--calgap)));   /* main column; shrinks first */
      --cluster: calc(var(--calw) + var(--ai-w) + 2*var(--calgap) + var(--main3));
      --outer: max(0px, calc((100vw - var(--cluster))/2));   /* whitespace lives OUTSIDE the trio, not between the columns */
      max-width: var(--main3);
      margin-left: calc(var(--outer) + var(--calw) + var(--calgap)); margin-right:0; }
    .wrap.aiside.hascal .calrail{ left: var(--outer); }
    .wrap.aiside.hascal .cover.assist-cover{ right: var(--outer); }
    /* the detail (and other non-assist) covers must sit in the MAIN column between the calendar and the panel —
       without this they kept the 2-column right:calc(--ai-w + --aix) and OVERLAPPED the inward-pushed assistant,
       so the assistant was inaccessible with the calendar open in the detail view (bug 2026-08-18). */
    .wrap.aiside.hascal .cover:not(.assist-cover){
        left: calc(var(--outer) + var(--calw) + var(--calgap)); right: calc(var(--outer) + var(--ai-w)); }
  }
  /* each overlay sets --cw (its column width); the header and the body share it so the title always
     lines up with the content instead of a narrow column hanging under a wide title bar */
  .cover .top{ display:flex; align-items:center; gap:8px; padding:18px; width:100%; max-width:var(--cw, 760px); box-sizing:border-box; }
  .cover .top h2{ margin:0; font-size:1.15rem; }
  .cal{ max-width:var(--cw, 760px); width:100%; margin:0 auto; padding:0 18px; }

  /* Settings: left category nav + content pane (collapses to top tabs on mobile) */
  .settings{ width:100%; max-width:var(--cw, 900px); margin:0 auto; padding:0 18px 28px; box-sizing:border-box; display:flex; gap:32px; align-items:flex-start; }
  .setnav{ flex:0 0 158px; display:flex; flex-direction:column; gap:2px; position:sticky; top:0; }
  .setnav button{ text-align:left; padding:9px 12px; border-radius:9px; border:none; background:none; color:var(--muted); font-size:.92rem; cursor:pointer; }
  .setnav button:hover{ background:var(--surface2); color:var(--text); }
  .setnav button.on{ background:var(--surface2); color:var(--text); font-weight:600; }
  .setbody{ flex:1; min-width:0; }
  .setrow{ display:flex; align-items:center; gap:24px; padding:16px 0; border-bottom:1px solid var(--line); }
  .setrow:first-child{ padding-top:2px; }
  .setsec > .setrow:last-of-type{ border-bottom:none; }
  .setinfo{ flex:1; min-width:0; }
  .setname{ font-weight:600; font-size:.95rem; }
  .setdesc{ color:var(--muted); font-size:.8rem; margin-top:3px; line-height:1.45; }
  /* change-password form (settings → account) */
  .pwform{ display:flex; flex-direction:column; gap:14px; padding:4px 0 18px; border-bottom:1px solid var(--line); max-width:420px; }
  .pwfield{ display:flex; flex-direction:column; gap:6px; }
  .pwfield > label{ font-size:.82rem; font-weight:600; color:var(--muted); }
  .pwin{ font:inherit; padding:9px 12px; border:1px solid var(--line); border-radius:9px; background:var(--surface); color:var(--text); }
  .pwin:focus{ outline:none; border-color:var(--accent); }
  .pwmeter{ height:5px; border-radius:3px; background:var(--surface2); overflow:hidden; }
  .pwbar{ height:100%; border-radius:3px; transition:width .18s ease, background .18s ease; }
  .pwbar.s0{ background:var(--weekend); } .pwbar.s1{ background:#e0803c; } .pwbar.s2{ background:#d9b23a; }
  .pwbar.s3{ background:#5aa469; } .pwbar.s4{ background:var(--soft); }
  .pwmeta{ display:flex; justify-content:space-between; gap:10px; font-size:.75rem; }
  .pwlabel{ font-weight:600; } .pwlabel.s0,.pwlabel.s1{ color:var(--weekend); } .pwlabel.s2{ color:#b08a1a; }
  .pwlabel.s3,.pwlabel.s4{ color:var(--soft); }
  .pwreq{ color:var(--muted); } .pwreq.ok{ color:var(--soft); } .pwreq.bad{ color:var(--weekend); }
  .pwshow{ display:inline-flex; align-items:center; gap:7px; font-size:.82rem; color:var(--muted); cursor:pointer; }
  .pwerr{ color:var(--weekend); font-size:.82rem; }
  .pwactions{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
  .pwnote{ color:var(--muted); font-size:.76rem; }
  .setctl{ flex:0 0 auto; }
  .setbody .brief{ margin-top:4px; }
  /* Timezone search + dropdown (localized). Trigger shows the current zone; the popover is a searchable list
     of all IANA zones, current + auto-detected pinned on top. */
  .tzctl{ position:relative; display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
  .tztrigger{ display:inline-flex; align-items:center; gap:8px; border:1.5px solid var(--line); background:var(--surface);
    color:var(--text); border-radius:9px; padding:7px 12px; cursor:pointer; font-size:.85rem; font-variant-numeric:tabular-nums; }
  .tztrigger:hover{ border-color:var(--accent); }
  .tzuse{ border:1px solid var(--line); width:auto; padding:0 12px; }
  .tzpop{ position:absolute; top:calc(100% + 6px); right:0; z-index:60; width:min(360px,86vw);
    background:var(--surface); border:1.5px solid var(--line); border-radius:12px; box-shadow:0 12px 34px #0007; padding:8px; }
  .tzsearch{ width:100%; box-sizing:border-box; border:1.5px solid var(--line); border-radius:9px; background:var(--bg);
    color:var(--text); padding:9px 12px; font-size:.9rem; outline:none; }
  .tzsearch:focus{ border-color:var(--accent); }
  .tzlist{ margin-top:8px; max-height:min(46vh,340px); overflow-y:auto; display:flex; flex-direction:column; gap:2px; }
  .tzitem{ display:flex; align-items:center; gap:10px; width:100%; text-align:left; background:none; border:none; cursor:pointer;
    color:var(--text); padding:8px 10px; border-radius:8px; font-size:.86rem; }
  .tzitem.on{ background:var(--accent-weak); }
  .tzitem.cur{ color:var(--accent); }
  .tzoff{ flex:0 0 88px; color:var(--muted); font-variant-numeric:tabular-nums; font-size:.8rem; }
  .tzcity{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .tzregion{ flex:0 0 auto; color:var(--muted); font-size:.76rem; }
  .tzflag{ flex:0 0 auto; margin-left:auto; color:var(--accent); font-size:.8rem; }
  .tzflag.det{ color:var(--muted); border:1px solid var(--line); border-radius:999px; padding:1px 8px; }
  .tznone{ color:var(--muted); cursor:default; }
  @media (max-width:640px){
    .settings{ flex-direction:column; gap:16px; align-items:stretch; }
    .setnav{ flex-flow:row nowrap; overflow-x:auto; gap:6px; padding-bottom:4px; position:static; align-items:center; }
    .setnav button{ flex:0 0 auto; white-space:nowrap; border:1px solid var(--line); padding:8px 14px; }
    .setrow{ flex-direction:column; align-items:stretch; gap:10px; }
    .setrow .setctl, .setrow .seg{ width:100%; }
  }
  .calwrap{ max-width:560px; width:100%; margin:clamp(22px,7vh,84px) auto 0; padding:0 18px; }
  .navhead{ display:flex; align-items:center; gap:8px; margin-bottom:12px; }
  .ic.yr{ font-size:1.15rem; font-weight:700; line-height:1; width:auto; min-width:0; padding:0 5px; }   /* the « » YEAR steppers are a tight GLYPH, not a full icon-box — else they crowd the month/year title */
  .navhead h2{ min-width:0; overflow:hidden; text-overflow:ellipsis; }   /* never let the title overflow its flex box and overlap the chevrons */
  /* mobile: the Month/Week toggle drops to its own row so prev/next/CLOSE always stay on screen
     (they were being pushed off the right edge — "you can't close the calendar" on a phone) */
  @media (max-width:640px){
    .navhead{ flex-wrap:wrap; }
    .navhead .seg{ order:3; flex:1 1 100%; justify-content:center; }
  }
  .flabel{ display:block; color:var(--muted); font-size:.74rem; text-transform:uppercase; letter-spacing:.05em; margin:0 2px 6px; }
  .fstatus{ display:flex; width:100%; }
  .fstatus button{ flex:1; }
  .fmore{ display:flex; align-items:center; gap:7px; background:none; border:none; color:var(--muted); cursor:pointer; font-size:.82rem; font-weight:600; padding:2px 0; }
  .fmore:hover{ color:var(--text); }
  .fmore .pcaret{ display:inline-block; font-size:.7rem; transition:transform .15s; transform:rotate(180deg); }   /* collapsed: ⌃ points down (expandable) */
  .fmore .pcaret.open{ transform:rotate(0); }
  .brief{ background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:12px 14px; margin:0 0 6px; color:var(--text); font-size:.86rem; line-height:1.5; white-space:pre-wrap; word-break:break-word; font-family:inherit; }
  /* "About you" editor — user-pinned durable facts */
  .aboutbox{ display:flex; flex-direction:column; gap:10px; padding:4px 0 4px; }
  .aboutchips{ display:flex; flex-wrap:wrap; gap:7px; align-items:center; }
  .aboutfact{ display:inline-flex; align-items:center; gap:7px; background:var(--surface); border:1px solid var(--line); border-radius:999px; padding:5px 6px 5px 12px; font-size:.85rem; }
  .aboutfact .x{ display:inline-flex; align-items:center; justify-content:center; width:18px; height:18px; border:none; border-radius:50%; background:var(--surface2); color:var(--muted); cursor:pointer; font-size:.9rem; line-height:1; }
  .aboutfact .x:hover{ background:var(--weekend); color:#fff; }
  .aboutadd{ display:flex; gap:8px; align-items:center; }
  .aboutadd .pwin{ flex:1; max-width:340px; }
  .aboutadd .chip{ white-space:nowrap; }
  /* event detail */
  .row .open{ color:var(--muted); font-size:1.2rem; width:24px; height:28px; opacity:.35; flex:0 0 auto; }   /* blank doc = no notes */
  .row .open.filled{ opacity:.8; color:var(--text); }                                                        /* lined doc = has notes */
  .row.sel .open, .row .open:hover{ opacity:1; color:var(--text); }
  .detailbar{ display:flex; align-items:center; gap:2px; width:100%; max-width:900px; box-sizing:border-box; padding:2px 12px 12px; margin-bottom:14px; border-bottom:1px solid var(--line); }
  .detailbar .close{ margin-left:auto; }
  .detailtitle{ width:100%; max-width:900px; box-sizing:border-box; margin:0; padding:16px 16px 6px; text-align:left; font-size:1.25rem; font-weight:600; line-height:1.3; white-space:normal; overflow-wrap:anywhere; word-break:break-word; outline:none; cursor:text; }
  .detailtitle:focus{ background:var(--surface); border-radius:8px; }
  .tb-more{ position:relative; flex:0 0 auto; }
  .tb-menu{ position:absolute; right:0; top:38px; z-index:30; min-width:160px; background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:5px; box-shadow:0 10px 30px #0008; }
  .tb-menu button{ display:flex; align-items:center; gap:11px; width:100%; text-align:left; background:none; border:none; color:var(--text); padding:9px 11px; border-radius:8px; font-size:.92rem; cursor:pointer; }
  .tb-menu button:hover{ background:var(--surface2); }
  .tb-menu .i{ width:18px; text-align:center; }
  /* top-right account control (desktop): avatar button → dropdown (settings · sign out); mobile keeps the ⋯ menu */
  .acctmenu{ position:relative; flex:0 0 auto; margin-left:auto; }   /* anchors the far right; leaves the ⋯ packed inline with the other actions */
  .acctbtn{ position:relative; width:32px; height:32px; border-radius:50%; border:1px solid var(--line);
            background:color-mix(in srgb, var(--accent) 14%, var(--surface2)); color:var(--accent); cursor:pointer;
            display:inline-flex; align-items:center; justify-content:center; padding:0; }
  .acctbtn:hover{ border-color:var(--accent); }
  .acctinit{ font-size:.74rem; font-weight:700; letter-spacing:.02em; line-height:1; }
  .acctdot{ position:absolute; top:-1px; right:-1px; width:9px; height:9px; border-radius:50%; background:var(--accent); border:2px solid var(--surface); }
  .acctpop{ position:absolute; right:0; top:40px; z-index:30; min-width:216px; background:var(--surface); border:1px solid var(--line); border-radius:11px; padding:5px; box-shadow:0 10px 30px #0008; }
  .acctpop button{ display:flex; align-items:center; gap:11px; width:100%; text-align:left; background:none; border:none; color:var(--text); padding:9px 11px; border-radius:8px; font-size:.92rem; cursor:pointer; }
  .acctpop button:hover{ background:var(--surface2); }
  .acctpop .i{ width:18px; text-align:center; }
  .accthdr{ display:flex; align-items:center; gap:10px; padding:8px 11px 10px; margin-bottom:3px; border-bottom:1px solid var(--line); }
  .accthdr .acctinit.lg{ width:34px; height:34px; border-radius:50%; background:var(--accent); color:#fff; display:inline-flex; align-items:center; justify-content:center; font-size:.82rem; flex:0 0 auto; }
  .acctemail{ color:var(--muted); font-size:.82rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
  .acctreview{ display:inline-block; width:7px; height:7px; border-radius:50%; background:var(--accent); margin-left:auto; flex:0 0 auto; }
  .row.cancelled{ opacity:.62; }
  .row.cancelled .txt{ text-decoration:line-through; color:var(--muted); }
  .row.cancelled .box{ color:var(--muted); font-size:.85rem; }
  .statusseg button{ font-size:.8rem; padding:6px 11px; }
  .estsel{ border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:9px; padding:5px 8px; font-size:.78rem; cursor:pointer; color-scheme:dark light; }
  .spentval{ color:var(--muted); font-size:.78rem; font-variant-numeric:tabular-nums; }
  .spentval.total{ color:var(--accent); }
  .spentbtn{ border:1px solid var(--line); width:auto; padding:0 8px; height:28px; font-size:.74rem; color:var(--muted); }
  .spentbtn:hover{ color:var(--text); border-color:var(--accent); }

  /* Event detail v2: notes + sub-tasks on the left, a properties rail on the right (Linear/Height
     issue-view). The rail is a vertical property list, so new per-event fields from the docs
     (assignee/doc 10, priority, deadline, location, the waiting axis/doc 23) drop in as more .prop rows. */
  .detail-cover:focus{ outline:none; }   /* focused on open so PgDn/Space scroll it — no ring around the whole overlay */
  .detail-cover .dhead{ width:100%; max-width:var(--cw, 1000px); margin:0 auto; box-sizing:border-box; padding:14px 18px 12px; display:flex; align-items:flex-start; gap:10px; border-bottom:1px solid var(--line); }
  .detail-cover .detailtitle{ flex:1; min-width:0; max-width:none; padding:4px 6px; }
  .detail-cover .detailbar{ width:auto; max-width:none; margin:0; padding:0; border:none; flex:0 0 auto; }
  .detail{ width:100%; max-width:var(--cw, 1000px); margin:0 auto; box-sizing:border-box; padding:18px; display:flex; gap:36px; align-items:flex-start; }
  .dmain{ flex:1; min-width:0; }
  .dmain .md{ min-height:140px; }
  .dmain .detailbody{ width:100%; min-height:340px; box-sizing:border-box; resize:vertical; }   /* roomy editor; drag to grow */
  /* sub-tasks read as a section attached UNDER the notes (a divider), not a floating block */
  .dmain .subtasks{ margin:22px 0 0; padding-top:18px; border-top:1px solid var(--line); }
  /* Maximize notes: hide the rail so the notes/editor take the full width + more height */
  .detail.notesmax .dprops{ display:none; }
  .detail.notesmax .dmain .md{ min-height:62vh; }
  .detail.notesmax .dmain .detailbody{ min-height:62vh; }
  .dprops{ flex:0 0 268px; display:flex; flex-direction:column; }
  .prop{ padding:13px 0; border-bottom:1px solid var(--line); display:flex; flex-direction:column; gap:9px; }
  .prop:first-child{ padding-top:0; }
  .prop:last-child{ border-bottom:none; }
  .plabel{ display:flex; align-items:center; gap:7px; font-size:.7rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:600; }
  .plabel .pi{ display:inline-flex; color:var(--muted); }
  .plabel .pi svg{ width:.82rem; height:.82rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  .pval.prow{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
  .pval .pdate{ font-size:.88rem; }
  /* one consistent type scale in the rail: labels .7 (caps) · values .85 · controls .82 · chips .8 */
  .dprops .pval{ font-size:.85rem; }
  /* calm rail (2026-08-06): a SET section collapses to one value line; empty ones live in the add-chip row */
  .prop.sumprop{ padding:10px 0; cursor:pointer; }
  .sumline{ display:flex; align-items:center; gap:8px; font-size:.85rem; color:var(--text); line-height:1.4; min-width:0; }
  .sumline .pi{ display:inline-flex; flex:0 0 auto; color:var(--muted); }
  .sumline .pi svg{ width:.82rem; height:.82rem; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
  .sumline span:last-child{ overflow:hidden; text-overflow:ellipsis; }
  .prop.sumprop:hover .sumline{ color:var(--accent); }
  .plabel.propclk{ cursor:pointer; }
  .plabel .pcaret{ margin-left:auto; font-size:.72rem; color:var(--muted); }
  .prop.addrow{ flex-direction:row; flex-wrap:wrap; gap:6px; padding-top:11px; }
  .addprop{ color:var(--muted); }
  .addprop:hover{ color:var(--text); }
  /* the AI quick-set line: one door to every setting */
  .prop.qsetrow{ padding:0 0 11px; }
  .qsetwrap{ display:flex; align-items:center; gap:8px; border:1px solid var(--line); border-radius:9px; padding:0 10px; background:var(--panel, transparent); }
  .qsetwrap:focus-within{ border-color:var(--accent); }
  .qsetwrap.busy{ opacity:.55; }
  .qsetwrap .qspark{ display:inline-flex; color:var(--muted); }
  .qsetwrap .qspark svg{ width:.82rem; height:.82rem; }
  .qset{ flex:1; min-width:0; border:none; outline:none; background:transparent; height:33px; font-size:.84rem; color:var(--text); }
  .qset::placeholder{ color:var(--muted); opacity:.8; }
  .dprops .pdate, .dprops .rset, .dprops .spentval{ font-size:.85rem; }
  .dprops .statusseg button, .dprops .estsel, .dprops .recsel, .dprops .ralarm, .dprops .tagadd, .dprops .detailtags .tag{ font-size:.82rem; }
  .dprops .spentbtn, .dprops .daypick .dpchip{ font-size:.8rem; }
  .dprops .statusseg{ display:grid; grid-template-columns:1fr 1fr; gap:3px; }
  .prop .tobacklog{ align-self:flex-start; display:inline-flex; align-items:center; gap:6px; padding:5px 11px; border:1px solid var(--line);
    border-radius:8px; background:none; color:var(--muted); font-size:.82rem; cursor:pointer; }   /* send a scheduled event to the backlog */
  .prop .tobacklog:hover{ background:var(--surface2); color:var(--text); }
  .prop .tobacklog .pi svg{ width:.9rem; height:.9rem; fill:none; stroke:currentColor; stroke-width:2; }
  .dprops .statusseg button{ padding:6px 4px; text-align:center; }
  .dprops .estsel{ flex:1; }
  .dprops .remind, .dprops .repeat{ display:flex; flex-direction:column; align-items:flex-start; gap:8px; margin:0; flex-wrap:nowrap; }
  .dprops .remind .ralarm, .dprops .repeat .recsel{ margin-left:0; width:100%; box-sizing:border-box; }
  .dprops .remind .remindset{ display:flex; gap:8px; width:100%; align-items:center; }
  .dprops .remind .remindset .ralarm{ flex:1; }
  .dprops .repeat .daypick{ padding-left:0; flex-wrap:wrap; gap:4px; }
  .dprops .repeat .applyseries{ padding-left:0; flex-wrap:wrap; }
  .dprops .detailtags{ margin:0; }
  @media (max-width:760px){
    /* stacked: STRETCH children to full width — the desktop align-items:flex-start otherwise shrinks the
       notes pane to the textarea's narrow intrinsic (cols) width */
    .detail{ flex-direction:column; gap:18px; padding-top:14px; align-items:stretch; }
    .dmain{ width:100%; }
    .dprops{ flex:none; width:100%; order:-1; }
    .detail-cover .detailtitle{ font-size:1.2rem; }
  }
  @media (max-width:600px){
    /* phone: stack the toolbar BELOW the title so the title gets the full width (no truncation) */
    .detail-cover .dhead{ flex-direction:column; align-items:stretch; gap:4px; }
    .detail-cover .detailtitle{ flex:0 0 auto; }
    .detail-cover .detailbar{ width:100%; justify-content:flex-end; align-items:center; }
    .detail-cover .detailbar .close{ margin-left:6px; }
  }
  .dbar-actions{ display:flex; align-items:center; gap:2px; }
  /* ---- MOBILE event detail: notes are the hero. A Read / Edit / Settings switcher swaps one full-height
        pane at a time; the header stays pinned so you can exit while scrolling. (real-estate-driven, per
        the "Change mobile event details" note.) The m-notes / m-settings classes only exist on mobile. ---- */
  .dmodes{ display:flex; gap:4px; }
  .dmodes button{ display:inline-flex; align-items:center; justify-content:center; width:38px; height:34px; padding:0;
    border:1px solid var(--line); background:var(--surface); color:var(--muted); border-radius:9px; cursor:pointer; }
  .dmodes button svg{ width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; display:block; }
  .dmodes button.on{ border-color:var(--accent); color:var(--accent); background:color-mix(in srgb, var(--accent) 12%, var(--surface)); }
  .detail.m-notes .dprops, .detail.m-notes .subtasks{ display:none; }   /* Read/Edit: only the notes */
  .detail.m-settings .dnotes{ display:none; }                           /* Settings: props + sub-tasks, no notes */
  .detail.m-notes .dmain .md{ min-height:68vh; }
  .detail.m-notes .dmain .detailbody{ min-height:68vh; }
  .dmob-actions{ display:flex; gap:2px; }
  @media (max-width:760px){
    /* narrow (phone / split-screen): pin the title + switcher so you can x-out while scrolling long notes */
    .detail-cover .dhead{ position:sticky; top:0; z-index:6; background:var(--atmo); background-attachment:fixed; }
    .detail-cover .detailbar{ justify-content:flex-start; gap:6px; }
    .dmodes{ margin-right:auto; }                 /* switcher left; print / delete / close cluster right */
    .detail-cover .detailbar .close{ margin-left:0; }
    .detail{ padding-top:12px; }
  }
  .recprop .spentadj{ display:inline-flex; align-items:center; gap:8px; }
  .recprop .spentadj button{ border:1.5px solid var(--accent); background:var(--surface); color:var(--accent); width:26px; height:26px; border-radius:50%; font-size:1rem; line-height:1; cursor:pointer; padding:0; }
  .recprop .spentadj b{ min-width:2.6rem; text-align:center; font-variant-numeric:tabular-nums; }
  /* font-size in REM so the editor follows the text-size setting (root font-size), matching the rendered notes */
  .detailbody{ width:100%; min-height:46vh; background:var(--surface); border:1.5px solid var(--line); border-radius:11px; padding:14px 16px; color:var(--text); font:1rem/1.6 ui-monospace,SFMono-Regular,Menlo,monospace; outline:none; resize:vertical; box-sizing:border-box; }
  .detailbody:focus{ border-color:var(--accent); }
  /* Template suggestion as ghost text: a gray overlay of the proposed skeleton on the EMPTY editor, accepted
     with Tab (code-completion style). The <pre> matches the textarea's box exactly (padding + transparent
     border), sits on top with pointer-events:none, and vanishes the instant you type (x-show !detailBody). */
  .notesedit{ position:relative; }
  .notes-ghost{ position:absolute; inset:0; margin:0; padding:14px 16px; border:1.5px solid transparent; border-radius:11px;
    box-sizing:border-box; font:1rem/1.6 ui-monospace,SFMono-Regular,Menlo,monospace; color:var(--muted);
    white-space:pre-wrap; overflow-wrap:anywhere; overflow:hidden; pointer-events:none; }
  .notes-ghosthint{ position:absolute; top:10px; right:12px; pointer-events:none; font-size:.72rem; color:var(--muted);
    background:var(--surface); padding:2px 9px; border-radius:999px; border:1px solid var(--line); white-space:nowrap; }
  .md{ color:var(--text); line-height:1.6; overflow-wrap:anywhere; min-width:0; overflow-x:hidden; }   /* a long unbroken string must wrap, never stretch across the settings rail */
  .md pre{ overflow-x:auto; max-width:100%; }
  .md.mdedit{ cursor:text; }   /* click the rendered notes to edit (Notion-style) */
  .md.mdedit a{ cursor:pointer; }
  .md.mdedit .mermaid{ cursor:default; }   /* diagrams stay interactive, not click-to-edit */
  .md h1,.md h2,.md h3,.md h4{ margin:1.1em 0 .4em; line-height:1.25; }
  .md h1{ font-size:1.2rem; }   /* was unset → browser default 2em (huge) */
  .md h2{ font-size:1.05rem; border-bottom:1px solid var(--line); padding-bottom:.2em; }
  .md h3,.md h4{ font-size:.98rem; }
  .md p{ margin:.5em 0; } .md ul,.md ol{ margin:.4em 0 .4em 1.3em; } .md li{ margin:.2em 0; }
  .md a{ color:var(--accent); }
  .md code{ background:var(--surface2); padding:.1em .35em; border-radius:5px; font-size:.9em; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
  .md pre{ background:#1e1e1e; border:1px solid var(--line); padding:13px 15px; border-radius:9px; overflow:auto; }   /* dark code block in both themes (VS Code-ish) */
  .md pre code{ background:none; padding:0; color:#d4d4d4; font-size:.88rem; line-height:1.55; }
  .md pre.mermaid{ background:none; border:none; padding:6px 0; text-align:center; line-height:normal; }   /* rendered diagram, not a code block */
  .md pre.mermaid svg{ max-width:100%; height:auto; }
  /* GitHub-style copy button on code blocks — reveals on hover, top-right, doesn't scroll with the code */
  .md pre.codeblock{ position:relative; }
  .md pre.codeblock .codecopy{ position:absolute; top:7px; right:7px; display:inline-flex; align-items:center; justify-content:center;
    width:26px; height:26px; padding:0; border:1px solid #ffffff24; border-radius:6px; background:#ffffff14; color:#cfcfcf;
    cursor:pointer; opacity:0; transition:opacity .12s, background .12s, color .12s; }
  .md pre.codeblock:hover .codecopy, .md pre.codeblock .codecopy:focus-visible{ opacity:1; }
  .md pre.codeblock .codecopy:hover{ background:#ffffff28; color:#fff; }
  .md pre.codeblock .codecopy.copied{ opacity:1; color:#4ade80; border-color:#4ade8055; }   /* green check after copy */
  @media (hover:none){ .md pre.codeblock .codecopy{ opacity:1; } }                            /* touch: always visible */
  /* highlight.js tokens — VS Code Dark+ palette */
  .hljs-keyword,.hljs-literal,.hljs-symbol,.hljs-selector-tag{ color:#569cd6; }
  .hljs-built_in,.hljs-class .hljs-title,.hljs-title.class_,.hljs-type{ color:#4ec9b0; }
  .hljs-string,.hljs-regexp,.hljs-meta .hljs-string{ color:#ce9178; }
  .hljs-number{ color:#b5cea8; }
  .hljs-title,.hljs-title.function_,.hljs-function .hljs-title,.hljs-section{ color:#dcdcaa; }
  .hljs-attr,.hljs-property,.hljs-attribute,.hljs-variable,.hljs-name,.hljs-template-variable{ color:#9cdcfe; }
  .hljs-comment,.hljs-quote{ color:#6a9955; font-style:italic; }
  .hljs-meta,.hljs-doctag{ color:#569cd6; }
  .hljs-deletion{ color:#ce9178; } .hljs-addition{ color:#b5cea8; } .hljs-emphasis{ font-style:italic; } .hljs-strong{ font-weight:700; }
  .md blockquote{ border-left:3px solid var(--line); margin:.5em 0; padding-left:12px; color:var(--muted); }
  /* The browser cram-fits table columns into the panel width and breaks a short cell at its hyphens — a date
     "2026-08-20" wrapped onto two rows while the description column hogged the space (owner 2026-08-20). Keep
     the FIRST column (idiomatically the date / short key) on one line so it gets its due width; other columns
     (the description) still wrap to fill the rest. overflow-x:auto is a safety net for a genuinely too-wide row. */
  .md table{ border-collapse:collapse; display:block; max-width:100%; overflow-x:auto; }
  .md th,.md td{ border:1px solid var(--line); padding:4px 8px; }
  .md th:first-child,.md td:first-child{ white-space:nowrap; }
  .dim{ color:var(--muted); }
  .dinput{ flex:1; background:var(--surface); border:1.5px solid var(--line); border-radius:11px; padding:10px 12px; color:var(--text); font-size:.95rem; outline:none; }
  .dinput:focus{ border-color:var(--accent); }
  /* context switcher (doc 33) — a bare coloured dot on all widths; name in tooltip + dropdown */
  .ctxpick{ position:relative; flex-shrink:0; margin-right:6px; }
  .ctxchip{ display:inline-flex; align-items:center; justify-content:center; border:none; background:none;
    cursor:pointer; padding:4px; border-radius:8px; }
  .ctxchip:hover{ background:var(--surface2); }
  .ctxdot{ width:11px; height:11px; border-radius:50%; background:var(--ctx,var(--muted)); flex-shrink:0;
    box-shadow:0 0 0 2px color-mix(in srgb, var(--ctx,var(--muted)) 22%, transparent); }
  .ctxdot.all{ background:transparent; border:1.5px solid var(--muted); box-shadow:none; }
  /* context-switch cue: the context NAME blasted center-screen in --pulse, fading up then down.
     The overlay centers; only the name animates. Inert until .ctxgo restarts the animation.
     NB the trigger class is .ctxgo, NOT .go — .go is the primary-button style (accent bg, 46px tall). */
  .ctxpulse{ position:fixed; inset:0; z-index:70; pointer-events:none;   /* the context-switch cue must sit ABOVE every cover/modal (was 16 → hidden behind the assistant/detail) — it's inert (pointer-events:none), so lifting it only makes it visible */
    display:flex; align-items:center; justify-content:center; }
  .ctxpulsename{ font-weight:800; font-size:clamp(2.1rem, 10vw, 6rem); line-height:1; letter-spacing:-.02em;
    color:var(--pulse,var(--accent)); opacity:0; text-align:center; padding:0 6vw; max-width:100%;
    text-shadow:0 2px 30px color-mix(in srgb, var(--pulse,var(--accent)) 35%, transparent); }
  .ctxpulse.ctxgo .ctxpulsename{ animation:ctxpulse .8s cubic-bezier(.2,.7,.3,1); }
  @keyframes ctxpulse{
    0%{ opacity:0; transform:translateY(14px) scale(.94); }
    30%{ opacity:1; transform:translateY(0) scale(1); }
    60%{ opacity:1; transform:translateY(0) scale(1); }
    100%{ opacity:0; transform:translateY(-14px) scale(1.04); } }
  @media (prefers-reduced-motion: reduce){ .ctxpulse.ctxgo .ctxpulsename{ animation:none; } }
  .ctxmenu{ position:absolute; top:calc(100% + 5px); left:0; z-index:40; min-width:150px; background:var(--surface);
    border:1px solid var(--line); border-radius:12px; padding:5px; box-shadow:0 10px 30px rgba(0,0,0,.35); }
  .ctxmenu button{ display:flex; align-items:center; gap:9px; width:100%; border:none; background:none; color:var(--text);
    padding:7px 9px; border-radius:8px; cursor:pointer; font-size:.86rem; text-align:left; }
  .ctxmenu button:hover{ background:var(--surface2); }
  .ctxmenu button.on{ background:color-mix(in srgb, var(--soft) 18%, var(--surface2)); }
  /* Settings → Contexts (doc 33 Phase 4) */
  .setintro{ color:var(--muted); font-size:.9rem; padding:2px 0 14px; }
  .ctxeditlist{ display:flex; flex-direction:column; gap:10px; }
  .ctxedit{ display:grid; grid-template-columns:auto 1fr auto auto; align-items:center; gap:12px;
    background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:12px 14px; }
  .ctxedit .ctxsw{ width:26px; height:26px; padding:0; border:1px solid var(--line); border-radius:7px; background:none; cursor:pointer; }
  .ctxedit .ctxnm{ background:var(--surface2); border:1px solid var(--line); border-radius:8px; color:var(--text); padding:7px 10px; font-size:.95rem; min-width:0; }
  .ctxedit .ctxdefbtn{ border:1px solid var(--line); background:none; color:var(--muted); border-radius:999px; padding:5px 12px; font-size:.78rem; cursor:pointer; white-space:nowrap; }
  .ctxedit .ctxdefbtn.on{ border-color:var(--accent); color:var(--accent); cursor:default; }
  .ctxedit .ctxdel{ border:1px solid var(--line); color:var(--muted); }
  .ctxedit .ctxdel:hover{ color:var(--weekend); border-color:var(--weekend); }
  .ctxauto{ grid-column:2 / -1; display:flex; align-items:center; gap:10px; }
  .ctxautolbl{ color:var(--muted); font-size:.78rem; white-space:nowrap; }
  .ctxedit .ctxcidr{ flex:1; background:var(--surface2); border:1px solid var(--line); border-radius:8px; color:var(--text);
    padding:6px 10px; font-size:.85rem; font-variant-numeric:tabular-nums; min-width:0; }
  .ctxadd{ margin-top:14px; display:inline-flex; align-items:center; gap:7px; border:1px dashed var(--line);
    background:none; color:var(--soft); border-radius:10px; padding:9px 14px; cursor:pointer; font-size:.9rem; }
  .ctxadd:hover{ border-color:var(--soft); color:var(--text); }
  @media (max-width:640px){ .ctxedit{ grid-template-columns:auto 1fr auto; } .ctxedit .ctxdefbtn{ grid-column:2 / -1; justify-self:start; } }
  /* AI bulk-sort review (doc 33 §9) */
  .ctxsort{ display:flex; align-items:center; gap:16px; margin-top:18px; padding-top:16px; border-top:1px solid var(--line); }
  .ctxsort .setinfo{ flex:1; }
  .gho{ border:1px solid var(--line); background:none; color:var(--text); border-radius:10px; padding:9px 14px; cursor:pointer; font-size:.9rem; white-space:nowrap; }
  .gho:hover{ border-color:var(--soft); } .gho:disabled{ opacity:.5; cursor:default; }
  .sortbody{ max-height:min(60vh,460px); overflow:auto; padding:4px 2px; }
  .sortempty{ color:var(--muted); padding:24px 8px; text-align:center; }
  .sortrow{ display:flex; align-items:center; gap:12px; padding:9px 8px; border-bottom:1px solid var(--line); }
  .sortrow.off{ opacity:.45; }
  .sortrow .sorttitle{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; cursor:pointer; }
  .sortsel{ flex:0 0 auto; background:var(--surface2); border:1px solid var(--line); border-radius:8px; color:var(--text); padding:6px 8px; font-size:.85rem; }
  .sortfoot{ display:flex; align-items:center; gap:10px; padding-top:14px; margin-top:6px; border-top:1px solid var(--line); }
  /* subscribe-to-calendar-feed form (doc 27 §5) */
  .icssub{ margin-top:16px; padding-top:14px; border-top:1px dashed var(--line); }
  .icssub .setdesc{ margin:4px 0 10px; }
  .icssub .connadd{ display:flex; gap:8px; align-items:center; }
  .icssub .connadd input{ flex:1; min-width:0; }
  .icssub .connadd input.icstag{ flex:0 1 150px; }
  /* detail-panel context picker (doc 33): move this event to a space */
  .ctxrow{ position:relative; display:flex; align-items:center; gap:10px; }
  .ctxrowlbl{ color:var(--muted); font-size:.78rem; }
  .ctxpickbtn{ display:inline-flex; align-items:center; gap:7px; }
  .ctxpickbtn .ctxcaret{ color:var(--muted); font-size:.7rem; }
  .detctxmenu{ top:calc(100% + 4px); }
  .seg{ display:inline-flex; background:var(--surface2); border-radius:10px; padding:3px; }
  .seg button{ border:none; background:none; color:var(--muted); padding:5px 12px; border-radius:8px; cursor:pointer; font-size:.85rem; }
  .seg button.on{ background:var(--surface); color:var(--text); }
  /* flags + language dropdown (scales past a single row) */
  .flag{ display:inline-flex; }
  .flag svg{ height:11px; width:auto; display:block; border-radius:2px; box-shadow:0 0 0 1px rgba(0,0,0,.18); }
  .langsel{ position:relative; }
  .langbtn{ display:inline-flex; align-items:center; gap:8px; min-width:150px; padding:8px 11px; border:1px solid var(--line); border-radius:10px; background:var(--surface2); color:var(--text); cursor:pointer; font-size:.88rem; }
  .langbtn .langname{ flex:1; text-align:left; }
  .langbtn .langcaret{ width:10px; height:6px; flex:0 0 auto; color:var(--muted); transition:transform .12s ease; }
  .langbtn.open .langcaret{ transform:rotate(180deg); }
  .langmenu{ position:absolute; right:0; top:calc(100% + 6px); z-index:30; min-width:100%; padding:5px; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 12px 32px rgba(0,0,0,.28); }
  .langopt{ display:flex; align-items:center; gap:9px; width:100%; padding:8px 10px; border:none; border-radius:8px; background:none; color:var(--text); cursor:pointer; font-size:.9rem; white-space:nowrap; text-align:left; }
  .langopt:hover{ background:var(--surface2); }
  .langopt.on{ color:var(--accent); }
  .langopt .langname{ flex:1; }
  .langopt .langtick{ color:var(--accent); font-size:.8rem; }
  .dow{ display:grid; grid-template-columns:repeat(7,1fr); margin:12px 0 4px; }
  .dow span{ text-align:center; color:var(--muted); font-size:.72rem; }
  .dow span.we{ color:var(--weekend); }
  .grid{ display:grid; grid-template-columns:repeat(7,1fr); gap:4px; }
  .cell{ aspect-ratio:1; border-radius:10px; border:1px solid transparent; display:flex; flex-direction:column; align-items:center; justify-content:center; cursor:pointer; color:var(--text); font-size:.95rem; }
  .cell:hover{ background:var(--surface); }
  .cell.out{ color:var(--muted); opacity:.45; }
  .cell.we{ color:var(--weekend); }
  .cell.today{ border-color:var(--accent); }
  .cell.cursor{ box-shadow:0 0 0 2px var(--accent) inset; }   /* keyboard cursor ring */
  .cell.sel{ background:var(--accent); color:#fff; }
  .cell .dot{ width:5px; height:5px; border-radius:50%; background:var(--accent); margin-top:3px; }
  .cell.sel .dot{ background:#fff; }
  .weekrow .cell{ aspect-ratio:auto; padding:14px 0; }

  /* PROTOTYPE: persistent left-rail mini-month (desktop). Mirrors the right-docked .timeline rail; pushes the
     main column right via .wrap.hascal (same gutter math as the docked assistant). Never rendered on mobile. */
  /* Everything sizes in REM so the rail scales with the user's text-size (root font 14–23px): the title-to-rail
     width ratio stays constant, so if "September 2026" fits at one size it fits at ALL of them (no re-wrap). */
  .calrail{ position:fixed; left:0; top:0; width:var(--calw,15rem); height:100vh; height:var(--vvh,100dvh);
    background:var(--surface); border-right:1px solid var(--line); z-index:15; display:flex; flex-direction:column; gap:.5rem;
    padding:.9rem .9rem env(safe-area-inset-bottom); box-shadow:8px 0 24px #0003; overflow-y:auto; }
  .calrail-head{ display:flex; align-items:center; gap:0; }
  .calrail-head .ic{ width:1.5rem; height:1.75rem; flex:0 0 auto; font-size:1rem; }   /* compact + scales, so a long "September 2026" fits on one line at any text size */
  .calrail-head .ic.yr{ width:1.15rem; padding:0; font-size:.95rem; }   /* the « » year glyphs are tighter still — the rail is only 15rem, five buttons + the title must fit */
  .calrail-title{ flex:1 1 0; min-width:0; text-align:center; font-size:.84rem; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .calrail-seg{ align-self:stretch; }
  .calrail-seg .seg, .calrail .seg{ width:100%; }
  .calrail .dow{ margin:2px 0 2px; }
  .calrail .grid{ gap:3px; }
  .calrail .cell{ font-size:.82rem; border-radius:8px; }
  .calrail .cell .dot{ width:4px; height:4px; margin-top:2px; }
  .calrail .cell.caldrop{ box-shadow:0 0 0 2px var(--accent) inset; background:var(--accent-soft, rgba(99,102,241,.16)); }   /* PROTOTYPE: drag-a-row drop target */
  /* PROTOTYPE drag-to-date affordances: a chip that follows the cursor, and a dimmed source row while carrying */
  .dragghost{ position:fixed; z-index:40; pointer-events:none; transform:translate(14px,10px); max-width:220px; padding:6px 11px;
    background:var(--surface); border:1px solid var(--accent); border-radius:9px; box-shadow:0 10px 28px #0007;
    font-size:.85rem; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .row.dragsrc{ opacity:.38; }
  .calrail-today{ margin-top:6px; text-align:center; cursor:pointer; }
  .date.calon{ color:var(--accent); }
  .wrap.hascal{ --calw:15rem; --calgap:1.5rem;   /* rem so the rail + gutter scale with text size; --calgap = the gutter to the day column */
    --calgut:max(0px, calc((100vw - 900px - var(--calw) - var(--calgap))/2));
    max-width:min(900px, calc(100vw - var(--calw) - var(--calgap)));
    margin-left:calc(var(--calgut) + var(--calw) + var(--calgap)); margin-right:0; }
  .wrap.hascal .calrail{ left:var(--calgut); }
  /* the email-verify banner is a fixed 34px bar at top:0 — start the rail below it so its header isn't covered */
  .wrap.verifybar .calrail{ top:34px; height:calc(100vh - 34px); height:calc(var(--vvh,100dvh) - 34px); }

    /* the goal LAYER (doc 46 P1): statement rows, pulse lines, the evidence ledger, chips */
  .goalrow2{ padding:10px 12px; border:1px solid var(--line); border-radius:11px; margin-bottom:9px; }
  .goalrow2.parked{ opacity:.55; }
  .goalrow2 .gmain{ cursor:pointer; }
  .goalrow2 .gname{ font-weight:600; }
  .goalrow2 .gtop{ display:flex; align-items:center; gap:8px; }
  .gchip{ flex:0 0 auto; padding:1px 8px; border-radius:999px; font-size:.7rem; font-weight:600; color:var(--accent); background:var(--accent-weak); }
  .gchip.gdue{ color:var(--danger, #e5484d); background:transparent; border:1px solid var(--line); }
  /* the mirror status chip — self-relative, honest (doc 46): green=on track, amber=slipping/behind, muted=silent */
  .gchip.gst{ text-transform:lowercase; letter-spacing:.02em; }
  .gchip.gst-tracking{ color:#1f9d5a; background:color-mix(in srgb, #1f9d5a 13%, transparent); }
  .gchip.gst-slipping{ color:#b0741a; background:color-mix(in srgb, #b0741a 15%, transparent); }
  .gchip.gst-behind{ color:var(--danger,#e5484d); background:color-mix(in srgb, #e5484d 13%, transparent); }
  .gchip.gst-silent{ color:var(--muted); background:var(--surface2); }
  .gchip.gst-plateaued{ color:#5f7183; background:color-mix(in srgb, #5f7183 14%, transparent); }
  .gchip.gst-stalled{ color:#c0562a; background:color-mix(in srgb, #c0562a 14%, transparent); }
  /* no model yet — honest "teach me", never a false green (doc 46 §4.4) */
  .gchip.gst-unknown{ color:var(--muted); background:transparent; border:1px dashed var(--line); }
  /* THE DOSSIER + COACH (doc 46 §4.4): the AI's model of the goal + one grounded next action */
  .gdoss{ margin-top:9px; }
  .gunderstand{ font-size:.78rem; color:var(--accent); background:var(--accent-weak); border:0; border-radius:8px;
    padding:5px 11px; cursor:pointer; } .gunderstand:disabled{ opacity:.55; cursor:default; }
  .gdrivers{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:6px; }
  .gdrivers .gdlabel{ font-size:.72rem; color:var(--muted); margin-right:2px; }
  .gchip.gdrv{ color:var(--text); background:var(--surface2); font-weight:500; }
  .gcurrent{ font-size:.86rem; color:var(--text); line-height:1.45; }
  .gpace{ font-size:.78rem; color:var(--muted); margin-top:3px; }
  .gteach{ margin-top:8px; padding:9px 11px; border-radius:9px; background:var(--surface2); }
  .gteach .gq{ font-size:.84rem; color:var(--text); margin-bottom:5px; }
  .gteach .gansw{ margin-top:6px; }
  /* the one next-action — accept (→ event), alter, or dismiss */
  .gsug{ margin-top:9px; padding:10px 12px; border:1px solid var(--accent); border-radius:10px;
    background:color-mix(in srgb, var(--accent) 6%, transparent); }
  .gsug-why{ font-size:.78rem; color:var(--muted); margin-bottom:6px; line-height:1.4; }
  .gsug-row{ display:flex; align-items:center; gap:8px; }
  .gsug-lead{ color:var(--accent); font-weight:700; }
  .gsug-text{ font-size:.9rem; font-weight:600; color:var(--text); }
  .gsug-edit{ flex:1; min-width:0; padding:5px 8px; border:1px solid var(--line); border-radius:7px;
    background:var(--surface); color:var(--text); font-size:.9rem; }
  .gbtn{ flex:0 0 auto; font-size:.78rem; font-weight:600; color:#fff; background:var(--accent); border:0;
    border-radius:7px; padding:5px 11px; cursor:pointer; }
  .gbtn.ghost{ color:var(--accent); background:transparent; border:1px solid var(--line); }
  .grefresh{ margin-top:8px; font-size:.72rem; color:var(--muted); background:transparent; border:0; cursor:pointer;
    padding:2px 0; } .grefresh:hover{ color:var(--accent); } .grefresh:disabled{ opacity:.55; cursor:default; }
  /* HOLD (doc 46 §4.5): a calm paused chip; the honest resume chip carries the accent (act on me) */
  .gchip.gst-hold{ color:#4b6b8a; background:color-mix(in srgb, #4b6b8a 13%, transparent); }
  .gchip.gst-resume{ color:var(--accent); background:var(--accent-weak); }
  .ghold{ font-size:.76rem; color:var(--muted); margin-top:4px; }
  .gholdpick{ display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-top:8px; padding:8px 10px;
    background:var(--surface2); border-radius:9px; }
  .gholdpick .ghlabel{ font-size:.74rem; color:var(--muted); margin-right:2px; }
  .gholddate{ padding:4px 6px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--text); font-size:.8rem; }
  .gholdreason{ flex:1; min-width:120px; padding:5px 8px; border:1px solid var(--line); border-radius:7px; background:var(--surface); color:var(--text); font-size:.82rem; }
  /* THE PROACTIVE NUDGE (doc 46 §4.5): goal guidance surfaced on the day — accent-framed, calm, dismissible */
  .gnudge{ border:1px solid var(--accent); border-radius:12px; padding:12px 14px; margin:0 0 14px;
    background:color-mix(in srgb, var(--accent) 5%, transparent); }
  .gnudge-head{ display:flex; align-items:center; gap:7px; font-size:.72rem; font-weight:700; letter-spacing:.06em;
    text-transform:uppercase; color:var(--accent); }
  .gnudge-head .aii{ display:inline-flex; } .gnudge-head .aii svg{ width:14px; height:14px; }
  .gnudge-x{ background:transparent; border:0; cursor:pointer; color:var(--muted); display:inline-flex; }
  .gnudge-x svg{ width:15px; height:15px; }
  .gnudge-item{ margin-top:9px; }
  /* wraps so the actions drop to their own line when a large font / narrow phone would otherwise squeeze the
     goal NAME to nothing (owner: "goals in main view breaks on mobile") */
  .gnudge-row{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 8px; }
  .gnudge-goal{ font-weight:600; color:var(--text); cursor:pointer; flex:1 1 auto; min-width:7.5em;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .gnudge-goal:hover{ color:var(--accent); }
  .gnudge-acts{ display:inline-flex; gap:6px; flex:0 0 auto; margin-left:auto; }   /* right-aligned; wraps below when tight */
  .gnudge-sug{ margin-top:4px; font-size:.84rem; color:var(--muted); line-height:1.4; }
  /* SCHEDULE-AWARE PLACEMENT chooser (doc 46 §4.6) */
  .placard-task{ font-size:.92rem; color:var(--text); margin:2px 0 14px; }
  .placard-best{ display:flex; flex-direction:column; align-items:flex-start; gap:2px; text-align:left; }
  .placard-best .placard-when{ font-weight:700; }
  .placard-best .placard-why{ font-size:.78rem; font-weight:400; opacity:.85; }
  .placard-alts{ display:flex; flex-wrap:wrap; gap:7px; }
  .placard-alt{ flex:0 0 auto; font-size:.82rem; color:var(--text); background:var(--surface2); border:1px solid var(--line);
    border-radius:9px; padding:7px 12px; cursor:pointer; display:inline-flex; align-items:center; gap:6px; }
  .placard-alt:hover{ border-color:var(--accent); color:var(--accent); }
  .placard-pick{ position:relative; overflow:hidden; }
  .placard-pick input[type=date]{ position:absolute; inset:0; opacity:0; cursor:pointer; }
  /* THE MIRROR card (doc 46 §4.2) — the week's attention accounting, headed by the assistant's honest read */
  .gmirror{ border:1px solid var(--line); border-radius:12px; padding:14px 16px; margin-bottom:16px;
    background:linear-gradient(180deg, var(--accent-weak), transparent); }
  .gmirror-head{ display:flex; align-items:center; gap:7px; font-size:.72rem; font-weight:700; letter-spacing:.08em;
    text-transform:uppercase; color:var(--accent); }
  .gmirror-head .aii{ display:inline-flex; } .gmirror-head .aii svg{ width:14px; height:14px; }
  .gmirror-brief{ margin:8px 0 0; font-size:.96rem; line-height:1.5; color:var(--text); }
  .gmirror-cap{ margin:10px 0 0; font-size:.82rem; color:var(--muted); }
  .gpulse{ font-size:.74rem; color:var(--muted); margin-top:2px; }
  .gfacet{ margin:6px 0 0 10px; font-size:.88rem; cursor:pointer; display:flex; align-items:baseline; }
  .gfacet:hover{ color:var(--accent); }
  .goalrow2 .gact{ width:26px; height:26px; opacity:.35; }
  .goalrow2:hover .gact{ opacity:.8; }
  .gweeks{ display:flex; align-items:flex-end; gap:4px; height:40px; margin:6px 0 12px; }
  .gwk .gwbar{ width:14px; border-radius:4px 4px 0 0; background:var(--accent); opacity:.8; }
  .gwk .gwbar.zero{ background:var(--line); height:4px !important; }
  .gledger{ display:flex; align-items:baseline; gap:10px; padding:7px 4px; border-bottom:1px solid var(--line); cursor:pointer; }
  .gledger:hover{ background:var(--surface2); }
  .gledger .gld{ flex:0 0 auto; font-size:.74rem; color:var(--muted); font-variant-numeric:tabular-nums; }
  .gledger .glt{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .gledger .glt.done{ opacity:.6; }
  .gledger .glw{ flex:0 0 auto; }
  .tag.goalchip.ai{ opacity:.6; border:1px dashed var(--accent); background:transparent; }   /* inferred → muted until confirmed */

  /* mobile polish (bug list 2026-08-06): the drill-in breadcrumb header was outsized on a phone, and the
     search rows drowned in meta — keep date + title + open affordances, drop tags/breadcrumbs/meta there. */
  @media (max-width:640px){
    .crumbs .crumb.line{ font-size:.92rem; font-weight:650; }
    .crumbs .crumb.home{ height:26px; }
    .srow .rowmeta{ display:none; }
    .srow .chip.hard{ display:none; }
  }

  .toast{ position:fixed; bottom:92px; left:50%; transform:translateX(-50%); background:var(--text); color:var(--bg); padding:8px 15px; border-radius:10px; font-size:.85rem; z-index:30; }
  /* doc 42: upgrade prompt shown when a Pro-gated action is refused */
  .upsell-bar{ position:fixed; bottom:92px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:12px;
    background:var(--surface); color:var(--text); border:1px solid var(--accent); box-shadow:0 6px 24px rgba(0,0,0,.18);
    padding:9px 12px 9px 16px; border-radius:12px; font-size:.85rem; z-index:31; max-width:min(92vw,520px); }
  .upsell-bar .ut{ flex:1; min-width:0; }
  .upsell-bar .go.mini{ width:auto; padding:5px 12px; font-size:.8rem; flex:0 0 auto; }
  .auth{ max-width:330px; width:100%; margin:16vh auto 0; padding:0 18px; }
  .auth h2{ letter-spacing:-.02em; margin-bottom:2px; }
  .auth input{ width:100%; background:var(--surface); border:1.5px solid var(--line); border-radius:11px; padding:12px 14px; margin-bottom:10px; color:var(--text); font-size:1rem; outline:none; }
  .auth input:focus{ border-color:var(--accent); }

  /* --- sign-in screen: morphing-canvas background + glass card (SignIn.html port, dark) --- */
  .authstage{ position:fixed; inset:0; z-index:30; background:var(--atmo); display:flex; align-items:center; justify-content:center; padding:24px; }
  .loginbg{ position:absolute; inset:0; opacity:.6; }
  .authcard{ position:relative; z-index:1; width:100%; max-width:360px; padding:30px 28px 26px;
    background:color-mix(in srgb, var(--surface) 78%, transparent);
    border:1px solid var(--line); border-radius:18px;
    box-shadow:0 18px 50px -12px rgba(0,0,0,.55), 0 0 0 1px rgba(255,255,255,.02) inset;
    backdrop-filter:blur(14px) saturate(1.2); -webkit-backdrop-filter:blur(14px) saturate(1.2); }
  /* No entry animation on the card at all: an earlier scale-in made the card (and its font) visibly grow,
     which read as "login font small until selected". The card just appears; the x-transition on it gives a
     gentle opacity fade. Nothing transforms the card, so it can never change size. */
  /* Sign-in brand: the mark leads as the logo; the name sits beneath as a small letter-spaced
     nameplate. The two are held at very different sizes so the mark and the "XC…" wordmark
     don't stutter into each other (an equal-weight lockup read as the same thing twice). */
  .authmark{ display:block; width:72px; height:72px; margin:0 auto 10px;
    fill:none; stroke:var(--accent); stroke-width:16; stroke-linecap:butt; }
  .authmark .chev{ stroke-linejoin:miter; }
  .authbrand{ text-align:center; margin:0 0 16px; font-weight:700; font-size:1.02rem;
    letter-spacing:.2em; text-transform:uppercase; color:var(--muted); }
  .authtag{ text-align:center; color:var(--muted); font-size:.88rem; margin:0 0 20px; }
  .authtoggle{ display:flex; gap:20px; justify-content:center; margin-bottom:18px; }
  .authtoggle span{ cursor:pointer; font-size:1.02rem; color:var(--muted); padding-bottom:3px;
    border-bottom:2px solid transparent; transition:color .15s, border-color .15s; }
  .authtoggle span.on{ color:var(--text); font-weight:700; border-bottom-color:var(--accent); }
  /* floor at 16px: below it iOS/mobile zooms the page on focus ("the font gets large"); the app font
     preference (xc_base) can be <16, so honor it only when it's already >=16 */
  /* PLAIN 17px (not max()/rem): Chrome's autofill/preview renderer doesn't evaluate max() and falls back to
     its default form-control font (~13px), so only the autofilled value looked small until you interacted.
     A literal px it can't fumble. 17>16 so mobile still doesn't zoom on focus. */
  .authcard input{ width:100%; background:var(--surface); border:1.5px solid var(--line); border-radius:11px;
    padding:12px 14px; margin-bottom:10px; color:var(--text); font-size:17px; outline:none; transition:border-color .15s, box-shadow .15s; }
  .authcard input:focus{ border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-weak); }
  /* Chrome autofill renders remembered values with ITS OWN style (light bg, dark text, a smaller font that
     only corrects on interaction — "the autopopulated text is small until I click"). Pin our own style so an
     autofilled field looks + sizes exactly like a typed one. The 600000s bg transition parks Chrome's restyle. */
  .authcard input:-webkit-autofill,
  .authcard input:-webkit-autofill:hover,
  .authcard input:-webkit-autofill:focus{
    font-size:17px;
    -webkit-text-fill-color:var(--text); caret-color:var(--text);
    -webkit-box-shadow:0 0 0 100px var(--surface) inset;
    transition:background-color 600000s 0s, color 600000s 0s; }
  .authgo{ width:100%; height:46px; margin-top:6px; }
  .autherr{ color:var(--danger); font-size:.85rem; margin:12px 0 0; text-align:center; min-height:1em; }
  @media (prefers-reduced-motion: reduce){ .authcard{ animation:none; } }

  /* assist (active AI door) */
  .amsgs{ flex:1; overflow:auto; max-width:640px; width:100%; margin:0 auto; padding:10px 18px; display:flex; flex-direction:column; gap:10px; }
  .amsg{ display:flex; flex-direction:column; max-width:86%; }
  .amsg.user{ align-self:flex-end; align-items:flex-end; }
  .amsg.assistant{ align-self:flex-start; }
  .abubble{ padding:10px 14px; border-radius:15px; background:var(--surface); border:1px solid var(--line); overflow-wrap:anywhere; line-height:1.45; }
  .abubble .utext{ white-space:pre-wrap; }                              /* preserve the user's own line breaks — but NOT the wrapper's source whitespace */
  /* The assistant is the one place XCortex cannot be sub-second — a cold measurement is ~15s of real work.
     A motionless "…" that long reads as a hung app, so the bubble narrates what the server is ACTUALLY
     doing, with an elapsed count once it's clearly a slow one. Motion is small and steady on purpose:
     enough to say "alive", not enough to demand attention while the user waits. */
  .abubble.working{ display:flex; align-items:center; gap:9px; }
  .abubble .wtext{ opacity:.85; }
  .abubble .wsecs{ margin-left:auto; font-size:.82em; opacity:.5; font-variant-numeric:tabular-nums; }
  .wdots{ display:inline-flex; gap:3px; flex:none; }
  .wdots i{ width:5px; height:5px; border-radius:50%; background:currentColor; opacity:.35; animation:wdot 1.2s ease-in-out infinite; }
  .wdots i:nth-child(2){ animation-delay:.16s; } .wdots i:nth-child(3){ animation-delay:.32s; }
  @keyframes wdot{ 0%,80%,100%{ opacity:.25; transform:translateY(0); } 40%{ opacity:.9; transform:translateY(-2px); } }
  @media (prefers-reduced-motion: reduce){ .wdots i{ animation:none; opacity:.5; } }
  .abubble .md > :first-child{ margin-top:0; } .abubble .md > :last-child{ margin-bottom:0; }
  .abubble .md h1, .abubble .md h2, .abubble .md h3, .abubble .md h4{ font-size:1rem; margin:.4em 0 .2em; border-bottom:none; padding-bottom:0; }   /* keep chat replies from ballooning on a heading */
  .amsg.user .abubble{ background:var(--accent); color:#fff; border-color:transparent; }
  .abubble.dim{ color:var(--muted); }
  /* no-AI onboarding panel in the assistant dock */
  .aionboard{ max-width:470px; margin:16px auto; padding:18px 20px; border:1px solid var(--line); border-radius:16px; background:var(--surface); }
  .aiob-title{ display:flex; align-items:center; gap:8px; font-size:1.05rem; font-weight:650; margin-bottom:8px; }
  .aiob-title .ibtn{ color:var(--accent); display:inline-flex; }
  .aiob-title .ibtn svg{ width:1.1rem; height:1.1rem; fill:none; stroke:currentColor; stroke-width:2; }
  .aionboard p{ color:var(--muted); font-size:.86rem; line-height:1.5; margin:0 0 10px; }
  .aiob-steps{ margin:0 0 14px; padding-left:20px; font-size:.86rem; line-height:1.55; }
  .aiob-steps li{ margin:4px 0; }
  .aiob-steps a, .aionboard a{ color:var(--accent); }
  .aiob-actions{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom:12px; }
  .aiob-foot{ margin:0 !important; font-size:.78rem !important; opacity:.8; }
  .atools{ font-size:.7rem; color:var(--muted); margin-top:4px; padding:0 4px; }
  /* "Working on: <event>" hint — the event the assistant acts on by default; follows the open detail */
  .aifocus{ display:flex; align-items:center; gap:6px; max-width:640px; width:100%; margin:0 auto; padding:6px 18px 0; font-size:.76rem; color:var(--muted); }
  .aifocus .aifi{ display:inline-flex; } .aifocus .aifi svg{ width:12px; height:12px; }
  .aifocus b{ color:var(--text); font-weight:600; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; min-width:0; }
  /* assistant safety gate: a bulk/destructive op awaits the user's OK */
  .aconfirm{ margin-top:6px; padding:11px 13px; border-radius:14px; border:1px solid var(--danger);
             background:color-mix(in srgb, var(--danger) 12%, var(--surface)); }
  .aconfirm .acwarn{ font-size:.9rem; line-height:1.4; margin-bottom:10px; }
  .aconfirm .acwarn b{ font-weight:600; }
  .aconfirm .acdetails{ margin:-2px 0 10px; }
  .aconfirm .acshow{ background:none; border:0; padding:0; color:var(--muted); font-size:.82rem; cursor:pointer; }
  .aconfirm .acshow:hover{ color:var(--text); }
  .aconfirm .acplan{ list-style:none; margin:8px 0 0; padding:8px 0 0; border-top:1px solid var(--line);
    max-height:180px; overflow-y:auto; font-size:.85rem; }
  .aconfirm .acplan li{ display:flex; gap:8px; align-items:baseline; padding:2px 0; }
  .aconfirm .acplan .act{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .aconfirm .acplan .acm{ flex:0 0 auto; color:var(--muted); font-variant-numeric:tabular-nums; }
  .aconfirm .acbtns{ display:flex; gap:8px; }
  .aconfirm .acapply{ flex:1; height:38px; background:var(--danger); }
  .aconfirm .accancel{ flex:0 0 auto; height:38px; width:auto; padding:0 16px; border:1px solid var(--line); }
  /* assist panel: sized to the VISUAL viewport so the input stays above the keyboard; only messages scroll */
  .cover.assist-cover{ overflow:hidden; top:0; bottom:auto; height:100vh; height:var(--vvh, 100dvh); z-index:23; }   /* ABOVE the detail cover (z20) in EVERY state — not just when maximized. On narrow/mobile both covers are full-screen at z20 and the later-in-DOM detail cover buried a DOCKED assistant, making it unclickable (bug 2026-08-18). */
  .cover.assist-cover.aimax{ z-index:24; }   /* maximized from the dock: above the docked assistant too */
  .adock{ flex:0 0 auto; width:100%; box-sizing:border-box; border-top:1px solid var(--line); padding:12px 18px calc(12px + env(safe-area-inset-bottom)); display:flex; gap:8px; }   /* full-width so the input can't outgrow the screen at large font sizes */
  .adock .inner{ max-width:640px; width:100%; margin:0 auto; display:flex; gap:8px; flex:1; }

  /* now-line + elapsed dimming */
  .nowline{ display:flex; align-items:center; gap:7px; margin:8px 11px; color:var(--text); font-size:.7rem; font-weight:700; letter-spacing:.04em; }
  .nowline::before{ content:''; width:7px; height:7px; border-radius:50%; background:var(--text); flex:0 0 auto; }
  .nowline .ln{ flex:1; height:0; border-top:2px solid var(--text); opacity:.35; }
  .nowline .nx{ color:var(--muted); font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:50%; }
  /* proximity warming: calm when far, amber <15m, red+pulse <5m */
  .nowline.far{ opacity:.65; }
  .nowline.soon{ color:var(--weekend); }
  .nowline.soon::before{ background:var(--weekend); }
  .nowline.soon .nx{ color:var(--weekend); }
  .nowline.imminent{ color:var(--danger); }
  .nowline.imminent .nx{ color:var(--danger); }
  .nowline.imminent .ln{ border-top-color:var(--danger); opacity:.5; }
  .nowline.imminent::before{ background:var(--danger); animation:nowpulse 1.4s ease-in-out infinite; }
  @keyframes nowpulse{ 0%{ box-shadow:0 0 0 0 var(--danger); } 70%{ box-shadow:0 0 0 6px transparent; } 100%{ box-shadow:0 0 0 0 transparent; } }
  /* event alert icon + issue popover */
  .alert{ border:none; background:none; color:var(--weekend); cursor:pointer; font-size:.98rem; padding:0 2px; flex:0 0 auto; line-height:1.3; }
  .alert:hover{ filter:brightness(1.25); }
  .updatebar{ position:fixed; top:0; left:0; right:0; z-index:60; background:var(--accent); color:#fff; text-align:center;
              padding:8px 14px; font-size:.85rem; cursor:pointer; box-shadow:0 2px 12px #0004; }
  .updatebar b{ text-decoration:underline; }
  .modal{ position:fixed; inset:0; z-index:25; background:#0008; display:flex; padding:18px; }
  .issuebox{ max-width:400px; width:100%; margin:auto; background:var(--surface); border:1px solid var(--line); border-radius:16px; padding:22px; box-shadow:0 16px 48px #0006; }
  .issuebox h3{ margin:0 0 10px; font-size:1.05rem; }
  .issuebox p{ color:var(--text); line-height:1.5; margin:0 0 16px; }
  /* suggested reflow preview */
  .reflowbox{ max-width:480px; }
  .reflowbox p.dim{ color:var(--muted); font-size:.84rem; }
  .rfplan{ max-height:46vh; overflow-y:auto; margin:6px 0 16px; border:1px solid var(--line); border-radius:11px; padding:6px; }
  .rfrow{ display:flex; align-items:center; gap:10px; padding:7px 8px; border-radius:8px; font-size:.88rem; }
  .rfrow .rft{ flex:0 0 auto; font-variant-numeric:tabular-nums; color:var(--soft); font-weight:600; min-width:3.1rem; }
  .rfrow .rfbar{ flex:0 0 3px; align-self:stretch; border-radius:3px; background:var(--soft); }
  .rfrow.fixed .rft{ color:var(--hard); } .rfrow.fixed .rfbar{ background:var(--hard); }
  .rfrow .rfd{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .rfrow.fixed .rfd{ font-weight:600; }
  .rfrow .rfe{ flex:0 0 auto; color:var(--muted); font-size:.74rem; font-variant-numeric:tabular-nums; }
  /* Auto-schedule controls + toggleable candidate rows */
  .asctl{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; margin:2px 0 10px; }
  .asctl .aswin{ display:inline-flex; align-items:center; gap:6px; font-size:.82rem; color:var(--muted); }
  .asctl .aswin input[type=time]{ font-size:.82rem; padding:4px 6px; border:1px solid var(--line); border-radius:8px; background:var(--surface); color:var(--text); }
  .rfrow.asrow{ cursor:pointer; margin:0; }
  .rfrow.asrow input[type=checkbox]{ flex:0 0 auto; width:16px; height:16px; accent-color:var(--accent); }
  .rfrow.asrow.off{ opacity:.5; }
  .rfrow.asrow.off .rft{ color:var(--muted); font-weight:400; }
  /* phone: the box becomes a column that fits the screen — the task list scrolls, Apply/Close stay reachable */
  @media (max-width:640px){
    .modal:has(.reflowbox){ padding:10px; }
    .reflowbox{ max-width:none; height:100%; max-height:100%; box-sizing:border-box; display:flex; flex-direction:column; padding:16px; }
    .reflowbox .rfplan{ flex:1 1 auto; min-height:0; max-height:none; }
    .reflowbox .rfrow .rfe{ display:none; }          /* drop the end-time column — give the title the room */
    .reflowbox .rfrow .rfd{ white-space:normal; }    /* titles wrap instead of truncating */
  }
  .rfrow.asrow.ai .rft{ color:var(--accent); }   /* times the AI chose */
  .asaibtn{ display:flex; align-items:center; justify-content:center; gap:8px; width:100%; height:40px; margin:2px 0 10px;
    border:1px solid var(--accent); border-radius:11px; background:color-mix(in srgb, var(--accent) 10%, var(--surface)); color:var(--accent); font-size:.9rem; font-weight:600; cursor:pointer; }
  .asaibtn:disabled{ opacity:.55; cursor:default; }
  .asaibtn.arranged{ background:var(--accent); color:#fff; }
  .asaibtn .aii svg{ width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; }
  /* plan today (backlog picker) */
  /* two-part ritual signpost: 1 From earlier › 2 Pull from backlog */
  .plansteps{ display:flex; align-items:center; gap:10px; margin:0 0 16px; flex-wrap:wrap; }
  .pstep{ display:flex; align-items:center; gap:7px; font-size:.9rem; color:var(--muted); }
  .pstep.on{ color:var(--text); font-weight:600; }
  .pstep .pnum{ display:inline-flex; align-items:center; justify-content:center; width:22px; height:22px; border-radius:50%; border:1px solid var(--line); font-size:.78rem; flex:0 0 auto; }
  .pstep.on .pnum{ background:var(--accent); color:#fff; border-color:var(--accent); }
  .pstep.done .pnum{ background:color-mix(in srgb,var(--accent) 20%,transparent); color:var(--accent); border-color:transparent; }
  .plansteps .psep{ color:var(--muted); display:inline-flex; }
  .plansteps .psep svg{ width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:2; }
  .planexcl{ color:var(--muted); font-size:.78rem; opacity:.8; }
  .planlist{ max-height:58vh; overflow-y:auto; }
  /* the plan's Continue/Commit button sticks to the bottom of the scrolling cover so it's never pushed below the
     fold — critical on mobile, where the list is tall and the button was getting obscured (bug list #5/#6). */
  .plango{ position:sticky; bottom:0; z-index:1; }
  @media (max-width:640px){
    .planlist{ max-height:none; }                              /* one scroll (the cover), not a nested one that trapped the button */
    .cal{ padding-bottom:calc(14px + env(safe-area-inset-bottom)); }
    .plango{ box-shadow:0 -10px 18px -10px var(--atmo); }      /* subtle lift so list rows scrolling under it read cleanly */
  }
  /* #66 "From earlier" triage table */
  .trbulk{ display:flex; align-items:center; gap:6px; margin-bottom:8px; }
  .trbulk .trbl{ color:var(--muted); font-size:.74rem; margin-right:2px; }
  .trbulk button{ border:1px solid var(--line); background:var(--surface); color:var(--muted); border-radius:7px; padding:4px 10px; font-size:.75rem; cursor:pointer; }
  .trbulk button:hover{ color:var(--text); border-color:var(--accent); }
  .triage{ max-height:54vh; overflow-y:auto; }
  .trrow{ display:flex; align-items:center; gap:10px; padding:9px 6px; border-bottom:1px solid var(--line); }
  .trrow.done .trt{ color:var(--done); }
  .trrow.backlog{ opacity:.66; }
  .trc-t{ flex:1; min-width:0; display:flex; flex-direction:column; gap:1px; }
  .trc-t .trt{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .trc-t .trmeta{ color:var(--muted); font-size:.72rem; }
  .trc-t .trmeta .trcasc{ color:var(--done); }
  .trc-time{ display:inline-flex; align-items:center; gap:6px; flex:0 0 auto; }
  .trc-time button{ width:24px; height:24px; border:1.5px solid var(--line); background:var(--surface); color:var(--muted); border-radius:50%; font-size:.95rem; line-height:1; cursor:pointer; padding:0; }
  .trc-time button:hover{ border-color:var(--accent); color:var(--accent); }
  .trc-time b{ min-width:2.6rem; text-align:center; font-variant-numeric:tabular-nums; color:var(--accent); font-size:.78rem; }
  .trseg{ display:inline-flex; flex:0 0 auto; border:1px solid var(--line); border-radius:8px; overflow:hidden; }
  .trseg button{ border:none; background:var(--surface); color:var(--muted); padding:5px 10px; font-size:.74rem; cursor:pointer; border-left:1px solid var(--line); }
  .trseg button:first-child{ border-left:none; }
  .trseg button.on{ background:var(--accent); color:#fff; }
  @media (max-width:640px){ .trrow{ flex-wrap:wrap; } .trc-t{ flex:1 1 100%; } }
  .plangrp{ margin-bottom:10px; }
  .plangl{ font-size:.72rem; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin:10px 2px 5px; }
  /* stack like the day view (.row:has(.rowtop)): title line on top, tags on their own line below so a long
     title is never squeezed by inline chips on a narrow (mobile) width — owner 2026-08-16. */
  .planrow{ display:flex; flex-direction:column; align-items:stretch; gap:3px; padding:9px 10px; border-radius:9px; border:1px solid transparent; cursor:pointer; }
  .plantop{ display:flex; align-items:center; gap:9px; }
  .planmeta{ margin-left:calc(18px + 9px); display:flex; flex-wrap:wrap; align-items:center; gap:6px; }   /* indent under the title, past the checkbox+gap */
  .planrow:hover{ background:var(--surface2); }
  .planrow.picked{ background:color-mix(in srgb, var(--accent) 12%, var(--surface)); border-color:color-mix(in srgb, var(--accent) 45%, transparent); }
  .planrow.cursor{ border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-weak); }   /* keyboard-highlighted row */
  .planrow .pck{ flex:0 0 18px; width:18px; height:18px; border:1.5px solid var(--line); border-radius:6px; display:inline-flex; align-items:center; justify-content:center; }
  .planrow.picked .pck{ background:var(--accent); border-color:var(--accent); }
  .planrow .pck svg{ width:13px; height:13px; fill:none; stroke:#fff; stroke-width:3; }
  .planrow .pt{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:1rem; line-height:1.4; }   /* match the day view's .txt (was .9rem) */
  .planrow .tag{ flex:0 0 auto; padding:1px 7px; border-radius:999px; font-size:.7rem; font-weight:600; color:var(--accent); background:var(--accent-weak); }
  .planrow .exp{ flex:0 0 auto; border:none; background:none; color:var(--muted); cursor:pointer; }
  .planrow .exp svg{ width:.95rem; height:.95rem; fill:none; stroke:currentColor; stroke-width:2; }
  /* prune junk right from the picker: quiet trash, revealed on hover / keyboard-cursor / touch */
  .planrow .pdel{ flex:0 0 auto; border:none; background:none; color:var(--muted); cursor:pointer; opacity:0; padding:2px; }
  .planrow:hover .pdel, .planrow.cursor .pdel{ opacity:.65; }
  .planrow .pdel:hover{ opacity:1; color:var(--danger,#e5484d); }
  .planrow .pdel svg{ width:.95rem; height:.95rem; fill:none; stroke:currentColor; stroke-width:2; }
  @media (hover:none){ .planrow .pdel{ opacity:.5; } }
  .planrow.sub{ margin-left:20px; }
  .planempty{ color:var(--muted); font-size:.84rem; padding:8px 10px; }
  /* time picker */
  .timebox{ max-width:320px; width:100%; margin:auto; background:var(--surface); border:1px solid var(--line); border-radius:14px; padding:20px; box-shadow:0 16px 48px #0006; }
  .timebox h3{ margin:0; font-size:.7rem; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); font-weight:600; }
  .tsteppers{ display:flex; align-items:center; justify-content:center; gap:5px; margin:14px 0 16px; }
  .tcol{ display:flex; flex-direction:column; align-items:center; gap:5px; }
  .tcol button{ border:1px solid var(--line); background:var(--surface); color:var(--muted); width:52px; height:24px; border-radius:7px; cursor:pointer; font-size:.62rem; line-height:1; padding:0; }
  .trow{ display:flex; gap:3px; justify-content:center; }
  .tcol .trow button{ width:25px; height:22px; }                      /* two arrows per row -> each ~half width */
  .tcol .trow button[title]{ font-size:.72rem; color:var(--text); }   /* the coarse ⏫/⏬ — bolder so the double jump reads */
  .tcol button:hover{ color:var(--accent); border-color:var(--accent); }
  .tcol .tval{ font-size:1.7rem; font-weight:700; font-variant-numeric:tabular-nums; min-width:52px; text-align:center; }
  .tcol.ap .tval{ font-size:1.1rem; }
  .tsep{ font-size:1.7rem; font-weight:700; padding-bottom:2px; }
  .tinput{ width:100%; box-sizing:border-box; border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:9px; padding:9px 12px; font-size:.9rem; outline:none; margin-bottom:16px; text-align:center; color-scheme:dark light; }
  .tinput::placeholder{ color:var(--muted); }
  .tinput:focus{ border-color:var(--accent); }
  .teflex{ width:100%; margin:0 0 10px; }
  .teflex button{ flex:1; }
  .tbtns{ display:flex; align-items:center; gap:8px; }
  .tbtns .ic, .tbtns .go{ height:38px; }
  .tremove{ border:1px solid var(--line); background:none; color:var(--danger); width:auto; padding:0 12px; height:38px; border-radius:9px; cursor:pointer; font-size:.8rem; white-space:nowrap; }
  .tremove:hover{ background:color-mix(in srgb, var(--danger) 14%, transparent); }
  /* inline time editor in the detail rail (no modal chrome — reuses the stepper/input/button styles above) */
  .timeinline{ width:100%; }
  .timeinline .tsteppers{ justify-content:flex-start; margin:0 0 12px; }
  .timeinline .tinput{ margin-bottom:12px; }
  .timeinline .tbtns{ gap:6px; }
  /* inline DATE picker in the detail Schedule row */
  .prow .pdate{ cursor:pointer; border-radius:7px; padding:2px 7px; margin:-2px -7px; }
  .prow .pdate:hover{ background:var(--surface); }
  .dateinline{ width:100%; }
  .datechips{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:10px; }
  .dchipbtn{ border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:8px; padding:5px 12px; font-size:.8rem; cursor:pointer; }
  .dchipbtn:hover{ border-color:var(--accent); }
  .dchipbtn.on{ border-color:var(--accent); color:var(--accent); }
  .dchipbtn.dim{ color:var(--muted); }
  .dinput{ width:100%; box-sizing:border-box; border:1px solid var(--line); background:var(--surface); color:var(--text); border-radius:9px; padding:9px 12px; font-size:.9rem; outline:none; margin-bottom:10px; color-scheme:dark light; }
  .dinput:focus{ border-color:var(--accent); }
  /* inline capture time-prompt (a meeting/appt with no time) — compact steppers in the dock banner */
  .captime{ flex-wrap:wrap; }
  .captime .rp-t{ flex:0 1 auto; }
  .captime .tsteppers{ margin:0; gap:4px; }
  .captime .tcol{ gap:2px; }
  .captime .tcol button{ width:38px; height:15px; font-size:.5rem; border-radius:5px; }
  .captime .trow{ gap:2px; }
  .captime .tcol .trow button{ width:18px; height:14px; }
  .captime .tcol .trow button[title]{ font-size:.55rem; }
  .captime .tcol .tval{ font-size:1.05rem; min-width:38px; }
  .captime .tcol.ap .tval{ font-size:.78rem; }
  .captime .tsep{ font-size:1.05rem; padding:0; }
  .captime .captinput{ width:auto; max-width:108px; margin:0; padding:5px 9px; font-size:.8rem; text-align:left; }
  .captime .rp-skip{ border:1px solid var(--line); background:none; color:var(--muted); border-radius:8px; padding:6px 12px; font-size:.8rem; cursor:pointer; }
  .captime .rp-skip:hover{ color:var(--text); }
  .row.past{ opacity:.5; }
  .row.current{ box-shadow:inset 3px 0 0 var(--accent); background:color-mix(in srgb, var(--accent) 7%, transparent); }   /* happening now */
  .livebar{ display:flex; align-items:center; gap:9px; margin:0 2px 8px; padding:9px 13px; background:var(--surface); border:1px solid var(--line); border-radius:11px; }
  .livebar input{ flex:1; border:none; background:none; color:var(--text); outline:none; font-size:.96rem; }
  .livebar .x{ border:none; background:none; color:var(--muted); cursor:pointer; font-size:.9rem; }

  /* on-demand vertical day timeline */
  .timeline{ position:fixed; right:0; top:0; width:200px; height:100vh; height:var(--vvh,100dvh); background:var(--surface); border-left:1px solid var(--line); z-index:15; display:flex; flex-direction:column; box-shadow:-8px 0 24px #0003; padding-bottom:env(safe-area-inset-bottom); }
  .tlhead{ padding:14px 12px 12px; font-size:.78rem; color:var(--muted); border-bottom:1px solid var(--line); }
  .tlhead .tlselhint{ color:var(--accent); cursor:pointer; margin-left:8px; font-size:.74rem; }
  .tlhead .tlselhint b{ font-weight:700; }
  /* the body has an explicit (zoomed) height so 06:00–22:00 spreads out; the scroller lets you pan the day */
  .tlscroll{ flex:1; overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain; }
  .tlbody{ position:relative; margin:12px 0; height:var(--tl-h, 760px); min-height:100%; }   /* fills a tall desktop rail; mobile --tl-h zooms past it */
  .tltick{ position:absolute; left:0; right:0; border-top:1px dashed var(--line); }
  .tltick span{ position:absolute; left:6px; top:-7px; font-size:.6rem; color:var(--muted); background:var(--surface); padding:0 3px; }
  .tlblock{ position:absolute; left:46px; right:9px; background:var(--hard-bg); border-left:3px solid var(--hard); border-radius:5px; min-height:5px;
            cursor:grab; touch-action:pan-y; }   /* a touch-swipe scrolls the zoomed timeline; long-press lifts to retime (see app.js) */
  .tlblock.soft{ background:var(--soft-bg); border-left-color:var(--soft); }
  /* done = clearly finished + not draggable: muted, gray border, hatched, a ✓ badge, not-allowed cursor */
  .tlblock.done{ opacity:.7; cursor:not-allowed; border-left-color:var(--done);
                 background:repeating-linear-gradient(45deg, var(--surface2), var(--surface2) 5px, transparent 5px, transparent 10px); }
  .tlblock.done .tllabel{ text-decoration:line-through; color:var(--done); }
  /* context indicator (doc 33): a thin colour strip on the right edge, shown in the "All" lens. pointer-events
     off so it never steals the resize-grip drag underneath; inset top/bottom to clear the ✓ badge + grip. */
  .tlblock .tlctx{ position:absolute; top:2px; bottom:12px; right:2px; width:3px; border-radius:2px;
                   background:var(--ctx,var(--muted)); pointer-events:none; }
  .tlblock .tlcheck{ position:absolute; top:1px; right:3px; display:inline-flex; color:var(--done); }
  .tlblock .tlcheck svg{ width:.78rem; height:.78rem; fill:none; stroke:currentColor; stroke-width:3; }
  .tlblock.hov{ box-shadow:0 0 0 1px var(--accent); background:color-mix(in srgb, var(--accent) 18%, var(--hard-bg)); }
  .tlblock.drag{ cursor:grabbing; z-index:6; box-shadow:0 4px 14px #0005, 0 0 0 1px var(--accent); opacity:1; transition:none; }
  .tlblock .tldt{ position:absolute; left:50%; top:-9px; transform:translateX(-50%); background:var(--accent); color:#fff;
                  font-size:.62rem; font-variant-numeric:tabular-nums; padding:1px 5px; border-radius:7px; white-space:nowrap; z-index:7; }
  .tlblock .tldur{ position:absolute; right:-4px; bottom:-9px; background:var(--accent); color:#fff;   /* live duration while resizing */
                   font-size:.62rem; font-variant-numeric:tabular-nums; padding:1px 5px; border-radius:7px; white-space:nowrap; z-index:8; }
  .tlblock .tlresize{ position:absolute; left:0; right:0; bottom:0; height:11px; display:flex; align-items:center; justify-content:center;
                      cursor:ns-resize; color:#fff; opacity:0; font-size:.74rem; line-height:1; touch-action:none; border-radius:0 0 5px 5px; }
  .tlblock:hover .tlresize, .tlblock.sel .tlresize, .tlblock.current .tlresize{ opacity:.6; }   /* show the grip on focus */
  .tlblock .tlresize:hover{ opacity:1; background:rgba(255,255,255,.16); }
  @media (hover:none){ .tlblock .tlresize{ opacity:.5; } }   /* touch: always grabbable */
  .tlblock .tllabel{ display:block; font-size:.66rem; line-height:1.3; padding:1px 7px; color:var(--text);
                     white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }   /* wider desktop rail now fits a one-line title (tooltip still has the full text) */
  .tlblock.current{ box-shadow:0 0 0 2px var(--accent); }   /* happening now → live, not faded */
  .tlblock.sel{ box-shadow:0 0 0 2px var(--accent); background:color-mix(in srgb, var(--accent) 22%, var(--hard-bg)); }   /* in the multi-selection */
  .tlblock.sel.soft{ background:color-mix(in srgb, var(--accent) 22%, var(--soft-bg)); }
  .tlnow{ position:absolute; left:0; right:0; border-top:2px solid var(--accent); z-index:5; }   /* above blocks so it reads as crossing the current event */
  .tlnow::before{ content:''; position:absolute; left:2px; top:-4px; width:7px; height:7px; border-radius:50%; background:var(--accent); }
  @media (max-width:640px){
    .timeline{ width:100%; --tl-h:1680px; }   /* zoom in: ~105px/hour, taller than the screen → scrollable */
    .tlblock{ left:64px; right:20px; }
    .tltick span{ font-size:.7rem; }
    .tlblock .tllabel{ display:block; font-size:.72rem; line-height:1.3; padding:4px 10px; color:var(--text);
                       white-space:normal; overflow:hidden; }   /* full-width + room → show the event, can wrap */
  }

  /* doc 42 P0: email-verification nudge (top strip) */
  /* z-index sits BELOW the full-screen covers (.cover=20, .modal=25): an open detail/search/tag overlay must
     render on top of this nag, or the fixed banner intercepts clicks on the overlay's header (title, ⚙, etc.).
     Still above main-view content (header=6, rows≤9, timeline=15) so it shows normally on the day view. */
  .verify-bar{ position:fixed; top:0; left:0; right:0; z-index:19; display:flex; align-items:center; justify-content:center; gap:12px;
    background:color-mix(in srgb,var(--accent) 14%,var(--surface)); color:var(--text); border-bottom:1px solid var(--accent);
    padding:7px 14px; font-size:.82rem; }
  .verify-bar .lnk{ border:none; background:none; color:var(--accent); cursor:pointer; text-decoration:underline; font:inherit; }

  /* doc 42 P0b: password reset */
  .authforgot{ margin:6px 0 0; font-size:.82rem; text-align:center; }
  .authforgot span{ color:var(--accent); cursor:pointer; text-decoration:underline; }
  .resetcard{ width:100%; max-width:var(--cw,420px); margin:0 auto; padding:26px 22px; display:flex; flex-direction:column; gap:12px; box-sizing:border-box; }
  .resetcard h2{ margin:0 0 4px; font-size:1.15rem; }
  .resetcard input{ width:100%; box-sizing:border-box; padding:11px 13px; border:1.5px solid var(--line); border-radius:12px; background:var(--surface); color:var(--text); font-size:1rem; outline:none; }
  .resetcard input:focus{ border-color:var(--accent); }

/* ---- the merge gate (bug 019FDD3E): Meld-style review of staged assistant note rewrites ----
   Full real-estate: the cover fills the viewport; hunks render as ALIGNED rows (old | gutter | new),
   so no scroll-sync is needed. Colors follow Meld's pastels; word-level emphasis follows Delta. */
.revbanner{ display:flex; align-items:center; gap:10px; padding:10px 14px; margin:0 0 10px;
  border:1.5px solid var(--accent); border-radius:11px; background:color-mix(in srgb, var(--accent) 10%, var(--surface));
  cursor:pointer; font-size:.9rem; }
.revbanner .aii{ display:inline-flex; color:var(--accent); }
.revbanner .revbtn{ margin-left:auto; height:30px; padding:0 14px; }
.revbanner .revx{ width:28px; }
.acblast{ margin:8px 0 2px; padding-left:20px; font-size:.86rem; }
.acblast li{ margin:2px 0; }
.merge-cover{ z-index:60; }
/* the review is a full-bleed surface: it must never share the viewport with a side rail (2026-08-08) */
.merge-cover .mergewrap{ margin:auto; }
.wrap.hascal .merge-cover, .wrap.aiside .merge-cover{ left:0; right:0; }
.mergewrap{ width:min(1500px, 96vw); height:92vh; display:flex; flex-direction:column;
  background:var(--surface); border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.mergehead{ display:flex; align-items:center; gap:12px; padding:12px 16px; border-bottom:1px solid var(--line); flex:0 0 auto; }
.mergehead .aii{ display:inline-flex; color:var(--accent); }
.mergehead .mtitle{ display:flex; flex-direction:column; min-width:0; }
.mergehead .mtitle .dim{ font-size:.8rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:40vw; }
.mergehead .mcount{ font-size:.82rem; color:var(--muted); font-variant-numeric:tabular-nums; }
.mergehead .mapply{ height:34px; padding:0 18px; }
.mergehead .mdiscard{ width:auto; padding:0 12px; border:1px solid var(--line); }
.mergelegend{ display:flex; gap:14px; align-items:center; padding:6px 16px; font-size:.78rem; border-bottom:1px solid var(--line); flex:0 0 auto; }
.mergelegend .lg{ padding:1px 8px; border-radius:6px; }
.mergelegend .lg.old{ background:color-mix(in srgb, #e05252 14%, var(--surface)); }
.mergelegend .lg.new{ background:color-mix(in srgb, #3fae5a 14%, var(--surface)); }
.mergebody{ flex:1; overflow:auto; padding:10px 16px 24px; font:.86rem/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; }
.mergebody.editing{ display:flex; padding:12px 16px; }
.mergedraft{ flex:1; resize:none; border:1.5px solid var(--accent); border-radius:11px; background:var(--surface);
  color:var(--text); font:.88rem/1.5 ui-monospace,SFMono-Regular,Menlo,monospace; padding:14px; outline:none; }
.mhunk.same .mctx{ margin:0; padding:1px 10px; color:var(--muted); white-space:pre-wrap; word-break:break-word; }
.mfold{ display:block; width:100%; text-align:left; border:none; background:color-mix(in srgb, var(--accent) 6%, var(--surface));
  color:var(--muted); font:inherit; font-size:.78rem; padding:3px 10px; margin:2px 0; border-radius:7px; cursor:pointer; }
.mhunk.change{ margin:8px 0; border:1px solid var(--line); border-radius:10px; overflow:hidden; }
.mhdr{ padding:2px 10px; font-size:.72rem; color:var(--muted); background:color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.mpair{ display:grid; grid-template-columns:1fr 44px 1fr; }
.mold, .mnew{ padding:7px 12px; white-space:pre-wrap; word-break:break-word; min-width:0; }
.mold{ background:color-mix(in srgb, #e05252 8%, var(--surface)); }
.mnew{ background:color-mix(in srgb, #3fae5a 8%, var(--surface)); }
.wdel{ background:color-mix(in srgb, #e05252 34%, var(--surface)); border-radius:3px; text-decoration:line-through; text-decoration-color:color-mix(in srgb, #e05252 70%, var(--surface)); }
.wadd{ background:color-mix(in srgb, #3fae5a 32%, var(--surface)); border-radius:3px; }
.mempty{ color:var(--muted); font-style:italic; }
.mgut{ display:flex; align-items:center; justify-content:center; background:var(--surface); border-left:1px solid var(--line); border-right:1px solid var(--line); }
.mtake{ width:30px; height:30px; border-radius:50%; border:1.5px solid var(--line); background:var(--surface);
  color:var(--muted); font-size:.95rem; cursor:pointer; }
.mtake.on{ border-color:#3fae5a; color:#3fae5a; background:color-mix(in srgb, #3fae5a 12%, var(--surface)); }
.mhunk.change.rejected .mnew{ opacity:.38; }
.mhunk.change.rejected .mold{ background:color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.mhunk.change.rejected .mtake{ border-color:#e05252; color:#e05252; background:color-mix(in srgb, #e05252 10%, var(--surface)); }
@media (max-width:760px){
  .mergewrap{ width:100vw; height:100vh; border-radius:0; border:none; }
  .mergehead{ flex-wrap:wrap; gap:8px; }
  .mergehead .mtitle .dim{ max-width:80vw; }
  .mpair{ grid-template-columns:1fr; }             /* unified: old above new, Delta-style */
  .mgut{ flex-direction:row; justify-content:flex-end; padding:4px 10px; border:none; border-top:1px dashed var(--line); order:3; }
  .mold{ order:1; } .mnew{ order:2; }
}
