/* ==========================================================================
   Кабинет отзывов — дизайн-система
   Светлая и тёмная темы, адаптивная вёрстка, мобильное меню.
   Все прежние классы сохранены, добавлены новые компоненты.
   ========================================================================== */

:root {
  --bg: #f7f4ee;
  --panel: #ffffff;
  --panel-2: #faf8f4;
  --ink: #1b1a15;
  --ink-2: #3c3a33;
  --muted: #6f6c61;
  --line: #ebe6da;
  --line-strong: #d8d1c0;
  --soft: #efece4;
  --clay: #c9633c;
  --clay-dark: #a44c2c;
  --clay-soft: #fbece4;
  --clay-ring: rgba(201, 99, 60, .28);
  --green: #2a7a4f;
  --green-bg: #e3f1e8;
  --red: #b3372b;
  --red-bg: #f9e5e2;
  --amber: #9a6a0c;
  --amber-bg: #f8eed6;
  --blue: #34497a;
  --blue-bg: #e7ebf5;
  --star: #e0a21f;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(40, 30, 10, .04), 0 2px 8px rgba(40, 30, 10, .03);
  --shadow: 0 1px 2px rgba(40, 30, 10, .05), 0 6px 18px rgba(40, 30, 10, .06);
  --shadow-lg: 0 12px 36px rgba(40, 30, 10, .16);
  --font: "Inter", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --side-w: 252px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #141310;
  --panel: #1d1b17;
  --panel-2: #23211c;
  --ink: #f1eee6;
  --ink-2: #d4d0c4;
  --muted: #9b978a;
  --line: #34312a;
  --line-strong: #4a463c;
  --soft: #2a2822;
  --clay: #e07a52;
  --clay-dark: #f0956f;
  --clay-soft: #3a2a22;
  --clay-ring: rgba(224, 122, 82, .35);
  --green: #5cc58a;
  --green-bg: #1d3328;
  --red: #f0867a;
  --red-bg: #3b221f;
  --amber: #e8b655;
  --amber-bg: #38301b;
  --blue: #9db4ee;
  --blue-bg: #222b43;
  --star: #f0b436;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 36px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--clay-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--clay-ring); }

:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; border-radius: 6px; }

/* ---------- Каркас ---------- */

.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }

.side {
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 14px 10px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
  z-index: 40;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 12px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--clay), var(--clay-dark));
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  box-shadow: 0 2px 8px var(--clay-ring);
}
.brand-word { font-weight: 700; letter-spacing: -.01em; font-size: 15px; }

.biz {
  display: flex; align-items: center; gap: 9px; margin: 0 2px 8px;
  padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2);
}
.biz-ic {
  width: 28px; height: 28px; border-radius: 8px; background: var(--clay-soft);
  color: var(--clay-dark); display: grid; place-items: center; font-weight: 700; font-size: 12px;
  flex: 0 0 auto;
}
.biz-info { min-width: 0; }
.biz-name { font-size: 13px; font-weight: 650; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biz-sub { font-size: 11.5px; color: var(--muted); }

.section {
  font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase;
  color: var(--muted); font-weight: 700; padding: 14px 10px 4px;
}

.side a.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px;
  border-radius: 9px; color: var(--ink-2); font-size: 13.5px; font-weight: 500;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}
.side a.nav-item:hover { background: var(--soft); text-decoration: none; color: var(--ink); }
.side a.nav-item.on { background: var(--clay-soft); color: var(--clay-dark); font-weight: 650; }
.side a.nav-item.on::before {
  content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--clay);
}
.nav-ic { width: 18px; height: 18px; flex: 0 0 auto; opacity: .75; }
.nav-item.on .nav-ic, .nav-item:hover .nav-ic { opacity: 1; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .45; flex: 0 0 auto; }

.badge {
  margin-left: auto; background: var(--clay); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; padding: 1px 7px; min-width: 20px; text-align: center;
}

.side-foot { margin-top: auto; padding: 12px 0 0; border-top: 1px solid var(--line); }
.side-user { font-size: 12.5px; color: var(--muted); line-height: 1.35; padding: 8px 10px 0; word-break: break-word; }
.side-user strong { display: block; color: var(--ink); font-size: 13px; }
.side-actions { display: flex; align-items: center; gap: 6px; padding: 6px 10px 0; }

