/* Google Review v2 — Citiwell design tokens (shared with Citiwell ID and Team), layout and components. */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/manrope-cyrillic-ext.woff2") format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/manrope-cyrillic.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/manrope-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("../fonts/manrope-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  color-scheme: light;
  --font: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bg: #f3f7fa;
  --bg-2: #e8f0f6;
  --surface: #ffffff;
  --surface-2: #f6f9fb;
  --surface-3: #edf3f7;
  --hover: #f0f5f9;
  --text: #0e1d2a;
  --muted: #536777;
  --faint: #8294a3;
  --border: #dfe7ee;
  --border-strong: #c8d6e1;
  --brand: #1d8fbd;
  --brand-strong: #13709f;
  --brand-soft: #e3f2f9;
  --brand-ink: #0f5f86;
  --coral: #ff6b70;
  --success: #17895c;
  --success-soft: #e2f5ec;
  --warn: #9a5f0e;
  --warn-soft: #fdf1df;
  --danger: #c23b36;
  --danger-soft: #fcebea;
  --star: #f2a516;
  --ring: rgba(29, 143, 189, 0.3);
  --shadow-1: 0 1px 2px rgba(14, 29, 42, 0.05), 0 10px 28px -18px rgba(14, 29, 42, 0.22);
  --shadow-pop: 0 18px 50px -14px rgba(14, 29, 42, 0.32);
  --shadow-lift: 0 1px 2px rgba(14, 29, 42, 0.06), 0 22px 44px -22px rgba(14, 29, 42, 0.35);
  --scrim: rgba(9, 20, 32, 0.34);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --sidebar: 244px;
  /* charts (validated: ordinal blue pair, status red for deletions) */
  --series-photo: #1d8fbd;
  --series-nophoto: #72b8d8;
  --series-deleted: #d03b3b;
  --series-muted: #b9c7d2;
  --grid: #e9eff4;
  --axis: #c5d2dc;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #07111e;
    --bg-2: #0a1728;
    --surface: #0e1b2c;
    --surface-2: #122236;
    --surface-3: #172a42;
    --hover: #13253a;
    --text: #e6eef5;
    --muted: #9db0c1;
    --faint: #6f8599;
    --border: #1f344c;
    --border-strong: #2c4764;
    --brand: #3aaad9;
    --brand-strong: #6cc3e8;
    --brand-soft: #0f2f45;
    --brand-ink: #9ad6ef;
    --success: #4cc996;
    --success-soft: #0f2e25;
    --warn: #f0b35a;
    --warn-soft: #33240f;
    --danger: #ff8a84;
    --danger-soft: #3a1618;
    --ring: rgba(58, 170, 217, 0.36);
    --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 40px -26px rgba(0, 0, 0, 0.75);
    --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.8);
    --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 26px 60px -28px rgba(0, 0, 0, 0.9);
    --scrim: rgba(0, 0, 0, 0.55);
    --series-photo: #3aaad9;
    --series-nophoto: #1f6a8e;
    --series-deleted: #ef6b6f;
    --series-muted: #34506b;
    --grid: #182c42;
    --axis: #2c4764;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #07111e;
  --bg-2: #0a1728;
  --surface: #0e1b2c;
  --surface-2: #122236;
  --surface-3: #172a42;
  --hover: #13253a;
  --text: #e6eef5;
  --muted: #9db0c1;
  --faint: #6f8599;
  --border: #1f344c;
  --border-strong: #2c4764;
  --brand: #3aaad9;
  --brand-strong: #6cc3e8;
  --brand-soft: #0f2f45;
  --brand-ink: #9ad6ef;
  --success: #4cc996;
  --success-soft: #0f2e25;
  --warn: #f0b35a;
  --warn-soft: #33240f;
  --danger: #ff8a84;
  --danger-soft: #3a1618;
  --ring: rgba(58, 170, 217, 0.36);
  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.03) inset, 0 18px 40px -26px rgba(0, 0, 0, 0.75);
  --shadow-pop: 0 24px 60px -18px rgba(0, 0, 0, 0.8);
  --shadow-lift: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 26px 60px -28px rgba(0, 0, 0, 0.9);
  --scrim: rgba(0, 0, 0, 0.55);
  --series-photo: #3aaad9;
  --series-nophoto: #1f6a8e;
  --series-deleted: #ef6b6f;
  --series-muted: #34506b;
  --grid: #182c42;
  --axis: #2c4764;
}

