*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--fs-base); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; font-feature-settings: "tnum" 1; }
h1, h2, h3 { color: var(--fg); line-height: 1.25; margin: 0 0 var(--sp-2); letter-spacing: -0.01em; }
h1 { font-size: var(--fs-2xl); font-weight: 700; }
h2 { font-size: var(--fs-lg); font-weight: 650; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--primary-strong); }
.muted { color: var(--muted); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip-link { position: absolute; left: -9999px; top: var(--sp-2); background: var(--surface); padding: var(--sp-2) var(--sp-3); border-radius: var(--radius); z-index: 100; }
.skip-link:focus { left: var(--sp-2); }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark { width: 26px; height: 26px; fill: var(--primary); }

/* Top bar */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--sp-5);
  height: 60px; padding: 0 var(--sp-5); background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: var(--sp-2); font-weight: 750; font-size: var(--fs-lg); color: var(--fg); text-decoration: none; min-height: var(--touch); }
.mainnav { display: flex; gap: var(--sp-1); flex: 1; }
.navlink { display: inline-flex; align-items: center; gap: var(--sp-2); min-height: var(--touch); padding: 0 var(--sp-3);
  border-radius: var(--radius); color: var(--muted); text-decoration: none; font-weight: 550; font-size: var(--fs-sm);
  transition: background var(--dur), color var(--dur); }
.navlink:hover { background: var(--bg); color: var(--fg); }
.navlink[aria-current="page"] { background: var(--bg); color: var(--primary-strong); box-shadow: inset 0 -2px 0 var(--primary); }
.topbar-end { position: relative; margin-left: auto; }
.avatar { width: var(--touch); height: var(--touch); border-radius: 50%; border: 1px solid var(--border-strong); background: var(--bg);
  color: var(--primary-strong); font: 700 var(--fs-sm) var(--font); cursor: pointer; }
.avatar:hover { background: var(--border); }
.menu { position: absolute; right: 0; top: calc(100% + var(--sp-2)); min-width: 220px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: var(--sp-2); }
.menu-head { display: flex; flex-direction: column; padding: var(--sp-2) var(--sp-3) var(--sp-3); border-bottom: 1px solid var(--border); margin-bottom: var(--sp-2); font-size: var(--fs-sm); }
.menu-item { display: flex; align-items: center; gap: var(--sp-2); width: 100%; min-height: var(--touch); padding: 0 var(--sp-3);
  border: 0; border-radius: var(--radius); background: none; color: var(--text); font: 500 var(--fs-sm) var(--font); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--bg); }
.menu form { margin: 0; }

/* Layout */
.main { max-width: 1200px; margin: 0 auto; padding: var(--sp-6) var(--sp-5); }
.page-head { margin-bottom: var(--sp-5); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); }

/* Empty state */
.empty { text-align: center; padding: 56px var(--sp-5); }
.empty p { max-width: 52ch; margin-left: auto; margin-right: auto; }
.empty-icon { width: 48px; height: 48px; fill: none; stroke: var(--primary); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
  padding: 10px; box-sizing: content-box; background: var(--bg); border-radius: 50%; margin-bottom: var(--sp-4); }
.empty-actions { display: flex; gap: var(--sp-3); justify-content: center; flex-wrap: wrap; margin-top: var(--sp-5); }
.error-code { font-size: var(--fs-sm); font-weight: 700; color: var(--primary-strong); letter-spacing: .08em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2); min-height: var(--touch); padding: 0 var(--sp-4);
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--fg);
  font: 600 var(--fs-sm) var(--font); text-decoration: none; cursor: pointer; transition: background var(--dur), border-color var(--dur); }
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--primary-strong); border-color: var(--primary-strong); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn[disabled] { opacity: .65; cursor: progress; }
.btn-block { width: 100%; }

/* Forms */
.form { display: flex; flex-direction: column; gap: var(--sp-4); margin-top: var(--sp-4); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: var(--fs-sm); color: var(--fg); }
.field input { min-height: var(--touch); padding: 0 var(--sp-3); border: 1px solid var(--input-border); border-radius: var(--radius);
  background: var(--surface); color: var(--text); font: 400 var(--fs-base) var(--font); width: 100%; }