.plan-note {
  display: block; margin: 0 2px 6px; padding: 9px 11px; border-radius: 10px;
  background: var(--clay-soft); border: 1px solid transparent; color: var(--ink);
  font-size: 12px; font-weight: 650; line-height: 1.3;
}
.plan-note:hover { text-decoration: none; border-color: var(--clay-ring); }
.plan-note span { display: block; margin-top: 2px; font-size: 11px; font-weight: 500; color: var(--clay-dark); }

.main { padding: 28px 34px 96px; width: 100%; max-width: 1280px; min-width: 0; margin-inline: auto; }

/* Мобильная шапка и выдвижное меню */
.topbar {
  display: none; position: sticky; top: 0; z-index: 35;
  align-items: center; gap: 10px; padding: 10px 14px;
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.topbar .brand { padding: 0; }
.topbar .burger { margin-left: auto; }
.scrim {
  display: none; position: fixed; inset: 0; background: rgba(15, 12, 5, .45); z-index: 38;
  opacity: 0; transition: opacity .2s var(--ease);
}

/* ---------- Типографика ---------- */

h1 { font-size: 25px; margin: 0 0 4px; letter-spacing: -.025em; line-height: 1.25; font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; letter-spacing: -.01em; font-weight: 650; }
h3 { font-size: 14px; margin: 0 0 8px; font-weight: 650; }
.sub { color: var(--muted); margin: 0 0 22px; font-size: 14px; max-width: 80ch; }
.sub strong { color: var(--ink); }

.page-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 240px; }
.page-head .grow .sub { margin-bottom: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- Сетка и панели ---------- */

.grid { display: grid; gap: 16px; }
.c2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); }
.c3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.c4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); }

.panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm);
}
.panel.tight { padding: 0; overflow-x: auto; overflow-y: hidden; }
.panel.tight.open { overflow: visible; }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 0; margin-bottom: 12px; }
.panel:not(.tight) > .panel-head { padding: 0; }
.panel-head h2 { margin: 0; }

