/* Repeat: one stylesheet, no build step. Visual language follows Clockwork (DESIGN.md):
   cobalt for action, cool-white ground, white rounded cards with soft shadows, pills to press,
   12px to type into, 20px to read inside. Archivo self-hosted; light + dark follow the OS. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --shell: #ffffff; --shell-2: #ebeff8; --shell-ink: #111a2e; --shell-muted: #364159;
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #ebeff8;
  --ink: #111a2e; --ink-2: #364159; --muted: #5b667e;
  --line: #e2e7f1; --line-strong: #c6cfe0; --field-edge: #868fa5;
  --accent: #2456e6; --accent-hover: #1a45c4; --accent-ink: #ffffff; --accent-soft: #e4ecff;
  --ok: #0c7f5a; --ok-soft: #d9f7ea; --fail: #d1274e; --fail-soft: #ffe4ea;
  --warn: #8c5a00; --warn-soft: #fff2c4; --info: #0a68b8; --info-soft: #e0f1ff;
  --neutral: #546078; --neutral-soft: #e9edf5;
  --shadow: 0 1px 2px rgb(20 40 90 / 0.05), 0 8px 24px rgb(20 40 90 / 0.06);
  --shadow-pop: 0 16px 40px rgb(20 40 90 / 0.18), 0 2px 8px rgb(20 40 90 / 0.08);
  --radius: 20px; --radius-sm: 12px; --pill: 999px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  /* Avatar tints: identity only, never status */
  --color-a: #c9d6ff; --color-b: #ffe8a3; --color-c: #ffd3e3; --color-d: #c3f0dc;

  /* Aliases still referenced from inline styles in app.js */
  --card: var(--surface); --mute: var(--muted); --fill-1: var(--surface-2);
  --active: var(--accent); --overdue: var(--fail); --reject: var(--warn);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --shell: #151b29; --shell-2: #1f2738; --shell-ink: #f0f3fa; --shell-muted: #c8d0e0;
    --bg: #0c111c; --surface: #151b29; --surface-2: #1f2738;
    --ink: #f0f3fa; --ink-2: #c8d0e0; --muted: #98a3b8;
    --line: #29324a; --line-strong: #434e68; --field-edge: #6b7794;
    --accent: #7fa3ff; --accent-hover: #a0bcff; --accent-ink: #071433; --accent-soft: #17294f;
    --ok: #4fdcae; --ok-soft: #10352a; --fail: #ff7d99; --fail-soft: #3f1622;
    --warn: #ffd257; --warn-soft: #3a2e0c; --info: #6cc0ff; --info-soft: #0f2e47;
    --neutral: #b3bccf; --neutral-soft: #232c40;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-pop: 0 16px 40px rgb(0 0 0 / 0.6), 0 2px 8px rgb(0 0 0 / 0.4);
    --color-a: #33437a; --color-b: #5c4a16; --color-c: #5a2a40; --color-d: #1f4a3a;
    color-scheme: dark;
  }
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--muted) transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  caret-color: var(--accent);
}
::selection { background: var(--accent); color: var(--accent-ink); }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
p { margin: 0; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
ul { margin: 0; padding: 0; }
.mono { font-family: var(--mono); font-size: .9em; }
.text-mute { color: var(--muted); }
.text-overdue { color: var(--fail); font-weight: 650; }
.flex-1 { flex: 1; }
hr.divider { border: none; border-top: 1px solid var(--line); margin: 0; }
.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;
}

/* ── Focus ── */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[tabindex="-1"]:focus { outline: none; }

/* ── Shell: sticky top bar + one centred column ── */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.25rem;
  height: 68px; padding: 0 1.5rem;
  background: var(--shell); color: var(--shell-ink);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex; align-items: center; gap: .5rem;
  color: var(--shell-ink); font-weight: 800; font-size: 1.25rem; text-decoration: none;
  letter-spacing: -0.01em;
}
.brand-mark { width: 26px; height: 26px; color: var(--accent); flex: 0 0 26px; }
.nav { display: flex; align-items: center; gap: .25rem; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.nav::-webkit-scrollbar { display: none; }
.admin-tabs { display: flex; gap: .25rem; overflow-x: auto; scrollbar-width: none; margin: 0 0 1.5rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.admin-tabs::-webkit-scrollbar { display: none; }
.nav-item {
  position: relative;
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .5rem .9rem; border-radius: var(--pill);
  color: var(--shell-muted); font-size: 1rem; font-weight: 550; white-space: nowrap;
  text-decoration: none; transition: background .12s;
}
.nav-item:hover { background: var(--shell-2); color: var(--shell-ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-item .badge {
  min-width: 1.4rem; padding: 0 .4rem; border-radius: var(--pill);
  background: var(--surface-2); color: var(--ink-2);
  font-size: .8rem; font-weight: 650; text-align: center; line-height: 1.4rem;
}
.nav-item .badge:empty { display: none; }
.nav-item .badge.urgent { background: var(--fail-soft); color: var(--fail); }
.nav-item.active .badge { background: var(--surface); }
.viewer { display: flex; align-items: center; gap: .5rem; flex: 0 0 auto; }
/* The burger shows on phones only; on wider screens its menu is just the bar's contents. */
.top-menu { display: contents; }
.top .nav-burger { display: none; position: relative; margin-left: auto; }
.nav-burger-dot {
  position: absolute; top: .3rem; right: .3rem; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 2px var(--shell);
}
.nav-burger-dot.urgent { background: var(--fail); }
.viewer label { font-size: .85rem; color: var(--muted); font-weight: 600; white-space: nowrap; }
.viewer select { width: auto; min-height: 2.25rem; padding: .3rem 2.1rem .3rem .9rem; border-radius: var(--pill); font-size: .92rem; background-position: right .75rem center; }

.main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 1.75rem 1.5rem 4rem; flex: 1; }

/* ── Page head: big plain headline left, actions right ── */
.page-header {
  display: flex; align-items: flex-end; flex-wrap: wrap; gap: .75rem 1rem;
  margin-bottom: 1.5rem;
}
.page-title { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: .35rem; }
.page-header h1 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem); font-weight: 800; line-height: 1.08;
  letter-spacing: -0.025em; overflow-wrap: anywhere;
}
.page-header .sub { font-size: 1.1rem; color: var(--muted); }
.page-header .back { font-size: .95rem; font-weight: 600; text-decoration: none; color: var(--ink-2); align-self: flex-start; padding: .5rem 0; margin: -.5rem 0 -.15rem; }
.page-header .back:hover { color: var(--accent); }
.page-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.page-header .chip { align-self: flex-start; }

/* ── Buttons: pills that give when pressed ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.75rem; padding: .6rem 1.2rem;
  font: 650 .99rem/1.3 var(--font);
  border: 1px solid var(--line-strong); border-radius: var(--pill);
  background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .12s, border-color .12s, transform .12s, box-shadow .12s;
}
.btn:hover { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn.primary {
  background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  box-shadow: 0 6px 16px color-mix(in srgb, var(--accent) 30%, transparent);
}
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 2.1rem; padding: .3rem .8rem; font-size: .85rem; }
.btn.danger { background: var(--fail); border-color: var(--fail); color: var(--surface); }
.btn.reject-btn { color: var(--ink); }
.btn:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ── Inputs: 12px corners ── */
input[type="text"], input[type="email"], input[type="search"], input[type="number"], input[type="datetime-local"], input[type="time"], input[type="date"], select, textarea {
  width: 100%; min-height: 2.75rem; padding: .6rem .8rem;
  font: 400 .95rem/1.4 var(--font);
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--field-edge); border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
}
/* Selects: drop the platform arrow, draw one chevron in the muted ink (redrawn for dark below). */
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 2.5rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b667e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  background-size: 1rem;
}
select::-ms-expand { display: none; }
select:disabled { cursor: not-allowed; opacity: .6; }
@media (prefers-color-scheme: dark) {
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2398a3b8' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  }
}
input[type="date"] { cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .55; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: .9; }
input[type="date"]:disabled { cursor: not-allowed; opacity: .6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
textarea { resize: vertical; min-height: 6rem; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--fail); }
input[aria-invalid="true"]:focus, select[aria-invalid="true"]:focus, textarea[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--fail-soft); }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--accent); cursor: pointer; }
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }
input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

