/* SuperBusy demo kit: shared look for every live demo.
   Rules: no uppercase transforms, no letter-spacing, sentence case, British English. */
@font-face { font-family: "Geist"; src: url("fonts/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/GeistMono-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  --navy: #111111;
  --navy-2: #262626;
  --navy-3: #383838;
  --blue: #d4420b;
  --blue-2: #b63809;
  --blue-soft: #f7ebe5;
  --blue-line: #e8c8bc;
  --ink: #222222;
  --muted: #666666;
  --faint: #858585;
  --paper: #f5f5f4;
  --mist: #eeedeb;
  --border: #dedfdf;
  --white: #ffffff;
  --green: #12a150;
  --green-soft: #e3f6ec;
  --amber: #c27c00;
  --amber-soft: #fff3db;
  --red: #d64545;
  --red-soft: #fde8e8;
  --wa: #25d366;
  --wa-bubble: #dcf8c6;
  --wa-bg: #efeae2;
  --radius: 6px;
  --radius-sm: 4px;
  --shadow: 0 1px 2px rgba(17, 17, 17, .06);
  --shadow-lg: 0 3px 14px rgba(17, 17, 17, .14);
  --font: "Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 14px/1.5 var(--font);
  color: var(--ink);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Stage: the area a demo lives in */
.stage {
  position: relative;
  padding: 20px;
  min-height: 420px;
  background: #f5f5f4;
  border-radius: 6px;
  overflow: hidden;
}
.stage.dark {
  background: #111111;
  color: #f5f5f4;
}
@media (max-width: 560px) { .stage { padding: 12px; } }

/* App window */
.app {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.app-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  min-height: 46px;
}
.app-bar .dots { display: flex; gap: 6px; }
.app-bar .dots i { width: 10px; height: 10px; border-radius: 50%; background: #dedfdf; display: block; }
.app-title { font-weight: 600; font-size: 13.5px; }
.app-sub { color: var(--muted); font-size: 12.5px; }
.app-bar .spacer, .spacer { flex: 1; }
.app-body { padding: 14px; }

/* Panels and layout */
.panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.panel-pad { padding: 12px 14px; }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.wrap { flex-wrap: wrap; }
@media (max-width: 640px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* Text */
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.strong { font-weight: 600; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.num { font-variant-numeric: tabular-nums; }
.h { font-weight: 600; font-size: 15px; margin: 0; }
.label { font-weight: 600; font-size: 12px; color: var(--muted); }

/* Chips and status */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px; border-radius: 99px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
  background: var(--mist); color: var(--ink); border: 1px solid transparent;
}
.chip i.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip.blue { background: var(--blue-soft); color: #a82f06; }
.chip.green { background: var(--green-soft); color: #0b7a3c; }
.chip.amber { background: var(--amber-soft); color: #8a5800; }
.chip.red { background: var(--red-soft); color: #a92f2f; }
.chip.navy { background: var(--navy); color: #fff; }
.chip.outline { background: transparent; border-color: var(--border); color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: 4px;
  border: 1px solid var(--border); background: var(--white);
  font-weight: 600; font-size: 13px; color: var(--ink);
  transition: background .15s, border-color .15s, transform .15s var(--ease), box-shadow .15s;
}
.btn:hover { border-color: #bfbfbf; background: #f5f5f4; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: none; }
.btn.primary:hover { background: #ae3508; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--blue); }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* Inputs */
.input {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--white); outline: none;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(212, 66, 11, .14); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--border); background: #f5f5f4; }
.table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .r { text-align: right; }
.table tr.hl td { background: var(--blue-soft); }

/* KPI tiles */
.kpi { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); }
.kpi .k-label { font-size: 12px; color: var(--muted); }
.kpi .k-value { font-size: 22px; font-weight: 600; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .k-note { font-size: 12px; margin-top: 2px; }

/* Avatars */
.avatar { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: #fff; background: var(--navy-2); flex: none; }
.avatar.blue { background: var(--blue); }

/* Chat bubbles (generic and WhatsApp style) */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
.bubble { max-width: 82%; padding: 8px 11px; border-radius: 12px; font-size: 13.5px; line-height: 1.45; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); position: relative; animation: pop .35s var(--ease) both; }
.bubble.in { align-self: flex-start; background: #fff; border-top-left-radius: 4px; }
.bubble.out { align-self: flex-end; background: var(--wa-bubble); border-top-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: var(--blue-soft); border-top-left-radius: 4px; }
.bubble .meta { display: block; text-align: right; font-size: 10.5px; color: var(--faint); margin-top: 2px; }
.bubble[dir="rtl"] { text-align: right; }
.typing { display: inline-flex; gap: 4px; padding: 10px 12px; background: #fff; border-radius: 12px; align-self: flex-start; box-shadow: 0 1px 1px rgba(0, 0, 0, .06); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: #a6b0c0; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
.system-note { align-self: center; font-size: 11.5px; color: var(--muted); background: rgba(255, 255, 255, .8); padding: 3px 10px; border-radius: 99px; }

/* Phone frame: iPhone 17 (402 × 874 pt screen, Dynamic Island, iOS status bar, home indicator).
   Size it with --pw, the screen width in px as a plain number (default 300); the height follows
   the real iPhone proportions. Inside .screen, keep content clear of the status bar with
   padding-top: var(--sb) and of the home indicator with padding-bottom: var(--hb).
   demo-kit.js adds the status bar and home indicator to every .phone .screen automatically.
   Add class "status-light" to .phone for white status bar text on a dark top area. */
.phone {
  --pw: 300; --bz: 10px;
  width: calc(var(--pw) * 1px + 2 * var(--bz)); max-width: 100%;
  border-radius: calc(var(--pw) * 55px / 402 + var(--bz)); background: #0b0f19; padding: var(--bz);
  box-shadow: var(--shadow-lg), inset 0 0 0 1.5px #2a3040; position: relative; flex: none;
}
.phone .screen {
  --sb: calc(var(--pw) * 54px / 402); --hb: calc(var(--pw) * 26px / 402);
  width: 100%; aspect-ratio: 402 / 874; height: auto;
  border-radius: calc(var(--pw) * 55px / 402); overflow: hidden; background: #fff;
  display: flex; flex-direction: column; position: relative;
}
.phone .notch, .phone .island {
  position: absolute; z-index: 30; pointer-events: none;
  top: calc(var(--bz) + var(--pw) * 11px / 402); left: 50%; transform: translateX(-50%);
  width: calc(var(--pw) * 126px / 402); height: calc(var(--pw) * 37px / 402);
  background: #000; border-radius: 99px;
}
.sb-status {
  position: absolute; top: 0; left: 0; right: 0; height: var(--sb); z-index: 25; pointer-events: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 calc(var(--pw) * 30px / 402) 0 calc(var(--pw) * 38px / 402);
  font: 600 calc(var(--pw) * 16px / 402)/1 var(--font); color: #000;
}
.sb-status .sb-icons { display: flex; align-items: center; gap: calc(var(--pw) * 6px / 402); }
.sb-status svg { display: block; height: calc(var(--pw) * 12px / 402); width: auto; }
.phone.status-light .sb-status, .phone .screen:has(> .wa-head) .sb-status { color: #fff; }
.sb-home {
  position: absolute; left: 50%; transform: translateX(-50%); z-index: 25; pointer-events: none;
  bottom: calc(var(--pw) * 8px / 402); width: calc(var(--pw) * 134px / 402); height: calc(var(--pw) * 5px / 402);
  border-radius: 99px; background: #000; opacity: .85;
}
.phone.home-light .sb-home { background: #fff; }
.wa-head { background: #075e54; color: #fff; padding: calc(var(--sb, 30px) + 2px) 12px 10px; display: flex; align-items: center; gap: 10px; }
.wa-head .avatar { background: #fff; color: var(--navy); }
.wa-body { flex: 1; background: var(--wa-bg); overflow-y: auto; }
.wa-input { display: flex; gap: 6px; padding: 8px 8px calc(8px + var(--hb, 0px)); background: #f0f0f0; }
.wa-input .input { border-radius: 99px; }
.wa-send { width: 38px; height: 38px; border-radius: 50%; border: 0; background: #00a884; color: #fff; display: grid; place-items: center; flex: none; }

/* Notifications / toasts */
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 12px; border-radius: 6px;
  background: var(--white); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-size: 13px; animation: slideIn .45s var(--ease) both;
}
.toast .t-icon { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }

/* Progress */
.progress { height: 6px; border-radius: 99px; background: var(--mist); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: inherit; transition: width .6s var(--ease); }

/* Steps rail used by self-running demos */
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 500; color: var(--muted); background: rgba(255, 255, 255, .7); border: 1px solid var(--border); transition: all .3s var(--ease); }
.step-pill .n { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; background: var(--mist); color: var(--muted); }
.step-pill.on { color: var(--ink); border-color: var(--blue-line); background: #fff; box-shadow: none; }
.step-pill.on .n { background: var(--blue); color: #fff; }
.step-pill.done .n { background: var(--green); color: #fff; }

/* Demo controls (replay / pause), pinned bottom right of the stage */
.demo-controls { position: absolute; right: 14px; bottom: 12px; display: flex; gap: 6px; z-index: 20; }
.demo-controls .btn { background: rgba(255, 255, 255, .92); backdrop-filter: blur(4px); }
.stage.dark .demo-controls .btn { background: rgba(38, 38, 38, .95); color: #f5f5f4; border-color: rgba(255, 255, 255, .24); }
.hint { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.hint b { color: var(--blue); font-weight: 600; }

/* Highlight that a value was filled by the system */
.filled { animation: filled 1.2s var(--ease) both; border-radius: 6px; }

/* Animations */
.fade-in { animation: fadeIn .45s var(--ease) both; }
.rise { animation: rise .5s var(--ease) both; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
@keyframes filled { 0% { background: rgba(212, 66, 11, .18); } 100% { background: transparent; } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(212, 66, 11, .3); } 100% { box-shadow: 0 0 0 10px rgba(212, 66, 11, 0); } }
.pulse { animation: pulse 1.4s infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
