/* ZupaBilling: calm, modern payment infrastructure for AI. Dark premium base, lime brand accent, soft status colours. */
:root {
  --bg: #0B0B10; --bg-2: #101017; --card: #15151D; --card-2: #1C1C26; --line: rgba(246,243,234,.08); --line-2: rgba(246,243,234,.14);
  --text: #F6F3EA; --muted: rgba(246,243,234,.62); --faint: rgba(246,243,234,.38);
  --lime: #D7FF3D; --lime-ink: #0B0B10; --lilac: #B8A6FF;
  --green: #34D399; --green-bg: rgba(52,211,153,.10); --green-line: rgba(52,211,153,.28);
  --amber: #FBBF24; --amber-bg: rgba(251,191,36,.10); --amber-line: rgba(251,191,36,.28);
  --coral: #FB7185; --coral-bg: rgba(251,113,133,.10); --coral-line: rgba(251,113,133,.28);
  --r: 20px;
  --display: "Bricolage Grotesque", Inter, system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 70% -10%, rgba(184,166,255,.10), transparent 60%),
              radial-gradient(900px 500px at 10% 110%, rgba(215,255,61,.06), transparent 60%), var(--bg);
  color: var(--text); font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; display: flex; flex-direction: column;
}
button { font: inherit; cursor: pointer; }
::selection { background: var(--lime); color: var(--lime-ink); }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 28px;
  border-bottom: 1px solid var(--line); background: rgba(11,11,16,.7); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 12px; }
.logo { width: 34px; height: 34px; border-radius: 10px; background: var(--lime); color: var(--lime-ink);
  display: grid; place-items: center; font: 800 20px/1 var(--display); transform: rotate(-6deg); }
.brand-name { font: 700 20px/1 var(--display); letter-spacing: -0.02em; }
.brand-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.brand-sub b { color: var(--lilac); font-weight: 600; }
.toggle { display: flex; align-items: center; gap: 4px; background: var(--card); border: 1px solid var(--line);
  border-radius: 999px; padding: 4px; }
