/* ──────────────────────────────────────────────────────────────
   Developer Dashboard — modern minimal light
   ────────────────────────────────────────────────────────────── */

:root {
  /* Surfaces */
  --bg:        oklch(98.2% 0.003 250);
  --bg-sub:    oklch(96.5% 0.004 250);
  --surface:   #ffffff;
  --surface-2: oklch(99% 0.002 250);
  --border:    oklch(91.5% 0.005 250);
  --border-strong: oklch(86% 0.008 250);
  --divider:   oklch(94% 0.004 250);

  /* Text */
  --text:      oklch(22% 0.01 250);
  --text-mid:  oklch(42% 0.012 250);
  --text-mut:  oklch(58% 0.012 250);
  --text-faint:oklch(72% 0.01 250);

  /* Accent — overridden by Tweaks */
  --accent:        oklch(55% 0.14 245);
  --accent-soft:   oklch(95% 0.04 245);
  --accent-ink:    oklch(38% 0.13 245);
  --accent-line:   oklch(82% 0.07 245);

  /* Semantic */
  --green:    oklch(58% 0.14 150);
  --green-bg: oklch(95% 0.04 150);
  --amber:    oklch(68% 0.15 75);
  --amber-bg: oklch(96% 0.05 75);
  --red:      oklch(58% 0.18 25);
  --red-bg:   oklch(96% 0.04 25);
  --violet:   oklch(55% 0.15 295);
  --violet-bg:oklch(96% 0.04 295);
  --slate:    oklch(55% 0.01 250);
  --slate-bg: oklch(95% 0.005 250);

  /* Spacing / radii — controlled by density */
  --gap: 16px;
  --pad: 18px;
  --r-card: 14px;
  --r-sm: 8px;
  --r-xs: 6px;

  /* Type */
  --font-sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "JetBrains Mono", "SF Mono", Menlo, monospace;
}

[data-density="compact"] {
  --gap: 12px;
  --pad: 14px;
  --r-card: 12px;
}
[data-density="comfy"] {
  --gap: 22px;
  --pad: 24px;
  --r-card: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "ss03", "cv11";
}

button { font-family: inherit; }

/* ── App shell ─────────────────────────────────────────────── */

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-size: 15px;
}
.brand .glyph {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: var(--text);
  color: var(--surface);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.brand .sub {
  font-weight: 400;
  color: var(--text-mut);
  font-size: 13px;
}

.search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  height: 32px;
  background: var(--bg-sub);
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--text-mut);
  font-size: 13px;
  cursor: text;
  transition: border-color .15s, background .15s;
}
.search:hover { background: var(--bg); border-color: var(--border); }
.search input {
  flex: 1; min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font: inherit;
  color: var(--text);
}
.search kbd {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 5px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-mut);
}

.quicklinks {
  display: flex;
  align-items: center;
  gap: 2px;
}
.quicklinks a {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--text-mid);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: background .12s, color .12s;
}
.quicklinks a:hover { background: var(--bg-sub); color: var(--text); }
.quicklinks .dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
}

.clock {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-mid);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.clock .date { color: var(--text-faint); }

.avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, oklch(70% 0.1 245), oklch(55% 0.13 285));
  color: white;
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 12px;
  cursor: pointer;
}

/* ── Grid ──────────────────────────────────────────────────── */

.main {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  padding: var(--gap) 24px 32px;
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
}

.span-7 { grid-column: span 7; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.span-6 { grid-column: span 6; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }

[data-layout="stacked"] .span-7,
[data-layout="stacked"] .span-5 { grid-column: span 6; }

/* ── Card ──────────────────────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;        /* fill the grid cell — keeps siblings in the same row equal-height */
  overflow: hidden;
}
/* Cap row 1 cards (JiraTickets + PRs) at 60vh so they don't stretch the layout */
.cap-60 > .card { max-height: 60vh; }

.card-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px var(--pad) 12px;
  border-bottom: 1px solid var(--divider);
}
[data-density="compact"] .card-h { padding: 10px 14px 10px; }
[data-density="comfy"]   .card-h { padding: 18px 24px 16px; }

