/* My Planner.
 *
 * The visual language is Student Tasks' (Sean Michael's approved Today view): navy and Batten
 * orange, Inter for the working text and Libre Caslon Text for the page's voice, cards
 * with a status stripe in Monday's own color, solid Monday-colored status blocks, and a
 * time rail with an orange "now" line. What is new here is a planner's: the day's
 * masthead, a one-click check on every task, a side column for what is coming, a week
 * you can drag tasks across, and boards you choose. */

:root {
  --navy: #232D4B; --navy-2: #1a2240; --orange: #E57200; --blue: #17679F;
  --bg: #EEF1F6; --card: #fff; --tint: #F4F7FB; --tint-2: #F7F8FB;
  --text: #232D4B; --text-light: #5A6378; --text-muted: #616A7E; --ink: #1E2438;
  --border: #DDE1E9; --border-2: #E7EAF1;
  --ok: #1E8E3E; --warn: #B26A00; --bad: #C5221F;
  --urgent-bg: #FFF3E8; --urgent-line: #F5C39C; --urgent-ink: #9A3412; --urgent-deep: #C2410C;
  /* "Now" as text or a pill: Batten orange deep enough to read (5:1 on the page, white on it 5.7:1). */
  --now: #B4400F;
  --shadow: 0 1px 3px rgba(35,45,75,0.08), 0 1px 2px rgba(35,45,75,0.06);
  --shadow-md: 0 4px 12px rgba(35,45,75,0.10), 0 1px 3px rgba(35,45,75,0.08);
  --shadow-lg: 0 12px 32px rgba(35,45,75,0.18);
  --radius: 10px; --radius-sm: 6px; --radius-lg: 14px;
  --serif: 'Libre Caslon Text', Georgia, serif;
}
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
.fbs { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--text-muted); }
.bad { color: var(--bad); }
.ok { color: var(--ok); }
[hidden] { display: none !important; }

/* ── FBS app-shell chrome (the block every app carries; the nav markup is injected) ── */
header.fbs { background: var(--navy); color: white; padding: 10px 24px; display: flex; align-items: center; justify-content: space-between; }
.fbs .header-left { display: flex; align-items: center; }
.fbs .header-logo { height: 24px; margin-right: 16px; }
.fbs .header-divider { width: 1px; height: 32px; background: rgba(255,255,255,0.3); margin-right: 16px; }
.fbs .header-text { display: flex; flex-direction: column; }
.fbs .header-brand-name { font-size: 16px; font-weight: 700; letter-spacing: 0.3px; }
.fbs .header-tool { font-size: 12px; font-weight: 500; opacity: 0.7; margin-top: 1px; }
.fbs .app-shell { display: flex; min-height: calc(100vh - 48px); }
.fbs .nav-sidebar { width: 220px; background: var(--navy-2); color: white; display: flex; flex-direction: column; flex-shrink: 0; overflow: hidden; z-index: 20; }
.fbs .nav-sidebar.animate { transition: width 0.2s; }
.fbs .nav-sidebar.collapsed { width: 48px; }
.fbs .nav-sidebar.collapsed .nav-label, .fbs .nav-sidebar.collapsed .nav-section-label { display: none; }
.fbs .nav-sidebar.collapsed .nav-item { justify-content: center; padding: 10px 0; }
.fbs .nav-sidebar.collapsed .nav-item svg { margin: 0; }
.fbs .nav-sidebar.collapsed .nav-toggle { text-align: center; padding: 10px 0; }
.fbs .nav-sidebar.collapsed .nav-icon-chevron { display: none; }
.fbs .nav-toggle { padding: 10px 14px; cursor: pointer; border: none; background: none; color: rgba(255,255,255,0.5); font-size: 16px; text-align: right; transition: color 0.15s; }
.fbs .nav-toggle:hover { color: white; }
.fbs .nav-icon-chevron { opacity: 0.6; }
.fbs .nav-section-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: rgba(255,255,255,0.35); padding: 16px 16px 6px; font-weight: 600; }
.fbs .nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,0.7); text-decoration: none; transition: all 0.12s; cursor: pointer; border: none; background: none; width: 100%; text-align: left; white-space: nowrap; border-left: 3px solid transparent; }
.fbs .nav-item:hover { background: rgba(255,255,255,0.08); color: white; }
.fbs .nav-item.active { background: rgba(255,255,255,0.12); color: white; font-weight: 700; border-left-color: var(--orange); }
.fbs .nav-item svg { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.7; }
.fbs .nav-item.active svg { opacity: 1; }
.fbs .nav-label { overflow: hidden; }
.fbs .nav-spacer { flex: 1; }
.fbs .nav-item.disabled { opacity: 0.3; pointer-events: none; }
.fbs .nav-item.nav-sub { padding-left: 40px; font-size: 12px; }
.fbs .nav-sidebar.collapsed .nav-item.nav-sub { padding-left: 0; }
.fbs .main { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ── Toolbar: views on the left, search and the planner's own controls on the right ── */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 24px 0; }
.toolbar .spacer { flex: 1; }
.view-switch { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.view-switch button { border: none; background: none; padding: 8px 16px; font-size: 13px; font-weight: 600; color: var(--text-light); cursor: pointer; }
.view-switch button + button { border-left: 1px solid var(--border); }
.view-switch button.active { background: var(--navy); color: white; }
.view-switch button.active + button, .view-switch button + button.active { border-left-color: var(--navy); }
.view-switch button:focus-visible { outline: 2px solid var(--orange); outline-offset: -2px; }
.range { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; }
.range-label { min-width: 150px; text-align: center; font-family: var(--serif); font-size: 16px; color: var(--navy); }
.btn-tool { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--card); border-radius: var(--radius-sm); padding: 7px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--text); box-shadow: var(--shadow); }
.btn-tool:hover:not(:disabled) { border-color: var(--navy); }
.btn-tool:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.btn-tool svg { width: 15px; height: 15px; flex-shrink: 0; }
/* Square, with the icon dead center (the gear's drawing is centered on its hole, too). */
.btn-tool.icon { padding: 7px; justify-content: center; }
.btn-tool.icon svg { width: 17px; height: 17px; }
.search { position: relative; display: inline-flex; align-items: center; }
.search svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--text-muted); pointer-events: none; }
.search input { width: 220px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px 8px 32px; font: inherit; font-size: 13px; background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.search input:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }

