/* specs/007-ui-restyle FR-005 — токены бренда (те же, что лендинг: site/src/layouts/Layout.astro,
   site/src/components/StatusCard.astro, design/landing-directions.html вариант C). */
:root {
  --bg: #fbf9f1;
  --surface: #ffffff;
  --ink: #1b2a3d;
  --muted: #5b6b7d;
  --accent: #a8842e;
  --line: #e6e0cc;
  --shadow: 0 1px 2px rgba(28, 28, 26, 0.06);
  --radius-sm: 4px;
  --radius-lg: 12px;
  --up: #2f7a54;
  --down: #a8402c;
  --down-bg: #fdf7f5;
  --down-line: #e6c6bd;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Golos Text", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--ink);
}

h1,
h2,
h3 {
  margin: 0 0 8px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

table {
  border-collapse: collapse;
  width: 100%;
}

@keyframes pulse-dot {
  0% {
    box-shadow: 0 0 0 0 rgba(47, 122, 84, 0.55);
  }
  70% {
    box-shadow: 0 0 0 7px rgba(47, 122, 84, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(47, 122, 84, 0);
  }
}

/* Клиентский контур — боковая панель (FR-002). */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  /* Панель прибита к вьюпорту: подвал с организацией и выходом виден на длинных страницах. */
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 20px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}

.sidebar-nav-item.active {
  background: rgba(168, 132, 46, 0.12);
  color: var(--ink);
}

.sidebar-spacer {
  flex: 1;
}

.sidebar-account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
}

.sidebar-account:hover {
  background: rgba(168, 132, 46, 0.08);
  color: var(--ink);
}

.sidebar-logout {
  padding: 4px 12px 0;
}

.btn-small {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
}

.sidebar-org-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-org-info {
  flex: 1;
  min-width: 0;
}

.sidebar-org-name {
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-org-tier {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.main {
  flex: 1;
  padding: 32px 40px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 0;
}

/* Контур оператора — верхняя навигация, не сайдбар с карточками (FR-009). */
.topnav {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.topnav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.topnav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.topnav-links {
  display: flex;
  gap: 26px;
  flex: 1;
}

.topnav-link {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
}

.topnav-link.active {
  color: var(--ink);
}

.topnav-user {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topnav-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Заголовок страницы. */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.page-title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-subtitle {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* Кнопки (FR-005). */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
  padding: 11px 18px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: inherit;
}

.btn-primary {
  background: var(--ink);
  color: var(--bg);
}

.btn-secondary {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
}

.btn-danger {
  background: var(--surface);
  color: var(--down);
  border: 1px solid var(--down-line);
}

/* Поля форм (FR-005). Кнопки не растягиваются на всю ширину формы. */
form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

form .field,
form .form-grid,
form .inline-form-row,
form .notice-ok {
  align-self: stretch;
}

/* Раскрывающаяся форма создания: заголовок страницы держит одну кнопку, она открывает форму. */
.reveal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}

.reveal h2 {
  font-size: 16px;
  margin: 0 0 12px;
}

.reveal-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

/* Список выбранных проверок внутри карточки статус-страницы. */
.sub-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 12px;
}

.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.sub-row:last-child {
  border-bottom: none;
}

.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 12px;
}

.field input,
.field select,
.field textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Сообщение об ошибке (FR-007) — переиспользует уже существующий класс "error", стоящий на
   каждой странице кабинета сегодня. */
.error {
  background: var(--down-bg);
  border: 1px solid var(--down-line);
  color: var(--down);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 16px;
}

/* Пустое состояние (FR-006). */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
}

.empty-state p {
  margin: 0 0 12px;
}

/* Сетка карточек статуса (FR-003). */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

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

.card.card-down {
  background: var(--down-bg);
  border-color: var(--down-line);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}

.card.card-down .card-header {
  border-bottom-color: var(--down-line);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.card-name {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-status-label {
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  color: var(--muted);
}

.card-status-label.up {
  color: var(--up);
}

.card-status-label.down {
  color: var(--down);
}

.card-metrics {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.card-metric-value {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.card-metric-value.down {
  color: var(--down);
}

.card-metric-label {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* Индикатор статуса — точка (FR-003). */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--muted);
}

.status-dot.up {
  background: var(--up);
  animation: pulse-dot 2s ease-out infinite;
}

.status-dot.down {
  background: var(--down);
}

/* Полоска истории за 28 дней (FR-004/FR-004a). */
.uptime-bar {
  display: flex;
  gap: 3px;
}

.uptime-segment {
  flex: 1;
  height: 26px;
  border-radius: 2px;
}

.uptime-segment.up {
  background: var(--up);
  opacity: 0.85;
}

.uptime-segment.down {
  background: var(--down);
  opacity: 0.85;
}

.uptime-segment.no-data {
  background: var(--line);
  opacity: 0.6;
}

.uptime-caption {
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--muted);
}

/* Вход и регистрация (FR-008). */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 24px;
}

.auth-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 380px;
}

