:root {
  color-scheme: light;
  --bg: #f1f7fb;
  --bg-alt: #eaf3fa;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-subtle: #f5f9fd;
  --surface-muted: #edf4fa;
  --border: rgba(108, 141, 170, 0.2);
  --text: #0f1d2b;
  --text-soft: #42586b;
  --text-muted: #688199;
  --accent: #31bbd9;
  --accent-strong: #179dbc;
  --accent-soft: rgba(49, 187, 217, 0.14);
  --success: #22b693;
  --warning: #de9d32;
  --danger: #d95a5a;
  --shadow: 0 18px 44px rgba(17, 34, 53, 0.12);
  --shadow-soft: 0 10px 28px rgba(17, 34, 53, 0.08);
  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1320px;
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #070d14;
  --bg-alt: #0d1825;
  --surface: rgba(13, 24, 37, 0.82);
  --surface-strong: #132335;
  --surface-subtle: #102030;
  --surface-muted: #132739;
  --border: rgba(95, 125, 152, 0.28);
  --text: #e6f2ff;
  --text-soft: #afc4d8;
  --text-muted: #86a1bb;
  --accent: #31bbd9;
  --accent-strong: #57d4ef;
  --accent-soft: rgba(49, 187, 217, 0.2);
  --success: #4cc9aa;
  --warning: #e4b45f;
  --danger: #f08282;
  --shadow: 0 20px 50px rgba(1, 5, 12, 0.56);
  --shadow-soft: 0 12px 32px rgba(1, 5, 12, 0.4);
}

* { box-sizing: border-box; }

/*
 * An element marked hidden is hidden, whatever a component rule says.
 *
 * The UA stylesheet's [hidden] { display: none } loses to ANY author rule that
 * sets display, regardless of specificity -- and rules in this file do exactly
 * that: .voice-clone-card is display:grid and .trial-settings-save-state is
 * display:inline-flex, while both elements carry the hidden attribute in the
 * markup. So #voiceCloneCard is on screen although its own markup says
 * otherwise, and empty save-state chips still occupy a slot.
 *
 * That is also why the spacing fix below could not simply add a gap: a gap
 * reserves space for every child, including the ones nobody can see. Three
 * one-off [hidden] rules had already been added elsewhere in this file for the
 * same reason; this makes a fourth unnecessary.
 */
[hidden] { display: none !important; }

html,
body { min-height: 100%; }

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 520px at 12% -8%, rgba(49, 187, 217, 0.2), transparent 62%),
    radial-gradient(880px 420px at 110% 20%, rgba(49, 187, 217, 0.12), transparent 62%),
    linear-gradient(160deg, var(--bg) 0%, var(--bg-alt) 100%);
  transition: background 220ms ease, color 220ms ease;
}

img { display: block; max-width: 100%; }
button, input { font: inherit; }
button { border: 0; cursor: pointer; background: transparent; }

.container { width: min(calc(100% - 48px), var(--container)); margin: 0 auto; }
.page-shell { min-height: 100vh; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  min-height: 84px;
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-strong));
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--border));
}
.brand-mark img { width: 20px; height: 20px; }
.brand-text { display: grid; gap: 0; line-height: 1.15; }
.brand-name { font-size: 1.55rem; letter-spacing: -0.01em; }
.brand-subtitle { font-size: 0.84rem; color: var(--text-soft); font-weight: 600; }

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.brand-mark,
.auth-brand-mark {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background:
    linear-gradient(155deg, color-mix(in srgb, var(--accent) 14%, var(--surface-strong)), color-mix(in srgb, var(--surface-strong) 97%, white)),
    var(--surface-strong);
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
  box-shadow:
    0 10px 24px color-mix(in srgb, var(--accent) 12%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 40%, transparent);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 260ms ease, border-color 220ms ease;
}

.brand-mark::after,
.auth-brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.22), transparent 52%);
  pointer-events: none;
}

.brand:hover .brand-mark,
.brand:focus-visible .brand-mark {
  transform: translateY(-1px);
  box-shadow:
    0 14px 28px color-mix(in srgb, var(--accent) 14%, transparent),
    inset 0 1px 0 color-mix(in srgb, white 44%, transparent);
}

.brand-mark .brand-logo--nav { width: 24px; height: 24px; filter: drop-shadow(0 5px 12px color-mix(in srgb, var(--accent) 18%, transparent)); }
.auth-brand-mark .brand-logo--auth { width: 28px; height: 28px; filter: drop-shadow(0 6px 14px color-mix(in srgb, var(--accent) 18%, transparent)); }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}


.main-nav {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
}

.nav-link {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  color: var(--text-soft);
  font-weight: 600;
  transition: 160ms ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-strong));
}

.header-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: nowrap; justify-content: flex-end; }

.status-badge,
.tiny-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
}

.status-ready,
.status-active {
  background: color-mix(in srgb, var(--success) 13%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--success) 30%, var(--border));
  color: color-mix(in srgb, var(--success) 80%, var(--text));
}
.status-idle { background: var(--surface); }
.status-error {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--danger) 30%, var(--border));
  color: color-mix(in srgb, var(--danger) 78%, var(--text));
}

.dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.dot-green { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 20%, transparent); }
.dot-amber { background: var(--warning); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 20%, transparent); }
.dot-red { background: var(--danger); box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 20%, transparent); }

.btn {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  font-weight: 600;
  transition: 160ms ease;
}
.btn:hover,
.link-btn:hover,
.nav-link:hover { transform: translateY(-1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  background: linear-gradient(120deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 26%, transparent);
}
.btn-primary:hover { filter: brightness(1.04); }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-tertiary {
  background: var(--surface-subtle);
  color: var(--text-soft);
  border: 1px solid var(--border);
}

.btn-danger {
  background: color-mix(in srgb, var(--danger) 14%, var(--surface-strong));
  color: color-mix(in srgb, var(--danger) 90%, var(--text));
  border: 1px solid color-mix(in srgb, var(--danger) 38%, var(--border));
}

.btn-compact { min-height: 38px; padding: 0 14px; }

.theme-toggle {
  gap: 8px;
  display: inline-flex;
  align-items: center;
}

#currentUserBadge {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-btn { color: var(--accent); font-weight: 700; padding: 8px 0; }
.ui-premium-hover,
:where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background-color 220ms ease,
    border-color 220ms ease,
    color 220ms ease,
    box-shadow 260ms ease,
    filter 220ms ease;
}

.ui-premium-hover::before,
:where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn)::before {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(
    110deg,
    transparent 18%,
    color-mix(in srgb, var(--accent) 15%, rgba(255, 255, 255, 0.26)) 44%,
    transparent 72%
  );
  opacity: 0;
  transform: translate3d(-34%, 0, 0);
  transition: opacity 180ms ease-out, transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.ui-premium-hover::after,
:where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn)::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 14%;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 22%, rgba(255, 255, 255, 0.34)) 0%, transparent 74%);
  opacity: 0;
  transform: translate3d(-14px, -50%, 0) scale(0.82);
  transition: opacity 180ms ease-out, transform 280ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.ui-premium-hover:is(:hover, :focus-visible):not(:disabled),
:where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn):is(:hover, :focus-visible):not(:disabled) {
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 10%, transparent);
}

.ui-premium-hover:is(:hover, :focus-visible):not(:disabled)::before,
:where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn):is(:hover, :focus-visible):not(:disabled)::before {
  opacity: 0.72;
  transform: translate3d(24%, 0, 0);
}

.ui-premium-hover:is(:hover, :focus-visible):not(:disabled)::after,
:where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn):is(:hover, :focus-visible):not(:disabled)::after {
  opacity: 0.5;
  transform: translate3d(52px, -50%, 0) scale(1);
}

.nav-link.active,
.admin-tab-btn.active,
.workspace-mode-btn.active {
  box-shadow:
    var(--shadow-soft),
    0 0 0 1px color-mix(in srgb, var(--accent) 10%, transparent) inset;
}

.nav-link:focus-visible,
.admin-tab-btn:focus-visible,
.workspace-mode-btn:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent),
    0 12px 28px color-mix(in srgb, var(--accent) 12%, transparent);
}

.main-content { padding: 48px 0 80px; }
.view { display: none; }
.view.active { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  /*
   * A card is a surface with a border, so content flush against that border is
   * never what anybody meant -- but .card carried no padding at all. Every card
   * got it from a companion class instead (.transcript-card, .session-card,
   * .admin-shell, .hero-section, .auth-card, .scorecard-card, .offer-admin-card,
   * .trial-settings-card), and the two places that use a bare class="card" got
   * nothing: the per-type rows in "Agenten je Nutzertyp" and
   * #agentCatalogRemovalConfirm. "Nutzertyp / Operator" sat on the border.
   *
   * This is a BASE value, not a change to the others: every rule listed above
   * appears later in this file and therefore still wins.
   */
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.hero-section { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 0.85fr); gap: 48px; padding: 56px; }
.hero-copy h1,
.hero-panel h2,
.section-heading h2,
.section-heading h3,
.selected-agent-copy h3,
.composer-head h4 { margin: 0; }

