/* Paper: the signed-in app as one white sheet on a soft mint-grey tint. Loaded last on every app page.
   Black is the only accent (the open item, the All filter, today, the present time, the main buttons); colour comes
   from the calendars alone, as pastel cards. A labelled sidebar sits on the tint at the left; everything to its right
   is one rounded white surface (the top bar, the banners and the page). No blur, no glow, no fixed sky.
   The --g-* names are kept: calm.css and the other sheets read them. */
:root {
  --g-base: #E7EAEB;                                          /* behind everything */
  --g-sky: linear-gradient(165deg, #D7E6E4 0%, #E6EBEC 42%, #F2F3F3 100%);   /* the tint behind the sidebar */
  --g-glass: #FFFFFF; --g-strong: #FFFFFF; --g-solid: #FFFFFF; --g-ev: #FFFFFF;
  --g-rim: #ECEEEF; --g-hair: #EEF0F1; --g-soft: rgba(10,10,11,.04);
  --g-shadow: 0 12px 32px rgba(10,10,11,.08); --g-blur: none; --g-on: #FFFFFF;
  /* local to this sheet */
  --g-edge: #DDE1E3;                                          /* the hairline of a control (a button, an input) */
  --g-pill: #F1F2F3; --g-pill-hover: #E8EAEB;                 /* the filter pills and the view switch */
  --g-cap: #5C6166;                                           /* captions on the tint (4.8:1 on its darkest corner) */
  --g-side-hover: rgba(255,255,255,.55); --g-side-on: #FFFFFF;
  --g-panel: #F4F5F6; --g-panel-on: #ECEEEF; --g-card: #FFFFFF; /* Tasks: grey columns, white cards */
  --st-bg: #FFFFFF; --st-ink: #0A0A0B;                        /* the status pill on a card */
  --ev-fill: 22%; --ev-hover: 30%; --ev-past: 10%;
  --ev-title: #0A0A0B; --ev-time: #4A4F54; --ev-past-title: #5C6166; --ev-past-time: #63686D;
  /* the shared tokens style.css and dark.css read. --faint is darker than the brief's #8A8F94 (3.3:1 on white)
     so grey text keeps 4.5:1 */
  --ink: #0A0A0B; --ink-soft: #2A2C2F; --body: #3F4347; --faint: #6E7378; --slate: #6E7378; --quiet: #6E7378;
  --page: #FFFFFF; --panel: #F4F5F6; --panel-rule: #ECEEEF; --shade: #F4F5F6; --input: #DDE1E3;
  --line: #EEF0F1; --rule: #EEF0F1; --hover-soft: #F7F8F8; --hover-btn: #ECEEEF; --status-bg: #F4F5F6;
  --now: #0A0A0B; --night: #111214; --on-ink: #FFFFFF;
}
:root[data-theme="dark"] {
  --g-base: #0C0D0E;
  --g-sky: linear-gradient(165deg, #141A19 0%, #101213 45%, #0C0D0E 100%);
  --g-glass: #151719; --g-strong: #151719; --g-solid: #151719; --g-ev: #151719;
  --g-rim: rgba(255,255,255,.08); --g-hair: rgba(255,255,255,.08); --g-soft: rgba(255,255,255,.05);
  --g-shadow: 0 12px 32px rgba(0,0,0,.45); --g-blur: none; --g-on: #0A0A0B;
  --g-edge: rgba(255,255,255,.14);
  --g-pill: rgba(255,255,255,.06); --g-pill-hover: rgba(255,255,255,.10);
  --g-cap: #8B9096;
  --g-side-hover: rgba(255,255,255,.05); --g-side-on: #24272A;
  --g-panel: #1C1F22; --g-panel-on: #222528; --g-card: #26292C;
  --st-bg: #1C1F22; --st-ink: #F3F4F5;
  --ev-fill: 30%; --ev-hover: 38%; --ev-past: 14%;
  --ev-title: #F3F4F5; --ev-time: #BEC3C8; --ev-past-title: #A3A8AD; --ev-past-time: #8B9096;
  --ink: #F3F4F5; --ink-soft: #D9DCDF; --body: #C5C9CD; --faint: #8B9096; --slate: #8B9096; --quiet: #8B9096;
  --page: #151719; --panel: #1C1F22; --panel-rule: rgba(255,255,255,.08); --shade: rgba(255,255,255,.05); --input: rgba(255,255,255,.14);
  --line: rgba(255,255,255,.08); --rule: rgba(255,255,255,.08); --hover-soft: rgba(255,255,255,.04); --hover-btn: rgba(255,255,255,.10);
  --status-bg: #1C1F22; --now: #F3F4F5; --night: #1E2124; --on-ink: #0A0A0B;
}

/* ------------------------------------------------------------------ the page: the tint, not fixed */
html { background: var(--g-base); }
:root body, :root[data-theme] body { background: var(--g-sky); background-color: var(--g-base); }
/* the signed-out pages are plain documents: let them grow and scroll (the app pages keep their fixed height) */
html:has(> body.ld), body.ld { height: auto; min-height: 100%; }
:root[data-theme="dark"] .appic rect:first-child { fill: #151719; stroke: rgba(255,255,255,.14); }

/* ------------------------------------------------------------------ wide screens: a sidebar and one white sheet */
@media (min-width: 1024px) {
  :root { --rail: 280px; }
  /* the body is a column: the top bar, the banners and the page, framed 12 px from the window on three sides.
     Only the page scrolls, so the sheet keeps its corners. */
  body[data-page] { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; padding-block: 12px; padding-inline: var(--rail) 12px; }
  body[data-page] > .tbar, body[data-page] > .banner { flex: none; }
  body[data-page] > main { flex: 1 1 auto; min-height: 0; overflow: auto; background: var(--g-strong); border-radius: 0 0 24px 24px; scrollbar-width: thin; scrollbar-color: var(--g-edge) transparent; }
  body[data-page] > main.main-calendar { height: auto; overflow: hidden; display: flex; flex-direction: column; }
  .main-calendar > .cal-shell { flex: 1 1 auto; min-height: 0; height: auto; padding: 0; gap: 0; }

  /* the sidebar: on the tint, no edge */
  .rail { width: var(--rail); background: transparent; border: 0; box-shadow: none; padding-block: 24px 20px; padding-inline: 24px 20px; align-items: stretch; }
  .rail-brand { align-self: flex-start; }
  .rail-brand svg.appic { width: 38px; height: 38px; }
  .rail-nav { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 32px 0 0; align-items: stretch; gap: 2px; scrollbar-width: none; }
  .rail-nav::-webkit-scrollbar { display: none; }
  /* the head: the mark and the name, the week list's button at the end of their row; the language switch on a row
     of its own under them, on every page (beside the name and the button it has no room, and nothing moves between
     pages). The foot's box steps aside so its two parts can sit apart (display: contents keeps them in its markup). */
  .rail-foot { display: contents; }
  #colBtn { position: absolute; top: 23px; inset-inline-end: 20px; }
  .rail .rail-foot .lang-sw { order: 1; align-self: flex-start; flex-direction: row; margin-top: 16px; border-radius: 999px; }
  .rail .rail-foot .lang-sw button { padding-inline: 10px; border-radius: 999px; font-size: 12px; }
  .rail-nav { order: 2; }
  .rail-acct { order: 3; }
  .rail .rb-set, .rail .rail-sep { display: none; }
  .rail .rb { width: auto; height: 44px; flex: none; justify-content: flex-start; gap: 12px; padding: 0 14px; border-radius: 999px;
    color: var(--ink); font-size: 15px; font-weight: 500; letter-spacing: 0; line-height: 20px; }
  .rail .rb svg.i { width: 20px; height: 20px; stroke-width: 1.6; transform: none; }
  .rail .rb:hover { background: var(--g-side-hover); color: var(--ink); }
  .rail .rb.on { background: var(--g-side-on); color: var(--ink); box-shadow: 0 1px 2px rgba(10,10,11,.04); }
  .rail .rb.on svg.i { stroke-width: 1.8; }
  .rail .rb.on::before { display: none; }
  .rail .rb[data-tip]:hover::after { display: none; }
  .rail .rl { flex: 1 1 auto; min-width: 0; overflow-x: clip; overflow-y: visible; text-overflow: ellipsis; white-space: nowrap; text-align: start; }
  .rail .rn { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ink); color: var(--g-on);
    font-size: 12px; font-weight: 500; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
  .rail-cap { font-size: 14px; font-weight: 400; line-height: 20px; color: var(--g-cap); margin: 0 0 8px; letter-spacing: 0; }
  .rail-cap2 { margin-top: 28px; }
  /* the week list's button, on the brand's row at the right */
  #colBtn { width: 40px; height: 40px; padding: 0; justify-content: center; border-radius: 12px; color: var(--ink); }
  #colBtn:hover { background: var(--g-side-hover); }
  #colBtn.flip svg.i { transform: none; }
  #colBtn[data-tip]:hover::after { display: block; inset-inline-start: auto; inset-inline-end: 0; top: calc(100% + 8px); transform: none; }
  /* the foot: who is signed in */
  .rail-acct { flex: none; padding-top: 18px; }
  .rail-me { display: flex; align-items: center; gap: 12px; min-width: 0; padding-block: 4px; padding-inline: 0 8px; border-radius: 16px; color: var(--ink); text-decoration: none; }
  .rail-me:hover .rm-n { text-decoration: underline; text-underline-offset: 3px; }
  .rm-av { flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--ink); color: var(--g-on);
    display: inline-flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 500; }
  .rm-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .rm-n { font-size: 15px; font-weight: 600; line-height: 20px; overflow-x: clip; overflow-y: visible; text-overflow: ellipsis; white-space: nowrap; }
  .rm-r { font-size: 14px; line-height: 18px; color: var(--g-cap); }

  /* the top bar: the sheet's top edge, with a rounded hairline box inside it */
  .tbar { height: 72px; padding: 16px 32px 0 32px; background: var(--g-strong); border: 0; border-radius: 24px 24px 0 0; box-shadow: none; gap: 16px; }
  .tbar::before { content: ""; position: absolute; inset-inline-start: 16px; inset-inline-end: 16px; top: 16px; bottom: 0; border: 1px solid var(--g-rim); border-radius: 16px; pointer-events: none; }
  #tabs { display: none; }                         /* the sidebar lists the settings pages */

  /* the + button sits inside the sheet's corner */
  .fab { inset-inline-end: 40px; bottom: 40px; }
}

/* ------------------------------------------------------------------ narrower: the compact rail, as before */
@media (max-width: 1023px) {
  :root body[data-page], :root[data-theme] body[data-page] { background: var(--g-strong); }
  .rail { background: var(--g-strong); border-inline-end: 1px solid var(--g-hair); box-shadow: none; }
  .rail .rl, .rail .rn, .rail-cap, .rail .rb-pg, .rail-acct { display: none; }
  .rail .rb.on { background: var(--g-pill); border-radius: 12px; }
  .tbar { background: var(--g-strong); border-bottom: 1px solid var(--g-hair); box-shadow: none; }
}
@media (max-width: 767px) { .rail { border-inline-end: 0; border-top: 1px solid var(--g-hair); } }
/* Phone top bar: the buttons on the right keep their size and the search (or the settings tabs) takes what is left.
   With two equal side columns the right group was squeezed and its buttons sat on top of each other. */
@media (max-width: 767px) {
  .tbar { grid-template-columns: minmax(0, 1fr) auto auto; }
  .bar-r { gap: 4px; min-width: auto; }
  .bar-r > * { flex: none; }
  .bar-r .thm { width: 36px; }
  .bar-l { overflow: hidden; }
}
.rb { color: var(--faint); }
.rb:hover { color: var(--ink); }
.rb.on { color: var(--ink); }
.rb .bdg { background: var(--ink); box-shadow: 0 0 0 2px var(--g-strong); }
.rb[data-tip]:hover::after { background: var(--ink); color: var(--g-on); box-shadow: var(--g-shadow); border-radius: 8px; }

/* ------------------------------------------------------------------ the top bar's controls */
.search { color: var(--faint); }
.search input { color: var(--ink); }
.search input::placeholder { color: var(--faint); }
.search:focus-within { color: var(--ink); }
.inv, .sdot { color: var(--body); }
.inv:hover, .user:hover, .sdot:hover { background: var(--g-soft); color: var(--ink); }
.inv.has { color: var(--ink); }
.user { color: var(--ink); }
.uav { background: var(--ink); color: var(--g-on); }
.bar-t { color: var(--ink); }
.addcal { background: var(--g-strong); border: 1px solid var(--g-edge); color: var(--ink); }
.addcal:hover { border-color: var(--faint); }
.trial { color: var(--faint); }
.thm { color: var(--body); }
.thm:hover { background: var(--g-soft); color: var(--ink); }
.tabs a { border-radius: 999px; color: var(--body); }
.tabs a:hover { background: var(--g-soft); color: var(--ink); }
.tabs a.on { background: var(--g-strong); color: var(--ink); box-shadow: 0 0 0 1px var(--g-edge); }
.badge { background: var(--ink); color: var(--g-on); }

/* ------------------------------------------------------------------ banners: a soft band inside the sheet */
.banner { position: relative; isolation: isolate; background: var(--g-strong); border: 0; color: var(--body); padding: 14px 32px; }
.banner::before { content: ""; position: absolute; inset: 6px 16px; border-radius: 12px; background: var(--g-pill); z-index: -1; }
.banner.vb::before, .banner.bill:not(.quiet)::before { background: color-mix(in srgb, #E0A12E 16%, var(--g-strong)); }
.banner a { color: var(--ink); }
@media (max-width: 767px) { .banner { padding: 12px 22px; } .banner::before { inset: 4px 8px; } }

/* ------------------------------------------------------------------ the calendar page */
.cal-main { background: transparent; }
.cal-side { background: var(--g-strong); border: 0; border-inline-end: 1px solid var(--g-hair); border-radius: 0; box-shadow: none; }
@media (max-width: 1023px) { .cal-side, .cal-shell.noside .cal-side { box-shadow: calc(8px * var(--dir, 1)) 0 30px rgba(10,10,11,.14); } }
.wk-day.today { background: var(--g-soft); }
.wk-day .dl:hover .L { color: var(--ink); }
.wk-ev:hover .tt { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.wk-ev.next::before { background: var(--ink); }
.wk-ev.next .tm { color: var(--ink); }
.tchip { background: var(--ink); color: var(--g-on); box-shadow: none; border-radius: 999px; }
.wk-today { border-color: var(--g-hair); }
.side-foot { color: var(--faint); }

/* the toolbar: the title, the filter pills, then the quiet controls */
.cal-tool { border: 0; }
.cal-tool h1 { color: var(--ink); font-weight: 500; letter-spacing: -.01em; }
.cal-tool h1 span { font-weight: 500; color: var(--faint); }
.cal-tool .ib { color: var(--body); }
.cal-tool .ib:hover { background: var(--g-soft); color: var(--ink); }
.cal-tool .btn.light { background: none; border: 0; box-shadow: none; color: var(--ink); font-weight: 500; }
.main-calendar .cal-tool { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding-block: 22px 18px; padding-inline: 32px 28px; }
.main-calendar .cal-tool > *, .main-calendar .cal-tool h1, .main-calendar .cal-tool .vseg { order: 0; }
.main-calendar .cal-tool h1 { flex: none; flex-basis: auto; margin: 0; font-size: 28px; line-height: 36px; white-space: nowrap; }
/* the pills take the room between the title and the controls and wrap onto a second line rather than hide */
.fpills { flex: 1 1 0; min-width: 140px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 2px 0; }
.tctl { flex: none; margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.main-calendar .tctl > *, .main-calendar .tctl #tToday { order: 0; }
.main-calendar .tctl .ib { width: 36px; height: 36px; border-radius: 999px; }
.main-calendar .tctl .btn.light { padding: 8px 10px; font-size: 14px; border-radius: 999px; }
.main-calendar .tctl .btn.light:hover { background: var(--g-soft); }
.main-calendar .tctl .vseg { margin-block: 0; margin-inline: 8px 4px; }
/* the filter pills (also the Tasks legend, so both pages filter alike) */
.main-calendar .fp, .kb-legend .cchip { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 32px; padding: 0 14px; border: 0; border-radius: 999px;
  background: var(--g-pill); color: var(--body); font-size: 14px; font-weight: 400; line-height: 20px; white-space: nowrap; cursor: pointer; text-decoration: none; box-shadow: none; }
.main-calendar .fp:hover, .kb-legend .cchip:hover { background: var(--g-pill-hover); color: var(--ink); }
.main-calendar .fp .dot, .kb-legend .cchip .dot { width: 9px; height: 9px; }
.main-calendar .fp.off, .kb-legend .cchip.off { background: transparent; box-shadow: inset 0 0 0 1px var(--g-edge); color: var(--faint); }
.main-calendar .fp.warn { color: var(--bad); }
.main-calendar .fp-all { padding-inline-start: 14px; }
.main-calendar .fp-all .ck { display: none; }
.main-calendar .fp-all.on { background: var(--ink); color: var(--g-on); font-weight: 500; padding-inline-start: 7px; }
.main-calendar .fp-all.on:hover { background: var(--ink-soft); color: var(--g-on); }
.main-calendar .fp-all.on .ck { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--g-on); color: var(--ink);
  border: 0; padding: 0; margin: 0; box-sizing: border-box; }   /* life.css has a general .ck (a checklist box) */
.main-calendar .fp-all .ck svg.i { width: 12px; height: 12px; stroke-width: 2.8; }
.kb-legend { gap: 8px; flex-wrap: wrap; }
/* the view switch: a light grey segmented pill */
.vseg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--g-pill); }
.vseg button { border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--body); }
.vseg button:hover { color: var(--ink); }
.vseg button.on { background: var(--g-strong); color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(10,10,11,.10); }
:root[data-theme="dark"] .vseg button.on { background: #2A2D30; box-shadow: none; }
@media (max-width: 1023px) {
  .main-calendar .cal-tool { flex-wrap: nowrap; padding: 16px 16px 12px; gap: 8px; }
  .main-calendar .cal-tool h1 { flex: 0 1 auto; min-width: 0; overflow-x: clip; overflow-y: visible; text-overflow: ellipsis; font-size: 22px; line-height: 30px; }
  .fpills { display: none; }                       /* the week list's chips filter here */
}
@media (max-width: 767px) {
  .main-calendar .cal-tool { flex-wrap: wrap; row-gap: 6px; gap: 2px; padding: 10px 8px 8px; }
  .main-calendar .cal-tool h1 { order: 2; flex-basis: 100%; padding: 0 6px; font-size: 22px; }
  .main-calendar .tctl .ib { width: 32px; height: 32px; }
  .main-calendar .tctl .btn.light { padding: 6px 8px; }
  .main-calendar .tctl .vseg { margin-inline-start: 4px; }
}

/* the week grid: hairlines, centred "22 - Sun" headers, today as a black block */
.tg-head { background: var(--g-strong); border-top: 1px solid var(--g-hair); border-bottom: 1px solid var(--g-hair); padding-bottom: 0; }
.tg-head .tz { font-size: 12px; color: var(--faint); align-self: center; padding-block: 0; padding-inline: 0 12px; }
.dh { justify-content: center; align-items: center; gap: 0; padding: 3px 8px; border-inline-start: 0; font-size: 14px; line-height: 18px; color: var(--body); white-space: nowrap; overflow: hidden; }
.dh .dn, .dh .wd, .dh .dsep { padding: 0; border-radius: 0; background: none; color: inherit; font-size: 14px; font-weight: 400; line-height: 18px; letter-spacing: 0; }
.dh .dsep { white-space: pre; }
.dh:hover { color: var(--ink); }
.dh:hover .dn { background: none; color: inherit; }
.dh.past { color: var(--faint); }
.dh.past .dn { color: inherit; }
.dh.today { background: var(--ink); color: var(--g-on); }
.dh.today .dn, .dh.today .wd, .dh.today .dsep { background: none; color: var(--g-on); font-weight: 500; }
.dh.acc-h { justify-content: center; gap: 10px; padding: 8px 10px; font-size: 15px; font-weight: 500; color: var(--ink); cursor: default; }
.tg-all { background: var(--g-strong); border-top: 1px solid var(--g-hair); }
.tg-all .lab { font-size: 12px; color: var(--faint); }
.tg-all .cell { border-inline-start: 1px solid var(--g-hair); }
/* hour labels sit inside their hour, as in the reference; no quarter ticks */
.gut { background: none; }
.gut span { inset-inline-end: 12px; font-size: 14px; color: var(--body); letter-spacing: 0; transform: translateY(calc(var(--hour) / 2 - 50%)); }
.gut .zcol { border-inline-end-color: var(--g-hair); }
.gut .zcol span { font-size: 12px; color: var(--faint); }
.gut .zcol span.dd { color: var(--body); }
.gut .nowt { display: none; }
.col { border-inline-start: 1px solid var(--g-hair); background-color: transparent;
  background-image: repeating-linear-gradient(to bottom, var(--g-hair) 0 1px, transparent 1px var(--hour)); }
.col::after { display: none; }
.col.today, .col.weekend { background-color: transparent; }
/* now: a black line with the time in a black pill at its left end, reaching into the gutter or the day before */
.now { inset-inline-start: 0; inset-inline-end: 0; height: 0; border-top: 2px solid var(--now); z-index: 6; }
.now::before { display: none; }
.now[data-t]::before { display: block; content: attr(data-t); position: absolute; top: -13px; inset-inline-start: auto; inset-inline-end: calc(100% - 6px); width: auto; height: 24px;
  padding: 0 10px; border-radius: 999px; background: var(--now); color: var(--g-on); font-size: 13px; font-weight: 600; line-height: 24px;
  font-variant-numeric: tabular-nums; white-space: nowrap; }
/* day view: the old large clock on the line becomes the same black pill as in the week view, with
   "next in 40 min" as one quiet pill beside it */
.nowbig { inset-inline-start: 6px; gap: 6px; padding: 0; background: none; }
.nowbig b { height: 24px; padding: 0 10px; border-radius: 999px; background: var(--now); color: var(--g-on); font-size: 13px; font-weight: 600; line-height: 24px; letter-spacing: 0; }
.nowbig span { height: 24px; padding: 0 10px; border-radius: 999px; background: var(--g-pill); color: var(--body); font-size: 12px; line-height: 24px; letter-spacing: 0; white-space: nowrap; }
.nowbig span br { display: none; }
.nowbig i { margin-inline-start: 4px; font-size: 12px; font-weight: 600; color: var(--ink); }
.sel { border: 0; border-radius: 10px; background: color-mix(in srgb, var(--ink) 6%, var(--g-ev)); box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); font-weight: 500; }

/* entries: a pastel card in the calendar's colour; title, then the time; no bar, no border, no shadow at rest.
   fitCards() in calendar.js counts on these sizes: 10 px above and below, 18 px lines, a 20 px time row. */
.ev { border: 0; border-radius: 10px; padding: 10px 12px; box-shadow: none; transform: none; color: var(--ev-title);
  background: color-mix(in srgb, var(--c) var(--ev-fill), var(--g-ev)); }
.ev::before { display: none; }
.ev .tt { font-size: 14px; font-weight: 500; line-height: 18px; letter-spacing: 0; color: var(--ev-title); overflow-wrap: normal; word-break: normal; hyphens: none; }
.ev .tm { margin-top: 2px; font-size: 13px; line-height: 18px; letter-spacing: 0; opacity: 1; color: var(--ev-time); }
.ev .du { display: none; }
.ev:hover:not(.dragging) { transform: none; background: color-mix(in srgb, var(--c) var(--ev-hover), var(--g-ev)); box-shadow: 0 10px 24px rgba(10,10,11,.10); }
:root[data-theme="dark"] .ev:hover:not(.dragging) { box-shadow: 0 10px 24px rgba(0,0,0,.45); }
.ev.active, .ev.active:hover { box-shadow: 0 0 0 2px var(--ink); }
.ev.past { opacity: 1; background: color-mix(in srgb, var(--c) var(--ev-past), var(--g-ev)); }
.ev.past .tt { color: var(--ev-past-title); }
.ev.past .tm { color: var(--ev-past-time); }
/* short entries (under 40 px: 15, 20, 25 and 30 minutes) are one line, centred */
.ev.short { display: flex; flex-direction: column; justify-content: center; padding: 0 12px; }
.ev.short .tt { display: -webkit-box; min-width: 0; }       /* an early rule in style.css made it inline */
.ev[data-h="20"], .ev[data-h="22"] { padding: 0 10px; }
.ev[data-h="20"] .tt, .ev[data-h="22"] .tt, .ev.sm .tt { font-size: 12.5px; line-height: 16px; }
.ev.skip { background: transparent; box-shadow: inset 0 0 0 1px var(--g-edge); }
.ev.skip .tt { color: var(--faint); font-weight: 400; }
.ev.mirror, .ev.planned { box-shadow: inset 0 0 0 1px var(--g-edge); color: var(--body);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, var(--g-ev)) 0 6px, color-mix(in srgb, var(--c) 6%, var(--g-ev)) 6px 12px); }
/* where the person stands on an entry with guests: a small white pill at the card's foot */
.ev.has-st { padding-bottom: 40px; }
.ev-st { position: absolute; inset-inline-start: 10px; bottom: 8px; display: inline-flex; align-items: center; gap: 6px; height: 24px; max-width: calc(100% - 20px);
  padding-block: 0; padding-inline: 5px 10px; border-radius: 999px; background: var(--st-bg); color: var(--st-ink); font-size: 12px; font-weight: 500; line-height: 16px;
  white-space: nowrap; overflow: hidden; pointer-events: none; }
