@import url('/static/css/fonts.css');

/* ==========================================================================
   Greyloch brand theme
   Green #009639 · Black #000000 · White #FFFFFF · Dark Grey #444343 · Light Grey #868686
   Headings: Oswald · Body: Open Sans
   ========================================================================== */
:root {
  /* Brand green scale (Greyloch #009639) — matches GreyMatter */
  --brand-50: #e6f5ec;
  --brand-100: #c2e7d0;
  --brand-200: #8fd3a9;
  --brand-300: #57bc7f;
  --brand-500: #009639;
  --brand-600: #008331;
  --brand-700: #006d29;
  --brand-900: #003d16;
  --green: #009639;
  --green-dark: #006d29;
  --green-light: #1fa758;
  --green-bg: #e6f5ec;

  /* Slate neutral scale — matches GreyMatter */
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --greyloch-dark: #444343;
  --greyloch-grey: #868686;

  /* semantic aliases kept so existing class names keep working */
  --navy: #0f172a;          /* headings */
  --navy-2: #ffffff;        /* sidebar is now white */
  --wood: #008331;          /* primary accent -> brand-600 */
  --wood-light: #009639;
  --black: #000000;

  --bg: #f8fafc;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;

  /* functional status colors */
  --red: #dc2626;
  --red-bg: #fef2f2;
  --amber: #d97706;
  --amber-bg: #fffbeb;

  /* One definition of the on-track / off-track surface, shared by overdue
     To-Dos and Scorecard cells so the three screens cannot drift apart. */
  --status-ok-bg: #e6f5ec;
  --status-bad-bg: #fef2f2;

  --radius: 12px;           /* rounded-xl cards */
  --radius-sm: 8px;         /* rounded-lg controls */
  --shadow: 0 1px 2px rgba(15,23,42,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}
h1, h2, h3, h4, .page-head h1, th {
  font-family: 'Oswald', 'Open Sans', sans-serif;
}
a { color: var(--brand-700); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- Layout ---- */
.topbar {
  background: #fff;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
}
.topbar .page-title { font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 600; letter-spacing: .005em; color: var(--text); }
.topbar .spacer { flex: 1; }
.topbar .user { display: flex; align-items: center; gap: 12px; }
.topbar .user .who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; text-decoration: none; }
.topbar .user .who:hover { text-decoration: none; }
.topbar .user .who:hover .nm { color: var(--brand-700); }
.topbar .user .who .nm { font-size: 13px; font-weight: 600; color: var(--text); }
.topbar .user .who .rl { font-size: 11px; color: var(--slate-400); text-transform: capitalize; }
.topbar .user a { color: var(--slate-500); }
.topbar .user form { display: inline; }
.topbar .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--brand-600); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.topbar .user button { background: #fff; border: 1px solid var(--slate-300); color: var(--slate-600); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; }
.topbar .user button:hover { background: var(--slate-100); }

/* Green logo on a white rounded badge (brand-guide primary: green on white) */
.logo-badge { background: #fff; border-radius: 12px; padding: 14px; display: inline-block; line-height: 0; border: 1px solid var(--line); }
.logo-badge img { width: 100%; height: auto; display: block; }

/* Light/dark theme toggle button */
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: none; background: none; color: var(--slate-500); border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.theme-toggle:hover { background: var(--slate-100); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: inline-flex; }

.shell { display: flex; min-height: calc(100vh - 60px); position: relative; min-width: 0; }
.sidebar {
  width: 240px;
  background: #fff;
  border-right: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}
.sidebar .side-logo { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 20px; border-bottom: 1px solid var(--slate-100); }
.sidebar .side-logo .logo-badge { width: 150px; padding: 16px; }
.sidebar .side-logo .product { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .32em; color: var(--greyloch-grey); }
.sidebar .side-nav { flex: 1 1 auto; overflow-y: auto; padding: 10px 0; }
.team-switcher {
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--slate-100);
}
.team-switcher__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--brand-700);
  margin-bottom: 4px;
}
.team-switcher__name {
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 600;
}
.team-switcher select {
  width: 100%;
  font-size: 13px;
  font-weight: 600;
}
.team-card--archived { opacity: .72; }
[data-theme="dark"] .team-switcher { border-bottom-color: #1e293b; }
.sidebar .side-foot { padding: 14px 24px; font-size: 11px; color: var(--slate-400); border-top: 1px solid var(--slate-100); }
.sidebar a {
  display: flex; align-items: center; gap: 12px;
  color: var(--slate-600); margin: 2px 12px; padding: 8px 12px; font-size: 14px; font-weight: 500;
  border-radius: 8px;
}
.sidebar a:hover { background: var(--slate-100); text-decoration: none; color: var(--slate-900); }
.sidebar a.active { background: var(--brand-50); color: var(--brand-700); font-weight: 600; }
.sidebar .section { color: var(--slate-400); font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .1em; padding: 16px 24px 5px; }
.sidebar .ico { width: 18px; text-align: center; }
.sidebar svg.ico { width: 18px; height: 18px; flex-shrink: 0; vertical-align: middle; stroke-width: 1.7; }

/* Three content widths, because a 32" monitor helps some pages and hurts
   others. Default is generous; prose pages stay narrower so lines do not run
   to 200+ characters; the chart and Scorecard take everything going. */
.content { flex: 1 1 auto; width: 100%; min-width: 0; padding: 28px 32px; max-width: 2100px; }
.content--wide { max-width: none; }        /* org chart, Scorecard */
.content--reading { max-width: 1640px; }   /* prose: guide, V/TO, checkup, account */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 21px; color: var(--text); letter-spacing: -.01em; font-weight: 600; }
.page-head .sub { color: var(--muted); margin-top: 5px; font-size: 14px; }

/* ---- Cards ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: none; padding: 20px; margin-bottom: 18px; }
.card h2 { margin: 0 0 4px; font-size: 16px; font-weight: 600; color: var(--navy); }
.card h3 { font-size: 14px; font-weight: 600; color: var(--navy); margin: 0 0 8px; }
.card .card-sub { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; }

/* Nested Core Value tiles on the V/TO — brand-green name, body text for the rest */
.value-card {
  margin: 0;
  box-shadow: none;
  background: var(--slate-50);
  color: var(--text);
  border-left: 3px solid var(--brand-700);
}
.value-card h3 {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--brand-700);
}
.value-card .value-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
}

/* ---- V/TO dashboard presentation ---- */
.vto-head { align-items: flex-start; }
.page-head-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.page-head-actions .btn svg { width: 15px; height: 15px; }
.vto-kicker {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 6px;
}
.vto-block { margin-bottom: 18px; }
.vto-block:last-child { margin-bottom: 0; }
.vto-prose { margin: 0; white-space: pre-wrap; font-size: 15px; line-height: 1.55; color: var(--text); }
.vto-target {
  font-family: 'Oswald', sans-serif;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
  white-space: pre-wrap;
}
.vto-list { margin: 0; padding-left: 18px; color: var(--text); }
.vto-list li { margin: 5px 0; line-height: 1.5; }
.vto-strategy .vto-block {
  padding: 4px 0 8px;
}
.vto-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 14px 0 18px;
}
.vto-metric {
  background: var(--slate-50);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
}
.vto-metric-lbl {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}
.vto-metric-val {
  font-family: 'Oswald', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-top: 4px;
  letter-spacing: .01em;
}
.vto-metric-val.is-money { color: var(--brand-700); }
.vto-save {
  position: sticky;
  bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  z-index: 5;
}

/* ---- Six key components ---- */
/* margin-bottom matches .stats so the dashboard's blocks breathe evenly —
   without it the next card butts straight against the bottom row of tiles */
