:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --border: #e3e8ee;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #16a34a;
  --accent-2: #15803d;
  --accent-ink: #ffffff;
  --accent-soft: #dcfce7;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --side-bg: #ffffff;
  --side-ink: #475569;
  --side-hover: #f1f5f9;
  --side-active: #dcfce7;
  --side-active-ink: #0f172a;
  --bubble-in: #ffffff;
  --bubble-out: #d9fdd3;
  --bubble-ai: #e0f2fe;
  --chat-bg: #efeae2;
  --danger: #dc2626;
  --warn: #f59e0b;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 4px 16px rgb(15 23 42 / 6%);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1117;
    --panel: #111a22;
    --panel-2: #16212b;
    --border: #22303c;
    --text: #e6edf3;
    --muted: #8b9aab;
    --accent: #22c55e;
    --accent-2: #4ade80;
    --accent-ink: #052e12;
    --accent-soft: #123222;
    --green: #22c55e;
    --green-soft: #123222;
    --side-bg: #111a22;
    --side-ink: #8b9aab;
    --side-hover: #16212b;
    --side-active: #123222;
    --side-active-ink: #e6edf3;
    --bubble-in: #1b2731;
    --bubble-out: #144d37;
    --bubble-ai: #12354a;
    --chat-bg: #0d151c;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font-family: Inter, system-ui, sans-serif; font-size: 14px; background: var(--bg); color: var(--text); }
h1 { font-size: 22px; margin: 2px 0 4px; font-weight: 700; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 15px; margin: 0 0 12px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.grow { flex: 1; min-width: 0; }
.error { color: var(--danger); min-height: 1em; margin: 4px 0; font-size: 13px; }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--accent-2); }

input, select, textarea {
  width: 100%; font: inherit; color: inherit; background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent-2); }
textarea { resize: vertical; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; margin-bottom: 12px; }
label .small { font-weight: 400; }

.btn {
  font: inherit; font-weight: 600; border: 1px solid var(--border); background: var(--panel);
  color: var(--text); padding: 8px 14px; border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-2); }
.btn.pill { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 10px 20px; text-transform: uppercase; font-size: 12px; font-weight: 700; letter-spacing: .03em; }
.btn.pill:hover { background: var(--accent-2); }
.btn.danger { color: var(--danger); }
.btn.warn { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--panel-2); color: var(--text); }
.row { display: flex; align-items: center; gap: 12px; }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }

/* Auth */
.auth { min-height: 100%; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border-radius: 16px; padding: 28px; border: 1px solid var(--border); box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; }
.logo { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-weight: 800; }
.tabs { display: flex; gap: 4px; background: var(--panel-2); padding: 4px; border-radius: 10px; margin: 18px 0; }
.tabs button { flex: 1; border: 0; background: none; font: inherit; font-weight: 600; padding: 8px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.tabs button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.auth:not(.register) .register-only { display: none; }

/* Shell / sidebar */
.app { display: flex; height: 100%; }
.sidebar {
  width: 225px; flex: none; position: relative; display: flex; flex-direction: column; gap: 2px;
  padding: 14px 8px; color: var(--side-ink); background: var(--side-bg); border-right: 1px solid var(--border);
  transition: width .2s;
}
.side-user { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.side-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 12px; background: var(--accent); color: var(--accent-ink); }
.side-user-text { display: flex; flex-direction: column; min-width: 0; font-size: 12px; line-height: 1.35; }
.side-user-text b { color: var(--text); }
.side-user-text b, .side-user-text small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text small { opacity: .8; font-size: 11px; }
.collapse-btn {
  position: absolute; right: -11px; top: 22px; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; z-index: 2; box-shadow: var(--shadow);
}
.nav {
  position: relative; display: flex; align-items: center; gap: 12px; font: inherit; font-size: 13px; font-weight: 600;
  border: 0; background: none; color: var(--side-ink); padding: 10px 12px; border-radius: 8px; cursor: pointer; text-align: left;
}
.nav svg { width: 20px; height: 20px; flex: none; fill: currentColor; }
.nav span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav:hover { background: var(--side-hover); color: var(--text); }
.nav.active { background: var(--side-active); color: var(--side-active-ink); }
.nav.active svg { color: var(--accent); }
.nav-badge { margin-left: auto; font-style: normal; font-size: 11px; background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 1px 7px; font-weight: 700; }
.spacer { flex: 1; }
.wa-pill { font-size: 11px; padding: 6px 10px; border-radius: 999px; margin: 0 6px 8px; text-align: center; cursor: pointer; font-weight: 700; background: var(--green-soft); color: var(--green); white-space: nowrap; overflow: hidden; }
.wa-pill.off { background: #fee2e2; color: #b91c1c; }
.sidebar.collapsed { width: 64px; }
.sidebar.collapsed .nav span, .sidebar.collapsed .side-user-text, .sidebar.collapsed .nav-badge { display: none; }
.sidebar.collapsed .nav { justify-content: center; padding: 10px 0; }
.sidebar.collapsed .side-user { padding: 4px 0 18px; justify-content: center; }
.sidebar.collapsed .wa-pill { font-size: 0; padding: 0; width: 12px; height: 12px; margin: 0 auto 10px; background: #4ade80; }
.sidebar.collapsed .wa-pill.off { background: #f87171; }
.sidebar.collapsed .collapse-btn { transform: rotate(180deg); }

main { flex: 1; min-width: 0; height: 100%; }
.view { height: 100%; }
.page { overflow-y: auto; padding: 12px 16px 24px; display: flex; flex-direction: column; gap: 12px; }

/* Header card */
.hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; }
.filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.date-field { margin: 0; position: relative; gap: 0; }
.date-field small { position: absolute; top: 4px; left: 10px; font-size: 9px; color: var(--muted); font-weight: 500; }
.date-field input { padding: 16px 10px 5px; width: 150px; background: var(--panel); }
.search-lg { max-width: 320px; }

/* KPIs */
.kpis { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.kpi { display: flex; align-items: center; gap: 14px; padding: 16px; flex: 0 1 calc(25% - 9px); min-width: 200px; }
.kpi-icon { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; flex: none; font-size: 18px; }
.kpi-label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: .03em; }
.kpi-value { font-size: 20px; font-weight: 800; margin-top: 2px; }
.kpi-sub { font-size: 11px; color: var(--muted); }

/* Charts */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.chart-card { padding: 0; }
.chart-card h3 { display: flex; align-items: center; gap: 8px; padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--border); font-size: 15px; }
.chart-card h3 .ic { color: var(--accent-2); }
.chart-body { padding: 18px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.donut { width: 210px; height: 210px; }
.donut text { font-size: 12px; font-weight: 700; fill: var(--text); }
.legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-empty { color: var(--muted); padding: 60px 0; }

/* Contacts table */
.table-card { padding: 0; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 12px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 10px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--panel-2); }
.table .who { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.table .who .avatar { width: 32px; height: 32px; font-size: 13px; }
.table .last { color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

#ai-model-select { flex: 1; min-width: 0; }
#ai-model { margin-top: 6px; }

/* Roles: what each person sees */
body.is-agent .manager-only { display: none !important; }
body:not(.is-superadmin) .superadmin-only { display: none !important; }

/* Team / admin */
.team-grid { display: flex; flex-direction: column; gap: 12px; }
.team-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
.team-grid .who .small { white-space: nowrap; }
.team-grid .table select { width: auto; padding: 5px 8px; font-size: 13px; }
.you { font-size: 11px; color: var(--muted); font-weight: 500; }
.invite-result { margin-top: 12px; padding: 12px; background: var(--green-soft); border-radius: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 8px; }
.invite-result input { font-size: 12px; background: var(--panel); }
.invite-row { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.invite-row:last-child { border-bottom: 0; }
.perms td, .perms th { padding: 7px 8px; font-size: 12px; text-align: center; }
.perms td:first-child { text-align: left; }
.invite-box { margin: 18px 0 6px; padding: 12px 14px; background: var(--green-soft); border-radius: 10px; font-size: 13px; line-height: 1.5; }
.auth.inviting .tabs, .auth.inviting .register-only.company-only { display: none; }
.seg-sm button { padding: 5px 11px; font-size: 12px; }
#inbox-filter { display: flex; width: 100%; }
#inbox-filter button { flex: 1; padding: 5px 4px; white-space: nowrap; }
.assignee { font-size: 11px; color: var(--muted); white-space: nowrap; }
.badge.mine { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }
.badge.blocked { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }

/* Dropdown / segmented */
.dropdown { position: relative; }
.menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; min-width: 270px; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgb(15 23 42 / 15%); padding: 6px; }
.menu.right { left: auto; right: 0; }
.menu button { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; border: 0; background: none; font: inherit; color: var(--text); text-align: left; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.menu button:hover { background: var(--panel-2); }
.menu small { color: var(--muted); font-size: 12px; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: none; font: inherit; font-weight: 600; padding: 7px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.seg button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow); }
.select-sm { width: auto; min-width: 170px; }
.count-line { margin: -4px 4px 0; }

/* Funnel report */
.report { display: flex; flex-direction: column; gap: 12px; }
.report-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 18px; }
.report-grid { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr); gap: 12px; align-items: start; }
.table-title { padding: 14px 18px; margin: 0; border-bottom: 1px solid var(--border); }
.bars { align-items: stretch; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 36px; align-items: center; gap: 10px; font-size: 13px; }
.bar-row .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 22px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 6px; min-width: 2px; }
.bar-row .val { text-align: right; font-weight: 700; }
.kind-select { width: auto; padding: 4px 8px; font-size: 12px; }
.stage-chip { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.stage-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Inbox */
.inbox { display: flex; }
.list-pane { width: 320px; border-right: 1px solid var(--border); background: var(--panel); display: flex; flex-direction: column; }
.pane-head { padding: 16px; display: flex; flex-direction: column; gap: 12px; border-bottom: 1px solid var(--border); }
.contact-list { overflow-y: auto; flex: 1; }
.contact { display: flex; gap: 10px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border); align-items: center; }
.contact:hover { background: var(--panel-2); }
.contact.active { background: var(--accent-soft); }
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; color: #fff; }
.contact .top { display: flex; justify-content: space-between; gap: 8px; }
.contact .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact .time { font-size: 11px; color: var(--muted); flex: none; }
.contact .preview { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact .meta { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.unread { background: var(--green); color: #fff; border-color: var(--green); }
.badge.human { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.badge.paused { background: #e2e8f0; color: #334155; border-color: #cbd5e1; }
.badge.ai { background: var(--accent-soft); color: var(--accent-2); border-color: transparent; }

.chat-pane { flex: 1; min-width: 0; display: flex; background: var(--chat-bg); }
.empty-state { margin: auto; text-align: center; padding: 24px; }
.empty-state .big { font-size: 44px; }
.chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--panel); border-bottom: 1px solid var(--border); }
.chat-name { font-weight: 600; }
.chat-head .back { display: none; }
.messages { flex: 1; overflow-y: auto; padding: 20px 6%; display: flex; flex-direction: column; gap: 6px; }
.bubble { max-width: 70%; padding: 8px 11px 6px; border-radius: 10px; background: var(--bubble-in); box-shadow: 0 1px 1px rgb(0 0 0 / 8%); white-space: pre-wrap; word-wrap: break-word; line-height: 1.4; }
.bubble.out { align-self: flex-end; background: var(--bubble-out); }
.bubble.ai { align-self: flex-end; background: var(--bubble-ai); }
.bubble .foot { font-size: 11px; color: var(--muted); text-align: right; margin-top: 3px; }
.day-sep { align-self: center; font-size: 12px; background: var(--panel); color: var(--muted); padding: 4px 10px; border-radius: 8px; margin: 8px 0; }
.composer { display: flex; gap: 8px; padding: 10px 16px; background: var(--panel); border-top: 1px solid var(--border); align-items: flex-end; }
.composer textarea { max-height: 140px; resize: none; }

.details-pane { width: 300px; background: var(--panel); border-left: 1px solid var(--border); padding: 16px; overflow-y: auto; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.tag { display: inline-flex; align-items: center; gap: 4px; background: var(--accent-soft); color: var(--text); padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 500; }
.tag button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0; font-size: 13px; }
#d-tag-input { margin-bottom: 12px; }

/* Kanban */
.kanban { flex: 1; display: flex; gap: 12px; overflow-x: auto; align-items: flex-start; padding-bottom: 8px; }
.column { width: 280px; flex: none; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; display: flex; flex-direction: column; max-height: 100%; box-shadow: var(--shadow); }
.column-head { display: flex; align-items: center; gap: 8px; padding: 12px; font-weight: 600; border-bottom: 1px solid var(--border); }
.column-head .dot { width: 10px; height: 10px; border-radius: 50%; }
.column-head .count { color: var(--muted); font-weight: 500; }
.column-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 60px; overflow-y: auto; background: var(--panel-2); border-radius: 0 0 12px 12px; }
.column.drop .column-body { background: var(--accent-soft); }
.card-lead { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); }
.card-lead .name { font-weight: 600; }
.card-lead .preview { color: var(--muted); font-size: 12px; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Settings */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; align-items: start; }
.switch-row { flex-direction: row; align-items: center; gap: 10px; }
.switch-row input { width: 18px; height: 18px; accent-color: var(--accent); }
.qr { display: block; margin: 12px auto; border-radius: 12px; background: #fff; padding: 8px; }
.wa-status { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 12px; }
.wa-status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.wa-status.connected .dot { background: var(--green); }
.wa-status.qr .dot, .wa-status.connecting .dot { background: var(--warn); }
.test-out { margin-top: 12px; padding: 12px; background: var(--bubble-ai); border-radius: 10px; white-space: pre-wrap; }
#test-msg { margin-bottom: 10px; }
ol.steps { padding-left: 18px; color: var(--muted); line-height: 1.6; margin: 0 0 12px; }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); z-index: 10; max-width: calc(100% - 32px); }
.toast.err { background: var(--danger); color: #fff; }

/* Mobile */
@media (max-width: 860px) {
  .app { flex-direction: column-reverse; }
  .sidebar { width: 100% !important; flex-direction: row; padding: 4px; justify-content: space-around; border-right: 0; border-top: 1px solid var(--border); }
  .side-user, .collapse-btn, .spacer, .nav span, .wa-pill, .nav-badge { display: none; }
  .nav { padding: 10px; }
  .nav svg { width: 24px; height: 24px; }
  main { height: calc(100% - 52px); }
  .page { padding: 12px 16px 16px; }
  .list-pane { width: 100%; }
  .inbox.chat-open .list-pane { display: none; }
  .inbox:not(.chat-open) .chat-pane { display: none; }
  .chat-head .back { display: block; }
  .details-pane { position: fixed; inset: 0 0 52px 0; width: 100%; z-index: 5; }
  .bubble { max-width: 85%; }
  .messages { padding: 16px; }
  .settings-grid, .charts { grid-template-columns: 1fr; }
  .kpi { flex: 1 1 calc(50% - 6px); min-width: 0; }
  .date-field input { width: 100%; }
  .filters { width: 100%; }
  .filters .date-field { flex: 1; }
  .search-lg { max-width: none; }
  .report-grid, .team-grid { grid-template-columns: 1fr; }
  .select-sm { flex: 1; }
}

#view-admin .table th, #view-admin .table td { padding: 10px 10px; font-size: 13px; }

/* Site reader + photos */
.site-row input { flex: 1; }
.site-images { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 8px 0 12px; }
.site-images a { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--text); font-size: 11px; }
.site-images img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--border); }
.site-images span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-btn { margin: 0; flex-direction: row; display: inline-flex; font-weight: 600; cursor: pointer; }
.test-row { margin-bottom: 10px; }
.test-preview { max-width: 160px; border-radius: 10px; margin-bottom: 10px; display: block; }
.test-photos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; white-space: normal; }
.test-photos a { width: 120px; font-size: 11px; color: var(--text); text-decoration: none; }
.test-photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 8px; display: block; margin-bottom: 4px; }
.msg-img { display: block; max-width: 260px; max-height: 320px; border-radius: 8px; margin: -2px -4px 6px; cursor: zoom-in; background: rgb(0 0 0 / 5%); min-height: 60px; }

