/* eBo styles
 */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
body { margin: 0; background: var(--color-paper); color: var(--color-ink-2);
  font: 400 var(--text-md)/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); color: var(--color-ink); font-weight: 600; letter-spacing: -0.02em; margin: 0; font-style: normal; }
h1 { font-size: var(--text-2xl); overflow-wrap: anywhere; min-width: 0; }
h2 { font-size: var(--text-lg); }
h3 { font-size: var(--text-sm); }
:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.mono, .key { font-family: var(--font-mono); }
.label { font: 500 var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: 0.06em; color: var(--color-muted); }
.muted { color: var(--color-muted); }

/* Shell */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.rail { border-right: var(--rule); background: var(--color-paper-2); padding: var(--space-lg) var(--space-md);
  display: flex; flex-direction: column; gap: var(--space-xl); position: sticky; top: 0; height: 100dvh; overflow-y: auto; }
.wordmark { font: 700 var(--text-xl)/1 var(--font-display); color: var(--color-ink); letter-spacing: -0.03em; padding: 0 var(--space-sm); }
.wordmark span { color: var(--color-accent); }
.jump { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 6px var(--space-sm);
  border: var(--rule); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-muted); cursor: pointer; font: inherit; }
.jump:hover { border-color: var(--color-rule-strong); }
kbd { font: 500 var(--text-xs) var(--font-mono); border: var(--rule); border-radius: var(--radius-sm); padding: 1px 5px; color: var(--color-muted); background: var(--color-paper-2); }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav .label { padding: 0 var(--space-sm) var(--space-sm); }
.nav a { display: flex; align-items: center; gap: var(--space-sm); padding: 6px var(--space-sm); border-radius: var(--radius-md);
  color: var(--color-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background var(--dur-fast) var(--ease-out); }
.nav a:hover { background: var(--color-paper-3); }
.nav a[aria-current="page"] { background: var(--color-accent-soft); color: var(--color-ink); font-weight: 500; }
.nav a[aria-current="page"]::before { content: ""; width: 3px; height: 14px; border-radius: 2px; background: var(--color-accent); margin-left: -6px; }
.rail-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-sm); border-top: var(--rule); }
.main { min-width: 0; display: flex; flex-direction: column; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-md);
  padding: var(--space-xl) var(--space-2xl) var(--space-lg); border-bottom: var(--rule); }
.pagehead .crumbs { margin-bottom: var(--space-xs); }
.pagehead .crumbs a:hover { color: var(--color-accent); }
.content { padding: var(--space-xl) var(--space-2xl); min-width: 0; }

/* Controls */
.btn, button { font: 500 var(--text-sm)/1 var(--font-body); color: var(--color-ink); background: var(--color-surface);
  border: 1px solid var(--color-rule-strong); border-radius: var(--radius-md); padding: 7px 12px; cursor: pointer; white-space: nowrap;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out); }
.btn:hover, button:hover { background: var(--color-paper-3); }
.btn:active, button:active { transform: translateY(1px); }
.btn:disabled, button:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-accent-ink); border-color: var(--color-accent); }
.btn-primary:hover { background: var(--color-accent); filter: brightness(1.08); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--color-muted); }
.btn-ghost:hover { color: var(--color-ink); }
input, select, textarea { font: inherit; color: var(--color-ink); background: var(--color-surface); border: 1px solid var(--color-rule-strong);
  border-radius: var(--radius-md); padding: 6px 9px; min-width: 0; }
input:hover, select:hover, textarea:hover { border-color: var(--color-muted); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 0; border-color: var(--color-focus); }
textarea { width: 100%; resize: vertical; line-height: 1.5; }

/* Filters */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.seg { display: inline-flex; border: var(--rule); border-radius: var(--radius-md); background: var(--color-surface); padding: 2px; flex-wrap: wrap; }
.seg a { padding: 5px 10px; border-radius: var(--radius-sm); color: var(--color-muted); font-size: var(--text-sm); white-space: nowrap; }
.seg a:hover { color: var(--color-ink); }
.seg a[aria-current="true"] { background: var(--color-paper-3); color: var(--color-ink); font-weight: 500; }
.search { flex: 1 1 200px; max-width: 320px; }

/* Board */
.board { display: flex; gap: var(--space-md); overflow-x: auto; padding-bottom: var(--space-lg); align-items: flex-start; }
.col { flex: 0 0 272px; background: var(--color-paper-2); border: var(--rule); border-radius: var(--radius-lg); display: flex; flex-direction: column; max-height: calc(100dvh - 190px); }
.col-head { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-md) var(--space-md) var(--space-sm); }
.col-head h2 { font-size: var(--text-sm); font-family: var(--font-body); font-weight: 600; letter-spacing: 0; }
.col-head .count { font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--color-cat-todo); }
.dot.backlog { background: var(--color-cat-backlog); } .dot.active { background: var(--color-cat-active); }
.dot.waiting { background: var(--color-cat-waiting); } .dot.review { background: var(--color-cat-review); } .dot.done { background: var(--color-cat-done); }
.cards { display: flex; flex-direction: column; gap: var(--space-sm); padding: 0 var(--space-sm) var(--space-sm); min-height: 40px; overflow-y: auto; }
.card { background: var(--color-surface); border: var(--rule); border-radius: var(--radius-md); padding: 10px var(--space-md);
  display: flex; flex-direction: column; gap: 6px; cursor: grab; box-shadow: var(--shadow-lift);
  transition: border-color var(--dur-fast) var(--ease-out); }
.card:hover { border-color: var(--color-rule-strong); }
.card.sortable-ghost { opacity: .4; }
.card.sortable-chosen { border-color: var(--color-accent); }
.card-top { display: flex; align-items: center; gap: var(--space-sm); }
.card .key { font-size: var(--text-xs); color: var(--color-muted); }
.card-title { color: var(--color-ink); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.card-title:hover { color: var(--color-accent); }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.waiting-note { font-size: var(--text-sm); color: var(--color-ink-2); background: color-mix(in oklch, var(--color-cat-waiting) 14%, transparent);
  border-left: 2px solid var(--color-cat-waiting); padding: 3px 8px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.add { padding: var(--space-sm); border-top: var(--rule); display: flex; gap: var(--space-xs); }
.add input { flex: 1; background: transparent; border-color: transparent; }
.add input:hover, .add input:focus-visible { background: var(--color-surface); }
.add select { max-width: 92px; font-size: var(--text-sm); }

/* Priority: chevron icons drawn with a CSS mask so they take the token colour. */
.prio { display: inline-flex; align-items: center; flex: none; }
.prio::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--prio-icon) center / contain no-repeat; mask: var(--prio-icon) center / contain no-repeat; }
.prio.p1 { color: var(--color-p1); --prio-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5 8 4l5 4.5M3 13 8 8.5l5 4.5'/%3E%3C/svg%3E"); }
.prio.p2 { color: var(--color-p2); --prio-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 10.5 8 5.5l5 5'/%3E%3C/svg%3E"); }
.prio.p3 { color: var(--color-p3); --prio-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M3 6h10M3 10.5h10'/%3E%3C/svg%3E"); }
.prio.p4 { color: var(--color-p4); --prio-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5.5 8 10.5l5-5'/%3E%3C/svg%3E"); }
.prio.p5 { color: var(--color-p5); --prio-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3 8 7.5 13 3M3 8.5 8 13l5-4.5'/%3E%3C/svg%3E"); }

/* People */
.people { display: flex; align-items: center; }
.av { width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font: 600 10px/1 var(--font-mono);
  background: var(--color-paper-3); color: var(--color-ink); border: 2px solid var(--color-surface); margin-left: -6px; text-transform: uppercase; }
.av:first-child { margin-left: 0; }
.av.doer { background: var(--color-accent); color: var(--color-accent-ink); }
.av.reviewer { background: var(--color-cat-review); color: var(--color-accent-ink); }
.chip { display: inline-flex; align-items: center; gap: 4px; font: 500 var(--text-xs)/1.6 var(--font-mono); padding: 0 6px;
  border-radius: var(--radius-sm); background: var(--color-paper-3); color: var(--color-ink-2); white-space: nowrap; }
.chip.overdue { background: var(--color-danger-soft); color: var(--color-danger); }
.labels { display: flex; flex-wrap: wrap; gap: 4px; }

/* Table */
.table-wrap { overflow-x: auto; border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); }
table { border-collapse: collapse; width: 100%; min-width: 760px; }
th { text-align: left; padding: 9px var(--space-md); border-bottom: var(--rule); background: var(--color-paper-2); }
td { padding: 7px var(--space-md); border-bottom: var(--rule); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--color-paper-2); }
td select, td input { border-color: transparent; background: transparent; padding: 4px 6px; }
td select:hover, td input:hover { border-color: var(--color-rule-strong); background: var(--color-surface); }
td .title { color: var(--color-ink); font-weight: 500; }
td .title:hover { color: var(--color-accent); }
.empty { padding: var(--space-3xl) var(--space-xl); text-align: left; color: var(--color-muted); }

/* My work */
.lanes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--space-lg); }
.lane { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-paper-2); }
.lane .col-head { border-bottom: var(--rule); padding-bottom: var(--space-md); }
.lane .cards { padding: var(--space-sm); }
.lane-empty { padding: var(--space-md); font-size: var(--text-sm); color: var(--color-muted); }

/* Item */
.item-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-2xl); align-items: start; }
.section { margin-bottom: var(--space-2xl); }
.section > h2 { margin-bottom: var(--space-md); display: flex; align-items: baseline; gap: var(--space-sm); }
.props { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); position: sticky; top: var(--space-lg); }
.prop { display: grid; grid-template-columns: 96px minmax(0, 1fr); align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-bottom: var(--rule); }
.prop:last-child { border-bottom: 0; }
.prop select, .prop input { width: 100%; }
.role-row { display: flex; align-items: center; gap: var(--space-sm); padding: 4px 0; }
.role-row .who { flex: 1; color: var(--color-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.role-add { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: var(--space-xs); margin-top: var(--space-sm); }
.list-rows { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); }
.list-rows > * { display: flex; align-items: center; gap: var(--space-sm); padding: 8px var(--space-md); border-bottom: var(--rule); }
.list-rows > *:last-child { border-bottom: 0; }
.list-rows > :not([hidden]):not(:has(~ :not([hidden]))) { border-bottom: 0; }   /* last visible row, when a hidden add form follows */
.list-rows input { flex: 1; border-color: transparent; background: transparent; }
.check { width: 18px; height: 18px; padding: 0; display: inline-grid; place-items: center; border-radius: var(--radius-sm); font-size: 12px; line-height: 1; }
.check.on { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.done-text { text-decoration: line-through; color: var(--color-muted); }
.comment { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-md); margin-bottom: var(--space-sm); }
.comment-head { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: 6px; }
.comment-head b { color: var(--color-ink); font-weight: 600; }
.comment-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.history { list-style: none; margin: 0; padding: 0 0 0 4px; }
.history li { border-left: var(--rule); }
.history li { padding: 5px 0 5px var(--space-md); font-size: var(--text-sm); line-height: 1.45; color: var(--color-ink-2); position: relative; overflow-wrap: anywhere; }
.hist-meta { color: var(--color-muted); }
.hist-meta time { font-size: var(--text-xs); white-space: nowrap; }
.history li::before { content: ""; position: absolute; left: -4px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: var(--color-rule-strong); }
.history b { color: var(--color-ink); font-weight: 600; }
.desc-form textarea { min-height: 120px; }
.form-actions { display: flex; justify-content: flex-end; margin-top: var(--space-sm); }

/* Login */
/* Login: one quiet column, the wordmark and the form. Nothing else to read. */
.login { min-height: 100dvh; display: grid; place-items: center; padding: var(--space-xl) var(--space-lg); background: var(--color-paper); }
.login-form { width: min(100%, 320px); display: flex; flex-direction: column; gap: var(--space-md); }
.login-mark { margin: 0 0 var(--space-lg); line-height: 1; }
.login-mark .wordmark { font-size: var(--text-2xl); padding: 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; }
.login-error { margin: 0; padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-danger); border-radius: var(--radius-md); color: var(--color-danger); font-size: var(--text-sm); }
.login-go, .login-sso { width: 100%; justify-content: center; white-space: nowrap; }
.login-go { margin-top: var(--space-sm); }
.login-sso { margin-top: var(--space-xs); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field input { padding: 9px 11px; }
.errors { color: var(--color-danger); background: var(--color-danger-soft); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); font-size: var(--text-sm); }

/* Palette */
dialog.palette { border: var(--rule); border-radius: var(--radius-lg); padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--color-surface);
  color: var(--color-ink-2); box-shadow: var(--shadow-pop); margin-top: 12vh; }
dialog.palette::backdrop { background: oklch(20% 0.02 258 / 0.35); }
.palette input { width: 100%; border: 0; border-bottom: var(--rule); border-radius: 0; padding: 14px var(--space-lg); font: 400 var(--text-lg) var(--font-mono); background: transparent; }
.palette input:focus-visible { outline: none; }
.palette ul { list-style: none; margin: 0; padding: var(--space-xs); max-height: 320px; overflow-y: auto; }
.palette li a { display: flex; justify-content: space-between; gap: var(--space-md); padding: 8px var(--space-md); border-radius: var(--radius-md); }
.palette li[aria-selected="true"] a { background: var(--color-accent-soft); color: var(--color-ink); }

@media (max-width: 860px) {
  .item-grid { grid-template-columns: minmax(0, 1fr); }
  .props { position: static; }
}
@media (max-width: 720px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-sm); border-right: 0; border-bottom: var(--rule); padding: var(--space-sm) var(--space-lg); }
  .rail .nav { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .rail .nav .label, .rail-foot .who, .jump kbd { display: none; }
  .jump { width: auto; margin-left: auto; }
  .rail-foot { margin: 0; border: 0; padding: 0; }
  .pagehead, .content { padding-left: var(--space-lg); padding-right: var(--space-lg); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ===== Item modal / panel (Jira-style) ===== */
.card { cursor: pointer; }
.card:active { cursor: grabbing; }
.card:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.card-title { color: var(--color-ink); font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
img.av { object-fit: cover; padding: 0; }
.doer-ring .av { box-shadow: 0 0 0 1.5px var(--color-accent); }
.reviewer-ring .av { box-shadow: 0 0 0 1.5px var(--color-cat-review); }
.people > span + span { margin-left: -6px; }

dialog.item-modal { border: var(--rule); border-radius: var(--radius-lg); padding: 0; background: var(--color-surface); color: var(--color-ink-2);
  width: min(1080px, calc(100vw - 32px)); max-height: calc(100dvh - 64px); margin: 32px auto; box-shadow: var(--shadow-pop); overflow: hidden; }
dialog.item-modal[open] { display: flex; flex-direction: column; }
dialog.item-modal::backdrop { background: oklch(18% 0.02 258 / 0.45); }
#item-modal-body { overflow-y: auto; min-height: 0; }
@media (prefers-reduced-motion: no-preference) {
  dialog.item-modal[open] { animation: ip-in var(--dur-med) var(--ease-out); }
  @keyframes ip-in { from { opacity: 0; transform: translateY(8px); } }
}
.ip-page { padding: var(--space-lg) var(--space-2xl); }
.ip-page .ip { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); }
.ip-page .ip-close { display: none; }
.ip-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: 10px var(--space-lg); border-bottom: var(--rule);
  position: sticky; top: 0; background: var(--color-surface); z-index: 1; }
.ip-bar .crumbs { display: flex; gap: 6px; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.ip-bar .crumbs a:hover { color: var(--color-accent); }
.ip-key { color: var(--color-ink); flex: none; }
.ip-bar .crumbs > a:not(.ip-key) { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ip-bar .crumbs > .kind-pick, .ip-bar .crumbs > .help-q { flex: none; }
.ip-bar-actions { display: flex; gap: var(--space-xs); align-items: center; }
.ip-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
.ip-main { padding: var(--space-xl) var(--space-xl) var(--space-2xl); min-width: 0; }
.ip-side { padding: var(--space-xl) var(--space-lg); border-left: var(--rule); background: var(--color-paper-2); display: flex; flex-direction: column; gap: var(--space-md); }
.ip-title { width: 100%; font: 600 var(--text-2xl)/1.25 var(--font-display); letter-spacing: -0.02em; color: var(--color-ink);
  border: 1px solid transparent; background: transparent; padding: 4px 6px; margin: 0 -6px var(--space-lg); }
.ip-title:hover { background: var(--color-paper-2); }
.ip-sec { margin-bottom: var(--space-xl); }
.ip-h { font: 600 var(--text-sm)/1 var(--font-body); color: var(--color-ink); letter-spacing: 0; margin-bottom: var(--space-sm); display: flex; gap: 6px; align-items: baseline; }
.ip-h .count, .tabs .count { font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); }
.ip .desc-form textarea { min-height: 72px; background: var(--color-surface); }
.sub-row { display: flex; align-items: center; gap: var(--space-sm); padding: 8px var(--space-md); border-bottom: var(--rule); color: var(--color-ink-2); }
.sub-row:hover { background: var(--color-paper-2); }
.sub-row .key { font-size: var(--text-xs); color: var(--color-muted); }
.sub-title { flex: 1; color: var(--color-ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; gap: 2px; border-bottom: var(--rule); margin-bottom: var(--space-lg); }
.tabs button { border: 0; border-radius: 0; background: transparent; color: var(--color-muted); padding: 8px 10px; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { background: transparent; color: var(--color-ink); }
.tabs button[aria-selected="true"] { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.composer, .cmt { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--space-md); margin-bottom: var(--space-lg); }
.composer .av, .cmt .av { width: 28px; height: 28px; margin: 0; font-size: 11px; }
.cmt-head { display: flex; gap: var(--space-sm); align-items: baseline; margin-bottom: 4px; }
.cmt-head b { color: var(--color-ink); font-weight: 600; }
.cmt-head .mono { font-size: var(--text-xs); }
.comment-body img { max-width: 100%; border-radius: var(--radius-md); }
.status-pill { width: auto; align-self: flex-start; font-weight: 600; padding: 7px 28px 7px 12px; border-radius: var(--radius-md); cursor: pointer;
  background: var(--color-paper-3); color: var(--color-ink); border-color: transparent; }
.status-pill.cat-active { background: var(--color-accent); color: var(--color-accent-ink); }
.status-pill.cat-done { background: var(--color-cat-done); color: var(--color-accent-ink); }
.status-pill.cat-waiting { background: var(--color-cat-waiting); color: oklch(20% 0.02 60); }
.status-pill.cat-review { background: var(--color-cat-review); color: var(--color-accent-ink); }
.waiting-box { display: flex; flex-direction: column; gap: 6px; padding: var(--space-sm) var(--space-md); border-left: 2px solid var(--color-cat-waiting);
  background: color-mix(in oklch, var(--color-cat-waiting) 12%, transparent); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.details { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); }
.details summary { padding: 10px var(--space-md); font-weight: 600; color: var(--color-ink); cursor: pointer; border-bottom: var(--rule); list-style: none; }
.details summary::-webkit-details-marker { display: none; }
.details summary::before { content: "▾ "; color: var(--color-muted); }
.details:not([open]) summary { border-bottom: 0; }
.details:not([open]) summary::before { content: "▸ "; }
.drow { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: var(--space-sm); padding: 8px var(--space-md); align-items: start; }
.dlabel { font-size: var(--text-sm); color: var(--color-muted); padding-top: 3px; }
.dval { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.person { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 2px; border-radius: 999px; background: var(--color-paper-2); max-width: 100%; }
.person > span:not(.av) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-ink); font-size: var(--text-sm); }
.person .av { margin: 0; width: 22px; height: 22px; border: 0; }
.person .x { border: 0; background: transparent; padding: 0 4px; color: var(--color-muted); font-size: 11px; }
.person .x:hover { color: var(--color-danger); background: transparent; }
select.add-person, select.bare, input.bare { border-color: transparent; background: transparent; padding: 3px 4px; color: var(--color-muted); font-size: var(--text-sm); }
select.bare, input.bare { color: var(--color-ink); }
select.add-person:hover, select.bare:hover, input.bare:hover { border-color: var(--color-rule-strong); background: var(--color-surface); }
input.bare.overdue { color: var(--color-danger); }
.ip-stamp { font-size: var(--text-xs); color: var(--color-muted); margin: 0; line-height: 1.7; }
@media (max-width: 860px) {
  .ip-grid { grid-template-columns: minmax(0, 1fr); }
  .ip-side { border-left: 0; border-top: var(--rule); order: -1; }
  dialog.item-modal { margin: 8px auto; max-height: calc(100dvh - 16px); width: calc(100vw - 16px); }
  .ip-page { padding: var(--space-sm); }
}
.atts { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-top: var(--space-sm); }
.atts img { max-height: 160px; max-width: min(100%, 280px); border-radius: var(--radius-md); border: var(--rule); display: block; }

.ip-page [data-full-page] { display: none; }

/* Themed dropdown (replaces native <select>; the real select stays in the form, visually hidden). */
.sel-native { position: absolute !important; width: 1px !important; height: 1px !important; opacity: 0; pointer-events: none; }
.sel { position: relative; display: inline-flex; min-width: 0; max-width: 100%; }
.sel-btn { display: inline-flex; align-items: center; gap: 6px; width: 100%; min-width: 0; justify-content: space-between; text-align: left;
  font: inherit; font-size: var(--text-sm); font-weight: 400; color: var(--color-ink); padding: 6px 9px; }
.sel-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-btn::after { content: ""; flex: none; width: 10px; height: 10px; background: var(--color-muted);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3.5 5 6.5 8 3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3.5 5 6.5 8 3.5'/%3E%3C/svg%3E") center / contain no-repeat; }
.sel-btn[aria-expanded="true"] { border-color: var(--color-focus); }
.sel.is-bare .sel-btn, td .sel .sel-btn, .add .sel .sel-btn { border-color: transparent; background: transparent; }
.sel.is-bare .sel-btn:hover, td .sel .sel-btn:hover, .add .sel .sel-btn:hover { border-color: var(--color-rule-strong); background: var(--color-surface); }
.sel.is-muted .sel-btn { color: var(--color-muted); }
.sel.is-pill .sel-btn { font-weight: 600; padding: 7px 12px; border-color: transparent; background: var(--color-paper-3); }
.sel.is-pill.cat-active .sel-btn { background: var(--color-accent); color: var(--color-accent-ink); }
.sel.is-pill.cat-done .sel-btn { background: var(--color-cat-done); color: var(--color-accent-ink); }
.sel.is-pill.cat-waiting .sel-btn { background: var(--color-cat-waiting); color: oklch(20% 0.02 60); }
.sel.is-pill.cat-review .sel-btn { background: var(--color-cat-review); color: var(--color-accent-ink); }
.sel.is-pill .sel-btn::after { background: currentColor; }
.sel-menu { position: fixed; z-index: 1000; min-width: 160px; max-height: 280px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--color-surface); border: var(--rule); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); }
.sel-menu li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: var(--radius-sm); cursor: pointer; color: var(--color-ink-2); font-size: var(--text-sm); white-space: nowrap; }
.sel-menu li[aria-selected="true"] { color: var(--color-ink); font-weight: 600; }
.sel-menu li[aria-selected="true"]::after { content: "✓"; margin-left: auto; color: var(--color-accent); }
.sel-menu li.is-active { background: var(--color-accent-soft); color: var(--color-ink); }
.sel-menu li[data-placeholder] { color: var(--color-muted); }
.sel-menu .prio { margin-right: 2px; }

/* ===== Jira parity: work types, cards, toolbar, swimlanes, list, create, summary ===== */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.nowrap { white-space: nowrap; } .small { font-size: var(--text-xs); }
.create-btn { width: 100%; justify-content: center; display: inline-flex; gap: 8px; align-items: center; }
.create-btn kbd { background: transparent; color: inherit; border-color: color-mix(in oklch, var(--color-accent-ink) 40%, transparent); }
.icon-btn { border: 0; background: transparent; color: var(--color-muted); padding: 2px 6px; border-radius: var(--radius-sm); line-height: 1.2; font-size: var(--text-sm); cursor: pointer; list-style: none; }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { background: var(--color-paper-3); color: var(--color-ink); }

/* Work type icons (CSS masks, like priority). */
.kind { display: inline-block; width: 16px; height: 16px; border-radius: 3px; flex: none; position: relative; }
.kind::after { content: ""; position: absolute; inset: 2px; background: var(--color-accent-ink);
  -webkit-mask: var(--kind-icon) center / contain no-repeat; mask: var(--kind-icon) center / contain no-repeat; }
.kind.k-task { background: var(--color-kind-task); --kind-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5'/%3E%3C/svg%3E"); }
.kind.k-story { background: var(--color-kind-story); --kind-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 1.5h6v9L6 8.3 3 10.5z' fill='black'/%3E%3C/svg%3E"); }
.kind.k-bug { background: var(--color-kind-bug); --kind-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Ccircle cx='6' cy='6' r='3.2' fill='black'/%3E%3C/svg%3E"); }
.kind.k-epic { background: var(--color-kind-epic); --kind-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M7 1 2.5 7H6l-1 4 4.5-6H6z' fill='black'/%3E%3C/svg%3E"); }
.kind.k-subtask { background: var(--color-kind-task); --kind-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='black' stroke-width='1.6'%3E%3Crect x='1.8' y='1.8' width='4.4' height='4.4' rx='.8'/%3E%3Crect x='5.8' y='5.8' width='4.4' height='4.4' rx='.8'/%3E%3C/svg%3E"); }
.flag { width: 14px; height: 14px; display: inline-block; background: var(--color-danger);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 1.5v11M3 2h7.5L9 4.7l1.5 2.8H3' fill='black' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3 1.5v11M3 2h7.5L9 4.7l1.5 2.8H3' fill='black' stroke='black' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.warn { width: 14px; height: 14px; display: inline-block; background: var(--color-danger);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1.5 13 12H1z' fill='black'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M7 1.5 13 12H1z' fill='black'/%3E%3C/svg%3E") center / contain no-repeat; }

/* Popovers built on <details>. */
.pop { position: relative; display: inline-block; }
.pop > summary { list-style: none; cursor: pointer; }
.pop > summary::-webkit-details-marker { display: none; }
.pop > .menu { position: absolute; top: calc(100% + 4px); left: 0; z-index: 50; min-width: 200px; max-height: 60vh; overflow-y: auto;
  background: var(--color-surface); border: var(--rule); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); padding: 4px; display: flex; flex-direction: column; }
.pop-right > .menu { left: auto; right: 0; }
.menu > button, .menu > a, .menu form > button:not(.btn) { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent;
  padding: 7px 10px; border-radius: var(--radius-sm); color: var(--color-ink-2); font-weight: 400; font-size: var(--text-sm); }
.menu > button:hover, .menu > a:hover, .menu form > button:not(.btn):hover { background: var(--color-accent-soft); color: var(--color-ink); }
.menu > button[aria-current="true"] { color: var(--color-accent); font-weight: 600; }
.menu .danger, .btn.danger { color: var(--color-danger); }
.menu hr { border: 0; border-top: var(--rule); margin: 4px 0; width: 100%; }
.menu-label { font: 500 var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); padding: 8px 10px 4px; }
.menu form { display: flex; gap: 6px; padding: 4px; }
.menu form input { flex: 1; }
.add-col .menu form, form.menu { flex-direction: column; gap: 8px; padding: 10px; }

/* Toolbar */
.jtool { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-lg); }
.jsearch input { width: 200px; max-width: 100%; }
.facepile { display: flex; align-items: center; padding-left: 6px; }
.face { margin-left: -6px; cursor: pointer; border-radius: 50%; position: relative; }
.face input { position: absolute; opacity: 0; pointer-events: none; }
.face .av { width: 28px; height: 28px; border: 2px solid var(--color-paper); margin: 0; transition: transform var(--dur-fast) var(--ease-out); }
.face:hover .av { transform: translateY(-2px); }
.face:has(input:checked) { z-index: 1; }
.face:has(input:checked) .av { box-shadow: 0 0 0 2px var(--color-accent); }
.face:has(input:focus-visible) .av { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.btn.is-on { border-color: var(--color-accent); color: var(--color-accent); background: var(--color-accent-soft); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; border-radius: 9px; background: var(--color-accent); color: var(--color-accent-ink); font: 600 11px/1 var(--font-mono); padding: 0 5px; }
.filter-menu { min-width: 260px; padding: 8px !important; gap: 6px; }
.filter-menu fieldset { border: 0; margin: 0; padding: 4px 0; display: flex; flex-direction: column; gap: 2px; }
.filter-menu legend { font: 500 var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); padding: 4px 6px; }
.filter-menu label { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: var(--radius-sm); font-size: var(--text-sm); cursor: pointer; }
.filter-menu label:hover { background: var(--color-paper-2); }
.filter-menu input[type=checkbox], .cb input, .create-foot input, .drawer input[type=checkbox] { accent-color: var(--color-accent); width: 15px; height: 15px; }
.menu-foot { display: flex; justify-content: space-between; gap: 8px; border-top: var(--rule); padding-top: 8px; position: sticky; bottom: -8px; background: var(--color-surface); }
.jtool-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-sm); }
.count-note { font-size: var(--text-xs); }

/* Project tabs */
.ptabs { display: flex; gap: 2px; align-self: flex-end; margin-bottom: calc(-1 * var(--space-lg) - 1px); }
.ptabs a { padding: 8px 12px; color: var(--color-muted); border-bottom: 2px solid transparent; font-weight: 500; }
.ptabs a:hover { color: var(--color-ink); }
.ptabs a[aria-current="page"] { color: var(--color-accent); border-bottom-color: var(--color-accent); }

/* Board with swimlanes: header row of columns, then one row per lane. */
.board-wrap { overflow-x: auto; padding-bottom: var(--space-lg); --colw: 272px; }
.board-cols { display: flex; gap: var(--space-md); align-items: stretch; width: max-content; }
.board-header { position: sticky; top: 0; z-index: 3; background: var(--color-paper); padding-bottom: 6px; }
.colhead { width: var(--colw); display: flex; align-items: center; gap: 6px; padding: 8px 10px; background: var(--color-paper-2); border: var(--rule); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.colname { font: 600 var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--color-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.colhead .count { font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); margin-right: auto; }
.add-col { align-self: center; }
.add-col > summary { font-size: var(--text-lg); border: 1px dashed var(--color-rule-strong); padding: 4px 10px; }
.lane + .lane { margin-top: var(--space-md); }
.lane-head { display: flex; align-items: center; gap: 8px; padding: 6px 2px; position: sticky; left: 0; width: fit-content; }
.lane-head b { color: var(--color-ink); }
.lane-head .count { font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); }
.lane.is-closed .lane-body { display: none; }
.col { width: var(--colw); background: var(--color-paper-2); border: var(--rule); border-top: 0; display: flex; flex-direction: column; min-height: 80px; }
.lane:last-child .col { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.col .cards { padding: 8px; flex: 1; max-height: none; }
.colhead.is-collapsed, .col.is-collapsed { width: 44px; }
.col.is-collapsed > *, .colhead.is-collapsed > :not(.dot):not([data-collapse]) { display: none; }
.colhead.is-collapsed { flex-direction: column; }
.col.is-collapsed::after { content: attr(data-name); writing-mode: vertical-rl; font: 600 var(--text-xs) var(--font-mono); text-transform: uppercase; color: var(--color-muted); padding: 10px 0; align-self: center; }

/* Cards */
.card { gap: 8px; }
.card.is-flagged { background: color-mix(in oklch, var(--color-danger) 9%, var(--color-surface)); border-color: color-mix(in oklch, var(--color-danger) 35%, var(--color-rule)); }
.card-head { display: flex; gap: 6px; align-items: flex-start; }
.card-head .card-title { flex: 1; min-width: 0; }
.card-tools { display: flex; gap: 0; opacity: 0; transition: opacity var(--dur-fast) var(--ease-out); }
.card:hover .card-tools, .card:focus-within .card-tools, .card-tools:has(details[open]) { opacity: 1; }
.card-title-input { width: 100%; font: inherit; font-weight: 500; }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--color-ink-2); border: var(--rule); border-radius: var(--radius-sm); padding: 1px 6px; width: fit-content; }
.due.overdue { color: var(--color-danger); border-color: color-mix(in oklch, var(--color-danger) 40%, transparent); }
.card-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-left, .card-right { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.card-left .key { font-size: var(--text-xs); color: var(--color-muted); }
.subcount { font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); border: var(--rule); border-radius: var(--radius-sm); padding: 0 4px; }
.epic-chip { background: color-mix(in oklch, var(--color-kind-epic) 22%, transparent); color: var(--color-ink); }
.add { flex-wrap: wrap; }
.add input[name=title] { flex: 1 1 100%; order: -1; }
.add .add-due { flex: 1; font-size: var(--text-xs); }
body.hide-f-key [data-f="key"], body.hide-f-priority [data-f="priority"], body.hide-f-due [data-f="due"],
body.hide-f-labels [data-f="labels"], body.hide-f-subtasks [data-f="subtasks"], body.hide-f-people [data-f="people"] { display: none !important; }

/* View settings drawer */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(340px, 100vw); background: var(--color-surface); border-left: var(--rule); box-shadow: var(--shadow-pop);
  z-index: 60; padding: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-lg); overflow-y: auto; }
