/* ============================================================
   Schedule v2 styles
   Scoped to .page-schedule so tokens never leak.
   Floating scrim siblings (modal/toast/cheat-sheet/confirm/peek
   /assign popovers) live outside #page-schedule, so they are
   left unscoped and given an explicit font-family below.
   ============================================================ */

/* -------- Plus Jakarta Sans (self-hosted) -------- */
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/plus-jakarta-sans-cyrillic-ext.woff2") format("woff2");
  unicode-range: U+0460-052F, U+1C80-1C88, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/plus-jakarta-sans-vietnamese.woff2") format("woff2");
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/plus-jakarta-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/plus-jakarta-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ============================================================
   Scoped page tokens
   ============================================================ */
.page-schedule {
  --ink: #15131c;
  --ink-soft: #4a4658;
  --ink-faint: #5d5973;
  --ink-mute: #6d6982;
  --bg: #f6f5f8;
  --card: #ffffff;
  --line: #e9e7ef;
  --line-soft: #f0eef4;
  --blue: #2563eb;
  --blue-soft: #eaf0fd;
  --purple: #7c3aed;
  --grad: linear-gradient(96deg, #2563eb 0%, #7c3aed 100%);
  --ok: #1f9d55;
  --ok-soft: #e7f6ec;
  --amber: #d68316;
  --amber-soft: #fdf2e3;
  --red: #dc4b54;
  --red-soft: #fcebec;
  --shadow-sm: 0 1px 2px rgba(21,19,28,.05), 0 1px 3px rgba(21,19,28,.04);
  --shadow-md: 0 8px 24px -10px rgba(21,19,28,.14), 0 2px 6px rgba(21,19,28,.05);
  --shadow-lg: 0 28px 60px -22px rgba(21,19,28,.30), 0 8px 22px -12px rgba(21,19,28,.14);
  --r: 14px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --spring: cubic-bezier(.34,1.4,.5,1);
  --sidebar: 256px;
  --labelW: 212px;

  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.011em;
  line-height: 1.5;
}

.page-schedule h1,
.page-schedule h2,
.page-schedule h3 { margin: 0; letter-spacing: -0.03em; line-height: 1.1; }
.page-schedule p { margin: 0; }
.page-schedule button { font-family: inherit; }

/* ============================================================
   Main panel
   ============================================================ */
/* The section IS the schedule panel in the SPA shell; the standalone prototype had a <main>
   inside .page-schedule, but in-app there's a global <main class="main"> as the ancestor. Apply
   the panel layout (flex column, viewport-bound height, hidden overflow) to the section itself
   so .planner/.timeline can flex to fill it. */
.page-schedule { display: flex; flex-direction: column; height: calc(100vh - 60px); overflow: hidden; padding: 26px 26px 22px; min-width: 0; }
/* The Schedule is a full-width calendar/timeline, so let ONLY this page break out of the app's 1280px
   content cap (which suits the narrower reading pages). Scoped via :has + :not([hidden]) so no other page
   is affected, and the .main padding is dropped so the schedule's own padding controls the inset. */
.main:has(#page-schedule:not([hidden])) { max-width: none; padding: 0; }
.page-schedule .head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.page-schedule .head h1 { font-size: 28px; font-weight: 800; display: flex; align-items: center; gap: 11px; }
.page-schedule .head h1 .ub { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 4px 9px; border-radius: 999px; background: var(--ink); color: #fff; transform: translateY(-2px); }
.page-schedule .head .sub { margin-top: 7px; font-size: 14.5px; color: var(--ink-faint); font-weight: 500; max-width: 640px; text-wrap: pretty; }
.page-schedule .head .info { display: inline-flex; align-items: center; vertical-align: -3px; margin-left: 6px; color: var(--ink-mute); cursor: help; position: relative; }
.page-schedule .head .info svg { width: 16px; height: 16px; }
.page-schedule .head .info:hover, .page-schedule .head .info:focus { color: var(--blue); }
.page-schedule .head .info:focus-visible { outline: 2px solid var(--accent, #2563eb); outline-offset: 3px; border-radius: 6px; }
.page-schedule .head .info .tip { position: absolute; left: -8px; top: calc(100% + 9px); width: 308px; background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 500; line-height: 1.45; padding: 11px 13px; border-radius: 11px; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s ease, transform .18s var(--spring), visibility .16s ease; z-index: 60; letter-spacing: -.004em; text-wrap: pretty; }
.page-schedule .head .info:hover .tip,
.page-schedule .head .info:focus .tip,
.page-schedule .head .info:focus-within .tip { opacity: 1; visibility: visible; transform: none; }
.page-schedule .head .info .tip::before { content: ""; position: absolute; left: 12px; top: -5px; width: 10px; height: 10px; background: var(--ink); transform: rotate(45deg); }

.page-schedule .btn {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700;
  padding: 10px 15px; border-radius: 11px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .2s ease, border-color .15s ease, color .15s ease;
}
.page-schedule .btn svg { width: 16px; height: 16px; }
.page-schedule .btn:hover { color: var(--ink); border-color: #d8d4e4; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.page-schedule .btn:active { transform: scale(.97); }
.page-schedule .btn-primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(124,58,237,.5); }
.page-schedule .btn-primary:hover { color: #fff; border-color: transparent; box-shadow: 0 12px 26px -8px rgba(124,58,237,.6); }

/* toolbar */
.page-schedule .toolbar { display: flex; align-items: center; gap: 12px; margin: 20px 0 14px; flex-wrap: wrap; }
.page-schedule .seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 11px; padding: 4px; gap: 3px; box-shadow: var(--shadow-sm); }
.page-schedule .seg button { font-size: 13.5px; font-weight: 700; color: var(--ink-faint); background: none; border: 0; cursor: pointer; padding: 7px 15px; border-radius: 8px; transition: color .15s ease, background .15s ease; }
.page-schedule .seg button:hover:not(.on) { color: var(--ink); }
.page-schedule .seg button.on { color: #fff; background: var(--blue); box-shadow: 0 2px 6px -2px rgba(37,99,235,.5); }
/* Icon-only mode toggle (Timeline / Board / Calendar) - tighter than the text seg to free up width. */
.page-schedule .seg-icons button { padding: 7px 12px; display: grid; place-items: center; }
.page-schedule .seg-icons button svg { width: 17px; height: 17px; display: block; }

/* 8px gap between the 38px prev/next icon buttons keeps adjacent targets from crowding (WCAG 2.5.8). */
.page-schedule .nav-range { display: inline-flex; align-items: center; gap: 8px; }
/* icon colour is --ink-soft (#4a4658, ~5.9:1 on #fff) not --ink-faint, so the thin glyph strokes clear WCAG 1.4.3 AA. */
.page-schedule .icon-btn { width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); box-shadow: var(--shadow-sm); transition: color .14s ease, border-color .14s ease, transform .12s ease, background .14s ease; }
.page-schedule .icon-btn:hover { color: var(--ink); border-color: #d8d4e4; transform: translateY(-1px); }
.page-schedule .icon-btn:active { transform: scale(.94); }
.page-schedule .icon-btn svg { width: 18px; height: 18px; }
.page-schedule .range-label { font-size: 14px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; padding: 0 8px; min-width: 188px; text-align: center; }

.page-schedule .spacer { flex: 1; }

.page-schedule .tray-toggle { display: inline-flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); cursor: pointer; padding: 9px 14px; border-radius: 11px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); transition: color .14s ease, border-color .14s ease, background .14s ease; }
.page-schedule .tray-toggle:hover { color: var(--ink); border-color: #d8d4e4; }
.page-schedule .tray-toggle.on { background: var(--blue-soft); color: var(--blue); border-color: #cfe0fb; }
.page-schedule .tray-toggle svg { width: 17px; height: 17px; }
.page-schedule .tray-toggle .ct { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.page-schedule .tray-toggle.on .ct { background: var(--blue); }

/* ============================================================
   Planner
   ============================================================ */
.page-schedule .planner { flex: 1; min-height: 0; display: flex; gap: 16px; }
.page-schedule .board { flex: 1; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; overflow: hidden; }

.page-schedule .timeline { flex: 1; min-height: 0; overflow: auto; position: relative; scrollbar-width: thin; }
.page-schedule .timeline::-webkit-scrollbar { height: 11px; width: 11px; }
.page-schedule .timeline::-webkit-scrollbar-thumb { background: #d9d6e2; border-radius: 999px; border: 3px solid #fff; }
.page-schedule .timeline::-webkit-scrollbar-thumb:hover { background: #c7c3d4; }

/* date header */
.page-schedule .tl-head { position: sticky; top: 0; z-index: 20; display: flex; background: rgba(255,255,255,.86); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.page-schedule .tl-corner { position: sticky; left: 0; z-index: 21; width: var(--labelW); flex: none; background: rgba(255,255,255,.92); border-right: 1px solid var(--line); display: flex; align-items: center; padding: 0 18px; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-mute); }
.page-schedule .tl-days { display: flex; }
.page-schedule .dcell { flex: none; border-right: 1px solid var(--line-soft); padding: 9px 0 8px; text-align: center; position: relative; }
.page-schedule .dcell .dow { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-mute); }
.page-schedule .dcell .dnum { font-size: 14px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; margin-top: 1px; }
.page-schedule .dcell.mfirst::before { content: attr(data-month); position: absolute; top: 4px; left: 7px; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
.page-schedule .dcell.weekend { background: #faf9fc; }
.page-schedule .dcell.today { background: var(--blue-soft); }
.page-schedule .dcell.today .dow, .page-schedule .dcell.today .dnum { color: var(--blue); }
.page-schedule .dcell.today .dnum { font-weight: 800; }
/* Non-colour marker so "today" is distinguishable without relying on the blue tint alone (WCAG 1.4.1). */
.page-schedule .dcell.today::after { content: "TODAY"; display: block; margin-top: 2px; font-size: 8px; font-weight: 800; letter-spacing: .08em; color: var(--blue); }

/* lanes */
.page-schedule .tl-body { position: relative; }
.page-schedule .lane { display: flex; border-bottom: 1px solid var(--line-soft); position: relative; transition: background .15s ease; }
.page-schedule .lane:last-child { border-bottom: 0; }
/* Drop-target signals validity with a non-colour cue too (inset ring, not just the tint) so
   achromatopsia / colour-blind users can see the zone (WCAG 1.4.1). box-shadow avoids the
   layout shift a border would cause on the flex lane. */
.page-schedule .lane.drop-target { background: rgba(37,99,235,.05); box-shadow: inset 0 0 0 2px var(--blue); }
.page-schedule .lane.unassigned { background: #fbfafc; }
.page-schedule .lane.unassigned.drop-target { background: rgba(37,99,235,.06); box-shadow: inset 0 0 0 2px var(--blue); }

.page-schedule .lane-label { position: sticky; left: 0; z-index: 10; width: var(--labelW); flex: none; background: inherit; border-right: 1px solid var(--line); padding: 13px 16px; display: flex; align-items: flex-start; gap: 11px; }
.page-schedule .lane.unassigned .lane-label,
.page-schedule .lane .lane-label { background: var(--card); }
.page-schedule .lane.unassigned .lane-label { background: #fbfafc; }
.page-schedule .lane-label .pa { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; flex: none; color: #fff; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); }
/* dashed border #8b879b is ~3.5:1 on #fff so the unassigned avatar reads as a real UI element (WCAG 1.4.11). */
.page-schedule .lane-label .pa.dashed { background: #fff; color: var(--ink-mute); border: 1.5px dashed #8b879b; box-shadow: none; }
.page-schedule .lane-label .pinfo { min-width: 0; flex: 1; }
.page-schedule .lane-label .pn { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-schedule .lane-label .load { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.page-schedule .lane-label .loadbar { flex: 1; height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; max-width: 92px; }
.page-schedule .lane-label .loadbar > i { display: block; height: 100%; border-radius: 999px; transition: width .3s var(--ease), background .3s ease; }
.page-schedule .lane-label .loadtxt { font-size: 11px; font-weight: 700; white-space: nowrap; }
.page-schedule .lane-label .pn-sub { font-size: 11.5px; font-weight: 600; color: var(--ink-mute); }

.page-schedule .lane-track { position: relative; flex: 1; min-height: 64px; }
.page-schedule .daycols { position: absolute; inset: 0; display: flex; pointer-events: none; }
.page-schedule .daycols > i { flex: none; border-right: 1px solid var(--line-soft); }
.page-schedule .daycols > i.weekend { background: #faf9fc; }
.page-schedule .daycols > i.today { background: rgba(37,99,235,.045); }

/* today line */
.page-schedule .nowline { position: absolute; top: 0; bottom: 0; width: 2px; background: linear-gradient(var(--blue), rgba(37,99,235,.25)); z-index: 8; pointer-events: none; }
.page-schedule .nowline::before { content: ""; position: absolute; top: -1px; left: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }

/* block */
.page-schedule .block { position: absolute; height: 46px; border-radius: 11px; padding: 7px 11px; cursor: grab; overflow: hidden; user-select: none; z-index: 5; display: flex; flex-direction: column; justify-content: center; gap: 3px; background: var(--bk-bg, #eaf0fd); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--bk-line, rgba(37,99,235,.16)); transition: box-shadow .18s ease, transform .12s var(--spring); touch-action: none; }
.page-schedule .block::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3.5px; background: var(--bk-accent, #2563eb); }
.page-schedule .block:hover { box-shadow: var(--shadow-md), inset 0 0 0 1px var(--bk-line, rgba(37,99,235,.28)); }
.page-schedule .block .bt { font-size: 13px; font-weight: 700; color: var(--bk-ink, #1e3a8a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.15; }
.page-schedule .block .bm { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--bk-ink, #1e3a8a); opacity: .72; white-space: nowrap; overflow: hidden; }
.page-schedule .block .bm .bdot { width: 5px; height: 5px; border-radius: 50%; background: var(--bk-accent, #2563eb); flex: none; }
.page-schedule .block .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0,0,0,.06); }
.page-schedule .block .prog > i { display: block; height: 100%; background: var(--bk-accent, #2563eb); opacity: .85; transition: width .3s var(--ease); }
.page-schedule .block.conflict { box-shadow: var(--shadow-sm), inset 0 0 0 1.5px var(--amber); }
.page-schedule .block.dragging { cursor: grabbing; z-index: 30; box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--bk-line, rgba(37,99,235,.3)); transform: scale(1.015); transition: none; }
/* Hit area is >=24px wide (WCAG 2.5.8); the visible grip stays 3px via ::after,
   pinned to the block edge (left/right:3px) so widening inward leaves it in place. */
.page-schedule .block .rz { position: absolute; top: 0; bottom: 0; width: 24px; cursor: ew-resize; z-index: 6; }
.page-schedule .block .rz.l { left: 0; }
.page-schedule .block .rz.r { right: 0; }
.page-schedule .block .rz::after { content: ""; position: absolute; top: 50%; width: 3px; height: 16px; border-radius: 999px; background: var(--bk-accent,#2563eb); opacity: 0; transform: translateY(-50%); transition: opacity .14s ease; }
.page-schedule .block .rz.l::after { left: 3px; }
.page-schedule .block .rz.r::after { right: 3px; }
.page-schedule .block:hover .rz::after { opacity: .35; }
.page-schedule .block.compact { padding: 5px 8px; height: 38px; }
.page-schedule .block.compact .bm { display: none; }
.page-schedule .block.tiny { padding: 0; }
.page-schedule .block.tiny .bt,
.page-schedule .block.tiny .bm,
.page-schedule .block.tiny .prog { display: none; }
.page-schedule .block.tiny::after { content: ""; position: absolute; inset: 6px 5px; border-radius: 5px; background: var(--bk-accent,#2563eb); opacity: .55; }

/* create ghost */
.page-schedule .ghost { position: absolute; height: 46px; border-radius: 11px; background: rgba(37,99,235,.12); border: 1.5px dashed var(--blue); z-index: 7; pointer-events: none; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--blue); }

/* conflict chip on lane */
.page-schedule .lane-flag { position: absolute; right: 12px; top: 9px; z-index: 9; display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--amber-soft); color: var(--amber); pointer-events: none; box-shadow: var(--shadow-sm); }
.page-schedule .lane-flag svg { width: 12px; height: 12px; }

/* ============================================================
   Backlog tray
   ============================================================ */
.page-schedule .tray { width: 296px; flex: none; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; overflow: hidden; transition: width .28s var(--ease), opacity .2s ease; }
.page-schedule .tray.hidden { width: 0; border: 0; opacity: 0; pointer-events: none; }
.page-schedule .tray-head { padding: 16px 18px 12px; border-bottom: 1px solid var(--line-soft); }
.page-schedule .tray-head .tt { display: flex; align-items: center; gap: 9px; }
.page-schedule .tray-head .tt h3 { font-size: 15px; font-weight: 800; }
.page-schedule .tray-head .tt .ct { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--line-soft); color: var(--ink-faint); font-size: 11.5px; font-weight: 800; display: grid; place-items: center; }
.page-schedule .tray-head .th { margin-top: 5px; font-size: 12px; font-weight: 600; color: var(--ink-mute); line-height: 1.4; }
.page-schedule .tray-list { padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 9px; flex: 1; scrollbar-width: thin; }
.page-schedule .tcard { border-radius: 12px; padding: 11px 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-sm); cursor: grab; position: relative; transition: transform .14s var(--spring), box-shadow .18s ease, border-color .14s ease; touch-action: none; }
.page-schedule .tcard::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3.5px; border-radius: 999px; background: var(--tc, #2563eb); }
.page-schedule .tcard:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); border-color: #d8d4e4; }
.page-schedule .tcard.dragging { opacity: .35; }
/* Flash newly-added cards (e.g. from a template) so the user sees where they landed. */
@keyframes sv-tcard-in { 0%, 55% { box-shadow: 0 0 0 2px var(--blue); background: var(--blue-soft); } 100% { box-shadow: var(--shadow-sm); background: #fff; } }
.page-schedule .tcard.justadded { animation: sv-tcard-in 1.9s ease; }
.page-schedule .tcard .tct { font-size: 13.5px; font-weight: 700; color: var(--ink); padding-left: 8px; line-height: 1.25; }
.page-schedule .tcard .tcm { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-left: 8px; font-size: 11.5px; font-weight: 600; color: var(--ink-mute); }
.page-schedule .tcard .tcm .pj { display: inline-flex; align-items: center; gap: 5px; }
.page-schedule .tcard .tcm .pj i { width: 7px; height: 7px; border-radius: 2px; background: var(--tc, #2563eb); }
.page-schedule .tcard .tcm .est { margin-left: auto; padding: 2px 7px; border-radius: 999px; background: var(--line-soft); color: var(--ink-faint); font-weight: 700; }
.page-schedule .tray-empty { text-align: center; padding: 40px 18px; color: var(--ink-mute); }
.page-schedule .tray-empty svg { width: 34px; height: 34px; color: var(--ok); margin-bottom: 10px; }
.page-schedule .tray-empty .te-t { font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.page-schedule .tray-empty .te-s { font-size: 12.5px; font-weight: 600; margin-top: 3px; }

/* floating drag clone */
.page-schedule .flyer { position: fixed; z-index: 9999; pointer-events: none; width: 240px; border-radius: 12px; padding: 11px 12px; background: #fff; box-shadow: var(--shadow-lg); border: 1px solid var(--line); transform: rotate(-1.5deg); }
.page-schedule .flyer::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3.5px; border-radius: 999px; background: var(--tc,#2563eb); }
.page-schedule .flyer .tct { font-size: 13.5px; font-weight: 700; padding-left: 8px; }

/* ============================================================
   Hint strip
   ============================================================ */
.page-schedule .hint { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--ink-mute); padding: 9px 18px; border-top: 1px solid var(--line-soft); background: #fcfbfd; flex-wrap: wrap; }
.page-schedule .hint .k { font-size: 11px; font-weight: 700; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 6px; }
.page-schedule .hint .sep { width: 1px; height: 13px; background: var(--line); margin: 0 4px; }

/* block: play button + tracked-time + subtask count */
.page-schedule .block .play { position: absolute; right: 7px; top: 50%; transform: translateY(-50%) scale(.8); width: 24px; height: 24px; border-radius: 999px; border: 0; background: var(--bk-accent,#2563eb); color: #fff; display: grid; place-items: center; cursor: pointer; opacity: 0; z-index: 7; box-shadow: var(--shadow-sm); transition: opacity .14s ease, transform .14s var(--spring), background .14s ease; }
.page-schedule .block:hover .play,
.page-schedule .block:focus-within .play,
.page-schedule .block .play:focus-visible { opacity: 1; transform: translateY(-50%) scale(1); }
.page-schedule .block .play svg { width: 12px; height: 12px; margin-left: 1px; }
.page-schedule .block.running .play { opacity: 1; transform: translateY(-50%) scale(1); background: #ff5a5f; }
.page-schedule .block.running .play svg { margin-left: 0; }
.page-schedule .block.running::after { content: ""; position: absolute; right: 9px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: #ff5a5f; box-shadow: 0 0 0 3px rgba(255,90,95,.18); }
.page-schedule .block .bm .tt-time { display: inline-flex; align-items: center; gap: 4px; }
.page-schedule .block .bm .tt-time.live { color: #d92d33; opacity: 1; font-weight: 800; font-variant-numeric: tabular-nums; }
.page-schedule .block .bm .subc { display: inline-flex; align-items: center; gap: 4px; }
.page-schedule .block .bm .subc svg { width: 11px; height: 11px; }

/* ============================================================
   Tray quick-add (Reminders style)
   ============================================================ */
.page-schedule .quick { padding: 11px 12px 9px; border-bottom: 1px solid var(--line-soft); }
.page-schedule .quick-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 12px; border: 1px solid var(--line); background: #fff; transition: border-color .15s ease, box-shadow .15s ease; }
.page-schedule .quick-row:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.page-schedule .quick-row .qdot { width: 18px; height: 18px; border-radius: 999px; border: 2px solid var(--qc, #cfcbdb); flex: none; cursor: pointer; position: relative; transition: border-color .15s ease; }
.page-schedule .quick-row .qdot::after { content: ""; position: absolute; inset: 3px; border-radius: 999px; background: var(--qc, transparent); opacity: 0; transition: opacity .15s ease; }
.page-schedule .quick-row.has-pj .qdot::after { opacity: 1; }
.page-schedule .quick-row input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); background: none; }
.page-schedule .quick-row input::placeholder { color: var(--ink-mute); font-weight: 500; }
.page-schedule .quick-row .qest { font-size: 11px; font-weight: 800; color: var(--ink-mute); background: var(--line-soft); border-radius: 999px; padding: 3px 8px; cursor: pointer; user-select: none; white-space: nowrap; }
/* Stacked: the project dropdown stretches full width, the "Enter to add" hint sits on the line below. */
.page-schedule .quick-meta { display: flex; flex-direction: column; align-items: stretch; gap: 7px; margin: 9px 2px 1px; }
.page-schedule .quick-meta .qm-pj { display: flex; align-items: center; gap: 7px; width: 100%; text-align: left; font-size: 12px; font-weight: 700; color: var(--ink-faint); padding: 7px 11px; border-radius: 11px; border: 1px solid var(--line); background: #fff; cursor: pointer; transition: border-color .14s ease, background .14s ease; }
.page-schedule .quick-meta .qm-pj:hover { border-color: #d8d4e4; background: var(--line-soft); }
.page-schedule .quick-meta .qm-pj i { width: 9px; height: 9px; border-radius: 3px; flex: none; background: var(--qc,#2563eb); }
.page-schedule .quick-meta .qm-pj span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-schedule .quick-meta .qm-pj svg { width: 13px; height: 13px; flex: none; opacity: .5; }
.page-schedule .quick-meta .qm-hint { font-size: 11px; font-weight: 600; color: var(--ink-mute); display: flex; align-items: center; gap: 5px; padding-left: 2px; }
.page-schedule .quick-meta .qm-hint .k { font-size: 10px; font-weight: 700; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 5px; }

/* suggestions */
.page-schedule .sugg { border-bottom: 1px solid var(--line-soft); }
.page-schedule .sugg-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px 10px; cursor: pointer; user-select: none; }
.page-schedule .sugg-head svg.lb { width: 15px; height: 15px; color: var(--amber); }
.page-schedule .sugg-head .sh-t { font-size: 12px; font-weight: 800; letter-spacing: .02em; color: var(--ink-soft); flex: 1; }
.page-schedule .sugg-head .chev2 { width: 16px; height: 16px; color: var(--ink-mute); transition: transform .22s var(--ease); }
.page-schedule .sugg.collapsed .chev2 { transform: rotate(-90deg); }
.page-schedule .sugg-body { padding: 0 12px 12px; overflow: hidden; transition: max-height .28s var(--ease), opacity .2s ease, padding .28s var(--ease); max-height: 420px; }
.page-schedule .sugg.collapsed .sugg-body { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; }
.page-schedule .sugg-cat { font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-mute); margin: 8px 2px 7px; }
.page-schedule .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.page-schedule .chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px 5px 9px; cursor: pointer; transition: transform .12s var(--spring), border-color .14s ease, color .14s ease, background .14s ease; }
.page-schedule .chip:hover { border-color: #c9d8fb; background: var(--blue-soft); color: var(--blue); transform: translateY(-1px); }
.page-schedule .chip:active { transform: scale(.95); }
.page-schedule .chip .plus { width: 13px; height: 13px; color: currentColor; opacity: .6; }
.page-schedule .chip.added { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); pointer-events: none; }

/* tray card: tracked time + subtask badge */
.page-schedule .tcard .tcm .est.tracked { background: var(--ink); color: #fff; }

/* ============================================================
   Template picker + backlog subtasks
   ============================================================ */
.page-schedule .tpl { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 10px 11px; cursor: pointer; margin-bottom: 8px; box-shadow: var(--shadow-sm); transition: transform .12s var(--spring), border-color .14s ease, box-shadow .18s ease; }
.page-schedule .tpl:last-child { margin-bottom: 0; }
.page-schedule .tpl:hover { border-color: #d8d4e4; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.page-schedule .tpl:active { transform: scale(.99); }
.page-schedule .tpl.added { border-color: var(--ok); background: var(--ok-soft); }
.page-schedule .tpl .ti { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: var(--shadow-sm); }
.page-schedule .tpl .ti svg { width: 18px; height: 18px; }
.page-schedule .tpl .tinfo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.page-schedule .tpl .tnm { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.page-schedule .tpl .tct { font-size: 11.5px; font-weight: 600; color: var(--ink-mute); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-schedule .tpl .tadd { width: 26px; height: 26px; border-radius: 8px; background: var(--line-soft); color: var(--ink-faint); display: grid; place-items: center; flex: none; transition: background .14s ease, color .14s ease; }
.page-schedule .tpl:hover .tadd { background: var(--blue); color: #fff; }
.page-schedule .tpl .tadd svg { width: 15px; height: 15px; }
.page-schedule .tcm-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.page-schedule .tcm-right .est { margin-left: 0; }
/* "from <quick list>" chip on an unscheduled tray card created from a template. */
.page-schedule .tcard .tsrc { font-size: 10px; font-weight: 700; color: var(--ink-faint); background: var(--line-soft); border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.page-schedule .subck { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 800; color: var(--ink-faint); background: var(--line-soft); border-radius: 999px; padding: 2px 8px; }
.page-schedule .subck svg { width: 11px; height: 11px; }

/* ============================================================
   Month band header (fixes month/day overlap)
   ============================================================ */
.page-schedule .tl-headcols { display: flex; flex-direction: column; min-width: 0; }
.page-schedule .tl-months { display: flex; height: 20px; border-bottom: 1px solid var(--line-soft); }
.page-schedule .tl-months > i { font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--blue); padding: 4px 0 0 9px; border-right: 1px solid var(--line-soft); white-space: nowrap; overflow: hidden; flex: none; }

/* ============================================================
   Private (only-me) tasks
   ============================================================ */
.page-schedule .block .lock { flex: none; margin-right: 4px; opacity: .65; vertical-align: -1px; }
.page-schedule .vis-toggle { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 11px 13px; cursor: pointer; font: inherit; transition: border-color .14s ease; }
.page-schedule .vis-toggle:hover { border-color: #d8d4e4; }
.page-schedule .vis-toggle .vt-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--line-soft); color: var(--ink-faint); display: grid; place-items: center; flex: none; transition: background .16s ease, color .16s ease; }
.page-schedule .vis-toggle.on .vt-ic { background: var(--ink); color: #fff; }
.page-schedule .vis-toggle .vt-ic svg { width: 17px; height: 17px; }
.page-schedule .vis-toggle .vt-tx { flex: 1; }
.page-schedule .vis-toggle .vt-tx b { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.page-schedule .vis-toggle .vt-tx i { display: block; font-size: 11.5px; font-weight: 500; font-style: normal; color: var(--ink-mute); margin-top: 1px; }
.page-schedule .vis-toggle .vt-sw { width: 40px; height: 23px; border-radius: 999px; background: #d9d6e2; position: relative; flex: none; transition: background .18s ease; }
.page-schedule .vis-toggle.on .vt-sw { background: var(--blue); }
.page-schedule .vis-toggle .vt-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left .18s var(--spring); }
.page-schedule .vis-toggle.on .vt-sw::after { left: 19px; }

/* ============================================================
   Mobile (phone) layout
   ============================================================ */
.page-schedule .mobile-view { display: none; }
.page-schedule .m-tools { display: flex; align-items: center; gap: 9px; margin: 4px 0 14px; }
.page-schedule .m-quick { display: flex; align-items: center; gap: 10px; padding: 12px 13px; border-radius: 13px; border: 1px solid var(--line); background: #fff; box-shadow: var(--shadow-sm); margin-bottom: 12px; }
.page-schedule .m-quick:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.page-schedule .m-quick .qdot { width: 20px; height: 20px; border-radius: 999px; border: 2px solid var(--qc,#cfcbdb); flex: none; position: relative; }
.page-schedule .m-quick .qdot::after { content: ""; position: absolute; inset: 3px; border-radius: 999px; background: var(--qc,transparent); }
.page-schedule .m-quick input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16px; font-weight: 600; color: var(--ink); background: none; }
.page-schedule .m-filters { display: flex; gap: 8px; }
.page-schedule .m-chip { font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-faint); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 15px; cursor: pointer; }
.page-schedule .m-chip.on { background: var(--blue); color: #fff; border-color: transparent; }
.page-schedule .m-group { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mute); margin: 20px 2px 11px; display: flex; align-items: center; gap: 9px; }
.page-schedule .m-group span { font-size: 11px; font-weight: 800; color: var(--ink-faint); background: var(--line-soft); border-radius: 999px; min-width: 19px; height: 19px; padding: 0 6px; display: grid; place-items: center; }
.page-schedule .m-group.today { color: var(--blue); }
.page-schedule .mcard { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 14px 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.page-schedule .mcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--mc,#2563eb); }
.page-schedule .mcard .mc-main { flex: 1; min-width: 0; }
.page-schedule .mcard .mc-pj { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--mc,#2563eb); }
.page-schedule .mcard .mc-pj .lk { color: var(--ink-mute); margin-left: 2px; }
.page-schedule .mcard .mc-t { font-size: 16.5px; font-weight: 700; color: var(--ink); margin-top: 5px; line-height: 1.25; letter-spacing: -0.01em; }
.page-schedule .mcard .mc-meta { font-size: 12.5px; font-weight: 600; color: var(--ink-mute); margin-top: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.page-schedule .mcard .mc-meta .live { color: #d92d33; font-weight: 800; font-variant-numeric: tabular-nums; }
.page-schedule .mcard .mc-bar { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 9px; }
.page-schedule .mcard .mc-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--mc,#2563eb); }
.page-schedule .mcard .mc-side { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 10px; flex: none; }
.page-schedule .mcard .mc-play { width: 46px; height: 46px; border-radius: 999px; border: 0; background: var(--mc,#2563eb); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.page-schedule .mcard .mc-play svg { width: 18px; height: 18px; margin-left: 2px; }
.page-schedule .mcard .mc-play.on { background: #ff5a5f; }
.page-schedule .mcard .mc-play.on svg { margin-left: 0; }
.page-schedule .mcard .mc-av { width: 28px; height: 28px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 700; flex: none; }
.page-schedule .mcard .mc-av.dashed { background: #fff; color: var(--ink-mute); border: 1.5px dashed #8b879b; }
.page-schedule .mcard.backlog { border-style: dashed; }
.page-schedule .mcard.backlog .mc-play { background: var(--line-soft); color: var(--ink-faint); }
.page-schedule .m-modebar { display: none; }

/* ===========================================================================
   Mobile (phone <=640px). Ported 1:1 from the Claude-design prototype, with two
   adaptations: every in-page selector is scoped to .page-schedule (the SPA reuses
   .head/.toolbar elsewhere), and the page-shell rules target production's own
   .page-schedule wrapper instead of the prototype's standalone .app/main grid.
   Bars + sheets are desktop-hidden; the floating Google nudge is shared.
   =========================================================================== */
.page-schedule .m-bar, .page-schedule .m-sub { display: none; }   /* slim mobile bars: phone only */
.m-sheet, .m-scrim, .page-schedule .tray .m-tray-x { display: none; }   /* bottom-sheet machinery: phone only */
.page-schedule #startTimerBtn .st-ic { display: none; }   /* the compact clock glyph only appears on phones (where the label is hidden) */

/* Floating "connect your calendar" nudge (shared desktop + mobile; shown only when not connected) */
.gcal-banner { position: fixed; right: 26px; bottom: 24px; width: 344px; max-width: calc(100vw - 32px); background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 17px 18px 15px; z-index: 180; transform: translateY(16px) scale(.98); opacity: 0; visibility: hidden; transition: transform .34s var(--spring), opacity .24s ease, visibility .24s ease; }
.gcal-banner.show { transform: none; opacity: 1; visibility: visible; }
.gcal-banner .gb-top { display: flex; align-items: flex-start; gap: 12px; }
.gcal-banner .gb-ic { width: 38px; height: 38px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; flex: none; }
.gcal-banner .gb-ic svg { width: 20px; height: 20px; }
.gcal-banner .gb-h { flex: 1; min-width: 0; }
.gcal-banner .gb-h b { display: block; font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.gcal-banner .gb-h p { font-size: 12.5px; font-weight: 500; color: var(--ink-mute); margin-top: 3px; line-height: 1.45; text-wrap: pretty; }
.gcal-banner .gb-x { width: 26px; height: 26px; border-radius: 8px; border: 0; background: none; color: var(--ink-mute); display: grid; place-items: center; cursor: pointer; flex: none; margin: -3px -4px 0 0; }
.gcal-banner .gb-x:hover { background: var(--line-soft); color: var(--ink); }
.gcal-banner .gb-x svg { width: 16px; height: 16px; }
.gcal-banner .gb-foot { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.gcal-banner .gb-foot .grow { flex: 1; }
.gcal-banner .gb-later { font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-faint); background: none; border: 0; padding: 8px 10px; border-radius: 9px; cursor: pointer; }
.gcal-banner .gb-later:hover { color: var(--ink); background: var(--line-soft); }
.gcal-banner .gb-connect { font: inherit; font-size: 13px; font-weight: 700; color: #fff; background: var(--grad); border: 0; border-radius: 10px; padding: 9px 16px; cursor: pointer; box-shadow: 0 6px 16px -6px rgba(124,58,237,.5); display: inline-flex; align-items: center; gap: 7px; }
.gcal-banner .gb-connect:hover { box-shadow: 0 12px 26px -8px rgba(124,58,237,.6); }

@media (max-width: 640px) {
  /* --- Page shell on a phone --- */
  .page-schedule { padding: 18px 15px 116px; height: auto; min-height: 100vh; overflow: visible; }
  .page-schedule .head { align-items: center; gap: 12px; }
  .page-schedule .head h1 { font-size: 22px; }
  .page-schedule .head .sub { display: none; }
  .page-schedule .head .head-actions { gap: 8px; flex: none; }

  /* --- Header CTAs collapse to compact icon buttons --- */
  .page-schedule #startTimerBtn { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 13px; }
  .page-schedule #startTimerBtn .st-lab, .page-schedule #startTimerBtn .st-dot { display: none; }
  .page-schedule #startTimerBtn .st-ic { display: block; width: 20px; height: 20px; }
  .page-schedule #newBlock { width: 44px; height: 44px; padding: 0; justify-content: center; border-radius: 13px; }
  .page-schedule #newBlock .nb-lab { display: none; }
  .page-schedule #newBlock svg { width: 21px; height: 21px; }

  /* --- Slim control bar replaces the desktop toolbar --- */
  .page-schedule .toolbar { display: none !important; }
  .page-schedule .m-modebar { display: none !important; }

  .page-schedule .m-bar { display: flex; align-items: center; gap: 10px; margin: 16px 0 11px; }
  .page-schedule .m-seg { flex: 1; display: flex; gap: 3px; background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 4px; box-shadow: var(--shadow-sm); }
  .page-schedule .m-seg button { flex: 1; display: grid; place-items: center; height: 38px; border: 0; background: none; border-radius: 9px; color: var(--ink-mute); cursor: pointer; transition: background .15s ease, color .15s ease; }
  .page-schedule .m-seg button svg { width: 19px; height: 19px; }
  .page-schedule .m-seg button.on { background: var(--blue); color: #fff; box-shadow: 0 2px 6px -2px rgba(37,99,235,.5); }
  .page-schedule .m-iconbtn { width: 46px; height: 46px; flex: none; border: 1px solid var(--line); background: #fff; border-radius: 13px; display: grid; place-items: center; color: var(--ink-faint); box-shadow: var(--shadow-sm); cursor: pointer; }
  .page-schedule .m-iconbtn svg { width: 20px; height: 20px; }
  .page-schedule .m-iconbtn:active { transform: scale(.95); }

  .page-schedule .m-sub { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 15px; }
  .page-schedule .m-today { display: none; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; box-shadow: var(--shadow-sm); align-items: center; gap: 6px; flex: none; }
  .page-schedule .m-today svg { width: 15px; height: 15px; }
  .page-schedule .m-nav { display: none; align-items: center; gap: 2px; flex: 1; justify-content: center; min-width: 0; }
  .page-schedule .m-navbtn { width: 34px; height: 34px; flex: none; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; color: var(--ink-faint); cursor: pointer; box-shadow: var(--shadow-sm); }
  .page-schedule .m-navbtn svg { width: 16px; height: 16px; }
  .page-schedule .m-range { font-size: 12.5px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; text-align: center; min-width: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
  .page-schedule .m-unsched { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 13px; font-weight: 700; color: var(--blue); background: var(--blue-soft); border: 1px solid #cfe0fb; border-radius: 11px; padding: 9px 13px; cursor: pointer; flex: none; }
  .page-schedule .m-unsched svg { width: 16px; height: 16px; }
  .page-schedule .m-unsched b { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
  body.m-grid .page-schedule .m-today { display: inline-flex; }
  body.m-grid .page-schedule .m-nav { display: flex; }

  /* --- View containers: list (cards) by default, grids when m-grid is set --- */
  .page-schedule .planner { display: flex; }
  .page-schedule .board { display: none; }
  body.m-grid .page-schedule .board { display: flex; }
  .page-schedule .mobile-view { display: block; }
  body.m-grid .page-schedule .mobile-view { display: none; }
  body.m-grid .page-schedule { height: 100dvh; min-height: 0; overflow: hidden; padding-bottom: 14px; }

  /* --- Shared sheet scrim --- */
  .m-scrim { display: block; position: fixed; inset: 0; background: rgba(18,15,28,.42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 265; opacity: 0; visibility: hidden; transition: opacity .26s ease, visibility .26s ease; }
  .m-scrim.show { opacity: 1; visibility: visible; }

  /* --- Unscheduled sheet = the existing .tray, re-housed as a bottom sheet --- */
  .page-schedule .tray { position: fixed !important; left: 0; right: 0; bottom: 0; top: auto; width: auto; height: 86dvh; max-height: 86dvh; margin: 0; z-index: 270; display: flex !important; border: 0; border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg); transform: translateY(103%); transition: transform .34s var(--ease); }
  body.tray-sheet .page-schedule .tray { transform: none; }
  body:not(.tray-sheet) .page-schedule .tray { pointer-events: none; }
  .page-schedule .tray > .m-tray-x { display: grid; position: absolute; top: 16px; right: 16px; z-index: 6; }

  /* --- Menu / settings sheet (filters, Google Calendar, display, export) --- */
  .m-sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 88dvh; z-index: 270; background: var(--card); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-lg); transform: translateY(103%); transition: transform .34s var(--ease); display: flex; flex-direction: column; overflow: hidden; }
  body.menu-sheet .m-sheet { transform: none; }
  .m-sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 16px 13px; border-bottom: 1px solid var(--line-soft); flex: none; }
  .m-sheet-head h3 { font-size: 17px; font-weight: 800; flex: 1; }
  .m-sheet-x { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-faint); display: grid; place-items: center; cursor: pointer; flex: none; }
  .m-sheet-x svg { width: 17px; height: 17px; }
  .m-sheet-body { overflow-y: auto; padding: 4px 14px 30px; -webkit-overflow-scrolling: touch; }
  .m-sec { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); padding: 17px 6px 7px; }
  .m-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; background: none; font: inherit; padding: 11px 8px; border-radius: 12px; cursor: pointer; }
  .m-row:active { background: var(--line-soft); }
  .m-rl { flex: 1; min-width: 0; }
  .m-rt { display: block; font-size: 14px; font-weight: 700; color: var(--ink); }
  .m-rh { display: block; font-size: 12px; font-weight: 500; color: var(--ink-mute); margin-top: 1px; }
  .m-sw { width: 44px; height: 26px; border-radius: 999px; flex: none; position: relative; transition: background .18s ease; background: #d9d6e2; }
  .m-sw.on { background: var(--blue); }
  .m-sw i { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left .18s var(--spring); }
  .m-sw.on i { left: 20px; }
  .m-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 6px 6px; }
  .m-fchip { font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-faint); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
  .m-fchip i { width: 9px; height: 9px; border-radius: 3px; }
  .m-fchip.on { background: var(--ink); color: #fff; border-color: transparent; }
  .m-gcal { background: var(--line-soft); border-radius: 16px; padding: 5px 6px 7px; margin: 2px 0; }
  .m-gconn { display: flex; align-items: center; gap: 11px; padding: 10px 8px 11px; }
  .m-gconn .g-ic { width: 36px; height: 36px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex: none; box-shadow: var(--shadow-sm); }
  .m-gconn .g-tx { flex: 1; min-width: 0; }
  .m-gconn .g-nm { font-size: 13.5px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 7px; }
  .m-gconn .g-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); flex: none; box-shadow: 0 0 0 3px var(--ok-soft); }
  .m-gconn .g-st { font-size: 12px; font-weight: 600; color: var(--ink-mute); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .m-gsync { font: inherit; font-size: 12.5px; font-weight: 700; color: var(--blue); background: #fff; border: 1px solid #cfe0fb; border-radius: 10px; padding: 8px 12px; cursor: pointer; flex: none; }
  .m-gsync:active { background: var(--blue-soft); }
  .m-gsync.spin { color: var(--ink-mute); pointer-events: none; }
  .m-gcal .m-divx { height: 1px; background: rgba(21,19,28,.06); margin: 2px 8px; }
  .m-actrow { display: flex; gap: 9px; padding: 4px 6px; }
  .m-actrow button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 0; cursor: pointer; }
  .m-actrow button svg { width: 16px; height: 16px; }
  .m-actrow button:active { background: var(--line-soft); }

  /* --- Floating nudge spans the bottom; hidden while a sheet is open --- */
  .gcal-banner { right: 12px; left: 12px; bottom: 12px; width: auto; max-width: none; }
  body.tray-sheet .gcal-banner, body.menu-sheet .gcal-banner { opacity: 0; visibility: hidden; }

  /* --- Focus overlay tidy --- */
  .focus-actions { flex-wrap: wrap; }
  .focus-actions .btn { flex: 1 1 auto; justify-content: center; }

  /* --- Mobile Stage 1: touch foundation --- */
  /* Every field is >=16px so iOS never auto-zooms the page when you tap into it. */
  .page-schedule .quick-row input,
  .scrim .modal .field input[type=text],
  .scrim .modal .field input[type=date],
  .scrim .modal .field select,
  .scrim .modal .field textarea,
  .scrim .modal .subadd input,
  .focus-park input { font-size: 16px; }
  /* The task editor becomes a full-width bottom sheet (Save reachable with a thumb) instead of a cramped
     centred box that you have to stretch to the top of. Slides up from the bottom; long editors scroll. */
  .scrim .modal { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-width: none;
    margin: 0; border-radius: 22px 22px 0 0; max-height: 92dvh; overflow: auto;
    padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); transform: translateY(100%) scale(1); }
  .scrim.show .modal { transform: none; }
  /* Bigger mode-switch targets (was 38px). */
  .page-schedule .m-seg button { height: 44px; }
}

@media (max-width: 1080px) {
  .page-schedule .tray { position: absolute; right: 26px; top: 150px; bottom: 40px; z-index: 50; box-shadow: var(--shadow-lg); }
}

/* ============================================================
   Floating scrim siblings (UNSCOPED).
   These live at the body level so #page-schedule's scope can't
   reach them. Tokens are passed explicitly via the .page-schedule
   class on <body> wouldn't work, so we redeclare what they need
   and pin the font-family.
   ============================================================ */

/* Shared font + token block for unscoped siblings. These all live at body level (outside
   #page-schedule where the tokens are scoped), so each must be listed here or its --grad/--blue/
   --ink/--card vars resolve to nothing. The focus overlay + attach popover were missing: that made
   the Focus overlay's "Stop and log" / attach "Keep" buttons white-on-no-gradient = invisible. */
.scrim,
.focus-scrim,
.attach-scrim,
.modal,
.toast,
.ks-scrim,
.ksheet,
.cf-scrim,
.cf-box,
.peek,
.apop,
.sa-pop,
.morePop,
.m-scrim,
.m-sheet,
.gcal-banner,
#setPop,
#pjPop {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  --ink: #15131c;
  --ink-soft: #4a4658;
  --ink-faint: #5d5973;
  --ink-mute: #6d6982;
  --bg: #f6f5f8;
  --card: #ffffff;
  --line: #e9e7ef;
  --line-soft: #f0eef4;
  --blue: #2563eb;
  --blue-soft: #eaf0fd;
  --purple: #7c3aed;
  --grad: linear-gradient(96deg, #2563eb 0%, #7c3aed 100%);
  --ok: #1f9d55;
  --ok-soft: #e7f6ec;
  --amber: #d68316;
  --amber-soft: #fdf2e3;
  --red: #dc4b54;
  --red-soft: #fcebec;
  --shadow-sm: 0 1px 2px rgba(21,19,28,.05), 0 1px 3px rgba(21,19,28,.04);
  --shadow-md: 0 8px 24px -10px rgba(21,19,28,.14), 0 2px 6px rgba(21,19,28,.05);
  --shadow-lg: 0 28px 60px -22px rgba(21,19,28,.30), 0 8px 22px -12px rgba(21,19,28,.14);
  --ease: cubic-bezier(.2,.7,.2,1);
  --spring: cubic-bezier(.34,1.4,.5,1);
}

/* ---------------- Modal ---------------- */
.scrim { position: fixed; inset: 0; background: rgba(18,15,28,.34); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 200; display: grid; place-items: center; opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s ease; }
.scrim.show { opacity: 1; visibility: visible; }
/* Scoped to .scrim so this hidden-until-shown animation styles ONLY the Schedule v2 modal. As a bare
   `.modal` it leaked onto every app modal (#gmodal create-workspace / rename / delete, survey, name
   prompt) - which live in .modal-bg, never get .scrim.show, and so stayed opacity:0 = invisible (the
   "grey page" when creating a workspace). The app's own .modal rule (index.html) handles those. */
.scrim .modal { width: 460px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); overflow: auto; background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 26px 26px 22px; transform: translateY(14px) scale(.97); opacity: 0; transition: transform .3s var(--spring), opacity .22s ease; color: var(--ink); }
.scrim.show .modal { transform: none; opacity: 1; }
.modal .mh { display: flex; align-items: flex-start; gap: 12px; }
.modal .mh .mi { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; color: #fff; }
.modal .mh .mi svg { width: 19px; height: 19px; }
.modal h2 { font-size: 19px; font-weight: 800; margin: 0; letter-spacing: -0.03em; line-height: 1.1; }
.modal .mh p { font-size: 13px; font-weight: 500; color: var(--ink-mute); margin-top: 2px; }
.modal .close { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-mute); transition: color .14s ease, background .14s ease; }
.modal .close:hover { color: var(--ink); background: var(--line-soft); }
.modal .close svg { width: 16px; height: 16px; }
.modal .field { margin-top: 16px; }
.modal .field > label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.modal .field input[type=text],
.modal .field input[type=date],
.modal .field select,
.modal .field textarea { width: 100%; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; background: #fff; outline: 0; transition: border-color .15s ease, box-shadow .15s ease; }
.modal .field input:focus,
.modal .field select:focus,
.modal .field textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.modal .field textarea { resize: vertical; min-height: 64px; font-weight: 500; }
.modal .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal .swatches { display: flex; gap: 9px; flex-wrap: wrap; }
.modal .sw { width: 30px; height: 30px; border-radius: 9px; cursor: pointer; position: relative; transition: transform .14s var(--spring); }
.modal .sw:hover { transform: scale(1.1); }
.modal .sw.on::after { content: ""; position: absolute; inset: -4px; border-radius: 12px; border: 2px solid var(--ink); }
.modal .sw.auto { background: #fff; border: 1.5px dashed #8b879b; display: grid; place-items: center; font-size: 9px; font-weight: 800; color: var(--ink-mute); }
/* Sticky action footer: pinned to the bottom of the scrolling modal so Delete / Duplicate / Save stay
   reachable without scrolling to the end. The negative margins bleed it flush to the modal's padded
   edges (26px sides, 22px bottom); bottom:-22px cancels that bottom padding so it sits on the very edge. */
.modal .mfoot { display: flex; align-items: center; gap: 10px; position: sticky; bottom: -22px; margin: 18px -26px -22px; padding: 15px 26px; background: var(--card); box-shadow: 0 -1px 0 var(--line), 0 -12px 18px -14px rgba(20,15,40,.22); border-radius: 0 0 20px 20px; z-index: 2; }
.modal .mfoot .del { color: var(--red); border-color: var(--red-soft); }
.modal .mfoot .del:hover { background: var(--red-soft); border-color: #f3c9cd; color: var(--red); }
.modal .mfoot .grow { flex: 1; }
.modal .btn {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700;
  padding: 10px 15px; border-radius: 11px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .2s ease, border-color .15s ease, color .15s ease;
}
.modal .btn svg { width: 16px; height: 16px; }
.modal .btn:hover { color: var(--ink); border-color: #d8d4e4; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.modal .btn:active { transform: scale(.97); }
.modal .btn-primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(124,58,237,.5); }
.modal .btn-primary:hover { color: #fff; border-color: transparent; box-shadow: 0 12px 26px -8px rgba(124,58,237,.6); }

/* Modal: timer + subtasks */
.modal .seg-time { display: flex; align-items: center; gap: 10px; }
.modal .timer-box { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line); background: #fcfbfd; }
.modal .timer-box.running { border-color: #f6cfd0; background: #fff5f5; }
.modal .timer-box .big { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; color: var(--ink); }
.modal .timer-box.running .big { color: #d92d33; }
.modal .timer-box .tlbl { font-size: 11.5px; font-weight: 700; color: var(--ink-mute); }
.modal .timer-box .grow { flex: 1; }
.modal .timer-box .tbtn { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; padding: 9px 15px; border-radius: 10px; border: 0; cursor: pointer; background: var(--grad); color: #fff; box-shadow: 0 5px 14px -6px rgba(124,58,237,.5); transition: transform .14s var(--ease), box-shadow .18s ease; }
.modal .timer-box .tbtn:hover { transform: translateY(-1px); }
.modal .timer-box .tbtn:active { transform: scale(.96); }
.modal .timer-box .tbtn.stop { background: #ff5a5f; box-shadow: 0 5px 14px -6px rgba(255,90,95,.55); }
.modal .timer-box .tbtn svg { width: 14px; height: 14px; }
.modal .timer-box .tb-left { min-width: 0; }
.modal .timer-box .tsess { font-size: 12px; font-weight: 700; color: var(--ink-soft); font-variant-numeric: tabular-nums; margin-top: 3px; display: none; }
.modal .timer-box.running .tsess,
.modal .timer-box.paused .tsess { display: block; }
.modal .timer-box.paused { border-color: #f0e3c6; background: #fdfaf2; }
.modal .timer-box.paused .big { color: var(--amber); }
.modal .timer-box .tb-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; }
.modal .timer-box .tb-links { display: none; align-items: center; gap: 14px; }
.modal .timer-box.running .tb-links,
.modal .timer-box.paused .tb-links { display: flex; }
.modal .timer-box .tlink { font: inherit; font-size: 11.5px; font-weight: 700; color: var(--ink-mute); background: none; border: 0; cursor: pointer; padding: 2px; }
.modal .timer-box .tlink:hover { color: var(--ink); }
.modal .timer-box .tlink.discard:hover { color: var(--red); }

.modal .subwrap { display: flex; flex-direction: column; gap: 7px; }
.modal .subprog { display: flex; align-items: center; gap: 10px; margin-bottom: 2px; }
.modal .subprog .sbar { flex: 1; height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.modal .subprog .sbar > i { display: block; height: 100%; border-radius: 999px; background: var(--grad); transition: width .3s var(--ease); }
.modal .subprog .stxt { font-size: 12px; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; white-space: nowrap; }
.modal .subitem { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: #fcfbfd; border: 1px solid var(--line-soft); transition: background .14s ease; }
.modal .subitem:hover { background: var(--line-soft); }
.modal .subitem .ck { width: 19px; height: 19px; border-radius: 999px; border: 2px solid #cfcbdb; flex: none; cursor: pointer; display: grid; place-items: center; transition: border-color .14s ease, background .14s ease; }
.modal .subitem .ck svg { width: 11px; height: 11px; color: #fff; opacity: 0; transition: opacity .12s ease; }
.modal .subitem.done .ck { background: var(--ok); border-color: var(--ok); }
.modal .subitem.done .ck svg { opacity: 1; }
.modal .subitem .stext { flex: 1; font-size: 13.5px; font-weight: 600; color: var(--ink); border: 0; outline: 0; background: none; font-family: inherit; }
.modal .subitem.done .stext { color: var(--ink-mute); text-decoration: line-through; }
.modal .subitem .sdel { width: 24px; height: 24px; border-radius: 7px; border: 0; background: none; color: var(--ink-mute); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .14s ease, color .14s ease, background .14s ease; }
.modal .subitem:hover .sdel { opacity: 1; }
.modal .subitem .sdel:hover { color: var(--red); background: var(--red-soft); }
.modal .subitem .sdel svg { width: 13px; height: 13px; }
.modal .subadd { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; border: 1px dashed var(--line); }
.modal .subadd .ck { width: 19px; height: 19px; border-radius: 999px; border: 2px dashed #8b879b; flex: none; }
.modal .subadd input { flex: 1; border: 0; outline: 0; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink); background: none; }
.modal .subadd input::placeholder { color: var(--ink-mute); font-weight: 500; }
.modal .sub-sugg { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.modal .sub-sugg .ss-lbl { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mute); margin-right: 2px; }
.modal .ss-chip { font: inherit; font-size: 12px; font-weight: 600; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; cursor: pointer; transition: transform .12s var(--spring), border-color .14s ease, color .14s ease, background .14s ease; }
.modal .ss-chip::before { content: "+ "; color: var(--ink-mute); font-weight: 700; }
.modal .ss-chip:hover { border-color: #c9d8fb; background: var(--blue-soft); color: var(--blue); transform: translateY(-1px); }
.modal .ss-chip:active { transform: scale(.95); }

/* per-subtask assignee (lives inside modal) */
.modal .subitem .sub-av { width: 23px; height: 23px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-size: 9.5px; font-weight: 700; cursor: pointer; flex: none; border: 0; box-shadow: var(--shadow-sm); transition: transform .12s var(--spring); }
.modal .subitem .sub-av:hover { transform: scale(1.12); }
.modal .subitem .sub-av.inherit { opacity: .5; }
.modal .subitem .sub-av.dashed { background: #fff !important; color: var(--ink-mute); border: 1.5px dashed #8b879b; box-shadow: none; }

.modal .vis-toggle { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 11px 13px; cursor: pointer; font: inherit; transition: border-color .14s ease; }
.modal .vis-toggle:hover { border-color: #d8d4e4; }
.modal .vis-toggle .vt-ic { width: 34px; height: 34px; border-radius: 10px; background: var(--line-soft); color: var(--ink-faint); display: grid; place-items: center; flex: none; transition: background .16s ease, color .16s ease; }
.modal .vis-toggle.on .vt-ic { background: var(--ink); color: #fff; }
.modal .vis-toggle .vt-ic svg { width: 17px; height: 17px; }
.modal .vis-toggle .vt-tx { flex: 1; }
.modal .vis-toggle .vt-tx b { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); }
.modal .vis-toggle .vt-tx i { display: block; font-size: 11.5px; font-weight: 500; font-style: normal; color: var(--ink-mute); margin-top: 1px; }
.modal .vis-toggle .vt-sw { width: 40px; height: 23px; border-radius: 999px; background: #d9d6e2; position: relative; flex: none; transition: background .18s ease; }
.modal .vis-toggle.on .vt-sw { background: var(--blue); }
.modal .vis-toggle .vt-sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left .18s var(--spring); }
.modal .vis-toggle.on .vt-sw::after { left: 19px; }

/* ---------------- Sub-assignee popover ---------------- */
.sa-pop { position: fixed; z-index: 9999; width: 212px; background: #fff; border: 1px solid var(--line); border-radius: 13px; box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; transform: translateY(6px) scale(.98); transition: opacity .14s ease, transform .16s var(--spring); pointer-events: none; color: var(--ink); }
.sa-pop.show { opacity: 1; transform: none; pointer-events: auto; }
.sa-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; padding: 8px 9px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink); }
.sa-row:hover { background: var(--line-soft); }
.sa-row .av { width: 26px; height: 26px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; flex: none; }
.sa-row .av.dashed { background: #fff; color: var(--ink-mute); border: 1.5px dashed #8b879b; }
.sa-row span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sa-row .ck2 { width: 16px; height: 16px; color: var(--blue); flex: none; }
.sa-pop .sa-lbl { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mute); padding: 8px 9px 5px; }

/* ---------------- Assign popover (Assign Control mirror) ---------------- */
.apop { position: fixed; z-index: 9999; width: 268px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); border: 1px solid rgba(20,18,40,.06); padding: 6px; opacity: 0; transform: translateY(6px) scale(.98); transition: opacity .14s ease, transform .16s var(--spring); pointer-events: none; color: var(--ink); }
.apop.show { opacity: 1; transform: none; pointer-events: auto; }
.apop-search { width: 100%; border: 0; outline: 0; font: inherit; font-size: 14.5px; font-weight: 600; padding: 9px 11px 11px; color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.apop-search::placeholder { color: #b3b3bd; font-weight: 500; }
.apop-row { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; border: 0; background: none; cursor: pointer; padding: 9px 10px; border-radius: 10px; font: inherit; font-size: 14.5px; color: var(--ink); }
.apop-row:hover, .apop-row.cursor { background: var(--line-soft); }
.apop-row .av { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; flex: none; }
.apop-row .nm { font-weight: 600; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apop-row .tag { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: var(--blue); background: var(--blue-soft); padding: 2px 7px; border-radius: 6px; text-transform: uppercase; }
.apop-row .check { width: 18px; height: 18px; color: var(--blue); flex: none; }
.apop-row .kbd { font: inherit; font-size: 12px; font-weight: 700; color: var(--ink-faint); background: var(--line-soft); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 7px; line-height: 19px; min-width: 12px; text-align: center; flex: none; }
.apop-quick { background: var(--blue-soft); }
.apop-quick:hover, .apop-quick.cursor { background: #dde9fd; }
.apop-quick .nm { font-weight: 700; }
.apop-label { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); padding: 9px 10px 5px; }
.apop-sep { height: 1px; background: var(--line); margin: 5px 6px; }
.apop-row.danger { color: var(--red); }
.apop-row.danger:hover, .apop-row.danger.cursor { background: var(--red-soft); }
.apop-row.danger .x { width: 34px; display: grid; place-items: center; font-size: 17px; }
.apop-hint { font-size: 12px; color: var(--ink-mute); padding: 9px 10px 5px; display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--line); margin-top: 4px; }
.apop-hint .kbd { font: inherit; font-size: 11px; font-weight: 700; color: var(--ink-faint); background: var(--line-soft); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; }

/* assignee avatar on a block (lives inside .page-schedule, not a sibling) */
.page-schedule .block .bav { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; color: #fff; font-size: 10.5px; font-weight: 700; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 0 0 2px var(--bk-bg,#eaf0fd); z-index: 6; transition: transform .14s var(--spring); }
.page-schedule .block .bav.dashed { background: #fff !important; color: var(--ink-mute); border: 1.5px dashed #8b879b; box-shadow: 0 0 0 2px var(--bk-bg,#eaf0fd); }
.page-schedule .block:hover .bav { transform: translateY(-50%) scale(1.08); }
.page-schedule .block.running:hover .bav,
.page-schedule .block:hover .play ~ .bav { opacity: 1; }
.page-schedule .block.has-bav { padding-right: 64px; }
.page-schedule .block.has-bav .play { right: 38px; }
.page-schedule .block.hot { box-shadow: var(--shadow-md), inset 0 0 0 1.5px var(--bk-accent,#2563eb); }

/* ---------------- Toast ---------------- */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; font-size: 14px; font-weight: 600; padding: 12px 20px; border-radius: 999px; box-shadow: var(--shadow-md); opacity: 0; pointer-events: none; transition: opacity .2s ease, transform .25s var(--ease); z-index: 300; display: flex; align-items: center; gap: 10px; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast svg { width: 16px; height: 16px; color: #6ee7a8; }
@media (max-width: 640px) {
  .toast { bottom: 86px; }
}

/* ---------------- Peek popover (single-day reveal gesture) ---------------- */
.peek { position: fixed; z-index: 9998; width: 250px; background: var(--card); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); padding: 13px 14px; pointer-events: none; opacity: 0; transform: translateY(4px) scale(.97); transition: opacity .16s ease, transform .18s var(--spring); color: var(--ink); }
.peek.show { opacity: 1; transform: none; }
.peek::after { content: ""; position: absolute; left: var(--arrow, 50%); bottom: -6px; width: 12px; height: 12px; background: var(--card); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.peek.below::after { bottom: auto; top: -6px; border: 0; border-left: 1px solid var(--line); border-top: 1px solid var(--line); }
.peek .pk-pj { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--pkc, var(--blue)); }
.peek .pk-pj i { width: 8px; height: 8px; border-radius: 3px; background: var(--pkc, var(--blue)); }
.peek .pk-t { font-size: 15px; font-weight: 800; color: var(--ink); margin-top: 6px; line-height: 1.25; letter-spacing: -0.02em; text-wrap: pretty; }
.peek .pk-dates { font-size: 12px; font-weight: 600; color: var(--ink-faint); margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.peek .pk-row { display: flex; align-items: center; gap: 8px; margin-top: 11px; padding-top: 11px; border-top: 1px solid var(--line-soft); }
.peek .pk-stat { flex: 1; }
.peek .pk-stat .lbl { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mute); }
.peek .pk-stat .val { font-size: 14px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; margin-top: 2px; }
.peek .pk-stat .val.live { color: #d92d33; }
.peek .pk-bar { height: 5px; border-radius: 999px; background: var(--line); overflow: hidden; margin-top: 7px; }
.peek .pk-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--pkc, var(--blue)); }
.peek .pk-private { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; color: var(--ink-faint); background: var(--line-soft); border-radius: 999px; padding: 3px 9px 3px 8px; margin-top: 11px; }
.peek .pk-private svg { width: 12px; height: 12px; }

/* ---------------- Shortcuts cheat-sheet ---------------- */
.ks-scrim { position: fixed; inset: 0; background: rgba(18,15,28,.34); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 250; display: grid; place-items: center; opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
.ks-scrim.show { opacity: 1; visibility: visible; }
.ksheet { width: 660px; max-width: calc(100vw - 32px); max-height: calc(100vh - 48px); overflow: auto; background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 26px 28px 24px; transform: translateY(14px) scale(.97); opacity: 0; transition: transform .3s var(--spring), opacity .22s ease; color: var(--ink); }
.ks-scrim.show .ksheet { transform: none; opacity: 1; }
.ksheet h2 { font-size: 20px; font-weight: 800; display: flex; align-items: center; gap: 10px; margin: 0; letter-spacing: -0.03em; line-height: 1.1; }
.ksheet h2 .close { margin-left: auto; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink-mute); }
.ksheet h2 .close:hover { background: var(--line-soft); color: var(--ink); }
.ksheet h2 .close svg { width: 16px; height: 16px; }
.ksheet .ks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px 36px; margin-top: 20px; }
.ksheet .ks-col h4 { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); margin: 0 0 10px; }
.ksheet .ks-line { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.ksheet .ks-line:last-child { border-bottom: 0; }
.ksheet .ks-line .desc { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); flex: 1; }
.ksheet .ks-line .keys { display: flex; align-items: center; gap: 5px; }
.ksheet .ks-line .keys .k { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); background: #fff; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 2px 7px; min-width: 14px; text-align: center; }
.ksheet .ks-line .keys .plus { font-size: 11px; color: var(--ink-mute); font-weight: 700; }
.ksheet .ks-foot { margin-top: 20px; font-size: 12.5px; font-weight: 600; color: var(--ink-mute); display: flex; align-items: center; gap: 7px; }
.ksheet .ks-foot .k { font-size: 11px; font-weight: 800; color: var(--ink-soft); background: var(--line-soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; }

/* ---------------- Confirm dialog ---------------- */
.cf-scrim { position: fixed; inset: 0; background: rgba(18,15,28,.4); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 400; display: grid; place-items: center; opacity: 0; visibility: hidden; transition: opacity .18s ease, visibility .18s ease; }
.cf-scrim.show { opacity: 1; visibility: visible; }
.cf-box { width: 384px; max-width: calc(100vw - 32px); background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg); padding: 24px; transform: translateY(12px) scale(.97); opacity: 0; transition: transform .26s var(--spring), opacity .2s ease; color: var(--ink); }
.cf-scrim.show .cf-box { transform: none; opacity: 1; }
.cf-box .cf-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--red-soft); color: var(--red); margin-bottom: 14px; }
.cf-box .cf-ic svg { width: 22px; height: 22px; }
.cf-box h3 { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin: 0; line-height: 1.1; }
.cf-box p { font-size: 13.5px; font-weight: 500; color: var(--ink-mute); margin-top: 6px; line-height: 1.45; }
.cf-box .cf-foot { display: flex; gap: 10px; margin-top: 22px; }
.cf-box .cf-foot .grow { flex: 1; }
.cf-box .btn {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700;
  padding: 10px 15px; border-radius: 11px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft);
  box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .2s ease, border-color .15s ease, color .15s ease;
}
.cf-box .btn svg { width: 16px; height: 16px; }
.cf-box .btn:hover { color: var(--ink); border-color: #d8d4e4; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.cf-box .cf-danger { background: var(--red); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(220,75,84,.5); }
.cf-box .cf-danger:hover { color: #fff; border-color: transparent; background: #c8434b; box-shadow: 0 12px 26px -8px rgba(220,75,84,.55); }
@media (max-width: 640px) {
  .scrim { align-items: flex-end; }
  .modal { width: 100%; max-width: 100%; border-bottom-left-radius: 0; border-bottom-right-radius: 0; max-height: 92vh; }
}

/* ============================================================
   Voice fix #17: KEY/CRITICAL subtask marker
   Phase 3's renderer detects a U+26A0 in the source string and
   appends <span class="sub-critical"><svg ...></svg></span>.
   ============================================================ */
.page-schedule .sub-critical,
.modal .sub-critical,
.peek .sub-critical {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 11px;
  height: 11px;
  margin-left: 4px;
  vertical-align: baseline;
  color: var(--amber);
}
.page-schedule .sub-critical svg,
.modal .sub-critical svg,
.peek .sub-critical svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
}

/* ============================================================
   Focus indicators (a11y)
   ============================================================ */
.page-schedule .block:focus-visible,
.page-schedule .kb-card:focus-visible,
.page-schedule .tcard:focus-visible,
.page-schedule .mcard:focus-visible,
.page-schedule .icon-btn:focus-visible,
.page-schedule .btn:focus-visible {
  /* 3px outline + 3px offset (matching the info icon) so the ring clears crowded/adjacent
     absolutely-positioned blocks and stays visible (WCAG 2.4.7). */
  outline: 3px solid var(--accent, #2563eb);
  outline-offset: 3px;
}
.modal .btn:focus-visible,
.cf-box .btn:focus-visible {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
}

/* ============================================================
   Kanban / Board
   ============================================================ */
/* Mode switch. Timeline is the default; #kanbanView is hidden until body.mode-kanban.
   The timeline chrome is hidden in board mode so the columns own the .board surface. */
.page-schedule .kanban { display: none; flex: 1; min-height: 0; overflow-x: auto; }
body.mode-kanban .page-schedule .timeline,
body.mode-kanban .page-schedule .tl-head { display: none; }
body.mode-kanban .page-schedule .kanban { display: flex; }
/* In board mode the day/week/month zoom + the prev/next range stepper don't apply. */
body.mode-kanban .page-schedule #viewSeg,
body.mode-kanban .page-schedule .nav-range { display: none; }
/* Calendar mode has no day/week/month zoom either, so hide the timeline-only zoom seg (it was rendering as
   an empty pill in the toolbar, especially cramped on mobile). */
body.mode-cal .page-schedule #viewSeg { display: none; }

.page-schedule .kb-col { flex: 1 1 0; min-width: 286px; display: flex; flex-direction: column; border-right: 1px solid var(--line-soft); min-height: 0; }
.page-schedule .kb-col:last-child { border-right: 0; }
.page-schedule .kb-head { display: flex; align-items: center; gap: 9px; padding: 16px 18px 11px; position: sticky; top: 0; background: var(--card); z-index: 3; }
.page-schedule .kb-ic { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.page-schedule .kb-ic svg { width: 14px; height: 14px; }
.page-schedule .kb-head h3 { font-size: 14.5px; font-weight: 800; color: var(--ink); margin: 0; }
.page-schedule .kb-head .kb-ct { font-size: 13px; font-weight: 800; color: var(--ink-mute); }
.page-schedule .kb-head .kb-add { margin-left: auto; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink-faint); display: grid; place-items: center; cursor: pointer; }
.page-schedule .kb-head .kb-add:hover { color: var(--blue); border-color: #cfe0fb; }
.page-schedule .kb-head .kb-add svg { width: 14px; height: 14px; }
.page-schedule .kb-list { flex: 1; overflow-y: auto; padding: 4px 14px 20px; display: flex; flex-direction: column; gap: 11px; scrollbar-width: thin; transition: background .14s ease; border-radius: 12px; }
/* WIP-cap nudge in the "In progress" column when more than 3 tasks are open at once (ADHD anti-switching). */
.page-schedule .kb-wip { display: flex; align-items: center; gap: 7px; margin: 0 14px 8px; padding: 7px 10px; border-radius: 9px; background: rgba(214,131,22,.1); border: 1px solid rgba(214,131,22,.28); color: #9a5b08; font-size: 11.5px; font-weight: 650; line-height: 1.3; }
.page-schedule .kb-wip svg { width: 14px; height: 14px; flex: none; }
body.calm .page-schedule .kb-wip { filter: saturate(.7); }
.page-schedule .kb-col.drop .kb-list { background: rgba(37,99,235,.05); box-shadow: inset 0 0 0 2px rgba(37,99,235,.18); }

.page-schedule .kb-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; box-shadow: var(--shadow-sm); cursor: grab; transition: box-shadow .14s ease, transform .1s ease; touch-action: none; }
.page-schedule .kb-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.page-schedule .kb-card.dragging { display: none; }
/* The flyer is appended to <body> while dragging, so it is scoped to body, not .page-schedule. */
.kb-flyer { position: fixed; width: 258px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; box-shadow: 0 22px 48px -12px rgba(20,16,40,.45); z-index: 200; pointer-events: none; transform: rotate(-2deg) scale(1.02); opacity: .97; }
.page-schedule .kb-ghost { box-sizing: border-box; border: 2px dashed var(--blue); background: rgba(37,99,235,.08); border-radius: 14px; }

.page-schedule .kc-top { display: flex; align-items: center; gap: 5px; margin-bottom: 7px; }
.page-schedule .kc-pj { font-size: 11.5px; font-weight: 800; color: var(--ink-soft); display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.page-schedule .kc-pj i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.page-schedule .kc-pj .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-schedule .kc-pj svg { width: 13px; height: 13px; color: var(--ink-mute); flex: none; }
.page-schedule .kc-av { margin-left: auto; width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; font-size: 10px; font-weight: 800; color: #fff; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05); border: 1.5px solid #fff; }
.page-schedule .kc-av.dashed { background: #fff; color: var(--ink-mute); border: 1.5px dashed #8b879b; }
.page-schedule .kc-main { display: flex; align-items: flex-start; gap: 9px; }
.page-schedule .kc-check { width: 19px; height: 19px; border-radius: 999px; border: 2px solid #d4d0e0; background: #fff; flex: none; margin-top: 1px; cursor: pointer; display: grid; place-items: center; transition: border-color .14s ease, background .14s ease; }
.page-schedule .kc-check svg { width: 12px; height: 12px; color: #fff; opacity: 0; }
.page-schedule .kc-check.on { background: var(--ok); border-color: var(--ok); }
.page-schedule .kc-check.on svg { opacity: 1; }
.page-schedule .kc-title { font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.3; text-wrap: pretty; overflow-wrap: anywhere; }
.page-schedule .kb-card.done .kc-title { text-decoration: line-through; color: var(--ink-mute); }
.page-schedule .kc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-left: 28px; }
.page-schedule .kc-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 8px; padding: 3px 8px; background: #fff; }
.page-schedule .kc-chip i { width: 7px; height: 7px; border-radius: 999px; flex: none; }
.page-schedule .kc-chip svg { width: 12px; height: 12px; }
.page-schedule .kc-chip.live { color: var(--red); border-color: #f6cfd0; }
.page-schedule .kc-subs { display: flex; gap: 4px; margin-top: 11px; padding-left: 28px; }
.page-schedule .kc-subs i { height: 5px; flex: 1; border-radius: 999px; background: var(--line); max-width: 38px; }
.page-schedule .kc-subs i.on { background: var(--bk-accent, var(--blue)); }

/* ============================================================
   Calendar (hourly week). Me-only by design; #calView is hidden until body.mode-cal.
   The timeline chrome is hidden in calendar mode so the columns own the .board surface.
   The prev/next range stepper STAYS visible: it steps the calendar a week at a time.
   ============================================================ */
.page-schedule .calview { display: none; flex: 1; min-height: 0; flex-direction: column; }
body.mode-cal .page-schedule .timeline,
body.mode-cal .page-schedule .tl-head { display: none; }
body.mode-cal .page-schedule .calview { display: flex; }
/* In calendar mode the day/week/month zoom doesn't apply (the axis is hours, not days). */
body.mode-cal .page-schedule #viewSeg { display: none; }

.page-schedule .cal-scroll { flex: 1; overflow: auto; position: relative; scrollbar-width: thin; overscroll-behavior-x: none; }
.page-schedule .cal-scroll::-webkit-scrollbar { width: 11px; height: 11px; }
.page-schedule .cal-scroll::-webkit-scrollbar-thumb { background: #d9d6e2; border-radius: 999px; border: 3px solid #fff; }
.page-schedule .cal-inner { position: relative; min-width: 640px; }
.page-schedule .cal-top { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.9); backdrop-filter: saturate(160%) blur(10px); -webkit-backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.page-schedule .cal-gut { width: 60px; flex: none; }
.page-schedule .cal-headrow { display: flex; }
.page-schedule .cal-dh { flex: 1; min-width: 0; text-align: center; padding: 9px 4px 8px; border-left: 1px solid var(--line-soft); }
.page-schedule .cal-dh .dow { font-size: 10.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mute); }
.page-schedule .cal-dh .dn { font-size: 19px; font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; line-height: 1.25; margin-top: 1px; }
.page-schedule .cal-dh.today .dn { display: inline-block; min-width: 30px; padding: 1px 9px; border-radius: 999px; background: var(--ink); color: #fff; }
.page-schedule .cal-dh .tot { font-size: 10.5px; font-weight: 700; color: var(--ink-mute); margin-top: 2px; font-variant-numeric: tabular-nums; }
.page-schedule .cal-dh .tot b { color: var(--blue); }
.page-schedule .cal-allday { display: flex; border-top: 1px solid var(--line-soft); align-items: stretch; }
.page-schedule .cal-allday .cal-gut { display: flex; align-items: center; justify-content: flex-end; padding: 0 9px 0 0; font-size: 9.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-mute); }
.page-schedule .cal-adcol { flex: 1; min-width: 0; border-left: 1px solid var(--line-soft); padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.page-schedule .cal-ad { font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: grab; background: var(--bk-bg); color: var(--bk-ink); border: 1px solid var(--bk-line); }
/* Dragging an all-day pill down into the hour grid to give it a time (calMove/calUp adslot mode). */
.page-schedule .cal-ad.dragging { cursor: grabbing; opacity: .4; }
/* External Google "busy" blocks: greyed, hatched, non-interactive, sit BEHIND tasks. Others' titles are
   already redacted to "Busy" server-side; on your own calendar these are your own events (real titles). */
.page-schedule .cal-busy { position: absolute; left: 1px; right: 3px; border-radius: 7px; padding: 3px 7px; overflow: hidden; pointer-events: none; box-sizing: border-box; color: #6b6680; font-size: 10.5px; font-weight: 650; line-height: 1.25; border: 1px solid rgba(120,116,140,.3); background: repeating-linear-gradient(45deg, rgba(120,116,140,.14), rgba(120,116,140,.14) 6px, rgba(120,116,140,.06) 6px, rgba(120,116,140,.06) 12px); }
.page-schedule .cal-busy .cb-busy-t { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-schedule .cal-busy-ad { position: static; left: auto; right: auto; height: auto; font-size: 10.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.calm .page-schedule .cal-busy { filter: saturate(.55); }
/* Optional "Colour my calendar events" mode: same hatched pattern (keeps the external feel + the distinction
   from solid task cards) but in the event's own stable hue rather than grey. Vars set inline per block. */
.page-schedule .cal-busy.colored { color: var(--busy-ink); border-color: var(--busy-line); background: repeating-linear-gradient(45deg, var(--busy-bg), var(--busy-bg) 6px, var(--busy-bg2) 6px, var(--busy-bg2) 12px); }
/* Toolbar Google-Calendar sync icon (last-synced time lives in the hover tooltip to keep the bar clean). */
.page-schedule .toolbar .gcal-sync { width: 40px; height: 40px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); cursor: pointer; transition: color .14s ease, border-color .14s ease; }
.page-schedule .toolbar .gcal-sync:hover { color: var(--blue); border-color: #cfe0fb; }
.page-schedule .toolbar .gcal-sync svg { width: 17px; height: 17px; }
.page-schedule .toolbar .gcal-sync.spinning { color: var(--blue); pointer-events: none; }
.page-schedule .toolbar .gcal-sync.spinning svg { animation: gcal-spin .8s linear infinite; }
@keyframes gcal-spin { to { transform: rotate(360deg); } }
.page-schedule .cal-body { display: flex; position: relative; }
.page-schedule .cal-gut-body { width: 60px; flex: none; position: relative; }
.page-schedule .cal-hourlab { position: absolute; right: 8px; font-size: 10.5px; font-weight: 700; color: var(--ink-mute); font-variant-numeric: tabular-nums; transform: translateY(-7px); }
.page-schedule .cal-cols { flex: 1; display: flex; position: relative; background-image: repeating-linear-gradient(to bottom, var(--line-soft) 0, var(--line-soft) 1px, transparent 1px, transparent 56px); }
.page-schedule .cal-col { flex: 1; min-width: 0; border-left: 1px solid var(--line-soft); position: relative; }
.page-schedule .cal-col.today { background: rgba(37,99,235,.035); }
/* Translucent so the parent .cal-cols hour-line gradient shows THROUGH the weekend shade (an opaque
   #faf9fc fill painted right over the grid lines, so weekends looked like they had none). */
.page-schedule .cal-col.wknd { background: rgba(21,19,28,.028); }
/* Today wins over the weekend shade when today IS a weekend (keep the blue highlight on Sat/Sun). */
.page-schedule .cal-col.wknd.today { background: rgba(37,99,235,.05); }
/* Opaque base + tint so a scheduled task reads as a solid card ON TOP of any imported busy hatching (a bare
   15% tint let the diagonal lines show through and the block looked washed out). */
.page-schedule .cal-block { position: absolute; left: 3px; right: 3px; border-radius: 10px; padding: 5px 9px; overflow: hidden; cursor: grab; background-color: var(--card); background-image: linear-gradient(var(--bk-bg), var(--bk-bg)); border: 1px solid var(--bk-line); box-shadow: 0 1px 3px rgba(20,16,40,.12); transition: box-shadow .14s ease, transform .1s ease; touch-action: none; }
.page-schedule .cal-block::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--bk-accent); }
.page-schedule .cal-block:hover { box-shadow: 0 6px 16px -8px rgba(20,16,40,.28); z-index: 7; }
.page-schedule .cal-block.dragging { cursor: grabbing; box-shadow: 0 14px 30px -10px rgba(20,16,40,.4); z-index: 30; opacity: .96; }
.page-schedule .cal-block.running { box-shadow: 0 0 0 2px rgba(217,45,51,.5), 0 6px 16px -8px rgba(20,16,40,.3); }
.page-schedule .cal-block .cb-t { font-size: 12.5px; font-weight: 700; color: var(--bk-ink); line-height: 1.2; display: flex; align-items: center; gap: 4px; }
.page-schedule .cal-block .cb-t .ttl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-schedule .cal-block .cb-m { font-size: 10.5px; font-weight: 600; color: var(--bk-ink); opacity: .72; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-schedule .cal-block.done .cb-t .ttl { text-decoration: line-through; opacity: .55; }
.page-schedule .cal-block .cb-play { position: absolute; right: 6px; bottom: 5px; width: 22px; height: 22px; border-radius: 7px; border: 0; background: rgba(255,255,255,.7); color: var(--bk-accent); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .12s ease; }
.page-schedule .cal-block:hover .cb-play, .page-schedule .cal-block.running .cb-play { opacity: 1; }
.page-schedule .cal-block .cb-play svg { width: 12px; height: 12px; }
.page-schedule .cal-block.short { padding-top: 2px; padding-bottom: 2px; }
.page-schedule .cal-block.short .cb-m { display: none; }
.page-schedule .cal-block .pz { position: absolute; left: 0; right: 0; height: 8px; cursor: ns-resize; z-index: 2; }
.page-schedule .cal-block .pz.top { top: 0; }
.page-schedule .cal-block .pz.bot { bottom: 0; }
.page-schedule .nowline-cal { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 8; pointer-events: none; }
.page-schedule .nowline-cal::before { content: ""; position: absolute; left: -3px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.page-schedule .cal-ghost { position: absolute; left: 3px; right: 3px; border-radius: 10px; background: rgba(37,99,235,.16); border: 1.5px dashed var(--blue); z-index: 9; pointer-events: none; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800; color: var(--blue); }
/* The time tag is appended to <body> while dragging, so it is OUTSIDE .page-schedule - which means the
   scoped var(--ink) resolved to nothing here (transparent box + white text = invisible). Hardcode it. */
.cal-timetag { position: fixed; z-index: 320; background: #15131c; color: #fff; font-size: 12.5px; font-weight: 800; padding: 5px 10px; border-radius: 9px; pointer-events: none; box-shadow: 0 8px 20px -6px rgba(10,8,20,.5); font-variant-numeric: tabular-nums; white-space: nowrap; transform: translate(calc(-100% - 16px), -50%); }
.cal-timetag::after { content: ""; position: absolute; right: -5px; top: 50%; transform: translateY(-50%); border: 5px solid transparent; border-left-color: #15131c; }

/* ============================================================
   Auto-plan your week (Phase D)
   Tray trigger is inside .page-schedule; the preview overlay is
   appended to <body>, so its chrome is scoped to .ap-card, not
   .page-schedule (matches .cal-timetag above).
   ============================================================ */
.page-schedule .tray-head .ap-trigger { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 11px; font: inherit; font-size: 13px; font-weight: 700; color: var(--blue); background: var(--blue-soft); border: 1px solid #cfe0fb; border-radius: 11px; padding: 9px 12px; cursor: pointer; transition: background .14s ease, border-color .14s ease, transform .12s var(--spring); }
.page-schedule .tray-head .ap-trigger:hover { background: #e2ecfe; border-color: #b9d2fb; transform: translateY(-1px); }
.page-schedule .tray-head .ap-trigger:active { transform: scale(.98); }
.page-schedule .tray-head .ap-trigger svg { width: 16px; height: 16px; }
.page-schedule .tray-head .ap-trigger[hidden] { display: none; }

/* Preview overlay (body-level) */
.ap-scrim { position: fixed; inset: 0; background: rgba(18,15,28,.34); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 270; display: none; place-items: center; padding: 20px; }
.ap-scrim.show { display: grid; }
.ap-card { width: 440px; max-width: 100%; background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); padding: 22px 22px 18px; animation: apCardIn .2s var(--spring) both; }
@keyframes apCardIn { from { transform: scale(.97); opacity: .6; } to { transform: none; opacity: 1; } }
.ap-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ap-head .ap-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; flex: none; }
.ap-head .ap-ic svg { width: 20px; height: 20px; }
.ap-head h3 { font-size: 17px; font-weight: 800; margin: 0; color: var(--ink); }
.ap-head p { font-size: 12.5px; color: var(--ink-mute); margin: 1px 0 0; }
.ap-empty { font-size: 13px; color: var(--ink-mute); padding: 14px; text-align: center; }
.ap-leftover { font-size: 12px; font-weight: 600; color: var(--ink-mute); margin-top: 10px; padding: 0 2px; }
.ap-grid-wrap { margin-top: 10px; }
.ap-foot { display: flex; gap: 8px; margin-top: 16px; }
.ap-card .btn { flex: 1; justify-content: center; display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; padding: 10px 15px; border-radius: 11px; cursor: pointer; white-space: nowrap; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); box-shadow: var(--shadow-sm); transition: transform .15s var(--ease), box-shadow .2s ease, border-color .15s ease, color .15s ease; }
.ap-card .btn:hover { color: var(--ink); border-color: #d8d4e4; transform: translateY(-1px); box-shadow: var(--shadow-md); }
.ap-card .btn:active { transform: scale(.97); }
.ap-card .btn.soft { color: var(--ink-mute); flex: 0 0 auto; padding-left: 18px; padding-right: 18px; }
.ap-card .btn.btn-primary { background: var(--grad); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(124,58,237,.5); }
.ap-card .btn.btn-primary:hover { color: #fff; border-color: transparent; box-shadow: 0 12px 26px -8px rgba(124,58,237,.6); }

/* Mini week preview grid */
.apw { display: flex; gap: 5px; }
.apw-gut { width: 18px; flex: none; }
.apw-gut .apw-gtrack { position: relative; }
.apw-gut .apw-gtrack span { position: absolute; right: 0; font-size: 9px; font-weight: 700; color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.apw-col { flex: 1; min-width: 0; }
.apw-dh { text-align: center; font-size: 9.5px; font-weight: 700; color: var(--ink-mute); margin-bottom: 4px; text-transform: uppercase; letter-spacing: .02em; }
.apw-dh b { display: block; font-size: 12px; font-weight: 800; color: var(--ink-soft); }
.apw-dh.today b { color: #fff; background: var(--ink); border-radius: 999px; width: 18px; height: 18px; line-height: 18px; margin: 1px auto 0; }
.apw-track { position: relative; border-radius: 7px; background: #fbfafc; border: 1px solid var(--line-soft); background-image: repeating-linear-gradient(to bottom, var(--line-soft) 0, var(--line-soft) 1px, transparent 1px, transparent 17px); overflow: hidden; }
.apw-lunch { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(45deg,#efedf4,#efedf4 3px,#f8f7fb 3px,#f8f7fb 6px); }
.apw-now { position: absolute; left: 0; right: 0; height: 2px; background: var(--red); z-index: 3; }
.apw-b { position: absolute; left: 2px; right: 2px; border-radius: 4px; }
.apw-b.ex { border: 1px solid; }
.apw-b.new { box-shadow: 0 1px 3px rgba(20,16,40,.28); animation: apwPop .26s var(--spring) both; }
@keyframes apwPop { from { transform: scaleY(.4); opacity: .4; } to { transform: scaleY(1); opacity: 1; } }
.apw-legend { display: flex; gap: 16px; justify-content: center; margin-top: 11px; font-size: 11px; font-weight: 700; color: var(--ink-mute); }
.apw-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: -1px; margin-right: 5px; }
.apw-legend i.new { background: var(--blue); }
.apw-legend i.ex { background: rgba(37,99,235,.2); }

/* ============================================================
   Screen-reader only utility
   ============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   Dual-month date-range picker (driven by schedule-v2-datepicker.js)

   The popover is appended to document.body (NOT inside .page-schedule) so it
   floats above the New-block modal scrim. These selectors are therefore
   unscoped. z-index sits above the modal.
   ============================================================ */
/* Flex column + capped height so the Apply/Cancel footer stays reachable on a short laptop:
   the calendars scroll inside .dp-body while .dp-foot stays pinned. */
.dp-pop { position: fixed; z-index: 340; background: var(--card, #fff); border: 1px solid var(--line, #e9e7ef); border-radius: 18px; box-shadow: var(--shadow-lg, 0 28px 60px -22px rgba(21,19,28,.30)); display: none; flex-direction: column; max-height: calc(100vh - 24px); overflow: hidden; }
.dp-pop.show { display: flex; }
.dp-body { display: flex; flex: 1 1 auto; overflow-y: auto; min-height: 0; }
.dp-foot { flex: none; }
.dp-rail { width: 124px; flex: none; border-right: 1px solid var(--line-soft, #f0eef4); padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; background: #fcfbfd; }
.dp-preset { font: inherit; font-size: 12.5px; font-weight: 700; color: var(--ink-soft, #4a4658); text-align: left; background: none; border: 0; border-radius: 8px; padding: 8px 11px; cursor: pointer; }
.dp-preset:hover { background: var(--line-soft, #f0eef4); color: var(--ink, #15131c); }
.dp-cals { position: relative; display: flex; gap: 20px; padding: 14px 18px 6px; }
.dp-nav { position: absolute; top: 14px; width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line, #e9e7ef); background: #fff; color: var(--ink-soft, #4a4658); cursor: pointer; font-size: 15px; line-height: 1; display: grid; place-items: center; z-index: 2; }
.dp-nav:hover { border-color: #d8d4e4; color: var(--ink, #15131c); }
.dp-nav.prev { left: 14px; }
.dp-nav.next { right: 14px; }
.dp-month { width: 208px; }
.dp-mh { text-align: center; font-size: 13.5px; font-weight: 800; color: var(--ink, #15131c); margin-bottom: 10px; }
.dp-dow { display: grid; grid-template-columns: repeat(7,1fr); margin-bottom: 5px; }
.dp-dow span { text-align: center; font-size: 10.5px; font-weight: 800; color: var(--ink-mute, #6d6982); }
.dp-grid { display: grid; grid-template-columns: repeat(7,1fr); }
.dp-day { position: relative; height: 30px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--ink-soft, #4a4658); background: none; border: 0; cursor: pointer; }
/* Muted (off-month) days: dimmed by colour only, no opacity, so the text keeps
   >=4.5:1 contrast on the picker background (WCAG 1.4.3). */
.dp-day.muted { color: #6a6678; }
.dp-day.today { font-weight: 800; }
.dp-day.today::after { content: ""; position: absolute; left: 50%; bottom: 3px; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--blue, #2563eb); }
.dp-day:hover:not(.muted):not(.inrange):not(.start):not(.end) { background: var(--line-soft, #f0eef4); border-radius: 8px; }
.dp-day.inrange { background: var(--blue-soft, #eaf0fd); color: var(--blue, #2563eb); }
.dp-day.start, .dp-day.end { background: var(--ink, #15131c); color: #fff; z-index: 1; }
.dp-day.start { border-radius: 8px 0 0 8px; }
.dp-day.end { border-radius: 0 8px 8px 0; }
.dp-day.start.end, .dp-day.single { border-radius: 8px; }
.dp-day.today.start::after, .dp-day.today.end::after { background: #fff; }
.dp-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 18px; border-top: 1px solid var(--line-soft, #f0eef4); }
.dp-sel { font-size: 13px; font-weight: 800; color: var(--ink, #15131c); font-variant-numeric: tabular-nums; }
.dp-fbtns { display: flex; gap: 8px; }
.dp-fbtns .btn { padding: 7px 16px; border-radius: 11px; border: 1px solid var(--line, #e9e7ef); background: #fff; font: inherit; font-size: 13px; font-weight: 700; color: var(--ink-soft, #4a4658); cursor: pointer; }
.dp-fbtns .btn:hover { border-color: #d8d4e4; color: var(--ink, #15131c); }
.dp-fbtns .btn.soft { color: var(--ink-mute, #6d6982); }
.dp-fbtns .btn.btn-primary { background: var(--grad, var(--blue, #2563eb)); color: #fff; border-color: transparent; }
.dp-fbtns .btn.btn-primary:hover { color: #fff; }
@media (max-width: 560px) {
  .dp-cals { flex-direction: column; gap: 10px; }
  .dp-month { width: 220px; }
  .dp-rail { width: 104px; }
}

/* ============================================================
   Accessibility: Calm mode (body.calm)

   Lowers surface saturation + flattens shadows on the schedule surfaces so the
   board reads quieter. Toggled from Settings. Colour-blind safe (body.cb) is a
   PRESENTATION-ONLY palette swap done in JS (applyPalette), so it needs no extra
   CSS here, the swatch hues simply come through the inline styles already.
   ============================================================ */
body.calm .page-schedule .block,
body.calm .page-schedule .cal-block,
body.calm .page-schedule .cal-ad,
body.calm .page-schedule .tcard,
body.calm .page-schedule .kb-card { filter: saturate(.55); }
body.calm .page-schedule .block,
body.calm .page-schedule .cal-block,
body.calm .page-schedule .kb-card { box-shadow: none; }
body.calm .page-schedule .nowline,
body.calm .page-schedule .nowline-cal { opacity: .6; }
body.calm .page-schedule .btn-primary { filter: saturate(.82); }
body.calm .page-schedule .lane.drop-target,
body.calm .page-schedule .kb-col.drop .kb-list { filter: saturate(.7); }

/* ============================================================
   Focus overlay (ADHD-friendly)

   A body-appended overlay (#focusScrim) that runs ON the existing per-task
   timer (window.SCHED2_TIMER). It only ever shows the CURRENTLY RUNNING task.
   Body-level, so these rules are NOT scoped under .page-schedule, and the
   in-card buttons carry their own styling rather than leaning on .page-schedule
   .btn (which would not match outside the page root).
   ============================================================ */
.focus-scrim { position: fixed; inset: 0; background: rgba(14,12,22,.5); backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%); z-index: 600; display: none; place-items: center; padding: 20px; }
.focus-scrim.show { display: grid; }
.focus-card { position: relative; width: 520px; max-width: 100%; background: var(--card); border-radius: 28px; box-shadow: 0 40px 90px -30px rgba(10,8,20,.6); padding: 34px 34px 26px; text-align: center; transform: scale(.96) translateY(8px); transition: transform .3s var(--spring); }
.focus-scrim.show .focus-card { transform: none; }
.focus-min { position: absolute; top: 18px; right: 18px; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink-faint); display: grid; place-items: center; cursor: pointer; }
.focus-min:hover { color: var(--ink); border-color: #d8d4e4; }
.focus-min svg { width: 17px; height: 17px; }
.focus-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.focus-task { font-size: 25px; font-weight: 800; color: var(--ink); margin: 8px auto 4px; line-height: 1.2; max-width: 420px; }
.focus-sub { font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.focus-sub b { color: var(--ink); }
.focus-clock { font-size: 66px; font-weight: 800; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; margin: 14px 0 4px; }
.focus-clock.paused { color: var(--ink-mute); }
.focus-prompt { font-size: 14.5px; font-weight: 600; color: var(--ink-soft); min-height: 22px; transition: opacity .25s ease; max-width: 360px; margin: 0 auto; text-wrap: pretty; }
.focus-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.focus-card .btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 700; padding: 10px 16px; border-radius: 11px; cursor: pointer; white-space: nowrap; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); transition: transform .15s ease, box-shadow .2s ease, border-color .15s ease, color .15s ease; }
.focus-card .btn:hover { color: var(--ink); border-color: #d8d4e4; transform: translateY(-1px); }
.focus-card .btn:active { transform: scale(.97); }
.focus-card .btn-primary { background: var(--grad, var(--blue)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(124,58,237,.5); }
.focus-card .btn-primary:hover { color: #fff; border-color: transparent; box-shadow: 0 12px 26px -8px rgba(124,58,237,.6); }
/* Destructive secondary, separated to the left of Pause/Stop. Hardcoded reds (no token reliance). */
.focus-card .btn-discard { color: #d92d33; border-color: #f3c9cd; margin-right: auto; }
.focus-card .btn-discard:hover { color: #c41f25; border-color: #e9a8ac; background: #fff5f5; }
.focus-park { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; text-align: left; }
.focus-park label { display: block; font-size: 12px; font-weight: 800; color: var(--ink-soft); margin-bottom: 7px; }
.focus-park .pk-row { display: flex; gap: 8px; }
.focus-park input { flex: 1; font: inherit; font-size: 14px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fcfbfd; color: var(--ink); }
.focus-park input:focus { outline: none; border-color: var(--blue); background: #fff; }
.focus-park .pk-hint { font-size: 11.5px; color: var(--ink-mute); margin-top: 7px; }

/* Phase C2: an ad-hoc focus session's name is editable inline (the title becomes a text box). */
.focus-task-edit { outline: none; border-radius: 10px; padding: 2px 10px; transition: background .15s ease, box-shadow .15s ease; cursor: text; }
.focus-task-edit:hover { background: rgba(124,58,237,.06); }
.focus-task-edit:focus { background: #fff; box-shadow: 0 0 0 2px var(--blue); }
.focus-task-edit:empty::before { content: attr(data-ph); color: var(--ink-mute); }

/* Phase C2: attach-on-stop popover. After an ad-hoc focus session stops, choose where the time goes. */
.attach-scrim { position: fixed; inset: 0; background: rgba(14,12,22,.5); backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%); z-index: 620; display: grid; place-items: center; padding: 20px; opacity: 0; transition: opacity .2s ease; }
.attach-scrim.show { opacity: 1; }
.attach-card { width: 440px; max-width: 100%; background: var(--card); border-radius: 24px; box-shadow: 0 40px 90px -30px rgba(10,8,20,.6); padding: 26px 26px 20px; text-align: center; transform: scale(.96) translateY(8px); transition: transform .3s var(--spring); }
.attach-scrim.show .attach-card { transform: none; }
.attach-eyebrow { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--blue); }
.attach-head { font-size: 21px; font-weight: 800; color: var(--ink); margin: 7px 0 4px; line-height: 1.25; }
.attach-head b { color: var(--ink); }
.attach-sub { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); margin-bottom: 14px; }
.attach-search { width: 100%; font: inherit; font-size: 14px; padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fcfbfd; color: var(--ink); margin-bottom: 10px; }
.attach-search:focus { outline: none; border-color: var(--blue); background: #fff; }
.attach-list { max-height: 232px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.attach-task { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--ink); cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .1s ease; }
.attach-task:hover { border-color: var(--blue); background: rgba(37,99,235,.04); }
.attach-task:active { transform: scale(.99); }
.attach-task-title { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-task-pj { display: inline-flex; align-items: center; gap: 6px; flex: none; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
.attach-task-pj i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.attach-empty { padding: 24px 0; text-align: center; font-size: 13px; color: var(--ink-mute); }
.attach-foot { display: flex; gap: 10px; justify-content: space-between; margin-top: 16px; }
.attach-card .btn { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 14px; font-weight: 700; padding: 10px 16px; border-radius: 11px; cursor: pointer; white-space: nowrap; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); transition: transform .15s ease, box-shadow .2s ease, border-color .15s ease, color .15s ease; }
.attach-card .btn:hover { color: var(--ink); border-color: #d8d4e4; }
.attach-card .btn:active { transform: scale(.97); }
.attach-card .btn-primary { background: var(--grad, var(--blue)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(124,58,237,.5); }
.attach-card .btn-primary:hover { color: #fff; border-color: transparent; box-shadow: 0 12px 26px -8px rgba(124,58,237,.6); }

/* Header actions: "Start timer" CTA next to "New block". */
.page-schedule .head-actions { display: flex; align-items: center; gap: 10px; }
.page-schedule #startTimerBtn { display: inline-flex; align-items: center; gap: 8px; }
.page-schedule #startTimerBtn .st-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-mute); flex: none; transition: background .15s ease; }
.page-schedule #startTimerBtn.running { color: var(--ink); border-color: #d8d4e4; }
.page-schedule #startTimerBtn.running .st-dot { background: #ff5a5f; box-shadow: 0 0 0 0 rgba(255,90,95,.55); animation: st-pulse 1.6s ease-out infinite; }
.page-schedule #startTimerBtn.running.paused .st-dot { background: var(--ink-mute); animation: none; }
@keyframes st-pulse { 0% { box-shadow: 0 0 0 0 rgba(255,90,95,.55); } 80% { box-shadow: 0 0 0 7px rgba(255,90,95,0); } 100% { box-shadow: 0 0 0 0 rgba(255,90,95,0); } }

/* Hover-hot on calendar + board cards (timeline already styles .block.hot). */
.cal-block.hot, .kb-card.hot { box-shadow: 0 0 0 2px var(--blue), 0 6px 16px -8px rgba(21,19,28,.3); }

/* Right-click task context menu. */
.tmenu { position: fixed; z-index: 640; min-width: 188px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 5px; }
.tmenu-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.tmenu-item:hover { background: var(--line-soft); color: var(--ink); }
.tmenu-item.danger { color: #c0392b; }
.tmenu-item.danger:hover { background: #fdecec; color: #a3271f; }
.tmenu-ic { display: inline-flex; width: 16px; height: 16px; flex: none; }
.tmenu-ic svg { width: 16px; height: 16px; }
.tmenu-sep { height: 1px; background: var(--line-soft); margin: 5px 6px; }

/* Searchable project picker (quick-add chip + Edit-task modal). */
.pjpick { position: fixed; z-index: 700; width: 268px; max-width: calc(100vw - 24px); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; }
.pjpick-search { width: 100%; font: inherit; font-size: 13.5px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: #fcfbfd; color: var(--ink); box-sizing: border-box; margin-bottom: 6px; }
.pjpick-search:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 3px var(--blue-soft); }
.pjpick-list { max-height: 264px; overflow-y: auto; display: flex; flex-direction: column; gap: 1px; }
.pjpick-opt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); background: none; border: 0; border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.pjpick-opt:hover, .pjpick-opt.cursor { background: var(--line-soft); color: var(--ink); }
.pjpick-opt.on { color: var(--ink); }
.pjpick-opt i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.pjpick-opt span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pjpick-opt .pjpick-check { width: 15px; height: 15px; flex: none; color: var(--blue); }
.pjpick-empty { padding: 18px 10px; text-align: center; font-size: 13px; color: var(--ink-mute); }

/* Modal project trigger (replaces the native select visually; the select stays hidden as the value). */
.fpt { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; cursor: pointer; }
.fpt:hover { border-color: #d8d4e4; }
.fpt .fpt-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; background: #888; }
.fpt .fpt-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpt svg { width: 14px; height: 14px; flex: none; opacity: .5; }

/* What now? — the ADHD start-friction killer. A primary (purple) toolbar button so it reads as THE
   action, not just another control. Base layout comes from .btn; this only recolours it. */
.page-schedule .toolbar .whatnow-btn { background: #7c3aed; border-color: transparent; color: #fff; box-shadow: 0 6px 16px -8px rgba(124,58,237,.6); }
.page-schedule .toolbar .whatnow-btn:hover { background: #6d28d9; color: #fff; }
.page-schedule .toolbar .whatnow-btn svg { color: #fff; opacity: 1; }
/* Shame-free overdue rescue pill: amber, only shown when tasks have slipped (toggled via [hidden]). */
.page-schedule .toolbar .overdue-btn { background: rgba(214,131,22,.12); border-color: rgba(214,131,22,.34); color: #9a5b08; font-weight: 700; }
.page-schedule .toolbar .overdue-btn:hover { background: rgba(214,131,22,.2); color: #7e4906; }
.page-schedule .toolbar .overdue-btn svg { color: #b8690d; opacity: 1; }
body.calm .page-schedule .toolbar .overdue-btn { filter: saturate(.75); }
