/* ---------- Design tokens ---------- */
:root {
  --bg: #EEF1F6;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --ink: #0F1B2D;
  --muted: #64748B;
  --faint: #94A3B8;
  --line: #E3E8F0;
  --accent: #2456E6;
  --accent-ink: #1A3FAE;
  --accent-soft: #EAF0FF;
  --green: #15A34A;
  --green-soft: #E7F6EC;
  --red: #DC2A38;
  --red-soft: #FCEBEC;
  --shadow-sm: 0 1px 2px rgba(15,27,45,.04), 0 1px 3px rgba(15,27,45,.06);
  --shadow-md: 0 2px 4px rgba(15,27,45,.04), 0 8px 24px rgba(15,27,45,.07);
  --radius: 12px;
  --radius-sm: 8px;
  --sans: system-ui, sans-serif;
  --mono: system-ui, sans-serif;
  --sidebar-w: 256px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: var(--ink); }

/* ---------- App shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---------- Sidebar / agenda ---------- */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand { display: flex; align-items: baseline; gap: 9px; padding: 4px 8px 18px; }
.topbar-mobile-brand { display: none; align-items: baseline; gap: 9px; }
.brand-mark {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .5px;
  color: #fff;
  background: var(--accent);
  padding: 4px 7px;
  border-radius: 6px;
}
.brand-name { font-weight: 700; font-size: 17px; letter-spacing: -.2px; }
.brand-ver { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.agenda-eyebrow {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--faint);
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  transition: background .12s ease, color .12s ease;
}
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.nav-step {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  width: 16px;
  flex: 0 0 16px;
  text-align: right;
}
.nav-item.active .nav-step { color: var(--accent); }
.nav-label { flex: 1 1 auto; }
.nav-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--faint);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 5px;
}
.nav-item.active .nav-time { background: #fff; color: var(--accent); }

.agenda-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 14px 8px 2px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
}
.agenda-foot b { color: var(--ink); }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 32px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; }
.topbar-favicon { height: 36px; width: 36px; object-fit: contain; flex: 0 0 36px; }
.topbar-title { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.topbar-sub { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: .3px; }
.footer-logo {
  position: fixed;
  bottom: 14px;
  right: 18px;
  z-index: 10;
  pointer-events: none;
}
.footer-logo img { height: 36px; width: auto; object-fit: contain; opacity: 1; }
.backup-btns { display: flex; align-items: center; gap: 6px; }
.backup-import-label { cursor: pointer; }
.backup-import-input { display: none; }
.date-pick { display: flex; align-items: center; gap: 10px; }
.date-pick label {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted);
}
.date-pick input[type="date"] {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}
.date-pick input[type="date"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

/* ---------- Content ---------- */
.content { padding: 28px 32px 56px; max-width: 1040px; width: 100%; }
.page-head { margin-bottom: 22px; }
.page-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}
.page-title { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin: 0; }
.page-desc { color: var(--muted); margin: 6px 0 0; font-size: 14.5px; }

/* ---------- Reusable components (per spec) ---------- */
.section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 26px 0 12px;
}
.section-header .count {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: 0;
  color: var(--faint);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 1px 9px;
  font-size: 11px;
}
.section-header::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 12px;
}

.form-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.form-row input[type="text"],
.form-row select,
.field {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14.5px;
}
.form-row input[type="text"] { flex: 1 1 220px; min-width: 0; }
.field:focus, .form-row input:focus, .form-row select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .12s ease;
}
.btn:hover { background: var(--accent-ink); }
.btn-ghost {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--faint); }

.icon-btn {
  border: none;
  background: transparent;
  color: var(--faint);
  font-size: 16px;
  line-height: 1;
  padding: 6px;
  border-radius: 6px;
}
.icon-btn:hover { background: var(--surface-2); color: var(--red); }

.meta-text {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--faint);
  letter-spacing: .2px;
}