.drawer[hidden] { display: none; }
.drawer header { display: flex; justify-content: space-between; align-items: center; }
.drawer fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.drawer fieldset label { display: flex; gap: 8px; align-items: center; }

/* List */
.jlist th { white-space: nowrap; }
.jlist th .sort { color: var(--color-muted); }
.jlist th .sort:hover { color: var(--color-ink); }
.jlist th .sort.is-asc::after { content: " ↑"; color: var(--color-accent); }
.jlist th .sort.is-desc::after { content: " ↓"; color: var(--color-accent); }
.jlist .cb { width: 36px; }
.jlist .work { min-width: 320px; }
.work-in { display: flex; align-items: center; gap: 8px; }
.jlist .key { font-size: var(--text-xs); color: var(--color-accent); white-space: nowrap; }
.jlist .title { color: var(--color-ink); cursor: text; border-radius: var(--radius-sm); padding: 2px 4px; margin: -2px -4px; }
.jlist .title:hover { background: var(--color-paper-3); }
.jlist tr.is-sub .work-in { padding-left: 24px; }
.jlist tr.is-flagged { background: color-mix(in oklch, var(--color-danger) 7%, transparent); }
.jlist tr:has(.cb input:checked) { background: var(--color-accent-soft); }
.jlist .person { background: transparent; padding: 0; }
.jlist .rowmenu { width: 40px; text-align: right; }
.inline-edit { display: flex; gap: 4px; align-items: center; width: 100%; }
.inline-edit input { flex: 1; }
.create-row { display: flex; gap: var(--space-sm); align-items: center; padding: 8px var(--space-md); border-top: var(--rule); flex-wrap: wrap; }
.create-row input[name=title] { flex: 1 1 240px; }
.list-foot { padding: 8px var(--space-md); border-top: var(--rule); font-size: var(--text-xs); text-align: center; }
.bulkbar { position: fixed; left: 50%; bottom: var(--space-xl); transform: translateX(-50%); z-index: 40; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm);
  background: var(--color-surface); border: var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); padding: 8px 12px; max-width: calc(100vw - 32px); }
.bulkbar[hidden] { display: none; }

/* Create dialog */
.create-dlg form { display: flex; flex-direction: column; }
.create-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.create-body { padding: var(--space-lg) var(--space-xl); display: flex; flex-direction: column; gap: var(--space-md); }
.create-body .ip-title { margin: 0; }
.create-row-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.create-row-chips .sel-btn, .create-chips .sel-btn { border-radius: 999px; padding: 5px 12px; }
.due-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--color-rule-strong); border-radius: 999px; padding: 2px 4px 2px 12px; }
.due-chip input { border: 0; background: transparent; padding: 3px; }
.create-foot { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-xl); border-top: var(--rule); }
.create-foot label { display: flex; gap: 6px; align-items: center; font-size: var(--text-sm); }
.created-note { margin: 0; padding: 8px 12px; border-radius: var(--radius-md); background: color-mix(in oklch, var(--color-cat-done) 15%, transparent); font-size: var(--text-sm); }
.created-note a { color: var(--color-ink); font-weight: 600; }
dialog.item-modal:has(.create-dlg) { width: min(720px, calc(100vw - 32px)); }

/* Item panel extras */
.kind-pick { display: inline-flex; }
.kind-pick .sel-btn { padding: 2px 6px; }
.label-chip { display: inline-flex; align-items: center; gap: 2px; }
.label-chip .x { border: 0; background: transparent; padding: 0 2px; color: var(--color-muted); font-size: 10px; }
.add-link { color: var(--color-muted); font-size: var(--text-sm); padding: 2px 4px; }
.add-link:hover { color: var(--color-accent); }
.is-flagged-btn { color: var(--color-danger) !important; }

/* Summary */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: var(--space-md); margin-bottom: var(--space-xl); }
.tile { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-lg); display: flex; flex-direction: column; gap: 4px; }
.tile-n { font: 600 var(--text-2xl)/1.1 var(--font-display); color: var(--color-ink); font-variant-numeric: tabular-nums; }
.tile-name { font: 600 var(--text-md) var(--font-display); color: var(--color-ink); }
.tile { transition: border-color var(--dur-fast), box-shadow var(--dur-fast); }
.tile:hover { border-color: var(--color-rule-strong); box-shadow: var(--shadow-lift); }
.sgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: var(--space-lg); }
.panel { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-lg) var(--space-xl); min-width: 0; }
.panel h2 { margin-bottom: 4px; }
.panel .history { margin: var(--space-md) 0 0; max-height: 320px; overflow: hidden auto; }
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; margin: var(--space-lg) 0 var(--space-md); gap: 2px; background: var(--color-paper-3); }
.stack > span { min-width: 4px; }
.seg-backlog { background: var(--color-cat-backlog); } .seg-todo { background: var(--color-cat-todo); } .seg-active { background: var(--color-cat-active); }
.seg-waiting { background: var(--color-cat-waiting); } .seg-review { background: var(--color-cat-review); } .seg-done { background: var(--color-cat-done); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px 16px; }
.legend li { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); }
.legend b { margin-left: auto; font-family: var(--font-mono); color: var(--color-ink); }
.bar { display: grid; grid-template-columns: minmax(110px, 160px) minmax(0, 1fr) 40px; align-items: center; gap: var(--space-md); padding: 6px 0; }
.bar-label { display: flex; align-items: center; gap: 8px; font-size: var(--text-sm); min-width: 0; white-space: nowrap; overflow: hidden; }
.bar-track { height: 10px; border-radius: 5px; background: var(--color-paper-3); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--color-accent); border-radius: 5px; }
.bar-fill.p1 { background: var(--color-p1); } .bar-fill.p2 { background: var(--color-p2); } .bar-fill.p3 { background: var(--color-p3); }
.bar-fill.p4 { background: var(--color-p4); } .bar-fill.p5 { background: var(--color-p5); }
.bar b { text-align: right; color: var(--color-ink); font-size: var(--text-sm); }
.panel.wide { grid-column: 1 / -1; }
.bar .person { background: transparent; padding: 0; }
@media (max-width: 720px) {
  .ptabs { margin-bottom: 0; }
  .board-wrap { --colw: 240px; }
  .jsearch input { width: 140px; }
}
.board-cols .col { flex: none; max-height: none; border-radius: 0; }
.board-cols .col .add { border-top: var(--rule); }
/* Quick add stays a single "+ Create" line until focused, like Jira. */
.board-cols .col .add:not(:focus-within) > :not([name=title]) { display: none; }
.board-cols .col .add:not(:focus-within) { border-top-color: transparent; }
.board-cols .col .add:not(:focus-within) input[name=title]::placeholder { color: var(--color-muted); }
.board-cols .col { min-height: 56px; }
.people.stack .av { width: 26px; height: 26px; margin-left: -8px; border: 2px solid var(--color-surface); }
.people.stack .av:first-child { margin-left: 0; }
.av.more { background: var(--color-paper-3); color: var(--color-muted); font-size: 10px; }

/* Board fills the window; columns scroll on their own; themed scrollbars everywhere. */
* { scrollbar-width: thin; scrollbar-color: var(--color-rule-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--color-rule-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--color-muted); }
::-webkit-scrollbar-corner { background: transparent; }

.main:has(.board-wrap) { height: 100dvh; overflow: hidden; }
.main:has(.board-wrap) .content { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-bottom: var(--space-md); }
.board-wrap { flex: 1; min-height: 0; overflow: auto; padding-bottom: 0; display: flex; flex-direction: column; }
.board-wrap > .board-header, .board-wrap > .lane { flex: none; }
/* Board swimlanes are not My-work lanes: no fill, so the gaps between columns show the page. */
.board-wrap .lane { background: none; border: 0; border-radius: 0; }
/* Columns hug their cards ("+ Create" sits right under the last one); only very tall columns scroll inside. */
.board-wrap .lane-body { align-items: flex-start; }
.board-wrap .col { max-height: calc(100dvh - 240px); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.board-wrap .col .cards { overflow-y: auto; min-height: 0; flex: 0 1 auto; }
.board-wrap .lane + .lane .col { border-top: var(--rule); border-radius: var(--radius-lg); }
.board-wrap .lane:first-of-type:not(:has(> .lane-head)) .col { border-top: 0; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
@media (max-width: 720px) {
  .main:has(.board-wrap) { height: auto; overflow: visible; }
  .board-wrap { min-height: 70dvh; }
}
.board-header { padding-bottom: 0; }
.board-wrap .lane:first-of-type .col:not(:has(.col-tag:not(.wrap-only))) { border-top: 0; }
.col-tag { display: flex; align-items: center; gap: 6px; padding: 8px 10px 0; font: 600 var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .05em; color: var(--color-muted); }
.col-tag .count { font-weight: 500; margin-left: 2px; }
.board-wrap .lane-head { position: sticky; left: 0; margin-top: var(--space-md); }
/* Grouped: every lane's columns are standalone boxes (the first lane used to look glued to the header). */
.board-wrap .lane:has(> .lane-head) .col { border-top: var(--rule); border-radius: var(--radius-lg); }
.board-wrap:has(> .lane:first-of-type > .lane-head) .colhead { border-radius: var(--radius-lg); }

/* Item view: use the screen, transparent text, read-more, comments, mentions. */
dialog.item-modal:not(:has(.create-dlg)) { width: calc(100vw - 48px); max-width: 1600px; height: calc(100dvh - 48px); max-height: none; margin: 24px auto; }
dialog.item-modal #item-modal-body { height: 100%; }
dialog.item-modal .ip { min-height: 100%; display: flex; flex-direction: column; }
dialog.item-modal .ip-grid { flex: 1; grid-template-columns: minmax(0, 1fr) 360px; }
.ip-main { padding: var(--space-xl) var(--space-2xl) var(--space-3xl); }
.ip-title { resize: none; overflow: hidden; display: block; line-height: 1.25; }
.ip-title:focus-visible { background: var(--color-paper-2); border-color: var(--color-focus); }
.ip-add { margin: -8px 0 var(--space-lg); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ip-add .btn { display: inline-flex; align-items: center; gap: 6px; }
.attach-form { display: contents; }
.attach-form label { cursor: pointer; }
.btn-split { display: inline-flex; }
.btn-split > .btn { border-radius: var(--radius-md) 0 0 var(--radius-md); }
.btn-split .pop > summary.btn { border-radius: 0 var(--radius-md) var(--radius-md) 0; border-left: 0; padding-inline: 6px; }
.flag-banner { display: inline-flex; align-items: center; gap: 6px; color: var(--color-danger); font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--space-sm); }
.desc { position: relative; }
.desc-view { padding: 6px 8px; margin: 0 -8px; border-radius: var(--radius-md); color: var(--color-ink); line-height: 1.6; cursor: text; overflow-wrap: anywhere; border: 1px solid transparent; }
.desc-view:hover { background: var(--color-paper-2); }
.desc-view:focus-visible { border-color: var(--color-focus); outline: none; }
.desc-view.is-empty { color: var(--color-muted); }
.desc-view.is-clamped:not(.is-open) { max-height: 22em; overflow: hidden; -webkit-mask-image: linear-gradient(to bottom, black 75%, transparent); mask-image: linear-gradient(to bottom, black 75%, transparent); }
.more-toggle, .link-btn { border: 0; background: transparent; color: var(--color-accent); padding: 4px 0; font-weight: 500; font-size: var(--text-sm); }
.more-toggle:hover, .link-btn:hover { background: transparent; text-decoration: underline; }
.rich a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
.mention { color: var(--color-accent); background: var(--color-accent-soft); border-radius: var(--radius-sm); padding: 0 3px; font-weight: 500; }
.composer { align-items: start; }
.composer-box { border: 1px solid var(--color-rule-strong); border-radius: var(--radius-md); background: var(--color-surface); }
.composer-box:focus-within { border-color: var(--color-focus); }
.composer-box textarea { border: 0; background: transparent; resize: none; min-height: 44px; }
.composer-box textarea:focus-visible { outline: none; }
.composer-foot { display: flex; align-items: center; gap: var(--space-sm); padding: 6px 8px; border-top: var(--rule); flex-wrap: wrap; }
.composer-foot .quick { display: flex; gap: 4px; flex-wrap: wrap; margin-right: auto; }
.chip-btn { border-radius: 999px; padding: 3px 10px; font-size: var(--text-xs); font-weight: 500; color: var(--color-ink-2); }
.cmt-main { min-width: 0; }
.cmt-actions { display: flex; gap: var(--space-md); margin-top: 2px; }
.cmt-actions form { display: inline; }
.cmt-edit textarea { width: 100%; }
.mention-menu li { display: flex; justify-content: space-between; gap: var(--space-md); }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 6px var(--space-md); }
.inline-form input { flex: 1 1 140px; }
.link-row .link-kind { min-width: 110px; font-size: var(--text-sm); }
.link-target { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.sub-row .x, .link-row .x { border: 0; background: transparent; color: var(--color-muted); padding: 0 4px; }
.watch.is-on { color: var(--color-accent); }
.side-top { display: flex; gap: var(--space-sm); align-items: center; }
/* Jump-to search results */
dialog.palette { width: min(720px, calc(100vw - 32px)); }
.palette ul { max-height: min(60vh, 520px); }
.palette li a { align-items: center; }
.sr-row { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; }
.sr-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-ink); }
.sr-meta { display: flex; align-items: center; gap: 8px; flex: none; }
/* List: Doer column never squeezes the avatar stack. */
.jlist td:nth-child(3) { min-width: 150px; white-space: nowrap; }
.jlist .people.stack { display: inline-flex; flex-wrap: nowrap; background: none; }
@media (max-width: 860px) { dialog.item-modal:not(:has(.create-dlg)) { width: calc(100vw - 16px); height: calc(100dvh - 16px); margin: 8px auto; } }

/* Editor toolbar, drafts, pickers */
.editor .md-bar { display: flex; flex-wrap: wrap; gap: 2px; align-items: center; padding: 4px; border: 1px solid var(--color-rule-strong); border-bottom: 0; border-radius: var(--radius-md) var(--radius-md) 0 0; background: var(--color-paper-2); }
.editor .md-bar + textarea { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.composer-box .md-bar { border: 0; border-bottom: var(--rule); border-radius: var(--radius-md) var(--radius-md) 0 0; }
.md-bar button { border: 0; background: transparent; padding: 4px 8px; font-size: var(--text-xs); color: var(--color-ink-2); border-radius: var(--radius-sm); }
.md-bar button:hover { background: var(--color-paper-3); color: var(--color-ink); }
.md-sep { width: 1px; height: 16px; background: var(--color-rule-strong); margin: 0 4px; }
.desc-edit textarea, .cmt-edit textarea { width: 100%; min-height: 120px; }
.desc-edit .form-actions, .cmt-edit .form-actions { align-items: center; gap: var(--space-sm); }
.desc-edit .form-actions .muted { margin-right: auto; }
.draft-badge { font: 500 var(--text-xs)/1 var(--font-body); color: var(--color-cat-waiting); margin-left: 6px; }
.draft-badge::before { content: "• "; }
.sub-create { display: flex; gap: 6px; align-items: center; padding: 4px 8px; }
.sub-create input[name=title] { flex: 1; }
.sub-create .sel { flex: none; }
.link-btn.pad { padding: 6px var(--space-md); }
.picker-menu li { display: flex; align-items: center; gap: 8px; }
.picker-menu .sr-title { flex: 1; min-width: 0; }
/* Rendered markdown */
.rich p { margin: 0 0 .6em; } .rich p:last-child { margin-bottom: 0; }
.rich ul, .rich ol { margin: .2em 0 .6em; padding-left: 1.4em; }
.rich li.task { list-style: none; margin-left: -1.2em; }
.rich li.task.done { color: var(--color-muted); text-decoration: line-through; }
.rich h1, .rich h2, .rich h3 { font-size: var(--text-lg); margin: .6em 0 .3em; }
.rich code { font-family: var(--font-mono); font-size: .9em; background: var(--color-paper-3); padding: 1px 4px; border-radius: var(--radius-sm); }
.rich pre { background: var(--color-paper-3); padding: var(--space-md); border-radius: var(--radius-md); overflow-x: auto; }
.rich pre code { background: none; padding: 0; }
.rich blockquote { margin: .4em 0; padding-left: var(--space-md); border-left: 3px solid var(--color-rule-strong); color: var(--color-ink-2); }
.rich table { border-collapse: collapse; } .rich th, .rich td { border: var(--rule); padding: 4px 8px; }

/* Board: subtasks under a parent header, progress dots, done keys, epic chips. */
.subhead { font-size: var(--text-xs); color: var(--color-muted); padding: 8px 4px 2px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-top: 1px dashed var(--color-rule-strong); margin-top: 2px; }
.subhead:first-child { border-top: 0; margin-top: 0; }
.subhead .mono { color: var(--color-ink-2); }
.subhead:hover { color: var(--color-ink); }
.card.is-sub { margin-left: 8px; border-left: 2px solid var(--color-rule-strong); }
.card.is-done .key { text-decoration: line-through; }
.subdots { display: inline-flex; gap: 3px; align-items: center; }
.sd { width: 6px; height: 6px; border-radius: 50%; background: var(--color-cat-todo); }
.sd.backlog { background: var(--color-cat-backlog); } .sd.active { background: var(--color-cat-active); } .sd.waiting { background: var(--color-cat-waiting); }
.sd.review { background: var(--color-cat-review); } .sd.done { background: var(--color-cat-done); }
.epic-chip { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 10px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .03em;
  padding: 0 6px; border-radius: var(--radius-sm); background: color-mix(in oklch, var(--color-kind-epic) 30%, transparent); color: var(--color-ink); }

/* Icons */
.i { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }
.icon-sq { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 30px; height: 30px; padding: 0 6px; border-radius: var(--radius-md);
  border: 1px solid transparent; background: transparent; color: var(--color-muted); cursor: pointer; list-style: none; }
.icon-sq::-webkit-details-marker { display: none; }
.icon-sq:hover { background: var(--color-paper-3); color: var(--color-ink); }
.icon-sq.sm { min-width: 26px; height: 26px; padding: 0 4px; }
.icon-sq.danger:hover { color: var(--color-danger); background: var(--color-danger-soft); }
.icon-sq .n { font: 500 var(--text-xs) var(--font-mono); }
.icon-sq.is-on { color: var(--color-accent); }
.menu .i { color: var(--color-muted); }
.menu .danger .i { color: currentColor; }
.ip-bar-actions { gap: 2px; }
/* Comment header tools */
.cmt-head { align-items: center; }
.cmt-tools { margin-left: auto; display: inline-flex; gap: 2px; opacity: .55; transition: opacity var(--dur-fast) var(--ease-out); }
.cmt:hover .cmt-tools, .cmt:focus-within .cmt-tools { opacity: 1; }
.cmt-tools form { display: inline; }
/* Quote popover */
.quote-pop { position: fixed; z-index: 1100; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-md);
  background: var(--color-ink); color: var(--color-paper); border: 0; box-shadow: var(--shadow-pop); font-size: var(--text-sm); font-weight: 500; }