.auth-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  margin-bottom: 24px;
  font-weight: 700;
  font-size: 18px;
}

.auth-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* Плотные таблицы кабинета оператора (FR-009). */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table th,
.table td {
  text-align: left;
  padding: 10px 14px;
  font-size: 13.5px;
  border-bottom: 1px solid var(--line);
}

.table th {
  color: var(--muted);
  font-weight: 600;
  background: rgba(168, 132, 46, 0.06);
}

.table tr:last-child td {
  border-bottom: none;
}

.table-wrap {
  overflow-x: auto;
}

/* Операторские страницы: поиск организаций, разделы внутри карточки, ссылка «назад». */
.search-form {
  flex-direction: row;
  align-items: flex-end;
  gap: 10px;
}

.search-form .field {
  flex: 1;
  margin-bottom: 0;
}

.back-link {
  padding: 0;
}

.subsection-title {
  font-size: 18px;
}

.row-form {
  flex-direction: row;
}

/* Универсальные добавки к кнопкам и формам. */
.btn-block {
  width: 100%;
  justify-content: center;
}

.btn-accent {
  background: var(--accent);
  color: #fffdf7;
}

.inline-form {
  display: inline-flex;
  margin-top: 8px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}

.form-grid .field-wide {
  grid-column: 1 / -1;
}

.field-hint {
  font-weight: 400;
  color: var(--muted);
}

/* Согласие на обработку ПДн под формой регистрации (152-ФЗ, COMPLIANCE.md). */
.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  margin: 4px 0 14px;
}

.consent input {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

/* Сетка тарифов в кабинете — та же логика, что site/src/components/Pricing.astro. */
.plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 16px 18px;
}

.plan-hero {
  border: 2px solid var(--accent);
  box-shadow: var(--shadow);
}

.plan-current {
  background: rgba(168, 132, 46, 0.06);
}

.plan-badge {
  position: absolute;
  top: -12px;
  left: 16px;
  background: var(--accent);
  color: #fffdf7;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.plan-badge-current {
  background: var(--ink);
  color: var(--bg);
}

.plan-name {
  font-size: 16px;
  font-weight: 700;
}

.plan-audience {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
  min-height: 2.6em;
}

.plan-price {
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-variant-numeric: tabular-nums;
}