.hero-copy h1 {
  margin-top: 16px;
  max-width: 12ch;
  font-size: clamp(2.4rem, 4.8vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-copy p,
.hero-panel p,
.selected-agent-copy p,
.composer-head p,
.agent-card p,
.drawer-item p,
.scenario-card p,
.quiet-note,
.feature-list li,
.transcript-item p,
.event-item p { color: var(--text-soft); line-height: 1.7; }

.hero-copy p { max-width: 60ch; margin: 24px 0 0; font-size: 1.05rem; }
.hero-actions,
.control-row,
.composer-row { display: flex; flex-wrap: wrap; gap: 16px; }
.hero-actions { margin-top: 32px; }

.hero-aside { display: flex; align-items: stretch; }
.hero-panel {
  width: 100%;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}
.hero-panel h2 { margin-top: 12px; font-size: 1.75rem; }
.hero-panel p { margin: 16px 0 0; }

.feature-list { margin: 24px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.feature-list li { position: relative; padding-left: 24px; }
.feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.section-block { margin-top: 48px; }
.public-legal-links {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.public-legal-links a {
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
  transition: color 180ms ease;
}

.public-legal-links a:hover,
.public-legal-links a:focus-visible {
  color: var(--accent);
}

.public-legal-links-auth {
  margin-top: 18px;
  justify-content: center;
}

/*
 * The public trial page has its own palette rather than the app's tokens, which
 * is deliberate -- it is a marketing surface with hand-picked brand colours. But
 * "its own palette" had come to mean "light, and no way to be anything else":
 * four values were hardcoded, so a visitor on a dark system got a white page
 * while the console next door was dark.
 *
 * So the four become trial-specific tokens, defaulting to exactly today's
 * values. The light page is byte-for-byte what it was; the dark block further
 * down redefines only these.
 */
.trial-public-page {
  --trial-glow-over: white;
  --trial-ground-top: #f8fbfd;
  --trial-ground-bottom: #f2f7fa;
  --trial-panel-top: rgba(255, 255, 255, 0.94);
  --trial-panel-bottom: rgba(247, 251, 253, 0.98);
  --trial-card-bg: rgba(255, 255, 255, 0.95);
  --trial-input-bg: #fbfdff;
  --trial-input-border: rgba(0, 88, 129, 0.12);

  min-height: 100vh;
  background:
    radial-gradient(720px 360px at 12% 12%, color-mix(in srgb, #31bbd9 12%, var(--trial-glow-over)), transparent 74%),
    linear-gradient(180deg, var(--trial-ground-top) 0%, var(--trial-ground-bottom) 100%);
}

/*
 * Dark, in both of the ways a viewer can ask for it.
 *
 * The media query carries the common case and needs no JavaScript, which is what
 * makes it flash-free: the page is never painted light first. It is guarded
 * against an explicit light choice, so somebody who picked light in the console
 * keeps light here.
 *
 * The attribute selector covers the other case -- an explicit dark choice stored
 * from the console. public/trial.js applies it after parse, so that one can
 * flicker briefly; the OS case, which is the one a stranger arrives with, does
 * not.
 *
 * The accent gradient on the submit button is deliberately NOT overridden:
 * #31bbd9 -> #1aa6ce with white text is the same accent the dark app palette
 * uses, and it reads on both grounds.
 */
:root[data-theme='dark'] .trial-public-page,
:root[data-theme='dark'] .trial-public-page .trial-marketing-panel {
  color-scheme: dark;
}

:root[data-theme='dark'] .trial-public-page {
  --trial-glow-over: #070d14;
  --trial-ground-top: #0b1622;
  --trial-ground-bottom: #070d14;
  --trial-panel-top: rgba(19, 35, 53, 0.94);
  --trial-panel-bottom: rgba(13, 24, 37, 0.98);
  --trial-card-bg: rgba(19, 35, 53, 0.95);
  --trial-input-bg: #102030;
  --trial-input-border: rgba(95, 125, 152, 0.34);
  --trial-pill-bg: rgba(19, 35, 53, 0.88);
  --trial-pill-text: #e6f2ff;
  --trial-pill-border: rgba(49, 187, 217, 0.34);
  --trial-feature-bg: rgba(16, 32, 48, 0.72);
  --trial-feature-border: rgba(95, 125, 152, 0.24);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .trial-public-page {
    color-scheme: dark;
    --trial-glow-over: #070d14;
    --trial-ground-top: #0b1622;
    --trial-ground-bottom: #070d14;
    --trial-panel-top: rgba(19, 35, 53, 0.94);
    --trial-panel-bottom: rgba(13, 24, 37, 0.98);
    --trial-card-bg: rgba(19, 35, 53, 0.95);
    --trial-input-bg: #102030;
    --trial-input-border: rgba(95, 125, 152, 0.34);
    --trial-pill-bg: rgba(19, 35, 53, 0.88);
    --trial-pill-text: #e6f2ff;
    --trial-pill-border: rgba(49, 187, 217, 0.34);
    --trial-feature-bg: rgba(16, 32, 48, 0.72);
    --trial-feature-border: rgba(95, 125, 152, 0.24);
  }
}

.trial-public-page .auth-shell {
  width: min(1120px, 100%);
  grid-template-columns: minmax(0, 1.04fr) minmax(360px, 0.96fr);
  gap: 32px;
  align-items: stretch;
}

.trial-public-page .auth-brand-panel,
.trial-public-page .auth-card {
  min-width: 0;
  padding: 34px 34px 30px;
  border-radius: 24px;
  border: 1px solid color-mix(in srgb, #005881 8%, var(--border));
  box-shadow: 0 18px 40px rgba(0, 88, 129, 0.08);
}

.trial-public-page .trial-marketing-panel {
  display: flex;
  flex-direction: column;
  gap: 22px;
  justify-content: space-between;
  background:
    linear-gradient(180deg, var(--trial-panel-top), var(--trial-panel-bottom)),
    linear-gradient(135deg, rgba(49, 187, 217, 0.08), transparent 62%);
  border-color: color-mix(in srgb, #31bbd9 16%, var(--border));
}

.trial-public-page .trial-form-card {
  background: var(--trial-card-bg);
  justify-content: flex-start;
}

.trial-public-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 36px 24px;
}

.trial-public-frame {
  width: min(1120px, 100%);
}

.trial-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.trial-public-page .trial-brand-lockup {
  min-height: 0;
  margin-bottom: 0;
  color: inherit;
  text-decoration: none;
}

.trial-public-page .trial-brand-lockup:hover,
.trial-public-page .trial-brand-lockup:focus-visible {
  text-decoration: none;
}

.trial-public-page .auth-brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  box-shadow: 0 12px 26px rgba(49, 187, 217, 0.12);
}

.trial-public-page .auth-brand-copy {
  gap: 3px;
}

.trial-public-page .auth-brand-copy strong {
  font-size: 1.18rem;
}

.trial-public-page .auth-brand-copy span {
  font-size: 0.82rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--text-soft) 88%, #005881 12%);
}

.trial-top-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(49, 187, 217, 0.18);
  background: rgba(49, 187, 217, 0.08);
  color: #005881;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.trial-hero-copy {
  display: grid;
  gap: 14px;
}

.trial-public-page .auth-brand-panel h1 {
  margin: 0;
  max-width: none;
  text-wrap: balance;
  font-size: clamp(2.25rem, 4vw, 3.15rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
}

.trial-public-page .auth-lead {
  margin: 0;
  max-width: 50ch;
  font-size: 0.99rem;
  line-height: 1.65;
}

.trial-value-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--trial-pill-border, rgba(49, 187, 217, 0.18));
  background: var(--trial-pill-bg, rgba(255, 255, 255, 0.88));
  color: var(--trial-pill-text, #0d2b3b);
  box-shadow: 0 10px 22px rgba(0, 88, 129, 0.06);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.trial-value-pill.is-disabled {
  border-color: color-mix(in srgb, var(--warning) 28%, var(--border));
  background: color-mix(in srgb, var(--warning) 10%, var(--surface-strong));
  color: color-mix(in srgb, var(--warning) 86%, var(--text));
}

.trial-feature-list {
  display: grid;
  gap: 12px;
}

.trial-feature-item {
  position: relative;
  display: grid;
  gap: 5px;
  padding: 14px 16px 14px 18px;
  border-radius: 16px;
  border: 1px solid var(--trial-feature-border, rgba(0, 88, 129, 0.08));
  background: var(--trial-feature-bg, rgba(255, 255, 255, 0.72));
  box-shadow: 0 8px 18px rgba(0, 88, 129, 0.04);
}

.trial-feature-item::before {
  content: '';
  position: absolute;
  left: 18px;
  top: 19px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #31bbd9;
}

.trial-feature-item strong,
.trial-feature-item span {
  padding-left: 16px;
}

.trial-feature-item strong {
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.trial-feature-item span {
  color: var(--text-soft);
  line-height: 1.55;
}

.trial-feedback {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text);
  line-height: 1.45;
}

.trial-feedback[hidden] {
  display: none !important;
}

.trial-feedback-message {
  font-size: 0.92rem;
  font-weight: 700;
  color: inherit;
}

.trial-feedback-note {
  font-size: 0.82rem;
  color: var(--text-soft);
}

.trial-feedback.is-error {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-strong));
  color: color-mix(in srgb, var(--danger) 86%, var(--text));
}

.trial-feedback.is-success {
  border-color: color-mix(in srgb, var(--success) 28%, var(--border));
  background: color-mix(in srgb, var(--success) 10%, var(--surface-strong));
  color: color-mix(in srgb, var(--success) 82%, var(--text));
}

.trial-form-head {
  gap: 8px;
  margin-bottom: 20px;
}

.trial-form-kicker {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(49, 187, 217, 0.08);
  color: #005881;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.trial-public-page .auth-card h2 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.trial-public-page .auth-card-head p {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
}

.trial-public-page .trial-form {
  gap: 14px;
  margin-top: 0;
}

.trial-public-page .trial-name-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.trial-public-page .trial-name-row > * {
  min-width: 0;
}

.trial-public-page .trial-field {
  gap: 7px;
}

.trial-public-page .auth-label {
  font-size: 0.86rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--text) 92%, #005881 8%);
}

.trial-public-page .trial-field .text-input {
  min-height: 48px;
  height: 48px;
  padding: 0 15px;
  border-radius: 14px;
  border-color: var(--trial-input-border);
  background: var(--trial-input-bg);
  box-shadow: none;
}

.trial-public-page .trial-field .text-input:hover {
  border-color: rgba(49, 187, 217, 0.3);
}

.trial-public-page .trial-field .text-input:focus {
  border-color: rgba(49, 187, 217, 0.55);
  box-shadow:
    0 0 0 4px rgba(49, 187, 217, 0.12),
    0 10px 18px rgba(0, 88, 129, 0.06);
}

.trial-submit-btn {
  width: 100%;
}

.trial-public-page .auth-submit-btn {
  min-height: 50px;
  margin-top: 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, #31bbd9 0%, #1aa6ce 100%);
  border: 1px solid rgba(0, 88, 129, 0.16);
  color: white;
  box-shadow: 0 14px 28px rgba(0, 88, 129, 0.16);
}

.trial-public-page .auth-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 30px rgba(0, 88, 129, 0.18);
}

.trial-public-page .auth-submit-btn:focus-visible {
  box-shadow:
    0 0 0 4px rgba(49, 187, 217, 0.14),
    0 16px 28px rgba(0, 88, 129, 0.18);
}

.trial-inline-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.trial-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.trial-captcha-slot {
  min-height: 0;
  display: grid;
  justify-content: start;
}

.trial-legal-links {
  margin-top: 14px;
  gap: 12px 16px;
}

.trial-public-page .trial-legal-links a {
  color: color-mix(in srgb, var(--text-muted) 82%, #005881 18%);
  font-size: 0.84rem;
  font-weight: 600;
}

@media (max-width: 1024px) {
  .trial-public-page .auth-shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}

@media (max-width: 720px) {
  .trial-public-shell {
    padding: 20px 14px;
  }

  .trial-public-page .auth-brand-panel,
  .trial-public-page .auth-card {
    padding: 24px 20px;
    border-radius: 20px;
  }

  .trial-brand-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .trial-public-page .auth-brand-panel h1 {
    font-size: 2rem;
  }

  .trial-public-page .auth-card h2 {
    font-size: 1.56rem;
  }

  .trial-public-page .trial-name-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .trial-value-pill {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading.compact { margin-bottom: 20px; }
.section-heading h2 { margin-top: 8px; font-size: 2rem; letter-spacing: -0.02em; }
.section-heading h3 { margin-top: 8px; font-size: 1.25rem; }

/* Groups a status badge and its action on the right of a heading. Without the
   wrapper the flex parent's space-between would push the two apart. */
.section-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
}

.agent-grid,
.scenario-grid,
.drawer-list { display: grid; gap: 24px; }
.agent-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.agent-grid > .empty-state,
.drawer-list > .empty-state,
.agent-access-list > .empty-state { grid-column: 1 / -1; }

.agent-card,
.drawer-item,
.more-card,
.scenario-card {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}

.agent-card,
.drawer-item,
.more-card { cursor: pointer; transition: 160ms ease; }

.agent-card.is-static,
.drawer-item.is-static {
  cursor: default;
}

.agent-card:hover,
.agent-card.active,
.drawer-item:hover,
.drawer-item.active,
.more-card:hover {
  border-color: color-mix(in srgb, var(--accent) 52%, var(--border));
  box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 16%, transparent);
}

.agent-card.is-static:hover,
.drawer-item.is-static:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-soft);
}