.quote-pop:hover { background: var(--color-ink); filter: brightness(1.15); }
/* Lightbox */
dialog.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: oklch(10% 0.01 260 / 0.92); color: oklch(95% 0.005 250); }
dialog.lightbox[open] { display: flex; flex-direction: column; }
dialog.lightbox::backdrop { background: transparent; }
.lb-bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); padding: 10px var(--space-lg); }
.lb-name { font-size: var(--text-sm); opacity: .8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-tools { display: flex; gap: 4px; }
dialog.lightbox .icon-sq { color: oklch(90% 0.005 250); }
dialog.lightbox .icon-sq:hover { background: oklch(100% 0 0 / 0.12); color: #fff; }
.lb-stage { flex: 1; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: var(--space-lg); overflow: hidden; touch-action: none; }
/* The whole picture fits on open (a tall phone screenshot included); zoom is for details. */
.lb-stage img { max-width: 100%; max-height: min(100%, calc(100dvh - 130px)); width: auto; height: auto; object-fit: contain; border-radius: var(--radius-md); transform-origin: center; cursor: zoom-in; user-select: none; }
.lb-stage.is-zoomed img { cursor: grab; }
.lb-stage.is-zoomed img:active { cursor: grabbing; }
.lb-zoom { min-width: 52px; font-size: var(--text-xs); color: inherit; opacity: .85; }
.lb-stage img.is-sideways { max-width: calc(100dvh - 120px); max-height: calc(100vw - 48px); }
.lb-count { text-align: center; padding: 8px; font-size: var(--text-xs); opacity: .7; }
.atts a[data-lightbox] { cursor: zoom-in; }
.is-copied { color: var(--color-ok) !important; }
.menu .is-copied::after { content: "Copied"; margin-left: auto; font-size: var(--text-xs); }

/* ===== Phone layout (must stay last so it beats the desktop rules above) ===== */
@media (max-width: 860px) {
  dialog.item-modal .ip-grid { grid-template-columns: minmax(0, 1fr); }
  dialog.item-modal .ip-side, .ip-page .ip-side { border-left: 0; border-bottom: var(--rule); border-top: 0; order: -1; }
  .ip-main { padding: var(--space-lg); }
  .ip-side { padding: var(--space-lg); }
  .ip-bar { padding: 8px var(--space-md); }
  .ip-bar .crumbs { font-size: 10px; }
}
.rail-drawer { display: contents; }
.rail-mobile, .drawer-scrim { display: none; }
.rail-foot .who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .rail { position: sticky; top: 0; z-index: 30; height: auto; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: var(--space-sm);
    padding: 8px var(--space-lg); border-right: 0; border-bottom: var(--rule); background: var(--color-paper-2); }
  .rail > .create-btn, .rail > .jump, .rail-top .rail-fold { display: none; }
  .rail-mobile { display: inline-flex; gap: 2px; margin-left: auto; }
  .rail-mobile .icon-sq { min-width: 40px; height: 40px; }
  .rail-mobile .i { width: 20px; height: 20px; }
  .rail-drawer { display: flex; flex-direction: column; gap: var(--space-xl); position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 84vw); z-index: 50;
    background: var(--color-paper-2); border-right: var(--rule); padding: var(--space-xl) var(--space-md); overflow-y: auto;
    transform: translateX(-100%); visibility: hidden; transition: transform var(--dur-med) var(--ease-out), visibility 0s linear var(--dur-med); }
  body.menu-open .rail-drawer { transform: none; visibility: visible; transition: transform var(--dur-med) var(--ease-out); }
  body.menu-open .drawer-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: oklch(18% 0.02 258 / 0.5); }
  .rail .rail-drawer .nav { flex-direction: column; width: auto; }
  .rail .rail-drawer .nav .label { display: block; }
  .rail .rail-drawer .nav a { padding: 10px var(--space-sm); font-size: var(--text-lg); }
  .rail-drawer .rail-foot { margin-top: auto; border-top: var(--rule); padding: var(--space-md) var(--space-sm) 0; }
  .rail-drawer .rail-foot .who { display: inline-flex; }
}
@media (max-width: 720px) and (prefers-reduced-motion: reduce) { .rail-drawer { transition: none; } }
/* Touch devices: no hover, so card actions stay visible; no quick-edit pencil on phones. */
@media (hover: none) {
  .card-tools { opacity: 1; }
  .cmt-tools { opacity: 1; }
}
@media (max-width: 720px), (pointer: coarse) and (max-width: 1024px) {
  [data-edit-title] { display: none; }
  .jlist .title { cursor: pointer; }
}
@media (max-width: 720px) {
  .board-wrap { --colw: min(82vw, 320px); scroll-snap-type: x mandatory; scroll-padding-left: 0; }
  .board-cols .colhead, .board-cols .col { scroll-snap-align: start; }
  .card { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
  .card.sortable-chosen { box-shadow: var(--shadow-pop); }
}
@media (max-width: 720px) { body.menu-open .rail { z-index: 60; } }
/* Phones: list rows stack (title on top, status/doer/priority/due underneath); summary tiles 2-up. */
@media (max-width: 720px) {
  .table-wrap:has(.jlist) { border: 0; background: none; overflow: visible; }
  .jlist { min-width: 0; display: block; }
  .jlist thead { display: none; }
  .jlist tbody { display: flex; flex-direction: column; gap: 8px; }
  .jlist tr { display: grid; grid-template-columns: 28px auto auto auto minmax(0, 1fr) 36px; align-items: center; gap: 4px 6px;
    padding: 10px 8px; border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); }
  .jlist td { border: 0; padding: 0; min-width: 0 !important; }
  .jlist td:nth-child(1) { grid-area: 1 / 1; }
  .jlist td:nth-child(2) { grid-area: 1 / 2 / 2 / 6; min-width: 0; }
  .jlist td:nth-child(11) { grid-area: 1 / 6; }
  .jlist td:nth-child(6) { grid-area: 2 / 2; }
  .jlist td:nth-child(3) { grid-area: 2 / 3; }
  .jlist td:nth-child(5) { grid-area: 2 / 4; }
  .jlist td:nth-child(10) { grid-area: 2 / 5; justify-self: end; }
  .jlist td:nth-child(10) input.is-empty { display: none; }
  .jlist td:nth-child(5) .sel-btn { padding: 4px; }
  .jlist td:nth-child(4), .jlist td:nth-child(7), .jlist td:nth-child(8), .jlist td:nth-child(9) { display: none; }
  .jlist td:nth-child(3) .person > span:not(.av) { display: none; }
  .jlist td:nth-child(5) .sel-btn span:not(.prio), .jlist td:nth-child(5) .sel-btn::after { display: none; }
  .jlist .work-in { flex-wrap: wrap; row-gap: 2px; }
  .jlist .title { flex: 1 1 100%; order: 3; }
  .jlist tr.is-sub { margin-left: 16px; }
  .jlist tr.is-sub .work-in { padding-left: 0; }
  .jlist td.empty { grid-column: 1 / -1; }
  .create-row, .list-foot { border: var(--rule); border-radius: var(--radius-lg); margin-top: 8px; background: var(--color-surface); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
  .tile { padding: var(--space-md); }
  .bar { grid-template-columns: minmax(90px, 120px) minmax(0, 1fr) 32px; gap: var(--space-sm); }
  .panel { padding: var(--space-md) var(--space-lg); }
  .pagehead { padding-top: var(--space-md); }
}

@media (max-width: 720px) {
  .sr-meta .label { display: none; }
  .palette li a { gap: 8px; padding: 10px 8px; }
  .sr-row .mono { white-space: nowrap; flex: none; font-size: var(--text-xs); }
  .sr-meta .chip { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
}
.sel-btn .prio { margin-right: -2px; }

/* Access / people / new board / gate */
.access { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-lg); align-items: start; }
.access-side { display: flex; flex-direction: column; gap: var(--space-lg); }
.access-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md); flex-wrap: wrap; }
.access-level { display: flex; align-items: center; gap: var(--space-sm); }
.access-note { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: var(--radius-md); background: var(--color-paper-2); font-size: var(--text-sm); margin: var(--space-md) 0; }
.add-people { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin: var(--space-md) 0; }
.add-people .sel:first-child { flex: 1 1 240px; }
.add-people .sel:first-child .sel-btn { width: 100%; }
.people-scroll { overflow-x: auto; }
.people-table { width: 100%; min-width: 0; border-collapse: collapse; }
.people-table td { vertical-align: middle; }
.people-table tbody tr:last-child td { border-bottom: 0; }
.people-table tbody tr:hover { background: color-mix(in oklch, var(--color-accent) 4%, transparent); }
.people-table .person { background: transparent; padding: 0; }
.people-table th { text-align: left; font: 500 var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); padding: 8px; border-bottom: var(--rule); background: transparent; }
.people-table td { padding: 8px; border-bottom: var(--rule); }
.people-table .right { text-align: right; }
.people-table tr.is-guest td { color: var(--color-muted); }
.chip.role-manager { background: var(--color-accent-soft); color: var(--color-ink); }
.chip.role-guest { background: color-mix(in oklch, var(--color-cat-waiting) 18%, transparent); }
.roles-help { margin: var(--space-sm) 0 0; display: grid; gap: 4px 0; }
.roles-help dt { font-weight: 600; color: var(--color-ink); margin-top: 6px; }
.roles-help dd { margin: 0; font-size: var(--text-sm); color: var(--color-ink-2); }
.board-settings, .new-board { display: flex; flex-direction: column; gap: var(--space-md); }
.new-board { max-width: 560px; }
.req { padding: var(--space-sm) 0; border-bottom: var(--rule); }
.req:last-child { border-bottom: 0; }
.req-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.req-list { list-style: none; padding: 0; margin: var(--space-sm) 0 0; display: flex; flex-direction: column; gap: 8px; }
.req-list a { color: var(--color-accent); }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: var(--rule); border-radius: var(--radius-md); cursor: pointer; margin-top: 6px; }
.radio-card span { display: flex; flex-direction: column; gap: 2px; }
.radio-card:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.radio-card input { accent-color: var(--color-accent); margin-top: 3px; }
.access-pick { border: 0; padding: 0; margin: 0; }
.toggle { width: 38px; height: 22px; border-radius: 11px; border: 0; padding: 0; background: var(--color-rule-strong); position: relative; cursor: pointer; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--color-surface); transition: transform var(--dur-fast) var(--ease-out); }
.toggle.is-on { background: var(--color-accent); }
.toggle.is-on::after { transform: translateX(16px); }
.toggle:hover { filter: brightness(1.1); }
.gate { max-width: 520px; margin: var(--space-2xl) auto; text-align: left; display: flex; flex-direction: column; gap: var(--space-md); }
.gate-icon .i { width: 28px; height: 28px; color: var(--color-muted); }
.gate-form { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.gate-form input { flex: 1 1 220px; }
.nav-label { display: flex; align-items: center; justify-content: space-between; }
.nav a .i { width: 13px; height: 13px; color: var(--color-muted); }
.toast { position: fixed; left: 50%; bottom: var(--space-xl); transform: translateX(-50%); z-index: 1200; background: var(--color-ink); color: var(--color-paper);
  padding: 10px 16px; border-radius: var(--radius-md); box-shadow: var(--shadow-pop); font-size: var(--text-sm); max-width: calc(100vw - 32px); }
fieldset.ro { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.ro:disabled .sel-btn, fieldset.ro:disabled input, fieldset.ro:disabled textarea { cursor: default; }
fieldset.ro:disabled .sel-btn::after, fieldset.ro:disabled .x, fieldset.ro:disabled .add-person, fieldset.ro:disabled .add-link, fieldset.ro:disabled .md-bar { display: none; }
@media (max-width: 860px) { .access { grid-template-columns: minmax(0, 1fr); } .people-table td:nth-child(2), .people-table th:nth-child(2) { display: none; }
  /* Access list on narrow screens: fixed columns so Role and Remove stay inside the card and long names wrap. */
  .access .people-table { table-layout: fixed; }
  .access .people-table th:nth-child(3) { width: 112px; } .access .people-table th:nth-child(4) { width: 44px; font-size: 0; }
  .access .people-table td { padding: 8px 4px; }
  .access .people-table .person { align-items: flex-start; } .access .people-table .person > span:not(.av) { white-space: normal; overflow-wrap: anywhere; }
}
.ro-note { display: flex; gap: 8px; align-items: center; font-size: var(--text-sm); color: var(--color-ink-2); background: var(--color-paper-2); border-radius: var(--radius-md); padding: 8px 12px; margin: 0 0 var(--space-md); }
fieldset.ro:disabled [data-desc-view] { cursor: default; }
fieldset.ro:disabled [data-desc-view]:hover { background: transparent; }
fieldset.ro:disabled .ip-add, fieldset.ro:disabled .sub-create, fieldset.ro:disabled .inline-form, fieldset.ro:disabled [data-reveal], fieldset.ro:disabled form:has(> input[name=text]) { display: none; }

/* Notification inbox: bell next to the wordmark, popover with Direct / Watching tabs */
.rail { z-index: 40; } /* keeps the inbox popover above board cards */
.rail-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); }
.bell { position: relative; }
.bell-count .badge { position: absolute; top: -4px; right: -6px; pointer-events: none; }
/* fixed so the rail's overflow doesn't clip it */
.inbox-pop > .inbox { position: fixed; top: 52px; left: 16px; z-index: 60; width: min(400px, calc(100vw - 32px)); max-height: min(70vh, 560px); padding: 0; gap: 0; }
.inbox-head { position: sticky; top: 0; z-index: 1; background: var(--color-surface); border-bottom: var(--rule); padding: var(--space-sm) var(--space-sm) 0; display: flex; flex-direction: column; gap: 6px; }
.inbox-tabs { display: flex; gap: var(--space-sm); }
.inbox-tabs button { font: 500 var(--text-sm) var(--font-body); color: var(--color-ink-2); padding: 6px 2px; border-bottom: 2px solid transparent; display: inline-flex; gap: 6px; align-items: center; }
.inbox-tabs button[aria-selected="true"] { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.inbox-tools { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); padding-bottom: 6px; font-size: var(--text-sm); }
.inbox-unread { display: inline-flex; gap: 6px; align-items: center; color: var(--color-ink-2); cursor: pointer; }
.inbox-list { list-style: none; margin: 0; padding: 4px; }
.inbox-empty { padding: var(--space-md); font-size: var(--text-sm); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: var(--radius-md); color: var(--color-ink); position: relative; }
.note:hover { background: var(--color-paper-2); }
.note.unread::after { content: ""; position: absolute; top: 14px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-accent); }
.note.unread { padding-right: 24px; }
.note-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--text-sm); }
.note-item { color: var(--color-ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.note-quote { color: var(--color-ink-2); border-left: 2px solid var(--color-rule-strong); padding-left: 8px; overflow-wrap: anywhere; }
.note-time { color: var(--color-ink-2); font-size: var(--text-xs); }
@media (max-width: 720px) {
  .rail-top { flex: 1; justify-content: flex-start; }
  .inbox-pop > .inbox { top: 56px; right: 16px; width: auto; }
}

/* Board rules, WIP limits, stars, Recent/Starred, person hover card */
.rule-check { display: flex; gap: 8px; align-items: flex-start; font-size: var(--text-sm); margin: 6px 0; cursor: pointer; }
.rule-check input { flex: none; width: 15px; height: 15px; margin: 2px 0 0; accent-color: var(--color-accent); }
.colhead.is-over { background: color-mix(in oklch, var(--color-danger) 14%, var(--color-paper-2)); border-color: color-mix(in oklch, var(--color-danger) 45%, transparent); }
.colhead.is-over .count { color: var(--color-danger); font-weight: 600; }
.wip-over { margin: 0 0 var(--space-sm); padding: 8px 12px; border-radius: var(--radius-md); font-size: var(--text-sm);
  background: color-mix(in oklch, var(--color-danger) 10%, var(--color-surface)); border: 1px solid color-mix(in oklch, var(--color-danger) 35%, transparent); }
.icon-sq.star.is-on { color: var(--color-warn); }
.icon-sq.star.is-on .i { fill: currentColor; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-sm); align-items: start; }
.person-card { position: fixed; z-index: 70; width: 340px; padding: var(--space-lg); background: var(--color-surface); border: var(--rule);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); font-size: var(--text-sm); }
.pc-top { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.pc-av { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin-bottom: var(--space-sm); display: grid; place-items: center;
  background: var(--color-paper-2); color: var(--color-ink-2); font: 600 28px/1 var(--font-display); }
.pc-name { font: 700 var(--text-xl)/1.2 var(--font-display); color: var(--color-ink); }
.pc-sub { color: var(--color-ink-2); overflow-wrap: anywhere; }
.pc-role { margin-top: 4px; }
.pc-h { margin: var(--space-md) 0 6px; font-weight: 600; color: var(--color-ink); }
.pc-items { list-style: none; margin: 0 calc(-1 * var(--space-sm)); padding: 0; display: flex; flex-direction: column; }
.pc-items a { display: flex; gap: 10px; align-items: center; padding: 6px var(--space-sm); border-radius: var(--radius-md); color: var(--color-ink); }
.pc-items a:hover { background: var(--color-paper-2); }
.pc-ico { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border: var(--rule); border-radius: var(--radius-md); }
.pc-txt { display: flex; flex-direction: column; min-width: 0; }
.pc-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-meta { color: var(--color-ink-2); font-size: var(--text-xs); }
.pc-none { padding: 6px var(--space-sm); color: var(--color-ink-2); }

/* Popover menus inside scrolling columns/modals: pinned to the viewport by JS so they aren't clipped */
.pop > .menu.is-pinned { position: fixed; right: auto; z-index: 80; }
.mention[data-user], .cmt-head b[data-user] { cursor: default; }

/* Comment replies: a "Replying to" chip in the composer and a "Reply to X" link that jumps to (and flashes) the original */
.reply-chip, .reply-ref { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--text-xs); color: var(--color-ink-2); }
.reply-chip { padding: 4px 4px 4px 8px; margin-bottom: 6px; border-left: 2px solid var(--color-accent); background: var(--color-paper-2); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.reply-chip button { margin-left: auto; }
.reply-ref { margin-bottom: 4px; padding: 2px 8px; border-left: 2px solid var(--color-rule-strong); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; width: fit-content; max-width: 100%; }
.reply-ref:hover { border-left-color: var(--color-accent); color: var(--color-ink); background: var(--color-paper-2); }
.reply-chip .i, .reply-ref .i { width: 12px; height: 12px; flex: none; }
.reply-snip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; opacity: .8; }
.cmt { scroll-margin: 80px; }
.cmt.is-flash { animation: cmt-flash 2.2s var(--ease-out); border-radius: var(--radius-md); }
@keyframes cmt-flash { 0%, 35% { background: color-mix(in oklch, var(--color-accent) 20%, transparent); box-shadow: 0 0 0 2px color-mix(in oklch, var(--color-accent) 55%, transparent); } 100% { background: transparent; box-shadow: none; } }
@media (prefers-reduced-motion: reduce) { .cmt.is-flash { animation: none; background: color-mix(in oklch, var(--color-accent) 16%, transparent); } }

