/* Панель администратора Markerator — в стиле сайта: бумага, чернила, сигнальный оранжевый. */
:root {
  --paper: #f3efe6;
  --paper-2: #e9e3d6;
  --label: #fffdf8;
  --ink: #16130f;
  --ink-2: #3d372f;
  --ink-soft: #2b2620;
  --signal: #ff5a1f;
  --signal-soft: #ffe7dc;
  --line: rgba(22, 19, 15, .1);
  --line-2: rgba(22, 19, 15, .18);

  /* совместимость со старыми именами (используются в JS-графиках и разметке) */
  --primary: var(--ink);
  --primary-hover: #000;
  --primary-soft: var(--paper-2);
  --bg: var(--paper);
  --surface: var(--label);
  --border: var(--line);
  --text: var(--ink);
  --muted: #7b7366;
  --success: #1d8a5a;
  --success-soft: #dcf1e5;
  --warning: #b9770e;
  --warning-soft: #fbeccb;
  --danger: #d6361f;
  --danger-soft: #fde3dc;

  --radius: 20px;
  --shadow: 0 1px 0 var(--line), 0 24px 40px -36px rgba(22, 19, 15, .35);
  --sidebar: 252px;
  --display: "Unbounded", "Segoe UI", sans-serif;
  --body: "Manrope", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: var(--body);
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--paper); font-size: 14.5px; -webkit-font-smoothing: antialiased; }
::selection { background: var(--signal); color: #fff; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
a { color: var(--ink); text-decoration-color: var(--signal); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.02em; }
.eyebrow { font: 700 11.5px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); display: inline-flex; gap: 10px; align-items: center; }
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--signal); }