/* Simulator */
.sim-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 12px; align-items: start; }
.sim-phone { padding: 0; overflow: hidden; display: flex; flex-direction: column; height: min(680px, calc(100vh - 210px)); min-height: 420px; }
.sim-phone .chat-head { border-radius: 12px 12px 0 0; }
.sim-messages { background: var(--chat-bg); }
.sim-messages .bubble.out { background: var(--bubble-out); }
.sim-side { display: flex; flex-direction: column; gap: 12px; }
.checklist { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.checklist li { display: flex; gap: 8px; align-items: flex-start; }
.checklist .ok { color: var(--green); font-weight: 700; }
.checklist .no { color: var(--warn); font-weight: 700; }
.checklist small { display: block; color: var(--muted); }
.sim-ideas { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.sim-ideas button { border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit; font-size: 12px; padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.sim-ideas button:hover { border-color: var(--accent); }
.sim-attach { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: var(--panel); border-top: 1px solid var(--border); }
.sim-attach img { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.sim-photo-btn { margin: 0; flex-direction: row; font-size: 20px; padding: 6px 8px; cursor: pointer; }
.sim-note { align-self: center; font-size: 12px; background: #fef3c7; color: #92400e; padding: 6px 12px; border-radius: 8px; max-width: 85%; text-align: center; }
.sim-site-photo { display: block; max-width: 220px; border-radius: 8px; margin: -2px -4px 6px; }
.typing { color: var(--muted); font-style: italic; }
@media (max-width: 860px) { .sim-grid { grid-template-columns: 1fr; } .sim-phone { height: calc(100vh - 230px); } }

/* Plans */
.trial-banner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; background: #fef3c7; color: #92400e; font-size: 13px; font-weight: 600; padding: 8px 16px; border-bottom: 1px solid #fcd34d; }
.trial-banner.blocked { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.trial-banner button { font: inherit; font-size: 12px; font-weight: 700; border: 0; border-radius: 999px; padding: 5px 12px; background: #92400e; color: #fff; cursor: pointer; }
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.plan-card { display: flex; flex-direction: column; gap: 10px; }
.plan-card.featured { border: 2px solid var(--accent); }
.plan-card .price { font-size: 32px; font-weight: 800; }
.plan-card .price small { font-size: 14px; color: var(--muted); font-weight: 600; }
.plan-card ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; flex: 1; }
.plan-card .tag { align-self: flex-start; }
.plan-foot { margin: 0 4px; }
.plan-chosen { background: var(--green-soft); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin: 0 0 12px; }
body.is-blocked .nav[data-view]:not([data-view="plan"]):not([data-view="admin"]) { opacity: .35; pointer-events: none; }
main { display: flex; flex-direction: column; }
main > .view { flex: 1; min-height: 0; }
main > .view { height: auto; }
