/* tuesday.com — BRI Health design system v2
   Spine: brihealth.ai — paper #f2f5f7, ink black, blue #3d7fe0,
   Inter black display / DM Sans body, pill controls, soft washes.
   Light + dark themes via [data-theme] on <html>. */

:root {
  --paper: #f2f5f7;
  --ink: #0b0d11;
  --ink-soft: #2a2d33;
  --mute: #565b66;
  --soft: #8a93a6;
  --blue: #3d7fe0;
  --blue-deep: #2c63b8;
  --blue-pale: #dce6fb;
  --blue-pale-soft: #eaf0fd;
  --purple: #5b51d8;
  --teal: #3f9797;
  --ice: #d2ecf9;
  --rule: #d9dee6;
  --tint2: #eef1f6;
  --red: #d64550;

  --surface: #ffffff;          /* cards, tables, modals */
  --surface-2: rgba(255, 255, 255, 0.55);  /* kanban columns */
  --glass: rgba(255, 255, 255, 0.75);      /* sidebar */
  --count-bg: rgba(16, 24, 40, 0.06);
  --soon-bg: #faedd4;
  --soon-fg: #a1650f;
  --wash-a: rgba(91, 81, 216, 0.09);
  --wash-b: rgba(61, 127, 224, 0.08);
  --wash-c: rgba(63, 151, 151, 0.07);

  --sidebar-w: 250px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05), 0 1px 6px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 4px 16px rgba(16, 24, 40, 0.07), 0 1px 3px rgba(16, 24, 40, 0.05);
  --shadow-lg: 0 24px 60px rgba(16, 24, 40, 0.22);

  --font-display: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: "DM Sans", -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

:root[data-theme="dark"] {
  --paper: #0f1218;
  --ink: #eef1f6;
  --ink-soft: #d5dae3;
  --mute: #a3abba;
  --soft: #6d7788;
  --blue: #5a95ec;
  --blue-deep: #7dabf0;
  --blue-pale: #1e2c4a;
  --blue-pale-soft: #171f31;
  --teal: #55b3b3;
  --ice: #16303f;
  --rule: #262d3b;
  --tint2: #1d222d;
  --red: #e05a64;

  --surface: #171b24;
  --surface-2: rgba(23, 27, 36, 0.55);
  --glass: rgba(17, 20, 28, 0.78);
  --count-bg: rgba(255, 255, 255, 0.08);
  --soon-bg: #3a2e14;
  --soon-fg: #e6b45c;
  --wash-a: rgba(91, 81, 216, 0.14);
  --wash-b: rgba(61, 127, 224, 0.10);
  --wash-c: rgba(63, 151, 151, 0.09);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.25), 0 1px 6px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.32), 0 1px 3px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(900px 480px at 85% -10%, var(--wash-a), transparent 60%),
    radial-gradient(760px 420px at -10% 30%, var(--wash-b), transparent 55%),
    radial-gradient(700px 420px at 60% 110%, var(--wash-c), transparent 60%),
    var(--paper);
  background-attachment: fixed;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
  transition: background 0.25s, color 0.25s;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 13.5px; }

/* ---------- sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 22px 18px 18px;
}
.brand-logo {
  width: 38px; height: 38px; object-fit: contain;
  background: #fff; border-radius: 12px; padding: 3px;
  box-shadow: var(--shadow-sm);
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 900; letter-spacing: -0.8px; line-height: 1.05; color: var(--ink);
}
.brand-dot { color: var(--purple); font-weight: 800; }
:root[data-theme="dark"] .brand-dot { color: #8f86ec; }
.brand-sub { font-size: 9.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--soft); margin-top: 3px; font-weight: 600; }

.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase;
  color: var(--soft); padding: 8px 12px 4px; font-weight: 700;
}
.nav-item {
  display: flex; align-items: center; gap: 11px;
  background: none; border: none; color: var(--mute);
  font-size: 14px; font-weight: 600;
  padding: 10px 14px; border-radius: 999px; text-align: left;
  transition: background 0.14s, color 0.14s;
}
.nav-item:hover { background: rgba(61, 127, 224, 0.09); color: var(--ink); }
.nav-item.active { background: var(--ink); color: var(--paper); }
.nav-item.active .nav-ico { opacity: 1; }
.nav-ico { width: 18px; display: inline-flex; align-items: center; justify-content: center; opacity: 0.75; }
.nav-ico svg { width: 17px; height: 17px; }

.sidebar-foot { margin-top: auto; padding: 12px 12px 18px; border-top: 1px solid var(--rule); }
.me-picker { display: flex; flex-direction: column; gap: 2px; }
.me-option {
  display: flex; align-items: center; gap: 9px;
  background: none; border: none; color: var(--mute);
  padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 500; text-align: left; width: 100%;
  transition: background 0.14s;
}
.me-option:hover { background: rgba(61, 127, 224, 0.09); }
.me-option.active { background: var(--blue-pale); color: var(--ink); font-weight: 700; }

/* ---------- avatars ---------- */
.avatar {
  width: 27px; height: 27px; min-width: 27px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff; font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px;
  border: 2px solid var(--surface);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}