.agent-card h3,
.drawer-item h3,
.scenario-card h3,
.more-card strong { margin: 12px 0 0; font-size: 1.2rem; line-height: 1.35; }
.agent-card p,
.drawer-item p { margin: 16px 0 0; min-height: 84px; }

.agent-chip-row,
.scenario-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }

.chip,
.tiny-badge {
  min-height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.84rem;
  font-weight: 600;
}

.chip-warning {
  background: color-mix(in srgb, var(--warning) 12%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--warning) 28%, var(--border));
  color: color-mix(in srgb, var(--warning) 92%, var(--text));
}

.chip-danger {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  color: color-mix(in srgb, var(--danger) 92%, var(--text));
}

.more-card { display: grid; place-items: center; min-height: 248px; text-align: center; background: var(--surface-subtle); }
.more-card span {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  font-size: 1.75rem;
  color: var(--accent);
}
.more-card strong { margin-top: 16px; }
.more-card p { margin: 12px 0 0; color: var(--text-soft); max-width: 26ch; line-height: 1.6; }

.workspace-grid { display: grid; grid-template-columns: minmax(360px, 0.92fr) minmax(0, 1.08fr); gap: 32px; }
.session-card,
.transcript-card { padding: 32px; }

.selected-agent {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  gap: 24px;
  align-items: center;
  padding: 32px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.muted { color: var(--text-muted); }
.selected-agent-copy h3 { margin-top: 12px; font-size: 1.85rem; line-height: 1.15; letter-spacing: -0.03em; }
.selected-agent-copy p { margin-top: 16px; }

.voice-visual-wrap { display: flex; justify-content: center; }
.voice-visual {
  width: 104px;
  height: 104px;
  border-radius: 28px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 16%, #132335), #101a28 72%);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  padding: 24px 18px;
  box-shadow: 0 14px 32px color-mix(in srgb, var(--accent) 16%, transparent);
}

.voice-visual span {
  width: 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f8fcff 0%, color-mix(in srgb, var(--accent) 48%, #cfd8e3) 100%);
  height: 22px;
  transition: height 160ms ease, opacity 160ms ease;
  opacity: 0.9;
}
.voice-visual span:nth-child(2) { height: 34px; }
.voice-visual span:nth-child(3) { height: 46px; }
.voice-visual span:nth-child(4) { height: 34px; }
.voice-visual span:nth-child(5) { height: 22px; }
.voice-visual.listening span:nth-child(1) { animation: equalize 1s ease-in-out infinite; }
.voice-visual.listening span:nth-child(2) { animation: equalize 1.1s ease-in-out infinite 0.08s; }
.voice-visual.listening span:nth-child(3) { animation: equalize 0.9s ease-in-out infinite 0.14s; }
.voice-visual.listening span:nth-child(4) { animation: equalize 1.15s ease-in-out infinite 0.1s; }
.voice-visual.listening span:nth-child(5) { animation: equalize 1.05s ease-in-out infinite 0.18s; }

@keyframes equalize {
  0%, 100% { height: 18px; opacity: 0.75; }
  25% { height: 52px; opacity: 1; }
  50% { height: 28px; opacity: 0.9; }
  75% { height: 64px; opacity: 1; }
}

.control-row { margin-top: 24px; }
.quiet-note,
.outbound-card,
.composer-card,
.activity-panel { margin-top: 24px; }

.quiet-note {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}


.outbound-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.composer-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.composer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.composer-head h4 { font-size: 1.125rem; }
.composer-head p { margin: 8px 0 0; }

.phone-input-group {
  flex: 1 1 340px;
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(136px, 146px) minmax(160px, 1fr);
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface-strong);
  overflow: hidden;
}

.country-select-shell {
  position: relative;
  min-width: 0;
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-subtle) 90%, white);
}

.country-select-display {
  min-height: 48px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  pointer-events: none;
}

.country-flag {
  flex: 0 0 auto;
  width: 22px;
  height: 16px;
  display: block;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 82%, transparent);
  background: color-mix(in srgb, var(--surface-strong) 92%, white);
}

.country-dial {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
}

.country-select-caret {
  margin-left: auto;
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-right: 1.8px solid color-mix(in srgb, var(--text-muted) 88%, transparent);
  border-bottom: 1.8px solid color-mix(in srgb, var(--text-muted) 88%, transparent);
  transform: translateY(-2px) rotate(45deg);
}

.country-select {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 0;
  opacity: 0.01;
  color: transparent;
  background: transparent;
  font-size: 0.95rem;
  line-height: 1.2;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
  appearance: none;
}

