/* PR PRO — shared light design tokens. See design-system/pr-pro/MASTER.md. */
:root {
  color-scheme: light;
  --bg: #f5f5f7; --bg2: #ffffff; --bg3: #eeeef2; --bg-soft: #f5f5f7;
  --border: #e3e5eb; --text: #1d1d1f; --muted: #636875;
  --accent: #0066d6; --accent-soft: #edf5ff; --green: var(--accent); --red: #c33236; --yellow: #936211;
  --shadow: 0 4px 24px rgb(24 39 75 / 4%); --radius: 22px;
  --ease: cubic-bezier(.22,1,.36,1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

/* Sidebar */
.sidebar {
  width: 220px;
  min-height: 100vh;
  background: var(--bg2);
  border-right: 1px solid var(--border);
  padding: 20px 0;
  flex-shrink: 0;
}

.logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  padding: 0 20px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.logo sup { font-size: 11px; }

.nav-link {
  display: block;
  padding: 8px 20px;
  color: var(--muted);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all .15s;
}

.nav-link:hover { color: var(--text); background: var(--bg3); }
.nav-link.active { color: var(--text); border-left-color: var(--accent); background: var(--bg3); }

.nav-section {
  padding: 16px 20px 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
}

/* Content */
.content {
  flex: 1;
  padding: 32px;
  max-width: 1100px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.page-header h1 { font-size: 22px; font-weight: 600; }

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: 12px;
}

/* Buttons */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: opacity .15s;
  text-decoration: none;
  display: inline-block;
}

.btn:hover { opacity: .85; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-success { background: var(--green); color: #fff; }
.btn-danger  { background: var(--red);   color: #fff; }
.btn-secondary { background: var(--bg3); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* Status */
.status {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.status-running { background: var(--accent-soft); color: var(--green); }
.status-stopped { background: rgba(100,116,139,.15); color: var(--muted); }
.status-error   { background: rgba(239,68,68,.15);  color: var(--red);   }
.status-ready   { background: var(--accent-soft); color: var(--green); }
.status-pending { background: rgba(176,125,32,.18); color: var(--yellow); }

/* Badge */
.badge {
  background: rgba(99,102,241,.15);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

/* Table */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg2);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--bg3); }

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

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }

.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 8px;
}

.card-title { font-weight: 600; margin-right: 8px; }
.card-meta { font-size: 12px; margin-bottom: 14px; }

.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.card-actions form { margin: 0; }

/* Logs */
.logs {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.logs-inner {
  max-height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.log-line {
  font-size: 12px;
  font-family: 'SF Mono', Monaco, monospace;
  color: var(--text);
  line-height: 1.5;
}

.log-time { color: var(--muted); margin-right: 6px; }

.logs-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.log-system { color: var(--muted); font-size: 11px; }
.log-msg { color: var(--text); font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--border); }

/* Messages */
.messages { display: flex; flex-direction: column; gap: 10px; }

.message {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}

.msg-agent { font-weight: 600; margin-right: 8px; }
.msg-chat  { margin-right: 8px; font-size: 12px; }
.msg-time  { font-size: 12px; }
.msg-text  { margin-top: 6px; line-height: 1.5; }

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

.modal.open { display: flex; }

.modal-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  width: 460px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h2 { font-size: 18px; }
.modal-close { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 18px; }

/* Forms */
.field { margin-bottom: 16px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.field input, .field select, .field textarea {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-size: 14px;
}

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--accent);
}

/* Красивые окна ввода текста (проблема разговора, поддержка, факты) */
textarea:not(.mono) {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  transition: border-color .12s, box-shadow .12s;
}
textarea:not(.mono):focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(58,63,74,.08);
}
textarea::placeholder { color: var(--muted); opacity: .6; }

/* Misc */
.muted { color: var(--muted); }
.link  { color: var(--accent); text-decoration: none; }
.link:hover { text-decoration: underline; }
.empty { color: var(--muted); padding: 40px; text-align: center; }
.empty-chats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 74px;
  padding: 20px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: var(--bg2);
  font-size: 14px;
}
.empty-chats-icon { font-size: 20px; }

/* Аналитика временно недоступна */
.analytics-coming-soon {
  min-height: 360px;
  padding: 24px;
  border: 1px solid rgba(74, 79, 88, .28);
  border-radius: 14px;
  background: rgba(74, 79, 88, .10);
  opacity: .78;
}
.analytics-coming-card {
  display: flex;
  min-height: 230px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  text-align: center;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
}
.analytics-coming-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}
.analytics-coming-card h2 { font-size: 17px; }
.analytics-coming-card p { max-width: 360px; color: var(--muted); }

/* ── Login ── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.login-box {
  width: 360px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px;
}

.login-logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
}

.login-sub {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.login-error {
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 13px;
}

/* ── Client ── */
.client-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.client-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.client-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

.client-project {
  font-weight: 600;
  font-size: 16px;
  flex: 1;
}

.client-section { margin-bottom: 40px; }

.client-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 16px;
}

.client-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.client-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color .15s;
}

.client-card:hover { border-color: var(--accent); }

.client-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.client-agent-name { font-weight: 600; min-width: 0; }
.client-card-top > .status { white-space: nowrap; flex-shrink: 0; }
.client-mask, .client-card-sub { font-size: 12px; color: var(--accent); margin-bottom: 4px; }
.client-chat { font-size: 12px; }

