/* Площадка публикации «Свои».

   Фирменный мир магазина: светло-серая студийная подложка, почти чёрный
   жирный Montserrat, неоново-салатовый акцент со свечением и вертикальная
   надпись на белой полосе у правого края. Тема одна — светлая: у бренда
   тёмной нет, и площадка её не выдумывает.

   Салатовый — только заливка под чёрным текстом. Текстом на белом он не
   читается (≈1.6:1), поэтому для ссылок и отметок есть тёмно-зелёный.
   Все пары цветов проверены на WCAG AA: текст ≥ 4.5:1, рамки полей ≥ 3:1. */

@font-face { font-family: "Montserrat"; font-weight: 500; font-display: swap;
  src: url("/static/fonts/montserrat-medium.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 600; font-display: swap;
  src: url("/static/fonts/montserrat-semibold.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 700; font-display: swap;
  src: url("/static/fonts/montserrat-bold.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-weight: 900; font-display: swap;
  src: url("/static/fonts/montserrat-black.woff2") format("woff2"); }

:root {
  color-scheme: light;

  --ground: #ECEEED;
  --ground-deep: #E0E3E1;
  --surface: #FFFFFF;
  --sunk: #F3F5F4;
  --ink: #181A1C;
  --ink-soft: #3B413E;
  --muted: #565D59;
  --line: #DCE0DD;
  --line-strong: #858D85;

  --lime: #96E878;
  --lime-bright: #B4F59A;
  --lime-glow: rgba(150, 232, 120, 0.55);
  --leaf: #2A6B1A;
  --leaf-soft: #E4F6DB;

  --danger: #B42318;
  --danger-soft: #FDECEA;
  --warn: #7A4E0B;
  --warn-soft: #FBF0DB;
  --ok: #22692F;
  --ok-soft: #E3F4E6;

  --tg: #1A6FA3;
  --tg-soft: #E3F0F9;
  --vk: #2446B5;
  --vk-soft: #E7ECFB;

  --font: "Montserrat", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;

  --r-s: 8px;
  --r-m: 14px;
  --r-l: 22px;
  --shadow: 0 1px 2px rgba(24, 26, 28, 0.05), 0 8px 24px -12px rgba(24, 26, 28, 0.18);
  --shell: 1200px;
  --strip: 44px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, var(--ground) 0%, var(--ground-deep) 100%) fixed;
  background-color: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-weight: 500;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--leaf); text-underline-offset: 3px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }

/* ---------- вертикальная надпись у правого края ---------- */

.strip {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: var(--strip);
  background: var(--surface);
  border-left: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  pointer-events: none;
}

.strip span {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-weight: 900;
  font-size: 13px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  white-space: nowrap;
}

.strip i { color: var(--leaf); font-style: normal; }

/* ---------- шапка ---------- */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}

.top-in {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }

.brand-mark {
  font-weight: 900;
  font-size: 21px;
  letter-spacing: -0.03em;
  line-height: 1;
  padding: 7px 10px 6px;
  background: var(--lime);
  border-radius: var(--r-s);
  box-shadow: 0 0 0 0 var(--lime-glow);
}

.brand-sub { font-size: 13px; font-weight: 600; color: var(--muted); }

.nav { display: flex; gap: 2px; margin-right: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }

/* Меню — подчёркиванием, фильтры страниц — чёрными пилюлями: два уровня
   навигации не должны выглядеть одинаково. */
.nav a {
  position: relative;
  padding: 11px 12px;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.nav a:hover { color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); font-weight: 800; }
.nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 4px;
  height: 3px;
  border-radius: 3px;
  background: var(--lime);
}

.who { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.who form { margin: 0; }

.avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 15px;
}

.who-name { font-size: 14px; font-weight: 600; color: var(--ink-soft); }

/* ---------- основа ---------- */

main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 32px 24px 96px;
}

.with-strip main, .with-strip .top-in { padding-right: calc(24px + var(--strip)); }

h1 {
  font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1.05;
  margin: 0;
  text-wrap: balance;
}

h2 { font-size: 1.05rem; font-weight: 800; margin: 0; letter-spacing: -0.015em; }

.lead { color: var(--muted); font-size: 15px; margin: 8px 0 0; max-width: 60ch; }

