/* Tech 42 Voice Agent — styles */

:root {
  --t42-navy: #003459;
  --t42-azure: #00A8E8;
  --t42-orange: #FF9800;
  --t42-charcoal: #20262A;
  --t42-smoke: #F8F7F9;

  --t42-mineral: #1B649D;
  --t42-sky: #5BCFFA;
  --t42-mist: #CCEDFA;
  --t42-powder: #E5F6FC;

  --t42-success: #66A540;
  --t42-error: #F03D1D;

  --t42-font: 'Instrument Sans', 'Inter', system-ui, -apple-system, sans-serif;

  --t42-radius: 14px;
  --t42-radius-sm: 10px;
  --t42-shadow-card: 0 1px 0 rgba(15, 23, 42, .02), 0 1px 3px rgba(15, 23, 42, .04), 0 4px 12px rgba(15, 23, 42, .04);
  --t42-shadow-card-hover: 0 1px 0 rgba(15, 23, 42, .02), 0 6px 14px rgba(0, 52, 89, .08), 0 16px 32px rgba(0, 52, 89, .08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--t42-smoke);
  color: var(--t42-charcoal);
  font-family: var(--t42-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button { font-family: inherit; cursor: pointer; touch-action: manipulation; }
input, textarea { font-family: inherit; color: inherit; }
textarea { resize: vertical; }

:where(button, a, [tabindex]):focus-visible {
  outline: 2px solid var(--t42-azure);
  outline-offset: 2px;
  border-radius: 4px;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* subtle ambient background — keeps the page feeling "product" not "form" */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% -10%, rgba(0, 168, 232, .08), transparent 60%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(0, 52, 89, .04), transparent 60%);
  pointer-events: none;
  z-index: 0;
}

/* ───────── Floating chrome ───────── */

.chrome {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  pointer-events: none;
  gap: 16px;
  background: rgba(248, 247, 249, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.chrome > * { pointer-events: auto; }
.chrome-left, .chrome-right {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.brand-logo {
  display: block;
  height: 30px;
  width: auto;
}
.brand-sub {
  font-size: 11px;
  color: #6b757d;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding-left: 12px;
  border-left: 1px solid #d8dde2;
}

.link-btn {
  background: #fff;
  border: 1px solid var(--t42-mist);
  color: var(--t42-mineral);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
  box-shadow: var(--t42-shadow-card);
}
.link-btn:hover { color: var(--t42-azure); border-color: var(--t42-sky); }

.cta-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--t42-navy);
  color: #fff;
  text-decoration: none;
  border: none;
  padding: 9px 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s ease, transform .08s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,.1) inset, 0 8px 18px rgba(0, 52, 89, .25);
}
.cta-pill:hover { background: #002744; }
.cta-label-short { display: none; }

/* ───────── Main layout ───────── */

.main {
  flex: 1;
  display: flex;
  width: 100%;
  position: relative;
  z-index: 1;
}
.main-select { padding: 24px 28px 40px; justify-content: center; }
.main-session {
  padding: 12px 28px 24px;
  justify-content: center;
  align-items: flex-start;
  min-height: 0;
}

/* ───────── Scenario select ───────── */

.select-wrap { width: 100%; max-width: 1080px; }
.select-head { text-align: center; margin: 24px 0 28px; }
.select-head h1 {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--t42-charcoal);
  margin: 0 0 10px;
  text-wrap: pretty;
}
.select-head p {
  color: #5e6a72;
  margin: 0;
  font-size: 16px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;
  gap: 18px;
  align-items: stretch;
}

/* card base */
.card {
  background: #fff;
  border: 1px solid var(--t42-mist);
  border-radius: var(--t42-radius);
  box-shadow: var(--t42-shadow-card);
  position: relative;
  text-align: left;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
  overflow: hidden;
  height: 100%;
}
.card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--t42-azure);
  opacity: 0;
  transition: opacity .15s ease;
}
.card:hover::before { opacity: 1; }

