/* Enable Security brand theme (enablesecurity.com): black header, signature
   red, Roboto. Fonts and logo are vendored (CSP forbids external loads). */
@font-face {
  font-family: "Roboto";
  src: url("./roboto-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Roboto Mono";
  src: url("./roboto-mono-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --fg: #212529;
  --muted: #6c757d;
  --bg: #f8f9fa;
  --card: #ffffff;
  --line: #dee2e6;
  --brand: #ff2828;      /* Enable Security signature red */
  --brand-dark: #cc0000; /* brand hover red; text links */
  --grey: #bcbec0;       /* brand grey */
  --cyan: #27ade4;       /* brand cyan accent (in-progress / info) */
  --cyan-dark: #0e6b8f;  /* readable cyan text on light */
  --ok: #198754;         /* success green — the one justified non-brand hue */
  --warn: #9a6700;
  --danger: #cc0000;
  --info: #27ade4;
}
* { box-sizing: border-box; }
/* `hidden` must win over author display rules (.manage-menu/.you-badge/.bulk-bar
   set display:flex, which would otherwise override the UA [hidden] rule). */
[hidden] { display: none !important; }
body {
  margin: 0;
  font: 15px/1.5 "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--fg);
  background: var(--bg);
}
code, pre { font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
main { max-width: 60rem; margin: 1.5rem auto 4rem; padding: 0 1rem; }
h1 { font-size: 1.4rem; margin: 0.5rem 0 1rem; font-weight: 700; }
h2 { font-size: 1.05rem; margin: 2rem 0 0.5rem; border-bottom: 2px solid var(--line); padding-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.92rem; }
a { color: var(--brand-dark); }
a:hover { color: #991818; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 1.2rem; background: #000; color: #fff;
  border-bottom: 3px solid var(--brand);
}
.topbar a { color: #fff; text-decoration: none; margin-left: 1rem; }
.topbar a:hover { color: var(--brand); }
.topbar .brand { display: flex; align-items: center; gap: 0.7rem; margin-left: 0; font-weight: 500; }
.topbar .brand img { height: 26px; width: auto; display: block; }
.topbar .brand span { border-left: 1px solid #444; padding-left: 0.7rem; font-size: 0.95rem; color: #ebe2d5; }
.topbar .muted { color: #9aa0a6; }
.muted { color: var(--muted); }
.error { color: var(--danger); font-weight: 600; }
.inline-hint { font-size: 0.8rem; margin-left: 0.5rem; }
.save-status { align-self: center; font-size: 0.85rem; color: var(--muted); }
.save-status.saved { color: var(--ok); font-weight: 600; }
.save-status.error { color: var(--danger); font-weight: 600; }
.member-invite-notice { color: var(--ok); font-weight: 600; }
.foreign-domain-note { display: block; margin-top: 0.5rem; color: var(--warn); }
.foreign-domain-notice { margin: 1rem 0; padding: 0.75rem 1rem; border: 1px solid #d8b35a; border-radius: 6px; background: #fff8df; color: #684900; font-weight: 600; }
.view-as-notice { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; margin: 0 0 1rem; padding: 0.65rem 1rem; border: 1px solid #d8b35a; border-radius: 6px; background: #fff8df; color: #684900; box-shadow: 0 2px 6px #0002; }
.view-as-notice .btn { margin-left: auto; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 6px; padding: 1rem; margin: 1rem 0;
}
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
table.list { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--line); }
table.list th, table.list td { text-align: left; padding: 0.45rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { background: #000; color: #fff; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
/* Per-cell wrap control: keep short values (dates, sizes) on one line; let long
   ones (file names) wrap. Wins over the mobile break-word rule below. */
table.list th.nowrap, table.list td.nowrap { white-space: nowrap; }
table.list td.wrap-any { overflow-wrap: anywhere; }
.file-delivered, .file-pending, .file-failed, .file-purged { white-space: nowrap; }
table.kv th { text-align: left; padding-right: 1rem; vertical-align: top; }
table.kv td { padding: 0.2rem 0; }
label { display: block; margin: 0.6rem 0; font-weight: 500; }
label input, label textarea, label select, .answer-input {
  display: block; width: 100%; margin-top: 0.25rem; padding: 0.45rem 0.5rem;
  border: 1px solid var(--line); border-radius: 4px; font: inherit; font-weight: 400;
}
label input:focus, label textarea:focus, label select:focus, .answer-input:focus {
  outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand);
}
/* Textareas grow with their content as you type (native, Chrome/Edge); browsers
   without field-sizing keep the fixed-rows fallback — an enhancement, no
   regression. field-sizing ignores the `rows` floor, so min-height restores a
   sensible starting size; max-height caps runaway growth and re-enables scroll. */
textarea { field-sizing: content; min-height: 2.75rem; max-height: 60vh; }
textarea.answer-input { min-height: 8.5rem; }
label textarea, .inline-editor textarea { min-height: 4.5rem; }
label.check { font-weight: 400; }
label.check input { display: inline; width: auto; margin-right: 0.4rem; }
fieldset { border: 1px solid var(--line); border-radius: 6px; margin: 1rem 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.btn {
  display: inline-block; padding: 0.4rem 0.9rem; border-radius: 4px;
  border: 1px solid #adb5bd; background: #fff; color: var(--fg);
  font: inherit; font-weight: 500; cursor: pointer; text-decoration: none;
}
.btn:hover { border-color: var(--fg); color: var(--fg); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.small { padding: 0.15rem 0.5rem; font-size: 0.85rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btnrow { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 0.5rem; align-items: center; }
.invitation-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-top: 1.25rem; }
.invitation-actions .btn { text-align: center; }
.status-actions .action-group + .action-group {
  border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 0.4rem;
}
form.inline { display: inline; }
.chip {
  display: inline-block; padding: 0.05rem 0.55rem; border-radius: 3px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; white-space: nowrap;
  letter-spacing: 0.03em; border: 1px solid var(--line); background: #e9ecef;
}
.chip.blocking { background: #fde8e8; border-color: #f3b8b5; color: var(--danger); }
.chip.required-done { background: #f1f3f5; color: var(--muted); border-color: #dee2e6; }
.chip.internal { background: #fff4d6; border-color: #e8d28a; color: var(--warn); }
/* Status palette, brand-tightened: grey = neutral, cyan = in-progress/waiting,
   red = attention/problem, green = the one "done/success" exception. */
.state-draft { background: #e9ecef; }
.state-submitted { background: #e2f4fb; border-color: #a9ddf2; color: var(--cyan-dark); }
.state-changes_requested { background: #fde8e8; border-color: #f3b8b5; color: var(--danger); }
.state-accepted { background: #d1e7dd; border-color: #a3cfbb; color: var(--ok); }
.state-blocked { background: #fde8e8; border-color: #f3b8b5; color: var(--danger); }
.state-waived { background: #edeef0; border-color: var(--grey); color: #495057; }
.mem-active { background: #d1e7dd; border-color: #a3cfbb; color: var(--ok); }
.mem-invited { background: #e2f4fb; border-color: #a9ddf2; color: var(--cyan-dark); }
.mem-revoked { background: #edeef0; border-color: var(--grey); color: #495057; }
.eng-setup { background: #e9ecef; }
.eng-active { background: #d1e7dd; border-color: #a3cfbb; color: var(--ok); }
.eng-closed { background: #eee; color: var(--muted); }
.sec-pending { background: #e2f4fb; border-color: #a9ddf2; color: var(--cyan-dark); }
.sec-delivered { background: #d1e7dd; border-color: #a3cfbb; color: var(--ok); }
.sec-failed, .sec-purged { background: #fde8e8; border-color: #f3b8b5; color: var(--danger); }
.file-pending { background: #e2f4fb; border-color: #a9ddf2; color: var(--cyan-dark); }
.file-delivered { background: #d1e7dd; border-color: #a3cfbb; color: var(--ok); }
.file-failed, .file-purged { background: #fde8e8; border-color: #f3b8b5; color: var(--danger); }
.file-dropzone {
  padding: 1.2rem; border: 2px dashed #adb5bd; border-radius: 6px;
  background: #f8f9fa; text-align: center; transition: border-color 0.12s, background 0.12s;
}
.file-dropzone.dragover { border-color: var(--brand); background: #fff1f1; }
.file-dropzone .btn { margin-left: 0.25rem; }
.file-selection { margin: 0.65rem 0 0; overflow-wrap: anywhere; }
.file-upload { padding: 1rem 0; }
.file-list { margin-top: 1rem; }
.file-row { padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.file-row:first-child { padding-top: 0; }
.file-row-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.75rem; }
.file-name { min-width: 0; overflow-wrap: anywhere; }
.file-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; margin-top: 0.4rem; color: var(--muted); font-size: 0.8rem; }
.detail-main > details.card[open] > .secret-intro { margin-top: 1rem; }
.detail-main > details.card[open] > .file-upload,
.detail-main > details.card[open] > .secret-intro,
.detail-main > details.card[open] > p:last-child {
  margin-left: 2rem; margin-right: 2rem;
}
.readiness {
  padding: 0.8rem 1rem; border-radius: 6px; margin: 1rem 0;
  display: flex; flex-direction: column; gap: 0.6rem;
  border: 1px solid var(--line); border-left: 4px solid var(--muted);
}
.readiness-copy { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1rem; }
.readiness-progress { height: 4px; overflow: hidden; border-radius: 1rem; background: #e9ecef; }
.progress-fill { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.readiness.ready .progress-fill { background: var(--ok); }
.readiness.ready { background: #d1e7dd; border-color: #a3cfbb; border-left-color: var(--ok); }
.readiness.notready { background: #fff5f5; border-color: #f3b8b5; border-left-color: var(--brand); }
.help { background: #f8f9fa; border-left: 3px solid var(--brand); padding: 0.6rem 0.8rem; white-space: pre-wrap; }
pre.answer { white-space: pre-wrap; background: #f1f3f5; padding: 0.6rem; border-radius: 4px; }
ul.comments { list-style: none; padding: 0; }
.comment { border: 1px solid var(--line); border-radius: 6px; background: var(--card); padding: 0.5rem 0.8rem; margin: 0.5rem 0; }
.comment.internal { background: #fffaf0; }
.comment p { margin: 0.3rem 0 0; white-space: pre-wrap; }
.comment-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 0.5rem; }
.comment-head > strong { overflow-wrap: anywhere; min-width: 0; }
/* Keep the timestamp on one line (a long author email pushes it to its own row
   rather than char-wrapping the date) and make it clearly secondary. */
.comment-head .comment-time { white-space: nowrap; font-size: 0.8rem; }

/* Item history as a stacked activity feed (a 5-column table did not fit). */
ul.history-feed { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.hist-entry { padding: 0.5rem 0; border-top: 1px solid var(--line); }
.hist-entry:first-child { border-top: 0; padding-top: 0.2rem; }
.hist-what { overflow-wrap: anywhere; }
.hist-meta { font-size: 0.8rem; margin-top: 0.1rem; overflow-wrap: anywhere; }

/* Rendered Markdown (safe DOM from md.js). Overrides inherited pre-wrap. */
.md { white-space: normal; overflow-wrap: anywhere; }
.answer.md { background: #f1f3f5; padding: 0.6rem; border-radius: 4px; }
.answer-preview { position: relative; margin-top: 0.6rem; cursor: text; }
.answer-preview .markdown-preview { margin-top: 0; padding-bottom: 1.65rem; }
.answer-edit-hint {
  position: absolute; right: 0.65rem; bottom: 0.4rem;
  color: var(--muted); font-size: 0.75rem; line-height: 1;
}
.answer-preview:hover .answer-edit-hint { color: var(--brand-dark); }
.answer-actions { justify-content: flex-end; }
.member-role { max-width: 12rem; padding: 0.25rem; border: 1px solid #adb5bd; border-radius: 4px; background: #fff; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0.4rem 0; }
.md ul, .md ol { margin: 0.4rem 0; padding-left: 1.4rem; }
.md li { margin: 0.15rem 0; }
.md :is(h1, h2, h3, h4, h5, h6) {
  margin: 0.6rem 0 0.3rem; padding: 0; border: 0; line-height: 1.25;
  text-transform: none; letter-spacing: normal;
}
.md h1 { font-size: 1.25rem; } .md h2 { font-size: 1.15rem; } .md h3 { font-size: 1.05rem; }
.md :is(h4, h5, h6) { font-size: 1rem; }
.md code { background: #e9ecef; padding: 0.05rem 0.3rem; border-radius: 3px; font-size: 0.9em; }
.md pre.md-code { background: #f1f3f5; padding: 0.6rem 2.4rem 0.6rem 0.6rem; border-radius: 4px;
  position: relative; white-space: pre-wrap; overflow-wrap: anywhere; }
.md pre.md-code .btn { position: absolute; top: 0.35rem; right: 0.35rem; width: 1.6rem; height: 1.6rem; padding: 0; color: var(--muted); }
.md pre.md-code .icon { width: 0.9rem; height: 0.9rem; }
.md pre.md-code code { background: none; padding: 0; }
.md blockquote { margin: 0.4rem 0; padding-left: 0.8rem; border-left: 3px solid var(--line); color: #555; }
.md a { color: var(--brand); }
.hint { font-size: 0.8rem; margin: 0.2rem 0 0; }
.celltext { display: inline-block; max-width: 28rem; white-space: pre-wrap; overflow-wrap: anywhere; vertical-align: top; font-size: 0.85rem; }
/* Audit detail: aligned key/value rows; values wrap within the column. The
   Detail column takes the width freed by dropping the Object column. */
/* Fixed layout so Detail gets a guaranteed-wide column instead of being
   starved by auto-layout. Detail (6th col, no explicit width) takes the rest. */
table.audit-table { table-layout: fixed; }
table.audit-table td { overflow-wrap: break-word; }
table.audit-table th:nth-child(1), table.audit-table td:nth-child(1) { width: 9.5rem; }
table.audit-table th:nth-child(2), table.audit-table td:nth-child(2) { width: 14rem; }
table.audit-table th:nth-child(3), table.audit-table td:nth-child(3) { width: 8rem; }
table.audit-table th:nth-child(4), table.audit-table td:nth-child(4) { width: 9rem; }
table.audit-table th:nth-child(5), table.audit-table td:nth-child(5) { width: 8.5rem; }
/* Inline key + value per row: the value gets the full detail width instead of
   competing with a fixed key column, so a plain email never collapses. */
.audit-detail { font-size: 0.85rem; }
.audit-detail .ad-row { margin: 0.1rem 0; overflow-wrap: break-word; }
.audit-detail .ad-key { color: var(--muted); margin-right: 0.35rem; }
/* Truncated opaque values (links, hashes) stay on one line. */
.audit-detail .trunc { white-space: nowrap; }
.invite-link { word-break: break-all; }
.copyable { display: inline-flex; align-items: center; gap: 0.4rem; max-width: 100%; }
.copyable code { flex: 1; min-width: 0; word-break: break-all; }
.copyable .btn { flex: none; }
details.card summary { cursor: pointer; font-weight: 500; }
.topbar .linklike {
  background: none; border: none; color: #fff; font: inherit; cursor: pointer;
  padding: 0; margin-left: 1rem;
}
.topbar .linklike:hover { color: var(--brand); }
.topbar { position: relative; }
.burger { display: none; background: none; border: 1px solid #444; color: #fff;
  font-size: 1.2rem; line-height: 1; padding: 0.2rem 0.55rem; border-radius: 4px; cursor: pointer; }
.burger:hover { border-color: var(--brand); color: var(--brand); }
.navmenu { display: flex; align-items: center; gap: 0.2rem; min-width: 0; }
.navmenu .email { color: #9aa0a6; max-width: 16rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   Dashboard: sidebar item list + detail pane (master–detail)
   ========================================================================== */
body[data-page="e"] main { max-width: 84rem; }
body[data-page="admin"] main { max-width: 84rem; }

.dash {
  display: grid; grid-template-columns: 23rem minmax(0, 1fr); gap: 1.2rem;
  align-items: start;
}
.side {
  position: sticky; top: 1rem; align-self: start;
  max-height: calc(100vh - 5.5rem);
  display: flex; flex-direction: column; gap: 0.5rem;
}
.side-head .eng-title { font-size: 1.05rem; margin: 0; line-height: 1.3; }
.side-head .eng-desc { font-size: 0.85rem; margin: 0.3rem 0; }
.side-head .eng-dates { font-size: 0.85rem; margin: 0.3rem 0; display: flex; flex-direction: column; gap: 0.1rem; }
.side-head .row-between { align-items: flex-start; gap: 0.75rem; }
.side-head .row-between > .editable,
.side-head .row-between > .eng-title { flex: 1; min-width: 0; }
.side-head .issue-header-actions { flex: none; white-space: nowrap; }
.side-head .manage-btn { white-space: nowrap; }
.side-actions { margin: 0.3rem 0 0.2rem; }
.side .readiness { margin: 0.4rem 0; }
.side-stats { font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.1rem; }
.side-stats .mine-stat { color: var(--brand-dark); font-weight: 600; }
.side .item-filters { margin: 0.5rem 0 0.3rem; }
.side .filter-count { margin: 0 0 0.2rem; }
.side .keyboard-hint { margin: 0 0 0.4rem; }

/* Manage menu (engagement-wide sections) */
.manage-wrap { position: relative; display: inline-block; }
.manage-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; min-width: 12rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.14); padding: 0.3rem; display: flex; flex-direction: column;
}
.manage-opt {
  text-align: left; background: none; border: none; cursor: pointer; font: inherit;
  color: var(--fg); padding: 0.4rem 0.55rem; border-radius: 4px;
}
.manage-opt:hover { background: #f1f3f5; }
.manage-opt.danger { color: var(--danger); }

/* Item list — the only part of the sidebar that scrolls, so the Manage
   dropdown in the header can overflow freely. */
.item-list { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 5rem; overflow-y: auto; }
.sec-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
  color: var(--muted); padding: 0.7rem 0.25rem 0.25rem; border-bottom: 1px solid var(--line);
}
.sec-head .sec-count { font-weight: 500; }
.item-entry {
  display: flex; flex: 0 0 auto; align-items: stretch; gap: 0.35rem;
  border-bottom: 1px solid var(--line); overflow: hidden; transition: background-color 0.1s;
}
.item-select-slot {
  flex: none; align-self: center; display: grid; place-items: center;
  width: 1rem; height: 1rem; margin-left: 0.65rem;
}
.item-entry .item-check { display: none; width: 1rem; height: 1rem; margin: 0; cursor: pointer; accent-color: #adb5bd; }
.item-entry.has-check .item-select-slot:hover .issue-icon, .item-entry.bulk-active .issue-icon { display: none; }
.item-entry.has-check .item-select-slot:hover .item-check, .item-entry.bulk-active .item-check { display: block; }
.entry-main {
  flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) auto;
  gap: 0.55rem; align-items: center; text-align: left;
  background: none; border: none; font: inherit; cursor: pointer; color: var(--fg);
  padding: 0.6rem 0.5rem;
}
/* Slug is a secondary locator — mute it so the title reads as primary and the
   two stop competing in the narrow sidebar. */
.entry-main .cell-ref { color: var(--muted); }
.entry-main:hover { background: #f1f3f5; }
.item-entry:hover { box-shadow: inset 2px 0 0 var(--grey); }
.entry-title { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.entry-title .cell-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.entry-main .cell-state { text-align: right; }
/* Selection: keyboard cursor = a quiet grey wash + a focus ring for a11y;
   the open item = light brand wash + a single left accent bar. One red cue. */
.item-entry.keyboard-selected { background: #f1f3f5; box-shadow: inset 3px 0 0 var(--grey); }
.entry-main:focus-visible { outline: none; }
.item-entry.active { background: #fff2f2; box-shadow: inset 3px 0 0 var(--brand); }
.item-entry.active .entry-main:hover { background: #ffe9e9; }
.item-entry.active.keyboard-selected { background: #ffeaea; }
.item-entry.selected { background: #fff2f2; }
.item-entry.selected.active { background: #ffe3e3; }
.add-item-btn { margin: 0.7rem 0.25rem; align-self: flex-start; }

/* Detail pane */
.detail-wrap { min-width: 0; }
.detail-back { display: none; margin-bottom: 0.6rem; }
.welcome { padding: 3rem 1rem; text-align: center; }
/* Client orientation shown before an item is picked — left-aligned and
   top-anchored like the item detail, not a centered hero, so it matches the
   rest of the app. */
.welcome-guide { max-width: 46rem; }
.welcome-title { font-size: 1.5rem; margin: 0 0 0.8rem; }
.welcome-lead { margin: 0 0 1.2rem; }
.welcome-steps { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.7rem; }
.welcome-steps li { padding-left: 0.2rem; }
.welcome-foot { margin: 1.4rem 0 0; }
.item-detail { display: grid; grid-template-columns: minmax(0,1fr) 19rem; gap: 1.3rem; align-items: start; }
.detail-main { min-width: 0; overflow-wrap: anywhere; }
.detail-main .crumbs {
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; margin: 0 0 0.2rem;
}
.detail-main .crumbs .cell-ref { color: var(--brand-dark); }
/* Section crumb is a click-to-filter control; inherits the crumbs' uppercase. */
.crumbs .crumb-link {
  background: none; border: none; padding: 0; font: inherit; cursor: pointer;
  color: var(--muted); text-transform: uppercase; letter-spacing: inherit;
}
.crumbs .crumb-link:hover { color: var(--brand-dark); text-decoration: underline; }
/* Current assignee shown inline in the Assign card's summary (no duplicate fact). */
.detail-rail .assign-current { color: var(--muted); font-weight: 400; }
/* Active section filter — reads as an engaged control, like the mine toggle. */
.section-chip { align-self: flex-start; background: #000; border-color: #000; color: #fff; }
.section-chip:hover { background: #222; border-color: #222; color: #fff; }
.detail-head .item-title { font-size: 1.5rem; margin: 0.1rem 0 0.4rem; }
.detail-head .chips { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.4rem; }
.detail-rail { min-width: 0; display: flex; flex-direction: column; }
@media (min-width: 1351px) {
  .dash.show-detail:not(.full-detail) .detail-rail { position: sticky; top: 1rem; }
}
.detail-rail .card, .detail-rail details.card { margin: 0 0 0.9rem; }
/* Item facts card (assignee, due, …) — GitHub-style label/value stack. */
.detail-facts { display: flex; flex-direction: column; gap: 0.6rem; }
.detail-facts .fact { display: flex; flex-direction: column; gap: 0.1rem; }
.detail-facts .fact-k {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 600;
}
.detail-facts .fact-v { font-size: 0.9rem; overflow-wrap: anywhere; }

/* Bulk action toolbar — sticky along the bottom (appears when items selected) */
.bulk-bar {
  position: sticky; bottom: 0.6rem; z-index: 25;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  padding: 0.5rem 0.7rem; margin: 0.8rem 0 0;
  box-shadow: 0 -2px 14px rgba(0,0,0,0.1);
}
.bulk-bar .bulk-pop { top: auto; bottom: calc(100% + 4px); }
.bulk-bar .bulk-count { font-weight: 600; margin-right: 0.3rem; }
/* Match .btn.small metrics so buttons, selects and inputs line up uniformly. */
.bulk-bar .btn, .bulk-bar select, .bulk-bar input {
  height: 1.9rem; box-sizing: border-box; font: inherit; font-size: 0.85rem;
  padding: 0 0.5rem; border: 1px solid #adb5bd; border-radius: 4px;
  background: #fff; color: var(--fg); vertical-align: middle;
}
.bulk-bar .btn { display: inline-flex; align-items: center; justify-content: center; }
.bulk-bar .bulk-status { margin-left: auto; }

/* Anchored popovers for input-needing actions (Assign, Due, Waive, …) */
.bulk-menu { position: relative; display: inline-flex; }
.bulk-pop {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 30;
  min-width: 13rem; padding: 0.4rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.14);
}
.bulk-pop .pop-col { display: flex; flex-direction: column; gap: 0.35rem; }
.bulk-pop .pop-row { display: flex; align-items: center; gap: 0.35rem; }
.bulk-pop .pop-filter { width: 100%; }
.bulk-pop .pop-comment {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 0.85rem;
  padding: 0.3rem 0.4rem; border: 1px solid #adb5bd; border-radius: 4px; resize: vertical;
}
.bulk-pop .pop-list { display: flex; flex-direction: column; max-height: 14rem; overflow-y: auto; }
.bulk-pop .pop-opt {
  text-align: left; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 0.85rem; color: var(--fg);
  padding: 0.3rem 0.4rem; border-radius: 3px;
}
.bulk-pop .pop-opt:hover { background: #f1f3f5; }
.cell-ref { font-family: "Roboto Mono", monospace; font-size: 0.85rem; font-weight: 500; }

/* Click-to-edit affordance (ES only; elements get .editable) */
.editable { cursor: text; }
.editable:hover { outline: 1px dashed var(--brand); outline-offset: 3px; }
.inline-editor input, .inline-editor textarea {
  width: 100%; padding: 0.4rem 0.5rem; border: 1px solid var(--brand);
  border-radius: 4px; font: inherit; margin-bottom: 0.3rem;
}
.readiness.closed { background: #e9ecef; border-left-color: var(--muted); color: var(--muted); }
.hint { font-size: 0.85rem; margin: 0.2rem 0 0.6rem; }

/* Combobox (assignee, and future add-or-pick fields) */
.combo { position: relative; }
.combo-menu {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20;
  background: var(--card); border: 1px solid var(--line); border-top: none;
  border-radius: 0 0 4px 4px; max-height: 14rem; overflow-y: auto;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.combo-opt { padding: 0.4rem 0.6rem; cursor: pointer; }
.combo-opt:hover, .combo-opt.active { background: #f1f3f5; }

/* "Assigned to you" markers */
.you-badge { display: inline-block; background: var(--brand); color: #fff; font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em; padding: 0.05rem 0.4rem; border-radius: 3px; }

/* Checklist filtering */
.item-filters {
  display: flex; align-items: center; gap: 0.6rem; margin: 1rem 0 0.5rem;
}
.item-filters input[type="search"] {
  flex: 1; min-width: 10rem; padding: 0.5rem 0.65rem; border: 1px solid var(--line);
  border-radius: 4px; background: var(--card); color: var(--fg); font: inherit;
}
.item-filters input[type="search"]:focus {
  outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand);
}
.filter-toggle { display: inline-flex; align-items: center; gap: 0.35rem; white-space: nowrap; }
.filter-toggle.active { background: #000; border-color: #000; color: #fff; }
.filter-toggle.active:hover { background: #222; color: #fff; }
.filter-count { margin-left: auto; white-space: nowrap; }
.no-filter-results { margin-top: 0.5rem; }
.open-zero {
  min-height: 26rem; display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 3rem 1rem; text-align: center;
}
.open-zero-icon {
  display: grid; place-items: center; width: 5.5rem; height: 5.5rem;
  border: 2px solid var(--ok); border-radius: 50%; color: var(--ok); background: #eef8f2;
}
.open-zero-icon .icon { width: 3rem; height: 3rem; stroke-width: 1.7; }
.open-zero h2 { margin: 1.25rem 0 0.35rem; padding: 0; border: 0; font-size: 1.5rem; text-transform: none; letter-spacing: normal; }
.open-zero p { margin: 0 0 1rem; color: var(--muted); }
.keyboard-hint { margin: 0 0 0.5rem; font-size: 0.8rem; }
.keyboard-help { width: min(30rem, calc(100% - 2rem)); border: 1px solid var(--line);
  border-radius: 8px; padding: 1rem 1.2rem; box-shadow: 0 14px 40px rgba(0,0,0,0.25); }
.keyboard-help::backdrop { background: rgba(0,0,0,0.45); }
.keyboard-help h2 { margin: 0; border: 0; padding: 0; }
.keyboard-help dl { display: grid; grid-template-columns: 8rem 1fr; gap: 0.65rem 1rem; margin-bottom: 0; }
.keyboard-help dt, .keyboard-help dd { margin: 0; }
kbd { display: inline-block; min-width: 1.6rem; padding: 0.05rem 0.35rem; border: 1px solid #adb5bd;
  border-bottom-width: 2px; border-radius: 4px; background: #f8f9fa; font-family: "Roboto Mono", monospace;
  font-size: 0.8rem; text-align: center; }

/* --------------------------------------------------------------------------
   Responsive / smartphone support
   -------------------------------------------------------------------------- */
.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

@media (max-width: 640px) {
  main { margin: 1rem auto 3rem; padding: 0 0.8rem; }
  h1 { font-size: 1.25rem; }

  /* Topbar: keep the logo and sign-out; truncate the email instead of overflowing */
  .topbar { padding: 0.5rem 0.8rem; gap: 0.5rem; }
  .topbar .brand { gap: 0.5rem; min-width: 0; flex-shrink: 0; }
  .topbar .brand img { height: 22px; }
  .topbar .brand span { display: none; }
  /* Collapse nav into a burger menu */
  .burger { display: block; }
  .navmenu {
    display: none; position: absolute; top: 100%; right: 0.6rem;
    flex-direction: column; align-items: stretch; gap: 0;
    background: #111; border: 1px solid #333; border-radius: 6px;
    min-width: 13rem; padding: 0.3rem; z-index: 30; box-shadow: 0 8px 20px rgba(0,0,0,0.45);
  }
  .navmenu.open { display: flex; }
  .navmenu .email { color: #ebe2d5; max-width: none; white-space: normal; overflow-wrap: anywhere;
    padding: 0.55rem 0.7rem; border-bottom: 1px solid #333; margin-bottom: 0.2rem; font-size: 0.85rem; }
  .navmenu a, .navmenu .linklike { margin: 0; padding: 0.65rem 0.7rem; text-align: left;
    border-radius: 4px; font-size: 0.95rem; }
  .navmenu a:hover, .navmenu .linklike:hover { background: #242424; color: #fff; }

  .grid2 { grid-template-columns: 1fr; }
  .row-between { flex-wrap: wrap; }
  .item-filters { flex-wrap: wrap; }
  .item-filters input[type="search"] { flex-basis: 100%; }
  .filter-count { margin-left: 0; }

  /* Comfortable tap targets */
  .btn { padding: 0.5rem 0.9rem; }
  .btn.small { padding: 0.3rem 0.6rem; font-size: 0.85rem; }

  /* Tables: preserve compact controls and scroll instead of crushing words. */
  table.list th, table.list td { padding: 0.4rem 0.5rem; }
  table.list th, table.list .btn { white-space: nowrap; }
  table.list td { overflow-wrap: break-word; }
  .celltext { max-width: 13rem; }
}

/* Detail rail stacks under the answer on narrower screens */
@media (max-width: 1000px) {
  .item-detail { grid-template-columns: 1fr; }
}

/* Phones/tablets: show one pane at a time (list ↔ detail) */
@media (max-width: 800px) {
  body[data-page="e"] main { max-width: none; }
  .dash { grid-template-columns: 1fr; gap: 0; }
  .side { position: static; max-height: none; overflow: visible; }
  .detail-wrap { display: none; }
  .dash.show-detail .side { display: none; }
  .dash.show-detail .detail-wrap { display: block; }
  .detail-back { display: inline-block; }
}

/* Expandable secret rows (inline, like items) */
details.secret-row { padding: 0; margin: 0.4rem 0; }
details.secret-row > summary { padding: 0.6rem 0.9rem; list-style: none; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
details.secret-row > summary::-webkit-details-marker { display: none; }
details.secret-row > summary::before { content: "\203A"; color: var(--muted); margin-right: 0.2rem; transition: transform 0.12s; }
details.secret-row[open] > summary::before { transform: rotate(90deg); }
details.secret-row[open] > summary { border-bottom: 1px solid var(--line); }
.secret-row .secret-sub { font-weight: 400; }
.secret-body { padding: 0.3rem 0.9rem 0.8rem; }
.secret-body table.kv th { padding-right: 1rem; white-space: nowrap; color: var(--muted); }

/* GitLab-inspired readiness view: issue list first, split detail on demand. */
body[data-page="e"] main { max-width: none; margin: 1rem auto; padding: 0 1.25rem; }
.dash { display: block; }
.side {
  position: static; max-height: none; width: 100%;
  display: flex; flex-direction: column; gap: 0;
}
.side-head { padding: 0.2rem 0 0.8rem; }
.side-head .eng-title { font-size: 1.35rem; margin: 0.15rem 0; }
.side-head .eng-desc { max-width: 65rem; margin: 0.3rem 0; }
.portal-crumbs { margin: 0 0 0.4rem; color: var(--muted); font-size: 0.85rem; }
.portal-crumbs a { color: var(--muted); text-decoration: none; }
.portal-crumbs a:hover { color: var(--brand-dark); text-decoration: underline; }
.issue-header-actions, .issue-list-head, .issue-list-actions, .filter-summary, .detail-tools {
  display: flex; align-items: center; gap: 0.5rem;
}
.issue-list-actions .btn { white-space: nowrap; }
.side .readiness { margin: 0 0 0.9rem; }
.client-task-panel {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  margin: 0 0 0.9rem; padding: 0.8rem 1rem; border: 1px solid var(--line);
  border-left: 4px solid var(--brand); border-radius: 6px; background: var(--card);
}
.client-task-copy { min-width: 0; }
.client-task-copy p { margin: 0.15rem 0 0; color: var(--muted); }
.client-task-actions { display: flex; align-items: center; gap: 0.5rem; flex: none; }
.workspace-nav {
  display: flex; gap: 0.35rem; margin: -0.2rem 0 0.55rem; padding: 0.2rem 0 0.55rem;
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none;
}
.workspace-nav::-webkit-scrollbar { display: none; }
.workspace-nav button {
  display: inline-flex; flex: none; align-items: center; gap: 0.4rem; padding: 0.35rem 0.55rem;
  border: 0; border-radius: 4px; background: none; color: var(--fg); font: inherit; cursor: pointer;
}
.workspace-nav button:hover { background: #f1f3f5; }
.workspace-nav .icon { color: var(--muted); }
.workspace-count {
  min-width: 1.25rem; padding: 0 0.3rem; border-radius: 1rem; background: #e9ecef;
  color: var(--muted); font-size: 0.72rem; text-align: center;
}
.issue-list-head { justify-content: space-between; border-bottom: 1px solid var(--line); }
.shortcuts-btn { min-width: 2.35rem; font-weight: 700; }
.issue-tabs { display: flex; align-items: stretch; gap: 0.25rem; }
.issue-tab {
  display: flex; align-items: center; gap: 0.4rem; padding: 0.7rem 0.8rem 0.6rem;
  border: 0; border-bottom: 2px solid transparent; background: none; color: var(--fg);
  font: inherit; font-weight: 500; cursor: pointer;
}
.issue-tab:hover { border-bottom-color: var(--grey); }
.issue-tab.active { border-bottom-color: var(--brand); font-weight: 700; }
.issue-count {
  min-width: 1.35rem; padding: 0 0.35rem; border-radius: 1rem;
  background: #e9ecef; color: var(--muted); font-size: 0.75rem; text-align: center;
}
.side .item-filters { margin: 0.8rem 0 0.45rem; }
.filter-summary { min-height: 1.8rem; margin-bottom: 0.25rem; }
.filter-summary .filter-count { margin-left: auto; }
.filter-summary .mine-stat { color: var(--brand-dark); font-size: 0.85rem; }
.issue-legend { position: relative; font-size: 0.82rem; }
.issue-legend > summary { cursor: pointer; color: var(--muted); }
.legend-pop {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; width: 19rem;
  display: flex; flex-direction: column; gap: 0.55rem; padding: 0.65rem;
  border: 1px solid var(--line); border-radius: 5px; background: var(--card);
  box-shadow: 0 6px 16px rgba(0,0,0,0.14); color: var(--fg);
}
.legend-pop > span { display: flex; align-items: center; gap: 0.45rem; }
.section-chip { align-self: auto; }
.item-list { min-height: 5rem; overflow: visible; border-top: 1px solid var(--line); }
.item-entry { min-height: 4rem; gap: 0.2rem; }
.entry-main {
  grid-template-columns: minmax(0, 1fr) auto; gap: 0.7rem;
  padding: 0.7rem 0.75rem; min-height: 4rem;
}
.icon { width: 1rem; height: 1rem; display: inline-block; flex: none; vertical-align: -0.15em; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; }
.issue-icon { display: inline-flex; width: 1rem; height: 1rem; color: var(--cyan-dark); }
.issue-icon .icon { width: 100%; height: 100%; }
.issue-copy { display: flex; min-width: 0; flex-direction: column; gap: 0.08rem; }
.entry-title { font-weight: 600; }
.entry-meta { color: var(--muted); font-size: 0.82rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-main .cell-state { margin-left: 0.5rem; }
.item-entry.active { background: #eef7fb; box-shadow: inset 3px 0 0 var(--cyan-dark); }
.item-entry.active:hover { box-shadow: inset 3px 0 0 var(--cyan-dark); }
.item-entry.active .entry-main:hover { background: #e5f3f9; }
.detail-wrap { display: none; min-width: 0; }
.detail-tools {
  justify-content: flex-end; position: sticky; top: 0; z-index: 10;
  margin: 0 0 0.8rem; padding: 0 0 0.65rem; background: var(--bg); border-bottom: 1px solid var(--line);
}
.detail-tools .detail-close { order: 2; }
.detail-tools .icon-btn, .detail-tools .detail-close {
  width: 2rem; height: 2rem; padding: 0; border-radius: 4px;
  display: inline-flex; align-items: center; justify-content: center;
}
.detail-tools .icon { width: 1rem; height: 1rem; }
.dash.show-detail {
  display: grid; grid-template-columns: minmax(28rem, 34rem) minmax(0, 1fr);
  gap: 1rem; align-items: start;
}
.dash.show-detail .side {
  position: sticky; top: 1rem; max-height: calc(100vh - 2rem);
  padding-right: 0.7rem;
}
.dash.show-detail .workspace-nav { gap: 0.15rem; }
.dash.show-detail .workspace-nav button { gap: 0.25rem; padding-inline: 0.3rem; font-size: 0.9rem; }
.dash.show-detail .issue-tab { padding-inline: 0.45rem; }
.dash.show-detail .issue-list-actions { gap: 0.35rem; }
.dash.show-detail .issue-list-actions .btn { padding-inline: 0.6rem; }
.dash.show-detail .side-head .eng-desc,
.dash.show-detail .side-head .eng-dates,
.dash.show-detail .side > .readiness,
.dash.show-detail .side > .client-task-panel { display: none; }
.dash.show-detail .item-list { overflow-y: auto; }
.dash.show-detail .detail-wrap {
  display: block; overflow: visible; padding-right: 0.25rem;
}
.dash.show-detail:not(.full-detail) .item-detail {
  grid-template-columns: minmax(0, 1fr) 16rem; gap: 1.3rem;
}
.dash.show-detail:not(.full-detail) .detail-rail {
  border-left: 1px solid var(--line); padding-left: 1rem;
}
.dash.full-detail, .dash.engagement-view { display: block; }
.dash.full-detail .side, .dash.engagement-view .side { display: none; }
.dash.full-detail .detail-wrap, .dash.engagement-view .detail-wrap {
  display: block; max-width: 78rem; max-height: none; overflow: visible; margin: 0 auto; padding: 0;
}
.dash.full-detail .detail-tools, .dash.engagement-view .detail-tools { top: 0; }
.dash.engagement-view .detail-tools { display: none; }

@media (max-width: 1280px) {
  body[data-page="e"] main { padding: 0 0.8rem; }
  .dash.show-detail { display: block; }
  .dash.show-detail .side { display: none; }
  .dash.show-detail .detail-wrap { display: block; max-height: none; overflow: visible; padding: 0; }
  .dash.show-detail:not(.full-detail) .item-detail { grid-template-columns: 1fr; }
  .dash.show-detail:not(.full-detail) .detail-rail {
    border-left: 0; border-top: 1px solid var(--line); padding: 1rem 0 0;
  }
  .detail-tools { position: static; justify-content: flex-end; }
  .detail-tools .detail-expand { display: none; }
  .detail-tools .detail-close { order: 0; }
  .detail-tools .detail-close .mobile-only { display: none; }
  .detail-tools .detail-close .desktop-only { display: inline-flex; }
}

/* GitLab issue-list controls and metadata. */
.mobile-only { display: none; }
.issue-toolbar { display: flex; align-items: stretch; gap: 0.55rem; margin: 0.8rem 0 0.45rem; }
.issue-toolbar > .btn, .issue-toolbar > select { height: 2.6rem; }
.search-wrap { display: flex; flex: 1; }
.search-wrap input {
  flex: 1; min-width: 10rem; padding: 0.55rem 0.7rem; border: 1px solid #adb5bd;
  border-radius: 5px 0 0 5px; background: var(--card); color: var(--fg); font: inherit;
}
.search-wrap input:focus { outline: 2px solid var(--brand); outline-offset: -1px; z-index: 1; }
.search-wrap .search-button { border-radius: 0 5px 5px 0; margin-left: -1px; font-size: 1.1rem; }
.sort-select {
  min-width: 0; padding: 0.45rem 2rem 0.45rem 0.65rem; border: 1px solid #adb5bd; border-radius: 5px;
  background: var(--card); color: var(--fg); font: inherit; font-weight: 500;
}
.dash.show-detail .issue-toolbar { flex-wrap: wrap; }
.dash.show-detail .search-wrap { flex: 1 0 100%; min-width: 0; }
.dash.show-detail .search-wrap input { min-width: 0; }
.dash.show-detail .sort-select { flex: 1 1 12rem; }
.dash.show-detail .issue-filter-pop { left: 0; right: auto; }
.issue-filter-menu { position: relative; }
.issue-filter-menu > summary {
  list-style: none; white-space: nowrap; display: inline-flex; align-items: center;
  justify-content: center; gap: 0.4rem; height: 2.6rem; padding: 0 0.8rem;
}
.issue-filter-menu > summary::-webkit-details-marker { display: none; }
.issue-filter-menu > summary .icon { width: 0.95rem; height: 0.95rem; }
.issue-filter-menu > summary.active { background: #f1f3f5; border-color: var(--fg); }
.issue-filter-pop {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30; width: 18rem;
  padding: 0.65rem; border: 1px solid var(--line); border-radius: 5px;
  background: var(--card); box-shadow: 0 6px 16px rgba(0,0,0,0.14);
}
.issue-filter-pop label { margin: 0 0 0.55rem; font-size: 0.8rem; }
.issue-filter-pop label:last-child { margin-bottom: 0; }
.issue-filter-pop select {
  display: block; width: 100%; margin-top: 0.2rem; padding: 0.4rem;
  border: 1px solid #adb5bd; border-radius: 4px; background: #fff; font: inherit;
}
.entry-labels { display: flex; gap: 0.3rem; margin-top: 0.15rem; }
.issue-label {
  display: inline-block; padding: 0.02rem 0.4rem; border: 1px solid var(--line);
  border-radius: 1rem; background: #f1f3f5; color: #495057; font: inherit;
  font-size: 0.7rem; font-weight: 600; line-height: 1.35;
}
button.issue-label { cursor: pointer; }
.section-label { border-color: #a9ddf2; background: #e2f4fb; color: var(--cyan-dark); }
.required-label { border-color: #f3b8b5; background: #fde8e8; color: var(--danger); }
.entry-meta { margin-top: 0.15rem; }

/* GitLab issue-detail hierarchy: title/byline, description, activity, metadata rail. */
.detail-head { padding-bottom: 0.85rem; border-bottom: 1px solid var(--line); }
.detail-head .item-title { font-size: 1.65rem; line-height: 1.2; margin: 0 0 0.35rem; }
.issue-byline { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin: 0; color: var(--muted); }
.detail-head .chips { margin: 0.6rem 0 0; }
.issue-description { padding: 1rem 0 0.4rem; }
.issue-description h2, .answer-heading {
  margin: 0 0 0.6rem; padding: 0; border: 0; text-transform: none;
  letter-spacing: normal; font-size: 1.1rem;
}
.issue-description .help { background: transparent; border-left: 0; padding: 0; }
.answer-heading { margin-top: 1.1rem; }
.rail-section { border-bottom: 1px solid var(--line); padding: 0 0 0.85rem; margin-bottom: 0.85rem; }
.rail-section > h3, .rail-heading h3 { margin: 0 0 0.65rem; font-size: 0.95rem; }
.rail-heading { display: flex; justify-content: space-between; align-items: baseline; }
.status-current { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.status-current .hint { margin: 0; }
.status-primary-action { margin-top: 0.75rem; }
.status-section .status-actions { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.75rem; }
.status-section .action-group + .action-group {
  padding-top: 0.7rem; border-top: 1px solid var(--line);
}
.status-section textarea { width: 100%; }
.status-section .btnrow { margin-bottom: 0; }
.rail-edit { padding: 0; border: 0; background: none; color: var(--brand-dark); font: inherit; cursor: pointer; }
.assignee-value { overflow-wrap: anywhere; }
.rail-value-button {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  color: var(--fg); font: inherit; text-align: left; cursor: pointer;
}
.rail-value-button:hover { color: var(--brand-dark); text-decoration: underline; }
.rail-editor { margin-top: 0.7rem; }
.rail-editor > input, .rail-editor > select {
  display: block; width: 100%; padding: 0.4rem; border: 1px solid #adb5bd;
  border-radius: 4px; background: #fff; font: inherit;
}
.rail-editor label { font-size: 0.82rem; }
.detail-facts { gap: 0.75rem; }
.detail-rail > details.card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 0 0.85rem; }
.item-resource-actions {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 0.5rem;
  margin: 1rem 0 0.75rem;
}
.item-resource-actions .btn { display: inline-flex; align-items: center; gap: 0.4rem; }
.item-resource-actions .icon { width: 1rem; height: 1rem; }
.item-resource-panel { margin: 0.75rem 0 1rem; }
.item-resource-panel .file-upload { padding: 0; }
.item-resource-list { margin: 1rem 0; padding-top: 1rem; border-top: 1px solid var(--line); }
.item-resource-list > h3 { margin: 0 0 0.6rem; font-size: 1rem; }
.item-resource-list .file-list { margin-top: 0; }
.activity-section { margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.activity-head { display: flex; justify-content: space-between; align-items: center; }
.activity-head h2 {
  margin: 0; padding: 0; border: 0; text-transform: none; letter-spacing: normal; font-size: 1.2rem;
}
.activity-section > form.card { margin-bottom: 0; }
.engagement-view-head { max-width: 72rem; padding-bottom: 1.25rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.engagement-view-head .portal-crumbs { margin-bottom: 0.7rem; }
.crumb-button { padding: 0; border: 0; background: none; color: var(--muted); font: inherit; cursor: pointer; }
.crumb-button:hover { color: var(--brand-dark); text-decoration: underline; }
.engagement-view-title { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; }
.engagement-view-title h1 { margin: 0; font-size: 1.65rem; }
.engagement-view-title p { margin: 0.15rem 0 0; font-size: 0.95rem; }
.engagement-view-actions { display: flex; align-items: center; gap: 0.65rem; flex: none; }
.engagement-back {
  display: inline-flex; align-items: center; gap: 0.35rem; padding: 0;
  border: 0; background: none; color: var(--brand-dark); font: inherit; font-weight: 500; cursor: pointer;
}
.engagement-back:hover { color: #991818; text-decoration: underline; }
.engagement-back .icon { width: 0.9rem; height: 0.9rem; }
.pane-section { max-width: 72rem; }
.engagement-view .pane-section > h2:first-child { display: none; }
.pane-intro { margin: -0.1rem 0 1rem; }
.resource-entry { margin-bottom: 1rem; }
.resource-context { margin: 0 0 0.25rem; font-weight: 600; }
.invite-member { margin-top: 1rem; }
.members-table td { vertical-align: middle; }
.detail-main > details.card {
  padding: 0; overflow: hidden; transition: border-color 0.1s, background-color 0.1s;
}
.detail-main > details.card:hover { border-color: #adb5bd; }
.detail-main > details.card > summary { padding: 0.85rem 1rem; }
.detail-main > details.card[open] > summary { border-bottom: 1px solid var(--line); background: #f8f9fa; }
.detail-main > details.card[open] > :not(summary) { margin-left: 1rem; margin-right: 1rem; }

@media (max-width: 640px) {
  .side-head .row-between { align-items: flex-start; }
  .readiness-copy { display: block; }
  .readiness-copy span { display: block; margin-top: 0.15rem; }
  .detail-head .item-title { font-size: 1.45rem; }
  .issue-description { padding-top: 0.8rem; }
  .detail-main > .card, .detail-main > details.card, .activity-section > form.card { border-radius: 5px; }
  .detail-rail { gap: 0; }
  .rail-section { padding: 0.85rem 0; margin: 0; }
  .members-pane .tablewrap { overflow: visible; }
  .members-table, .members-table tbody { display: block; border: 0; background: transparent; }
  .members-table thead { display: none; }
  .members-table tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.35rem 0.7rem;
    padding: 0.85rem 0; border-bottom: 1px solid var(--line);
  }
  .members-table td { display: block; padding: 0; border: 0; overflow-wrap: anywhere; }
  .members-table td:nth-child(1) { grid-column: 1 / -1; font-weight: 600; }
  .members-table td:nth-child(2) { grid-column: 1 / -1; color: var(--muted); }
  .members-table td:nth-child(3) { grid-column: 1; }
  .members-table td:nth-child(4) { grid-column: 2; grid-row: 3; }
  .members-table td:nth-child(5) { grid-column: 2; grid-row: 4; }
  .members-table .member-role { width: 100%; max-width: none; }
  .issue-header-actions { flex-wrap: wrap; justify-content: flex-end; }
  .client-task-panel { align-items: stretch; flex-direction: column; }
  .client-task-actions { flex-wrap: wrap; }
  .workspace-nav { overflow-x: auto; padding-bottom: 0.45rem; }
  .workspace-nav button { flex: none; }
  .issue-list-head { display: block; position: relative; padding-right: 5.2rem; }
  .issue-list-actions { position: absolute; right: 0; bottom: 0.3rem; }
  .issue-list-actions .shortcuts-btn { display: none; }
  .issue-list-actions .btn { min-width: 2.45rem; width: 2.45rem; padding: 0.45rem; }
  .mobile-only { display: inline-flex; align-items: center; font-size: 1.1rem; line-height: 1; }
  .desktop-only { display: none; }
  .issue-tab { padding-inline: 0.45rem; }
  .issue-toolbar { flex-wrap: wrap; }
  .search-wrap { flex-basis: 100%; }
  .issue-filter-menu { order: 2; }
  .issue-toolbar .filter-toggle { flex: 0 0 auto; }
  .sort-select { flex: 1; min-width: 8.5rem; }
  .item-entry { position: relative; }
  .item-select-slot { margin-left: 0.4rem; }
  .entry-main {
    position: relative; grid-template-columns: minmax(0, 1fr); gap: 0.55rem;
    padding: 0.8rem 0.4rem;
  }
  .entry-main .cell-state {
    position: absolute; right: 0.4rem; bottom: 0.8rem; margin: 0;
  }
  .entry-main .entry-meta { padding-right: 7.5rem; }
  .filter-summary .mine-stat { display: none; }
  .entry-labels { flex-wrap: wrap; }
  .engagement-view-title { align-items: flex-start; flex-direction: column; }
  .engagement-view-actions { width: 100%; justify-content: space-between; }
  .open-zero { min-height: 20rem; padding: 2rem 1rem; }
}

/* ---- Assurance portal additions ---------------------------------------- */
/* Passphrase gate */
.gate-card { max-width: 34rem; margin: 2rem auto; }
.gate label { display: block; font-weight: 600; margin: 0.75rem 0 0.3rem; }
.gate label.check { font-weight: 400; display: flex; align-items: center; gap: 0.4rem; }
.gate input[type="password"] { width: 100%; font: inherit; font-family: "Roboto Mono", ui-monospace, monospace; padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: 4px; }
.gate .btnrow { margin: 1rem 0 0.5rem; }
/* Decryption: each row resolves from ciphertext to plaintext */
.cipher-list { list-style: none; padding: 0; margin: 0; max-height: 60vh; overflow: auto; }
.cipher-row { padding: 0.2rem 0.4rem; border-bottom: 1px solid var(--line); font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cipher-row .cipher { color: var(--muted); letter-spacing: 0.02em; }
.cipher-row .plain { opacity: 0; }
.cipher-row.resolved { background: #f1f8f3; }
.cipher-row.resolved .plain { opacity: 1; transition: opacity 250ms ease-out; }
.topbar .linklike { background: none; border: 0; color: #fff; cursor: pointer; font: inherit; }
@media (prefers-reduced-motion: reduce) {
  .cipher-row.resolved .plain { transition: none; }
}
/* Portal layout */
.tabs { display: flex; gap: 0.25rem; border-bottom: 2px solid var(--line); margin: 1rem 0; }
.tabs .tab { padding: 0.5rem 0.9rem; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs .tab.active { color: var(--fg); border-bottom-color: var(--brand); }
.tabs .tab:hover { color: var(--fg); }
.portal-grid { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: 1rem; align-items: start; }
.portal-main .card:first-child, .portal-side .card:first-child { margin-top: 0; }
.plain-list { list-style: none; padding: 0; margin: 0.25rem 0; }
.plain-list li { padding: 0.1rem 0; }
.small { font-size: 0.85rem; }
.btnrow { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.back { margin: 0 0 0.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.25rem 0 1rem; }
/* Banner */
.banner { padding: 0.65rem 1rem; border-radius: 6px; border: 1px solid var(--line); background: var(--card); margin: 0 0 1rem; }
.state-banner.state-waiting-access, .state-banner.state-onboarding { background: #fff8df; border-color: #d8b35a; color: #684900; }
.state-banner.state-active { background: #eef8f1; border-color: #9fd3b1; color: #14532d; }
/* Chips */
.chip.sev-critical { background: #4a0000; border-color: #4a0000; color: #fff; }
.chip.sev-high { background: #fde8e8; border-color: #f3b8b5; color: #a30000; }
.chip.sev-medium { background: #fff4d6; border-color: #e8d28a; color: #7a5200; }
.chip.sev-low { background: #e6f5fb; border-color: #a8dcee; color: var(--cyan-dark); }
.chip.sev-informational { background: #f1f3f5; border-color: #dee2e6; color: var(--muted); }
.chip.status-open { background: #fff4d6; border-color: #e8d28a; color: #7a5200; }
.chip.status-fixed { background: #eef8f1; border-color: #9fd3b1; color: #14532d; }
.chip.status-not-applicable { background: #f1f3f5; border-color: #dee2e6; color: var(--muted); }
.chip.illustrative { background: #f1f3f5; border-color: #bcbec0; color: var(--muted); font-style: italic; }
.chip.depth-automated { background: #f1f3f5; color: var(--muted); }
.chip.depth-reviewed { background: #e6f5fb; border-color: #a8dcee; color: var(--cyan-dark); }
.chip.depth-deep-dive { background: #152235; border-color: #152235; color: #fff; }
.chip.kind-blocked { background: #fde8e8; border-color: #f3b8b5; color: #a30000; }
.chip.kind-unblocked, .chip.kind-retest { background: #eef8f1; border-color: #9fd3b1; color: #14532d; }
.chip.kind-report { background: #152235; border-color: #152235; color: #fff; }
.chip.kind-release-review { background: #fff4d6; border-color: #e8d28a; color: #7a5200; }
.chip.component { background: var(--card); }
/* Retest badges */
.badge.retest { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700; border: 1px solid transparent; transition: background-color 300ms, color 300ms; }
.badge.retest.large { font-size: 0.95rem; padding: 0.2rem 0.75rem; }
.badge.retest-pass { background: var(--ok); color: #fff; }
.badge.retest-fail { background: var(--danger); color: #fff; }
.badge.retest-none { background: #f1f3f5; color: var(--muted); border-color: var(--line); }
.awaiting { color: #7a5200; font-weight: 600; }
.label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); display: block; }
/* Findings table */
table.findings tbody tr { cursor: pointer; }
table.findings tbody tr:hover { background: #f8f9fa; }
/* Finding detail */
.finding-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 1rem; align-items: start; }
.finding-main .card.body h2 { margin-top: 1.25rem; }
.finding-main .card.body h2:first-child { margin-top: 0; }
.evidence-figure { margin: 1rem 0; }
.evidence-img { max-width: 100%; border: 1px solid var(--line); border-radius: 4px; }
.evidence-figure figcaption { font-size: 0.85rem; color: var(--muted); }
code.vector { font-size: 0.8rem; overflow-wrap: anywhere; }
table.cvss th { font-weight: 500; color: var(--muted); font-size: 0.85rem; }
table.cvss td { font-size: 0.9rem; }
/* Timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline .entry { padding: 0.75rem 0 0.75rem 1rem; border-left: 3px solid var(--line); margin-bottom: 0.25rem; }
.timeline .entry.kind-blocked { border-left-color: var(--danger); }
.timeline .entry.kind-unblocked, .timeline .entry.kind-retest { border-left-color: var(--ok); }
.timeline .entry.kind-report { border-left-color: #152235; }
.timeline .entry.kind-release-review { border-left-color: var(--warn); }
.entry-head { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-bottom: 0.25rem; }
.entry-date { font-weight: 600; min-width: 7rem; }
.entry-body p { margin: 0.25rem 0; }
.entry-findings { margin: 0.25rem 0 0; font-size: 0.9rem; }
.report-links { margin: 0.75rem 0; }
@media (max-width: 56rem) {
  .portal-grid, .finding-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Demo overlay: time bar */
body:has(#demo-bar:not([hidden])) main { margin-bottom: 6rem; }
#demo-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: #000; color: #fff; border-top: 3px solid var(--brand); box-shadow: 0 -2px 8px #0004; }
.demo-bar-inner { display: flex; align-items: center; gap: 1rem; max-width: 60rem; margin: 0 auto; padding: 0.6rem 1rem; }
.demo-tag { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand); font-weight: 700; }
.demo-slider { position: relative; flex: 1; height: 1.6rem; }
.demo-track { position: absolute; left: 0; right: 0; top: 0.55rem; height: 0.5rem; background: #333; border-radius: 3px; overflow: hidden; }
.demo-quiet { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, #5a5a5a 0 4px, #333 4px 8px); }
.demo-slider input[type="range"] { position: absolute; left: 0; right: 0; top: 0; width: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; height: 1.6rem; cursor: pointer; }
.demo-slider input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 1.6rem; }
.demo-slider input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 1rem; height: 1rem; margin-top: 0.3rem; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.demo-slider input[type="range"]::-moz-range-track { background: transparent; }
.demo-slider input[type="range"]::-moz-range-thumb { width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--brand); border: 2px solid #fff; }
.demo-labels { min-width: 13rem; font-size: 0.9rem; }
.demo-labels .demo-date { font-weight: 700; }
.demo-labels .muted { color: #9aa0a6; }
#demo-bar .btn { color: #fff; border-color: #666; background: transparent; }
#demo-bar .btn:hover { border-color: #fff; color: #fff; }
#demo-bar .btn.primary { border-color: var(--brand); }
#demo-bar .count { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 0.4rem; font-size: 0.75rem; margin-left: 0.2rem; }
@media (max-width: 56rem) {
  .demo-bar-inner { flex-wrap: wrap; gap: 0.5rem; }
  .demo-slider { flex-basis: 100%; }
}
/* Quiet period */
.quiet-banner { background: #f1f3f5; border-color: #bcbec0; color: #3b4147; }
.timeline .entry.quiet-band { border-left-color: #bcbec0; background: repeating-linear-gradient(45deg, #f8f9fa 0 6px, #f1f3f5 6px 12px); border-radius: 0 4px 4px 0; }
.chip.quiet { background: #f1f3f5; border-color: #bcbec0; color: #3b4147; }
/* Toasts */
#toasts { position: fixed; right: 1rem; bottom: 5.5rem; z-index: 40; display: flex; flex-direction: column; gap: 0.5rem; pointer-events: none; }
.toast { background: #152235; color: #fff; padding: 0.5rem 0.9rem; border-radius: 6px; box-shadow: 0 2px 8px #0005; font-size: 0.9rem; opacity: 0; transform: translateY(6px); transition: opacity 250ms, transform 250ms; max-width: 22rem; }
.toast.show { opacity: 1; transform: none; }
.toast strong { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: #9fd3b1; }
/* Notifications panel and email modal */
.panel-backdrop { position: fixed; inset: 0; background: #0006; z-index: 50; }
.panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(28rem, 100%); background: var(--card); z-index: 51; padding: 1rem 1.2rem; overflow: auto; box-shadow: -2px 0 10px #0004; }
.panel h2, .modal h2 { margin: 0.25rem 0; border: 0; }
.notif-list { list-style: none; padding: 0; margin: 0.5rem 0; }
.notif-list li { border-bottom: 1px solid var(--line); }
.notif-list a { display: block; padding: 0.5rem 0.2rem; text-decoration: none; color: var(--fg); }
.notif-list a:hover { background: #f8f9fa; }
.notif-list .notif-date { display: inline-block; min-width: 7rem; font-weight: 600; font-size: 0.85rem; }
.notif-list .notif-to { font-size: 0.8rem; }
.notif-list .notif-subject { display: block; }
.modal-host { position: fixed; inset: 0; z-index: 60; }
.modal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(36rem, 94vw); max-height: 90vh; overflow: auto; background: var(--card); border-radius: 8px; padding: 1rem 1.2rem; z-index: 61; box-shadow: 0 4px 24px #0006; }
.email-head th { color: var(--muted); font-weight: 500; }
.email-body { background: #f4f6f8; padding: 1rem; border-radius: 6px; margin-top: 0.75rem; }
.email-brand { background: #152235; color: #fff; font-weight: 700; font-size: 0.85rem; padding: 0.6rem 1rem; border-radius: 6px 6px 0 0; margin: -1rem -1rem 1rem; }
.email-body h3 { margin: 0 0 0.75rem; font-size: 1.1rem; }
@media (prefers-reduced-motion: reduce) {
  .toast { transition: none; }
}
/* Retest celebrations */
.celebration-canvas { position: fixed; pointer-events: none; z-index: 45; }
.badge.retest.flip { animation: badge-flip 500ms ease-out; }
.badge.retest.bounce { animation: badge-bounce 650ms cubic-bezier(.36,.07,.19,.97); }
@keyframes badge-flip { 0% { transform: scale(0.6); background: #f1f3f5; } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes badge-bounce { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-9px); } 55% { transform: translateY(0); } 75% { transform: translateY(-4px); } }
.check-draw { width: 1.4em; height: 1.4em; vertical-align: middle; margin-left: 0.3rem; }
.check-draw path { fill: none; stroke: var(--ok); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; }
.check-draw.drawn path { transition: stroke-dashoffset 600ms ease-out; stroke-dashoffset: 0; }
@media (prefers-reduced-motion: reduce) {
  .badge.retest.flip, .badge.retest.bounce { animation: none; }
  .check-draw.drawn path { transition: none; }
}
