:root {
  --navy: #001C71;
  --blue: #007AC9;
  --cta: #1a1a1a;
  --surface: #ffffff;
  --bg: #fafafa;
  --text: #222;
  --muted: #6b6b6b;
  --border: #e8e8e8;
  --tint: #E5EDFD;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --ctrl-h: 36px;
  --ctrl-px: 0.7rem;
  --ctrl-font: 0.875rem;
  --ctrl-radius: 10px;
  --icon-h: 32px;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-sans: "Avenir Next", "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.ms {
  font-family: "Material Symbols Outlined";
  font-weight: normal;
  font-style: normal;
  font-size: 18px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  width: 1em;
  height: 1em;
  overflow: hidden;
  vertical-align: -0.15em;
  font-feature-settings: "liga";
  -webkit-font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); overflow-x: clip; }
body { padding-top: var(--safe-top); min-height: 100dvh; }
img { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { min-height: var(--ctrl-h); cursor: pointer; }
a { color: var(--blue); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.login-shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background:
    radial-gradient(ellipse at top left, rgba(0, 122, 201, 0.2), transparent 55%),
    linear-gradient(165deg, var(--navy), #0a3a8a 50%, var(--blue));
}
.login-card {
  width: min(100%, 400px);
  background: #fff;
  border-radius: 16px;
  padding: 1.5rem;
  display: grid;
  gap: 0.75rem;
  box-shadow: 0 18px 40px rgba(0, 28, 113, 0.22);
}
.login-brand { text-align: center; }
.login-brand h1 { margin: 0.55rem 0 0.1rem; color: var(--navy); font-size: 1.4rem; }
.login-brand p { margin: 0; color: var(--muted); }
.mark { border-radius: 8px; margin-inline: auto; }
.brand .mark { margin: 0; }
label { display: grid; gap: 0.28rem; font-size: 0.84rem; font-weight: 650; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--ctrl-radius);
  padding: 0 var(--ctrl-px);
  background: #fff;
  font-size: var(--ctrl-font);
  line-height: 1.35;
  min-width: 0;
}
input:not([type="checkbox"]):not([type="radio"]):not([type="color"]):not([type="file"]),
select {
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
}
textarea {
  height: auto;
  min-height: 5.5rem;
  padding: 0.5rem var(--ctrl-px);
}
input[type="color"] {
  width: var(--ctrl-h);
  min-width: var(--ctrl-h);
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  padding: 3px;
  background: #fff;
  cursor: pointer;
}
input[type="checkbox"], input[type="radio"] {
  width: 1rem;
  height: 1rem;
  min-height: 0;
  padding: 0;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 6px;
}
textarea { resize: vertical; }
.primary, .ghost, .danger, .text-btn {
  border-radius: var(--ctrl-radius);
  border: 0;
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  padding: 0 var(--ctrl-px);
  font-size: var(--ctrl-font);
  font-weight: 700;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.primary { background: var(--cta); color: #fff; }
.ghost { background: transparent; color: var(--navy); border: 1px solid var(--border); }
.danger { background: transparent; color: #9b2335; border: 1px solid #e7c4cb; }
.text-btn, .text-link { background: none; color: var(--blue); border: 0; text-align: center; font-weight: 650; }
.help { margin: 0; font-size: 0.88rem; line-height: 1.4; color: var(--muted); font-weight: 500; }
.form-error { color: #9b2335; margin: 0; font-weight: 650; }
.form-ok { color: #0d6b3d; margin: 0; font-weight: 650; }
.check { display: flex; align-items: center; gap: 0.45rem; font-weight: 650; }
.check input { width: auto; }

.app-shell { min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: calc(1.25rem + var(--safe-bottom)); }
.icon-btn, .add-btn {
  width: var(--ctrl-h); height: var(--ctrl-h); min-width: var(--ctrl-h); min-height: var(--ctrl-h);
  padding: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--ctrl-radius); border: 1px solid var(--border); background: #fff; color: var(--navy);
}
.icon-btn svg, .add-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.danger { color: #9b2335; border-color: #e7c4cb; background: transparent; }
.icon-btn.primary { background: var(--cta); color: #fff; border-color: transparent; }
.icon-btn.is-busy svg { animation: spin 0.8s linear infinite; }
.add-btn { border: 0; border-radius: 50%; background: var(--cta); color: #fff; }
@keyframes spin { to { transform: rotate(-360deg); } }
.app-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--navy);
  color: #fff;
}
.brand, button.brand {
  display: flex; gap: 0.55rem; align-items: center;
  background: transparent; border: 0; color: inherit; padding: 0; text-align: left;
}
.brand strong { display: block; font-size: 0.95rem; }
.brand .who { display: block; font-size: 0.72rem; opacity: 0.75; font-weight: 500; }
.app-top .ghost { color: #fff; border-color: rgba(255,255,255,0.35); }
.global-search {
  flex: 1;
  min-width: 0;
  max-width: 28rem;
  width: auto;
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 999px;
  padding: 0 var(--ctrl-px);
  font-size: var(--ctrl-font);
}
.global-search::placeholder { color: rgba(255,255,255,0.72); }
.search-group { margin: 0.85rem 0 0.25rem; font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.search-hit {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.65rem 0.75rem;
  min-height: 0;
}
.search-hit-open {
  display: flex; align-items: flex-start; gap: 0.55rem; flex: 1; min-width: 0;
  border: 0; background: transparent; padding: 0; text-align: left; min-height: 0;
}
.search-hit-copy { display: grid; gap: 0.15rem; min-width: 0; flex: 1; }
.search-marks { display: flex; gap: 0.05rem; padding-top: 0.12rem; flex: none; }
.search-mark { width: 18px; height: 18px; color: var(--navy); flex: none; }
.search-mark svg { width: 18px; height: 18px; display: block; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.search-hit .task-title { font-size: 0.98rem; }
.search-kind { font-size: 0.72rem; font-weight: 700; color: var(--blue); }
.list-bar .search-type {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.35rem;
  margin: 0; min-height: var(--ctrl-h); font-size: 0.8rem; font-weight: 650;
  min-width: 0; max-width: 100%;
}
.list-bar .search-type select {
  width: auto;
  min-width: min(11rem, 100%);
  max-width: 100%;
  flex: 1 1 11rem;
}
#search-clear.is-on { background: var(--tint); }

.tab-nav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0.55rem 0.75rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
}
.tab-nav button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  border-radius: 999px;
  min-height: var(--ctrl-h);
  height: var(--ctrl-h);
  padding: 0 var(--ctrl-px);
  font-size: var(--ctrl-font);
}
.nav-ico { width: 16px; height: 16px; display: inline-flex; flex: none; }
.nav-ico svg {
  width: 16px; height: 16px; display: block;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.nav-ico .ms { font-size: 16px; width: 16px; height: 16px; }
.tab-nav button.is-on {
  background: var(--tint);
  color: var(--navy);
}

.app-main { flex: 1; padding: 1rem 1rem 2rem; max-width: 720px; width: 100%; margin: 0 auto; min-width: 0; }
/* Author display:grid/flex rules beat the UA [hidden] stylesheet — force hide. */
[hidden] { display: none !important; }
.view[hidden] { display: none !important; }
.view-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
#view-today .view-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-bottom: 0.85rem;
  min-width: 0;
  max-width: 100%;
}
.today-head-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.35rem 0.75rem;
  min-width: 0;
  max-width: 100%;
}
.today-head-row > div:first-child { min-width: 0; }
.view-head h1 { margin: 0; font-size: 2rem; letter-spacing: -0.03em; color: #111; }
.view-sub { margin: 0.15rem 0 0; color: var(--muted); font-weight: 600; }
.view-actions { display: flex; gap: 0.4rem; flex-wrap: wrap; }
#view-today .view-actions {
  flex: 1 1 auto;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}
.view-actions button.is-busy { opacity: 0.55; cursor: progress; }

.cat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
  min-width: 0;
  max-width: 100%;
}
.cat-chip {
  border: 0;
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  text-align: left;
  display: grid;
  gap: 0.05rem;
  min-height: 0;
  flex: 0 0 auto;
  min-width: min(5.5rem, 100%);
  max-width: 100%;
  box-shadow: none;
}
.cat-chip .count { font-size: 1rem; font-weight: 800; line-height: 1; }
.cat-chip .label { font-size: 0.68rem; font-weight: 700; opacity: 0.85; text-transform: capitalize; overflow-wrap: anywhere; }
.cat-chip.is-on { outline: 2px solid var(--navy); outline-offset: 1px; }
.cat-chip:not(.is-on) { opacity: 0.45; }
.cat-chip.is-empty { opacity: 0.32; filter: grayscale(0.15); }
.cat-picks { display: grid; gap: 0.15rem; align-content: start; min-width: 0; }
.cat-picks .check { margin: 0; min-height: var(--ctrl-h); font-size: var(--ctrl-font); font-weight: 650; }
.assigned-jiras { display: grid; gap: 0.55rem; margin: 0 0 1rem; min-width: 0; }
.assigned-head { display: flex; align-items: center; gap: 0.35rem; min-width: 0; }
.assigned-toggle {
  display: inline-flex; align-items: center; gap: 0.35rem;
  min-width: 0; text-align: left; justify-content: flex-start;
}
.assigned-toggle .twist {
  width: 16px; height: 16px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  transition: transform 0.15s ease;
}
.assigned-toggle[aria-expanded="true"] .twist { transform: rotate(90deg); }
.assigned-scan { flex: none; }
.assigned-scan.is-busy svg { animation: spin 0.8s linear infinite; }
.assigned-body { display: grid; gap: 0.55rem; min-width: 0; }
.assigned-jiras h2 { margin: 0; font-size: 0.95rem; }
.assigned-empty { margin: 0; color: var(--muted); font-size: 0.85rem; }
.assigned-jira {
  display: grid; gap: 0.25rem;
  border: 1px solid var(--border); border-radius: 12px;
  background: #fff; padding: 0.65rem 0.75rem;
}
.assigned-jira-head { display: flex; flex-wrap: wrap; gap: 0.35rem 0.65rem; align-items: center; }
.assigned-jira-head a, .assigned-jira-head strong { font-weight: 800; }
.assigned-status, .assigned-due { font-size: 0.78rem; color: var(--muted); font-weight: 700; }
.assigned-hide { margin-left: auto; }
.assigned-summary { margin: 0; font-weight: 700; }
.assigned-note { margin: 0; color: var(--ink, #222); font-size: 0.82rem; }
.assigned-tasks { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.assigned-tasks .ghost { height: auto; min-height: var(--ctrl-h); }
.today-ai { margin: 0; min-width: 0; max-width: 100%; }
.today-ai-panel { display: grid; gap: 0.45rem; margin-top: 0.45rem; min-width: 0; }
#today-ai-toggle { white-space: nowrap; }
.today-source { display: grid; gap: 0.3rem; margin: 0; font-weight: 700; min-width: 0; }
.today-source .help { font-weight: 500; }
.today-source-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
  align-items: start;
  min-width: 0;
}
.today-source-row textarea { font-weight: 450; min-height: 5.5rem; width: 100%; min-width: 0; }
.today-source-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-content: flex-start; }
.today-source-actions .ghost { white-space: nowrap; }
.use-ai { display: grid; gap: 0.35rem; }
#task-ai-panel:not([hidden]) { display: grid; gap: 0.35rem; }
#task-ai-toggle { justify-self: start; }
.quick-add { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin: 0 0 0.85rem; }
.quick-add-panel { margin: 0 0 0.65rem; }
.quick-add-form { display: grid; gap: 0.45rem; margin: 0; align-items: stretch; }
.quick-add-form .quick-field { display: grid; gap: 0.25rem; font-weight: 650; font-size: 0.82rem; }
.quick-add-form .quick-field input,
.quick-add-form .quick-field textarea { font-weight: 500; }
.quick-add-form .date-quick { margin-top: 0.2rem; }
.quick-add input[type="text"] { flex: 1 1 16rem; min-width: 12rem; }
.quick-add select { flex: 0 1 11rem; }
.quick-add .check { margin: 0; white-space: nowrap; }
.res-count { cursor: pointer; }
.res-expanded { display: inline; }

.list-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.7rem;
  margin-bottom: 0.35rem;
  min-width: 0;
  max-width: 100%;
}
.list-bar .check,
.cal-nav .check {
  margin: 0;
  min-height: var(--ctrl-h);
  font-size: 0.8rem;
  font-weight: 650;
  width: auto;
  max-width: 100%;
}
.list-bar .check input[type="checkbox"],
.cal-nav .check input[type="checkbox"],
.list-filters .check input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 0;
  flex: none;
  padding: 0;
}
.filter-toggle { white-space: nowrap; }
.filter-toggle.is-on { background: var(--tint); }
.list-filters {
  display: grid;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.65rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  min-width: 0;
  max-width: 100%;
}
.list-filters .filter-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
}
.list-filters .filter-flags .check {
  margin: 0;
  width: auto;
  max-width: none;
  flex: 0 0 auto;
  min-height: var(--ctrl-h);
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
}
.list-filters .cat-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  align-items: center;
  align-content: center;
}
.list-filters .cat-picks .check { width: auto; flex: 0 1 auto; }
.list-filters .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: end;
  min-width: 0;
}
.list-filters .filter-row > input[type="search"] {
  flex: 1 1 12rem;
  width: auto;
  min-width: min(11rem, 100%);
  max-width: 100%;
}
.list-filters .filter-row-selects .filter-field {
  flex: 1 1 8.5rem;
  min-width: min(8.5rem, 100%);
  max-width: 14rem;
}
.list-filters .filter-row-dates .filter-field {
  flex: 1 1 9.5rem;
  min-width: min(9.5rem, 100%);
  max-width: 12rem;
}
.list-filters .filter-field {
  display: grid;
  gap: 0.2rem;
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  min-width: 0;
}
.list-filters .filter-field input,
.list-filters .filter-field select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: var(--ctrl-h);
  height: var(--ctrl-h);
}
.task-info { margin: 0.15rem 0 0; font-size: 0.82rem; }