/* ---- base ------------------------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 500 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-strong); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -0.01em; }
p { margin: 0; }
svg { flex: none; }
[hidden] { display: none !important; }
.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; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--muted);
}
.boot-mark {
  display: block;
  width: 64px;
  height: 64px;
  border-radius: 18px;
  box-shadow: 0 14px 30px -12px rgba(21, 115, 168, 0.55);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(0.94); opacity: 0.75; } }
@media (prefers-reduced-motion: reduce) { .boot-mark { animation: none; } }

/* ---- app shell -------------------------------------------------------------------------------------- */

.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px 14px;
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px; color: var(--text); text-decoration: none !important; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, #27a3d6, #1573a8);
  color: #fff;
  box-shadow: 0 10px 22px -14px rgba(21, 115, 168, 0.9);
}
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name strong { font-size: 16px; font-weight: 800; }
.brand-name span { font-size: 12px; color: var(--muted); font-weight: 600; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { padding: 12px 10px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 11px;
  color: var(--muted);
  font-weight: 650;
  text-decoration: none;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-ink); }
.nav a .count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--coral);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}
.nav a .count.soft { background: var(--surface-3); color: var(--muted); }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.user-card .who { min-width: 0; line-height: 1.25; }
.user-card .who strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.user-card .who span { font-size: 12px; color: var(--muted); }
.sidebar-actions { display: flex; gap: 6px; }
.id-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--faint); padding: 0 6px; }
.id-badge img { width: 16px; height: 16px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 28px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar .titles { flex: 1 1 auto; min-width: 0; }
.topbar h1 { font-size: 21px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .subtitle { color: var(--muted); font-size: 13px; }
/* "← Обзор": back to the screen this one was opened from (or to its section after a shared link). */
.back-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  max-width: 240px;
  height: 38px;
  padding: 0 13px 0 9px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 13.5px;
  box-shadow: 0 1px 2px rgba(14, 29, 42, 0.05);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.back-button:hover { border-color: var(--brand); color: var(--brand-strong); }
.back-button svg { flex: none; }
.back-button .back-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content { width: 100%; max-width: 1360px; margin: 0 auto; padding: 8px 28px 48px; }
.tabbar { display: none; }
.btn.menu-button { display: none; }

@media (max-width: 1180px) {
  .app { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 16px 10px; align-items: center; }
  .sidebar .brand-name, .sidebar .nav-label, .sidebar .nav a span:not(.count), .sidebar .user-card .who, .sidebar .id-badge span { display: none; }
  .sidebar .nav a { justify-content: center; position: relative; padding: 10px; }
  .sidebar .nav a .count { position: absolute; top: 3px; right: 3px; min-width: 18px; padding: 0 5px; font-size: 10.5px; margin: 0; }
  .sidebar .user-card { padding: 6px; justify-content: center; }
  .sidebar .sidebar-actions { flex-direction: column; }
}

/* The phone menu: the sidebar sliding in from the left edge, where the menu button is. */
.side-menu {
  position: fixed;
  z-index: 71;
  top: 0;
  bottom: 0;
  left: 0;
  width: min(320px, 86vw);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: env(safe-area-inset-top) 0 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  overflow-y: auto;
  overscroll-behavior: contain;
  animation: slide-in-left 0.2s ease-out;
}
@keyframes slide-in-left { from { transform: translateX(-24px); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .side-menu { animation: none; } }
.side-menu-head { display: flex; align-items: center; gap: 8px; min-height: 60px; padding: 10px 10px 10px 12px; border-bottom: 1px solid var(--border); }
.side-menu-nav { padding: 6px 10px; }
.side-menu-nav a { min-height: 46px; padding: 10px 12px; font-size: 15px; }
.side-menu-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.side-menu-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .app { display: block; padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sidebar { display: none; }
  .topbar { padding: 8px 16px; min-height: 56px; flex-wrap: wrap; row-gap: 6px; }
  .topbar h1 { font-size: 18px; }
  .topbar .subtitle { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .period { order: 3; width: 100%; justify-content: space-between; }
  .back-button { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .back-button .back-label { display: none; }
  .topbar .period-current { flex: 1; }
  .card-head { flex-wrap: wrap; row-gap: 8px; }
  .card-head .hint { display: none; }
  .content { padding: 4px 16px 32px; }
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--border);
  }
  .tabbar a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
  }
  .tabbar a[aria-current="page"] { color: var(--brand-strong); background: var(--brand-soft); }
  .tabbar a .count { position: absolute; top: 2px; left: 55%; min-width: 17px; padding: 0 5px; border-radius: 999px; background: var(--coral); color: #fff; font-size: 10px; line-height: 17px; text-align: center; }
  .btn.menu-button { display: inline-flex; }
}

/* ---- primitives --------------------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px 0; }
.card-head h2, .card-head h3 { font-size: 15.5px; font-weight: 750; }
.card-head .hint { color: var(--muted); font-size: 12.5px; }
.card-body { padding: 14px 20px 18px; }
.section-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin: 26px 0 12px; }
.section-title h2 { font-size: 17px; font-weight: 800; }
.section-title .hint { color: var(--muted); font-size: 13px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 700;
  font-size: 13.5px;
  white-space: nowrap;
  text-decoration: none !important;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--hover); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 10px 22px -16px rgba(21, 115, 168, 0.9); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.soft { background: var(--brand-soft); border-color: transparent; color: var(--brand-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn.block { width: 100%; }
.btn .spinner { width: 14px; height: 14px; border-width: 2px; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.chip.brand { background: var(--brand-soft); color: var(--brand-ink); }
.chip.success { background: var(--success-soft); color: var(--success); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.danger { background: var(--danger-soft); color: var(--danger); }
.chip.outline { background: transparent; border: 1px solid var(--border-strong); }
.chip.master { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.chip.master.unassigned { color: var(--muted); border-style: dashed; }
.chip.clickable { cursor: pointer; }
.chip.clickable:hover { border-color: var(--brand); }

.badge-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

.stars { display: inline-flex; gap: 1px; color: var(--star); vertical-align: -2px; }
.stars .off { color: var(--border-strong); }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-ink);
  font-weight: 800;
  font-size: 14px;
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.sm { width: 30px; height: 30px; font-size: 12px; }
.avatar.lg { width: 52px; height: 52px; font-size: 18px; }

.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.input, .select, .textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.select { appearance: none; padding-right: 32px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .field-label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.search .input { padding-left: 36px; }

.segmented {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 13px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
/* Queues and other long choices wrap to a second line instead of hiding behind the right edge. */
.segmented.wrap { flex-wrap: wrap; overflow: visible; }
.segmented button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
}
.segmented button:hover { color: var(--text); }
.segmented button[aria-pressed="true"], .segmented button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(14, 29, 42, 0.1); }
.segmented .n { padding: 0 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); font-size: 11.5px; }
.segmented button[aria-pressed="true"] .n.hot, .segmented .n.hot { background: var(--coral); color: #fff; }

.toggle { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 650; }
.toggle input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--border-strong); position: relative; transition: background 0.15s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); }
.toggle input:checked { background: var(--brand); }
.toggle input:checked::after { transform: translateX(16px); }