.plan-price-num {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.plan-price-per {
  font-size: 13px;
  color: var(--muted);
}

.plan-annual {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

.plan-sites {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.plan-sites-n {
  font-size: 14px;
  font-weight: 600;
}

.plan-sites-extra {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}

.plan-actions {
  margin-top: auto;
  padding-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-actions form {
  gap: 0;
}

.plan-note {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  text-align: center;
}

.included {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
}

.included-k {
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}

.included-v {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  font-size: 12px;
  white-space: nowrap;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
}

/* Список интеграций (каналы уведомлений): одинаковые строки вместо карточек разной высоты. */
.integration-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.integration-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.integration-row .row-main {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  min-height: 72px;
}

/* Раскрывающаяся строка: summary без маркера, вся строка кликабельна, кнопка меняет подпись. */
details.integration-row > summary {
  list-style: none;
  cursor: pointer;
}

details.integration-row > summary::-webkit-details-marker {
  display: none;
}

details.integration-row[open] > summary .row-main {
  border-bottom: 1px solid var(--line);
}

.open-label::after {
  content: "Подключить";
}

details.integration-row[open] .open-label::after {
  content: "Свернуть";
}

details.integration-row[open] .open-label {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
}

.integration-panel {
  padding: 16px 18px 18px 74px;
  background: rgba(168, 132, 46, 0.06);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  gap: 10px;
}

.integration-panel .field {
  max-width: 520px;
  margin-bottom: 4px;
}

.panel-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.panel-note {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 60ch;
}

.integration-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(168, 132, 46, 0.12);
  color: var(--ink);
}

.integration-icon.icon-telegram {
  background: #e3f0fa;
  color: #1f6fa8;
}

.integration-icon.icon-max {
  background: #e9e6fb;
  color: #4b3fb5;
}

.integration-icon.icon-email {
  background: rgba(168, 132, 46, 0.14);
  color: var(--accent);
}

.integration-icon.icon-sms {
  background: #e5f3ea;
  color: var(--up);
}

.integration-icon.icon-slack {
  background: #f3e6ef;
  color: #8a2b6b;
}

.integration-name {
  font-size: 14px;
  font-weight: 600;
}

.integration-desc {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}

.integration-action {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.integration-action form {
  gap: 0;
}

.inline-form-row {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.inline-form-row input {
  font-family: inherit;
  font-size: 14px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
  flex: 1 1 220px;
}

.inline-form-row input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.inline-form-row select {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  min-width: 0;
  flex: 1 1 220px;
}

/* Страница «Аккаунт»: секции настроек одной формы. */
.notice-ok {
  background: #e5f3ea;
  border: 1px solid #c3dfcd;
  color: var(--up);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 16px;
}

.notice-ok a {
  color: var(--up);
  text-decoration: underline;
}

.settings-section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: 24px;
}

.settings-section-quiet {
  background: transparent;
  border-style: dashed;
}

.settings-head h2 {
  font-size: 16px;
  margin: 0 0 4px;
}

.settings-form {
  max-width: 520px;
}

.settings-form .field {
  margin-bottom: 10px;
}

.settings-actions {
  margin-top: 4px;
}

/* Страница проверки: список параметров ключ-значение внутри .card. */
.kv-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.kv-row {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}

.kv-row:last-child {
  border-bottom: none;
}

.kv-key {
  color: var(--muted);
  min-width: 160px;
}

.kv-value {
  color: var(--ink);
  font-weight: 600;
  word-break: break-word;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.member-row:last-child {
  border-bottom: none;
}

.member-email {
  font-size: 14px;
  font-weight: 600;
}

.member-meta {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .settings-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Публичная статус-страница — то, что видят клиенты клиента. */
.status-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 20px 60px;
}

.status-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 16px;
  margin-bottom: 28px;
}

.status-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
}

.status-summary.down {
  color: var(--down);
}

.status-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.status-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.status-row.down {
  background: var(--down-bg);
  border-color: var(--down-line);
}

.status-row-name {
  font-weight: 600;
}

.status-row-url {
  font-size: 12.5px;
  color: var(--muted);
}

.status-row-meta {
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.status-footer {
  margin-top: 28px;
  font-size: 12px;
  color: var(--muted);
}

.status-footer a {
  color: var(--muted);
}

/* Адаптив кабинета: сайдбар превращается в верхнюю панель, сетки в один столбец. */
@media (max-width: 1100px) {
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .app-shell {
    flex-direction: column;
  }

  .sidebar {
    width: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
    padding: 12px 16px;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 12px;
  }

  .sidebar-brand {
    padding: 0;
    border: none;
    margin: 0 8px 0 0;
    font-size: 16px;
  }

  /* Порядок в верхней панели: бренд, справа аватар и выход, навигация второй строкой. */
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
    flex-basis: 100%;
    order: 3;
  }

  .sidebar-account {
    order: 1;
    margin-left: auto;
  }

  .sidebar-logout {
    order: 2;
  }

  .sidebar-nav-item {
    padding: 7px 10px;
    font-size: 13px;
  }

  .sidebar-spacer {
    display: none;
  }

  .sidebar {
    position: static;
    height: auto;
    overflow: visible;
  }

  .sidebar-account {
    padding: 0;
    border: none;
    gap: 8px;
  }

  .sidebar-logout {
    padding: 0;
  }

  .sidebar-org-info {
    display: none;
  }

  .integration-row .row-main {
    grid-template-columns: 40px 1fr;
  }

  .integration-action {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .integration-panel {
    padding-left: 18px;
  }

  .inline-form-row {
    width: 100%;
  }

  .main {
    padding: 20px 16px 40px;
    gap: 18px;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .topnav-inner {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .plans {
    grid-template-columns: 1fr;
  }

  .plan-hero {
    order: -1;
  }

  .plan-audience {
    min-height: 0;
  }

  .card-metrics {
    gap: 12px;
  }

  .auth-card {
    padding: 28px 20px;
  }

  .status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .status-row-meta {
    text-align: left;
  }
}