.client-history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.run-header-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.run-status-group { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.run-sent-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 6px;
  border-radius: 100px;
  background: #eaf6ee;
  color: #20603a;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}
.run-sent-count .ui-icon { width: 13px; height: 13px; }

.client-messages { display: flex; flex-direction: column; gap: 10px; }
.client-pagination { display:flex; align-items:center; gap:12px; margin-top:18px; }
.client-runs-archive { max-width:1100px; }

.client-msg {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
}

.client-msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.client-msg-agent { font-weight: 600; font-size: 13px; }
.client-msg-text { line-height: 1.6; }

/* ── Сцены / спектакли ── */
.status-playing { background: rgba(176,125,32,.18); color: var(--yellow); }
.status-preparing { background: rgba(176,125,32,.18); color: var(--yellow); }
.status-done    { background: var(--accent-soft);  color: var(--green); }
.status-idle    { background: rgba(100,116,139,.15); color: var(--muted); }

.scene-transcript { display: flex; flex-direction: column; gap: 10px; max-width: 720px; }

.scene-line {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}

.scene-line.role-seeking { border-left-color: #2d6ea3; }
.scene-line.role-skeptic { border-left-color: #a15b2d; }
.scene-line.role-client  { border-left-color: var(--green); }

.scene-line-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.scene-speaker { display: flex; align-items: center; flex-wrap: wrap; min-width: 0; gap: 4px 8px; }
.scene-agent { font-weight: 600; }
.scene-role { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.scene-text { line-height: 1.5; }

.brand-tag {
  background: var(--accent); color: #fff;
  font-size: 10px; padding: 1px 7px; border-radius: 10px;
  letter-spacing: .05em;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Компактные инпуты для инлайн-форм (начисление токенов и т.п.) */
.input-sm {
  padding: 4px 7px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg2);
  color: var(--text);
}
.input-sm::placeholder { color: var(--muted); opacity: .7; }

/* Моноширинный textarea для JSON-редактирования шаблонов */
textarea.mono {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  overflow-wrap: normal;
  tab-size: 2;
}

/* ═══════════ Клиентский кабинет SaaS v2 ═══════════ */
.client-balance {
  margin-left: auto;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  padding: 6px 14px;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.client-balance span { font-size: 12px; font-weight: 500; color: var(--muted); }

/* Флеш-сообщения */
.flash { padding: 10px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.flash-ok  { background: rgba(60,180,110,.12); color: #3cb46e; border: 1px solid rgba(60,180,110,.3); }
.flash-err { background: rgba(224,86,86,.12);  color: #e05656; border: 1px solid rgba(224,86,86,.3); }

.client-subtitle {
  font-size: 14px; font-weight: 600; color: var(--muted);
  margin: 22px 0 12px; text-transform: uppercase; letter-spacing: .04em;
}

/* Сетка шаблонов */
.client-template-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 12px; }
.client-template {
  display: block; padding: 14px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg2); text-decoration: none; color: var(--text); transition: border-color .15s;
}
.client-template:hover { border-color: var(--accent, #6b8cff); }
.client-template-featured {
  border: 3px solid var(--accent, #6b8cff);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent, #6b8cff) 28%, transparent);
}
.client-template-name { font-weight: 600; margin-bottom: 4px; }

/* Список чатов */
.client-chat-list { display: flex; flex-direction: column; gap: 8px; }
.client-chat-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: var(--bg2); border: 1px solid var(--border); border-radius: 8px;
}
.client-chat-info { display: contents; }
.client-chat-ref { font-size: 12px; }
.chat-readiness {
  display: inline-flex; align-self: flex-start; width: fit-content;
  padding: 2px 7px; border-radius: 999px; font-size: 11px; font-weight: 600;
}
.chat-readiness-ready { background: var(--accent-soft); color: var(--green); }
.chat-readiness-pending { background: rgba(176,125,32,.18); color: var(--yellow); }

.client-inline-form { display: flex; gap: 8px; align-items: center; margin-top: 12px; flex-wrap: wrap; }

.client-card-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 12px; align-items: stretch; }
.client-card-actions .client-card-launch { grid-column: 1 / -1; }
.client-card-actions form { display: flex; margin: 0; }
.client-card-actions .btn, .client-card-actions form { flex: 1 1 auto; }
.client-card-actions .btn { text-align: center; white-space: nowrap; }

.client-run-block { margin-bottom: 24px; }

/* Раздел агентов — ровные строки, занятость */
.agents-table td { vertical-align: middle; }
.agent-name { font-weight: 600; }
.agent-jobs { display: flex; flex-wrap: wrap; gap: 6px; }
.agent-job {
  font-size: 12px; padding: 3px 10px; border-radius: 6px;
  background: var(--bg2); border: 1px solid var(--border); color: var(--text);
}
.agent-job b { color: var(--accent); font-weight: 600; }
.admin-chat-agents { display: flex; flex-direction: column; gap: 7px; }
.admin-chat-agent {
  display: flex; justify-content: space-between; gap: 10px; align-items: baseline;
  padding-top: 7px; border-top: 1px solid var(--border); font-size: 13px;
}
.admin-chat-agent .muted { text-align: right; font-size: 12px; }

/* Клиентские формы с подписями (вместо инлайн-плейсхолдеров) */
.client-add-form { display: flex; gap: 14px; align-items: flex-end; flex-wrap: wrap; margin-top: 12px; }
.client-add-form .field { margin-bottom: 0; flex: 1; min-width: 160px; }
.client-add-form .field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }

/* ── Полигон — рабочее место (панель настроек) ── */
.polygon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; }
@media (max-width: 720px) { .polygon-grid { grid-template-columns: 1fr; } }
.polygon-col { min-width: 0; }

/* Сегментные переключатели (radio как кнопки) — ровные, на всю ширину, одинаковой высоты */
.seg { display: flex; align-items: stretch; width: 100%; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg-opt { display: flex; cursor: pointer; flex: 1 1 0; min-width: 0; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 46px; padding: 6px; font-size: 13px; font-weight: 500; color: var(--muted); text-align: center;
  background: var(--bg2); border-right: 1px solid var(--border); transition: background .12s, color .12s;
  user-select: none;
}
.seg-opt span em { font-style: normal; font-size: 10px; font-weight: 400; opacity: .8; }
.seg-opt:last-child span { border-right: none; }
.seg-opt input:checked + span { background: var(--accent); color: #fff; font-weight: 600; }
.seg-opt input:checked + span em { opacity: .9; }
.seg-opt:hover span { color: var(--text); }

/* Подсказка под подписью поля */
.field-hint { font-size: 11px; color: var(--muted); margin-bottom: 6px; line-height: 1.4; }
.niche-fixed { padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-soft, #f4f5f7); font-size: 14px; font-weight: 600; color: var(--text, #1a1a1a); }

/* Мультиполя (формы написания бренда) */
.multi-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.multi-input {
  width: 100%; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 6px; padding: 8px 12px; color: var(--text); font-size: 14px;
}
.multi-input:focus { outline: none; border-color: var(--accent); }

.brand-warn {
  margin-top: 8px; padding: 8px 12px; font-size: 12px; line-height: 1.4;
  background: rgba(176,125,32,.12); color: var(--yellow);
  border: 1px solid rgba(176,125,32,.3); border-radius: 6px;
}

/* Блок стоимости прогона на полигоне */
.cost-box {
  margin-top: 18px; padding: 12px 16px; border-radius: 8px;
  background: var(--bg2); border: 1px solid var(--border); font-size: 14px;
}
.cost-box b { color: var(--text); }

/* Бейдж в навигации (непрочитанная поддержка) */
.nav-badge {
  background: var(--red); color: #fff; font-size: 11px; font-weight: 600;
  padding: 1px 7px; border-radius: 10px; margin-left: 4px;
}

/* Поддержка */
.support-list { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.support-item {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.support-unread { border-left: 3px solid var(--accent); }
.support-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.support-client { font-weight: 600; }
.support-text { line-height: 1.5; margin-bottom: 10px; }
.support-reply {
  font-size: 13px; color: var(--muted); padding: 8px 12px;
  background: var(--bg3); border-radius: 6px;
}
.support-form { display: flex; gap: 8px; align-items: center; }

/* ═══════════ Клиентский кабинет — дашборд ═══════════ */
.cdash { display: flex; min-height: 100vh; width: 100%; }
.cdash-nav {
  width: 230px; flex-shrink: 0; background: var(--bg2); border-right: 1px solid var(--border);
  padding: 22px 0; display: flex; flex-direction: column; min-height: 100vh;
}
.cdash-logo { font-size: 20px; font-weight: 700; color: var(--accent); padding: 0 22px 4px; }
.cdash-logo sup { font-size: 11px; }
.cdash-project { padding: 0 22px 14px; font-size: 13px; color: var(--muted); border-bottom: 1px solid var(--border); }
.cdash-balance {
  margin: 16px 22px; padding: 14px 16px; background: var(--bg3); border: 1px solid var(--border);
  border-radius: 10px; font-size: 26px; font-weight: 700; color: var(--text); text-align: center;
}
.cdash-balance span { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.cnav-list { display: flex; flex-direction: column; margin-top: 6px; }
.cnav {
  padding: 10px 22px; color: var(--muted); text-decoration: none; cursor: pointer;
  border-left: 3px solid transparent; transition: all .12s; font-size: 14px;
}
.cnav:hover { color: var(--text); background: var(--bg3); }
.cnav.active { color: var(--text); border-left-color: var(--accent); background: var(--bg3); font-weight: 600; }

.cdash-main { flex: 1; padding: 32px 40px; max-width: 1100px; }
.cdash-h1 { font-size: 22px; font-weight: 600; margin-bottom: 22px; }

.cmetrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.cmetric { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.cmetric-num { font-size: 30px; font-weight: 700; color: var(--text); }
.cmetric-lbl { font-size: 13px; color: var(--muted); margin-top: 4px; }
.cquick { display: flex; gap: 10px; flex-wrap: wrap; }
.activity-list { display: none; }
.activity-rename { display: inline-block; margin-top: 6px; }
.activity-rename summary { color: var(--accent); cursor: pointer; font-size: 12px; }
.activity-rename form { display: flex; gap: 6px; margin-top: 7px; }
.activity-rename input { min-width: 160px; max-width: 240px; }

/* Telegram Mini App: компактный мобильный кабинет */
@media (max-width: 720px) {
  html, body { min-width: 0; }
  .cdash { display: block; min-height: 100dvh; }
  .cdash-nav {
    box-sizing: border-box; position: sticky; top: 0; z-index: 20;
    width: 100%; min-height: 0; padding: 12px 0 0;
    border-right: 0; border-bottom: 1px solid var(--border);
  }
  .cdash-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 14px; }
  .cdash-brand { min-width: 0; }
  .cdash-logo { padding: 0; font-size: 18px; }
  .cdash-project { padding: 2px 0 0; border: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cdash-balance {
    flex: 0 0 auto; margin: 0; padding: 5px 10px; border-radius: 8px;
    font-size: 15px; text-align: right;
  }
  .cdash-balance span { display: inline; margin: 0 0 0 4px; font-size: 11px; }
  .cnav-list {
    flex-direction: row; overflow-x: auto; overscroll-behavior-x: contain;
    margin-top: 8px; padding: 0 8px 8px; gap: 4px; scrollbar-width: none;
  }
  .cnav-list::-webkit-scrollbar { display: none; }
  .cnav {
    flex: 0 0 auto; padding: 8px 10px; border: 1px solid transparent;
    border-radius: 8px; font-size: 12px; white-space: nowrap;
  }
  .cnav.active { border-left-color: var(--accent); border-color: var(--accent); }
  .cdash-main { box-sizing: border-box; width: 100%; padding: 20px 16px 32px; }
  .cdash-h1 { font-size: 22px; margin-bottom: 16px; }
  .cmetrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
  .cmetric { padding: 12px 8px; border-radius: 10px; text-align: center; }
  .cmetric-num { font-size: 24px; }
  .cmetric-lbl { font-size: 11px; line-height: 1.25; }
  .cquick { display: grid; grid-template-columns: 1fr; gap: 8px; }
  .cquick .btn { width: 100%; box-sizing: border-box; padding: 12px; text-align: center; }
  .client-template-grid { grid-template-columns: 1fr; }
  .client-card, .client-template, .client-chat-row, .support-item { padding: 12px; }
  .client-chat-row { min-width: 0; gap: 10px; }
  .client-chat-info { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; gap: 3px; }
  .client-chat-info .link, .client-chat-ref { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .client-chat-remove { flex: 0 0 auto; margin-left: 0 !important; }
  .client-chat-remove .btn { box-sizing: border-box; display: flex; width: 32px; min-width: 32px; min-height: 32px; align-items: center; justify-content: center; padding: 0; }
  .client-card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: stretch; }
  .client-card-actions form { display: flex !important; width: 100%; margin: 0; }
  .client-card-actions .btn {
    box-sizing: border-box; display: flex; width: 100%; min-height: 42px;
    align-items: center; justify-content: center; line-height: 1.2; text-align: center;
  }
  .client-card-actions form .btn { flex: 1; }
  .activity-table { display: none; }
  .activity-list { display: flex; flex-direction: column; gap: 10px; }
  .activity-card { padding: 13px; background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; }
  .activity-card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  .activity-id { color: var(--accent); font-size: 13px; font-weight: 700; text-decoration: none; }
  .activity-title { display: block; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.35; text-decoration: none; }
  .activity-meta { display: flex; flex-wrap: wrap; gap: 5px 10px; margin-top: 8px; color: var(--muted); font-size: 12px; line-height: 1.35; }
  .activity-rename { display: block; margin-top: 8px; }
  .activity-rename summary { font-size: 12px; }
  .activity-rename form { width: 100%; }
  .activity-rename input { box-sizing: border-box; flex: 1; min-width: 0; width: 100%; }
  .activity-meta span + span::before { content: "·"; margin-right: 10px; color: var(--border); }
  .activity-actions { display: flex; gap: 8px; margin-top: 12px; }
  .activity-actions form { display: flex; margin: 0; }
  .activity-actions .btn { display: flex; min-height: 40px; align-items: center; justify-content: center; }
  .activity-actions form .btn { width: 100%; }
  .scene-line { padding: 12px; }
  .scene-line-head { flex-wrap: nowrap; gap: 8px; margin-bottom: 7px; }
  .scene-speaker { flex: 1 1 auto; }
  .scene-edit-btn {
    box-sizing: border-box; display: inline-flex; width: 32px; min-width: 32px; min-height: 32px;
    margin-left: auto; align-items: center; justify-content: center; padding: 0; font-size: 16px;
  }
  .scene-edit-btn span { display: none; }
  .run-status { display: inline-block; padding: 1px 6px; border-radius: 7px; font-size: 10px; line-height: 1.2; vertical-align: middle; }
  .scene-text { font-size: 14px; line-height: 1.5; }
  .client-add-form, .client-inline-form { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .client-add-form .field { min-width: 0; }
  .support-bubble { max-width: 94%; }
}

/* Состав агентов в конструкторе сценария */
.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 6px; }
.cast-item {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg2); opacity: .45; transition: all .12s;
}
.cast-item.cast-active { opacity: 1; border-color: var(--accent); background: var(--bg3); }
.cast-name { font-weight: 600; font-size: 13px; }
.cast-trait { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.35; }

/* Переписка поддержки в кабинете клиента */
.support-thread { display: flex; flex-direction: column; gap: 8px; max-width: 560px; }
.support-bubble { padding: 10px 14px; border-radius: 12px; font-size: 14px; line-height: 1.45; max-width: 85%; }
.support-bubble-meta { font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.support-out { align-self: flex-end; background: var(--bg3); border: 1px solid var(--border); border-bottom-right-radius: 3px; }
.support-in  { align-self: flex-start; background: rgba(45,122,79,.12); border: 1px solid rgba(45,122,79,.3); border-bottom-left-radius: 3px; }
.support-pending { align-self: flex-start; font-size: 11px; color: var(--muted); padding: 2px 8px; }

/* Мультивыбор чатов в модалке запуска */
.run-chats { display: flex; flex-direction: column; gap: 6px; }
.run-chat-opt { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--bg3);
  cursor: pointer; font-size: 14px; text-transform: none; letter-spacing: 0; }
.run-chat-opt input { width: auto; }
.run-chat-opt:hover { border-color: var(--accent); }

/* Внешние участники чата в ленте прогона */
.scene-line.role-external { border-left-color: var(--muted); opacity: .9; }
.scene-line.role-external .scene-agent { color: var(--muted); }
.scene-ext-tag { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* Редактирование реплик на полигоне */
.scene-edit-btn { margin-left: auto; }
.scene-edit-form { margin-top: 6px; }
.scene-edit-form textarea { width: 100%; }

/* Сегмент из 5 (агитация) — компактнее */
.seg-5 .seg-opt span { padding: 8px 4px; }

/* Прогоны под карточкой сценария */
.camp-runs { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.camp-run-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; }
.camp-run { display: flex; flex: 1 1 auto; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--text);
  text-decoration: none; padding: 4px 8px; border-radius: 6px; }
.camp-run:hover { background: var(--bg3); }
.camp-run-send { font-size: 12px; }

/* Статусы вступления агентов в чаты клиента */
.chat-block { margin-bottom: 4px; }
.chat-status-summary { display: flex; gap: 6px; cursor: pointer; }
.chat-agents-detail {
  margin: 4px 0 8px; padding: 8px 12px; background: var(--bg2);
  border: 1px solid var(--border); border-radius: 8px;
  display: flex; flex-direction: column; gap: 4px;
}
.chat-agent-line { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.badge-ok   { background: var(--accent-soft); color: var(--green); }
.badge-wait { background: rgba(176,125,32,.15); color: var(--yellow); }
.badge-err  { background: rgba(192,57,43,.15); color: var(--red); }

/* Мониторинг: срабатывания */
.hit-list { display: flex; flex-direction: column; gap: 10px; max-width: 760px; margin-bottom: 24px; }
.hit-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 16px;
}
.hit-new { border-left: 3px solid var(--accent); }
.hit-head { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 6px; flex-wrap: wrap; }
.hit-text { line-height: 1.5; margin-bottom: 10px; }
.hit-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hit-reply {
  font-size: 13px; padding: 8px 12px; background: rgba(45,122,79,.1);
  border-radius: 6px; line-height: 1.45;
}

/* Мониторинг: контекст и черновик ответа */
.hit-ctx {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 8px; font-size: 12px;
  max-height: 260px; overflow-y: auto;
}
.ctx-line { padding: 3px 0; line-height: 1.45; }
.hit-draft {
  background: rgba(176,125,32,.08); border: 1px solid rgba(176,125,32,.3);
  border-radius: 8px; padding: 10px 12px;
}

/* Shared Apple-inspired interface: opaque content, translucent navigation. */
html { scroll-padding-top: 24px; }
body { font-size: 15px; line-height: 1.5; letter-spacing: -.015em; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button, a, summary { touch-action: manipulation; }
[hidden] { display: none !important; }
::selection { background: #d5e7ff; color: #163f75; }
a { color: var(--accent); }
.ui-icon { width: 21px; height: 21px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip-link { position: fixed; top: -80px; left: 24px; z-index: 300; padding: 12px 20px; border-radius: 12px; background: white; }
.skip-link:focus { top: 16px; }
:where(a, button, input, textarea, select, summary):focus-visible { outline: 3px solid #0066d6; outline-offset: 4px; }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; flex: 0 0 auto; border-radius: 13px; color: white; background: #1d1d1f; font-size: 26px; font-weight: 700; letter-spacing: -.09em; padding-right: 3px; }
.logo, .cdash-logo { display: flex; align-items: center; gap: 11px; color: var(--text); font-size: 20px; letter-spacing: -.06em; text-decoration: none; }
.logo small, .cdash-logo small { display: block; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: 0; margin-top: 1px; }
.logo sup, .cdash-logo sup { font-size: 10px; margin-left: 1px; letter-spacing: -.03em; }
.sidebar, .cdash-nav { position: sticky; top: 0; width: 248px; height: 100dvh; min-height: 0; overflow-y: auto; flex-shrink: 0; display: flex; flex-direction: column; padding: 30px 16px 20px; border-right: 1px solid rgb(210 215 225 / 65%); background: #f0f1f5; }
@supports (backdrop-filter: blur(24px)) { .sidebar, .cdash-nav { background: rgb(238 240 246 / 74%); backdrop-filter: blur(24px) saturate(150%); -webkit-backdrop-filter: blur(24px) saturate(150%); } }
.logo { padding: 0 8px 28px; border: 0; margin: 0; }
.nav-section { padding: 24px 14px 10px; font-size: 10px; font-weight: 600; letter-spacing: .1em; color: #727783; }
.nav-link, .cnav { display: flex; align-items: center; gap: 12px; min-height: 46px; margin: 3px 0; padding: 11px 14px; border: 0; border-radius: 12px; color: #535967; font-size: 13px; font-weight: 500; text-decoration: none; transition: background 180ms, color 180ms, box-shadow 180ms; }
.nav-link .ui-icon, .cnav .ui-icon { width: 19px; height: 19px; }
.nav-link:hover, .cnav:hover { background: rgb(255 255 255 / 60%); color: var(--text); }
.nav-link.active, .cnav.active { border: 0; color: var(--accent); background: white; box-shadow: 0 2px 8px rgb(30 50 90 / 5%); font-weight: 600; }
.nav-logout { margin-top: 32px; }
.cdash-top { padding: 0 8px; }
.cdash-logo { padding: 0; }
.cdash-project { padding: 22px 0 0; margin: 0; border: 0; font-size: 13px; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }
.cdash-balance { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; margin: 14px -4px 24px; padding: 8px 6px; border-radius: 14px; border: 1px solid rgb(255 255 255 / 90%); background: rgb(255 255 255 / 60%); text-align: left; font-size: 20px; letter-spacing: -.05em; }
.balance-amount { display: grid; grid-template-columns: auto auto; align-items: baseline; column-gap: 3px; white-space: nowrap; }
.cdash-balance span { font-size: 12px; letter-spacing: 0; margin: 0; }
.cdash-balance .balance-label { grid-column: 1 / -1; font-size: 12px; font-weight: 500; line-height: 1.3; }
.cnav-list { margin: 0 0 22px; }
.content, .cdash-main { min-width: 0; flex: 1; width: 100%; max-width: 1560px; padding: 0 48px 60px; }
.workspace-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 80px; margin-bottom: 36px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.bar-separator { display: inline-block; padding: 0 10px; color: #a9adb6; }
.workspace-role, .project-pill { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; background: white; border: 1px solid var(--border); border-radius: 100px; font-size: 11px; white-space: nowrap; }
.workspace-role .ui-icon { width: 13px; height: 13px; }
.project-pill { color: var(--muted); font-size: 12px; padding: 9px 14px; }
.project-pill .ui-icon { width: 16px; height: 16px; }
.eyebrow { color: var(--muted); font-size: 10px; font-weight: 600; letter-spacing: .12em; margin-bottom: 10px; }
.page-header { gap: 20px; align-items: center; margin-bottom: 30px; }
.page-header h1, .cdash-h1 { font-size: clamp(28px, 2.8vw, 40px); line-height: 1.15; font-weight: 650; letter-spacing: -.055em; margin-bottom: 0; }
.cdash-h1 { margin-bottom: 26px; }
.page-header .cdash-h1 { margin-bottom: 0; }
.page-description { color: var(--muted); font-size: 14px; margin-top: 12px; letter-spacing: -.01em; }
.section-title, .client-subtitle { margin: 32px 0 16px; color: var(--text); font-size: 17px; font-weight: 600; letter-spacing: -.025em; text-transform: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 11px 19px; border-radius: 100px; font-size: 13px; font-weight: 550; line-height: 1.3; cursor: pointer; transition: background 180ms, box-shadow 180ms, transform 220ms var(--ease); }
.btn .ui-icon { width: 17px; height: 17px; }
.btn:hover { opacity: 1; box-shadow: 0 4px 14px rgb(30 45 80 / 9%); transform: translateY(-1px); }
.btn:active { transform: scale(.97); box-shadow: none; }
.btn:disabled { cursor: default; opacity: .5; transform: none; box-shadow: none; }
.btn-primary { background: var(--accent); color: white; box-shadow: 0 2px 5px rgb(0 102 214 / 13%); }
.btn-primary:hover { background: #005cbe; }
.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f7f9fc; }
.btn-success { background: var(--accent); color: white; }
.btn-success:hover { background: #005cbe; }
.btn-danger { color: var(--red); background: #fff0f0; border: 1px solid #f4d5d6; }
.btn-danger:hover { background: #ffe4e5; }
.btn-sm { min-height: 44px; padding: 9px 14px; font-size: 12px; }
.btn.balance-top-up {
  position: relative; isolation: isolate; min-height: 26px; padding: 0 6px; border: 0;
  color: var(--accent); background: transparent; font-size: 11px; letter-spacing: 0; white-space: nowrap;
}
.btn.balance-top-up::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: 50% 0 auto; height: 22px; transform: translateY(-50%);
  border-radius: inherit; background: var(--accent-soft);
}
.btn.balance-top-up:hover { background: transparent; box-shadow: none; transform: none; }
.btn.balance-top-up:hover::before { background: #e2efff; }
.btn.balance-top-up:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.modal-close { display: grid; place-items: center; height: 44px; width: 44px; border-radius: 50%; background: var(--bg3); flex-shrink: 0; }
.cmetrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-bottom: 24px; }
.cmetric { position: relative; min-height: 154px; padding: 46px 26px 24px; border: 1px solid #e9eaf0; border-radius: var(--radius); background: white; box-shadow: var(--shadow); text-align: left; }
.cmetric-num { font-size: 48px; overflow-wrap: anywhere; font-weight: 600; line-height: 1.15; letter-spacing: -.06em; font-variant-numeric: tabular-nums; }
.cmetric-lbl { color: var(--muted); font-size: 15px; margin-top: 10px; }
.metric-icon { position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; padding: 8px; border-radius: 11px; color: #0066d6; background: #edf5ff; }
.cquick { gap: 10px; margin-bottom: 34px; }
.overview-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 20px; }
.feature-card, .guide-card { padding: 32px; border-radius: 26px; min-width: 0; }
.feature-card { position: relative; overflow: hidden; background: #e8effc; border: 1px solid #dee7f8; min-height: 340px; }
.feature-kicker { display: flex; align-items: center; gap: 8px; color: #375b91; font-size: 10px; font-weight: 600; letter-spacing: .09em; position: relative; z-index: 1; }
.feature-kicker .ui-icon { width: 16px; height: 16px; }
.feature-card h2 { position: relative; z-index: 1; margin: 22px 0 16px; color: #203958; font-size: 38px; line-height: 1.08; letter-spacing: -.055em; font-weight: 600; }
.feature-card p { position: relative; z-index: 1; max-width: 280px; color: #536985; font-size: 13px; line-height: 1.7; }
.feature-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 16px; color: #005abf; font-size: 13px; font-weight: 600; text-decoration: none; position: relative; z-index: 1; }
.feature-link .ui-icon { width: 16px; height: 16px; }
.feature-orbit { position: absolute; width: 180px; height: 180px; right: -35px; top: 80px; border: 1px solid rgb(255 255 255 / 80%); border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, rgb(255 255 255 / 72%), rgb(148 185 239 / 24%)); box-shadow: inset 0 2px 12px white, 0 15px 45px rgb(54 100 160 / 10%); transform: rotate(-16deg); }
.feature-orbit .ui-icon { width: 72px; height: 72px; color: #7192c7; stroke-width: .8; }
.guide-card { border: 1px solid var(--border); background: white; box-shadow: var(--shadow); }
.guide-card h2 { font-size: 21px; letter-spacing: -.04em; margin: 12px 0 22px; }
.guide-card > a { display: flex; align-items: center; gap: 12px; padding: 17px 0; border-top: 1px solid #eff0f3; color: var(--text); text-decoration: none; }
.step-number { font-size: 11px; color: #717888; font-variant-numeric: tabular-nums; }
.guide-card b { display: block; font-size: 13px; font-weight: 550; }
.guide-card small { display: block; font-size: 11px; color: var(--muted); margin-top: 4px; }
.guide-card > a > .ui-icon { margin-left: auto; width: 16px; height: 16px; color: #8c95a2; }
.guide-card > a:hover b { color: var(--accent); }
.card, .client-card, .client-template, .support-item, .hit-card { border-color: var(--border); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.cards, .client-cards, .client-template-grid { gap: 18px; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); }
.card { cursor: default; }
.client-card { cursor: default; }
.client-template { transition: border-color 180ms, box-shadow 180ms, transform 220ms var(--ease); }
.client-template:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgb(32 55 90 / 8%); }
.client-template-featured { border: 1px solid #9ac3f5; background: #f7faff; box-shadow: none; }
.client-card-sub, .client-mask { color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: 18px; background: white; box-shadow: var(--shadow); margin-bottom: 24px; }
.table-wrap .table { margin-bottom: 0 !important; border: 0; border-radius: 0; box-shadow: none; }
.table { border-radius: 18px; font-size: 13px; box-shadow: var(--shadow); }
.table th { padding: 17px 20px; color: var(--muted); text-transform: none; font-size: 11px; letter-spacing: 0; background: #fafafc; white-space: nowrap; }
.table td { padding: 17px 20px; border-color: #eff0f4; }
.table tr:hover td { background: #f8faff; }
.table .link { font-weight: 550; }
.actions { gap: 8px; flex-wrap: wrap; }
.status, .badge, .chat-readiness { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 5px 10px; font-size: 11px; border-radius: 7px; line-height: 1.4; overflow-wrap: anywhere; }
.status { border-radius: 100px; }
.badge { color: #315c9b; background: #eef4fe; }
.status-running, .status-ready, .status-done, .chat-readiness-ready { background: var(--accent-soft); color: var(--accent); }
.status-error, .badge-err { color: var(--red); background: #fff0f0; }
.status-playing, .status-preparing, .status-pending, .chat-readiness-pending { color: var(--yellow); background: #fbf2df; }
.status-stopped, .status-idle { color: #616978; background: #eff0f4; }
.field label { text-transform: none; letter-spacing: 0; font-size: 13px; color: #424855; font-weight: 500; margin-bottom: 8px; }
.field { margin-bottom: 22px; }
.field input:not([type=radio]):not([type=checkbox]), .field select, .field textarea, .input-sm, .multi-input, .activity-rename input { border: 1px solid #d9dde5; border-radius: 12px; padding: 12px 14px; min-height: 46px; color: var(--text); background: #fbfbfd; font-size: 14px; transition: border-color 180ms, box-shadow 180ms, background 180ms; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 19px; height: 19px; flex-shrink: 0; }
.field input:focus, .field select:focus, .field textarea:focus, .multi-input:focus, .input-sm:focus { background: white; border-color: var(--accent); box-shadow: 0 0 0 4px #0066d612; }
textarea:not(.mono) { border-radius: 14px; background: #fbfbfd; padding: 14px; font-size: 14px; }
textarea::placeholder { opacity: 1; }
.field-hint { font-size: 12px; line-height: 1.6; margin-bottom: 9px; }
.client-add-form { gap: 16px; padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: white; margin-top: 20px; }
.client-add-form .field label { font-size: 12px; }
.client-chat-row { padding: 17px 20px; border-radius: 14px; flex-wrap: wrap; }
.client-chat-info { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; min-width: 0; flex: 1; }
.client-chat-info .link { font-weight: 550; }
.client-chat-ref { overflow-wrap: anywhere; }
.niche-fixed { background: #eff2f8; border: 0; padding: 14px 16px; border-radius: 12px; }
.seg { border: 0; border-radius: 14px; background: #eceef3; padding: 4px; gap: 4px; }
.seg-opt span { background: transparent; border: 0; border-radius: 10px; min-height: 48px; font-size: 12px; }
.seg-opt input:checked + span { background: white; color: var(--text); box-shadow: 0 2px 5px #1d1d1f12; }
.seg-opt input:checked + span em { color: var(--muted); }
.seg-opt input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: -3px; }
.modal { padding: 24px; background: rgb(30 36 49 / 28%); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.modal-box { width: 500px; max-width: 100%; border: 1px solid rgb(255 255 255 / 90%); border-radius: 26px; padding: 28px; box-shadow: 0 30px 100px #152b4b26; animation: sheet-enter 300ms var(--ease); }
.modal-header h2 { font-size: 23px; letter-spacing: -.04em; }
.modal-header { gap: 12px; }
.modal-box .btn[type=submit] { margin-top: 12px; }
body.modal-visible { overflow: hidden; }
.flash, .login-error, .brand-warn { border-radius: 13px; line-height: 1.6; }
.flash-ok { color: var(--accent); background: var(--accent-soft); border-color: #d5e7ff; }
.flash-err { color: var(--red); background: #fff0f0; border-color: #f3d1d3; }
.empty { padding: 40px 24px; margin-bottom: 18px; border-radius: 18px; border: 1px dashed #d9dde6; background: #ffffff80; font-size: 14px; line-height: 1.7; }
.empty-chats-icon { width: 28px; height: 28px; }
.analytics-coming-soon { padding: 28px; opacity: 1; border: 1px solid var(--border); background: white; border-radius: 22px; }
.analytics-coming-card { background: #f6f8fc; border-color: #dbe3ed; border-radius: 18px; padding: 32px; }
.analytics-coming-icon { width: 54px; height: 54px; background: white; border: 1px solid var(--border); color: var(--accent); }
.support-form { flex-wrap: wrap; }
.support-bubble, .support-reply, .hit-ctx, .hit-draft, .hit-reply, .message, .client-msg, .scene-line { border-radius: 15px; padding: 16px 20px; }
.support-in { background: #edf7f0; border-color: #d5e9dc; }
.support-out { background: #eef4ff; border-color: #dce7f9; }
.scene-transcript, .support-list, .hit-list { max-width: 100%; }
.scene-line-head, .support-head, .client-history-header { flex-wrap: wrap; gap: 10px; }
.scene-role, .scene-ext-tag, .brand-tag { font-size: 11px; text-transform: none; letter-spacing: 0; }
.cost-box { padding: 18px 20px; border-radius: 14px; background: #f1f5fc; border-color: #dbe5f5; }
.camp-run { min-height: 44px; }
.agent-job { border-radius: 8px; background: #f5f7fb; font-size: 11px; padding: 5px 10px; }
.log-line { font-size: 12px; overflow-wrap: anywhere; }
.client-wrap { width: 100%; max-width: 1100px; padding: 0 40px 60px; }
.client-header { min-height: 100px; margin-bottom: 34px; gap: 20px; }
.client-logo { color: var(--text); letter-spacing: -.05em; }
.client-project { font-size: 14px; }
.client-section > .client-title { font-size: 27px; font-weight: 600; text-transform: none; letter-spacing: -.045em; margin-bottom: 26px; }
.client-detail-body .client-section > form { background: white; border: 1px solid var(--border); border-radius: 24px; padding: 30px; box-shadow: var(--shadow); }
.login-body { padding: 32px 20px; background: radial-gradient(ellipse at 25% 15%, #e5edfa, transparent 50%), radial-gradient(ellipse at 80% 90%, #eee7f8, transparent 50%), #f5f5f7; }
.login-box { width: 430px; max-width: 100%; padding: 40px; border: 1px solid white; border-radius: 30px; background: #ffffffd9; box-shadow: 0 18px 70px #2540650c; }
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 650; letter-spacing: -.05em; margin-bottom: 40px; }
.login-brand sup { font-size: 10px; }
.login-brand .brand-mark { width: 36px; height: 36px; font-size: 23px; border-radius: 11px; }
.login-emblem { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 17px; background: #eaf2ff; color: var(--accent); margin-bottom: 18px; }
.login-emblem .ui-icon { width: 25px; height: 25px; }
.login-heading { font-size: 29px; line-height: 1.2; letter-spacing: -.05em; font-weight: 600; margin-bottom: 10px; }
.login-sub { font-size: 13px; margin-bottom: 30px; }
.login-box .btn[type=submit] { min-height: 48px; margin-top: 5px; }
.login-register { width: 100%; min-height: 48px; margin-top: 16px; border-radius: 100px; text-align: center; }
.login-recovery { display: flex; justify-content: center; margin-top: 14px; }
.login-recovery-link { display: inline-flex; align-items: center; justify-content: center; min-height: 32px; padding: 7px 15px; border: 1px solid #e5e7eb; border-radius: 100px; background: #f1f2f5; color: #626874; font-size: 12px; font-weight: 500; line-height: 1.3; text-decoration: none; transition: background 180ms, color 180ms, border-color 180ms; }
.login-recovery-link:hover { background: #e9ebf0; border-color: #dce0e7; color: #4c535f; text-decoration: none; }
.login-recovery-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.recovery-page .login-brand { margin-bottom: 32px; }
.recovery-page .login-heading { font-size: 27px; line-height: 1.2; text-wrap: balance; }
.recovery-page .login-sub { margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.recovery-page form[action="/password/reset"] { margin-top: 24px; }
.recovery-actions { display: grid; gap: 18px; margin-top: 24px; }
.recovery-actions > .btn { width: 100%; min-height: 46px; }
.recovery-support { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 16px; border: 1px solid #e7e9ee; border-radius: 20px; background: #f7f8fa; }
.recovery-support-caption { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; text-align: center; }
.recovery-support-link { background: white; }
.recovery-return { margin-top: 0; }
[data-panel]:not([hidden]) { animation: panel-enter 320ms var(--ease); }
@keyframes panel-enter { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes sheet-enter { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@media (min-width: 1600px) { .content, .cdash-main { padding-left: 64px; padding-right: 64px; } }
@media (max-width: 1120px) { .sidebar, .cdash-nav { width: 220px; } .content, .cdash-main { padding-left: 28px; padding-right: 28px; } .overview-grid { grid-template-columns: 1fr; } .feature-card { min-height: 280px; } .feature-orbit { right: 20px; } .feature-card p { max-width: 65%; } .cmetric { padding: 46px 18px 22px; } .project-pill { display: none; } }
@media (max-width: 760px) {
  .admin-body, .client-body { display: block; }
  .cdash { display: block; }
  .sidebar, .cdash-nav { position: sticky; top: 0; z-index: 30; width: 100%; height: auto; min-height: 0; padding: max(12px, env(safe-area-inset-top)) 16px 10px; border-right: 0; border-bottom: 1px solid var(--border); overflow: visible; }
  .sidebar { display: flex; flex-direction: row; gap: 5px; overflow-x: auto; align-items: center; }
  .sidebar .logo { padding: 0 12px 0 0; margin-right: 5px; }
  .sidebar .logo > span:last-child { display: none; }
  .sidebar .brand-mark { width: 34px; height: 34px; font-size: 22px; border-radius: 11px; }
  .sidebar .nav-section { display: none; }
  .sidebar .nav-link { flex-shrink: 0; white-space: nowrap; min-height: 44px; margin: 0; gap: 6px; font-size: 12px; padding: 10px; }
  .sidebar .nav-logout { margin-top: 0; }
  .cdash-top { display: flex; align-items: center; justify-content: space-between; padding: 0; gap: 12px; }
  .cdash-logo { font-size: 17px; gap: 8px; }
  .cdash-logo .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 22px; }
  .cdash-logo small { font-size: 9px; }
  .cdash-brand { display: flex; align-items: center; gap: 16px; min-width: 0; }
  .cdash-project { padding: 0; font-size: 11px; max-width: 120px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
  .cdash-balance { flex: 0 0 auto; margin: 0; padding: 2px 3px 2px 8px; font-size: 17px; border-radius: 10px; }
  .balance-amount { display: flex; }
  .cdash-balance span { font-size: 10px; }
  .btn.balance-top-up { min-height: 44px; }
  .cnav-list { display: flex; flex-direction: row; gap: 4px; overflow-x: auto; margin: 12px 0 0; padding: 0 0 2px; scrollbar-width: none; }
  .cnav { flex: 0 0 auto; gap: 7px; padding: 10px 12px; min-height: 44px; font-size: 12px; white-space: nowrap; margin: 0; border-radius: 11px; }
  .cnav.active { border: 0; }
  .cnav-list .ui-icon { width: 17px; height: 17px; }
  .content, .cdash-main { padding: 0 20px max(40px, env(safe-area-inset-bottom)); }
  .workspace-bar { min-height: 70px; margin-bottom: 20px; font-size: 10px; }
  .workspace-role { display: none; }
  .page-header { flex-wrap: wrap; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
  .page-header h1, .cdash-h1 { font-size: 31px; }
  .page-description { font-size: 13px; line-height: 1.6; }
  .cmetrics { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 18px; }
  .cmetric { min-height: 146px; padding: 48px 12px 16px; text-align: left; border-radius: 17px; }
  .cmetric-num { font-size: 34px; }
  .metric-icon { top: 10px; right: 10px; margin: 0; width: 30px; height: 30px; padding: 7px; border-radius: 9px; }
  .cmetric-lbl { font-size: 12px; line-height: 1.4; margin-top: 6px; }
  .cquick { gap: 8px; margin-bottom: 24px; }
  .cquick .btn { flex: 1 1 auto; min-height: 44px; font-size: 12px; padding: 11px 14px; }
  .overview-grid { gap: 14px; }
  .feature-card, .guide-card { padding: 26px; border-radius: 22px; }
  .feature-card h2 { font-size: 36px; }
  .feature-card p { max-width: 75%; font-size: 12px; }
  .feature-orbit { width: 140px; height: 140px; right: -40px; top: 100px; }
  .guide-card small { font-size: 11px; }
  .card, .client-card, .client-template, .support-item, .hit-card { padding: 20px; }
  .client-chat-row { padding: 15px; gap: 10px; }
  .client-chat-info { flex: 1 1 160px; display: flex; }
  .table-wrap .table { display: table; width: 100%; min-width: 600px; }
  .table th, .table td { padding: 14px; }
  .activity-table { display: none !important; }
  .activity-list { display: flex; }
  .client-add-form { padding: 18px; }
  .client-add-form .field { flex-basis: 100%; }
  .client-wrap { padding: 0 20px 40px; }
  .client-header { min-height: 90px; gap: 12px; flex-wrap: wrap; padding: 20px 0; margin-bottom: 26px; }
  .client-header .client-project { flex: 1; min-width: 100px; }
  .client-detail-body .client-section > form { padding: 20px; border-radius: 20px; }
  .client-section > .client-title { font-size: 25px; }
  .field-row { flex-wrap: wrap; }
  .field-row .field { flex-basis: 100%; }
  .polygon-grid { grid-template-columns: 1fr; }
  .field input:not([type=radio]):not([type=checkbox]), .field textarea, .field select, textarea:not(.mono), .input-sm { font-size: 16px; }
  .modal { padding: 16px; }
  .modal-box { padding: 24px; max-height: calc(100dvh - 32px); border-radius: 24px; }
  .modal-header h2 { font-size: 22px; }
  .login-box { padding: 30px 26px; border-radius: 26px; }
}
@media (prefers-reduced-transparency: reduce) { .sidebar, .cdash-nav, .login-box { background: #f0f1f5; backdrop-filter: none; -webkit-backdrop-filter: none; } .modal { backdrop-filter: none; -webkit-backdrop-filter: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .btn:hover, .btn:active, .client-template:hover { transform: none; } }
/* Keep icon actions comfortably tappable in compact views. */
.client-chat-remove .btn, .scene-edit-btn { min-width: 44px; min-height: 44px; }
@media (min-width: 721px) and (max-width: 760px) {
  .activity-list { flex-direction: column; gap: 12px; }
  .activity-card { padding: 20px; background: white; border: 1px solid var(--border); border-radius: 18px; }
  .activity-card-top, .activity-actions, .activity-meta { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
  .activity-title { display: block; font-weight: 600; text-decoration: none; }
}


/* Language is selected at entry or Overview and persists across tabs. */
.workspace-tools { display: flex; justify-content: flex-end; padding-top: 20px; }
.workspace-tools + .workspace-bar { min-height: 64px; }
.language-switcher { display: inline-flex; align-items: center; gap: 6px; margin: 0; flex-shrink: 0; }
.language-icon { width: 16px; height: 16px; color: var(--muted); font-size: 22px; line-height: 1; }
.language-options { display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 14px; background: rgb(118 118 128 / 7%); }
.language-options button { min-height: 30px; padding: 0 9px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; transition: background 160ms, color 160ms; }
.language-options button[aria-pressed="true"] { background: white; color: var(--text); box-shadow: 0 1px 4px #1d1d1f14; opacity: 1; cursor: default; }
.language-options button:not(:disabled):hover { color: var(--text); background: #ffffff80; }
.language-options button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.login-box > .language-switcher { display: flex; justify-content: flex-end; margin: -12px -12px 24px 0; }
.client-wrap > .workspace-tools { padding-top: 0; }
@media (max-width: 768px) {
  .workspace-tools { padding-top: 16px; }
  .workspace-tools + .workspace-bar { padding-right: 0; }
  .language-options button { padding-inline: 9px; }
  .workspace-bar > span:first-child { min-width: 0; overflow-wrap: anywhere; }
}
.language-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* Client-managed niche selection. */
.niche-picker { max-width: 560px; margin-bottom: 24px; }
.niche-picker .field { margin-bottom: 12px; }
.niche-picker select { width: 100%; min-width: 0; min-height: 44px; }

/* Run character picker: native radios keep touch and keyboard selection familiar. */
.character-avatar { position: relative; display: inline-grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; overflow: hidden; border-radius: 50%; background: #e7efff; color: #345f9c; font-size: 13px; font-weight: 650; }
.character-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.character-tone-1 { background: var(--accent-soft); color: var(--accent); }
.character-tone-2 { background: var(--accent-soft); color: var(--accent); }
.character-tone-3 { background: var(--accent-soft); color: var(--accent); }
.character-tone-4 { background: var(--accent-soft); color: var(--accent); }
.character-tone-5 { background: var(--accent-soft); color: var(--accent); }
.character-picker { min-width: 0; border: 0; padding: 16px; border-radius: 18px; background: var(--bg); }
.character-picker legend { float: left; width: 100%; margin-bottom: 5px; font-size: 14px; font-weight: 650; }
.character-picker-hint { clear: both; color: var(--muted); font-size: 12px; line-height: 1.5; }
.character-options { display: flex; gap: 10px; overflow-x: auto; padding: 12px 3px 16px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: #bdc9db transparent; }
.character-option { position: relative; flex: 0 0 116px; min-width: 0; cursor: pointer; scroll-snap-align: start; }
.character-option input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.character-card { display: flex; position: relative; height: 100%; min-height: 118px; flex-direction: column; align-items: center; gap: 10px; padding: 15px 8px 12px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg2); transition: border-color .16s, background .16s; }
.character-card .character-avatar { flex-basis: 48px; width: 48px; height: 48px; font-size: 17px; }
.character-name { max-width: 100%; text-align: center; overflow-wrap: anywhere; line-height: 1.3; font-size: 13px; font-weight: 600; }
.character-check { position: absolute; top: 7px; right: 7px; display: grid; place-items: center; width: 18px; height: 18px; background: var(--accent); color: white; border-radius: 50%; font-size: 11px; opacity: 0; }
.character-option:hover .character-card { border-color: var(--accent); }
.character-option input:checked + .character-card { border-color: var(--accent); background: #edf4ff; box-shadow: inset 0 0 0 1px var(--accent); }
.character-option input:checked + .character-card .character-check { opacity: 1; }
.character-option input:focus-visible + .character-card { outline: 3px solid #0066d650; outline-offset: 3px; }
.character-picker-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 3px; }
.character-picker-actions .btn { min-height: 44px; }
.character-empty { padding: 12px 0; }
@media (max-width: 600px) {
  .scene-line-actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .character-picker { padding: 12px; }
  .character-option { flex-basis: 104px; }
  .scene-speaker .scene-agent { overflow-wrap: anywhere; }
}
@media (prefers-reduced-motion: reduce) { .character-card { transition: none; } }


/* Keep saved scenarios bounded so creation stays close to the list. */
.client-scenarios-window {
  max-height: 360px;
  max-height: min(360px, 48dvh);
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: #bdc9db transparent;
  scrollbar-gutter: stable;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--bg);
}
.client-scenarios-window:focus-visible { outline: 3px solid #0066d650; outline-offset: 3px; }
.client-scenarios-window .client-card { min-width: 0; overflow-wrap: anywhere; }
.client-scenarios-window .client-chat-row { flex-wrap: wrap; overflow-wrap: anywhere; }
.client-scenarios-window .client-chat-row > span { min-width: 0; }
@media (max-width: 600px) {
  .client-scenarios-window { padding: 8px; }
}

/* Decorative reserve stack: no link, action, count or hidden account records. */
.character-picker-row { display: flex; min-width: 0; gap: 12px; align-items: stretch; }
.character-picker-row .character-options { flex: 0 1 auto; min-width: 0; }
.character-reserve { position: relative; flex: 0 0 76px; min-height: 118px; margin: 12px 12px 16px 0; pointer-events: none; user-select: none; }
.character-reserve::before, .character-reserve::after { content: ''; position: absolute; inset: 0; border: 1px solid #dce2eb; border-radius: 16px; background: #e8ecf3; }
.character-reserve::before { transform: translate(10px, -5px) rotate(5deg); opacity: .55; }
.character-reserve::after { transform: translate(5px, -2px) rotate(2.5deg); opacity: .8; }
.character-reserve-face { position: relative; z-index: 1; display: flex; height: 100%; min-height: 118px; padding: 15px 8px 12px; flex-direction: column; align-items: center; gap: 10px; border: 1px solid #dce2eb; border-radius: 16px; background: linear-gradient(145deg, #f8faff, #edf0f6); }
.character-reserve-avatar { display: block; width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(145deg, #e1e7f2, #d4ddec); box-shadow: inset 0 0 0 5px #ffffff60; }
.character-reserve-dots { color: #8391a8; font-size: 24px; line-height: 17px; letter-spacing: 3px; }
@media (max-width: 600px) { .character-picker-row { gap: 8px; } .character-reserve { flex-basis: 56px; margin-right: 10px; } .character-reserve-avatar { width: 38px; height: 38px; margin: 5px 0; } }

/* Run archive keeps real entries visible on narrow screens. */
.client-runs-archive { max-width: 1200px; margin: 0 auto; padding-top: 32px; }
.archive-back { margin-bottom: 30px; }
.archive-back > .ui-icon { transform: rotate(180deg); }
.archive-header { margin-bottom: 30px; }
.archive-header .cdash-h1 { margin-bottom: 0; }
.archive-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.archive-table-wrap .table { border: 0; margin: 0; }
.archive-run-list { display: none; }
.client-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 16px; padding: 24px 0; }
.archive-run-card { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: white; box-shadow: var(--shadow); }
.archive-run-top, .archive-run-bottom { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.archive-run-card h2 { margin: 18px 0 6px; font-size: 19px; line-height: 1.35; overflow-wrap: anywhere; }
.archive-run-card h2 a { color: var(--text); text-decoration: none; }
.archive-run-card p { overflow-wrap: anywhere; }
.archive-run-bottom { margin-top: 18px; font-size: 12px; }
@media (max-width: 760px) {
  .client-runs-archive { padding-top: 24px; }
  .archive-back { margin-bottom: 24px; }
  .archive-table-wrap { display: none; }
  .archive-run-list { display: grid; gap: 14px; }
}

.overview-language { display: flex; justify-content: flex-end; margin: -12px 0 24px; }

/* Monitoring: native radio plans with a clear one-time price. */
.monitor-pricing { min-width: 0; margin: 28px 0 18px; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg2); }
.monitor-pricing-title { margin: 0 0 8px; font-size: 17px; line-height: 1.35; font-weight: 650; letter-spacing: -.3px; }
.monitor-pricing-lead { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 18px; }
.monitor-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.monitor-plan { position: relative; min-width: 0; cursor: pointer; }
.monitor-plan input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.monitor-plan-card { display: flex; flex-direction: column; min-height: 174px; padding: 16px 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg); transition: border-color .18s, background .18s, box-shadow .18s; }
.monitor-plan-top { display: flex; align-items: center; justify-content: space-between; gap: 5px; min-height: 20px; }
.monitor-plan-note { color: var(--muted); font-size: 11px; line-height: 1.35; }
.monitor-plan-check { display: grid; place-items: center; flex: 0 0 18px; height: 18px; border: 1px solid #c9ced8; border-radius: 50%; color: transparent; font-size: 11px; }
.monitor-plan-duration { margin: 16px 0 20px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.monitor-plan-duration b { margin-right: 3px; color: var(--text); font-size: 32px; font-weight: 650; letter-spacing: -1.4px; line-height: 1; }
.monitor-plan-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; margin-top: auto; }
.monitor-plan-stars { font-size: 20px; line-height: 1.4; white-space: nowrap; }
.monitor-plan-price small { width: 100%; color: var(--muted); font-size: 11px; }
.monitor-plan:hover .monitor-plan-card { border-color: #9cbce1; }
.monitor-plan input:checked + .monitor-plan-card { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.monitor-plan input:checked + .monitor-plan-card .monitor-plan-check { color: white; border-color: var(--accent); background: var(--accent); }
.monitor-plan input:focus-visible + .monitor-plan-card { outline: 3px solid #0066d640; outline-offset: 3px; }
.monitor-pricing-details { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 17px 0; color: var(--muted); font-size: 12px; }
.monitor-pricing-details > span { display: inline-flex; align-items: center; gap: 7px; }
.monitor-pricing-details .ui-icon { width: 15px; height: 15px; }
.monitor-reply-price { display: flex; align-items: center; justify-content: space-between; gap: 15px; border-top: 1px solid var(--border); padding-top: 16px; }
.monitor-reply-price > span { display: grid; gap: 4px; }
.monitor-reply-price b { font-size: 13px; font-weight: 600; }
.monitor-reply-price small { font-size: 11px; color: var(--muted); line-height: 1.45; }
.monitor-reply-price > strong { flex-shrink: 0; font-size: 21px; font-weight: 650; }
.monitor-reply-price strong span { font-size: 20px; }
.monitor-purchase { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 15px; min-height: 50px; padding: 13px 20px; border-radius: 16px; }
.monitor-purchase-cost { padding-left: 18px; border-left: 1px solid #ffffff55; white-space: nowrap; font-weight: 650; }
@media (max-width: 560px) {
  .monitor-pricing { padding: 18px 15px; }
  .monitor-plans { grid-template-columns: 1fr; gap: 8px; }
  .monitor-plan-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-height: 86px; gap: 8px 12px; padding: 13px 15px; }
  .monitor-plan-top { grid-column: 1; grid-row: 1; justify-content: flex-start; }
  .monitor-plan-check { order: -1; flex-basis: 16px; height: 16px; }
  .monitor-plan-duration { grid-column: 1; grid-row: 2; margin: 0; font-size: 13px; }
  .monitor-plan-duration b { font-size: 26px; }
  .monitor-plan-price { grid-column: 2; grid-row: 1 / 3; align-self: center; justify-content: flex-end; max-width: 94px; margin: 0; }
  .monitor-plan-price small { text-align: right; }
  .monitor-pricing-details { gap: 9px; flex-direction: column; }
}

/* Three short steps explain monitoring without a paragraph of instructions. */
.monitor-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; max-width: 620px; padding: 0; margin: 22px 0 30px; list-style: none; }
.monitor-flow li { position: relative; display: flex; align-items: center; gap: 10px; min-width: 0; }
.monitor-flow li:not(:last-child)::after { content: '→'; position: absolute; right: -21px; top: 8px; color: #a8afbb; font-size: 15px; }
.monitor-flow-icon { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: 12px; background: white; color: var(--accent); }
.monitor-flow-icon .ui-icon { width: 18px; height: 18px; }
.monitor-flow b { display: block; font-size: 12px; line-height: 1.4; font-weight: 600; }
.monitor-flow small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.monitor-notifications { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 16px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg2, #fff); }
.monitor-notifications-info { display: flex; align-items: center; gap: 10px; }
.monitor-notifications-info b, .monitor-notifications-info small { display: block; }
.monitor-notifications-info small { margin-top: 3px; color: var(--muted); }
.monitor-notifications .btn { text-align: center; white-space: normal; }
.monitor-notifications .flash { flex-basis: 100%; margin: 0; }
.monitor-reply-price > span { min-width: 0; }
.monitor-reply-price small { max-width: 490px; }
@media (max-width: 560px) {
  .monitor-notifications .btn { width: 100%; }
  .monitor-flow { gap: 20px; margin: 20px 0 25px; }
  .monitor-flow li { flex-direction: column; text-align: center; align-items: center; gap: 8px; }
  .monitor-flow li:not(:last-child)::after { top: 9px; right: -16px; }
  .monitor-flow b { font-size: 11px; }
  .monitor-flow small { font-size: 10px; }
}

.client-body .cdash-main { padding-top: 32px; }
@media (max-width: 560px) { .client-body .cdash-main { padding-top: 24px; } }

/* Compact steps share monitoring icons and visual hierarchy. */
.overview-path { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; max-width: 620px; margin: 0 0 24px; padding: 0; list-style: none; }
.overview-path li { position: relative; min-width: 0; }
.overview-path li:not(:last-child)::after { content: '→'; position: absolute; right: -18px; top: 8px; color: #a8afbb; font-size: 15px; }
.overview-path a { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 0 4px; color: var(--text); text-decoration: none; }
.overview-path b { font-size: 12px; line-height: 1.4; font-weight: 600; }
.overview-path a:hover { color: var(--accent); }
.overview-path a:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 12px; }
.overview-monitoring p { margin: 14px 0 24px; max-width: 340px; color: var(--muted); line-height: 1.65; }
@media (max-width: 560px) { .overview-path { gap: 16px; margin-bottom: 20px; } .overview-path li:not(:last-child)::after { right: -13px; } .overview-path b { font-size: 11px; } }

.overview-title { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.access-case { background: var(--surface, #fff); border: 1px solid var(--border, #dce4ef); border-radius: 20px; padding: 24px; margin: 24px 0; overflow-wrap: anywhere; }
.access-case-overdue { border-left: 4px solid #d97706; }
.access-case h2 { font-size: 20px; line-height: 1.4; margin: 0 0 12px; }
.access-case details { margin: 16px 0; }
.access-case summary { cursor: pointer; }
.access-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 20px 0; }
.access-form .field { margin: 0; min-width: 0; }
.access-form label { display: block; }
.access-form input, .access-form select, .access-form textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 6px; }
.access-form textarea { min-height: 80px; }
#access-badge[hidden] { display: none; }
@media (max-width: 700px) { .access-form { grid-template-columns: 1fr; } .access-case { padding: 16px; } }

.verification-card { background: var(--surface, #fff); color: var(--text, #202733); border: 1px solid var(--border, #dce4ef); border-radius: 22px; padding: 24px; margin: 20px 0; overflow-wrap: anywhere; }
.verification-card h3 { margin: 10px 0 14px; font-size: 20px; line-height: 1.35; }
.verification-kicker { color: #336ba5; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.verification-card p { margin: 8px 0; }
.verification-instruction { white-space: pre-wrap; border-left: 3px solid #3978b9; padding-left: 14px; }
.verification-image { display: block; max-width: 100%; max-height: 360px; width: auto; height: auto; margin: 16px 0; object-fit: contain; border-radius: 12px; }
.verification-options { border: 0; padding: 0; margin: 16px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.verification-options legend { padding: 0; margin-bottom: 8px; }
.verification-options label { min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; background: #f0f5fb; border: 1px solid #d7e2f0; border-radius: 12px; cursor: pointer; }
.verification-options input { accent-color: #2869ac; }
.verification-status { font-size: 14px; line-height: 1.5; }
@media (max-width: 600px) { .verification-card { padding: 18px; } .verification-card .btn { width: 100%; } }

/* Replacement choices grouped by operator-assigned gender. */
.character-gender-group { width: 100%; }
.character-gender-title { font-size: 13px; font-weight: 600; margin: 0 0 8px; }
.character-gender-options { display: flex; gap: 8px; overflow-x: auto; padding: 3px 3px 12px; }
.character-gender-options .character-option { flex: 0 0 100px; }
.character-picker-row .character-options:has(.character-gender-group) { flex: 1; overflow: hidden; }
@media (max-width: 600px) { .character-gender-options .character-option { flex-basis: 80px; } }
.character-options:has(.character-gender-group) { flex-direction: column; }

/* Shared logo asset: keep the complete white speech-bubble outline visible. */
.brand-logo { display: block; width: 112px; height: auto; max-width: 100%; object-fit: contain; flex-shrink: 0; }
.login-brand .brand-logo { width: 128px; }
.cdash-logo, .logo { flex-direction: column; align-items: flex-start; gap: 6px; letter-spacing: normal; }
.client-logo .brand-logo { width: 84px; }
@media (max-width: 760px) {
  .cdash-logo .brand-logo, .sidebar .brand-logo { width: 80px; }
  .cdash-logo small { display: none; }
  .client-logo .brand-logo { width: 72px; }
}

/* Bound monitoring scope selection while keeping duration close by. */
.monitor-chats-window { max-height: 240px; max-height: min(240px, 32dvh); overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #bdc9db transparent; scrollbar-gutter: stable; padding: 8px 12px; margin-top: 10px; border: 1px solid var(--border); border-radius: 18px; background: var(--bg); }
.monitor-chats-window:focus-visible { outline: 3px solid #0066d650; outline-offset: 3px; }
.monitor-chats-window label { min-height: 36px; }
.monitor-chats-window label span { min-width: 0; overflow-wrap: anywhere; }
.empty.monitor-empty { padding: 16px 20px; margin-bottom: 12px; line-height: 1.5; white-space: pre-line; }

/* Keep adding a chat visible before the saved list. */
.client-add-chat-panel { margin: 0 0 24px; border: 1px solid #cbdcf4; border-radius: 22px; background: #f5f8fe; box-shadow: var(--shadow); }

/* Shared activity/archive cards; one accessible list at every viewport. */
.run-feed { display: flex; flex-direction: column; gap: 14px; max-height: 640px; max-height: min(640px, 70dvh); overflow-y: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #bdc9db transparent; scrollbar-gutter: stable; padding: 3px 10px 3px 3px; }
.run-feed:focus-visible { outline: 3px solid #0066d650; outline-offset: 3px; border-radius: 24px; }
.run-tile { flex-shrink: 0; min-width: 0; padding: 24px; background: var(--bg2); border: 1px solid var(--border); border-radius: 24px; box-shadow: var(--shadow); }
.run-tile-top, .run-tile-tags, .run-tile-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.run-tile-top { justify-content: space-between; gap: 14px; }
.run-tile-id { color: var(--muted); font-size: 13px; font-weight: 500; text-decoration: none; }
.run-tile-id:hover { color: var(--accent); text-decoration: underline; }
.run-tile-date { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
.run-tile-date .ui-icon { width: 16px; height: 16px; }
.run-tile-tags { margin: 22px 0 24px; }
.run-tile-place { display: inline-flex; align-items: center; gap: 7px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; padding: 10px 13px; border-radius: 100px; background: var(--bg3); color: var(--muted); font-size: 13px; font-weight: 500; }
.run-tile-place .ui-icon { flex-shrink: 0; width: 16px; height: 16px; }
.run-tile-tags .status { padding: 10px 13px; font-size: 13px; }
.run-tile-actions { border-top: 1px solid var(--border); padding-top: 18px; }
.run-tile-actions form { margin: 0; }
.run-tile-actions .btn { border-radius: 100px; }
.run-tile-open { margin-right: auto; }
@media (max-width: 420px) {
  .run-tile { padding: 20px 16px; }
  .run-tile-actions .btn { padding-inline: 14px; }
}

/* Each gender keeps its own decorative reserve beside the scroll strip. */
.character-gender-row { display: flex; min-width: 0; gap: 10px; align-items: stretch; }
.character-gender-row .character-gender-options { flex: 0 1 auto; min-width: 0; }
.character-gender-row .character-reserve { margin-top: 3px; margin-bottom: 12px; }

/* Compact quick start beside the language selector. */
.overview-language { align-items: center; justify-content: space-between; gap: 10px; }
.overview-language #tour-replay { font-size: 12px; padding: 7px 12px; min-height: 32px; white-space: nowrap; }

/* Previous messages in monitoring hits */
.hit-ctx { background: transparent; border: 0; padding: 0; max-height: 320px; display: grid; gap: 8px; }
.ctx-line { background: #f3f6fb; border: 1px solid #e4eaf3; border-radius: 14px; padding: 10px 12px; font-size: 13px; overflow-wrap: anywhere; }
.ctx-meta { display: flex; justify-content: space-between; gap: 10px; color: #45658e; margin-bottom: 3px; }
.ctx-meta time { color: #777e8c; font-size: 11px; white-space: nowrap; }
.ctx-text { white-space: pre-wrap; }

/* Monitoring account access uses a compact secondary label. */
.monitor-access { display: block; font-size: 11px; line-height: 1.4; color: var(--muted); margin-top: 4px; font-weight: 400; }
.monitor-access-ready { color: #45658e; }
.monitor-context-load { margin: 8px 0; }
.hit-ctx:empty { display: none; }

.hit-card .character-options { clear: both; }

/* Monitoring: pinned controls, compact rules and separated history. */
.monitor-controls { margin: 0 0 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--bg2, #fff); box-shadow: 0 4px 16px rgb(30 50 90 / 6%); }
.monitor-settings > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; padding: 13px 16px; list-style: none; }
.monitor-settings > summary::-webkit-details-marker { display: none; }
.monitor-settings > summary > span:first-child { min-width: 0; }
.monitor-settings summary b { display: block; font-size: 14px; }
.monitor-settings summary small { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }
.monitor-settings-plan { font-size: 12px; color: #45658e; white-space: nowrap; }
.monitor-settings-plan::after { content: '⌄'; display: inline-block; margin-left: 10px; }
.monitor-settings[open] .monitor-settings-plan::after { transform: rotate(180deg); }
.monitor-controls-body { border-top: 1px solid var(--border); padding: 14px 16px; }
.monitor-controls-body .client-subtitle { margin: 12px 0; font-size: 15px; }
.monitor-rules { display: grid; gap: 8px; margin-bottom: 16px; }
.monitor-rule-card { position: relative; min-width: 0; padding: 12px 60px 12px 12px; border: 1px solid var(--border); border-radius: 13px; background: #fff; }
.monitor-rule-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 13px; }
.monitor-rule-title b { overflow-wrap: anywhere; }
.monitor-rule-title .badge { font-size: 10px; padding: 3px 7px; }
.monitor-rule-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 6px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.monitor-rule-keywords { margin-top: 4px; color: #45658e; font-size: 12px; overflow-wrap: anywhere; }
.monitor-rule-delete { position: absolute; top: 10px; right: 10px; margin: 0; }
.monitor-rule-delete .btn { display: grid; place-items: center; width: 36px; min-width: 36px; height: 36px; min-height: 36px; padding: 0; border-radius: 10px; font-size: 13px; }
.monitor-archive { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 14px; }
.monitor-archive > summary { cursor: pointer; font-size: 16px; font-weight: 600; padding: 10px 0; }
.monitor-archive > summary .badge { margin-left: 6px; font-size: 11px; }
.monitor-archive-body { padding-top: 10px; }
.hit-chat-title { overflow-wrap: anywhere; font-size: 13px; }
.ctx-current { border-color: #b7cde9; background: #edf4ff; }
.ctx-current-label { display: block; color: #45658e; font-size: 10px; margin-bottom: 6px; }
.ctx-current .ctx-meta { flex-wrap: wrap; }
.ctx-current .ctx-meta time { font-size: 10px; }
.hit-card .character-picker { display: flow-root; margin-bottom: 12px; }
.hit-card .monitor-reply-field { clear: both; margin: 0 0 14px; padding: 12px; border: 1px solid #dce6f3; border-radius: 14px; background: #f3f6fb; }
.hit-card .monitor-reply-field label { display: block; text-align: left; margin: 0 0 8px; color: #375b91; font-size: 13px; font-weight: 600; }
.hit-card .monitor-reply-field textarea { display: block; min-height: 80px; height: 80px; resize: vertical; background: #fff; }
.hit-card .monitor-reply-field .field-hint { margin-top: 7px; font-size: 11px; }
.monitor-character-reserve { align-self: stretch; flex: 0 0 76px; margin: 0 12px 0 0; }
.monitor-character-reserve .character-reserve-face { min-height: 100%; }
@media (max-width: 400px) {
  .monitor-settings > summary { padding: 12px; gap: 8px; }
  .monitor-settings summary b { font-size: 13px; }
  .monitor-settings-plan { font-size: 11px; }
  .monitor-controls-body { padding: 12px; }
}

/* One rounded frame marks the scrollable monitoring conversation. */
.hit-card .hit-ctx { border: 1px solid #a9c6eb; border-radius: 18px; padding: 12px; background: #f8fbff; scrollbar-color: #9bbce7 #edf4ff; scrollbar-width: thin; box-shadow: inset 0 0 0 1px rgb(106 158 222 / 6%); }
.hit-card .hit-ctx:focus-visible { outline: 2px solid #6a9ede; outline-offset: 3px; }
.ctx-agent-reply { border-color: #a9c6eb; background: #e9f2ff; }
.monitor-delivery-status:empty { display: none; }

/* Scenario photo editing */
.scene-photo { display:block; width:auto; max-width:min(100%,360px); max-height:320px; object-fit:contain; border-radius:16px; margin:12px 0; border:1px solid var(--border); }
.scene-photo[hidden] { display:none; }
.scene-photo-controls { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; margin:12px 0 4px; }
.scene-photo-button { position:relative; display:inline-flex; align-items:center; gap:8px; cursor:pointer; border-radius:12px; overflow:hidden; }
.scene-photo-button:focus-within { outline:2px solid var(--accent, #7c6aef); outline-offset:3px; }
.scene-photo-input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.scene-photo-hint { font-size:12px; }
.scene-photo-remove { display:inline-flex; align-items:center; gap:6px; font-size:13px; cursor:pointer; }
.scene-photo-feedback { font-size:12px; overflow-wrap:anywhere; }
@media(max-width:600px) { .scene-photo-controls { align-items:flex-start; flex-direction:column; } .scene-photo-button { min-height:44px; } }

/* Draft message actions remain reachable on touch screens. */
.scene-line-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.scene-delete-form { display: inline-flex; margin: 0; }
.scene-delete-btn { min-width: 44px; min-height: 44px; padding: 8px; }

/* Optional campaign context stays compact until the customer opens a field. */
.campaign-context-field { border: 1px solid var(--border); border-radius: 14px; padding: 0; }
.campaign-context-field > summary { cursor: pointer; padding: 14px 16px; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.campaign-context-body { padding: 0 16px 16px; }
.campaign-context-body .field-hint { margin-top: 0; }
.campaign-quality-note { margin: 12px 0 0; font-size: 12px; line-height: 1.6; }

/* Equal action cells on desktop and mobile. */
.client-card-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.client-card-actions > form { display: flex; width: 100%; min-width: 0; margin: 0; }
.client-card-actions .btn { box-sizing: border-box; display: flex; align-items: center; justify-content: center; width: 100%; min-width: 0; min-height: 44px; white-space: normal; }
#generate-button { display: inline-flex; flex-direction: row; align-items: center; gap: 4px; white-space: nowrap; }

/* Keep all four transcript actions on one touch-friendly mobile row. */
.scene-action-icon { flex: 0 0 18px; }
.scene-photo-trigger, .scene-replace-trigger { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
@media (max-width: 600px) {
  .scene-line-actions { flex: 0 0 100%; width: 100%; min-width: 0; flex-wrap: nowrap; gap: 6px; }
  .scene-line-actions .btn { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; padding: 8px; margin: 0; flex: 0 0 44px; }
  .scene-line-actions .scene-action-label, .scene-line-actions .scene-edit-btn span { display: none; }
  .scene-line-actions .scene-delete-form { flex: 0 0 44px; }
}

/* Delivery approval uses the same cards and transcript as the polygon. */
.delivery-page-header, .delivery-panel, .delivery-messages { width: 100%; max-width: 760px; min-width: 0; margin: 0 auto 24px; }
.delivery-page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.delivery-page-header h1 { font-size: 26px; line-height: 1.25; }
.delivery-panel { padding: 24px; border: 1px solid var(--border); border-radius: 24px; background: var(--bg2, #fff); }
.delivery-panel h2, .delivery-messages h2 { font-size: 22px; line-height: 1.3; margin: 0 0 16px; }
.delivery-access { display: flex; align-items: center; gap: 9px; font-size: 14px; line-height: 1.5; margin: 12px 0; }
.delivery-access > span { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--accent); }
.delivery-paid { font-size: 12px; margin: 8px 0 20px; }
.delivery-options { display: grid; gap: 10px; margin: 20px 0; }
.delivery-option { display: flex; align-items: center; gap: 10px; cursor: pointer; line-height: 1.5; }
.delivery-option input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--accent); }
.delivery-schedule, .delivery-date-field { min-width: 0; max-width: 100%; }
.delivery-date-field { margin-bottom: 20px; }
.delivery-date-field[hidden] { display: none; }
.delivery-schedule input[type=datetime-local] { display: block; width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box; -webkit-appearance: none; appearance: none; }
.delivery-schedule input[type=datetime-local]::-webkit-date-and-time-value { min-width: 0; text-align: left; }
.delivery-cancel { margin-top: 12px; }
.delivery-messages .scene-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.delivery-photo-note { font-size: 12px; margin-top: 8px; }
.delivery-check-link { margin: 16px 0; }
.delivery-access-note { line-height: 1.5; margin: 20px 0; }
.delivery-access-note form { margin-top: 12px; }
.delivery-summary-list { margin: 20px 0; display: grid; gap: 12px; }
.delivery-summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 24px; border: 1px solid var(--border); border-radius: 20px; background: var(--bg2, #fff); }
.delivery-summary > div { min-width: 0; }
.delivery-eyebrow { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.delivery-summary h3 { font-size: 18px; line-height: 1.4; margin-bottom: 4px; overflow-wrap: anywhere; }
.delivery-summary .muted { font-size: 13px; line-height: 1.5; }
.delivery-summary > .btn { flex-shrink: 0; }
@media (max-width: 600px) {
  .delivery-page-header { align-items: flex-start; flex-direction: column; gap: 12px; }
  .delivery-page-header h1 { font-size: 24px; }
  .delivery-panel { padding: 20px; border-radius: 20px; }
  .delivery-summary { align-items: stretch; flex-direction: column; gap: 16px; padding: 20px; }
  .delivery-summary > .btn, .delivery-schedule > .btn, .delivery-cancel > .btn { width: 100%; justify-content: center; }
}

.status-awaiting_send { background: #e9f7ef; color: #217a45; white-space: nowrap; }
