/* Оформление по фирменному стилю: тёплая кремовая бумага, чёрный текст,
   кнопки-пилюли, тонкие линии вместо теней. Тема одна — светлая.
   Шрифт лежит рядом, из интернета ничего не тянется. */

@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --eggshell: #fdfcfc;
  --taupe: #f5f3f1;
  --stone: #ebe8e4;
  --ink: #000000;
  --graphite: #44403b;
  --smoke: #777169;
  --ash: #a59f97;
  --ember: #ff4704;
  --violet: #0447ff;

  --ok: #2f7d4f;
  --warn: #9a6a00;

  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius-card: 20px;
  --radius-input: 4px;
  --page: 1280px;
}

/* Тёмная тема: те же роли цветов, только вывернутые. Ничего, кроме этих
   переменных, менять не нужно — весь интерфейс завязан на них.
   Главное правило: на залитых элементах текст берёт цвет страницы (--eggshell),
   а не жёсткий белый, иначе на светлой плашке он исчезает. */
:root[data-theme="dark"] {
  --eggshell: #161514;
  --taupe: #1e1d1b;
  --stone: #2e2c29;
  --ink: #f2efec;
  --graphite: #cdc7c0;
  --smoke: #9a938a;
  --ash: #6d665e;
  --ok: #4e9d6d;
  --ember: #ff6a37;
}
:root[data-theme="dark"] .toast { box-shadow: none; }
/* Обычные кнопки в тёмной теме слегка подсвечены, чтобы не сливались с фоном.
   ВАЖНО: у селектора с :not специфичность выше, чем у одиночного класса,
   поэтому здесь перечислены все «особенные» кнопки. Иначе это правило
   перекрашивает выделенные элементы в цвет фона, и текст на них пропадает —
   ровно так активный пункт меню становился тёмным на тёмном. */
:root[data-theme="dark"] button:not(.primary):not(.ghost):not(.nav-item):not(.on):not(.style-pick):not(.day) {
  background: var(--taupe);
}
:root[data-theme="dark"] button:not(.primary):not(.ghost):not(.nav-item):not(.on):not(.style-pick):not(.day):hover {
  background: var(--stone);
}
:root[data-theme="dark"] button.primary { background: var(--ink); color: var(--eggshell); }
:root[data-theme="dark"] button.primary:hover { background: var(--ink); opacity: .85; }
:root[data-theme="dark"] .step-num { color: var(--eggshell); }

/* Всё выделенное: заливка цветом текста, надпись цветом страницы.
   Здесь !important намеренно. Правил, влияющих на кнопки, много (базовые,
   тематические, с :not), и они по специфичности перебивали выделение —
   активный пункт меню становился тёмным на тёмном. Один жёсткий приоритет
   на «выделенное состояние» надёжнее, чем гонка селекторов. */
.nav-item.active, .topic-pick.on, .theme-switch button.on, .day.on,
.style-card.on .style-foot, .step-chip.now span {
  background: var(--ink) !important;
  color: var(--eggshell) !important;
}
.nav-item.active b { color: var(--eggshell) !important; opacity: .55; }
.step-chip.ready span { background: var(--ok) !important; color: var(--eggshell) !important; }
:root[data-theme="dark"] input[type=text], :root[data-theme="dark"] input[type=password],
:root[data-theme="dark"] input[type=time], :root[data-theme="dark"] input[type=number],
:root[data-theme="dark"] input[type=datetime-local], :root[data-theme="dark"] input[type=file],
:root[data-theme="dark"] select, :root[data-theme="dark"] textarea {
  background: var(--taupe); color: var(--ink); border-color: var(--stone);
}
:root[data-theme="dark"] .tag { background: var(--taupe); }
:root[data-theme="dark"] .step-chip { background: var(--taupe); }
:root[data-theme="dark"] .pub-topics { background: var(--taupe); }
:root[data-theme="dark"] .add-box { background: var(--taupe); }
:root[data-theme="dark"] .photo button { background: var(--taupe); }
/* Календарь и часы в тёмной теме рисуются светлыми. */
:root[data-theme="dark"] input[type=time]::-webkit-calendar-picker-indicator,
:root[data-theme="dark"] input[type=datetime-local]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(.7);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--eggshell);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 300; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: 36px; line-height: 1.17; }
h2 { font-size: 26px; line-height: 1.2; }
h3 { font-size: 18px; letter-spacing: 0; font-weight: 500; }