.stat-label { color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; }
.stat-value { font-size: 28px; font-weight: 700; letter-spacing: -.025em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat-note { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* ---------- Таблицы ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 700; background: var(--panel-2); white-space: nowrap;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Метки ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; background: var(--soft); color: var(--muted);
  white-space: nowrap; line-height: 1.5;
}
.pill.ok { background: var(--green-bg); color: var(--green); }
.pill.warn { background: var(--amber-bg); color: var(--amber); }
.pill.bad { background: var(--red-bg); color: var(--red); }
.pill.info { background: var(--blue-bg); color: var(--blue); }

.plat { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.plat-mark {
  width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff; flex: 0 0 auto;
}

/* ---------- Кнопки ---------- */

.btn, button {
  font-family: inherit; font-size: 13.5px; font-weight: 600; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  padding: 7px 14px; cursor: pointer; line-height: 1.35;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
a.btn { text-decoration: none; }
.btn:hover, button:hover { border-color: var(--muted); background: var(--panel-2); text-decoration: none; }
.btn:active, button:active { transform: translateY(1px); }
.btn.primary, button.primary { background: var(--clay); border-color: var(--clay); color: #fff; box-shadow: 0 1px 2px var(--clay-ring); }
.btn.primary:hover, button.primary:hover { background: var(--clay-dark); border-color: var(--clay-dark); }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] button.primary { color: #1b1008; }
.btn.small, button.small { padding: 4px 10px; font-size: 12.5px; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn[disabled], button[disabled], button.busy { opacity: .6; cursor: progress; pointer-events: none; }
button.link {
  border: none; background: none; padding: 0; color: var(--clay-dark); box-shadow: none;
  font-weight: 500; font-size: 13px;
}
button.link:hover { text-decoration: underline; background: none; }
button.danger, .btn.danger { color: var(--red); }
button.danger:hover { background: var(--red-bg); border-color: var(--red); }
button.icon, .btn.icon { padding: 7px; width: 34px; height: 34px; }
button.icon svg { width: 18px; height: 18px; }

/* ---------- Формы ---------- */

input, select, textarea {
  font-family: inherit; font-size: 14px; width: 100%; padding: 8px 11px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--panel); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .75; }
textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-ring);
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--clay); width: 16px; height: 16px; padding: 0; }
select { appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236f6c61' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; }

label.field { display: block; margin-bottom: 12px; }
label.field > span { display: block; font-size: 12px; font-weight: 650; color: var(--muted); margin-bottom: 5px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; }

/* ---------- Вкладки ---------- */

.tabs {
  display: flex; gap: 4px; flex-wrap: nowrap; margin-bottom: 18px;
  overflow-x: auto; scrollbar-width: none; padding: 2px 0 6px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--muted); border: 1px solid transparent; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 7px;
  transition: background .15s, color .15s;
}
.tabs a:hover { background: var(--soft); text-decoration: none; color: var(--ink); }
.tabs a.on { background: var(--panel); border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs .count {
  font-size: 11.5px; font-weight: 700; padding: 0 7px; border-radius: 999px;
  background: var(--soft); color: var(--muted); font-variant-numeric: tabular-nums;
}
.tabs a.on .count { background: var(--clay-soft); color: var(--clay-dark); }
.tabs .count.hot { background: var(--clay); color: #fff; }

/* ---------- Сообщения ---------- */

.error {
  background: var(--red-bg); border: 1px solid color-mix(in srgb, var(--red) 35%, transparent);
  color: var(--red); padding: 10px 13px; border-radius: var(--radius-sm); margin-bottom: 14px; font-size: 13.5px;
}
.empty { color: var(--muted); text-align: center; padding: 40px 20px; font-size: 14px; }

/* ---------- Отзывы ---------- */

.review {
  display: grid; grid-template-columns: auto 1fr; gap: 0 14px;
  border-bottom: 1px solid var(--line); padding: 18px 18px 16px;
  transition: background .15s;
}
.review:last-child { border-bottom: none; }
.review:hover { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.review.selected { background: var(--clay-soft); }
.review-side { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 2px; }
.review-body { min-width: 0; }

.rating-badge {
  min-width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  font-weight: 750; font-size: 16px; font-variant-numeric: tabular-nums;
  background: var(--soft); color: var(--ink);
}
.rating-badge[data-r="5"], .rating-badge[data-r="4"] { background: var(--green-bg); color: var(--green); }
.rating-badge[data-r="3"] { background: var(--amber-bg); color: var(--amber); }
.rating-badge[data-r="2"], .rating-badge[data-r="1"] { background: var(--red-bg); color: var(--red); }

.review-head { display: flex; gap: 8px 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.review-author { font-weight: 650; }
.review-meta { display: flex; gap: 6px 10px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.stars { color: var(--star); letter-spacing: 1px; font-size: 13px; }
.review-text { margin: 4px 0 10px; font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.review-text.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.review-more { font-size: 12.5px; margin: -4px 0 8px; }
.muted { color: var(--muted); font-size: 12px; }
.review-photos { display: flex; gap: 6px; margin: 6px 0 10px; flex-wrap: wrap; }
.review-photos img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }

.reply-box {
  background: var(--panel-2); border: 1px solid var(--line); border-left: 3px solid var(--line-strong);
  padding: 10px 13px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px; margin-top: 10px; overflow-wrap: anywhere;
}
.reply-box.draft { border-left-color: var(--blue); background: var(--blue-bg); }
.reply-box.official { border-left-color: var(--green); }
.reply-box .reply-label { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }

.review-actions { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.review-actions form { margin: 0; display: inline-flex; }
.review-actions .spacer { flex: 1; }

/* Редактор ответа: раскрывается по клику */
.reply-editor { margin-top: 12px; }
.reply-editor > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--clay-dark); padding: 4px 0;
}
.reply-editor > summary::-webkit-details-marker { display: none; }
.reply-editor > summary::before { content: "✎"; }
.reply-editor[open] > summary { margin-bottom: 8px; }
.reply-editor form { display: grid; gap: 8px; }
.reply-editor textarea { min-height: 96px; }
.reply-editor .editor-foot { display: flex; align-items: center; gap: 10px; }
.reply-editor .editor-foot .count { margin-left: auto; }

/* Меню «Ещё» */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 210px;
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: 10px;
  box-shadow: var(--shadow-lg); padding: 5px; display: grid; gap: 1px;
}
.menu-list form { display: block; margin: 0; }
.menu-list button {
  width: 100%; justify-content: flex-start; border: none; background: none; box-shadow: none;
  padding: 8px 11px; border-radius: 7px; font-weight: 500; font-size: 13px;
}
.menu-list button:hover { background: var(--soft); }
.menu-list button.danger:hover { background: var(--red-bg); }
.menu-list a { display: block; padding: 8px 11px; border-radius: 7px; color: var(--ink); font-size: 13px; }
.menu-list a:hover { background: var(--soft); text-decoration: none; }
.menu-list hr { border: none; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }

/* Панель фильтров */
.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters .field { margin: 0; flex: 1 1 150px; }
.filters .field select { width: 100%; }
.filters .grow { flex: 3 1 220px; min-width: 180px; }

/* Панель массовых действий — липкая */
.bulkbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 14px;
  position: sticky; top: 8px; z-index: 15;
}
.bulkbar .bulk-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; opacity: .45; pointer-events: none; transition: opacity .15s; }
.bulkbar.active { border-color: var(--clay); box-shadow: 0 0 0 3px var(--clay-ring), var(--shadow); }
.bulkbar.active .bulk-actions { opacity: 1; pointer-events: auto; }

/* ---------- Лента, графики ---------- */

.feed { display: grid; }
.feed-item { display: flex; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.feed-item:last-child { border-bottom: none; }
.feed-time { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.chart { display: flex; align-items: flex-end; gap: 3px; height: 120px; padding: 6px 0; }
.chart-bar { flex: 1; background: var(--clay); opacity: .7; border-radius: 3px 3px 0 0; min-height: 3px; transition: opacity .15s; }
.chart-bar:hover { opacity: 1; }
.chart-axis { display: flex; justify-content: space-between; color: var(--muted); font-size: 11px; }

.bars { display: grid; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 150px) 1fr 54px; gap: 10px; align-items: center; font-size: 13px; }
.bar-track { background: var(--soft); border-radius: 999px; height: 9px; overflow: hidden; }
.bar-fill { background: var(--clay); height: 100%; border-radius: 999px; }
.bar-num { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

.thumb { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius-sm); background: var(--soft); }
.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }

/* ---------- Плитки ---------- */

.summary-tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.tile {
  display: flex; flex-direction: column; gap: 3px; padding: 16px 18px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s;
}
a.tile:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.tile-label { font-size: 11px; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tile-value { font-size: 30px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.tile-note { font-size: 12px; color: var(--muted); }
.tile[data-tone="warn"] { border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); background: color-mix(in srgb, var(--amber-bg) 45%, var(--panel)); }
.tile[data-tone="warn"] .tile-value { color: var(--amber); }
.tile[data-tone="ok"] .tile-value { color: var(--green); }

.loc { display: block; color: var(--ink); transition: transform .15s var(--ease), box-shadow .15s, border-color .15s; }
a.loc:hover { text-decoration: none; border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.loc[data-warn="1"] { border-color: color-mix(in srgb, var(--amber) 45%, var(--line)); }

.phone { border: 1px solid var(--line); border-radius: 18px; padding: 18px 16px; background: var(--panel); max-width: 320px; box-shadow: var(--shadow); }
.star-btn {
  font-family: inherit; font-size: 20px; font-weight: 650; line-height: 1;
  padding: 10px 14px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--panel); cursor: pointer; min-width: 46px;
}
.star-btn:hover { border-color: var(--clay); color: var(--clay-dark); background: var(--clay-soft); }

/* ---------- Вход и публичные страницы ---------- */

.auth { max-width: 400px; margin: 9vh auto 40px; padding: 0 16px; }
.auth .panel { padding: 28px; box-shadow: var(--shadow); }
.auth h1 { font-size: 21px; margin-bottom: 18px; }
.auth button.primary { padding: 10px 14px; }

.public { max-width: 540px; margin: 56px auto 80px; padding: 0 16px; }
.public .panel { border-radius: 18px; box-shadow: var(--shadow); }

/* ---------- Утилиты ---------- */

.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12.5px; }
.hint { color: var(--muted); font-size: 12px; margin-top: 5px; }
.sep { height: 1px; background: var(--line); margin: 16px 0; }
.scroll { max-height: 520px; overflow: auto; scrollbar-width: thin; }
.nowrap { white-space: nowrap; }
.big { font-size: 32px; font-weight: 700; letter-spacing: -.03em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
form.inline { display: inline-flex; }

/* ---------- Всплывающие уведомления ---------- */

.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; max-width: min(92vw, 380px); }
.toast {
  background: var(--ink); color: var(--bg); padding: 11px 15px; border-radius: 10px;
  font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toast-in .25s var(--ease);
}
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

kbd {
  font-family: inherit; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 5px;
  border: 1px solid var(--line-strong); background: var(--panel-2); color: var(--muted);
}

/* ---------- Адаптивность ---------- */

@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .topbar { display: flex; }
  .side {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(86vw, 300px); height: 100dvh;
    transform: translateX(-102%); transition: transform .25s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  body.nav-open .side { transform: none; }
  body.nav-open .scrim { display: block; opacity: 1; }
  body.nav-open { overflow: hidden; }
  .main { padding: 20px 16px 80px; }
  .side a.nav-item { padding: 10px 11px; }
  .side a.nav-item.on::before { left: -10px; }
}

@media (max-width: 640px) {
  h1 { font-size: 21px; }
  .review { grid-template-columns: 1fr; padding: 16px 14px; }
  .review-side { flex-direction: row; justify-content: flex-start; margin-bottom: 8px; }
  .bulkbar .bulk-actions { margin-left: 0; width: 100%; }
  .filters .field { flex-basis: 100%; min-width: 0 !important; }
  .bar-row { grid-template-columns: 90px 1fr 46px; }
  .page-head .actions { width: 100%; }
  th, td { padding: 9px 10px; }
  .toasts { left: 14px; right: 14px; bottom: 14px; max-width: none; }
}

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

@media print {
  .side, .topbar, .bulkbar, .review-actions, .toasts { display: none !important; }
  .shell { display: block; }
  .main { padding: 0; max-width: none; }
}


/* ==========================================================================
   Дружелюбный слой: круглее, мягче, больше подсказок и быстрых действий
   ========================================================================== */

body { background: radial-gradient(1200px 500px at 85% -10%, color-mix(in srgb, var(--clay) 7%, transparent), transparent 70%), var(--bg); background-attachment: fixed; }

/* кнопки — «таблетки», с понятным откликом */
.btn, button { border-radius: 999px; padding: 8px 17px; font-weight: 600; }
.btn.small, button.small { padding: 5px 13px; }
.btn.primary, button.primary { box-shadow: 0 2px 10px var(--clay-ring); }
.btn.primary:hover, button.primary:hover { transform: translateY(-1px); box-shadow: 0 4px 14px var(--clay-ring); }
.review-actions button.small, .menu > summary.btn { border-radius: 999px; }
input, select, textarea { border-radius: 14px; padding: 9px 14px; }
select { padding-right: 34px; }
textarea { border-radius: 16px; }
.pill { padding: 3px 11px; }

/* меню слева мягче */
.side { padding: 16px 12px 18px; }
.side a.nav-item { border-radius: 14px; padding: 8px 12px; gap: 11px; }
.side a.nav-item.on::before { display: none; }
.side a.nav-item.on { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--clay) 18%, transparent); }
.nav-ic { width: 18px; height: 18px; }
.biz { border-radius: 16px; background: var(--clay-soft); border-color: transparent; }
.biz-ic { background: var(--panel); border-radius: 10px; }
.plan-note { border-radius: 16px; }
.brand-mark { border-radius: 11px; }