/* auto-fit, not auto-fill: on a 32" monitor auto-fill creates empty tracks
   and the tiles bunch to the left instead of sharing the row. */
.kc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 22px; }
.kc {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: none; display: block; color: var(--text);
}
.kc:hover { text-decoration: none; border-color: var(--brand-300); transition: .12s; }
.kc .kc-top { display: flex; align-items: center; justify-content: space-between; }
.kc .kc-name { font-weight: 600; color: var(--navy); font-size: 16px; }
.kc .kc-blurb { color: var(--muted); font-size: 13px; margin-top: 8px; min-height: 34px; }
.ring { --p: 0; width: 52px; height: 52px; border-radius: 50%;
  background: conic-gradient(var(--wood) calc(var(--p)*1%), #e9edf1 0);
  display: inline-flex; align-items: center; justify-content: center; }
.ring span { width: 40px; height: 40px; background: #fff; border-radius: 50%; display:flex; align-items:center; justify-content:center; font-size: 12px; font-weight: 700; color: var(--navy); }

/* ---- Stat tiles ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 22px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: none; }
.stat .n { font-family: 'Oswald', sans-serif; font-size: 27px; font-weight: 600; color: var(--slate-900); }
a.stat { display: block; color: var(--text); }
a.stat:hover { border-color: var(--brand-300); transition: .12s; }
.stat .l { color: var(--slate-500); font-size: 13px; font-weight: 500; margin-top: 4px; }

/* ---- Forms ---- */
label { display: block; font-size: 13px; font-weight: 600; color: var(--navy); margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px;
  font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(0,150,57,.15); }
textarea { resize: vertical; min-height: 70px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 4px; font-weight: 400; }

.btn { display: inline-flex; align-items: center; gap: 6px; background: var(--brand-600); color: #fff; border: 1px solid var(--brand-600); padding: 8px 15px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn:hover { background: var(--brand-700); border-color: var(--brand-700); text-decoration: none; color: #fff; }
.btn.secondary { background: #fff; color: var(--slate-600); border: 1px solid var(--slate-300); }
.btn.secondary:hover { background: var(--slate-100); color: var(--slate-900); }
.btn.danger { background: #fff; color: var(--red); border: 1px solid #fecaca; }
.btn.danger:hover { background: var(--red-bg); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
[hidden] { display: none !important; }
.btn-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.green { background: var(--brand-50); color: var(--brand-700); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.amber { background: var(--amber-bg); color: #b45309; }
.badge.gray { background: var(--slate-100); color: var(--slate-600); }
.badge.navy { background: var(--slate-100); color: var(--slate-700); }
.badge.elevated { background: var(--brand-50); color: var(--brand-700); }

/* ---- Scorecard ---- */
.scorecard-board {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}
.scorecard-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.scorecard-board > .scorecard-toolbar { margin-bottom: 8px; }
.scorecard-wrap {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--slate-300) transparent;
  overscroll-behavior-x: contain;
}
.scorecard-wrap::-webkit-scrollbar { height: 10px; }
.scorecard-wrap::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 99px;
}
.scorecard-wrap::-webkit-scrollbar-track { background: transparent; }
.scorecard-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--slate-300);
  background: #fff;
  color: var(--slate-600);
  cursor: pointer;
}
.scorecard-nav:hover { background: var(--slate-100); color: var(--slate-900); }
.scorecard-nav:disabled { opacity: .35; cursor: default; }
.scorecard-nav svg { display: block; }
.scorecard {
  border-collapse: separate;
  border-spacing: 0;
  width: max-content;
  max-width: none;
  --sc-name-w: 180px;
  --sc-owner-w: 110px;
  --sc-goal-w: 88px;
  --sc-avg-w: 104px;
  --sc-now-w: 96px;
}
.scorecard--l10 { --sc-owner-w: 0px; }
/* numbers read as numbers: right-aligned so digits line up column-wise */
.scorecard td.num, .scorecard th.num { text-align: right; }
/* a touch wider now that cells carry $ and thousands separators */
.scorecard .sc-week,
.scorecard .sc-now { width: 120px; min-width: 120px; max-width: 132px; }
.scorecard input.cell { color: var(--text); text-align: right; padding: 6px 6px 6px 2px; font-variant-numeric: tabular-nums; border: 1px solid transparent; background: transparent; width: 100%; min-width: 52px; }
.scorecard input.cell:focus { border-color: var(--wood-light); background: #fff; }
.scorecard .goal { font-weight: 600; color: var(--navy); white-space: nowrap; }
.scorecard .sc-pin {
  position: sticky;
  z-index: 2;
  background: var(--card);
}
.scorecard thead th { background: var(--card); }
.scorecard thead .sc-pin { z-index: 5; }
.scorecard tbody .sc-pin { z-index: 3; }
.scorecard .sc-name { left: 0; width: var(--sc-name-w); min-width: var(--sc-name-w); }
.scorecard .sc-owner { left: var(--sc-name-w); width: var(--sc-owner-w); min-width: var(--sc-owner-w); }
.scorecard .sc-goal { left: calc(var(--sc-name-w) + var(--sc-owner-w)); width: var(--sc-goal-w); min-width: var(--sc-goal-w); }
.scorecard .sc-avg {
  left: calc(var(--sc-name-w) + var(--sc-owner-w) + var(--sc-goal-w));
  width: var(--sc-avg-w); min-width: var(--sc-avg-w);
}
.scorecard .sc-now {
  left: calc(var(--sc-name-w) + var(--sc-owner-w) + var(--sc-goal-w) + var(--sc-avg-w));
  width: var(--sc-now-w);
  min-width: var(--sc-now-w);
  max-width: var(--sc-now-w);
  box-shadow: 6px 0 8px -6px rgba(15, 23, 42, .18);
}
.scorecard thead .sc-now { z-index: 6; }
.scorecard th.sc-now { background: var(--brand-50); color: var(--brand-700); }
.scorecard .sc-now-label {
  display: block;
  font-size: 10px;
  letter-spacing: .06em;
  line-height: 1.2;
  margin-bottom: 2px;
}
.scorecard td.hit { background: var(--status-ok-bg); }
.scorecard td.miss { background: var(--status-bad-bg); }

/* ---- Accountability tree ---- */
.org { list-style: none; padding-left: 0; }
.org ul { list-style: none; padding-left: 28px; border-left: 2px solid var(--line); margin-left: 10px; }
.seat { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 8px 0; box-shadow: var(--shadow); }
.seat .seat-title { font-weight: 700; color: var(--navy); }
.seat .seat-holder { color: var(--wood); font-size: 13px; font-weight: 600; }
.seat .seat-desc { color: var(--text); font-size: 13px; margin-top: 6px; opacity: .85; }
.seat .seat-roles { color: var(--muted); font-size: 12.5px; margin-top: 6px; white-space: pre-line; }

/* ---- Dashboard: this week (My90-style, EOS To-Dos only) ---- */
.section-title { color: var(--navy); font-size: 18px; margin: 8px 0 4px; }
.section-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; }
.my-week { margin: 8px 0 28px; }
.card-head-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.card-head-row h2 { margin: 0; }
.card-head-row .card-sub { margin-bottom: 0; }
.card-head-row .pill-tabs { margin-bottom: 0; }
.tab-count { font-weight: 700; }
.todo-list .todo-row { gap: 10px; }
.todo-list .todo-owner { display: none; }
.todo-list.show-owner .todo-owner { display: inline-block; }
.todo-list:not(.show-owner) .todo-row[data-mine="0"] { display: none; }
.todo-list:not(.show-owner) [data-todo-empty="team"] { display: none; }
.todo-list.show-owner [data-todo-empty="mine"] { display: none; }
.todo-title { flex: 1; min-width: 0; }
.todo-due { font-size: 12px; color: var(--muted); white-space: nowrap; }
.todo-due.is-overdue, .todo-row.is-overdue .todo-due { color: var(--red); font-weight: 700; }
.todo-row.is-overdue { background: var(--status-bad-bg); margin: 0 -10px; padding-left: 10px; padding-right: 10px; border-radius: 8px; }
.todo-row.is-done .todo-title { text-decoration: line-through; }
.rock-row, .meas-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rock-row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.rock-row-meta { display: flex; align-items: center; gap: 8px; }
.rock-list .rock-row { align-items: flex-start; }
.meas-row { flex-wrap: wrap; }

/* ---- Flash / alerts ---- */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.flash.success { background: var(--green-bg); color: #1d6c3d; border: 1px solid #bfe6cd; }
.flash.error { background: var(--red-bg); color: #9c2c1d; border: 1px solid #f0c4bd; }

/* ---- Auth pages ---- */
.auth-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; background: var(--greyloch-dark); padding: 24px; }
.auth-head { display: flex; flex-direction: column; align-items: center; text-align: center; margin-bottom: 26px; }
.auth-head .logo-badge { width: 230px; padding: 18px; }
.auth-head .product { margin-top: 12px; font-family: 'Oswald', sans-serif; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .34em; color: var(--greyloch-grey); }
.auth-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 26px; width: 100%; max-width: 384px; box-shadow: 0 10px 25px rgba(0,0,0,.25); }
.auth-card h1 { font-family: 'Oswald', sans-serif; font-size: 21px; margin: 0 0 4px; color: var(--text); }
.auth-card p.sub { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12px; color: var(--greyloch-grey); }
/* badge used on survey thank-you/closed -> green logo on white */
.auth-badge { background: #fff; border-radius: 12px; padding: 16px; display: inline-block; line-height: 0; margin-bottom: 18px; width: 200px; border: 1px solid var(--line); }
.auth-badge img { width: 100%; height: auto; display: block; }

/* ---- Misc ---- */
.muted { color: var(--muted); }
.empty { color: var(--muted); font-style: italic; padding: 16px 0; }
details.editor { margin-top: 8px; }
details.editor summary { cursor: pointer; color: var(--wood); font-size: 13px; font-weight: 600; list-style: none; }
details.editor summary.is-cancel { color: var(--muted); }
.btn.is-cancel { background: #eef0f2; color: var(--muted); border-color: var(--line); }
.btn.is-cancel:hover { background: #e4e7ea; }

/* ---- Active "edit mode" cue ---- */
/* div-based editor panels (Accountability, Issues, Processes) */
div.editing-open {
  background: var(--green-bg);
  box-shadow: inset 4px 0 0 var(--green);
  border-radius: 0 8px 8px 0;
  padding-left: 14px;
}
/* table-row editor panels (People, Scorecard, Rocks, Manage Users) */
tr.editing-open > td {
  background: var(--green-bg) !important;
  box-shadow: inset 4px 0 0 var(--green);
}
/* <details> editor (Core Values) */
details.editor[open] {
  display: block;
  background: var(--green-bg);
  box-shadow: inset 4px 0 0 var(--green);
  border-radius: 0 8px 8px 0;
  padding: 10px 12px 12px 14px;
  margin-top: 10px;
}
/* "Add new …" forms: same green cue, shown while the user is working in them.
   Padding/margin reserve room for the bar so nothing shifts when it appears. */
.add-form {
  box-shadow: inset 4px 0 0 transparent;
  border-radius: 0 8px 8px 0;
  padding-left: 14px;
  margin-left: -14px;
  transition: background .15s ease, box-shadow .15s ease;
}
.add-form:focus-within {
  background: var(--green-bg);
  box-shadow: inset 4px 0 0 var(--green);
}
details.editor summary::-webkit-details-marker { display: none; }
details.editor[open] summary { margin-bottom: 10px; }
.divider { height: 1px; background: var(--line); margin: 18px 0; }
.pill-tabs { display: inline-flex; gap: 4px; background: #e9edf1; padding: 4px; border-radius: 10px; margin-bottom: 18px; }
.pill-tabs a { padding: 7px 14px; border-radius: 7px; font-size: 13px; font-weight: 600; color: var(--muted); }
.pill-tabs a.active { background: #fff; color: var(--navy); box-shadow: var(--shadow); }
.gwc { display: flex; gap: 4px; }
select.rock-status { font-weight: 600; border-radius: 999px; padding: 5px 10px; width: auto; min-width: 120px; }
select.rock-status.on_track { background: var(--amber-bg); color: #9a7212; border-color: #ecd8a3; }
select.rock-status.off_track { background: var(--red-bg); color: var(--red); border-color: #f0c4bd; }
select.rock-status.done { background: var(--green-bg); color: var(--green); border-color: #bfe6cd; }
.checklist { list-style: none; padding: 0; }
.checklist li { padding: 7px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.checklist li:last-child { border: none; }
.guide-step { display: flex; gap: 16px; margin-bottom: 22px; }
.guide-step .num { width: 34px; height: 34px; flex-shrink: 0; background: var(--wood); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.guide-step h3 { margin: 4px 0 6px; }
/* ---- Organizational Checkup ---- */
.checkup-score { width: 92px; height: 92px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-family: 'Oswald', sans-serif; font-size: 38px; font-weight: 600; color: #fff; line-height: 1; }
.checkup-score span { font-size: 16px; font-weight: 500; margin-left: 2px; }
.checkup-score.green { background: var(--green); }
.checkup-score.amber { background: var(--amber); }
.checkup-score.red { background: var(--red); }
.score-row { display: flex; align-items: center; gap: 12px; margin: 7px 0; }
.score-label { width: 84px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--navy); }
.score-track { flex: 1; height: 12px; background: #eef1f4; border-radius: 999px; overflow: hidden; }
.score-fill { display: block; height: 100%; border-radius: 999px; background: var(--green); transition: width .3s ease; }
.score-fill.amber { background: var(--amber); }
.score-fill.red { background: var(--red); }
.score-num { width: 42px; text-align: right; font-size: 13px; font-weight: 700; color: var(--navy); }
.trend { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 6px; }
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.trend-bar { width: 70%; max-width: 38px; border-radius: 5px 5px 0 0; background: var(--green); min-height: 6px; }
.trend-bar.amber { background: var(--amber); }
.trend-bar.red { background: var(--red); }
.trend-num { font-size: 12px; font-weight: 700; color: var(--navy); margin-bottom: 4px; }
.trend-lbl { font-size: 11px; color: var(--muted); margin-top: 5px; text-align: center; }
.checkup-q { padding: 12px 0; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.checkup-q:last-child { border-bottom: none; }
.checkup-q-text { font-size: 14.5px; }
.scale { display: flex; gap: 6px; flex-shrink: 0; }
.scale-opt { cursor: pointer; }
.scale-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.scale-opt span { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; color: var(--muted); background: #fff; transition: .12s; }
.scale-opt:hover span { border-color: var(--green-light); }
.scale-opt input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.scale-opt input:focus-visible + span { box-shadow: 0 0 0 3px rgba(0,150,57,.25); }
@media (max-width: 600px) {
  .checkup-q { flex-direction: column; align-items: stretch; }
  .scale { justify-content: space-between; }
}

/* ---- One-question-per-screen survey wizard ---- */
.wiz-progress { height: 7px; background: #e3e7eb; border-radius: 999px; overflow: hidden; margin: 4px 0 20px; }
.wiz-progress-fill { height: 100%; width: 0; background: var(--green); border-radius: 999px; transition: width .3s ease; }
.wizard.stepper .q-step { display: none; }
.wizard.stepper .q-step.active { display: block; animation: stepIn .22s ease; }
@keyframes stepIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.q-meta { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; margin-bottom: 12px; }
.q-comp { color: var(--green-dark); }
.wizard.stepper .q-step .card { text-align: center; padding: 34px 28px; }
.checkup-q-text.big { font-size: 21px; line-height: 1.45; margin: 0 auto 26px; max-width: 620px; }
.wizard.stepper .q-step .scale { justify-content: center; }
.scale-lg { gap: 10px; }
.scale-lg .scale-opt span { width: 56px; height: 56px; font-size: 19px; }
.wiz-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; bottom: 16px; }
@media (max-width: 480px) {
  .scale-lg { gap: 6px; }
  .scale-lg .scale-opt span { width: 48px; height: 48px; font-size: 17px; }
  .wizard.stepper .q-step .card { padding: 26px 16px; }
}

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
/* ---- Mobile navigation drawer ---- */
.nav-toggle { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; margin-left: -6px; margin-right: 2px; background: none; border: none; border-radius: 8px; color: var(--slate-600); cursor: pointer; flex-shrink: 0; }
.nav-toggle:hover { background: var(--slate-100); }
.nav-toggle svg { width: 22px; height: 22px; }
.nav-backdrop { display: none; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; }
  .topbar { padding: 0 12px; gap: 6px; }
  .topbar .page-title { display: none; }      /* declutter; the content heading repeats it */
  .topbar .user .who { display: none; }
  .topbar .user { gap: 8px; }
  .topbar .user button { white-space: nowrap; padding: 6px 11px; }
  .sidebar {
    position: fixed; top: 60px; left: 0; bottom: 0; width: 264px; z-index: 60;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 3px 0 18px rgba(15,23,42,.18);
  }
  body.nav-open .sidebar { transform: translateX(0); }
  .nav-backdrop { position: fixed; inset: 60px 0 0 0; background: rgba(15,23,42,.35); z-index: 55; }
  body.nav-open .nav-backdrop { display: block; }
  .content { padding: 18px 14px; max-width: 100%; }
  .two-col { grid-template-columns: 1fr; }
  .vto-metrics { grid-template-columns: 1fr; gap: 8px; }
  .vto-target { font-size: 18px; }
  .vto-metric-val { font-size: 18px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat .n { font-size: 23px; }
  /* Name stays pinned. Owner hides so Goal + this week fit on the first screen. */
  .scorecard .sc-owner { display: none; }
  .scorecard .sc-goal,
  .scorecard .sc-now {
    position: static;
    left: auto;
    box-shadow: none;
  }
  .scorecard .sc-name {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--card);
    box-shadow: 1px 0 0 var(--line);
  }
  .scorecard { --sc-name-w: 132px; --sc-owner-w: 0px; --sc-goal-w: 72px; --sc-now-w: 84px; }
  .scorecard--l10 { --sc-owner-w: 0px; }
}
@media (max-width: 470px) {
  .page-head { gap: 10px; }
  .page-head h1 { font-size: 19px; }
}

/* Tables that collapse to stacked cards on phones (opt-in via class="stack") */
@media (max-width: 600px) {
  table.stack, table.stack tbody { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tr { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 6px 12px; margin-bottom: 10px; background: var(--card); }
  table.stack td { display: block; border: none !important; padding: 7px 0; text-align: left !important; }
  table.stack td:empty { display: none; }
  table.stack td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; margin-bottom: 3px; }
  table.stack select, table.stack .rock-status { width: 100%; }
}

/* ==========================================================================
   Dark mode  —  applied when <html data-theme="dark">
   Mirrors GreyMatter's slate-950/900 dark surfaces.
   ========================================================================== */
[data-theme="dark"] {
  --bg: #020617;          /* slate-950 */
  --card: #0f172a;        /* slate-900 */
  --line: #1e293b;        /* slate-800 */
  --text: #e2e8f0;        /* slate-200 */
  --muted: #94a3b8;       /* slate-400 */
  --navy: #e2e8f0;        /* headings flip light */
  /* the dashboard's overdue tint, adopted everywhere */
  --status-ok-bg: rgba(0, 150, 57, .15);
  --status-bad-bg: rgba(220, 38, 38, .13);
}
[data-theme="dark"] body { background: var(--bg); color: var(--text); }
[data-theme="dark"] a { color: var(--brand-300); }

/* chrome */
[data-theme="dark"] .topbar { background: #0f172a; border-bottom-color: #1e293b; }
[data-theme="dark"] .topbar .page-title { color: var(--text); }
[data-theme="dark"] .topbar .user .who .nm { color: var(--text); }
[data-theme="dark"] .topbar .user button { background: #0f172a; border-color: #334155; color: #cbd5e1; }
[data-theme="dark"] .topbar .user button:hover { background: #1e293b; }
[data-theme="dark"] .nav-toggle { color: #cbd5e1; }
[data-theme="dark"] .nav-toggle:hover { background: #1e293b; }
[data-theme="dark"] .theme-toggle { color: #cbd5e1; }
[data-theme="dark"] .theme-toggle:hover { background: #1e293b; }
[data-theme="dark"] .theme-toggle .icon-sun { display: inline-flex; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

[data-theme="dark"] .sidebar { background: #0f172a; border-right-color: #1e293b; }
[data-theme="dark"] .sidebar .side-logo { border-bottom-color: #1e293b; }
[data-theme="dark"] .sidebar .side-foot { color: #64748b; border-top-color: #1e293b; }
[data-theme="dark"] .sidebar a { color: #cbd5e1; }
[data-theme="dark"] .sidebar a:hover { background: #1e293b; color: #fff; }
[data-theme="dark"] .sidebar a.active { background: rgba(0,150,57,.22); color: #8fd3a9; }
[data-theme="dark"] .sidebar .section { color: #64748b; }

/* surfaces */
[data-theme="dark"] .card,
[data-theme="dark"] .kc,
[data-theme="dark"] .stat,
[data-theme="dark"] .seat { background: var(--card); border-color: var(--line); }
[data-theme="dark"] .stat .n { color: var(--text); }
[data-theme="dark"] td[style*="fafbfc"] { background: #0b1220 !important; }
[data-theme="dark"] .value-card {
  background: #0b1220;
  border-color: #334155;
  border-left-color: var(--brand-200);
  color: #f1f5f9;
}
[data-theme="dark"] .value-card h3 { color: var(--brand-200); }
[data-theme="dark"] .value-card .value-desc { color: #f1f5f9; }
[data-theme="dark"] .vto-metric {
  background: #0b1220;
  border-color: #334155;
}
[data-theme="dark"] .vto-metric-val { color: #f1f5f9; }
[data-theme="dark"] .vto-metric-val.is-money { color: var(--brand-200); }
[data-theme="dark"] .vto-target,
[data-theme="dark"] .vto-prose,
[data-theme="dark"] .vto-list { color: #f1f5f9; }

/* forms */
[data-theme="dark"] input[type=text],
[data-theme="dark"] input[type=email],
[data-theme="dark"] input[type=password],
[data-theme="dark"] input[type=number],
[data-theme="dark"] input[type=date],
[data-theme="dark"] select,
[data-theme="dark"] textarea { background: #0b1220; border-color: #334155; color: var(--text); }
[data-theme="dark"] input::placeholder, [data-theme="dark"] textarea::placeholder { color: #64748b; }
[data-theme="dark"] .btn.secondary { background: #0f172a; color: #cbd5e1; border-color: #334155; }
[data-theme="dark"] .btn.secondary:hover { background: #1e293b; color: #fff; }
[data-theme="dark"] .btn.is-cancel { background: #1e293b; color: #94a3b8; border-color: #334155; }
[data-theme="dark"] .btn.danger { background: #0f172a; color: #f87171; border-color: #7f1d1d; }

/* badges */
[data-theme="dark"] .badge.gray { background: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .badge.navy { background: #1e293b; color: #cbd5e1; }
[data-theme="dark"] .badge.green { background: rgba(0,150,57,.20); color: #8fd3a9; }
[data-theme="dark"] .badge.elevated { background: rgba(0,150,57,.20); color: #8fd3a9; }

/* data viz / surveys */
[data-theme="dark"] .score-track { background: #1e293b; }
[data-theme="dark"] .wiz-progress { background: #1e293b; }
[data-theme="dark"] .scale-opt span { background: #0b1220; border-color: #334155; color: #94a3b8; }
[data-theme="dark"] .scale-opt:hover span { border-color: var(--green-light); }
[data-theme="dark"] .pill-tabs { background: #1e293b; }
[data-theme="dark"] .pill-tabs a.active { background: #0f172a; color: var(--text); }
[data-theme="dark"] .section-title { color: var(--text); }

/* active-edit / focus highlights -> translucent green on dark */
[data-theme="dark"] .editing-open,
[data-theme="dark"] .add-form:focus-within,
[data-theme="dark"] details.editor[open] { background: rgba(0,150,57,.12); }
[data-theme="dark"] tr.editing-open > td { background: rgba(0,150,57,.12) !important; }

/* the white logo badge stays white in dark mode so the green mark pops */
[data-theme="dark"] .ring { background: conic-gradient(var(--wood) calc(var(--p)*1%), #1e293b 0); }
[data-theme="dark"] .ring span { background: var(--card); color: var(--text); }
[data-theme="dark"] .flash.success { background: rgba(0,150,57,.15); color: #8fd3a9; border-color: rgba(0,150,57,.35); }
[data-theme="dark"] .flash.error { background: rgba(220,38,38,.13); color: #fca5a5; border-color: rgba(220,38,38,.4); }
[data-theme="dark"] .flash { background: #1e293b; color: var(--text); border-color: #334155; }
[data-theme="dark"] .scorecard-nav { background: #0f172a; border-color: #334155; color: #cbd5e1; }
[data-theme="dark"] .scorecard-nav:hover { background: #1e293b; color: #fff; }
[data-theme="dark"] .scorecard th.sc-now { background: #14532d; color: var(--brand-200); }
[data-theme="dark"] .scorecard-wrap::-webkit-scrollbar-thumb { background: #334155; }

/* ==========================================================================
   Mobile compaction — tighter spacing on phones/tablets
   ========================================================================== */
@media (max-width: 880px) {
  .content { padding: 16px 12px; }
  .page-head { margin-bottom: 14px; }
  .page-head .sub { font-size: 13px; margin-top: 3px; }
  .card { padding: 15px; margin-bottom: 12px; }
  .card h2 { font-size: 15px; }
  .card .card-sub { margin-bottom: 10px; font-size: 12.5px; }
  .card-grid { gap: 12px; }
  .kc { padding: 14px; }
  .kc-grid { gap: 10px; margin-bottom: 16px; }
  .kc .kc-blurb { min-height: 0; margin-top: 6px; }
  .stats { margin-bottom: 16px; }
  .field { margin-bottom: 10px; }
  .row { gap: 10px; }
  .divider { margin: 12px 0; }
  .btn { padding: 8px 13px; }
  table th, table td { padding: 8px; }
  .table-wrap table:not(.stack) { font-size: 13px; }
}
@media (max-width: 600px) {
  table.stack tr { padding: 4px 12px 8px; margin-bottom: 8px; }
  table.stack td { padding: 5px 0; }
}

/* ==========================================================================
   Accountability Chart — org chart view (top-down boxes + collapsible nodes)
   ========================================================================== */
.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.view-bar .pill-tabs { margin-bottom: 0; }
.view-bar .pill-tabs a { cursor: pointer; }

/* Its own viewport rather than growing the page: with 51 seats the chart is
   far taller and wider than a screen, and scrolling the page would take the
   toolbar away with it. Drag to pan (see initOrgPan), or scroll either axis. */
.orgchart {
  overflow: auto;
  padding: 6px 4px 24px;
  height: clamp(420px, calc(100vh - 300px), 1400px);
  overscroll-behavior: contain;
  cursor: grab;
}
.orgchart.is-panning { cursor: grabbing; user-select: none; }
/* keep the grab cursor off things you actually click */
.orgchart .org-node, .orgchart button, .orgchart a, .orgchart input { cursor: auto; }
.orgchart button, .orgchart a { cursor: pointer; }
.orgchart .org-node-body { cursor: auto; }
.orgchart ul { display: flex; justify-content: center; align-items: flex-start; list-style: none; margin: 0; padding: 26px 0 0; position: relative; }
/* The root row must not use justify-content: center. Once the tree is wider
   than the viewport, centred flex overflow spills equally both ways and the
   left half becomes unreachable — the chart looked blank at 51 seats. Sizing
   to content and centring with auto margins scrolls correctly and still
   centres a small chart. */
.orgchart > ul { width: max-content; margin: 0 auto; justify-content: flex-start; }
.orgchart li { list-style: none; position: relative; padding: 26px 9px 0; text-align: center; }

/* connector: horizontal arms + vertical drop into each child */
.orgchart li::before,
.orgchart li::after {
  content: ''; position: absolute; top: 0; right: 50%;
  border-top: 2px solid var(--line); width: 50%; height: 26px;
}
.orgchart li::after { right: auto; left: 50%; border-left: 2px solid var(--line); }
.orgchart li:only-child::before, .orgchart li:only-child::after { display: none; }
.orgchart li:only-child { padding-top: 26px; }
.orgchart li:first-child::before, .orgchart li:last-child::after { border: 0 none; }
.orgchart li:last-child::before { border-right: 2px solid var(--line); border-radius: 0 7px 0 0; }
.orgchart li:first-child::after { border-radius: 7px 0 0 0; }
/* vertical stem from a parent box down to its children row */
.orgchart ul ul::before {
  content: ''; position: absolute; top: 0; left: 50%;
  border-left: 2px solid var(--line); width: 0; height: 26px;
}
/* the root row has nothing above it */
.orgchart > ul { padding-top: 0; }
.orgchart > ul > li { padding-top: 0; }
.orgchart > ul > li::before, .orgchart > ul > li::after { display: none; }

/* node box */
/* Uniform tiles: every seat is the same size; the body scrolls if it overflows.
   Sized to the full ninety.io org (51 seats, up to 9 roles on one seat).
   Width matters as much as height: at 258px, 36 role lines wrapped onto two
   lines; at 320px only 2 do, so the wider tile is both more readable and
   shorter than padding the height would have made it. */
.orgchart { --org-tile-w: 320px; --org-tile-h: 360px; }
.org-node {
  position: relative; display: inline-flex; flex-direction: column;
  vertical-align: top; text-align: left;
  width: var(--org-tile-w); height: var(--org-tile-h);
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 16px;
}
.org-node-head { flex: 0 0 auto; text-align: center; }
/* block-level + auto margins: keeps photo and initials avatars exactly the same
   height (an inline <img> would otherwise add baseline descender space). */
.org-avatar {
  display: flex; align-items: center; justify-content: center;
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 7px;
  object-fit: cover; background: var(--slate-100); border: 2px solid var(--card);
  box-shadow: 0 0 0 1px var(--line);
  font-family: 'Oswald', sans-serif; font-size: 18px; font-weight: 600; color: #fff;
  overflow: hidden; flex-shrink: 0;
}
.org-avatar.initials { background: var(--brand-600); box-shadow: 0 0 0 1px var(--brand-600); }
.org-avatar.empty { background: var(--slate-100); color: var(--slate-400); }
.org-avatar.empty svg { width: 26px; height: 26px; }
[data-theme="dark"] .org-avatar.empty { background: #1e293b; color: var(--slate-500); }
.org-node-body {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; margin-top: 8px;
  scrollbar-width: thin; scrollbar-color: var(--slate-300) transparent;
}
/* soft fade at the bottom while there is more content below */
.org-node-body.has-more {
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), rgba(0,0,0,.15) 100%);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 16px), rgba(0,0,0,.15) 100%);
}
.org-node-body::-webkit-scrollbar { width: 6px; }
.org-node-body::-webkit-scrollbar-track { background: transparent; }
.org-node-body::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 3px; }
[data-theme="dark"] .org-node-body { scrollbar-color: #334155 transparent; }
[data-theme="dark"] .org-node-body::-webkit-scrollbar-thumb { background: #334155; }
.org-node.open-seat { border-style: dashed; }
.org-node-title { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 14.5px; color: var(--text); line-height: 1.25; }
.org-node-holder { color: var(--brand-700); font-size: 12.5px; font-weight: 600; margin-top: 2px; }
.org-node.open-seat .org-node-holder { color: var(--muted); font-style: italic; font-weight: 500; }
/* Sticky so the heading stays visible while a long list scrolls. */
.org-roles-label {
  position: sticky; top: 0; z-index: 1; background: var(--card);
  font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em;
  color: var(--slate-400); text-align: left;
  padding-bottom: 4px; margin-bottom: 5px; border-bottom: 1px solid var(--line);
}
.org-node-roles { margin: 0; }
.org-node-roles .role { color: var(--muted); font-size: 11.5px; line-height: 1.5; padding-left: 10px; position: relative; text-align: left; }
.org-node-roles .role::before { content: '·'; position: absolute; left: 2px; color: var(--brand-500); font-weight: 700; }
.org-node-desc { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11.5px; line-height: 1.45; }

/* collapse / expand control at the bottom of a node */
.org-toggle {
  position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  min-width: 26px; height: 26px; padding: 0 6px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-size: 12px; font-weight: 600; line-height: 1; z-index: 2;
}
.org-toggle:hover { border-color: var(--brand-500); color: var(--brand-700); }
.org-toggle .chev { width: 14px; height: 14px; }
.org-toggle .cnt { display: none; }
.orgchart li.collapsed > ul { display: none; }
.orgchart li.collapsed > .org-node .org-toggle {
  background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700);
}
.orgchart li.collapsed > .org-node .org-toggle .chev { display: none; }
.orgchart li.collapsed > .org-node .org-toggle .cnt { display: inline; }

@media (max-width: 880px) {
  .orgchart { padding-bottom: 20px; }
  /* narrower tiles wrap the longer role names onto two lines, so mobile needs
     more height than the desktop arithmetic suggests */
  .orgchart { --org-tile-w: 250px; --org-tile-h: 400px; }
  .org-node { padding: 14px; }
  .org-node-title { font-size: 13.5px; }
  .org-node-roles .role { font-size: 11px; }
}

/* ---- Edit pencil on org chart tiles ---- */
.org-edit {
  position: absolute; top: 7px; right: 7px; width: 24px; height: 24px;
  border-radius: 6px; border: 1px solid transparent; background: none;
  color: var(--slate-400); cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; z-index: 2;
}
.org-edit svg { width: 13px; height: 13px; }
.org-edit:hover { background: var(--brand-50); border-color: var(--brand-200); color: var(--brand-700); }

/* ---- Modal ---- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(15,23,42,.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 42px 16px; overflow-y: auto;
}
.modal {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  width: 100%; max-width: 580px; box-shadow: 0 18px 45px rgba(0,0,0,.30);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 600; color: var(--text); }
.modal-close { background: none; border: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; border-radius: 6px; }
.modal-close:hover { color: var(--text); background: var(--slate-100); }
.modal-body { padding: 18px; }
[data-theme="dark"] .modal-close:hover { background: #1e293b; }
@media (max-width: 600px) { .modal-backdrop { padding: 16px 10px; } .modal-body { padding: 14px; } }

/* ---- Profile photo picker ---- */
.avatar-picker-row { display: flex; align-items: flex-start; gap: 14px; }
.avatar-preview {
  width: 64px; height: 64px; border-radius: 50%; flex-shrink: 0;
  background: var(--slate-100) center/cover no-repeat;
  border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 20px; color: var(--slate-400);
}
.avatar-preview.has-img { color: transparent; border-color: var(--brand-200); }
.avatar-picker-controls { flex: 1 1 auto; min-width: 0; }
.avatar-picker-controls input[type=file] { font-size: 12.5px; max-width: 100%; }
.avatar-picker-controls .hint { margin-top: 4px; }
.avatar-remove { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 400; font-size: 12.5px; color: var(--muted); }
.avatar-remove input { width: auto; }
[data-theme="dark"] .avatar-preview { background-color: #1e293b; }

/* small round avatar used in tables/lists */
.mini-avatar {
  width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
  background: var(--brand-600) center/cover no-repeat;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'Oswald', sans-serif; font-size: 11px; font-weight: 600; color: #fff;
  vertical-align: middle; margin-right: 8px;
}

/* ---- Org chart toolbar (collapse/expand, zoom, search) ---- */
/* single flat row: controls keep their size, the search box takes up the slack */
.chart-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; min-width: 0; }
.tb-group {
  display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card); padding: 2px;
}
.tb-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border: none; background: none; border-radius: 7px;
  color: var(--slate-500); cursor: pointer; padding: 0;
}
.tb-btn:hover { background: var(--slate-100); color: var(--brand-700); }
.tb-btn:disabled { opacity: .4; cursor: not-allowed; }
.tb-btn:disabled:hover { background: none; color: var(--slate-500); }
.tb-btn svg { width: 17px; height: 17px; }
.tb-zoom {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  padding: 0 8px 0 4px; min-width: 44px; text-align: center; font-variant-numeric: tabular-nums;
}
.tb-search { position: relative; display: inline-flex; align-items: center; flex: 1 1 170px; min-width: 130px; max-width: 320px; }
.tb-search svg { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--slate-400); pointer-events: none; }
.tb-search input {
  width: 100%; height: 36px; padding: 0 10px 0 32px; font-size: 13px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--text);
}
.tb-search input::-webkit-search-cancel-button { cursor: pointer; }
.tb-count {
  position: absolute; right: 10px; font-size: 11px; font-weight: 600;
  color: var(--muted); pointer-events: none; background: var(--card); padding-left: 6px;
}
[data-theme="dark"] .tb-btn:hover { background: #1e293b; color: var(--brand-300); }

/* search highlighting */
.orgchart.searching .org-node { opacity: .32; transition: opacity .15s; }
.orgchart.searching li.search-match > .org-node {
  opacity: 1; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100);
}
[data-theme="dark"] .orgchart.searching li.search-match > .org-node { box-shadow: 0 0 0 3px rgba(0,150,57,.30); }

@media (max-width: 880px) {
  .view-bar { flex-direction: column; align-items: stretch; gap: 10px; }
  .tb-search { max-width: none; }
}
/* On small phones drop the zoom % readout so the row still fits on one line. */
@media (max-width: 560px) {
  .chart-toolbar { gap: 7px; }
  .tb-zoom { display: none; }
}

/* ==========================================================================
   Level 10 timed meeting — persistent side panel + workspace
   ========================================================================== */
.l10-other-live {
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 14px;
}
.l10-other-live__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 4px 0;
}
[data-theme="dark"] .l10-other-live {
  background: rgba(0,150,57,.16);
  border-color: rgba(0,150,57,.35);
}
.l10-banner {
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  color: var(--brand-900);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.l10-start-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.l10 { display: block; }
.l10-workspace { min-width: 0; }
.l10-is-running [data-section]:not(.is-current) { display: none; }
.l10-section.is-current { outline: none; }

.l10-panel {
  width: 300px;
  flex-shrink: 0;
  background: var(--card);
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow: auto;
  z-index: 40;
}
.l10-panel__toggle {
  display: none;
  width: 100%;
  text-align: left;
  background: var(--card);
  border: none;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  font-family: 'Oswald', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}
.l10-panel__toggle-clock { float: right; font-variant-numeric: tabular-nums; color: var(--brand-700); }
.l10-panel__body { padding: 16px 16px 24px; display: flex; flex-direction: column; gap: 14px; }
.l10-panel__kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand-700);
}
.l10-panel__date { font-family: 'Oswald', sans-serif; font-size: 16px; font-weight: 600; }
.l10-panel__by { font-size: 12px; color: var(--muted); }
.l10-panel__clocks { display: grid; gap: 10px; }
.l10-panel__clock-block {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.l10-clock-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.l10-clock {
  font-family: 'Oswald', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 40px;
  line-height: 1.05;
  color: var(--text);
  margin-top: 4px;
}
.l10-clock--meet { font-size: 28px; }
.l10-clock.is-over { color: var(--red); background: var(--red-bg); margin: 6px -8px -4px; padding: 4px 8px; border-radius: 8px; }
.l10-clock.is-warn { color: var(--amber); }
.l10-clock-caption { font-size: 12px; color: var(--muted); margin-top: 2px; }
.l10-panel__paused {
  font-size: 12px;
  color: var(--amber);
  background: var(--amber-bg);
  border-radius: 8px;
  padding: 8px 10px;
}
.l10-rail { display: flex; flex-direction: column; gap: 2px; }
.l10-rail__item {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--slate-600);
  font-size: 13px;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.l10-rail__item:hover { background: var(--slate-100); text-decoration: none; color: var(--slate-900); }
.l10-rail__item.is-current {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
  border-left-color: var(--brand-700);
}
.l10-rail__item.is-over .l10-rail__times { color: var(--red); }
.l10-rail__num { width: 1.4em; flex-shrink: 0; }
.l10-rail__label { flex: 1; }
.l10-rail__times { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); }
.l10-panel__controls { display: flex; flex-wrap: wrap; gap: 6px; }
.l10-panel__open { font-size: 13px; font-weight: 600; }

.l10-timebar { height: 160px; }
.l10-timebar .trend-lbl { line-height: 1.25; }

body.has-l10-panel .content { max-width: none; }

@media (max-width: 1100px) {
  .l10-panel {
    position: fixed;
    right: 0; left: 0; bottom: 0;
    top: auto;
    width: auto;
    height: auto;
    max-height: 72vh;
    border-left: none;
    border-top: 1px solid var(--line);
    z-index: 45;
  }
  .l10-panel__toggle { display: block; }
  .l10-panel.is-collapsed { max-height: none; }
  .l10-panel.is-collapsed .l10-panel__body { display: none; }
  body.has-l10-panel .content { padding-bottom: 88px; }
  .l10-clock { font-size: 32px; }
  .l10-clock--meet { font-size: 22px; }
}

body.l10-projector .sidebar,
body.l10-projector .nav-backdrop { display: none !important; }
body.l10-projector .topbar { height: 44px; }
body.l10-projector .topbar .page-title { font-size: 16px; }
body.l10-projector .l10-panel { width: 340px; }
body.l10-projector .l10-clock { font-size: 72px; }
body.l10-projector .l10-clock--meet { font-size: 40px; }
body.l10-projector .add-form,
body.l10-projector .btn.danger { display: none; }
body.l10-projector .content { padding-top: 16px; }

[data-theme="dark"] .l10-banner {
  background: rgba(0,150,57,.16);
  border-color: rgba(0,150,57,.35);
  color: #c2e7d0;
}
[data-theme="dark"] .l10-panel { background: #0f172a; border-left-color: #1e293b; }
[data-theme="dark"] .l10-panel__toggle { background: #0f172a; border-bottom-color: #1e293b; color: var(--text); }
[data-theme="dark"] .l10-panel__clock-block { background: #0b1220; border-color: #334155; }
[data-theme="dark"] .l10-rail__item { color: #cbd5e1; }
[data-theme="dark"] .l10-rail__item:hover { background: #1e293b; color: #fff; }
[data-theme="dark"] .l10-rail__item.is-current { background: rgba(0,150,57,.22); color: #8fd3a9; }
[data-theme="dark"] .l10-clock.is-over { background: rgba(220,38,38,.18); }

/* ---- Company pulse (Dashboard, company leadership only) ---- */
.pulse-card .card-sub { margin-bottom: 12px; }
table.pulse th, table.pulse td { white-space: nowrap; }
table.pulse th:not(:first-child), table.pulse td:not(:first-child) { text-align: center; }
table.pulse tbody tr:hover { background: var(--slate-50); }
[data-theme="dark"] table.pulse tbody tr:hover { background: #0b1220; }
table.pulse form { margin: 0; }
/* the Team cell is a form submit, but should read as a link */
.pulse-team {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--brand-700); text-align: left;
}
.pulse-team:hover { text-decoration: underline; }
[data-theme="dark"] .pulse-team { color: var(--brand-300); }
/* a meeting that ran long is worth noticing, not shouting about */
table.pulse .over { color: var(--amber); font-weight: 600; }

/* ---- Trademark / affiliation notice (login, setup) ---- */
.auth-foot .legal-note {
  margin: 0 auto;
  max-width: 42ch;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--greyloch-grey);
  text-wrap: pretty;
}

/* ---- Rocks: keep the Company and Individual tables on the same grid ----
   They are two separate <table> elements, so with the default auto layout each
   sizes its columns to its own content and the two headers drift apart (a long
   Rock title in one table shifts Owner/Due/Status right). Fixing the layout and
   pinning the trailing columns makes both tables share one grid.
   Only above the stacking breakpoint — below it the rows become cards. */
@media (min-width: 601px) {
  .rock-table { table-layout: fixed; width: 100%; }
  .rock-table th:nth-child(2), .rock-table td:nth-child(2) { width: 150px; }
  .rock-table th:nth-child(3), .rock-table td:nth-child(3) { width: 120px; }
  .rock-table th:nth-child(4), .rock-table td:nth-child(4) { width: 150px; }
  .rock-table th:nth-child(5), .rock-table td:nth-child(5) { width: 90px; }
  /* first column now has a computed width, so long titles must wrap */
  .rock-table td:first-child { overflow-wrap: anywhere; }
  /* the expanded edit row spans every column and keeps its natural layout */
  .rock-table td[colspan] { width: auto; }
}

/* ---- To-Dos page ---- */
.todo-table td { vertical-align: middle; }
.todo-table .todo-title { font-weight: 500; }
/* the dashboard leaves the title in normal text and reddens only the due
   date; a table row must also shed the list-item margins/radius */
.todo-table tr.is-overdue { margin: 0; padding-left: 0; padding-right: 0; border-radius: 0; }
.todo-table tr.is-overdue .todo-title { color: inherit; }
.todo-table tr.is-done .todo-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.todo-owner { max-width: 100%; font-size: 13px; }
/* brief green flash so an inline owner change is visibly saved */
.todo-owner.saved { border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-100); }
[data-theme="dark"] .todo-owner.saved { box-shadow: 0 0 0 3px rgba(0,150,57,.30); }
@media (min-width: 601px) {
  .todo-table { table-layout: fixed; width: 100%; }
  .todo-table th:nth-child(3), .todo-table td:nth-child(3) { width: 170px; }
  .todo-table th:nth-child(4), .todo-table td:nth-child(4) { width: 140px; }
  .todo-table td:nth-child(2) { overflow-wrap: anywhere; }
}

/* Scorecard range picker sits with the scroll arrows */
.sc-range { display: inline-flex; margin: 0 8px 0 0; }
.sc-range select { font-size: 13px; padding: 7px 10px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Scorecard: average column, resize grip, dark-mode status tints ---- */
.scorecard .sc-avg { font-variant-numeric: tabular-nums; padding-right: 10px; }
.scorecard .sc-avg-val { font-weight: 600; }
.scorecard thead .sc-avg { font-weight: 600; }
/* the average is a summary, not an entry — tint it more softly than a week cell */
.scorecard td.sc-avg.hit { background: color-mix(in srgb, var(--status-ok-bg) 55%, var(--card)); }
.scorecard td.sc-avg.miss { background: color-mix(in srgb, var(--status-bad-bg) 55%, var(--card)); }

/* Drag handle for the Measurable column */
.scorecard .sc-name { position: sticky; }
.col-grip {
  position: absolute; top: 0; right: 0; width: 9px; height: 100%;
  cursor: col-resize; user-select: none;
  border-right: 2px solid transparent;
}
.col-grip:hover, .col-grip.dragging { border-right-color: var(--brand-500); }
.scorecard.col-resizing { user-select: none; cursor: col-resize; }

/* Status now comes from --status-ok-bg / --status-bad-bg, the same tokens the
   dashboard's overdue rows use, so the tint is identical across all three
   screens. The figure stays in normal text — as on the dashboard, where the
   tint carries the status and the content stays plainly readable. */
[data-theme="dark"] .scorecard input.cell:focus { background: #0b1220; color: var(--text); }

/* ---- Scorecard: measurable title, description, edit side panel ---- */
.meas-title {
  background: none; border: none; padding: 0; font: inherit; font-weight: 600;
  color: var(--text); text-align: left; cursor: pointer;
}
.meas-title:hover { color: var(--brand-700); text-decoration: underline; }
[data-theme="dark"] .meas-title:hover { color: var(--brand-300); }
.meas-pencil {
  border: none; background: none; padding: 2px; margin-left: 4px; cursor: pointer;
  color: var(--slate-400); vertical-align: middle; opacity: 0; transition: opacity .12s;
}
.meas-pencil svg { width: 13px; height: 13px; display: block; }
tr:hover .meas-pencil, .meas-pencil:focus-visible { opacity: 1; }
.meas-pencil:hover { color: var(--brand-600); }
.meas-desc {
  display: block; font-size: 11.5px; line-height: 1.35; color: var(--muted);
  margin-top: 2px; overflow: hidden; text-overflow: ellipsis;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

.side-panel-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 90;
}
.side-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100vw);
  background: var(--card); border-left: 1px solid var(--line);
  z-index: 91; display: flex; flex-direction: column;
  box-shadow: -8px 0 24px rgba(15, 23, 42, .18);
}
.side-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line); flex: 0 0 auto;
}
.side-panel-head h2 { margin: 0; font-size: 16px; }
.side-panel-close {
  border: none; background: none; font-size: 24px; line-height: 1;
  color: var(--muted); cursor: pointer; padding: 0 4px;
}
.side-panel-close:hover { color: var(--text); }
.side-panel-body { flex: 1 1 auto; overflow-y: auto; padding: 18px 20px 28px; }
.side-panel-body h3 { font-size: 14px; margin: 0 0 4px; }
.side-panel-body textarea { width: 100%; resize: vertical; }
.spinoff-form .btn { margin-right: 6px; }
@media (max-width: 560px) {
  .side-panel { width: 100vw; border-left: none; }
  .meas-pencil { opacity: 1; }
}

/* ---- L10 attendance + per-person 1–10 rating ---- */
.l10-roster { margin: 4px 0 8px; }
.l10-roster-summary {
  display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center;
  margin-bottom: 8px; font-size: 14px;
}
.l10-roster-avg { display: inline-flex; align-items: center; gap: 8px; }
.l10-roster-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  gap: 8px 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.l10-roster-row.is-absent .l10-roster-who { color: var(--muted); }
.l10-roster-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.l10-roster-miss { font-size: 12px; }
.l10-attend { display: flex; gap: 6px; margin: 0; }
.l10-dropin-remove { margin: 0; }
.att-toggle {
  background: #fff; color: var(--slate-600); border: 1px solid var(--slate-300);
  padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  cursor: pointer;
}
.att-toggle:hover { background: var(--slate-100); color: var(--slate-900); }
.att-toggle.is-on { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-200); }
.att-toggle-out.is-on { background: var(--red-bg); color: var(--red); border-color: #fecaca; }
.l10-rate {
  grid-column: 1 / -1;
  display: flex; flex-wrap: wrap; gap: 4px;
  margin: 0;
}
.l10-rate.is-locked { opacity: .4; }
.rate-pad {
  min-width: 36px; height: 36px; padding: 0 8px;
  border-radius: 8px; border: 1px solid var(--slate-300);
  background: #fff; color: var(--slate-700);
  font-size: 13px; font-weight: 700; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.rate-pad:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand-700); }
.rate-pad.is-on {
  background: var(--brand-600); color: #fff; border-color: var(--brand-600);
}
.rate-pad:disabled { cursor: not-allowed; }
.l10-dropin { margin-top: 8px; }
.l10-rating-trend { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.l10-rating-trend__item {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  text-decoration: none; color: inherit; min-width: 52px;
}
.l10-rating-trend__item:hover { text-decoration: none; }
.l10-rating-trend__item:hover .muted { color: var(--brand-700); }

@media (max-width: 720px) {
  .l10-roster-row { grid-template-columns: 1fr auto; }
  .l10-dropin-remove { justify-self: end; }
}

[data-theme="dark"] .att-toggle { background: #0f172a; color: #cbd5e1; border-color: #334155; }
[data-theme="dark"] .att-toggle:hover { background: #1e293b; color: #fff; }
[data-theme="dark"] .att-toggle.is-on { background: rgba(0,150,57,.20); color: #8fd3a9; border-color: rgba(0,150,57,.45); }
[data-theme="dark"] .att-toggle-out.is-on { background: rgba(220,38,38,.18); color: #f87171; border-color: #7f1d1d; }
[data-theme="dark"] .rate-pad { background: #0f172a; color: #cbd5e1; border-color: #334155; }
[data-theme="dark"] .rate-pad:hover:not(:disabled) { border-color: var(--brand-500); color: #8fd3a9; }
[data-theme="dark"] .rate-pad.is-on { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

/* ---- Checkup: due dates and reminders ---- */
.due-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.due-form { display: inline-flex; gap: 8px; align-items: center; }
.due-form input[type="date"] { padding: 7px 10px; font-size: 13px; }
.due-soon { color: var(--amber); font-weight: 600; }
.due-over { color: var(--red); font-weight: 600; }
.remind-note { display: block; font-size: 11.5px; margin-top: 2px; }
/* the deadline as the respondent sees it, on the survey itself */
.survey-due {
  margin-top: 12px; padding: 9px 12px; border-radius: 9px;
  background: var(--status-ok-bg); font-size: 13px; line-height: 1.45;
}
.survey-due.is-soon { background: var(--status-bad-bg); }