.scenario-card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px 20px;
  min-height: 240px;
  width: 100%;
  font: inherit;
  color: inherit;
  cursor: pointer;
  border-width: 1px;
  background: #fff;
}
.scenario-card:hover {
  box-shadow: var(--t42-shadow-card-hover);
  transform: translateY(-1px);
}

.card-icon {
  display: inline-flex;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  background: var(--t42-powder);
  margin-bottom: 18px;
  color: var(--t42-navy);
  flex-shrink: 0;
}
.card-body { flex: 1; min-height: 0; }
.card-badge {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t42-mineral);
  font-weight: 600;
  margin-bottom: 10px;
}
.card-title {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--t42-charcoal);
  margin: 0 0 8px;
  line-height: 1.3;
  text-wrap: balance;
}
.card-desc {
  font-size: 13.5px;
  line-height: 1.5;
  color: #5e6a72;
  margin: 0;
  text-wrap: pretty;
}
.card-cta {
  margin-top: 18px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--t42-navy);
  opacity: .65;
  transition: opacity .15s ease, gap .15s ease, color .15s ease;
}
.scenario-card:hover .card-cta { opacity: 1; gap: 9px; color: var(--t42-azure); }

/* custom expanded */
.custom-expanded {
  padding: 24px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-color: var(--t42-azure);
  box-shadow: var(--t42-shadow-card-hover);
}
.custom-expanded::before { opacity: 1; }
.custom-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: 12px;
}
.custom-head .card-icon { margin-bottom: 0; }
.custom-head .card-title { margin-bottom: 0; }
.custom-close {
  background: none;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #5e6a72;
  transition: background .12s ease, color .12s ease;
}
.custom-close:hover { background: var(--t42-smoke); color: var(--t42-charcoal); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--t42-charcoal);
  display: flex;
  gap: 6px;
  align-items: baseline;
}
.field-label em {
  font-style: normal;
  font-weight: 400;
  font-size: 11px;
  color: #8a94a0;
}
.field textarea, .field input[type=text] {
  width: 100%;
  border: 1px solid #d8dde2;
  border-radius: var(--t42-radius-sm);
  padding: 10px 12px;
  font-size: 13.5px;
  background: #fff;
  color: var(--t42-charcoal);
  transition: border-color .12s ease, box-shadow .12s ease;
  outline: none;
  font-family: inherit;
}
.field textarea:focus, .field input[type=text]:focus {
  border-color: var(--t42-azure);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, .15);
}
.advanced-toggle {
  background: none;
  border: none;
  color: var(--t42-mineral);
  font-size: 12.5px;
  font-weight: 600;
  padding: 2px 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
}
.advanced-toggle svg { transition: transform .15s ease; }
.advanced-toggle.open svg { transform: rotate(90deg); }
.advanced-toggle:hover { color: var(--t42-azure); }