.toggle-label { font-size: 13px; color: var(--muted); padding: 0 8px 0 12px; }
.toggle button { border: 0; background: transparent; padding: 7px 18px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; }
.toggle button.active { background: var(--card-2); color: var(--text); }
.toggle button#on.active { background: var(--lime); color: var(--lime-ink); }
.source { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.source::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.source.live::before { background: var(--lime); box-shadow: 0 0 0 4px rgba(215,255,61,.15); }

/* layout */
.stage { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(300px, 32%) 1fr; }
.chat { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: rgba(16,16,23,.6); }
.center { min-height: 0; overflow: auto; padding: 26px 28px 28px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* chat */
.chat-head { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.agent-avatar { width: 38px; height: 38px; border-radius: 12px; background: rgba(184,166,255,.16); color: var(--lilac);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.agent-name { font-weight: 600; }
.agent-sub { font-size: 13px; color: var(--muted); }
.messages { flex: 1; min-height: 0; overflow: auto; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 15px; animation: rise .2s ease-out; }
.bubble.user { align-self: flex-end; background: var(--lime); color: var(--lime-ink); border-bottom-right-radius: 6px; font-weight: 500; }
.bubble.agent { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 6px; }
.bubble .model { display: block; margin-top: 4px; font-size: 12px; color: var(--lilac); }
.composer { display: flex; gap: 8px; padding: 14px 16px; border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; border: 1px solid var(--line-2); border-radius: 999px; padding: 11px 16px; font: inherit;
  font-size: 15px; background: var(--card); color: var(--text); outline: none; }
.composer input:focus { border-color: var(--lime); }
.composer button, .btn { border: 0; border-radius: 999px; padding: 11px 22px; background: var(--lime); color: var(--lime-ink); font-weight: 700; }
.composer button:hover, .btn:hover { filter: brightness(1.05); }

/* chips */
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; min-height: 34px; }
.chip { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); background: var(--card);
  border-radius: 999px; padding: 6px 14px; font-size: 14px; color: var(--muted); }
.chip.active { border-color: var(--lime); color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.dot.countersigned { background: var(--green); } .dot.warn { background: var(--amber); } .dot.blocked { background: var(--coral); }
.dot.checking { background: var(--lime); animation: breathe 1.2s ease-in-out infinite; }

/* card */
.card { width: 100%; max-width: 580px; background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line-2);
  border-radius: var(--r); box-shadow: 0 30px 80px rgba(0,0,0,.45); padding: 26px 28px; }
.card.empty { text-align: center; color: var(--muted); padding: 64px 28px; }
.empty-title { font: 700 24px/1.2 var(--display); color: var(--text); margin-bottom: 8px; letter-spacing: -0.02em; }
.eyebrow { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.amount { font: 700 52px/1.1 var(--display); letter-spacing: -0.03em; margin: 4px 0 2px; }
.to { font-size: 16px; color: var(--muted); }
.to b { color: var(--text); font-weight: 600; }
.product { display: flex; gap: 12px; align-items: center; margin: 16px 0 4px; padding: 10px 12px; background: rgba(246,243,234,.04);
  border: 1px solid var(--line); border-radius: 14px; }
.product img { width: 44px; height: 44px; object-fit: contain; border-radius: 10px; background: #fff; }
.product div { font-size: 14px; }
.product small { display: block; color: var(--muted); }

.checking { margin-top: 18px; animation: rise .2s ease-out; }
.checking-line { font-size: 15px; display: flex; justify-content: space-between; }
.checking-line span { color: var(--muted); font-size: 14px; }
.bar { height: 6px; background: rgba(215,255,61,.12); border-radius: 999px; margin-top: 10px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--lime); border-radius: 999px; transition: width .3s ease; }

.status { margin-top: 18px; border-radius: 14px; padding: 14px 16px; border: 1px solid; animation: rise .25s ease-out; }
.status h3 { margin: 0; font: 700 18px/1.3 var(--display); letter-spacing: -0.01em; }
.status p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.status.good { background: var(--green-bg); border-color: var(--green-line); } .status.good h3 { color: var(--green); }
.status.warn { background: var(--amber-bg); border-color: var(--amber-line); } .status.warn h3 { color: var(--amber); }
.status.bad  { background: var(--coral-bg); border-color: var(--coral-line); } .status.bad h3 { color: var(--coral); }
.status.neutral { background: rgba(246,243,234,.04); border-color: var(--line-2); }
.paid { margin-top: 12px; font-weight: 600; font-size: 15px; color: var(--green); }
.note { margin-top: 10px; font-size: 14px; color: var(--muted); }
.note b { color: var(--text); }
.quote { margin-top: 10px; font-size: 14px; color: var(--muted); font-style: italic; border-left: 3px solid var(--lilac); padding-left: 10px; }
.actions { display: flex; gap: 8px; margin-top: 12px; }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--line-2); }

.reasons { list-style: none; padding: 0; margin: 16px 0 0; display: flex; flex-direction: column; gap: 10px; }
.reasons li { display: flex; gap: 10px; font-size: 15px; animation: rise .2s ease-out; }
.reasons .ic { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; margin-top: 1px; }
.ic.good { background: var(--green-bg); color: var(--green); }
.ic.bad { background: var(--coral-bg); color: var(--coral); }
.ic.info { background: rgba(246,243,234,.06); color: var(--muted); }
.card-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.link { background: none; border: 0; color: var(--lime); font-weight: 600; font-size: 14px; padding: 0; }
.small { font-size: 12px; color: var(--faint); }

.after { width: 100%; max-width: 580px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.try { border: 1px solid var(--line-2); color: var(--muted); border-radius: 999px; padding: 8px 18px; font-size: 14px; background: transparent; }
.try:hover { color: var(--text); border-color: var(--faint); }
.stat { font-size: 14px; color: var(--muted); text-align: center; max-width: 520px; }
.stat b { color: var(--lime); }

/* side sheet */
.sheet { position: fixed; top: 0; right: 0; bottom: 0; width: min(580px, 100vw); background: var(--bg-2);
  border-left: 1px solid var(--line-2); box-shadow: -20px 0 60px rgba(0,0,0,.5); transform: translateX(100%);
  transition: transform .22s ease; display: flex; flex-direction: column; z-index: 20; }
.sheet.open { transform: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 10; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.sheet-title { font: 700 20px/1.2 var(--display); }
.sheet-sub { font-size: 13px; color: var(--muted); }
.icon-btn { border: 1px solid var(--line-2); background: var(--card); width: 32px; height: 32px; border-radius: 50%; color: var(--muted); }
.sheet-body { overflow: auto; padding: 8px 22px 24px; }
.sheet h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--lilac); margin: 22px 0 8px; }
.ev { padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.ev-top { display: flex; justify-content: space-between; gap: 10px; }
.ev-name { font-weight: 600; }
.ev-meta { font-size: 12px; color: var(--faint); white-space: nowrap; font-family: ui-monospace, "SF Mono", Consolas, monospace; }
.ev-meta.live { color: var(--lime); }
.ev-sum { color: var(--muted); margin-top: 2px; }
.ev a { color: var(--lime); font-size: 13px; text-decoration: none; }
.ev.hl { background: rgba(215,255,61,.07); margin: 0 -10px; padding: 10px; border-radius: 10px; }
.ev.pending .ev-sum { color: var(--faint); }
.rule { display: flex; gap: 10px; padding: 8px 0; font-size: 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.rule .w { font-family: ui-monospace, Consolas, monospace; width: 42px; flex: none; font-weight: 700; }
.rule .w.neg { color: var(--coral); } .rule .w.pos { color: var(--green); } .rule .w.zero { color: var(--faint); }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); word-break: break-all; }

@keyframes rise { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; }
  .chat { max-height: 42vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .top { padding: 12px 16px; flex-wrap: wrap; } .center { padding: 16px; }
}

/* ---- personality layer: grain, moving glow, ticker, stickers, hero ---- */
body::before { content: ""; position: fixed; inset: -50%; z-index: -1; pointer-events: none;
  background: conic-gradient(from 0deg at 50% 50%, rgba(215,255,61,.06), rgba(184,166,255,.10), rgba(215,255,61,.04), rgba(184,166,255,.08), rgba(215,255,61,.06));
  filter: blur(80px); animation: spin 40s linear infinite; }
body::after { content: ""; position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@keyframes spin { to { transform: rotate(360deg); } }

.ticker { overflow: hidden; border-bottom: 1px solid var(--line); background: var(--lime); color: var(--lime-ink); }
.ticker-track { display: flex; gap: 40px; width: max-content; padding: 6px 0; font: 700 12px/1 var(--display);
  text-transform: uppercase; letter-spacing: .12em; animation: marquee 38s linear infinite; }
.ticker-track span::before { content: "✦"; margin-right: 40px; }
@keyframes marquee { to { transform: translateX(-50%); } }

.card { position: relative; overflow: visible; }
.sticker { position: absolute; top: -16px; right: -14px; padding: 10px 16px; border-radius: 14px; transform: rotate(8deg);
  font: 800 14px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 10px 30px rgba(0,0,0,.4);
  animation: pop .45s cubic-bezier(.2,1.6,.4,1) both; border: 2px solid rgba(11,11,16,.9); }
.sticker.countersigned { background: var(--lime); color: var(--lime-ink); }
.sticker.blocked { background: var(--coral); color: #1a0b0f; transform: rotate(-7deg); }
.sticker.warn { background: var(--amber); color: #1a1205; }
.sticker small { display: block; font: 600 10px/1.2 Inter, sans-serif; letter-spacing: .02em; text-transform: none; opacity: .75; margin-top: 3px; }
@keyframes pop { from { opacity: 0; transform: scale(1.8) rotate(-20deg); } to { opacity: 1; } }

.hero { text-align: left; padding: 40px 34px; }
.hero h1 { font: 800 44px/1.02 var(--display); letter-spacing: -0.035em; margin: 0 0 14px; color: var(--text); }
.hero h1 em { font-style: normal; background: var(--lime); color: var(--lime-ink); padding: 0 .18em; border-radius: 10px; display: inline-block; transform: rotate(-2deg); }
.hero p { margin: 0 0 18px; color: var(--muted); font-size: 16px; max-width: 440px; }
.engines { display: flex; flex-wrap: wrap; gap: 6px; }
.engines span { font-size: 12px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.engines span.k { border-color: rgba(184,166,255,.4); color: var(--lilac); }