.card-h .title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.005em;
  font-size: 14px;
}
.card-h .title .count {
  color: var(--text-faint);
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
}
.card-h .actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-h .actions .pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-mut);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
}
.card-h .actions .pill:hover { background: var(--bg-sub); color: var(--text); }
.card-h .actions .pill.active { background: var(--accent-soft); color: var(--accent-ink); }

.card-body {
  flex: 1;
  padding: var(--pad);
  overflow: auto;
  min-height: 0;
}
[data-density="compact"] .card-body { padding: 14px; }
[data-density="comfy"]   .card-body { padding: 24px; }
.card-body.tight { padding: 0; }

/* ── Jira ──────────────────────────────────────────────────── */

.jira-cols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  height: 100%;
}
.jira-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.jira-col-h {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 10px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mut);
}
.jira-col-h .pip {
  width: 8px; height: 8px; border-radius: 2px;
}
.jira-col-h .num {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  color: var(--text-faint);
}
.jira-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  max-height: 60vh;
  overflow: auto;
}
/* Generic vertically-capped scrollable card body */
.card-body.scroll-list {
  max-height: 60vh;
  overflow: auto;
  min-height: 0;
}
.ticket {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 11px;
  cursor: pointer;
  transition: border-color .12s, transform .08s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ticket:hover {
  border-color: var(--border-strong);
}
.ticket .meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-mut);
}
.ticket .meta .key { font-weight: 600; color: var(--text-mid); }
.ticket .meta .type {
  width: 14px; height: 14px;
  border-radius: 3px;
  display: grid; place-items: center;
  color: white;
  font-size: 9px;
}
.ticket .meta .type.story { background: var(--green); }
.ticket .meta .type.bug   { background: var(--red); }
.ticket .meta .type.task  { background: var(--accent); }
.ticket .meta .type.epic  { background: var(--violet); }
.ticket .title {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text);
  text-wrap: pretty;
}
.ticket .foot {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-mut);
}
.ticket .pts {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  background: var(--bg-sub);
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-mid);
  font-weight: 500;
}
.ticket .prio { display: inline-flex; align-items: center; gap: 3px; }
.ticket .prio .bar {
  width: 3px; border-radius: 1px; background: var(--border-strong);
}
.ticket .prio[data-p="high"] .bar:nth-child(-n+3),
.ticket .prio[data-p="med"]  .bar:nth-child(-n+2),
.ticket .prio[data-p="low"]  .bar:nth-child(-n+1) { background: var(--amber); }
.ticket .prio[data-p="urgent"] .bar { background: var(--red); }
.ticket .due { margin-left: auto; }
.ticket .due.overdue { color: var(--red); }

/* ── Tempo ─────────────────────────────────────────────────── */

