/* ct-admin — без сборки и внешних шрифтов. Цвета — токены, тёмная тема по настройке системы. */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --border: #e2e5ea;
  --border-strong: #cdd2da;
  --text: #1b1f27;
  --text-2: #5b6372;
  --text-3: #8a93a3;
  --accent: #3a5bd9;
  --accent-hover: #2f4cc0;
  --accent-soft: #e8edfc;
  --on-accent: #ffffff;
  --ok: #1d7a4f;
  --ok-soft: #e3f4ea;
  --warn: #9a6200;
  --warn-soft: #fdf1dc;
  --danger: #c0352b;
  --danger-soft: #fbe7e5;
  --info: #3a5bd9;
  --info-soft: #e8edfc;
  --focus: 0 0 0 3px rgba(58, 91, 217, .28);
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --surface: #171b23;
    --surface-2: #1e232d;
    --border: #2a303b;
    --border-strong: #3a4250;
    --text: #e6e9ef;
    --text-2: #a4acba;
    --text-3: #747d8c;
    --accent: #7d97f5;
    --accent-hover: #93a9f7;
    --accent-soft: #232c47;
    --on-accent: #0f1218;
    --ok: #5fcf96;
    --ok-soft: #173326;
    --warn: #f0b75a;
    --warn-soft: #3a2d14;
    --danger: #f2837a;
    --danger-soft: #3d1f1d;
    --info: #7d97f5;
    --info-soft: #232c47;
    --focus: 0 0 0 3px rgba(125, 151, 245, .35);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; }
h1, h2, h3 { line-height: 1.25; margin: 0; }
p { margin: 0 0 .75rem; }
.muted { color: var(--text-2); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* --- Шапка ---------------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.topbar__inner {
  max-width: 1160px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 28px; height: 56px;
}
.brand {
  display: inline-flex; align-items: center; gap: 9px;
  font-weight: 650; letter-spacing: -.01em; color: var(--text); font-size: 1.02rem;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 18px; height: 18px; border-radius: 5px;
  background: linear-gradient(135deg, var(--accent) 0 50%, var(--ok) 50% 100%);
}
.nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav__link {
  padding: 7px 12px; border-radius: var(--radius-sm);
  color: var(--text-2); white-space: nowrap; font-weight: 500;
}
.nav__link:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav__link.is-active { background: var(--accent-soft); color: var(--accent); }
.account { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account form { margin: 0; }
.account__email { color: var(--text-2); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 220px; }

/* --- Страница ------------------------------------------------------------------- */
.page { max-width: 1160px; margin: 0 auto; padding: 28px 24px 64px; }
.page__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.page__title { font-size: 1.55rem; font-weight: 650; letter-spacing: -.015em; margin-bottom: 4px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.crumbs { color: var(--text-3); font-size: .88rem; margin-bottom: 8px; }
.crumbs a { color: var(--text-2); }

/* --- Панели и карточки ---------------------------------------------------------- */
.panel {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 22px; margin-bottom: 20px;
}
.panel--narrow { max-width: 640px; }
.panel__title { font-size: 1.05rem; font-weight: 620; margin-bottom: 14px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.grid-2 > .panel { margin-bottom: 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 14px;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card__title { font-size: 1.05rem; font-weight: 620; }
.card__title a { color: var(--text); }
.card__placeholder {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text-3); font-size: .85rem;
}
.card__foot { margin-top: auto; display: flex; justify-content: flex-end; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); flex: none; }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: .9rem; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.tag {
  display: inline-block; padding: 1px 7px; border-radius: 5px;
  background: var(--surface-2); color: var(--text-2); font-size: .78rem; font-weight: 500;
}
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 2px 9px; border-radius: 999px; font-size: .8rem; font-weight: 560; white-space: nowrap;
}
.badge--ok { background: var(--ok-soft); color: var(--ok); }
.badge--warn { background: var(--warn-soft); color: var(--warn); }
.badge--info { background: var(--info-soft); color: var(--info); }

.stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stages__item {
  display: grid; grid-template-columns: 220px 1fr; gap: 14px; align-items: baseline;
  padding: 10px 12px 10px 30px; border-radius: var(--radius-sm); position: relative; color: var(--text-2);
}
.stages__item::before {
  content: ""; position: absolute; left: 10px; top: 17px;
  width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--surface);
}
.stages__item strong { color: var(--text); font-weight: 600; }
.stages__item.is-done::before { background: var(--ok); border-color: var(--ok); }
.stages__item.is-next { background: var(--accent-soft); }
.stages__item.is-next::before { border-color: var(--accent); }

.checklist { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--text-2); }
.upcoming .badge { margin-bottom: 12px; }