.headline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.back {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 600; color: var(--muted);
  text-decoration: none; margin-bottom: 10px;
}
.back:hover { color: var(--ink); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 11px 20px;
  border: 1.5px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.18s ease, background-color 0.18s ease, transform 0.08s ease;
}

.btn:hover { background: var(--sunk); }
.btn:active { transform: translateY(1px); }

/* Свечение — постоянное, а не по наведению: на телефоне наведения нет,
   и там фирменный знак главной кнопки пропадал бы совсем. */
.btn.main {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 0 0 4px rgba(150, 232, 120, 0.35), 0 10px 28px -8px rgba(150, 232, 120, 0.9);
}

.btn.main:hover { background: var(--lime-bright); box-shadow: 0 0 0 6px var(--lime-glow), 0 12px 34px -6px rgba(150, 232, 120, 1); }

.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.dark:hover { background: #2B2F32; }

.btn.quiet { border-color: transparent; background: transparent; color: var(--muted); font-weight: 600; }
.btn.quiet:hover { background: rgba(24, 26, 28, 0.06); color: var(--ink); }

.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { background: #9A1D13; }

.btn[disabled] { opacity: 0.4; cursor: not-allowed; box-shadow: none; transform: none; }

.btn .plus { font-size: 20px; line-height: 0; font-weight: 700; }

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

.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  border-radius: var(--r-m);
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 18px;
}

.note::before { flex-shrink: 0; font-weight: 900; }
.note.good { background: var(--ok-soft); color: var(--ok); }
.note.good::before { content: "✓"; }
.note.bad { background: var(--danger-soft); color: var(--danger); }
.note.bad::before { content: "!"; width: 1ch; text-align: center; }
.note ul { margin: 6px 0 0; padding-left: 18px; font-weight: 500; }

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

.box {
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.box-head .step {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}

.hint { margin: 0; font-size: 13.5px; color: var(--muted); line-height: 1.45; }

/* ---------- поля ---------- */

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink-soft); }

input[type="text"], input[type="password"], input[type="datetime-local"], textarea {
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  padding: 12px 14px;
  min-height: 48px;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-m);
  background: var(--sunk);
  color: var(--ink);
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

textarea { font-family: var(--mono); font-size: 16px; line-height: 1.55; resize: vertical; }
textarea.prose { font-family: var(--font); }

input:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--lime-glow);
}

input::placeholder, textarea::placeholder { color: #7E857F; }

/* ---------- выбор ---------- */

.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }

.pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--r-m);
  cursor: pointer;
  background: var(--surface);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.pick:hover { border-color: var(--line-strong); }
.pick:has(input:checked) { border-color: var(--ink); background: var(--leaf-soft); }
.pick:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.pick input { width: 20px; height: 20px; accent-color: var(--ink); flex-shrink: 0; margin: 0; }
.pick span { display: flex; flex-direction: column; gap: 1px; }
.pick b { font-weight: 800; font-size: 15px; }
.pick small { font-size: 13px; color: var(--muted); font-weight: 500; }

/* ---------- метки состояния ---------- */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.tag-plain { background: var(--sunk); color: var(--ink-soft); }
.tag-done { background: var(--ok-soft); color: var(--ok); }
.tag-bad { background: var(--danger-soft); color: var(--danger); }
.tag-wait { background: var(--warn-soft); color: var(--warn); }
.tag-owner { background: var(--lime); color: var(--ink); }
.tag-owner::before, .tag-manager::before { display: none; }
.tag-manager { background: var(--sunk); color: var(--ink-soft); }

/* ---------- вход ---------- */

.gate {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  align-items: center;
  gap: 32px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px calc(28px + var(--strip)) 40px 28px;
}

.gate-art { position: relative; display: flex; flex-direction: column; gap: 22px; }

