/* Fonts are served from this origin. Files and licence: app/static/fonts/README.txt */
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 400; font-display: swap; src: url("/ui/fonts/tajawal-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 400; font-display: swap; src: url("/ui/fonts/tajawal-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 500; font-display: swap; src: url("/ui/fonts/tajawal-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 500; font-display: swap; src: url("/ui/fonts/tajawal-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap; src: url("/ui/fonts/tajawal-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 700; font-display: swap; src: url("/ui/fonts/tajawal-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 800; font-display: swap; src: url("/ui/fonts/tajawal-arabic-800-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Tajawal"; font-style: normal; font-weight: 800; font-display: swap; src: url("/ui/fonts/tajawal-latin-800-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 700; font-display: swap; src: url("/ui/fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("/ui/fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("/ui/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Brand tokens. The first eight are the Sondos AI website's own values, name for name
   (--purple, --purple-deep, --coral, --bg, --surface, --line, --muted, --ink).
   Everything else in this file refers to tokens, never to a color directly. */
:root {
  --purple: #672D92;
  --purple-deep: #381850;
  --coral: #E8485A;
  --bg: #F8F8FB;
  --surface: #FFFFFF;
  --line: #E7E7F0;
  --muted: #83839C;
  --ink: #1B1B2E;

  /* derived from the brand colors for interface states */
  --text-muted: #6C6C86;            /* the site's muted, darkened to stay readable at small sizes */
  --purple-soft: #F1EAF6;
  --coral-hover: #D93D50;
  --coral-shadow: 0 8px 20px rgba(232, 72, 90, .24);
  --sunken: #F1F0F6;
  --good: #1F7A4D;
  --good-soft: #E3F2E9;
  --warn: #8F5F0E;
  --warn-soft: #FBEFD5;
  --bad: #C0293B;
  --bad-soft: #FCE6E9;
  --radius: 18px;
  --radius-control: 10px;
  --radius-pill: 100px;
  --shadow: 0 1px 2px rgba(56, 24, 80, .05), 0 10px 28px rgba(56, 24, 80, .07);
  /* the space around a page; the sticky header reaches into it */
  --page-pad-y: 28px;
  --page-pad-x: 36px;
  /* motion: every transition and animation in this file uses these */
  --dur-fast: 120ms;
  --dur: 220ms;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --dur-loop: 1.1s;                  /* one pass of a repeating animation */
  --rise: 6px;                       /* how far things travel when they appear */
  --sans: "Tajawal", -apple-system, "Segoe UI", sans-serif;
  --latin: "Space Grotesk", Inter, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; line-height: 1.3; font-weight: 700; color: var(--purple-deep); }
h1 { font-weight: 800; }
h1 { font-size: 24px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: var(--purple); }
.ltr { direction: ltr; unicode-bidi: isolate; font-family: var(--mono); font-size: 13px; }
.muted { color: var(--text-muted); }
.small { font-size: 13px; }

/* ---------- controls ---------- */
button, input, select, textarea { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  border: 1px solid var(--line); background: var(--surface); color: var(--purple-deep);
  padding: 8px 20px; border-radius: var(--radius-pill); cursor: pointer; font-weight: 600;
  min-height: 40px; white-space: nowrap; text-decoration: none;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.btn:hover { background: var(--sunken); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
.nav-item:focus-visible, .rowlink:focus-visible {
  outline: 2px solid var(--purple); outline-offset: 2px;
}
.btn.primary { background: var(--coral); border-color: var(--coral); color: #fff; font-weight: 700; box-shadow: var(--coral-shadow); }
.btn.primary:hover { background: var(--coral-hover); border-color: var(--coral-hover); transform: translateY(-1px); }
.btn.danger { color: var(--bad); border-color: var(--bad-soft); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--sunken); }
.btn.sm { min-height: 32px; padding: 4px 14px; font-size: 13.5px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 500; margin-bottom: 5px; font-size: 14px; }
label.field > small { display: block; color: var(--text-muted); margin-top: 4px; font-size: 12.5px; }
input[type=text], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; padding: 9px 14px; border: 1px solid var(--line); border-radius: var(--radius-control);
  background: var(--bg); color: var(--ink); min-height: 42px;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.7; }
input.ltr, textarea.ltr { text-align: left; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--purple); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; align-items: end; }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login {
  width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-mark { width: 30px; height: auto; flex: 0 0 auto; }
.brand-name { font-family: var(--latin); font-weight: 700; letter-spacing: .3px; font-size: 1.08rem; color: var(--purple-deep); line-height: 1.2; }
.brand-sub { font-size: 12.5px; color: var(--text-muted); }
.login h1 { margin: 26px 0 6px; font-size: 21px; }
.login .lead { color: var(--text-muted); margin-bottom: 22px; }
.login .btn { width: 100%; }
.error-line { color: var(--bad); font-size: 13.5px; min-height: 22px; margin: 4px 0 10px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 252px 1fr; min-height: 100%; }
.side {
  background: var(--surface); border-inline-end: 1px solid var(--line);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { padding: 0 8px 16px; }
.tenant-box {
  background: var(--sunken); border-radius: var(--radius-control); padding: 10px 12px; margin-bottom: 10px;
}
.tenant-box .name { font-weight: 600; }
.tenant-box .btn { margin-top: 8px; width: 100%; }
.nav-label { font-size: 12px; color: var(--text-muted); padding: 10px 10px 4px; font-weight: 500; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-control);
  color: var(--ink); text-decoration: none; font-weight: 500; cursor: pointer;
  border: 0; background: none; width: 100%; text-align: start;
}
.nav-item:hover { background: var(--sunken); }
.nav-item.active { background: var(--purple-soft); color: var(--purple); }
.nav-item svg { width: 18px; height: 18px; flex: none; }
.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }

.main { padding: var(--page-pad-y) var(--page-pad-x) 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head p { color: var(--text-muted); margin-top: 4px; max-width: 60ch; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumb { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.crumb a { color: var(--text-muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card, .section + .section { margin-top: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.cards > .card { margin-top: 0; }
.timeline.versions li { grid-template-columns: 1fr auto; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.stat .num { font-size: 30px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .cap { color: var(--text-muted); font-size: 13.5px; }

/* ---------- checklist ---------- */
.steps { list-style: none; margin: 0; padding: 0; }
.step { display: flex; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); align-items: center; }
.step:first-child { border-top: 0; padding-top: 0; }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  font-weight: 600; font-size: 14px; background: var(--sunken); color: var(--text-muted);
}
.step.done .step-dot { background: var(--good-soft); color: var(--good); }
.step-body { flex: 1; min-width: 0; }
.step-body .t { font-weight: 600; }
.step-body .d { color: var(--text-muted); font-size: 13.5px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: start; font-weight: 500; color: var(--text-muted); font-size: 13px; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--bg); }
td.num, th.num { text-align: end; font-variant-numeric: tabular-nums; }
.empty { text-align: center; padding: 36px 16px; color: var(--text-muted); }
.empty .t { color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.empty .btn { margin-top: 14px; }

.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px;
  font-size: 12.5px; font-weight: 500; background: var(--sunken); color: var(--text-muted); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.good { background: var(--good-soft); color: var(--good); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.info { background: var(--purple-soft); color: var(--purple); }

.note { border-radius: var(--radius-control); padding: 10px 14px; font-size: 14.5px; background: var(--purple-soft); color: var(--purple-deep); margin-bottom: 14px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note ul { margin: 6px 0 0; padding-inline-start: 20px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; }
.kv dt { color: var(--text-muted); font-size: 13.5px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ---------- provider cards ---------- */
.provider { display: flex; flex-direction: column; gap: 10px; }
.provider .role { font-size: 13px; color: var(--text-muted); }
.provider .pname { font-size: 18px; font-weight: 600; }
.provider .btn { align-self: flex-start; margin-top: 4px; }

/* ---------- transcript and timeline ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; background: var(--sunken); }
.bubble .who { font-size: 12px; color: var(--text-muted); margin-bottom: 2px; }
.bubble.agent { align-self: flex-start; background: var(--purple-soft); }
.bubble.caller { align-self: flex-end; }
.bubble .meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.bubble .meta.slow { color: var(--warn); }
.bubble.action { align-self: center; background: var(--surface); border: 1px dashed var(--line); width: min(100%, 520px); max-width: 100%; }
.action-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bubble.action details.more { margin: 6px 0 0; }
.bubble.action pre { max-height: 180px; overflow: auto; white-space: pre-wrap; }
.check span { display: flex; flex-direction: column; }
.check small { color: var(--text-muted); font-size: 13px; font-weight: 400; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: 14px; }
.timeline li:first-child { border-top: 0; }
.split { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; align-items: start; }

/* ---------- variables editor ---------- */
.var-row { display: grid; grid-template-columns: 1fr 1.4fr auto auto; gap: 10px; align-items: center; margin-bottom: 8px; }
.var-row .check { margin: 0; }
.pair-row { display: grid; grid-template-columns: 1fr 1.6fr auto; gap: 10px; align-items: center; margin-bottom: 8px; }
@media (max-width: 720px) { .pair-row { grid-template-columns: 1fr; } }
.form-part { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 14px; }
.value-list { display: grid; gap: 6px; }
.value-item { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
ul.plain { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; }
.toolbar { margin-bottom: 12px; }
.field[hidden] { display: none; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(56, 24, 80, .45); display: grid; place-items: center; padding: 20px; z-index: 50; }
.modal { background: var(--surface); border-radius: var(--radius); width: min(560px, 100%); max-height: 90vh; overflow-y: auto; box-shadow: var(--shadow); }
.modal-head { padding: 18px 22px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.modal-body { padding: 16px 22px 4px; }
.modal-foot { padding: 14px 22px 20px; display: flex; gap: 8px; justify-content: flex-start; }
.secret-box { background: var(--sunken); border-radius: var(--radius-control); padding: 12px; word-break: break-all; margin: 10px 0; }

#toasts { position: fixed; bottom: 20px; inset-inline-end: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; }
.toast { background: var(--purple-deep); color: #fff; padding: 10px 16px; border-radius: var(--radius-control); box-shadow: var(--shadow); max-width: 380px; font-size: 14px; }
.toast.bad { background: var(--bad); }

.spinner { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--purple); border-radius: 50%; animation: spin .7s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } * { transition: none !important; animation: none !important; } }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 12px; border-inline-end: 0; border-bottom: 1px solid var(--line); }
  .side .brand { padding: 0 4px; flex: 1 1 100%; }
  .nav-label, .side-foot { display: none; }
  .tenant-box { flex: 1 1 100%; margin: 6px 0; }
  .nav-item { width: auto; padding: 7px 10px; }
  :root { --page-pad-y: 20px; --page-pad-x: 16px; }
  .main { padding-bottom: 48px; }
  .grid2, .grid3, .split { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dd { margin-bottom: 10px; }
  .bubble { max-width: 92%; }
  .table-wrap table { min-width: 600px; }
  .table-wrap td { white-space: nowrap; }
}

/* ---------- small utilities used by the script instead of inline styles ---------- */
.bad-text { color: var(--bad); }
.spaced { margin-top: 12px; }
.btn.block { width: 100%; margin-top: 6px; }
textarea.short { min-height: 70px; }
textarea.tall { min-height: 190px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

/* ---------- choices (radio cards) ---------- */
.group-label { font-weight: 500; font-size: 14px; margin: 4px 0 6px; }
.choices { display: grid; gap: 8px; margin-bottom: 14px; }
.choice {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface);
}
.choice:has(input:checked) { border-color: var(--purple); background: var(--purple-soft); }
.choice:has(input:focus-visible) { outline: 2px solid var(--purple); outline-offset: 2px; }
.choice.disabled { opacity: .55; cursor: not-allowed; }
.choice input { margin-top: 5px; accent-color: var(--purple); }
.choice strong { display: block; font-weight: 600; }
.choice small { display: block; color: var(--text-muted); font-size: 12.5px; }

/* ---------- agent test stage ---------- */
.split.test { grid-template-columns: minmax(280px, 380px) 1fr; }
.stage { display: flex; flex-direction: column; min-height: 460px; margin-top: 0; }
.split.test > .card + .card { margin-top: 0; }
.chat-list { display: grid; gap: 6px; max-height: 52vh; overflow-y: auto; }
.chat-item { display: grid; gap: 2px; text-align: start; width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: var(--radius-control); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.chat-item .badge { justify-self: start; }
.chat-item:hover { background: var(--sunken); }
.chat-item.active { border-color: var(--purple); background: var(--purple-soft); }
.chat-item-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.chat-item-text { font-size: 14px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage-idle { margin: auto; text-align: center; max-width: 42ch; padding: 24px 0; }
.stage-idle .t { font-weight: 600; font-size: 17px; margin-bottom: 4px; }
.stage-chat { flex: 1; overflow-y: auto; max-height: 52vh; padding: 4px 2px 12px; }
.stage-controls { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.stage-form { display: flex; gap: 8px; flex: 1; min-width: 220px; }
.stage-form input { flex: 1; }

@media (max-width: 860px) {
  .split.test { grid-template-columns: 1fr; }
  .split.test > .card + .card { margin-top: 18px; }
  .stage { min-height: 380px; }
}

.stage-status { display: flex; }
.kind-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.section + .section { margin-top: 26px; }

.out-row { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.out-row:last-child { border-bottom: 0; }
.out-main { display: grid; grid-template-columns: 1fr 170px auto; gap: 8px; align-items: center; }
@media (max-width: 720px) { .out-main { grid-template-columns: 1fr; } }

.guest { max-width: 1040px; margin: 0 auto; padding: 24px 20px 48px; }
.guest-head { margin-bottom: 20px; }

.share { display: grid; gap: 6px; margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--line); text-align: center; }

.voices { display: grid; gap: 10px; max-height: 52vh; overflow-y: auto; margin-top: 12px; padding-inline-end: 4px; }
.voice { border: 1px solid var(--line); border-radius: var(--radius-control); padding: 12px 14px; display: grid; gap: 8px; }
.voice-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.voice-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.voice-foot audio { height: 34px; max-width: 100%; flex: 1; min-width: 0; }

/* ---------- smoothness ---------- */
html { scroll-behavior: smooth; scroll-padding-top: 120px; }
.nav-item, .choice, .tab, tr.rowlink td, .card, .voice,
input, select, textarea {
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.btn:active { transform: translateY(1px); }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }

@keyframes enter { from { opacity: 0; transform: translateY(var(--rise)); } to { opacity: 1; transform: none; } }
@keyframes leave { to { opacity: 0; transform: translateY(var(--rise)); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.page.enter > * { animation: enter var(--dur) var(--ease) both; }
.tab-panel:not([hidden]) { animation: enter var(--dur) var(--ease) both; }
.overlay { animation: fade var(--dur-fast) var(--ease) both; }
.modal { animation: enter var(--dur) var(--ease) both; }
.toast { animation: enter var(--dur) var(--ease) both; cursor: pointer; }
.toast.leaving { animation: leave var(--dur) var(--ease) both; }
.page { min-height: 40vh; }

/* a thin bar while the server is being asked something */
.activity { position: fixed; top: 0; inset-inline: 0; height: 3px; overflow: hidden; z-index: 70; opacity: 0;
  transition: opacity var(--dur) var(--ease); pointer-events: none; }
.activity.on { opacity: 1; }
.activity::before { content: ""; position: absolute; inset: 0; width: 45%;
  background: linear-gradient(90deg, transparent, var(--coral), transparent); animation: sweep var(--dur-loop) linear infinite; }

/* page title, actions and tabs stay in reach while a long form scrolls */
.sticky-head { position: sticky; top: 0; z-index: 20; background: var(--bg); margin: calc(-1 * var(--page-pad-y)) calc(-1 * var(--page-pad-x)) 18px; padding: calc(var(--page-pad-y) - 6px) var(--page-pad-x) 0;
  border-bottom: 1px solid var(--line); }
.sticky-head .page-head { margin-bottom: 12px; align-items: center; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { border: 0; background: none; font: inherit; font-weight: 500; color: var(--text-muted); cursor: pointer;
  padding: 10px 14px; border-bottom: 2px solid transparent; white-space: nowrap; border-radius: var(--radius-control) var(--radius-control) 0 0; }
.tab:hover { color: var(--ink); background: var(--sunken); }
.tab.active { color: var(--purple); border-bottom-color: var(--purple); font-weight: 700; }
.tab:focus-visible { outline: 2px solid var(--purple); outline-offset: -2px; }
/* cards flow into as many columns as fit, each filling from the top: no gaps under short cards */
.tab-panel { columns: 420px 2; column-gap: 18px; }
.tab-panel[hidden] { display: none; }
.tab-panel > .card { break-inside: avoid; margin: 0 0 18px; }
.dirty { align-self: center; white-space: nowrap; line-height: 1.6; font-size: 13px; color: var(--warn); background: var(--warn-soft); border-radius: var(--radius-pill); padding: 4px 12px; animation: fade var(--dur) var(--ease) both; }
.dirty[hidden] { display: none; }

.slider { display: flex; align-items: center; gap: 12px; }
.slider input[type=range] { flex: 1; accent-color: var(--purple); min-width: 0; }
.slider output { font-size: 13px; color: var(--text-muted); min-width: 108px; text-align: end; }
details.more { margin: -4px 0 14px; }
details.more summary { cursor: pointer; color: var(--purple); font-weight: 500; font-size: 14px; padding: 4px 0; }
details.more[open] summary { margin-bottom: 8px; }

.check small.why { color: var(--warn); }
.check small.why:empty { display: none; }
.check:has(input:disabled) { cursor: default; }
input:disabled { opacity: .55; cursor: not-allowed; }
.note[hidden] { display: none; }
.note .btn { margin-inline-start: 6px; }

.side-foot .who { padding: 0 12px 6px; overflow-wrap: anywhere; }
.login .choices { margin-bottom: 14px; }

.progress progress { width: 100%; height: 10px; accent-color: var(--purple); border-radius: var(--radius-pill); }

/* inside the widget's frame on a tenant's site: one narrow column, nothing but the agent */
.guest.embedded { padding: 14px 14px 20px; }
.guest.embedded .guest-head { margin-bottom: 10px; }
.guest.embedded .page-head p { display: none; }
.guest.embedded .split.test { grid-template-columns: 1fr; }