/* Search: matched text in results and in the comment you land on */
.palette li a:has(.sr-snip) { flex-wrap: wrap; row-gap: 2px; }
.sr-snip { flex-basis: 100%; margin-top: 2px; font-size: var(--text-xs); color: var(--color-ink-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.palette mark, .comment-body mark.hit { background: color-mix(in oklch, var(--color-warn) 35%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }

/* Standup: people strip, who's up, and their lanes */
.su-since { display: flex; align-items: center; gap: 8px; }
.su-people { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin-bottom: var(--space-lg); }
.su-chip { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 4px 10px 4px 4px; border: var(--rule); border-radius: 999px; font-size: var(--text-sm); color: var(--color-ink-2); background: var(--color-surface); }
.su-chip:hover { border-color: var(--color-rule-strong); color: var(--color-ink); }
.su-chip.is-on { border-color: var(--color-accent); color: var(--color-ink); background: var(--color-accent-soft); }
.su-chip:not(:has(.av)) { padding-left: 10px; }
.su-who { display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap; margin-bottom: var(--space-lg); }
.su-who h2 { margin: 0; font: 700 var(--text-xl)/1.2 var(--font-display); }
.su-who p { margin: 2px 0 0; }
.su-av { width: 56px; height: 56px; margin: 0; font-size: 20px; }
.su-nav { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.su-nav kbd { background: transparent; color: inherit; border-color: currentColor; opacity: .7; }
.su-overdue { border-color: color-mix(in oklch, var(--color-danger) 45%, transparent); }
.su-overdue .col-head h2 { color: var(--color-danger); }
.su-lanes .lane + .lane, .lanes > .lane + .lane { margin-top: 0; }
@media (max-width: 720px) { .su-nav { margin-left: 0; width: 100%; } .su-nav .btn { flex: 1; text-align: center; } }

/* Item attachments and comment uploads */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-sm); }
.file { position: relative; margin: 0; border: var(--rule); border-radius: var(--radius-md); overflow: hidden; background: var(--color-paper-2); }
.file-thumb { display: grid; place-items: center; height: 100px; background: var(--color-surface); }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; cursor: zoom-in; }
.file-doc { flex-direction: column; gap: 4px; color: var(--color-ink-2); }
.file-doc .i { width: 22px; height: 22px; }
.file figcaption { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; font-size: var(--text-xs); min-width: 0; }
.file-name { font-weight: 600; color: var(--color-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file form { position: absolute; top: 4px; right: 4px; opacity: 0; transition: opacity var(--dur-fast); }
.file:hover form, .file:focus-within form { opacity: 1; }
.file-del { background: var(--color-surface); }
fieldset.ro:disabled .file form, fieldset.ro:disabled .attach-form { display: none; }
.composer-files { display: flex; flex-wrap: wrap; gap: 4px; padding: 6px 0 0; }
.composer-foot label.icon-sq { cursor: pointer; }
.ip-main.is-drop, form.composer.is-drop { outline: 2px dashed var(--color-accent); outline-offset: 4px; border-radius: var(--radius-md); }
@media (hover: none) { .file form { opacity: 1; } }

/* Attachment tiles: previews by kind */
.files:empty, .atts:empty { display: none; }
.files-sm { grid-template-columns: repeat(auto-fill, minmax(150px, 190px)); margin-top: var(--space-sm); }
.file-thumb { position: relative; overflow: hidden; }
.file-thumb video, .file-thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.file-pdf .file-thumb canvas { object-position: top; background: #fff; }
.file-play { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.file-play .i { width: 36px; height: 36px; padding: 9px 7px 9px 11px; border-radius: 50%; background: oklch(0% 0 0 / .55); color: #fff; }
.file-snip { margin: 0; padding: 8px; width: 100%; height: 100%; overflow: hidden; font: 10px/1.35 var(--font-mono); color: var(--color-ink-2); white-space: pre-wrap; word-break: break-all; text-align: left; align-self: start; }
.file-badge { position: absolute; left: 6px; bottom: 6px; padding: 1px 5px; border-radius: var(--radius-sm); font-size: 10px; background: oklch(0% 0 0 / .6); color: #fff; }
.file-icon .i { width: 24px; height: 24px; color: var(--color-ink-2); }
.file-thumb[data-lightbox] { cursor: zoom-in; }
/* Viewer for non-image files */
.lb-doc { width: 100%; height: 100%; justify-self: stretch; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 0; }
.lb-media { max-width: 100%; max-height: 100%; border-radius: var(--radius-md); background: #000; }
.lb-frame { flex: 1; width: min(1100px, 100%); min-height: 0; border: 0; border-radius: var(--radius-md); background: #fff; }
.lb-text { flex: 1; width: min(1100px, 100%); min-height: 0; margin: 0; overflow: auto; padding: var(--space-md); border-radius: var(--radius-md);
  background: oklch(16% 0.01 260); color: oklch(92% 0.005 250); font: 13px/1.5 var(--font-mono); white-space: pre-wrap; word-break: break-word; }
.lb-msg { opacity: .8; }
.lb-sheets { display: flex; gap: 4px; flex-wrap: wrap; width: min(1100px, 100%); }
.lb-sheets button, .lb-modes button { color: inherit; opacity: .7; }
.lb-sheets button[aria-pressed="true"], .lb-modes button[aria-pressed="true"] { opacity: 1; background: oklch(100% 0 0 / .14); }
.lb-sheet { flex: 1; width: min(1100px, 100%); min-height: 0; display: flex; }
.lb-sheet .lb-frame { width: 100%; }
.lb-modes { display: inline-flex; gap: 2px; margin-right: 6px; }
.lb-pages { flex: 1; width: min(1100px, 100%); min-height: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.lb-page { width: 100%; height: auto; background: #fff; border-radius: var(--radius-sm); box-shadow: 0 2px 12px oklch(0% 0 0 / .4); }

/* Timeline (Gantt) */
.tl-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: var(--space-md); }
.seg { display: inline-flex; }
.seg .btn { border-radius: 0; margin-left: -1px; }
.seg .btn:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); margin-left: 0; }
.seg .btn:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.seg .btn[aria-pressed="true"], .tl-edit[aria-pressed="true"] { background: var(--color-accent-soft); border-color: var(--color-accent); color: var(--color-ink); position: relative; }
.tl-edit { display: inline-flex; gap: 6px; align-items: center; }
.tl-legend { display: flex; gap: 10px; margin-left: auto; font-size: var(--text-xs); color: var(--color-ink-2); flex-wrap: wrap; }
.tl-legend span { display: inline-flex; gap: 4px; align-items: center; }
.tl-sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.tl-sw.p1, .tl-bar-el.p1, .tl-ghost.p1 { --bar: var(--color-p1); } .tl-sw.p2, .tl-bar-el.p2, .tl-ghost.p2 { --bar: var(--color-p2); }
.tl-sw.p3, .tl-bar-el.p3, .tl-ghost.p3 { --bar: var(--color-p3); } .tl-sw.p4, .tl-bar-el.p4, .tl-ghost.p4 { --bar: var(--color-p4); }
.tl-sw.p5, .tl-bar-el.p5, .tl-ghost.p5 { --bar: var(--color-p5); }
.tl-sw { background: var(--bar); }
.tl-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--space-md); align-items: start; }
.tl { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); overflow: hidden; min-width: 0; }
.tl-scroll { overflow: auto; max-height: calc(100dvh - 220px); position: relative; }
.tl-head { position: sticky; top: 0; z-index: 4; display: flex; width: calc(var(--name-w) + var(--lane-w)); background: var(--color-paper-2); border-bottom: var(--rule); }
.tl-corner { position: sticky; left: 0; z-index: 2; flex: none; width: var(--name-w); padding: 0 10px; display: flex; align-items: flex-end; padding-bottom: 6px;
  font: 500 var(--text-xs) var(--font-mono); text-transform: uppercase; color: var(--color-muted); background: var(--color-paper-2); border-right: var(--rule); }
.tl-hlane { position: relative; width: var(--lane-w); height: 46px; cursor: grab; user-select: none; }
.tl-hlane:active { cursor: grabbing; }
.tl-top, .tl-ticks { position: absolute; left: 0; right: 0; }
.tl-top { top: 0; height: 22px; }
.tl-ticks { top: 22px; height: 24px; border-top: var(--rule); }
/* Every label lives in a cell as wide as its span and is clipped there, so labels can never overlap at any zoom. */
.tl-cell, .tl-tick { position: absolute; top: 0; bottom: 0; overflow: clip; border-left: var(--rule); }
.tl-cell span { position: sticky; left: calc(var(--name-w) + 6px); display: inline-block; padding: 4px 6px; font: 600 var(--text-xs) var(--font-mono); text-transform: uppercase; color: var(--color-ink); white-space: nowrap; }
.tl-tick span { display: block; padding: 5px 4px; font: 500 10px var(--font-mono); color: var(--color-muted); white-space: nowrap; }
.tl-tick.is-we span { opacity: .6; }
.tl-body { position: relative; width: calc(var(--name-w) + var(--lane-w)); min-height: 120px; }
.tl-grid { position: absolute; top: 0; bottom: 0; left: var(--name-w); width: var(--lane-w); pointer-events: none; }
.tl-gl { position: absolute; top: 0; bottom: 0; border-left: 1px solid color-mix(in oklch, var(--color-rule) 60%, transparent); }
.tl-gl.is-we { background: color-mix(in oklch, var(--color-paper-2) 70%, transparent); }
.tl-today { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px solid var(--color-warn); z-index: 2; pointer-events: none; }
.tl-today span { position: sticky; top: 0; display: inline-block; transform: translateX(-50%); padding: 1px 5px; border-radius: var(--radius-sm); background: var(--color-warn); color: #111; font: 600 10px var(--font-mono); }
.tl-links { position: absolute; top: 0; z-index: 1; pointer-events: none; overflow: visible; }
.tl-links path { fill: none; stroke: var(--color-ink-2); stroke-width: 1.4; opacity: .7; marker-end: url(#tl-ar); }
.tl-links marker path { fill: var(--color-ink-2); stroke: none; }
.tl-row { display: flex; height: var(--row-h); border-bottom: 1px solid color-mix(in oklch, var(--color-rule) 50%, transparent); }
.tl-row:hover { background: color-mix(in oklch, var(--color-accent) 5%, transparent); }
.tl-name { position: sticky; left: 0; z-index: 3; flex: none; width: var(--name-w); display: flex; align-items: center; gap: 6px; padding-right: 8px; font-size: var(--text-sm);
  background: var(--color-surface); border-right: var(--rule); color: var(--color-ink); white-space: nowrap; overflow: hidden; }
.tl-name .mono { font-size: var(--text-xs); color: var(--color-ink-2); flex: none; }
.tl-title { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tl-proj { margin-left: auto; font-size: 10px; color: var(--color-muted); flex: none; }
.tl-lane { position: relative; width: var(--lane-w); flex: none; }
.tl-bar-el { position: absolute; top: 6px; height: calc(var(--row-h) - 12px); border-radius: 6px; background: var(--bar); color: #fff; cursor: pointer; z-index: 2;
  display: flex; align-items: center; box-shadow: 0 1px 2px oklch(0% 0 0 / .25); }
.tl-bar-el.no-due { background: linear-gradient(90deg, var(--bar) 55%, color-mix(in oklch, var(--bar) 30%, transparent)); box-shadow: none; }
.tl-bar-el.is-done { opacity: .5; }
.tl-bar-el.is-late { outline: 2px solid var(--color-danger); outline-offset: 1px; }
.tl-label { padding: 0 10px; font-size: var(--text-xs); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; text-shadow: 0 1px 1px oklch(0% 0 0 / .3); }
.tl-label em { font-style: normal; font-weight: 500; }
.tl-label.out { position: absolute; left: calc(100% + 6px); overflow: visible; color: var(--color-ink); text-shadow: none; padding: 0; }
.tl-bar-el.is-ms { width: 18px; background: none; box-shadow: none; }
.tl-bar-el.is-ms i { width: 14px; height: 14px; margin: auto; background: var(--bar); transform: rotate(45deg); border-radius: 2px; }
.tl-bar-el.is-ms b { position: absolute; left: 22px; font-size: var(--text-xs); color: var(--color-ink); white-space: nowrap; font-weight: 600; }
.tl-h { position: absolute; top: 0; bottom: 0; width: 9px; display: none; cursor: ew-resize; z-index: 1; }
.tl-h.l { left: -1px; border-radius: 6px 0 0 6px; } .tl-h.r { right: -1px; border-radius: 0 6px 6px 0; }
.tl-h::after { content: ""; position: absolute; top: 25%; bottom: 25%; left: 3px; width: 3px; border-radius: 2px; background: #fff; opacity: .9; }
.is-edit .tl-bar-el.can-edit { cursor: grab; }
.is-edit .tl-bar-el.can-edit .tl-h { display: block; background: oklch(0% 0 0 / .22); }
.tl-bar-el.is-dragging { cursor: grabbing; z-index: 5; box-shadow: 0 4px 14px oklch(0% 0 0 / .35); }
.tl-bar-el.is-dragging::before { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 0; padding: 2px 6px; border-radius: var(--radius-sm);
  background: var(--color-ink); color: var(--color-paper); font: 500 10px var(--font-mono); white-space: nowrap; }
.tl-empty { padding: var(--space-lg); }
.tl-uns { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-paper-2); padding: var(--space-md); max-height: calc(100dvh - 220px); overflow: auto; }
.tl-uns h2 { margin: 0 0 4px; font: 600 var(--text-md) var(--font-display); }
.tl-uns ul { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-uns li a { display: flex; gap: 6px; align-items: center; padding: 6px; border-radius: var(--radius-sm); font-size: var(--text-sm); color: var(--color-ink); }
.tl-uns li a:hover { background: var(--color-surface); }
.tl-uns li.can-edit a { cursor: grab; }
.tl-uns .mono { font-size: var(--text-xs); color: var(--color-ink-2); white-space: nowrap; flex: none; }
.tl-uns .prio { flex: none; }
.tl-uns li.can-edit a:active { cursor: grabbing; }
.tl-ghost { position: fixed; z-index: 90; pointer-events: none; padding: 3px 8px; border-radius: 6px; background: var(--bar); color: #fff; font: 600 var(--text-xs) var(--font-mono); }
.tl-ghost.is-bar { box-sizing: border-box; height: 24px; line-height: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .85; outline: 2px dashed var(--bar); outline-offset: 2px; }
.tl-carrying, .tl-carrying * { cursor: grabbing !important; user-select: none; }
@media (max-width: 900px) { .tl-wrap { grid-template-columns: 1fr; } .tl-legend { margin-left: 0; } .tl-hint { display: none; } }

/* ===== Redesign 2026-11: rail, page header ===== */
/* Board chip: the key on a colour derived from it (ebo.hue), so each board is recognisable in the rail and its header. */
.bchip { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--radius-md);
  background: oklch(var(--chip-l) var(--chip-c) var(--h, 256)); color: var(--color-accent-ink); font: 700 9px/1 var(--font-mono); letter-spacing: .02em; text-transform: uppercase; }
.bchip.lg { width: auto; min-width: 32px; height: 32px; padding: 0 7px; border-radius: var(--radius-lg); font-size: var(--text-xs); }
.rail { gap: var(--space-lg); padding: var(--space-md); }
.rail-top { padding: 2px 0 0 2px; }
.jump { justify-content: flex-start; gap: 8px; padding: 7px 10px; font-size: var(--text-sm); }
.jump kbd { margin-left: auto; }
.jump span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { gap: 2px; }
.nav .label { padding: 0 var(--space-sm) 6px; }
.nav a { gap: 10px; padding: 6px var(--space-sm); font-size: var(--text-sm); color: var(--color-ink-2); position: relative; overflow: visible; }
.nav a > span:not(.bchip):not(.nav-n):not(.badge) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav a > .i { color: var(--color-muted); width: 22px; }
.nav a:hover > .i, .nav a[aria-current="page"] > .i { color: var(--color-ink); }
.nav a[aria-current="page"] { font-weight: 600; }
.nav a[aria-current="page"]::before { position: absolute; left: -6px; top: 50%; height: 16px; margin: -8px 0 0; }
.nav .nav-lock { width: 12px; height: 12px; color: var(--color-muted); }
.nav-n { flex: none; min-width: 20px; text-align: right; font: 500 var(--text-xs)/1 var(--font-mono); color: var(--color-muted); }
.nav a[aria-current="page"] .nav-n { color: var(--color-ink-2); }
.rail-foot { padding: var(--space-md) 2px 0; gap: 4px; }
.rail-foot .who { gap: 10px; flex: 1; }
.rail-foot .who .av { width: 30px; height: 30px; margin: 0; border: 0; font-size: 11px; }
.who-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.who-text b { color: var(--color-ink); font-weight: 600; font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; }
.who-text small { color: var(--color-muted); font-size: var(--text-xs); }
.rail-foot form { display: flex; }

/* Header: title and tabs share one row, tabs right after the title, so the page starts ~40px higher. */
.pagehead { align-items: flex-end; justify-content: flex-start; gap: 0 var(--space-xl); padding: var(--space-md) var(--space-2xl) 0; min-height: 57px; }
.pagehead > * { margin-bottom: var(--space-md); }
.pagehead > :not(.ptabs):not(:first-child) { margin-left: auto; }
.pagehead h1 { font-size: var(--text-xl); line-height: 1.3; }
.pagehead .crumbs { margin-bottom: 2px; }
.ph-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pagehead > .ptabs { margin-bottom: -1px; align-self: flex-end; }
.ptabs a { padding: 9px 12px 11px; font-size: var(--text-sm); border-radius: var(--radius-md) var(--radius-md) 0 0; white-space: nowrap; }
.ptabs a:hover { background: var(--color-paper-2); }
.ptabs a[aria-current="page"] { color: var(--color-ink); font-weight: 600; }
.content { padding-top: var(--space-lg); }
@media (max-width: 720px) {
  .pagehead { padding: var(--space-md) var(--space-lg) 0; }
  .pagehead > .ptabs { width: 100%; overflow-x: auto; scrollbar-width: none; margin-left: -6px; }
  .pagehead > :first-child { margin-bottom: var(--space-sm); }
  .rail .rail-drawer .nav a { font-size: var(--text-md); padding: 9px var(--space-sm); }
  .rail-drawer .rail-foot .who { display: inline-flex; }
}
/* Timestamps: tabular so a list of them lines up. */
time[data-local] { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ===== Redesign 2026-11: cards ===== */
/* One quiet meta row: key and due on the left, subtask progress, priority and up to three people on the right.
   Plain tasks carry no type icon (it said nothing); doers have no ring, a reviewer keeps a thin violet one. */
.card { padding: 10px var(--space-md) 9px; gap: 8px; border-radius: var(--radius-lg); transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out); }
.card:hover { border-color: var(--color-rule-strong); box-shadow: 0 2px 8px oklch(0% 0 0 / .12); }
.card-title { font-size: var(--text-md); line-height: 1.4; }
.card.is-done .card-title { color: var(--color-muted); }
.card-meta { gap: 8px; flex-wrap: wrap; min-height: 24px; }
.card-left { gap: 8px; flex-wrap: wrap; }
.card-right { gap: 8px; margin-left: auto; }
.card-left .key { font-size: var(--text-xs); color: var(--color-muted); letter-spacing: .01em; }
.card .due { border: 0; padding: 0; gap: 4px; font: 500 var(--text-xs)/1 var(--font-body); color: var(--color-muted); white-space: nowrap; }
.card .due .i { width: 12px; height: 12px; vertical-align: 0; }
.card .due.overdue { color: var(--color-danger); background: var(--color-danger-soft); padding: 3px 6px; border-radius: var(--radius-sm); }
.subprog { display: inline-flex; align-items: center; gap: 3px; font: 500 var(--text-xs)/1 var(--font-mono); color: var(--color-muted); white-space: nowrap; }
.subprog .i { width: 12px; height: 12px; vertical-align: 0; }
.subprog.is-all { color: var(--color-ok); }
.card .people .av { width: 22px; height: 22px; border: 2px solid var(--color-surface); font-size: 9px; margin: 0; }
.card .people > * + * { margin-left: -7px; }
.card .doer-ring .av { box-shadow: none; }
.card .reviewer-ring .av { box-shadow: 0 0 0 1.5px var(--color-cat-review); }
.card .av.more { background: var(--color-paper-3); color: var(--color-ink-2); font: 600 9px/1 var(--font-mono); }
.card .labels { gap: 4px; }
.card .waiting-note { font-size: var(--text-xs); padding: 4px 8px; }
.card.is-sub { margin-left: 10px; }
.col { border-radius: var(--radius-lg); }

/* ===== Redesign 2026-11: item view ===== */
/* Details is a flat list (no card inside the side panel), people sit inline, and the side panel moves above the
   content before the text column gets narrower than about 560px. Media queries, not container queries: containment
   on .ip would re-anchor the fixed menus pinned inside the modal. */
.ip-grid, dialog.item-modal .ip-grid { grid-template-columns: minmax(0, 1fr) 340px; }
.ip-main > *, .ip-main > fieldset > * { max-width: 880px; }
.ip-side { gap: var(--space-lg); padding: var(--space-xl) var(--space-lg); }
.ip-sec { margin-bottom: var(--space-xl); }
.ip-h { font-size: var(--text-sm); margin-bottom: 10px; }
.details { border: 0; background: transparent; border-radius: 0; }
.details summary { padding: 0 0 8px; font: 500 var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); }
.details summary::before, .details:not([open]) summary::before { content: none; }
.details summary::after { content: ""; display: inline-block; width: 10px; height: 10px; margin-left: 6px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3.5 5 6.5l3-3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none' stroke='black' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 3.5 5 6.5l3-3'/%3E%3C/svg%3E") center / contain no-repeat; transition: transform var(--dur-fast) var(--ease-out); }
.details:not([open]) summary::after { transform: rotate(-90deg); }
.details > fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.drow { grid-template-columns: 84px minmax(0, 1fr); gap: var(--space-sm); padding: 6px 0; align-items: center; min-height: 38px;
  border-bottom: 1px solid color-mix(in oklch, var(--color-rule) 55%, transparent); }
.drow:last-child { border-bottom: 0; }
.dlabel { padding-top: 0; }
.drow:has(.person) { align-items: start; } .drow:has(.person) .dlabel { padding-top: 5px; }
.dval { gap: 2px 10px; }
.dval .person { background: transparent; padding: 2px 0; gap: 6px; }
.dval .person .av { width: 20px; height: 20px; }
.dval .person .x { opacity: 0; transition: opacity var(--dur-fast); }
.dval .person:hover .x, .dval .person:focus-within .x { opacity: 1; }
@media (hover: none) { .dval .person .x { opacity: 1; } }
.ip-stamp { font-family: var(--font-body); line-height: 1.5; }
/* Native date fields stay native (they follow the viewer's own date order: mm/dd in the US, dd.mm in Bulgaria)
   but are dressed like the other bare fields. */
input[type=date] { font-variant-numeric: tabular-nums; }
input[type=date].bare { width: auto; font-size: var(--text-sm); padding: 3px 4px; }
input[type=date].is-empty:not(:focus) { color: var(--color-muted); }
input[type=date]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; padding: 2px; border-radius: var(--radius-sm); }
input[type=date]::-webkit-calendar-picker-indicator:hover { opacity: 1; background-color: var(--color-paper-3); }
/* Comments: name and time never wrap; the name gives way first. */
.composer, .cmt { grid-template-columns: 32px minmax(0, 1fr); gap: var(--space-md); }
.composer .av, .cmt .av { width: 32px; height: 32px; font-size: 12px; }
.cmt { margin-bottom: var(--space-lg); }
.cmt-head { gap: 8px; min-width: 0; min-height: 26px; margin-bottom: 2px; }
.cmt-head b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); }
.cmt-time { flex: none; font-size: var(--text-xs); color: var(--color-muted); }
.cmt-head .small { flex: none; }
.cmt-tools { flex: none; }
@media (hover: hover) { .cmt-tools { opacity: 0; } .cmt:hover .cmt-tools, .cmt:focus-within .cmt-tools { opacity: 1; } }
.comment-body { line-height: 1.55; }
.tabs button[aria-selected="true"] { color: var(--color-ink); font-weight: 600; }
/* One column, side panel first, with Details laid out as a grid of fields. */
@media (max-width: 1240px) {
  .ip-page .ip-grid { grid-template-columns: minmax(0, 1fr); }
  .ip-page .ip-side { border-left: 0; border-bottom: var(--rule); order: -1; }
  .ip-page .details > fieldset { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); column-gap: var(--space-2xl); }
  .ip-page .ip-title { font-size: var(--text-xl); }
}
@media (max-width: 1000px) {
  dialog.item-modal .ip-grid { grid-template-columns: minmax(0, 1fr); }
  dialog.item-modal .ip-side { border-left: 0; border-bottom: var(--rule); order: -1; }
  dialog.item-modal .details > fieldset { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); column-gap: var(--space-2xl); }
  dialog.item-modal .ip-title { font-size: var(--text-xl); }
}
/* Board and timeline use the height the slimmer header freed. */
.board-wrap .col { max-height: calc(100dvh - 196px); }
.tl-scroll, .tl-uns { max-height: calc(100dvh - 176px); }

/* ===== Redesign 2026-11: list, settings, My work, timeline ===== */
/* List: Reporter and Created are hidden on desktop (mostly empty after the Worklog import; both stay in the item
   view), Board is hidden inside a board, so the table fits 1280px without a sideways scroll. The cells stay in the
   DOM because the phone layout places them by position. */
@media (min-width: 721px) {
  .jlist th:nth-child(4), .jlist td:nth-child(4), .jlist th:nth-child(8), .jlist td:nth-child(8) { display: none; }
  .jlist.in-board th:nth-child(7), .jlist.in-board td:nth-child(7) { display: none; }
  .jlist td { padding-top: 6px; padding-bottom: 6px; }
  .jlist .work { min-width: 280px; width: 46%; }
}
.jlist th { font: 500 var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); padding-top: 10px; padding-bottom: 10px; }
.jlist th .sort { color: inherit; }
.jlist tbody tr:hover { background: color-mix(in oklch, var(--color-accent) 4%, transparent); }
.jlist .key { color: var(--color-muted); }
.jlist a.key:hover { color: var(--color-accent); }
.doers { display: inline-flex; align-items: center; gap: 8px; }
.doers .people.stack .av { width: 24px; height: 24px; margin-left: -8px; border: 2px solid var(--color-surface); font-size: 9px; }
.doers .people.stack .av:first-child { margin-left: 0; }
.doers .people.stack { flex: none; }
.jlist tbody tr[data-open] { cursor: pointer; }
.jlist tbody tr[data-open] :is(input, select, .sel, [data-inline-title], summary) { cursor: auto; }
.jlist .row-pick > summary { cursor: pointer; padding: 2px 6px 2px 2px; height: auto; }
.jlist .row-pick .menu { max-height: 320px; overflow-y: auto; min-width: 220px; }
.jlist .doers .people { overflow: visible; height: auto; }
/* :ebo-name: marks inside docs and comments (templatetags rich): sit on the text line. */
.doc-mark { display: inline-block; vertical-align: -3px; margin: 0 2px; }
svg.doc-mark { width: 16px; height: 16px; }
.prio.doc-mark { display: inline-flex; }
.doc-mark .av { width: 18px; height: 18px; }
.doers .people.stack .av.more { background: var(--color-paper-3); color: var(--color-ink); }
.doer-names { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--color-ink); font-size: var(--text-sm); }
/* Status in the list is a soft tinted pill with a dot: a column of solid blue buttons outweighed the titles. */
.jlist .sel.is-pill .sel-btn { --cat: var(--color-cat-todo); font-weight: 500; font-size: var(--text-sm); padding: 4px 8px 4px 10px; gap: 8px; border-radius: 999px;
  background: color-mix(in oklch, var(--cat) 16%, transparent); color: var(--color-ink); }
.jlist .sel.is-pill .sel-btn::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cat); flex: none; }
.jlist .sel.is-pill.cat-backlog .sel-btn { --cat: var(--color-cat-backlog); } .jlist .sel.is-pill.cat-active .sel-btn { --cat: var(--color-cat-active); }
.jlist .sel.is-pill.cat-waiting .sel-btn { --cat: var(--color-cat-waiting); } .jlist .sel.is-pill.cat-review .sel-btn { --cat: var(--color-cat-review); }
.jlist .sel.is-pill.cat-done .sel-btn { --cat: var(--color-cat-done); }
.jlist .sel.is-pill .sel-btn::after { background: var(--color-muted); }
@media (max-width: 720px) {
  .doer-names { display: none; }
  /* The card row is status, people, priority, due: the date field drops its picker icon so all four fit at 320px. */
  .jlist td:nth-child(10) input[type=date] { width: 92px; padding: 0; font-size: var(--text-xs); text-align: right; }
  .jlist td:nth-child(10) input[type=date]::-webkit-calendar-picker-indicator { display: none; }
  .jlist td:nth-child(10) { grid-area: 2 / 5 / 3 / 7; }
}
@media (max-width: 400px) {
  .jlist td:nth-child(10) { grid-area: 3 / 2 / 4 / 7; justify-self: start; }
  .jlist td:nth-child(10):has(input.is-empty) { display: none; }
  .jlist td:nth-child(10) input[type=date] { text-align: left; }
}
.create-row input[type=date] { color: var(--color-muted); }

/* Settings tab */
.settings-grid { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 440px)); gap: var(--space-lg); align-items: start; }
.settings-grid .panel > p.muted { margin: 0 0 var(--space-md); font-size: var(--text-sm); }
.settings-grid .btn-primary { align-self: flex-start; }
.settings-grid:disabled .btn-primary { display: none; }

