:root {
  --mono: 'Space Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --grotesk: 'Space Grotesk', Inter, system-ui, sans-serif;
  --sans: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}

[data-theme="dark"] {
  --bg: #000;
  --bg-subtle: #0a0a0a;
  --surface: #141414;
  --card: #1a1a1a;
  --border: #2a2a2a;
  --text: #fff;
  --text-inv: #000;
  --dim: rgba(255, 255, 255, 0.78);
  --faint: rgba(255, 255, 255, 0.45);
  --yellow: #ffcc00;
  --cyan: #00d4d4;
  --pink: #ffb8ff;
  --red: #ff3333;
}

[data-theme="light"] {
  --bg: #f5f3ef;
  --bg-subtle: #eae8e3;
  --surface: #fff;
  --card: #fff;
  --border: #e0ddd7;
  --text: #1a1a1a;
  --text-inv: #fff;
  --dim: rgba(0, 0, 0, 0.6);
  --faint: rgba(0, 0, 0, 0.2);
  --yellow: #e6a800;
  --cyan: #00a3a3;
  --pink: #d45cbf;
  --red: #d44;
}

* { box-sizing: border-box; }
*, *::before, *::after { margin: 0; padding: 0; }
*:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

html, body { height: 100%; }
body {
  font-family: var(--sans);
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
  transition: background .35s ease, color .35s ease;
  min-height: 100vh; display: flex; flex-direction: column;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: 1px solid var(--border); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--grotesk); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }
.brand-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 0 var(--yellow); animation: dot-blink 1.5s ease-in-out infinite; }
@keyframes dot-blink { 0%,100% { opacity: .95 } 50% { opacity: .35 } }
.nav-links { display: flex; gap: 22px; }
.nav-links a { color: var(--dim); text-decoration: none; font-size: 13px; font-weight: 500; }
.nav-links a:hover { color: var(--text); }
.nav-cta { display: inline-flex; gap: 8px; align-items: center; }

.btn-ghost { border: 1px solid var(--border); color: var(--text); background: transparent; padding: 6px 12px; border-radius: 8px; text-decoration: none; font-size: 12px; font-family: var(--grotesk); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.btn-ghost:hover { border-color: var(--yellow); color: var(--text); }
.btn-ghost.sm { padding: 5px 9px; font-size: 11px; }

.theme-toggle { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: transparent; color: var(--dim); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle:hover { border-color: var(--yellow); color: var(--yellow); }

/* Auth */
.auth-slot { position: relative; display: inline-flex; }
.user-chip { display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px 3px 3px; cursor: pointer; color: var(--text); font-family: var(--grotesk); font-size: 12.5px; font-weight: 600; }
.user-chip:hover { border-color: var(--yellow); }
.user-chip img { width: 24px; height: 24px; border-radius: 50%; display: block; }
.user-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--border); border-radius: 10px; min-width: 200px; padding: 6px; z-index: 60; box-shadow: 0 12px 32px rgba(0,0,0,0.35); }
.user-menu[hidden] { display: none; }
.user-menu .um-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-menu .um-name { font-family: var(--grotesk); font-weight: 700; font-size: 13px; color: var(--text); }
.user-menu .um-sub { font-family: var(--mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 1.3px; margin-top: 2px; }
.user-menu button, .user-menu a { display: block; width: 100%; background: transparent; border: 0; text-align: left; padding: 8px 10px; border-radius: 7px; font: inherit; font-family: var(--grotesk); font-size: 13px; color: var(--text); cursor: pointer; text-decoration: none; }
.user-menu button:hover, .user-menu a:hover { background: var(--surface); color: var(--yellow); }

/* Sign-in modal */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.65); backdrop-filter: blur(6px); }
.modal-card {
  position: relative; width: min(420px, 100%);
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px 28px 24px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,204,0,0.08);
  animation: modal-in .18s ease;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-x {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px;
  background: transparent; border: 1px solid var(--border); border-radius: 7px;
  color: var(--dim); cursor: pointer; font-size: 16px; line-height: 1;
}
.modal-x:hover { border-color: var(--yellow); color: var(--yellow); }
.modal-brand-row { display: flex; align-items: center; justify-content: center; gap: 5px; margin-bottom: 14px; }
.modal-brand-row .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); opacity: 0.55; display: inline-block; }
.modal-brand-row .dot.big { width: 10px; height: 10px; opacity: 0.95; animation: dot-blink 1.5s ease-in-out infinite; }
.modal-title { font-family: var(--grotesk); font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; text-align: center; }
.modal-sub { color: var(--dim); font-size: 13.5px; text-align: center; margin: 0 0 22px; line-height: 1.55; }
.modal-banner {
  background: color-mix(in srgb, var(--red) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--red) 50%, var(--border));
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: var(--grotesk); font-size: 12.5px; line-height: 1.5;
  margin-bottom: 18px;
}

.provider-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px 14px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--border);
  font-family: var(--grotesk); font-size: 13.5px; font-weight: 600;
  color: var(--text); text-decoration: none; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.provider-btn:hover { border-color: var(--yellow); background: var(--bg-subtle); transform: translateY(-1px); }