.tempo {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.timer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.timer.running { background: var(--accent-soft); border-color: var(--accent-line); }
.timer-row1 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-mut);
}
.timer-row1 .live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 1.6s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 oklch(58% 0.14 150 / 0.6); }
  70% { box-shadow: 0 0 0 8px oklch(58% 0.14 150 / 0); }
  100% { box-shadow: 0 0 0 0 oklch(58% 0.14 150 / 0); }
}
.timer .proj {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text);
}
.timer .desc {
  font-size: 12px;
  color: var(--text-mid);
  margin-top: -6px;
}
.timer .big {
  font-family: var(--font-mono);
  font-size: 38px;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.timer .controls {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.timer .controls button {
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.timer .controls button:hover { background: var(--bg-sub); }
.timer .controls button.primary {
  background: var(--text); color: var(--surface); border-color: var(--text);
}
.timer .controls button.primary:hover { background: oklch(35% 0.01 250); }

.today {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.today-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12.5px;
  color: var(--text-mut);
}
.today-row .val {
  font-family: var(--font-mono);
  color: var(--text);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.bar-bg {
  height: 6px;
  background: var(--bg-sub);
  border-radius: 999px;
  overflow: hidden;
}
.bar-fg {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.week {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.week-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  align-items: end;
  height: 90px;
}
.week-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.week-bar .b {
  width: 100%;
  background: var(--bg-sub);
  border-radius: 4px;
  position: relative;
  transition: background .15s;
  min-height: 2px;
}
.week-bar .b.has { background: var(--accent); opacity: 0.85; }
.week-bar .b.today { box-shadow: 0 0 0 2px var(--accent-soft); }
.week-bar:hover .b.has { opacity: 1; }
.week-bar .lbl {
  font-size: 10.5px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.week-bar.today .lbl { color: var(--accent-ink); font-weight: 600; }
.week-bar .h {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-mut);
  font-variant-numeric: tabular-nums;
}

/* When a row/tile/ticket is wrapped in <a> (item.url present), strip default
   link styling so the anchor inherits the surrounding card design. */
a.ticket, a.row, a.ci, a.pill {
  color: inherit;
  text-decoration: none;
}
a.pill { display: inline-flex; align-items: center; }

/* PR section dividers — same visual language as the jira column headers */
.pr-section + .pr-section { margin-top: 14px; }
.pr-section-h {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-mut);
  border-bottom: 1px solid var(--divider);
  margin-bottom: 4px;
}
.pr-section-h .num {
  margin-left: auto;
  font-family: var(--font-mono);
  font-weight: 500;
  color: var(--text-faint);
}

/* ── Lists (branches/versions/prs) ─────────────────────────── */

.row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--divider);
  cursor: pointer;
}
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--bg-sub); margin: 0 -10px; padding: 10px; border-radius: 8px; border-bottom-color: transparent; }
.row:hover + .row { border-top: 0; }
[data-density="compact"] .row { padding: 7px 0; }

.row .proj {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 2px;
}
.row .name {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text);
  font-weight: 500;
}
.row .sub {
  font-size: 11.5px;
  color: var(--text-mut);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.row .main-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.row .right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.row .ago {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--bg-sub);
  color: var(--text-mid);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
}
.tag.green { background: var(--green-bg); color: var(--green); }
.tag.amber { background: var(--amber-bg); color: oklch(45% 0.13 75); }
.tag.red   { background: var(--red-bg); color: var(--red); }
.tag.violet{ background: var(--violet-bg); color: var(--violet); }
.tag.accent{ background: var(--accent-soft); color: var(--accent-ink); }

.delta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-mut);
  display: inline-flex;
  gap: 6px;
}
.delta .add { color: var(--green); }
.delta .sub { color: var(--red); }

.branch-glyph {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--bg-sub);
  color: var(--text-mut);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 11px;
  flex-shrink: 0;
}
.branch-glyph.feature { background: var(--accent-soft); color: var(--accent-ink); }
.branch-glyph.fix     { background: var(--red-bg); color: var(--red); }
.branch-glyph.chore   { background: var(--slate-bg); color: var(--slate); }
.branch-glyph.release { background: var(--violet-bg); color: var(--violet); }
.branch-glyph.hotfix  { background: var(--amber-bg); color: oklch(45% 0.13 75); }

/* PR review */
.pr-avs {
  display: flex;
  margin-left: -4px;
}
.pr-av {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  margin-left: -6px;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 600;
  color: white;
}

/* ── CI/CD strip ───────────────────────────────────────────── */

.ci-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.ci {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-2);
}
.ci-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ci .status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  flex-shrink: 0;
}
.ci .status-dot.passed { background: var(--green); }
.ci .status-dot.failed { background: var(--red); }
.ci .status-dot.running { background: var(--amber); animation: spin 1s linear infinite; box-shadow: 0 0 0 3px var(--amber-bg); }
.ci .status-dot.queued { background: var(--text-faint); }
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.ci .proj-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.ci .ci-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.ci .ci-actor {
  margin-left: auto;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 9px;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}