.empty {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 44px 20px;
  text-align: center;
  color: var(--muted);
}
.empty .empty-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--success-soft); color: var(--success); }
.empty strong { color: var(--text); font-size: 15px; }

.notice {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.5px;
}
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, transparent); }
.notice.brand { background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 25%, transparent); }
.notice.success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 25%, transparent); }
.notice .notice-icon { margin-top: 1px; }
.notice.warn .notice-icon { color: var(--warn); }
.notice.danger .notice-icon { color: var(--danger); }
.notice.brand .notice-icon { color: var(--brand-strong); }
.notice.success .notice-icon { color: var(--success); }

.kbd { padding: 1px 6px; border-radius: 6px; border: 1px solid var(--border-strong); font-size: 11.5px; color: var(--muted); }

/* ---- tables ------------------------------------------------------------------------------------------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
  padding: 10px 12px;
  text-align: left;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table td.r, .table th.r { font-variant-numeric: tabular-nums; }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr.clickable:hover td { background: var(--hover); }
.table tfoot td { font-weight: 800; border-top: 1px solid var(--border-strong); border-bottom: 0; }
.table .sub { display: block; font-size: 12px; color: var(--muted); font-weight: 600; }
.table .cell-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.table .cell-bar .track { display: block; flex: 1; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.table .cell-bar .fill { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
/* Narrow screens keep the columns that answer the question (who, how many, how much); the rest steps aside
   instead of pushing the table sideways. show-sm repeats what a hidden column said, under the name. */
