/* GhostChat dashboard + auth. Same palette as the marketing site (public/assets/site.css). */
:root {
  color-scheme: dark;
  --bg: #07060f;
  --text: #f6f3ff;
  --muted: #aaa5c2;
  --soft: #7f7a98;
  --line: rgba(224, 216, 255, .11);
  --line-2: rgba(224, 216, 255, .2);
  --primary: #8f6cff;
  --violet-2: #b9a6ff;
  --pink: #ff6ad5;
  --cyan: #36c8ff;
  --danger: #fb7185;
  --glass: rgba(18, 13, 34, .6);
  --font-display: "Unbounded", "Space Grotesk", system-ui, sans-serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-label: "Space Grotesk", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font-ui); color: var(--text); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
.hidden { display: none !important; }
a { color: #ddd3ff; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .92em; padding: 1px 6px; border-radius: 6px; background: rgba(143, 108, 255, .14); color: #e5dcff; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.025em; margin: 0 0 8px; line-height: 1.15; }
h3 { font-size: 18px; }
.lede, .muted { color: var(--muted); line-height: 1.55; }
.tiny { font-size: 12.5px; }
.grad { background: linear-gradient(90deg, #b9a6ff, #ff6ad5 60%, #36c8ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
:focus-visible { outline: 2px solid #d9ccff; outline-offset: 3px; }

/* Background */
.scene { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.mesh { position: absolute; inset: -20%; opacity: .42; mix-blend-mode: screen; }
.blob { position: absolute; border-radius: 50%; filter: blur(10px); }
.b1 { width: 50vmax; height: 50vmax; left: -10%; top: -10%; background: radial-gradient(circle, #8a55ff 0, #7b4dff66 24%, transparent 66%); animation: mesh-a 24s ease-in-out infinite alternate; }
.b2 { width: 40vmax; height: 40vmax; right: -12%; top: 30%; background: radial-gradient(circle, #18c4e6 0, #18b8d844 24%, transparent 66%); animation: mesh-b 29s ease-in-out infinite alternate; }
.b3 { width: 38vmax; height: 38vmax; left: 30%; bottom: -20%; background: radial-gradient(circle, #f044b4 0, #e040a844 24%, transparent 66%); animation: mesh-c 33s ease-in-out infinite alternate; }
.grain { position: absolute; inset: 0; opacity: .045; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23fff' filter='url(%23n)' opacity='.6' d='M0 0h180v180H0z'/%3E%3C/svg%3E"); }
.vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 40%, transparent 40%, #07060fc0 100%); }
@keyframes mesh-a { to { transform: translate(12vw, 8vh) scale(1.1); } }
@keyframes mesh-b { to { transform: translate(-10vw, -8vh) scale(.92); } }
@keyframes mesh-c { to { transform: translate(-8vw, -10vh) scale(1.12); } }

/* Glass + controls */
.glass { background: linear-gradient(180deg, rgba(30, 22, 56, .55), rgba(14, 10, 28, .6)); border: 1px solid var(--line); backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2); box-shadow: 0 30px 70px -34px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06); }
.btn { border: 1px solid var(--line-2); background: rgba(255, 255, 255, .04); color: var(--text); border-radius: 12px; padding: 10px 15px; font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-flex; gap: 8px; align-items: center; justify-content: center; transition: transform .15s, background .2s, border-color .2s, box-shadow .2s; }
.btn:hover { background: rgba(255, 255, 255, .08); border-color: #c9b8ff55; }
.btn:active { transform: translateY(1px); }
.btn.primary { border: 0; color: #fff; background: linear-gradient(135deg, #8f6cff 0%, #b06bff 55%, #ff6ad5 100%); box-shadow: 0 10px 26px -10px #8f6cffcc, inset 0 1px 0 #ffffff40; }
.btn.primary:hover { box-shadow: 0 14px 34px -10px #a77bffee, inset 0 1px 0 #ffffff55; }
.btn.ghost { background: transparent; }
.btn.small, .btn.tiny { padding: 8px 11px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; padding: 13px 16px; font-size: 15px; }
.btn:disabled, .btn[aria-busy="true"] { opacity: .6; cursor: default; }
.pill { display: inline-flex; align-items: center; border-radius: 999px; padding: 3px 10px; font-family: var(--font-label); font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; background: rgba(143, 108, 255, .18); color: #e9d5ff; border: 1px solid var(--line-2); }
.error { color: var(--danger); font-size: 13.5px; margin: 10px 0 0; }
label, .stack { display: flex; flex-direction: column; gap: 7px; }
.stack { gap: 14px; margin-top: 22px; }
label { font-size: 13px; font-weight: 500; color: var(--muted); }
input, textarea, select { width: 100%; border: 1px solid var(--line-2); background: rgba(5, 3, 12, .55); color: var(--text); border-radius: 12px; padding: 11px 13px; font: inherit; font-size: 15px; transition: border-color .2s, box-shadow .2s; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #b9a6ff; box-shadow: 0 0 0 4px rgba(143, 108, 255, .2); }
input[type="color"] { padding: 4px; height: 44px; }
input[type="file"] { padding: 9px; font-size: 13px; }
textarea { resize: vertical; }
.check { flex-direction: row; align-items: center; gap: 10px; color: var(--text); }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0; }
.row.center { justify-content: center; }

/* Brand mark */
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.logo-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, #8f6cff, #ff6ad5); box-shadow: 0 0 22px #8f6cff77; }
.logo-mark svg { width: 20px; height: 20px; color: #fff; }

/* ---------- Auth ---------- */
.auth { min-height: 100svh; display: grid; grid-template-columns: 1.05fr 1fr; position: relative; z-index: 1; }
.auth-art { padding: 36px clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 30px; border-right: 1px solid var(--line); background: linear-gradient(180deg, rgba(20, 14, 40, .4), rgba(10, 7, 20, .2)); }
.auth-art-body img { width: 100%; max-width: 560px; height: auto; border-radius: 24px; border: 1px solid var(--line-2); box-shadow: 0 40px 80px -30px #8f6cff66; animation: float 7s ease-in-out infinite; }
.auth-art-body h2 { font-size: clamp(30px, 3.6vw, 48px); margin: 34px 0 18px; }
.auth-art-body ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; color: #ddd6f5; }
.auth-art-body li::before { content: "✓"; color: var(--violet-2); margin-right: 10px; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.auth-side { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 36px 20px calc(28px + env(safe-area-inset-bottom)); gap: 18px; }
.auth-mobile-brand { display: none; }
.auth-card { width: min(440px, 100%); padding: clamp(26px, 4vw, 38px); border-radius: 28px; }
.auth-card h1 { font-size: clamp(24px, 3vw, 30px); }
.auth-card > p.muted { margin: 0 0 22px; }
.oauth-list { display: grid; gap: 10px; }
.btn.oauth { position: relative; width: 100%; padding: 13px 16px; font-size: 15px; border-radius: 14px; }
.btn.oauth svg { width: 20px; height: 20px; flex: none; }
.btn.oauth.discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn.oauth.discord:hover { background: #4752c4; }
.btn.oauth.google { background: #fff; border-color: #fff; color: #1f1f1f; }
.btn.oauth.google:hover { background: #f1f1f4; }
.soon-badge { display: none; position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-style: normal; font-family: var(--font-label); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, .25); }
.btn.oauth.google .soon-badge { background: rgba(0, 0, 0, .08); }
.btn.oauth.soon { opacity: .62; cursor: not-allowed; filter: saturate(.7); }
.btn.oauth.soon .soon-badge { display: inline-block; }
.divider { display: flex; align-items: center; gap: 12px; margin: 20px 0 16px; color: var(--soft); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
#auth-form { display: grid; gap: 14px; }
.pw { position: relative; display: block; }
.pw input { padding-right: 70px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: rgba(255, 255, 255, .06); color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 6px 10px; border-radius: 9px; cursor: pointer; }
.switch { text-align: center; margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.switch a { font-weight: 600; }
.legal { text-align: center; max-width: 400px; }

/* ---------- App shell ---------- */
.app { min-height: 100svh; display: grid; grid-template-columns: 264px minmax(0, 1fr); position: relative; z-index: 1; }
.rail { position: sticky; top: 0; height: 100svh; border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 14px; background: rgba(10, 7, 20, .55); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.rail-top { display: flex; flex-direction: column; gap: 16px; }
.rail-label { font-family: var(--font-label); font-size: 11px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); margin: 6px 4px -4px; }
.site-list { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow: auto; }
.site-list button { text-align: left; border: 1px solid transparent; background: transparent; color: var(--text); padding: 10px 12px; border-radius: 12px; cursor: pointer; font: inherit; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .2s, border-color .2s; }
.site-list button:hover { background: rgba(255, 255, 255, .05); }
.site-list button.on { background: rgba(143, 108, 255, .16); border-color: #b9a6ff44; }
.rail-foot { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 14px; }
.rail-foot .btn { justify-content: flex-start; }
.owner { display: flex; align-items: center; gap: 10px; padding: 8px 4px; min-width: 0; }
.owner span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center; background: rgba(143, 108, 255, .2); border: 1px solid var(--line-2); overflow: hidden; font-size: 15px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.main { padding: 26px clamp(16px, 3vw, 40px) 60px; max-width: 1100px; width: 100%; min-width: 0; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 20px 22px; border-radius: 22px; margin-bottom: 16px; }
.top h2 { font-size: clamp(20px, 2.6vw, 28px); margin-bottom: 6px; overflow-wrap: anywhere; }
.meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.usage-bar { width: min(260px, 40%); height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; flex: none; }
.usage-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8f6cff, #ff6ad5); border-radius: inherit; transition: width .6s ease; box-shadow: 0 0 12px #8f6cff; }
.tabs { display: flex; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 4px; margin: 0 0 16px; border-radius: 16px; background: rgba(10, 7, 20, .5); border: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.tabs::-webkit-scrollbar { display: none; }
/* Desktop (sidebar layout): wrap so Leads, Share and Live chat stay on-screen.
   Phones keep a single swipeable row — the hidden scrollbar is fine with touch. */
@media (min-width: 861px) {
  .tabs { flex-wrap: wrap; overflow: visible; }
}
.tabs button { flex: none; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; font-size: 14px; padding: 9px 14px; border-radius: 12px; cursor: pointer; transition: color .2s, background .2s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: linear-gradient(135deg, rgba(143, 108, 255, .35), rgba(255, 106, 213, .2)); color: #fff; box-shadow: inset 0 0 0 1px #b9a6ff44; }
.panel { padding: clamp(18px, 3vw, 28px); border-radius: 22px; animation: rise .35s ease; }
.panel > h3:first-child { margin-top: 0; }
.panel h3 { margin-top: 8px; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.empty { text-align: center; padding: clamp(24px, 5vw, 44px); border-radius: 26px; max-width: 640px; margin: 4vh auto; }
.empty img { width: 100%; max-width: 420px; height: auto; margin: 0 auto 22px; border-radius: 20px; border: 1px solid var(--line-2); }

/* Getting-started checklist on the Setup tab */
.checklist { padding: 18px; border-radius: 18px; margin-bottom: 24px; border: 1px solid #b9a6ff33; background: linear-gradient(135deg, rgba(143, 108, 255, .14), rgba(54, 200, 255, .06)); }
.checklist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.checklist ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; counter-reset: c; }
.checklist li { counter-increment: c; }
.checklist li button { width: 100%; height: 100%; text-align: left; display: grid; gap: 2px; padding: 12px 12px 12px 46px; position: relative; border-radius: 14px; border: 1px solid var(--line); background: rgba(5, 3, 12, .35); color: var(--text); font: inherit; cursor: pointer; transition: border-color .2s, transform .15s; }
.checklist li button:hover { border-color: #b9a6ff66; transform: translateY(-1px); }
.checklist li button::before { content: counter(c); position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: linear-gradient(135deg, #8f6cff, #ff6ad5); }
.checklist li span { color: var(--muted); font-size: 12.5px; }

.list, .transcripts { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.item, .log { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(5, 3, 12, .3); overflow-wrap: anywhere; }
.log { display: block; }
.log .who { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.cards button { text-align: left; border: 1px solid var(--line); background: rgba(5, 3, 12, .35); border-radius: 16px; padding: 14px; color: var(--text); cursor: pointer; font: inherit; transition: border-color .2s; }
.cards button:hover, .cards button.on { border-color: var(--violet-2); background: rgba(143, 108, 255, .12); }
.cards strong { display: block; margin-bottom: 4px; }
.analytics { display: grid; gap: 18px; margin-top: 12px; }
.analytics ul { padding-left: 18px; color: #ddd6f5; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 8px; }
.stat { padding: 16px; border-radius: 16px; border: 1px solid var(--line); background: rgba(5, 3, 12, .3); color: var(--muted); font-size: 13px; }
.stat b { display: block; font-size: 24px; font-family: var(--font-display); color: var(--text); margin-bottom: 4px; text-transform: capitalize; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-top: 18px; }
.plan-card { padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: rgba(5, 3, 12, .3); display: flex; flex-direction: column; gap: 6px; }
.plan-card.current { border-color: #b9a6ff88; background: rgba(143, 108, 255, .12); }
.plan-card h4 { margin: 0; font-family: var(--font-display); font-size: 18px; }
.plan-card ul { margin: 6px 0 12px; padding-left: 18px; color: #ddd6f5; font-size: 13.5px; }
.plan-card .btn { margin-top: auto; }
#share-qr { margin-top: 16px; border-radius: 16px; background: #fff; padding: 10px; max-width: 100%; height: auto; }
dialog { border: 1px solid var(--line-2); border-radius: 24px; padding: 26px; width: min(460px, calc(100vw - 24px)); color: var(--text); background: rgba(18, 13, 34, .94); }
dialog .stack { margin-top: 0; }
dialog::backdrop { background: rgba(5, 2, 12, .7); backdrop-filter: blur(6px); }
#toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); background: rgba(26, 16, 48, .95); border: 1px solid var(--line-2); padding: 11px 18px; border-radius: 999px; z-index: 9; box-shadow: 0 16px 40px -10px #000; font-size: 14px; max-width: calc(100vw - 32px); text-align: center; }

/* ---------- Responsive (tuned for phones incl. Galaxy Z Fold cover + inner screens) ---------- */
@media (max-width: 980px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .auth-mobile-brand { display: inline-flex; }
  .auth-side { justify-content: flex-start; padding-top: max(28px, env(safe-area-inset-top)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail, .main { min-width: 0; }
  .rail { position: sticky; top: 0; z-index: 5; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .rail-top { flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .rail-label { display: none; }
  .site-list { flex-direction: row; overflow-x: auto; flex: 1 1 100%; order: 3; scrollbar-width: none; }
  .site-list::-webkit-scrollbar { display: none; }
  .site-list button { flex: none; max-width: 70vw; padding: 8px 12px; }
  .rail-foot { flex-direction: row; flex-wrap: wrap; align-items: center; width: 100%; order: 4; border-top: 0; padding-top: 0; gap: 6px; }
  .rail-foot .btn { flex: 1 1 auto; justify-content: center; }
  .owner { display: none; }
  .main { padding: 16px 12px 48px; }
  .top { flex-direction: column; align-items: stretch; }
  .usage-bar { width: 100%; }
}
@media (max-width: 420px) {
  .brand { font-size: 16px; }
  .auth-card { border-radius: 22px; padding: 22px 18px; }
  .rail-foot .btn { flex: 1 1 auto; font-size: 12px; padding: 7px 8px; }
  .tabs button { padding: 8px 11px; font-size: 13px; }
  .row .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- My account ---- */
#account-view { display: grid; gap: 18px; }
.acct-head { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.avatar.lg { width: 52px; height: 52px; font-size: 20px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.row .grow { flex: 1 1 220px; }
.row.end { justify-content: flex-end; }
.methods { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.methods li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(5, 3, 12, .3); }
.methods .on { color: #86efac; font-size: 13px; }
.methods .off { color: var(--soft); font-size: 13px; }
.linklike { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; font: inherit; font-size: 13px; cursor: pointer; }
.linklike:hover { color: var(--text); }
.cancel-line { margin: 16px 0 0; }
.btn.danger { background: rgba(251, 113, 133, .14); border: 1px solid rgba(251, 113, 133, .45); color: #fecdd3; }
.btn.danger:hover { background: rgba(251, 113, 133, .24); }
.danger-zone { border-color: rgba(251, 113, 133, .25); }
.dlg { width: min(460px, calc(100vw - 24px)); border-radius: 22px; padding: 22px; color: var(--text); border: 1px solid var(--line); }
.dlg::backdrop { background: rgba(5, 2, 12, .7); backdrop-filter: blur(4px); }
.dlg h3 { margin: 0 0 6px; }
.dlg select, .dlg textarea { width: 100%; }
.remember { margin: 2px 0 4px; font-size: 13.5px; }
.plan-card h4 .price { font-family: var(--font-body, inherit); font-size: 13px; font-weight: 600; color: var(--muted); margin-left: 6px; }

/* Message top-ups and usage banner */
.topups:empty { display: none; }
.topups, .usage-banner .topup-head { margin-top: 14px; }
.topup-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.topup-head h4 { margin: 0; }
.topup-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 8px; }
.topup { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line, rgba(196,181,253,.18)); background: linear-gradient(135deg, rgba(167,139,250,.10), transparent); color: inherit; text-decoration: none; transition: border-color .18s, transform .18s; }
.topup:hover { border-color: var(--primary, #a78bfa); transform: translateY(-1px); }
.topup span { font-size: 18px; font-weight: 700; }
.topup small, .topup em { font-size: 12px; opacity: .7; font-style: normal; font-weight: 500; }
.usage-banner { margin: 12px 0; padding: 12px 16px; border-radius: 14px; border: 1px solid rgba(250,204,21,.35); background: rgba(250,204,21,.08); }
.usage-banner.warn { border-color: rgba(248,113,113,.45); background: rgba(248,113,113,.08); }
.usage-banner p { margin: 0; }
.usage-banner.hidden { display: none; }

/* ---------- Live chat ---------- */
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #f43f5e; color: #fff; font-size: 11px; font-weight: 700; margin-left: 4px; }
.st { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); margin-left: 6px; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.st.human { color: #34d399; border-color: rgba(52, 211, 153, .35); }
.st.waiting { color: #fbbf24; border-color: rgba(251, 191, 36, .35); }
.inbox { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; gap: 0; padding: 0; overflow: hidden; min-height: min(78vh, 760px); }
.inbox-list { border-right: 1px solid var(--line); padding: 18px 12px; overflow: auto; max-height: 80vh; }
.inbox-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 6px; }
.inbox-items { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 16px; }
.inbox-item { text-align: left; display: grid; gap: 3px; padding: 10px 10px; border-radius: 12px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; font: inherit; }
.inbox-item:hover { background: rgba(255, 255, 255, .04); }
.inbox-item.on { background: rgba(143, 108, 255, .14); border-color: var(--line-2); }
.ii-top { font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.ii-prev { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inbox-pane { display: flex; flex-direction: column; min-width: 0; max-height: 80vh; }
.inbox-empty { margin: auto; padding: 40px; text-align: center; max-width: 360px; }
.ip-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.ip-head .row { margin: 0; }
.ip-url { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-msgs { flex: 1; overflow: auto; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.im { display: flex; flex-direction: column; gap: 3px; max-width: 78%; align-self: flex-start; }
.im.user { align-self: flex-start; }
.im.assistant, .im.agent { align-self: flex-end; align-items: flex-end; }
.im-who { font-size: 11px; color: var(--soft); }
.im-b { padding: 9px 12px; border-radius: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.im.assistant .im-b { background: rgba(143, 108, 255, .12); }
.im.agent .im-b { background: rgba(16, 185, 129, .14); border-color: rgba(52, 211, 153, .3); }
.im.system { align-self: center; max-width: 100%; }
.im.system .im-b { background: transparent; border-style: dashed; color: var(--muted); font-size: 12px; border-radius: 999px; padding: 5px 12px; }
.ip-reply { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); align-items: flex-end; }
.ip-reply textarea { resize: none; min-height: 44px; }
@media (max-width: 760px) { .inbox { grid-template-columns: 1fr; } .inbox-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 38vh; } .im { max-width: 92%; } }
.live-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.live-head h3 .pill { margin-left: 6px; vertical-align: middle; }
.switch-toggle { position: relative; flex: none; width: 50px; height: 28px; cursor: pointer; }
.switch-toggle input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.switch-toggle span { position: absolute; inset: 0; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line-2); transition: background .2s; }
.switch-toggle span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .25s cubic-bezier(.34, 1.4, .5, 1); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.switch-toggle input:checked + span { background: linear-gradient(135deg, #10b981, #34d399); }
.switch-toggle input:checked + span::after { transform: translateX(22px); }
.switch-toggle input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 2px; }
.switch-toggle input:disabled + span { opacity: .5; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.live-locked { margin: 14px 0; padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(251, 191, 36, .35); background: rgba(251, 191, 36, .07); }
.live-locked p { margin: 4px 0 10px; }
.live-grid { display: grid; grid-template-columns: 1fr minmax(240px, 300px); gap: 22px; align-items: start; }
.live-grid.is-locked { opacity: .55; pointer-events: none; filter: saturate(.6); }
.live-settings { margin-top: 10px; }
.seg { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.seg label { flex-direction: row; align-items: center; gap: 8px; color: var(--text); }
.seg input { width: 16px; height: 16px; accent-color: var(--primary); }
.live-preview { position: sticky; top: 12px; text-align: center; }
.lp-panel { text-align: left; border-radius: 20px; overflow: hidden; border: 1px solid var(--line-2); background: rgba(12, 8, 20, .85); box-shadow: 0 24px 50px -24px rgba(0, 0, 0, .8); }
.lp-head { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.lp-head small { display: block; color: #34d399; font-size: 11.5px; }
.lp-av { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: radial-gradient(120% 120% at 30% 15%, #6ee7b7, #10b981 45%, #047857); font-size: 15px; }
.lp-msgs { padding: 12px; display: flex; flex-direction: column; gap: 7px; font-size: 13px; }
.lp-b { padding: 8px 11px; border-radius: 14px; border: 1px solid var(--line); background: #110818; max-width: 85%; }
.lp-b.user { align-self: flex-end; background: #2a1848; }
.lp-b.sys { align-self: center; background: transparent; border-style: dashed; color: var(--muted); font-size: 11.5px; border-radius: 999px; text-align: center; }
.lp-b.agent { border-color: rgba(52, 211, 153, .4); box-shadow: inset 3px 0 0 #34d399; }
.lp-name { font-size: 11px; font-weight: 700; color: #34d399; }
.live-ch-title { margin-top: 26px; }
.live-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 10px; }
.ch-card { border: 1px solid var(--line-2); border-radius: 16px; padding: 14px 16px; background: rgba(255, 255, 255, .025); }
.ch-top { display: flex; justify-content: space-between; align-items: center; }
.ch-card .row { margin: 10px 0 4px; }
.ch-card code { background: rgba(255, 255, 255, .08); padding: 2px 6px; border-radius: 6px; }
.ch-own summary { cursor: pointer; color: var(--muted); margin-top: 6px; }
.ch-own .row input { flex: 1; min-width: 160px; font-size: 13px; padding: 8px 10px; }
@media (max-width: 760px) { .live-grid { grid-template-columns: 1fr; } .live-head { flex-direction: row; } }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; } @media (max-width: 560px) { .row.two { grid-template-columns: 1fr; } }
/* Site search tools */
.tool { padding: 14px; border-radius: 14px; display: flex; flex-direction: column; gap: 10px; }
.tool .row { margin: 0; }
.row.between { justify-content: space-between; }
.row.tight { gap: 10px; flex-wrap: wrap; }
.fieldmap { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.fieldmap input { width: 100%; }
.tool-cards { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.tool-card { flex: none; width: 110px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 4px; color: inherit; text-decoration: none; font-size: 12px; }
.tool-card img, .tool-card .ph { width: 110px; aspect-ratio: 2/3; object-fit: cover; border-radius: 10px; background: rgba(139,92,246,.15); }
.tool-card small { opacity: .7; }
.tool-out .err { color: #f87171; }
details.scope { margin: 14px 0; border: 1px solid rgba(196,181,253,.18); border-radius: 12px; padding: 10px 12px; }
details.scope summary { cursor: pointer; font-weight: 600; }
details.scope form { margin-top: 10px; }
.og-preview { display: block; width: 100%; max-width: 600px; height: auto; aspect-ratio: 1200 / 630; border-radius: 14px; border: 1px solid rgba(196,181,253,.18); margin-top: 8px; }

/* v2 analytics charts */
.chart-card { padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: rgba(5, 3, 12, .3); min-width: 0; }
.chart-card h3 { margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-bottom: 20px; position: relative; }
.bars.dense { gap: 2px; }
.bar { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar i { display: block; width: 100%; max-width: 28px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent, #a78bfa), rgba(139, 92, 246, .35)); transition: height .4s ease; }
.bar.hi i { background: linear-gradient(180deg, #f5c86b, #a78bfa); }
.bar span { position: absolute; bottom: -18px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.hbars { list-style: none; padding: 0 !important; display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(60px, 1fr) auto; gap: 10px; align-items: center; }
.hbar-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-b { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.hbar-b i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #8b5cf6, #22d3ee); }
.lowc-list { list-style: none; padding: 0 !important; display: grid; gap: 10px; }
.lowc { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(5, 3, 12, .3); }
.lowc > div { min-width: 0; display: grid; gap: 2px; }
.lowc p { margin: 4px 0 0; overflow-wrap: anywhere; }
.log .fix-btn { margin-top: 8px; }
@media (max-width: 520px) {
  .lowc { flex-direction: column; }
  .hbar { grid-template-columns: minmax(0, 1fr) 60px auto; }
  .bars { height: 120px; }
}

/* ---- v2: mode picker, support, tickets, features, wizard ---- */
.mode-picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.mode-picks button { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 14px; border-radius: 16px; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; font: inherit; transition: border-color .2s, background .2s, transform .2s; }
.mode-picks button:hover { transform: translateY(-1px); }
.mode-picks button.on { border-color: var(--primary); background: rgba(143,108,255,.16); box-shadow: 0 0 0 1px var(--primary) inset; }
fieldset.hours { border: 1px solid var(--line-2); border-radius: 16px; padding: 12px 14px; display: grid; gap: 10px; }
fieldset.hours legend { padding: 0 6px; color: var(--muted); font-size: 13px; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days .day { flex-direction: row; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; color: var(--text); }
.days .day input { width: 15px; height: 15px; accent-color: var(--primary); }
.canned, .greet { display: grid; gap: 8px; padding: 10px; border-radius: 14px; }
.canned { grid-template-columns: 1fr; }
.canned [data-rm] { justify-self: start; }
.greet { grid-template-columns: minmax(90px, 1fr) minmax(160px, 2.4fr) auto auto; align-items: center; }
.greet .sec, .ff .sec { flex-direction: row; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.greet .sec input { width: 64px; }
.form-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 6px 14px; }
.ff { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 12px; }
.callout { border: 1px dashed var(--line-2); border-radius: 14px; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.callout ol { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }
.callout code, .tm code { word-break: break-all; }
.tfilter { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line-2); border-radius: 999px; }
.tfilter button { border: 0; background: none; color: var(--muted); padding: 6px 12px; border-radius: 999px; cursor: pointer; font: inherit; font-size: 13px; }
.tfilter button.on { background: rgba(143,108,255,.22); color: var(--text); }
.tickets { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.ticket-list { display: grid; gap: 8px; }
.tk { display: grid; gap: 4px; text-align: left; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,.03); color: var(--text); cursor: pointer; font: inherit; }
.tk.on, .tk:hover { border-color: var(--primary); }
.tk-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.tk-top b { font-size: 14px; overflow-wrap: anywhere; }
.tk-pri { flex: none; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.tk-pri.p-high { color: #fdba74; border-color: rgba(253,186,116,.5); }
.tk-pri.p-urgent { color: #fda4af; border-color: rgba(251,113,133,.6); background: rgba(251,113,133,.12); }
.tk-st { text-transform: capitalize; }
.tk-st.st-open { color: #93c5fd; } .tk-st.st-pending { color: #fcd34d; } .tk-st.st-solved { color: #86efac; }
.ticket-detail { padding: 16px; border-radius: 18px; display: grid; gap: 12px; min-width: 0; }
.ticket-detail h4 { margin: 0; overflow-wrap: anywhere; }
.tk-thread { display: grid; gap: 8px; }
.tm { padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.tm.agent { background: rgba(143,108,255,.12); }
.tm p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.tm small { color: var(--muted); }
.tk-trans pre { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 260px; overflow: auto; font-size: 12.5px; background: rgba(0,0,0,.25); padding: 10px; border-radius: 12px; }
.empty-tk { padding: 18px; border: 1px dashed var(--line-2); border-radius: 16px; }
dialog.wizard { width: min(560px, calc(100vw - 20px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 26px 22px 22px; }
.wz-steps { display: flex; gap: 6px; margin-bottom: 16px; }
.wz-steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--line-2); transition: background .3s; }
.wz-steps i.on { background: linear-gradient(90deg, var(--primary), var(--pink)); }
.wz-body section { display: grid; gap: 12px; }
.wz-body section[hidden], .ticket-detail[hidden] { display: none; }
.wz-body h3 { margin: 0; }
.wz-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--muted); cursor: pointer; }
.wz-progress { height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.wz-progress i { display: block; height: 100%; width: 30%; background: linear-gradient(90deg, var(--primary), var(--cyan)); border-radius: 6px; }
.wz-progress.run i { animation: wz-run 1.2s ease-in-out infinite; }
@keyframes wz-run { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
#wz-chat { width: 100%; height: min(460px, 60vh); border: 1px solid var(--line-2); border-radius: 16px; background: #0b0816; }
#wz-snippet { width: 100%; font-family: ui-monospace, monospace; font-size: 12.5px; }
@media (max-width: 760px) {
  .tickets { grid-template-columns: 1fr; }
  .greet { grid-template-columns: 1fr auto; }
  .greet [data-g="message"] { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 400px) {
  .tfilter button { padding: 6px 9px; }
  .mode-picks { grid-template-columns: 1fr 1fr; }
}
.lowc-list .lowc-more { display: none; }
.tk-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tk-head .btn { flex: none; width: auto; }