/* The strip that acts on the tasks: 10px from them, 12px below the toolbar — closer to
   what it filters than to the controls above it (proximity says which is which). */
.subbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 24px 0; }
/* It wraps rather than run past a narrow screen's edge (it once made the page 507px wide on a phone). */
.subbar-right { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: 8px 12px; margin-left: auto; max-width: 100%; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); background: var(--card); color: var(--text-light); border-radius: 999px; padding: 5px 11px 5px 9px; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.pill i { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--bc, #9AA2B1); }
.pill:hover { border-color: var(--bc, var(--navy)); }
.pill.on { color: var(--navy); border-color: var(--bc); background: #F1F3F7; background: color-mix(in srgb, var(--bc) 12%, white); }
.pill.on i { background: var(--bc); }
.pill-count { font-size: 11px; font-weight: 700; color: var(--text-muted); }
.pill.on .pill-count { color: var(--navy); }
.pill-warn { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--warn); color: white; font-size: 10.5px; font-weight: 800; }
.pill:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.fresh { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-light); cursor: pointer; user-select: none; }
.switch { position: relative; flex-shrink: 0; width: 38px; height: 22px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; margin: 0; }
.switch .slider { position: absolute; inset: 0; cursor: pointer; background: #cfd2da; border-radius: 22px; transition: background 0.2s; }
.switch .slider::before { content: ""; position: absolute; height: 16px; width: 16px; left: 3px; top: 3px; background: white; border-radius: 50%; transition: transform 0.2s; box-shadow: 0 1px 2px rgba(0,0,0,0.25); }
.switch input:checked + .slider { background: var(--orange); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:focus-visible + .slider { outline: 2px solid var(--navy); outline-offset: 2px; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: none; background: none; padding: 7px 14px; font-size: 13px; font-weight: 600; color: var(--text-light); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on, .seg button.active { background: var(--navy); color: white; }
.seg.small button { padding: 5px 11px; font-size: 12px; }

/* ── Banners, loading, empty ── */
#banners:empty { display: none; }
.banner { margin: 12px 24px 0; padding: 11px 15px; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; }
.banner.warn { background: #FDF3E3; border: 1px solid #F2D9AC; color: #7A4A00; }
.banner.bad { background: #FCE8E6; border: 1px solid #F5C4C0; color: #8C1D18; }
.content { padding: 18px 24px 56px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 90px 20px; color: var(--text-muted); font-size: 14px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); border-top-color: var(--navy); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--text-muted); padding: 70px 20px; font-size: 14px; line-height: 1.6; max-width: 560px; margin: 0 auto; }
.empty strong { font-size: 17px; color: var(--text); }
.hint { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin: 6px 0; }
.link { background: none; border: none; padding: 0; color: var(--blue); font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--blue) 40%, transparent); }
.link:hover { text-decoration-color: currentColor; }
.btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--navy); background: var(--navy); color: white; border-radius: var(--radius-sm); padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.btn-primary:hover:not(:disabled) { background: #2E3A5F; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }
.btn-ghost { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--card); color: var(--navy); border-radius: var(--radius-sm); padding: 6px 12px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.btn-ghost:hover { border-color: var(--navy); }
.btn-ghost.danger { color: var(--bad); }
.btn-ghost.danger:hover { border-color: var(--bad); }

/* ── Today: the day's sheet, with what is coming in the margin ── */
.today-view { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; align-items: start; max-width: 1240px; }
.masthead { margin: 6px 0 4px; }
.day-title { font-family: var(--serif); font-weight: 400; font-size: 31px; line-height: 1.15; color: var(--navy); margin: 0; letter-spacing: -0.2px; }
.day-summary { margin: 8px 0 0; font-size: 14.5px; color: var(--text-light); max-width: 62ch; line-height: 1.55; }
/* "Filtered": a search or switched-off boards are hiding some of the day, so the page,
   and its sentence, are not about all of it. */
.filter-note { display: flex; align-items: baseline; gap: 4px 10px; flex-wrap: wrap; max-width: 76ch; margin: 12px 0 0; padding: 8px 12px; background: #EAF1F9; border: 1px solid #C9DAEC; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; color: var(--navy); }
.filter-tag { flex-shrink: 0; padding: 1px 8px; border-radius: 999px; background: var(--navy); color: white; font-size: 11px; font-weight: 700; letter-spacing: 0.3px; }
.filter-note + .day-summary { margin-top: 10px; }

.sec { margin-top: 40px; }
.sec-title { display: flex; align-items: baseline; gap: 12px; font-family: var(--serif); font-size: 17px; font-weight: 400; color: var(--navy); margin: 0 0 12px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--border); transform: translateY(-4px); }
.count { font-family: 'Inter', sans-serif; font-size: 11.5px; font-weight: 700; color: var(--text-muted); background: var(--border-2); border-radius: 999px; padding: 2px 9px; }
.sec.bad .sec-title { color: var(--bad); }
.sec.bad .count { background: #FCE8E6; color: var(--bad); }
.sec-note { font-size: 12.5px; color: var(--text-muted); margin: -6px 0 10px; }
.more { margin-top: 10px; }
.more, .tray-toggle { background: none; border: none; color: var(--blue); font-weight: 600; font-size: 13px; cursor: pointer; padding: 4px 0; }
.tray-toggle { display: inline-flex; align-items: baseline; gap: 10px; }
.tray-toggle::before { content: "›"; display: inline-block; width: 8px; transition: transform 0.15s; color: var(--text-muted); }
.tray-toggle[aria-expanded="true"]::before { transform: rotate(90deg); }

/* Do first: the work to clear before anything on the clock — its own warm zone, as in
   Student Tasks' ASAP Today. Calms to nothing once it is empty (it is not drawn). */
.zone-urgent { margin-top: 32px; padding: 16px 16px 18px; background: var(--urgent-bg); border: 1px solid var(--urgent-line); border-left: 6px solid var(--orange); border-radius: var(--radius); }
.zone-urgent .sec-title { color: var(--urgent-ink); align-items: center; }
.zone-urgent .sec-title::after { background: var(--urgent-line); transform: none; }
.zone-urgent .count { background: var(--urgent-deep); color: white; }
.pulse { flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(229,114,0,0.55); } 70% { box-shadow: 0 0 0 9px rgba(229,114,0,0); } 100% { box-shadow: 0 0 0 0 rgba(229,114,0,0); } }

.quiet-day { background: var(--card); border: 1px dashed var(--border); border-radius: var(--radius); padding: 18px 20px; font-size: 14px; color: var(--text-light); }
.quiet-day strong { color: var(--navy); }

/* ── The task card ── */
.cards { display: grid; gap: 8px; }
.task { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 4px 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px 14px 12px 17px; overflow: hidden; transition: border-color 0.12s, box-shadow 0.12s, opacity 0.2s; }
.task::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--st, #9AA2B1); }
.task:hover { border-color: #B9C0CE; }
.task.active { border-color: var(--navy); box-shadow: 0 0 0 2px var(--navy); }
.task.done { opacity: 0.72; }
.task.done .tk-name { text-decoration: line-through; text-decoration-color: rgba(35,45,75,0.35); }
.task.urgent { border-color: #EFA877; box-shadow: 0 1px 2px rgba(154,52,18,0.10), 0 6px 16px rgba(229,114,0,0.14); }
.task.urgent .tk-name { color: #7C2D12; }
.task.compact { padding: 8px 10px 8px 13px; gap: 2px 10px; box-shadow: none; }
.task.compact::before { width: 4px; }

/* The check: the action taken most, so it is big enough to hit and looks like a check. */
.tk-check { width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; border: 2px solid #AAB2C2; background: white; display: grid; place-items: center; cursor: pointer; padding: 0; color: transparent; transition: background 0.15s, border-color 0.15s, color 0.15s; }
.tk-check svg { width: 14px; height: 14px; }
.tk-check:hover:not(:disabled) { border-color: var(--ok); color: rgba(30,142,62,0.45); }
.tk-check.on { background: var(--ok); border-color: var(--ok); color: white; }
.tk-check:disabled { opacity: 0.55; cursor: progress; }
.tk-check.placeholder { border: none; background: none; cursor: default; width: 22px; }
.task.compact .tk-check { width: 18px; height: 18px; border-radius: 5px; }
.task.compact .tk-check svg { width: 12px; height: 12px; }
/* The tick animates only on a check made a moment ago (main.js marks it just-done for a few
   seconds), so a redraw of the page never replays every tick on it. */
@media (prefers-reduced-motion: no-preference) {
  .tk-check.on.just-done svg { animation: tick 0.28s ease-out; }
  @keyframes tick { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
}

.tk-open { display: grid; gap: 3px; min-width: 0; background: none; border: none; padding: 0; text-align: left; cursor: pointer; color: inherit; }
.tk-open:focus-visible { outline: 2px solid var(--navy); outline-offset: 3px; border-radius: 4px; }
.tk-name { font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--navy); overflow-wrap: anywhere; }
.task.compact .tk-name { font-size: 13.5px; font-weight: 500; }
.tk-ctx { display: block; font-size: 12px; line-height: 1.45; color: var(--text-muted); }
.tk-ctx .bdot { margin-right: 6px; vertical-align: 1px; }
.ctx-board { font-weight: 600; color: var(--text-light); }
.ctx-sep { color: #A8AFBD; margin: 0 5px; }
.tk-when { font-size: 12.5px; color: var(--text-light); }
.tk-when.overdue, .tk-when .late { color: var(--bad); font-weight: 600; }
.from-parent { color: var(--text-muted); font-weight: 400; }
.bdot { display: inline-block; flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--bc, #9AA2B1); }
.bdot.lg { width: 12px; height: 12px; }
.badge { display: inline-block; vertical-align: 2px; margin-left: 8px; font-size: 10px; font-weight: 700; letter-spacing: 0.4px; border-radius: 4px; padding: 2px 6px; color: var(--text-muted); background: var(--border-2); }
.badge.urgent { color: white; background: var(--bad); }
.badge.high { color: white; background: #B4400F; }
.badge.new { color: white; background: var(--blue); }

/* The status chip is a control (it opens the menu), so it looks pressable: a pill with
   Monday's color in its dot and tint. */
.chip { flex-shrink: 0; align-self: center; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 4px 11px 4px 9px; border-radius: 999px; white-space: nowrap; color: var(--navy); border: 1px solid transparent; background: #F1F3F7; background: color-mix(in srgb, var(--st, #9AA2B1) 14%, white); cursor: pointer; }
.chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--st, #9AA2B1); }
.chip:hover:not(:disabled) { border-color: color-mix(in srgb, var(--st, #9AA2B1) 70%, var(--navy)); }
.chip:disabled { opacity: 0.6; cursor: progress; }
.chip.static { cursor: default; }

/* ── Meetings and agenda rows: thinner and quieter than tasks — context, not work ── */
.evs { display: grid; gap: 6px; }
.ev { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 2px 10px; width: 100%; min-width: 0;
  background: #EDF0F6; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; color: var(--text-light); }
.ev:hover { border-color: #B9C0CE; }
.ev.agenda { background: #F2F4F8; background: color-mix(in srgb, var(--bc) 8%, white); border-color: color-mix(in srgb, var(--bc) 25%, white); }
.ev-tag { display: inline-flex; align-items: center; color: var(--text-muted); }
.ev-tag svg { width: 13px; height: 13px; }
.ev-tag .bdot { background: var(--bc); }
/* The button that opens the row covers all of it (its ::after), so the row still clicks as
   one; a join link sits above that layer, since a link cannot go inside a button. */
.ev-open { min-width: 0; margin: 0; padding: 0; border: none; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.ev-open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-sm); }
.ev-open:focus-visible { outline: none; }
.ev-open:focus-visible::after { outline: 2px solid var(--navy); outline-offset: 2px; }
.ev-name { font-size: 13.5px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.ev-meta { grid-column: 2; min-width: 0; font-size: 12px; color: var(--text-muted); display: flex; align-items: baseline; gap: 2px 10px; flex-wrap: wrap; }
.ev-time { white-space: nowrap; }

/* A meeting's place and its join link (render.js locationView, which the panel uses too).
   Nothing here may be wider than its box: the place wraps, even inside a long word, and
   the link's words are few. */
.loc { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; min-width: 0; max-width: 100%; }
.loc-place { display: inline-flex; align-items: baseline; gap: 4px; min-width: 0; }
.loc-place > span { min-width: 0; overflow-wrap: anywhere; }
.loc-place svg { flex-shrink: 0; align-self: center; width: 11px; height: 11px; }
.loc .loc-join { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--blue); text-decoration: none; white-space: nowrap; }
.loc .loc-join svg { flex-shrink: 0; width: 13px; height: 13px; color: inherit; }
.loc-join:hover { text-decoration: underline; text-underline-offset: 2px; }
.loc-join:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 3px; }
.panel-head > .loc { display: flex; margin-top: 10px; font-size: 13px; color: var(--text-light); }

/* ── The day's rail: an agenda, not a scaled grid, so a tall card never pushes the next
   item off its hour. A node per item carries the eye; open work whose moment has passed
   does NOT fade — it says so. ── */
.tl { list-style: none; margin: 0; padding: 0; }
.tl-row { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 0 12px; padding: 5px 0; }
.tl-time { text-align: right; font-size: 12px; font-weight: 600; color: var(--text-light); padding-top: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-row.ev-row .tl-time { padding-top: 10px; }
.tl-row.anytime .tl-time { color: var(--navy); }
.tl-body { position: relative; padding-left: 20px; min-width: 0; }
.tl-body::before { content: ""; position: absolute; left: 4px; top: -5px; bottom: -5px; width: 2px; background: var(--border); }
.tl-body::after { content: ""; position: absolute; left: -1px; top: 16px; width: 8px; height: 8px; border-radius: 50%; background: var(--card); border: 2px solid var(--st, #9AA2B1); }
.tl-row.ev-row .tl-body::after { top: 11px; border-color: #B8BFCC; }
.tl-row.anytime .tl-body::after { border-color: var(--navy); background: var(--navy); }
.tl-row.past .tl-time, .tl-row.past .tl-body > * { opacity: 0.5; }
.tl-row.past .tl-body > *:hover { opacity: 0.9; }
/* On now (started, not yet over): said in the time column, its node filled, the row warm,
   where what is over fades. */
.tl-live { display: block; width: fit-content; margin: 5px 0 0 auto; padding: 1px 7px; border-radius: 999px; background: var(--now); color: white; font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px; line-height: 1.5; }
.tl-row.on .tl-body::after { background: var(--now); border-color: var(--now); }
.tl-row.on .ev { background: #FFF6EE; border-color: #EDC3A6; }
.tl-now { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 0 12px; align-items: center; margin: 6px 0; }
.tl-now .tl-time { padding: 0; color: var(--now); font-weight: 700; }
.tl-now-line { position: relative; height: 2px; background: var(--orange); margin-left: 4px; }
.tl-now-line::before { content: ""; position: absolute; left: -4px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }
.tl-now-line span { position: absolute; right: 0; top: -8px; padding: 1px 8px; border-radius: 999px; background: var(--now); box-shadow: 0 0 0 3px var(--bg); font-size: 10.5px; font-weight: 700; letter-spacing: 1px; line-height: 1.5; color: white; }

.done-today { margin-top: 36px; }
.done-today summary { display: flex; align-items: baseline; gap: 10px; cursor: pointer; font-family: var(--serif); font-size: 16px; color: var(--text-light); margin-bottom: 10px; list-style: none; }
.done-today summary::-webkit-details-marker { display: none; }
.done-today summary::before { content: "›"; display: inline-block; transition: transform 0.15s; font-family: 'Inter', sans-serif; color: var(--text-muted); }
.done-today[open] summary::before { transform: rotate(90deg); }

/* The margin: smaller type, no shadows — supporting, not primary. */
.today-side { position: sticky; top: 16px; display: grid; gap: 14px; }
.side-block { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 16px 14px; }
.side-block.quiet { background: var(--tint-2); }
.side-block.warn { border-color: #F2D9AC; background: #FDF9F1; }
.side-title { font-family: var(--serif); font-weight: 400; font-size: 16px; color: var(--navy); margin: 0 0 10px; }
.side-day + .side-day { margin-top: 12px; }
.side-day-title { font-size: 11.5px; font-weight: 700; color: var(--text-light); margin: 0 0 6px; letter-spacing: 0.2px; }
.side-text { font-size: 13px; line-height: 1.55; color: var(--text-light); margin: 0 0 10px; }
.side-empty { font-size: 13px; color: var(--text-muted); margin: 0 0 10px; }
.side-block > .link { margin-top: 12px; }

/* ── Week: seven days to plan across. Drag a task to another day to move it. ── */
/* minmax(0, 1fr), not the default auto column: a long overdue strip or the seven days on a
   phone then scroll inside their own boxes instead of widening the whole page. */
.week { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.wk-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; align-items: stretch; }
.wk-day { display: flex; flex-direction: column; min-height: 320px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); transition: background 0.12s, border-color 0.12s, box-shadow 0.12s; min-width: 0; }
.wk-day.today { border-color: var(--orange); box-shadow: 0 0 0 1px var(--orange); }
.wk-day.past { background: var(--tint-2); }
.wk-head { display: flex; align-items: baseline; gap: 6px; padding: 10px 10px 8px; border-bottom: 1px solid var(--border-2); }
.wk-dow { font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.wk-date { font-family: var(--serif); font-size: 20px; color: var(--navy); }
.wk-day.today .wk-date { color: var(--orange); }
.wk-head .count { margin-left: auto; }
.wk-list { display: grid; align-content: start; gap: 6px; padding: 8px; flex: 1; }
.wk-list .task { grid-template-columns: auto minmax(0, 1fr); padding: 8px 9px 8px 12px; gap: 2px 8px; box-shadow: none; }
.wk-list .task .chip { display: none; }
.wk-list .task .tk-name { font-size: 13px; }
.wk-list .task .tk-ctx { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.wk-list .task .tk-ctx .bdot { margin-right: 5px; vertical-align: 1px; }
.wk-list .task .tk-check { width: 18px; height: 18px; border-radius: 5px; }
.wk-list .task .tk-check svg { width: 12px; height: 12px; }
.wk-empty { margin: 4px 2px; font-size: 12px; color: #A8AFBD; }
/* What is on the calendar, under the day's tasks: one quiet line each, not a card, set
   off from the work by a dashed rule. */
.wk-cal { display: grid; gap: 1px; margin-top: 4px; padding-top: 6px; border-top: 1px dashed var(--border); }
.wk-list > .wk-cal:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.wk-ev { display: flex; align-items: baseline; gap: 6px; width: 100%; min-width: 0; margin: 0; padding: 3px 4px; border: none; border-radius: 4px; background: none; font-size: 12px; line-height: 1.35; color: var(--text-light); text-align: left; cursor: pointer; }
.wk-ev:hover { background: var(--tint); color: var(--ink); }
.wk-ev:focus-visible { outline: 2px solid var(--navy); outline-offset: 0; }
.wk-ev-time { flex-shrink: 0; font-size: 11px; font-weight: 600; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.wk-ev-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-ev-name .bdot { width: 7px; height: 7px; margin-right: 5px; vertical-align: 1px; background: var(--bc); }
.wk-ev.agenda .wk-ev-name { font-weight: 600; color: var(--ink); }
.wk-more { justify-self: start; margin: 1px 0 0; padding: 3px 4px; border: none; background: none; font-size: 12px; font-weight: 600; color: var(--blue); cursor: pointer; }
.wk-more:hover { text-decoration: underline; text-underline-offset: 2px; }
.wk-earlier, .wk-tray { min-width: 0; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.wk-earlier { border-color: #F5C4C0; background: #FFF8F7; }
.wk-earlier .sec-title { color: var(--bad); }
/* The undated tray sits above the days, a single line until opened. */
.wk-tray { padding: 8px 16px; background: var(--tint-2); }
.wk-tray.open { padding: 12px 16px 14px; background: var(--card); }
.wk-tray .sec-title { margin: 0; }
.wk-tray.open .sec-title { margin-bottom: 8px; }
/* One row that scrolls sideways, so a long overdue list never pushes the week off screen. */
.wk-strip { grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); overflow-x: auto; padding-bottom: 4px; overscroll-behavior-x: contain; }
/* The tray's cards: rows, at most about two of them tall, scrolling inside the tray, so
   the days stay just below to drag onto. */
.wk-tray-cards { grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr)); max-height: 232px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 4px 2px; }
.wk-strip .task, .wk-tray-cards .task { grid-template-columns: auto minmax(0, 1fr); box-shadow: none; }
.wk-strip .task .chip, .wk-tray-cards .task .chip { display: none; }
.task[draggable="true"] { cursor: grab; }
.task.dragging { opacity: 0.4; }
.is-dragging .wk-day, .is-dragging .mo-cell { border-style: dashed; }
.drop-hover { background: #EAF2FA !important; border-color: var(--blue) !important; box-shadow: 0 0 0 2px var(--blue) !important; }

/* ── Month: the big picture of deadlines ── */
.mo-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: var(--border); gap: 1px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.mo-dow { background: var(--tint); padding: 8px 10px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); }
.mo-cell { background: var(--card); min-height: 116px; padding: 6px 6px 8px; display: grid; align-content: start; gap: 3px; min-width: 0; }
.mo-cell.out { background: var(--tint-2); }
.mo-cell.out .mo-date { color: #A8AFBD; }
.mo-cell.today { box-shadow: inset 0 0 0 2px var(--orange); }
.mo-date { justify-self: start; background: none; border: none; padding: 2px 6px; border-radius: 999px; font-family: var(--serif); font-size: 15px; color: var(--navy); cursor: pointer; }
.mo-date:hover { background: var(--tint); }
.mo-cell.today .mo-date { background: var(--orange); color: white; }
.mo-item { display: block; width: 100%; text-align: left; border: none; border-radius: 4px; padding: 3px 6px 3px 8px; font-size: 12px; font-weight: 500; color: var(--ink); background: #F1F3F7; background: color-mix(in srgb, var(--st) 12%, white); box-shadow: inset 3px 0 0 var(--st); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.mo-item:hover { background: color-mix(in srgb, var(--st) 22%, white); }
.mo-item.done { text-decoration: line-through; opacity: 0.6; }
.mo-item.overdue { color: var(--bad); font-weight: 600; }
.mo-item.ev { background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--bc) 35%, white); color: var(--text-light); }
.mo-item.ev::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--bc); margin-right: 5px; vertical-align: 1px; }
.mo-more { justify-self: start; background: none; border: none; padding: 1px 6px; font-size: 11.5px; font-weight: 600; color: var(--blue); cursor: pointer; }

/* ── All tasks ── */
.list { max-width: 980px; }
.list .sec:first-child { margin-top: 8px; }

/* ── First run ── */
.welcome { max-width: 680px; margin: 26px auto 0; }
.welcome-lead { font-size: 15px; line-height: 1.6; color: var(--text-light); margin: 10px 0 26px; }
.welcome-boards .sec-title { margin-top: 0; }
.choices { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.choice { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.choice-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.choice-name { font-size: 14px; font-weight: 600; color: var(--navy); }
.choice-meta { font-size: 12.5px; color: var(--text-muted); line-height: 1.45; }
.choice-done { font-size: 12.5px; color: var(--ok); font-weight: 600; }
.search-boards { margin-top: 20px; display: grid; gap: 8px; }
.search-results:empty { display: none; }
.field-label { font-size: 12.5px; font-weight: 600; color: var(--navy); }
.input { width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 10px; font: inherit; font-size: 13px; color: var(--text); background: white; }
.input:focus-visible { outline: 2px solid var(--blue); outline-offset: 0; border-color: var(--blue); }
select.input { padding-right: 28px; }

/* ── The panel: identity / action band / primary / history ── */
.scrim { position: fixed; inset: 0; background: rgba(26,34,64,0.32); z-index: 90; opacity: 0; transition: opacity 0.2s; }
.scrim.open { opacity: 1; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--bg); z-index: 100; box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform 0.22s ease; display: flex; flex-direction: column; }
.panel.open { transform: none; }
.panel-scroll { overflow-y: auto; height: 100%; }
.panel-head { background: var(--card); padding: 16px 22px 18px; border-bottom: 1px solid var(--border); }
.panel-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel-ctx { display: inline-flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); font-weight: 600; }
.panel-ctx svg { width: 14px; height: 14px; }
.x { width: 32px; height: 32px; display: grid; place-items: center; border: none; background: none; border-radius: 8px; cursor: pointer; color: var(--text-muted); flex-shrink: 0; }
.x:hover { background: var(--tint); color: var(--navy); }
.x svg { width: 16px; height: 16px; }
.panel-title { font-size: 21px; font-weight: 700; line-height: 1.3; color: var(--navy); margin: 0; overflow-wrap: anywhere; }
.panel-title:focus { outline: none; }
.panel-parent { margin: 6px 0 0; font-size: 13px; color: var(--text-light); }
.panel-parent strong { color: var(--navy); font-weight: 600; }
.panel-when { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: 10px 0 0; font-size: 13px; color: var(--text-light); }
.panel-when svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); }
.panel-when.overdue { color: var(--bad); font-weight: 600; }
.panel-note { margin: 6px 0 0 21px; font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.panel-note strong { color: var(--text-light); font-weight: 600; }
.open-monday { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--blue); text-decoration: none; }
.open-monday svg { width: 13px; height: 13px; }
.open-monday:hover { text-decoration: underline; text-underline-offset: 3px; }

.panel-band { background: var(--tint); border-bottom: 1px solid var(--border); padding: 14px 22px 16px; display: grid; gap: 14px; }
/* Why this task cannot be changed from the planner, first in the band: a calm notice (a
   lock, a slightly deeper tint than the band), not an error. */
.band-locked { position: relative; margin: 0; padding: 9px 14px 9px 36px; background: #E6EBF3; border: 1px solid #D3DAE6; border-radius: var(--radius-sm); font-size: 13px; line-height: 1.5; color: var(--text); }
.band-locked::before { content: ""; position: absolute; left: 13px; top: 12px; width: 14px; height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3' y='7' width='10' height='7' rx='1.5' fill='none' stroke='%235A6378' stroke-width='1.5'/%3E%3Cpath d='M5.5 7V5a2.5 2.5 0 0 1 5 0v2' fill='none' stroke='%235A6378' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat center / contain; }
.band-row { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: start; }
.band-label { font-size: 12.5px; font-weight: 700; color: var(--navy); padding-top: 9px; }
.band-label label { cursor: pointer; }
.band-note { font-size: 13px; color: var(--text-light); padding-top: 8px; line-height: 1.5; }
.status-blocks { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; }
.sblock { border: none; border-radius: 4px; padding: 9px 10px; font-size: 13px; font-weight: 600; cursor: pointer; text-align: center; transition: filter 0.1s, transform 0.05s; }
.sblock:hover:not(:disabled) { filter: brightness(0.95); }
.sblock:active:not(:disabled) { transform: scale(0.98); }
.sblock.current { outline: 2.5px solid var(--navy); outline-offset: 2px; }
.sblock:disabled { opacity: 0.55; cursor: progress; }
.sblock.static { display: block; cursor: default; }
.due-ctl { display: grid; gap: 8px; }
.input.date { width: auto; min-width: 170px; justify-self: start; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-btn { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 4px 11px; font-size: 12px; font-weight: 600; color: var(--navy); cursor: pointer; }
.pill-btn:hover:not(:disabled) { border-color: var(--navy); }
.prio-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pchip { border: 1px solid var(--border); background: var(--card); border-radius: 999px; padding: 4px 11px 4px 9px; font-size: 12px; font-weight: 600; color: var(--navy); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pchip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pc); }
.pchip.current { border-color: var(--navy); box-shadow: inset 0 0 0 1px var(--navy); }

.zones { padding: 14px 14px 32px; display: grid; gap: 12px; }
.zone { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px 18px; }
.zone-title { font-size: 13.5px; font-weight: 700; color: var(--navy); margin: 0 0 10px; }
.notes-text { font-size: 14px; line-height: 1.65; color: var(--ink); overflow-wrap: anywhere; }
.notes-text a, .c-text a { color: var(--blue); }
textarea.input { resize: vertical; line-height: 1.55; }
.input.notes { font-size: 14px; color: var(--ink); }
.notes-actions { display: flex; gap: 8px; margin-top: 8px; }
.composer { display: grid; gap: 8px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-row .hint { margin: 0; }
.thread { margin-top: 14px; }
.comments { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.comment { background: #F5F7FB; border-radius: 10px; padding: 10px 12px; }
.c-by { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12.5px; color: var(--navy); margin-bottom: 4px; }
.c-text { font-size: 13.5px; line-height: 1.55; color: var(--ink); overflow-wrap: anywhere; }
.machine { margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.machine summary { cursor: pointer; }
.machine-lines { list-style: none; margin: 8px 0 0; padding: 0 0 0 10px; border-left: 2px solid var(--border); display: grid; gap: 4px; }
.machine-lines li { display: flex; gap: 8px; justify-content: space-between; }

/* ── The status menu (from a card's chip) ── */
.menu { position: fixed; z-index: 150; display: grid; gap: 5px; width: 220px; padding: 8px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.menu .sblock { text-align: left; }

/* ── Dialogs ── */
.modal-scrim { z-index: 190; }
.modal { position: fixed; z-index: 200; left: 50%; top: 6vh; transform: translate(-50%, 8px); opacity: 0; transition: opacity 0.16s, transform 0.16s; width: min(820px, calc(100vw - 32px)); max-height: 88vh; overflow-y: auto; background: var(--card); border-radius: var(--radius-lg); border-top: 5px solid var(--orange); box-shadow: var(--shadow-lg); }
.modal.open { opacity: 1; transform: translate(-50%, 0); }
.dlg-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; background: var(--card); z-index: 2; }
.dlg-title { font-family: var(--serif); font-weight: 400; font-size: 23px; color: var(--navy); margin: 0; }
.dlg-title:focus { outline: none; }
.dlg-sub { margin: 6px 0 0; font-size: 13px; line-height: 1.55; color: var(--text-light); max-width: 70ch; }
.dlg-body { padding: 8px 24px 26px; display: grid; gap: 24px; }
.dlg-section { font-size: 14px; font-weight: 700; color: var(--navy); margin: 14px 0 10px; }
.dlg-note { font-size: 13px; line-height: 1.55; color: var(--text-light); margin: -4px 0 12px; max-width: 72ch; }
.sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.source { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
.source.open { border-color: #B9C0CE; box-shadow: var(--shadow-md); }
.source-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.source-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.source-name { font-size: 14.5px; font-weight: 600; color: var(--navy); }
.source-meta { font-size: 12.5px; color: var(--text-muted); }
.source-also { font-size: 12px; color: var(--text-muted); }
.source-actions { display: flex; gap: 6px; flex-shrink: 0; }
.source-form { border-top: 1px solid var(--border-2); background: var(--tint-2); padding: 14px 16px 16px; border-radius: 0 0 var(--radius) var(--radius); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 28px; }
.form-col { display: grid; align-content: start; gap: 10px; }
.form-title { font-size: 12.5px; font-weight: 700; color: var(--text-light); margin: 6px 0 0; }
.form-row { display: grid; gap: 5px; margin: 0; padding: 0; border: none; min-width: 0; }
.form-row.inline { display: flex; gap: 8px; align-items: center; }
.form-row .grow { flex: 1; }
fieldset.form-row legend { padding: 0; margin-bottom: 4px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; line-height: 1.4; }
.check input { margin: 2px 0 0; accent-color: var(--navy); }
.check.strong { font-weight: 600; color: var(--navy); }
.sub-form { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); display: grid; gap: 10px; }
.form-actions { display: flex; gap: 8px; margin-top: 16px; }
.form-actions.start { margin-top: 0; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid white; box-shadow: 0 0 0 1px var(--border); background: var(--sw); cursor: pointer; padding: 0; }
.swatch.picked { box-shadow: 0 0 0 2px var(--navy); }
.help { font-size: 12.5px; color: var(--text-light); margin-top: 10px; }
.help summary { cursor: pointer; color: var(--blue); font-weight: 600; }
.help ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.6; }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 24px; margin: 0; }
.keys div { display: flex; gap: 10px; align-items: baseline; }
.keys dt { flex-shrink: 0; min-width: 110px; }
.keys dd { margin: 0; font-size: 13px; color: var(--text-light); }
kbd { display: inline-block; min-width: 22px; text-align: center; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; background: var(--tint-2); font: 600 11.5px 'Inter', sans-serif; color: var(--navy); }

/* ── Toast ── */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); opacity: 0; transition: opacity 0.18s, transform 0.18s; z-index: 1300; display: flex; align-items: center; gap: 14px; max-width: min(620px, calc(100vw - 32px)); background: var(--navy); color: white; padding: 11px 14px 11px 18px; border-radius: 999px; font-size: 13.5px; box-shadow: var(--shadow-lg); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #8C1D18; }
.toast-act { border: 1px solid rgba(255,255,255,0.55); background: none; color: white; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.toast-act:hover { background: rgba(255,255,255,0.12); }

/* ── Narrower screens ── */
@media (max-width: 1180px) {
  .today-view { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  /* One column: the margin's "Coming up" comes before the record of what is already done,
     so an open "Done today" never pushes it down. (.today-main's children join the grid.) */
  .today-main { display: contents; }
  .today-side { order: 1; margin-top: 36px; position: static; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
  .done-today { order: 2; }
  .wk-grid { grid-template-columns: repeat(7, minmax(150px, 1fr)); overflow-x: auto; padding-bottom: 6px; overscroll-behavior-x: contain; }
}
@media (max-width: 760px) {
  /* A phone: tighter controls, so the day itself starts in the top half of the screen. */
  .toolbar { gap: 8px; padding: 10px 14px 0; }
  .subbar { gap: 6px 10px; padding: 8px 14px 0; }
  .toolbar > .view-switch { width: 100%; }
  .toolbar > .view-switch button { flex: 1; padding: 8px 6px; white-space: nowrap; }
  .search { flex: 1 1 140px; order: 1; min-width: 0; }
  .search input { width: 100%; }
  .toolbar > [data-action="boards"] { order: 2; }
  .toolbar > [data-action="settings"] { order: 3; }
  .range { order: 4; width: 100%; margin-left: 0; }
  .range-label { flex: 1; min-width: 0; font-size: 15px; }
  .toolbar .spacer { display: none; }
  /* The board buttons in one row that scrolls sideways, not three rows of them. */
  .pills { flex: 1 1 100%; flex-wrap: nowrap; min-width: 0; overflow-x: auto; padding-bottom: 3px; scrollbar-width: thin; overscroll-behavior-x: contain; }
  .subbar-right { width: 100%; margin-left: 0; }
  .content { padding: 12px 14px 48px; }
  .banner { margin-left: 14px; margin-right: 14px; }
  .day-title { font-size: 26px; }
  .masthead { margin-top: 2px; }
  .tl-row, .tl-now { grid-template-columns: 58px minmax(0, 1fr); gap: 0 8px; }
  .task { grid-template-columns: auto minmax(0, 1fr); }
  .task .chip { grid-column: 2; justify-self: start; }
  .mo-dow { padding: 6px 4px; }
  .mo-cell { min-height: 84px; padding: 4px 3px 6px; }
  .mo-item { font-size: 11px; padding: 2px 4px 2px 6px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .keys { grid-template-columns: minmax(0, 1fr); }
  .band-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .band-label { padding-top: 0; }
  .modal { top: 0; max-height: 100vh; border-radius: 0; width: 100vw; }
  .source-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