.task-list { display: grid; gap: 0; min-width: 0; max-width: 100%; }
#today-list > .task-row,
#today-list > .empty,
#today-list > .list-section {
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
}
.list-section { display: grid; gap: 0; min-width: 0; }
.list-section-title {
  column-span: all;
  margin: 0.85rem 0 0.2rem;
  padding: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.list-section:first-child .list-section-title { margin-top: 0.15rem; }
.icon-key {
  column-span: all;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  margin: 1rem 0 0;
  padding: 0.55rem 0 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}
.icon-key-item {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  white-space: nowrap;
}
.icon-key .status-mark,
.icon-key .search-mark,
.icon-key .jira-mark,
.icon-key .child-mark {
  display: inline-flex;
  width: 14px;
  height: 14px;
}
.icon-key .status-mark svg,
.icon-key svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-key .ms { font-size: 14px; width: 14px; height: 14px; }
.icon-key .priority-bar.key-priority {
  width: 3px;
  height: 12px;
  border-radius: 1px;
  background: #c43737;
  display: inline-block;
}
@media (min-width: 1100px) {
  .app-main:has(#view-today.is-on) { max-width: min(1120px, 100%); }
  #today-list {
    display: block;
    column-count: 2;
    column-gap: 1.5rem;
  }
}
@media (min-width: 1680px) {
  .app-main:has(#view-today.is-on) { max-width: min(1560px, 100%); }
  #today-list { column-count: 3; }
}
.task-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.45rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
  background: transparent;
}
.task-row.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.task-check {
  --radio: 18px;
  box-sizing: content-box;
  width: var(--radio);
  height: var(--radio);
  min-width: var(--radio);
  min-height: var(--radio);
  /* 32px tap target. Negative margin keeps the row sized to the 18px circle. */
  padding: 8px 7px 6px;
  margin: -7px -7px -6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  flex: none;
}
.task-check::after {
  content: "";
  display: block;
  width: var(--radio);
  height: var(--radio);
  box-sizing: border-box;
  border: 2px solid #c5c5c5;
  border-radius: 50%;
  background: #fff;
}
.task-check.is-on::after { background: var(--navy); border-color: var(--navy); }
.task-check:focus-visible { outline: none; }
.task-check:focus-visible::after { box-shadow: 0 0 0 3px rgba(0, 122, 201, 0.35); }
.sub-edit .task-check {
  --radio: 20px;
  padding: 6px;
  margin: 2px -6px -6px;
}
.task-row.is-on { background: #f3f6fb; }
.ref-open {
  grid-column: 1 / -1;
  display: grid;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0;
  min-height: 0;
  cursor: pointer;
}
.ref-facts { display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.35rem 0.75rem; margin: 0.75rem 0 0; }
.ref-facts dt { color: var(--muted); }
.ref-facts dd { margin: 0; }
.task-body { display: grid; gap: 0.25rem; min-width: 0; }
.task-title {
  margin: 0; font-weight: 700; font-size: 1rem; line-height: 1.25; color: #111;
  background: none; border: 0; padding: 0; text-align: left; min-height: 0;
  width: 100%;
}
.task-meta { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.cat-tag {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; border: 0; padding: 0.15rem 0.45rem; min-height: 0;
  border-radius: 6px;
}
.list-edit { font-size: 0.75rem; min-height: 0; padding: 0; }
.icon-btn.list-edit,
.ref-row > .icon-btn,
.child-tasks .icon-btn {
  width: 28px; height: 28px; min-width: 28px; min-height: 28px; padding: 0;
}
.icon-btn.list-edit svg,
.ref-row > .icon-btn svg,
.child-tasks .icon-btn svg { width: 16px; height: 16px; }
.status-pill {
  font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.45rem;
  border-radius: 6px; border: 0; min-height: 0; background: #f0f0f0;
}
.task-ref, .task-ref-chip {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.task-ref-chip { font-weight: 700; }
.due-chip, .res-chip {
  font-size: 0.72rem; font-weight: 650; color: var(--muted);
  background: #f3f3f3; border-radius: 6px; padding: 0.12rem 0.4rem;
  border: 0; min-height: 0; text-decoration: none; color: inherit;
}
.status-mark {
  width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center;
}
.status-mark svg {
  width: 16px; height: 16px; display: block;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.status-mark.mark-overdue { color: #9b2335; }
.status-mark.mark-soon { color: #8a5a00; }
.status-mark.mark-new { color: #0e47df; }
.quick-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.25rem; }
.quick-row select, .quick-row input { width: auto; flex: 1 1 8rem; }
.sub-rows { margin: 0.2rem 0 0 0.15rem; display: grid; gap: 0.15rem; }
.sub-rows .sub-rows { margin-left: 1.15rem; }
.sub-row {
  display: flex; gap: 0.45rem; align-items: center;
  font-size: 0.9rem; color: var(--muted); font-weight: 600;
}
.child-task {
  background: none; border: 0; padding: 0; margin: 0; min-height: 0;
  text-align: left; font: inherit; color: inherit; cursor: pointer; font-weight: 700;
  line-height: 1.25;
}
.child-mark { width: 16px; height: 16px; margin-top: 2px; color: var(--blue); flex: none; }
.child-mark .ms, .search-mark .ms, .status-mark .ms, .jira-mark .ms { font-size: 16px; width: 16px; height: 16px; }
.jira-pair { display: inline-flex; align-items: center; gap: 0.15rem; }
.jira-mark { width: 16px; height: 16px; color: var(--navy); display: inline-flex; flex: none; }
.jira-mark svg { width: 16px; height: 16px; display: block; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pill-ico { margin-right: 0.12rem; }
.child-mark svg {
  width: 16px; height: 16px; display: block;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.sub-edit { align-items: flex-start; }
.sub-edit-fields { flex: 1; display: grid; gap: 0.25rem; min-width: 0; }
.sub-edit-fields textarea { min-height: 4.5rem; }
.step-summary { margin: 0.1rem 0 0; font-size: 0.82rem; font-weight: 500; line-height: 1.35; color: var(--navy); white-space: pre-wrap; }
.view-steps { padding: 0.35rem 0.2rem; display: grid; gap: 0.35rem; }
.view-step.is-done .view-step-title { text-decoration: line-through; }
.view-step-title { font-weight: 700; }
.info-when { text-transform: none; letter-spacing: 0; font-weight: 650; font-size: 0.75rem; color: var(--muted); margin-left: 0.35rem; }
.view-v .cat-tag, .view-v .status-pill, .view-v .due-chip { vertical-align: middle; }
.view-marks { margin: 0 0 0.35rem; }
.child-line { align-items: flex-start; border-radius: 8px; padding: 0.15rem 0.35rem; }
.child-main { display: grid; gap: 0.15rem; min-width: 0; flex: 1; }
.step-row { align-items: flex-start; padding-left: 0.35rem; }
.task-info-snip { margin: 0; font-size: 0.78rem; line-height: 1.35; color: var(--navy); }
.task-view { flex: 1; min-height: 0; overflow: auto; padding: 0.2rem 2rem 1rem 0; }
.task-view h2, #ref-detail-title { font-size: 1.05rem; font-weight: 700; margin: 0; }
.view-field {
  display: block; width: 100%; text-align: left; background: transparent;
  border: 0; padding: 0.35rem 0.2rem; margin: 0; min-height: 0;
  font: inherit; color: inherit; cursor: text; border-radius: 8px;
}
.view-field:hover { background: #f4f7fb; }
.view-jira { margin: 0 0 0.15rem; }
.view-jira .ref-facts { margin: 0.2rem 0 0; font-weight: 600; }
.view-jira-link {
  display: inline-block; margin: 0 0.2rem 0.45rem; font-size: 0.82rem;
  font-weight: 600; word-break: break-all;
}
.view-k { display: block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.view-v { display: block; font-weight: 600; }
.toast { display: flex; align-items: center; gap: 0.65rem; }
.toast button { min-height: var(--ctrl-h); height: var(--ctrl-h); }
.toast.has-undo {
  text-align: left;
  border-radius: 16px;
  max-width: min(94vw, 520px);
  padding: 0.7rem 0.85rem 0.7rem 1rem;
}
.toast .toast-msg { flex: 1; min-width: 0; line-height: 1.35; }
.toast .toast-undo {
  flex: none;
  background: #fff;
  color: #111;
  border: 1px solid #fff;
  border-radius: var(--ctrl-radius);
  font-weight: 750;
  padding: 0 0.85rem;
  -webkit-text-fill-color: #111;
}
.toast .toast-undo:hover,
.toast .toast-undo:focus-visible {
  background: #f3f3f3;
  color: #000;
  -webkit-text-fill-color: #000;
}
.sub-row.is-done .child-task { text-decoration: line-through; }
.empty {
  padding: 2rem 0.5rem; text-align: center; color: var(--muted); font-weight: 600;
}

.cal-nav {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  margin-bottom: 0.65rem; min-width: 0; max-width: 100%;
}
.cal-nav .ghost { padding: 0 var(--ctrl-px); font-size: var(--ctrl-font); }
.cal-nav .ghost.is-icon-only {
  width: var(--ctrl-h);
  min-width: var(--ctrl-h);
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  padding: 0;
}
.cal-nav .icon-btn.is-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cal-nav .is-icon-only .action-ico { margin-right: 0; }
.cal-week-label {
  margin: 0 0 0.45rem; font-weight: 800; color: var(--navy); font-size: 0.95rem;
}
.cal-strip {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.cal-day {
  border: 0; border-radius: 12px;
  background: #fff; padding: 0.55rem 0.2rem; text-align: center;
  display: grid; gap: 0.15rem; box-shadow: 0 0 0 1px var(--border);
}
.cal-day .dow { font-size: 0.65rem; font-weight: 800; color: var(--muted); letter-spacing: 0.04em; }
.cal-day .dom { font-size: 1.1rem; font-weight: 800; }
.cal-day.is-today .dom { text-decoration: underline; text-underline-offset: 3px; }
.cal-day.is-on { background: var(--navy); color: #fff; box-shadow: none; }
.cal-day.is-on .dow { color: rgba(255,255,255,0.75); }
.cal-day.has-tasks .dom::after {
  content: ''; display: block; width: 5px; height: 5px; border-radius: 50%;
  margin: 0.2rem auto 0; background: var(--cta);
}
.cal-day.is-on.has-tasks .dom::after { background: #fff; }

.cal-daylist { display: grid; gap: 0.4rem; margin: 0 0 0.85rem; }
.cal-daylist h2 {
  margin: 0; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted);
}
.cal-timeline { display: grid; gap: 0; position: relative; }
.cal-hour {
  display: grid; grid-template-columns: 52px 1fr; gap: 0.5rem;
  min-height: 56px; border-top: 1px solid var(--border);
}
.cal-hour .t { font-size: 0.72rem; font-weight: 700; color: var(--muted); padding-top: 0.25rem; }
.cal-hour .slot { position: relative; }
.cal-block {
  border: 0; border-radius: 12px; padding: 0.55rem 0.65rem;
  text-align: left; width: 100%; margin: 0.2rem 0;
  display: grid; gap: 0.15rem; min-height: 44px;
}
.cal-block strong { font-size: 0.9rem; }
.cal-block span { font-size: 0.72rem; opacity: 0.8; font-weight: 650; }
.cal-block.is-done { opacity: 0.55; }
.cal-block.is-done strong { text-decoration: line-through; }

.jira-dup[hidden] { display: none !important; }
.jira-dup {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 24, 32, 0.35);
  display: grid; place-items: center;
  padding: 1rem;
}
.jira-dup-card {
  width: min(100%, 32rem);
  background: #fff;
  border-radius: 16px;
  padding: 1rem 1rem 0.85rem;
  display: grid;
  gap: 0.65rem;
}
.jira-dup-card h2 { margin: 0; font-size: 1.05rem; }
.jira-dup-card p { margin: 0; }
.jira-dup-choices { display: grid; gap: 0.35rem; }
.jira-dup-note { margin: 0; }
.sheet {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(20, 24, 32, 0.35);
  display: grid; align-items: end;
  padding: 0;
}
.sheet-card {
  background: #fff;
  border-radius: 18px 18px 0 0;
  height: min(94dvh, 920px);
  max-height: min(94dvh, 920px);
  overflow: hidden;
  padding: 0.65rem 0.85rem calc(0.65rem + var(--safe-bottom));
  position: relative;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.sheet-x {
  position: absolute; top: 0.45rem; right: 0.45rem;
  border: 0; background: transparent; color: var(--muted);
}
.task-form { display: flex; flex-direction: column; gap: 0; min-height: 0; flex: 1; overflow: hidden; }
.task-scroll { display: grid; align-content: start; gap: 0.4rem; overflow: auto; min-height: 0; flex: 1; padding-top: 0.15rem; }
.task-form label { gap: 0.1rem; font-size: 0.75rem; }
.task-form .help { font-size: 0.75rem; line-height: 1.25; }
.task-form > .form-actions.editor-actions {
  position: static; flex: none; flex-wrap: wrap; align-items: center;
  background: #fff; border-bottom: 1px solid var(--border); border-top: 0;
  padding: 0.1rem 2.6rem 0.35rem 0; margin: 0 0 0.2rem; gap: 0.35rem;
}
.task-form > .form-actions.editor-actions .primary { margin-left: auto; }
.task-form > .form-actions.editor-actions .icon-btn { padding: 0; }
.task-checks { display: flex; flex-wrap: wrap; gap: 0.2rem 0.85rem; }
.task-form .ref-facts { margin: 0; gap: 0.12rem 0.5rem; font-size: 0.8rem; }
.title-label textarea {
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 650;
  min-height: var(--ctrl-h);
  height: auto;
  padding: 0.45rem 0.65rem;
  background: #fff;
  letter-spacing: 0;
  line-height: 1.3;
}
.title-label textarea.is-empty {
  border-color: #e24b4b;
  box-shadow: 0 0 0 1px #e24b4b;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem; }
.task-form .form-row {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: start;
}
.task-form .form-row > * { min-width: 0; }
.task-form .field {
  font-size: 0.75rem;
  gap: 0.1rem;
  align-content: start;
  min-width: 0;
}
/* Category and Status share one grid: labels on row 1, controls on row 2. */
.task-form .cat-status {
  grid-template-columns: minmax(0, 1fr) minmax(9.5rem, 14rem);
  grid-template-rows: auto auto;
  grid-template-areas:
    "cat-label status-label"
    "cat-picks status-field";
  column-gap: 0.85rem;
  row-gap: 0.25rem;
  align-items: start;
}
.task-form .cat-status > #task-cat-label { grid-area: cat-label; }
.task-form .cat-status > label[for="task-status"] { grid-area: status-label; }
.task-form .cat-status > .cat-multi { grid-area: cat-picks; }
.task-form .cat-status > .status-control { grid-area: status-field; }
.task-form .cat-status > .field-label {
  display: block;
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.2;
  align-self: baseline;
}
.task-form .cat-status > .cat-multi {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-self: start;
  align-content: start;
  align-items: center;
  justify-items: stretch;
  gap: 0.1rem 0.75rem;
  width: 100%;
  min-width: 0;
  min-height: 0;
}
.task-form .cat-status .cat-multi .check {
  display: grid;
  grid-template-columns: 1rem 1rem minmax(0, 1fr);
  column-gap: 0.4rem;
  align-items: center;
  min-height: var(--ctrl-h);
  min-width: 0;
  margin: 0;
  padding: 0;
  font-size: 0.8125rem;
  font-weight: 650;
  line-height: 1.25;
}
.task-form .cat-status .cat-multi .check input {
  width: 1rem;
  height: 1rem;
  min-width: 1rem;
  min-height: 1rem;
  margin: 0;
  justify-self: center;
}
.task-form .cat-status .cat-multi .cat-check-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  flex: none;
}
.task-form .cat-status .cat-multi .cat-check-icon .ms {
  display: block;
  width: 16px;
  height: 16px;
  font-size: 16px;
  line-height: 1;
  vertical-align: middle;
}
.task-form .cat-status .cat-multi .cat-check-name {
  min-width: 0;
  line-height: 1.25;
  overflow-wrap: break-word;
}
.task-form .cat-status > .status-control {
  align-self: start;
  width: 100%;
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  max-height: var(--ctrl-h);
}
.task-form .cat-status > .status-control select {
  display: block;
  width: 100%;
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  max-height: var(--ctrl-h);
}
@media (max-width: 640px) {
  .task-form .cat-status {
    grid-template-columns: minmax(0, 1fr) minmax(7.5rem, 42%);
  }
  .task-form .cat-status > .cat-multi {
    grid-template-columns: minmax(0, 1fr);
  }
}
.task-form input[type="date"],
.task-form input[type="time"] {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}
.due-fields {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  width: 100%;
  min-width: 0;
}
.task-form .field-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  min-height: 1.15rem;
}
.task-form .field-title label {
  display: inline;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1.2;
}
.task-form .help-q {
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  min-height: 1.15rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}
.task-form .help-q:focus-visible {
  outline: 2px solid var(--navy);
  outline-offset: 2px;
}
.task-form .help-q-pop {
  position: absolute;
  z-index: 6;
  left: 0;
  top: calc(100% + 0.2rem);
  margin: 0;
  max-width: min(18rem, 100%);
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
  box-shadow: 0 6px 16px rgba(16, 24, 40, 0.1);
  pointer-events: none;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
}
.task-form .due-fields:has(.help-q:hover) .help-q-pop,
.task-form .due-fields:has(.help-q:focus) .help-q-pop,
.task-form .due-fields:has(.help-q:focus-visible) .help-q-pop {
  clip: auto;
  clip-path: none;
  width: max-content;
  height: auto;
  overflow: visible;
  white-space: normal;
}
.due-date-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  width: auto;
  max-width: 100%;
}
.task-form .due-date-line input[type="date"] {
  width: 10.75rem;
  max-width: 100%;
  flex: 0 0 auto;
  min-width: 0;
}
.task-form .all-day-check {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
  width: auto;
  max-width: 100%;
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  margin: 0;
  gap: 0.45rem;
  padding: 0;
  white-space: nowrap;
  background: transparent;
  line-height: 1.2;
}
.task-form .all-day-check input {
  width: 1.25rem;
  height: 1.25rem;
  min-width: 1.25rem;
  min-height: 1.25rem;
  flex: none;
}
.task-form .link-field,
.task-form .link-field input {
  color: var(--text);
}
.task-form .link-field input { font-weight: 650; }
#task-form #task-info + .md-preview { display: none !important; }
.child-tasks { display: grid; gap: 0.25rem; }
.child-tasks .sub-row { align-items: center; }
.subtask-list { display: grid; gap: 0.35rem; }
.subtask-add { display: flex; gap: 0.45rem; align-items: center; }
.subtask-add input { flex: 1 1 auto; min-width: 0; }
.subtask-add .icon-plus { flex: none; }
.sub-edit-fields input,
.sub-edit-fields textarea {
  color: var(--text);
  font-weight: 500;
}
.icon-plus {
  width: var(--ctrl-h); height: var(--ctrl-h); min-width: var(--ctrl-h); min-height: var(--ctrl-h);
  border-radius: 50%; padding: 0;
  border: 1px solid var(--border); background: #fff; font-size: 1.15rem; line-height: 1;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: var(--tint); color: var(--navy);
  border-radius: 999px; padding: 0.25rem 0.55rem;
  font-size: 0.78rem; font-weight: 700; border: 0; min-height: 0;
}
.chip button {
  border: 0; background: transparent; color: inherit;
  padding: 0; min-height: 0; font-size: 1rem; line-height: 1;
}
.chip-kind {
  font-size: 0.65rem; font-weight: 800; letter-spacing: 0.03em;
  text-transform: uppercase; opacity: 0.7;
}
.chip-detail { font-weight: 600; color: var(--muted); }
.chip a { color: inherit; }
.ref-row { display: flex; align-items: flex-start; gap: 0.25rem; }
.ref-row .ref-open { flex: 1; min-width: 0; }
.form-actions { display: flex; gap: 0.5rem; margin-top: 0.35rem; }
.catchup-fields {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 0.85rem;
  min-width: 0;
}
@media (min-width: 720px) {
  .catchup-fields {
    grid-template-columns: minmax(11rem, 0.38fr) minmax(0, 1fr);
    align-items: start;
  }
}
.catchup-topic { margin: 0; display: grid; gap: 0.3rem; font-weight: 700; min-width: 0; }
.catchup-topic input { font-weight: 450; }
.catchup-source { display: grid; gap: 0.3rem; margin: 0; font-weight: 700; min-width: 0; }
.catchup-source .help { font-weight: 500; display: block; }
.catchup-source textarea { font-weight: 450; min-height: 5.5rem; width: 100%; min-width: 0; }
.catchup-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.45rem; min-width: 0; max-width: 100%; }
.catchup-actions select {
  flex: 1 1 12rem;
  width: auto;
  min-width: min(12rem, 100%);
  max-width: 100%;
}
.catchup-review h2 { margin: 0; font-size: 1.05rem; }
.catchup-review-part { display: grid; gap: 0.4rem; padding: 0.7rem 0; border-top: 1px solid var(--border); }
.catchup-review-include { display: flex; gap: 0.55rem; align-items: flex-start; font-weight: 600; }
.catchup-review-include input { width: 1.15rem; height: 1.15rem; margin-top: 0.15rem; flex: none; }
.catchup-review-copy { display: grid; gap: 0.2rem; min-width: 0; }
.catchup-review-controls { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.catchup-review-controls select { flex: 1 1 11rem; min-width: 0; max-width: 100%; }
.catchup-review .form-actions { flex-wrap: wrap; }
.catchup-review .form-actions .primary { margin-left: auto; }
.catchup-review-ask { margin: 0; }
.catchup-ask { margin: 0.25rem 0 0; }
.md { font-weight: 500; line-height: 1.4; }
.md p { margin: 0.2rem 0; }
.md h1, .md h2, .md h3 { margin: 0.35rem 0 0.1rem; font-size: 0.98rem; }
.md ul, .md ol { margin: 0.15rem 0; padding-left: 1.15rem; }
.md blockquote { margin: 0.25rem 0; padding-left: 0.6rem; border-left: 3px solid var(--border); color: var(--muted); }
.md code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85em; background: #f3f3f3; padding: 0.05rem 0.25rem; border-radius: 4px; }
.md pre { margin: 0.25rem 0; overflow: auto; background: #f6f6f6; padding: 0.4rem 0.5rem; border-radius: 8px; }
.md pre code { background: none; padding: 0; }
.md a { word-break: break-word; }
.md-preview { margin-top: 0.25rem; }
.md-preview[hidden] { display: none !important; }
.save-wide { flex: 1; }
.history-list { display: grid; gap: 0.4rem; }
.history-item {
  background: #f7f7f7; border-radius: 10px; padding: 0.55rem 0.7rem;
  font-size: 0.85rem; font-weight: 550;
}
.history-item time { display: block; color: var(--muted); font-size: 0.72rem; margin-bottom: 0.15rem; }
.jira-panel { display: grid; gap: 0.45rem; }
button.jira-chip {
  border: 0; font: inherit; cursor: pointer; color: var(--blue, #007ac9);
}

.stub-card {
  background: #fff; border-radius: 14px; padding: 1rem;
  border: 1px solid var(--border); display: grid; gap: 0.55rem;
}
.settings-grid { display: grid; gap: 0.65rem; }
.settings-block {
  background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 0.15rem 0.9rem 0.85rem;
}
.settings-block:not([open]) { padding-bottom: 0.15rem; }
.settings-block summary {
  cursor: pointer; font-weight: 700; color: var(--navy); padding: 0.75rem 0; font-size: 1.05rem;
}
.settings-row input[type="text"] { flex: 1 1 10rem; min-width: 8rem; }
.inline-add { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.65rem; }
.inline-add input[type="text"], .inline-add input:not([type]), .inline-add input[type="email"] { flex: 1 1 120px; }
.inline-add input[type="color"] { flex: 0 0 auto; }
.color-pair { display: flex; gap: 0.75rem; align-items: end; flex-wrap: wrap; }
.color-pair label, .color-field { width: auto; }
.color-field { font-size: 0.72rem; font-weight: 700; color: var(--navy); }
.color-sample {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0.15rem 0.5rem;
  border-radius: 6px; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
}
.settings-list { display: grid; gap: 0.45rem; }
.settings-row {
  display: flex; gap: 0.45rem; align-items: center; flex-wrap: wrap;
  background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 0.5rem 0.65rem;
}
.settings-row .swatch {
  width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto;
}
.settings-row strong { flex: 1; font-size: 0.9rem; }
.stack-form { display: grid; gap: 0.65rem; margin-bottom: 1rem; }
.settings-h3 { margin: 1rem 0 0.45rem; font-size: 0.95rem; color: var(--navy); }
.row-add { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0 0 0.85rem; }
.row-add .ghost.is-on { background: var(--chip); box-shadow: inset 0 0 0 1px var(--border); }
.paste-box { display: grid; gap: 0.45rem; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 0.85rem 1rem; margin-bottom: 0.85rem; }
.paste-preview { display: grid; gap: 0.25rem; margin: 0; }
.paste-preview p { margin: 0; font-weight: 700; }
.paste-preview ul { margin: 0; padding-left: 1.1rem; }
.paste-preview li { margin: 0.15rem 0; }
.flag-form { display: grid; gap: 0.7rem; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 1rem; margin-bottom: 1rem; }
.flag-form .form-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.grid-3 { display: grid; gap: 0.65rem; }
@media (min-width: 720px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}
.form-error { color: #9B2335; font-size: 0.86rem; margin: 0; }
/* Typeahead menus stay light: dark text always, navy-on-tint for hover/keyboard highlight.
   Do not inherit white text from a dark chrome ancestor or color-scheme. */
.at-results,
.at-results.assign-suggest {
  list-style: none; margin: 0; padding: 0.25rem 0; border: 1px solid var(--border);
  border-radius: 10px; background: #fff; color: #222; color-scheme: light;
  max-height: 180px; overflow: auto; forced-color-adjust: none;
}
.at-results button,
.at-results [role="option"] {
  display: block; width: 100%; text-align: left; background: #fff; border: 0;
  padding: 0.55rem 0.75rem; font: inherit; cursor: pointer;
  color: #222; -webkit-text-fill-color: #222; color-scheme: light;
}
.at-results button:hover,
.at-results button:focus,
.at-results button:focus-visible,
.at-results button.is-active,
.at-results button[aria-selected="true"],
.at-results [role="option"]:hover,
.at-results [role="option"]:focus,
.at-results [role="option"]:focus-visible,
.at-results [role="option"].is-active,
.at-results [role="option"][aria-selected="true"] {
  background: #E5EDFD;
  color: #001C71;
  -webkit-text-fill-color: #001C71;
}
.at-results button .chip-kind,
.at-results [role="option"] .chip-kind {
  color: inherit; -webkit-text-fill-color: currentColor;
}
.task-suggest { margin-top: 0.25rem; }
.doc-log { margin-top: 0.5rem; display: grid; gap: 0.5rem; }
.empty { color: var(--muted); padding: 0.75rem 0; }

.toast {
  position: fixed; left: 50%; bottom: calc(0.75rem + var(--safe-bottom));
  transform: translateX(-50%);
  background: #222; color: #fff; padding: 0.65rem 1rem;
  border-radius: 999px; font-weight: 650; font-size: 0.88rem;
  z-index: 50; max-width: min(90vw, 360px); text-align: center;
  box-sizing: border-box;
}

@media (min-width: 720px) {
  .sheet { align-items: center; padding: 1rem; }
  .sheet-card { border-radius: 18px; height: min(90dvh, 880px); max-height: min(90dvh, 880px); }
}

@media (max-width: 719px) {
  .app-top { flex-wrap: wrap; gap: 0.4rem; padding: 0.4rem 0.6rem; }
  .brand .who { display: none; }
  .brand strong { font-size: 0.82rem; }
  .brand .mark { width: 22px; height: 22px; }
  .global-search { order: 3; flex: 1 1 100%; max-width: none; }
  .tab-nav { gap: 0.15rem; padding: 0.28rem 0.45rem; }
  .app-main { padding: 0.55rem 0.65rem 1rem; }
  .view-head { margin-bottom: 0.4rem; gap: 0.35rem; align-items: center; }
  #view-today .view-head { margin-bottom: 0.45rem; align-items: stretch; }
  .view-head h1 { font-size: 1.25rem; }
  .view-sub { font-size: 0.75rem; margin: 0; }
  .view-actions { gap: 0.3rem; }
  .view-actions { width: 100%; }
  .help { font-size: 0.75rem; line-height: 1.3; }
  .today-source-row { grid-template-columns: minmax(0, 1fr); }
  .today-source-actions .ghost { white-space: normal; }
  .assigned-toggle { font-size: 0.85rem; }
  .quick-add { display: grid; grid-template-columns: 1fr auto; gap: 0.3rem; margin-bottom: 0.45rem; }
  .quick-add input[type="text"] { grid-column: 1 / -1; min-width: 0; flex: none; }
  .quick-add select, .quick-add .check { min-width: 0; font-size: 0.8rem; }
  .quick-add .primary { width: auto; }
  .list-bar .check { font-size: 0.75rem; }
  .task-row { gap: 0.4rem; padding: 0.35rem 0; }
  .task-title { font-size: 0.92rem; }
  .task-meta { gap: 0.25rem; }
  .due-chip, .status-pill, .cat-tag { font-size: 0.66rem; }
  .row-add { flex-wrap: nowrap; overflow-x: auto; gap: 0.3rem; margin-bottom: 0.45rem; }
  .row-add .ghost { flex: 0 0 auto; }
  .ref-facts { grid-template-columns: 5.6rem 1fr; gap: 0.2rem 0.4rem; font-size: 0.82rem; }
  .catchup-actions select { max-width: 100%; flex: 1 1 100%; min-width: 0; }
  .catchup-review-controls { flex-direction: column; }
  .catchup-review-controls select { width: 100%; }
  .catchup-review .form-actions .primary,
  .catchup-review .form-actions .ghost { margin-left: 0; width: 100%; }
  .flag-form, .paste-box, .stack-form { gap: 0.4rem; padding: 0.65rem; }
  input, textarea, select { max-width: 100%; }
  .sheet-card { padding: 0.45rem 0.6rem calc(0.45rem + var(--safe-bottom)); }
}

.attach-block { display: grid; gap: 0.45rem; margin: 0.35rem 0 0.15rem; }
.attach-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 0.75rem; font-weight: 700; color: var(--navy); }
.attach-add {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
}
.attach-add input {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0;
  opacity: 0; cursor: pointer; padding: 0; border: 0;
}
.attach-grid, .attach-block .attach-cards { display: flex; flex-wrap: wrap; gap: 0.45rem; }
#task-attach-list, .attach-block { min-width: 0; }
.attach-card { display: grid; gap: 0.15rem; width: 4.75rem; justify-items: center; }
.attach-thumb {
  width: 4.75rem; height: 4.75rem; padding: 0; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border); background: #f4f7fb; cursor: zoom-in;
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attach-card .text-btn { height: 28px; min-height: 28px; padding: 0 0.35rem; font-size: 0.75rem; }
.attach-file {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.55rem;
  padding: 0.35rem 0; border-bottom: 1px solid var(--border); min-width: 0;
}
.attach-file a:not(.ghost) { color: var(--navy); font-weight: 700; word-break: break-word; }
.attach-file .ghost { flex: 0 0 auto; }
.attach-empty { font-size: 0.78rem; }
.attach-lightbox {
  position: fixed; inset: 0; z-index: 70;
  display: grid; place-items: center; padding: 1rem;
}
.attach-lightbox[hidden] { display: none; }
.attach-lightbox-backdrop {
  position: absolute; inset: 0; border: 0; padding: 0; margin: 0;
  background: rgba(10, 16, 32, 0.82); cursor: zoom-out;
}
.attach-lightbox-frame {
  position: relative; z-index: 1; display: grid; justify-items: center; gap: 0.55rem;
  max-width: 100%; max-height: 100%;
}
.attach-lightbox-frame img {
  width: auto; height: auto;
  max-width: calc(100vw - 2rem); max-height: calc(100dvh - 5.5rem);
  background: #fff; border-radius: 8px;
}
.attach-lightbox-close { position: absolute; top: -0.2rem; right: -0.2rem; background: #fff; }
.attach-lightbox-frame .ghost { background: #fff; }
.task-title.is-overdue { background: #fde8e8; border-radius: 6px; padding: 0.05rem 0.28rem; }
.title-line {
  display: flex; align-items: flex-start; gap: 0.4rem; min-width: 0;
}
.title-line .task-title { width: auto; flex: 1; }
.priority-bar {
  flex: none; width: 3px; align-self: stretch; min-height: 1.05rem;
  margin: 0.12rem 0; border-radius: 2px; background: #c43737;
}
.priority-mark {
  flex: none; width: 16px; height: 16px; margin-top: 0.12rem;
  color: #c43737; display: inline-flex; align-items: center; justify-content: center;
}
.priority-mark .ms { font-size: 16px; width: 16px; height: 16px; }
.field { display: grid; gap: 0.28rem; font-size: 0.84rem; font-weight: 650; }
.cat-multi { display: flex; flex-wrap: wrap; gap: 0.35rem 0.75rem; }
.cat-multi .check { min-height: 32px; margin: 0; }
.search-cats { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; align-items: center; }
.cal-cats { display: flex; flex-wrap: wrap; gap: 0.25rem; opacity: 1; }
.cal-cats .cat-tag { opacity: 1; }
.pill-pop .ghost.is-on { border-color: var(--navy); background: var(--tint); color: var(--navy); }
#task-view-title.title-line { align-items: center; }
.task-row.assigned-jira { grid-template-columns: 1fr; cursor: pointer; }
.jira-id {
  margin: 0; padding: 0; border: 0; background: transparent; min-height: 0;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; color: var(--muted); text-align: left;
}
.id-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 0; }
.id-stack .rollup { padding-left: 0; }
.row-fns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.35rem; margin-top: 0.15rem; }
.action-ico { display: inline-flex; align-items: center; margin-right: 0.28rem; }
.action-ico .ms, .add-btn .ms, .icon-btn .ms, .attach-add .ms { font-size: 18px; width: 18px; height: 18px; vertical-align: middle; }
.ghost.is-icon-only, .primary.is-icon-only, a.ghost.is-icon-only, .attach-add.is-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--ctrl-h);
  min-height: var(--ctrl-h);
  width: var(--ctrl-h);
  height: var(--ctrl-h);
  padding: 0;
  text-align: center;
}
.icon-btn.is-icon-only, .add-btn.is-icon-only {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--ctrl-h);
  min-width: var(--ctrl-h);
  height: var(--ctrl-h);
  min-height: var(--ctrl-h);
  padding: 0;
}
.ghost.is-icon-only .action-ico,
.primary.is-icon-only .action-ico,
a.ghost.is-icon-only .action-ico,
.attach-add.is-icon-only .action-ico,
.icon-btn.is-icon-only .action-ico,
.add-btn.is-icon-only .action-ico { margin-right: 0; }
.btn-settings { display: grid; gap: 1.1rem; }
.btn-settings-group { display: grid; gap: 0.35rem; }
.btn-settings-title {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--navy);
}
.btn-settings-head, .btn-settings-row {
  display: grid;
  grid-template-columns: minmax(8rem, 1.3fr) minmax(7.5rem, 1.1fr) minmax(5.5rem, 0.9fr) auto;
  gap: 0.45rem 0.75rem;
  align-items: center;
}
.btn-settings-head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0 0.1rem;
  border-bottom: 1px solid var(--border);
}
.btn-settings-name { font-weight: 650; color: var(--navy); min-width: 0; }
.btn-settings-word { color: var(--muted); font-size: 0.9rem; min-width: 0; }
.btn-settings-hide { margin: 0; white-space: nowrap; }
.btn-settings-row .icon-pick { justify-self: start; }
@media (max-width: 700px) {
  .btn-settings-head { display: none; }
  .btn-settings-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
  }
  .btn-settings-word::before { content: "Text: "; font-weight: 700; color: var(--muted); }
}
.list-settings { display: grid; gap: 0.35rem; }
.list-settings-head, .list-settings-row {
  display: grid;
  gap: 0.45rem 0.75rem;
  align-items: center;
}
.list-settings-head {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 0 0.1rem;
  border-bottom: 1px solid var(--border);
}
.cat-settings .list-settings-head,
.cat-settings .list-settings-row {
  grid-template-columns: minmax(8rem, 1.4fr) auto auto minmax(5rem, 1fr) minmax(7.5rem, 1.1fr) auto;
}
.st-settings .list-settings-head,
.st-settings .list-settings-row {
  grid-template-columns: minmax(8rem, 1.4fr) minmax(7.5rem, 1.2fr) minmax(7.5rem, 1.1fr) auto auto;
}
.list-settings-name {
  width: 100%;
  min-width: 0;
  margin: 0;
}
.list-settings-row .color-field { margin: 0; }
.list-settings-field-label { display: none; }
.list-settings-color {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  flex-wrap: wrap;
}
.list-settings-high { margin: 0; white-space: nowrap; }
.list-settings-item { display: grid; gap: 0.15rem; }
.list-settings-actions { min-width: 2rem; min-height: 1px; }
.list-settings-locked {
  margin: 0;
  padding: 0 0 0.2rem;
  font-size: 0.78rem;
  line-height: 1.35;
  max-width: 28rem;
}
.list-settings-row .icon-pick { justify-self: start; }
@media (max-width: 700px) {
  .list-settings-head { display: none; }
  .cat-settings .list-settings-row,
  .st-settings .list-settings-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--border);
  }
  .list-settings-field-label {
    display: inline;
    margin-right: 0.35rem;
  }
  .list-settings-row .icon-pick::before {
    content: "Icon: ";
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
    margin-right: 0.25rem;
  }
  .list-settings-color::before {
    content: "Color: ";
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--muted);
  }
}
.cat-tag .ms, .status-pill .ms, .color-sample .ms, .cat-chip .ms, .pill-pop .ms {
  text-transform: none; letter-spacing: normal; font-weight: normal;
  font-size: 14px; width: 14px; height: 14px; margin-right: 0.12rem; vertical-align: -0.2em;
}
.jira-due { font-weight: 700; }
.rollup {
  display: inline-flex; align-items: center; gap: 0.2rem;
  min-height: 28px; padding: 0 0.35rem; border: 0; background: transparent;
  color: var(--navy); font-size: 0.75rem; font-weight: 700;
}
.rollup .twist { width: 14px; height: 14px; transition: transform 0.15s ease; }
.rollup[aria-expanded="true"] .twist { transform: rotate(90deg); }
.pill-btn { border: 0; padding: 0; background: transparent; min-height: 0; }
.date-pop, .pill-pop {
  position: fixed; z-index: 60; background: #fff; border: 1px solid var(--border);
  border-radius: 12px; padding: 0.55rem; box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12);
  display: grid; gap: 0.4rem; max-width: min(420px, calc(100vw - 1rem));
}
.date-pop[hidden], .pill-pop[hidden] { display: none; }
/* Quick chips above the date input so the native calendar (below the field) does not cover them. */
.date-quick, .pill-pop { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.date-pop {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0.55rem;
  overflow: visible;
}
.date-pop.is-quick-only { gap: 0; }
.date-quick {
  position: relative;
  z-index: 2;
  order: -1;
}
.date-pop > input[type="date"] {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: var(--ctrl-h);
  height: var(--ctrl-h);
}
.date-quick .ghost, .pill-pop .ghost { min-height: 36px; }
.assign-row { position: relative; display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-top: 0.35rem; }
.assign-row input { min-width: 10rem; flex: 1; }
.assign-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 0.15rem); z-index: 30;
  margin: 0;
}
.assign-suggest[hidden] { display: none; }
.assigned-level, .assigned-full { display: grid; gap: 0.35rem; margin-top: 0.35rem; }
.assigned-k { font-weight: 800; color: var(--navy); }
.assigned-pre { white-space: pre-wrap; }
.assigned-block h3 { margin: 0.35rem 0 0; font-size: 0.78rem; color: var(--navy); }
.assigned-fields { margin: 0.15rem 0 0; }
.menu-row { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.font-drop { position: relative; margin-bottom: 0.75rem; max-width: 24rem; }
.font-drop-btn {
  width: 100%; text-align: left; border: 1px solid var(--border); background: #fff;
  border-radius: var(--ctrl-radius); min-height: var(--ctrl-h); padding: 0 0.7rem; font-size: 1rem;
  /* Keep closed-field preview face (inline font-family) instead of shorthand inherit alone. */
  font-family: inherit;
}
.font-drop-panel {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px);
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12); padding: 0.4rem; display: grid; gap: 0.35rem;
}
.font-drop-panel[hidden] { display: none; }
.font-drop-list { max-height: 280px; overflow: auto; }
.font-group { margin: 0.45rem 0 0.15rem; padding: 0 0.45rem; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.font-group[hidden], .font-option[hidden] { display: none; }
.font-option {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  border-radius: 8px; padding: 0.35rem 0.55rem; font-size: 1rem;
}
.font-option.is-on, .font-option:hover { background: var(--tint); color: var(--navy); }
.icon-pick {
  display: inline-flex; align-items: center; gap: 0.25rem;
  min-height: 32px; border: 1px solid var(--border); background: #fff;
  border-radius: 8px; padding: 0 0.45rem; font-size: 0.75rem;
}
.icon-pick svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-picker {
  position: fixed; z-index: 80; width: min(320px, calc(100vw - 1rem));
  max-height: min(380px, 70vh); overflow: auto; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; padding: 0.5rem;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.12); display: grid; gap: 0.4rem;
}
.icon-picker[hidden] { display: none; }
.icon-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.2rem; }
.icon-grid button {
  min-height: 36px; height: 36px; padding: 0; border: 1px solid transparent;
  background: transparent; border-radius: 8px; display: grid; place-items: center;
}
.icon-grid button:hover, .icon-grid button:focus { border-color: var(--border); background: var(--tint); }
.status-mark.mark-high { color: #c43737; }
#ref-sheet .stack-form.task-form {
  display: flex; flex-direction: column; gap: 0;
  overflow: hidden; min-height: 0; flex: 1;
  padding: 0.15rem 0 0; margin-bottom: 0;
}
#ref-sheet .editor-toolbar {
  flex: none; display: flex; flex-wrap: wrap; align-items: center;
  gap: 0.35rem 0.65rem; padding: 0.1rem 2.6rem 0.35rem 0;
  border-bottom: 1px solid var(--border); margin-bottom: 0.2rem;
  background: #fff;
}
#ref-sheet .editor-toolbar h2 {
  margin: 0; font-size: 1.05rem; font-weight: 700;
  flex: 1 1 8rem; min-width: 0; line-height: 1.25;
}
#ref-sheet .editor-toolbar .form-actions {
  margin: 0; flex: 0 1 auto; flex-wrap: wrap; gap: 0.35rem;
}
#ref-sheet .ref-scroll {
  display: grid; align-content: start; gap: 0.65rem;
  overflow: auto; min-height: 0; flex: 1; padding-top: 0.15rem;
}