.avatar.sm { width: 22px; height: 22px; min-width: 22px; font-size: 9px; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar:not(:first-child) { margin-left: -8px; }

/* ---------- main layout ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }

.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
  padding: 26px 28px 14px;
}
.topbar-title h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 27px; font-weight: 900; letter-spacing: -1.1px; color: var(--ink); line-height: 1.05;
}
.view-sub { margin: 4px 0 0; font-size: 13px; color: var(--mute); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.icon-btn {
  border: none; background: var(--surface); color: var(--mute);
  width: 38px; height: 38px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: color 0.14s, transform 0.12s, box-shadow 0.12s;
}
.icon-btn:hover { color: var(--ink); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.icon-btn svg { width: 18px; height: 18px; }
.ico-sun { display: none; }
.ico-moon { display: inline-flex; }
:root[data-theme="dark"] .ico-sun { display: inline-flex; }
:root[data-theme="dark"] .ico-moon { display: none; }

.search {
  border: 1px solid transparent; border-radius: 999px;
  padding: 9px 17px; width: 210px; background: var(--surface);
  box-shadow: var(--shadow-sm); color: var(--ink);
}
.search::placeholder { color: var(--soft); }
.search:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61, 127, 224, 0.15); }

.view-toggle {
  display: flex; background: var(--surface); border-radius: 999px; padding: 3px;
  box-shadow: var(--shadow-sm);
}
.view-toggle button {
  border: none; background: transparent; padding: 6px 15px; font-size: 13px;
  color: var(--mute); font-weight: 600; border-radius: 999px; transition: background 0.14s, color 0.14s;
}
.view-toggle button.active { background: var(--ink); color: var(--paper); }

.btn {
  border: none; background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 9px 18px; font-size: 13.5px; font-weight: 700;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.btn:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); }
:root[data-theme="dark"] .btn-primary { color: #0f1218; }
.btn-danger { background: rgba(214, 69, 80, 0.12); color: var(--red); box-shadow: none; }
.btn-danger:hover { background: rgba(214, 69, 80, 0.2); box-shadow: none; transform: none; }

/* ---------- filters ---------- */
.filters {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 28px 12px;
}
.filters-label { font-size: 11px; color: var(--soft); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.filters select {
  border: none; border-radius: 999px; padding: 7px 13px; background: var(--surface); font-size: 12.5px;
  color: var(--mute); font-weight: 600; box-shadow: var(--shadow-sm); cursor: pointer;
}
.filters select:focus { outline: none; box-shadow: 0 0 0 3px rgba(61, 127, 224, 0.15); }
.chip-btn {
  border: none; background: var(--surface); border-radius: 999px;
  padding: 7px 15px; font-size: 12.5px; font-weight: 700; color: var(--mute);
  box-shadow: var(--shadow-sm); transition: background 0.14s, color 0.14s;
}
.chip-btn.on { background: var(--ink); color: var(--paper); }
.chip-btn.ghost { background: transparent; box-shadow: none; font-weight: 600; color: var(--soft); }
.chip-btn.ghost:hover { color: var(--ink); }

/* ---------- content ---------- */
.content { flex: 1; overflow: auto; padding: 10px 28px 28px; }

/* ---------- chips (status / priority / category / label) ---------- */
.chip {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.2px;
  border-radius: 999px; padding: 3.5px 10px;
  white-space: nowrap;
}

/* ---------- kanban ---------- */
.kanban { display: flex; gap: 14px; align-items: flex-start; min-height: 100%; }
.kcol {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  width: 276px; min-width: 276px;
  display: flex; flex-direction: column; max-height: calc(100vh - 220px);
  transition: background 0.15s;
}
.kcol-head {
  display: flex; align-items: center; gap: 9px;
  padding: 14px 16px 8px;
}
.kcol-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--col, var(--blue)); }
.kcol-title {
  font-family: var(--font-display);
  font-weight: 800; font-size: 13.5px; letter-spacing: -0.2px; color: var(--ink);
}
.kcol-count {
  margin-left: auto; background: var(--count-bg); color: var(--mute);
  font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 9px;
}
.kcol-body { padding: 6px 10px 4px; display: flex; flex-direction: column; gap: 9px; overflow-y: auto; min-height: 50px; }
.kcol.drag-over { background: var(--blue-pale-soft); outline: 2px dashed rgba(61, 127, 224, 0.4); outline-offset: -4px; }
.kcol-add {
  border: none; background: none; color: var(--soft); font-size: 12.5px; font-weight: 600;
  padding: 10px 16px 12px; text-align: left; border-radius: 0 0 var(--r-lg) var(--r-lg);
}
.kcol-add:hover { color: var(--blue); }