label.field-label, legend.field-label, .field > .field-label {
  display: block; margin-bottom: .4rem;
  font-size: .95rem; font-weight: 650; color: var(--ink);
}
.field { margin-bottom: 1.1rem; }
.field-hint, .modal-hint { font-size: .95rem; color: var(--muted); margin-top: .35rem; }
.field-required { color: var(--fail); }
.field-error { font-size: .95rem; color: var(--fail); font-weight: 600; margin-top: .35rem; }
.fieldset { border: none; margin: 0 0 1.1rem; padding: 0; min-width: 0; }
.fieldset legend { padding: 0; }

/* ── Status: soft fill + word, quiet unless failing ── */
.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .1rem .6rem; border-radius: var(--pill);
  font-size: .85rem; font-weight: 650; line-height: 1.5; white-space: nowrap;
  background: var(--neutral-soft); color: var(--neutral);
}
.chip.active, .chip.up, .chip.open  { background: var(--info-soft); color: var(--info); }
.chip.done, .chip.acknowledged    { background: var(--ok-soft);   color: var(--ok); }
.chip.overdue { background: var(--fail-soft); color: var(--fail); }
.chip.warn, .chip.reject, .chip.done_late { background: var(--warn-soft); color: var(--warn); }
.chip.pending, .chip.waiting { background: var(--neutral-soft); color: var(--neutral); }
.chip.ended { background: var(--neutral-soft); color: var(--ink-2); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: 0 0 8px; display: inline-block; }
.dot.active  { background: var(--info); }
.dot.done    { background: var(--ok); }
.dot.overdue { background: var(--fail); }
.dot.warn    { background: var(--warn); }
.dot.pulse   { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.nav .dot { display: none; }

/* ── Avatars ── */
.avatar {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); color: var(--ink);
  font-size: .78rem; font-weight: 700; box-shadow: 0 0 0 2px var(--surface);
}
.avatar { position: relative; }
.avatar-photo { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.avatar.sm { width: 24px; height: 24px; flex-basis: 24px; font-size: .66rem; letter-spacing: -0.02em; }
.avatar.lg { width: 34px; height: 34px; flex-basis: 34px; font-size: .9rem; }
.avatar.a { background: var(--color-a); } .avatar.b { background: var(--color-b); }
.avatar.c { background: var(--color-c); } .avatar.d { background: var(--color-d); }
.avatars-stack { display: flex; }
.avatars-stack { gap: 6px; }

/* ── Cards ── */
.task-card, .table-wrap, .detail-sidebar, .progress-block, .board-card, .form-wrap {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}

/* ── Section headings (subtitle) and purpose lines ── */
.section-header, .section-label, .form-section-title {
  font-size: 1.2rem; font-weight: 700; color: var(--ink); letter-spacing: -0.005em;
}
h2.section-header { margin: 0 0 .75rem; }
.section-count { color: var(--muted); font-weight: 600; margin-left: .3rem; }
.block-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: .25rem .75rem; margin-bottom: 1rem; }
.block-head .section-header { margin: 0; }
.block-meta { font-size: 1rem; color: var(--muted); }