.ev-st .si { flex: none; width: 14px; height: 14px; }
.ev-st .sl { min-width: 0; overflow-x: clip; overflow-y: visible; text-overflow: ellipsis; }
/* side-by-side entries get narrow: smaller type, the time row gives way, the pill keeps its icon */
@container (max-width: 96px) { .ev-st { padding: 0 5px; } .ev-st .sl { display: none; } }
@container (max-width: 84px) {
  .ev .tt { font-size: 12px; line-height: 16px; overflow-wrap: break-word; }
  .ev .tm { display: none; }
}
/* all-day entries and the month's chips: the same pastel */
.chip { border: 0; border-radius: 8px; padding: 3px 8px; font-size: 12.5px; color: var(--ev-title); background: color-mix(in srgb, var(--c) var(--ev-fill), var(--g-ev)); }
.chip:hover { background: color-mix(in srgb, var(--c) var(--ev-hover), var(--g-ev)); }
.chip.line { background: none; color: var(--ink); }
.chip.line:hover { background: var(--g-soft); }
.chip.line .tm { color: var(--faint); }
.chip.skip { background: none; color: var(--faint); border: 0; }
.chip.planned, .chip.mirror { border: 0; box-shadow: inset 0 0 0 1px var(--g-edge); color: var(--body);
  background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 14%, var(--g-ev)) 0 4px, var(--g-ev) 4px 8px); }