.btn-primary {
  background: var(--t42-navy);
  color: #fff;
  border: none;
  padding: 11px 18px;
  border-radius: var(--t42-radius-sm);
  font-weight: 600;
  font-size: 13.5px;
  transition: background .12s ease, transform .08s ease;
  align-self: flex-start;
}
.btn-primary:hover:not(:disabled) { background: #002744; }
.btn-primary:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { background: #c3cdd4; cursor: not-allowed; }

.entry-foot {
  margin-top: 32px;
  text-align: center;
  color: #6b757d;
  font-size: 14px;
}
.link-inline {
  appearance: none;
  background: transparent;
  border: 0;
  border-bottom: 1px solid transparent;
  color: var(--t42-azure);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  margin-left: 8px;
  padding: 0;
  text-decoration: none;
  transition: border-color .15s ease;
}
.link-inline:hover { border-bottom-color: var(--t42-azure); }

/* ───────── Pipeline picker ───────── */

.pipeline {
  position: relative;
  width: 100%;
  max-width: 480px;
}
.pipeline-trigger {
  width: 100%;
  background: #fff;
  border: 1px solid var(--t42-mist);
  border-radius: 12px;
  padding: 10px 14px 10px 16px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  text-align: left;
  box-shadow: var(--t42-shadow-card);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.pipeline-trigger:hover { border-color: var(--t42-sky); }
.pipeline.open .pipeline-trigger {
  border-color: var(--t42-azure);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, .12);
}
.pipeline-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8a94a0;
  font-weight: 600;
}
.pipeline-value { display: flex; flex-direction: column; min-width: 0; }
.pipeline-value-main {
  font-size: 14px;
  font-weight: 600;
  color: var(--t42-charcoal);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipeline-value-sub {
  font-size: 12px;
  color: #6b757d;
  margin-top: 1px;
}
.pipeline-caret {
  color: #6b757d;
  transition: transform .15s ease;
}
.pipeline.open .pipeline-caret { transform: rotate(180deg); }

.pipeline-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--t42-mist);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0, 52, 89, .12);
  padding: 6px;
  list-style: none;
  margin: 0;
  z-index: 40;
}
.pipeline-menu li {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 10px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.pipeline-menu li:hover { background: var(--t42-powder); }
.pipeline-menu li.selected { background: var(--t42-powder); }
.pipeline-opt-main {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--t42-charcoal);
}
.pipeline-opt-sub {
  font-size: 12px;
  color: #6b757d;
  grid-column: 1;
}
.pipeline-opt-check {
  color: var(--t42-azure);
  grid-row: 1 / span 2;
  grid-column: 2;
}

/* ───────── Conversation ───────── */

.conv-wrap {
  width: 100%;
  max-width: 680px;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.conv-context {
  display: flex;
  align-items: center;
  margin-bottom: 14px;
  padding: 0 4px;
  gap: 10px;
  flex-wrap: wrap;
}
.ctx-tag {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--t42-mineral);
  background: var(--t42-powder);
  border-radius: 4px;
  padding: 3px 7px;
}
.ctx-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--t42-charcoal);
}
.ctx-sep { color: #c8d0d6; }
.ctx-pipeline {
  font-size: 12.5px;
  color: #6b757d;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.conv-panel {
  background: #fff;
  border: 1px solid var(--t42-mist);
  border-radius: 16px;
  box-shadow: var(--t42-shadow-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: clamp(360px, calc(100dvh - 190px), 620px);
  min-height: 0;
}
.conv-scroll {
  padding: 24px 24px 12px;
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.session-overview {
  margin: auto;
  width: min(100%, 520px);
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 18px;
  align-items: start;
  padding: 22px;
  border: 1px solid var(--t42-mist);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(229, 246, 252, .42), rgba(255, 255, 255, .9));
  box-shadow: 0 12px 32px rgba(0, 52, 89, .06);
}
.session-overview-icon {
  display: inline-flex;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  align-items: center;
  justify-content: center;
  background: var(--t42-powder);
  color: var(--t42-navy);
}
.session-overview-copy {
  min-width: 0;
}
.session-overview-badge {
  display: inline-block;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--t42-mineral);
  font-weight: 600;
  margin: 0 0 8px;
}
.session-overview-title {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 600;
  color: var(--t42-charcoal);
  text-wrap: balance;
}
.session-overview-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: #5e6a72;
  text-wrap: pretty;
}

.msg { display: flex; flex-direction: column; max-width: 84%; gap: 5px; }
.msg-user { align-self: flex-end; align-items: flex-end; }
.msg-agent { align-self: flex-start; align-items: flex-start; }
.msg-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8a94a0;
}
.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.55;
  text-wrap: pretty;
}
.msg-user .msg-bubble {
  background: var(--t42-navy);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-agent .msg-bubble {
  background: var(--t42-powder);
  color: var(--t42-charcoal);
  border-bottom-left-radius: 4px;
}

.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--t42-mineral);
  opacity: .55;
  animation: typing-bounce 1.2s infinite ease-in-out;
}
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: .35; }
  40% { transform: translateY(-4px); opacity: .9; }
}

