:root {
  --brand: #5144e8;
  --brand-strong: #4534c6;
  --brand-soft: #eeecff;
  --on-brand: #fff;
  --bg: #f6f6fb;
  --surface: #fff;
  --text: #17172b;
  --muted: #5f6178;
  --line: #e3e3ee;
  --danger: #c62828;
  --danger-soft: #fdecec;
  --ok: #1b7f4b;
  --ok-soft: #e6f5ec;
  --warn: #8a5200;
  --warn-soft: #fff4e0;
  --radius: 14px;
  --tabbar: 64px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --brand: #8379ff;
    --brand-strong: #a8a1ff;
    --brand-soft: #25224a;
    --bg: #0f0f1a;
    --surface: #1a1a2b;
    --text: #ececf6;
    --muted: #a3a4bd;
    --line: #2d2d44;
    --danger: #ff8a80;
    --danger-soft: #3a1d22;
    --ok: #6fd49c;
    --ok-soft: #173326;
    --warn: #f3b55a;
    --warn-soft: #3a2c12;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px);
  -webkit-tap-highlight-color: transparent;
}
body.bare { padding-bottom: 0; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.25; }

/* ---------- frame ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: env(safe-area-inset-top) 12px 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  flex: 1;
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.logo-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: 800;
  font-size: 16px;
}
.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  border-radius: 50%;
  color: var(--text);
}
.icon-btn:active { background: var(--line); }

.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 16px;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  font-size: 11.5px;
  color: var(--muted);
  text-decoration: none;
}
.tabbar a[aria-current="page"] { color: var(--brand); font-weight: 650; }
.tabbar .bubble {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-top: -18px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--on-brand);
  box-shadow: 0 4px 14px rgb(81 68 232 / 0.35);
}

.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon.big { width: 40px; height: 40px; color: var(--brand); stroke-width: 1.5; }
.icon.chevron { width: 18px; height: 18px; color: var(--muted); }

/* ---------- content ---------- */

.eyebrow {
  margin: 0 0 4px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  text-transform: uppercase;
}
.muted, .meta { color: var(--muted); }
.meta { display: block; font-size: 13.5px; }
.hint { display: block; font-size: 13px; color: var(--muted); }
.footnote { text-align: center; font-size: 12.5px; color: var(--muted); }
.grow { flex: 1; min-width: 0; }
.grow strong { display: block; overflow-wrap: anywhere; }

.hello h2 { margin: 0 0 16px; font-size: 24px; }

.section { margin-top: 24px; }
.section-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.card {
  margin: 0 0 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card-title { margin: 0 0 8px; font-size: 20px; }
.description { white-space: pre-line; overflow-wrap: anywhere; }
.event-line { display: flex; align-items: center; gap: 8px; margin: 8px 0; }

.list {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.list + .card { margin-top: 16px; }
.list li + li { border-top: 1px solid var(--line); }
.list a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 14px;
  color: inherit;
  text-decoration: none;
}
.list a:active { background: var(--brand-soft); }
.list-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  flex: none;
}

.event-card, .alert {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  padding: 12px 14px;
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}
.event-card { background: var(--surface); border: 1px solid var(--line); }
.alert { background: var(--warn-soft); color: var(--warn); }
.alert strong { color: var(--text); }
.date-tile {
  display: grid;
  place-items: center;
  width: 52px;
  height: 56px;
  border-radius: 12px;
  background: var(--brand);
  color: var(--on-brand);
  line-height: 1.1;
  flex: none;
}
.date-tile strong { font-size: 20px; }
.date-tile span { font-size: 12px; text-transform: uppercase; }

.empty {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}
.empty p { margin: 0; }
.empty-large { flex-direction: column; text-align: center; padding: 40px 20px; margin-top: 24px; }

.timeline { margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); list-style: none; }
.timeline li { padding: 4px 0 10px; }

.toolbar { margin: 0 0 8px; text-align: right; font-size: 14px; }

.notice {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--ok-soft);
  color: var(--ok);
  font-weight: 550;
}
.notice-error { background: var(--danger-soft); color: var(--danger); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }

