: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; }
.card__dates { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 2px 10px; font-size: 11px; color: var(--text-faint); }
/* Only space the dates off the meta row when that row actually has chips in it. */
.card__meta:has(span) + .card__dates { margin-top: 8px; }
/* 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; }
/* Which game a bug belongs to, shown when several projects share the board. */
.proj-tag { font-size: 10.5px; font-weight: 600; color: var(--text); background: var(--bg-elev2); border: 1px solid var(--border-soft); padding: 1px 7px; border-radius: 5px; white-space: nowrap; }

/* ---------- 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; }

/* ---------- 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; }

/* ---------- Tokens manager: project tabs + filter bar + rows ---------- */
.tk-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.tk-tabs .tab { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; }
.tk-tab__n { font-size: 10px; font-weight: 600; min-width: 17px; height: 16px; padding: 0 5px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; background: var(--bg-elev2); color: var(--text-faint); }
.tab--active .tk-tab__n { background: rgba(255,255,255,.22); color: #fff; }
.tk-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; flex-wrap: wrap; }
.tk-bar .tk-search { flex: 1 1 120px; width: auto; min-width: 110px; }
.tk-bar .select { width: auto; }
.tk-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--text-dim); cursor: pointer; white-space: nowrap; }
/* Usually wraps onto its own line; pin it to the right edge so it reads as an action, not a stray label. */
.tk-clear { color: var(--sev-critical); margin-left: auto; }
.tk-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow-y: auto; padding: 1px; margin-bottom: 6px; }
.tk-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; }
.tk-row:hover { border-color: var(--border-hover); }
.tk-row--revoked { opacity: .55; }
.tk-row__main { flex: 1; min-width: 0; }
.tk-row__name { display: flex; align-items: center; gap: 7px; font-size: 13px; flex-wrap: wrap; min-height: 20px; }
.tk-row__label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.tk-row__meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.tk-row__actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.tk-row .proj-inline .input { width: 220px; max-width: 100%; }
.tkind { font-size: 10px; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; white-space: nowrap; }
.tkind--api { color: var(--accent); background: rgba(91,108,255,.14); border: 1px solid rgba(91,108,255,.25); }
.tkind--agent { color: var(--mention); background: rgba(124,86,255,.14); border: 1px solid rgba(124,86,255,.25); }
.tkind--public { color: var(--text-faint); background: var(--bg-elev); border: 1px solid var(--border-soft); }
.tkind--game { color: #ff9f43; background: rgba(255,159,67,.14); border: 1px solid rgba(255,159,67,.25); }
.tk-flag { font-size: 10.5px; font-weight: 500; white-space: nowrap; }
.tk-flag--unused, .tk-flag--stale { color: var(--sev-high); }
.tk-flag--revoked { color: var(--sev-critical); }
/* Create form: when the "acts as" select is hidden (non-agent kinds), let the project select take the row. */
.user-add #tok-user.hidden + #tok-project { grid-column: 1 / -1; }

/* ---------- 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 ⇄ Sessions 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; }

/* Off the board, hide the board-only filter controls but keep the archived
   toggle usable. */
.topbar__filters.on-altview > #search,
.topbar__filters.on-altview > .select,
.topbar__filters.on-altview > #clear-filters,
.topbar__filters.on-altview > #save-view,
.topbar__filters.on-altview > #delete-view { display: none; }

/* ============ 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); }

/* Delete-project confirmation */
.pdelete__warn { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text); }
.pdelete__warn strong { color: var(--sev-critical); }
.pdelete__counts { display: flex; flex-wrap: wrap; gap: 6px; }
.pdelete__counts:empty { display: none; }
.pdelete__actions { display: flex; justify-content: flex-end; gap: 8px; }
.pdelete__actions .btn--danger[disabled] { opacity: .45; cursor: not-allowed; }