.country-select option {
  color: var(--text);
  background: var(--surface-strong);
  font-size: 0.95rem;
  -webkit-text-fill-color: initial;
}

.phone-input-group .text-input {
  border: 0;
  border-radius: 0;
  background: transparent;
}

.phone-input-group:focus-within {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.phone-input-group:focus-within .country-select-shell {
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-subtle));
}

.country-select-shell:hover {
  background: color-mix(in srgb, var(--accent) 6%, var(--surface-subtle));
}

.text-input {
  flex: 1 1 240px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  outline: none;
}
.text-input::placeholder { color: color-mix(in srgb, var(--text-muted) 72%, transparent); }
.text-input:focus {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}

.text-input:-webkit-autofill,
.text-input:-webkit-autofill:hover,
.text-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 14%, var(--border)),
    0 0 0 1000px color-mix(in srgb, var(--surface-muted) 64%, var(--surface-strong)) inset;
  transition: background-color 9999s ease-out;
}

.transcript-list,
.event-feed { display: grid; gap: 16px; }
.transcript-list { min-height: 360px; max-height: 560px; overflow: auto; padding-right: 4px; }

.empty-state {
  display: grid;
  place-items: center;
  padding: 48px 32px;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px dashed color-mix(in srgb, var(--accent) 32%, var(--border));
  background: var(--surface-subtle);
  color: var(--text-muted);
}

.transcript-item,
.event-item {
  padding: 24px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.transcript-item header,
.event-item header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

/* One bubble per uninterrupted turn: the paragraphs inside it carry the
   spacing, the bubble keeps the single border and the 24px padding it has.
   .event-item is this card's twin in every other rule (padding, border,
   background, header) and the two feeds sit in the same panel, so it gets the
   same paragraph reset -- otherwise the browser default `margin: 1em 0` would
   only survive in one of them and two identical-looking cards would breathe
   differently. Only the transcript can hold more than one paragraph, so only it
   needs the gap between them. */
.transcript-item p,
.event-item p { margin: 0; }
.transcript-item p + p { margin-top: 12px; }

.role {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.75rem;
  font-weight: 700;
}

.transcript-item.assistant .role { color: var(--accent); }
.transcript-item.user .role { color: #4a81c8; }
.transcript-item.tool .role { color: #a48a59; }
.time { color: var(--text-muted); font-size: 0.84rem; }

.activity-panel { border-top: 1px solid var(--border); padding-top: 24px; }
.activity-heading { margin-bottom: 16px; }
.scenario-grid { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.scenario-card { padding: 28px; }
.scenario-card h3 { margin: 12px 0 0; font-size: 1.2rem; }
.scenario-card p { margin: 16px 0 0; }

.drawer { position: fixed; inset: 0; display: none; z-index: 40; }
.drawer.open { display: block; }
.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 19, 34, 0.24);
  backdrop-filter: blur(1.5px);
}

:root[data-theme='dark'] .drawer-backdrop {
  background: rgba(2, 8, 16, 0.34);
}

.drawer-panel {
  position: absolute;
  right: 24px;
  top: 24px;
  bottom: 24px;
  width: min(430px, calc(100% - 32px));
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px;
  overflow: auto;
}

.drawer-panel-wide {
  width: min(720px, calc(100% - 32px));
}

.drawer-header { margin-bottom: 24px; }
.drawer-header .btn { flex-shrink: 0; white-space: nowrap; }

.drawer-subtitle {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.65;
}

.agent-empty-state {
  min-height: 240px;
}

.agent-access-drawer-panel {
  display: grid;
  gap: 18px;
  align-content: start;
}

.agent-access-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.agent-access-mode-group,
.agent-access-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agent-access-mode-group {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
}

.agent-access-selection {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Story 1.5 (A5): same drawer shell as the agent-access drawer, same spacing.
   No new layout system -- only the panel's own vertical rhythm. */
.user-edit-drawer-panel {
  display: grid;
  gap: 14px;
  align-content: start;
}

.user-edit-drawer-panel .split-row { align-items: start; }

.user-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.user-edit-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

/* The credential summary (Story 1.5 / A5, D12). It replaces window.alert and
   must stay until it is dismissed: it is the only place a temporary password is
   ever shown. */
.credential-summary {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 19, 34, 0.24);
  backdrop-filter: blur(1.5px);
}

:root[data-theme='dark'] .credential-summary {
  background: rgba(2, 8, 16, 0.34);
}

.credential-summary[hidden] { display: none; }

.credential-summary-panel {
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 32px;
  display: grid;
  gap: 16px;
  align-content: start;
}

.credential-summary-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.credential-summary-list li {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  word-break: break-word;
}

/*
 * The rows inside #agentTypeList are cards of their own, so they are NOT direct
 * children of the admin panel and the panel rule cannot reach them. Inside a row
 * nothing carried a layout: the mode buttons, the summary chip and the agent
 * checkboxes stacked with zero space between them, and the only gap in the whole
 * row came from .section-heading's own margin-bottom.
 *
 * #agentTypeList is the only .agent-access-list that renders .card rows;
 * #agentCatalogList and #agentAccessList render .agent-access-item labels, which
 * the list gap below already spaces.
 */
.agent-access-list > .card {
  display: grid;
  gap: 14px;
  align-content: start;
}

.agent-access-list > .card > * {
  margin-top: 0;
  margin-bottom: 0;
}

/*
 * The segmented control is inline-flex, and a grid blockifies its children --
 * without this it would stretch across the whole row instead of hugging its
 * three buttons.
 */
.agent-access-list > .card > .agent-access-mode-group {
  justify-self: start;
}

/*
 * A configuration card shows its state in the summary and keeps the controls
 * behind a disclosure, so the tab reads as a list of decisions rather than one
 * long form. Native <details>, so it works without JavaScript and with a
 * keyboard, and closed content stays in the DOM -- which is what lets the Save
 * button in the card header submit a form nobody has expanded.
 */
/*
 * The loading spinner. One appearance for every panel, so "waiting" looks the
 * same everywhere instead of each list inventing an empty box.
 *
 * The ring is decoration and is aria-hidden; the label carries the meaning.
 * Under prefers-reduced-motion the ring stops turning and becomes a static
 * marker -- it does NOT disappear, because then the label would be the only
 * signal and a stopped page would look like a finished one.
 */
.load-spinner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 4px;
  color: var(--text-soft);
  font-size: 0.94rem;
}

.load-spinner-ring {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  border-top-color: var(--accent);
  animation: load-spinner-turn 700ms linear infinite;
}

@keyframes load-spinner-turn {
  to { transform: rotate(360deg); }
}

.load-spinner-label { min-width: 0; }

/* An error is not an empty result, so it must not look like one. */
.empty-state.is-error {
  border-color: color-mix(in srgb, var(--danger) 34%, var(--border));
  color: color-mix(in srgb, var(--danger) 88%, var(--text));
}

@media (prefers-reduced-motion: reduce) {
  .load-spinner-ring {
    animation: none;
    border-top-color: color-mix(in srgb, var(--accent) 28%, transparent);
    background: var(--accent);
  }
}

.config-section {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.config-section > summary {
  cursor: pointer;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  border-radius: var(--radius-md);
}

.config-section > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.config-section[open] > summary {
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.config-section-label { flex: 1 1 auto; }

.config-section-chip:empty { display: none; }

/* The disclosure owns the padding, so the cards inside keep their own layout. */
.config-section > *:not(summary) {
  margin-left: 18px;
  margin-right: 18px;
}

.config-section > *:last-child:not(summary) { margin-bottom: 18px; }

.agent-access-list {
  display: grid;
  gap: 12px;
  max-height: 440px;
  overflow: auto;
  padding-right: 4px;
}

.agent-access-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: flex-start;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  transition: 160ms ease;
  cursor: pointer;
}

.agent-access-item:hover,
.agent-access-item.selected {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--border));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 12%, transparent);
}

.agent-access-item.is-disabled {
  opacity: 0.72;
  cursor: default;
}

.agent-access-item input {
  width: 18px;
  height: 18px;
  margin-top: 4px;
  accent-color: var(--accent);
}

.agent-access-item-copy {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.agent-access-item-copy strong {
  font-size: 1rem;
  line-height: 1.4;
}

.agent-access-item-copy p {
  margin: 0;
  color: var(--text-soft);
  min-height: 0;
}

.agent-access-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.agent-access-hint {
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%) translateY(16px);
  opacity: 0;
  pointer-events: none;
  min-width: 280px;
  max-width: min(90vw, 520px);
  padding: 16px 18px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface-strong) 76%, #0f1d2b);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-soft);
  transition: 160ms ease;
}

