/* =========================================================
   GLIME LIVE DEMO  (demo.html)
   Same design tokens as index.html. Page-specific only.
========================================================= */
:root {
  --bg: #071016;
  --bg-deep: #050b10;
  --surface: #101b29;
  --border: rgba(184, 222, 234, 0.13);
  --text: #f4fbfd;
  --muted: #9cabb9;
  --dim: #6f818c;
  --cyan: #52e8ff;
  --green: #50f5a8;
  --purple: #a68cff;
  --red: #ff6b7a;
  --amber: #ffc857;
  --container: 1180px;
  --wa: #25d366;
  --wa-dark: #075e54;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; background: var(--bg); }
body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(700px 500px at 85% 0%, rgba(82, 232, 255, 0.08), transparent 70%),
    radial-gradient(700px 600px at 5% 70%, rgba(166, 140, 255, 0.07), transparent 70%),
    var(--bg);
  font-family: "Manrope", Arial, sans-serif;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; color: inherit; border: 0; background: none; }
h1, h2, h3, p, a, span, small, b { overflow-wrap: break-word; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

.container { width: min(var(--container), calc(100% - 32px)); margin-inline: auto; }

.eyebrow {
  color: var(--cyan);
  font-family: "DM Mono", monospace;
  font-size: 0.72rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.demo { padding: 34px 0 70px; }

/* ---------- head ---------- */
.demo-title {
  margin-top: 12px;
  font-size: clamp(2rem, 5.6vw, 3.6rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}
.demo-title span { display: block; color: var(--cyan); }
.demo-lead { max-width: 720px; margin-top: 16px; color: var(--muted); font-size: 0.98rem; line-height: 1.75; }

/* ---------- progress rail ---------- */
.steps { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 28px; }
.steps li { min-width: 0; }
.steps button { width: 100%; display: grid; gap: 8px; text-align: left; padding: 4px 0; }
.steps .bar { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.09); position: relative; overflow: hidden; }
.steps .bar::after {
  content: ""; position: absolute; inset: 0; transform: scaleX(0); transform-origin: left;
  background: linear-gradient(90deg, var(--green), var(--cyan)); transition: transform 0.45s ease;
}
.steps li.done .bar::after, .steps li.now .bar::after { transform: scaleX(1); }
.steps li.now .bar { box-shadow: 0 0 14px rgba(82, 232, 255, 0.45); }
.steps li.problem.now .bar::after, .steps li.problem.done .bar::after { background: linear-gradient(90deg, var(--red), var(--amber)); }
.steps .lbl { display: none; font-family: "DM Mono", monospace; font-size: 0.64rem; letter-spacing: 0.05em; color: var(--dim); text-transform: uppercase; }
.steps li.now .lbl { color: var(--cyan); }
.steps li.done .lbl { color: var(--muted); }
@media (min-width: 640px) { .steps .lbl { display: block; } }

/* ---------- caption bar ---------- */
.capbar {
  margin-top: 16px;
  padding: 20px 22px;
  display: grid;
  gap: 18px;
  border: 1px solid rgba(82, 232, 255, 0.17);
  border-radius: 20px;
  background: radial-gradient(circle at 0% 0%, rgba(82, 232, 255, 0.10), transparent 60%), rgba(255, 255, 255, 0.025);
}
.capbar.bad { border-color: rgba(255, 107, 122, 0.35); background: radial-gradient(circle at 0% 0%, rgba(255, 107, 122, 0.12), transparent 60%), rgba(255, 255, 255, 0.025); }
.step-kicker { color: var(--green); font-family: "DM Mono", monospace; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; }
.capbar.bad .step-kicker { color: var(--red); }
.step-heading { margin-top: 6px; font-size: clamp(1.3rem, 3.2vw, 1.8rem); line-height: 1.14; letter-spacing: -0.04em; }
.step-text { margin-top: 8px; color: var(--muted); font-size: 0.94rem; line-height: 1.65; max-width: 640px; }
.step-text.ok { color: var(--green); }
.cap-text.swap { animation: swap 0.4s ease; }
@keyframes swap { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.controls { display: flex; flex-wrap: wrap; align-content: center; gap: 10px; }
@media (min-width: 980px) {
  .capbar { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .controls { justify-content: flex-end; max-width: 420px; }
}

.btn {
  min-height: 46px; padding: 11px 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px; font-size: 0.84rem; font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:disabled { opacity: 0.35; pointer-events: none; }
.btn-primary { color: #031014; background: linear-gradient(105deg, var(--green), var(--cyan)); box-shadow: 0 12px 35px rgba(82, 232, 255, 0.14); }
.btn-ghost { background: rgba(255, 255, 255, 0.025); border-color: var(--border); }
.btn-ghost:hover { border-color: rgba(82, 232, 255, 0.35); }
.btn[aria-pressed="true"] { border-color: var(--green); color: var(--green); }
.btn-lg { min-height: 52px; padding: 13px 22px; font-size: 0.88rem; }

/* ---------- stage ---------- */
.tabs { display: flex; gap: 8px; margin-top: 18px; }
.tab { flex: 1; padding: 11px 10px; border: 1px solid var(--border); border-radius: 12px; font-size: 0.8rem; font-weight: 800; color: var(--muted); background: rgba(255, 255, 255, 0.025); }
.tab.on { color: #031014; border-color: transparent; background: linear-gradient(105deg, var(--green), var(--cyan)); }
.tab.alert::after { content: " ●"; color: var(--red); }
.tab.on.alert::after { color: #031014; }

.stage { margin-top: 18px; display: grid; gap: 22px; align-items: start; }
.stage[data-dev="phone"] .dev-dash { display: none; }
.stage[data-dev="dash"] .dev-phone { display: none; }
.dev { display: grid; justify-items: center; gap: 12px; min-width: 0; }
.dev-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-family: "DM Mono", monospace; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; }
.dot-live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(80, 245, 168, 0.7); animation: live 1.8s infinite; }
@keyframes live { 70% { box-shadow: 0 0 0 8px rgba(80, 245, 168, 0); } 100% { box-shadow: 0 0 0 0 rgba(80, 245, 168, 0); } }

@media (min-width: 1000px) {
  .tabs { display: none; }
  .stage, .stage[data-dev] { grid-template-columns: 296px minmax(0, 1fr); gap: 30px; }
  .stage[data-dev] .dev-phone, .stage[data-dev] .dev-dash { display: grid; }
  .dev-dash { justify-items: stretch; }
}

.stage-note { margin-top: 16px; color: var(--dim); font-size: 0.74rem; text-align: center; }

/* ---------- tap hint ---------- */
.hot { position: relative; z-index: 2; animation: pulse 1.5s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(80, 245, 168, 0.85); }
  80%, 100% { box-shadow: 0 0 0 11px rgba(80, 245, 168, 0); }
}

/* ---------- channel toggle ---------- */
.channel { display: inline-flex; padding: 4px; gap: 4px; border: 1px solid var(--border); border-radius: 999px; background: rgba(255, 255, 255, 0.03); }
.chan { padding: 7px 16px; border-radius: 999px; font-size: 0.78rem; font-weight: 800; color: var(--muted); transition: background 0.2s ease, color 0.2s ease; }
.chan.on { color: #031014; background: linear-gradient(105deg, var(--green), var(--cyan)); }
.chan#chan-ig.on { background: linear-gradient(105deg, #fa7e1e, #d62976 55%, #962fbf); color: #fff; }

/* ---------- phone ---------- */
.phone {
  --ink: #111b21;
  --sub: #667781;
  --line: #e9edef;
  --accent: var(--wa);
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(296px, 100%);
  aspect-ratio: 9 / 18;
  container-type: inline-size;
  overflow: hidden;
  border: 9px solid #0c1a22;
  border-radius: 40px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0 0 1.5px rgba(184, 222, 234, 0.25), 0 40px 90px rgba(0, 0, 0, 0.55), 0 0 90px rgba(82, 232, 255, 0.10);
  font-size: 4cqw;
  line-height: 1.35;
}
.phone[data-chan="ig"] { --accent: #d62976; }
.phone-notch { position: absolute; z-index: 30; top: 2.2cqw; left: 50%; width: 22cqw; height: 5cqw; transform: translateX(-50%); border-radius: 99px; background: #0c1a22; }

.chat-head { display: flex; align-items: center; gap: 3cqw; padding: 10cqw 4cqw 3cqw; color: #fff; background: var(--wa-dark); }
.phone[data-chan="ig"] .chat-head { color: var(--ink); background: #fff; border-bottom: 1px solid var(--line); }
.chat-head b { display: block; font-size: 4cqw; line-height: 1.15; }
.chat-head small { display: block; font-size: 3cqw; opacity: 0.8; }
.chat-head > div { flex: 1; min-width: 0; }
.avatar { flex: none; width: 9cqw; height: 9cqw; display: grid; place-items: center; border-radius: 50%; color: #031014; background: linear-gradient(135deg, var(--green), var(--cyan)); font-weight: 800; font-size: 4cqw; }
.chan-badge { flex: none; padding: 0.8cqw 2.4cqw; border-radius: 99px; background: rgba(255, 255, 255, 0.18); font-size: 2.7cqw; font-weight: 800; }
.phone[data-chan="ig"] .chan-badge { background: linear-gradient(105deg, #fa7e1e, #d62976, #962fbf); color: #fff; }

.chat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2cqw; padding: 3cqw 3.4cqw; overflow-y: auto; scroll-behavior: smooth; background: #efe7dd; }
.phone[data-chan="ig"] .chat-body { background: #fff; }
.chat-body::-webkit-scrollbar { width: 0; }
.chat-body > * { flex-shrink: 0; }
.thread-body > * { flex-shrink: 0; }

.sys { align-self: center; max-width: 90%; padding: 1.6cqw 3cqw; border-radius: 2.4cqw; background: #fdf4c5; color: #54656f; text-align: center; font-size: 2.9cqw; }
.phone[data-chan="ig"] .sys { background: #f3f3f3; }
.sys.pay { background: #d9fdd3; color: #107a43; font-weight: 700; }

.msg { position: relative; max-width: 82%; padding: 2cqw 3cqw 3.8cqw; border-radius: 2.6cqw; font-size: 3.6cqw; line-height: 1.4; white-space: pre-line; box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12); animation: pop 0.32s ease both; }
.msg time { position: absolute; right: 2.4cqw; bottom: 0.8cqw; font-size: 2.4cqw; color: #667781; white-space: nowrap; }
.msg.out { align-self: flex-end; background: #d9fdd3; border-top-right-radius: 0.6cqw; }
.msg.in { align-self: flex-start; background: #fff; border-top-left-radius: 0.6cqw; }
.msg.out time::after { content: " ✓✓"; color: #53bdeb; }
.phone[data-chan="ig"] .msg { box-shadow: none; border-radius: 5cqw; padding-bottom: 2cqw; }
.phone[data-chan="ig"] .msg time { display: none; }
.phone[data-chan="ig"] .msg.in { background: #efefef; }
.phone[data-chan="ig"] .msg.out { color: #fff; background: linear-gradient(135deg, #8a3ab9, #d62976 70%, #fa7e1e); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(0.97); } to { opacity: 1; transform: none; } }

.typing { align-self: flex-start; display: flex; gap: 1.2cqw; padding: 3cqw 3.4cqw; border-radius: 99px; background: #fff; animation: pop 0.25s ease both; }
.phone[data-chan="ig"] .typing { background: #efefef; }
.typing i { width: 1.8cqw; height: 1.8cqw; border-radius: 50%; background: #8a979e; animation: dot 1s infinite; }
.typing i:nth-child(2) { animation-delay: 0.15s; }
.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot { 0%, 60%, 100% { transform: none; opacity: 0.5; } 30% { transform: translateY(-1.2cqw); opacity: 1; } }

.pcard { align-self: flex-start; width: 80%; overflow: hidden; border-radius: 3cqw; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); animation: pop 0.32s ease both; }
.phone[data-chan="ig"] .pcard { box-shadow: 0 0 0 1px var(--line); }
.pimg { height: 20cqw; display: grid; place-items: center; font-size: 10cqw; background: linear-gradient(135deg, #cfe9ff, #e6dcff); }
.pbody { padding: 2.4cqw 3cqw 3cqw; }
.pcard b { display: block; font-size: 3.6cqw; }
.pcard small { display: block; color: #667781; font-size: 3cqw; }
.price { margin-top: 0.6cqw; font-size: 4cqw; font-weight: 800; color: var(--ink); }
.pcard .line { display: flex; justify-content: space-between; gap: 2cqw; margin-top: 1cqw; font-size: 3.1cqw; color: #3b4a54; }
.paybtn { width: 100%; margin-top: 2.2cqw; padding: 2.4cqw; border-radius: 2.4cqw; color: #fff; background: #3395ff; font-size: 3.5cqw; font-weight: 800; }
.paybtn:disabled { background: #2ea36b; pointer-events: none; animation: none; }

.track-steps { margin-top: 2cqw; display: grid; gap: 1.2cqw; }
.track-steps div { display: flex; align-items: center; gap: 2cqw; font-size: 3cqw; color: #8a979e; }
.track-steps div::before { content: ""; width: 3cqw; height: 3cqw; border-radius: 50%; border: 1.5px solid #c3ccd1; flex: none; }
.track-steps div.on { color: #2f3d46; font-weight: 700; }
.track-steps div.on::before { border-color: #2ea36b; background: #2ea36b; box-shadow: inset 0 0 0 0.7cqw #fff; }
.advbtn { width: 100%; margin-top: 2.2cqw; padding: 2.2cqw; border-radius: 2.4cqw; color: var(--ink); background: #eef2f4; font-size: 3.2cqw; font-weight: 800; }

.lost { align-self: center; width: 92%; padding: 2.6cqw 3cqw; border-radius: 3cqw; border: 1.5px solid rgba(255, 107, 122, 0.6); background: #fff0f1; color: #b4232f; text-align: center; font-size: 3.3cqw; animation: pop 0.32s ease both; }
.lost b { display: block; font-size: 4cqw; }

.chat-foot { padding: 2cqw 3cqw 4cqw; background: #f0f2f5; }
.phone[data-chan="ig"] .chat-foot { background: #fff; border-top: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 2cqw; margin-bottom: 2cqw; }
.chips:empty { display: none; }
.chips button { padding: 1.8cqw 3.4cqw; border: 1.5px solid var(--accent); border-radius: 99px; font-size: 3.3cqw; font-weight: 800; color: var(--ink); background: #fff; text-align: left; }
.composer { display: flex; align-items: center; gap: 2.4cqw; padding: 1.4cqw 1.6cqw 1.4cqw 3.4cqw; border-radius: 99px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05); }
.c-ico { color: #667781; font-size: 5cqw; }
.composer input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 3.3cqw; color: var(--ink); text-overflow: ellipsis; }
.send { flex: none; width: 9cqw; height: 9cqw; border-radius: 50%; color: #fff; background: var(--wa-dark); font-size: 4cqw; }
.phone[data-chan="ig"] .send { background: #d62976; }
.send:disabled { opacity: 0.4; pointer-events: none; }

/* ---------- dashboard ---------- */
.dash {
  --d-bg: #0a1620;
  --d-card: #0f1e2b;
  --d-line: rgba(184, 222, 234, 0.12);
  position: relative;
  container-type: inline-size;
  width: 100%;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(184, 222, 234, 0.2);
  border-radius: 18px;
  background: var(--d-bg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 80px rgba(82, 232, 255, 0.08);
  font-size: 13px;
}
@media (min-width: 1000px) { .dash { height: 590px; } }

.dash-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--d-line); background: rgba(255, 255, 255, 0.03); }
.tl { display: flex; gap: 6px; }
.tl i { width: 10px; height: 10px; border-radius: 50%; background: #34424d; }
.url { flex: 1; min-width: 0; padding: 4px 12px; border-radius: 99px; background: rgba(255, 255, 255, 0.05); color: var(--dim); font-family: "DM Mono", monospace; font-size: 11px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who { color: var(--muted); font-size: 11.5px; font-weight: 700; white-space: nowrap; }

.dash-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 148px minmax(0, 1fr); }
.dash-nav { display: flex; flex-direction: column; gap: 3px; padding: 12px 10px; border-right: 1px solid var(--d-line); background: rgba(0, 0, 0, 0.18); }
.dash-nav button { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px; color: var(--muted); font-weight: 700; font-size: 12.5px; text-align: left; }
.dash-nav button:hover { background: rgba(255, 255, 255, 0.05); }
.dash-nav button.on { color: var(--text); background: rgba(82, 232, 255, 0.11); box-shadow: inset 2px 0 0 var(--cyan); }
.dash-nav .nb { margin-left: auto; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; text-align: center; }
.dash-nav .ic { width: 16px; text-align: center; }
.nav-brand { display: flex; align-items: center; gap: 8px; padding: 2px 8px 12px; font-weight: 800; letter-spacing: 0.04em; }
.nav-brand img { width: 26px; height: 26px; }

.dash-main { min-width: 0; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.dash-main::-webkit-scrollbar { width: 6px; }
.dash-main::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 9px; }

@container (max-width: 640px) {
  .dash-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .dash-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--d-line); padding: 8px; }
  .dash-nav button { flex: none; padding: 8px 10px; }
  .nav-brand { display: none; }
  .url { display: none; }
}

.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pg-title { font-size: 17px; font-weight: 800; letter-spacing: -0.03em; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); color: var(--muted); font-size: 11px; font-weight: 800; }
.pill.g { color: var(--green); background: rgba(80, 245, 168, 0.1); }
.pill.r { color: var(--red); background: rgba(255, 107, 122, 0.12); }
.pill.a { color: var(--amber); background: rgba(255, 200, 87, 0.12); }
.pill.c { color: var(--cyan); background: rgba(82, 232, 255, 0.1); }

.card { padding: 14px; border: 1px solid var(--d-line); border-radius: 14px; background: var(--d-card); }
.card h4 { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.kpi { padding: 12px; border: 1px solid var(--d-line); border-radius: 13px; background: var(--d-card); }
.kpi small { display: block; color: var(--dim); font-size: 11px; font-weight: 700; }
.kpi b { display: block; margin-top: 2px; font-size: 22px; letter-spacing: -0.04em; }
.kpi.bad b { color: var(--red); }
.kpi.good b { color: var(--green); }
.kpi.flash b { animation: flash 1.2s ease; }
@keyframes flash { 0% { text-shadow: 0 0 0 transparent; } 30% { text-shadow: 0 0 22px var(--green); color: var(--green); } 100% { text-shadow: 0 0 0 transparent; } }

.feed { list-style: none; display: grid; gap: 8px; }
.feed li { display: flex; gap: 9px; align-items: flex-start; color: var(--muted); font-size: 12.5px; }
.feed li i { flex: none; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%; background: var(--cyan); }
.feed li.bad i { background: var(--red); }
.feed li.good i { background: var(--green); }
.feed li time { margin-left: auto; color: var(--dim); font-size: 11px; white-space: nowrap; }
.empty { padding: 26px 16px; border: 1px dashed var(--d-line); border-radius: 14px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

.dbtn { padding: 8px 14px; border-radius: 9px; font-size: 12px; font-weight: 800; color: #031014; background: linear-gradient(105deg, var(--green), var(--cyan)); }
.dbtn.ghost { color: var(--text); background: rgba(255, 255, 255, 0.06); }
.dbtn:disabled { opacity: 0.4; pointer-events: none; animation: none; }

/* connect */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; }
.conn { display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid var(--d-line); border-radius: 14px; background: var(--d-card); transition: border-color 0.3s ease; }
.conn.ok { border-color: rgba(80, 245, 168, 0.4); }
.conn-top { display: flex; align-items: center; gap: 10px; }
.cbadge { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; color: #fff; font-weight: 800; font-size: 13px; }
.conn b { display: block; font-size: 13px; }
.conn small { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.35; }
.conn .tag { margin-left: auto; font-size: 9.5px; font-family: "DM Mono", monospace; color: var(--dim); }
.conn .dbtn { align-self: flex-start; }
.conn .done { color: var(--green); font-weight: 800; font-size: 12px; }
.spin { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 2px solid rgba(3, 16, 20, 0.3); border-top-color: #031014; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.meter { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), var(--cyan)); transition: width 0.5s ease; }

/* inbox */
.inbox { flex: 1; min-height: 0; display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 12px; }
@container (max-width: 640px) { .inbox { grid-template-columns: 1fr; } .convs { display: none; } }
.convs { display: grid; align-content: start; gap: 6px; }
.conv { padding: 10px; border: 1px solid var(--d-line); border-radius: 11px; background: var(--d-card); }
.conv.on { border-color: rgba(82, 232, 255, 0.4); background: rgba(82, 232, 255, 0.07); }
.conv b { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12.5px; }
.conv small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv.dim { opacity: 0.55; }
.thread { min-height: 300px; display: flex; flex-direction: column; border: 1px solid var(--d-line); border-radius: 14px; background: var(--d-card); overflow: hidden; }
.thread-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--d-line); }
.thread-head b { font-size: 13px; }
.thread-body { flex: 1; min-height: 160px; max-height: 340px; overflow-y: auto; display: flex; flex-direction: column; gap: 7px; padding: 12px; }
.thread-body::-webkit-scrollbar { width: 5px; }
.thread-body::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 9px; }
.tb { max-width: 82%; padding: 7px 10px; border-radius: 11px; font-size: 12.3px; line-height: 1.4; white-space: pre-line; }
.tb.c { align-self: flex-start; background: rgba(255, 255, 255, 0.07); border-top-left-radius: 3px; }
.tb.b { align-self: flex-end; background: rgba(82, 232, 255, 0.14); border: 1px solid rgba(82, 232, 255, 0.25); border-top-right-radius: 3px; }
.tb .ai { display: block; margin-bottom: 2px; color: var(--cyan); font-family: "DM Mono", monospace; font-size: 9.5px; letter-spacing: 0.08em; }
.tb.card2 { background: rgba(80, 245, 168, 0.08); border-color: rgba(80, 245, 168, 0.3); }
.tsys { align-self: center; padding: 3px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); color: var(--muted); font-size: 11px; text-align: center; }
.tsys.pay { color: var(--green); background: rgba(80, 245, 168, 0.1); font-weight: 700; }
.tsys.lost { color: var(--red); background: rgba(255, 107, 122, 0.12); font-weight: 800; }
.thread-foot { padding: 9px 12px; border-top: 1px solid var(--d-line); display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 11.5px; }
.thread-foot.bad { color: var(--red); background: rgba(255, 107, 122, 0.07); }
.alertbar { padding: 10px 12px; border: 1px solid rgba(255, 107, 122, 0.4); border-radius: 12px; background: rgba(255, 107, 122, 0.09); color: #ffb3bb; font-size: 12.3px; }
.alertbar b { color: var(--red); }

/* orders */
.tbl { width: 100%; border-collapse: collapse; font-size: 12.3px; }
.tbl th { text-align: left; padding: 8px 10px; color: var(--dim); font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; border-bottom: 1px solid var(--d-line); }
.tbl td { padding: 10px; border-bottom: 1px solid var(--d-line); color: var(--muted); }
.tbl td:first-child, .tbl td.strong { color: var(--text); font-weight: 700; }
.tbl tr.new td { background: rgba(80, 245, 168, 0.07); animation: flash2 1.6s ease; }
@keyframes flash2 { from { background: rgba(80, 245, 168, 0.25); } to { background: rgba(80, 245, 168, 0.07); } }
.scroll-x { overflow-x: auto; }
@container (max-width: 560px) { .tbl .hide-s { display: none; } }

.tl-ship { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 4px; }
.tl-ship div { position: relative; padding-top: 18px; color: var(--dim); font-size: 10.5px; font-weight: 700; text-align: center; line-height: 1.25; }
.tl-ship div::before { content: ""; position: absolute; top: 4px; left: 50%; width: 11px; height: 11px; margin-left: -5.5px; border-radius: 50%; background: #1c2d3a; border: 2px solid #2a3d4b; z-index: 1; }
.tl-ship div::after { content: ""; position: absolute; top: 9px; left: -50%; width: 100%; height: 2px; background: #1c2d3a; }
.tl-ship div:first-child::after { display: none; }
.tl-ship div.on { color: var(--text); }
.tl-ship div.on::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 10px rgba(80, 245, 168, 0.6); }
.tl-ship div.on::after { background: var(--green); }
.ship-meta { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: var(--muted); font-size: 12px; }
.ship-meta code { font-family: "DM Mono", monospace; color: var(--cyan); }

/* payments */
.bank { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--d-line); border-radius: 13px; background: var(--d-card); }
.bank .bi { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: rgba(82, 232, 255, 0.12); font-size: 18px; }
.bank b { font-size: 13px; }
.bank small { display: block; color: var(--muted); font-size: 11.5px; }
.bank .bal { margin-left: auto; text-align: right; }
.bank .bal b { display: block; font-size: 20px; letter-spacing: -0.03em; }
.bank.credited { border-color: rgba(80, 245, 168, 0.55); box-shadow: 0 0 40px rgba(80, 245, 168, 0.15); }
.bank.credited .bal b { color: var(--green); }
.ledger { list-style: none; display: grid; gap: 8px; }
.ledger li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--d-line); color: var(--muted); font-size: 12.3px; }
.ledger li b { color: var(--text); }
.ledger li span.amt { margin-left: auto; font-weight: 800; color: var(--text); }
.ledger li span.amt.in { color: var(--green); }

.dash-toast { position: absolute; z-index: 20; top: 52px; right: 14px; max-width: 78%; padding: 9px 14px; border-radius: 11px; color: #04210f; background: linear-gradient(105deg, var(--green), var(--cyan)); font-size: 12.3px; font-weight: 800; box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4); opacity: 0; transform: translateY(-10px); pointer-events: none; transition: opacity 0.3s ease, transform 0.3s ease; }
.dash-toast.on { opacity: 1; transform: none; }

/* ---------- finale ---------- */
.finale {
  margin-top: 56px; padding: 44px 22px; border: 1px solid rgba(82, 232, 255, 0.17); border-radius: 25px; text-align: center;
  background: radial-gradient(circle at 50% 0%, rgba(82, 232, 255, 0.13), transparent 55%), rgba(255, 255, 255, 0.025);
  opacity: 0.5; transition: opacity 0.5s ease, box-shadow 0.5s ease;
}
.finale.lit { opacity: 1; box-shadow: 0 0 80px rgba(82, 232, 255, 0.14); }
.finale h2 { max-width: 820px; margin: 12px auto 0; font-size: clamp(1.7rem, 5.4vw, 3.1rem); line-height: 1.06; letter-spacing: -0.05em; }
.finale h2 span { color: var(--cyan); }
.finale .lead { max-width: 560px; margin: 16px auto 0; color: var(--muted); font-size: 0.95rem; }
.finale-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 26px; }
.hero-note { margin-top: 14px; color: var(--dim); font-size: 0.8rem; }
.hero-note b { color: var(--green); }

@media (max-width: 560px) {
  .controls .btn { flex: 1 1 calc(50% - 6px); }
  #btn-next { flex-basis: 100%; order: -1; }
  .finale-actions .btn { width: 100%; }
  .tl-ship div { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Make it yours (customise) ---------- */
.custom {
  display: grid; grid-template-columns: 1fr; gap: 10px; align-items: end;
  margin: 26px 0 18px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 16px;
  background: linear-gradient(135deg, rgba(82, 232, 255, 0.06), rgba(80, 245, 168, 0.04));
}
.custom-ttl b { display: block; font-size: 0.95rem; letter-spacing: -0.02em; }
.custom-ttl span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.8rem; }
.custom label { display: grid; gap: 5px; color: var(--dim); font: 500 0.68rem/1 'DM Mono', monospace; text-transform: uppercase; letter-spacing: 0.08em; }
.custom input {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.28); color: var(--text); font: 600 0.92rem 'Manrope', sans-serif;
}
.custom input:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(82, 232, 255, 0.14); }
.custom-act { display: flex; gap: 8px; }
.custom-msg { min-height: 1em; margin: 0; color: var(--green); font-size: 0.8rem; font-weight: 700; }
@media (min-width: 900px) {
  .custom { grid-template-columns: 1.3fr 1fr 110px auto; }
  .custom-ttl { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 12px; }
  .custom-ttl span { margin: 0; }
  .custom-msg { grid-column: 1 / -1; margin-top: -4px; }
}

/* ---------- Extra visuals ---------- */
.spark { display: flex; align-items: flex-end; gap: 8px; height: 92px; }
.spark .sb { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
.spark .sb i { display: block; width: 100%; border-radius: 6px 6px 2px 2px; background: rgba(156, 171, 185, 0.28); transition: height 0.6s cubic-bezier(.2,.8,.2,1); }
.spark .sb.today i { background: linear-gradient(180deg, var(--green), var(--cyan)); box-shadow: 0 0 18px rgba(80, 245, 168, 0.35); }
.spark .sb span { font-size: 10px; color: var(--dim); }
.lossbox { border-color: rgba(255, 107, 122, 0.4); background: rgba(255, 107, 122, 0.07); }
.lossbox b { display: block; font-size: 1.7rem; letter-spacing: -0.04em; color: var(--red); }
.lossbox span { color: var(--muted); font-size: 12px; }
.finale-line { max-width: 640px; margin: 14px auto 0; color: var(--green); font-weight: 800; }
.finale-line:empty { display: none; }
.dash { position: relative; }
.cf {
  position: absolute; z-index: 30; top: 38%; width: 8px; height: 12px; border-radius: 2px; pointer-events: none;
  animation: cf-fall 1.9s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes cf-fall {
  0% { transform: translate(0, 0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--dx), 340px) rotate(var(--rot)); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) { .cf { display: none; } }

/* ---------- Voice narration bar ---------- */
.voice { margin-top: 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255, 255, 255, 0.025); }
.v-main { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.v-title { font-size: 0.86rem; letter-spacing: -0.01em; }
.v-ctl, .v-lang { display: flex; flex-wrap: wrap; gap: 6px; }
.v-lang { margin-left: auto; }
.vbtn { min-height: 36px; padding: 7px 13px; border: 1px solid var(--border); border-radius: 10px; font-size: 0.78rem; font-weight: 800; color: var(--muted); background: rgba(255, 255, 255, 0.03); transition: border-color 0.2s ease, color 0.2s ease; }
.vbtn:hover { border-color: rgba(82, 232, 255, 0.4); color: var(--text); }
.vbtn:disabled { opacity: 0.35; pointer-events: none; }
.v-lang .vbtn.on { color: #031014; border-color: transparent; background: linear-gradient(105deg, var(--green), var(--cyan)); }
.v-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; }
.v-eq i { width: 3px; height: 4px; border-radius: 2px; background: var(--dim); }
.voice.speaking .v-eq i { background: var(--green); animation: eq 0.9s ease-in-out infinite; }
.voice.speaking .v-eq i:nth-child(2) { animation-delay: 0.15s; }
.voice.speaking .v-eq i:nth-child(3) { animation-delay: 0.3s; }
.voice.speaking .v-eq i:nth-child(4) { animation-delay: 0.45s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 16px; } }
.voice.off .v-title { color: var(--dim); }
.v-line { margin-top: 8px; min-height: 1.4em; color: var(--muted); font-size: 0.82rem; line-height: 1.5; }
@media (max-width: 560px) { .v-lang { margin-left: 0; } }