/* ---------- Логотип ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font: 800 19px/1 var(--display); text-decoration: none; letter-spacing: -.03em; color: var(--ink); }
.logo i { width: 30px; height: 22px; border-radius: 5px; background: var(--label); box-shadow: inset 0 0 0 2px var(--ink); position: relative; transform: rotate(-6deg); transition: transform .4s var(--ease); flex: none; }
.logo i::before, .logo i::after { content: ""; position: absolute; left: 6px; right: 6px; height: 2px; background: var(--ink); border-radius: 2px; }
.logo i::before { top: 6px; } .logo i::after { top: 12px; right: 11px; background: var(--signal); }
.logo:hover i { transform: rotate(6deg) scale(1.08); }
.logo.light { color: var(--paper); }
.logo.light i { box-shadow: none; }

/* ---------- Кнопки и формы ---------- */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  border: 0; border-radius: 999px; padding: 9px 16px; font: 700 13.5px/1.1 var(--body);
  cursor: pointer; background: var(--paper-2); color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  transition: transform .3s var(--ease), background .25s, color .25s, box-shadow .25s;
}
.btn:hover { background: #ddd5c4; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: var(--signal); transform: translateY(101%); transition: transform .4s var(--ease); z-index: -1; border-radius: inherit; }
.btn-primary:hover { background: var(--ink); }
.btn-primary:hover::after { transform: none; }
.btn-primary .arr { transition: transform .3s var(--ease); } .btn-primary:hover .arr { transform: translateX(4px); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-block { width: 100%; justify-content: center; }
.btn-lg { padding: 16px 24px; font-size: 15.5px; }
input, select, textarea {
  font: 500 14.5px/1.3 var(--body); padding: 10px 14px; border: 1.5px solid var(--line-2); border-radius: 12px;
  background: var(--label); color: var(--ink); min-width: 0; transition: border-color .2s, box-shadow .2s;
}
select { padding-right: 36px; appearance: none; cursor: pointer;
  background: var(--label) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2316130f' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") right 14px center / 11px no-repeat; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(255, 90, 31, .18); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--signal); padding: 0; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 12.5px; color: var(--ink-2); }
label.check { flex-direction: row; align-items: center; font-weight: 600; font-size: 14px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form-error { color: var(--danger); min-height: 18px; font-size: 13px; font-weight: 600; }

/* ---------- Вход ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { position: relative; overflow: hidden; background: var(--ink); color: var(--paper); padding: 44px 52px; display: flex; flex-direction: column; }
.login-art::before { content: ""; position: absolute; width: 560px; height: 560px; right: -160px; bottom: -200px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 90, 31, .42), transparent 65%); animation: breathe 7s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .75; } }
.art-stack { position: relative; flex: 1; min-height: 340px; }
.art-label { position: absolute; width: 270px; aspect-ratio: 3 / 2; background: var(--label); color: var(--ink); border-radius: 8px; padding: 18px; display: grid; grid-template-rows: 1fr auto auto; justify-items: center; box-shadow: 0 40px 60px -30px rgba(0, 0, 0, .8); animation: drop 1s var(--ease) both, float 8s ease-in-out infinite; }
.art-label b { align-self: center; font: 800 20px/1.1 var(--body); text-align: center; }
.art-label span { font: 500 17px/1.35 var(--mono); }
.art-label.l1 { left: 8%; top: 22%; --r: -8deg; animation-delay: .1s, 1.1s; }
.art-label.l2 { left: 38%; top: 40%; --r: 6deg; animation-delay: .25s, 1.25s; z-index: 2; }
.art-label.l3 { left: 14%; top: 60%; --r: -3deg; animation-delay: .4s, 1.4s; }
@keyframes drop { from { opacity: 0; transform: translateY(-60px) rotate(calc(var(--r) * 3)); } to { opacity: 1; transform: rotate(var(--r)); } }
@keyframes float { 0%, 100% { transform: rotate(var(--r)) translateY(0); } 50% { transform: rotate(calc(var(--r) * .6)) translateY(-12px); } }
.art-text { position: relative; font: 700 clamp(20px, 2.2vw, 28px)/1.25 var(--display); letter-spacing: -.02em; margin: 0; max-width: 460px; }
.login-side { display: grid; place-items: center; padding: 32px 20px; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px; animation: rise .8s var(--ease) both; }
.login-title { font-size: clamp(40px, 5vw, 58px); font-weight: 800; letter-spacing: -.05em; margin: 4px 0 10px; line-height: 1; }
.login-card input { padding: 14px 16px; font-size: 16px; border-radius: 14px; }
.login-card .back { color: var(--muted); font-size: 13.5px; font-weight: 600; text-decoration: none; text-align: center; }
.login-card .back:hover { color: var(--ink); }
@keyframes rise { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

/* ---------- Каркас ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); background: var(--ink); color: var(--paper); display: flex; flex-direction: column;
  position: fixed; inset: 0 auto 0 0; z-index: 20; transition: transform .35s var(--ease);
}
.sidebar::after { content: ""; position: absolute; left: -120px; bottom: -160px; width: 340px; height: 340px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 90, 31, .22), transparent 65%); pointer-events: none; }
.brand { padding: 26px 24px 30px; }
#nav { display: flex; flex-direction: column; gap: 3px; padding: 0 12px; position: relative; z-index: 1; }
#nav a {
  color: rgba(243, 239, 230, .66); text-decoration: none; padding: 11px 14px; border-radius: 14px; display: flex; gap: 12px; align-items: center;
  font-weight: 600; font-size: 14.5px; position: relative; transition: background .25s, color .25s, transform .3s var(--ease);
}
#nav a:hover { background: rgba(243, 239, 230, .07); color: var(--paper); }
#nav a.active { background: var(--paper); color: var(--ink); font-weight: 800; }
#nav a.active .ico { stroke: var(--signal); }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-foot { margin-top: auto; padding: 20px 26px 24px; font-size: 13px; position: relative; z-index: 1; }
.sidebar-foot a { color: rgba(243, 239, 230, .55); text-decoration: none; }
.sidebar-foot a:hover { color: var(--signal); }
.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 76px; display: flex; align-items: center; padding: 0 32px; gap: 14px; position: sticky; top: 0; z-index: 10;
  background: var(--paper); border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 24px; font-weight: 800; margin: 0; letter-spacing: -.035em; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-right select { border-radius: 999px; }
.user-chip { display: flex; flex-direction: column; text-align: right; line-height: 1.25; font-weight: 700; }
.user-chip small { color: var(--muted); font: 500 11.5px/1.3 var(--mono); }
.menu-btn { display: none; font-size: 20px; }
.view { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 20px; }

/* ---------- Карточки и таблицы ---------- */
.card { background: var(--label); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2, .card-head b { font: 700 16px/1.2 var(--display); letter-spacing: -.02em; margin: 0; }
.card-body { padding: 22px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { flex: 1; min-width: 180px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat { padding: 22px 22px 20px; position: relative; overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s var(--ease); }
.stat:hover { box-shadow: 0 1px 0 var(--line), 0 30px 50px -34px rgba(22, 19, 15, .5); }
.stat::before { content: ""; position: absolute; left: 22px; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--signal); }
.stat .label { color: var(--muted); font: 700 11px/1.3 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.stat .value { font: 800 36px/1 var(--display); letter-spacing: -.05em; margin-top: 14px; color: var(--ink); }
.stat .sub { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.stats .stat:first-child { background: var(--ink); color: var(--paper); }
.stats .stat:first-child .value { color: var(--paper); }
.stats .stat:first-child .label, .stats .stat:first-child .sub { color: rgba(243, 239, 230, .6); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 20px; }
th { font: 700 10.5px/1.2 var(--mono); white-space: nowrap; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); background: transparent; }
tr:last-child td { border-bottom: none; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: rgba(255, 90, 31, .05); }
/* Кнопки действий всегда видны: колонка прилипает к правому краю, кнопки переносятся */
th.actions, td.actions { position: sticky; right: 0; z-index: 1; background: var(--label); text-align: right; padding-right: 16px; }
td.actions { white-space: normal; min-width: 128px; }
td.actions .btn { margin: 2px 0 2px 4px; }
.table-wrap.scrolled th.actions, .table-wrap.scrolled td.actions { box-shadow: -14px 0 16px -14px rgba(22, 19, 15, .35); }
tbody tr:hover td.actions { background: #fff6f0; }
td.num, th.num { text-align: right; font-family: var(--mono); }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.badge { white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font: 700 11.5px/1 var(--body); background: var(--paper-2); color: var(--ink-2); }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: var(--success-soft); color: var(--success); }
.badge.warn { background: var(--warning-soft); color: var(--warning); }
.badge.bad { background: var(--danger-soft); color: var(--danger); }
.badge.gray { background: var(--paper-2); color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; vertical-align: middle; margin-right: 6px; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 22px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 12.5px; color: var(--muted); }

/* ---------- Графики ---------- */
.chart-box { width: 100%; min-height: 240px; overflow: hidden; }
.chart { display: block; }
.chart .bar { fill: var(--ink); transition: fill .2s; }
.chart .bar:hover { fill: var(--signal); }
.chart text { font: 500 10.5px var(--mono); fill: var(--muted); }
.hbar { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hbar .name { width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hbar .track { flex: 1; background: var(--paper-2); border-radius: 6px; height: 8px; overflow: hidden; }
.hbar .fill { background: var(--signal); height: 100%; border-radius: inherit; }
@keyframes grow { from { transform: scaleX(0); } }
.hbar .n { width: 40px; text-align: right; font: 700 13px var(--mono); }

/* ---------- Модальные окна и уведомления ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(22, 19, 15, .55); display: grid; place-items: center; z-index: 50; padding: 16px; animation: fadein .25s ease both; }
.modal { background: var(--label); border-radius: 24px; width: min(580px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 50px 80px -30px rgba(0, 0, 0, .55); animation: pop .45s var(--ease) both; }
.modal-head { padding: 22px 24px 16px; display: flex; align-items: center; }
.modal-head h3 { margin: 0; font: 800 20px/1.2 var(--display); letter-spacing: -.03em; }
.modal-head .btn { margin-left: auto; }
.modal-body { padding: 8px 24px 22px; }
.modal-foot { padding: 16px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: var(--ink); color: var(--paper); padding: 14px 18px; border-radius: 16px; box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .5); max-width: 380px; font-weight: 600; animation: slidein .45s var(--ease) both; border-left: 4px solid var(--signal); }
.toast.error { border-left-color: #ff8a73; background: #3a1510; }
.toast.ok { border-left-color: #43c486; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 10px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 700; }

/* ---------- Адаптивность ---------- */
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 900px) {
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px 24px 30px; min-height: 300px; }
  .art-stack { min-height: 200px; }
  .art-label { width: 190px; padding: 12px; } .art-label b { font-size: 15px; } .art-label span { font-size: 12.5px; }
  .art-label.l3 { display: none; }
  .art-text { font-size: 19px; }
}
@media (max-width: 860px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: none; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
  .main { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .view { padding: 18px 16px 40px; }
  .topbar { padding: 0 16px; height: 64px; }
  .topbar h1 { font-size: 19px; }
  .user-chip { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Выпадающие списки (свои, вместо системных) ---------- */
.cs { position: relative; display: inline-flex; min-width: 0; }
label > .cs { display: flex; }
.cs-native { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.cs-button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-width: 150px; cursor: pointer; text-align: left;
  font: 600 14.5px/1.3 var(--body); color: var(--ink); background: var(--label);
  border: 1.5px solid var(--line-2); border-radius: 12px; padding: 10px 14px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.cs-button:hover { border-color: var(--ink); }
.cs-button:focus-visible, .cs.open .cs-button { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(255, 90, 31, .18); }
.cs-button:disabled { opacity: .5; cursor: not-allowed; }
.cs-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-button svg { width: 12px; height: 8px; flex: none; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; transition: transform .35s var(--ease); }
.cs.open .cs-button svg { transform: rotate(180deg); }
.topbar-right .cs-button { border-radius: 999px; padding: 10px 18px; min-width: 190px; font-weight: 700; }

.cs-menu {
  position: fixed; z-index: 80; overflow-y: auto; padding: 6px; max-width: min(420px, calc(100vw - 24px));
  background: var(--label); border-radius: 18px;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -20px rgba(22, 19, 15, .45), 0 10px 20px -12px rgba(22, 19, 15, .25);
  transform-origin: top center; animation: cs-in .28s var(--ease) both;
  scrollbar-width: thin; scrollbar-color: var(--paper-2) transparent;
}
.cs-menu.up { transform-origin: bottom center; }
.cs-menu.closing { animation: cs-out .16s ease forwards; }
@keyframes cs-in { from { opacity: 0; transform: translateY(-8px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes cs-out { to { opacity: 0; transform: translateY(-4px) scale(.98); } }
.cs-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; cursor: pointer;
  font: 600 14.5px/1.3 var(--body); color: var(--ink-2); white-space: nowrap;
  animation: cs-item .32s var(--ease) both; animation-delay: calc(var(--n) * 18ms);
  transition: background .15s, color .15s;
}
@keyframes cs-item { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
.cs-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.cs-item i { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; opacity: 0; transform: scale(.5); transition: .25s var(--ease); }
.cs-item i svg { width: 12px; height: 12px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cs-item.active { background: var(--paper); color: var(--ink); }
.cs-item.selected { background: var(--ink); color: var(--paper); font-weight: 800; }
.cs-item.selected i { opacity: 1; transform: none; background: var(--signal); }
.cs-item.disabled { opacity: .4; cursor: default; }
.cs-item + .cs-item { margin-top: 2px; }

/* ---------- Личный кабинет: вход и регистрация ---------- */
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper-2); margin: 6px 0 4px; }
.auth-tabs button { border: 0; border-radius: 999px; padding: 11px 0; font: 700 14px/1 var(--body); background: transparent; color: var(--ink-2); cursor: pointer; transition: background .25s, color .25s, box-shadow .25s; }
.auth-tabs button.on { background: var(--label); color: var(--ink); box-shadow: 0 6px 16px -10px rgba(22, 19, 15, .5); }
.auth-form { display: flex; flex-direction: column; gap: 14px; animation: rise .5s var(--ease) both; }
.auth-form .login-title { margin: 8px 0 4px; font-size: clamp(32px, 4vw, 44px); }
.hint { margin: -4px 0 0; color: var(--muted); font-size: 13px; }
.link-btn { border: 0; background: none; padding: 4px; font: 600 13.5px var(--body); color: var(--ink-2); cursor: pointer; text-decoration: underline; text-decoration-color: var(--signal); text-underline-offset: 4px; }
.link-btn:hover { color: var(--signal); }
.code-input { font: 700 24px/1 var(--mono) !important; letter-spacing: .5em; text-align: center; }
.reset-step2 { display: flex; flex-direction: column; gap: 14px; }

/* ---------- Меню: разделы, закрытые до оплаты ---------- */
#nav a.locked { opacity: .45; }
#nav a.locked::after { content: ""; margin-left: auto; width: 14px; height: 14px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 7V5a3.5 3.5 0 0 1 7 0v2h.5a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1.5 0h4V5a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 7V5a3.5 3.5 0 0 1 7 0v2h.5a1 1 0 0 1 1 1v6a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1zm1.5 0h4V5a2 2 0 0 0-4 0z'/%3E%3C/svg%3E") center / contain no-repeat; }
#nav a.hidden { display: none; }

/* ---------- Подписка владельца ---------- */
.center { text-align: center; }
.notice { background: var(--signal-soft); color: #a3340c; font-weight: 700; border-left: 4px solid var(--signal); }
.plan-status { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 28px 30px; flex-wrap: wrap; }
.plan-status h2 { font: 800 clamp(22px, 2.6vw, 30px)/1.15 var(--display); letter-spacing: -.035em; margin: 12px 0 6px; }
.plan-status p { margin: 0; }
.plan-status.on { background: var(--ink); color: var(--paper); }
.plan-status.on .muted, .plan-status.on .eyebrow { color: rgba(243, 239, 230, .6); }
.plan-venues { text-align: right; display: flex; flex-direction: column; gap: 4px; }
.plan-venues b { font: 800 26px/1 var(--display); letter-spacing: -.03em; }
.plan-venues span { color: var(--muted); font: 600 12.5px/1.3 var(--mono); }
.plan-status.on .plan-venues span { color: rgba(243, 239, 230, .6); }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan-card { padding: 26px 24px 24px; display: flex; flex-direction: column; gap: 6px; transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.plan-card:hover { box-shadow: 0 1px 0 var(--line), 0 34px 50px -34px rgba(22, 19, 15, .5); }
.plan-card.best { box-shadow: inset 0 0 0 2px var(--ink), var(--shadow); }
.plan-price { font: 800 clamp(30px, 3.2vw, 40px)/1 var(--display); letter-spacing: -.05em; margin: 14px 0 2px; }
.plan-card p { margin: 0 0 14px; font-size: 13.5px; }
.plan-card { position: relative; }
.plan-save { position: absolute; top: 18px; right: 18px; background: var(--signal); color: #fff; font: 800 12px/1 var(--display); padding: 8px 11px; border-radius: 999px; transform: rotate(6deg); }
.plan-old { font: 600 14px/1.2 var(--mono); color: var(--muted); text-decoration-color: var(--signal); text-decoration-thickness: 2px; }
.plan-card .btn { margin-top: auto; padding: 13px; }

/* ---------- Программа ---------- */
.download { display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; padding: 32px; align-items: center; }
.download h2 { font: 800 clamp(24px, 3vw, 34px)/1.1 var(--display); letter-spacing: -.04em; margin: 12px 0 10px; }
.download p { margin: 0 0 22px; max-width: 520px; }
.req { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.req li { background: var(--paper); border-radius: 14px; padding: 12px 16px; font-size: 14px; color: var(--ink-2); }
.req b { display: block; font: 700 11px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 2px; }

@media (max-width: 900px) {
  .plans, .download { grid-template-columns: 1fr; }
  .plan-venues { text-align: left; }
}

/* ---------- Выбор даты и времени (свой, вместо системного) ---------- */
.dp { position: relative; display: inline-flex; min-width: 0; }
label > .dp { display: flex; }
.dp-native { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; pointer-events: none; }
.dp-button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-width: 170px; cursor: pointer; text-align: left;
  font: 600 14.5px/1.3 var(--body); color: var(--ink); background: var(--label);
  border: 1.5px solid var(--line-2); border-radius: 12px; padding: 10px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.dp-button:hover { border-color: var(--ink); }
.dp-button:focus-visible, .dp.open .dp-button { outline: none; border-color: var(--ink); box-shadow: 0 0 0 4px rgba(255, 90, 31, .18); }
.dp-button svg { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--signal); stroke-width: 1.7; stroke-linecap: round; }
.dp-text { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-text.empty { color: var(--muted); font-weight: 500; }

.dp-menu {
  position: fixed; z-index: 80; display: flex; gap: 0; background: var(--label); border-radius: 20px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 30px 60px -20px rgba(22, 19, 15, .45), 0 10px 20px -12px rgba(22, 19, 15, .25);
  transform-origin: top left; animation: cs-in .3s var(--ease) both;
}
.dp-menu.up { transform-origin: bottom left; }
.dp-menu.closing { animation: cs-out .16s ease forwards; }
.dp-cal { padding: 16px 16px 12px; width: 308px; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.dp-title { font: 800 16px/1 var(--display); letter-spacing: -.03em; }
.dp-nav { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--paper); cursor: pointer; display: grid; place-items: center; transition: background .2s, transform .25s var(--ease); }
.dp-nav:hover { background: var(--ink); }
.dp-nav:hover svg { stroke: var(--paper); }
.dp-nav:active { transform: scale(.92); }
.dp-nav svg { width: 12px; height: 12px; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dp-nav.next svg { transform: rotate(180deg); }
.dp-week, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-week span { text-align: center; font: 700 10.5px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 6px 0 8px; }
.dp-week span.we { color: var(--signal); }
.dp-day {
  height: 38px; border: 0; border-radius: 12px; background: transparent; cursor: pointer;
  font: 600 14px/1 var(--body); color: var(--ink); position: relative; transition: background .15s, color .15s, transform .2s var(--ease);
}
.dp-day:hover { background: var(--paper); }
.dp-day:active { transform: scale(.92); }
.dp-day.other { color: rgba(22, 19, 15, .3); }
.dp-day.today::after { content: ""; position: absolute; left: 50%; bottom: 6px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--signal); }
.dp-day.on { background: var(--ink); color: var(--paper); font-weight: 800; }
.dp-day.on.today::after { background: var(--signal); }
.dp-grid.slide-l { animation: dp-l .3s var(--ease); } .dp-grid.slide-r { animation: dp-r .3s var(--ease); }
@keyframes dp-l { from { opacity: 0; transform: translateX(14px); } }
@keyframes dp-r { from { opacity: 0; transform: translateX(-14px); } }
.dp-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.dp-link { border: 0; background: none; cursor: pointer; font: 700 13px var(--body); color: var(--ink-2); padding: 8px 10px; border-radius: 999px; transition: background .2s, color .2s; }
.dp-link:hover { background: var(--paper); color: var(--signal); }
.dp-done { border: 0; cursor: pointer; font: 700 13px var(--body); color: var(--paper); background: var(--ink); padding: 9px 16px; border-radius: 999px; transition: background .25s; }
.dp-done:hover { background: var(--signal); }
.dp-time { width: 132px; background: var(--paper); padding: 16px 10px 12px; display: flex; flex-direction: column; }
.dp-time-title { font: 700 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); text-align: center; margin: 6px 0 14px; }
.dp-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; flex: 1; min-height: 0; }
.dp-col { position: relative; overflow-y: auto; max-height: 300px; display: flex; flex-direction: column; gap: 2px; scrollbar-width: none; scroll-behavior: smooth; }
.dp-col::-webkit-scrollbar { display: none; }
.dp-col button { flex: none; height: 34px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; font: 600 14px/1 var(--mono); color: var(--ink-2); transition: background .15s, color .15s; }
.dp-col button:hover { background: var(--label); color: var(--ink); }
.dp-col button.on { background: var(--ink); color: var(--paper); font-weight: 700; }
@media (max-width: 480px) { .dp-menu.with-time { flex-direction: column; } .dp-time { width: auto; padding-top: 10px; } .dp-time-title { margin: 2px 0 8px; } .dp-col { max-height: 108px; } }
.dp-menu { max-height: calc(100vh - 16px); overflow-y: auto; }

/* ---------- Оформление подписки ---------- */
.back-link { color: var(--muted); font-weight: 700; text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--ink); }
.checkout { display: grid; grid-template-columns: 1.35fr 1fr; gap: 20px; align-items: start; }
.co-form, .co-sum { padding: 30px; display: flex; flex-direction: column; gap: 18px; }
.co-form h2, .co-sum h2 { font: 800 26px/1.1 var(--display); letter-spacing: -.04em; margin: -6px 0 4px; }
.co-form label { gap: 8px; }
.hint { font-weight: 500; font-size: 12.5px; color: var(--muted); }
.hint.ok { color: var(--success); font-weight: 700; }
.ro { position: relative; }
.ro input { width: 100%; background: var(--paper); color: var(--ink-2); border-style: dashed; cursor: not-allowed; padding-right: 44px; }
.ro svg { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-linecap: round; }
.addr { position: relative; }
.addr input { width: 100%; padding-right: 44px; }
.addr input.valid { border-color: var(--success); box-shadow: 0 0 0 4px rgba(29, 138, 90, .12); }
.addr-ok { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--success); color: #fff; display: grid; place-items: center; font: 800 13px/1 var(--body); }
.addr-ok[hidden] { display: none; }
.addr-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); background: var(--label); border-radius: 16px; padding: 6px; box-shadow: 0 0 0 1px var(--line), 0 30px 60px -20px rgba(22, 19, 15, .45); animation: cs-in .22s var(--ease) both; max-height: 320px; overflow-y: auto; }
.addr-list[hidden] { display: none; }
.addr-list button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 12px; padding: 10px 12px; cursor: pointer; font: inherit; }
.addr-list button b { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.addr-list button span { color: var(--muted); font-size: 12.5px; }
.addr-list button:hover, .addr-list button.on { background: var(--paper); }
.addr-wait { padding: 14px; color: var(--muted); font-size: 13.5px; text-align: center; }
.map-btn { align-self: flex-start; }
.map-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--signal); stroke-width: 1.8; }
.co-sum ul { list-style: none; margin: 0; padding: 0 0 16px; border-bottom: 1.5px dashed var(--line-2); display: grid; gap: 10px; }
.co-sum li { display: flex; justify-content: space-between; font-size: 15px; color: var(--ink-2); }
.co-sum li b { color: var(--ink); } .co-sum li b.sig { color: var(--signal); }
.co-total { font: 800 44px/1 var(--display); letter-spacing: -.05em; }
.co-sum .small { font-size: 12.5px; margin: 0; }
.map-modal { width: min(860px, 100%); }
.map-box { height: min(60vh, 460px); margin: 0 24px; border-radius: 16px; overflow: hidden; background: var(--paper); display: grid; place-items: center; }
.map-box > div:not(.addr-wait) { width: 100%; height: 100%; }
.map-foot { justify-content: space-between; align-items: center; }
.map-foot #map-addr { font-weight: 700; max-width: 60%; }
@media (max-width: 900px) { .checkout { grid-template-columns: 1fr; } }

.ro.pwd input { padding-right: 84px; }
.ro.pwd .eye { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; display: grid; place-items: center; color: var(--muted); transition: background .2s, color .2s; }
.ro.pwd .eye:hover { background: var(--paper-2); color: var(--ink); }
.ro.pwd .eye svg { position: static; transform: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ro.pwd .eye .off { display: none; } .ro.pwd.shown .eye .on { display: none; } .ro.pwd.shown .eye .off { display: block; }
.addr-list button.part span { color: var(--signal); font-weight: 600; }

/* ---------- несколько точек при оформлении ---------- */
.co-points { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; font-size: 13px; color: var(--ink-2); }
.stepper { display: inline-flex; align-items: center; gap: 4px; background: var(--paper); border-radius: 999px; padding: 4px; }
.stepper button { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--label); cursor: pointer; font: 800 18px/1 var(--body); color: var(--ink); box-shadow: 0 1px 0 var(--line); transition: background .2s, color .2s; }
.stepper button:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.stepper button:disabled { opacity: .35; cursor: not-allowed; }
.stepper b { min-width: 40px; text-align: center; font: 800 20px/1 var(--display); }
.co-addrs { display: flex; flex-direction: column; gap: 10px; }
.co-addr-row { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; animation: rise .35s var(--ease) both; position: relative; z-index: 1; }
/* строка с открытыми подсказками — поверх следующих строк (анимация делает каждую строку отдельным слоем) */
.co-addr-row:focus-within, .co-addr-row:has(.addr-list:not([hidden])) { z-index: 20; }
.co-num { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: var(--paper); display: grid; place-items: center; font: 800 13px/1 var(--display); }
.map-icon { width: 44px; height: 44px; padding: 0; justify-content: center; }
.map-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--signal); stroke-width: 1.8; }
.stepper input { width: 64px; text-align: center; border: 0; background: transparent; font: 800 20px/1 var(--display); color: var(--ink); padding: 6px 0; box-shadow: none; }
.stepper input:focus { outline: none; box-shadow: none; background: var(--label); border-radius: 10px; }

/* ---------- Филиалы ---------- */
.branches-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 28px 30px; flex-wrap: wrap; }
.branches-head h2 { font: 800 30px/1.1 var(--display); letter-spacing: -.04em; margin: 10px 0 6px; }
.branches-head p { margin: 0; max-width: 520px; }
.branch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.branch { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; }
.branch b { display: block; font-weight: 800; margin-bottom: 4px; }
.branch span:not(.co-num) { font-size: 13.5px; color: var(--ink-2); }
.venue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 220px; }
.venue-list li { display: flex; flex-direction: column; line-height: 1.3; }
.venue-list b { font-size: 13px; }
.venue-list span { font-size: 12.5px; color: var(--ink-2); }
.branch { align-items: center; }
.branch .grow { flex: 1; min-width: 0; }
.branch-act { flex-shrink: 0; }
.branch { flex-wrap: wrap; }
.branch-acts { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 8px; padding-left: 44px; }
.branch.off { opacity: .7; }
.branch-sub { font: 800 18px/1.2 var(--display); letter-spacing: -.02em; margin: 26px 0 12px; }

/* ---------- Калькулятор сроков ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.calc .card { padding: 28px 30px; }
.calc h2 { font: 800 26px/1.1 var(--display); letter-spacing: -.04em; margin: 10px 0 20px; }
.calc label { display: grid; gap: 8px; margin-bottom: 16px; font-weight: 600; font-size: 13.5px; }
.calc-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.calc-row > input, .calc-row > .dp { flex: 1; min-width: 140px; }
#cl-value { flex: 0 0 110px; min-width: 0; font-weight: 800; font-size: 17px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--paper-2); gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 8px 12px; border-radius: 9px; font: inherit; font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.calc-presets { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 13px; font: inherit; font-weight: 700; font-size: 13px; color: var(--ink); cursor: pointer; }
.chip:hover { border-color: var(--ink-2); }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.calc-out { position: sticky; top: 20px; }
.calc-date { font: 800 34px/1.1 var(--display); letter-spacing: -.04em; margin: 14px 0 6px; }
.calc-week { font-size: 15px; text-transform: capitalize; }
.calc-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; padding: 14px 16px; border-radius: 14px; border: 1px dashed var(--line); }
.calc-label span { font-size: 13px; color: var(--ink-2); }
.calc-label b { font: 700 18px var(--mono); }
.calc-left { margin-top: 16px; font-weight: 700; font-size: 14px; }
.calc-left.ok { color: var(--success); }
.calc-left.warn { color: var(--signal); }
.calc-left.bad { color: var(--danger); }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } .calc-out { position: static; } }

/* ---------- Открытие смены ---------- */
.mo-venues { margin-bottom: 14px; }
.mo-venues a { padding: 8px 14px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.mo-venues a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.mo-card { padding: 22px 24px; margin-top: 18px; }
.mo-add { margin-bottom: 14px; }
.mo-add .addr { position: relative; }
.mo-add input { width: 100%; }
.mo-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.mo-row:first-child { border-top: 0; }
.mo-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mo-row .grow b { font-weight: 800; }
.mo-row .grow span { font-size: 13px; }
.mo-row .stepper button { width: 32px; height: 32px; font-size: 16px; }
.mo-row .stepper b { min-width: 34px; font-size: 16px; }
.mo-move { display: flex; gap: 2px; }
.mo-move button { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; font-weight: 800; }
.mo-move button:hover:not(:disabled) { background: var(--paper-2); color: var(--ink); }
.mo-move button:disabled { opacity: .25; cursor: default; }
.mo-foot { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.mo-foot .grow { flex: 1; }
@media (max-width: 640px) { .mo-move { display: none; } .mo-row { gap: 10px; } }

/* ---------------- Техподдержка */
.sup { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 18px; align-items: start; }
.sup-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.sup-head { padding: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sup-head h2 { font: 800 24px/1.1 var(--display); letter-spacing: -.04em; margin: 10px 0 2px; }
.sup-head p { margin: 0 0 12px; font-size: 13.5px; }
.sup-filter { align-self: flex-start; }
.sup-filter a { padding: 8px 12px; border-radius: 9px; font-weight: 700; font-size: 13px; color: var(--ink-2); text-decoration: none; }
.sup-filter a.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.sup-list { display: flex; flex-direction: column; gap: 8px; }
.sup-item { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border-radius: 16px; background: var(--label); box-shadow: var(--shadow); text-decoration: none; color: var(--ink); border: 1.5px solid transparent; transition: border-color .2s, transform .25s var(--ease); }
.sup-item:hover { transform: translateY(-1px); border-color: var(--line-2); }
.sup-item.on { border-color: var(--ink); }
.sup-item b { font-size: 14.5px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sup-item-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.sup-org { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.sup-last { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 800; }
.st-open { background: var(--signal-soft); color: var(--signal); }
.st-wait { background: var(--warning-soft); color: var(--warning); }
.st-answered { background: var(--success-soft); color: var(--success); }
.st-closed { background: var(--paper-2); color: var(--muted); }
.sup-main { padding: 26px; min-height: 420px; display: flex; flex-direction: column; min-width: 0; }
.sup-main h3 { font: 800 20px/1.2 var(--display); letter-spacing: -.03em; margin: 10px 0 6px; overflow-wrap: anywhere; }
.sup-empty { margin: auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.sup-form { display: flex; flex-direction: column; gap: 14px; }
.sup-form h3 { margin-bottom: 0; }
.sup-cats { display: flex; flex-wrap: wrap; gap: 8px; }
.sup-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.sup-form .sup-actions { justify-content: flex-start; }
.sup-actions .form-error { margin-right: auto; }
.sup-thread-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sup-thread-head p { margin: 0; }
.sup-thread { display: flex; flex-direction: column; gap: 12px; padding: 18px 2px; max-height: 52vh; overflow-y: auto; }
.msg { max-width: 78%; align-self: flex-start; background: var(--paper); border-radius: 16px 16px 16px 4px; padding: 12px 14px; }
.msg.me { align-self: flex-end; background: var(--ink); color: var(--paper); border-radius: 16px 16px 4px 16px; }
.msg.from-sup:not(.me) { background: var(--signal-soft); }
.msg-meta { display: flex; gap: 10px; align-items: baseline; font-size: 12px; margin-bottom: 4px; }
.msg-meta span { opacity: .6; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; }
.sup-reply { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); margin-top: auto; }
.sup-reply textarea { resize: vertical; min-height: 80px; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--signal); color: #fff; font: 800 11px/20px var(--body); text-align: center; }
@media (max-width: 1240px) { .sup { grid-template-columns: 1fr; } .sup-main { min-height: 0; } }
@media (max-width: 700px) { .msg { max-width: 92%; } }

.form-grid label[hidden] { display: none; }

/* ---------- Телефон и планшет ---------- */
@media (max-width: 1000px) {
  /* строка таблицы — карточка «подпись: значение» */
  table.stack, table.stack tbody, table.stack tr { display: block; width: 100%; }
  table.stack thead { display: none; }
  table.stack tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td, table.stack td:first-child { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 5px 0; border: 0; text-align: right; min-width: 0; }
  table.stack td::before { content: attr(data-title); flex: none; font: 700 10.5px/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); text-align: left; }
  table.stack td > div { min-width: 0; overflow-wrap: anywhere; }
  table.stack td.blank { display: none; }
  table.stack .venue-list { min-width: 0; max-width: none; }
  table.stack td.actions { position: static; background: none !important; box-shadow: none !important; padding: 8px 0 0; }
  table.stack td.actions::before { display: none; }
  table.stack td.actions > div { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
  table.stack td.actions .btn { margin: 0; flex: 1 1 auto; justify-content: center; }
}
@media (min-width: 701px) and (max-width: 1000px) {
  table.stack tr { display: grid; grid-template-columns: 1fr 1fr; column-gap: 36px; padding: 14px 22px; }
  table.stack td.actions { grid-column: 1 / -1; } table.stack td.actions .btn { flex: 0 1 auto; padding-left: 18px; padding-right: 18px; }
}
#nav { overflow-y: auto; min-height: 0; }
.sup-main { scroll-margin-top: 90px; }
@media (max-width: 860px) {
  /* мельче 16px — и iPhone увеличивает страницу при вводе */
  input, select, textarea { font-size: 16px; }
  .sidebar { width: min(300px, 84vw); }
  #nav a { padding: 12px 14px; font-size: 15.5px; }
}
@media (max-width: 700px) {
  .view { padding: 14px 12px 36px; gap: 14px; }
  .topbar { height: auto; min-height: 60px; padding: 8px 12px; gap: 8px; flex-wrap: wrap; }
  .topbar h1 { font-size: clamp(14px, 4.6vw, 17px); flex: 1; min-width: 0; }
  .topbar-right { gap: 8px; }
  .topbar-right:has(.cs) { display: contents; }
  .topbar-right .cs { order: 5; flex: 1 0 100%; }
  .card-head, .card-body { padding: 16px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 18px 16px; } .stat::before { left: 16px; }
  .stat .label { font-size: 10px; letter-spacing: .06em; } .stat .value { font-size: 28px; }

  .toolbar { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .toolbar > * { min-width: 0; }
  .toolbar > .grow, .toolbar > h2, .toolbar > .btn-primary, .toolbar > label:has(.dp), .toolbar > label:has(input[type="checkbox"]) { grid-column: 1 / -1; }
  .toolbar > div.grow:empty { display: none; }
  .toolbar > .btn + .btn-primary { grid-column: auto; }
  .toolbar .btn { justify-content: center; white-space: normal; }
  .toolbar .cs, .toolbar .dp { display: flex; width: 100%; }
  .cs-button, .dp-button { min-width: 0; padding-left: 12px; padding-right: 12px; gap: 7px; }
  .toolbar .cs-button { font-size: 13.5px; padding-left: 10px; padding-right: 10px; }
  .hbar { gap: 10px; } .hbar .name { white-space: normal; overflow-wrap: anywhere; width: 50%; font-size: 13.5px; line-height: 1.25; } .hbar .n { width: 30px; }

  .modal-backdrop { padding: 10px; }
  .modal { max-height: calc(100dvh - 20px); }
  .modal-head { padding: 18px 18px 12px; } .modal-body { padding: 6px 18px 18px; } .modal-foot { padding: 12px 18px 18px; flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; justify-content: center; }
  .modal .table-wrap th, .modal .table-wrap td { padding-left: 6px; padding-right: 6px; }
  .toasts { left: 12px; right: 12px; bottom: 12px; } .toast { max-width: none; }
  .sup-main, .sup-head { padding: 18px 16px; }
  .sup-thread-head { flex-direction: column; }
}
@media (max-width: 480px) { .calc-row > .dp { flex: 1 1 100%; } }
@media (max-width: 380px) { .toolbar > label, .toolbar > .cs { grid-column: 1 / -1; } }