.provider-btn + .provider-btn { margin-top: 8px; }
.provider-btn.github { background: var(--text); color: var(--bg); border-color: var(--text); }
.provider-btn.github:hover { background: var(--yellow); color: var(--text-inv); border-color: var(--yellow); }
.provider-btn.google { background: var(--surface); color: var(--text); border-color: var(--border); }
.provider-btn.google:hover { border-color: #4285F4; }

.divider { display: flex; align-items: center; gap: 10px; margin: 20px 0 16px; color: var(--faint); font-family: var(--mono); font-size: 10px; letter-spacing: 1.8px; text-transform: uppercase; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.dev-form { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-family: var(--mono); font-size: 9px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 2.2px; margin-top: 6px; }
.field-label .muted { color: var(--faint); font-weight: 400; }
.dev-form input {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 9px; padding: 10px 12px; font: inherit; font-family: var(--grotesk); font-size: 14px;
  outline: 0; transition: border-color .15s;
}
.dev-form input::placeholder { color: var(--faint); }
.dev-form input:focus { border-color: var(--yellow); }
.dev-form .btn-primary { margin-top: 10px; padding: 11px 14px; justify-content: center; }
.form-error { color: var(--red); font-family: var(--mono); font-size: 11px; margin: 6px 0 0; }

.modal-foot { margin: 18px 0 0; color: var(--faint); font-family: var(--mono); font-size: 10px; letter-spacing: 0.8px; line-height: 1.6; text-align: center; }

/* Small confirm modal */
.modal-sm { width: min(380px, 100%); padding: 24px 22px 20px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.btn-danger {
  background: var(--red); color: #fff; border: 0;
  padding: 9px 16px; border-radius: 9px;
  font-family: var(--grotesk); font-weight: 700; font-size: 13px; cursor: pointer;
  transition: filter .12s, transform .12s;
}
.btn-danger:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* Admin dashboard */
.admin { padding: 28px 0 72px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.admin-title { font-family: var(--grotesk); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.admin-sub { font-family: var(--mono); font-size: 11px; color: var(--faint); text-transform: uppercase; letter-spacing: 1.5px; margin: 6px 0 0; }
.admin-actions { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.admin-loading { color: var(--dim); font-family: var(--mono); font-size: 12px; padding: 40px 0; }
.admin-error { color: var(--red); font-family: var(--grotesk); font-size: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--red); border-radius: 10px; }
.admin-error a, .admin-error code { color: var(--yellow); }
.admin-error code { background: var(--bg-subtle); padding: 1px 6px; border-radius: 4px; font-family: var(--mono); font-size: 12px; }

.range-picker { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 9px; padding: 2px; gap: 2px; }
.rp { background: transparent; border: 0; padding: 6px 11px; border-radius: 7px; cursor: pointer; color: var(--dim); font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase; }
.rp:hover { color: var(--text); }
.rp.active { background: var(--yellow); color: var(--text-inv); }

.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.sec-note { font-family: var(--mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 1.5px; margin-left: 8px; font-weight: 400; }

.admin-grid { display: grid; gap: 14px; }
.admin-grid.kpis { grid-template-columns: repeat(6, 1fr); margin-bottom: 32px; }
.admin-grid.two { grid-template-columns: 1fr 1fr; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; position: relative; overflow: hidden; }
.k-label { font-family: var(--mono); font-size: 9.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 1.6px; }
.k-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.k-value { font-family: var(--grotesk); font-size: 26px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); line-height: 1.1; }
.k-spark { width: 60px; height: 20px; }
.k-delta { font-family: var(--mono); font-size: 10.5px; margin-top: 2px; min-height: 14px; font-weight: 700; letter-spacing: 0.5px; }
.k-delta.up { color: var(--ok, #34d399); }
.k-delta.down { color: var(--red); }
.k-delta.neutral { color: var(--faint); }

.admin-section { margin-bottom: 36px; }
.admin-section h2 { font-family: var(--grotesk); font-size: 18px; margin: 0; font-weight: 700; letter-spacing: -0.01em; }
.admin-section h3 { font-family: var(--grotesk); font-size: 14px; margin: 0 0 12px; font-weight: 700; }

/* Chart */
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; position: relative; }
.chart-card svg { width: 100%; height: auto; display: block; cursor: crosshair; }
.legend { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.dotleg { background: transparent; border: 1px solid var(--border); border-radius: 99px; padding: 4px 10px; font-family: var(--mono); font-size: 10.5px; color: var(--faint); display: inline-flex; align-items: center; gap: 6px; cursor: pointer; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; }
.dotleg i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; opacity: 0.3; }
.dotleg.active { color: var(--text); border-color: var(--border); }
.dotleg.active i { opacity: 1; }
.chart-tip {
  position: absolute; top: 8px; pointer-events: none;
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px;
  min-width: 160px; font-size: 11px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}
.tip-date { font-family: var(--mono); font-size: 10px; color: var(--yellow); text-transform: uppercase; letter-spacing: 1.4px; margin-bottom: 6px; font-weight: 700; }
.tip-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 2px 0; }
.tip-k { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-family: var(--grotesk); text-transform: capitalize; }
.tip-k i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.tip-v { color: var(--text); font-family: var(--mono); font-weight: 700; }

/* Breakdowns */
.breakdown-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.bd-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bd-list li { display: grid; grid-template-columns: 80px 1fr 70px; align-items: center; gap: 12px; font-size: 13px; color: var(--dim); }
.bd-k { font-family: var(--grotesk); text-transform: capitalize; color: var(--text); font-weight: 500; }
.bd-bar { height: 7px; border-radius: 99px; background: var(--bg-subtle); overflow: hidden; }
.bd-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--pink)); }
.bd-v { text-align: right; font-family: var(--mono); font-size: 11px; color: var(--text); font-weight: 700; }
.bd-pct { color: var(--faint); font-weight: 400; margin-left: 4px; }
.bd-empty { color: var(--faint); font-style: italic; }

/* Heatmap */
.heatmap-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px; }
.heat-sub { font-family: var(--mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 1.5px; margin-left: 8px; font-weight: 400; }
.heatmap { display: flex; flex-direction: column; gap: 3px; overflow-x: auto; }
.hm-row { display: grid; grid-template-columns: 44px repeat(24, 1fr); gap: 3px; align-items: center; }
.hm-row.hm-hdr { margin-bottom: 4px; }
.hm-day { font-family: var(--mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 1.3px; text-align: right; padding-right: 6px; font-weight: 700; }
.hm-col { font-family: var(--mono); font-size: 8.5px; color: var(--faint); text-align: center; }
.hm-cell { height: 18px; border-radius: 3px; transition: transform .15s; cursor: default; }
.hm-cell:hover { transform: scale(1.5); outline: 1px solid var(--yellow); z-index: 2; }

/* Funnel */
.funnel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.fn-row { display: grid; grid-template-columns: 120px 1fr 80px 70px; align-items: center; gap: 14px; }
.fn-label { font-family: var(--grotesk); font-weight: 600; font-size: 13px; color: var(--text); }
.fn-bar { height: 20px; border-radius: 6px; background: var(--bg-subtle); overflow: hidden; }
.fn-fill { display: block; height: 100%; border-radius: 6px; transition: width .4s ease; }
.fn-count { font-family: var(--grotesk); font-weight: 700; font-size: 15px; color: var(--text); }
.fn-conv { font-family: var(--mono); font-size: 11px; color: var(--faint); font-weight: 700; }

/* Tables */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow-x: auto; }
.users-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.users-table th, .users-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.users-table th { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--faint); font-weight: 700; }
.users-table tr:last-child td { border-bottom: 0; }
.users-table tr:hover td { background: var(--bg-subtle); }
.users-table .ava { width: 28px; height: 28px; border-radius: 50%; display: block; border: 1px solid var(--border); }
.users-table .ava.sm { width: 22px; height: 22px; }
.mono-email { font-family: var(--mono); font-size: 11.5px; color: var(--dim); background: none; padding: 0; }
.pill { font-family: var(--mono); font-size: 9px; text-transform: uppercase; letter-spacing: 1.2px; padding: 2px 7px; border-radius: 99px; font-weight: 700; }
.pill-github { background: color-mix(in srgb, var(--text) 12%, transparent); color: var(--text); border: 1px solid var(--border); }
.pill-dev { background: color-mix(in srgb, var(--yellow) 18%, transparent); color: var(--yellow); border: 1px solid color-mix(in srgb, var(--yellow) 40%, var(--border)); }

/* Feed */
.feed-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.feed-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.feed-item { display: grid; grid-template-columns: 80px 100px 1fr 1fr; gap: 12px; padding: 9px 14px; border-bottom: 1px solid var(--border); font-size: 12px; align-items: center; }
.feed-item:last-child { border-bottom: 0; }
.feed-time { font-family: var(--mono); font-size: 10.5px; color: var(--faint); }
.feed-type { font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; padding: 2px 8px; border-radius: 99px; background: var(--bg-subtle); color: var(--dim); display: inline-block; text-align: center; }
.feed-login .feed-type { color: var(--yellow); background: color-mix(in srgb, var(--yellow) 14%, var(--bg-subtle)); }
.feed-chat .feed-type { color: var(--cyan); background: color-mix(in srgb, var(--cyan) 14%, var(--bg-subtle)); }
.feed-logout .feed-type { color: var(--faint); }
.feed-email { font-family: var(--mono); font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.feed-meta { font-family: var(--mono); font-size: 10.5px; color: var(--faint); text-transform: uppercase; letter-spacing: 0.8px; }
.feed-empty { color: var(--faint); font-style: italic; padding: 24px; text-align: center; }

.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--red); display: inline-block; opacity: 0.3; }
.pulse-dot.on { opacity: 1; box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 30%, transparent); transition: box-shadow .8s ease, opacity .8s ease; }