.field input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.input-group { position: relative; display: flex; }
.input-group input { padding-right: 52px; }
.input-btn { position: absolute; right: 0; top: 0; width: var(--touch); height: 100%; border: 0; background: none; color: var(--muted); cursor: pointer; border-radius: 0 var(--radius) var(--radius) 0; }
.input-btn:hover { color: var(--fg); }
.alert { display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-3); border-radius: var(--radius);
  background: var(--destructive-bg); color: var(--destructive); border: 1px solid currentColor; font-size: var(--fs-sm); font-weight: 550; margin-top: var(--sp-3); }

/* Login */
.auth-body { min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(1200px 500px at 50% -10%, var(--border) 0%, var(--bg) 60%); }
.auth { width: 100%; max-width: 400px; padding: var(--sp-5) var(--sp-4); }
.auth-brand { display: flex; align-items: center; justify-content: center; gap: var(--sp-2); font-weight: 750; font-size: var(--fs-xl); color: var(--fg); margin-bottom: var(--sp-5); }
.auth-card { padding: var(--sp-6); }
.auth-card h1 { font-size: var(--fs-xl); }
.auth-foot { text-align: center; font-size: var(--fs-sm); margin-top: var(--sp-4); }

/* Mobile: nav moves to a bottom bar */
.bottomnav { display: none; }
@media (max-width: 720px) {
  .topbar { padding: 0 var(--sp-4); gap: var(--sp-3); }
  .mainnav { display: none; }
  .main { padding: var(--sp-5) var(--sp-4) 96px; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; background: var(--surface);
    border-top: 1px solid var(--border); padding: var(--sp-1) var(--sp-2) calc(var(--sp-1) + env(safe-area-inset-bottom)); justify-content: space-around; }
  .bottomnav .navlink { flex-direction: column; gap: 2px; font-size: 11.5px; padding: var(--sp-1) var(--sp-2); flex: 1; justify-content: center; }
  .bottomnav .navlink[aria-current="page"] { box-shadow: inset 0 2px 0 var(--primary); }
  .auth-card { padding: var(--sp-5); }
}