/* My work: a lane with nothing in it stays as a slim drop target instead of taking a third of the page. */
@media (min-width: 721px) {
  .lanes { display: flex; flex-wrap: wrap; align-items: flex-start; }
  .lanes > .lane { flex: 1 1 280px; min-width: 0; }
  .lanes > .lane.is-empty { flex: 0 0 180px; background: transparent; border-style: dashed; }
  .lanes > .lane.is-empty .col-head { border-bottom: 0; }
  .lanes > .lane.is-empty .col-head h2, .lanes > .lane.is-empty .lane-empty { color: var(--color-muted); }
}
.lane .col-head h2 { font-size: var(--text-sm); }

/* Timeline: the row names the item, the bar gives its dates. Open-ended bars (start, no due) are a tint with a solid
   start cap rather than a fade. */
.tl-label { font: 500 var(--text-xs)/1 var(--font-body); font-variant-numeric: tabular-nums; }
.tl-bar-el.no-due { background: color-mix(in oklch, var(--bar) 26%, transparent); border-left: 3px solid var(--bar); color: var(--color-ink-2);
  border-radius: 3px 6px 6px 3px; box-shadow: none; }
.tl-bar-el.no-due .tl-label { text-shadow: none; color: var(--color-ink-2); }
.tl-bar-el.is-ms b { font-weight: 500; color: var(--color-ink-2); font-variant-numeric: tabular-nums; }
.tl-name { font-size: var(--text-sm); }
.tl-row:hover .tl-name { background: color-mix(in oklch, var(--color-accent) 5%, var(--color-surface)); }
/* An empty date in the list stays out of the way until you point at its row. */
@media (hover: hover) and (min-width: 721px) {
  .jlist td input[type=date].is-empty:not(:focus) { opacity: 0; }
  .jlist tr:hover td input[type=date].is-empty, .jlist td input[type=date].is-empty:focus-visible { opacity: 1; }
}

/* Timeline: the row an Unscheduled item gets while it is being dragged over the chart. */
.tl-row.is-preview, .tl-row.is-preview .tl-name { background: color-mix(in oklch, var(--color-accent) 10%, var(--color-surface)); }
.tl-bar-el.is-preview { background: color-mix(in oklch, var(--bar) 45%, transparent); outline: 2px dashed var(--bar); outline-offset: 1px; box-shadow: none; pointer-events: none; }
.tl-ghost { box-shadow: var(--shadow-pop); white-space: nowrap; }
/* Rail: the number by a board is its open-item count, drawn as a count pill so it does not read as a shortcut key. */
.nav-n { min-width: 0; padding: 3px 7px; border-radius: 999px; background: var(--color-paper-3); text-align: center; }

/* Item sections: add forms stay hidden behind a quiet "+ Add ..." row. */
.ip-sec > .ip-more { display: block; background: none; border: 0; padding: 4px 0; font: 400 var(--text-sm) var(--font-body); color: var(--color-muted); cursor: pointer; }
.ip-sec > .list-rows + .ip-more { margin-top: 6px; }
.ip-sec > .ip-more:hover, .ip-sec > .ip-more:focus-visible { color: var(--color-accent); }

/* Chat apps page */
.chat-id { display: grid; grid-template-columns: auto 1fr; gap: 6px var(--space-md); align-items: baseline; margin: var(--space-md) 0; }
.chat-id dd { margin: 0; color: var(--color-ink); user-select: all; }
.chat-new { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); padding: var(--space-md); margin-bottom: var(--space-md);
  border: 1px solid var(--color-accent); border-radius: var(--radius-md); background: var(--color-accent-soft); }
.chat-new b { flex: 1 1 100%; color: var(--color-ink); }
.chat-new code { padding: 6px 10px; border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-ink); user-select: all; overflow-wrap: anywhere; }
.chat-new p { flex: 1 1 100%; margin: 0; }
.chat-add { display: flex; flex-direction: column; gap: var(--space-md); margin-bottom: var(--space-md); }
.chat-add .btn { align-self: flex-start; }

/* Chat page and Discussions tab */
.chat-wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: var(--space-lg); align-items: start; }
.chat-side { padding: var(--space-md); display: flex; flex-direction: column; gap: var(--space-sm); max-height: calc(100dvh - 120px); overflow: auto; }
.chat-side h2 { margin: var(--space-sm) 0 0; padding: 0 var(--space-sm); }
.chat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-open { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px var(--space-sm); border: 0; background: transparent; border-radius: var(--radius-md);
  color: var(--color-ink-2); font-size: var(--text-sm); text-align: left; }
.chat-open > span:last-child { overflow: hidden; text-overflow: ellipsis; }
.chat-open:hover { background: var(--color-paper-3); }
.chat-open.is-on { background: var(--color-accent-soft); color: var(--color-ink); font-weight: 600; }
.chat-open .av { width: 22px; height: 22px; margin: 0; border: 0; flex: none; }
.chat-new-channel { display: flex; gap: 4px; padding: 0 var(--space-sm); }
.chat-new-channel input { flex: 1; font-size: var(--text-sm); }
.chat-main { padding: 0; overflow: hidden; }
.chat-main > .ro-note { margin: var(--space-lg); }
.chat-stage { height: calc(100dvh - 120px); min-height: 420px; position: relative; }
.chat-stage [data-chat-status] { position: absolute; inset: var(--space-lg) var(--space-lg) auto; margin: 0; z-index: 1; }
.chat-stage converse-root { display: block; height: 100%; }
/* Every level between the stage and the message box takes the full height and may shrink, so the box at the
   bottom is never pushed out of view. chat.js sizes the stage to the window. */
.chat-stage .conversejs, .chat-stage converse-chats, .chat-stage converse-chats > .row, .chat-stage converse-chat, .chat-stage converse-muc,
.chat-stage .chatbox, .chat-stage .chatbox .flyout { height: 100%; min-height: 0; max-height: 100%; }
.chat-stage .chatbox .flyout { display: flex; flex-direction: column; }
.chat-stage .chat-body, .chat-stage .chatroom-body { flex: 1 1 auto; min-height: 0; }
.disc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: var(--space-lg); align-items: start; }
.disc-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-md); }
.disc-head .btn { display: inline-flex; gap: 6px; align-items: center; }
.disc-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-md); }
.disc-log li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--space-md); }
.disc-log .av { width: 28px; height: 28px; margin: 0; border: 0; }
.disc-log b { color: var(--color-ink); font-size: var(--text-sm); }
.disc-log .rich > :first-child { margin-top: 2px; } .disc-log .rich > :last-child { margin-bottom: 0; }
@media (max-width: 720px) { .chat-wrap { grid-template-columns: minmax(0, 1fr); } .chat-side { max-height: 220px; } .chat-stage { height: 70dvh; } }

/* Converse.js inside the Chat page, dressed as eBo. Converse's dracula theme is built from a small palette of
   variables; mapping that palette onto eBo's tokens restyles all of it, in light and dark. eBo's list is the only
   sidebar, so Converse's own (the controlbox) is hidden. */
.chat-stage .conversejs, .chat-stage .conversejs.theme-dracula {
  --background: var(--color-surface); --foreground: var(--color-ink-2); --current-line: var(--color-paper-2); --comment: var(--color-muted);
  --green: var(--color-accent); --orange: var(--color-accent); --cyan: var(--color-accent); --pink: var(--color-accent);
  --purple: var(--color-ink); --red: var(--color-danger); --yellow: var(--color-warn);
  --normal-font: var(--font-body); --heading-font: var(--font-display); --font-family-sans-serif: var(--font-body);
  --message-author-color: var(--color-ink); --link-color: var(--color-accent); --text-color: var(--color-ink-2); --message-text-color: var(--color-ink-2);
  --chat-head-text-color: var(--color-ink); --chat-head-fg-color: var(--color-ink); --chatroom-head-fg-color: var(--color-ink); --chatroom-head-color: var(--color-ink);
  --chat-head-border-bottom: var(--rule); --chatroom-head-border-bottom: var(--rule); --headlines-head-border-bottom: var(--rule);
  --chatbox-message-input-border-top: var(--rule); --chatroom-message-input-border-top: var(--rule);
  --chat-separator-border-bottom: var(--rule); --chatroom-separator-border-bottom: var(--rule);
  --occupants-border-left: var(--rule); --occupants-border-bottom: var(--rule);
  --button-text-color: var(--color-accent-ink); --toolbar-btn-text-color: var(--color-accent-ink); --unread-msgs-color: var(--color-accent);
  --raised-el-shadow: var(--shadow-pop); --chat-msg-hover-color: var(--color-paper-2);
  font-family: var(--font-body); font-size: var(--text-md);
}
.chat-stage #controlbox, .chat-stage converse-controlbox, .chat-stage .controlbox, .chat-stage converse-minimized-chats, .chat-stage .toggle-controlbox { display: none !important; }
.chat-stage converse-chats.converse-embedded, .chat-stage converse-chats.converse-embedded > .row { height: 100%; margin: 0; }
.chat-stage converse-chats.converse-embedded .chatbox { flex: 1 1 100%; max-width: 100%; width: 100%; margin: 0; }
.chat-stage .chat-head, .chat-stage .chatroom-head { padding: 10px var(--space-lg); }
.chat-stage .chat-head .chatbox-title__text, .chat-stage .chatroom-head .chatbox-title__text { font: 600 var(--text-lg) var(--font-display); color: var(--color-ink); letter-spacing: -0.01em; }
.chat-stage .chat-msg__author { font-weight: 600; font-size: var(--text-sm); }
.chat-stage .chat-msg__time, .chat-stage .chat-msg__heading time { font-size: var(--text-xs); color: var(--color-muted); }
.chat-stage .chat-textarea { font: inherit; padding: 10px var(--space-lg); }
.chat-stage .separator-text, .chat-stage .date-separator time { font: 500 var(--text-xs) var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); }
.chat-stage .avatar { border-radius: 50%; }
.chat-empty { position: absolute; inset: 40% 0 auto; text-align: center; margin: 0; }
.chat-open .chat-key { flex: none; font-size: var(--text-xs); color: var(--color-muted); }
.chat-open .dot { flex: none; margin: 0 7px; }

/* ===== Tags, Docs, Channels tab ===== */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 0 5px; border-radius: var(--radius-sm); background: var(--color-paper-3); color: var(--color-ink);
  font-size: .92em; text-decoration: none !important; white-space: nowrap; vertical-align: baseline; }
a.tag:hover { background: var(--color-accent-soft); }
.tag-item { font-family: var(--font-mono); font-size: .85em; }
.tag-channel, .tag-page { color: var(--color-accent); }
.tag-page::before { content: ""; width: 11px; height: 11px; background: currentColor; -webkit-mask: var(--doc-icon) center / contain no-repeat; mask: var(--doc-icon) center / contain no-repeat;
  --doc-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='1.8' stroke-linejoin='round'%3E%3Cpath d='M4 2.5h5l3 3v8H4z'/%3E%3C/svg%3E"); }
.tag-missing { color: var(--color-muted); background: transparent; border: 1px dashed var(--color-rule-strong); }
.docs { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: var(--space-lg); align-items: start; }
.docs-tree { padding: var(--space-md); position: sticky; top: var(--space-lg); max-height: calc(100dvh - 120px); overflow: auto; }
.docs-tree ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.docs-tree li a { display: flex; align-items: center; gap: 8px; padding: 6px var(--space-sm) 6px calc(var(--space-sm) + var(--d, 0) * 14px); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--color-ink-2); }
.docs-tree li a span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-tree li a:hover { background: var(--color-paper-3); }
.docs-tree li a[aria-current="page"] { background: var(--color-accent-soft); color: var(--color-ink); font-weight: 600; }
.docs-tree h3 { margin: 0 0 var(--space-sm); padding: 0 var(--space-sm); }
.docs-new { display: flex; gap: 4px; margin-top: var(--space-md); padding-top: var(--space-md); border-top: var(--rule); }
.docs-new input { flex: 1; font-size: var(--text-sm); }
.docs-page { padding: var(--space-xl) var(--space-2xl); min-width: 0; }
.docs-page > * { max-width: none; }
.rich img { display: block; max-width: 100%; height: auto; margin: var(--space-md) 0; border-radius: var(--radius-md); border: var(--rule); cursor: zoom-in; }
.docs-file .ins { position: absolute; top: 4px; left: 4px; }
.docs-trail { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--space-md); }
.docs-trail a:hover { color: var(--color-accent); }
.docs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); flex-wrap: wrap; }
.docs-title { font: 600 var(--text-2xl)/1.2 var(--font-display); letter-spacing: -0.02em; overflow-wrap: anywhere; }
.docs-tools { display: flex; gap: 6px; align-items: center; }
.docs-tools .btn { display: inline-flex; gap: 6px; align-items: center; }
.docs-meta { margin: 6px 0 var(--space-lg); }
.docs-body { font-size: var(--text-lg); line-height: 1.65; color: var(--color-ink-2); }
.docs-body h1, .docs-body h2, .docs-body h3 { margin: 1.4em 0 .4em; } .docs-body h1 { font-size: var(--text-xl); } .docs-body h2 { font-size: var(--text-lg); }
.docs-sec { margin-top: var(--space-2xl); padding-top: var(--space-lg); border-top: var(--rule); }
.docs-sec > h3 { margin-bottom: var(--space-sm); }
.docs-children { list-style: none; margin: 0; padding: 0; }
.docs-children li a { display: flex; align-items: center; gap: 8px; padding: 7px var(--space-sm); margin: 0 calc(-1 * var(--space-sm)); border-radius: var(--radius-md); color: var(--color-ink); }
.docs-children li a:hover { background: var(--color-paper-2); }
.docs-children li a > span:nth-last-child(1) { margin-left: auto; flex: none; }
.docs-file { position: relative; display: inline-block; } .docs-file form { position: absolute; top: 4px; right: 4px; }
.docs-attach { margin-top: var(--space-sm); } .docs-attach .btn { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.docs-edit { display: flex; flex-direction: column; gap: var(--space-sm); }
.docs-title-input { font: 600 var(--text-2xl)/1.2 var(--font-display); letter-spacing: -0.02em; border-color: transparent; padding: 4px 6px; margin: 0 -6px; }
.docs-edit textarea { min-height: 50dvh; font-size: var(--text-md); }
.docs-edit .form-actions { gap: var(--space-sm); align-items: center; } .docs-edit .form-actions input { flex: 1; }
.doc-versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.doc-versions a { display: flex; flex-direction: column; gap: 1px; padding: 7px var(--space-sm); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--color-ink-2); }
.doc-versions a:hover { background: var(--color-paper-3); } .doc-versions a[aria-current="page"] { background: var(--color-accent-soft); }
.doc-versions b { color: var(--color-ink); font-weight: 600; }
.doc-diff { border: var(--rule); border-radius: var(--radius-md); overflow: hidden; font: 400 var(--text-sm)/1.55 var(--font-mono); max-width: none !important; }
.dl { display: grid; grid-template-columns: 24px minmax(0, 1fr); } .dl-text { white-space: pre-wrap; overflow-wrap: anywhere; padding: 1px 8px 1px 0; }
.dl-mark { text-align: center; color: var(--color-muted); user-select: none; }
.dl-add { background: color-mix(in oklch, var(--color-ok) 16%, transparent); } .dl-add .dl-mark { color: var(--color-ok); }
.dl-del { background: color-mix(in oklch, var(--color-danger) 14%, transparent); } .dl-del .dl-mark { color: var(--color-danger); } .dl-del .dl-text { text-decoration: line-through; text-decoration-color: color-mix(in oklch, var(--color-danger) 50%, transparent); }
.dl-skip { color: var(--color-muted); background: var(--color-paper-2); font-family: var(--font-body); font-size: var(--text-xs); }
.doc-retitle del { color: var(--color-danger); } .doc-retitle ins { color: var(--color-ok); text-decoration: none; font-weight: 600; }
.chan-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-md); }
.chan-bar .btn { display: inline-flex; gap: 6px; align-items: center; } .chan-open { margin-left: auto; }
.chan-new { padding: var(--space-md); min-width: 260px; } .chan-new form { display: flex; flex-direction: column; gap: var(--space-sm); }
.chan { padding: 0; display: flex; flex-direction: column; height: calc(100dvh - 190px); min-height: 360px; }
.chan-log { flex: 1; overflow-y: auto; padding: var(--space-lg) var(--space-xl) 0; }
.chan-log .cmt { max-width: 880px; } .chan-empty { margin: var(--space-xl) 0; }
.chan-composer { padding: var(--space-md) var(--space-xl) var(--space-lg); margin: 0; border-top: var(--rule); }
.chan-grid { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: var(--space-md); align-items: start; }
.chan-people { padding: var(--space-md); height: calc(100dvh - 190px); min-height: 360px; overflow-y: auto; }
.chan-n { color: var(--color-muted); }
.chan-people .chan-role { margin-left: auto; flex: none; }
.chan-readers { margin-top: var(--space-md); } .chan-readers > summary { cursor: pointer; display: flex; gap: 6px; align-items: center; margin-bottom: var(--space-sm); }
.chan-people h2 { margin: 0 0 var(--space-sm); display: flex; gap: 6px; align-items: center; }
.chan-people ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.chan-people li { display: flex; align-items: center; gap: var(--space-sm); padding: 4px; border-radius: var(--radius-sm); font-size: var(--text-sm); min-width: 0; }
.chan-people li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chan-people .av { width: 24px; height: 24px; margin: 0; font-size: 10px; flex: none; }
@media (max-width: 1000px) { .chan-grid { grid-template-columns: minmax(0, 1fr); } .chan-people { height: auto; min-height: 0; max-height: 240px; } }
.pc-msg { display: flex; gap: 4px; margin-top: var(--space-md); padding-top: var(--space-md); border-top: var(--rule); }
.pc-msg input { flex: 1; min-width: 0; font-size: var(--text-sm); }
@media (max-width: 860px) { .docs { grid-template-columns: minmax(0, 1fr); } .docs-tree { position: static; max-height: 240px; } .docs-page { padding: var(--space-lg); } .chan { height: calc(100dvh - 230px); } }