.card {
  background: var(--surface); border-radius: var(--r-md);
  padding: 12px 13px; cursor: grab;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.14s, transform 0.14s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.card.dragging { opacity: 0.45; transform: rotate(1.2deg); }
.card-title { font-weight: 700; font-size: 13.5px; color: var(--ink); margin-bottom: 4px; letter-spacing: -0.1px; }
.card-sub { margin-bottom: 6px; }
.card-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.due {
  font-size: 11px; color: var(--mute); background: var(--tint2);
  border-radius: 999px; padding: 3.5px 10px; font-weight: 700; white-space: nowrap;
}
.due.overdue { color: #fff; background: var(--red); }
:root[data-theme="dark"] .due.overdue { color: #0f1218; }
.due.soon { color: var(--soon-fg); background: var(--soon-bg); }
.card .avatar-stack { margin-left: auto; }

/* ---------- tables ---------- */
.tablewrap {
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
  overflow-x: auto;
}
table.board { border-collapse: collapse; width: 100%; font-size: 13px; }
table.board th {
  background: var(--surface); color: var(--soft); text-align: left;
  padding: 13px 14px 9px; font-weight: 700; font-size: 10.5px; letter-spacing: 1.1px; text-transform: uppercase;
  white-space: nowrap; position: sticky; top: 0;
  border-bottom: 1px solid var(--rule);
}
table.board td { padding: 10px 14px; border-bottom: 1px solid var(--tint2); vertical-align: middle; background: var(--surface); }
table.board tbody tr:last-child td { border-bottom: none; }
table.board tbody tr { cursor: pointer; transition: background 0.1s; }
table.board tbody tr:hover td { background: var(--blue-pale-soft); }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.td-strong { font-weight: 700; color: var(--ink); letter-spacing: -0.1px; }
.td-mute { color: var(--soft); font-size: 12.5px; }

select.pill-select {
  border: none; border-radius: 999px; font-weight: 700;
  font-size: 11px; letter-spacing: 0.2px; padding: 5px 10px;
  -webkit-appearance: none; appearance: none; cursor: pointer; text-align: center;
}
select.pill-select:focus { outline: 2px solid rgba(61, 127, 224, 0.35); outline-offset: 1px; }
select.pill-select option { background: var(--surface); color: var(--ink); }

/* ---------- dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
/* Three cards when the viewer has no CRM access and the pipeline tile is absent,
   so the row fills the width instead of leaving a hole where it would have been. */
.dash-grid.three { grid-template-columns: repeat(3, 1fr); }
.stat-card {
  background: var(--surface); border-radius: var(--r-lg); padding: 20px 20px 17px;
  box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ""; position: absolute; top: -30px; right: -30px; width: 110px; height: 110px;
  border-radius: 50%; background: var(--blue-pale-soft);
}
.stat-card.warn::before { background: rgba(214, 69, 80, 0.1); }
.stat-card.teal::before { background: rgba(63, 151, 151, 0.12); }
.stat-card .num {
  font-family: var(--font-display);
  font-size: 31px; font-weight: 900; letter-spacing: -1.4px; color: var(--ink); line-height: 1;
  position: relative;
}
.stat-card.warn .num { color: var(--red); }
.stat-card.teal .num { color: var(--teal); }
.stat-card .lab { font-size: 10.5px; color: var(--soft); text-transform: uppercase; letter-spacing: 1.1px; margin-top: 8px; font-weight: 700; position: relative; }

.dash-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.panel-head {
  padding: 16px 20px 4px;
  font-family: var(--font-display);
  font-weight: 800; color: var(--ink); font-size: 15px; letter-spacing: -0.3px;
}
.panel-body { padding: 6px 20px 16px; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--tint2); border-radius: 6px; }
.mini-row:last-child { border-bottom: none; }
.mini-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.bar-label { width: 108px; font-size: 12px; color: var(--mute); font-weight: 600; }
.bar-track { flex: 1; background: var(--tint2); border-radius: 999px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.bar-num { width: 24px; text-align: right; font-size: 12px; font-weight: 800; color: var(--ink); }

/* ---------- modals ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(8, 12, 20, 0.45);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex; align-items: center; justify-content: center; z-index: 50;
}
.modal {
  background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg);
  width: min(580px, 92vw); max-height: 88vh; display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px 6px;
}
.modal-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 20px; font-weight: 900; letter-spacing: -0.7px; color: var(--ink);
}
.modal-x {
  border: none; background: var(--tint2); border-radius: 50%;
  width: 30px; height: 30px; font-size: 18px; color: var(--mute); line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.modal-x:hover { background: var(--rule); color: var(--ink); }
.modal-body { padding: 14px 24px 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 13px; }
.modal-body label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 10.5px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: 1px;
}
.modal-body input, .modal-body select, .modal-body textarea {
  border: 1.5px solid var(--rule); border-radius: 11px; padding: 9px 12px; font-weight: 500;
  color: var(--ink); background: var(--surface); text-transform: none; letter-spacing: 0; font-size: 13.5px;
  transition: border-color 0.12s, box-shadow 0.12s;
  color-scheme: light;
}
:root[data-theme="dark"] .modal-body input,
:root[data-theme="dark"] .modal-body select,
:root[data-theme="dark"] .modal-body textarea { color-scheme: dark; }
.modal-body input:focus, .modal-body select:focus, .modal-body textarea:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61, 127, 224, 0.13);
}
.modal-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.modal-grid.two { grid-template-columns: 1fr 1fr; }
.modal-foot { display: flex; gap: 10px; padding: 6px 24px 22px; }
.modal-foot .spacer { flex: 1; }

.assignee-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.assignee-opt {
  display: flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--rule); border-radius: 999px; background: var(--surface);
  padding: 4px 13px 4px 5px; font-size: 12.5px; font-weight: 600; color: var(--mute);
  transition: border-color 0.12s, background 0.12s;
}
.assignee-opt.on { border-color: var(--blue); background: var(--blue-pale-soft); color: var(--blue-deep); }

/* ---------- sidebar foot: identity + actions ---------- */
.me-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 6px;
  background: var(--blue-pale); border-radius: 14px;
}
.me-card .me-name { font-weight: 700; color: var(--ink); font-size: 13.5px; line-height: 1.15; }
.me-card .me-role { font-size: 11px; color: var(--mute); }
.foot-btn {
  display: flex; align-items: center; gap: 9px; width: 100%;
  background: none; border: none; color: var(--mute);
  font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 999px; text-align: left;
  transition: background 0.14s, color 0.14s;
}
.foot-btn:hover { background: rgba(61, 127, 224, 0.09); color: var(--ink); }
.foot-btn svg { width: 15px; height: 15px; }

/* ---------- notifications ---------- */
.topbar-actions { position: relative; }
#notifBtn { position: relative; }
.notif-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; line-height: 1;
  border-radius: 999px; padding: 3px 6px; min-width: 18px; text-align: center;
  border: 2px solid var(--paper);
}
:root[data-theme="dark"] .notif-badge { color: #0f1218; }
.notif-panel {
  position: absolute; top: 46px; right: 96px; z-index: 40;
  width: 360px; max-height: 440px;
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--rule);
  display: flex; flex-direction: column; overflow: hidden;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px 9px;
  font-family: var(--font-display); font-weight: 800; font-size: 14px; color: var(--ink);
  border-bottom: 1px solid var(--tint2);
}
.notif-list { overflow-y: auto; }
.notif-row {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 16px; cursor: pointer;
  border-bottom: 1px solid var(--tint2);
  transition: background 0.1s;
}
.notif-row:hover { background: var(--blue-pale-soft); }
.notif-row:last-child { border-bottom: none; }
.notif-dot { width: 9px; height: 9px; min-width: 9px; border-radius: 50%; margin-top: 5px; }
.notif-main { flex: 1; min-width: 0; }
.notif-title { font-weight: 700; font-size: 13px; color: var(--ink); }
.notif-body { font-size: 12.5px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: 11px; color: var(--soft); white-space: nowrap; margin-top: 2px; }
.notif-row.unread { background: var(--blue-pale-soft); }
.notif-row.unread .notif-title::after {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--blue); margin-left: 7px; vertical-align: middle;
}
.notif-empty { padding: 28px 16px; text-align: center; color: var(--soft); font-size: 13px; }

