/* PM Copilot — components for Issues, Actions inbox, Glossary, Settings. Semantic tokens only (defined in styles.css). */

/* ---------- Issue refs ---------- */
.iref { border: 0; background: none; padding: 0 2px; border-radius: var(--r-sm); color: var(--accent-text); font-weight: 500; cursor: pointer; }
.iref:hover { background: var(--accent-tint); }

/* ---------- Issues list ---------- */
.is-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 0 0 12px; }
.is-fbtn { display: none; }
.is-sort { display: inline-flex; align-items: center; gap: 8px; margin-inline-start: auto; }
.qchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.qchip[aria-pressed="true"] { background: var(--accent-tint); color: var(--accent-text); border-color: var(--accent-tint); }
.qchip[aria-pressed="true"]:hover { background: var(--accent-tint); border-color: var(--border-strong); }
.is-note { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; font-size: var(--fs-sm); }
.is-count { margin: 0 0 8px; font-size: var(--fs-sm); }
.itab { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); font-size: var(--fs-sm); overflow-x: auto; }
.ir { position: relative; display: grid; grid-template-columns: var(--cols); align-items: center; gap: 10px; min-height: 36px; padding: 4px 12px; border-bottom: 1px solid var(--border); min-width: 980px; }
.ir:last-child { border-bottom: 0; }
.ir:not(.ir-h):hover { background: var(--surface-2); }
.ir-h { min-height: 30px; font-size: var(--fs-xs); color: var(--text-subtle); background: var(--bg); font-weight: 500; }
/* The ref is the row's link: its hit area covers the row; other controls sit above it. */
.ir-open::after { content: ""; position: absolute; inset: 0; }
.ir-open:focus-visible { outline: none; }
.ir:has(.ir-open:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }
.ir .gl-link, .ir .btn, .ir .link-btn { position: relative; z-index: 1; }
.ir > span { min-width: 0; }
.ir-t, .ir-g { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ir-a { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.area { font-size: 11px; color: var(--text-muted); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0 5px; white-space: nowrap; }
.st-review { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); }
.est { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.est-c svg { width: 14px; height: 14px; color: var(--text-muted); }
.est-p { color: var(--ai-fg); }
.q { white-space: nowrap; }
.q-low { color: var(--text); font-weight: 600; }
.ir-u { white-space: nowrap; }
.ir-est { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 0 0 4px; padding: 6px 10px; border-radius: var(--r-md); background: var(--surface-2); position: relative; z-index: 1; }
.el-prop { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.el-state { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
.el-state span { display: inline-flex; align-items: center; gap: 6px; }
.el-btns { display: inline-flex; gap: 6px; margin-inline-start: auto; }
.ig-r { border-bottom: 1px solid var(--border); background: var(--bg); min-width: 980px; }
.ig-h { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 32px; padding: 0 12px; border: 0; background: none; color: var(--text); font-weight: 600; text-align: start; }
.ig-h:hover { background: var(--surface-2); }
.ig-r { background: var(--bg); }
.il-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: var(--fs-sm); }
.il-sub .is-sort { margin-inline-start: auto; }
.if-stack { display: grid; gap: 10px; }
.if-stack .menu-wrap, .if-stack .dd-btn { width: 100%; }
.if-stack .dd-btn { justify-content: space-between; height: 44px; }
/* Issue peek */
.ip-k { color: var(--text-muted); }
.ph-top .ip-k + h2 { flex: 1; min-width: 0; }
.ip-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0; font-size: var(--fs-sm); }
.ip-meta > div { display: grid; gap: 2px; }
.ip-meta dt { font-size: var(--fs-xs); color: var(--text-subtle); }
.ip-meta dd { margin: 0; display: flex; align-items: center; gap: 6px; }
.ip-desc { margin: 0; }
.ip-notes { align-items: flex-start; }
.ip-notes ul { margin: 0; padding-inline-start: 16px; display: grid; gap: 2px; }
.tl-ai::before { background: var(--ai-fg); }
.ic-list li { gap: 8px; }
.ic-e { font-size: var(--fs-xs); }
.gd-desc { margin: 4px 0 0; max-width: 72ch; color: var(--text-muted); }
.blk-link { padding: 0; text-align: start; color: var(--text); font-weight: 400; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.blk-link:hover { text-decoration-color: var(--text); }
.conf { cursor: pointer; }
/* Plan: affected issues with their diff */
.diff-iss { display: grid; gap: 2px; }
.diff-ih { display: flex; align-items: center; gap: 8px; font-size: var(--fs-sm); padding-bottom: 4px; direction: ltr; }
.diff-ih .grow { unicode-bidi: plaintext; }
.diff-f { font-size: var(--fs-xs); color: var(--text-subtle); }
/* Calibration */
.cal-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 2px; font-size: var(--fs-sm); }
.cal-r { white-space: nowrap; }
.cal-sub { margin: 0 0 8px; font-size: var(--fs-sm); }
.cal-cap { margin: 4px 0 0; font-size: var(--fs-xs); }
.cal-note { display: flex; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-xs); }

/* ---------- Actions inbox ---------- */
.ib-grp + .ib-grp { margin-top: 20px; }
.ib-grp .sec-h { display: flex; align-items: center; gap: 8px; }
.ib-card { display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: start; gap: 6px; }
.ib-pick { display: grid; place-items: center; width: 32px; height: 40px; margin-top: 8px; }
.ib-pick input { width: 16px; height: 16px; accent-color: var(--accent); }
.ib-lock { color: var(--text-subtle); border-radius: var(--r-sm); cursor: help; }
.ib-card.is-sel .acard { border-color: var(--accent); }
.ib-empty { margin: 8px 0; }
.bulk-bar { position: sticky; bottom: 16px; z-index: 20; display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 8px 8px 8px 16px; padding-inline: 16px 8px; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-popover); font-size: var(--fs-sm); }
.bulk-bar .end { margin-inline-start: auto; }
.dlg-wrap { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: var(--scrim); }
.dlg { width: min(480px, 100%); max-height: calc(100dvh - 32px); overflow: auto; display: grid; gap: 12px; padding: 20px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-modal); }
.dlg h2 { margin: 0; font-size: 16px; font-weight: 600; }
.dlg p { margin: 0; font-size: var(--fs-sm); }
.ib-wait { list-style: none; margin: 0; padding: 0; }
.ib-w { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.ib-w:last-child { border-bottom: 0; }
.ib-w-main { display: flex; align-items: center; gap: 8px; flex: 1 1 280px; min-width: 0; min-height: 32px; border: 0; background: none; padding: 0; text-align: start; }
.ib-w-main:hover .grow { text-decoration: underline; }
.ib-w-m { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: var(--fs-sm); }
.hl { font-size: var(--fs-sm); overflow-x: auto; }
.hl-r { display: grid; grid-template-columns: 64px 52px minmax(220px, 1fr) 110px 90px minmax(112px, max-content) minmax(150px, auto); align-items: center; gap: 10px; min-height: 40px; padding: 6px 12px; border-bottom: 1px solid var(--border); min-width: 920px; }
.hl-r:last-child { border-bottom: 0; }
.hl-r:not(.hl-h):hover { background: var(--surface-2); }
.hl-h { min-height: 30px; font-size: var(--fs-xs); color: var(--text-subtle); background: var(--bg); }
.hl-s { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.hl-why { display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); flex-basis: 100%; }
.hl-a { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.pill-ic::before { display: none; }
.pill-ic { gap: 4px; }
.pill-ic svg { width: 12px; height: 12px; }

/* ---------- Glossary ---------- */
.gl-banner { margin: 12px 0 0; }
.gl-banner .grow { flex: 1; }
.gl-bar { flex-wrap: wrap; }
.gl-search { display: flex; align-items: center; gap: 8px; flex: 1 1 320px; max-width: 480px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--text-subtle); }
.gl-search:focus-within { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px; }
.gl-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); }
.gl-search input::placeholder { color: var(--text-subtle); }
.gl-split { display: grid; grid-template-columns: minmax(240px, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.gl-list { list-style: none; margin: 0; padding: 4px; }
.gl-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; width: 100%; min-height: 40px; padding: 6px 10px; border: 0; border-radius: var(--r-md); background: none; text-align: start; }
.gl-item:hover { background: var(--surface-2); }
.gl-item[aria-current="true"] { background: var(--accent-tint); }
.gl-item[aria-current="true"] .gl-fa { color: var(--accent-text); }
.gl-fa { font-weight: 600; }
.gl-en { color: var(--text-muted); font-size: var(--fs-sm); }
.gl-none { padding: 12px; }
.tag-ai { color: var(--ai-fg); background: var(--ai-tint); border-color: var(--ai-tint); }
.tag-scope { color: var(--text); }
.gl-detail { display: grid; gap: 10px; }
.gl-dh { display: grid; gap: 6px; }
.gl-dh h2 { margin: 0; font-size: 18px; font-weight: 600; }
.gl-alt { font-weight: 500; }
.gl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; font-size: var(--fs-sm); }
.gl-def { font-size: var(--fs); max-width: 68ch; }
.gl-code { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.gl-code li { display: flex; align-items: center; gap: 12px; }
.gl-props .stack { display: grid; gap: 10px; }
.gl-prop { display: grid; gap: 8px; max-width: 760px; }
.gl-pt { margin: 0; font-size: 15px; font-weight: 600; }
.gl-draft { font-weight: 400; color: var(--text); }
.gl-ev { margin: 0; font-size: var(--fs-sm); }
.gl-ta { width: 100%; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; resize: vertical; }
.gl-sheet { padding-top: 16px; }

/* ---------- Settings ---------- */
.set-top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.set-top .h1 { margin-inline-end: auto; }
.set-search { max-width: 420px; }
.set-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 16px 0 20px; }
.set-scope { height: 32px; }
.set-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-nav { position: sticky; top: 72px; display: grid; gap: 2px; }
.set-ni { width: 100%; }
.set-main { min-width: 0; }
.set-main > .sec-h { margin-top: 0; }
.set-cards { display: grid; gap: 10px; max-width: 820px; }
.set-cards .set-sec { max-width: none; }
.set-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: start; }
.set-card-c { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.pc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 24px; align-items: start; padding-top: 10px; border-top: 1px solid var(--border); }
.sc-main { display: grid; gap: 4px; min-width: 0; }
.sc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sc-head .set-l, .sc-head h3.set-l { margin: 0; font-size: var(--fs); font-weight: 500; }
.sc-path { margin: 0; font-size: var(--fs-xs); }
.sc-inh { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 4px; }
.sc-ov { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-sm); color: var(--text-muted); }
.switch-sm { width: 32px; height: 20px; }
.switch-sm .switch-k { top: 2px; width: 14px; height: 14px; }
.switch-sm[aria-checked="true"] .switch-k { inset-inline-start: 15px; }
.sc-ctl { display: flex; align-items: center; justify-content: flex-end; min-height: 32px; }
.sc-ro { font-weight: 500; }
.sc-in { display: inline-flex; align-items: center; gap: 6px; }
.sc-in input { height: 32px; min-width: 0; width: 240px; padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); font-variant-numeric: tabular-nums; }
.sc-in input[type="number"] { width: 84px; }
.sc-in input[type="time"] { width: 120px; }
.sc-in input:disabled, .sc-range input:disabled { opacity: .6; cursor: not-allowed; }
.sc-range { display: inline-flex; align-items: center; gap: 10px; }
.sc-range input { width: 180px; accent-color: var(--accent); }
.sc-range output { min-width: 3ch; font-weight: 600; }
.sc-hist { margin: 2px 0 0; font-size: var(--fs-xs); }
.sc-lock { color: var(--text-muted); }
.sc-dl { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0; }
.sc-dl dt { font-size: var(--fs-xs); color: var(--text-subtle); }
.sc-dl dd { margin: 0; font-size: 16px; font-weight: 500; }
.wp { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.wp li { display: grid; gap: 2px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--r-md); font-size: var(--fs-sm); }
.wp li.off { background: var(--surface-2); color: var(--text-muted); }
.hol-d { min-width: 96px; }
.hol-add { flex-wrap: wrap; }
.set-tt td, .set-tt th { text-align: start; }
.sc-status { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sc-status li { display: flex; align-items: center; gap: 8px; }
.ur td { vertical-align: top; }
.ur-ed { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; }
.ur-ed .set-help { flex-basis: 100%; }
.ur-cb { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); min-height: 28px; }
.ur-cb input { accent-color: var(--accent); }
.us-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: var(--fs-sm); }
.us-chart { width: 100%; max-width: 560px; height: auto; display: block; }
.us-bar { fill: var(--border-strong); }
.us-bar.sel { fill: var(--text-muted); }
.us-bar-l { margin: 4px 0; }
.us-t .end { text-align: end; }