/* ===== Item view, 2026-11: subtasks, links and checklist read as main content, not footnotes ===== */
.ip-big > .ip-h { font: 600 var(--text-lg)/1.2 var(--font-display); align-items: center; margin-bottom: var(--space-md); }
.ip-big > .ip-h .count { font-size: var(--text-sm); }
.ip-big .list-rows { border-width: 1px; box-shadow: var(--shadow-card, none); }
.sub-row.big, .ip-big .list-rows > form.chk-row { padding: 12px var(--space-lg); gap: var(--space-md); font-size: var(--text-md); min-height: 48px; }
.sub-row.big .sub-link { display: flex; align-items: center; gap: var(--space-md); flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.sub-row.big .sub-title { font-weight: 500; }
.sub-row.big .key { font-size: var(--text-sm); }
.sub-row.big .av { width: 24px; height: 24px; margin: 0; }
.sub-row.big.is-done .sub-title { color: var(--color-muted); text-decoration: line-through; }
.ip-big .check { width: 22px; height: 22px; font-size: 14px; }
.sub-progress { width: 120px; height: 6px; border-radius: 3px; background: var(--color-paper-3); overflow: hidden; margin-left: var(--space-sm); }
.sub-progress > span { display: block; height: 100%; background: var(--color-cat-done, var(--color-accent)); }
.blocked-chip { display: inline-flex; align-items: center; gap: 4px; color: var(--color-danger); border-color: currentColor; font: 500 var(--text-xs) var(--font-mono); text-decoration: none; }
.blocked-chip .i { width: 12px; height: 12px; }
/* Restricted items (perms.hide_restricted): a lock next to the key, a chip in the item's breadcrumb. */
.restricted-lock { width: 12px; height: 12px; margin-left: 4px; color: var(--color-muted); vertical-align: -1px; }
.restricted-chip { display: inline-flex; align-items: center; gap: 4px; font-size: var(--text-xs); color: var(--color-muted); }
.restricted-chip .i { width: 12px; height: 12px; }
.status-chip { flex: none; }
.ip-back { margin-right: var(--space-xs); }
.ip-bar { align-items: center; }

/* Link previews under user text */
.unfurls { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin: var(--space-sm) 0; }
.unfurl { display: flex; gap: var(--space-md); max-width: 460px; width: 100%; padding: var(--space-md); border: var(--rule); border-left: 3px solid var(--color-accent);
  border-radius: var(--radius-md); background: var(--color-paper-2); color: var(--color-ink-2); text-decoration: none; }
.unfurl:hover { background: var(--color-paper-3); }
.unfurl-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.unfurl-site { font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); text-transform: uppercase; letter-spacing: .04em; }
.unfurl b { color: var(--color-accent); font-size: var(--text-md); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.unfurl-desc { font-size: var(--text-sm); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.unfurl img { width: 88px; height: 88px; object-fit: cover; border-radius: var(--radius-sm); flex: none; }
.unfurl-img img { display: block; max-width: min(100%, 360px); max-height: 260px; border-radius: var(--radius-md); border: var(--rule); }

/* Summary: the completed tile lists what was finished */
.done-list { list-style: none; margin: var(--space-sm) 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.done-list a { display: flex; gap: var(--space-sm); align-items: center; color: var(--color-ink-2); text-decoration: none; font-size: var(--text-sm); }
.done-list a:hover { color: var(--color-accent); }
.done-list .mono { color: var(--color-muted); font-size: var(--text-xs); flex: none; }
.done-list .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chat-stage a.chat-file { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: var(--rule); border-radius: var(--radius-md);
  background: var(--color-paper-2); color: var(--color-ink); text-decoration: none; font-size: var(--text-sm); max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chat-stage a.chat-file::before { content: attr(data-kind); font: 500 var(--text-xs) var(--font-mono); text-transform: uppercase; color: var(--color-accent); }
.chat-stage .chat-msg[data-tick] .chat-msg__content--me .chat-msg__time::after, .chat-stage .chat-msg[data-tick] .chat-msg__time::after { margin-left: 4px; font: 600 var(--text-xs) var(--font-mono); color: var(--color-muted); }
.chat-stage .chat-msg[data-tick="1"] .chat-msg__time::after { content: "\2713"; }
.chat-stage .chat-msg[data-tick="2"] .chat-msg__time::after { content: "\2713\2713"; color: var(--color-accent); }

/* Chat: eBo's file tile under a message, and the message tools as hover icons in the message's top-right corner. */
.chat-stage .chat-tile { width: 200px; margin: 6px 0 2px; }
.chat-stage .chat-msg { position: relative; }
.chat-stage converse-message-actions { position: absolute; top: -10px; right: 12px; z-index: 2; }
.chat-stage .chat-msg__actions > button[data-toggle="dropdown"] { display: none !important; }
.chat-stage .chat-msg__actions .dropdown-menu { display: flex !important; position: static !important; transform: none !important; min-width: 0; padding: 2px; gap: 2px;
  border: var(--rule); border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transition: opacity .12s; }
.chat-stage .chat-msg:hover .chat-msg__actions .dropdown-menu, .chat-stage .chat-msg:focus-within .chat-msg__actions .dropdown-menu { opacity: 1; pointer-events: auto; }
.chat-stage button.chat-msg__action { font-size: 0; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--color-muted); }
.chat-stage button.chat-msg__action:hover { background: var(--color-paper-3); color: var(--color-ink); }
.chat-stage button.chat-msg__action-retract:hover { color: var(--color-danger); }
.chat-stage button.chat-msg__action .i { width: 19px; height: 19px; }
.chat-stage button.chat-msg__action converse-icon { font-size: 18px; }
.chat-stage converse-message-actions { top: -18px; }
@media (hover: none) { .chat-stage .chat-msg__actions .dropdown-menu { opacity: 1; pointer-events: auto; } }

/* Nothing in a conversation may be wider than the stage: a long link or file name in a direct message used to
   widen the message list and push the send button out of the box. */
.chat-stage .chatbox, .chat-stage .chatbox .flyout, .chat-stage .chat-body, .chat-stage .chat-content, .chat-stage converse-chat-content,
.chat-stage converse-message-form, .chat-stage .sendXMPPMessage, .chat-stage .chat-content__messages { min-width: 0; max-width: 100%; box-sizing: border-box; }
.chat-stage .chatbox { overflow: hidden; }
.chat-stage .chat-msg__content, .chat-stage .chat-msg__body, .chat-stage .chat-msg__message { min-width: 0; max-width: 100%; }
.chat-stage .chat-msg__text { overflow-wrap: anywhere; word-break: break-word; }
.chat-stage .chat-textarea { min-width: 0; }
/* Converse gives a direct message 15 px of left margin (room for its floating chat windows); here it overflowed. */
.chat-stage converse-chat, .chat-stage converse-muc { margin: 0 !important; }
.chat-stage .chatbox .flyout { left: 0 !important; right: 0 !important; width: auto !important; }
.chat-stage converse-message-actions, .chat-stage converse-message-actions converse-dropdown { width: max-content; display: block; }
.chat-stage button.chat-msg__action { flex: none; min-width: 36px; }
.chat-stage .chat-inline-img img { display: block; max-width: min(100%, 360px); max-height: 280px; margin-top: 4px; border-radius: var(--radius-md); border: var(--rule); }
.chat-stage .chat-msg__actions .dropdown-menu { flex-wrap: nowrap; width: max-content !important; }
.chat-stage .chat-msg__actions .dropdown-menu button.chat-msg__action { width: 36px !important; height: 36px !important; margin: 0 !important; padding: 0 !important; flex: 0 0 36px; }
/* Tools: centred on the message row, icons centred in their buttons. */
.chat-stage converse-message-actions { top: 50% !important; transform: translateY(-50%); }
.chat-stage .chat-msg__actions .dropdown-menu { align-items: center; }
.chat-stage .chat-msg__actions .dropdown-menu button.chat-msg__action { display: flex !important; align-items: center; justify-content: center; line-height: 0; }
.chat-stage button.chat-msg__action .i, .chat-stage button.chat-msg__action converse-icon { display: block; margin: 0 !important; }

/* ===== Sidebar fold, account menu, theme ===== */
.rail-top { gap: 4px; }
.rail-top .rail-fold { margin-left: auto; }
.rail-top .inbox-pop { order: 3; }
.who-pop { flex: 1; min-width: 0; }
.who-pop > summary { list-style: none; cursor: pointer; border-radius: var(--radius-md); padding: 4px; }
.who-pop > summary::-webkit-details-marker { display: none; }
.who-pop > summary:hover { background: var(--color-paper-3); }
.who-menu { bottom: calc(100% + 6px); top: auto; left: 0; min-width: 220px; }
.theme-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; }
.theme-pick button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border: var(--rule); border-radius: var(--radius-md); background: transparent; color: var(--color-ink-2); font-size: var(--text-xs); }
.theme-pick button[aria-pressed="true"] { border-color: var(--color-accent); background: var(--color-accent-soft); color: var(--color-ink); }
.theme-pick .i { width: 18px; height: 18px; }
.create-btn .rail-text { display: inline; }

@media (min-width: 721px) {
  .shell { transition: grid-template-columns var(--dur-med) var(--ease-in-out); }
  html.rail-mini .shell { grid-template-columns: 64px minmax(0, 1fr); }
  html.rail-mini .rail { padding: var(--space-md) 8px; align-items: center; overflow-x: hidden; }
  html.rail-mini .rail-top { flex-direction: column; padding: 0; }
  html.rail-mini .rail-top .rail-fold { margin: 0; order: 2; }
  /* The whole name fits in the 48px column once the side padding goes and the size drops a step. */
  html.rail-mini .wordmark { padding: 0; font-size: var(--text-lg); }
  html.rail-mini .rail-text, html.rail-mini .jump span, html.rail-mini .jump kbd,
  html.rail-mini .nav .label, html.rail-mini .nav a > span:not(.bchip), html.rail-mini .nav-n, html.rail-mini .nav-lock,
  html.rail-mini .who-text, html.rail-mini .nav .badge { display: none; }
  html.rail-mini .create-btn, html.rail-mini .jump { width: 40px; height: 36px; padding: 0; justify-content: center; display: grid; place-items: center; }
  html.rail-mini .nav { align-items: center; width: 100%; }
  html.rail-mini .nav a { width: 40px; height: 36px; padding: 0; justify-content: center; }
  html.rail-mini .nav a > .i { width: 18px; }
  html.rail-mini .nav a[aria-current="page"] { background: var(--color-accent-soft); border-radius: var(--radius-md); }
  html.rail-mini .nav a[aria-current="page"]::before { display: none; }
  html.rail-mini .rail-foot { flex-direction: column; padding-inline: 0; }
  html.rail-mini .who-pop > summary { padding: 2px; }
  html.rail-mini .who-menu { left: 0; }
}

/* Chat page: the lists and the conversation share one height, sized to the window by chat.js (--chat-h). */
.chat-wrap { --chat-h: calc(100dvh - 140px); }
.chat-side { max-height: var(--chat-h); }
.chat-stage { height: var(--chat-h); }
.chat-stage .chat-tile figcaption { min-width: 0; overflow: hidden; }
.chat-stage .chat-tile .file-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.who-menu { position: fixed !important; left: 12px !important; bottom: 64px !important; top: auto !important; z-index: 80; }
.app-cmd { white-space: pre-wrap; word-break: break-all; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-md); background: var(--color-paper-3); font-size: var(--text-xs); margin: 0; }
.consent { max-width: 560px; display: flex; flex-direction: column; gap: var(--space-md); }
.consent-actions { display: flex; gap: var(--space-sm); justify-content: flex-end; }

/* Status dialog: why a move needs an answer or was refused, with the items in the way. */
dialog.sdlg { border: var(--rule); border-radius: var(--radius-lg); padding: 0; width: min(520px, calc(100vw - 32px)); background: var(--color-surface); color: var(--color-ink-2); box-shadow: var(--shadow-pop); }
dialog.sdlg::backdrop { background: oklch(20% 0.02 258 / 0.35); }
.sdlg-body { display: flex; flex-direction: column; gap: var(--space-md); padding: var(--space-lg); }
.sdlg-body h2 { margin: 0; font: 600 var(--text-lg) var(--font-display); color: var(--color-ink); }
.sdlg-body p { margin: 0; }
.sdlg-body h3 { margin: var(--space-xs) 0 0; }
.sdlg-list { list-style: none; margin: 0; padding: 0; border: var(--rule); border-radius: var(--radius-md); }
.sdlg-list li { display: flex; align-items: center; gap: var(--space-sm); padding: 8px var(--space-md); border-bottom: var(--rule); }
.sdlg-list li:last-child { border-bottom: 0; }
.sdlg-list a { display: flex; align-items: center; gap: var(--space-sm); flex: 1; min-width: 0; color: var(--color-ink); text-decoration: none; }
.sdlg-list .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sdlg-list .mono { color: var(--color-muted); font-size: var(--text-xs); flex: none; }
.sdlg-list .chip { flex: none; }
.sdlg-actions { display: flex; justify-content: flex-end; gap: var(--space-sm); flex-wrap: wrap; margin-top: var(--space-xs); }
html.no-anim *, html.no-anim *::before { transition: none !important; }

/* Narrow windows: when fewer than four columns fit, they wrap onto new rows instead of scrolling sideways
   (app.js sets .is-wrapped). Each column then carries its own name; wide screens keep the one sideways scroll. */
.col-tag.wrap-only { display: none; }
.board-wrap.is-wrapped .col-tag.wrap-only { display: flex; }
.board-wrap.is-wrapped .board-header { display: none; }
.board-wrap.is-wrapped .board-cols { width: auto; flex-wrap: wrap; }
.board-wrap.is-wrapped .col { flex: 1 1 var(--colw); width: auto; max-height: none; border-top: var(--rule); border-radius: var(--radius-lg); }
.board-wrap.is-wrapped { overflow: visible; scroll-snap-type: none; }
.main:has(.board-wrap.is-wrapped) { height: auto; overflow: visible; }
.rail-live { display: contents; }

/* ===== Blocks, Applets, Embeds in docs ===== */
.blk { margin: var(--space-md) 0; padding: var(--space-md); border: var(--rule); border-radius: var(--radius-lg); background: var(--color-paper-2); font-size: var(--text-md); line-height: 1.45; }
.blk-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-md); margin-bottom: var(--space-sm); }
.blk-list, .blk-msgs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.blk-list li { display: flex; align-items: center; gap: var(--space-sm); padding: 6px 0; border-top: var(--rule); }
.blk-list li:first-child { border-top: 0; }
.blk-list a, .blk-item { display: flex; align-items: center; gap: var(--space-sm); flex: 1; min-width: 0; color: var(--color-ink); text-decoration: none; }
.blk-list .t, .blk-item b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blk-list .mono, .blk-item .mono { font-size: var(--text-xs); color: var(--color-muted); flex: none; }
.blk .overdue { color: var(--color-danger); }
.blk-item { flex-wrap: wrap; }
.blk-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--space-sm); }
.blk-sum a { display: flex; flex-direction: column; gap: 2px; padding: var(--space-sm); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-ink-2); text-decoration: none; }
.blk-sum b { font: 600 var(--text-xl) var(--font-display); color: var(--color-ink); }
.blk-msgs li { padding: 6px 0; border-top: var(--rule); } .blk-msgs li:first-child { border-top: 0; }
.blk-msgs .rich > :first-child { margin-top: 2px; } .blk-msgs .rich > :last-child { margin-bottom: 0; }
.blk-missing { padding: var(--space-sm) var(--space-md); border: 1px dashed var(--color-rule-strong); border-radius: var(--radius-md); color: var(--color-muted); font-size: var(--text-sm); }
figure.applet { margin: var(--space-md) 0; border: var(--rule); border-radius: var(--radius-lg); overflow: hidden; background: var(--color-surface); }
figure.applet iframe { display: block; width: 100%; height: 240px; border: 0; background: var(--color-surface); }
figure.applet figcaption { padding: 4px var(--space-md); border-top: var(--rule); font-size: var(--text-xs); color: var(--color-muted); }
.embed { margin: var(--space-md) 0; aspect-ratio: 16 / 9; max-width: 100%; border-radius: var(--radius-lg); overflow: hidden; border: var(--rule); }
.embed iframe { width: 100%; height: 100%; border: 0; }
.docs-insert { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; }
.insert-menu { min-width: 260px; max-height: 60vh; overflow: auto; }
.applet-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-lg); align-items: start; }
.applet-form { display: flex; flex-direction: column; gap: var(--space-md); }
.applet-form fieldset { display: contents; }
.applet-code { min-height: 420px; font-size: var(--text-sm); tab-size: 2; }
.applet-boards { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-left: 22px; }
.applet-side { display: flex; flex-direction: column; gap: var(--space-sm); }
.applet-ver { display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm); font-size: var(--text-sm); padding: 4px 0; }
.embed-sites { list-style: none; margin: 0 0 var(--space-md); padding: 0; }
.embed-sites li { display: flex; align-items: center; gap: var(--space-md); padding: 6px 0; border-top: var(--rule); }
.embed-sites li .mono { margin-left: auto; }
@media (max-width: 1000px) { .applet-grid { grid-template-columns: minmax(0, 1fr); } }
.docs-lib { display: flex; align-items: center; gap: 8px; margin-top: var(--space-md); padding: 6px var(--space-sm); font-size: var(--text-sm); color: var(--color-muted); border-top: var(--rule); }
.docs-lib:hover { color: var(--color-accent); }
.ask-dlg { width: min(440px, calc(100vw - 32px)); }
.ask-input { width: 100%; font-size: var(--text-md); }
.btn-danger { background: var(--color-danger); border-color: var(--color-danger); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }
.pick-list button { display: flex; align-items: center; gap: var(--space-sm); width: 100%; padding: 0; border: 0; background: none; color: var(--color-ink); text-align: left; cursor: pointer; }
.pick-list li:hover { background: var(--color-paper-2); }
.pick-list .file-badge { position: static; flex: none; }

.archived-boards { list-style: none; padding: 0; margin: 0; }
.archived-boards li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); padding: var(--space-sm) 0; border-top: var(--rule); }

/* <?> help: a small round "?" and a hover card styled like the person card (app.js). Never uppercase, even inside labels. */
.help-q { display: inline-grid; place-items: center; inline-size: 1.15rem; block-size: 1.15rem; padding: 0; margin-inline-start: var(--space-xs); border-radius: 50%; border: var(--rule); background: transparent; color: var(--color-muted); font: 600 var(--text-xs)/1 var(--font-body); text-transform: none; letter-spacing: 0; cursor: help; vertical-align: middle; }
.help-q:hover, .help-q:focus-visible { color: var(--color-accent); border-color: var(--color-accent); }
.help-card { position: fixed; z-index: 70; max-inline-size: min(300px, calc(100vw - 16px)); padding: var(--space-md) var(--space-lg); background: var(--color-surface); color: var(--color-ink); border: var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); font: 400 var(--text-sm)/1.5 var(--font-body); text-transform: none; letter-spacing: 0; }
.help-card p { margin: 0; }
.help-card a { display: inline-block; margin-block-start: var(--space-xs); color: var(--color-accent); font-weight: 600; }

/* eBo tour (tour.js on Driver.js, vendor/driver.css): the popover is themed here, .tour-pop is its class. */
.driver-overlay { opacity: 1 !important; }
.driver-overlay path { fill: var(--color-scrim) !important; }
.tour-clear .driver-overlay { opacity: 0 !important; }
.driver-popover.tour-pop { box-sizing: border-box; min-inline-size: min(20rem, calc(100vw - 24px)); max-inline-size: min(24rem, calc(100vw - 24px)); padding: var(--space-lg); background: var(--color-surface); color: var(--color-ink); border: var(--rule); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); font-family: var(--font-body); }
.driver-popover.tour-pop.tour-corner { inset: auto var(--space-lg) var(--space-lg) auto !important; transform: none !important; }
.tour-pop .driver-popover-title { font: 600 var(--text-xl)/1.25 var(--font-display); padding-inline-end: var(--space-xl); }
.tour-pop .driver-popover-description { font-size: var(--text-md); line-height: 1.5; max-block-size: min(62vh, 32rem); overflow: auto; margin-block-start: var(--space-sm); padding: var(--space-xs); margin-inline: calc(-1 * var(--space-xs)); }  /* the padding keeps a pressed button or a focus ring from overflowing: a scrollbar popping in moves the button from under the click */
.tour-pop .driver-popover-description p { margin: 0 0 var(--space-sm); }
.tour-pop .driver-popover-close-btn { inset-block-start: var(--space-sm); inset-inline-end: var(--space-sm); color: var(--color-muted); border-radius: var(--radius-sm); }
.tour-pop .driver-popover-close-btn:hover, .tour-pop .driver-popover-close-btn:focus-visible { color: var(--color-ink); }
.tour-pop .driver-popover-footer { margin-block-start: var(--space-md); gap: var(--space-sm); }
.tour-pop .driver-popover-progress-text { font: 500 var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); }
.tour-pop .driver-popover-navigation-btns { gap: var(--space-sm); }
.tour-pop .driver-popover-footer-btn { font: 500 var(--text-sm)/1 var(--font-body); padding: 8px 12px; color: var(--color-ink); background: var(--color-surface); border: var(--rule); border-radius: var(--radius-md); text-shadow: none; }
.tour-pop .driver-popover-footer-btn:hover, .tour-pop .driver-popover-footer-btn:focus-visible { background: var(--color-paper-3); }
.tour-pop .driver-popover-footer-btn:focus-visible, .tour-pop .driver-popover-close-btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.tour-pop .driver-popover-next-btn { background: var(--color-accent); color: var(--color-accent-ink); border-color: var(--color-accent); }
.tour-pop .driver-popover-next-btn:hover, .tour-pop .driver-popover-next-btn:focus-visible { background: var(--color-accent); filter: brightness(1.08); }
.tour-pop .driver-popover-arrow { border-color: var(--color-surface); }
.tour-pop .driver-popover-arrow-side-left { border-block-color: transparent; border-right-color: transparent; }
.tour-pop .driver-popover-arrow-side-right { border-block-color: transparent; border-left-color: transparent; }
.tour-pop .driver-popover-arrow-side-top { border-inline-color: transparent; border-bottom-color: transparent; }
.tour-pop .driver-popover-arrow-side-bottom { border-inline-color: transparent; border-top-color: transparent; }
.tour-apps { font-weight: 600; }
.tour-tick, .tour-wait { display: flex; align-items: center; gap: var(--space-sm); font-weight: 600; }
.tour-tick { color: var(--color-ok); }
.tour-wait { color: var(--color-muted); font-weight: 500; font-size: var(--text-sm); }
.tour-dot { flex: none; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--color-warn); animation: tour-pulse 1.6s var(--ease-in-out) infinite; }
@keyframes tour-pulse { 50% { opacity: .35; transform: scale(.7); } }
@media (prefers-reduced-motion: reduce) { .tour-dot { animation: none; } }
.tour-actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); margin-block-start: var(--space-sm); }
.tour-legend { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(8, auto); grid-auto-flow: column; gap: var(--space-xs) var(--space-md); margin: var(--space-sm) 0 0; }
.tour-legend > div { display: flex; align-items: center; gap: var(--space-sm); min-inline-size: 0; }
.tour-legend dt { display: flex; inline-size: 2.5rem; justify-content: center; flex: none; }
.tour-legend dd { margin: 0; font-size: var(--text-sm); }
.tour-pill { position: fixed; inset-block-end: var(--space-lg); inset-inline-end: var(--space-lg); z-index: 60; box-shadow: var(--shadow-pop); }
.tour-list { list-style: none; padding: 0; margin: 0; }
.tour-list li { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) 0; border-top: var(--rule); }
.tour-list .tour-check { inline-size: 1.25rem; color: var(--color-ok); }
.tour-list .tour-name { flex: 1; min-inline-size: 0; }
@media (max-width: 720px) {
  .tour-legend { grid-template-columns: 1fr; }
}

/* Doc pages read like a book within their set: Previous / Next under the text (docs.neighbours). */
.docs-pager { display: flex; gap: var(--space-md); margin-block: var(--space-xl); }
.docs-pager a { flex: 1; display: flex; flex-direction: column; gap: var(--space-2xs); padding: var(--space-md); border: var(--rule); border-radius: var(--radius-md); color: var(--color-ink); text-decoration: none; min-inline-size: 0; }
.docs-pager a:hover { border-color: var(--color-accent); }
.docs-pager .docs-next { text-align: end; margin-inline-start: auto; }
.tour-devices { display: flex; flex-direction: column; gap: var(--space-sm); margin-block-start: var(--space-sm); }
.tour-device-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
.tour-steps { margin: var(--space-sm) 0 0; padding-inline-start: var(--space-lg); display: flex; flex-direction: column; gap: var(--space-xs); font-size: var(--text-sm); }

/* ===== Summary counts and person filter, Reports tab, My work numbers (2026-11) ===== */
.sum-filter { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm) var(--space-md); margin-bottom: var(--space-lg); }
.counts { list-style: none; margin: var(--space-lg) 0 var(--space-md); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 110px), 1fr)); gap: var(--space-sm); }
.counts a { display: flex; flex-direction: column; gap: 2px; padding: var(--space-sm) var(--space-md); border: var(--rule); border-radius: var(--radius-md); color: var(--color-ink-2); text-decoration: none; font-size: var(--text-xs); }
.counts a:hover { border-color: var(--color-accent); }
.counts b { font: 600 var(--text-xl)/1.1 var(--font-display); color: var(--color-ink); font-variant-numeric: tabular-nums; }
.counts span:not(.muted) { font-size: var(--text-sm); font-weight: 500; color: var(--color-ink); }
.stack.thin { height: 8px; margin: var(--space-xs) 0 0; }
.epic-row { padding: var(--space-sm) 0; }
.epic-row + .epic-row { border-top: var(--rule); }
.epic-head { display: flex; align-items: center; gap: var(--space-sm); justify-content: space-between; min-width: 0; }
.epic-head a { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; color: var(--color-ink-2); text-decoration: none; font-size: var(--text-sm); }
.epic-head a:hover { color: var(--color-accent); }
.epic-head .mono { color: var(--color-muted); font-size: var(--text-xs); flex: none; }
.epic-head .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.epic-head > .small { flex: none; }
[data-panel="epics"] .legend { margin-top: var(--space-md); }

.rep-bar { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-sm) var(--space-md); margin-bottom: var(--space-lg); }
.chart { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "y plot" ". x" "lg lg"; column-gap: var(--space-sm); margin-top: var(--space-md); }
.chart-y { grid-area: y; display: flex; flex-direction: column; justify-content: space-between; font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); text-align: right; }
.chart-svg { grid-area: plot; display: block; width: 100%; height: 200px; border-bottom: 1px solid var(--color-rule-strong); overflow: visible; }
.chart-x { grid-area: x; display: flex; justify-content: space-between; font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); padding-top: 4px; }
.chart .legend { grid-area: lg; margin-top: var(--space-md); }
.chart-svg .grid { stroke: var(--color-rule); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .band { stroke: var(--color-surface); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-svg rect:hover, .chart-svg .band:hover { opacity: .85; }
.fill-backlog { fill: var(--color-cat-backlog); } .fill-todo { fill: var(--color-cat-todo); } .fill-active { fill: var(--color-cat-active); }
.fill-waiting { fill: var(--color-cat-waiting); } .fill-review { fill: var(--color-cat-review); } .fill-done { fill: var(--color-cat-done); }
.fill-created { fill: var(--color-cat-todo); } .fill-lead { fill: var(--color-accent); }
.dot.fill-created { background: var(--color-cat-todo); }
.lg-toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 2px 4px; border: 0; background: none; color: var(--color-ink-2); font: inherit; font-size: var(--text-sm); cursor: pointer; border-radius: var(--radius-sm); text-align: left; }
.lg-toggle:hover { background: var(--color-paper-2); }
.lg-toggle[aria-pressed="false"] { color: var(--color-muted); text-decoration: line-through; }
.lg-toggle[aria-pressed="false"] .dot { opacity: .3; }
.lg-toggle b { margin-left: auto; font-family: var(--font-mono); color: var(--color-ink); }
.chart-legend li { display: block; }
.note { color: var(--color-muted); margin: var(--space-md) 0 0; }
.how { margin-top: var(--space-sm); font-size: var(--text-sm); }
.how summary { cursor: pointer; color: var(--color-accent); width: fit-content; }
.how p { margin: var(--space-xs) 0 0; color: var(--color-ink-2); max-width: 70ch; }
.how .table-wrap { max-height: 320px; overflow: auto; margin-top: var(--space-sm); }
.empty-note { color: var(--color-muted); margin: var(--space-md) 0 0; }
.rep-table { width: 100%; min-width: 0; border-collapse: collapse; }
.rep-table th { text-align: left; font: 500 var(--text-xs)/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; color: var(--color-muted); background: transparent; border-bottom: var(--rule); }
.rep-table td { border-bottom: var(--rule); vertical-align: middle; }
.rep-table tbody tr:last-child td { border-bottom: 0; }
.rep-table .right { text-align: right; }
.rep-table th, .rep-table td { padding: 6px 8px; }
.rep-table .person { display: flex; align-items: center; gap: 8px; color: var(--color-ink-2); text-decoration: none; }
.rep-table .person:hover { color: var(--color-accent); }
.rep-table td:first-child { width: 100%; max-width: 0; }
.rep-table .person > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rep-table th { letter-spacing: 0; white-space: nowrap; }
.rep-table th .dot { display: none; }
.tis { list-style: none; margin: var(--space-md) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-sm); }
.tis li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "dot label n" ". note note"; align-items: center; column-gap: var(--space-sm); padding: var(--space-sm) 0; border-bottom: var(--rule); }
.tis li:last-child { border-bottom: 0; }
.tis .dot { grid-area: dot; } .tis-label { grid-area: label; font-weight: 500; } .tis-n { grid-area: n; font: 600 var(--text-xl)/1.1 var(--font-display); color: var(--color-ink); }
.tis-n small { font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); }
.tis li > .small { grid-area: note; }
.is-danger { color: var(--color-danger); }