/* ---------- notification settings ---------- */
.settings-intro { margin: 0; font-size: 12.5px; color: var(--mute); }
.settings-grid-head, .setting-row {
  display: grid; grid-template-columns: 1fr 70px 70px; align-items: center; gap: 8px;
}
.settings-grid-head {
  font-size: 10px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--soft); padding-bottom: 2px; border-bottom: 1px solid var(--tint2);
}
.settings-grid-head span:not(:first-child), .setting-row .cb-wrap { text-align: center; }
.setting-row { padding: 9px 0; border-bottom: 1px solid var(--tint2); }
.setting-row:last-child { border-bottom: none; }
.setting-label { font-weight: 600; color: var(--ink); font-size: 13.5px; }
.setting-hint { font-size: 11.5px; color: var(--soft); font-weight: 400; margin-top: 2px; display: flex; align-items: center; gap: 6px; }
.setting-row input[type="checkbox"] {
  width: 17px; height: 17px; accent-color: var(--blue); cursor: pointer;
}
.setting-row select.lead-select {
  border: 1px solid var(--rule); border-radius: 8px; padding: 3px 6px; font-size: 11.5px;
  background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer;
}

/* ---------- login ---------- */
.login-overlay {
  position: fixed; inset: 0; z-index: 200;
  background:
    radial-gradient(900px 480px at 85% -10%, var(--wash-a), transparent 60%),
    radial-gradient(760px 420px at -10% 30%, var(--wash-b), transparent 55%),
    var(--paper);
  display: flex; align-items: center; justify-content: center;
}
.login-card {
  background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg);
  width: min(400px, 92vw); padding: 34px 34px 26px;
  display: flex; flex-direction: column; gap: 13px;
}
.login-logo { width: 52px; height: 52px; object-fit: contain; background: #fff; border-radius: 14px; padding: 4px; box-shadow: var(--shadow-sm); }
.login-title {
  font-family: var(--font-display); font-size: 26px; font-weight: 900; letter-spacing: -1px; color: var(--ink);
  margin-top: 4px;
}
.login-sub { font-size: 10.5px; letter-spacing: 1.8px; text-transform: uppercase; color: var(--soft); font-weight: 700; margin-bottom: 8px; }
.login-card label {
  display: flex; flex-direction: column; gap: 6px;
  font-size: 10.5px; font-weight: 700; color: var(--soft); text-transform: uppercase; letter-spacing: 1px;
}
.login-card input {
  border: 1.5px solid var(--rule); border-radius: 11px; padding: 10px 13px;
  color: var(--ink); background: var(--surface); font-size: 14px;
}
.login-card input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61, 127, 224, 0.13); }
.login-btn { margin-top: 6px; padding: 11px 18px; font-size: 14px; }
.login-err {
  background: rgba(214, 69, 80, 0.1); color: var(--red);
  border-radius: 10px; padding: 9px 13px; font-size: 12.5px; font-weight: 600;
}
.login-link {
  background: none; border: 0; padding: 2px; margin: 2px 0 0;
  font: inherit; font-size: 12px; font-weight: 600;
  color: var(--soft); text-align: center; cursor: pointer;
}
.login-link:hover { color: var(--ink); text-decoration: underline; }
.login-link:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }
.login-note { margin: 4px 0 0; font-size: 11.5px; color: var(--soft); text-align: center; }