.ci .ci-pr {
  color: var(--accent-ink);
}
.ci .ci-trigger {
  color: var(--text-faint);
}
.ci-row2 {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-mut);
}
.ci-row2 .branch {
  font-family: var(--font-mono);
  color: var(--text-mid);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ci-row2 .when {
  flex-shrink: 0;
  padding-left: 8px;
  font-family: var(--font-mono);
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

/* ── Notes ─────────────────────────────────────────────────── */

.notes-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 480px;
  min-height: 380px;
}
[data-density="compact"] .notes-wrap { height: 400px; }
[data-density="comfy"]   .notes-wrap { height: 540px; }

.notes-side {
  border-right: 1px solid var(--divider);
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  min-height: 0;
}
.notes-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--divider);
}
.notes-search input {
  width: 100%;
  height: 30px;
  padding: 0 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  outline: 0;
}
.notes-search input:focus { border-color: var(--accent-line); }
.notes-list {
  flex: 1;
  overflow: auto;
  padding: 6px 0;
}
.notes-list-item {
  padding: 10px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.notes-list-item:hover { background: var(--bg-sub); }
.notes-list-item.active {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}
.notes-list-item .nlt {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notes-list-item .nls {
  font-size: 11px;
  color: var(--text-mut);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notes-list-item .nld {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
.notes-new {
  margin: 8px 12px;
  height: 30px;
  border-radius: 7px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--text-mut);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.notes-new:hover { border-color: var(--accent); color: var(--accent-ink); background: var(--accent-soft); }

.notes-main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.notes-title {
  padding: 12px 18px 8px;
  border-bottom: 1px solid var(--divider);
  display: flex;
  align-items: center;
  gap: 10px;
}
.notes-title input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  outline: 0;
  color: var(--text);
  min-width: 0;
}
.notes-title .del {
  background: transparent;
  border: 0;
  color: var(--text-faint);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.notes-title .del:hover { color: var(--red); background: var(--red-bg); }

.notes-toolbar {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--divider);
  flex-wrap: wrap;
}
.tb-btn {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-mid);
  font-family: var(--font-sans);
  font-size: 13px;
  transition: background .1s;
}
.tb-btn:hover { background: var(--bg-sub); color: var(--text); }
.tb-btn.active { background: var(--accent-soft); color: var(--accent-ink); }
.tb-btn b { font-weight: 700; }
.tb-btn i { font-style: italic; font-family: Georgia, serif; }
.tb-btn u { text-decoration: underline; }
.tb-btn .h1 { font-weight: 700; font-size: 13px; }
.tb-btn .h2 { font-weight: 600; font-size: 12px; }
.tb-btn .mono { font-family: var(--font-mono); font-size: 11px; }
.tb-sep {
  width: 1px;
  height: 16px;
  background: var(--border);
  margin: 0 4px;
}

.notes-editor {
  flex: 1;
  overflow: auto;
  padding: 16px 24px 24px;
  outline: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text);
}
.notes-editor:empty::before {
  content: attr(data-placeholder);
  color: var(--text-faint);
  pointer-events: none;
}
.notes-editor h1 { font-size: 22px; margin: 16px 0 8px; letter-spacing: -0.01em; }
.notes-editor h2 { font-size: 18px; margin: 14px 0 6px; letter-spacing: -0.005em; }
.notes-editor h3 { font-size: 15px; margin: 12px 0 4px; }
.notes-editor p { margin: 0 0 10px; }
.notes-editor ul, .notes-editor ol { margin: 0 0 10px; padding-left: 24px; }
.notes-editor li { margin: 2px 0; }
.notes-editor code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-sub);
  padding: 1px 5px;
  border-radius: 4px;
  color: var(--accent-ink);
}
.notes-editor pre {
  background: oklch(96% 0.005 250);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  overflow: auto;
  margin: 10px 0;
  color: var(--text);
}
.notes-editor pre code { background: transparent; padding: 0; color: inherit; }
.notes-editor a { color: var(--accent-ink); text-decoration: underline; text-decoration-color: var(--accent-line); }
.notes-editor blockquote {
  border-left: 3px solid var(--accent-line);
  padding-left: 12px;
  color: var(--text-mid);
  margin: 10px 0;
}