.numbers { list-style: none; margin: 0 0 var(--space-lg); padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: var(--space-sm); }
.numbers a { display: flex; align-items: baseline; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-ink-2); text-decoration: none; font-size: var(--text-sm); }
.numbers a:hover { border-color: var(--color-accent); }
.numbers b { font: 600 var(--text-xl)/1.1 var(--font-display); color: var(--color-ink); font-variant-numeric: tabular-nums; }
.numbers a.is-danger b { color: var(--color-danger); }
.mw-panels { margin-top: var(--space-xl); }
.mw-board { display: flex; align-items: center; gap: var(--space-sm); color: var(--color-ink-2); text-decoration: none; min-width: 0; }
.mw-board:hover { color: var(--color-accent); }
.narrowed { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs) var(--space-sm); margin: 0 0 var(--space-md); color: var(--color-muted); }
.narrowed a { color: var(--color-accent); }
@media (max-width: 720px) {
  .numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .chart-svg { height: 160px; }
}
/* Stage names as dots until the table is wide enough for words and the Doer's name (two panels share the row up to here). */
@media (max-width: 1500px) {
  .rep-table th .dot { display: inline-block; }
  .rep-table th .rep-th { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

/* Rich text extras (rich filter + the "Rich text extras" block in app.js): math, diagrams, code boxes, tabsets,
   Wiki.js classes ({.dense}, {.grid-list}, {.links-list}, {.align-*}, {.is-info} callouts), footnotes, kbd. */
.rich .math-d { display: block; margin: var(--space-md) 0; overflow-x: auto; overflow-y: hidden; text-align: center; }
.rich .mermaid-d { margin: var(--space-md) 0; overflow-x: auto; }
.rich .mermaid-d svg { max-width: 100%; height: auto; }
.rich pre.is-bad { border: 1px solid var(--color-danger); }
.rich .code-box { margin: var(--space-md) 0; border: var(--rule); border-radius: var(--radius-md); background: var(--color-paper-3); overflow: hidden; }
.rich .code-box pre { margin: 0; border-radius: 0; font-size: var(--text-sm); line-height: 1.55; }
.rich .code-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: 4px 6px 4px var(--space-md); border-bottom: var(--rule); background: var(--color-paper-2); }
.rich .code-lang { font: 500 var(--text-xs) var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--color-muted); }
.rich .code-copy { font-size: var(--text-xs); }
.rich .hljs-keyword, .rich .hljs-selector-tag, .rich .hljs-built_in, .rich .hljs-literal { color: var(--color-cat-review); }
.rich .hljs-string, .rich .hljs-attr, .rich .hljs-addition, .rich .hljs-template-variable { color: var(--color-ok); }
.rich .hljs-number, .rich .hljs-variable, .rich .hljs-params { color: var(--color-p2); }
.rich .hljs-title, .rich .hljs-section, .rich .hljs-name, .rich .hljs-type { color: var(--color-accent); }
.rich .hljs-comment, .rich .hljs-quote, .rich .hljs-meta { color: var(--color-muted); font-style: italic; }
.rich .hljs-deletion { color: var(--color-danger); }
.rich kbd { display: inline-block; padding: 0 6px; font: 500 .85em var(--font-mono); border: 1px solid var(--color-rule-strong); border-bottom-width: 2px; border-radius: var(--radius-sm); background: var(--color-paper-2); color: var(--color-ink); }
.rich mark { background: color-mix(in oklch, var(--color-warn) 35%, transparent); color: inherit; padding: 0 2px; border-radius: 2px; }
.rich abbr[title] { text-decoration: underline dotted; cursor: help; }
.rich details { margin: var(--space-sm) 0; padding: var(--space-sm) var(--space-md); border: var(--rule); border-radius: var(--radius-md); }
.rich details > summary { cursor: pointer; color: var(--color-ink); }
.rich details[open] > summary { margin-bottom: var(--space-sm); }
.rich blockquote[class*="is-"] { border-left: 4px solid var(--callout); background: color-mix(in oklch, var(--callout) 12%, transparent); padding: var(--space-sm) var(--space-md); border-radius: 0 var(--radius-md) var(--radius-md) 0; color: var(--color-ink); }
.rich blockquote.is-info { --callout: var(--color-accent); }
.rich blockquote.is-success { --callout: var(--color-ok); }
.rich blockquote.is-warning { --callout: var(--color-warn); }
.rich blockquote.is-danger { --callout: var(--color-danger); }
.rich blockquote[class*="is-"] > :first-child { margin-top: 0; } .rich blockquote[class*="is-"] > :last-child { margin-bottom: 0; }
.rich table.dense th, .rich table.dense td { padding: 2px 8px; font-size: var(--text-sm); }
.rich ul.grid-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-sm); }
.rich ul.grid-list > li { padding: var(--space-sm) var(--space-md); border: var(--rule); border-radius: var(--radius-md); background: var(--color-paper-2); }
.rich ul.links-list { list-style: none; padding: 0; }
.rich ul.links-list > li { border: var(--rule); border-radius: var(--radius-md); margin: 0 0 var(--space-sm); }
.rich ul.links-list > li > a { display: block; padding: var(--space-sm) var(--space-md); color: var(--color-ink); font-weight: 500; }
.rich ul.links-list > li > a:hover { background: var(--color-paper-2); }
.rich ul.links-list > li em { display: block; font-style: normal; font-weight: 400; font-size: var(--text-sm); color: var(--color-muted); }
.rich img.align-right { float: right; margin: 0 0 var(--space-md) var(--space-md); max-width: 50%; }
.rich img.align-left { float: left; margin: 0 var(--space-md) var(--space-md) 0; max-width: 50%; }
.rich img.align-center { margin-left: auto; margin-right: auto; }
.rich img[width] { height: auto; }
.rich .footnote { margin-top: var(--space-lg); font-size: var(--text-sm); color: var(--color-muted); clear: both; }
.rich .footnote-ref, .rich .footnote-backref { text-decoration: none; }
.rich .tabset-box { margin: var(--space-md) 0; border: var(--rule); border-radius: var(--radius-md); overflow: hidden; }
.rich .tabset-bar { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 4px 0; background: var(--color-paper-2); border-bottom: var(--rule); }
.rich .tabset-bar > button { border: 0; background: transparent; padding: 6px 12px; font-size: var(--text-sm); color: var(--color-ink-2); border-bottom: 2px solid transparent; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.rich .tabset-bar > button[aria-selected="true"] { color: var(--color-accent); border-bottom-color: var(--color-accent); }
.rich .tabset-pane { padding: var(--space-sm) var(--space-md); }
.md-bar details.pop { display: inline-block; }
.md-bar .md-btn { list-style: none; padding: 4px 8px; font-size: var(--text-xs); color: var(--color-ink-2); border-radius: var(--radius-sm); cursor: pointer; }
.md-bar .md-btn::-webkit-details-marker { display: none; }
.md-bar .md-btn:hover { background: var(--color-paper-3); color: var(--color-ink); }
.md-bar .md-preview { margin-left: auto; }
.md-bar .md-preview[aria-pressed="true"] { background: var(--color-accent-soft); color: var(--color-accent); }
.md-bar.is-previewing > :not(.md-preview):not(.md-sep) { opacity: .4; pointer-events: none; }
.md-preview-box { min-height: 12rem; padding: var(--space-md); border: 1px solid var(--color-rule-strong); border-top: 0; border-radius: 0 0 var(--radius-md) var(--radius-md); }
@media (max-width: 720px) { .rich img.align-right, .rich img.align-left { float: none; max-width: 100%; margin: var(--space-md) 0; } }
.rich pre, .rich code, .md-bar ~ textarea { font-variant-ligatures: none; }   /* show --> and ``` as typed */
.rich table.dense { margin-bottom: var(--space-md); }
/* Long pages: the docs editor's toolbar stays at the top while you scroll the text. */
.docs-edit .docs-insert { position: sticky; top: 0; z-index: 5; display: block; background: var(--color-surface); margin-bottom: calc(-1 * var(--space-sm)); }   /* sits flush on the text box */
.docs-edit .docs-insert .md-bar { width: 100%; }
.docs-edit .docs-insert + textarea, .docs-edit .docs-insert + textarea + .md-preview-box { border-top-left-radius: 0; border-top-right-radius: 0; }
.md-bar > .is-over { display: none !important; }
.md-bar { flex-wrap: wrap; }
.md-more .menu { max-height: min(60vh, 420px); overflow-y: auto; }

/* Intake forms (forms.py) */
.subs { display: grid; gap: var(--space-sm); }
.sub { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: var(--space-lg); padding: var(--space-md) var(--space-lg);
  border: var(--rule); border-radius: var(--radius-md); background: var(--color-surface); }
.sub-main { display: grid; gap: var(--space-sm); min-width: 0; }
.sub-title { margin: 0; font: 600 var(--text-md)/1.35 var(--font-body); overflow-wrap: anywhere; }
.sub-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px var(--space-md); align-items: center; color: var(--color-muted); font-size: var(--text-xs); }
.sub-reason { margin: 0; color: var(--color-danger); font-size: var(--text-sm); }
.sub-rejected { opacity: .7; }
.sub-actions { display: grid; gap: var(--space-sm); align-content: start; }
.sub-accept { display: grid; gap: 4px; }
.sub-accept-row { display: flex; gap: 6px; }
.sub-accept-row select { flex: 1; min-width: 0; }
.sub-reject summary { list-style: none; width: 100%; justify-content: center; }
.sub-reject summary::-webkit-details-marker { display: none; }
.sub-reject[open] summary { display: none; }
.sub-reject form { display: flex; gap: 6px; }
.sub-reject input { flex: 1; min-width: 0; }
@media (max-width: 640px) { .sub { grid-template-columns: 1fr; } }
form.inline { display: inline-flex; gap: 6px; align-items: center; }
.answers { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 4px var(--space-md); margin: 0; font-size: var(--text-sm); }
.answers dt { color: var(--color-muted); }
.answers dd { margin: 0; overflow-wrap: anywhere; }
.reporter-form { display: block; font-size: var(--text-sm); }
.opt { display: flex; gap: 6px; align-items: baseline; }
fieldset.field { border: 0; padding: 0; margin: 0; }
.formpage { max-width: 640px; margin: 0 auto; padding: var(--space-2xl) 16px; display: grid; gap: var(--space-lg); }
.formpage-form { display: grid; gap: var(--space-lg); }
.formpage textarea, .formpage input:not([type=radio]):not([type=checkbox]) { width: 100%; }
.field-error { color: var(--color-danger); font-size: var(--text-sm); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-list { list-style: none; margin: 0; padding: 0; display: grid; }
.form-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--space-sm) var(--space-lg); padding: var(--space-md) 0; border-top: var(--rule); }
.form-list li:first-child { border-top: 0; }
.fl-main { display: grid; gap: 2px; }
.fl-name { font-weight: 600; }
.fl-actions { display: flex; gap: 6px; }
.resp-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-sm) var(--space-lg); margin-bottom: var(--space-lg); }
.resp-head h2 { margin: 0; font: 600 var(--text-lg)/1.3 var(--font-display); }
.resp-links { margin-left: auto; display: flex; gap: 6px; }
.tallies { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-lg); }
.tally h3 { margin: 0 0 var(--space-sm); font-size: var(--text-sm); }
.tally ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tally li { display: grid; grid-template-columns: 7em minmax(0, 1fr) 2em; gap: var(--space-sm); align-items: center; font-size: var(--text-sm); }
.tally-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tally-bar { height: 6px; border-radius: 3px; background: var(--color-paper-3); overflow: hidden; }
.tally-bar span { display: block; height: 100%; background: var(--color-accent); }
.tally b { text-align: right; }
.resp-table td { vertical-align: top; }
.resp-table .nowrap { white-space: nowrap; }
.resp-text { min-width: 18em; max-width: 36em; }
.resp-from { min-width: 9em; } .resp-from > * { display: block; }
.resp-actions { display: flex; gap: 4px; align-items: center; }
.fb { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-xl); align-items: start; max-width: 1100px; }
.fb-main { display: grid; gap: var(--space-md); min-width: 0; }
.fb-intro { display: grid; gap: var(--space-sm); }
.fb-name { font: 600 var(--text-lg)/1.3 var(--font-display); border-color: transparent; background: transparent; padding: 4px 0; }
.fb-name:focus { border-color: var(--color-accent); padding: 4px 8px; }
.fb-qs { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); counter-reset: q; }
.fb-q { display: grid; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); counter-increment: q; }
.fb-q-top { display: flex; gap: var(--space-sm); align-items: center; }
.fb-q-top input { flex: 1; min-width: 0; }
.fb-q-top select { width: 9.5em; }
.fb-num::before { content: counter(q); font: 600 var(--text-xs)/1 var(--font-mono); color: var(--color-muted); display: inline-block; width: 1.6em; }
.fb-q[data-kind="text"] .fb-choices { display: none; }
.fb-choices { margin-left: 1.6em; }
.fb-q-foot { display: flex; justify-content: space-between; align-items: center; margin-left: 1.6em; }
.fb-q-foot .btn-ghost { padding: 4px 8px; }
.fb-add { justify-self: start; }
.fb-side { display: grid; gap: var(--space-md); position: sticky; top: var(--space-lg); }
.fb-side .panel { display: grid; gap: var(--space-md); }
.fb-side h2 { margin: 0; font-size: var(--text-sm); }
.fb-dest { display: grid; gap: 6px; }
.fb-card { display: flex; gap: var(--space-sm); align-items: flex-start; padding: var(--space-sm); border: var(--rule); border-radius: var(--radius-md); cursor: pointer; }
.fb-card > span { display: grid; gap: 2px; }
.fb-card:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.fb-link { display: flex; gap: 6px; }
.fb-link input { flex: 1; min-width: 0; font: var(--text-xs) var(--font-mono); }
.fb-save { display: flex; gap: var(--space-sm); justify-content: space-between; }
@media (max-width: 900px) { .fb { grid-template-columns: 1fr; } .fb-side { position: static; } }
.formpage { gap: var(--space-md); }
.formpage-brand { margin: 0; display: flex; gap: var(--space-sm); align-items: baseline; }
.formpage-card { border: var(--rule); border-radius: var(--radius-lg); background: var(--color-surface); padding: var(--space-xl); display: grid; gap: var(--space-md); }
.formpage-card h1 { margin: 0; font: 600 var(--text-2xl)/1.2 var(--font-display); }
.fq { display: grid; gap: var(--space-sm); }
.fq-label { font: 500 var(--text-md)/1.4 var(--font-body); color: var(--color-ink); padding: 0; }
.fq-req { color: var(--color-danger); }
.fq-opt { display: flex; gap: var(--space-sm); align-items: center; padding: var(--space-sm) var(--space-md); border: var(--rule); border-radius: var(--radius-md); cursor: pointer; }
.fq-opt:has(input:checked) { border-color: var(--color-accent); background: var(--color-accent-soft); }
.fq-send { display: flex; justify-content: flex-end; }
.fq-send .btn { padding: 10px 24px; }

/* ===== Epics on the board (2026-11): epic cards, the epic strip, epic lane headers, checklist progress ===== */
.run { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px; font: 500 var(--text-xs)/1.3 var(--font-mono); color: var(--color-muted); }
.run-bar { flex: 1 1 60px; min-width: 40px; height: 6px; border-radius: 999px; background: var(--color-paper-3); overflow: hidden; display: block; }
.run-bar i { display: block; height: 100%; border-radius: inherit; background: var(--color-kind-epic); }
.run-text { white-space: nowrap; }
.run-blocked { font-weight: 600; color: var(--color-danger); }
.card.is-epic { border-left: 3px solid var(--color-kind-epic); }
.runs { display: flex; gap: var(--space-sm); overflow-x: auto; padding: 2px 2px var(--space-sm); margin-bottom: var(--space-sm); }
.run-card { position: relative; flex: 0 0 auto; width: 240px; max-width: 80vw; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border: 1px solid var(--color-rule);
  border-left: 3px solid var(--color-kind-epic); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-ink); text-decoration: none; }
.run-card:hover { border-color: var(--color-rule-strong); border-left-color: var(--color-kind-epic); }
.run-card.is-on { background: color-mix(in oklch, var(--color-kind-epic) 14%, var(--color-surface)); border-color: var(--color-kind-epic); }
.run-name { display: flex; align-items: center; gap: 6px; font-weight: 600; font-size: var(--text-sm); min-width: 0; }
.run-name .mono { font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); flex: none; }
.run-card .run { margin-top: 2px; }
.lane-head a { color: inherit; text-decoration: none; }
.lane-head a:hover b { text-decoration: underline; }
.lane-head .run { margin: 0; min-width: 160px; }
.lane-head .lane-status .sel-btn { padding: 2px 10px; font-size: var(--text-xs); }
.chkprog { display: inline-flex; align-items: center; gap: 3px; font: 500 var(--text-xs)/1 var(--font-mono); color: var(--color-muted); white-space: nowrap; }
.chkprog .i { width: 12px; height: 12px; }
.chkprog.is-all { color: var(--color-ok); }
.chk-bar { margin: -4px 0 var(--space-sm); max-width: 240px; }
.chk-bar i { background: var(--color-accent); }
.chk-bar.is-all i { background: var(--color-ok); }
.sel-btn .kind, .sel-menu .kind { width: 14px; height: 14px; }
.run-name a { color: inherit; text-decoration: none; position: relative; z-index: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.run-name a:hover { text-decoration: underline; }
.run-focus { color: inherit; text-decoration: none; }
.run-focus::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.run-focus:focus-visible { outline: none; }
.run-card:has(.run-focus:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* Child work items as a table (epic and parent item view), editable in place like Jira's. */
.kid-bar { display: flex; height: 6px; border-radius: 999px; background: var(--color-paper-3); overflow: hidden; margin: 0 0 var(--space-sm); }
.kid-bar i { display: block; height: 100%; }
.kid-bar .is-done { background: var(--color-ok); }
.kid-bar .is-doing { background: var(--color-accent); }
.kid-wrap { overflow-x: auto; }
table.kids { min-width: 0; width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
.kids th { text-align: left; font: 500 var(--text-xs) var(--font-mono); text-transform: uppercase; letter-spacing: .03em; color: var(--color-muted); padding: 6px 8px; border-bottom: var(--rule); }
.kids td { padding: 4px 8px; border-bottom: var(--rule); vertical-align: middle; }
.kids tr:hover td { background: var(--color-paper-2); }
.kids .kid-work { width: 100%; }
.kids .kid-work > * { vertical-align: middle; }
.kids .kid-work a[data-modal] { color: var(--color-ink); text-decoration: none; margin-left: 6px; }
.kids .kid-work a[data-modal]:hover .sub-title { text-decoration: underline; }
.kids .key { font: 500 var(--text-xs) var(--font-mono); color: var(--color-muted); margin-right: 4px; }
.kids .sub-title { white-space: normal; overflow: visible; overflow-wrap: anywhere; }
.kids tr.is-done .sub-title { color: var(--color-muted); text-decoration: line-through; }
.kids td:not(.kid-work) { white-space: nowrap; }
.kids .kid-doer .av { width: 22px; height: 22px; }
.kids .kid-block { display: inline-block; opacity: 0; }
.kids tr:hover .kid-block, .kids .kid-block[open], .kids .kid-block:focus-within { opacity: 1; }
@media (hover: none) { .kids .kid-block { opacity: 1; } }
.kids .sel.is-pill .sel-btn { padding: 3px 10px; font-size: var(--text-xs); }

/* A titled lane's own column header looks like the board's header row, and folds only that lane's column. */
.col-tag.is-lane { gap: 6px; padding: 8px 10px; }
.col-tag.is-lane .colname { flex: 0 1 auto; }
.col-tag.is-lane .count { margin-right: auto; }
.col.is-collapsed > .col-tag.is-lane { display: flex; flex-direction: column; align-items: center; padding: 8px 0; }
.col.is-collapsed > .col-tag.is-lane > :not(.dot):not([data-collapse]) { display: none; }
/* Fold and unfold slide the width. */
.colhead, .board-wrap .col { transition: width var(--dur-med) var(--ease-out); }
@media (prefers-reduced-motion: reduce) { .colhead, .board-wrap .col { transition: none; } }

/* Cards: priority and people open small menus to change them in place. */
.card-pick > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; border-radius: var(--radius-sm); padding: 2px; }
.card-pick > summary::-webkit-details-marker { display: none; }
.card-pick > summary:hover { background: var(--color-paper-3); }
.card-pick .menu button { display: flex; align-items: center; gap: 8px; width: 100%; }
.card-pick .menu button[aria-current="true"] { font-weight: 600; }
.card-pick .menu .av { width: 20px; height: 20px; font-size: 9px; }
.card-pick .pick-on { margin-left: auto; color: var(--color-accent); }
.av.av-none { display: inline-grid; place-items: center; background: var(--color-paper-3); color: var(--color-muted); border: 1px dashed var(--color-rule-strong); }
.av.av-none .i { width: 12px; height: 12px; }

/* Subtasks whose parent is in the same column sit right under its card, indented and tied to it by a line. */
.card.is-attached { margin-left: 18px; position: relative; overflow: visible; }
.card.is-attached::before { content: ""; position: absolute; left: -11px; top: calc(-1 * var(--space-sm)); bottom: 50%; width: 8px;
  border-left: 2px solid var(--color-muted); border-bottom: 2px solid var(--color-muted); border-bottom-left-radius: 6px; }
/* With several attached subtasks the line runs on past each card's elbow down to the next one. */
.card.is-attached:has(+ .card.is-attached)::after { content: ""; position: absolute; left: -11px; top: 50%; bottom: calc(-1 * var(--space-sm)); border-left: 2px solid var(--color-muted); }

/* ===== Motion (2026-11): page changes, tabs and menus ease in instead of snapping. ===== */
/* Page to page (same origin): the sidebar stays put, the page content fades and rises a little. Browsers without
   cross-document view transitions just navigate as before. */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .rail { view-transition-name: rail; }
  .main { view-transition-name: page; }
  /* The page header (title, tabs) holds still: switching tabs or Standup steps only moves the content below. */
  .pagehead { view-transition-name: pagehead; }
  /* No cross-fade: the old page is gone at once and only the new one fades in, so the two never show on top of
     each other (that overlap looked like a screen not cleared before redrawing). */
  ::view-transition-group(rail), ::view-transition-group(page), ::view-transition-group(root), ::view-transition-group(pagehead) { animation: none; }
  ::view-transition-old(page), ::view-transition-old(root), ::view-transition-old(pagehead) { animation: none; opacity: 0; }
  ::view-transition-new(pagehead) { animation: none; }
  ::view-transition-new(root) { animation: none; }
  ::view-transition-new(page) { animation: page-in 200ms var(--ease-out) both; }
}
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
/* Activity tabs in an item, popover menus and themed dropdowns. */
@media (prefers-reduced-motion: no-preference) {
  [data-pane] { transition: opacity var(--dur-med) var(--ease-out); }
  @starting-style { [data-pane] { opacity: 0; } }
  details.pop[open] > .menu, .sel-menu { animation: menu-in var(--dur-fast) var(--ease-out); }
  .ptabs a, .ip-activity [data-tab] { transition: color var(--dur-fast), background-color var(--dur-fast), border-color var(--dur-fast); }
}
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } }

/* Timeline: an epic without its own dates is a soft band behind its row and its items (timeline.js rollUp). */
.tl-band { position: absolute; z-index: 1; border-radius: 6px; background: color-mix(in oklch, var(--color-kind-epic) 12%, transparent);
  border: 1px solid color-mix(in oklch, var(--color-kind-epic) 35%, transparent); }
.tl-band:hover { background: color-mix(in oklch, var(--color-kind-epic) 20%, transparent); }
/* List: in the default order children sit under their parent, indented one step per level. */
.jlist td.work[style*="--depth"] .work-in { padding-left: calc(var(--depth) * 20px); position: relative; }
.jlist td.work[style*="--depth"] .work-in::before { content: ""; position: absolute; left: calc(var(--depth) * 20px - 12px); top: -2px; width: 8px; height: 10px;
  border-left: 2px solid var(--color-rule-strong); border-bottom: 2px solid var(--color-rule-strong); border-bottom-left-radius: 4px; }

/* Epic strip cards are board cards (2026-11-14): same surface, title and meta row, plus the epic's progress bar. */
.runs { gap: var(--space-md); align-items: stretch; padding: 2px 2px var(--space-sm); }
.card.run-card { width: 260px; flex: 0 0 auto; display: flex; flex-direction: column; gap: 8px; position: relative; cursor: default;
  border-left: 3px solid var(--color-kind-epic); background: var(--color-surface); }