p { margin: 0 0 12px; }
a { color: var(--ink); }

.muted { color: var(--smoke); }
.tiny { font-size: 13px; color: var(--smoke); }
/* Напоминание о временном пароле. Висит на каждой странице и не закрывается:
   пароль одинаковый у всех установок, и человек должен об этом помнить. */
.pass-notice {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin: 0 0 18px; padding: 14px 16px; border-radius: 14px;
  background: #fff2d6; color: #6b4b00; font-size: 14px; line-height: 1.5;
  border: 1px solid #f0d391;
}
.pass-notice div { flex: 1; min-width: 240px; }

/* Замечание, которое не мешает работать, но человек должен его увидеть:
   например, «с ютуба берутся только названия» из-за незаполненного ключа. */
.warn-note {
  font-size: 13px; line-height: 1.5; margin: 12px 0 4px; padding: 10px 12px;
  border-radius: 10px; background: #fff6e0; color: #6b4b00;
}
.faint { font-size: 13px; color: var(--ash); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }

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

.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 240px;
  flex: 0 0 240px;
  border-right: 1px solid var(--stone);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.logo { font-size: 17px; font-weight: 500; letter-spacing: -0.01em; padding: 0 12px 20px; }

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  font: inherit;
  color: var(--graphite);
  padding: 9px 12px;
  border-radius: 9999px;
  cursor: pointer;
  margin-bottom: 2px;
}
.nav-item:hover { background: var(--taupe); }
.nav-item.active { background: var(--ink); color: var(--eggshell); }

.nav-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--ash); padding: 18px 12px 6px; }

.main { flex: 1; padding: 32px 40px 80px; max-width: var(--page); }

.head { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 24px; flex-wrap: wrap; }

/* --- карточки --- */

.card {
  background: var(--taupe);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 16px;
}
.card.plain { background: var(--eggshell); border: 1px solid var(--stone); }
.card-title { font-size: 17px; font-weight: 500; margin-bottom: 4px; }
.card-sub { font-size: 13px; color: var(--smoke); margin-bottom: 16px; }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.tight { gap: 8px; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.stack > * + * { margin-top: 12px; }

hr.hair { border: 0; border-top: 1px solid var(--stone); margin: 20px 0; }

/* --- элементы управления --- */

button {
  font: inherit;
  font-weight: 500;
  font-size: 14px;
  border-radius: 9999px;
  padding: 9px 18px;
  border: 1px solid var(--stone);
  background: var(--eggshell);
  color: var(--ink);
  cursor: pointer;
  transition: background .15s, opacity .15s;
}
button:hover { background: var(--stone); }
button.primary { background: var(--ink); color: var(--eggshell); border-color: var(--ink); }
button.primary:hover { opacity: .85; background: var(--ink); }
button.ghost { background: none; border-color: transparent; color: var(--smoke); }
button.ghost:hover { background: var(--taupe); color: var(--ink); }
button.small { padding: 5px 12px; font-size: 13px; }
button:disabled { opacity: .45; cursor: default; }

input[type=text], input[type=password], input[type=time], input[type=number], select, textarea {
  font: inherit;
  font-size: 14px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--stone);
  border-radius: var(--radius-input);
  background: var(--eggshell);
  color: var(--ink);
}
textarea { min-height: 90px; resize: vertical; line-height: 1.55; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--graphite); }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; color: var(--graphite); margin-bottom: 6px; }
label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
label.check input { width: auto; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: 9999px; padding: 4px 12px; font-size: 13px;
  background: var(--eggshell); border: 1px solid var(--stone); color: var(--graphite);
}

/* --- статусы проверки подключений --- */