/* панели и плитки */
.panel, .tile { border-radius: var(--radius); }
.panel { padding: 20px; }
.tabs a { padding: 8px 16px; }
.reply-box { border-radius: 0 14px 14px 0; }
.rating-badge { border-radius: 14px; width: 44px; height: 44px; }
.bulkbar { border-radius: 999px; padding: 10px 20px; }
.menu-list { border-radius: 16px; padding: 6px; }
.menu-list button, .menu-list a { border-radius: 10px; }
.review { padding: 20px 20px 18px; }

/* плитки с цветными значками */
.tile { position: relative; padding: 18px 20px; overflow: hidden; }
.tile-ic {
  position: absolute; right: 16px; top: 16px; width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; background: var(--soft); color: var(--muted);
}
.tile-ic svg { width: 20px; height: 20px; }
.tile[data-t="rating"] .tile-ic { background: var(--amber-bg); color: var(--amber); }
.tile[data-t="week"] .tile-ic { background: var(--blue-bg); color: var(--blue); }
.tile[data-t="open"] .tile-ic { background: var(--clay-soft); color: var(--clay-dark); }
.tile[data-t="clean"] .tile-ic { background: var(--green-bg); color: var(--green); }
.tile[data-tone="warn"] .tile-ic { background: var(--amber-bg); color: var(--amber); }
.tile[data-tone="ok"] .tile-ic { background: var(--green-bg); color: var(--green); }