@media (max-width: 1100px) {
  .admin-grid.kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .admin-grid.kpis { grid-template-columns: repeat(2, 1fr); }
  .admin-grid.two { grid-template-columns: 1fr; }
  .fn-row { grid-template-columns: 90px 1fr 60px 50px; }
  .feed-item { grid-template-columns: 70px 90px 1fr; }
  .feed-meta { display: none; }
}

/* Tip banner */
.tip { border-bottom: 1px solid var(--border); background: var(--bg-subtle); color: var(--dim); font-size: 12px; font-family: var(--mono); }
.tip .wrap { display: flex; gap: 8px; align-items: center; padding: 8px 24px; }
.tip .yellow { color: var(--yellow); }

/* App shell */
.app-shell {
  display: grid; grid-template-columns: 280px 1fr;
  height: calc(100dvh - 56px - 34px);
  min-height: 580px;
  max-width: 1400px; margin: 0 auto; width: 100%;
  border-left: 1px solid var(--border); border-right: 1px solid var(--border);
  background: var(--bg);
}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; border-right: 1px solid var(--border); background: var(--bg-subtle); }
.sb-head { padding: 14px; }
.btn-primary {
  background: var(--yellow); color: var(--text-inv); border: 0;
  padding: 10px 14px; border-radius: 8px;
  font-family: var(--grotesk); font-weight: 700; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px; letter-spacing: 0.01em;
  transition: transform .12s ease, filter .12s ease;
}
.btn-primary.full { width: 100%; justify-content: center; }
.btn-primary:hover { filter: brightness(1.05); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; transform: none; }