.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 1120px) {
  .header-inner {
    grid-template-columns: 1fr;
    justify-items: start;
    padding: 16px 0;
  }
  .main-nav { justify-self: start; }

  .brand-name { font-size: 1.35rem; }
  .brand-subtitle { font-size: 0.82rem; }
  .brand-mark { width: 42px; height: 42px; }

  .hero-section,
  .workspace-grid { grid-template-columns: 1fr; }
  .agent-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .brand-mark,
  .ui-premium-hover,
  :where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn) {
    transition: none !important;
  }

  .brand-mark::after,
  .ui-premium-hover::before,
  .ui-premium-hover::after,
  :where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn)::before,
  :where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn)::after {
    transition: none !important;
  }

  .ui-premium-hover:is(:hover, :focus-visible):not(:disabled)::before,
  :where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn):is(:hover, :focus-visible):not(:disabled)::before,
  .ui-premium-hover:is(:hover, :focus-visible):not(:disabled)::after,
  :where(.nav-link, .admin-tab-btn, .workspace-mode-btn, .btn):is(:hover, :focus-visible):not(:disabled)::after {
    opacity: 0.28;
    transform: none;
  }
}

@media (max-width: 720px) {
  .container { width: min(calc(100% - 24px), var(--container)); }
  .main-content { padding: 24px 0 56px; }
  .header-inner,
  .main-nav,
  .header-actions,
  .workspace-grid > *,
  .card,
  .selected-agent,
  .composer-card { min-width: 0; }
  .main-nav,
  .header-actions { max-width: 100%; }
  .main-nav { overflow-x: auto; }
  .header-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  .hero-section,
  .session-card,
  .transcript-card,
  .drawer-panel { padding: 24px; }
  .hero-copy h1 { max-width: none; font-size: clamp(2.2rem, 12vw, 3.4rem); }
  .agent-grid { grid-template-columns: 1fr; }
  .selected-agent { grid-template-columns: 1fr; }
  .composer-head { flex-direction: column; }
  .auth-overlay { padding: 16px; }
  .auth-brand-panel,
  .auth-card { padding: 24px; }
  .auth-submit-btn { min-height: 52px; }
}


body.auth-locked .page-shell,
body.auth-checking .page-shell {
  display: none;
}

body.auth-locked .auth-overlay {
  display: grid;
}

/*
 * While the session check is in flight: neither the console nor the login
 * dialog. The overlay's own `display: grid` below is what shows it, so the
 * checking state simply does not turn it on -- and the page is the background
 * colour with the spinner in the middle, which is honest about knowing nothing.
 */
body.auth-checking .auth-overlay {
  display: none;
}

body.auth-checking .auth-checking-spinner {
  display: grid;
}

.auth-checking-spinner {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 80;
  place-items: center;
  background: var(--bg);
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  /* Progressive: keeps centering when it fits, falls back to start-aligned when
     the shell is taller than the viewport. Dropped by engines without `safe`,
     which then land on the `place-items: center` above -- never worse than before. */
  align-items: safe center;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 32px;
  background:
    radial-gradient(640px 340px at 14% 18%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(560px 280px at 88% 82%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 74%),
    color-mix(in srgb, var(--bg) 94%, transparent);
}

.auth-overlay.hidden { display: none; }

/*
 * The login screen's own theme toggle. Placed rather than laid out: the overlay
 * is a centring grid, so a normal child would become a second row above the
 * dialog and push it off-centre.
 */
.auth-theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1;
}

/* The trial page has no toggle at all -- see the note on .trial-public-page. */
.trial-public-page .auth-theme-toggle { display: none; }

.auth-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 28px;
  align-items: stretch;
}

.auth-brand-panel,
.auth-card {
  min-width: 0;
}

.auth-brand-panel {
  position: relative;
  overflow: hidden;
  padding: 40px;
  border-radius: 30px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), color-mix(in srgb, var(--surface-subtle) 98%, transparent)),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 60%);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.auth-brand-panel::before {
  content: '';
  position: absolute;
  inset: auto -80px -120px auto;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  filter: blur(18px);
  pointer-events: none;
}

.auth-brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 52px;
  margin-bottom: 52px;
}

.auth-brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 16%, var(--surface-strong)), color-mix(in srgb, var(--surface-strong) 94%, white));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border));
  box-shadow: 0 16px 32px color-mix(in srgb, var(--accent) 14%, transparent);
}

.auth-brand-mark img {
  width: 28px;
  height: 28px;
}

.auth-brand-copy {
  display: grid;
  gap: 6px;
  line-height: 1.2;
}

.auth-brand-copy strong {
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

/* Deliberately quieter than the headline: this is the product's name badge, not
   a second headline. Two competing labels above the h1 read as one glued block. */
.auth-brand-copy span {
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.auth-brand-panel h1,
.auth-card h2 {
  margin: 12px 0 0;
  letter-spacing: -0.035em;
}

.auth-brand-panel h1 {
  font-size: clamp(2.4rem, 3vw, 3.2rem);
  line-height: 1.02;
  max-width: 11ch;
}

.auth-lead,
.auth-card p {
  color: var(--text-soft);
  line-height: 1.7;
}

.auth-lead {
  margin: 22px 0 0;
  max-width: 54ch;
  font-size: 1.02rem;
}

.auth-card {
  width: 100%;
  padding: 34px 34px 30px;
  background: color-mix(in srgb, var(--surface-strong) 90%, transparent);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-card-head {
  display: grid;
  gap: 10px;
}

.auth-card h2 {
  font-size: 2rem;
}

.auth-card-head p {
  margin: 0;
}

.auth-form {
  gap: 16px;
  margin-top: 28px;
}

.auth-field {
  display: grid;
  gap: 8px;
}

.auth-label {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
}

.auth-field .text-input {
  min-height: 54px;
  padding: 0 18px;
  border-color: color-mix(in srgb, var(--accent) 10%, var(--border));
  background: color-mix(in srgb, var(--surface-muted) 64%, var(--surface-strong));
}

.auth-field .text-input:hover {
  border-color: color-mix(in srgb, var(--accent) 22%, var(--border));
}

.auth-field .text-input:focus {
  border-color: color-mix(in srgb, var(--accent) 54%, var(--border));
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent),
    0 12px 26px color-mix(in srgb, var(--accent) 8%, transparent);
}

.auth-field .text-input:disabled {
  opacity: 0.78;
  cursor: wait;
}

.auth-feedback {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--danger) 28%, var(--border));
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-strong));
  color: color-mix(in srgb, var(--danger) 86%, var(--text));
  font-size: 0.94rem;
  line-height: 1.55;
}

.auth-submit-btn {
  width: 100%;
  min-height: 54px;
  margin-top: 6px;
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 18px 28px color-mix(in srgb, var(--accent) 24%, transparent);
}

.auth-submit-btn:hover {
  box-shadow: 0 22px 34px color-mix(in srgb, var(--accent) 28%, transparent);
}

.auth-submit-btn:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent),
    0 18px 28px color-mix(in srgb, var(--accent) 24%, transparent);
}

.auth-submit-btn[aria-busy='true'] {
  filter: saturate(0.95);
}

/* --------------------------------------------------------------------------
   Login console overlay (#authOverlay) only.
   Everything below is scoped under .auth-overlay on purpose: public/trial.html
   reuses the bare .auth-* classes, and unscoped edits would restyle the public
   trial funnel. Mirrors the existing `.trial-public-page .auth-shell` pattern.
   -------------------------------------------------------------------------- */

.auth-overlay .auth-shell {
  width: min(1040px, 100%);
}

.auth-overlay .auth-brand-lockup {
  margin-bottom: 34px;
}

/* The cap and the size have to be read together: a narrow `max-width` at a large
   `font-size` is what broke this headline into four stacked lines. 20ch sets it
   in two, and `balance` keeps those two lines close to equal length. */
.auth-overlay .auth-brand-panel h1 {
  margin-top: 0;
  font-size: clamp(1.95rem, 2.7vw, 2.75rem);
  line-height: 1.08;
  max-width: 20ch;
  text-wrap: balance;
}

.auth-overlay .auth-lead {
  margin: 18px 0 0;
}

.auth-facts {
  margin: 26px 0 0;
  gap: 16px;
}

.auth-facts li {
  display: grid;
  gap: 4px;
  padding-left: 24px;
}

.auth-facts li::before {
  top: 10px;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 14%, transparent);
}

.auth-facts strong {
  font-size: 0.98rem;
  color: var(--text);
}

.auth-facts span {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.6;
}

.auth-overlay .auth-card h2 {
  /* The card no longer carries an .eyebrow, so the h2 leads the block. */
  margin-top: 0;
  font-size: 1.35rem;
}

.auth-overlay .auth-card-head p {
  font-size: 0.95rem;
}

.auth-overlay .auth-form {
  margin-top: 24px;
}

.auth-field-group {
  display: grid;
  gap: 6px;
}

.auth-field-hint {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.86rem;
  line-height: 1.5;
}

/* .auth-feedback declares no `display`, which is what makes the `hidden`
   attribute work. Stated explicitly so a later layout change cannot leave an
   empty error box permanently on screen. */
.auth-overlay .auth-feedback[hidden] {
  display: none;
}

.auth-alt-access {
  margin: 20px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 6px;
}

.auth-alt-line {
  margin: 0;
  font-size: 0.94rem;
  color: var(--text-soft);
}

