:root {
  --bg: #0e0f12;
  --bg-elev: #16181d;
  --bg-elev2: #1c1f26;
  --border: #262a33;
  --border-soft: #20242c;
  --text: #e7e9ee;
  --text-dim: #9aa0ad;
  --text-faint: #6b7280;
  --accent: #5b6cff;
  --accent-soft: #3a44a8;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 12px 40px rgba(0,0,0,.5);

  --sev-critical: #ff5d6c;
  --sev-high: #ff9f43;
  --sev-medium: #ffd24a;
  --sev-low: #6ad19a;

  /* Theme-specific surface colors (overridden in light mode) */
  --btn-hover-bg: #232732;
  --btn-hover-border: #333845;
  --border-hover: #343a47;
  --scrollbar: #2a2f3a;
  --track-bg: #23272f;
  --track-fill: #3a4150;
  --mention: #c7b3ff;
  --login-glow: #1a1d3a;
}

/* Light theme — JS sets data-theme on <html> (see the head loader in index.html).
   Only the values that differ from the dark default are listed. */
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-elev: #ffffff;
  --bg-elev2: #eef0f3;
  --border: #d6dae1;
  --border-soft: #e4e7ec;
  --text: #1a1d23;
  --text-dim: #5a6473;
  --text-faint: #8a93a3;
  --accent: #4954e0;
  --accent-soft: #4954e0;
  --shadow: 0 8px 28px rgba(20,30,60,.12);

  /* darkened severity hues so they read on a light surface
     (the translucent .13 fills become pleasant light tints) */
  --sev-critical: #d83a4e;
  --sev-high: #c2680a;
  --sev-medium: #a87f10;
  --sev-low: #1f9d57;

  --btn-hover-bg: #e2e5ea;
  --btn-hover-border: #c4c9d2;
  --border-hover: #c4c9d2;
  --scrollbar: #c4c9d2;
  --track-bg: #e2e5ea;
  --track-fill: #cfd4dc;
  --mention: #6d3fe0;
  --login-glow: #dfe3ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* The board owns the only horizontal scroll surface; keep the page itself
   from ever growing a stray horizontal scrollbar. */
body { overflow-x: hidden; }

.hidden { display: none !important; }

/* ---------- Buttons / inputs ---------- */
.btn {
  border: 1px solid var(--border);
  background: var(--bg-elev2);
  color: var(--text);
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .05s;
}
.btn:hover { background: var(--btn-hover-bg); border-color: var(--btn-hover-border); }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: #6b7bff; border-color: #6b7bff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-dim); }
.btn--ghost:hover { background: var(--bg-elev2); color: var(--text); }
.btn--danger { color: var(--sev-critical); border-color: transparent; background: transparent; }
.btn--danger:hover { background: rgba(255,93,108,.12); }

.input, .select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
  width: 100%;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(91,108,255,.15); }