/* ---------- concurrent edit notice ---------- */
.conflict-notice {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--soon-bg); color: var(--soon-fg);
  font-size: 12.5px; line-height: 1.5;
}
.conflict-btn {
  margin: 8px 8px 0 0; padding: 5px 11px; border-radius: 7px;
  border: 1px solid currentColor; background: none; color: inherit;
  font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
}
.conflict-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.conflict-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- encounter log ---------- */
.enc { margin-top: 20px; border-top: 1px solid var(--rule); padding-top: 16px; }
.enc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.enc-head h3 { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.btn-small { padding: 6px 12px; font-size: 12px; }

.enc-form {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r-md);
  padding: 14px; margin-bottom: 16px;
}
.enc-people { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 6px; }
.enc-person { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; }
.enc-person input { width: auto; margin: 0; }
.enc-note { margin: 10px 0 0; font-size: 11.5px; color: var(--soft); }
.enc-note.is-error { color: var(--red); font-weight: 600; }
.enc-form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }

.enc-list { display: flex; flex-direction: column; gap: 10px; }
.enc-empty { margin: 0; font-size: 13px; color: var(--soft); }

/* Matches the task card treatment — surface + soft shadow, no accent rail. */
.enc-item {
  background: var(--surface); border-radius: var(--r-md);
  padding: 11px 13px; box-shadow: var(--shadow-sm);
}
/* A superseded entry stays readable but visibly demoted. The correction being
   visible is the point; the original does not disappear. */