/* блок «Что сделать сейчас» */
.todo { padding: 18px 20px; margin: 16px 0; border-color: color-mix(in srgb, var(--clay) 25%, var(--line));
  background: linear-gradient(135deg, var(--clay-soft), var(--panel) 70%); }
.todo-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.todo-head h2 { margin: 0; }
.todo-list { display: flex; gap: 10px; flex-wrap: wrap; }
.todo-item {
  display: inline-flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line-strong); color: var(--ink); font-weight: 600; font-size: 13.5px;
  box-shadow: var(--shadow-sm); cursor: pointer; font-family: inherit;
  transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
}
.todo-item:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--clay); text-decoration: none; }
.todo-item .num { background: var(--clay); color: #fff; border-radius: 999px; padding: 0 9px; font-size: 12px; min-width: 24px; text-align: center; }
.todo-item.good .num { background: var(--green); }
.todo-done { display: flex; align-items: center; gap: 10px; color: var(--green); font-weight: 600; }

/* контент не растягивает соседние панели без нужды */
.grid.top { align-items: start; }

/* карточки точек живее */
.loc { border-radius: var(--radius); }
.loc .sep { margin: 12px 0; }
.empty { padding: 48px 20px; }
.empty::before { content: "🌿"; display: block; font-size: 28px; margin-bottom: 8px; opacity: .8; }

@media (max-width: 640px) {
  .todo-item { width: 100%; justify-content: space-between; }
  .bulkbar { border-radius: 20px; }
}

/* ---------- Добавление точки по ссылке ---------- */
.add-point { max-width: 820px; margin-inline: auto; }
.add-point > label.field { margin-bottom: 6px; }
.link-row { display: flex; gap: 10px; }
.link-row input { flex: 1; min-width: 0; font-size: 15px; padding: 12px 16px; }
.link-row .btn { padding-inline: 24px; }
.lookup-status { margin: 14px 0 4px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13.5px; background: var(--soft); color: var(--ink-2); }
.lookup-status.ok { background: var(--green-bg); color: var(--green); }
.lookup-status.warn { background: var(--amber-bg); color: var(--amber); }
.lookup-status.loading::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -2px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.found { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
.manual-switch { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.more { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 16px; background: var(--panel-2); }
.more > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.more[open] > summary { margin-bottom: 4px; }
@media (max-width: 640px) { .link-row { flex-direction: column; } }

/* ---------- ������: �������-��������, ��������, ������� ---------- */
.stat-tabs {
  display: grid; gap: 12px; margin-bottom: 16px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.stat-tab {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); color: var(--ink);
}
.stat-tab:hover { text-decoration: none; border-color: var(--line-strong); }
.stat-tab.on { border-color: var(--clay); background: #fdf4ef; }
.stat-tab__label { font-size: 13px; color: var(--muted); }
.stat-tab.on .stat-tab__label { color: var(--clay-dark); font-weight: 600; }
.stat-tab__value { font-size: 30px; font-weight: 650; letter-spacing: -.03em; line-height: 1.1; }

.searchbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 8px 6px 18px;
}
.searchbar__icon { color: var(--muted); font-size: 17px; }
.searchbar input[type="search"] {
  flex: 1; min-width: 0; border: none; background: none; padding: 8px 0; font-size: 14.5px;
}
.searchbar input[type="search"]:focus { outline: none; }
.searchbar__period {
  width: auto; border: none; background: var(--soft); border-radius: 999px;
  padding: 8px 12px; font-size: 13.5px; font-weight: 600;
}

.reviews-layout { display: grid; grid-template-columns: minmax(0, 1fr) 272px; gap: 18px; align-items: start; }
.reviews-main { min-width: 0; display: grid; gap: 14px; }
.reviews-side { position: sticky; top: 76px; }

.review-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
}
.review-card__top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.review-card__check { flex: 0 0 auto; }
.review-card__check input { width: auto; }
.review-card__who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.review-card__author { font-weight: 650; font-size: 14.5px; }
.review-card__date { margin-left: auto; color: var(--muted); font-size: 12.5px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--soft); color: var(--ink-2); white-space: nowrap;
}
.badge__mark {
  width: 15px; height: 15px; border-radius: 4px; color: #fff;
  display: inline-grid; place-items: center; font-size: 9px; font-weight: 700;
}
.badge--ok { background: var(--green-bg); color: var(--green); }
.badge--warn { background: var(--amber-bg); color: var(--amber); }
.badge--bad { background: #fbe9e7; color: #a13524; }
.badge--place { background: #eef2f7; color: #3c4a63; }

.review-card__score { display: flex; align-items: center; gap: 8px; margin: 8px 0 6px; flex-wrap: wrap; }
.stars--inline { color: #d9a11f; letter-spacing: 1px; font-size: 14px; }
.review-card__rating { font-weight: 650; font-size: 13.5px; }
.sentiment { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--muted); }
.sentiment--ok { background: var(--green-bg); color: var(--green); }
.sentiment--bad { background: var(--red-bg); color: var(--red); }

.review-card__text { font-size: 14.5px; line-height: 1.55; margin: 6px 0 10px; white-space: pre-line; }

.review-card__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.tag-form { display: inline; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: #fbf8f2; color: var(--ink-2); font-size: 12.5px; font-weight: 500;
  cursor: pointer; text-decoration: none;
}
.tag:hover { border-color: var(--clay); color: var(--clay-dark); text-decoration: none; }
.tag--on { border-color: var(--clay); background: #fdf0e9; color: var(--clay-dark); }
.tag-input {
  width: 150px; border: 1px dashed var(--line-strong); background: none;
  border-radius: 999px; padding: 3px 11px; font-size: 12.5px;
}
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 4px; }

.reply-card {
  border-radius: 10px; padding: 12px 14px; margin-top: 10px;
  background: #f7f9fb; border: 1px solid #e3e9f0;
}
.reply-card--official { background: #f7f9fb; }
.reply-card--draft { background: #fdf7f2; border-color: #f0dccd; }
.reply-card--sent { background: #f5faf6; border-color: #dceade; }
.reply-card--failed { background: #fdf4f3; border-color: #f0d6d3; }
.reply-card__error {
  margin-top: 8px; padding: 8px 10px; border-radius: 8px; font-size: 12.5px;
  line-height: 1.5; color: #8c2f22; background: #fbe9e7; border: 1px solid #f0cfcb;
}
.reply-card__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.reply-card__mark {
  width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center;
  font-size: 10px; font-weight: 700; color: #fff; background: var(--clay);
}
.reply-card__title { font-weight: 650; font-size: 13px; }
.reply-card__text { font-size: 14px; line-height: 1.55; white-space: pre-line; }
.reply-card__actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.review-card__actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line);
}
.btn-reply {
  padding: 8px 18px; border-radius: 8px; font-weight: 650; font-size: 13.5px;
  border: 1px solid var(--clay); background: var(--clay); color: #fff; cursor: pointer;
}
.btn-reply:hover { background: var(--clay-dark); }
.btn-reply--ghost { background: none; border-color: var(--line); color: var(--ink-2); font-weight: 500; }
/* ������ ��� ��������� ������: ��� �� ���, �� �� ��������� ������. */
.btn-reply-b {
  padding: 7px 14px; border-radius: 8px; font-weight: 600; font-size: 13px;
  border: 1px solid var(--clay); background: var(--clay); color: #fff;
  cursor: pointer; line-height: 1.3;
}
.btn-reply-b:hover { background: var(--clay-dark); }
.btn-reply-b--ghost {
  background: none; border-color: var(--line); color: var(--ink-2); font-weight: 500;
}
.btn-reply-b--ghost:hover {
  border-color: var(--clay); color: var(--clay-dark); background: none;
}
.btn-reply--ghost:hover { border-color: var(--clay); color: var(--clay-dark); background: none; }
.review-card__source { margin-left: auto; font-size: 12.5px; color: var(--muted); }

.inline-reply { display: inline; }
.inline-reply > summary { list-style: none; display: inline-block; }
.inline-reply > summary::-webkit-details-marker { display: none; }
.reply-form { margin-top: 10px; display: grid; gap: 8px; width: 100%; }
/* Раскрытый редактор текста разворачивается на всю ширину карточки,
   а не жмётся в узкое окошко в ряду кнопок. */
.reply-card__actions details.inline-reply[open],
.review-card__actions details.inline-reply[open] { flex-basis: 100%; }
.reply-form textarea { min-height: 150px; font-size: 14px; }
.complaint-text {
  margin-top: 10px; padding: 10px 12px; max-width: 420px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  font-size: 13px; line-height: 1.5; white-space: pre-wrap;
}

.filters-card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px;
}
.filters-card__field { display: block; margin-bottom: 14px; }
.filters-card__field > span {
  display: block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.filters-card__reset { display: block; text-align: center; color: var(--clay-dark); }

.modal {
  border: 1px solid var(--line); border-radius: 14px; padding: 20px;
  background: var(--panel); max-width: 420px; width: calc(100% - 32px);
}
.modal::backdrop { background: rgba(20, 18, 14, .35); }
.modal h3 { margin: 0 0 6px; }
.modal__actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }

@media (max-width: 960px) {
  .reviews-layout { grid-template-columns: minmax(0, 1fr); }  .reviews-side { position: static; order: -1; }
  .filters-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 12px; }
  .filters-card__reset { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .searchbar { border-radius: 14px; flex-wrap: wrap; padding: 10px 12px; }
  .searchbar input[type="search"] { width: 100%; }
  .stat-tabs { grid-template-columns: repeat(2, 1fr); }
  .stat-tab__value { font-size: 24px; }
}

/* ---------- ИИ: провайдер, вердикт по отзыву ---------- */
.ai-providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.ai-provider {
  position: relative; display: block; cursor: pointer;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  background: var(--panel-2); transition: border-color .15s, background .15s;
}
.ai-provider:hover { border-color: var(--clay); }
.ai-provider.on, .ai-provider:has(input:checked) { border-color: var(--clay); background: var(--clay-soft); }
.ai-provider:has(input:focus-visible) { outline: 2px solid var(--clay-ring); outline-offset: 2px; }
.ai-provider input { position: absolute; opacity: 0; pointer-events: none; }
.ai-provider__title { display: block; font-weight: 700; font-size: 14px; }
.ai-provider__hint { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.45; }

.ai-status {
  border-radius: 10px; padding: 10px 12px; margin-bottom: 14px;
  font-size: 13px; line-height: 1.5; border: 1px solid var(--line);
}
.ai-status.ok { background: var(--green-bg, #eef7ef); border-color: var(--green); }
.ai-status.bad { background: var(--red-bg, #fbeeee); border-color: var(--red); }
.ok-text { color: var(--green); }
.bad-text { color: var(--red); }

.ai-verdict {
  border: 1px solid var(--line); border-left: 3px solid var(--muted);
  border-radius: 10px; padding: 10px 12px; margin: 10px 0 2px;
  background: var(--panel-2); font-size: 13px;
}
.ai-verdict--ok { border-left-color: var(--green); }
.ai-verdict--bad { border-left-color: var(--amber); background: var(--amber-bg); }
.ai-verdict__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ai-verdict__label { font-weight: 700; }
.ai-verdict__ground { margin-top: 6px; font-weight: 600; }
.ai-verdict__reason { margin-top: 4px; color: var(--ink-2); line-height: 1.5; }
.ai-verdict__quote {
  margin: 6px 0 0; padding: 6px 10px; border-left: 2px solid var(--line);
  color: var(--ink-2); font-style: italic;
}
.ai-verdict__missing { margin-top: 6px; color: var(--amber); }
.ai-verdict__note { margin-top: 6px; font-size: 12px; color: var(--muted); line-height: 1.45; }


/* ---- ������������ ��������� ---- */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 14px 4px 4px; }
.pager a { min-width: 36px; height: 36px; padding: 0 10px; display: inline-flex; align-items: center;
  justify-content: center; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--panel); color: var(--ink); text-decoration: none; font-weight: 600; }
.pager a:hover { border-color: var(--clay); }
.pager a.on { background: var(--clay); border-color: var(--clay); color: #fff; }
.pager .gap { color: var(--muted); padding: 0 2px; }
.pager-note { margin-left: auto; color: var(--muted); font-size: 13px; }

/* ---- �������� ��������� ������ ---- */
.draft { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px;
  border-top: 1px solid var(--line); }
.draft__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.draft__review { margin: 0; color: var(--muted); font-size: 13.5px; }
.draft__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.draft__actions form { margin: 0; }

/* ---- ������ ������: ��������� � ������ ������������� ---- */
.page-head .sub { display: none; }
.has-tip { position: relative; }
.tip-btn { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px;
  margin-left: 6px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--panel);
  color: var(--muted); font: 600 12px/1 var(--font); cursor: pointer; vertical-align: middle; }
.tip-btn:hover, .tip-btn[aria-expanded="true"] { color: var(--clay); border-color: var(--clay); }
.tip-text[hidden] { display: none; }
.panel[data-collapse] > .panel-head { cursor: pointer; user-select: none; }
.panel[data-collapse] > .panel-head::after { content: "▾"; margin-left: 12px; color: var(--muted);
  transition: transform .15s; }
.panel[data-collapse].is-collapsed > .panel-head::after { transform: rotate(-90deg); }
.panel[data-collapse].is-collapsed > :not(.panel-head) { display: none; }
.panel[data-collapse] > .panel-head .muted { margin-left: auto; }