.gate-art h1 { font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem); }
.gate-art h1 em { font-style: normal; background: var(--lime); padding: 0 0.12em; border-radius: 10px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.gate-art p { margin: 0; color: var(--ink-soft); font-size: 17px; max-width: 34ch; }

.frog-stage { position: relative; width: min(340px, 80%); aspect-ratio: 640 / 568; }
.frog-stage::before {
  content: "";
  position: absolute;
  inset: 12% 8% 0 8%;
  background: radial-gradient(closest-side, var(--lime-glow), rgba(150, 232, 120, 0) 72%);
  filter: blur(10px);
}
.frog-stage img { position: relative; width: 100%; height: auto; display: block; }

.gate-card {
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
  padding: 32px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 400px;
  justify-self: center;
}

.gate-card h2 { font-size: 1.4rem; font-weight: 900; letter-spacing: -0.02em; }
.gate-card form { display: flex; flex-direction: column; gap: 14px; margin: 0; }
.gate-card .btn { width: 100%; margin-top: 4px; }

/* ---------- лента ---------- */

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 18px;
  padding: 2px;
}
.tabs::-webkit-scrollbar { display: none; }

.tabs a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  white-space: nowrap;
}

.tabs a:hover { border-color: var(--line-strong); color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Счётчик не лаймовый: лайм держим для главной кнопки экрана. */
.tabs .count {
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: 999px; background: var(--ink); color: #fff;
  font-size: 12px; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.tabs a[aria-current="page"] .count { background: #fff; color: var(--ink); }
.tabs .count.alarm, .tabs a[aria-current="page"] .count.alarm { background: var(--danger); color: #fff; }

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

.card {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px 14px 14px;
  background: var(--surface);
  border-radius: var(--r-m);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card:hover { transform: translateY(-1px); box-shadow: 0 1px 2px rgba(24,26,28,.06), 0 14px 30px -14px rgba(24,26,28,.28); }

.thumb {
  width: 56px; height: 56px;
  border-radius: 12px;
  background: var(--sunk);
  object-fit: cover;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 20px; color: var(--muted);
}

.card-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.card-main b { font-weight: 800; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta { display: flex; flex-wrap: wrap; gap: 2px 0; font-size: 13.5px; color: var(--muted); }
.card-meta > span + span::before { content: "·"; margin: 0 8px; color: var(--line-strong); }

.blank {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  max-width: 520px;
  margin: 12px auto 0;
  padding: 30px 28px 32px;
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
}

.blank-frog { position: relative; width: 170px; }
.blank-frog::before {
  content: "";
  position: absolute;
  inset: 14% 4% 0 4%;
  background: radial-gradient(closest-side, var(--lime-glow), rgba(150, 232, 120, 0) 72%);
  filter: blur(8px);
}
.blank-frog img { position: relative; display: block; width: 100%; height: auto; }
.blank h2 { font-size: 1.35rem; font-weight: 900; }
.blank p { margin: 0; color: var(--ink-soft); max-width: 40ch; }

/* ---------- редактор ---------- */

.desk { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: start; }

.work { display: flex; flex-direction: column; gap: 16px; min-width: 0; margin: 0; }
.looks { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 84px; min-width: 0; }

.photo-drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  aspect-ratio: 16 / 9;
  border: 2px dashed var(--line-strong);
  border-radius: var(--r-m);
  background: var(--sunk);
  text-align: center;
  padding: 16px;
  cursor: pointer;
  overflow: hidden;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.photo-drop:hover { border-color: var(--ink); background: var(--leaf-soft); }
.photo-drop:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop b { font-weight: 800; }
.photo-drop small { color: var(--muted); font-size: 13px; }
.photo-drop .big { font-size: 30px; line-height: 1; }

/* Картинка целиком видна в предпросмотре рядом — здесь хватит миниатюры. */
.photo-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.photo-now { flex-shrink: 0; width: 132px; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.photo-now img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.photo-tools { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; }
.photo-tools .swap { position: relative; overflow: hidden; }
.photo-tools .swap input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-soft); min-height: 44px; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--danger); }

/* Подпись видят подписчики — ей больше места; адрес можно и обрезать. */
.btn-rows { display: flex; flex-direction: column; gap: 8px; }
.btn-row { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; }

/* Описание нужно только «Новинке» — у «Списка» поле не мешает под рукой. */
.work:has(input[name="shablon"][value="list"]:checked) .desc-only { display: none; }

/* Разбор прайса — под самим полем: ошибку видно там, где её правят. */
.parsed-inline summary {
  cursor: pointer; list-style: none;
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
  font-size: 14px; font-weight: 700; color: var(--ink-soft);
}
.parsed-inline summary::-webkit-details-marker { display: none; }
.parsed-inline summary::after { content: "▾"; font-size: 12px; transition: transform 0.15s ease; }
.parsed-inline[open] summary::after { transform: rotate(180deg); }
.parsed-inline .p-tw { margin-top: 6px; max-height: 360px; overflow: auto; border-radius: 10px; box-shadow: 0 0 0 1px var(--line); }
/* На компьютере строка прайса не переносится — номер строки в ошибке совпадает
   с тем, что видно. На телефоне переносится: иначе цены уезжают за край поля. */
textarea.price { white-space: pre; overflow-x: auto; overflow-wrap: normal; }

.note a { color: inherit; font-weight: 800; }

/* Площадки прямо в панели действий — рядом с кнопкой, которая туда отправит. */
.targets { display: flex; gap: 8px; flex-wrap: wrap; }
.target {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 8px 14px;
  border-radius: 999px; border: 1.5px solid #5E6661;
  font-size: 14px; font-weight: 700; color: #C9D0CB; cursor: pointer;
}
.target input { width: 18px; height: 18px; margin: 0; accent-color: var(--lime); }
.target:has(input:checked) { border-color: var(--lime); color: #fff; }
.target:has(input:disabled) { opacity: 0.55; cursor: not-allowed; }
.target:has(input:focus-visible) { outline: 3px solid var(--lime); outline-offset: 2px; }
.target small { font-weight: 600; font-size: 12px; color: #9AA39D; }

.peek {
  display: none;
  font-size: 14px; font-weight: 700; color: var(--lime);
  text-decoration: none; min-height: 40px; align-items: center;
}

/* Предпросмотр площадки, куда пост не уходит, — свёрнут. */
.look-off summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 14px 18px; font-size: 13.5px; font-weight: 700; color: var(--muted);
}
.look-off summary::-webkit-details-marker { display: none; }
.look-off summary::after { content: "показать ▾"; font-size: 12.5px; color: var(--muted); }
.look-off[open] summary::after { content: "скрыть ▴"; }

/* Опубликованный пост: всё главное — в одной карточке наверху. */
.live {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: center;
  padding: 20px 22px;
  margin-bottom: 18px;
  background: var(--surface);
  border-radius: var(--r-l);
  box-shadow: var(--shadow);
}
.live-where { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.live-where a { font-weight: 700; font-size: 14px; }
.live-where .err { flex-basis: 100%; font-size: 13px; color: var(--danger); font-weight: 600; }
.live-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.live-clicks summary {
  cursor: pointer; list-style: none; display: inline-flex; gap: 10px; align-items: baseline;
  font-size: 14px; color: var(--ink-soft); font-weight: 600; min-height: 32px;
}
.live-clicks summary::-webkit-details-marker { display: none; }
.live-clicks summary b { font-size: 1.35rem; font-weight: 900; color: var(--ink); letter-spacing: -0.02em; }
.live-clicks summary::after { content: "по кнопкам ▾"; font-size: 12.5px; color: var(--muted); }
.live-clicks[open] summary::after { content: "скрыть ▴"; }
.live-clicks .hits { margin-top: 8px; max-width: 420px; }
.live form { margin: 0; }

/* панель действий: на компьютере — карточка, на телефоне — прилипает к низу */

.actions {
  position: sticky;
  bottom: 14px;
  z-index: 8;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-l);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 18px 40px -14px rgba(24, 26, 28, 0.6);
}

.actions h2 { color: #fff; }
.actions .hint { color: #C9D0CB; }
.actions .row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.actions .btn:not(.main) { background: transparent; border-color: #5E6661; color: #fff; }
.actions .btn:not(.main):hover { background: rgba(255, 255, 255, 0.08); }
.actions .when { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 10px; }

.later summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  font-size: 14px;
  font-weight: 700;
  color: #C9D0CB;
}
.later summary::-webkit-details-marker { display: none; }
.later summary::after { content: "▾"; font-size: 12px; transition: transform 0.15s ease; }
.later[open] summary::after { transform: rotate(180deg); }
.later summary:hover { color: #fff; }
.later > .btn { margin-top: 8px; }
.actions .field > span { color: #C9D0CB; }
.actions input[type="datetime-local"] { background: #24282B; border-color: #5E6661; color: #fff; color-scheme: dark; }
.actions input[type="datetime-local"]:focus { background: #2B3033; border-color: var(--lime); }
.actions .when-set { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.actions .when-set b { font-size: 1.3rem; font-weight: 900; color: var(--lime); }

/* У опубликованного поста главное — «Повторить» наверху. Панель правки
   спокойная и не прилипает: пост уже вышел, торопить здесь нечего. */
.actions.calm { position: static; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.actions.calm .hint { color: var(--muted); }
.actions.calm .btn:not(.main) { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.actions.calm .btn:not(.main):hover { background: var(--sunk); }
.actions .hint a { color: var(--lime); }

/* Недоступная главная кнопка — ровно серая, без свечения: полупрозрачный
   салатовый на чёрном выглядел грязно-оливковым и всё равно звал нажать. */
.actions .btn.main[disabled] {
  opacity: 1;
  background: #3A403C;
  border-color: #3A403C;
  color: #A4ADA7;
  box-shadow: none;
}

.outcomes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-bottom: 18px; }

.outcome {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow);
}
.outcome-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.outcome-main b { font-weight: 800; }
.outcome-main small { color: var(--muted); font-size: 13px; }
.outcome-side { display: flex; align-items: center; gap: 10px; }
.outcome-side a { font-weight: 700; font-size: 14px; }

.danger-zone { border: 1.5px solid var(--danger-soft); box-shadow: none; }
.danger-zone h2 { color: var(--danger); }

/* ---------- предпросмотр ---------- */

.look { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }

.look-top {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 18px; font-size: 13px; font-weight: 800; letter-spacing: 0.02em;
}
.look-top small { font-weight: 600; opacity: 0.8; }
.look-top.tg { background: var(--tg-soft); color: var(--tg); }
.look-top.vk { background: var(--vk-soft); color: var(--vk); }

.look-body { padding: 18px 20px 20px; font-size: 14.5px; }
.look-body > *:first-child { margin-top: 0; }
.look-body > *:last-child { margin-bottom: 0; }

.p-h { font-size: 1.08rem; font-weight: 800; margin: 14px 0 8px; letter-spacing: -0.01em; }
.p-p { margin: 8px 0; }
.p-hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.p-a { color: var(--tg); font-weight: 600; }
.p-f { font-size: 12.5px; color: var(--muted); }
.p-q { border-left: 3px solid var(--line-strong); margin: 10px 0; padding-left: 12px; }
.p-ul { margin: 8px 0; padding-left: 20px; }
.p-ul li { margin-bottom: 5px; }
.p-tw { overflow-x: auto; }
.p-t { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.p-t th, .p-t td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.p-t th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; text-align: left; }
.p-t .a-right { text-align: right; }
.p-t s { color: var(--muted); }
.p-img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 12px; display: block; }

.p-ph {
  aspect-ratio: 16 / 9; background: var(--sunk); border: 2px dashed var(--line-strong); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}

.p-btns { display: flex; flex-direction: column; gap: 5px; margin-top: 14px; }
.p-btn {
  display: block; text-align: center; padding: 9px 10px; background: var(--sunk); border-radius: 10px;
  color: var(--tg); text-decoration: none; font-size: 14px; font-weight: 700;
}
.p-btn:hover { background: var(--tg-soft); }

.flat { font-family: var(--font); font-size: 14.5px; white-space: pre-wrap; margin: 0; line-height: 1.55; }

/* ---------- разбор прайса ---------- */

.parsed { margin-top: 22px; }

.lines { border-collapse: collapse; width: 100%; font-size: 14px; }
.lines th, .lines td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.lines th { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.lines .right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lines .mono { font-family: var(--mono); font-size: 13px; color: var(--ink-soft); }
.lines tr.bad td { background: var(--danger-soft); }
.lines .num { color: var(--muted); font-variant-numeric: tabular-nums; }
.trouble { color: var(--danger); font-weight: 700; }

/* ---------- переходы ---------- */

.clicks { display: flex; gap: 32px; flex-wrap: wrap; align-items: baseline; }
.clicks > div { display: flex; flex-direction: column; }
.clicks .n { font-size: 2.3rem; font-weight: 900; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.clicks .k { font-size: 13px; color: var(--muted); font-weight: 600; margin-top: 4px; }

.hits { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.hits th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; padding: 0 0 6px; }
.hits td { padding: 9px 0; border-top: 1px solid var(--line); }
.hits .num, .hits th.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 800; }

.tiles { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tile {
  min-width: 190px; padding: 18px 20px; background: var(--surface);
  border-radius: var(--r-l); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 4px;
}
.tile .n { font-size: 2.3rem; font-weight: 900; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.tile .k { font-size: 13px; color: var(--muted); font-weight: 600; }

.split { font-size: 13px; color: var(--muted); font-weight: 600; }

.stat-list { display: flex; flex-direction: column; gap: 8px; }
.stat-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center;
  padding: 14px 18px; background: var(--surface); border-radius: var(--r-m); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink);
}
.stat-row:hover { box-shadow: 0 1px 2px rgba(24,26,28,.06), 0 14px 30px -14px rgba(24,26,28,.28); }
.stat-row .stat-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.stat-row b { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-n { font-size: 1.5rem; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }

.bar { display: block; height: 8px; background: var(--sunk); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--lime); border-radius: 999px; }

/* ---------- списки владельца ---------- */

.rows { background: var(--surface); border-radius: var(--r-l); box-shadow: var(--shadow); overflow: hidden; }
.row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.row:last-child { border-bottom: 0; }
.row-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.row-main b { font-weight: 800; }
.dim { color: var(--muted); font-size: 13.5px; }
.mono { font-family: var(--mono); font-size: 13.5px; color: var(--ink-soft); }

/* ---------- узкие экраны ---------- */

@media (max-width: 1100px) {
  .strip { display: none; }
  .with-strip main, .with-strip .top-in { padding-right: 24px; }
  .gate { padding-right: 28px; }
}

@media (max-width: 960px) {
  .desk { grid-template-columns: minmax(0, 1fr); }
  .looks { position: static; }
}

@media (max-width: 720px) {
  /* Шапка на телефоне не прилипает: низ экрана и так занят панелью действий.
     Две строки — логотип и выход сверху, меню целиком ниже. */
  .top { position: static; }
  .top-in { padding: 8px 14px 6px; gap: 6px 10px; flex-wrap: wrap; }
  .with-strip .top-in { padding-right: 14px; }
  .brand { order: 1; }
  .who { order: 2; margin-left: auto; }
  .nav { order: 3; width: 100%; margin-right: 0; }
  .brand-sub, .who-name { display: none; }
  .brand-mark { font-size: 18px; }
  .nav a { padding: 11px 14px; font-size: 14px; }

  main, .with-strip main { padding: 20px 14px 120px; }
  .box { padding: 18px 16px; border-radius: 18px; }

  .gate { grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 24px 16px 32px; min-height: auto; }
  .gate-art { align-items: center; text-align: center; }
  .gate-art p { margin: 0 auto; }
  .frog-stage { width: 190px; order: -1; }

  .headline > .btn.main { width: 100%; min-height: 52px; font-size: 16px; }

  /* Все четыре вкладки видны сразу — «Ошибки» не должны уезжать за край. */
  .tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .tabs a { padding: 9px 10px; }

  .card { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
  .card .tag { grid-column: 2; justify-self: start; }
  .thumb { width: 48px; height: 48px; }

  .blank { padding: 24px 18px 26px; }
  .blank-frog { width: 140px; }

  /* Подпись и адрес одной кнопки — одним блоком, иначе десять полей сливаются. */
  .btn-row { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 10px; background: var(--sunk); border-radius: var(--r-m); }
  .btn-rows { gap: 10px; }
  .btn-row input { background: var(--surface); }

  .peek { display: inline-flex; }
  textarea.price { white-space: pre-wrap; overflow-wrap: anywhere; }

  .live { grid-template-columns: minmax(0, 1fr); padding: 16px; }
  .live form .btn { width: 100%; }

  /* главное действие всегда под пальцем */
  .actions { bottom: 10px; border-radius: 20px; padding: 14px 16px; gap: 10px; }
  .actions .when { grid-template-columns: minmax(0, 1fr); }
  .actions .row-btns .btn { flex: 1 1 140px; }
}

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