.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; display: inline-block; }
.dot.ok { background: var(--ok); }
.dot.not_set { background: var(--ash); }
.dot.bad_key, .dot.service_down, .dot.no_money { background: var(--ember); }

.check-item { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--stone); }
.check-item:last-child { border-bottom: 0; }
.check-item .dot { margin-top: 7px; }

/* --- список тем, каналов, журнала --- */

.list-item {
  display: flex; justify-content: space-between; gap: 12px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--stone);
}
.list-item:last-child { border-bottom: 0; }

.log-line { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--stone); font-size: 14px; }
.log-line:last-child { border-bottom: 0; }
.log-line .when { color: var(--ash); font-size: 12px; white-space: nowrap; padding-top: 2px; }

/* --- выбор проекта в шапке меню --- */

/* Селектор во всю ширину: длинные имена проектов не должны обрезаться. */
.project-picker { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 8px; }
.project-picker select { width: 100%; }
.project-picker button { width: 100%; }

/* Подвал сайдбара: часы, баланс и выбор темы. */
.side-foot { margin-top: 20px; padding: 16px 12px 6px; border-top: 1px solid var(--stone);
  display: flex; flex-direction: column; gap: 12px; }
.side-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.side-top #clock { font-size: 18px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.side-top .faint { font-size: 11px; }

.balance-box { line-height: 1.35; }
.balance-box .faint { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.balance-box #side-balance { font-size: 15px; color: var(--graphite); }

/* Переключатель темы — две половины во всю ширину, активная залита. */
.theme-switch { display: flex; gap: 6px; }
.theme-switch button { flex: 1; padding: 9px 6px; font-size: 12px; white-space: nowrap; }
.theme-switch button.on { background: var(--ink); color: var(--eggshell); border-color: var(--ink); }

.nav-item b { display: inline-block; width: 18px; color: var(--ash); font-weight: 500; }
.nav-item.active b { color: var(--eggshell); opacity: .55; }

/* --- полоска шагов настройки --- */

.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.step-chip {
  display: inline-flex; align-items: center; gap: 8px;
  border-radius: 9999px; padding: 7px 16px 7px 8px; font-size: 13px;
  background: var(--eggshell); border: 1px solid var(--stone); color: var(--smoke);
}
.step-chip span {
  width: 20px; height: 20px; border-radius: 50%; background: var(--stone);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--graphite);
}
.step-chip.ready span { background: var(--ok); color: var(--eggshell); }
.step-chip.now { border-color: var(--ink); color: var(--ink); }
.step-chip:hover { background: var(--taupe); }

.next { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--stone); }

/* --- канал с расписанием --- */

.channel { padding: 16px 0; border-bottom: 1px solid var(--stone); }
.channel:last-child { border-bottom: 0; }
.channel details { margin-top: 12px; }
.channel details summary { cursor: pointer; color: var(--smoke); }
.channel details[open] summary { margin-bottom: 4px; }