/* Speaking card */
.speak {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 24px;
  background: var(--t42-smoke);
  border-top: 1px solid var(--t42-mist);
  border-bottom: 1px solid var(--t42-mist);
  transition: background .25s ease;
  flex: 0 0 auto;
}
.speak-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--t42-charcoal);
  line-height: 1.2;
}
.speak-sub {
  font-size: 12.5px;
  color: #6b757d;
  margin-top: 3px;
}
.speak-agent {
  background: linear-gradient(180deg, rgba(229, 246, 252, .55), rgba(229, 246, 252, .25));
}
.speak-user {
  background: linear-gradient(180deg, rgba(0, 168, 232, .08), rgba(0, 168, 232, .03));
}
.speak-idle {
  background: var(--t42-smoke);
}

.speak-dot {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--t42-azure);
  flex-shrink: 0;
}
.speak-dot::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: var(--t42-azure);
  opacity: .25;
  animation: speak-pulse 1.4s ease-out infinite;
}
.speak-dot-idle {
  background: var(--t42-success);
}
.speak-dot-idle::after {
  background: var(--t42-success);
  animation-duration: 2.6s;
  opacity: .18;
}
@keyframes speak-pulse {
  0% { transform: scale(.85); opacity: .35; }
  100% { transform: scale(2); opacity: 0; }
}

/* Voice wave */
.wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 28px;
  flex-shrink: 0;
}
.wave span {
  display: inline-block;
  width: 4px;
  height: 100%;
  border-radius: 3px;
  background: var(--t42-navy);
  transform-origin: center;
  transform: scaleY(0.35);
}
.wave.active span { animation: wave-bounce 1.05s ease-in-out infinite; }
.wave.active span:nth-child(1) { animation-delay: -.5s; }
.wave.active span:nth-child(2) { animation-delay: -.3s; }
.wave.active span:nth-child(3) { animation-delay: -.7s; }
.wave.active span:nth-child(4) { animation-delay: -.1s; }
.wave.active span:nth-child(5) { animation-delay: -.4s; }
@keyframes wave-bounce {
  0%, 100% { transform: scaleY(.32); }
  50% { transform: scaleY(1); }
}

/* Inject */
.conv-inject {
  display: flex;
  gap: 10px;
  padding: 16px;
  align-items: center;
  background: #fff;
}
.conv-inject input {
  flex: 1;
  border: 1px solid #d8dde2;
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 14px;
  background: var(--t42-smoke);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease, background .12s ease;
}
.conv-inject input:focus {
  border-color: var(--t42-azure);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 168, 232, .15);
}
.btn-send {
  background: var(--t42-navy);
  color: #fff;
  border: none;
  padding: 11px 18px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
}
.btn-send:disabled { background: #c3cdd4; cursor: not-allowed; }
.btn-send:hover:not(:disabled) { background: #002744; }

/* ───────── Session start gate ───────── */

.session-start {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 28px 24px;
  background: var(--t42-smoke);
  border-top: 1px solid var(--t42-mist);
  flex: 0 0 auto;
}

.session-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--t42-navy);
  color: #fff;
  border: none;
  padding: 14px 32px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
  box-shadow: 0 4px 16px rgba(0, 52, 89, .30), 0 1px 0 rgba(255,255,255,.1) inset;
}
.session-start-btn:hover {
  background: #002744;
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 52, 89, .38), 0 1px 0 rgba(255,255,255,.1) inset;
}
.session-start-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0, 52, 89, .22);
}

.session-start-hint {
  margin: 0;
  font-size: 12px;
  color: #8a94a0;
}