.auth-alt-note {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  /* --text-muted is ~4.0:1 on the light card and would fail AA at this size. */
  color: var(--text-soft);
}

.auth-alt-link {
  /* Plain --accent-strong is ~3.2:1 on the light card; darkening it toward
     --text lifts it past AA in light and stays bright in dark. */
  color: color-mix(in srgb, var(--accent-strong) 60%, var(--text));
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-alt-link:hover {
  color: var(--accent);
}

/* The base .public-legal-links focus style only swaps the text colour, which is
   not a reliable focus indicator. Scoped to the login so trial.html is untouched. */
.auth-overlay a:focus-visible {
  outline: 2px solid var(--accent-strong);
  outline-offset: 3px;
  border-radius: 6px;
}

@media (min-width: 1440px) {
  .auth-overlay .auth-shell {
    width: min(1120px, 100%);
  }
}

@media (max-width: 920px) {
  .auth-shell {
    grid-template-columns: 1fr;
    max-width: 620px;
  }

  .auth-card { order: 1; }
  .auth-brand-panel { order: 2; }

  .auth-brand-panel {
    padding: 30px;
  }

  .auth-brand-lockup {
    margin-bottom: 32px;
  }

  .auth-brand-panel h1 {
    max-width: none;
    font-size: clamp(2rem, 7vw, 2.7rem);
  }

  /* Needs the same specificity as the scoped desktop rule above, or the login
     h1 would keep its 20ch cap and desktop clamp below the breakpoint. */
  .auth-overlay .auth-brand-panel h1 {
    max-width: none;
    font-size: clamp(1.8rem, 6.4vw, 2.4rem);
  }

  .auth-overlay .auth-facts {
    margin-top: 22px;
  }
}

.stack-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.split-row {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Close-Integration: the per-field provenance label.
   The wrapper exists so the label can sit UNDER its input without becoming a
   second cell of the surrounding .split-row grid -- the input plus its label is
   one field, and the two must stay together when the row wraps. */
.close-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

/* Deliberately always visible and never display:none. An operator who cannot
   see that a value comes from .env cannot see which values a save would freeze
   into the store, which is the whole reason this label exists. */
.close-field-source {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  white-space: nowrap;
}

/* "gespeichert": the store already owns this value, so a save cannot capture
   anything new here. */
.close-field-source.is-stored {
  color: var(--text-soft);
}

/* "aus .env" / "Standard": the store does NOT own this value yet. Marked in the
   warning colour because these are exactly the fields a careless save used to
   copy out of the environment. */
.close-field-source.is-inherited {
  color: var(--warning);
}

.privacy-toggle .close-field-source {
  margin-left: 2px;
}

.admin-users-list {
  display: grid;
  gap: 12px;
  margin-top: 20px;
}

.admin-user-item {
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  gap: 10px;
}

.admin-user-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.admin-user-meta {
  margin: 0;
  color: var(--text-soft);
}

.admin-user-inline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-user-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* Story 1.5 (A5): the admin list row is a readable summary again -- editing
   moved into #userEditDrawer, so the row only carries entry points. */
.admin-user-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin-user-row-actions .btn { min-height: 40px; }

/* One labelled field. Reused by the create form and the edit drawer so both
   surfaces look identical -- no second form system. */
.user-form-field {
  display: grid;
  gap: 6px;
  align-content: start;
}

.user-form-section-note {
  margin: 6px 0 0;
  font-weight: 700;
  color: var(--text);
}

.user-form .split-row { align-items: start; }

.admin-user-actions .text-input,
.admin-user-actions .btn { min-height: 40px; }

.admin-user-actions .privacy-toggle {
  min-height: 40px;
}

.offer-shell,
.offer-view-content {
  display: grid;
  gap: 24px;
}

.offer-admin-card {
  padding: 32px;
}

.trial-settings-card {
  padding: 32px;
}

.invite-email-settings-form {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.invite-email-message-input {
  min-height: 180px;
  line-height: 1.5;
  resize: vertical;
}

.offer-admin-note,
.trial-settings-note {
  margin-top: 0;
}

.trial-settings-agent-section {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.trial-settings-field-label {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.trial-settings-field-hint {
  margin: 0;
}

.trial-settings-inline-warning {
  color: color-mix(in srgb, var(--warning) 88%, var(--text));
}

.offer-save-state,
.trial-settings-save-state {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-soft);
}

.offer-save-state.is-success,
.trial-settings-save-state.is-success {
  background: color-mix(in srgb, var(--success) 10%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--success) 28%, var(--border));
  color: color-mix(in srgb, var(--success) 80%, var(--text));
}

.offer-save-state.is-error,
.trial-settings-save-state.is-error {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  color: color-mix(in srgb, var(--danger) 82%, var(--text));
}

.offer-module-toggle {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.offer-module-option {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--surface-strong);
  border: 1px solid transparent;
  color: var(--text-soft);
  font-weight: 700;
}

.offer-module-option input {
  accent-color: var(--accent);
}

.offer-module-option:has(input:checked) {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--accent) 32%, var(--border));
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.offer-admin-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.offer-editor-section {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.offer-editor-section .section-heading {
  margin-bottom: 4px;
}

.offer-editor-section .section-heading h3,
.offer-tier-editor-head h3 {
  font-size: 1.12rem;
}

.offer-editor-section select,
.offer-editor-section textarea,
.offer-configurator-controls select,
.offer-configurator-controls textarea,
.offer-configurator-controls input {
  font: inherit;
}

.offer-textarea {
  min-height: 152px;
  padding: 14px 16px;
  resize: vertical;
}

.offer-tier-editor {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface);
}

.offer-tier-editor-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.offer-tier-list {
  display: grid;
  gap: 10px;
}

.offer-tier-row {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1.2fr) minmax(120px, 0.7fr) minmax(120px, 0.7fr) auto;
  align-items: center;
}

.offer-tier-remove {
  min-height: 48px;
}

.offer-form-actions {
  display: flex;
  justify-content: flex-end;
}

.offer-hero-card,
.offer-control-card,
.offer-result-card,
.offer-sidebar-card {
  padding: 32px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.offer-hero-card {
  display: grid;
  gap: 24px;
}

.offer-hero-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.offer-hero-head h3,
.offer-tier-match h3 {
  margin: 10px 0 0;
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  letter-spacing: -0.03em;
}

.offer-hero-head p,
.offer-tier-match p,
.offer-footnote,
.offer-result-note,
.offer-feature-copy {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.offer-price-pill {
  min-width: 190px;
  padding: 18px 20px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  color: #fff;
  box-shadow: 0 18px 34px color-mix(in srgb, var(--accent) 22%, transparent);
}

.offer-price-pill span {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  opacity: 0.8;
}

.offer-price-pill strong {
  display: block;
  margin-top: 6px;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.offer-metric-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.offer-metric {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  display: grid;
  gap: 6px;
}

.offer-metric span {
  color: var(--text-muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.offer-metric strong {
  font-size: 1.08rem;
  color: var(--text);
}

.offer-detail-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
}

.offer-feature-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.offer-feature-list li {
  position: relative;
  padding-left: 24px;
  color: var(--text-soft);
  line-height: 1.6;
}

.offer-feature-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.offer-footnote {
  padding: 18px 20px;
  border-radius: var(--radius-md);
  border: 1px dashed color-mix(in srgb, var(--accent) 30%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-subtle));
}

.offer-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offer-configurator-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
}

.offer-configurator-controls {
  display: grid;
  gap: 16px;
}

.offer-input-stack {
  display: grid;
  gap: 12px;
}

.offer-field-group {
  display: grid;
  gap: 10px;
}

.offer-field-group label {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.offer-field-hint {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.offer-inline-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 132px;
}

.offer-range-input {
  width: 100%;
  accent-color: var(--accent);
}

.offer-range-labels {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.offer-tier-match {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}

.offer-result-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.offer-result-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.offer-result-row:last-child {
  border-bottom: 0;
}

.offer-result-row span {
  color: var(--text-soft);
}

.offer-result-row strong {
  color: var(--text);
}

.offer-result-row.total {
  padding-top: 18px;
}

.offer-result-row.total span,
.offer-result-row.total strong {
  font-size: 1.12rem;
  font-weight: 800;
}

.offer-inline-message {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
  color: var(--text-soft);
}

.offer-inline-message.is-warning {
  background: color-mix(in srgb, var(--warning) 10%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--warning) 28%, var(--border));
  color: color-mix(in srgb, var(--warning) 88%, var(--text));
}

.offer-inline-message.is-error {
  background: color-mix(in srgb, var(--danger) 10%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  color: color-mix(in srgb, var(--danger) 86%, var(--text));
}

.premium-empty-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 132px;
  padding: 22px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px dashed color-mix(in srgb, var(--accent) 24%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-strong) 70%, transparent), color-mix(in srgb, var(--surface-subtle) 92%, transparent));
}

.premium-empty-state strong {
  color: var(--text);
  font-size: 0.98rem;
}

.premium-empty-state span {
  max-width: 52ch;
  color: var(--text-soft);
  line-height: 1.6;
}

.empty-state .premium-empty-state {
  width: 100%;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.admin-offer-section .section-heading p,
.offer-voice-editor .offer-tier-editor-head p,
.offer-control-panel-head h3 {
  margin: 6px 0 0;
}

.admin-offer-section .section-heading p,
.offer-voice-editor .offer-tier-editor-head p,
.offer-control-panel-head {
  color: var(--text-soft);
  line-height: 1.6;
}

.offer-polish-card,
.configurator-input-card {
  box-shadow: inset 0 1px 0 color-mix(in srgb, white 26%, transparent);
}

.pilot-offer-card,
.configurator-summary-card {
  position: relative;
  overflow: hidden;
}

.pilot-offer-card::before,
.configurator-summary-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 72%, white), transparent);
  opacity: 0.7;
  pointer-events: none;
}