.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: var(--brand-soft);
  color: var(--brand-strong);
  white-space: nowrap;
}
.badge.role-admin { background: var(--brand); color: var(--on-brand); }
.badge.status-pending { background: var(--warn-soft); color: var(--warn); }
.badge.status-disabled { background: var(--danger-soft); color: var(--danger); }

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 700;
  font-size: 15px;
  flex: none;
}
.avatar-large { width: 56px; height: 56px; font-size: 20px; }
.profile { display: flex; align-items: center; gap: 14px; }
.profile .badge { margin-top: 6px; }

/* ---------- forms and buttons ---------- */

.form { display: grid; gap: 14px; }
/* Grid children may shrink below their content, so wide tables scroll inside instead of widening the page. */
.form > * { min-width: 0; }
.field { display: grid; gap: 5px; align-content: start; }
.field .label { font-size: 14px; font-weight: 600; }
input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.has-error input, .has-error select, .has-error textarea { border-color: var(--danger); }
.error { color: var(--danger); font-size: 13px; font-weight: 550; }

.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  font: inherit;
  font-weight: 650;
  color: var(--on-brand);
  background: var(--brand);
  border: 1px solid var(--brand);
  border-radius: 12px;
  text-decoration: none;
  cursor: pointer;
}
.btn:active { background: var(--brand-strong); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn-small .icon { width: 18px; height: 18px; }
.btn-secondary { color: var(--brand); background: var(--brand-soft); border-color: var(--brand-soft); }
.btn-link { color: var(--brand); background: none; border-color: transparent; }
.btn-danger-outline { width: 100%; color: var(--danger); background: var(--surface); border-color: var(--line); }
.btn-google {
  width: 100%;
  color: #1f1f1f;
  background: #fff;
  border-color: #dadce0;
}
.google-g { width: 20px; height: 20px; }

details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  list-style: none;
  font-weight: 650;
}
details > summary::-webkit-details-marker { display: none; }
details[open] > summary { margin-bottom: 14px; }