.sb-search { display: flex; align-items: center; gap: 8px; padding: 0 14px 10px; color: var(--faint); }
.sb-search input { flex: 1; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 12.5px; outline: 0; }
.sb-search input::placeholder { color: var(--faint); }
.sb-search input:focus { border-color: var(--yellow); }

.sb-section { padding: 10px 16px 6px; color: var(--faint); font-family: var(--mono); font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 2.5px; }
.conv-list { list-style: none; margin: 0; padding: 0 8px; overflow: auto; flex: 1; }
.conv-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--dim); font-size: 13px; display: flex; flex-direction: column; gap: 3px; border: 1px solid transparent; }
.conv-list li:hover { background: var(--surface); color: var(--text); }
.conv-list li.active { background: var(--surface); color: var(--text); border-color: var(--border); }
.conv-list li.active .conv-title { color: var(--yellow); }
.conv-list .conv-title { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--grotesk); }
.conv-list .conv-meta { color: var(--faint); font-family: var(--mono); font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.2px; }
.conv-empty { color: var(--faint) !important; font-size: 12.5px; padding: 12px !important; font-style: italic; }
.sb-foot { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }

/* Chat area */
.chat { display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; border-bottom: 1px solid var(--border); gap: 12px; flex-wrap: wrap; background: var(--bg); }
.mode-tabs { display: inline-flex; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.tab { padding: 6px 14px; border-radius: 5px; border: 0; cursor: pointer; background: transparent; color: var(--dim); font-family: var(--grotesk); font-weight: 600; font-size: 12px; letter-spacing: 0.02em; }
.tab.active { background: var(--yellow); color: var(--text-inv); }
.chat-controls { display: inline-flex; gap: 8px; align-items: center; }

/* Custom dropdown (shared by Format + Tone) */
.dp-wrap { position: relative; }
.dp-trigger {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid var(--border); border-radius: 8px;
  font-family: var(--grotesk); font-size: 12px; font-weight: 600;
  color: var(--dim); cursor: pointer; white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.dp-trigger:hover { border-color: var(--yellow); color: var(--text); }
.dp-trigger .dp-icon { flex-shrink: 0; color: var(--yellow); }
.dp-trigger .dp-chev { flex-shrink: 0; color: var(--faint); transition: transform .2s; }
.dp-wrap.open .dp-trigger { border-color: var(--yellow); color: var(--text); }
.dp-wrap.open .dp-chev { transform: rotate(180deg); }

.dp-menu {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 10px; min-width: 240px; max-width: min(300px, calc(100vw - 24px));
  padding: 4px; z-index: 60;
  box-shadow: 0 12px 32px rgba(0,0,0,0.35);
  display: none;
  max-height: min(360px, calc(100dvh - 120px));
  overflow-y: auto; overscroll-behavior: contain;
}
.pwa .dp-menu { left: 0; right: auto; max-width: calc(100vw - 24px); }
.dp-wrap.open .dp-menu { display: block; }

.dp-option {
  display: flex; flex-direction: column; gap: 2px; width: 100%;
  padding: 9px 12px; background: transparent; border: 0; border-radius: 7px;
  cursor: pointer; text-align: left; font: inherit; color: var(--text);
  transition: background .1s;
}
.dp-option:hover { background: var(--surface); }
.dp-option.active { background: color-mix(in srgb, var(--yellow) 12%, var(--surface)); }
.dp-option.active .dp-opt-title { color: var(--yellow); }
.dp-option-row { display: flex; align-items: center; gap: 10px; }
.dp-opt-emoji { font-size: 13px; width: 16px; display: inline-flex; justify-content: center; }
.dp-opt-icon { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.dp-opt-icon svg { width: 16px; height: 16px; display: block; }
.dp-opt-title { font-family: var(--grotesk); font-size: 13px; font-weight: 600; }
.dp-opt-desc { font-family: var(--mono); font-size: 10px; color: var(--faint); text-transform: none; letter-spacing: 0.2px; line-height: 1.45; padding-left: 26px; }

.dp-icon-slot { display: inline-flex; align-items: center; justify-content: center; width: 14px; height: 14px; flex-shrink: 0; }
.dp-icon-slot svg { width: 14px; height: 14px; display: block; }

/* Messages */
.messages { flex: 1; overflow: auto; padding: 22px 22px 8px; display: flex; flex-direction: column; gap: 14px; }
.bubble { max-width: 760px; padding: 14px 16px; border-radius: 12px; font-size: 15px; font-family: var(--grotesk); font-weight: 500; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; position: relative; }
.bubble.user { align-self: flex-end; background: var(--yellow); color: var(--text-inv); border: 1px solid var(--yellow); }
.bubble.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.bubble.assistant.thinking { color: var(--faint); }
.bubble.assistant.thinking .body {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--grotesk); font-size: 13px; font-weight: 500;
}
.bubble.assistant.thinking .body::after {
  content: ''; display: inline-block;
  width: 24px; height: 24px;
  border: 2.5px solid var(--border);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: cf-spin .6s linear infinite;
}
@keyframes cf-spin { to { transform: rotate(360deg); } }
.bubble .role { display: block; font-family: var(--mono); font-size: 9px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: 2px; margin-bottom: 6px; }
.bubble.user .role { color: rgba(0,0,0,0.55); }
.bubble .shot { display: block; max-width: 320px; border-radius: 8px; margin-bottom: 8px; border: 1px solid var(--border); }
.bubble-actions { display: flex; gap: 6px; margin-top: 10px; opacity: 0; transition: opacity .15s; }
.bubble:hover .bubble-actions { opacity: 1; }
.bubble-actions button { background: transparent; color: var(--dim); border: 1px solid var(--border); padding: 4px 9px; border-radius: 6px; font-family: var(--mono); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.2px; cursor: pointer; }
.bubble-actions button:hover { border-color: var(--yellow); color: var(--yellow); }
.bubble.user .bubble-actions button { border-color: rgba(0,0,0,0.2); color: rgba(0,0,0,0.6); }

/* Empty state */
.empty-state { margin: auto; text-align: center; max-width: 580px; padding: 40px 20px; }
.empty-brand-row { display: flex; align-items: center; justify-content: center; gap: 5px; margin-bottom: 18px; }
.empty-brand-row .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--yellow); opacity: 0.55; }
.empty-brand-row .dot.big { width: 10px; height: 10px; opacity: 0.95; animation: dot-blink 1.5s ease-in-out infinite; }
.empty-state h1 { font-family: var(--grotesk); font-size: clamp(28px, 4.2vw, 44px); line-height: 1.1; letter-spacing: -0.03em; font-weight: 700; margin: 0 0 14px; }
.yellow { color: var(--yellow); }
.empty-state p { color: var(--dim); font-size: 14px; margin: 0 0 24px; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { background: var(--surface); color: var(--dim); border: 1px solid var(--border); padding: 7px 13px; border-radius: 999px; font-family: var(--grotesk); font-size: 12.5px; font-weight: 500; cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--yellow); color: var(--text); }