/* 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; }

/* ---------- 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; }
}

/* ---------- Sessions dashboard ---------- */
.sessions-view { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px; }
.sessions-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.sessions-toolbar h1 { font-size: 17px; margin-right: auto; }
.sessions-toolbar .input { width: min(260px, 100%); }
.sessions-toolbar .select { min-width: 130px; }
.sessions-check { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.sessions-layout { display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(360px, .9fr); gap: 14px; min-height: 0; }
.sessions-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.session-row { display: grid; grid-template-columns: 86px minmax(130px, 1fr) 100px minmax(170px, 1.4fr) 34px 82px; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; text-align: left; color: var(--text); background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius-sm); cursor: pointer; }
.session-row:hover, .session-row--active { border-color: var(--accent); background: var(--bg-elev2); }
.session-row__date, .session-row__build, .session-row__bugs { color: var(--text-dim); font-size: 12px; }
.session-row__main { min-width: 0; display: flex; flex-direction: column; }
.session-row__main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.session-row__main small { color: var(--text-faint); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.session-row__peers { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.session-row__bugs { text-align: center; }
.session-peer-chip { display: inline-block; padding: 2px 6px; border-radius: 999px; font-size: 10.5px; line-height: 1.35; white-space: nowrap; border: 1px solid transparent; }
.session-peer-chip--errors { color: var(--sev-critical); background: rgba(255,93,108,.12); border-color: rgba(255,93,108,.28); }
.session-peer-chip--warnings { color: var(--sev-medium); background: rgba(255,210,74,.12); border-color: rgba(255,210,74,.28); }
.session-peer-chip--clean { color: var(--sev-low); background: rgba(106,209,154,.12); border-color: rgba(106,209,154,.28); }
.session-row__manual { font-size: 11px; color: var(--text-dim); text-align: right; }
.session-status--new { color: var(--accent); }
.session-status--reviewed { color: var(--sev-low); }
.session-status--archived { color: var(--text-faint); }
.sessions-detail { min-width: 0; align-self: start; padding: 16px; background: var(--bg-elev); border: 1px solid var(--border-soft); border-radius: var(--radius); }
.session-detail__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.session-detail__head h2 { font-size: 18px; overflow-wrap: anywhere; }
.session-detail__eyebrow { color: var(--text-faint); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.session-detail__actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.session-detail__meta { display: flex; flex-wrap: wrap; gap: 5px 12px; margin: 8px 0 16px; color: var(--text-dim); font-size: 11px; }
.session-detail__meta span + span::before { content: '·'; margin-right: 12px; color: var(--text-faint); }
.session-detail__section { margin-top: 16px; }
.session-peers { display: flex; flex-direction: column; gap: 10px; }
.session-peer-card { padding: 12px; border: 1px solid var(--border-soft); border-left: 3px solid var(--sev-low); border-radius: var(--radius-sm); background: var(--bg-elev2); }
.session-peer-card--warnings { border-left-color: var(--sev-medium); }
.session-peer-card--errors { border-left-color: var(--sev-critical); }
.session-peer-card__head { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.session-peer-card__head span { color: var(--text-dim); }
.session-peer-card__meta, .session-peer-card__counts { color: var(--text-faint); font-size: 11px; margin-top: 4px; }
.session-peer-card__counts { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-dim); }
.session-subhead { margin-top: 10px; color: var(--text-faint); font-size: 10.5px; text-transform: uppercase; letter-spacing: .4px; }
.session-peer-card .md-code { margin-top: 5px; max-height: 180px; overflow: auto; }
.session-peer-summary { margin-top: 10px; font-size: 12px; }
.session-attachments { display: flex; flex-direction: column; gap: 4px; margin-top: 5px; }
.session-attachment { color: var(--text-dim); font-size: 12px; text-decoration: none; overflow-wrap: anywhere; }
.session-attachment:hover { color: var(--text); text-decoration: underline; }
.session-attachment small { color: var(--text-faint); }
.session-no-attachments { color: var(--text-faint); font-size: 11px; }
.session-notes-view { min-height: 32px; padding: 8px; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: text; }
.session-notes-view:hover { border-color: var(--border); background: var(--bg-elev2); }
.session-notes-editor { width: 100%; resize: vertical; }
.session-bugs { display: flex; flex-direction: column; gap: 5px; }
.session-bug { padding: 7px 9px; text-align: left; color: var(--text-dim); background: transparent; border: 1px solid var(--border-soft); border-radius: var(--radius-sm); cursor: pointer; }
.session-bug:hover { color: var(--text); border-color: var(--accent); }
.session-bug b { color: var(--accent); margin-right: 6px; }
.session-detail__footer { display: flex; justify-content: flex-end; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
.sessions-empty { padding: 30px 12px; }
/* ---------- Transient-failure banner ---------- */
/* A dropped background refresh used to be invisible: the board just stopped
   updating. This is the one place that says so. */
.refresh-error {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(560px, calc(100vw - 32px));
  padding: 9px 10px 9px 14px;
  background: var(--bg-elev2);
  border: 1px solid var(--sev-high);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
}
.refresh-error span { flex: 1 1 auto; }

/* Sessions "load more", mirroring the board's control. */
.sessions-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 0;
}

@media (max-width: 980px) {
  .sessions-layout { grid-template-columns: 1fr; }
  .sessions-detail { order: -1; }
  .session-row { grid-template-columns: 74px minmax(120px, 1fr) minmax(150px, 1fr) 28px; }
  .session-row__build, .session-row__manual { display: none; }
}

@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;
  }
}