/* ── Scrollbars (subtle) ───────────────────────────────────── */
.card-body::-webkit-scrollbar,
.notes-list::-webkit-scrollbar,
.notes-editor::-webkit-scrollbar,
.jira-list::-webkit-scrollbar { width: 10px; height: 10px; }
.card-body::-webkit-scrollbar-thumb,
.notes-list::-webkit-scrollbar-thumb,
.notes-editor::-webkit-scrollbar-thumb,
.jira-list::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 10px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.card-body:hover::-webkit-scrollbar-thumb,
.notes-list:hover::-webkit-scrollbar-thumb,
.notes-editor:hover::-webkit-scrollbar-thumb,
.jira-list:hover::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  background-clip: content-box;
}

/* ── Small utils ───────────────────────────────────────────── */
.muted { color: var(--text-mut); }
.faint { color: var(--text-faint); }
.mono  { font-family: var(--font-mono); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; }

/* ── Login + Settings + Empty state (multi-user refactor) ──── */

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.login-card { width: min(420px, 100%); }

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
}
.field > span { color: var(--text-mid); font-weight: 500; }
.field input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
.field small { color: var(--text-faint); font-size: 11px; }

.error-banner {
  background: var(--red-bg);
  color: var(--red);
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 16px;
  text-align: center;
  color: var(--text-mut);
  min-height: 120px;
}
.empty-state .empty-title { font-size: 14px; font-weight: 600; color: var(--text-mid); }
.empty-state .empty-hint  { font-size: 12.5px; color: var(--text-faint); max-width: 320px; }
.empty-state .pill { margin-top: 4px; cursor: pointer; }

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 0;
  min-height: 120px;
}
.skeleton-row {
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%;
  animation: skeleton-shimmer 1.4s ease infinite;
}
@keyframes skeleton-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.user-menu .avatar {
  cursor: pointer;
  border: 0;
  font-family: inherit;
}
.user-menu-pop {
  position: absolute;
  right: 0;
  top: 36px;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 100;
}
.user-menu-pop .user-menu-id {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-faint);
  border-bottom: 1px solid var(--divider);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-menu-pop button,
.user-menu-pop a {
  display: block;
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 0;
  width: 100%;
  padding: 7px 10px;
  border-radius: 5px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text);
  cursor: pointer;
}
.user-menu-pop button:hover,
.user-menu-pop a:hover { background: var(--bg-sub); }
.user-menu-pop form { margin: 0; }

/* Settings page */
.settings-shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.settings-head { display: flex; align-items: center; gap: 16px; }
.settings-head h1 { margin: 0; font-size: 20px; font-weight: 600; }
.settings-head .faint { margin-left: auto; }
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.settings-grid > section:first-child { grid-column: 1 / -1; }
.settings-foot { display: flex; justify-content: flex-end; }

/* Admin */
.users-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.users-table th, .users-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--divider); }
.users-table th { font-weight: 600; color: var(--text-mut); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.users-table tr:last-child td { border-bottom: 0; }

.invite-card {
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 8px;
  padding: 10px 12px;
}
.invite-url {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-ink);
  word-break: break-all;
}

/* Notes (multi-user rewrite — EasyMDE editor) */
.notes-side-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--divider);
  padding: 10px 12px;
  cursor: pointer;
  font: inherit;
}
.notes-side-item:hover { background: var(--bg-sub); }
.notes-side-item.active {
  background: var(--accent-soft);
}
.notes-side-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notes-side-date { font-size: 11px; margin-top: 2px; }

.note-editor-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 14px 16px;
  gap: 10px;
}
.note-editor-head {
  display: flex;
  gap: 10px;
  align-items: center;
}
.note-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  border: 0;
  background: transparent;
  font-family: inherit;
  color: var(--text);
  padding: 4px 0;
  border-bottom: 1px solid transparent;
}
.note-title:focus { outline: none; border-bottom-color: var(--accent); }