#pencil-launch { display: none; }
html.is-ipad #pencil-launch {
  display: inline-flex;
  align-items: center;
  flex: none;
  white-space: nowrap;
}

html.is-ipad .pencil-wrap {
  position: relative;
  display: block;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}
html.is-ipad .pencil-wrap > input,
html.is-ipad .pencil-wrap > textarea {
  width: 100%;
  max-width: 100%;
  padding-right: 2.15rem;
}
html.is-ipad .pencil-open {
  position: absolute;
  z-index: 2;
  right: 0.2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: var(--tint);
  color: var(--navy);
}
html.is-ipad .pencil-wrap:has(textarea) .pencil-open {
  top: 0.35rem;
  transform: none;
}
html.is-ipad .pencil-open svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
html.is-ipad .app-top .pencil-wrap {
  flex: 1;
  width: auto;
  max-width: 28rem;
}
html.is-ipad .app-top .pencil-wrap > .global-search { max-width: none; }
html.is-ipad .app-top .pencil-open {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}
html.is-ipad .quick-row .pencil-wrap,
html.is-ipad .assign-row .pencil-wrap,
html.is-ipad .subtask-add .pencil-wrap,
html.is-ipad .list-filters .filter-row > .pencil-wrap {
  flex: 1 1 12rem;
  width: auto;
  min-width: min(10rem, 100%);
}
@media (max-width: 719px) {
  html.is-ipad .app-top .pencil-wrap {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
  }
}