/* Password form, field feedback and full-page flash toasts (Step A). */
.account-card { max-width: 560px; padding: var(--sp-6); }
.field-help, .field-error { margin: 0; font-size: var(--fs-sm); }
.field-help { color: var(--muted); }
.field-error { color: var(--destructive); font-weight: 600; }
.notice { padding: var(--sp-3); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--fg); }
#toast-root { position: fixed; right: var(--sp-4); bottom: var(--sp-4); z-index: 100; display: grid; gap: var(--sp-2); width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.toast-ok { border-left: 4px solid var(--primary-strong); }
.toast-error { border-left: 4px solid var(--destructive); }
.toast button { min-width: var(--touch); min-height: var(--touch); border: 0; background: transparent; color: var(--muted); cursor: pointer; }
@media (max-width: 720px) { #toast-root { bottom: 80px; } .account-card { padding: var(--sp-5); } }


/* Phase-2 frozen application frame and shared components. */
.topbar-tools { display: flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.topbar-end { margin-left: 0; }
.main { width: 100%; max-width: 1440px; }
.home-dashboard { display: grid; align-content: start; gap: 1rem; }
.home-dashboard h1 { margin: 0; font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.2; }
.home-actions { display: flex; flex-wrap: wrap; justify-content: end; align-items: start; gap: .5rem; margin-left: auto; }
body:has(.home-dashboard) { background: #fff; }
.home-dashboard { color-scheme: light; --text: #44363b; --fg: #44363b; --muted: #665d62; --surface: #fff; --link: #3b5768; color: var(--text); max-width: 1140px; margin: 1rem auto; }
.home-planner { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); align-items: start; gap: clamp(1rem, 4vw, 4rem); margin-top: .65rem; }
.home-calendar table { width: 100%; table-layout: fixed; border-collapse: collapse; text-align: center; font-size: .85rem; }
.home-calendar th, .home-calendar td { padding: .35rem 0; text-align: center; }
.month-bar { display: flex; justify-content: space-between; align-items: center; background: #f5f3f4; padding: .35rem; border-radius: 5px; }
.month-bar button { width: 34px; height: 34px; border: 0; border-radius: 4px; font-size: 1.15rem; cursor: pointer; }
.home-calendar .month-bar button { background-color: transparent !important; border-color: transparent !important; color: #44363b !important; }
.home-calendar .adjacent { color: #726b70; }
.home-calendar time { display: inline-grid; place-items: center; width: 2em; height: 2em; }
.home-calendar [aria-current=date] { background: #44363b; color: white; border-radius: 4px; font-weight: 700; }
.home-today.card { min-width: 0; padding: .35rem 0; border: 0; box-shadow: none; background: #fff; color: var(--text); }
@media (max-width: 660px) { .home-planner { grid-template-columns: 1fr; } .home-calendar { max-width: 300px; width: 100%; } }
@media (pointer: coarse) { .month-bar button { width: 44px; height: 44px; } }
.home-today h2 { margin: 0 0 .65rem; font-size: 1.1rem; }
.home-dashboard .page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: .7rem 1rem; margin-bottom: 0; }
.planner-intro { display: grid; gap: .35rem; }
.planner-dateline { font-size: .83rem; font-weight: 600; letter-spacing: .025em; color: var(--muted); }
.planner-intro h1 { letter-spacing: -.035em; }
.home-empty { display: flex; align-items: start; gap: .7rem; padding-block: .8rem; }
.home-empty svg { flex: none; color: var(--muted); }
.home-empty p { margin: .2rem 0 0; color: var(--muted); font-size: .9rem; }
.home-today > a { font-size: .875rem; text-underline-offset: .18em; }
@media (min-width: 801px) { .home-dashboard .page-head { padding-bottom: .7rem; } }
.home-today ul { list-style: none; padding: 0; margin: .5rem 0 1rem; }
.home-task-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem 1rem; padding: .5rem 0; overflow-wrap: anywhere; }
.task-due { margin-left: .4rem; color: var(--muted); font-size: .8rem; white-space: nowrap; }
.task-due.is-overdue { color: var(--destructive, #b42318); font-weight: 600; }
.home-upcoming { margin: .25rem 0 0; font-size: .95rem; }
.home-task-row + .home-task-row { border-top: 1px solid var(--border); }
@media (min-width: 801px) and (pointer: fine) {
  .main .btn, .topbar .btn { min-height: 34px; padding: .25rem .75rem; border-radius: 5px; font-size: .875rem; line-height: 1.3; }
  .home-dashboard { gap: .8rem; }
  .main:has(.home-dashboard, .board-page) { padding-block: 1rem; }
}
@media (max-width: 800px), (pointer: coarse) {
  .home-actions .btn { min-height: 44px; }
}
.search-box { display: flex; align-items: center; gap: var(--sp-2); min-height: var(--touch); padding: 0 var(--sp-3); border: 1px solid var(--input-border); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.search-box input { width: 160px; min-height: 40px; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; }
/* Temporarily hide More in both navs. Restore display: flex to bring it back. */
.nav-more { position: relative; display: none; }
.navlink { border: 0; background: transparent; font-family: var(--font); cursor: pointer; }
.nav-more .menu { top: calc(100% + var(--sp-2)); left: 0; right: auto; z-index: var(--z-drawer); }
.nav-count:empty { display: none; }
.nav-count { display: inline-flex; min-width: 20px; min-height: 20px; align-items: center; justify-content: center; border-radius: 10px; background: var(--bg); color: var(--fg); font-size: var(--fs-xs); }
.nav-mobile-only { display: none; }

.chip, .badge { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 26px; max-width: 100%; padding: 2px var(--sp-2); border-radius: var(--radius); font-size: var(--fs-xs); font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.chip-grey { background: var(--st-neutral); color: var(--st-neutral-text); }
.chip-blue { background: var(--st-blue); color: var(--st-blue-text); }
.chip-yellow, .badge-warning { background: var(--st-action); color: var(--st-action-text); }
.chip-purple { background: var(--st-purple); color: var(--st-purple-text); }
.chip-teal, .badge-ok { background: var(--st-teal); color: var(--st-teal-text); }
.chip-green { background: var(--st-live); color: var(--st-live-text); }
.chip-orange { background: var(--st-ended); color: var(--st-ended-text); }
.chip-red, .badge-error, .badge-late { background: var(--st-cancelled); color: var(--st-cancelled-text); }
.badge-late { background: var(--st-late); color: var(--st-late-text); }
.badge { border: 1px solid currentColor; }
.highlight-yellow { background: var(--highlight-yellow); color: var(--highlight-yellow-text); }
.highlight-red { background: var(--highlight-red); color: var(--highlight-red-text); }

.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.tabs { display: flex; gap: var(--sp-1); overflow-x: auto; border-bottom: 1px solid var(--border); }
.tab { min-height: var(--touch); padding: 0 var(--sp-3); border: 0; background: transparent; color: var(--muted); font: 600 var(--fs-sm) var(--font); cursor: pointer; }
.tab[aria-selected="true"] { color: var(--primary-strong); box-shadow: inset 0 -2px 0 var(--primary); }
.tbl-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.tbl th, .tbl td { min-height: var(--touch); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.tbl th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--fg); font-weight: 650; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl .num { text-align: right; font-variant-numeric: tabular-nums; }
.cell { display: inline-flex; align-items: center; min-height: var(--touch); max-width: 100%; overflow-wrap: anywhere; }
.cell[role="button"] { cursor: pointer; border-radius: var(--radius); padding: var(--sp-1) var(--sp-2); }
.cell[role="button"]:hover { background: var(--bg); }
.cell-empty::after { content: "—"; color: var(--muted); }

.field select, .field textarea, .field input[type="date"], .field input[type="number"], .field input[type="search"] { min-height: var(--touch); padding: var(--sp-2) var(--sp-3); border: 1px solid var(--input-border); border-radius: var(--radius); background: var(--surface); color: var(--text); font: 400 var(--fs-base) var(--font); width: 100%; }
.field textarea { min-height: 96px; resize: vertical; }
.field input[type="checkbox"], .field input[type="radio"] { flex: none; width: 24px; height: 24px; margin: 10px; accent-color: var(--primary-strong); }
.field-help, .field-error { overflow-wrap: anywhere; }
.btn-danger { background: var(--destructive); border-color: var(--destructive); color: var(--on-primary); }
.popover { position: absolute; z-index: var(--z-drawer); min-width: 220px; padding: var(--sp-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-lg); }

.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: var(--z-drawer); background: var(--backdrop); }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: var(--z-drawer); width: min(var(--drawer-w), 100vw); overflow-y: auto; padding: var(--sp-5); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.modal { position: fixed; top: 50%; left: 50%; z-index: var(--z-drawer); width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; transform: translate(-50%, -50%); padding: var(--sp-5); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); }
#toast-root { z-index: var(--z-toast); pointer-events: none; }
.toast { pointer-events: auto; }
progress { display: block; width: 100%; height: 12px; accent-color: var(--primary-strong); }
.pagination { display: flex; justify-content: center; align-items: center; gap: var(--sp-3); margin-top: var(--sp-4); }
.skeleton { min-height: 20px; border-radius: var(--radius); background: var(--skeleton); animation: skeleton-pulse 1.4s ease-in-out infinite; }
@keyframes skeleton-pulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
.admin-links { display: grid; grid-template-columns: repeat(auto-fit,minmax(190px,1fr)); gap: var(--sp-3); }
.admin-link { display: flex; align-items: center; min-height: 72px; padding: var(--sp-4); text-decoration: none; font-weight: 650; }
.conflict-current { margin-top: var(--sp-2); padding: var(--sp-2); background: var(--surface-2); }

@media (max-width: 1000px) {
  .topbar { gap: var(--sp-2); }
  .topbar-tools .search-box { display: none; }
  .navlink { padding: 0 var(--sp-2); }
}
@media (max-width: 720px) {
  .topbar-tools { display: none; }
  .topbar-end { margin-left: auto; }
  .drawer { width: 100vw; padding: var(--sp-4) var(--sp-4) 96px; }
  .bottomnav .nav-desktop-only { display: none; }
  .bottomnav .nav-more { flex: 1; }
  .bottomnav .nav-more > .navlink { flex-direction: column; width: 100%; gap: 2px; font-size: 11.5px; padding: var(--sp-1) var(--sp-2); }
  .bottomnav .nav-more .menu { position: fixed; left: var(--sp-3); right: var(--sp-3); bottom: 76px; top: auto; }
  .nav-mobile-only { display: flex; }
  .tbl { font-size: var(--fs-base); }
}
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }


/* Kay's Programmatically palette: accessible, non-CTA semantic accents. */
a { color: var(--link); }
.btn-primary { background: var(--cta-bg); border-color: var(--cta-bg); color: var(--cta-text); }
.btn-primary:hover { background: var(--cta-hover); border-color: var(--cta-hover); color: var(--cta-text); }
.btn-danger { color: var(--on-danger); }

/* One palette for buttons, including component-specific and hover styles.
   Leave outline, opacity and state indicators independent of the fill. */
:is(button, .btn, input[type="button"], input[type="submit"], input[type="reset"], [role="button"]) {
  background-color: #44363B !important;
  border-color: #44363B !important;
  color: #fff !important;
}
:is(button, .btn)[aria-pressed="true"], button[aria-selected="true"] {
  box-shadow: inset 0 -3px currentColor;
}
.navlink[aria-current="page"] { background: var(--nav-active); color: var(--accent-text); box-shadow: inset 0 -2px 0 var(--primary); }
.bottomnav .navlink[aria-current="page"] { box-shadow: inset 0 2px 0 var(--primary); }
.avatar { background: var(--nav-active); color: var(--accent-text); border-color: var(--border-strong); }
.search-box { background: var(--surface); color: var(--muted); }
.search-box input { color: var(--text); }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.tab[aria-selected="true"] { color: var(--link); box-shadow: inset 0 -2px 0 var(--primary); }
.tbl th { background: var(--table-head); color: var(--table-head-text); }
.board-header, .board-lane-header, .lane-head { background: var(--board-header); color: var(--accent-text); }
.tbl tbody tr:hover { background: var(--row-hover); }
.tbl tbody tr[aria-selected="true"], .tbl tbody tr.is-selected, .tbl tbody tr.selected,
.board-card[aria-selected="true"], .board-card.is-selected { background: var(--row-selected); color: var(--accent-text); box-shadow: inset 3px 0 0 var(--primary); }
.tbl tbody tr[aria-selected="true"] a, .tbl tbody tr.is-selected a, .tbl tbody tr.selected a,
.board-card[aria-selected="true"] a, .board-card.is-selected a { color: var(--accent-text); }
.error-code { color: var(--link); }

/* Two-colour focus ring remains visible on white, dark and palette surfaces. */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-outer); }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 2px var(--focus-outer); }

/* Top-right search: mocha outline to match the toolbar buttons. */
.topbar-tools .filters_search-search-form { border-color: #44363b; }

/* Desktop runs about 15% smaller overall; phones keep full-size touch targets. */
@media (min-width: 801px) and (pointer: fine) { html { zoom: .85; } }

/* Home: personal tasks tick off in place and can be unticked the same day. */
.task-main { display: inline-flex; align-items: center; gap: .6rem; min-width: 0; }
.task-check-form { display: contents; }
.home-task-row .task-check {
  display: inline-grid; place-items: center; flex: none;
  width: 20px; height: 20px; min-height: 0; padding: 0;
  border: 1.5px solid #44363b !important; border-radius: 5px;
  background-color: #fff !important; color: transparent !important; cursor: pointer;
}
.home-task-row .task-check[aria-checked="true"] { background-color: #44363b !important; color: #fff !important; }
.home-task-row .task-check:focus-visible { outline: 2px solid #44363b; outline-offset: 2px; }
@media (pointer: coarse) {
  .home-task-row .task-check { width: 24px; height: 24px; }
  .home-task-row .task-check::after { content: ""; position: absolute; inset: -10px; }
  .home-task-row .task-check { position: relative; }
}
.home-task-row.is-done .task-title { color: #9a9195; text-decoration: line-through; text-decoration-color: #c9c2c5; }
.home-task-row.is-done .task-due { color: #b3acaf; }

/* Today's tasks heading sits level with the calendar's month bar. */
.home-today.card { padding-top: 0; }
.home-today h2 { display: flex; align-items: center; min-height: calc(34px + .7rem); margin-top: 0; }
@media (pointer: coarse) { .home-today h2 { min-height: calc(44px + .7rem); } }

/* Owner preference: all interface text displays in lower case. Data is stored as typed. */
body { text-transform: lowercase; }
button, select, .btn { text-transform: inherit; }
input, textarea { text-transform: none; }
input::placeholder, textarea::placeholder { text-transform: lowercase; }

/* Pencil to edit a task line, and the line in edit mode. */
.home-task-row .task-edit-button {
  display: inline-grid; place-items: center; flex: none;
  width: 32px; height: 32px; min-height: 0; padding: 0; border-radius: 6px; cursor: pointer;
  background-color: transparent !important; border-color: transparent !important; color: #8a8085 !important;
}
.home-task-row .task-edit-button:focus-visible { outline: 2px solid #44363b; outline-offset: 1px; }
@media (pointer: coarse) { .home-task-row .task-edit-button { width: 44px; height: 44px; } }
.home-task-row a.task-title { color: inherit; text-decoration: none; }
.home-task-row a.task-title:focus-visible { outline: 2px solid #44363b; outline-offset: 2px; }
.task-edit { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; width: 100%; }
.task-edit input { min-height: 36px; padding: 0 .6rem; border: 0; border-radius: 6px; background: #f5f3f4; color: #44363b; font: inherit; }
.task-edit input:focus { outline: 2px solid #44363b; outline-offset: 1px; }
.task-edit-title { flex: 1 1 14rem; min-width: 0; }
.task-edit .field-error { flex-basis: 100%; }

/* Review panel after creating a campaign: generated tasks, ticked by default. */
.task-review-list { list-style: none; margin: var(--sp-4) 0; padding: 0; }
.task-review-row { display: flex; align-items: flex-start; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid #eee8eb; }
.task-review-text { display: grid; gap: .1rem; min-width: 0; overflow-wrap: anywhere; }
.task-review-meta { color: var(--muted); font-size: .8rem; }
.task-review-row .task-check {
  display: inline-grid; place-items: center; flex: none; margin-top: .1rem;
  width: 20px; height: 20px; min-height: 0; padding: 0; border-radius: 5px; cursor: pointer;
  border: 1.5px solid #44363b !important; background-color: #fff !important; color: transparent !important;
}
.task-review-row .task-check[aria-checked="true"] { background-color: #44363b !important; color: #fff !important; }
.task-review-row .task-check:focus-visible { outline: 2px solid #44363b; outline-offset: 2px; }
@media (pointer: coarse) { .task-review-row .task-check { width: 24px; height: 24px; } }
.task-review-row.is-skipped .task-title, .task-review-row.is-skipped .task-review-meta { color: #a59da1; }
.task-review-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); }

/* Open-campaign button on campaign task lines. */
.home-task-row .task-main { flex: 1 1 auto; }
.home-task-row .task-open-button {
  display: inline-flex; align-items: center; gap: .3rem; flex: none; min-height: 30px; padding: 0 .55rem; border-radius: 6px; cursor: pointer;
  background-color: #f5f3f4 !important; border-color: transparent !important; color: #44363b !important; font-size: .8rem;
}
.home-task-row .task-open-button:focus-visible { outline: 2px solid #44363b; outline-offset: 1px; }
@media (pointer: coarse) { .home-task-row .task-open-button { min-height: 44px; } }

/* My tasks: one working week at a time. */
.my-week { display: grid; gap: 1rem; max-width: 900px; margin: 0 auto; }
.my-week-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .75rem; }
.my-week-head h1 { margin: 0; }
.my-week-head p { margin: .2rem 0 0; }
.my-week-nav { display: flex; flex-wrap: wrap; gap: .4rem; }
.my-week-day h2 { margin: 0 0 .25rem; font-size: 1rem; }
.my-week-day.is-today h2 { color: #44363b; }
.my-week-today { margin-left: .4rem; padding: .05rem .45rem; border-radius: 999px; background: var(--st-live); font-size: .75rem; font-weight: 600; }
.my-week-carried { padding: .75rem 1rem; border-radius: 8px; background: #f5f3f4; }
.my-week-list { list-style: none; margin: 0; padding: 0; }
.my-week-list .home-task-row { display: flex; align-items: center; gap: .5rem 1rem; padding: .45rem 0; }
.my-week-list .home-task-row + .home-task-row { border-top: 1px solid var(--border); }
.my-week-empty { margin: 0; color: var(--muted); font-size: .9rem; }

/* White pages everywhere, like Home. */
body { background: #fff; }

/* Current page in the menus: a mocha underline, not a filled box. */
.navlink[aria-current="page"] { background: transparent; color: #44363b; box-shadow: inset 0 -2px 0 #44363b; }
.bottomnav .navlink[aria-current="page"] { background: transparent; box-shadow: inset 0 2px 0 #44363b; }

/* My tasks: each day on the calendar grey; last week's leftovers on the board-header pink. */
.my-week-day { padding: .75rem 1rem; border-radius: 8px; background: #f5f3f4; }
.my-week-carried { background: var(--board-header); }
.my-week-day .home-task-row + .home-task-row { border-top-color: rgb(68 54 59 / .12); }

/* Day-1 and creative-change checklists. */
.checklist-page { display: grid; gap: 1rem; max-width: 900px; margin: 0 auto; }
.checklist-nav { align-items: center; }
.checklist-date input { min-height: 34px; padding: 0 .6rem; border: 0; border-radius: 6px; background: #f5f3f4; color: #44363b; font: inherit; }
.checklist-scope { display: flex; flex-wrap: wrap; gap: .35rem; }
.checklist-text { display: grid; gap: .1rem; min-width: 0; }
.checklist-detail { color: var(--muted); font-size: .8rem; }
.checklist-row .checklist-next { min-height: 30px; padding: 0 .6rem; font-size: .8rem; }
.checklist-row.is-done .checklist-detail { color: #b3acaf; }
.reports-when { margin-left: .3rem; color: var(--muted); font-size: .75rem; }

/* Person circles (table people columns, board cards): first initial in the person's colour. */
.avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: 0; }
.avatar-purple { background: var(--st-purple); color: var(--st-purple-text); }
.avatar-pink { background: #F6C9DD; color: #7A1F4B; }
.avatar-blue { background: var(--st-blue); color: var(--st-blue-text); }
.avatar-orange { background: var(--st-ended); color: var(--st-ended-text); }
.avatar-yellow { background: var(--st-action); color: var(--st-action-text); }
.avatar-grey { background: var(--st-neutral); color: var(--st-neutral-text); }
.avatar-note { margin-left: var(--sp-1); color: var(--muted); font-size: var(--fs-xs); }
/* The campaign table uses the full window width so more columns fit in one view. */
.main:has(> .table-page) { max-width: none; }
.status-dot { display: inline-block; flex: none; width: 12px; height: 12px; margin-left: 5px; border-radius: 50%; }
.status-dot-green { background: #3FA772; }
.status-dot-red { background: #D64545; }
/* Day-1 / creative: month calendar beside the day's list. Yellow = still to do, green = all done. */
.checklist-page { max-width: 1100px; }
.checklist-body { display: grid; grid-template-columns: 280px minmax(0, 1fr); align-items: start; gap: 1.25rem; }
.checklist-calendar { padding: .75rem; border-radius: 8px; background: #f5f3f4; }
.checklist-cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.checklist-cal-step { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; color: #44363b; text-decoration: none; font-size: 1.1rem; }
.checklist-cal-step:hover { background: #fff; }
.checklist-cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
.checklist-cal th { padding: .2rem 0; color: var(--muted); font-size: .75rem; font-weight: 600; text-align: center; }
.checklist-cal td { padding: 2px; text-align: center; }
.checklist-cal-day { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%; color: #44363b; font-size: .85rem; text-decoration: none; }
.checklist-cal-day:hover { background: #fff; }
.checklist-cal-day.is-pending { background: #FCE8B2; color: #713F12; font-weight: 700; }
.checklist-cal-day.is-done { background: #B7E1CD; color: #14532D; font-weight: 700; }
.checklist-cal-day.is-today { box-shadow: inset 0 0 0 1.5px #44363b; }
.checklist-cal-day.is-selected { outline: 2px solid #44363b; outline-offset: 1px; }
.checklist-cal-key { display: flex; align-items: center; gap: .35rem; margin: .5rem 0 0; color: var(--muted); font-size: .75rem; }
.checklist-key { display: inline-block; width: 10px; height: 10px; margin-left: .4rem; border-radius: 50%; }
.checklist-key.is-pending { background: #FCE8B2; }
.checklist-key.is-done { background: #B7E1CD; }
.checklist-nav .btn.is-current { opacity: .55; }
@media (max-width: 760px) { .checklist-body { grid-template-columns: minmax(0, 1fr); } }
/* Initials sit in the middle of the circle: centre the letters' x-height, not the line box. */
.avatar-text { display: block; line-height: 1; text-box: trim-both ex alphabetic; }