.member {
  margin-bottom: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.member summary { font-weight: 400; }
.install-help p { margin: 10px 0 0; }
.signout { margin-top: 24px; }

/* ---------- sign-in and other bare pages ---------- */

.center-card {
  max-width: 400px;
  margin: 8vh auto 24px;
  padding: 28px 22px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
}
.center-card h1 { margin: 12px 0 4px; font-size: 26px; }
.center-card .btn { width: 100%; margin-top: 12px; }
.center-card .notice { margin-top: 16px; text-align: left; }
.app-icon { border-radius: 18px; }
.dev-login { margin-top: 24px; padding-top: 20px; border-top: 1px dashed var(--line); text-align: left; }

/* ---------- week 2: tasks, timer, board ---------- */

:root {
  --urgent: #d32f2f;
  --high: #e07a00;
  --low: #8a8ca3;
  --help: #b4235a;
  --help-soft: #fde8f0;
}
@media (prefers-color-scheme: dark) {
  :root { --urgent: #ff7b72; --high: #ffb35c; --low: #7d7f96; --help: #ff8fbc; --help-soft: #3d1a2a; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.icon.tiny { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.overdue, .overdue-title { color: var(--urgent) !important; }
.help-title { color: var(--help); }
.danger { color: var(--danger); }

.stats { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -8px 0 16px; color: var(--muted); font-size: 14px; }
.stats strong { color: var(--text); }

.quick-add {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
}
.quick-add .btn { width: 52px; padding: 0; }
.qa-preview { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; min-height: 0; }
.qa-preview:empty { display: none; }
.chip {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 13px;
  font-weight: 600;
}

.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.section-head .section-title { flex: 1; margin: 0; }
.fold > summary { margin-bottom: 8px; }

/* task rows */
.tasks {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.task-row { position: relative; overflow: hidden; }
.task-row + .task-row { border-top: 1px solid var(--line); }
.task-row-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px 12px 10px;
  background: var(--surface);
  transition: transform 0.2s ease;
}
.swipe-hint {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  font-weight: 700;
  color: #fff;
}
.swipe-done { background: var(--ok); }
.swipe-later { background: var(--brand); justify-content: flex-end; }
.swiping-right .swipe-done, .swiping-left .swipe-later { display: flex; }
.swipe-ready .swipe-hint { filter: brightness(1.1); }

.check {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-top: 1px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--muted);
  background: transparent;
  color: transparent;
  cursor: pointer;
  flex: none;
}
.check .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.check.prio-urgent { border-color: var(--urgent); background: color-mix(in srgb, var(--urgent) 10%, transparent); }
.check.prio-high { border-color: var(--high); background: color-mix(in srgb, var(--high) 10%, transparent); }
.check.prio-low { border-color: var(--low); }
.check:hover { color: var(--muted); }
.is-done .check { background: var(--ok); border-color: var(--ok); color: #fff; }

.task-link { flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.task-title { display: block; font-weight: 600; overflow-wrap: anywhere; }
.is-done .task-title, .is-done-title { color: var(--muted); text-decoration: line-through; }
.task-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 12px;
  margin-top: 3px;
  font-size: 13px;
  color: var(--muted);
}
.due.overdue { font-weight: 650; }

.badge.prio-urgent { background: var(--urgent); color: #fff; }
.badge.prio-high { background: color-mix(in srgb, var(--high) 18%, transparent); color: var(--high); }
.badge.help { background: var(--help-soft); color: var(--help); }
.badge.status-in_progress { background: var(--brand-soft); color: var(--brand-strong); }
.badge.status-waiting { background: var(--warn-soft); color: var(--warn); }

/* filters and views */
.filters { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 12px; padding: 0 16px 4px; scrollbar-width: none; }
.filters select { width: auto; min-height: 38px; padding: 6px 30px 6px 12px; border-radius: 999px; font-size: 14px; flex: none; }
.segmented { display: flex; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 2px; }
.segmented a { display: grid; place-items: center; width: 38px; height: 32px; border-radius: 8px; color: var(--muted); }
.segmented a[aria-current="page"] { background: var(--surface); color: var(--brand); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }

/* board */
.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 82%);
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 -16px;
  padding: 0 16px 8px;
}
.board-column {
  scroll-snap-align: start;
  padding: 10px;
  background: color-mix(in srgb, var(--line) 45%, transparent);
  border-radius: var(--radius);
  align-self: start;
}
.board-title { display: flex; align-items: center; gap: 8px; margin: 2px 4px 10px; font-size: 15px; }
.board-title .count { padding: 0 8px; border-radius: 999px; background: var(--surface); font-size: 12.5px; color: var(--muted); }
.board-empty { margin: 4px; font-size: 14px; }
.board-card {
  margin-bottom: 8px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 12px;
}
.board-card.prio-urgent { border-left-color: var(--urgent); }
.board-card.prio-high { border-left-color: var(--high); }
.board-card .task-title { color: inherit; text-decoration: none; }
.board-move { display: flex; justify-content: space-between; gap: 8px; margin-top: 10px; }
.board-move .btn { font-size: 12.5px; padding: 0 10px; }
.board-move .icon { width: 16px; height: 16px; }

/* task page */
.task-card { border-top: 4px solid var(--line); }
.task-card.prio-urgent { border-top-color: var(--urgent); }
.task-card.prio-high { border-top-color: var(--high); }
.task-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.task-badges:empty { display: none; }
.status-switch {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 3px;
  margin: 4px 0 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.status-switch button {
  min-height: 38px;
  padding: 0 4px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}
.status-switch button[aria-pressed="true"] { background: var(--brand); color: var(--on-brand); }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; }
.facts dt { font-size: 12.5px; color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.timer-panel { display: grid; gap: 10px; margin-bottom: 12px; }
.timer-panel .card { margin: 0; }
.btn-wide { width: 100%; }
.btn-stop { background: var(--urgent); border-color: var(--urgent); color: #fff; }
.btn-help { width: 100%; color: var(--help); background: var(--help-soft); border-color: var(--help-soft); }
.btn-help.is-on { background: var(--help); border-color: var(--help); color: #fff; }
.help-toggle { margin-bottom: 8px; }

.checklist { margin: 0 0 10px; padding: 0; list-style: none; }
.checklist li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.checklist .box {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid var(--muted);
  border-radius: 7px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.checklist .box .icon { width: 16px; height: 16px; stroke-width: 2.6; }
.checklist .is-done .box { background: var(--ok); border-color: var(--ok); }
.checklist .is-done .grow { color: var(--muted); text-decoration: line-through; }
.icon-btn.small { width: 32px; height: 32px; margin: 0; color: var(--muted); background: none; border: 0; cursor: pointer; }
.icon-btn.small .icon { width: 18px; height: 18px; }
.inline-add { display: flex; gap: 8px; }
.inline-add input { min-height: 40px; }

.updates { margin: 0 0 12px; padding: 0; list-style: none; }
.updates .change { padding: 4px 0 4px 12px; border-left: 2px solid var(--line); font-size: 13.5px; color: var(--muted); }
.updates .change strong { color: var(--text); font-weight: 600; }
.updates .comment { margin: 8px 0; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.comment-head { display: flex; align-items: baseline; gap: 8px; margin: 0 0 2px; }
.comment-head .meta { display: inline; font-size: 12.5px; }
.comment-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; }
.meta-inline { font-size: 12.5px; }

.list.compact li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.list.compact a { display: inline; min-height: 0; padding: 0; color: inherit; }
.amount { font-weight: 700; white-space: nowrap; }
.page-actions { justify-content: space-between; margin-top: 24px; }

.choice-list { display: grid; gap: 8px; margin: 14px 0; }
.pick-date { padding-top: 14px; border-top: 1px solid var(--line); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-row.three { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.field-row > * { min-width: 0; }

.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.stat { padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.stat strong { display: block; font-size: 24px; }

/* running timer bar under the top bar */
.timer-bar {
  position: sticky;
  top: 56px;
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 16px;
  background: var(--brand);
  color: var(--on-brand);
}
.timer-bar a { color: inherit; text-decoration: none; overflow: hidden; }
.timer-bar strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer-bar .clock { font-variant-numeric: tabular-nums; font-weight: 700; }
.timer-bar .btn-stop { min-height: 32px; background: #fff; color: var(--urgent); border-color: #fff; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #ff6b6b; flex: none; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; } .task-row-inner { transition: none; } }

@media (min-width: 720px) {
  .board { grid-auto-columns: minmax(240px, 1fr); }
}

/* ---------- week 3: leads ---------- */

:root { --wa: #1fa855; --hot: #d84315; --warm: #c98a00; --cold: #5b7fa6; }
@media (prefers-color-scheme: dark) { :root { --wa: #3fd27a; --hot: #ff8a65; --warm: #f2c14e; --cold: #8fb3db; } }

.pills { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 10px; padding: 0 16px 2px; scrollbar-width: none; }
.pills a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.pills a[aria-current="page"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.pills .count { font-size: 12px; opacity: 0.85; }
.filters .search { min-width: 200px; min-height: 38px; padding: 6px 14px; border-radius: 999px; font-size: 14px; flex: 1 0 200px; }

.lead-row { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; }
.lead-row + .lead-row { border-top: 1px solid var(--line); }
.lead-phone { display: block; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lead-phone.big { font-size: 20px; font-weight: 650; color: var(--text); margin: 0 0 10px; }
.contact-buttons { display: flex; gap: 8px; flex: none; }
.round-btn {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
}
.round-btn .icon { width: 20px; height: 20px; }
.round-btn.call { background: var(--brand); }
.round-btn.wa, .btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.contact-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.contact-row .btn { flex: 1 1 auto; }

.badge.pot-hot { background: color-mix(in srgb, var(--hot) 16%, transparent); color: var(--hot); }
.badge.pot-warm { background: color-mix(in srgb, var(--warm) 18%, transparent); color: var(--warm); }
.badge.pot-cold { background: color-mix(in srgb, var(--cold) 18%, transparent); color: var(--cold); }
.badge.stage-review { background: var(--warn-soft); color: var(--warn); }
.badge.stage-won { background: var(--ok-soft); color: var(--ok); }
.badge.stage-lost { background: var(--line); color: var(--muted); }

.followups { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 0; padding: 0; list-style: none; }
.followups li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 8px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  font-size: 13px;
  min-width: 0;
}
.followups li.done { border-style: solid; background: var(--surface); }
.followups .slot-name { font-size: 11.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.02em; }
.followups strong { overflow-wrap: anywhere; }
.followups .meta { font-size: 12px; }
@media (max-width: 380px) { .followups { grid-template-columns: repeat(2, 1fr); } }

.card-title.small { font-size: 17px; }
.status-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; }
.status-chips legend { margin-bottom: 8px; }
.chip-choice input { position: absolute; opacity: 0; pointer-events: none; }
.chip-choice span {
  display: inline-block;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.chip-choice input:checked + span { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.chip-choice input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip-choice.status-interested input:checked + span, .chip-choice.status-paid input:checked + span { background: var(--ok); border-color: var(--ok); }
.chip-choice.status-not_interested input:checked + span, .chip-choice.status-wrong_number input:checked + span { background: var(--muted); border-color: var(--muted); }
.status-chips.has-error .chip-choice span { border-color: var(--danger); }

/* import */
.steps { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.stat-grid.three { grid-template-columns: repeat(3, 1fr); }
.stat-grid.three .stat strong { font-size: 20px; }
@media (max-width: 420px) { .stat-grid.three { grid-template-columns: repeat(2, 1fr); } }
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 14px; }
.map-grid .label small { font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .map-grid { grid-template-columns: 1fr; } }
.map-row { display: grid; grid-template-columns: 1fr minmax(150px, 48%); align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.map-row span { overflow-wrap: anywhere; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.preview-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.preview-table th, .preview-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.preview-table th { font-size: 12px; color: var(--muted); text-transform: uppercase; }
.problems { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; max-height: 360px; overflow-y: auto; }
.sticky-actions {
  position: sticky;
  bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 8px);
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgb(0 0 0 / 0.08);
}
.sticky-actions .btn { flex: 1; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- week 4: reports and dashboards ---------- */

.period-nav {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  text-align: center;
}
.period-nav .icon-btn { margin: 0; background: var(--surface); border: 1px solid var(--line); }
.period-nav strong { font-size: 17px; }
.stat-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .stat-grid.four { grid-template-columns: repeat(2, 1fr); } }
.stat strong { font-variant-numeric: tabular-nums; }
.stat.kpi strong { font-size: 22px; }
.stat .of { font-size: 15px; color: var(--muted); font-weight: 600; }
.delta { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 650; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); font-weight: 500; }
.stat meter, .bars meter { width: 100%; height: 10px; margin-top: 8px; }

.preview-table td .meta { display: block; font-size: 12px; white-space: normal; }
.tracker td:first-child { white-space: normal; min-width: 160px; }
.tracker a { color: inherit; font-weight: 600; }
.people-table th[scope="row"] {
  position: sticky;
  left: 0;
  background: var(--surface);
  text-transform: none;
  font-size: 13.5px;
  color: var(--text);
  z-index: 1;
}
.mom-table th[scope="row"] { text-transform: none; font-size: 13.5px; }
.mom-table th[scope="row"] a { color: inherit; }
.mom-table .delta { display: inline; }

.person-report summary { align-items: flex-start; }
.person-report .meta { font-weight: 400; }
.challenge {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-left: 3px solid var(--warn);
  background: var(--warn-soft);
  border-radius: 0 10px 10px 0;
  white-space: pre-line;
}
.calls-list { margin-top: 10px; }
.label { font-size: 14px; font-weight: 600; margin: 0 0 4px; }

.bars { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 14px; }
.bars meter { margin: 0; }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ranking { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.ranking .meta { font-size: 13px; }

.chart-card { padding: 10px; }
.chart { display: block; width: 100%; max-width: 560px; height: auto; margin: 0 auto; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 13px; }
.chart .series { fill: none; stroke: var(--brand); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--surface); stroke: var(--brand); stroke-width: 2; }
.chart .dot.current { fill: var(--brand); }
.chart .value { fill: var(--text); font-size: 14px; font-weight: 700; }

.check-line { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-size: 15px; }
.check-line input { width: 20px; height: 20px; min-height: 0; margin-top: 2px; accent-color: var(--brand); flex: none; }
.sheet-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--ok-soft);
  color: var(--ok);
  font-size: 14px;
}
.sheet-status p { flex: 1; margin: 0; overflow-wrap: anywhere; }
.sheet-status.warn { background: var(--warn-soft); color: var(--warn); }
.sheet-status.error { background: var(--danger-soft); color: var(--danger); }

@media (min-width: 720px) {
  .page { padding: 24px 16px; }
  .tabbar { left: 50%; right: auto; width: 680px; transform: translateX(-50%); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; }
}