.enc-item.is-superseded { opacity: .55; box-shadow: none; }

.enc-item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.enc-date { font-size: 12.5px; font-weight: 700; color: var(--ink); }
.enc-chan {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: var(--blue-pale); color: var(--blue-deep);
}
.enc-tag {
  font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px;
}
.enc-tag-fix { background: var(--soon-bg); color: var(--soon-fg); }
.enc-tag-old { background: var(--count-bg); color: var(--soft); }

.enc-summary { margin: 0 0 8px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.enc-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; color: var(--soft); }
.enc-by { font-style: italic; }
.enc-next { margin: 8px 0 0; font-size: 12.5px; color: var(--ink-soft); }
.enc-correct {
  background: none; border: 0; padding: 6px 0 0; margin: 0;
  font: inherit; font-size: 11.5px; font-weight: 600; color: var(--soft); cursor: pointer;
}
.enc-correct:hover { color: var(--blue-deep); text-decoration: underline; }
.enc-correct:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); border-radius: 999px; padding: 11px 22px;
  font-size: 13.5px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 100;
}

.empty {
  text-align: center; color: var(--soft); padding: 40px 20px; font-size: 14px;
}

/* ---------- people ---------- */
.people-stack { display: flex; flex-direction: column; gap: 16px; }

.input {
  border: 1.5px solid var(--rule); border-radius: 11px; padding: 9px 12px; font-weight: 500;
  color: var(--ink); background: var(--surface); font-size: 13.5px;
  transition: border-color 0.12s, box-shadow 0.12s;
  color-scheme: light;
}
:root[data-theme="dark"] .input { color-scheme: dark; }
.input:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(61, 127, 224, 0.13);
}
.input.sm { padding: 5px 9px; font-size: 12.5px; border-radius: 8px; max-width: 130px; }

.person-form {
  display: grid; grid-template-columns: 1.2fr 1.4fr 1fr 0.8fr 1.4fr auto;
  gap: 10px; align-items: center;
}
/* Without this the tier select's long option labels set a min-content floor and
   every fr collapses to the same width, ignoring the ratios above. */
.person-form > * { min-width: 0; }
.person-cell { display: flex; align-items: center; gap: 10px; }
.row-actions { display: flex; gap: 4px; flex-wrap: wrap; }
/* A deactivated account stays listed and readable — it is still the author of
   everything it wrote — but should not read as one of the working accounts. */
table.board tbody tr.row-inactive td { opacity: 0.62; }
table.board tbody tr.row-inactive:hover td { opacity: 1; }

.team-list { display: flex; flex-direction: column; gap: 8px; margin: 10px 0 14px; }
.team-row { display: flex; align-items: center; gap: 10px; }
.team-row .grow { flex: 1; }
.team-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.team-add { display: flex; gap: 10px; align-items: center; }
.team-add .grow { flex: 1; }

.invite-panel { border: 1.5px solid var(--teal); }
.invite-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px; font-weight: 600; letter-spacing: 0.5px; color: var(--ink);
  background: var(--tint2); border-radius: 11px; padding: 13px 16px;
  margin: 8px 0 12px; user-select: all; word-break: break-all;
}
.invite-note { color: var(--soft); font-size: 12.5px; line-height: 1.55; margin: 0 0 8px; }
.invite-actions { display: flex; gap: 10px; margin-top: 4px; }

@media (max-width: 1100px) {
  .dash-grid, .dash-grid.three { grid-template-columns: repeat(2, 1fr); }
  .dash-cols { grid-template-columns: 1fr; }
  .person-form { grid-template-columns: 1fr 1fr; }
}