.days-row { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.day { padding: 5px 11px; font-size: 12px; min-width: 40px; }
.day.on { background: var(--ink); color: var(--eggshell); border-color: var(--ink); }
:root[data-theme="dark"] .day.on { background: var(--ink); color: var(--eggshell); }

.slot-card { border: 1px solid var(--stone); border-radius: 12px; padding: 14px;
  margin-bottom: 8px; background: var(--eggshell); }
:root[data-theme="dark"] .slot-card { background: var(--taupe); }
.slot-card input[type=time] { width: 96px; }

.slots { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.slots > .tiny { width: 100%; }
.slot {
  display: inline-flex; align-items: center; gap: 10px;
  border: 1px solid var(--stone); border-radius: 9999px; padding: 4px 6px 4px 12px;
  background: var(--eggshell);
}
.slot input[type=time] { width: 96px; border: 0; background: none; padding: 0; font-size: 14px; }
.slot label.check { font-size: 13px; color: var(--graphite); white-space: nowrap; }

.add-box { background: var(--eggshell); border: 1px solid var(--stone);
  border-radius: 12px; padding: 14px; margin-bottom: 14px; }

.tag.warn { border-color: var(--ember); color: var(--ember); }

.photo { position: relative; width: 88px; height: 88px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--stone); }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo button { position: absolute; top: 2px; right: 2px; padding: 2px 7px; font-size: 12px;
  background: var(--eggshell); border-radius: 9999px; }

.pub-topics { display: flex; flex-direction: column; max-height: 300px; overflow-y: auto;
  border: 1px solid var(--stone); border-radius: 12px; padding: 4px; background: var(--eggshell); }
/* Между темами нужна линия: без неё список читается как сплошное полотно. */
.topic-pick { text-align: left; border: 0; border-bottom: 1px solid var(--stone); border-radius: 8px;
  padding: 11px 12px; font-size: 14px; font-weight: 400; line-height: 1.45;
  display: flex; flex-direction: column; gap: 3px; }
.topic-pick:last-child { border-bottom: 0; }
.topic-pick:hover { background: var(--taupe); }
.topic-pick.on { background: var(--ink); color: var(--eggshell); }
.topic-pick.on .faint { color: var(--eggshell); opacity: .6; }

/* Отдельный раздел: крупный пример слева, промт справа. */
.style-row { display: flex; gap: 20px; align-items: flex-start; padding: 18px;
  border: 1px solid var(--stone); border-radius: var(--radius-card); margin-bottom: 14px;
  background: var(--eggshell); }
.style-row.on { border-color: var(--ink); border-width: 2px; }
.style-row img { width: 220px; height: 220px; object-fit: cover; border-radius: 14px;
  flex: 0 0 220px; display: block; }
.style-row .style-empty { width: 220px; height: 220px; flex: 0 0 220px; border-radius: 14px; }
.style-body { flex: 1; min-width: 0; }
.style-text { font-size: 14px; color: var(--smoke); line-height: 1.5; margin-top: 6px; }

@media (max-width: 720px) {
  .style-row { flex-direction: column; }
  .style-row img, .style-row .style-empty { width: 100%; height: auto; aspect-ratio: 1; flex: none; }
}

/* Галерея стилей: выбираем картинкой, а не описанием. */
.style-gallery { display: grid; gap: 10px; margin-bottom: 16px;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); }
.style-card { border-radius: 12px; overflow: hidden; border: 1px solid var(--stone);
  background: var(--eggshell); display: flex; flex-direction: column; }
.style-card:hover { border-color: var(--graphite); }
.style-card.on { border-color: var(--ink); border-width: 2px; }
.style-pick { padding: 0; border: 0; border-radius: 0; background: none; display: block; }
.style-card img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; }
.style-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px;
  padding: 6px 4px 6px 9px; font-size: 12px; line-height: 1.25; }
.style-foot button { padding: 2px 7px; font-size: 13px; }
.style-card.on .style-foot { background: var(--ink); color: var(--eggshell); }
.style-card.on .style-foot button { color: var(--eggshell); }
.style-empty { aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  background: var(--taupe); color: var(--ash); font-size: 11px; text-align: center; }

.task { padding: 12px 0; border-bottom: 1px solid var(--stone); }
.task:last-child { border-bottom: 0; }

.warn-box { border: 1px solid var(--stone); border-left: 3px solid var(--ember);
  border-radius: 12px; padding: 12px 16px; margin-bottom: 16px;
  font-size: 14px; color: var(--graphite); background: var(--eggshell); }

/* --- уведомления --- */

.toast-host { position: fixed; right: 24px; bottom: 24px; z-index: 50;
  display: flex; flex-direction: column; gap: 10px; max-width: 420px; }
.toast {
  background: var(--eggshell); border: 1px solid var(--stone); border-radius: 16px;
  padding: 14px 16px; box-shadow: rgba(0,0,0,.4) 0 0 1px 0, rgba(0,0,0,.04) 0 2px 4px 0;
}
.toast .t-title { font-weight: 500; margin-bottom: 2px; }
.toast .t-hint { font-size: 13px; color: var(--smoke); }
.toast.err { border-left: 3px solid var(--ember); }
.toast.good { border-left: 3px solid var(--ok); }