.offer-polish-head h3 {
  letter-spacing: 0;
}

.offer-highlight-strip,
.configurator-value-strip {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.configurator-value-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.offer-highlight-strip span,
.configurator-value-strip span {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--border));
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-subtle));
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.demo-process-steps {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.demo-process-step {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 78px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 66%, var(--surface-subtle));
}

.demo-process-step:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: -10px;
  width: 10px;
  height: 1px;
  background: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.demo-process-step small {
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.demo-process-step strong {
  color: var(--text);
  font-size: 0.94rem;
}

.pilot-offer-layout .offer-sidebar-card,
.offer-configurator-controls .offer-sidebar-card {
  display: grid;
  gap: 16px;
}

.offer-control-panel-head {
  display: grid;
  gap: 2px;
}

.offer-control-panel-head h3 {
  color: var(--text);
  font-size: 1.24rem;
}

.configurator-input-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface-strong) 72%, var(--surface-subtle));
}

.offer-consent-note {
  margin: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 7%, var(--surface-subtle));
  color: var(--text-muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.offer-enterprise-note {
  margin-top: 10px !important;
  font-size: 0.88rem;
  color: var(--text-muted) !important;
}

.configurator-summary-card {
  display: grid;
  align-content: start;
  gap: 18px;
}

.configurator-total-row {
  margin-top: 6px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 10%, var(--surface-strong));
}

.configurator-total-row strong {
  color: color-mix(in srgb, var(--accent-strong) 78%, var(--text));
}

.offer-view-content > .empty-state {
  min-height: 240px;
}

@media (max-width: 1080px) {
  .offer-admin-grid,
  .offer-detail-grid,
  .offer-configurator-grid {
    grid-template-columns: 1fr;
  }

  .offer-metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .offer-highlight-strip,
  .configurator-value-strip,
  .demo-process-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .offer-module-toggle,
  .offer-form-actions,
  .offer-tier-editor-head {
    width: 100%;
  }

  .offer-module-toggle,
  .offer-tier-editor-head,
  .offer-hero-head {
    flex-direction: column;
    align-items: stretch;
  }

  .offer-module-option,
  .offer-form-actions .btn,
  .offer-tier-editor-head .btn,
  .offer-price-pill {
    width: 100%;
  }

  .offer-tier-row,
  .offer-inline-grid,
  .offer-metric-grid,
  .offer-highlight-strip,
  .configurator-value-strip,
  .demo-process-steps {
    grid-template-columns: 1fr;
  }

  .demo-process-step::after {
    display: none;
  }
}

@media (max-width: 720px) {
  .split-row,
  .phone-input-group,
  .admin-user-actions,
  .outbound-summary,
  .agent-access-footer,
  .voice-clone-grid,
  .voice-clone-meta { grid-template-columns: 1fr; }

  .country-select-shell {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .agent-access-toolbar {
    align-items: stretch;
  }

  .agent-access-mode-group,
  .agent-access-toolbar-actions {
    width: 100%;
  }
}


.admin-shell {
  padding: 24px;
}

.admin-tab-row {
  display: inline-flex;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
  margin-bottom: 24px;
}

.admin-tab-btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  font-weight: 700;
  color: var(--text-soft);
}

.admin-tab-btn.active {
  color: var(--text);
  background: var(--surface-strong);
  box-shadow: var(--shadow-soft);
}

.admin-panel { display: none; }

/*
 * Spacing in the admin area belongs to the CONTAINER, not to each child.
 *
 * Every card, and every block inside one, used to carry its own margin-top --
 * so a block that had none sat flush against the one above it. Three separate
 * reports, one cause: the Demo-Zugang card against Agenten je Nutzertyp
 * (#trialSettingsCard was the only card with a margin at all), the search field
 * and the badges under "Rufnummer anlegen" (#phoneNumbersSearchInput and
 * #phoneNumbersSummary have none), and the user-type settings
 * (.trial-settings-agent-section and .agent-access-list have none).
 *
 * Fixing those three individually would just leave the fourth to be reported.
 * The gap is authoritative instead, and the direct children's own vertical
 * margins are cleared so the two cannot add up. 18px is not a new number: it is
 * what .voice-clone-card already used for exactly this job.
 */
.admin-panel.active {
  display: grid;
  gap: 24px;
  align-content: start;
}

.admin-panel > .card {
  display: grid;
  gap: 18px;
  align-content: start;
}

.admin-panel > .card > * {
  margin-top: 0;
  margin-bottom: 0;
}

.admin-user-item.readonly p {
  margin: 0;
  color: var(--text-soft);
}

.voice-clone-card {
  display: grid;
  gap: 18px;
}

.voice-clone-warning {
  border: 1px solid color-mix(in srgb, var(--warning) 34%, var(--border));
  background: color-mix(in srgb, var(--warning) 10%, var(--surface-strong));
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
}

.voice-clone-warning p {
  margin: 6px 0 0;
  color: var(--text-soft);
}

.voice-clone-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.voice-clone-method {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  padding: 16px;
  display: grid;
  gap: 12px;
}

.voice-clone-method-head {
  display: grid;
  gap: 4px;
}

.voice-clone-recorder {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: var(--surface-subtle);
}

.voice-clone-timer {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  color: var(--text);
}

.voice-clone-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.voice-clone-drop-zone {
  min-height: 120px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
}

.voice-clone-drop-zone.is-dragging,
.voice-clone-drop-zone:focus-visible {
  border-color: var(--accent);
  outline: 2px solid color-mix(in srgb, var(--accent) 22%, transparent);
  outline-offset: 2px;
}

.voice-clone-file-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.voice-clone-consent {
  align-items: flex-start;
  border-radius: var(--radius-sm);
  min-height: auto;
  padding: 12px;
}

.voice-clone-meta {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.voice-clone-meta dt,
.voice-clone-meta dd {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}

.voice-clone-meta dt {
  color: var(--text-muted);
  background: var(--surface-subtle);
  font-weight: 700;
}

.voice-clone-meta dd {
  color: var(--text);
  word-break: break-word;
}

.voice-clone-meta dt:nth-last-child(2),
.voice-clone-meta dd:last-child {
  border-bottom: 0;
}


.privacy-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-soft);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-height: 36px;
  padding: 0 12px;
}

.privacy-toggle input {
  accent-color: var(--accent);
}


.workspace-mode-tabs {
  margin: 4px 0 20px;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-subtle);
}

.workspace-status-row {
  margin: -4px 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.workspace-chip {
  min-height: 34px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-size: 0.84rem;
  font-weight: 600;
}

.workspace-chip.is-warning {
  background: color-mix(in srgb, var(--warning) 12%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--warning) 28%, var(--border));
  color: color-mix(in srgb, var(--warning) 92%, var(--text));
}

.workspace-chip.is-danger {
  background: color-mix(in srgb, var(--danger) 12%, var(--surface-strong));
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  color: color-mix(in srgb, var(--danger) 92%, var(--text));
}

.workspace-mode-btn {
  min-height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
  color: var(--text-soft);
}

