/* Очередь.Онлайн — общий стиль.
   Палитра «дорожной разметки»: графит асфальта, сигнальный жёлтый, белая бумага талона. */
:root {
  --asphalt: #1e2630;
  --asphalt-2: #2c3642;
  --signal: #ffcf2e;
  --signal-deep: #e6b400;
  --paper: #ffffff;
  --concrete: #eceef1;
  --line: #d5d9df;
  --muted: #5d6875;
  --go: #138a4b;
  --go-bg: #e3f4ea;
  --stop: #c93a32;
  --stop-bg: #fbe9e7;
  --radius: 14px;
  --radius-sm: 9px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 1px 0 rgba(30, 38, 48, 0.06), 0 6px 18px -10px rgba(30, 38, 48, 0.35);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--asphalt);
  background: var(--concrete);
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 0.5em; letter-spacing: -0.01em; }
h1 { font-size: 1.75rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 750; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 0.8em; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

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

/* --- кнопки --- */
.btn {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5em;
  min-height: 48px; padding: 0 1.2em;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  background: var(--asphalt); color: var(--paper);
  transition: transform 0.08s ease, background-color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-signal { background: var(--signal); color: var(--asphalt); }
.btn-signal:hover { background: var(--signal-deep); }
.btn-go { background: var(--go); color: #fff; }
.btn-ghost { background: transparent; color: var(--asphalt); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--asphalt); }
.btn-danger { background: transparent; color: var(--stop); border-color: #eec3bf; }
.btn-danger:hover { border-color: var(--stop); }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 1.1rem; }
.btn-sm { min-height: 36px; padding: 0 0.8em; font-size: 0.9rem; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); text-decoration: underline; cursor: pointer; }

/* --- формы --- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 650; font-size: 0.92rem; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); margin-top: 4px; font-size: 0.82rem; }
input[type=text], input[type=tel], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: inherit; font-size: 1rem; color: var(--asphalt);
  background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm);
}
textarea { min-height: 84px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--asphalt); }
.field.invalid input, .field.invalid select { border-color: var(--stop); }
.field-error { color: var(--stop); font-size: 0.85rem; margin-top: 4px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.92rem; margin: 6px 0 16px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; flex: none; accent-color: var(--asphalt); }
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.form-error { background: var(--stop-bg); color: var(--stop); border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }

/* --- общие блоки --- */
.panel { background: var(--paper); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 14px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 0.8rem; font-weight: 700; background: var(--concrete); color: var(--asphalt); white-space: nowrap; }
.badge-go { background: var(--go-bg); color: var(--go); }
.badge-stop { background: var(--stop-bg); color: var(--stop); }
.badge-signal { background: #fff3c4; color: #7a5b00; }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 100; pointer-events: none; padding: 0 12px; }
.toast { background: var(--asphalt); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); max-width: 480px; pointer-events: auto; }
.toast.err { background: var(--stop); }

.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--asphalt); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Клиентская страница (телефон) ============ */
.client { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.client-head { background: var(--asphalt); color: #fff; padding: 18px 18px 22px; }
.client-head h1 { font-size: 1.45rem; margin: 0 0 4px; }
.client-head .addr { color: #c4ccd6; font-size: 0.92rem; margin: 0; }
.client-head .desc { color: #e4e8ed; font-size: 0.92rem; margin: 10px 0 0; }
.client-main { flex: 1; padding: 0 14px 28px; }

/* Сводка очереди: две большие цифры на «полосе разметки» */
.board { margin-top: -10px; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.board-row { display: grid; grid-template-columns: 1fr 1fr; }
.board-cell { padding: 16px 18px 14px; }
.board-cell + .board-cell { border-left: 2px dashed var(--line); }
.board-value { font-size: 2.6rem; font-weight: 850; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.board-value small { font-size: 1.05rem; font-weight: 700; letter-spacing: 0; margin-left: 3px; }
.board-label { color: var(--muted); font-size: 0.88rem; margin-top: 6px; }
.board-note { padding: 12px 18px; background: var(--stop-bg); color: var(--stop); font-weight: 650; font-size: 0.95rem; }
.stripe { height: 8px; background: repeating-linear-gradient(90deg, var(--signal) 0 26px, var(--asphalt) 26px 52px); }

.section-title { font-size: 1.1rem; margin: 22px 4px 10px; }
.services { list-style: none; margin: 0; padding: 0; }
.service-opt { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 8px; cursor: pointer; }
.service-opt input { width: 22px; height: 22px; accent-color: var(--asphalt); flex: none; margin: 0; }
.service-opt .s-name { flex: 1; font-weight: 650; }
.service-opt .s-time { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.service-opt:has(input:checked) { border-color: var(--asphalt); background: #fbfbfc; }

.plate-input { text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

.hours { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.hours td { padding: 5px 0; border-bottom: 1px solid var(--concrete); }
.hours td:last-child { text-align: right; }
.hours tr.today td { font-weight: 750; }
details.more { margin-top: 18px; background: var(--paper); border-radius: var(--radius); padding: 14px 18px; }
details.more summary { cursor: pointer; font-weight: 650; }

/* Талон: главная деталь интерфейса */
.ticket {
  position: relative; margin-top: 18px; background: var(--paper);
  border-radius: var(--radius); box-shadow: var(--shadow); text-align: center; padding: 20px 18px 18px;
}
.ticket-label { color: var(--muted); font-size: 0.9rem; }
.ticket-no { font-size: 4.2rem; font-weight: 900; line-height: 1; letter-spacing: -0.04em; margin: 2px 0 14px; font-variant-numeric: tabular-nums; }
/* Линия отрыва талона с вырезами по краям */
.ticket-cut { position: relative; border-top: 2px dashed var(--line); margin: 0 -18px 16px; }
.ticket-cut::before, .ticket-cut::after {
  content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--concrete);
}
.ticket-cut::before { left: -11px; }
.ticket-cut::after { right: -11px; }
.ahead { font-size: 1.55rem; font-weight: 800; line-height: 1.2; }
.ahead-sub { color: var(--muted); margin-top: 4px; font-size: 1rem; }
.queue-dots { display: flex; justify-content: center; gap: 6px; margin: 16px 0 4px; flex-wrap: wrap; }
.queue-dots i { width: 14px; height: 14px; border-radius: 4px; background: var(--line); }
.queue-dots i.me { background: var(--signal); outline: 2px solid var(--asphalt); }
.queue-dots i.post { background: var(--asphalt); }
.ticket-meta { margin-top: 14px; font-size: 0.92rem; color: var(--muted); }
.notice { margin-top: 14px; background: #fff7d6; border-radius: var(--radius-sm); padding: 12px 14px; font-size: 0.92rem; text-align: left; }
.notice b { display: block; margin-bottom: 2px; }
.client-actions { margin-top: 18px; display: grid; gap: 10px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; color: var(--muted); margin-top: 12px; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--go); }
.live.off::before { background: var(--stop); }

/* Экран «Ваша очередь подошла» */
.called-screen {
  position: fixed; inset: 0; z-index: 50; background: var(--signal); color: var(--asphalt);
  display: flex; flex-direction: column; justify-content: center; padding: 28px 24px; text-align: left;
}
.called-screen .c-ticket { font-weight: 800; font-size: 1.2rem; }
.called-screen h1 { font-size: clamp(2.6rem, 13vw, 4.4rem); font-weight: 900; line-height: 0.98; letter-spacing: -0.035em; margin: 14px 0 18px; }
.called-screen .c-post { font-size: 1.6rem; font-weight: 800; background: var(--asphalt); color: var(--signal); display: inline-block; padding: 8px 16px; border-radius: 10px; }
.called-screen .c-sub { margin-top: 18px; font-size: 1.05rem; max-width: 30ch; }
.called-screen .c-stripe { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; background: repeating-linear-gradient(90deg, var(--asphalt) 0 30px, transparent 30px 60px); }
@media (prefers-reduced-motion: no-preference) {
  .called-screen h1 { animation: knock 1.2s ease-out 1; }
}
@keyframes knock { 0% { transform: scale(0.92); opacity: 0; } 40% { transform: scale(1.03); opacity: 1; } 100% { transform: scale(1); } }

.final { text-align: center; padding: 40px 10px; }
.final .big { font-size: 3.4rem; margin-bottom: 10px; }

/* ============ Сайт ============ */
.site-nav { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; max-width: 1080px; margin: 0 auto; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 850; font-size: 1.15rem; text-decoration: none; letter-spacing: -0.01em; }
.logo-mark { width: 32px; height: 32px; flex: none; }
.site-nav .links { display: flex; gap: 8px; }

.hero { background: var(--asphalt); color: #fff; overflow: hidden; }
.hero-in { max-width: 1080px; margin: 0 auto; padding: 36px 20px 0; display: grid; gap: 32px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); font-weight: 900; letter-spacing: -0.035em; line-height: 1.02; max-width: 14ch; }
.hero p.lead { color: #cdd4dc; font-size: 1.12rem; max-width: 40ch; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 22px 0 36px; }
.hero .btn-ghost { color: #fff; border-color: #4a5664; }
.hero .btn-ghost:hover { border-color: #fff; }
.phone-demo { justify-self: center; width: 280px; background: var(--concrete); border-radius: 30px 30px 0 0; padding: 14px 14px 0; border: 8px solid #10161d; border-bottom: 0; color: var(--asphalt); }
.phone-demo .ticket { margin-top: 0; }
.hero .stripe { height: 12px; }

.site-sec { max-width: 1080px; margin: 0 auto; padding: 48px 20px; }
.steps { display: grid; gap: 14px; counter-reset: s; padding: 0; list-style: none; margin: 0; }
.steps li { background: var(--paper); border-radius: var(--radius); padding: 18px 18px 18px 64px; position: relative; box-shadow: var(--shadow); }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 18px; top: 16px; width: 32px; height: 32px; border-radius: 8px; background: var(--signal); font-weight: 850; display: grid; place-items: center; }
.steps h3 { margin-bottom: 4px; }
.steps p { margin: 0; color: var(--muted); }
.fit-groups { display: grid; gap: 14px; margin-top: 14px; }
@media (min-width: 760px) { .fit-groups { grid-template-columns: 1fr 1fr; } }
.fit-group { background: var(--paper); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border-top: 6px solid var(--signal); }
.fit-group p { color: var(--muted); }
.fit-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.fit-group li { border: 2px solid var(--line); border-radius: 99px; padding: 5px 13px; font-weight: 650; font-size: 0.95rem; }
.fit { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.fit span { background: var(--paper); border: 2px solid var(--line); border-radius: 99px; padding: 6px 14px; font-weight: 650; }
.site-foot { border-top: 1px solid var(--line); padding: 24px 20px; max-width: 1080px; margin: 0 auto; color: var(--muted); font-size: 0.9rem; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }

@media (min-width: 860px) {
  .hero-in { grid-template-columns: 1.2fr 1fr; align-items: end; padding-top: 56px; }
  .hero-in > div:first-child { padding-bottom: 56px; }
  .steps { grid-template-columns: repeat(3, 1fr); }
}

/* --- страница входа/регистрации --- */
.auth { max-width: 460px; margin: 0 auto; padding: 8px 16px 40px; }
.auth .panel { padding: 22px; }
.auth-switch { text-align: center; margin-top: 16px; }

/* ============ Кабинет и админка ============ */
.app { min-height: 100vh; }
.app-top { position: sticky; top: 0; z-index: 20; background: var(--asphalt); color: #fff; display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.app-top .logo { color: #fff; font-size: 1rem; }
.app-top .logo-mark { width: 26px; height: 26px; }
.app-top .org { margin-left: auto; color: #c4ccd6; font-size: 0.9rem; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-top .btn-sm { color: #fff; border-color: #4a5664; }
.imp-bar { background: var(--signal); color: var(--asphalt); padding: 8px 14px; font-weight: 650; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.92rem; }
.warn-bar { background: var(--stop-bg); color: var(--stop); padding: 10px 14px; font-weight: 650; font-size: 0.92rem; }
.warn-bar a { color: inherit; }
.app-body { display: flex; }
.app-nav { display: none; }
.app-main { flex: 1; min-width: 0; overflow-x: clip; padding: 16px 14px 96px; max-width: 980px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr); background: var(--paper); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 9px; font-size: 0.72rem; font-weight: 650; text-decoration: none; color: var(--muted); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--asphalt); }
.tabbar a.active svg { color: var(--asphalt); }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; text-decoration: none; font-weight: 650; color: var(--asphalt); }
.nav-link svg { width: 20px; height: 20px; color: var(--muted); }
.nav-link.active { background: var(--paper); box-shadow: var(--shadow); }
.nav-link.active svg { color: var(--asphalt); }
@media (min-width: 900px) {
  .app-nav { display: block; width: 220px; flex: none; padding: 16px 10px; position: sticky; top: 52px; align-self: flex-start; }
  .tabbar { display: none; }
  .app-main { padding: 20px 24px 40px; }
}
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head h1 { margin: 0; font-size: 1.5rem; }
.page-head .spacer { flex: 1; }

/* Живая очередь менеджера */
.posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.post { background: var(--paper); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); border-top: 6px solid var(--line); }
.post.busy { border-top-color: var(--signal); }
.post .p-title { font-size: 0.85rem; color: var(--muted); font-weight: 650; }
.post .p-ticket { font-size: 1.6rem; font-weight: 850; letter-spacing: -0.02em; }
.post .p-car { font-size: 0.9rem; }
.post .p-time { font-size: 0.82rem; color: var(--muted); }
.post .p-actions { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.post .p-empty { color: var(--muted); padding: 10px 0 4px; }

.q-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.q-item { background: var(--paper); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; }
.q-item.first { outline: 3px solid var(--signal); }
.q-ticket { font-size: 1.45rem; font-weight: 850; letter-spacing: -0.02em; min-width: 3.4em; font-variant-numeric: tabular-nums; }
.q-info .q-name { font-weight: 700; }
.q-info .q-sub { color: var(--muted); font-size: 0.9rem; }
.q-plate { display: inline-block; border: 2px solid var(--asphalt); border-radius: 5px; padding: 0 6px; font-weight: 750; letter-spacing: 0.05em; font-size: 0.88rem; background: #fff; }
.q-actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.q-actions .btn-signal { flex: 1 1 160px; }
@media (min-width: 700px) {
  .q-item { grid-template-columns: auto 1fr auto; }
  .q-actions { grid-column: auto; margin-top: 0; }
  .q-actions .btn-signal { flex: none; }
}
.empty { text-align: center; padding: 34px 16px; background: var(--paper); border-radius: var(--radius); color: var(--muted); }
.empty b { display: block; color: var(--asphalt); font-size: 1.1rem; margin-bottom: 6px; }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 650; }
.switch input { appearance: none; width: 48px; height: 28px; border-radius: 99px; background: var(--line); position: relative; cursor: pointer; transition: background 0.15s; margin: 0; flex: none; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked { background: var(--go); }
.switch input:checked::after { transform: translateX(20px); }

/* Таблицы */
.table-wrap { overflow-x: auto; background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table-wrap table.data { min-width: 640px; }
.table-wrap table.data td { white-space: nowrap; }
table.data th, table.data td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--concrete); vertical-align: top; }
table.data th { font-size: 0.82rem; color: var(--muted); font-weight: 650; background: #f8f9fa; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.click { cursor: pointer; }
table.data tr.click:hover td { background: #f8f9fa; }

.svc-row { display: grid; grid-template-columns: 1fr 140px auto; gap: 8px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--concrete); }
.svc-row:last-child { border-bottom: 0; }
.svc-row input:not([type=checkbox]) { min-height: 44px; }
@media (max-width: 599px) {
  .svc-row { grid-template-columns: 1fr auto; }
  .svc-row > :first-child { grid-column: 1 / -1; }
  .svc-row.svc-head { display: none; }
}
.svc-row .svc-actions { display: flex; gap: 6px; align-items: center; }

.qr-box { display: grid; gap: 18px; }
.qr-img { width: 100%; max-width: 260px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
.copy-line { display: flex; gap: 8px; }
.copy-line input { flex: 1; font-size: 0.92rem; }
@media (min-width: 700px) { .qr-box { grid-template-columns: 260px 1fr; align-items: start; } }

.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 18px; }
@media (min-width: 700px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .v { font-size: 1.9rem; font-weight: 850; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); font-size: 0.86rem; }

.plan-list { display: grid; gap: 10px; }
@media (min-width: 700px) { .plan-list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.plan { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; }
.plan.current { border-color: var(--asphalt); }
.plan .price { font-size: 1.6rem; font-weight: 850; margin: 4px 0; }

.sched-row { display: grid; grid-template-columns: 30px auto minmax(0, 1fr) minmax(0, 1fr); gap: 8px; align-items: center; margin-bottom: 8px; }
.sched-row input[type=time] { min-height: 44px; padding: 8px 6px; min-width: 0; font-size: 0.95rem; }
.sched-row input[type=time]:disabled { opacity: 0.4; }
.sched-row .d { font-weight: 700; }

.dialog-back { position: fixed; inset: 0; background: rgba(30, 38, 48, 0.55); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.dialog { background: var(--paper); width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; padding: 20px; max-height: 90vh; overflow: auto; }
@media (min-width: 600px) { .dialog-back { align-items: center; } .dialog { border-radius: 18px; } }
.dialog h2 { margin-bottom: 14px; }
.dialog .d-actions { display: flex; gap: 10px; margin-top: 8px; }
.dialog .d-actions .btn { flex: 1; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: 0.94rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-word; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.filters input { flex: 1 1 220px; min-height: 44px; }
.filters select { width: auto; min-height: 44px; }

@media print {
  .no-print { display: none !important; }
}

.called-screen .c-post { align-self: flex-start; }
@media (max-width: 420px) { .app-top .logo span { display: none; } .app-top .org { max-width: 60vw; } }

/* Счётчик в меню */
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--stop); color: #fff; font-size: 0.75rem; font-weight: 800; display: inline-grid; place-items: center; }
.tabbar a { position: relative; }
.tabbar a .nav-badge { position: absolute; top: 4px; left: calc(50% + 6px); margin: 0; }

/* Обратная связь */
.fb-list { display: grid; gap: 10px; }
.fb-item { background: var(--paper); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.fb-item.is-new { border-left: 5px solid var(--signal); }
.fb-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; font-size: 0.9rem; }
.fb-head .when { color: var(--muted); margin-left: auto; }
.fb-msg { white-space: pre-wrap; word-break: break-word; }
.fb-reply { margin-top: 12px; background: var(--concrete); border-radius: var(--radius-sm); padding: 10px 12px; }
.fb-reply b { display: block; font-size: 0.85rem; margin-bottom: 2px; }
.fb-reply.fresh { background: #fff3c4; }
.fb-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fb-tabs a { text-decoration: none; padding: 6px 12px; border-radius: 99px; border: 2px solid var(--line); font-weight: 650; font-size: 0.9rem; background: var(--paper); }
.fb-tabs a.active { border-color: var(--asphalt); }
.fb-admin { margin-top: 12px; display: grid; gap: 8px; }
.fb-admin textarea { min-height: 70px; }
@media (max-width: 899px) { body:has(.tabbar) .toast-wrap { bottom: calc(84px + env(safe-area-inset-bottom)); } }