.table .show-sm { display: none; }
@media (max-width: 1100px) { .table .hide-md { display: none; } }
@media (max-width: 760px) {
  .table .hide-sm { display: none; }
  .table .show-sm { display: block; }
  .table th, .table td { padding: 10px 8px; }
  .table th:first-child, .table td:first-child { padding-left: 14px; }
  .table th:last-child, .table td:last-child { padding-right: 14px; }
  .table .cell-bar { min-width: 0; }
  .table .cell-bar .track { display: none; }
}

/* ---- KPI tiles ---------------------------------------------------------------------------------------- */

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { position: relative; padding: 16px 16px 14px; min-height: 132px; display: flex; flex-direction: column; gap: 4px; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.kpi .value { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.kpi .value small { font-size: 16px; font-weight: 700; color: var(--muted); margin-left: 2px; }
.kpi .meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.kpi .spark { margin-top: auto; }
.kpi.link { cursor: pointer; transition: border-color 0.15s; }
.kpi.link:hover { border-color: var(--brand); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 750; font-size: 12.5px; }
.delta.up { color: var(--success); }
.delta.down { color: var(--danger); }
.delta.flat { color: var(--muted); }
@media (max-width: 1360px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } .kpi { min-height: 116px; padding: 14px; } .kpi .value { font-size: 25px; } }

/* ---- page grids --------------------------------------------------------------------------------------- */

.grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.grid-2e { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2e.top { align-items: start; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .grid-2, .grid-2e, .grid-3 { grid-template-columns: minmax(0, 1fr); } }
.mt { margin-top: 16px; }
.mt-lg { margin-top: 24px; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 6px 0 16px; }
.toolbar .search { flex: 1 1 260px; max-width: 420px; }
.filters-toggle { display: none; }
.filters-toggle .count { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11.5px; line-height: 20px; }
.filters-panel { display: contents; }
@media (max-width: 760px) {
  .toolbar .search { flex: 1 1 160px; max-width: none; }
  .filters-toggle { display: inline-flex; }
  .filters-panel { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 8px; }
  .filters-panel.open { display: flex; }
  .filters-panel .select { width: 100% !important; min-width: 0 !important; }
  .filters-panel .spacer { display: none; }
  .filter-chips { display: none !important; }
  .filter-chips.open { display: flex !important; }
}

/* ---- period picker --------------------------------------------------------------------------------- */

.period { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 13px; background: var(--surface); border: 1px solid var(--border); position: relative; }
.period .btn { min-height: 32px; border: 0; }
.period-current { min-width: 150px; font-weight: 750; }
.popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  padding: 14px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
}
.month-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 12px; }
.month-grid button {
  position: relative;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  font-size: 13px;
}
.month-grid button:hover { border-color: var(--brand); }
.month-grid button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.month-grid button:disabled { opacity: 0.35; cursor: default; }
.month-grid button .mark { position: absolute; top: 5px; right: 6px; width: 6px; height: 6px; border-radius: 50%; }
.month-grid button .mark.open { background: var(--warn); }
.month-grid button .mark.closed { background: var(--success); }
.popover-foot { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--border); }
.legend-inline { display: flex; gap: 12px; font-size: 11.5px; color: var(--muted); margin-top: 8px; }
.legend-inline span { display: inline-flex; align-items: center; gap: 5px; }
@media (max-width: 760px) {
  .period-current { min-width: 0; }
  /* Drops down under the full-width period bar. Not position: fixed — the top bar's backdrop-filter would make
     the bar its containing block and push the popover off the screen. */
  .popover { left: 0; right: 0; width: auto; max-height: calc(100vh - 190px); overflow-y: auto; overscroll-behavior: contain; }
  .segmented.wrap { display: flex; }
  .segmented.wrap button { flex: 1 1 auto; justify-content: center; padding: 0 10px; }
  .segmented.wrap button svg { display: none; }
}