.card.run-card:hover { border-color: var(--color-rule-strong); border-left-color: var(--color-kind-epic); box-shadow: 0 2px 8px oklch(20% 0.02 258 / 0.08); }
.card.run-card.is-on { background: color-mix(in oklch, var(--color-kind-epic) 8%, var(--color-surface)); border-color: color-mix(in oklch, var(--color-kind-epic) 45%, transparent); border-left-color: var(--color-kind-epic); }
.run-card .card-head { display: flex; align-items: flex-start; gap: 6px; }
.run-card .rc-title { position: relative; z-index: 1; color: var(--color-ink); text-decoration: none; flex: 1; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.run-card .rc-title:hover { text-decoration: underline; }
.rc-on { flex: none; font: 600 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .04em; color: var(--color-kind-epic);
  background: color-mix(in oklch, var(--color-kind-epic) 16%, transparent); padding: 3px 6px; border-radius: 999px; }
.run-card > .run-bar { flex: none; width: 100%; height: 5px; }
.run-card .card-meta { margin-top: auto; color: inherit; text-decoration: none; }
.run-card .run-focus::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.rc-blocked { display: inline-flex; align-items: center; gap: 3px; font: 600 var(--text-xs)/1 var(--font-mono); color: var(--color-danger);
  background: var(--color-danger-soft); padding: 3px 6px; border-radius: var(--radius-sm); }
.rc-blocked .i { width: 11px; height: 11px; }

/* Hover tips ([data-tip], app.js): a small dark box, first line bold, one line per entry. */
.tip { position: fixed; z-index: 120; max-width: 320px; display: flex; flex-direction: column; gap: 2px; padding: 7px 10px; border-radius: var(--radius-md);
  background: var(--color-ink); color: var(--color-paper); font: 500 var(--text-xs)/1.4 var(--font-body); box-shadow: 0 4px 14px oklch(20% 0.02 258 / 0.25); pointer-events: none; }
.tip b { font-weight: 600; }
.tip span { opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (prefers-reduced-motion: no-preference) { .tip { animation: menu-in var(--dur-fast) var(--ease-out); } }
/* Blocked chip on cards. */
.card-blocked { display: inline-flex; align-items: center; gap: 3px; font: 600 var(--text-xs)/1 var(--font-mono); color: var(--color-danger); background: var(--color-danger-soft); padding: 3px 5px; border-radius: var(--radius-sm); }
.card-blocked .i { width: 11px; height: 11px; }

/* People pickers show avatars in their menus. */
.sel-menu li .av { width: 20px; height: 20px; font-size: 9px; flex: none; }
/* Card meta row: menus as tall as the other icons, so everything sits on one centre line. */
.card-pick { display: inline-flex; align-items: center; }
.card-pick > summary { height: 24px; padding: 0 2px; }
.card-pick .people { display: inline-flex; align-items: center; }
.card .card-left, .card .card-right { display: flex; align-items: center; }
/* Status pills in the child items table share one width. */
.kids .sel.is-pill .sel-btn { min-width: 104px; }

/* A column tall enough to scroll got a scrollbar only in that column, so its cards were narrower than the rest and
   their meta rows wrapped. Every column keeps the same thin gutter instead. */
.board-wrap .col .cards { scrollbar-gutter: stable; scrollbar-width: thin; }
.board-wrap { --colw: 288px; }
/* Epic strip cards: the icons sit above the card-wide click area, so their hover tips work. */
.run-card .card-meta [data-tip] { position: relative; z-index: 1; cursor: default; }
.card .card-meta { column-gap: 6px; }
.card .card-left, .card .card-right { gap: 6px; }

/* Child items table: an epic's items show their subtasks nested under them, like the List. */
.kids tr.is-nested .kid-work { padding-left: calc(8px + var(--depth) * 22px); position: relative; }
.kids tr.is-nested .kid-work::before { content: ""; position: absolute; left: calc(var(--depth) * 22px - 6px); top: 0; width: 8px; height: 50%;
  border-left: 2px solid var(--color-rule-strong); border-bottom: 2px solid var(--color-rule-strong); border-bottom-left-radius: 4px; }
.epic-people { gap: 4px; }
.epic-people .person { padding: 0; }

/* Tree lines (2026-11-14 fix): a subtask with another one below it gets a straight junction (the trunk runs on);
   only the last one gets the rounded elbow. Same in the child items table. */
.card.is-attached:has(+ .card.is-attached)::before { border-bottom-left-radius: 0; }
.kids tr.is-nested:has(+ tr.is-nested) .kid-work::before { border-bottom-left-radius: 0; }
.kids tr.is-nested:has(+ tr.is-nested) .kid-work::after { content: ""; position: absolute; left: calc(var(--depth) * 22px - 6px); top: 50%; bottom: 0;
  border-left: 2px solid var(--color-rule-strong); }
.kids tr.is-nested .kid-work::before { top: 0; }
.app-guide { margin: var(--space-sm) 0 var(--space-md); }
.chat-new .row-btns { display: flex; flex-wrap: wrap; gap: var(--space-xs, 6px); }
kbd.kbd-i { display: inline-flex; align-items: center; padding: 1px 3px; }
kbd.kbd-i .i { width: 12px; height: 12px; }

/* Nextcloud picker and files */
.nc-dlg { width: min(560px, calc(100vw - 2 * 16px)); max-height: 80vh; padding: 16px; border: 1px solid var(--color-rule); border-radius: var(--radius-lg); background: var(--color-surface); color: var(--color-ink); }
.nc-dlg::backdrop { background: rgb(0 0 0 / .4); }
.nc-dlg-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.nc-dlg-head h3 { margin: 0; }
.nc-crumbs { font-size: var(--text-sm); margin-bottom: var(--space-sm); overflow-wrap: anywhere; }
.nc-list { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow: auto; border: 1px solid var(--color-rule); border-radius: var(--radius-md); }
.nc-list li + li { border-top: 1px solid var(--color-rule); }
.nc-row { display: flex; align-items: center; gap: var(--space-sm); width: 100%; padding: var(--space-sm) var(--space-md); background: none; border: 0; color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
.nc-row:hover, .nc-row:focus-visible { background: var(--color-paper-2); }
.nc-row[disabled] { opacity: .5; cursor: progress; }
.nc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-nc .file-thumb img { object-fit: cover; }
.file-badge.nc-badge { left: auto; right: 6px; }
.clip-choices { display: grid; border: 1px solid var(--color-rule); border-radius: var(--radius-md); }
.clip-choices > * + * { border-top: 1px solid var(--color-rule); }
.clip-pop { position: fixed; inset: auto; margin: 0; padding: 4px; min-width: 210px; border: 1px solid var(--color-rule-strong); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-ink); box-shadow: 0 8px 24px oklch(0% 0 0 / .25); z-index: 50; }
.clip-pop .clip-choices { border: 0; }
.clip-pop .clip-choices > * + * { border-top: 0; }
.clip-pop .nc-row { border-radius: var(--radius-sm); padding: 6px var(--space-sm); }
.file-nc .file-dl { position: absolute; top: 4px; left: 4px; background: var(--color-surface); opacity: 0; transition: opacity var(--dur-fast); }
.file-nc:hover .file-dl, .file-nc .file-dl:focus-visible { opacity: 1; }
@media (hover: none) { .file-nc .file-dl { opacity: 1; } }
.nc-share { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.file .nc-access { position: static; opacity: 1; }
.nc-access select { font: inherit; padding: 0 2px; background: var(--color-surface); color: var(--color-ink); border: 1px solid var(--color-rule); border-radius: var(--radius-sm); }
.nc-perm { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-sm); }
.nc-perm label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.tour-attn { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: var(--radius-md); animation: tour-attn 1.6s ease-in-out infinite; }
@keyframes tour-attn { 50% { outline-color: transparent; } }
@media (prefers-reduced-motion: reduce) { .tour-attn { animation: none; } }

/* Archived boards: folded group at the bottom of the rail's boards, and the read-only bar on their pages */
.nav-archived { margin-bottom: var(--space-lg); }
.nav-archived > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: var(--space-xs); }
.nav-archived > summary::-webkit-details-marker { display: none; }
.bchip.is-archived { filter: grayscale(1); opacity: .6; }
.archived-bar { display: flex; align-items: center; gap: var(--space-sm); flex-wrap: wrap; margin: 0 0 var(--space-md); padding: var(--space-sm) var(--space-md); border: 1px solid var(--color-rule-strong); border-radius: var(--radius-md); background: var(--color-paper-2); color: var(--color-ink); }
.archived-bar span { flex: 1; min-width: 12rem; }

/* Sidebar: the top (Create, search, Views) stays put; Boards and everything below it scroll on their own,
   with the account row pinned at the bottom. */
.rail-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column;
  gap: inherit; margin-inline: calc(-1 * var(--space-sm)); padding-inline: var(--space-sm); scrollbar-width: thin; }
@media (min-width: 721px) { .rail { overflow-y: hidden; } }
@media (min-width: 721px) { html.rail-mini .rail-scroll { width: 100%; align-items: center; overflow-x: hidden; } }

/* Epic grid (2026-11): a board with epics opens on its epic cards; picking one shows its items by status. */
.runs.is-grid { flex-wrap: wrap; overflow-x: visible; }
.runs.is-grid .card.run-card { width: 260px; max-width: 100%; }
.card.run-card.is-dim { opacity: 0.55; }
.card.run-card.is-closed .rc-title { text-decoration: line-through; color: var(--color-muted); }
.card.run-card.loose-card { text-decoration: none; color: inherit; cursor: pointer; border-left-color: var(--color-rule-strong); }
.runs-back { align-self: center; flex: 0 0 auto; }
.rc-mine { margin-left: auto; white-space: nowrap; }
.grid-hint { margin: var(--space-sm) 0; }

/* Forms polish (2026-11). */
/* Ticks never shrink when the text beside them is long (filter menu, Who and how, everywhere). */
input[type=checkbox], input[type=radio] { flex: 0 0 auto; width: 16px; height: 16px; min-width: 16px; margin: 0; }
.opt { align-items: flex-start; }
.opt > input[type=checkbox] { margin-top: 2px; }
/* Links that read as links: accent text, underline on hover. */
.link-btn { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: var(--radius-md); color: var(--color-accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn:hover { background: var(--color-accent-soft); text-decoration-thickness: 2px; }
.fl-name { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; font-size: var(--text-md, 1rem); }
/* Builder rows on one grid: number column, then everything else lines up with the question input. */
.fb-q { --fb-indent: calc(1.6em + var(--space-sm)); }
.fb-q-top select { flex: 0 0 9.5em; }
.fb-choices, .fb-q-foot { margin-left: var(--fb-indent); }
.fb-q-top select { margin-right: 0; }
.fb-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.fb-opt { display: flex; align-items: center; gap: var(--space-sm); }
.fb-opt input { flex: 1; min-width: 0; }
.fb-opt-mark { flex: 0 0 auto; width: 14px; height: 14px; border: 1.5px solid var(--color-rule-strong); border-radius: 3px; }
.fb-q[data-kind="choice"] .fb-opt-mark { border-radius: 50%; }
.fb-opt-add { justify-self: start; margin-top: 4px; padding: 4px 8px; }
.fb-choices { display: grid; }
.fb-q[data-kind="text"] .fb-choices { display: none; }
.fb-rules { display: grid; gap: 6px; }
.fb-rule { display: grid; grid-template-columns: 7em minmax(0, 1fr); align-items: center; gap: var(--space-sm); font-size: var(--text-sm); }
.fb-rule > span { display: inline-flex; align-items: center; gap: 6px; }
.fb-saved { margin: 0; padding: 6px 10px; border-radius: var(--radius-md); background: var(--color-accent-soft); color: var(--color-accent); font-weight: 600; font-size: var(--text-sm); }
.fb-save [aria-busy=true] { opacity: 0.7; pointer-events: none; }
/* Responses: compact tallies so the table gets the room. */
.tallies { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-sm); margin-bottom: var(--space-md); }
.tally { padding: var(--space-sm) var(--space-md); }
.tally h3 { margin-bottom: 4px; font-size: var(--text-xs); }
.tally ul { gap: 2px; }
.tally li { font-size: var(--text-xs); grid-template-columns: 6em minmax(0, 1fr) 1.6em; }
.tally ul { max-height: 7.5em; overflow-y: auto; }
.resp-actions select { width: auto; padding: 4px 6px; font-size: var(--text-xs); }

/* Nextcloud picker (_nc_browse.html): places | folder, icon or details view (app.js [data-ncp]) */
.ncp-dlg { width: min(860px, calc(100vw - 2 * 16px)); max-height: 88vh; display: none; }
.ncp-dlg[open] { display: flex; flex-direction: column; }
.ncp-dlg #nc-dlg-body { flex: 1; min-height: 0; }
.ncp { display: grid; grid-template-columns: 160px 1fr; gap: var(--space-md); height: min(60vh, 520px); }
.ncp-places { display: flex; flex-direction: column; gap: 2px; border-right: 1px solid var(--color-rule); padding-right: var(--space-sm); }
.ncp-place { display: flex; align-items: center; gap: var(--space-sm); padding: 6px var(--space-sm); border-radius: var(--radius-sm); color: inherit; text-decoration: none; font-size: var(--text-sm); }
.ncp-place:hover { background: var(--color-paper-2); }
.ncp-place.is-on { background: var(--color-paper-2); font-weight: 600; }
.ncp-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ncp-bar { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: var(--space-sm); }
.ncp-bar .nc-crumbs { flex: 1; min-width: 0; margin: 0; }
.ncp-q { width: 140px; font: inherit; font-size: var(--text-sm); padding: 4px 8px; border: 1px solid var(--color-rule); border-radius: var(--radius-sm); background: var(--color-surface); color: var(--color-ink); }
.ncp-views { display: flex; gap: 2px; }
.ncp-views [aria-pressed=true] { background: var(--color-paper-2); }
.ncp-items { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; border: 1px solid var(--color-rule); border-radius: var(--radius-md); }
.ncp-it { position: relative; cursor: default; user-select: none; }
.ncp-it:hover { background: var(--color-paper-2); }
.ncp-it[aria-selected=true] { background: color-mix(in srgb, var(--color-accent) 16%, transparent); }
.ncp-check { margin: 0; }
.ncp-ic { display: grid; place-items: center; color: var(--color-ink-2); }
.ncp-ic { flex: none; overflow: hidden; }
.ncp-ic img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; border-radius: var(--radius-sm); }
.ncp-ext { font-size: 10px; padding: 2px 4px; border: 1px solid var(--color-rule); border-radius: 3px; background: var(--color-paper-2); }
.ncp-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: inherit; text-decoration: none; }
a.ncp-name:hover { text-decoration: underline; }
.ncp-empty { padding: var(--space-md); }
.ncp-head { display: none; }
/* details */
[data-view=list] .ncp-head { display: grid; grid-template-columns: 24px 1fr 110px 80px; gap: var(--space-sm); padding: 0 var(--space-md) 4px calc(var(--space-md) + 52px); font-size: var(--text-sm); }
.ncp-head button { background: none; border: 0; padding: 0; font: inherit; color: var(--color-ink-2); text-align: left; cursor: pointer; }
.ncp-head [data-dir=asc]::after { content: " \2191"; }
.ncp-head [data-dir=desc]::after { content: " \2193"; }
[data-view=list] .ncp-it { display: grid; grid-template-columns: 16px 24px 1fr 110px 80px; align-items: center; gap: var(--space-sm); padding: 5px var(--space-md); }
[data-view=list] .ncp-it + .ncp-it { border-top: 1px solid var(--color-rule); }
[data-view=list] .ncp-ic { width: 24px; height: 24px; }
[data-view=list] .ncp-size { text-align: right; font-size: var(--text-sm); }
[data-view=list] .ncp-mod { font-size: var(--text-sm); }
/* icons */
[data-view=grid] .ncp-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); align-content: start; gap: 4px; padding: 6px; }
[data-view=grid] .ncp-it { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: var(--radius-md); text-align: center; }
[data-view=grid] .ncp-check { position: absolute; top: 6px; left: 6px; opacity: 0; }
[data-view=grid] .ncp-it:hover .ncp-check, [data-view=grid] .ncp-check:checked, [data-view=grid] .ncp-check:focus-visible { opacity: 1; }
[data-view=grid] .ncp-ic { width: 64px; height: 64px; }
[data-view=grid] .ncp-ic .i { width: 44px; height: 44px; stroke-width: 1.1; }
[data-view=grid] .ncp-name { width: 100%; font-size: var(--text-sm); white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
[data-view=grid] .ncp-mod, [data-view=grid] .ncp-size { display: none; }
.ncp-foot { display: flex; align-items: center; gap: var(--space-md); margin-top: var(--space-sm); }
.ncp-foot p { flex: 1; margin: 0; }
@media (pointer: coarse) { [data-view=grid] .ncp-check { opacity: 1; } }
@media (max-width: 640px) {
  .ncp { grid-template-columns: 1fr; grid-template-rows: auto 1fr; height: 70vh; }
  .ncp-places { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--color-rule); padding: 0 0 var(--space-sm); }
  .ncp-place { white-space: nowrap; }
  .ncp-q { width: 96px; }
  [data-view=list] .ncp-it { grid-template-columns: 16px 24px 1fr 64px; }
  [data-view=list] .ncp-mod, [data-view=list] .ncp-head { display: none; }
  .ncp-foot { flex-wrap: wrap; }
}

/* File tiles (app.js eboFileTile): a file in the comment box, uploading, or picked from Nextcloud */
.up-tiles, .composer-files { display: flex; flex-wrap: wrap; gap: 6px; }
.up-tray { margin: var(--space-sm) 0; }
.up-tile { position: relative; display: flex; align-items: center; gap: 8px; width: 220px; max-width: 100%; padding: 6px 28px 6px 6px; border: 1px solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-surface); }
.up-tile.is-err { border-color: var(--color-danger); }
.up-tile.is-err .up-meta { color: var(--color-danger); }
.up-ic { position: relative; flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--color-paper-2); color: var(--color-ink-2); }
.up-ic .i { width: 20px; height: 20px; }
.up-ext { font-size: 9px; font-weight: 600; letter-spacing: .02em; }
.up-nc { position: absolute; right: -4px; bottom: -4px; font-size: 8px; font-weight: 700; padding: 0 3px; border-radius: 3px; background: var(--color-accent); color: var(--color-accent-ink); }
.up-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.up-name { font-size: var(--text-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-meta { font-size: var(--text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-bar { display: block; height: 4px; border-radius: 2px; background: var(--color-paper-2); overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--color-accent); transition: width .2s; }
.up-tile.is-busy .up-bar i { background-image: linear-gradient(90deg, transparent, color-mix(in srgb, var(--color-accent-ink) 30%, transparent), transparent); background-size: 40px 100%; animation: up-shine 1s linear infinite; }
@keyframes up-shine { to { background-position: 40px 0; } }
.up-x { position: absolute; top: 4px; right: 4px; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--color-ink-2); cursor: pointer; }
.up-x:hover { background: var(--color-paper-2); }
.up-x .i { width: 12px; height: 12px; }
@media (max-width: 720px) { .up-tile { width: 100%; } }

/* Resources: search, Add sub page dialog, page icons and labels */
.docs-search { width: 100%; font-size: var(--text-sm); margin-bottom: var(--space-sm); }
.docs-hits { list-style: none; margin: 0 0 var(--space-sm); padding: 0 0 var(--space-sm); border-bottom: var(--rule); display: flex; flex-direction: column; gap: 2px; }
.docs-tree .docs-hits a { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 2px; padding: 6px var(--space-sm); border-radius: var(--radius-md); font-size: var(--text-sm); color: var(--color-ink); }
.docs-hits a:hover { background: var(--color-paper-3); }
.docs-tree .docs-hits a span, .docs-tree .docs-hits b { white-space: normal; overflow-wrap: anywhere; text-align: left; }
.docs-hits .small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.docs-add { width: 100%; justify-content: center; margin-top: var(--space-md); }
.docs-icon { flex: none; width: 1.2em; text-align: center; }
.tag-sm { margin-left: auto; font-size: 10px; color: var(--color-muted); border: var(--rule); border-radius: 99px; padding: 0 6px; }
.newpage-dlg .newpage-form { display: flex; flex-direction: column; gap: var(--space-md); }
.newpage-dlg .field { display: flex; flex-direction: column; gap: 4px; }
.newpage-row { display: flex; gap: var(--space-sm); align-items: flex-end; }
.newpage-icon { flex: none; }
.newpage-title, .newpage-row .docs-title-input { flex: 1; min-width: 0; }
.docs-labels { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 var(--space-xs); }
.docs-labels .label-chip { font-size: var(--text-xs, 12px); padding: 1px 8px; border-radius: 99px; background: color-mix(in oklch, var(--c, #888) 18%, transparent); color: var(--color-ink); }
.docs-edit > input[name="labels"] { width: 100%; font-size: var(--text-sm); }

/* Page icon chooser (Font Awesome Free) */
.icon-pick-btn { width: 42px; height: 38px; justify-content: center; padding: 0; font-size: 16px; }
.icon-pop { position: fixed; z-index: 1000; width: min(360px, calc(100vw - 32px)); padding: var(--space-sm); display: flex; flex-direction: column; gap: var(--space-sm);
  background: var(--color-surface); color: var(--color-ink); border: 1px solid var(--color-rule); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgb(0 0 0 / .3); }
.icon-pop input { width: 100%; font-size: var(--text-sm); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(36px, 1fr)); gap: 2px; max-height: 240px; overflow: auto; }
.icon-grid button { height: 36px; border: 0; border-radius: var(--radius-md); background: transparent; color: var(--color-ink-2); font-size: 16px; cursor: pointer; }
.icon-grid button:hover, .icon-grid button:focus-visible { background: var(--color-paper-3); color: var(--color-ink); }
.icon-grid button.is-active { background: var(--color-accent-soft); color: var(--color-ink); }
.icon-pop-foot { display: flex; align-items: center; justify-content: space-between; }
.docs-title .docs-icon { font-size: .85em; margin-right: 4px; color: var(--color-ink-2); }

/* Page editor: the text box keeps one size and scrolls inside, so Save and the change note stay on screen. */
.docs-edit .docs-body-input { height: max(240px, calc(100dvh - 400px)); resize: vertical; overflow-y: auto; }

/* Folding the Resources page list */
.docs-tree li { position: relative; }
.docs-tree .fold-btn { position: absolute; left: calc(var(--d, 0) * 14px - 12px); top: 50%; translate: 0 -50%; z-index: 1; width: 18px; height: 18px; padding: 0; border: 0; border-radius: var(--radius-sm, 4px); background: transparent; color: var(--color-muted); display: grid; place-items: center; cursor: pointer; }
.docs-tree .fold-btn:hover { background: var(--color-paper-3); color: var(--color-ink); }
.docs-tree .fold-btn .i { width: 12px; height: 12px; rotate: -90deg; transition: rotate .15s; }
.docs-tree .fold-btn[aria-expanded="true"] .i { rotate: 0deg; }

/* The open page's headings under it in the page list */
.docs-tree .docs-toc { list-style: none; margin: 2px 0 6px; padding: 0 0 0 calc(var(--d, 0) * 14px + var(--space-sm) + 10px); border: 0; display: flex; flex-direction: column; gap: 0; }
.docs-tree .docs-toc li a { display: block; padding: 3px 8px 3px calc(8px + var(--t, 0) * 12px); font-size: 12px; color: var(--color-muted); border-left: 1px solid var(--color-rule); border-radius: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.docs-tree .docs-toc li a:hover { color: var(--color-ink); background: transparent; }
.docs-tree .docs-toc li a.is-here { color: var(--color-ink); border-left-color: var(--color-accent); }
.rich h1[id], .rich h2[id], .rich h3[id], .rich h4[id] { scroll-margin-top: var(--space-lg); }

/* An item's Resources: eBo pages and outside links in one list */
.res-row .sub-title { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.res-row .sub-title > span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-row .sub-title .i, .res-row .sub-title .docs-icon { flex: none; color: var(--color-muted); }
.res-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px 0; }
.res-suggest .chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; font-size: 12px; border: 1px dashed var(--color-rule); border-radius: 99px; background: transparent; color: var(--color-ink-2); cursor: pointer; }
.res-suggest .chip:hover { border-style: solid; color: var(--color-ink); }
.res-suggest .chip .i { width: 10px; height: 10px; }
.res-menu li { align-items: flex-start; }
.res-menu .res-opt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.res-menu .res-opt small { font-size: 11px; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.res-menu .res-menu-head { font-size: 10px; pointer-events: none; padding-top: 6px; }
.res-suggest { padding-left: var(--space-sm); }
.crumbs .crumb-parent { max-width: 28ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-transform: none; }

/* Chat: search over encrypted direct messages (this browser only) */
.chat-dm-search { width: 100%; }
.chat-dm-hit { flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; }
.chat-dm-hit .small { color: var(--color-muted); overflow-wrap: anywhere; }
/* The Site group sits right under the scrolling board list: give it room so its label does not touch the last board. */
.nav-site { padding-top: var(--space-md); border-top: 1px solid var(--color-rule); margin-top: var(--space-sm); }