@media (max-width: 1023px) {
  .gl-split { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); }
  .set-layout { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 767px) {
  /* Issues: 2-line rows (ref + title / assignee · status · estimate); filters move to a bottom sheet. */
  .is-filters { display: none; }
  .is-fbtn { display: inline-flex; height: 40px; }
  .is-sort { margin-inline-start: 0; }
  .is-sort .seg-l { display: none; }
  .is-sort .dd-btn { height: 40px; }
  .qchip { height: 36px; }
  .itab { overflow: visible; }
  .ir, .ig-r { min-width: 0; }
  .ir { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "k t t" "a s e"; gap: 4px 10px; padding: 8px 12px; min-height: 44px; }
  .ir-h { display: none; }
  .ir-k { grid-area: k; } .ir-t { grid-area: t; white-space: normal; } .ir-a { grid-area: a; } .ir-s { grid-area: s; } .ir-e { grid-area: e; justify-self: end; }
  .ir-g, .ir-ar, .ir-q, .ir-u, .ir-l { display: none; }
  .ir-est { grid-column: 1 / -1; grid-area: auto; }
  .el-btns { margin-inline-start: 0; }
  .el-btns .btn { height: 36px; }
  .ig-h { min-height: 44px; }
  /* Inbox */
  .ib-tabs { border: 0; margin: 12px 0 16px; padding: 2px; background: var(--surface-2); border-radius: var(--r-md); }
  .ib-tabs .pal-tab { flex: 1; justify-content: center; height: 40px; border: 0; margin: 0; border-radius: var(--r-sm); }
  .ib-tabs .pal-tab[aria-selected="true"] { background: var(--surface); box-shadow: 0 0 0 1px var(--border); }
  .ib-pick { width: 44px; height: 44px; margin-top: 4px; }
  .ib-card { grid-template-columns: 44px minmax(0, 1fr); gap: 2px; }
  .bulk-bar { position: fixed; inset-inline: 12px; bottom: calc(124px + env(safe-area-inset-bottom)); margin: 0; }
  .ib:has(.bulk-bar) { padding-bottom: 72px; }
  .ib-w-main { min-height: 44px; }
  .ib-w .btn { height: 36px; }
  .hl { overflow: visible; }
  .hl-h { display: none; }
  .hl-r { min-width: 0; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "d i s s" "p q r r" "a a a a"; gap: 4px 10px; padding: 10px 12px; }
  .hl-d { grid-area: d; } .hl-id { grid-area: i; } .hl-s { grid-area: s; } .hl-r > .hl-p:nth-of-type(4) { grid-area: p; } .hl-r > .hl-p:nth-of-type(5) { grid-area: q; } .hl-res { grid-area: r; justify-self: end; } .hl-a { grid-area: a; justify-content: flex-start; }
  .hl-a .btn { height: 36px; }
  /* Glossary: list → detail sheet */
  .gl-split { grid-template-columns: minmax(0, 1fr); }
  .gl-detail { display: none; }
  .gl-item { min-height: 48px; }
  .gl-search { height: 40px; max-width: none; }
  .gl-banner { flex-wrap: wrap; }
  /* Settings: category list → category page; search at the top */
  .set-top { display: grid; }
  .set-search { max-width: none; height: 40px; }
  .set-layout { grid-template-columns: minmax(0, 1fr); }
  .set-nav { position: static; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 4px; }
  .set-ni { min-height: 48px; justify-content: space-between; }
  .set-ni .nav-label { display: inline; }
  .set-back { margin-inline-start: -8px; margin-bottom: 8px; height: 40px; }
  .set-scope button { min-height: 40px; }
  .set-card { grid-template-columns: minmax(0, 1fr); }
  .sc-ctl { justify-content: flex-start; }
  .pc-row { grid-template-columns: minmax(0, 1fr); }
  .sc-in input { width: 100%; height: 44px; }
  .sc-in { width: 100%; }
  .sc-in input[type="number"], .sc-in input[type="time"] { width: 140px; }
  .wp { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .switch-sm { width: 40px; height: 24px; } .switch-sm .switch-k { top: 3px; width: 16px; height: 16px; } .switch-sm[aria-checked="true"] .switch-k { inset-inline-start: 19px; }
  .ur-cb { min-height: 44px; }
}

/* ---------- Dev tools (staging / development only) ---------- */
.env-chip { flex: none; height: 18px; padding: 0 5px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); font: 500 11px/16px var(--mono); letter-spacing: .04em; color: var(--text-muted); background: var(--surface); direction: ltr; }
.collapsed .brand .env-chip { display: none; }
.dv-who { margin-inline-start: auto; max-width: 9ch; overflow: hidden; text-overflow: ellipsis; height: 18px; padding: 0 6px; border: 1px solid var(--border); border-radius: var(--r-pill); font-size: var(--fs-xs); font-weight: 500; line-height: 16px; color: var(--text); background: var(--surface); white-space: nowrap; }
.collapsed .nav-dev .dv-who { display: none; }
.nav-dev { margin-bottom: 2px; }
.row-btn .dv-who { margin-inline-start: 0; }
.dv-banner { align-items: center; margin: 0; border-radius: 0; padding: 8px 20px; border-bottom: 1px solid var(--border); }
.dv-banner svg { margin-top: 0; }
.dv-banner .grow { flex: 1; min-width: 0; }
.dv-banner .btn { flex: none; }
.dv-sub { margin: 0; font-size: var(--fs-sm); }
.dv-people { display: grid; gap: 2px; }
.dv-person { display: grid; grid-template-columns: 28px minmax(56px, auto) minmax(0, 1fr) 16px; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; border: 1px solid transparent; border-radius: var(--r-md); background: none; text-align: start; }
.dv-person:hover { background: var(--surface-2); }
.dv-person[aria-checked="true"] { background: var(--surface-2); border-color: var(--border-strong); }
.dv-pn { font-weight: 600; }
.dv-roles { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.dv-roles .roles { display: contents; }
.dv-ck { color: var(--text); }
.dv-list { display: grid; }
.dv-row { display: flex; align-items: center; gap: 16px; min-height: 44px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.dv-row:last-child { border-bottom: 0; }
.dv-t { flex: 1; min-width: 0; display: grid; gap: 2px; }
.dv-help { margin: 0; font-size: var(--fs-xs); }
.dv-time { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.dv-date { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.dv-date input { height: 32px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); color: var(--text); font: inherit; font-variant-numeric: tabular-nums; direction: ltr; color-scheme: light dark; }
.dv-read { color: var(--text-muted); font-size: var(--fs-sm); }
.dv-jbtn { height: 32px; font-variant-numeric: tabular-nums; }
.dv-cal-w { order: 1; flex: 0 0 100%; } /* own row, below the trigger and the readout */
.dv-cal-h .icon-btn:disabled { opacity: .35; }
.dv-cal { max-width: 300px; padding: 8px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.dv-cal-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; font-size: var(--fs-sm); }
.dv-cal-g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; font-size: var(--fs-xs); color: var(--text-subtle); }
.dv-day { height: 32px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: var(--text); font: inherit; font-size: var(--fs-sm); }
.dv-day:hover:not(:disabled) { background: var(--surface-2); }
.dv-day.seed { border-color: var(--border-strong); }
.dv-day.on { background: var(--text); color: var(--surface); }
.dv-day:disabled { color: var(--text-subtle); opacity: .45; }
.state-failed { background: var(--late-bg); color: var(--late-fg); }
@media (max-width: 767px) {
  .topbar .mobile-only .env-chip { margin-inline-start: 2px; }
  .dv-banner { flex-wrap: wrap; padding: 8px 16px; }
  .dv-date input, .dv-jbtn, .dv-day { height: 44px; }
  .dv-person { grid-template-columns: 28px minmax(0, auto) minmax(0, 1fr) 16px; }
}

/* Charts run LTR; their labels must too, or text-anchor start/end flips under RTL and labels run off the canvas. */
svg[dir="ltr"] text { direction: ltr; }

/* Persian text inside the EN UI (the "فا" language button, FA names): Inter has no Arabic glyphs. */
html[lang="en"] [lang="fa"] { font-family: Vazirmatn, Tahoma, system-ui, sans-serif; }

/* Intake triage (F24) and iteration plan (F25) */
.acard-note { grid-column: 1 / -1; display: flex; align-items: center; gap: 4px; margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.acard-note > svg { flex: none; }
.tri-opts { display: grid; gap: 8px; margin: 8px 0; }
.tri-opt { display: grid; gap: 2px; text-align: start; width: 100%; min-height: 44px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text); cursor: pointer; font: inherit; }
.tri-opt:hover:not(:disabled) { border-color: var(--border-strong); }
.tri-opt[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tri-opt:disabled { opacity: .6; cursor: default; }
.tri-t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 500; }
.tri-s, .tri-meta { font-size: var(--fs-sm); }
.tri-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; }
.tri-meta > span { display: inline-flex; align-items: center; gap: 4px; }
.tri-ih { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tri-why { margin-top: 8px; }
.ip-list { display: grid; gap: 6px; padding: 0; margin: 6px 0; list-style: none; }
.ip-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ip-list li > .grow { flex: 1 1 12em; min-width: 0; } /* narrow sheets: the title takes its own line instead of squeezing to one word */
.ip-n { min-width: 1.5em; color: var(--text-subtle); }
.ip-oh { margin: 12px 0 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.ip-fitline, .ip-break, .ip-head, .ip-maint { font-size: var(--fs-sm); }
.ip-flags { display: grid; gap: 6px; padding: 0; margin: 6px 0; list-style: none; }
.ip-flags li { display: flex; align-items: baseline; gap: 8px; }
.ip-flags li > svg { flex: none; align-self: center; }
.fit { display: flex; height: 12px; margin: 8px 0; overflow: hidden; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--border); direction: ltr; }
.fit-seg { display: block; height: 100%; }
.fit-used { background: var(--text-muted); }
.fit-free { background: transparent; }
.fit-res { background: repeating-linear-gradient(45deg, var(--border-strong) 0 3px, transparent 3px 6px); }
.fit-off { background: var(--border); }
.fit-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0; margin: 0 0 8px; list-style: none; font-size: var(--fs-xs); color: var(--text-muted); }
.fit-legend .sw { display: inline-block; width: 10px; height: 10px; margin-inline-end: 6px; border-radius: 2px; vertical-align: middle; }
.sw-used { background: var(--text-muted); }
.sw-res { background: var(--border-strong); }
.sw-off { background: var(--border); }
@media (max-width: 767px) {
  .tri-opt { padding: 12px; }
  .tri-why .chip { min-height: 44px; }
}

/* ---- v1 gaps 1, part 2: safety states, reason chips, low-confidence ranges, weekly status, Bot health ---- */
.tag-state { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.state-note { background: var(--surface-2); color: var(--text-muted); font-weight: 400; align-items: flex-start; }
.state-note svg { flex: none; margin-top: 2px; }
.sc-sub { margin: -4px 0 0; }
.sc-diff { margin-top: 0; width: 100%; }
.acard-imp .sc-diff { font-size: var(--fs-xs); }
.rsn-other { width: 100%; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); }
.rsn-other:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
/* "Needs estimates": neutral, a link to the estimates queue (goals.js needsPill) */
.pill-needs { height: 20px; font-size: var(--fs-xs); }
.pill-needs.pill-btn { cursor: pointer; }
.proj .pname .pill-needs { margin-inline-start: 8px; }
.row-split { padding: 0; }
.row-split .row-main { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; min-height: 44px; padding: 8px 0 8px 16px; padding-inline: 16px 8px; border: 0; background: none; text-align: start; }
.row-split .pill-needs { flex: none; margin-inline-end: 16px; }
.rm-low { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.rm-lab:has(.rm-low) { flex-wrap: wrap; row-gap: 2px; }
.rm-low .rng { font-size: var(--fs-xs); color: var(--text-muted); }
.gd-forecast .card-h .pill-needs { margin-inline-start: auto; }
.gd-forecast .card-h .pill-needs + .conf { margin-inline-start: 8px; }
.imp-seg .pill-needs, .itable .pill-needs { vertical-align: middle; }
/* Weekly status (F26): a ✦ T0 draft, full width under the forecast */
.gd-weekly .card-h { flex-wrap: wrap; gap: 8px; }
.gd-weekly .ws-by { font-size: var(--fs-xs); margin-inline-start: auto; }
.ws-list { display: grid; gap: 10px; margin: 8px 0; }
.ws-i dt { font-size: var(--fs-xs); font-weight: 600; color: var(--text-subtle); margin-bottom: 2px; }
.ws-i dd { margin: 0; font-size: var(--fs-sm); }
.ws-i ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 2px; }
.ws-note { margin: 4px 0 0; }
@media (min-width: 768px) {
  .gd-grid:has(.gd-weekly) { grid-template-areas: "fc fc" "ws ws" "bl bu" "wk pp" "wk dc" "nt nt"; }
  .gd-weekly { grid-area: ws; }
}
/* "Not useful": quiet, text-only, on every bot DM / GitLab comment (messages.js) */
.nu-btn { margin-inline-start: auto; padding: 0 4px; border: 0; background: none; font-size: var(--fs-xs); color: var(--text-subtle); cursor: pointer; }
.nu-btn:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.nu-done { margin-inline-start: auto; display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs); }
.nu-done svg { width: 12px; height: 12px; }
.mg-rel { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
/* Bot health (Settings): read-only tables; the CTO-only switch sits beside the eligibility text */
.bh-h { margin: 12px 0 4px; font-size: var(--fs-sm); font-weight: 600; color: var(--text-muted); }
.bh-t { margin-bottom: 8px; }
.bh-t th.end, .bh-t td.end { text-align: end; }
.bh-auto { display: flex; align-items: center; gap: 8px; min-height: 36px; }
.bh-ok { color: var(--text); font-weight: 500; }
@media (max-width: 767px) {
  .nu-btn, .nu-done { min-height: 44px; }
  .nu-btn { padding: 0 8px; }
  .pill-needs.pill-btn { position: relative; } /* stays a 20px pill; .pill-btn::after (styles.css) gives the 44px hit area */
  .bh-acts { min-width: 560px; } /* scrolls in .cap-scroll like the capacity table, instead of one word per line */
  .state-note { padding: 10px 12px; }
}

/* ---------- Projects list, Project detail, Iteration (projects.js) ---------- */
.pj-r { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 96px 64px minmax(120px, 1fr) 96px; align-items: center; gap: 16px; min-height: 44px; width: 100%; padding: 0 16px; border: 0; border-bottom: 1px solid var(--border); background: none; text-align: start; }
.pj-r:last-child { border-bottom: 0; }
button.pj-r:hover { background: var(--surface-2); }
.pj-h { min-height: 32px; font-size: var(--fs-xs); color: var(--text-subtle); }
.pj-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pj-noresp { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
.pj-unmapped { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; }
.pj-head .h1 { display: flex; align-items: center; gap: 10px; }
.pj-head .h1 .pdot { width: 12px; height: 12px; }
.pj-h1-p { font-weight: 400; }
.pj-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 6px 0 4px; color: var(--text-muted); font-size: var(--fs-sm); }
.pj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.pj-grid .card > p { margin: 8px 0; }
.pj-iter-n { font-size: var(--fs); }
.pj-fill { background: color-mix(in oklch, var(--text-muted) var(--bar-k), var(--surface)); } /* an iteration has no health of its own (F9.3): neutral */
.pj-bar .bar-track { flex: 1; }
.pj-bar .bar-pct { min-width: 44px; }
.pj-src { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; color: var(--text-muted); }
.pj-repos { width: 100%; margin-bottom: 8px; }
.pj-repos .area { margin-inline-end: 4px; }
.pj-old { display: inline-flex; align-items: center; gap: 4px; color: var(--risk-fg); }
.pj-maint .gr-name { display: flex; flex-direction: column; gap: 2px; }
.pj-maint .gr-name .muted { font-size: var(--fs-sm); }
.pj-maint-fc { color: var(--text-muted); font-size: var(--fs-sm); }
.pj-help { margin: 4px 0 8px; font-size: var(--fs-sm); }
.pj-ppl { margin: 0; padding: 0; list-style: none; }
.pj-p { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; min-height: 44px; padding: 6px 16px; border-bottom: 1px solid var(--border); }
.pj-p:last-child { border-bottom: 0; }
.pj-p .grow { flex: 1; }
.pj-other { font-size: var(--fs-sm); }
.pj-dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px 24px; margin: 0; padding: 14px 16px; }
.pj-dl div { display: grid; gap: 2px; }
.pj-dl dt { font-size: var(--fs-sm); color: var(--text-muted); }
.pj-dl dd { margin: 0; font-weight: 500; }
.card .pj-dl { padding: 0; }
.pj .ig { margin-top: 12px; }
.pj .ig-h { padding: 0; min-height: 28px; }
.pj .ig .sub-list { background: var(--surface); }
.bu-today { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.pj .foot-row { margin-top: 24px; }
@media (max-width: 767px) {
  .pj-r { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 8px 16px; }
  .pj-r > :nth-child(2), .pj-r > :nth-child(4) { display: none; }
  .pj-r > :nth-child(5) { grid-column: 1 / -1; }
  .pj-h { display: none; }
  .pj-grid { grid-template-columns: minmax(0, 1fr); }
  .pj-repos th:nth-child(4), .pj-repos td:nth-child(4) { display: none; }
}

/* Goal/project chips on sent messages are links (projects-1). */
.ctx-chip-a { cursor: pointer; font: inherit; font-size: var(--fs-xs); }
.ctx-chip-a:hover { color: var(--text); border-color: var(--border-strong, var(--text-muted)); }
.ctx-chip-a:focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 1px; }
.pj-unlab { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 12px; }