/* ---------- Status pill / dropdown ---------- */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 20px;
  padding: 3px 11px 3px 9px;
  border: 1px solid transparent;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.status.on  { background: var(--green-soft); color: var(--green); }
.status.on::before  { background: var(--green); }
.status.off { background: var(--red-soft); color: var(--red); }
.status.off::before { background: var(--red); }

select.status-select {
  border-radius: 20px;
  border: 1px solid var(--line);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  background: var(--surface);
}
select.status-select.on  { color: var(--green); border-color: var(--green); background: var(--green-soft); }
select.status-select.off { color: var(--red); border-color: var(--red); background: var(--red-soft); }

/* ---------- Scorecard table ---------- */
.scorecard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.scorecard-table th {
  text-align: left;
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  padding: 13px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.scorecard-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.scorecard-table tr:last-child td { border-bottom: none; }
.scorecard-table .num { font-family: var(--mono); }
.scorecard-table input.cell {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 7px 8px;
}
.scorecard-table input.cell:hover { border-color: var(--line); }
.scorecard-table input.cell:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.scorecard-table input.num { font-family: var(--mono); }
.col-goal, .col-actual { width: 120px; }
.col-dir { width: 36px; text-align: center; }
.col-owner { width: 120px; }
.col-del { width: 44px; text-align: center; }
.sc-owner-select {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 13px;
  color: var(--ink);
  width: 100%;
  cursor: pointer;
}
.sc-owner-select:hover { border-color: var(--line); }
.sc-owner-select:focus { border-color: var(--accent); outline: none; background: var(--surface); }
.sc-dir-btn {
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 6px;
  width: 26px; height: 26px;
  font-size: 13px;
  color: var(--muted);
  display: grid; place-items: center;
  padding: 0;
  transition: border-color .12s, color .12s;
}
.sc-dir-btn:hover { border-color: var(--accent); color: var(--accent); }
.sc-on { background: var(--green-soft); }
.sc-off { background: var(--red-soft); }
.sc-on input.cell { color: var(--green); }
.sc-off input.cell { color: var(--red); }
.sc-history { margin-top: 8px; table-layout: auto; }
.sc-history th, .sc-history td { white-space: nowrap; }
.sc-hist-date { min-width: 90px; text-align: center; }
.sc-hist-goal { min-width: 70px; }
.sc-hist-cell { text-align: center; font-size: 13px; padding: 8px 10px; }
.sc-history .sc-on { color: var(--green); }
.sc-history .sc-off { color: var(--red); }

/* ---------- Rocks ---------- */
.owner-group { margin-bottom: 8px; }
.owner-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 18px 0 0;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  text-align: left;
  transition: background .12s ease, border-color .12s ease;
  box-shadow: var(--shadow-sm);
}
.owner-head:hover { background: var(--accent-soft); border-color: var(--accent); }
.owner-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.owner-head.collapsed { border-radius: var(--radius); }
.owner-chevron {
  color: var(--accent);
  font-size: 13px;
  transition: transform .15s ease;
  transform: rotate(90deg);
  width: 14px;
  flex: 0 0 14px;
  text-align: center;
}
.owner-head.collapsed .owner-chevron { transform: rotate(0deg); }
.owner-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 16px;
  flex: 0 0 40px;
}
.owner-name { font-weight: 700; font-size: 17px; }
.owner-meta { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.rock-card { display: grid; grid-template-columns: 1fr auto; gap: 14px; align-items: start; }
.rock-name { font-weight: 600; font-size: 15px; margin-bottom: 10px; }
.rock-card-wrap { padding: 0; overflow: hidden; }
.rock-card-top { display: flex; flex-direction: column; }
.rock-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 4px;
}
.rock-name-input {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  padding: 4px 6px;
  color: var(--ink);
}
.rock-name-input:hover { border-color: var(--line); }
.rock-name-input:focus { border-color: var(--accent); outline: none; background: var(--surface-2); }
.rock-card-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.rock-del-confirm { display: flex; align-items: center; gap: 6px; }
.rock-del-label { font-size: 12px; font-weight: 600; color: var(--red); white-space: nowrap; }
.rock-del-yes { color: var(--red); border-color: var(--red); font-size: 12px; padding: 4px 10px; }
.rock-del-yes:hover { background: var(--red-soft); }
.rock-del-no { font-size: 12px; padding: 4px 10px; }
.rock-type-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid var(--line);
  cursor: pointer;
  white-space: nowrap;
}
.rock-type-individual {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-color: transparent;
}
.rock-type-company {
  background: var(--green-soft);
  color: var(--green);
  border-color: transparent;
}
.rock-desc-input {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  font-size: 13px;
  color: var(--muted);
  padding: 0 16px 10px;
  border-bottom: 1px solid transparent;
  box-sizing: border-box;
}
.rock-desc-input:hover { border-bottom-color: var(--line); }
.rock-desc-input:focus { border-bottom-color: var(--accent); outline: none; color: var(--ink); }

