:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --line: #e6eaf0;
  --line-2: #eef1f6;
  --side: #0b1220;
  --side-2: #111a2e;
  --side-text: #a8b3c7;
  --accent: #0e9f9a;
  --accent-2: #0b7f7b;
  --accent-soft: #e3f6f5;
  --indigo: #4f46e5;
  --indigo-soft: #eef0ff;
  --ok: #16a34a;
  --ok-soft: #e8f7ee;
  --warn: #c2760c;
  --warn-soft: #fff4e0;
  --err: #dc2626;
  --err-soft: #fdecec;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 16px rgba(15, 23, 42, .04);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, .18);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  font-feature-settings: 'cv11', 'ss01';
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h2 { font-size: 15px; font-weight: 600; margin: 0 0 14px; letter-spacing: -.01em; }
h3 { font-size: 13px; font-weight: 600; margin: 20px 0 10px; color: var(--text-2); text-transform: uppercase; letter-spacing: .04em; }
svg.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, 'Cascadia Code', Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.stack { display: grid; gap: 4px; }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px;
  background: radial-gradient(1200px 600px at 10% -10%, #123047 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, #0e3b3a 0%, transparent 55%), var(--side); }
.login-card { background: var(--card); padding: 32px; border-radius: 18px; width: 100%; max-width: 380px; display: grid; gap: 14px; box-shadow: var(--shadow-lg); }
.login-card h1 { margin: 6px 0 0; font-size: 22px; letter-spacing: -.02em; }
.login-card p { margin: 0; }
.login-brand, .brand { display: flex; align-items: center; gap: 10px; }
.login-brand b, .brand b { display: block; font-size: 16px; letter-spacing: -.01em; }
.login-brand small, .brand small { display: block; font-size: 12px; color: var(--muted); }
.logo-mark { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #14b8a6, #4f46e5); box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }
.logo-mark svg.ic { width: 20px; height: 20px; }
.error-text { color: var(--err); min-height: 1em; margin: 0; }

/* ---------- Layout ---------- */
.layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--side) 0%, var(--side-2) 100%); color: var(--side-text); padding: 20px 14px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { padding: 2px 8px 10px; }
.sidebar .brand b { color: #fff; }
.sidebar .brand small { color: #7d8aa3; }
#nav { display: grid; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #5f6b82; padding: 14px 10px 6px; }
#nav a { display: flex; align-items: center; gap: 11px; color: var(--side-text); padding: 9px 10px; border-radius: 9px; cursor: pointer; font-weight: 500; position: relative; }
#nav a:hover { background: rgba(255, 255, 255, .05); color: #e2e8f0; text-decoration: none; }
#nav a.active { background: rgba(20, 184, 166, .14); color: #fff; }
#nav a.active::before { content: ''; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #2dd4bf; }
#nav a i { display: grid; place-items: center; }
.nav-badge { margin-left: auto; font-style: normal; font-size: 11px; font-weight: 600; background: var(--err); color: #fff; border-radius: 999px; padding: 1px 7px; }
.sidebar-foot { margin-top: auto; display: grid; gap: 10px; border-top: 1px solid rgba(255, 255, 255, .06); padding-top: 14px; }
.side-health { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 0 8px; cursor: pointer; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; display: inline-block; flex: none; }
.dot.ok { background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .15); }
.dot.warn { background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, .15); }
.dot.error { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, .15); }
.sidebar .logout { color: var(--side-text); border-color: rgba(255, 255, 255, .1); justify-content: center; }
.sidebar .logout:hover { color: #fff; border-color: rgba(255, 255, 255, .25); }
main { min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 18px 32px; background: rgba(245, 247, 251, .85); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; flex-wrap: wrap; }
.topbar h1 { font-size: 20px; margin: 0; letter-spacing: -.02em; }
.topbar p { margin: 2px 0 0; font-size: 13px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#view { padding: 24px 32px 64px; display: grid; gap: 20px; max-width: 1440px; }

/* ---------- Cartões ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; min-width: 0; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush > .card-head { padding: 18px 20px 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.card-head p { margin: 2px 0 0; font-size: 13px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); }

.kpi { display: grid; gap: 6px; padding: 18px; }
.kpi .kpi-top { display: flex; align-items: center; justify-content: space-between; }
.kpi .label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.kpi .value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12.5px; }
.kpi.clickable { cursor: pointer; transition: border-color .15s, transform .15s; }
.kpi.clickable:hover { border-color: #b6dcd9; transform: translateY(-1px); }
.chip-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-2); }
.chip-ic.indigo { background: var(--indigo-soft); color: var(--indigo); }
.chip-ic.ok { background: var(--ok-soft); color: var(--ok); }
.chip-ic.warn { background: var(--warn-soft); color: var(--warn); }
.chip-ic.err { background: var(--err-soft); color: var(--err); }
.value.ok { color: var(--ok); }
.value.err { color: var(--err); }

.hero { background: linear-gradient(135deg, #0b1220 0%, #12304a 55%, #0e4f4c 100%); color: #e2e8f0; border: none; }
.hero .label, .hero .sub { color: #9fb3c8; }
.hero .value { color: #fff; }
.hero .chip-ic { background: rgba(255, 255, 255, .1); color: #5eead4; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.stat { background: #f8fafc; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 18px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat.err { background: var(--err-soft); border-color: #f8d4d4; }
.stat.warn { background: var(--warn-soft); border-color: #f6e2bd; }
.stat.ok { background: var(--ok-soft); border-color: #cdebd8; }

.callout { display: flex; gap: 14px; align-items: center; padding: 16px 18px; border-radius: var(--radius); border: 1px solid #f6e2bd; background: var(--warn-soft); color: #7c4a03; flex-wrap: wrap; }
.callout.info { border-color: #cfe9e7; background: var(--accent-soft); color: #0b5753; }
.callout b { color: inherit; }
.callout .grow { flex: 1; min-width: 220px; }

/* ---------- Botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--line); background: var(--card); color: var(--text); padding: 9px 15px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { border-color: #c9d2de; background: #fbfcfe; }
.btn:focus-visible, input:focus, select:focus, textarea:focus { outline: none; box-shadow: 0 0 0 3px rgba(14, 159, 154, .2); border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 1px 2px rgba(14, 159, 154, .3); }
.btn.primary:hover { background: var(--accent-2); }
.btn.secondary { background: #fff; }
.btn.danger { color: var(--err); }
.btn.danger:hover { border-color: #f3b8b8; background: var(--err-soft); }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 11px; font-size: 13px; }
.btn.block { width: 100%; }
.btn svg.ic { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: wait; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px; background: #fff; border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--text-2); }
.chip svg.ic { width: 15px; height: 15px; color: var(--accent-2); }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 500; background: #eef2f7; color: #334155; white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: #13803d; }
.badge.warn { background: var(--warn-soft); color: #a3600a; }
.badge.error { background: var(--err-soft); color: #c02121; }
.badge.off { background: #f1f5f9; color: var(--muted); }
.badge.info { background: var(--accent-soft); color: var(--accent-2); }
.badge.indigo { background: var(--indigo-soft); color: var(--indigo); }
input, select, textarea { font: inherit; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: var(--text); width: 100%; transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--text-2); font-weight: 500; }
label.inline { display: flex; align-items: center; gap: 9px; font-weight: 500; }
label.inline input { width: auto; accent-color: var(--accent); }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 170px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search input { padding-left: 36px; width: 100%; }
.search svg.ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.phone-input { display: flex; gap: 6px; align-items: center; min-width: 190px; }
.phone-input input { padding: 6px 10px; font-size: 13px; }
.phone-input input.saved { border-color: #9fd8b5; background: var(--ok-soft); }
.phone-input input.invalid { border-color: #f3b8b8; background: var(--err-soft); }

/* ---------- Tabelas ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
thead th { font-size: 12px; color: var(--muted); font-weight: 600; background: #f8fafc; white-space: nowrap; position: sticky; top: 0; }
thead th:first-child { border-top-left-radius: 0; }
tbody tr { transition: background .1s; }
tbody tr:hover { background: #f8fbfc; }
tbody tr:last-child td { border-bottom: none; }
td .actions { display: flex; gap: 6px; flex-wrap: wrap; }
tr.click { cursor: pointer; }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who > div { min-width: 0; }
.who b, .who small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.list-item > .row { flex-wrap: nowrap; flex: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 600; color: #fff; flex: none; }
.who b { display: block; font-weight: 600; }
.who small { display: block; color: var(--muted); font-size: 12px; }

/* ---------- Listas, checks e conversas ---------- */
.list-item { padding: 12px 0; border-bottom: 1px solid var(--line-2); display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.list-item:last-child { border-bottom: 0; }
.check { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 13px 0; border-bottom: 1px solid var(--line-2); }
.check:last-child { border-bottom: 0; }
.check .icon { font-size: 17px; }
.check .fix { margin-top: 6px; background: var(--warn-soft); color: #7c4a03; padding: 8px 11px; border-radius: 9px; font-size: 13px; }
.check.ok .fix { display: none; }
.ai-output { white-space: pre-wrap; line-height: 1.6; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.chat { display: grid; grid-template-columns: 320px 1fr; gap: 16px; min-height: 540px; }
.conv-list { overflow-y: auto; max-height: 70vh; padding: 0; }
.conv { padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.conv:hover, .conv.active { background: var(--accent-soft); }
.conv .preview { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread { display: flex; flex-direction: column; gap: 8px; max-height: 60vh; overflow-y: auto; padding: 8px 4px; }
.bubble { max-width: 78%; padding: 9px 13px; border-radius: 14px; white-space: pre-wrap; word-break: break-word; line-height: 1.45; }
.bubble.in { background: #f1f5f9; align-self: flex-start; border-bottom-left-radius: 4px; }
.bubble.out { background: #dcf5f3; align-self: flex-end; border-bottom-right-radius: 4px; }
.bubble.failed { background: var(--err-soft); }
.bubble .meta { font-size: 11px; color: var(--muted); margin-top: 4px; }
.chart-box { position: relative; height: 250px; }
.steps { margin: 4px 0 16px; padding-left: 22px; display: grid; gap: 10px; line-height: 1.5; }
.steps svg.ic { width: 16px; height: 16px; vertical-align: -3px; color: var(--accent-2); }
@media (display-mode: standalone) { .topbar { padding-top: max(18px, env(safe-area-inset-top)); } }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty b { display: block; color: var(--text-2); margin-bottom: 4px; }

/* ---------- Modal e avisos ---------- */
.modal { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); display: grid; place-items: center; padding: 16px; z-index: 60; }
.modal-card { background: var(--card); border-radius: 18px; width: 100%; max-width: 820px; max-height: 92vh; overflow-y: auto; padding: 26px; position: relative; box-shadow: var(--shadow-lg); }
.modal-close { position: absolute; right: 14px; top: 12px; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: var(--muted); width: 32px; height: 32px; border-radius: 8px; }
.modal-close:hover { background: #f1f5f9; }
#modal-body > .card-head:first-child { padding-right: 34px; }
.qr { width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid var(--line); border-radius: 12px; }
#toasts { position: fixed; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 70; max-width: calc(100vw - 32px); }
.toast { background: #0f172a; color: #fff; padding: 11px 15px; border-radius: 11px; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); max-width: 440px; }
.toast.error { background: var(--err); }
.toast.ok { background: #0f766e; }

/* ---------- Celular: menu de baixo, menu lateral e botões de ícone ---------- */
.title-area { min-width: 0; }
.icon-btn { width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--text); place-items: center; cursor: pointer; flex: none; }
.menu-btn { display: none; }
.drawer-overlay { display: none; }
.bottom-nav { display: none; }

@media (max-width: 980px) {
  .wide-left { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }

  /* Menu lateral vira gaveta */
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 286px; height: 100%; z-index: 50; transform: translateX(-105%); transition: transform .22s ease; box-shadow: var(--shadow-lg); padding-top: max(20px, env(safe-area-inset-top)); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open { overflow: hidden; }
  .drawer-overlay { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(15, 23, 42, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.drawer-open .drawer-overlay { opacity: 1; pointer-events: auto; }

  /* Barra do topo compacta */
  .menu-btn { display: inline-grid; }
  .topbar { flex-wrap: nowrap; gap: 10px; padding: 10px 12px; padding-top: max(10px, env(safe-area-inset-top)); }
  .title-area { flex: 1; }
  .topbar h1 { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar p { display: none; }
  .top-actions { flex-wrap: nowrap; gap: 6px; }
  #balance-badge { display: none; }
  .top-actions .btn .lbl { display: none; }
  .top-actions .btn { width: 40px; height: 40px; padding: 0; }
  .top-actions .btn svg.ic { width: 18px; height: 18px; }

  /* Menu fixo embaixo */
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: rgba(255, 255, 255, .97); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 20px rgba(15, 23, 42, .06); }
  .bottom-nav a { display: grid; justify-items: center; gap: 3px; padding: 5px 0; font-size: 11px; font-weight: 500; color: var(--muted); cursor: pointer; position: relative; text-decoration: none; -webkit-tap-highlight-color: transparent; }
  .bottom-nav a svg.ic { width: 22px; height: 22px; }
  .bottom-nav a.active { color: var(--accent-2); }
  .bottom-nav a.active svg.ic { stroke-width: 2.2; }
  .bottom-nav .nav-badge { position: absolute; top: 0; left: calc(50% + 5px); margin: 0; font-size: 10px; padding: 1px 6px; }

  /* Conteúdo */
  #view { padding: 14px 12px calc(92px + env(safe-area-inset-bottom)); gap: 14px; }
  .card { padding: 14px; border-radius: 13px; }
  .card.flush > .card-head { padding: 14px 14px 0; }
  .card-head { align-items: flex-start; }
  .card-head > .btn { width: 100%; }
  h2 { font-size: 15px; }
  .grid { gap: 10px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpi { padding: 13px; gap: 4px; }
  .kpi .label { font-size: 12px; }
  .kpi .value { font-size: 19px; }
  .kpi .sub { font-size: 11.5px; }
  .chip-ic { width: 28px; height: 28px; border-radius: 8px; }
  .chip-ic svg.ic { width: 15px; height: 15px; }
  .stat-row { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat { padding: 10px 12px; }
  .stat .value { font-size: 15px; }
  .two, .three { grid-template-columns: 1fr; }
  .callout { padding: 12px 14px; gap: 10px; }
  .callout .btn { width: 100%; }
  .chart-box { height: 200px; }

  /* Filtros e campos (16px evita o zoom automático do iPhone) */
  input, select, textarea { font-size: 16px; }
  .toolbar { gap: 8px; }
  .toolbar > * { flex: 1 1 calc(50% - 8px); min-width: 0 !important; width: auto; }
  .toolbar .search { flex-basis: 100%; max-width: none; }
  .toolbar > span[style*="flex:1"] { display: none; }
  .toolbar > .muted { flex-basis: 100%; }
  .form-grid { grid-template-columns: 1fr; }

  /* Tabelas viram cartões: cada célula mostra o nome da coluna à esquerda */
  .table-wrap { overflow: visible; }
  .card.flush .table-wrap { padding: 4px 12px 2px; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 10px; background: #fff; }
  tbody tr:hover { background: #fff; }
  .table-wrap td { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 5px 0; border: none; text-align: right; }
  .table-wrap td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; }
  .table-wrap td[data-label=""]::before { display: none; }
  .table-wrap td:first-child { justify-content: flex-start; text-align: left; padding: 0 0 6px; }
  .table-wrap td:first-child::before { display: none; }
  .table-wrap td:last-child:has(.actions) { border-top: 1px solid var(--line-2); margin-top: 6px; padding-top: 10px; }
  .table-wrap td:last-child:has(.actions)::before { display: none; }
  .table-wrap td .actions { width: 100%; justify-content: flex-end; }
  .table-wrap td .actions .btn { flex: 1; }
  .table-wrap td br { display: none; }
  .table-wrap td .badge { margin-left: 6px; }
  .phone-input { min-width: 0; width: 62%; }
  .who b, .who small { max-width: 210px; }
  .list-item { flex-wrap: wrap; }
  .list-item > .row { flex-wrap: wrap; justify-content: flex-end; flex: 1 1 auto; }

  /* Janelas sobem de baixo, como nos apps */
  .modal { place-items: end stretch; padding: 0; }
  .modal-card { max-width: none; width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh; padding: 22px 16px calc(20px + env(safe-area-inset-bottom)); }
  .modal-card::before { content: ''; display: block; width: 42px; height: 4px; border-radius: 4px; background: #d6dbe3; margin: -10px auto 14px; }

  .chat { grid-template-columns: 1fr; min-height: 0; }
  .conv-list { max-height: 40vh; }
  .bubble { max-width: 88%; }
  #toasts { left: 12px; right: 12px; bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toast { max-width: none; }
}