/* month and agenda */
.mo-h div { color: var(--faint); border-bottom: 1px solid var(--g-hair); }
.mo-c, .mo-h div { border-color: var(--g-hair); }
.mo-c:hover { background: var(--g-soft); }
.mo-c .d { color: var(--ink); }
.mo-c.out .d { color: var(--faint); }
.mo-c.today .d { background: var(--ink); color: var(--g-on); border-radius: 999px; font-weight: 500; }
.ag-day.today .dl .n { color: var(--ink); }
.ag-row:hover { background: var(--g-soft); }
.ag-row .cl { color: var(--faint); }

/* ------------------------------------------------------------------ things that float above: white, hairline, 16 px */
.pop, .menu, .card, .toast { background: var(--g-strong); border: 1px solid var(--g-rim); box-shadow: var(--g-shadow); color: var(--ink); }
:root[data-theme] :is(.pop:not(.dark), .card:not(.dark), .menu) { background: var(--g-strong); border-color: var(--g-rim); box-shadow: var(--g-shadow); }
.pop, .menu { border-radius: 16px; }
.toast { border-radius: 16px; }
@media (min-width: 768px) { .card { border-radius: 16px; } .pop.nepop { border-radius: 16px; } .ne-save { border-radius: 0 0 16px 16px; } }
.pop .bar { border-radius: 15px 15px 0 0; }
.menu .mrow:hover, .mrow:hover { background: var(--g-soft); }
/* the new-event card stays dark: near-black ink in the light theme, one step up in the dark one */
.pop.dark, .card.dark { background: var(--night); border: 1px solid var(--night); color: #fff; box-shadow: 0 24px 60px rgba(10,10,11,.30); }
:root[data-theme="dark"] :is(.pop.dark, .card.dark) { border-color: rgba(255,255,255,.10); box-shadow: 0 24px 60px rgba(0,0,0,.55); }
.dial .hub { fill: color-mix(in srgb, #fff 8%, var(--night)); }
.dial .hub:hover { fill: color-mix(in srgb, #fff 13%, var(--night)); }
.backdrop { background: rgba(10,10,11,.30); }
:root[data-theme="dark"] .backdrop { background: rgba(0,0,0,.55); }

/* ------------------------------------------------------------------ controls */
.btn { border-radius: 999px; }
.btn.dark { background: var(--ink); border: 1px solid var(--ink); color: var(--g-on); }
.btn.dark:hover { background: var(--ink-soft); border-color: var(--ink-soft); }
.btn.light { background: var(--g-strong); border: 1px solid var(--g-edge); color: var(--ink); box-shadow: none; }
.btn.light:hover { border-color: var(--faint); }
.btn.ghost { color: var(--body); }
.seg { border: 1px solid var(--g-edge); border-radius: 999px; background: var(--g-strong); }
.seg button + button { border-inline-start-color: var(--g-edge); }
.seg button.on { background: var(--ink); color: var(--g-on); }
.ib { color: var(--body); }
.ib:hover { background: var(--g-soft); color: var(--ink); }
.fab { width: 56px; height: 56px; inset-inline-end: 28px; bottom: 28px; border-radius: 50%; background: var(--ink); color: var(--g-on); box-shadow: 0 12px 28px rgba(10,10,11,.22); }
.fab:hover { background: var(--ink-soft); box-shadow: 0 14px 32px rgba(10,10,11,.26); transform: none; }
:root[data-theme="dark"] .fab { box-shadow: 0 12px 28px rgba(0,0,0,.55); }
.fab svg.i { width: 24px; height: 24px; stroke-width: 1.8; }
@media (min-width: 1024px) { .fab { inset-inline-end: 40px; bottom: 40px; } }
@media (max-width: 767px) { .fab { inset-inline-end: 16px; bottom: calc(var(--bar) + 16px); width: 56px; height: 56px; } }
:where(.page, .card:not(.dark), .pop:not(.dark)) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea) {
  background-color: var(--g-strong); border-color: var(--g-edge); border-radius: 12px;
}
.grid th, .grid td, .grid th + th, .grid td + td { border-color: var(--g-hair); }
.grid tr.item:hover { background: var(--g-soft); }
.xbtn { background: var(--g-pill); }

/* ------------------------------------------------------------------ settings pages: plain on the sheet */
.page { background: transparent; border: 0; border-radius: 0; box-shadow: none; }

/* ------------------------------------------------------------------ Tasks: light grey columns, white cards */
.kb-col { background: var(--g-panel); border: 0; border-radius: 16px; }
.kb-col.today { background: var(--g-panel-on); }
.kb-col.over { box-shadow: inset 0 0 0 2px var(--ink); }
.kb-card { background: var(--g-card); border-radius: 12px; box-shadow: 0 1px 2px rgba(10,10,11,.05); }
.kb-card:hover, .kb-card:focus-visible { box-shadow: 0 8px 20px rgba(10,10,11,.10); }
.kb-card.done, .kb-col.last .kb-card { background: color-mix(in srgb, var(--g-card) 55%, transparent); box-shadow: none; }
.kb-tick { background: var(--g-card); border-color: var(--g-edge); }
.kb-tick:hover { border-color: var(--ink); }
.kb-card.done .kb-tick { background: var(--ink); border-color: var(--ink); color: var(--g-on); }
.kb-h .tchip { background: var(--ink); color: var(--g-on); }

/* ------------------------------------------------------------------ printing: plain white, no chrome */
@media print {
  body, body[data-page], :root[data-theme] body { background: #fff !important; display: block; height: auto; overflow: visible; }
  body[data-page] > main, body[data-page] > main.main-calendar { display: block; overflow: visible; border-radius: 0; background: #fff; }
  .rail-acct, .fpills, .tctl { display: none !important; }
  .cal-side, .cal-main, .page, .tg-head, .tg-all { background: #fff; box-shadow: none; }
  .now[data-t]::before { display: none; }
}

/* ------------------------------------------------------------------ a calendar's colour, picked from its dot */
.cchip[data-acc] .dot { position: relative; width: 11px; height: 11px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.cchip[data-acc] .dot::after { content: ""; position: absolute; inset: -11px; }            /* a finger-sized target */
.cchip[data-acc] .dot:hover { transform: scale(1.3); box-shadow: 0 0 0 4px var(--g-soft); }
.main-calendar .fp[data-acc] .dot, .kb-legend .cchip[data-acc] .dot { width: 9px; height: 9px; }
.cpick { position: fixed; z-index: 90; display: grid; grid-template-columns: repeat(6, 32px); gap: 10px; padding: 14px; border-radius: 16px;
  background: var(--g-strong); border: 1px solid var(--g-rim); box-shadow: var(--g-shadow); animation: fade .12s ease-out; }
.cpick button { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 10px; background: var(--c); cursor: pointer; transition: transform .12s; }
.cpick button:hover { transform: scale(1.1); }
.cpick button.on { box-shadow: 0 0 0 2px var(--g-solid), 0 0 0 4px var(--ink); }
.cpick button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.cpick .own { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding-top: 4px; font-size: 13.5px; color: var(--body); cursor: pointer; }
.cpick .own input { width: 32px; height: 32px; padding: 0; border: 0; border-radius: 10px; background: none; cursor: pointer; }

/* below a wide screen the week list is a drawer, so the grid takes the whole width (a later rule in style.css
   had left a 27 px empty strip on phones) */
@media (max-width: 1023px) { .cal-shell, .cal-shell.noside { grid-template-columns: minmax(0, 1fr); } }

/* Switches: black when on, as everything that is "on" in this look (the blue was the last leftover accent). */
.sw input:checked + i { background: var(--ink); }
.sw input:checked + i::after { background: var(--g-strong); }
.sw input:focus-visible + i { box-shadow: 0 0 0 2px var(--g-strong), 0 0 0 4px var(--ink); }

/* ------------------------------------------------------------------ the new-event card (.pop.dark / .card.dark) on paper
   It was the last black card. Now a white sheet like every other float, in both themes, written with the tokens only.
   The :root prefix outranks the `:is(.pop, .card).dark …` rules in style.css. Nothing here matches .btn.dark itself. */
:root :is(.pop, .card).dark { background: var(--g-strong); border: 1px solid var(--g-rim); color: var(--ink); box-shadow: var(--g-shadow); }
:root :is(.pop, .card).dark :is(.ql, .ne .ql) { color: var(--faint); }
:root :is(.pop, .card).dark .qw { color: var(--body); }
:root :is(.pop, .card).dark .qw b { color: var(--ink); }
:root :is(.pop, .card).dark .qw span { color: var(--faint); }
:root :is(.pop, .card).dark :is(.note, .sec, label.field, .check) { color: var(--body); }
:root :is(.pop, .card).dark .check input { accent-color: var(--ink); }
:root :is(.pop, .card).dark .ib { color: var(--body); }
:root :is(.pop, .card).dark .ib:hover { background: var(--g-soft); color: var(--ink); }
:root :is(.pop, .card).dark .av { box-shadow: 0 0 0 1px var(--g-edge); }
:root :is(.pop, .card).dark .err { color: var(--bad); }
:root :is(.pop, .card).dark .ne .err, :root :is(.pop, .card).dark .ne .err.muted { color: var(--faint); }
:root :is(.pop, .card).dark .acts { border-top-color: var(--g-hair); }
/* the title: ink on a hairline underline, ink when focused */
:root :is(.pop, .card).dark input.title-in { background: transparent; color: var(--ink); border-bottom-color: var(--g-edge); }
:root :is(.pop, .card).dark .ne input.title-in { border-bottom-width: 1px; padding-bottom: 13px; }   /* a hairline, same height */
:root :is(.pop, .card).dark input.title-in:focus { border-bottom-color: var(--ink); outline: none; }   /* the ink underline is the focus mark */
:root :is(.pop, .card).dark input::placeholder { color: var(--faint); }
/* the rows: hairlines, grey captions */
:root :is(.pop, .card).dark .ne-row { border-bottom-color: var(--g-hair); }
:root :is(.pop, .card).dark .ne-row:last-child { border-bottom-color: transparent; }
:root :is(.pop, .card).dark .ne-row > span, :root :is(.pop, .card).dark .ne-ft label { color: var(--faint); }
/* the calendar chooser: grey names, the chosen one in ink */
:root :is(.pop, .card).dark .homes label { border-color: var(--g-edge); color: var(--body); }
:root :is(.pop, .card).dark .homes label:has(input:checked) { border-color: var(--ink); background: var(--g-pill); color: var(--ink); }
:root :is(.pop, .card).dark .ne .homes label { color: var(--faint); }
:root :is(.pop, .card).dark .ne .homes label:hover { color: var(--ink); }
:root :is(.pop, .card).dark .ne .homes label:has(input:checked) { color: var(--ink); }
:root :is(.pop, .card).dark .ne .homes label .dot { box-shadow: 0 0 0 1px var(--g-edge); }
/* date and time: ink text, the native pickers in the page's scheme */
:root :is(.pop, .card).dark :is(input[type=date], input[type=time]) { background: var(--g-strong); border-color: var(--g-edge); color: var(--ink); color-scheme: light; }
:root[data-theme="dark"] :is(.pop, .card).dark :is(input[type=date], input[type=time]) { color-scheme: dark; }
:root :is(.pop, .card).dark .ne-row input[type=date], :root :is(.pop, .card).dark .ne-ft input[type=time] { background: transparent !important; border-color: transparent !important; }
:root :is(.pop, .card).dark .ne-ft input[type=time]:is(:hover, :focus) { border-color: var(--g-edge) !important; }
/* the all-day switch: a grey track when off, ink when on, the knob in the surface colour */
:root :is(.pop, .card).dark .sw i { background: color-mix(in srgb, var(--ink) 18%, var(--g-strong)); }
:root :is(.pop, .card).dark .sw i::after { background: var(--g-strong); box-shadow: 0 1px 2px rgba(10,10,11,.18); }
:root :is(.pop, .card).dark .sw input:checked + i { background: var(--ink); }
:root :is(.pop, .card).dark .sw input:focus-visible + i { box-shadow: 0 0 0 2px var(--g-strong), 0 0 0 4px var(--ink); }
/* the dial: drawn in ink on the sheet; the three busy arcs keep their own colours */
:root :is(.pop, .card).dark .dial .tk { stroke: color-mix(in srgb, var(--ink) 22%, var(--g-strong)); }
:root :is(.pop, .card).dark .dial .tk.b { stroke: var(--faint); }
:root :is(.pop, .card).dark .dial .hub { fill: var(--g-pill); filter: none; }
:root :is(.pop, .card).dark .dial .hub:hover { fill: var(--g-pill-hover); }
:root :is(.pop, .card).dark .dial .dt { fill: var(--ink); }
:root :is(.pop, .card).dark .dial .ds { fill: var(--faint); }
:root :is(.pop, .card).dark .dial .span { fill: none; stroke: var(--ink); }
:root :is(.pop, .card).dark .dial .hd { fill: var(--ink); stroke: var(--g-strong); stroke-width: 2; filter: drop-shadow(0 1px 3px rgba(10,10,11,.25)); }
/* the wide save button: the app's black primary; muted grey when writing is off */
:root :is(.pop, .card).dark .ne-save { background: var(--ink); color: var(--g-on); border: 0; border-top: 1px solid var(--ink); }
:root :is(.pop, .card).dark .ne-save:hover:not(:disabled) { background: var(--ink-soft); border-top-color: var(--ink-soft); }
:root :is(.pop, .card).dark .ne-save:disabled { background: var(--g-pill); color: var(--faint); border-top-color: var(--g-hair); cursor: not-allowed; }

/* ================================================================== B1 block: the Agenda (N3), calendar.js agenda()
   One calm reading column: days as headings (each sticks to the top while its lines scroll), one line per entry
   (time, a bar in the calendar's colour, the title, the calendar's name, the answer's pill), the day's tasks with a
   tick, free time and folded empty days as quiet lines. Logical sides only: right to left the bar and the pill swap. */
.main-calendar .agv { max-width: 760px; margin: 0 auto; padding: 0 28px 56px; }
.agv-day { padding-block-end: 6px; }
.agv .agv-h { position: sticky; top: 0; z-index: 3; display: block; margin: 0; padding: 22px 0 8px; border: 0; background: var(--g-strong);
  font-size: 15.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.005em; color: var(--ink); }
.agv-day.today .agv-h { font-size: 18px; }
.agv-day.past .agv-h { color: var(--faint); font-weight: 500; }
.agv-hd { all: unset; cursor: pointer; border-radius: 4px; }
.agv-hd:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.agv-hd:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.agv-line { position: relative; display: grid; grid-template-columns: 112px 3px minmax(0, 1fr) auto; column-gap: 14px; align-items: center;
  min-height: 44px; padding: 6px 10px; margin-inline: -10px; border-radius: 10px; cursor: pointer; outline: none; }
.agv-line:hover { background: var(--g-soft); }
.agv-line:focus-visible { box-shadow: inset 0 0 0 2px var(--ink); }
.agv-tm { font-size: 14px; color: var(--body); font-variant-numeric: tabular-nums; white-space: nowrap; }
.agv-bar { width: 3px; align-self: stretch; min-height: 22px; border-radius: 2px; background: var(--c, var(--g-edge)); }
.agv-main { display: flex; align-items: center; gap: 10px; min-width: 0; }
.agv-main .tt { min-width: 0; font-weight: 500; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agv-cal { flex: none; max-width: 45%; font-size: 13px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agv-end { display: inline-flex; align-items: center; gap: 8px; justify-self: end; min-width: 0; }
.agv .ev-st { position: static; max-width: none; box-shadow: inset 0 0 0 1px var(--g-edge); }
.agv-line.past { opacity: .55; }
.agv-line.skip .tt, .agv-line.mirror .tt { color: var(--faint); font-weight: 400; }
.agv-line.skip.gone .tt { text-decoration: line-through; }
/* the quick actions that already exist, over the line's end while it is hovered or has the focus */
.agv-acts { display: none; position: absolute; inset-inline-end: 8px; top: 50%; transform: translateY(-50%); gap: 4px; padding: 3px;
  border-radius: 999px; background: var(--g-strong); box-shadow: 0 0 0 1px var(--g-edge), 0 4px 12px rgba(10,10,11,.08); }
.agv-line:hover .agv-acts, .agv-line:focus-within .agv-acts { display: inline-flex; }
.agv-line:is(:hover, :focus-within) .agv-end .ev-st { visibility: hidden; }     /* the actions stand where the pill was */
.agv-act { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border: 0; border-radius: 999px; background: none;
  color: var(--ink); font: inherit; font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap; }
.agv-act:hover, .agv-act:focus-visible { background: var(--g-pill-hover); outline: none; }
.agv-act[data-act="join"] { background: var(--ink); color: var(--g-on); }
.agv-act[data-act="join"]:hover { background: var(--ink-soft); }
.agv-act svg.i { width: 15px; height: 15px; }
/* tasks: a tick before the title; done reads struck through */
.agv-tick { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; padding: 0; border-radius: 6px;
  border: 1.5px solid var(--g-edge); background: none; color: transparent; cursor: pointer; }
.agv-tick:hover { border-color: var(--faint); color: var(--faint); }
.agv-tick:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.agv-tick svg.i { width: 14px; height: 14px; stroke-width: 2.4; }
.agv-task.done .agv-tick { background: var(--ink); border-color: var(--ink); color: var(--g-on); }
.agv-task.done .tt { color: var(--faint); font-weight: 400; text-decoration: line-through; }
.agv-task .tt { font-weight: 400; }
/* free time, empty days, the ends: quiet lines */
.agv-free { display: flex; align-items: center; gap: 12px; min-height: 30px; padding-inline-start: 143px; color: var(--faint); font-size: 13px; }
.agv-free::after { content: ""; flex: 1; border-top: 1px dashed var(--g-edge); }
.agv-none { padding: 8px 0; color: var(--faint); font-size: 14px; }
.agv-fold { padding: 18px 0 10px; color: var(--faint); font-size: 14px; }
.agv-ends { display: flex; justify-content: center; padding: 14px 0; }
.agv-step { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--g-pill);
  color: var(--body); font: inherit; font-size: 13.5px; cursor: pointer; }
.agv-step:hover { background: var(--g-pill-hover); color: var(--ink); }
.agv-step svg.i { width: 16px; height: 16px; }
.main-calendar .fp-tasks svg.i { width: 16px; height: 16px; }
@media (hover: none) { .agv-line:hover .agv-acts { display: none; } .agv-line:hover .agv-end .ev-st { visibility: visible; } }
@media (max-width: 767px) {
  .main-calendar .agv { padding: 0 14px 48px; }
  /* the time above the title, the pill under it; the bar runs down the start side */
  .agv-line { grid-template-columns: 3px minmax(0, 1fr); grid-template-areas: "bar tm" "bar main" "bar end"; row-gap: 2px; padding-block: 8px; }
  .agv-tm { grid-area: tm; font-size: 13px; }
  .agv-bar { grid-area: bar; }
  .agv-main { grid-area: main; flex-wrap: wrap; row-gap: 2px; }
  .agv-main .tt { white-space: normal; overflow-wrap: anywhere; }
  /* a task: the tick stays on the title's first line, the title takes the rest of that line (the calendar's name
     goes under them); without this a long title wrapped to a line of its own and left the tick alone above it */
  .agv-main .agv-tick + .tt { flex: 1 1 calc(100% - 30px); }
  .agv-main .agv-tick { align-self: flex-start; }
  .agv-cal { max-width: 100%; }
  .agv-end { grid-area: end; justify-self: start; }
  .agv-end:empty { display: none; }
  .agv-acts { display: none !important; }
  .agv-line:is(:hover, :focus-within) .agv-end .ev-st { visibility: visible; }
  .agv-free { padding-inline-start: 17px; }
}
@media print { .agv-acts, .agv-ends { display: none !important; } .agv .agv-h { position: static; } }

/* ================================================================== B1 block: Conflicts (N4), conflicts.js
   Each meeting of a clash on its own line: a bar in its calendar's colour, the title, a "Not answered" or "Maybe"
   pill, then its own time and every calendar it is on (dot and name). */
.cf-lead { margin: -4px 0 12px; color: var(--body); font-size: 14px; }
.cf-grid td { vertical-align: top; }
.cf-grid td.x { vertical-align: middle; }
.cf-m { display: flex; align-items: stretch; gap: 10px; padding: 2px 0; }
.cf-m + .cf-m { margin-top: 8px; }
.cf-bar { flex: none; width: 3px; border-radius: 2px; background: var(--c, var(--g-edge)); }
.cf-t { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; min-width: 0; }
.cf-t .tt { font-weight: 500; overflow-wrap: anywhere; }
.cf-t .pillc { padding: 1px 8px; font-size: 12px; }
.cf-sub { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 2px 14px; color: var(--faint); font-size: 13px; }
.cf-cal { display: inline-flex; align-items: center; gap: 6px; }
.cf-list .cf-when { display: block; margin-bottom: 6px; font-size: 13px; }
.cf-list .line .nm { display: block; }
.cf-issue { display: block; padding: 11px 0; border-bottom: 1px solid var(--line); }
.cf-src { align-items: stretch; }
.cf-src > span:last-child { line-height: 1.6; }
.cf-src .cf-cal + .cf-cal { margin-inline-start: 12px; }

/* ================================================================== Tasks: the board (N2, feat/b1-board)
   Both views: a card is a pastel of its calendar's colour (the week grid's own mix, --ev-fill) with a 3 px edge in
   the full colour on the start side; done cards fade to the past mix. Board: the stages side by side, the last one
   folded into a narrow column until it is opened; on a phone one column is 85% wide and the next peeks, with swipe
   and snap. The drag: a copy lifts and follows, a soft slot shows where it lands, the copy settles into it. */
.kb-card { background: color-mix(in srgb, var(--c) var(--ev-fill), var(--g-ev)); border-inline-start: 3px solid var(--c); border-radius: 10px;
  box-shadow: none; color: var(--ev-title); transform: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  transition: background-color .15s, box-shadow .15s; }
.kb-card:hover, .kb-card:focus-visible { background: color-mix(in srgb, var(--c) var(--ev-hover), var(--g-ev)); box-shadow: 0 6px 16px rgba(10,10,11,.08); transform: none; }
.kb-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.kb-card[data-drag] { cursor: grab; }
.kb-card.notick { padding-inline-start: 14px; }
.kb-card .tt { color: var(--ev-title); }
.kb-card.st .tt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.kb-card .tm { color: var(--ev-time); gap: 4px 10px; }
.kb-card .tm .cn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.kb-tick { background: color-mix(in srgb, var(--g-ev) 72%, transparent); border-color: color-mix(in srgb, var(--c) 50%, var(--g-edge)); }
.kb-tick:hover { border-color: var(--ink); color: color-mix(in srgb, var(--ink) 35%, transparent); }
.kb-card.done, .kb-col.last .kb-card { background: color-mix(in srgb, var(--c) var(--ev-past), var(--g-ev)); border-inline-start-color: color-mix(in srgb, var(--c) 45%, var(--g-ev)); box-shadow: none; }
.kb-card.done .tt, .kb-col.last .kb-card .tt { color: var(--ev-past-title); }
.kb-card.done .tm, .kb-col.last .kb-card .tm { color: var(--ev-past-time); opacity: 1; }
.kb-card.done .kb-tick { background: var(--ink); border-color: var(--ink); color: var(--g-on); }
.kb-card.st { padding-inline: 40px 40px; }
.kb-card.st.notick { padding-inline-start: 14px; }
.kb-card .kb-mv { color: var(--ev-time); }
.kb-card .kb-mv:hover, .kb-card .kb-mv:focus-visible { background: color-mix(in srgb, var(--g-ev) 60%, transparent); color: var(--ink); }
.kb-list { min-height: 8px; }
.kb-none.away { display: none; }

.kb-cols.board { display: flex; align-items: flex-start; gap: 14px; overflow-x: auto; padding-block: 0 12px; padding-inline: 34px 44px; scroll-padding-inline: 34px; }
.kb-cols.board > .kb-col { flex: 1 1 0; min-width: 230px; }
.kb-cols.board > .kb-none { flex: 1 1 auto; }
.kb-cols.board > .kb-col.fold { flex: 0 0 60px; min-width: 60px; padding: 0; }
.kb-fold { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; min-height: 240px; padding: 18px 0; border: 0; border-radius: inherit;
  background: none; color: var(--ink); font: inherit; cursor: pointer; transition: background-color .15s; }
.kb-fold:hover { background: var(--g-panel-on); }
.kb-fold:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.kb-fold .cnt { min-width: 26px; padding: 3px 7px; border-radius: 999px; background: var(--g-card); font-size: 12.5px; font-weight: 600; color: var(--body); }
.kb-fold svg.i { width: 15px; height: 15px; stroke-width: 2.2; color: var(--faint); }
.kb-fold .sn { writing-mode: vertical-rl; font-size: 17px; font-weight: 700; letter-spacing: .01em; color: var(--body); }
.kb-h .kb-unfold { width: 28px; height: 28px; margin-inline-start: 2px; align-self: center; }
.kb-h .kb-unfold svg.i { width: 15px; height: 15px; }
.kb-add { display: flex; align-items: center; gap: 7px; width: 100%; margin-top: 2px; padding: 8px 10px; border: 0; border-radius: 9px; background: none;
  color: var(--faint); font: inherit; font-size: 13.5px; cursor: pointer; transition: background-color .15s, color .15s; }
.kb-add:hover, .kb-add:focus-visible { background: var(--g-panel-on); color: var(--ink); outline: none; }
.kb-add svg.i { width: 15px; height: 15px; }

.kb-col.over { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ink) 22%, transparent); background: var(--g-panel-on); }
.kb-col.fold.over .kb-fold { background: var(--g-panel-on); }
.kb-card.kb-slot { background: color-mix(in srgb, var(--c) 8%, var(--g-panel)); border: 1.5px dashed color-mix(in srgb, var(--c) 55%, var(--g-edge)); box-shadow: none; }
.kb-card.kb-slot > * { visibility: hidden; }
.kb-card.kb-slot.away { display: none; }
.kb-ghost { position: fixed; z-index: 80; margin: 0; pointer-events: none; cursor: grabbing; will-change: translate;
  box-shadow: 0 1px 2px rgba(10,10,11,.05); transition: scale .16s cubic-bezier(.2, .7, .2, 1), box-shadow .16s ease-out; }
.kb-ghost.up { scale: 1.03; box-shadow: 0 16px 36px rgba(10,10,11,.16), 0 2px 6px rgba(10,10,11,.06); }
.kb-ghost.settle { transition: translate .18s cubic-bezier(.2, .7, .2, 1), scale .18s cubic-bezier(.2, .7, .2, 1), box-shadow .18s ease-out, opacity .18s ease-out; }
.kb-ghost.into { scale: .55; opacity: 0; }
:root.kb-dragging, :root.kb-dragging * { cursor: grabbing !important; }
:root.kb-dragging .kb-cols { scroll-snap-type: none; }                    /* the columns scroll under the card near an edge */
.kb-card.kb-back { animation: kbBack 1.2s ease-out; }
@keyframes kbBack { from { box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 70%, transparent); } to { box-shadow: 0 0 0 2px transparent; } }
:root[data-theme="dark"] .kb-ghost.up { box-shadow: 0 16px 36px rgba(0,0,0,.5), 0 2px 6px rgba(0,0,0,.3); }
:root[data-theme="dark"] .kb-card:hover, :root[data-theme="dark"] .kb-card:focus-visible { box-shadow: 0 6px 16px rgba(0,0,0,.3); }
@media (max-width: 1100px) {
  .kb-cols.board { padding-inline: 16px; scroll-padding-inline: 16px; gap: 12px; scroll-snap-type: x mandatory; }
  .kb-cols.board > .kb-col { flex: 0 0 min(78vw, 300px); scroll-snap-align: start; }
  .kb-cols.board > .kb-col.fold { flex: 0 0 60px; }
}
@media (max-width: 767px) {
  .kb-cols.board > .kb-col { flex: 0 0 85%; min-width: 0; min-height: 200px; }
  .kb-cols.board > .kb-col.fold { flex: 0 0 56px; min-width: 56px; }
  .kb-fold { min-height: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .kb-ghost, .kb-ghost.settle { transition: none; }
  .kb-card.kb-back { animation: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--c) 70%, transparent); }
}