/* ---- charts --------------------------------------------------------------------------------------------- */

.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--faint); font-size: 11px; font-weight: 600; font-family: var(--font); }
.chart .tick.strong { fill: var(--muted); font-weight: 750; }
.chart .value-label { fill: var(--muted); font-size: 11px; font-weight: 700; font-family: var(--font); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:hover + g, .chart .band.active { opacity: 1; }
.chart .band { fill: var(--hover); opacity: 0; transition: opacity 0.1s; }
.chart .band.active { opacity: 1; }
.chart-tooltip {
  position: absolute;
  z-index: 10;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  font-size: 12.5px;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 10px));
}
.chart-tooltip .t-title { font-weight: 800; margin-bottom: 6px; }
.chart-tooltip .t-row { display: flex; align-items: center; gap: 8px; line-height: 1.7; }
.chart-tooltip .t-row .k { width: 12px; height: 3px; border-radius: 2px; }
.chart-tooltip .t-row .v { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }
.chart-tooltip .t-row .lbl { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--muted); font-weight: 650; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; }

.hbar { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 13px; min-height: 28px; }
.hbar .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; }
.hbar .track { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.hbar .fill { display: block; height: 100%; border-radius: 99px; background: var(--series-photo); }
.hbar .fill.neg { background: var(--series-deleted); }
.hbar .fill.muted { background: var(--series-muted); }
.hbar .v { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 28px; text-align: right; }

.stackbar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.stackbar span { height: 100%; }

.spark { display: block; }
.spark path.line { fill: none; stroke: var(--series-muted); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark path.area { fill: var(--brand); opacity: 0.08; }
.spark circle { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.spark rect { fill: var(--series-muted); }
.spark rect.last { fill: var(--brand); }

.meter { height: 8px; border-radius: 99px; background: var(--brand-soft); overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--brand); border-radius: 99px; }

/* ---- review cards & lists ------------------------------------------------------------------------------ */

.review-list { display: flex; flex-direction: column; }
.review-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}
.review-row:last-child { border-bottom: 0; }
.review-row:hover { background: var(--hover); }
.review-row[aria-current="true"] { background: var(--brand-soft); }
.review-row .text { margin-top: 6px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.review-row .text.translation { color: var(--muted); }
.review-row .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.review-row .meta:empty { display: none; }
.review-row.deleted .author, .review-row.deleted .text { opacity: 0.6; }
.notext { color: var(--faint); font-style: italic; }
.bonus-text { margin-left: auto; padding-left: 6px; font-size: 12.5px; font-weight: 750; color: var(--success); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bonus-text.neg { color: var(--danger); }

/* Review header everywhere: name, stars, date; underneath the salon and the language. */
.rhead { flex: 1; min-width: 0; }
.rhead-top { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rhead-top .author { font-weight: 800; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rhead-top .stars { flex: none; }
.rhead-top .date { flex: none; margin-left: auto; padding-left: 8px; color: var(--faint); font-size: 12.5px; white-space: nowrap; }
.rhead-sub { display: flex; flex-wrap: wrap; align-items: center; margin-top: 1px; color: var(--muted); font-size: 12.5px; font-weight: 600; }
.rhead-sub > span + span::before { content: "·"; margin: 0 6px; color: var(--faint); }
.rhead-sub .deleted { color: var(--danger); }
.rhead-sub .deleted svg { vertical-align: -2px; margin-right: 3px; }

/* Long texts fold; "ещё" unfolds them in place. */
.clamped { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp .more { border: 0; background: none; padding: 0; margin-top: 2px; color: var(--brand-strong); font: inherit; font-size: 12.5px; font-weight: 750; cursor: pointer; }
.clamp .more:hover { text-decoration: underline; }
mark.mention { background: color-mix(in srgb, var(--star) 28%, transparent); color: inherit; border-radius: 4px; padding: 0 2px; }

/* Task cards: one decision each. Header — who, where, when; left — what the client wrote; right — what is
   wrong or suggested and the buttons, the main one first. One column on narrow screens. */
.task { padding: 16px 20px 18px; }
.task + .task { border-top: 1px solid var(--border); }
.task-head { display: flex; align-items: flex-start; gap: 12px; }
.task-head > .btn { flex: none; margin: -3px -8px 0 0; }
.task-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); margin-top: 10px; padding-left: 50px; }
.task-review { min-width: 0; padding-right: 22px; }
.task-review .text { font-size: 14px; line-height: 1.55; }
.task-review .clamp + .clamp { margin-top: 6px; }
.task-review .text.translation { color: var(--muted); font-size: 13px; }
.task-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.task-work { min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-left: 22px; border-left: 1px solid var(--border); }
.work-label { margin-bottom: 5px; color: var(--faint); font-size: 11.5px; font-weight: 750; letter-spacing: 0.04em; text-transform: uppercase; }
.callout { display: flex; align-items: flex-start; gap: 8px; padding: 8px 11px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 650; line-height: 1.45; }
.callout svg { flex: none; margin-top: 2px; }
.callout.danger { background: var(--danger-soft); color: var(--danger); }
.callout.calm { background: var(--surface-2); color: var(--muted); }
.callout.ok { background: var(--success-soft); color: var(--success); }
.reply-box { padding: 9px 12px; border-radius: 10px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.reply-box.current { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.reply-box.proposed { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent); }
.reply-box .translation { color: var(--muted); font-size: 12.5px; }
.reply-box .clamp + .clamp { margin-top: 6px; padding-top: 6px; border-top: 1px dashed color-mix(in srgb, var(--brand) 25%, transparent); }
.whom { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 8px 14px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.whom .k { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font-size: 12px; font-weight: 700; }
.whom .k.ai { color: var(--brand-ink); }
.whom .v { display: flex; flex-wrap: wrap; gap: 6px; }
.findings { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.findings li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.45; }
.findings li svg { flex: none; margin-top: 2px; color: var(--brand-strong); }
.task-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 2px; }
@media (max-width: 1180px) {
  .task-body { grid-template-columns: minmax(0, 1fr); }
  .task-review { padding-right: 0; }
  .task-work { margin-top: 12px; padding: 12px 0 0; border-left: 0; border-top: 1px dashed var(--border); }
}
@media (max-width: 560px) {
  .task { padding: 14px 14px 16px; }
  .task-body { padding-left: 0; }
  .task-actions .btn { flex: 1 1 auto; }
}
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs a, .thumbs img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; display: block; background: var(--surface-3); }

/* ---- drawer (review detail) -------------------------------------------------------------------------- */

.scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); animation: fade 0.15s ease-out; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: fixed;
  z-index: 71;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(640px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
  animation: slide 0.2s ease-out;
}
@keyframes slide { from { transform: translateX(24px); opacity: 0.6; } }
@media (prefers-reduced-motion: reduce) { .drawer, .scrim { animation: none; } }
.drawer-head { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.drawer-head h2 { font-size: 15px; font-weight: 800; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; overscroll-behavior: contain; }
.detail-card { padding: 16px 18px; }
.detail-card h3 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; color: var(--faint); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.detail-card h3 .spacer { flex: 1; }
.review-text { font-size: 15px; line-height: 1.6; white-space: pre-wrap; }
.review-text.translation { color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); font-weight: 650; }
.kv dd { margin: 0; font-weight: 650; }
.check-list { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.check-list div { display: flex; gap: 8px; align-items: flex-start; }
.check-list .ok { color: var(--success); }
.check-list .warn { color: var(--warn); }
.check-list .error { color: var(--danger); }
.timeline { display: flex; flex-direction: column; gap: 0; font-size: 13px; }
.timeline div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--border); }
.timeline div:last-child { border-bottom: 0; }
.timeline time { color: var(--faint); font-size: 12px; }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 6px; max-height: 280px; overflow-y: auto; padding: 2px; }
.picker label { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer; font-weight: 650; font-size: 13px; }
.picker label:hover { border-color: var(--brand); }
.picker label.here { background: var(--surface-2); }
.picker input { accent-color: var(--brand); }
@media (max-width: 760px) { .drawer { width: 100vw; border-left: 0; } .drawer-body { padding: 12px; } }

/* ---- dialogs & toasts ----------------------------------------------------------------------------------- */

.dialog {
  position: fixed;
  z-index: 90;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 22px;
  border-radius: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-pop);
}
.dialog h2 { font-size: 18px; font-weight: 800; margin-bottom: 8px; }
.dialog .dialog-body { color: var(--muted); display: flex; flex-direction: column; gap: 12px; }
.dialog .dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.dialog-scrim { position: fixed; inset: 0; z-index: 89; background: var(--scrim); }
.quote { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); white-space: pre-wrap; font-size: 13.5px; }