/* --- мастер первого запуска --- */

.wizard { max-width: 620px; margin: 60px auto; }
.step { display: flex; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--stone); }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--eggshell);
  display: flex; align-items: center; justify-content: center; font-size: 13px; flex: 0 0 26px; }
.step.done .step-num { background: var(--ok); }
.step.todo .step-num { background: var(--stone); color: var(--smoke); }

/* --- прочее --- */

.empty { padding: 28px; text-align: center; color: var(--smoke); }
.post-preview { white-space: pre-wrap; line-height: 1.55; }
.post-preview img { max-width: 100%; border-radius: 12px; margin-bottom: 10px; }
.spinner { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--ash);
  border-top-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }

/* В узком окне меню превращается в ленту кнопок сверху, а не в простыню
   на весь экран — иначе содержимое уезжает под сгиб. */
@media (max-width: 860px) {
  .layout { flex-direction: column; }
  .sidebar { width: 100%; flex: none; height: auto; position: static;
    border-right: 0; border-bottom: 1px solid var(--stone); display: flex;
    flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px; }
  .logo { width: 100%; padding: 2px 4px 8px; font-size: 15px; }
  .nav-group { display: none; }
  .nav-item { width: auto; display: inline-block; padding: 7px 14px; font-size: 14px; }
  .sidebar label.field { margin: 0 8px 0 0; max-width: 200px; }
  .sidebar label.field > span { display: none; }
  .main { padding: 20px 16px 60px; }
  h1 { font-size: 28px; }
  .head { margin-bottom: 16px; }
}

/* Проблемы в «Диагностике»: видно с порога, не спутать с обычной карточкой. */
.alert-box {
  background: color-mix(in srgb, var(--ember) 8%, var(--taupe));
  border: 1px solid color-mix(in srgb, var(--ember) 45%, var(--stone));
}
.ok-box {
  background: color-mix(in srgb, var(--ok) 7%, var(--taupe));
  border: 1px solid color-mix(in srgb, var(--ok) 35%, var(--stone));
}
.alert-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 0; border-top: 1px solid color-mix(in srgb, var(--ember) 25%, var(--stone));
}
.alert-item:first-of-type { margin-top: 8px; }
.what-to-do { color: var(--graphite); margin-top: 4px; }

.nav-badge { display: none; }
.nav-badge.on {
  display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: var(--ember); color: #fff;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 600;
}

/* Плитки с цифрами в «Диагностике»: сколько сделано и сколько потрачено. */
.stat {
  flex: 1; min-width: 120px; padding: 12px 14px;
  background: var(--eggshell); border: 1px solid var(--stone); border-radius: 14px;
}
.stat b { display: block; font-size: 22px; font-weight: 500; line-height: 1.2; }
.stat span { font-size: 12px; color: var(--smoke); }
.usage-list { max-height: 320px; overflow-y: auto; }

/* Экран входа: ничего лишнего, одно поле. */
#lock {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: var(--eggshell); padding: 24px;
}
.lock-box {
  width: 100%; max-width: 420px; padding: 32px;
  background: var(--taupe); border-radius: var(--radius-card);
}
.lock-title { font-size: 22px; font-weight: 500; margin-bottom: 6px; }

/* ------------------------------------------------------------------ телефон
   Одна колонка, меню выезжает по кнопке. Размеры полей и кнопок — под палец:
   меньше 44 точек в высоту попадать неудобно, а шрифт мельче 16 заставляет
   айфон зумить страницу при вводе. */

.burger, .screen-fade { display: none; }