/* Composer */
.composer { padding: 12px 22px 18px; border-top: 1px solid var(--border); background: var(--bg); }
.composer-inner { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 6px 6px 6px 14px; transition: border-color .15s, box-shadow .15s; }
.composer-inner:focus-within { border-color: var(--yellow); box-shadow: 0 0 0 2px rgba(255,204,0,0.1); }
.composer-inner.drag { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255,204,0,0.18); }
.composer-main { display: flex; align-items: flex-end; gap: 6px; }
.composer textarea { flex: 1; background: transparent; color: var(--text); border: 0; outline: 0; resize: none; font-family: var(--grotesk); font-size: 15px; font-weight: 500; line-height: 1.55; min-height: 24px; max-height: 180px; padding: 8px 0; }
.composer textarea::placeholder { color: var(--faint); }
.composer-btns { display: flex; align-items: center; gap: 4px; flex-shrink: 0; padding-bottom: 2px; }
.drop-hint { display: block; color: var(--faint); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; padding: 6px 8px 2px; }
.kbd-hint { font-family: var(--mono); font-size: 10px; color: var(--faint); display: inline-flex; align-items: center; gap: 4px; }
kbd { padding: 1px 5px; border: 1px solid var(--faint); border-radius: 3px; font-family: var(--mono); font-size: 9.5px; color: var(--dim); }

/* Send button (yellow circle) */
.send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--yellow); color: var(--text-inv); border: 0;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: transform .1s, filter .1s;
}
.send-btn:hover { filter: brightness(1.08); transform: scale(1.06); }
.send-btn:active { transform: scale(0.95); }