/* First-run setup checklist on Today (F2, projects-1). Neutral; the current step carries the one primary button. */
.fr-list { list-style: none; margin: 0; padding: 0; }
.fr-s { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.fr-s:first-child { border-top: 0; }
.fr-s .grow { display: grid; gap: 2px; min-width: 0; }
.fr-h { font-size: var(--fs-sm); text-wrap: pretty; }
.fr-n { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-muted); }
.fr-done .fr-n { border-color: transparent; background: var(--surface-2); color: var(--text); }
.fr-done b { color: var(--text-muted); font-weight: 500; }
.fr-cur .fr-n { border-color: var(--text); color: var(--text); font-weight: 600; }
.fr-todo b { font-weight: 500; }
@media (max-width: 640px) { .fr-s { flex-wrap: wrap; } .fr-s .btn { margin-inline-start: 36px; } }

/* Team → Capability as lists (F27): one axis per row, the other summarised. */
.cap-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 8px; }
.cap-tools .gl-search { flex: 1 1 220px; max-width: 320px; }
.cap-list { list-style: none; margin: 0; padding: 0; }
.cap-li { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--border); }
.cap-li:first-child { border-top: 0; }
.cap-li .cap-who { flex: 0 0 140px; }
.cap-sk { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.dom-t th[scope="row"] { white-space: nowrap; }
.dom-t td, .dom-t th { vertical-align: middle; }
.dom-who { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.dom-p { white-space: nowrap; }
.dom-pr { display: inline-flex; align-items: center; gap: 4px; margin-inline-end: 8px; white-space: nowrap; }
.dom-inactive { margin-top: 12px; }
.dom-inactive summary { cursor: pointer; color: var(--text-muted); font-size: var(--fs-sm); }
.dom-inactive p { margin: 6px 0 0; }
@media (max-width: 640px) {
  .cap-li { flex-wrap: wrap; } .cap-li .cap-who { flex-basis: 100%; }
  .dom-t th:nth-child(5), .dom-t td:nth-child(5), .dom-t th:nth-child(2), .dom-t td:nth-child(2) { display: none; }
}
/* Agreements (F8.1): Glossary sub-tab, Remember this sheet, citation chip. */
.ag-rule { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px; font-size: var(--fs-sm); max-width: 72ch; }
.ag-rule svg { flex: none; margin-top: 2px; }
.ag-g { margin-top: 20px; }
.ag-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; max-width: 860px; }
.ag-row { display: grid; gap: 6px; }
.ag-hi { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.ag-t { margin: 0; font-weight: 500; max-width: 72ch; }
.ag-foot { align-items: center; flex-wrap: wrap; font-size: var(--fs-sm); }
.ag-ret { margin-top: 20px; max-width: 860px; }
.ag-ret summary { cursor: pointer; color: var(--text-muted); font-size: var(--fs-sm); padding: 4px 0; }
.ag-ret .ag-t { color: var(--text-muted); font-weight: 400; }
.rem { display: grid; gap: 10px; }
.rem-row { display: flex; align-items: center; gap: 8px; }
.rem-guard .grow { flex: 1; }
.msg-acts { display: flex; justify-content: flex-start; margin-top: 4px; font-size: var(--fs-sm); }
.cites { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cite-chip { max-width: 100%; text-align: start; white-space: normal; height: auto; min-height: 28px; }
/* Below 768px the ✦ FAB already asks about this project; the in-page button would repeat it. */
@media (max-width: 767px) { [data-od-id="project-ask"] { display: none; } }