/* --- Таблицы -------------------------------------------------------------------- */
.table-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow-x: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th {
  text-align: left; font-weight: 560; color: var(--text-3); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em;
  padding: 11px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table__actions { text-align: right; white-space: nowrap; }
.details { font-family: var(--mono); font-size: .78rem; color: var(--text-2); max-width: 420px; overflow-wrap: anywhere; }
.empty { color: var(--text-3); text-align: center; padding: 28px !important; }

/* --- Формы ---------------------------------------------------------------------- */
.form { display: grid; gap: 16px; margin: 0; }
.field { display: grid; gap: 6px; }
.field__label { font-size: .85rem; font-weight: 560; color: var(--text); }
.field__hint { font-size: .8rem; color: var(--text-3); }
.field__error { font-size: .8rem; color: var(--danger); }
.field.has-error .input { border-color: var(--danger); }
.fieldset { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px 14px; margin: 0; display: grid; gap: 12px; }
.fieldset legend { padding: 0 6px; font-size: .8rem; color: var(--text-3); font-weight: 560; }
.input {
  width: 100%; padding: 9px 11px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }
.input.input--mono { font-family: var(--mono); font-size: .86rem; }
.input::placeholder { color: var(--text-3); }
.form__actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form__actions form { margin: 0; }
.form__actions--split { justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }

.keystate { display: flex; align-items: center; gap: 10px; margin: 4px 0 16px; }
.keystate__mask { color: var(--text-2); }

/* --- Кнопки --------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font: inherit; font-weight: 560; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .12s, border-color .12s, color .12s;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--secondary { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--secondary:hover { background: var(--surface-2); }
.btn--ghost { background: transparent; color: var(--text-2); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn--danger-ghost { background: transparent; color: var(--danger); }
.btn--danger-ghost:hover { background: var(--danger-soft); }
.btn--sm { padding: 5px 11px; font-size: .85rem; }
.btn--block { width: 100%; }
.link { font-weight: 560; }

/* --- Сообщения ------------------------------------------------------------------ */
.alert { padding: 10px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; font-size: .9rem; border: 1px solid transparent; }
.alert--ok { background: var(--ok-soft); color: var(--ok); }
.alert--error { background: var(--danger-soft); color: var(--danger); }

/* --- Вход ----------------------------------------------------------------------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px 16px; }
.auth__card {
  width: 100%; max-width: 400px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(16, 24, 40, .07); padding: 30px 28px;
}
.brand--auth { margin-bottom: 22px; }
.auth__title { font-size: 1.35rem; font-weight: 650; margin-bottom: 12px; letter-spacing: -.01em; }
.auth__links { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; font-size: .9rem; flex-wrap: wrap; }
.auth__foot { color: var(--text-3); font-size: .8rem; margin-top: 18px; text-align: center; }

/* --- Статусы (значок + подпись, цвет не единственный носитель) ------------------- */
.status {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
  padding: 2px 9px 2px 3px; border-radius: 999px; font-size: .8rem; font-weight: 560;
}
.status__icon {
  width: 17px; height: 17px; border-radius: 50%; display: inline-grid; place-items: center;
  font-size: .72rem; font-weight: 700; color: var(--surface);
}
.status--ok { background: var(--ok-soft); color: var(--ok); }
.status--ok .status__icon { background: var(--ok); }
.status--warn { background: var(--warn-soft); color: var(--warn); }
.status--warn .status__icon { background: var(--warn); }
.status--error { background: var(--danger-soft); color: var(--danger); }
.status--error .status__icon { background: var(--danger); }
.status--na { background: var(--surface-2); color: var(--text-3); }
.status--na .status__icon { background: var(--border-strong); }

/* --- Вкладки, панель инструментов, переключатель периода -------------------------- */
.page__head--tabs { margin-bottom: 10px; }
.page__actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.tabs__item {
  padding: 9px 14px; color: var(--text-2); font-weight: 560; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs__item:hover { color: var(--text); text-decoration: none; }
.tabs__item.is-active { color: var(--accent); border-bottom-color: var(--accent); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel__head .panel__title { margin-bottom: 0; }
.panel__title .small { font-weight: 400; margin-left: 6px; }
.segmented { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-sm); padding: 3px; gap: 2px; }
.segmented__item { padding: 4px 11px; border-radius: 5px; color: var(--text-2); font-size: .85rem; font-weight: 560; }
.segmented__item:hover { color: var(--text); text-decoration: none; }
.segmented__item.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.alert--warn { background: var(--warn-soft); color: var(--warn); }

/* --- KPI ------------------------------------------------------------------------ */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.kpi {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px 18px; min-width: 0;
}
.kpi__label { color: var(--text-2); font-size: .85rem; margin-bottom: 6px; }
.kpi__value { font-size: 1.75rem; font-weight: 640; letter-spacing: -.02em; line-height: 1.15; }
.kpi__value--empty { color: var(--text-3); }
.kpi__note { color: var(--text-3); font-size: .82rem; margin-top: 8px; min-height: 1.4em; }

.minis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini { display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.mini__label { color: var(--text-3); font-size: .76rem; }
.mini__value { font-weight: 620; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card__error { color: var(--danger); background: var(--danger-soft); border-radius: var(--radius-sm); padding: 8px 10px; font-size: .82rem; overflow-wrap: anywhere; }
.card__foot { gap: 16px; }

/* --- Проверки ------------------------------------------------------------------- */
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.checks__item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.checks__item:last-child { border-bottom: 0; padding-bottom: 0; }
.checks__item:first-child { padding-top: 0; }
.checks__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.checks__text { margin: 6px 0 0; color: var(--text-2); }
.checks__details { margin-top: 6px; font-size: .88rem; color: var(--text-2); }
.checks__details summary { cursor: pointer; color: var(--accent); }
.checks__details ul { margin: 6px 0 0; padding-left: 20px; }
.checks--compact { gap: 6px; }
.checks--compact li { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.checks__brief { color: var(--text-2); font-size: .82rem; padding-left: 4px; }

/* --- Столбики «звонки по дням» --------------------------------------------------- */
.bars { display: grid; grid-template-columns: auto 1fr; grid-template-rows: 160px auto; gap: 4px 10px; }
.bars__axis {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end;
  color: var(--text-3); font-size: .75rem; font-variant-numeric: tabular-nums;
}
.bars__plot {
  display: flex; align-items: flex-end; gap: 2px; height: 160px;
  border-bottom: 1px solid var(--border-strong);
  background: linear-gradient(to bottom, var(--border) 1px, transparent 1px) top / 100% 50%;
}
.bars__col { flex: 1; height: 100%; display: flex; align-items: flex-end; position: relative; cursor: default; outline: none; }
.bars__bar { width: 100%; background: var(--accent); border-radius: 4px 4px 0 0; }
.bars__col:hover .bars__bar, .bars__col:focus-visible .bars__bar { background: var(--accent-hover); }
.bars__col:hover::after, .bars__col:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--surface); font-size: .78rem; padding: 5px 8px; border-radius: 6px;
  white-space: nowrap; z-index: 5; pointer-events: none;
}
.bars__col:first-child:hover::after, .bars__col:first-child:focus-visible::after { left: 0; transform: none; }
.bars__col:last-child:hover::after, .bars__col:last-child:focus-visible::after { left: auto; right: 0; transform: none; }
.bars__labels { grid-column: 2; display: flex; justify-content: space-between; color: var(--text-3); font-size: .75rem; }

/* --- Календарь статусов дат ------------------------------------------------------ */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__wd { color: var(--text-3); font-size: .75rem; text-align: center; padding-bottom: 2px; }
.cal__day {
  min-height: 62px; border-radius: var(--radius-sm); padding: 6px 8px; display: grid;
  grid-template-columns: 1fr auto; grid-template-rows: auto 1fr; gap: 2px 4px; font-size: .78rem;
  border: 1px solid transparent;
}
.cal__num { font-weight: 640; font-size: .9rem; }
.cal__icon { font-weight: 700; justify-self: end; }
.cal__calls { grid-column: 1 / -1; align-self: end; color: var(--text-2); }
.cal__dup { color: var(--danger); font-weight: 650; }
.cal__day--ok { background: var(--ok-soft); }
.cal__day--ok .cal__icon { color: var(--ok); }
.cal__day--partial { background: var(--warn-soft); }
.cal__day--partial .cal__icon { color: var(--warn); }
.cal__day--failed { background: var(--danger-soft); }
.cal__day--failed .cal__icon { color: var(--danger); }
.cal__day--empty { background: var(--surface-2); }
.cal__day--empty .cal__icon { color: var(--text-3); }
.cal__day--data { background: var(--surface-2); }
.cal__day--data .cal__icon { color: var(--text-2); }
.cal__day--none { border: 1px dashed var(--border-strong); color: var(--text-3); }
.legend { list-style: none; display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 0; padding: 0; color: var(--text-2); font-size: .82rem; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.cal__chip { width: 20px; height: 20px; border-radius: 5px; display: inline-grid; place-items: center; font-size: .72rem; font-weight: 700; }
.cal__chip.cal__day--ok { color: var(--ok); }
.cal__chip.cal__day--partial { color: var(--warn); }
.cal__chip.cal__day--failed { color: var(--danger); }

/* --- Таблицы с числами ----------------------------------------------------------- */
.table-wrap--flat { box-shadow: none; }
.table--num td { font-variant-numeric: tabular-nums; }
.table__sub td { background: var(--surface-2); padding-top: 6px; padding-bottom: 8px; }
.table__sub summary { cursor: pointer; color: var(--danger); font-size: .85rem; }
.errors { margin: 6px 0 0; padding-left: 18px; font-family: var(--mono); font-size: .78rem; color: var(--text-2); overflow-wrap: anywhere; }

/* --- Отчёты и промпты ------------------------------------------------------------ */
.status--info { background: var(--info-soft); color: var(--info); }
.status--info .status__icon { background: var(--info); }
.form--inline { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; align-items: end; }
.form__note { margin: 12px 0 0; }
select.input { appearance: auto; }
.hints { margin: 12px 0 0; padding-left: 18px; color: var(--text-2); font-size: .88rem; display: grid; gap: 4px; }
.kv--wide { grid-template-columns: 150px 1fr; }
.grid-2--wide { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.prompt-editor { min-height: 420px; resize: vertical; line-height: 1.45; white-space: pre-wrap; }
.versions { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 640px; overflow: auto; }
.versions__item { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.versions__item.is-active { border-color: var(--ok); }
.versions__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 560; }
.versions__comment { margin-top: 4px; font-size: .88rem; color: var(--text-2); overflow-wrap: anywhere; }

/* --- Пайплайн ------------------------------------------------------------------- */
.readonly { padding: 9px 11px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text-2); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; color: var(--text-2); cursor: pointer; }
.check input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--accent); }
.form--run { grid-template-columns: minmax(0, 260px) auto; margin-bottom: 14px; }
pre.errors { white-space: pre-wrap; margin: 6px 0 0; max-height: 320px; overflow: auto; }
.compare { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.compare__col { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; min-width: 0; }
.compare__col h3 { font-size: .9rem; margin-bottom: 8px; color: var(--text-2); }
.compare__col pre { white-space: pre-wrap; margin: 0; font-family: var(--mono); font-size: .82rem; overflow-wrap: anywhere; }

/* --- Узкие экраны --------------------------------------------------------------- */
@media (max-width: 860px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2--wide, .form--inline, .field-row, .compare { grid-template-columns: minmax(0, 1fr); }
  .stages__item { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 640px) {
  .topbar__inner { padding: 0 16px; gap: 14px; height: auto; min-height: 56px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .nav { order: 3; flex-basis: 100%; }
  .account { margin-left: auto; }
  .account__email { display: none; }
  .page { padding: 20px 16px 48px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 18px 16px; }
  .cal { gap: 3px; }
  .cal__day { min-height: 48px; padding: 4px 5px; }
  .cal__calls { font-size: .68rem; }
  .minis { grid-template-columns: minmax(0, 1fr); }
}