/* Integration links (sidebar footer) */
.slack-add, .chrome-add {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--dim); font-family: var(--grotesk); font-size: 12px; font-weight: 600;
  text-decoration: none; cursor: pointer; transition: border-color .15s, color .15s, background .15s;
  white-space: nowrap;
}
.slack-add:hover, .chrome-add:hover { border-color: var(--yellow); color: var(--text); background: var(--bg-subtle); }
.slack-add svg, .chrome-add svg { flex-shrink: 0; }
.icon-btn { background: transparent; color: var(--dim); border: 1px solid var(--border); width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: all .15s; }
.icon-btn:hover { color: var(--yellow); border-color: var(--yellow); }
.icon-btn.rec { color: var(--red); border-color: var(--red); animation: mic-pulse 1.5s ease-in-out infinite; }
@keyframes mic-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,51,51,0.3); } 50% { box-shadow: 0 0 0 8px rgba(255,51,51,0); } }

.thumb { position: relative; display: inline-block; margin-top: 10px; }
.thumb img { max-height: 72px; border-radius: 6px; border: 1px solid var(--border); display: block; }
.thumb-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--surface); color: var(--text); border: 1px solid var(--border); cursor: pointer; font-size: 13px; line-height: 1; }

/* Sections below */
section.how, section.features, section.faq { padding: 80px 0; border-top: 1px solid var(--border); background: var(--bg); }
h2 { font-family: var(--grotesk); font-size: clamp(28px, 3.5vw, 40px); letter-spacing: -0.025em; margin: 0 0 10px; font-weight: 700; }
.section-lede { color: var(--dim); font-size: 15px; margin: 0 0 36px; max-width: 640px; }

/* How it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; counter-reset: step; }
.step {
  position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 28px 24px 24px;
  display: flex; flex-direction: column; gap: 14px;
  transition: border-color .18s, transform .18s, background .18s;
  overflow: hidden;
}
.step::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--yellow), var(--cyan));
  opacity: 0; transition: opacity .18s;
}
.step:hover { border-color: var(--yellow); transform: translateY(-3px); }
.step:hover::before { opacity: 1; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--yellow); color: var(--text-inv);
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 1px;
  flex-shrink: 0;
}
.step h3 { font-family: var(--grotesk); font-size: 16.5px; line-height: 1.35; margin: 0; font-weight: 700; }
.step p { color: var(--dim); margin: 0; font-size: 13.5px; line-height: 1.65; flex: 1; }

/* Features */
.feature-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px; align-items: stretch;
}
.feature {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 26px 24px 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .18s ease, transform .18s ease, background-color .18s ease;
}
.feature::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(130% 90% at 100% 0%, color-mix(in srgb, var(--accent-color, var(--yellow)) 14%, transparent), transparent 55%);
  opacity: 0; transition: opacity .2s ease;
}
.feature:hover { border-color: var(--accent-color, var(--yellow)); transform: translateY(-3px); }
.feature:hover::before { opacity: 1; }

/* Pac-Man palette rotation — yellow, cyan, pink, repeating */
.feature:nth-child(3n+1) { --accent-color: var(--yellow); }
.feature:nth-child(3n+2) { --accent-color: var(--cyan); }
.feature:nth-child(3n+3) { --accent-color: var(--pink); }

.f-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  font-size: 22px; line-height: 1;
  transition: border-color .18s ease, background-color .18s ease;
}
.feature:hover .f-ico { border-color: color-mix(in srgb, var(--accent-color) 55%, var(--border)); background: color-mix(in srgb, var(--accent-color) 8%, var(--bg-subtle)); }