.input--sm { width: 200px; padding: 7px 11px; }
textarea.input { resize: vertical; line-height: 1.5; }
.select { cursor: pointer; appearance: none; padding-right: 26px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%239aa0ad' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
.iconbtn { background: none; border: none; color: var(--text-dim); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.iconbtn:hover { background: var(--bg-elev2); color: var(--text); }
.select--lang { width: auto; min-width: 96px; padding: 7px 26px 7px 11px; font-size: 12px; color: var(--text-dim); }
.login .select--lang { width: 100%; margin-top: 2px; }

/* ---------- Login ---------- */
.login {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 50% -10%, var(--login-glow) 0%, var(--bg) 55%);
}
.login__card {
  width: 320px; background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 12px;
}
.login__brand { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.login__sub { color: var(--text-dim); margin-top: -8px; margin-bottom: 6px; font-size: 13px; }
.login__error { color: var(--sev-critical); font-size: 12px; min-height: 14px; text-align: center; }

/* ---------- Topbar ---------- */
.app { display: flex; flex-direction: row; height: 100vh; }
/* ---------- App shell: left sidebar + main column ---------- */
.sidebar {
  width: 208px; flex: 0 0 auto; display: flex; flex-direction: column;
  background: var(--bg-elev); border-right: 1px solid var(--border);
  padding: 14px 10px; gap: 2px; overflow-y: auto;
  transition: width .18s ease, padding .18s ease;
}
:root[data-sidebar="collapsed"] .sidebar {
  width: 0; padding-left: 0; padding-right: 0; border-right: none; overflow: hidden;
}
.sidebar__brand { display: flex; align-items: baseline; gap: 6px; padding: 4px 8px 12px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  text-align: left; background: transparent; border: none; color: var(--text-dim);
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 500; cursor: pointer;
}
.nav-item:hover { background: var(--bg-elev2); color: var(--text); }
.nav-item.tab--active { background: var(--accent-soft); color: #fff; }
.sidebar__viewshead {
  color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px;
  padding: 16px 10px 6px;
}
.sidebar__views { display: flex; flex-direction: column; gap: 1px; }
.view-item {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: var(--radius-sm);
  color: var(--text-dim); font-size: 13px; cursor: pointer;
}
.view-item:hover { background: var(--bg-elev2); color: var(--text); }
.view-item--active { background: var(--bg-elev2); color: var(--text); font-weight: 600; }
.view-item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-item__del { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: 14px;
  line-height: 1; padding: 0 2px; opacity: 0; }
.view-item:hover .view-item__del { opacity: .7; }
.view-item__del:hover { opacity: 1; color: var(--sev-critical); }
.view-add { text-align: left; background: none; border: none; color: var(--accent); cursor: pointer;
  font-size: 13px; padding: 7px 10px; border-radius: var(--radius-sm); margin-top: 2px; }
.view-add:hover { background: var(--bg-elev2); }

/* No overflow:hidden here — the header's dropdowns (account / bell / filter
   popover) must be able to paint over the board. The board manages its own
   scroll; min-height:0 lets it shrink so column bodies scroll internally. */
.main { flex: 1 1 auto; display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100vh; }

/* ---------- Slim top header ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  background: var(--bg-elev); flex: 0 0 auto;
}
.topbar__menu { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; }
.logo { font-weight: 700; letter-spacing: -.3px; }
.logo__sub { color: var(--text-faint); font-size: 12px; }
.topbar__search { width: 280px; max-width: 36vw; }
.topbar__sort { width: auto; min-width: 150px; font-size: 12px; padding: 7px 24px 7px 9px; }
.topbar__spacer { flex: 1 1 auto; }
.topbar__right { display: flex; align-items: center; gap: 10px; }
.whoami { color: var(--text-dim); font-size: 13px; }
.whoami b { color: var(--text); }

/* ---------- Filter popover ---------- */
.filter-dd { position: relative; flex: 0 0 auto; }
.filter-dd__btn { display: inline-flex; align-items: center; gap: 7px; }
.filter-count { background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 600;
  min-width: 17px; height: 17px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.topbar__filters {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; width: 256px;
  display: none; flex-direction: column; gap: 8px; padding: 12px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.topbar__filters--open { display: flex; }
.topbar__filters .select { width: 100%; font-size: 13px; padding: 8px 26px 8px 10px; }
.filter-panel__head { color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .5px; }
.filter-panel__foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 2px;
  padding-top: 8px; border-top: 1px solid var(--border-soft); }

/* ---------- Board ---------- */
.board {
  display: flex; gap: 14px; padding: 16px; overflow-x: auto; flex: 1 1 auto; align-items: flex-start;
}
.column {
  flex: 1 1 0; min-width: 180px; background: var(--bg-elev); border: 1px solid var(--border-soft);
  border-radius: var(--radius); display: flex; flex-direction: column; max-height: 100%;
}
.column__head {
  display: flex; align-items: center; gap: 8px; padding: 11px 13px;
  border-bottom: 1px solid var(--border-soft); position: sticky; top: 0;
}
.column__dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.column__title { font-weight: 600; font-size: 13px; }
.column__count { color: var(--text-faint); font-size: 12px; margin-left: auto; background: var(--bg-elev2);
  padding: 1px 8px; border-radius: 10px; }
.column__add { background: transparent; border: none; color: var(--text-dim); font-size: 18px; line-height: 1;
  cursor: pointer; padding: 0 4px; border-radius: var(--radius-sm); flex: 0 0 auto; }
.column__add:hover { color: var(--text); background: var(--bg-elev2); }
.column__body { padding: 10px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; min-height: 60px; }
.column.drop-target { outline: 2px dashed var(--accent-soft); outline-offset: -4px; }

.card {
  background: var(--bg-elev2); border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm); padding: 11px 12px; cursor: pointer;
  transition: border-color .12s, transform .05s, box-shadow .12s;
}
.card:hover { border-color: var(--border-hover); box-shadow: 0 4px 14px rgba(0,0,0,.25); }
.card.dragging { opacity: .5; }
.card__top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.card__check { width: 14px; height: 14px; flex: 0 0 auto; cursor: pointer; accent-color: var(--accent); opacity: .45; transition: opacity .12s; }
.card__check:hover, .card__check:checked, .card:hover .card__check { opacity: 1; }

/* ---------- Bulk action bar ---------- */
.bulk-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 16px; background: var(--bg-elev); border-bottom: 1px solid var(--border); flex: 0 0 auto; }
.bulk-bar .select { width: auto; min-width: 130px; font-size: 12px; padding: 7px 24px 7px 9px; }
.bulk-bar .btn { font-size: 12px; padding: 7px 11px; }
#bulk-count { font-weight: 600; font-size: 13px; color: var(--text); margin-right: 4px; }
.card__key { color: var(--text-faint); font-size: 11px; font-weight: 600; letter-spacing: .3px; }
.card__title { font-size: 13.5px; font-weight: 500; line-height: 1.35; margin-bottom: 9px; word-break: break-word; }
.card__meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
/* Won't-fix cards collapse to key + title only — tighten the now-trailing title. */
.card--collapsed .card__top { margin-bottom: 4px; }
.card--collapsed .card__title { margin-bottom: 0; }

.sev {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 7px; border-radius: 5px;
}
.sev--critical { color: var(--sev-critical); background: rgba(255,93,108,.13); }
.sev--high { color: var(--sev-high); background: rgba(255,159,67,.13); }
.sev--medium { color: var(--sev-medium); background: rgba(255,210,74,.13); }
.sev--low { color: var(--sev-low); background: rgba(106,209,154,.13); }

.tag { font-size: 11px; color: var(--text-dim); background: var(--bg); border: 1px solid var(--border-soft);
  padding: 1px 7px; border-radius: 5px; }
.chip-icons { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--text-faint); font-size: 11px; }
.chip-icons span { display: inline-flex; align-items: center; gap: 3px; }

.avatar {
  width: 20px; height: 20px; border-radius: 50%; font-size: 10px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: 0 0 auto;
}

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow-y: auto; }
.modal__backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.modal__panel { position: relative; width: 100%; max-width: 720px; background: var(--bg-elev);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal__head h2 { font-size: 16px; font-weight: 600; }

/* ---------- Detail ---------- */
.detail { padding: 18px 20px; }
.detail__keyrow { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.detail__key { color: var(--text-faint); font-size: 12px; font-weight: 600; }
.detail__title { font-size: 19px; font-weight: 600; line-height: 1.3; width: 100%; background: none; border: none; color: var(--text); padding: 0; }
.detail__title:focus { outline: none; background: var(--bg); border-radius: 6px; padding: 4px 6px; margin: -4px -6px; }
.detail__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.detail__field { display: flex; flex-direction: column; gap: 4px; }
.detail__field > span { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; }
.detail__desc { width: 100%; }
.section-label { color: var(--text-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; margin: 18px 0 8px; }

.attachments { display: flex; flex-wrap: wrap; gap: 10px; }
.att { border: 1px solid var(--border-soft); border-radius: var(--radius-sm); overflow: hidden; width: 130px; background: var(--bg); position: relative; }
.att img { width: 130px; height: 84px; object-fit: cover; display: block; cursor: zoom-in; background: #000; }
.att__file { height: 84px; display: flex; align-items: center; justify-content: center; font-size: 26px; }
.att__name { font-size: 11px; color: var(--text-dim); padding: 5px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-top: 1px solid var(--border-soft); }
.att__del { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.6); color: #fff; border: none; border-radius: 5px; width: 20px; height: 20px; cursor: pointer; font-size: 12px; line-height: 1; opacity: 0; transition: opacity .12s; }
.att:hover .att__del { opacity: 1; }
.att__add { width: 130px; height: 113px; border: 1px dashed var(--border); border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-dim); cursor: pointer; font-size: 12px; background: var(--bg); }
.att__add:hover { border-color: var(--accent); color: var(--text); }

/* Checklist */
.checklist { display: flex; flex-direction: column; gap: 2px; }
.checklist__item { display: flex; align-items: center; gap: 8px; padding: 4px 2px; border-radius: var(--radius-sm); }
.checklist__item:hover { background: var(--bg); }
.checklist__check { width: 15px; height: 15px; cursor: pointer; flex: none; }
.checklist__title { flex: 1; min-width: 0; font-size: 13px; word-break: break-word; }
.checklist__item--done .checklist__title { text-decoration: line-through; color: var(--text-faint); }
.checklist__assignee { flex: none; width: auto; max-width: 160px; }
.select--xs { padding: 4px 22px 4px 8px; font-size: 11px; }
.checklist__del { flex: none; opacity: 0; transition: opacity .12s; }
.checklist__item:hover .checklist__del { opacity: .6; }
.checklist__del:hover { opacity: 1; }
.checklist__add { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.checklist__input { flex: 1; resize: vertical; min-height: 34px; }

/* Card checklist progress badge (sits in .chip-icons) */
.chk-badge { display: inline-flex; align-items: center; gap: 3px; }
.chk-badge--done { color: #6ad19a; }

.comments { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.comment { display: flex; gap: 10px; }
.comment__body { background: var(--bg-elev2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 8px 11px; flex: 1; }
.comment__meta { font-size: 12px; margin-bottom: 2px; }
.comment__meta b { color: var(--text); }
.comment__meta time { color: var(--text-faint); margin-left: 6px; font-size: 11px; }
.comment__text { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.comment--sys .comment__body { background: transparent; border-style: dashed; }
.comment--sys .comment__text { color: var(--text-dim); font-style: italic; }
.comment-form { display: flex; gap: 8px; margin-top: 14px; align-items: flex-end; }
.comment-form textarea { flex: 1; }

.detail__footer { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }

/* ---------- New form ---------- */
.form { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field > span { font-size: 12px; color: var(--text-dim); }
.form__row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.form__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.85); display: grid; place-items: center; cursor: zoom-out; padding: 32px; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 6px; }

.empty { color: var(--text-faint); text-align: center; font-size: 12px; padding: 14px 6px; }

/* ---------- Login hint / setup ---------- */
.login__hint { color: var(--text-faint); font-size: 12px; text-align: center; line-height: 1.4; }

/* ---------- Account menu ---------- */
.account { position: relative; }
.account__menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 20;
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 4px; min-width: 170px; display: flex; flex-direction: column;
}
.account__menu button {
  background: none; border: none; color: var(--text); text-align: left; padding: 8px 10px;
  border-radius: 6px; cursor: pointer; font-size: 13px; font-family: inherit;
}
.account__menu button:hover { background: var(--bg); }

/* ---------- Buttons (extra size) ---------- */
.btn--xs { padding: 4px 9px; font-size: 12px; }

/* ---------- Users panel ---------- */
.modal__panel--narrow { max-width: 420px; }
.users-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.urow {
  display: flex; align-items: center; gap: 11px; padding: 9px 11px;
  background: var(--bg-elev2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
}
.urow--inactive { opacity: .55; }
.urow__main { flex: 1; min-width: 0; }
.urow__name { font-size: 13.5px; font-weight: 500; }
.urow__you { color: var(--text-faint); font-weight: 400; font-size: 11px; }
.urow__sub { font-size: 11.5px; color: var(--text-dim); margin-top: 1px; }
.urow__actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
.urole { font-weight: 600; }
.urole--admin { color: var(--accent); }
.urole--member { color: var(--text-dim); }
.urow__email { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.urow__email .uemail { width: 180px; max-width: 100%; }
.urow__notify { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-dim); cursor: pointer; }
.account__toggle { display: flex; align-items: center; gap: 7px; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text); }
.account__toggle:hover { background: var(--bg); }
.user-add { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; align-items: start; }
.user-add #ua-role { grid-column: 1; }
.user-add__pw { grid-column: 2; display: flex; gap: 6px; }
.user-add__pw .input { flex: 1; }
.user-add button[type="submit"] { grid-column: 1 / -1; }

/* ---------- Priority badge ---------- */
.prio {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  padding: 2px 7px; border-radius: 5px; color: var(--pc, #6b7280);
  background: color-mix(in srgb, var(--pc, #6b7280) 14%, transparent);
}

/* ---------- Labels ---------- */
.label-chip {
  display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 5px; line-height: 1.5; white-space: nowrap;
}
.label-chip--sm { font-size: 10px; padding: 1px 6px; }
.label-chip__x { background: none; border: none; color: inherit; cursor: pointer; font-size: 13px; line-height: 1; opacity: .7; padding: 0; }
.label-chip__x:hover { opacity: 1; }
.card__labels { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.labels-input {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 7px 9px; min-height: 38px;
}
.labels-input__field { flex: 1; min-width: 120px; background: none; border: none; outline: none; color: var(--text); font: inherit; font-size: 13px; }

/* ---------- Due / multiplayer-role badges on cards ---------- */
.due { font-size: 11px; color: var(--text-dim); display: inline-flex; align-items: center; gap: 3px; }
.due--overdue { color: var(--sev-critical); font-weight: 600; }
.mprole {
  font-size: 10.5px; color: var(--text-dim); background: var(--bg); border: 1px solid var(--border-soft);
  padding: 1px 7px; border-radius: 5px;
}

/* ---------- Linked bugs ---------- */
.links__group { margin-bottom: 10px; }
.links__label { color: var(--text-faint); font-size: 11px; margin-bottom: 4px; }
.link-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; background: var(--bg-elev2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); margin-bottom: 5px; }
.link-row__bug { color: var(--accent); font-size: 12px; font-weight: 600; cursor: pointer; flex: 0 0 auto; }
.link-row__bug:hover { text-decoration: underline; }
.link-row__title { font-size: 12.5px; color: var(--text-dim); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-row__rm { flex: 0 0 auto; }
.link-add { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.link-add .select { width: auto; min-width: 110px; }
.link-add .input { flex: 1; }

/* ---------- Archive ---------- */
.card--archived { opacity: .6; }
.archived-badge { font-size: 10px; color: var(--text-faint); background: var(--bg); border: 1px solid var(--border-soft); padding: 1px 6px; border-radius: 5px; text-transform: uppercase; letter-spacing: .3px; }
.btn--active { background: var(--accent-soft); border-color: var(--accent-soft); color: #fff; }

/* ---------- Milestone badge ---------- */
.milestone { font-size: 11px; color: var(--mention); background: rgba(124,86,255,.14); border: 1px solid rgba(124,86,255,.25); padding: 1px 7px; border-radius: 5px; }

/* ---------- Manager lists (labels / milestones) ---------- */
.manage-list { display: flex; flex-direction: column; gap: 7px; max-height: 50vh; overflow-y: auto; margin-bottom: 6px; }
.manage-row { display: flex; align-items: center; gap: 7px; background: var(--bg-elev2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 6px 8px; }
.manage-row--closed { opacity: .55; }
.manage-row .input { padding: 5px 8px; }
.manage-row .lm-name { flex: 1; }
.manage-row .ms-name { flex: 1; }
.manage-row .ms-due { width: 140px; flex: 0 0 auto; }
.manage-count { font-size: 11px; color: var(--text-faint); min-width: 34px; text-align: center; }
.lm-color { width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 6px; background: none; cursor: pointer; flex: 0 0 auto; }
.ms-add { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; align-items: center; }

/* ---------- Metrics ---------- */
.metrics { padding: 18px 20px 22px; }
.metric-cards { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.metric-card { flex: 1; min-width: 120px; background: var(--bg-elev2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 14px 16px; }
.metric-val { font-size: 26px; font-weight: 700; }
.metric-label { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.metric-group { margin-bottom: 16px; }
.metric-group__title { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-faint); margin-bottom: 8px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.bar-label { width: 120px; flex: 0 0 auto; font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { flex: 1; height: 9px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.bar-val { width: 28px; text-align: right; font-size: 12px; color: var(--text-dim); }

/* ---------- Notification bell ---------- */
.bell { position: relative; }
.bell__count { position: absolute; top: 1px; right: 1px; background: var(--sev-critical); color: #fff; font-size: 9px; font-weight: 700; min-width: 15px; height: 15px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; padding: 0 3px; }
.notif-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 300px; background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); overflow: hidden; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border-bottom: 1px solid var(--border-soft); font-size: 12px; color: var(--text-dim); }
.notif-list { max-height: 360px; overflow-y: auto; }
.notif-item { padding: 9px 12px; border-bottom: 1px solid var(--border-soft); cursor: pointer; font-size: 13px; }
.notif-item:hover { background: var(--bg); }
.notif-item time { display: block; color: var(--text-faint); font-size: 11px; margin-top: 2px; }
.notif-item--unread { border-left: 2px solid var(--accent); }

.account__sep { height: 1px; background: var(--border-soft); margin: 4px 0; }

/* ---------- Markdown ---------- */
.md { font-size: 13px; line-height: 1.55; word-break: break-word; }
.md p { margin: 0 0 8px; }
.md p:last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3 { margin: 10px 0 6px; line-height: 1.3; }
.md h1 { font-size: 17px; } .md h2 { font-size: 15px; } .md h3 { font-size: 14px; }
.md ul, .md ol { margin: 0 0 8px; padding-left: 20px; }
.md li { margin: 2px 0; }
.md code { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 4px; padding: 1px 5px; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.md-code { background: var(--bg); border: 1px solid var(--border-soft); border-radius: 6px; padding: 9px 11px; overflow-x: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; margin: 0 0 8px; }
.md blockquote { border-left: 3px solid var(--border); margin: 0 0 8px; padding: 2px 0 2px 11px; color: var(--text-dim); }
.md a { color: var(--accent); }
.mention { color: var(--mention); background: rgba(124,86,255,.14); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.detail__desc-view { background: var(--bg); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 9px 11px; cursor: text; min-height: 38px; }
.detail__desc-view:hover { border-color: var(--border); }
.empty-inline { color: var(--text-faint); font-style: italic; }
.detail__footer-actions { display: flex; gap: 8px; }

/* ---------- Paste preview ---------- */
.paste-hint { font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.paste-preview { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.paste-thumb { font-size: 11px; color: var(--text-dim); background: var(--bg-elev2); border: 1px solid var(--border-soft); border-radius: 5px; padding: 2px 6px; display: inline-flex; align-items: center; gap: 5px; }
.paste-thumb button { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 13px; line-height: 1; }

/* ---------- Token secret reveal ---------- */
.token-secret { background: var(--bg-elev2); border: 1px solid var(--accent-soft); border-radius: var(--radius-sm); padding: 10px 12px; }
.token-secret .input { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }

/* ---------- Context menu ---------- */
.ctxmenu {
  position: fixed; z-index: 90; min-width: 190px; padding: 4px;
  background: var(--bg-elev2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  display: flex; flex-direction: column;
}
.ctxmenu__sub {
  position: absolute; left: 100%; top: -5px; z-index: 91; min-width: 170px; padding: 4px;
  background: var(--bg-elev2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow);
  display: none; flex-direction: column; max-height: 60vh; overflow-y: auto;
}
.ctxmenu--flip .ctxmenu__sub { left: auto; right: 100%; }
.ctxmenu__item {
  display: flex; align-items: center; gap: 8px; justify-content: space-between;
  background: none; border: none; color: var(--text); text-align: left;
  padding: 7px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
  font-family: inherit; white-space: nowrap; position: relative;
}
.ctxmenu__item:hover { background: var(--bg); }
.ctxmenu__item--danger { color: var(--sev-critical); }
.ctxmenu__item--has-sub::after { content: '\25B8'; color: var(--text-faint); margin-left: 12px; }
.ctxmenu__item--has-sub:hover > .ctxmenu__sub { display: flex; }
.ctxmenu__sep { height: 1px; background: var(--border-soft); margin: 4px 0; }
.ctxmenu__hint { color: var(--text-faint); font-size: 11px; padding: 4px 10px 2px; }

/* ---------- Focused / selected cards ---------- */
.card--focused { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(91,108,255,.35); }
.card--selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg-elev2)); }

/* ---------- Cheat-sheet ---------- */
.cheatsheet { padding: 16px 20px 20px; }
.cheatsheet__group { margin-bottom: 16px; }
.cheatsheet__group:last-child { margin-bottom: 0; }
.cheatsheet__group h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--text-faint); margin-bottom: 8px; }
.cheatsheet__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 4px 0; font-size: 13px; color: var(--text-dim); }
.cheatsheet kbd {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11px;
  background: var(--bg); border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 6px; color: var(--text); flex: 0 0 auto;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--btn-hover-border); }

/* ---- Board ⇄ Systems tab switcher ---- */
.topbar__tabs { display: flex; gap: 4px; flex: 0 0 auto; }
.tab {
  background: transparent; border: 1px solid var(--border-soft); color: var(--text-dim);
  border-radius: var(--radius-sm); padding: 7px 13px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab--active { background: var(--accent-soft); border-color: var(--accent-soft); color: #fff; }

/* On the Systems tab, hide the board-only filter controls but keep the archived
   toggle usable (the dashboard honors it). */
.topbar__filters.on-systems > #search,
.topbar__filters.on-systems > .select,
.topbar__filters.on-systems > #clear-filters,
.topbar__filters.on-systems > #save-view,
.topbar__filters.on-systems > #delete-view { display: none; }

/* ---- Systems dashboard ---- */
.systems-view { flex: 1; overflow-y: auto; padding: 16px 20px; }
.systems-view.hidden { display: none; }
.systems-view__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.systems-view__head h2 { font-size: 16px; }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sys-grid--retired { margin-top: 6px; }
.sys-card {
  background: var(--bg-elev2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm);
  padding: 12px 14px; cursor: pointer; transition: border-color .12s;
}
.sys-card:hover { border-color: var(--accent); }
.sys-card--retired { opacity: .5; }
.sys-card--retired:hover { border-color: var(--border-soft); }
.sys-card__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.sys-card__name { font-weight: 600; font-size: 14px; }
.sys-card__noowner { font-size: 11px; color: var(--text-faint); }
.sys-card__desc { font-size: 12px; color: var(--text-dim); margin-bottom: 9px; }
.sys-card__stats { display: flex; flex-wrap: wrap; gap: 6px; }

/* Manager rows carry a few more controls than labels/milestones rows. */
.manage-row--sys .sys-row-name { flex: 1; min-width: 90px; }
.manage-row--sys .sys-row-owner { width: auto; min-width: 110px; flex: 0 0 auto; }
.manage-row--sys .sys-row-desc { flex: 2; min-width: 120px; }
.manage-row--sys .sys-row-kind { width: auto; min-width: 96px; flex: 0 0 auto; }
.manage-row--sys .sys-row-parent { width: auto; min-width: 120px; flex: 0 0 auto; }

/* ============ Projects manager ============ */
.proj-list { display: flex; flex-direction: column; gap: 9px; max-height: 52vh; overflow-y: auto; margin-bottom: 4px; padding: 1px; }
.proj-card { display: flex; align-items: center; gap: 11px; background: var(--bg-elev2); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); padding: 10px 12px; transition: border-color .12s; }
.proj-card:hover { border-color: var(--border-hover); }
.proj-card--archived { opacity: .6; }
.proj-card--current { border-color: var(--accent-soft); }
.proj-card__avatar { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 8px; display: grid; place-items: center; font-size: 13px; font-weight: 700; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-soft)); text-transform: uppercase; }
.proj-card__main { flex: 1; min-width: 0; }
.proj-card__name { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; min-height: 22px; }
.proj-card__name-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proj-card__meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; flex-wrap: wrap; }
.proj-card__actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

.pill { font-size: 10px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; }
.pill--current { background: var(--accent); color: #fff; }
.pill--muted { background: var(--bg-elev); color: var(--text-faint); border: 1px solid var(--border-soft); }

.chip { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-dim); background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: 999px; padding: 3px 9px; line-height: 1; }
.chip svg { opacity: .65; flex: 0 0 auto; }
.chip--build { cursor: pointer; }
.chip--build:hover { border-color: var(--accent); color: var(--text); }
.chip--empty { font-style: italic; color: var(--text-faint); }

.proj-inline { display: inline-flex; align-items: center; gap: 6px; }
.proj-inline .input { padding: 4px 8px; font-size: 13px; }

.iconbtn--sm { width: 28px; height: 28px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 6px; background: transparent; border: 1px solid transparent; color: var(--text-dim); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.iconbtn--sm:hover { background: var(--btn-hover-bg); color: var(--text); border-color: var(--btn-hover-border); }
.iconbtn--sm.is-danger:hover { color: var(--sev-critical); border-color: var(--sev-critical); }

/* Member editor */
.pm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.pm-search { flex: 1; }
.pm-count { font-size: 12px; color: var(--text-faint); white-space: nowrap; }
.pm-list { display: flex; flex-direction: column; gap: 5px; max-height: 50vh; overflow-y: auto; padding: 1px; }
.pm-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-soft); background: var(--bg-elev2); transition: border-color .12s; }
.pm-row--on { border-color: var(--accent-soft); }
.pm-row__av { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--text); background: var(--bg-elev); border: 1px solid var(--border); text-transform: uppercase; }
.pm-row__main { flex: 1; min-width: 0; }
.pm-row__name { font-size: 13px; }
.pm-row__sub { font-size: 11px; color: var(--text-faint); }
.pm-empty { color: var(--text-faint); text-align: center; font-size: 12px; padding: 16px; }

/* Toggle switch (reused by the member editor) */
.switch { position: relative; display: inline-block; width: 38px; height: 21px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__t { position: absolute; inset: 0; background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px; transition: .15s; cursor: pointer; }
.switch__t::before { content: ""; position: absolute; width: 15px; height: 15px; left: 2px; top: 2px; background: var(--text-dim); border-radius: 50%; transition: .15s; }
.switch input:checked + .switch__t { background: var(--accent); border-color: var(--accent); }
.switch input:checked + .switch__t::before { transform: translateX(17px); background: #fff; }
.switch input:disabled + .switch__t { opacity: .45; cursor: not-allowed; }

/* ============ Systems verification register (tree) ============ */
.sv-summary { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 13px 16px; margin-bottom: 14px;
  background: linear-gradient(180deg, var(--bg-elev), var(--bg-elev2)); border: 1px solid var(--border); border-radius: var(--radius); }
.sv-summary .g { display: flex; align-items: baseline; gap: 6px; }
.sv-summary .g .n { font-size: 20px; font-weight: 800; }
.sv-summary .g .t { font-size: 12px; color: var(--text-dim); }
.sv-summary .g.due .n { color: var(--sev-high); }
.sv-summary .g.fail .n { color: var(--sev-critical); }
.sv-summary .g.pass .n { color: var(--sev-low); }
.sv-summary .sv-spacer { flex: 1; }
.sv-build { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-dim);
  background: var(--bg); border: 1px solid var(--border); border-radius: 20px; padding: 5px 11px; }
.sv-build b { color: var(--text); font-weight: 700; }
.sv-build.editable { cursor: pointer; } .sv-build.editable:hover { border-color: var(--accent); color: var(--text); }

.sv-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sv-toolbar .btn { font-size: 12px; padding: 6px 11px; }
.sv-toolbar .btn--active { background: var(--accent-soft); border-color: var(--accent-soft); color: #fff; }

.sv-tree { display: flex; flex-direction: column; gap: 12px; }
.sv-cat { background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sv-cat-head { display: flex; align-items: center; gap: 13px; padding: 13px 16px; cursor: pointer; user-select: none; }
.sv-cat-head:hover { background: var(--bg-elev2); }
.sv-kind { font-size: 10px; font-weight: 700; letter-spacing: 1.1px; text-transform: uppercase; color: var(--text-faint);
  padding: 3px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--bg); white-space: nowrap; }
.sv-cat-title { font-size: 15px; font-weight: 700; }
.sv-cat-sub { font-size: 12px; color: var(--text-faint); }

.sv-chev { width: 15px; height: 15px; flex: none; color: var(--text-faint); transition: transform .2s ease; display: inline-flex; }
.sv-chev svg { width: 100%; height: 100%; }
.sv-open > .sv-chev, .sv-row.sv-open .sv-chev, .sv-cat.sv-open .sv-chev { transform: rotate(90deg); }

.sv-rollup { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.sv-chips { display: flex; gap: 5px; }
.sv-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; white-space: nowrap; }
.sv-chip.pass { color: var(--sev-low); background: rgba(106,209,154,.12); border: 1px solid rgba(106,209,154,.28); }
.sv-chip.due { color: var(--sev-high); background: rgba(255,159,67,.12); border: 1px solid rgba(255,159,67,.28); }
.sv-chip.fail { color: var(--sev-critical); background: rgba(255,93,108,.12); border: 1px solid rgba(255,93,108,.28); }
.sv-chip.blocked, .sv-chip.unver { color: var(--text-dim); background: var(--bg); border: 1px solid var(--border-soft); }

.sv-bar { width: 130px; height: 6px; border-radius: 4px; overflow: hidden; display: flex; background: var(--track-bg); border: 1px solid var(--border-soft); }
.sv-bar i { height: 100%; display: block; }
.sv-bar .pass { background: var(--sev-low); } .sv-bar .due { background: var(--sev-high); }
.sv-bar .fail { background: var(--sev-critical); } .sv-bar .rest { background: var(--track-fill); }

.sv-collapse { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .24s ease; }
.sv-open + .sv-collapse, .sv-cat.sv-open > .sv-collapse { grid-template-rows: 1fr; }
.sv-collapse > .sv-inner { overflow: hidden; min-height: 0; }

/* system + subsystem rows */
.sv-row { display: flex; align-items: center; gap: 11px; padding: 10px 16px; cursor: pointer; user-select: none;
  border-left: 3px solid transparent; border-top: 1px solid var(--border-soft); }
.sv-row:hover { background: var(--bg-elev2); }
.sv-row.lvl1 { padding-left: 28px; }
.sv-row.lvl2 { padding-left: 48px; background: rgba(0,0,0,.14); }
.sv-row .sv-name { font-size: 13.5px; font-weight: 600; }
.sv-row.lvl2 .sv-name { font-weight: 500; font-size: 13px; }
.sv-row .sv-owner { font-size: 11px; color: var(--text-faint); margin-left: 2px; }
.sv-row.worst-failing { border-left-color: var(--sev-critical); }
.sv-row.worst-due { border-left-color: var(--sev-high); }
.sv-addcheck { font-size: 11px; color: var(--text-dim); border: 1px dashed var(--border); background: transparent;
  border-radius: 6px; padding: 3px 9px; cursor: pointer; }
.sv-addcheck:hover { border-color: var(--accent); color: var(--text); }

/* check rows */
.sv-checks { padding: 2px 0 6px; }
.sv-checkrow { display: flex; align-items: center; gap: 11px; padding: 8px 16px 8px 64px; border-top: 1px solid var(--border-soft); }
.sv-checkrow:hover { background: rgba(255,255,255,.02); }
.sv-checktitle { font-size: 13px; font-weight: 500; }
.sv-crit-flag { font-size: 9px; font-weight: 700; letter-spacing: .5px; color: var(--sev-critical); border: 1px solid rgba(255,93,108,.3);
  background: rgba(255,93,108,.08); border-radius: 4px; padding: 1px 5px; margin-left: 6px; text-transform: uppercase; }
.sv-cadence { font-size: 11px; color: var(--text-faint); }
.sv-checkmeta { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.sv-lastv { font-size: 11.5px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; }
.sv-buildbadge { font-size: 10px; color: var(--text-faint); border: 1px solid var(--border-soft); border-radius: 4px; padding: 1px 5px; }

.sv-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.sv-pill .d { width: 6px; height: 6px; border-radius: 50%; }
.sv-pill.pass { color: var(--sev-low); background: rgba(106,209,154,.12); } .sv-pill.pass .d { background: var(--sev-low); }
.sv-pill.due { color: var(--sev-high); background: rgba(255,159,67,.12); } .sv-pill.due .d { background: var(--sev-high); }
.sv-pill.fail { color: var(--sev-critical); background: rgba(255,93,108,.12); } .sv-pill.fail .d { background: var(--sev-critical); }
.sv-pill.blocked { color: var(--mention); background: rgba(140,92,246,.12); } .sv-pill.blocked .d { background: var(--mention); }
.sv-pill.unver { color: var(--text-dim); background: var(--bg); border: 1px solid var(--border-soft); } .sv-pill.unver .d { background: var(--text-faint); }

.sv-vbtns { display: flex; gap: 4px; }
.sv-vbtn { font-size: 12px; font-weight: 700; line-height: 1; border-radius: 6px; padding: 5px 8px; cursor: pointer; border: 1px solid var(--border); background: var(--bg-elev2); color: var(--text-dim); }
.sv-vbtn.pass:hover { color: var(--sev-low); border-color: var(--sev-low); }
.sv-vbtn.fail:hover { color: var(--sev-critical); border-color: var(--sev-critical); }
.sv-vbtn.blocked:hover { color: var(--mention); border-color: var(--mention); }
.sv-hist-btn { font-size: 11px; color: var(--text-faint); background: none; border: none; cursor: pointer; }
.sv-hist-btn:hover { color: var(--text); }
.sv-history { padding: 4px 16px 8px 64px; font-size: 11.5px; color: var(--text-dim); }
.sv-history .hrow { display: flex; gap: 8px; padding: 2px 0; }
.sv-history .hrow .hr { font-weight: 700; }
.sv-history .hr.pass { color: var(--sev-low); } .sv-history .hr.fail { color: var(--sev-critical); } .sv-history .hr.blocked { color: var(--mention); }
.sv-emptychecks { padding: 9px 16px 9px 64px; color: var(--text-faint); font-size: 12px; font-style: italic; }

/* ---------- Command palette ---------- */
.palette { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: rgba(0,0,0,.45); }
.palette__box { width: 100%; max-width: 560px; background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.palette__input { width: 100%; box-sizing: border-box; border: none; outline: none; background: transparent; color: var(--text); font-size: 16px; padding: 15px 18px; border-bottom: 1px solid var(--border-soft); }
.palette__list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.palette__group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding: 8px 10px 4px; }
.palette__row { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette__row--active { background: color-mix(in srgb, var(--accent) 16%, var(--bg-elev2)); }
.palette__empty { padding: 16px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---------- Comment edit / delete ---------- */
.comment__edited { color: var(--text-faint); font-size: 11px; }
.comment__actions { margin-left: auto; display: inline-flex; gap: 4px; opacity: 0; transition: opacity .12s; }
.comment:hover .comment__actions, .comment:focus-within .comment__actions { opacity: 1; }
.comment__act { background: none; border: none; color: var(--text-faint); font-size: 11px; cursor: pointer; padding: 1px 4px; border-radius: 5px; }
.comment__act:hover { color: var(--text); background: var(--bg-elev); }
.comment__act--danger:hover { color: var(--sev-critical); }
.comment-edit__ta { width: 100%; box-sizing: border-box; }
.comment-edit__actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }

/* ---------- @mention autocomplete ---------- */
.mention-pop { position: fixed; z-index: 110; min-width: 180px; max-width: 280px; max-height: 200px; overflow-y: auto;
  background: var(--bg-elev2); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow); padding: 4px; }
.mention-pop__row { display: flex; align-items: center; gap: 7px; padding: 6px 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; color: var(--text); }
.mention-pop__row--active { background: color-mix(in srgb, var(--accent) 16%, var(--bg-elev2)); }
.mention-pop__row small { color: var(--text-faint); }

/* ---------- Responsive / mobile ---------- */
.topbar__filters-toggle { display: none; }

@media (max-width: 768px) {
  /* Sidebar folds into a horizontal strip above the header; page scrolls. */
  .app { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: auto; flex-direction: row; align-items: center; gap: 6px;
    overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); padding: 8px 10px; }
  .sidebar__brand { padding: 0 6px 0 2px; }
  .sidebar__viewshead { display: none; }
  .sidebar__nav, .sidebar__views { flex-direction: row; gap: 4px; }
  .view-item__del { display: none; }
  .main { height: auto; flex: 1 1 auto; overflow: visible; }
  .topbar { flex-wrap: wrap; gap: 8px; padding: 8px 12px; }
  .topbar__search { width: 100%; max-width: none; order: -1; }
  .topbar__right { margin-left: auto; gap: 8px; }
  .topbar__filters { left: auto; right: 0; }
  /* Board: one column at a time with scroll-snap (keeps DnD + Kanban model). */
  .board { scroll-snap-type: x mandatory; gap: 10px; padding: 10px; }
  .column { flex: 0 0 85%; min-width: 85%; scroll-snap-align: center; max-height: none; }
  .bulk-bar .select { min-width: 0; flex: 1 1 40%; }
  /* Modals become full-screen sheets. */
  .modal { padding: 0; align-items: stretch; }
  .modal__panel, .modal__panel--narrow { max-width: none; width: 100%; min-height: 100vh; min-height: 100dvh; border-radius: 0; border: none; }
  .notif-menu { position: fixed; top: 56px; left: 8px; right: 8px; width: auto; }
}

@media (max-width: 480px) {
  .detail__grid { grid-template-columns: 1fr; }
  .topbar__left .logo__sub { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