.workspace-mode-btn.active {
  background: var(--surface-strong);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.mode-section {
  margin-top: 24px;
}

.mode-section-label {
  display: block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-weight: 700;
  color: var(--text-muted);
}

.mode-count {
  font-weight: 600;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

.label-optional {
  margin-left: 8px;
  font-size: 0.6em;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 700;
  color: var(--text-muted);
  vertical-align: middle;
}

.selected-agent-copy .btn {
  margin-top: 20px;
  align-self: flex-start;
}

.is-hidden {
  display: none !important;
}


.outbound-summary {
  margin-top: 14px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.outbound-summary div {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.outbound-summary span {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.outbound-summary strong {
  font-size: 0.92rem;
  color: var(--text);
}

/* Freigegebene Rufnummern: the released-number picker and the request form. */
.outbound-number-picker {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

/* The picker is a grid with its own gap; the label's own margin would double it. */
.outbound-number-picker .mode-section-label,
.outbound-number-picker .quiet-note {
  margin: 0;
}

.outbound-request {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.outbound-request .admin-users-list:empty {
  display: none;
}

/* A native multi-select is the release control: it is the plain "pick several
   users" affordance and needs no script to stay in sync with its own value.
   The second selector is not redundant -- it has to out-specify
   `.admin-user-actions .text-input { min-height: 40px }` above. */
.phone-release-select,
.admin-user-actions .phone-release-select {
  min-height: 104px;
  padding: 8px;
  line-height: 1.6;
}

/* Its own full-width row inside the actions grid, so a 104px control cannot
   stretch the single-line inputs beside it. */
.admin-user-actions .phone-release-select {
  grid-column: 1 / -1;
}

.phone-release-select option {
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}

@media (max-width: 720px) {
  .voice-clone-grid,
  .voice-clone-meta {
    grid-template-columns: 1fr;
  }

  .voice-clone-actions,
  .voice-clone-actions .btn {
    width: 100%;
  }
}

/* Post-simulation scorecard (Story 4.1 / D1). Spans the full workspace grid so
   the result sits above the session and conversation columns. */
.scorecard-card {
  grid-column: 1 / -1;
  padding: 32px;
}

.scorecard-card[hidden] { display: none; }

.scorecard-mode {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  display: grid;
  gap: 6px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.scorecard-mode.tone-sample {
  background: color-mix(in srgb, var(--warning) 10%, var(--surface-subtle));
  border-color: color-mix(in srgb, var(--warning) 30%, var(--border));
}

.scorecard-mode.tone-live {
  background: color-mix(in srgb, var(--accent) 8%, var(--surface-subtle));
  border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
}

/* Sits inside the session header, separated by a rule rather than by nothing:
   it used to be an unstyled div between the metric tiles and the evaluation. */
.scorecard-mode .scorecard-agent {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  overflow-wrap: anywhere;
}

.scorecard-mode span {
  color: var(--text-soft);
  font-size: 0.88rem;
  line-height: 1.55;
}

.scorecard-metrics {
  margin-top: 20px;
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.scorecard-metric {
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  display: grid;
  gap: 6px;
  align-content: start;
}

.scorecard-metric > span {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.scorecard-metric strong { font-size: 1.5rem; line-height: 1.2; }
.scorecard-metric small { color: var(--text-soft); font-size: 0.82rem; line-height: 1.5; }

.scorecard-metric.tone-danger { border-color: color-mix(in srgb, var(--danger) 34%, var(--border)); }
.scorecard-metric.tone-danger strong { color: color-mix(in srgb, var(--danger) 92%, var(--text)); }
.scorecard-metric.tone-warning { border-color: color-mix(in srgb, var(--warning) 34%, var(--border)); }
.scorecard-metric.tone-warning strong { color: color-mix(in srgb, var(--warning) 92%, var(--text)); }
.scorecard-metric.tone-success { border-color: color-mix(in srgb, var(--success, var(--accent)) 34%, var(--border)); }

.scorecard-talk { margin-top: 24px; }

.scorecard-talk-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.scorecard-talk-head span { font-weight: 600; }
.scorecard-talk-head small { color: var(--text-muted); font-size: 0.8rem; }

.scorecard-talk-bar {
  margin-top: 10px;
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.scorecard-talk-bar .assistant { background: var(--accent); }
.scorecard-talk-bar .participant { background: color-mix(in srgb, var(--warning) 70%, var(--accent)); }

.scorecard-talk-legend {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: var(--text-soft);
  font-size: 0.84rem;
}

.scorecard-talk-legend i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 6px;
}

.scorecard-talk-legend i.assistant { background: var(--accent); }
.scorecard-talk-legend i.participant { background: color-mix(in srgb, var(--warning) 70%, var(--accent)); }

.scorecard-rubric {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.scorecard-rubric h4 { font-size: 0.98rem; }

.scorecard-rubric ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.scorecard-rubric li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-soft);
}

.scorecard-rubric li strong { color: var(--text); }

.scorecard-moments-block { margin-top: 24px; }
.scorecard-moments-block h4 { font-size: 0.98rem; }

.scorecard-moments {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.scorecard-moments li {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  border-left-width: 4px;
}

.scorecard-moments li.tone-danger { border-left-color: var(--danger); }
.scorecard-moments li.tone-warning { border-left-color: var(--warning); }
.scorecard-moments li.tone-success { border-left-color: var(--success, var(--accent)); }
.scorecard-moments li.tone-neutral { border-left-color: var(--border); }

.scorecard-moment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.scorecard-moment-head .time { color: var(--text-muted); font-size: 0.8rem; }

.scorecard-moment-context,
.scorecard-moment-text {
  margin: 10px 0 0;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.scorecard-moment-context { color: var(--text-muted); font-size: 0.86rem; }

.scorecard-moment-context span,
.scorecard-moment-text span {
  display: inline-block;
  margin-right: 8px;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.scorecard-empty {
  margin-top: 12px;
  padding: 18px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  border: 1px dashed var(--border);
  color: var(--text-soft);
}

.quiet-note.tiny {
  margin-top: 12px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .scorecard-card { padding: 24px; }
  .scorecard-metrics { grid-template-columns: 1fr; }
}

/* Vapi analysis block on the session card (Story 4.2 client surface). */
.scorecard-analysis {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--surface-subtle);
}
.scorecard-analysis h4 { margin: 0 0 8px; font-size: 1rem; }
.scorecard-analysis p { margin: 0 0 6px; color: var(--text-soft); }
.scorecard-analysis.is-pending { border-color: color-mix(in srgb, var(--accent) 32%, var(--border)); }
.scorecard-analysis.is-muted { opacity: 0.85; }
.scorecard-analysis-verdict strong { color: var(--text); }
/* A definition list of labelled rows, not a JSON dump: this is on screen while a
   prospect is looking at it. `white-space: pre` and the monospace feel are gone
   with the <pre> that used to be here. */
.scorecard-analysis-data {
  margin: 10px 0 0;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
  display: grid;
  gap: 1px;
}

.scorecard-data-row {
  display: grid;
  grid-template-columns: minmax(140px, 34%) 1fr;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

.scorecard-data-row:last-child { border-bottom: 0; }

.scorecard-data-row dt {
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 600;
  /* The label comes from the operator's schema, so it can be a long phrase. */
  overflow-wrap: anywhere;
}

.scorecard-data-row dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

/* ---------- scenario guide + readiness ---------- */

.heading-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.scenario-guide {
  margin: 12px 0 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
}

.scenario-guide[hidden] { display: none; }
.scenario-guide h3 { margin: 0 0 10px; font-size: 1rem; }

.scenario-guide-list { margin: 0 0 12px; padding-left: 1.3em; max-width: 74ch; }
.scenario-guide-list li { margin-bottom: 10px; line-height: 1.55; }
.scenario-guide-list li:last-child { margin-bottom: 0; }

.agent-readiness { margin-top: 10px; }

.agent-readiness-report:empty { display: none; }

.readiness-headline { margin: 8px 0 6px; font-weight: 600; }
.readiness-headline.is-ok { color: var(--success, #2c6242); }
.readiness-headline.is-fail { color: var(--danger, #a1362a); }

.readiness-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.readiness-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 10px;
  align-items: baseline;
  padding: 6px 0;
  border-top: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
}

/* The level is a word, not only a colour: this list is read by whoever has to fix
   it, and "Achtung" vs "Fehlt" is the difference between "works but will bite"
   and "does not work at all". */
.readiness-level {
  font-family: var(--mono, monospace);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.readiness-item.tone-ok .readiness-level { color: var(--success, #2c6242); }
.readiness-item.tone-warn .readiness-level { color: var(--warning, #8a5a12); }
.readiness-item.tone-fail .readiness-level { color: var(--danger, #a1362a); }

.readiness-title { font-weight: 550; }
.readiness-item p {
  grid-column: 2;
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--text-soft);
  max-width: 72ch;
}

/* ---------- session history ---------- */

.history-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-subtle);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.history-item:last-child { margin-bottom: 0; }

.history-item header {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.history-item header > span:first-child { font-weight: 600; }

.history-meta {
  color: var(--text-soft);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* The expanded record. Separated by a rule so the evaluation of the session
   being read cannot be mistaken for a property of the row above it. */
.history-detail {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}

.history-item.is-open { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }

/* What a counted row counted. Set below the value, not beside it: a number is
   read as a grade unless the card says what would have raised it. */
.scorecard-data-note {
  display: block;
  margin-top: 4px;
  color: var(--text-soft);
  font-size: 0.78rem;
  line-height: 1.45;
  max-width: 68ch;
}

/* A 'ready' evaluation whose every field was written against an older catalogue:
   the heading survives the filter, the values do not. */
.scorecard-analysis-note {
  margin: 6px 0 0;
  color: var(--text-soft);
  font-size: 0.85rem;
}

@media (max-width: 720px) {
  .scorecard-data-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
.scorecard-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }
.scorecard-analysis-transcript { margin-top: 12px; }
.scorecard-analysis-transcript summary { cursor: pointer; font-weight: 600; color: var(--text-soft); }
.scorecard-analysis-transcript ol { margin: 10px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.scorecard-analysis-transcript li {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}
.scorecard-analysis-transcript li.tone-participant { border-color: color-mix(in srgb, var(--accent) 30%, var(--border)); }
.scorecard-analysis-transcript li span {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.scorecard-analysis-transcript li p { margin: 4px 0 0; }