.pencil-sheet[hidden] { display: none !important; }
.pencil-sheet {
  position: fixed;
  z-index: 95;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: calc(0.7rem + var(--safe-top)) 0.85rem calc(0.7rem + var(--safe-bottom));
  background: #f6f4ef;
}
.pencil-sheet-bar {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.pencil-sheet-bar h2 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}
#pencil-pad {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: auto;
  resize: none;
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  background: #fff;
  font-size: clamp(1.35rem, 2.6vw, 1.85rem);
  line-height: 1.65;
  font-weight: 500;
}
.pencil-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}
body.is-pencil-open { overflow: hidden; }

.layout-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--ctrl-radius);
  overflow: hidden;
  background: #fff;
}
.layout-switch .ghost {
  border: 0;
  border-radius: 0;
  min-height: var(--ctrl-h);
  background: transparent;
}
.layout-switch .ghost.is-on {
  background: var(--navy);
  color: #fff;
}
#view-today.is-board [data-rollup-all] { display: none; }
.app-main:has(#view-today.is-board.is-on) { max-width: min(1760px, 100%); }
#today-list.is-board {
  display: grid;
  gap: 0.65rem;
  column-count: auto;
}
#today-list.is-board .board {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  width: 100%;
  padding-bottom: 0.25rem;
  -webkit-overflow-scrolling: touch;
}
.board-col {
  flex: 0 0 min(17.5rem, 78vw);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: min(72dvh, 760px);
  padding: 0.55rem;
  border-radius: 12px;
  background: #f3f3f3;
  border: 1px solid transparent;
}
.board-col.is-drop {
  border-color: var(--navy);
  background: var(--tint);
}
.board-col-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.board-col-head h2 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.82rem;
  line-height: 1.2;
}
.board-col-mark {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex: none;
}
.board-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
}
.board-col-cards {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  overflow: auto;
  min-height: 4.5rem;
}
.board-empty {
  margin: 0.35rem 0;
  color: var(--muted);
  font-size: 0.78rem;
}
.board-card {
  display: grid;
  gap: 0.35rem;
  padding: 0.45rem 0.5rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.board-card.is-dragging { opacity: 0.35; }
.board-card.is-done .task-title { text-decoration: line-through; color: var(--muted); }
.board-card-top {
  display: flex;
  align-items: flex-start;
  gap: 0.2rem;
  min-width: 0;
}
.board-card-main { flex: 1; min-width: 0; display: grid; gap: 0.2rem; }
.board-card .task-check { margin: 0; }
.board-card .title-line { min-width: 0; }
.board-card .task-title { white-space: normal; }
.board-grip {
  width: 28px;
  height: 28px;
  min-width: 28px;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  touch-action: none;
  cursor: grab;
  flex: none;
}
.board-grip svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.board-ghost {
  position: fixed;
  z-index: 96;
  pointer-events: none;
  margin: 0;
  opacity: 0.94;
  box-shadow: 0 12px 28px rgba(0, 28, 113, 0.18);
}
body.is-board-dragging { user-select: none; cursor: grabbing; }
.toast { z-index: 110; }