/* Status dots (context strip) */
.status-dot {
  position: relative;
  width: 9px;
  height: 9px;
  display: inline-block;
}
.status-dot-core {
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  background: var(--t42-success);
}
.status-dot-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--t42-success);
  opacity: .35;
}
.status-connecting .status-dot-core { background: var(--t42-orange); }
.status-connecting .status-dot-ring {
  background: var(--t42-orange);
  animation: status-pulse 1.6s ease-out infinite;
}
@keyframes status-pulse {
  0% { transform: scale(1); opacity: .55; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ───────── Behind the scenes ───────── */

.bts { margin-top: 20px; }
.bts-toggle-row { padding: 4px 6px; }
.bts-toggle {
  background: none;
  border: none;
  color: var(--t42-mineral);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bts-toggle:hover { color: var(--t42-azure); }
.bts-hint {
  font-weight: 400;
  color: #8a94a0;
  font-size: 12px;
  margin-left: 4px;
}

.bts-content {
  margin-top: 12px;
  background: #fff;
  border: 1px solid var(--t42-mist);
  border-radius: 14px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: var(--t42-shadow-card);
}
.bts-pipeline-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.bts-pipeline-row .pipeline {
  max-width: 460px;
  flex: 1 1 320px;
}
.bts-pipeline-hint {
  font-size: 12px;
  color: #8a94a0;
  flex: 1 1 auto;
  min-width: 0;
}
.bts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.bts-field-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8a94a0;
  font-weight: 600;
  margin-bottom: 4px;
}
.bts-field-value { font-size: 13.5px; color: var(--t42-charcoal); }
.bts-field-value.mono {
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
}
.bts-field-value.pill {
  display: inline-block;
  background: var(--t42-powder);
  color: var(--t42-mineral);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 11.5px;
  text-transform: capitalize;
}
.bts-field-block .bts-field-value {
  background: var(--t42-smoke);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #ececec;
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.55;
  color: #3a4148;
  white-space: pre-wrap;
}

/* Editable prompts */
.bts-edit {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--t42-smoke);
  border: 1px solid #ececec;
  border-radius: 10px;
}
.bts-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.bts-edit-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--t42-charcoal);
}
.bts-edit-sub {
  font-size: 12px;
  color: #6b757d;
  margin-top: 2px;
}
.bts-edit-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.bts-edit-field { display: flex; flex-direction: column; gap: 5px; }
.bts-edit-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8a94a0;
  font-weight: 600;
}
.bts-textarea {
  width: 100%;
  border: 1px solid #d8dde2;
  border-radius: 8px;
  padding: 10px 12px;
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  background: #fff;
  color: var(--t42-charcoal);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.bts-textarea:focus {
  border-color: var(--t42-azure);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, .15);
}