/* Update feed */
.rock-feed {
  border-top: 1px solid var(--line);
  padding: 6px 16px;
}
.rock-update {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.rock-update:last-child { border-bottom: none; }
.rock-update-date {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  flex: 0 0 52px;
}
.rock-update-text { font-size: 14px; color: var(--ink); flex: 1; line-height: 1.4; }
.rock-update-del { opacity: 0; flex: 0 0 auto; }
.rock-update:hover .rock-update-del { opacity: 1; }

/* New entry row */
.rock-entry-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
}
.rock-update-input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 14px;
  background: var(--surface);
}
.rock-update-input:focus { border-color: var(--accent); outline: none; }
.rock-log-btn {
  flex: 0 0 32px;
  height: 32px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 18px;
  line-height: 32px;
  padding: 0;
  text-align: center;
}

/* ---------- List items (todos / issues / headlines) ---------- */
.row-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
  margin-bottom: 8px;
}
.row-item .body { flex: 1 1 auto; min-width: 0; }
.row-item .row-title { font-size: 14.5px; }
.row-item.done .row-title { text-decoration: line-through; color: var(--faint); }
.owner-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 5px;
  padding: 1px 7px;
  margin-right: 8px;
}
.check {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px;
  border: 1.5px solid var(--faint);
  border-radius: 6px;
  margin-top: 1px;
  flex: 0 0 20px;
  position: relative;
  cursor: pointer;
  transition: all .12s ease;
}
.check:checked { background: var(--green); border-color: var(--green); }
.check:checked::after {
  content: "";
  position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px;
  border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.row-actions { display: flex; align-items: center; gap: 4px; }

/* ---------- IDS enhancements ---------- */
.ids-active {
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}
.ids-drag-handle { font-size: 14px; color: var(--muted); cursor: grab; padding: 0 4px; opacity: 0.35; -webkit-user-select: none; user-select: none; line-height: 1; }
.ids-drag-handle:hover { opacity: 0.9; }
.ids-draggable.dragging { opacity: 0.4; }
.ids-draggable.ids-drag-over { outline: 2px solid var(--accent); outline-offset: -2px; background: var(--accent-soft); }
.ids-discuss { color: var(--accent); border-color: var(--accent-soft); }
.ids-discuss:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }
.ids-back { color: var(--muted); }
.ids-leave-open-todo {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.ids-leave-open-todo:hover { background: var(--accent-ink); }
.ids-resolve-todo {
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.ids-resolve-todo:hover { background: #0e8a3e; }
.ids-todo-edit {
  flex: 1;
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  background: var(--surface);
}
.todo-edit-row { display: flex; align-items: center; gap: 8px; }
.todo-edit-input {
  flex: 1;
  min-width: 160px;
  padding: 6px 10px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px;
  outline: none;
  background: var(--surface);
}

/* ---------- Todo summary by person ---------- */
.todo-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.todo-summary-group {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.todo-summary-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.todo-summary-head .owner-avatar { width: 34px; height: 34px; font-size: 14px; flex: 0 0 34px; }
.todo-summary-head .owner-name { font-size: 14px; }
.todo-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.todo-summary-item:last-child { border-bottom: none; }
.todo-summary-item.done { color: var(--faint); }
.todo-summary-item.done .todo-summary-task { text-decoration: line-through; }
.todo-summary-dot {
  flex: 0 0 8px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px;
}
.todo-summary-dot.done { background: var(--green); }

/* ---------- Headlines ---------- */
.hl-group { margin-bottom: 18px; }
.hl-group-label { margin-bottom: 6px; }
.hl-name {
  display: inline-block;
  font-weight: 700;
  font-size: 13px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border-radius: 20px;
  padding: 3px 12px;
}
.hl-name.employee { background: var(--green-soft); color: var(--green); }
.hl-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  margin-bottom: 5px;
}
.hl-row.employee { border-left-color: var(--green); }
.hl-row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.hl-row .what { color: var(--ink); font-size: 14.5px; line-height: 1.4; }
.hl-row .meta-text { font-size: 11px; }
.hl-edit-fields { flex: 1; display: flex; gap: 8px; align-items: center; min-width: 0; }
.hl-edit-fields .todo-edit-input { flex: 1; min-width: 80px; }
.hl-edit-fields .field { flex-shrink: 0; }

/* ---------- Conclude ---------- */
.rating-scale { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 4px; }
.rating-dot {
  width: 42px; height: 42px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  color: var(--muted);
  transition: all .12s ease;
}
.rating-dot:hover { border-color: var(--accent); color: var(--accent); }
.rating-dot.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.rating-dot.selected.high { background: var(--green); border-color: var(--green); }
.rating-dot.selected.low { background: var(--red); border-color: var(--red); }
.rating-dot.sm { width: 34px; height: 34px; font-size: 13px; border-radius: 8px; }

/* Per-member rating rows */
.rating-member-row {
  display: flex; align-items: center; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.rating-member-row:last-child { border-bottom: none; }
.rating-member { display: flex; align-items: center; gap: 10px; width: 150px; flex: 0 0 150px; }
.rating-member .owner-avatar { width: 28px; height: 28px; flex: 0 0 28px; font-size: 12px; }
.rating-member .nm { font-weight: 600; font-size: 15px; }
.rating-dots { display: flex; gap: 5px; flex-wrap: wrap; }

.meeting-avg { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; }
.meeting-avg .big { font-size: 30px; font-weight: 800; letter-spacing: -.5px; line-height: 1; }
.meeting-avg .big.hi { color: var(--green); }
.meeting-avg .big.lo { color: var(--red); }

/* Rating history table */
.rating-history .num { text-align: center; }
.rating-history tr.current td { background: var(--accent-soft); }
.rating-history .col-date { white-space: nowrap; font-weight: 600; }
.rate {
  display: inline-block; min-width: 30px; text-align: center;
  font-weight: 700; border-radius: 6px; padding: 3px 9px; font-size: 13px;
}
.rate.hi  { background: var(--green-soft); color: var(--green); }
.rate.mid { background: var(--surface-2); color: var(--ink); }
.rate.lo  { background: var(--red-soft); color: var(--red); }
.rate.none { color: var(--faint); background: transparent; font-weight: 400; }
.notes-area {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14.5px;
  line-height: 1.6;
  background: var(--surface);
}
.label {
  font-size: 12px; font-weight: 700; letter-spacing: .6px;
  text-transform: uppercase; color: var(--muted);
  display: block; margin: 0 0 8px;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  color: var(--muted);
  padding: 30px 20px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; font-size: 15px; }

.saved-flash {
  position: fixed;
  bottom: 22px; right: 22px;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: 50;
}
.saved-flash.show { opacity: 1; transform: translateY(0); }

/* ---------- Scorecard scroll wrappers ---------- */
.sc-table-scroll { overflow-x: auto; }
.sc-history-scroll { overflow-x: auto; }

/* ---------- Mobile nav (hidden on desktop) ---------- */
.mobile-nav { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  /* Hide desktop sidebar — replaced by bottom nav */
  .sidebar { display: none; }
  .footer-logo { display: none; }
  .backup-btns { display: none; }

  /* Full width layout */
  .app { grid-template-columns: 1fr; }

  /* Compact topbar */
  .topbar { padding: 0 14px; height: 52px; flex-wrap: nowrap; }
  .topbar-sub { display: none; }
  .topbar-favicon { height: 28px; width: 28px; flex: 0 0 28px; }
  .topbar-mobile-brand { display: flex; }
  .date-pick label { display: none; }
  .date-pick input[type="date"] { padding: 6px 8px; font-size: 13px; }

  /* Content — extra bottom padding clears the nav + safe area */
  .content { padding: 20px 16px calc(64px + env(safe-area-inset-bottom, 0px)); }
  .page-title { font-size: 22px; }

  /* Touch-friendly elements */
  .btn, .btn-ghost { min-height: 44px; }
  .check { width: 24px; height: 24px; flex: 0 0 24px; }
  .icon-btn { padding: 10px; }

  /* Form rows stack vertically */
  .form-row { flex-direction: column; }
  .form-row input[type="text"] { flex: 1 1 auto; }

  /* Rocks */
  .rock-card { grid-template-columns: 1fr; }
  .rating-dot.sm { width: 40px; height: 40px; font-size: 14px; border-radius: 10px; }
  .rating-member { width: 120px; flex: 0 0 120px; }

  /* Scorecard main table — fixed layout so columns don't overflow */
  .sc-table-scroll .scorecard-table { width: 100%; table-layout: fixed; }
  .scorecard-table { font-size: 13px; }
  .col-dir { display: none; }
  .col-del { display: none; }
  .sc-table-scroll .col-goal,
  .sc-table-scroll .col-actual { width: 68px; }
  .sc-table-scroll .col-owner { width: 72px; }


  /* Metric cell: truncate, tap to expand */
  .sc-metric-cell { cursor: pointer; overflow: hidden; }
  .sc-metric-cell .sc-metric-text {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sc-metric-cell.expanded .sc-metric-text {
    white-space: normal;
    overflow: visible;
    background: var(--accent-soft);
    border-radius: 4px;
    padding: 2px 4px;
  }
  .sc-owner-text { font-size: 12px; color: var(--muted); }

  /* Scroll hint for history table */
  .sc-scroll-hint {
    font-size: 12px;
    color: var(--muted);
    text-align: right;
    padding: 2px 2px 6px;
    animation: hint-pulse 2s ease-in-out infinite;
  }
  @keyframes hint-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
  }

  /* Conclude — stack member name above dots, smaller dots */
  .rating-member-row { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 0; }
  .rating-member { width: 100%; flex: 1 1 auto; }
  .rating-dots { gap: 3px; }
  .rating-dot.sm { width: 32px; height: 32px; font-size: 12px; border-radius: 7px; }

  /* Bottom nav — sits above home indicator on real devices */
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 8px rgba(15,27,45,.06);
    z-index: 10;
    overflow-x: auto;
  }
  .mobile-nav-item {
    flex: 1 1 0;
    min-width: 72px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: none;
    border-top: 2px solid transparent;
    white-space: nowrap;
    padding: 0 10px;
    cursor: pointer;
  }
  .mobile-nav-item.active {
    color: var(--accent);
    border-top-color: var(--accent);
    background: var(--accent-soft);
  }
}

@media (max-width: 480px) {
  .content { padding: 14px 12px calc(64px + env(safe-area-inset-bottom, 0px)); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