.toasts { position: fixed; z-index: 100; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 24px)); pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-pop);
  font-weight: 650;
  font-size: 13.5px;
  pointer-events: auto;
  animation: rise 0.2s ease-out;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } }
@media (max-width: 760px) { .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* ---- sign in / no access: one card, as in Citiwell Team ------------------------------------------------ */

.welcome {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 16px calc(24px + env(safe-area-inset-bottom));
  background: radial-gradient(1200px 500px at 50% -180px, var(--bg-2), transparent 70%), var(--bg);
}
.welcome-card {
  position: relative;
  width: min(100%, 440px);
  padding: 32px 26px 26px;
  border-radius: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lift);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
}
.card-corner { position: absolute; top: 12px; right: 12px; display: flex; gap: 2px; }
.app-mark { display: block; width: 64px; height: 64px; border-radius: 18px; margin-bottom: 6px; box-shadow: 0 14px 30px -12px rgba(21, 115, 168, 0.55); }
.welcome-title { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -0.025em; }
.welcome-title.sm { font-size: 24px; line-height: 1.2; }
.welcome-lead { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.welcome-hint { margin: 0; color: var(--muted); font-size: 13.5px; }
.welcome-notice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
}
.welcome-card .citiwell-id-button { margin-top: 10px; }
.citiwell-id-button .mark { display: inline-flex; }
.citiwell-id-button.citiwell-id-button--lg { min-height: 56px; border-radius: 16px; font-size: 16.5px; gap: 12px; }
.citiwell-id-button.citiwell-id-button--lg svg { width: 28px; height: 28px; }
.citiwell-id-button:active { transform: scale(0.985); }
.welcome-actions { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.btn.lg { min-height: 50px; border-radius: 14px; font-size: 15px; }
.state-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--surface-3); color: var(--muted); }
.state-icon.warn { background: var(--warn-soft); color: var(--warn); }
/* Connecting an AI assistant (connect.html): what it will be able to do and how much access to give. */
.consent-card { gap: 12px; }
.consent-box { width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.consent-label { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.consent-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; font-size: 14px; line-height: 1.4; }
.consent-list li { display: flex; gap: 9px; align-items: flex-start; }
.consent-list .icon { flex: none; margin-top: 1px; color: var(--brand); }
.consent-access { width: 100%; margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.consent-access label { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 14px; border: 1px solid var(--border-strong); cursor: pointer; }
.consent-access label.on { border-color: var(--brand); background: var(--brand-soft); }
.consent-access input { margin: 3px 0 0; accent-color: var(--brand); }
.consent-access span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.consent-access small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.consent-warning { background: var(--warn-soft); color: var(--warn); }
.consent-error { margin: 0; color: var(--danger); font-weight: 600; font-size: 14px; }
.dev-panel {
  width: 100%;
  margin-top: 6px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px dashed color-mix(in srgb, var(--warn) 45%, transparent);
  background: var(--warn-soft);
  text-align: left;
  font-size: 13.5px;
}
.dev-panel summary { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 800; color: var(--warn); }
.dev-panel summary::-webkit-details-marker { display: none; }
.dev-panel p { margin: 8px 0; color: var(--muted); }
.dev-people { display: grid; gap: 2px; margin: 0 0 8px; padding: 0; list-style: none; }
.dev-people li { display: flex; align-items: center; gap: 8px; }
.dev-people code { font: 700 13px ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.dev-people span { flex: 1; color: var(--muted); font-size: 12.5px; }
.dev-panel a { font-weight: 700; }

/* ---- page specific ---------------------------------------------------------------------------------- */

.attention { display: flex; flex-direction: column; }
.attention a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  color: var(--text);
  text-decoration: none !important;
}
.attention a:hover { background: var(--hover); }
.attention .ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--surface-3); color: var(--muted); }
.attention .ico.hot { background: var(--danger-soft); color: var(--danger); }
.attention .ico.warn { background: var(--warn-soft); color: var(--warn); }
.attention .ico.brand { background: var(--brand-soft); color: var(--brand-strong); }
.attention .n { margin-left: auto; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.attention .n.zero { color: var(--faint); font-size: 15px; }
.attention small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }

.leader { display: flex; flex-direction: column; }
.leader a { display: grid; grid-template-columns: 22px auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 9px 20px; color: var(--text); text-decoration: none !important; border-top: 1px solid var(--border); }
.leader a:hover { background: var(--hover); }
.leader .rank { color: var(--faint); font-weight: 800; font-size: 12.5px; }
.leader .nm { font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader .nm small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.leader .v { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.leader .v small { display: block; color: var(--muted); font-weight: 650; font-size: 12px; }

/* Salons: a quiet card per salon (three numbers); the details live on the salon's own page. */
.salon-group + .salon-group { margin-top: 28px; }
.group-title { margin: 2px 2px 12px; font-size: 12px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); }
.salon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.salon-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px 22px 16px;
  color: var(--text);
  text-decoration: none !important;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.salon-card:hover { border-color: color-mix(in srgb, var(--brand) 55%, var(--border)); box-shadow: var(--shadow-lift); }
.salon-card-head { display: flex; align-items: flex-start; gap: 14px; }
.salon-name { display: block; font-size: 16.5px; font-weight: 800; letter-spacing: -0.01em; line-height: 1.3; }
.salon-place { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; font-weight: 600; }
.salon-google { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.salon-google .score { display: inline-flex; align-items: center; gap: 4px; font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.salon-google .score svg { color: var(--star); }
.salon-google .of { margin-top: 1px; color: var(--faint); font-size: 11.5px; font-weight: 650; white-space: nowrap; }
.salon-figures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.salon-figures strong { display: block; font-size: 25px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.salon-figures span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 650; }
.salon-card-foot { display: flex; align-items: center; gap: 12px; padding-top: 14px; border-top: 1px solid var(--border); font-size: 12.5px; }
.salon-card-foot .trend { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); font-weight: 650; }
.salon-card-foot .state { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font-weight: 750; white-space: nowrap; }
.salon-card-foot .state.ok { color: var(--success); }
.salon-card-foot .state.hot { color: var(--danger); }
.salon-card-foot .go { color: var(--faint); transition: color 0.15s, transform 0.15s; }
.salon-card:hover .go { color: var(--brand); transform: translateX(2px); }

.salon-hero { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 18px 22px; }
.salon-hero-google { display: flex; align-items: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 13.5px; font-weight: 600; }
.salon-hero-google svg { color: var(--star); }
.salon-hero-google strong { color: var(--text); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.review-list.compact .review-row { padding: 12px 20px; }
.review-list.compact .review-row .text { -webkit-line-clamp: 2; }

.master-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 20px; }
.master-head h2 { font-size: 22px; font-weight: 800; }

.bonus-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 20px; }
.bonus-banner .status { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; }
.bonus-banner .status.open { background: var(--warn-soft); color: var(--warn); }
.bonus-banner .status.closed { background: var(--success-soft); color: var(--success); }
.entries { font-size: 13px; }
.entries td { padding: 8px 12px; }
.amount-pos { color: var(--success); font-weight: 800; }
.amount-neg { color: var(--danger); font-weight: 800; }
.amount-zero { color: var(--faint); font-weight: 700; }

.checklist { display: flex; flex-direction: column; }
.checklist a, .checklist div.item { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-top: 1px solid var(--border); color: var(--text); text-decoration: none !important; }
.checklist a:hover { background: var(--hover); }
.checklist .n { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; }

.jobs .job { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; padding: 12px 20px; border-top: 1px solid var(--border); font-size: 13px; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; grid-column: 1 / -1; }
.progress span { display: block; height: 100%; background: var(--brand); transition: width 0.3s; }

.load-more { display: flex; justify-content: center; padding: 14px; }
.stale { opacity: 0.55; transition: opacity 0.15s; }
.skeleton { background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; border-radius: 12px; }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