.btn-primary-sm {
  padding: 7px 12px;
  font-size: 12.5px;
  border-radius: 8px;
}
.btn-ghost {
  background: transparent;
  border: 1px solid #d8dde2;
  color: var(--t42-charcoal);
  padding: 7px 12px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 12.5px;
  transition: background .12s ease, border-color .12s ease;
}
.btn-ghost:hover { background: #fff; border-color: #c0c8cf; }

.bts-log { display: flex; flex-direction: column; }
.bts-log-head {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #8a94a0;
  font-weight: 600;
  margin-bottom: 6px;
}
.bts-log-body {
  background: #0c1116;
  color: #cfe4d3;
  border-radius: 8px;
  padding: 12px 14px;
  font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  max-height: 220px;
  overflow-y: auto;
}
.bts-log-row {
  display: grid;
  grid-template-columns: 90px 60px 1fr;
  gap: 10px;
}
.bts-log-time { color: #7e8c95; }
.bts-log-kind-info { color: #5BCFFA; }
.bts-log-kind-turn { color: #FF9800; }
.bts-log-kind-warn { color: #F03D1D; }
.bts-log-msg { color: #d6e6da; }

/* ───────── Responsive ───────── */

@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .bts-grid { grid-template-columns: repeat(2, 1fr); }
  .chrome { padding: 16px 18px; }
  .select-head h1 { font-size: 30px; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .select-head { margin: 12px 0 20px; }
  .select-head h1 { font-size: 26px; }
  .main-select { padding: 16px 18px calc(40px + env(safe-area-inset-bottom)); }
  .main-session { padding: 8px 14px calc(20px + env(safe-area-inset-bottom)); }
  .scenario-card { min-height: 0; padding: 20px 18px 18px; }
  .card-icon { margin-bottom: 14px; }
  .chrome { padding: 12px 14px; gap: 8px; }
  .link-btn .btn-label { display: none; }
  .link-btn { padding: 8px 10px; }
  .gx-end-session-btn { display: none; }
  .cta-label-full { display: none; }
  .cta-label-short { display: inline; }
  .conv-panel { height: clamp(300px, calc(100dvh - 150px), 560px); }
  .conv-scroll { padding: 18px 18px 10px; gap: 14px; }
  .msg { max-width: 92%; }
  .bts-content { padding: 14px; }
  .bts-edit { padding: 12px; }
  .session-overview {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px;
  }
  .session-overview-icon {
    width: 48px;
    height: 48px;
  }
  .session-overview-title { font-size: 17px; }
  .gx-form-two { grid-template-columns: 1fr; }
  .speak { padding: 14px 18px; }
  .session-start { padding: 24px 18px; }
  .bts-grid { grid-template-columns: 1fr; }
  .bts-log-row { grid-template-columns: 80px 50px 1fr; }
  .brand-sub { display: none; }
  .brand-logo { height: 26px; }
  .cta-pill svg { display: none; }
}

/* ───────── Gating and CTA overlays ───────── */

.gx-modal-scrim {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(8, 24, 38, .54);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: gx-fade-in .18s ease-out;
}
@keyframes gx-fade-in { from { opacity: 0; } to { opacity: 1; } }

.gx-modal {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  background: #fff;
  border-radius: 18px;
  padding: 28px 28px 24px;
  box-shadow: 0 30px 80px rgba(0, 52, 89, .28), 0 8px 20px rgba(0, 52, 89, .14);
  animation: gx-rise .22s cubic-bezier(.2,.7,.2,1);
}
@keyframes gx-rise {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.gx-modal-narrow { max-width: 420px; }
.gx-modal-wide   { max-width: 560px; }

.gx-modal-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b757d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, color .12s ease;
}

.gx-modal-x:hover { background: #f1f3f5; color: var(--t42-navy); }
.gx-modal-title {
  margin: 0 0 8px;
  color: var(--t42-navy);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
}
.gx-modal-lede {
  margin: 0 0 18px;
  max-width: 480px;
  color: #5e6a72;
  font-size: 14px;
  line-height: 1.55;
}

.gx-form-grid { display: flex; flex-direction: column; gap: 18px; }
.gx-form-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.gx-field { display: flex; flex-direction: column; gap: 8px; }
.gx-field-label { color: var(--t42-navy); font-size: 13px; font-weight: 600; }
.gx-field input,
.gx-field textarea {
  width: 100%;
  border: 1px solid #d8dde2;
  border-radius: 10px;
  padding: 11px 14px;
  background: #fff;
  color: var(--t42-charcoal);
  font-size: 14px;
  outline: none;
}
.gx-field input:focus,
.gx-field textarea:focus {
  border-color: var(--t42-azure);
  box-shadow: 0 0 0 3px rgba(0, 168, 232, .15);
}
.gx-check {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  color: #5e6a72;
  font-size: 13px;
  line-height: 1.45;
}
.gx-check input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--t42-navy);
}
.gx-form-error {
  color: var(--t42-error);
  background: #fff3f0;
  border: 1px solid #ffd4cc;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.4;
}
.gx-form-actions { display: flex; justify-content: flex-end; }

.gx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s ease, color .12s ease, border-color .12s ease, transform .08s ease;
}
.gx-btn:active:not(:disabled) { transform: translateY(1px); }
.gx-btn:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}
.gx-btn-primary { background: var(--t42-navy); color: #fff; }
.gx-btn-primary:hover:not(:disabled) { background: #002744; }
.gx-btn-primary:disabled { background: #c3cdd4; cursor: not-allowed; }
.gx-btn-ghost {
  background: transparent;
  color: var(--t42-charcoal);
  border: 1px solid #d8dde2;
}
.gx-btn-ghost:hover { background: #f8f9fa; border-color: #c0c8cf; }
.gx-btn-lg { padding: 13px 20px; font-size: 14.5px; }

.gx-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--t42-azure);
  font: inherit;
  font-weight: 600;
}
.gx-link:hover { text-decoration: underline; }

.gx-nudge {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 10px 0 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--t42-mist);
  border-left: 3px solid var(--t42-azure);
  border-radius: 12px;
  box-shadow: var(--t42-shadow-card);
}
.gx-nudge-icon {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--t42-powder);
  color: var(--t42-mineral);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.gx-nudge-body { flex: 1; min-width: 0; }
.gx-nudge-title {
  margin-bottom: 1px;
  color: var(--t42-navy);
  font-size: 13px;
  font-weight: 600;
}
.gx-nudge-sub { color: #5e6a72; font-size: 12.5px; line-height: 1.5; }
.gx-nudge-x {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #8a94a0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .12s ease, color .12s ease;
}
.gx-nudge-x:hover { background: #f1f3f5; color: var(--t42-navy); }

.gx-end-session-btn {
  background: transparent;
  border: 1px solid #d8dde2;
  color: #5e6a72;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.gx-end-session-btn:hover {
  background: #fff;
  color: var(--t42-error);
  border-color: #f0c5bb;
}

.ctx-copy {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.ctx-end-btn {
  flex: 0 0 auto;
  border: 1px solid #f0c5bb;
  background: #fff;
  color: var(--t42-error);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--t42-shadow-card);
  transition: background .12s ease, border-color .12s ease, transform .12s ease;
}
.ctx-end-btn:hover { background: #fff7f5; border-color: #e99d8d; }
.ctx-end-btn:active { transform: translateY(1px); }

.gx-end {
  width: 100%;
  max-width: 600px;
  align-self: center;
  margin: 24px auto;
  padding: 32px 32px 28px;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
  border: 1px solid #e8eaee;
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0, 52, 89, .08), 0 1px 0 rgba(15, 23, 42, .02);
}
.gx-end-tag {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  color: var(--t42-navy);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.gx-end-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.gx-end-dot--user { background: var(--t42-success); }
.gx-end-dot--cap  { background: var(--t42-orange); }
.gx-end-meta { color: #8a94a0; font-weight: 500; letter-spacing: .04em; text-transform: none; }
.gx-end-title {
  margin: 0 0 10px;
  color: var(--t42-navy);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0;
}
.gx-end-title em {
  background: linear-gradient(180deg, transparent 60%, rgba(0, 168, 232, .25) 60%);
  font-style: normal;
  padding: 0 4px;
}
.gx-end-lede {
  margin: 0 0 22px;
  max-width: 480px;
  color: #5e6a72;
  font-size: 15px;
  line-height: 1.55;
}
.gx-estimate {
  display: grid;
  grid-template-columns: minmax(150px, .85fr) 1fr;
  gap: 18px;
  align-items: center;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid #d5edf7;
  border-radius: 10px;
  background: #f6fbfe;
}
.gx-estimate-kicker {
  color: var(--t42-mineral);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.gx-estimate-total {
  margin-top: 4px;
  color: var(--t42-navy);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}
.gx-estimate-note {
  margin-top: 6px;
  color: #6b7784;
  font-size: 12.5px;
  line-height: 1.35;
}
.gx-estimate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.gx-estimate-grid div {
  min-width: 0;
  padding: 9px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #e4eef4;
}
.gx-estimate-grid span {
  display: block;
  color: #7a8794;
  font-size: 11px;
  font-weight: 600;
}
.gx-estimate-grid strong {
  display: block;
  margin-top: 3px;
  color: var(--t42-charcoal);
  font-size: 14px;
}
.gx-estimate-detail {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-top: 2px;
}
.gx-estimate-detail-section {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid #dcebf3;
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}
.gx-estimate-detail-title {
  margin-bottom: 8px;
  color: var(--t42-navy);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.gx-estimate-rate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 10px;
  padding: 7px 0;
  border-top: 1px solid #edf4f8;
}
.gx-estimate-rate-row:first-of-type { border-top: 0; padding-top: 0; }
.gx-estimate-rate-row span {
  min-width: 0;
  color: #6b7784;
  font-size: 12px;
}
.gx-estimate-rate-row strong {
  color: var(--t42-charcoal);
  font-size: 12.5px;
  font-weight: 700;
}
.gx-estimate-rate-row em {
  grid-column: 1 / -1;
  color: #89949e;
  font-size: 11.5px;
  font-style: normal;
}
.gx-end-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 24px;
  padding: 0;
}
.gx-end-list li { display: flex; gap: 14px; align-items: flex-start; }
.gx-end-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--t42-navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
}
.gx-end-h { color: var(--t42-navy); font-size: 14.5px; font-weight: 600; }
.gx-end-p { color: #5e6a72; font-size: 13.5px; line-height: 1.5; }
.gx-end-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 20px;
  border-top: 1px solid #eef0f3;
}
.gx-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 0 4px;
}
.gx-success-mark {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--t42-success);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  font-size: 28px;
  font-weight: 700;
}

/* ───────── Cap warning chip ───────── */

.gx-cap-warn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 152, 0, .12);
  color: #8a5500;
  border: 1px solid rgba(255, 152, 0, .25);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .02em;
}
.gx-cap-warn-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--t42-orange);
  box-shadow: 0 0 0 3px rgba(255, 152, 0, .25);
  flex-shrink: 0;
}

/* ───────── Nudge slide-in ───────── */

.gx-nudge {
  animation: gx-nudge-in .35s cubic-bezier(.2,.7,.2,1);
}
@keyframes gx-nudge-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ───────── Responsive ───────── */

@media (max-width: 720px) {
  .gx-end { padding: 24px 22px 22px; margin: 16px auto; }
  .gx-end-title { font-size: 26px; }
  .gx-estimate { grid-template-columns: 1fr; }
  .gx-estimate-detail { grid-template-columns: 1fr; }
  .gx-modal { padding: 24px 22px 20px; }
  .gx-modal-title { font-size: 20px; }
}

/* ───────── Mobile: modals as bottom sheets, 16px inputs (prevents iOS focus zoom) ───────── */

@media (max-width: 640px) {
  .gx-modal-scrim {
    padding: 0;
    align-items: flex-end;
  }
  .gx-modal,
  .gx-modal-wide,
  .gx-modal-narrow {
    max-width: none;
    max-height: calc(100dvh - 32px);
    border-radius: 18px 18px 0 0;
    padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  }

  .gx-field input,
  .gx-field textarea,
  .field input[type=text],
  .field textarea,
  .conv-inject input,
  .bts-textarea {
    font-size: 16px;
  }
}

/* ───────── Connecting state ───────── */

.speak-connecting {
  background: linear-gradient(180deg, rgba(229, 246, 252, .35), rgba(229, 246, 252, .15));
}

.speak-spinner {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--t42-mist);
  border-top-color: var(--t42-azure);
  animation: spin .75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── Session error ───────── */

.session-start-error {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--t42-error);
  background: #fff3f0;
  border: 1px solid #ffd4cc;
  border-radius: 8px;
  padding: 10px 14px;
  text-align: center;
  max-width: 400px;
}

/* ───────── Touch target expansion ───────── */

/* Expand hit area without changing visual size */
.gx-nudge-x,
.gx-modal-x {
  position: relative;
}
.gx-nudge-x::after,
.gx-modal-x::after {
  content: "";
  position: absolute;
  inset: -10px;
}

/* End session button — larger touch target on mobile */
@media (max-width: 640px) {
  .ctx-end-btn {
    min-height: 44px;
    padding: 10px 16px;
    font-size: 13px;
  }
}

/* ───────── Reduced motion ───────── */

@media (prefers-reduced-motion: reduce) {
  .wave.active span,
  .typing span,
  .speak-dot::after,
  .speak-spinner,
  .status-dot-ring {
    animation: none;
  }
  .wave.active span {
    transform: scaleY(0.75);
  }
}