.feature h3 {
  font-family: var(--grotesk);
  margin: 0; font-size: 15.5px; font-weight: 700; letter-spacing: -0.005em;
  line-height: 1.35; min-height: 42px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.feature p { margin: 0; color: var(--dim); font-size: 13.5px; line-height: 1.6; }

.feature .soon {
  font-family: var(--mono);
  font-size: 9px; font-weight: 700; letter-spacing: 1.3px; text-transform: uppercase;
  color: var(--text-inv); background: var(--accent-color, var(--yellow));
  padding: 2px 7px; border-radius: 4px; line-height: 1.4;
}

@media (max-width: 900px) { .feature-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .feature-grid { grid-template-columns: 1fr; } }

.faq details { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; font-family: var(--grotesk); color: var(--text); }
.faq summary::marker { color: var(--yellow); }
.faq p { color: var(--dim); margin: 10px 0 0; }
.faq code { font-family: var(--mono); font-size: 12px; color: var(--yellow); background: var(--bg-subtle); padding: 1px 6px; border-radius: 4px; }

.foot { border-top: 1px solid var(--border); padding: 22px 0; color: var(--faint); font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; background: var(--bg); }
.foot-inner { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }

/* ==================== PWA INSTALL BANNER ==================== */
.install-banner {
  position: fixed; bottom: 16px; left: 16px; z-index: 90;
  padding: 0;
  animation: ib-slide .3s ease;
}
.install-banner[hidden] { display: none; }
@keyframes ib-slide { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: none; } }
.ib-inner {
  max-width: 360px;
  background: var(--card, #1a1a1a); border: 1px solid var(--border, #2a2a2a); border-radius: 14px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,204,0,0.06);
}
.ib-icon img { border-radius: 12px; display: block; }
.ib-text { flex: 1; min-width: 0; }
.ib-text strong { display: block; font-family: var(--grotesk, system-ui); font-size: 14px; font-weight: 700; color: var(--text, #fff); }
.ib-hint { display: block; font-family: var(--mono, monospace); font-size: 10.5px; color: var(--faint, rgba(255,255,255,0.45)); line-height: 1.5; margin-top: 2px; }
.ib-hint .key { display: inline-flex; align-items: center; justify-content: center; background: var(--surface, #141414); border: 1px solid var(--border, #2a2a2a); border-radius: 4px; padding: 1px 5px; font-size: 13px; vertical-align: middle; margin: 0 2px; }
.ib-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
.ib-install {
  background: var(--yellow, #ffcc00); color: #000; border: 0; border-radius: 9px;
  padding: 9px 16px; font-family: var(--grotesk, system-ui); font-size: 13px; font-weight: 700; cursor: pointer;
}
.ib-install:hover { filter: brightness(1.06); }
.ib-close {
  background: transparent; border: 0; color: var(--faint, rgba(255,255,255,0.45));
  font-family: var(--mono, monospace); font-size: 10px; cursor: pointer; text-transform: uppercase; letter-spacing: 1.2px;
}
.ib-close:hover { color: var(--text, #fff); }

/* ==================== PWA STANDALONE MODE ==================== */
/* When installed as app (iOS/Android/desktop), show only the chat. Full-screen, no chrome. */
.pwa .nav,
.pwa .tip,
.pwa .sidebar,
.pwa section.how,
.pwa section.features,
.pwa section.faq,
.pwa .foot { display: none !important; }

.pwa .app-shell {
  grid-template-columns: 1fr !important;
  height: 100dvh; min-height: 0;
  max-width: 100%; border: 0;
}
.pwa .chat {
  height: 100dvh;
  border-radius: 0;
}
.pwa .chat-head {
  padding-top: max(env(safe-area-inset-top, 0px), 12px);
  padding-left: max(env(safe-area-inset-left, 0px), 12px);
  padding-right: max(env(safe-area-inset-right, 0px), 12px);
}
.pwa .composer {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 16px);
  padding-left: max(env(safe-area-inset-left, 0px), 12px);
  padding-right: max(env(safe-area-inset-right, 0px), 12px);
}
.pwa .messages {
  padding-left: max(env(safe-area-inset-left, 0px), 14px);
  padding-right: max(env(safe-area-inset-right, 0px), 14px);
}

/* Install banner gets extra bottom space in PWA view */
/* PWA top bar (menu + brand + new chat) */
.pwa-bar { display: none; }
.pwa .pwa-bar {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0 0 8px; gap: 8px;
}
.pwa-brand {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--grotesk); font-weight: 700; font-size: 14px; color: var(--text);
}
.pwa-icon-btn {
  background: transparent; border: 1px solid var(--border); border-radius: 8px;
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--dim); cursor: pointer;
}
.pwa-icon-btn:hover { border-color: var(--yellow); color: var(--text); }

/* PWA slide-out drawer */
.pwa-drawer { position: fixed; inset: 0; z-index: 200; }
.pwa-drawer[hidden] { display: none; }
.pwa-drawer-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(4px);
}
.pwa-drawer-panel {
  position: absolute; top: 0; left: 0; bottom: 0; width: min(300px, 80vw);
  background: var(--bg-subtle); border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  animation: pwa-slide .2s ease;
  padding-top: env(safe-area-inset-top, 0px);
}
@keyframes pwa-slide { from { transform: translateX(-100%); } to { transform: none; } }

.pwa-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px 10px; border-bottom: 1px solid var(--border);
}
.pwa-drawer-user {
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.pwa-drawer-user .user-info {
  display: flex; align-items: center; gap: 10px;
}
.pwa-drawer-user .user-info img {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
}
.pwa-drawer-user .user-info .user-name {
  font-family: var(--grotesk); font-size: 13px; font-weight: 600; color: var(--text);
}
.pwa-drawer-user .user-info .user-email {
  font-family: var(--mono); font-size: 10px; color: var(--faint); text-transform: uppercase; letter-spacing: 1px;
}
.pwa-signout {
  background: transparent; border: 0; color: var(--faint); font-family: var(--mono);
  font-size: 10px; cursor: pointer; margin-top: 6px; text-transform: uppercase; letter-spacing: 1.2px;
}
.pwa-signout:hover { color: var(--red); }
.pwa-signin-btn {
  width: 100%; padding: 10px; border-radius: 9px;
  background: var(--yellow); color: var(--text-inv); border: 0;
  font-family: var(--grotesk); font-size: 13px; font-weight: 700; cursor: pointer;
}
.pwa-new-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 10px 14px; padding: 10px; border-radius: 9px;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: var(--grotesk); font-size: 13px; font-weight: 600; cursor: pointer;
}
.pwa-new-btn:hover { border-color: var(--yellow); }
.pwa-drawer-section {
  padding: 10px 16px 6px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  color: var(--faint); text-transform: uppercase; letter-spacing: 2px;
}
.pwa-chat-list {
  list-style: none; margin: 0; padding: 0 8px; overflow-y: auto; flex: 1;
}
.pwa-chat-list li {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  color: var(--dim); font-size: 13px; display: flex; flex-direction: column; gap: 2px;
}
.pwa-chat-list li:hover { background: var(--surface); }
.pwa-chat-list li.active { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
.pwa-chat-list li.active .pwa-chat-title { color: var(--yellow); }
.pwa-chat-title {
  font-family: var(--grotesk); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pwa-chat-meta {
  font-family: var(--mono); font-size: 9.5px; color: var(--faint);
  text-transform: uppercase; letter-spacing: 1px;
}
.pwa-chat-empty {
  color: var(--faint); font-size: 12px; padding: 16px; text-align: center; font-style: italic;
}

.pwa .install-banner { z-index: 100; }

/* Standalone mode (fully installed, no browser chrome) */
@media (display-mode: standalone) {
  .nav, .tip, .sidebar, section.how, section.features, section.faq, .foot { display: none !important; }
  .app-shell { grid-template-columns: 1fr !important; height: 100dvh !important; min-height: 0 !important; max-width: 100% !important; border: 0 !important; }
  .chat { height: 100dvh !important; }
  .install-banner { display: none !important; }
}

/* ==================== RESPONSIVE ==================== */

/* Tablet */
@media (max-width: 820px) {
  .app-shell { grid-template-columns: 1fr; height: auto; min-height: 0; }
  .sidebar { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--border); }
  .steps, .feature-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .chat-head { gap: 8px; }
  .chat { min-height: 70vh; }
}

/* Mobile */
@media (max-width: 580px) {
  .nav-inner { padding: 0 12px; height: 52px; }
  .brand { font-size: 14px; gap: 7px; }
  .brand-dot { width: 14px; height: 14px; }
  .nav-cta .btn-ghost, .theme-toggle { padding: 5px 8px; }
  .tip .wrap { padding: 7px 12px; font-size: 11px; }

  .app-shell { border-left: 0; border-right: 0; }
  .sidebar { max-height: 200px; }
  .sb-head { padding: 10px 12px; }
  .btn-primary { font-size: 12px; padding: 9px 12px; }
  .sb-search { padding: 0 12px 8px; }
  .sb-search input { font-size: 12px; padding: 7px 9px; }
  .conv-list li { padding: 8px 10px; font-size: 12.5px; }

  .chat-head { padding: 10px 12px; flex-wrap: wrap; gap: 6px; }
  .mode-tabs { width: 100%; }
  .tab { font-size: 12px; padding: 6px 10px; }
  .chat-controls { width: 100%; justify-content: space-between; }
  .dp-trigger { font-size: 11px; padding: 6px 8px; }
  .dp-menu { min-width: 200px; }

  .messages { padding: 16px 12px 6px; gap: 10px; }
  .bubble { font-size: 13.5px; padding: 10px 12px; max-width: 95%; }
  .bubble .role { font-size: 8.5px; }

  .empty-state { padding: 28px 12px; }
  .empty-state h1 { font-size: 26px; }
  .empty-state p { font-size: 13px; }
  .chips { gap: 6px; }
  .chip { font-size: 11.5px; padding: 6px 10px; }

  .composer { padding: 8px 10px 12px; }
  .composer-inner { padding: 4px 4px 4px 10px; }
  .composer textarea { font-size: 14px; }
  .hide-mobile { display: none !important; }
  .icon-btn { width: 30px; height: 30px; }
  .send-btn { width: 34px; height: 34px; }

  .thumb img { max-height: 56px; }

  section.how, section.features, section.faq { padding: 48px 0; }
  h2 { font-size: 24px; margin-bottom: 16px; }
  .section-lede { font-size: 13.5px; margin-bottom: 24px; }
  .step { padding: 18px 16px; }
  .step-num { width: 32px; height: 32px; font-size: 11px; }
  .step h3 { font-size: 14.5px; min-height: 36px; }
  .step p { font-size: 12.5px; }
  .feature { padding: 18px 16px; }
  .f-ico { width: 36px; height: 36px; font-size: 18px; }
  .feature h3 { font-size: 14px; min-height: 36px; }
  .feature p { font-size: 12.5px; }
  .faq details { padding: 12px 14px; }
  .faq summary { font-size: 14px; }
  .faq p { font-size: 13px; }

  .foot { padding: 18px 0; }
  .foot-inner { flex-direction: column; gap: 6px; align-items: center; text-align: center; }

  /* Modal mobile */
  .modal-card { padding: 24px 18px 18px; }
  .modal-title { font-size: 18px; }
  .modal-sub { font-size: 12.5px; }
  .provider-btn { font-size: 12.5px; padding: 10px 12px; }
  .dev-form input { font-size: 13px; padding: 9px 10px; }

  /* Confirm modal mobile */
  .modal-sm { padding: 18px 16px 14px; }
}