/* ── Task list ── */
.filter-bar { margin-bottom: 1.5rem; max-width: 520px; }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search-wrap input { padding-left: 2.4rem; border-radius: var(--pill); }
#task-list-body { display: flex; flex-direction: column; gap: 1.75rem; }
h2.section-label { margin: 0 0 .75rem; }
.task-card { overflow: hidden; }
.task-row {
  display: flex; align-items: center; gap: .9rem;
  padding: .85rem 1.25rem; color: inherit; text-decoration: none;
  border-bottom: 1px solid var(--line); transition: background .12s;
}
.task-row:last-child { border-bottom: none; }
.task-row:hover { background: var(--surface-2); }
.task-row:focus-visible { outline-offset: -3px; border-radius: var(--radius); }
.task-row-name { flex: 1; min-width: 0; }
.task-title { font-weight: 650; font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-sub { font-size: .9rem; color: var(--muted); margin-top: .1rem; }
.task-deadline { min-width: 7rem; text-align: right; font-size: .95rem; color: var(--ink-2); }
.task-deadline.overdue { color: var(--fail); font-weight: 650; }
.empty-line {
  margin: 0; padding: 1.1rem 1.25rem; font-size: 1rem; color: var(--muted);
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state p { margin: 0 0 1rem; font-size: 1.05rem; color: var(--ink-2); }

/* ── Dashboard ── */
.dashboard { display: flex; flex-direction: column; gap: 2.5rem; }
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; align-items: start; }
.board-col { min-width: 0; }
.board-col-title { display: flex; align-items: baseline; gap: .3rem; margin: 0 0 .75rem; font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.board-col.overdue .board-col-title { color: var(--fail); }
.board-col-body { display: flex; flex-direction: column; gap: .85rem; }
.board-empty {
  margin: 0; padding: 1rem 1.1rem; font-size: .95rem; color: var(--muted);
  border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.board-card { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .6rem; }
.board-card.mine { box-shadow: var(--shadow), inset 0 0 0 2px var(--accent-soft); }
.board-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.board-card-title { font-size: 1.02rem; font-weight: 700; color: var(--ink); text-decoration: none; line-height: 1.3; overflow-wrap: anywhere; }
.board-card-title:hover { color: var(--accent); }
.board-card-sub { font-size: .9rem; color: var(--muted); }
.board-card-meta { display: flex; align-items: center; gap: .6rem; }
.board-card-progress { font-size: .92rem; color: var(--ink-2); }
.board-card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
.board-card-due { font-size: .92rem; color: var(--ink-2); }
.board-card-due.late { color: var(--fail); font-weight: 650; }
@media (max-width: 1180px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .board { grid-template-columns: 1fr; } }

.table-wrap { overflow-x: auto; position: relative; } /* keeps absolutely placed .sr-only text inside the scroller */
.owned-table { width: 100%; border-collapse: collapse; font-size: 1rem; }
.owned-table th {
  text-align: left; font-size: .89rem; font-weight: 650; color: var(--muted);
  padding: .8rem 1rem; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.owned-table td { padding: .7rem 1rem; border-bottom: 1px solid var(--line); color: var(--ink-2); vertical-align: top; }
.owned-table tr:last-child td { border-bottom: none; }
.owned-table td a { color: var(--ink); font-weight: 650; text-decoration: none; }
.owned-table td a:hover { color: var(--accent); }
.owned-table td.late { color: var(--fail); font-weight: 650; }
.owned-table td.mono { font-size: .88rem; color: var(--muted); }
/* The small End button sits on the title's first line, so it lines up with the other cells. */
.owned-table .row-actions { width: 1%; padding: .35rem .6rem .35rem 0; text-align: right; white-space: nowrap; }

/* ── Task detail ── */
.detail-shell { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.75rem; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 1.75rem; min-width: 0; }
.detail-sidebar { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: calc(68px + 1.5rem); }
.detail-sidebar .section-header { font-size: 1.05rem; margin-bottom: .6rem; }
.detail-desc { font-size: 1rem; color: var(--ink-2); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.meta-grid { display: grid; grid-template-columns: 7.5rem 1fr; gap: .5rem .75rem; font-size: .95rem; }
.meta-key { color: var(--muted); }
.meta-val { color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 960px) {
  .detail-shell { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
}

/* Attention block: flat, coral, large corners */
.overdue-banner {
  padding: 1rem 1.5rem; border-radius: var(--radius);
  background: var(--fail-soft); color: var(--fail);
  font-size: 1rem; font-weight: 650;
}

/* Your turn: the task's only action surface */
.turn-band {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1rem 1.5rem;
  padding: 1.35rem 1.5rem; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
}
.turn-band.mine { background: var(--accent-soft); box-shadow: none; }
.turn-band.mine.overdue { background: var(--fail-soft); }
.turn-text { flex: 1 1 320px; min-width: 0; }
.turn-title { font-size: 1.65rem; font-weight: 750; letter-spacing: -0.012em; margin: 0 0 .3rem; color: var(--ink); }
.turn-sub { font-size: 1.02rem; color: var(--ink-2); line-height: 1.5; }
.turn-sub .mono { white-space: nowrap; font-family: var(--font); font-size: 1em; font-weight: 650; color: var(--ink); }
.turn-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

.progress-block { padding: 1.5rem; }
.assignee-state-row { display: flex; align-items: center; gap: .8rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
.assignee-state-row:last-child { border-bottom: none; padding-bottom: 0; }
.assignee-state-row:first-child { padding-top: 0; }
.assignee-state-info { flex: 1; min-width: 0; }
.assignee-state-name { font-weight: 650; }
.assignee-state-sub { font-size: .9rem; color: var(--muted); }
/* The Instance's Escalation Target, under its Steps */
.escalation-row { display: flex; align-items: center; gap: .5rem; margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--line); }

/* Sequential stepper */
.seq-stepper { display: flex; flex-direction: column; }
.seq-step { display: flex; gap: 1rem; }
.seq-rail { display: flex; flex-direction: column; align-items: center; flex: 0 0 32px; }
.seq-node {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; font-weight: 750;
  background: var(--surface-2); color: var(--muted);
}
.seq-node.done    { background: var(--ok-soft); color: var(--ok); }
.seq-node.active  { background: var(--accent-soft); color: var(--accent); }
.seq-node.overdue { background: var(--fail-soft); color: var(--fail); }
.seq-line { width: 2px; flex: 1; min-height: 16px; background: var(--line); margin: 4px 0; }
.seq-content { flex: 1; min-width: 0; padding-bottom: 1.25rem; }
.seq-step:last-child .seq-content { padding-bottom: 0; }
.seq-name { font-size: 1rem; font-weight: 700; }
.seq-detail { margin-top: .5rem; padding: .7rem .9rem; border-radius: var(--radius-sm); font-size: .95rem; color: var(--ink-2); }
.seq-detail.done    { background: var(--ok-soft); }
.seq-detail.active  { background: var(--accent-soft); }
.seq-detail.overdue { background: var(--fail-soft); color: var(--fail); }

/* History */
.history-header { display: flex; align-items: center; margin-bottom: .75rem; }
.history-event { display: flex; gap: .8rem; align-items: flex-start; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.history-event:last-child { border-bottom: none; }
.event-icon {
  width: 26px; height: 26px; flex: 0 0 26px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 750; background: var(--neutral-soft); color: var(--neutral);
}
.event-icon.ack      { background: var(--ok-soft); color: var(--ok); }
.event-icon.snooze, .event-icon.reject { background: var(--warn-soft); color: var(--warn); }
.event-icon.advance  { background: var(--accent-soft); color: var(--accent); }
.event-icon.overdue, .event-icon.escalate { background: var(--fail-soft); color: var(--fail); }
.event-icon.swap     { background: var(--accent-soft); color: var(--accent); }
.event-icon.task_ended { background: var(--neutral-soft); color: var(--ink-2); }
.event-body { flex: 1; min-width: 0; }
.event-label { font-size: 1rem; color: var(--ink); overflow-wrap: anywhere; }
.event-meta { font-size: .88rem; color: var(--muted); margin-top: .1rem; }

.note-box {
  padding: .8rem 1rem; border-radius: var(--radius-sm);
  background: var(--warn-soft); color: var(--warn);
  font-size: .92rem; line-height: 1.5;
}

/* ── Create form ── */
.form-wrap { max-width: 720px; margin: 0; padding: 1.75rem 1.75rem .75rem; }
.form-section-title { margin: 1.5rem 0 .9rem; }
.form-wrap .form-section-title:first-of-type { margin-top: 0; }
.form-alert {
  margin-bottom: 1.1rem; padding: .9rem 1.1rem; border-radius: var(--radius-sm);
  background: var(--fail-soft); color: var(--fail); font-weight: 600;
}
.draft-status { font-size: .92rem; color: var(--muted); }

.workflow-toggle {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface-2); border-radius: var(--pill);
}
.workflow-toggle button {
  min-height: 2.75rem; padding: .5rem 1.2rem;
  font: 650 .95rem var(--font); color: var(--ink-2);
  background: transparent; border: none; border-radius: var(--pill); cursor: pointer;
}
.workflow-toggle button.active { background: var(--accent); color: var(--accent-ink); }

.assignee-list { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 .6rem; padding: 0; list-style: none; }
.assignee-list:empty { display: none; }
.assignee-pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .2rem .3rem .2rem .3rem; border-radius: var(--pill);
  background: var(--surface-2); font-size: .95rem; font-weight: 600;
}
.assignee-pill .pill-order { color: var(--muted); padding-left: .3rem; }
.channel-options { display: flex; gap: 1.25rem; }
.channel-option { display: inline-flex; align-items: center; gap: .6rem; min-height: 2.75rem; padding: 0 .25rem; font-size: 1rem; cursor: pointer; }

/* ── Dialogs: centred, floating ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: rgb(12 17 28 / .45);
}
.modal-sheet {
  width: 100%; max-width: 520px; max-height: calc(100vh - 3rem); overflow-y: auto;
  padding: 1.75rem; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-pop);
}
.modal-sheet h2 { font-size: 1.65rem; font-weight: 750; letter-spacing: -0.012em; }
.modal-sheet h2.field-label { font-size: 1.65rem; }
.modal-handle { display: none; }
.modal-sheet.modal-wide { max-width: 880px; }
.modal-sheet .cal { border: 0; padding: 0; }
.cal-open { margin-top: .6rem; }
.modal-actions { display: flex; gap: .5rem; margin-top: 1.25rem; }
.modal-actions .btn { flex: 1; min-width: 0; white-space: normal; text-align: center; }
.end-body { display: flex; flex-direction: column; gap: .6rem; font-size: 1rem; color: var(--ink-2); line-height: 1.5; }
@media (max-width: 640px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-sheet { border-radius: var(--radius) var(--radius) 0 0; max-height: 92vh; padding: 1.25rem; }
  .modal-handle { display: block; width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 auto 1rem; }
}

.snooze-header { margin-bottom: 1.25rem; }
.snooze-section { margin-bottom: 1.1rem; }
.snooze-section-label { display: block; margin-bottom: .5rem; font-size: .95rem; font-weight: 650; color: var(--ink); }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.preset {
  display: flex; flex-direction: column; align-items: flex-start; gap: .15rem;
  padding: .7rem .9rem; border-radius: 16px; cursor: pointer; text-align: left;
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line-strong);
  transition: background .12s, border-color .12s, transform .12s;
}
.preset:hover:not(:disabled) { background: var(--accent-soft); border-color: var(--accent-soft); }
.preset:active:not(:disabled) { transform: scale(.97); }
.preset.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.preset:disabled { cursor: not-allowed; opacity: .55; }
.preset-label { font-size: .95rem; font-weight: 700; }
.preset-time { font-size: .85rem; opacity: .85; }
@media (max-width: 520px) { .preset-row { grid-template-columns: 1fr; } }
.nl-input-wrap { position: relative; }
.nl-parsed { display: block; margin-top: .4rem; font-size: .95rem; font-weight: 650; color: var(--accent); }
.nl-parsed.error { color: var(--fail); }

/* ── Toast (also the live region) ── */
.toast {
  position: fixed; left: 50%; top: calc(68px + 1rem); z-index: 200;
  transform: translate(-50%, -12px); opacity: 0; pointer-events: none;
  max-width: calc(100vw - 2rem); padding: .75rem 1.25rem; border-radius: var(--pill);
  background: var(--ink); color: var(--bg); font-weight: 650; box-shadow: var(--shadow-pop);
  transition: opacity .2s ease-out, transform .2s ease-out;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast:empty { display: none; }

/* ── Loading / boot ── */
.loading { display: flex; align-items: center; justify-content: center; min-height: 50vh; color: var(--muted); font-size: 1.05rem; }
.boot-error { display: grid; gap: 1rem; justify-items: center; text-align: center; color: var(--ink-2); }
.boot-error p { font-size: 1.1rem; }

/* ── Narrow screens ── */
@media (max-width: 720px) {
  .top { height: 60px; padding: 0 1rem; gap: .75rem; }
  .top .nav-burger { display: inline-flex; }
  .top-menu { display: none; }
  .top.nav-open .top-menu {
    display: flex; flex-direction: column; gap: 1rem;
    position: absolute; top: 100%; left: 0; right: 0;
    max-height: calc(100vh - 60px); overflow-y: auto;
    padding: .75rem 1rem 1.25rem;
    background: var(--shell); border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgb(0 0 0 / .18);
  }
  .top.nav-open .nav { flex-direction: column; align-items: stretch; overflow: visible; gap: .15rem; }
  .top.nav-open .nav-item { justify-content: space-between; padding: .7rem .9rem; font-size: 1rem; border-radius: var(--radius-sm); }
  .top.nav-open .viewer { flex-wrap: wrap; padding-top: .9rem; border-top: 1px solid var(--line); }
  .main { padding: 1.25rem 1rem 3rem; }
  .task-row { flex-wrap: wrap; padding: .85rem 1rem; }
  .task-row .avatars-stack { order: 3; }
  .task-deadline { min-width: 0; text-align: left; }
  .form-wrap { padding: 1.1rem; }
  .progress-block, .detail-sidebar { padding: 1.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .dot.pulse { animation: none; }
  .btn, .preset { transition: none; }
  .btn:active:not(:disabled), .preset:active:not(:disabled) { transform: none; }
  .toast { transition: opacity .2s; transform: translate(-50%, 0); }
}

/* Avatar state rings: who has it now (cobalt) and who is done (mint) */
.avatar.is-on   { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); position: relative; z-index: 1; }
.avatar.is-done { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ok); }

.field-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 .85rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

/* ── Create form (v2) ── */
.form-wrap { padding-bottom: 0; }
.form-wrap > section { padding-bottom: .4rem; }
.form-wrap > section + section { border-top: 1px solid var(--line); padding-top: 1.4rem; margin-top: .6rem; }
h2.form-section-title { margin: 0 0 1rem; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.counter { font-size: .85rem; color: var(--muted); }
.counter.near { color: var(--warn); font-weight: 650; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .85rem; }
@media (max-width: 640px) { .field-grid { grid-template-columns: 1fr; } }
.summary-line {
  margin: 0 0 1.1rem; padding: .8rem 1rem; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink-2); font-size: .95rem; line-height: 1.5;
}
.field-warn { margin-top: .5rem; padding: .6rem .8rem; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: .95rem; font-weight: 600; }

.choice-pills { display: flex; flex-wrap: wrap; gap: .5rem; }
.choice-pill { position: relative; display: inline-flex; }
.choice-pill input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice-pill span {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem 1.05rem;
  border: 1px solid var(--field-edge); border-radius: var(--pill);
  font-weight: 650; font-size: .95rem; color: var(--ink-2); background: var(--surface);
  transition: background .12s, border-color .12s, color .12s;
}
.choice-pill:hover span { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--ink); }
.choice-pill input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.choice-pill input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Segmented: one choice from a small fixed set, joined with dividers, rounded only at the ends. */
.choice-pills.seg {
  display: inline-flex; flex-wrap: nowrap; gap: 0; max-width: 100%;
  overflow-x: auto; scrollbar-width: none;
  border: 1px solid var(--field-edge); border-radius: var(--pill); background: var(--surface);
}
.choice-pills.seg::-webkit-scrollbar { display: none; }
.seg .choice-pill { flex: 0 0 auto; }
.seg .choice-pill span { min-height: 2.6rem; border: 0; border-radius: 0; padding: .45rem 1rem; white-space: nowrap; }
.seg .choice-pill + .choice-pill span { box-shadow: inset 1px 0 0 var(--field-edge); }
.seg .choice-pill:hover span { background: var(--surface-2); color: var(--ink); }
.seg .choice-pill input:checked + span { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.seg .choice-pill input:checked + span, .seg .choice-pill:has(input:checked) + .choice-pill span { box-shadow: none; }
.seg .choice-pill input:focus-visible + span { outline-offset: -3px; outline-color: var(--accent-ink); }
.seg .choice-pill input:focus-visible:not(:checked) + span { outline-color: var(--accent); }
/* The settings that follow the Repeats choice sit in one tinted panel joined to the
   Repeats bar, with a notch under the chosen option, so they read as belonging to it. */
.repeats-field { margin-bottom: 0; }
.repeat-details {
  position: relative; margin: .85rem 0 1.25rem; padding: 1.1rem 1.15rem .2rem;
  border-radius: var(--radius); background: var(--surface-2);
}
.repeat-details::before {
  content: ""; position: absolute; top: -7px; left: var(--notch-x, 2rem);
  width: 14px; height: 14px; margin-left: -7px; transform: rotate(45deg);
  border-radius: 3px 0 0 0; background: var(--surface-2);
}
.repeat-details .info-panel { background: var(--surface); }
@media (max-width: 640px) {
  .repeat-details { padding: .95rem .8rem .1rem; }
  .seg .choice-pill span { padding-left: .8rem; padding-right: .8rem; }
}
.repeat-rows { display: flex; flex-direction: column; gap: .5rem; }
/* Repeats: groups of options as separate bars that wrap, at every width. */
.seg-split.seg-groups { display: flex; flex-wrap: wrap; gap: .5rem; }
.seg-split.seg-groups > .seg { border: 1px solid var(--field-edge) !important; border-radius: var(--pill) !important; }
/* A bar in parts (segSplit): joined into one bar on wide screens, stacked bars on phones. */
.seg-split { display: inline-flex; max-width: 100%; }
.seg-split > .seg:not(:last-child) { border-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.seg-split > .seg:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
@media (max-width: 640px) {
  .seg-split { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; }
  .seg-split > .seg { border: 1px solid var(--field-edge) !important; border-radius: var(--pill) !important; }
}

.assignee-list.ordered { flex-direction: column; align-items: stretch; }
.assignee-list .assignee-pill { padding: .25rem .3rem .25rem .35rem; }
.assignee-list.ordered .assignee-pill { border-radius: var(--radius-sm); padding: .35rem .4rem .35rem .6rem; gap: .55rem; }
.assignee-pill .pill-order {
  width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent); font-size: .85rem; font-weight: 750; padding: 0;
}
.assignee-pill .pill-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pill-btn {
  width: 2.25rem; height: 2.25rem; flex: 0 0 2.25rem; border: none; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background .12s, color .12s;
}
.pill-btn:hover:not(:disabled) { background: var(--surface); color: var(--ink); }
.pill-btn.down svg { transform: rotate(180deg); }
.pill-btn.remove:hover { background: var(--fail-soft); color: var(--fail); }
.pill-btn:disabled { opacity: .35; cursor: default; }
.assignee-add { display: flex; gap: .5rem; }
.assignee-add input { flex: 1; }

.error-summary {
  margin-bottom: 1.25rem; padding: 1rem 1.25rem; border-radius: var(--radius-sm);
  background: var(--fail-soft); color: var(--fail);
}
.error-summary h2 { margin: 0 0 .4rem; font-size: 1.05rem; font-weight: 700; }
.error-summary ul { margin: 0; padding-left: 1.1rem; }
.error-summary a { color: var(--fail); font-weight: 600; }
.error-summary:focus { outline: 2px solid var(--fail); outline-offset: 2px; }

/* Sticky footer: the consequence sentence sits next to the button that commits it. */
.form-footer {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem;
  margin: 1rem -1.75rem 0; padding: 1rem 1.75rem;
  background: var(--surface); border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 -8px 24px rgb(20 40 90 / .06);
}
.consequence { flex: 1 1 280px; margin: 0; font-size: .95rem; color: var(--ink-2); line-height: 1.5; }
.form-footer-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-left: auto; }
@media (max-width: 720px) {
  .form-footer { margin: 1rem -1.1rem 0; padding: .85rem 1.1rem; }
  .form-footer-actions { width: 100%; }
  .form-footer-actions .btn.primary { flex: 1; }
}

/* Name field uses a datalist; hide Chrome's extra arrow so it reads as a text field. */
input[list]::-webkit-calendar-picker-indicator { display: none !important; }
@media (max-width: 720px) { .toast { top: calc(110px + .75rem); } }

/* ── Signed-in person + sign-in screen ── */
.tz-btn { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-name { font-size: .92rem; font-weight: 650; color: var(--shell-ink); white-space: nowrap; }
.chip.admin-badge { background: var(--accent-soft); color: var(--accent); font-size: .78rem; padding: .05rem .55rem; }
.signin { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem 1rem; }
.signin-card {
  width: 100%; max-width: 400px; display: grid; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 2rem 1.75rem;
}
.signin-brand { margin-bottom: .25rem; }
.signin-card h1 { font-size: 1.65rem; font-weight: 750; letter-spacing: -0.012em; }
.signin-card p { margin: 0; }
.signin-google { justify-content: center; gap: .6rem; text-decoration: none; }
.signin-dev { display: grid; gap: .4rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.signin-dev-row { display: flex; gap: .5rem; }
.signin-dev-row input { flex: 1; min-width: 0; }
@media (max-width: 420px) {
  .signin-card { padding: 1.5rem 1.1rem; }
  .signin-dev-row { flex-direction: column; }
}

/* ── Assistant panel beside the create form ── */
.create-layout.with-ai {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 1.5rem; align-items: start;
}
.create-layout.with-ai .create-main { min-width: 0; }
.create-layout.with-ai .form-wrap { max-width: none; }
.ai-panel {
  position: sticky; top: calc(68px + 1.25rem);
  display: flex; flex-direction: column;
  height: calc(100vh - 68px - 2.5rem); min-height: 420px; max-height: 820px;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.ai-head { display: flex; align-items: flex-start; gap: .75rem; padding: 1.1rem 1.1rem .9rem 1.25rem; border-bottom: 1px solid var(--line); }
.ai-head-text { flex: 1; min-width: 0; }
.ai-title { display: flex; align-items: center; gap: .45rem; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.005em; }
.ai-title svg { color: var(--accent); flex: 0 0 auto; }
.ai-sub { margin-top: .3rem; font-size: .92rem; color: var(--muted); line-height: 1.45; }
.ai-log {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: .65rem; padding: 1rem 1.25rem;
}
.ai-msg {
  max-width: 92%; padding: .6rem .9rem; border-radius: 16px;
  font-size: .95rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
}
.ai-msg.assistant { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 6px; }
.ai-msg.user { align-self: flex-end; background: var(--accent-soft); color: var(--ink); border-bottom-right-radius: 6px; }
.ai-note { display: flex; align-items: flex-start; gap: .45rem; padding: 0 .2rem; font-size: .92rem; color: var(--ink-2); line-height: 1.45; }
.ai-note svg { color: var(--accent); flex: 0 0 auto; margin-top: .2rem; }
.ai-thinking { display: flex; align-items: center; gap: .5rem; padding: 0 .2rem; font-size: .92rem; color: var(--muted); }
.typing { display: inline-flex; gap: 3px; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; animation: pulse 1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
.ai-error {
  display: grid; gap: .55rem; justify-items: start;
  padding: .75rem .9rem; border-radius: var(--radius-sm);
  background: var(--fail-soft); color: var(--fail); font-size: .95rem; font-weight: 600; line-height: 1.45;
}
.ai-error .btn { color: var(--ink); }
.ai-off { padding: .75rem .9rem; border-radius: var(--radius-sm); background: var(--neutral-soft); color: var(--ink-2); font-size: .95rem; line-height: 1.45; }
.ai-composer { padding: .75rem 1rem .8rem; border-top: 1px solid var(--line); }
.ai-composer-row { display: flex; align-items: flex-end; gap: .5rem; }
.ai-composer textarea { flex: 1; min-height: 2.75rem; max-height: 160px; resize: none; line-height: 1.45; }
.ai-hint { margin-top: .4rem; font-size: .85rem; color: var(--muted); }
.ai-badge {
  display: inline-flex; align-items: center; gap: .25rem; margin-left: .45rem; vertical-align: .08em;
  padding: .02rem .55rem; border-radius: var(--pill);
  background: var(--accent-soft); color: var(--accent);
  font-size: .78rem; font-weight: 650; line-height: 1.5; white-space: nowrap;
}
@media (max-width: 899px) {
  .create-layout.with-ai { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .create-layout.with-ai .create-main { display: contents; }
  .create-layout.with-ai .page-header { order: -2; }
  .ai-panel { order: -1; position: static; width: 100%; margin: 0 0 1rem; height: auto; min-height: 0; max-height: none; }
  .ai-log { max-height: 40vh; }
}
@media (max-width: 720px) {
  .ai-head { padding: .9rem .9rem .75rem 1.1rem; }
  .ai-log { padding: .9rem 1.1rem; }
  .ai-composer { padding: .7rem .9rem .75rem; }
}
@media (prefers-reduced-motion: reduce) { .typing i { animation: none; } }

/* ── Working days: form option and admin Calendars page ── */
.working-days-field { margin-top: -.25rem; }
.working-days-option { padding: 0; font-weight: 650; }
.cal-page { display: flex; flex-direction: column; gap: 1.75rem; }
.cal-notice { color: var(--ok); font-weight: 650; }
.cal-notice:empty { display: none; }
.cal-table tr.is-selected td { background: var(--accent-soft); }
.cal-table tr.is-selected td a { color: var(--accent); }
.cal-editor { max-width: none; margin: 0; padding-bottom: 1.5rem; }
.cal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.cal-actions .cal-delete { margin-left: auto; color: var(--fail); }
.cal-holidays { margin-top: 1.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.cal-sub { font-size: 1.05rem; font-weight: 700; color: var(--ink); }
.cal-intro { margin: .25rem 0 1rem; }
.cal-import { margin-bottom: 1rem; }
.cal-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.cal-row input[type="file"] { flex: 0 1 auto; min-width: 0; font: inherit; font-size: .95rem; color: var(--ink-2); }
.cal-row input[type="file"]::file-selector-button {
  font: inherit; font-weight: 650; font-size: .9rem; margin-right: .75rem; padding: .45rem 1rem; cursor: pointer;
  border: 1px solid var(--field-edge); border-radius: var(--pill); background: var(--surface); color: var(--ink);
}
.cal-row input[type="date"] { flex: 0 1 11rem; width: auto; min-height: 2.75rem; padding: .5rem .8rem; font: inherit; color: var(--ink);
  border: 1px solid var(--field-edge); border-radius: var(--radius-sm); background: var(--surface); }
.cal-row input[type="text"] { flex: 1 1 200px; width: auto; min-width: 0; }
.cal-add { margin-bottom: 1.1rem; }
.cal-year { margin: 1rem 0 .35rem; font-size: .95rem; font-weight: 700; color: var(--ink); }
.cal-year .text-mute { font-weight: 500; }
.holiday-list { list-style: none; }
.holiday-list li { display: flex; align-items: center; gap: .75rem; padding: .35rem 0; border-bottom: 1px solid var(--line); }
.holiday-list li:last-child { border-bottom: none; }
.holiday-date { flex: 0 0 8.5rem; font-weight: 650; color: var(--ink); }
.holiday-name { flex: 1; min-width: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.cal-person { display: inline-flex; align-items: center; gap: .5rem; font-weight: 650; color: var(--ink); white-space: nowrap; }
.cal-people td { vertical-align: middle; }
.cal-people select { min-width: 12rem; max-width: 22rem; }
@media (max-width: 640px) {
  .holiday-date { flex-basis: 6.5rem; }
  .cal-actions .cal-delete { margin-left: 0; }
  .cal-hide-sm { display: none; }
  .cal-people select { min-width: 0; width: 100%; }
  .owned-table.cal-table th, .owned-table.cal-table td, .owned-table.cal-people th, .owned-table.cal-people td { padding-left: .75rem; padding-right: .75rem; }
}

/* ── People pickers (Assignees, Escalation Target) and the Google directory page ── */
.person-picker { position: relative; flex: 1; min-width: 0; }
.person-picker input { width: 100%; }
.picker-pop {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; right: 0;
  max-height: min(22rem, 60vh); overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); padding: .3rem;
}
.picker-pop[hidden] { display: none; }
.picker-list { list-style: none; }
.picker-option {
  display: flex; align-items: center; gap: .6rem; min-height: 2.75rem;
  padding: .4rem .6rem; border-radius: calc(var(--radius-sm) - 4px); cursor: pointer;
}
.picker-option:hover, .picker-option.is-active { background: var(--accent-soft); }
.picker-option.is-refused { cursor: default; color: var(--muted); }
.picker-option.is-refused:hover { background: transparent; }
.picker-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.picker-name { font-weight: 650; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-option.is-refused .picker-name { color: var(--muted); }
.picker-sub { font-size: .85rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-sub.is-wrap { white-space: normal; }
.picker-option.is-refused .picker-sub { color: var(--fail); font-weight: 600; }
.picker-photo { object-fit: cover; padding: 0; }
.picker-add-icon {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent);
}
.picker-option.is-add .picker-name { color: var(--accent); }
.picker-option.is-refused .picker-add-icon { background: var(--fail-soft); color: var(--fail); }
.picker-notes:empty { display: none; }
.picker-notes { padding: .15rem .6rem .35rem; }
.picker-option + .picker-notes, .picker-list:not(:empty) + .picker-notes { border-top: 1px solid var(--line); margin-top: .3rem; padding-top: .5rem; }
.picker-note { font-size: .9rem; color: var(--muted); padding: .2rem 0; }
.picker-note.is-error { color: var(--fail); font-weight: 600; }

.pending-mark {
  display: inline-flex; align-items: center; flex: none;
  padding: 0 .45rem; border: 1px dashed var(--line-strong); border-radius: var(--pill);
  font-size: .75rem; font-weight: 600; line-height: 1.5; color: var(--muted); white-space: nowrap;
  vertical-align: .1em;
}
.picker-option .pending-mark { margin-left: auto; }
.assignee-pill .pending-mark { margin-right: .15rem; }
.seq-content .pending-mark, .assignee-state-name .pending-mark { margin-left: .1rem; }

.escalation-find { margin-top: .9rem; display: flex; flex-direction: column; }
.field-label.sub-label { font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-bottom: .3rem; }

.dir-card p { margin-bottom: .8rem; color: var(--ink-2); max-width: 62ch; }
.dir-card p.text-mute { color: var(--muted); }
.dir-state { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.dir-domains { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin-bottom: .8rem; }
.dir-domains li { display: inline-flex; align-items: center; gap: .35rem; }
@media (max-width: 640px) {
  /* The marker moves under the name so Replace and the status stay in the card. */
  .seq-content > div:first-child { flex-wrap: wrap; row-gap: 2px; }
  .seq-content > div:first-child .pending-mark { order: 10; flex-basis: 100%; width: max-content; max-width: max-content; margin-left: 32px; }
}

/* ── Extensions and per-person Reminder settings ── */
.nowrap { white-space: nowrap; }
.chip.extended { background: var(--warn-soft); color: var(--warn); }
.chip.custom { background: var(--accent-soft); color: var(--accent); font-size: .78rem; padding: 0 .5rem; }
.extended-tag { display: inline-flex; align-items: center; flex-wrap: wrap; gap: .1rem .4rem; margin-left: .45rem; vertical-align: middle; }
.extended-was { font-size: .85rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.owned-table td .extended-tag { display: flex; margin: .2rem 0 0; }
.board-card-due .extended-tag { margin-left: .4rem; }

.turn-tools { display: flex; flex-wrap: wrap; gap: .25rem; margin: .55rem 0 0 -.8rem; }
.turn-tools .btn { color: var(--ink-2); }
.turn-tools .btn:hover { background: color-mix(in srgb, var(--surface) 60%, transparent); color: var(--ink); }
.turn-sub.turn-more-time { margin-top: .3rem; font-weight: 650; color: var(--fail); }

.step-reminders { display: flex; align-items: center; flex-wrap: wrap; gap: .35rem; margin-top: .3rem; font-size: .88rem; color: var(--muted); }
.seq-detail .step-reminders { color: var(--ink-2); }
.seq-detail.overdue .step-reminders { color: var(--fail); }
.step-reminders svg { flex: 0 0 auto; }

.event-icon.extend { background: var(--warn-soft); color: var(--warn); }
.event-icon.reminder_settings { background: var(--accent-soft); color: var(--accent); }

.note-box.info-note { margin: 0 0 1.1rem; background: var(--accent-soft); color: var(--ink-2); }
.detail-main > .note-box.info-note { margin: 0; }

.preset-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .preset-row.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.deadline-facts { display: flex; flex-wrap: wrap; gap: .1rem 1.25rem; margin: .4rem 0 0; font-size: .95rem; }
.deadline-facts > div { display: flex; gap: .4rem; }
.deadline-facts dt { color: var(--muted); }
.deadline-facts dd { margin: 0; font-weight: 650; color: var(--ink); }
.deadline-facts dd .text-mute { font-weight: 500; }

.info-label { display: flex; align-items: center; margin-bottom: .4rem; }
.info-label > label.field-label { flex: 0 1 auto; width: auto; margin-bottom: 0; }
.info-btn {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: -.2em;
  width: 1.5rem; height: 1.5rem; margin: -.2rem 0 -.2rem .3rem; padding: 0;
  border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer;
}
.info-btn:hover, .info-btn[aria-expanded="true"] { color: var(--accent); background: var(--accent-soft); }
.info-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.info-panel {
  max-width: 64ch; margin: 0 0 .6rem; padding: .7rem .9rem;
  border-radius: var(--radius-sm); background: var(--surface-2);
  font-size: .92rem; line-height: 1.5; color: var(--ink-2);
}
.info-panel p { margin: 0; }
.info-panel p + p { margin-top: .45rem; }
.field-optional { margin-left: .3rem; font-size: .85rem; font-weight: 500; }
.time-row { display: flex; align-items: center; gap: .5rem; }
.time-row input { flex: 1 1 auto; min-width: 0; }
.time-row input[type="date"] { flex: 0 1 11rem; width: auto; }
input.once-date { width: auto; min-width: 11rem; }
input.end-date { display: block; margin-top: .5rem; }
.time-row { flex-wrap: wrap; }
.time-pick { display: inline-flex; align-items: center; gap: .35rem; }
.time-pick select { width: auto; min-width: 4.5rem; padding-right: 2rem; }
.time-pick select:disabled { opacity: .45; }
.rem-grid { margin-top: .25rem; }
.rem-reset {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
  margin-top: -.25rem; font-size: .92rem;
}

/* ── Notifications: Chat spaces on the task form, the bell menu, the admin page (notify.go) ── */
.spaces-field { margin-top: .5rem; }
.space-list { list-style: none; margin: .75rem 0 .25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.space-item { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; padding: .6rem .75rem; }
.space-item + .space-item { border-top: 1px solid var(--line); }
.space-text { flex: 1 1 12rem; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.space-name { font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.space-sub { font-size: .85rem; color: var(--muted); font-family: var(--mono); }
.space-sub em { font-family: var(--font); font-style: normal; color: var(--warn); font-weight: 600; }
.space-status { font-size: .88rem; color: var(--ok); font-weight: 600; }
.space-status:empty { display: none; }
.space-status.is-error { color: var(--fail); flex-basis: 100%; order: 3; }
.space-actions { display: flex; gap: .25rem; margin-left: auto; }
.space-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) auto; gap: .6rem; align-items: end; margin-top: .9rem; }
.space-add-field { display: flex; flex-direction: column; min-width: 0; }
.space-add-field input { width: 100%; }
@media (max-width: 640px) {
  .space-add { grid-template-columns: 1fr; }
  .space-add .btn { justify-self: start; }
}
.meta-spaces { color: var(--ink-2); font-size: .92rem; margin-top: .15rem; }

.notif-menu { position: relative; }
.notif-menu > summary { list-style: none; cursor: pointer; position: relative; padding-left: .55rem; padding-right: .55rem; }
.notif-menu > summary::-webkit-details-marker { display: none; }
.notif-menu[open] > summary { background: var(--surface-2); }
.notif-flag { position: absolute; top: .3rem; right: .35rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 2px var(--shell); }
.notif-pop {
  position: absolute; z-index: 40; right: 0; top: calc(100% + 8px); width: min(20rem, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-pop); padding: .9rem 1rem; display: flex; flex-direction: column; gap: .6rem;
}
.notif-title { font-weight: 700; color: var(--ink); }
.notif-list { display: grid; grid-template-columns: 1fr auto; gap: .45rem .75rem; align-items: center; margin: 0; }
.notif-list dt { color: var(--ink-2); font-size: .95rem; }
.notif-list dd { margin: 0; }
.notif-note { font-size: .9rem; color: var(--muted); }
.notif-note:empty { display: none; }
.notif-pop .btn { align-self: flex-start; }

.notif-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); gap: 1rem; }
.notif-cards .dir-card { display: flex; flex-direction: column; }
.notif-cards .cal-actions { margin-top: auto; }
.notif-result { margin: .6rem 0 0 !important; font-weight: 600; color: var(--ok) !important; }
.notif-result:empty { display: none; }
.notif-result.is-error { color: var(--fail) !important; }
.deliveries-table td { vertical-align: middle; }
.deliveries-table td.mono { white-space: nowrap; }
.delivery-error { font-size: .9rem; color: var(--muted) !important; max-width: 28rem; overflow-wrap: anywhere; }
.deliveries-table td.d-meta { display: none; }
@media (max-width: 720px) {
  /* The bell's panel spans the header instead of hanging off the bell. */
  .notif-menu { position: static; }
  .notif-pop { left: 1rem; right: 1rem; width: auto; top: calc(100% - .25rem); }
}
@media (max-width: 480px) {
  /* Room for the bell: "Viewing as" stays for screen readers only. */
  .viewer label[for="viewing-as"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .viewer { gap: .35rem; }
}
@media (max-width: 640px) {
  /* Recent deliveries: one card-like row each, no sideways scrolling. */
  .deliveries-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .deliveries-table, .deliveries-table tbody { display: block; }
  .deliveries-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
  .deliveries-table tr:last-child { border-bottom: none; }
  .owned-table.deliveries-table td { display: block; padding: 0; border: none; }
  .owned-table.deliveries-table td.d-time, .owned-table.deliveries-table td.d-chan, .owned-table.deliveries-table td.cal-hide-sm { display: none; }
  .owned-table.deliveries-table td.d-to { grid-column: 1; grid-row: 1; font-weight: 650; color: var(--ink); }
  .owned-table.deliveries-table td.d-status { grid-column: 2; grid-row: 1; text-align: right; }
  .owned-table.deliveries-table td.d-meta { display: block; grid-column: 1 / -1; font-size: .9rem; color: var(--muted); }
  .owned-table.deliveries-table td.delivery-error { grid-column: 1 / -1; }
  .owned-table.deliveries-table td.delivery-error:empty { display: none; }
}

/* People: Deactivate after hand-over (deactivate.go) */
.pending-mark.is-deactivated { border-style: solid; border-color: var(--line-strong); background: var(--neutral-soft); color: var(--neutral); margin-left: .45rem; }
.people-action { text-align: right; white-space: nowrap; }
.handover-status { color: var(--ink-2); }
.handover-group .section-header .text-mute { font-weight: 500; }
.handover-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.handover-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
.handover-item:last-child { border-bottom: none; }
.handover-what { flex: 1 1 16rem; min-width: 0; overflow-wrap: anywhere; font-weight: 650; }
.handover-what a { color: var(--ink); }
.handover-what .chip { margin-left: .35rem; vertical-align: .08em; }
.handover-act { display: flex; flex: 0 1 auto; align-items: center; gap: .5rem; }
.handover-act select { min-width: 12rem; max-width: 18rem; }
.handover-info { color: var(--ink-2); }
@media (max-width: 640px) {
  .handover-act { flex: 1 1 100%; }
  .handover-act select { flex: 1; min-width: 0; max-width: none; }
}

/* ── Date schedules: year calendar, rule controls (.scratch/flexible-schedules) ── */
.choice-pill input[type="checkbox"] { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.choice-pill input[type="checkbox"]:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.month-pills { display: grid; gap: .5rem; }
.month-pills .seg { display: flex; width: 100%; }
.month-pills .choice-pill { display: flex; flex: 1 1 0; min-width: 0; }
.month-pills .choice-pill span { width: 100%; justify-content: center; padding: .5rem .3rem; }
.month-shortcuts { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .55rem; }
.month-shortcuts .btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent-soft); color: var(--accent); }
.rule-on-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.rule-on-row select { flex: 1 1 9rem; width: auto; }

.cal { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem 1.1rem; }
.cal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .6rem; }
h3.cal-year { font-size: 1.2rem; font-weight: 750; }
.cal-nav { display: flex; gap: .3rem; }
.cal-step { border: 1px solid var(--line-strong); background: var(--surface); }
.cal-step:hover:not(:disabled) { background: var(--surface-2); }
.cal-warn { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.cal-months { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.25rem, 1fr)); gap: 1.1rem 1.25rem; }
.cal-months[aria-busy="true"] { opacity: .6; }
.cal-month { min-width: 0; }
h3.cal-month-name { font-size: .95rem; font-weight: 700; margin: 0 0 .3rem; color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; max-width: 22rem; }
.cal-wd { font-size: .75rem; font-weight: 600; color: var(--muted); text-align: center; line-height: 1.6; }
.cal-day {
  position: relative; aspect-ratio: 1; min-height: 1.9rem; padding: 0;
  border: none; border-radius: 50%; background: transparent;
  font: 550 .8125rem/1 var(--font); font-variant-numeric: tabular-nums; color: var(--ink);
  cursor: pointer; transition: background .12s, color .12s;
}
.cal-day.is-off { background: var(--surface-2); color: var(--ink-2); }
.cal-day.is-holiday::after {
  content: ""; position: absolute; left: 50%; bottom: 12%; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: currentColor; opacity: .7;
}
.cal-day:hover:not([aria-disabled="true"]) { background: var(--accent-soft); color: var(--ink); }
.cal-day.is-today { box-shadow: inset 0 0 0 1.5px var(--ink-2); font-weight: 800; }
.cal-day.is-chosen, .cal-day.is-chosen:hover:not([aria-disabled="true"]) { background: var(--accent); color: var(--accent-ink); }
.cal-day.is-added, .cal-day.is-added:hover:not([aria-disabled="true"]) {
  background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); font-weight: 750;
}
.cal-day.is-skipped { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px;
  outline: 1.5px dashed var(--field-edge); outline-offset: -3px; }
.cal-day.is-past { color: var(--muted); opacity: .5; cursor: default; }
.cal-day.is-past.is-chosen, .cal-day.is-started { opacity: 1; cursor: default; }
.cal-day.is-started.is-chosen { background: color-mix(in srgb, var(--accent) 70%, var(--surface)); }
.cal-day:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; z-index: 1; }
.cal-lock { position: absolute; top: -2px; right: -2px; display: inline-flex; padding: 2px; border-radius: 50%;
  background: var(--surface); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line-strong); }
.cal-legend { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; margin: 1rem 0 0; padding: 0; list-style: none; font-size: .85rem; color: var(--ink-2); }
.cal-legend li { display: inline-flex; align-items: center; gap: .4rem; }
.cal-swatch { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 1.35rem; height: 1.35rem;
  border-radius: 50%; font-size: .75rem; font-weight: 650; color: transparent; }
.cal-swatch.is-chosen { background: var(--accent); }
.cal-swatch.is-added { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.cal-swatch.is-skipped { color: var(--muted); text-decoration: line-through; outline: 1.5px dashed var(--field-edge); outline-offset: -3px; }
.cal-swatch.is-started { background: var(--surface); color: var(--ink-2); box-shadow: 0 0 0 1px var(--line-strong); }
.cal-swatch.is-off { background: var(--surface-2); }
.cal-strip { padding: .85rem 1rem 1rem; }

#chosen-dates { margin-top: .9rem; }
.chosen-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem 1.25rem; }
@media (max-width: 640px) { .chosen-pair { grid-template-columns: 1fr; } }
h4.chosen-title { margin: 0 0 .4rem; font-size: .95rem; font-weight: 650; color: var(--ink); }
.chosen-group .field-hint { margin-top: 0; }
.date-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.date-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .15rem .2rem .15rem .8rem;
  border-radius: var(--pill); background: var(--surface-2); font-size: .95rem; font-weight: 600; }
.date-chip.locked { padding: .45rem .8rem; color: var(--ink-2); gap: .4rem; }
.date-chip .pill-btn { width: 2rem; height: 2rem; flex-basis: 2rem; }

/* ── More options: everything past Title, schedule and Assignees ── */
.quick-describe { padding: 1rem 1.1rem; margin: 0 0 1.4rem; border-radius: var(--radius); background: var(--accent-soft); }
.quick-describe input { background: var(--surface); }
.more-section { padding-top: 1.1rem !important; }
/* The disclosure is a full-width row: what's inside, and the current settings, at a glance. */
.more-options > summary {
  list-style: none; display: flex; align-items: center; gap: 1rem; cursor: pointer;
  padding: .95rem 1.15rem; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); transition: border-color .12s, background .12s;
}
.more-options > summary:hover { border-color: var(--accent); background: var(--accent-soft); }
.more-options > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.more-options > summary::-webkit-details-marker { display: none; }
.more-options > summary::after {
  content: ""; flex: 0 0 auto; width: .6rem; height: .6rem; margin: -.3rem .25rem 0 0;
  border: solid var(--accent); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .12s;
}
.more-options[open] > summary::after { transform: rotate(-135deg); margin-top: .3rem; }
.more-text { flex: 1; min-width: 0; display: grid; gap: .2rem; }
.more-title { font-size: 1.05rem; font-weight: 700; color: var(--accent); }
.more-what { font-size: .95rem; color: var(--ink-2); }
.more-summary { font-size: .88rem; color: var(--muted); }
.more-options[open] .more-summary { display: none; }
.more-body { padding-top: 1.25rem; }
h2.form-section-title.more-title { margin-top: 1.4rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }

/* Task detail: upcoming dates */
.upcoming-dates { list-style: none; display: flex; flex-direction: column; gap: .35rem; font-size: .95rem; }
.upcoming-dates li { display: flex; align-items: center; gap: .4rem; }
@media (prefers-reduced-motion: reduce) { .cal-day, .more-options > summary::after { transition: none; } }

/* Year buttons under the months, so the next year is a click away without scrolling up. */
.cal-foot { display: flex; justify-content: space-between; gap: .5rem; margin-top: .75rem; }

/* Visibility: the people each chosen Department brings in. */
.dept-members { display: grid; gap: .75rem; margin-top: .75rem; }
.dept-members-head { font-size: .92rem; font-weight: 650; color: var(--ink); margin-bottom: .35rem; }
.dept-member-list { display: flex; flex-wrap: wrap; gap: .35rem .5rem; margin: 0; padding: 0; list-style: none; }
.dept-member {
  display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .7rem .2rem .25rem;
  border-radius: var(--pill); background: var(--surface-2); font-size: .9rem; color: var(--ink-2);
}