@media (max-width: 860px) {
  .layout { display: block; }

  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
    width: 280px; max-width: 84vw; overflow-y: auto;
    /* Меню выезжает поверх страницы, поэтому фон обязателен: на десктопе он
       не нужен (там колонка на своём месте), а здесь без него видно текст под ним. */
    background: var(--eggshell);
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 0 0 40px rgba(0, 0, 0, .18);
  }
  body.menu-open .sidebar { transform: translateX(0); }

  .burger {
    display: flex; align-items: center; justify-content: center;
    position: fixed; top: 12px; left: 12px; z-index: 50;
    width: 44px; height: 44px; padding: 0; font-size: 20px; line-height: 1;
    border-radius: 14px; background: var(--ink); color: var(--eggshell); border: 0;
  }
  body.menu-open .burger { left: auto; right: 12px; }

  .screen-fade {
    position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .35);
  }
  body.menu-open .screen-fade { display: block; }

  .main { padding: 68px 16px 40px; max-width: none; }
  .head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .head h1 { font-size: 24px; }

  .card { padding: 18px; border-radius: 16px; }
  .grid { grid-template-columns: 1fr; }

  /* Поля на всю ширину: две штуки в ряд на телефоне не читаются. */
  .row > input[type="text"], .row > input[type="password"], .row > input[type="number"],
  .row > input[type="file"], .row > select, .row > textarea, .field, .row > .field {
    flex: 1 1 100% !important; min-width: 0 !important; max-width: none !important;
  }
  input, select, textarea, button { font-size: 16px; }
  input[type="text"], input[type="password"], input[type="number"], input[type="time"],
  input[type="datetime-local"], select { min-height: 44px; }
  /* Ответы в анкете и тексты постов на телефоне надо видеть, а не подглядывать в щёлку. */
  textarea { min-height: 120px; }
  button { min-height: 42px; }
  .row > button { flex: 1 1 auto; }
  .row.tight > button, button.small, button.ghost { flex: 0 0 auto; min-height: 38px; }

  /* Широкое содержимое не должно распирать страницу — пусть листается внутри себя. */
  table, pre, .post-preview { max-width: 100%; overflow-x: auto; }
  .days-row { flex-wrap: wrap; }
  .day { min-width: 40px; }

  .steps { overflow-x: auto; padding-bottom: 4px; }
  .step-chip { flex: 0 0 auto; }

  .stat { min-width: calc(50% - 6px); }
  .photo img { width: 84px; height: 84px; }
  .slot-card { padding: 14px; }
  .toast-host { left: 12px; right: 12px; bottom: 12px; }
  .toast { max-width: none; }
}

/* Полоска «режим просмотра». Живёт отдельно от содержимого раздела: если рисовать
   её внутри, она пропадёт при первой же перерисовке. */
.mode-banner { display: none; }
body.support-mode .mode-banner {
  display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  padding: 10px 16px; text-align: center; font-size: 13px;
  background: var(--ink); color: var(--eggshell);
}
body.support-mode .main { padding-bottom: 64px; }

/* Инструкция: обычный текст, который читают, а не интерфейс. */
.guide-item { padding: 14px 18px; margin-bottom: 10px; }
.guide-item summary { cursor: pointer; font-size: 15px; }
.guide-text { font-size: 14px; line-height: 1.62; color: var(--graphite); margin-top: 10px; }
.guide-text p { margin: 0 0 10px; }
.guide-text ul, .guide-text ol { margin: 0 0 10px; padding-left: 20px; }
.guide-text li { margin-bottom: 5px; }
.guide-text code {
  background: var(--stone); padding: 2px 6px; border-radius: 6px; font-size: 13px;
}

#signout { font-size: 12px; color: var(--smoke); padding: 6px 12px; margin-bottom: 8px; }

body.support-mode .mode-banner a { color: var(--eggshell); text-decoration: underline; margin-left: 8px; }

/* Инструкция по DNS: две колонки, чтобы значения было легко переписать. */
.dns-row {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 6px 0; border-bottom: 1px solid var(--stone); font-size: 13px;
}
.dns-row > span:first-child { min-width: 160px; color: var(--smoke); }
.dns-row b { font-size: 14px; }

/* Кончающийся баланс должно быть видно из любого раздела: без кредитов сервис молча встанет. */
.low-balance { font-size: 11px; color: var(--ember); margin-top: 2px; }
