:root {
  --bg: #f8f9fb;
  --bg-elev: #ffffff;
  --bg-soft: #f1f3f8;
  --text: #0b0b10;
  --text-muted: #5b5b6b;
  --brand: #0a2540; /* dark blue */
  --brand-2: #0ea5e9; /* azure */
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --border: #e8e8ee;
  --chip: #eef0f7;
  --card-shadow: 0 8px 28px rgba(18,18,34,.06);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 0 rgba(0,0,0,.03) inset, 0 1px 8px rgba(18,18,34,.08);
  --shadow-md: 0 1px 0 rgba(0,0,0,.03) inset, 0 6px 24px rgba(18,18,34,.12);
  --shadow-lg: 0 1px 0 rgba(0,0,0,.03) inset, 0 12px 40px rgba(18,18,34,.16);
  --focus: 0 0 0 3px rgba(14, 165, 233, .25);
  --focus-strong: 0 0 0 4px rgba(14, 165, 233, .35);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f8f9fb;
    --bg-elev: #ffffff;
    --bg-soft: #f1f3f8;
    --text: #0b0b10;
    --text-muted: #5b5b6b;
    --brand: #0a2540;
    --brand-2: #0ea5e9;
    --border: #e8e8ee;
    --chip: #eef0f7;
    --card-shadow: 0 8px 28px rgba(18,18,34,.06);
    --shadow-sm: 0 1px 0 rgba(0,0,0,.03) inset, 0 1px 8px rgba(18,18,34,.08);
    --shadow-md: 0 1px 0 rgba(0,0,0,.03) inset, 0 6px 24px rgba(18,18,34,.12);
    --shadow-lg: 0 1px 0 rgba(0,0,0,.03) inset, 0 12px 40px rgba(18,18,34,.16);
  }
}

html, body {
  height: 100%;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(14, 165, 233, .10), transparent 50%),
    radial-gradient(900px 700px at 110% 20%, rgba(20, 184, 166, .10), transparent 50%),
    var(--bg);
  color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand-2);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.hidden { display: none !important; }
.muted { color: var(--text-muted); }
.xs { font-size: 12px; }

/* App shell */
.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto auto; /* brand | spacer | nav | account */
  grid-template-areas: "brand . nav account";
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  margin: 4px 0 18px;
  background: color-mix(in oklab, var(--bg-elev) 88%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  backdrop-filter: saturate(120%) blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-area: brand;
}
.brand-logo{
  width: 36px;
  height: 36px;
  object-fit: contain;
  display: block;
}
.logo {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 18px rgba(14, 165, 233, .25);
  font-size: 20px;
}
.title {
  font-weight: 800;
  letter-spacing: .3px;
  font-size: 18px;
}

/* Nav */
.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 0 10px;
  grid-area: nav;
}
.nav-link {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease;
}
.nav-link:hover { transform: translateY(-1px); }
.nav-link[aria-current="page"],
.nav-link.active {
  background: color-mix(in oklab, var(--brand) 18%, var(--bg-soft));
  border-color: color-mix(in oklab, var(--brand) 40%, var(--border));
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--brand) 28%, transparent);
}

/* Account area */
.account {
  display: flex;
  align-items: center;
  gap: 10px;
  grid-area: account;
  justify-self: end;
}

/* Topbar controls: unify font and pill size for nav + account button */
.topbar .nav-link,
.topbar .account .btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  padding: 10px 16px;
  height: 38px;
  border-radius: 999px;
}

/* Make "My Account" visually match nav pills */
.topbar .account .btn,
.topbar .account .btn.btn-secondary {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  box-shadow: none;
}
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 4px 8px;
  background: color-mix(in oklab, var(--brand) 20%, var(--chip));
  border: 1px solid color-mix(in oklab, var(--brand) 40%, var(--border));
  color: var(--text);
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}

/* Hamburger */
.hamburger {
  display: none;
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  grid-area: hamb;
}

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .06s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: color-mix(in oklab, var(--brand) 50%, var(--border));
  color: #fff;
  box-shadow: 0 6px 20px rgba(14, 165, 233, .35);
}
.btn-secondary {
  background: color-mix(in oklab, var(--brand) 14%, var(--bg-soft));
  border-color: color-mix(in oklab, var(--brand) 30%, var(--border));
  color: #fff;
}
.btn.link {
  background: transparent;
  border-color: transparent;
  padding: 8px;
  color: var(--brand-2);
}

/* Layout */
.main {
  display: block;
}

.view { display: none; }
.view.active { display: block; }

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}

.card, .panel, .price-card {
  grid-column: span 12;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px;
}

.card h2, .panel h2, .price-card h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.list {
  margin: 8px 0 0;
  padding-left: 18px;
}
.list li { margin: 6px 0; }

/* Reusable rows */
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 10px 0;
}
.row.space { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.block { display: block; }

/* Inputs */
label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
input, select, textarea {
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input::placeholder, textarea::placeholder { color: color-mix(in oklab, var(--text-muted) 80%, transparent); }
input:focus, select:focus, textarea:focus {
  border-color: color-mix(in oklab, var(--brand) 40%, var(--border));
  box-shadow: var(--focus);
}

/* Headings */
h1 {
  margin: 0 0 12px;
  font-size: 24px;
  letter-spacing: .2px;
}
.subheading {
  margin: 8px 0;
  font-weight: 700;
  color: var(--text-muted);
}
.subheading.xs {
  font-size: 12px;
  letter-spacing: .5px;
  text-transform: uppercase;
}

/* Dashboard */
#recentChart {
  width: 100%;
}

/* Transcript + Suggestions */
.transcript-box, .suggestions-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 120px;
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
/* Keep transcript area fixed height and auto-scroll */
.transcript-box {
  max-height: 260px;
  overflow-y: scroll;            /* always show a vertical scrollbar */
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  scrollbar-gutter: stable both-edges; /* keep layout width stable while scrolling */
  -webkit-overflow-scrolling: touch;   /* momentum scroll on iOS */
}
.suggestions-box {
  display: grid;
  gap: 8px;
}
.suggestions-box .tip {
  background: color-mix(in oklab, var(--brand) 12%, var(--bg-soft));
  border: 1px dashed color-mix(in oklab, var(--brand) 30%, var(--border));
  padding: 10px;
  border-radius: 10px;
}

/* QA blocks */
.qa-block {
  background: var(--bg-elev);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: var(--shadow-sm);
}
.qa-block .q {
  padding: 10px;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.feedback {
  margin-top: 10px;
  padding: 10px 12px;
  background: color-mix(in oklab, var(--ok) 10%, var(--bg-soft));
  border: 1px solid color-mix(in oklab, var(--ok) 40%, var(--border));
  border-radius: 10px;
}

/* Coding block */
#codeEditor {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  white-space: pre;
}
.output {
  margin: 8px 0 0;
  background: #0a0a0f;
  color: #cde4ff;
  border: 1px solid #182033;
  border-radius: 10px;
  padding: 10px;
  min-height: 70px;
  overflow: auto;
}

/* Pricing */
.pricing-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(12, 1fr);
}
.price-card {
  position: relative;
  grid-column: span 12;
  text-align: left;
}
.price {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
}
.price-card.featured {
  border: 2px solid color-mix(in oklab, var(--brand) 48%, var(--border));
  box-shadow: 0 12px 40px rgba(14, 165, 233, .25);
}

/* Plan feature lists (checkmarked) */
.plan-features {
  list-style: none;
  margin: 10px 0 0;
  padding-left: 0;
  display: grid;
  gap: 10px;
}
.plan-features li {
  position: relative;
  padding-left: 28px;
  line-height: 1.35;
}
.plan-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 2px;
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in oklab, var(--ok) 15%, var(--bg-soft));
  border: 1px solid color-mix(in oklab, var(--ok) 40%, var(--border));
  color: color-mix(in oklab, var(--ok) 80%, #0a0a0a);
  font-size: 12px;
  box-shadow: var(--shadow-sm);
}

/* Compact lists inside teaser plan cards too */
.plans .plan-card .plan-features { margin-top: 8px; gap: 8px; }

/* Footer */
.footer {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin: 22px 0 12px;
  color: var(--text-muted);
}

/* Overlay (discreet panel) */
.overlay {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(380px, calc(100vw - 24px));
  background: color-mix(in oklab, var(--bg-elev) 92%, transparent);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  user-select: none;
}
.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--brand) 8%, var(--bg-soft));
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  cursor: grab;
}
.overlay-title {
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.overlay-actions {
  display: flex;
  gap: 6px;
}
.chip {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--chip);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 9px;
  cursor: pointer;
}
.overlay-content {
  display: grid;
  gap: 10px;
  padding: 10px;
}
.overlay-section .overlay-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 58px;
  padding: 8px;
  overflow: auto;
}
.overlay-notes { user-select: text; }

/* Modal (dialog) */
.modal {
  border: none;
  padding: 0;
  border-radius: 16px;
  background: transparent;
}
.modal::backdrop {
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(3px);
}
.modal-content {
  width: min(720px, calc(100vw - 24px));
  max-width: 720px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 16px;
  margin: 0 auto;
}
.modal-content h2 {
  margin: 0 0 10px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 1200;
  background: color-mix(in oklab, var(--bg-elev) 92%, transparent);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 999px;
  padding: 10px 14px;
  box-shadow: var(--shadow-md);
}

/* Accessibility focus */
:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-color: color-mix(in oklab, var(--brand) 40%, var(--border));
}

/* Responsive */
@media (min-width: 680px) {
  .card { grid-column: span 6; }
  /* Dashboard: 3 cards */
  #dashboard .card:nth-child(1) { grid-column: span 6; }
  #dashboard .card:nth-child(2) { grid-column: span 3; }
  #dashboard .card:nth-child(3) { grid-column: span 3; }
  .price-card { grid-column: span 12; }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: auto auto 1fr;
    grid-template-areas: "brand hamb account";
  }
  .nav {
    display: none;
  }
  .hamburger {
    display: inline-block;
    justify-self: end;
  }
  .nav.open {
    display: flex;
    position: absolute;
    top: calc(100% + 6px);
    left: 12px;
    right: 12px;
    padding: 10px;
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    z-index: 50;
  }
}

/* Utilities */
.actions { display: flex; gap: 8px; margin-top: 10px; }

/* Legal pages */
.legal {
  max-width: 860px;
  margin: 0 auto;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}
.legal h1 {
  font-size: 28px;
  margin: 0 0 8px;
}
.legal h2 {
  font-size: 18px;
  margin: 16px 0 6px;
}
.legal p { margin: 8px 0; }
.legal ul { margin: 8px 0 8px 18px; }
.legal li { margin: 6px 0; }
.legal a { color: var(--brand-2); text-decoration: none; }
.legal a:hover { text-decoration: underline; }

/* Scrollbars (webkit) */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: color-mix(in oklab, var(--brand) 12%, var(--bg-soft));
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
*::-webkit-scrollbar-track {
  background: transparent;
}

/* Animations */
@keyframes pop {
  from { transform: scale(.98); opacity: .6; }
  to { transform: scale(1); opacity: 1; }
}
.card, .panel, .price-card, .overlay, .modal-content {
  animation: pop .18s ease-out;
}


/* Top landing menu */
.landing-menu {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
}
.landing-menu .nav-link {
  background: transparent;
  border-color: transparent;
  color: var(--text);
  padding: 8px 10px;
}
.landing-menu .nav-link:hover {
  text-decoration: underline;
}

/* Brand logo sizing */
.brand-logo {
  width: 42px;
  height: 42px;
}

/* Reviews marquee */
#reviews { margin: 28px 0 16px; }
#reviews .testimonials { padding: 0 8px 12px; text-align: left; }
#reviews { text-align: left; }
#reviews .testimonials .testimonials-title {
  margin: 0 0 8px;
  padding: 0 16px;   /* align title with marquee cards */
  font-size: 20px;
}
#reviews .testimonials .marquee {
  overflow: hidden;
  position: relative;
  display: block;
  width: 100%;
  margin: 0; /* sits directly below heading */
  padding: 0 16px;   /* align track left edge with title */
  -webkit-mask-image: none;
  mask-image: none; /* remove edge fade so track spans full width */
}
#reviews .testimonials .marquee-track {
  display: flex;                  /* block-level so it aligns with container left */
  justify-content: flex-start;
  align-items: stretch;
  gap: 14px;
  width: max-content;             /* allow continuous flow */
  will-change: transform;
  transform: translateX(0);       /* start flush left */
  animation: none;                /* start stopped; JS will add .play */
  padding-left: 0;
}
#reviews .testimonials .marquee-track.play {
  animation: marquee-left 40s linear infinite;
}
#reviews .testimonials:hover .marquee-track {
  animation-play-state: paused;   /* pause on hover */
}
#reviews .testimonials .t-card {
  flex: 0 0 360px;   /* equal length cards */
  width: 360px;
  min-width: 360px;
  max-width: 360px;
  height: 160px;     /* equal height cards */
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
}
#reviews .testimonials .t-name {
  font-weight: 800;
  margin: 0 0 6px 0;
}
#reviews .testimonials .t-text {
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;   /* clamp to keep heights consistent */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#reviews .testimonials .t-meta {
  margin-top: auto;        /* pin meta to bottom so all cards align */
}

@keyframes marquee-left {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); } /* because we duplicate the content */
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #reviews .testimonials .marquee-track { animation: none; }
}

/* Pricing squares (landing teaser and main pricing) */
.pricing-teaser .price-card,
#pricing .price-card {
  /* Simplified non-square cards */
  display: block;
}

/* Hero banner (AI-styled blob gradients) */
.hero-banner {
  position: relative;            /* flow naturally in one-column hero */
  width: 100%;
  height: 220px;
  border-radius: 18px;
  background:
    radial-gradient(180px 120px at 25% 30%, rgba(14,165,233,.35), transparent 60%),
    radial-gradient(240px 160px at 80% 60%, rgba(20,184,166,.30), transparent 60%),
    linear-gradient(135deg, rgba(10,37,64,.85), rgba(14,165,233,.18));
  box-shadow: 0 20px 50px rgba(2,6,23,.18);
  filter: saturate(115%);
  margin: 8px 0 12px;
}

/* Dashboard sidebar layout */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
}
.dash-sidebar {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: 76px;
  align-self: start;
  min-height: 420px;
}
.dash-brand {
  font-weight: 800;
  margin: 6px 6px 12px;
  color: var(--brand);
}
.dash-menu {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dash-item {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-soft);
  cursor: pointer;
  color: var(--text);
  transition: transform .06s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.dash-item:hover { transform: translateY(-1px); }
.dash-item.active {
  background: color-mix(in oklab, var(--brand) 12%, var(--bg-soft));
  border-color: color-mix(in oklab, var(--brand) 35%, var(--border));
  box-shadow: var(--shadow-sm);
}
.dash-main {
  min-height: 300px;
  display: block;
}

/* Resumes list */
.resume-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
  margin: 8px 0;
}
.resume-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.resume-icon { font-size: 18px; }
.btn-xs {
  padding: 6px 8px;
  font-size: 12px;
  border-radius: 8px;
}

@media (max-width: 860px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { position: static; }
}

/* Steps grid/cards */
.steps {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: stretch;
}
.step-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}
.step-card .subheading { margin-bottom: 4px; }
.step-card .plan-cta { margin-top: auto; }
#dashboard .card, #dashboard .panel { box-shadow: var(--card-shadow); }

/* Resume list compact in dashboard */
#dashboardResumesPanel .list { padding-left: 0; margin-top: 4px; }
#dashboardResumesPanel .resume-row { margin: 10px 0; }

/* Trial wizard centering and compact spacing */
#trialWizard { max-width: 640px; margin: 0 auto; }
#trialProgress { text-align: center; }
#trialWizard .grid { grid-template-columns: 1fr; gap: 12px; }
#trialWizard input,
#trialWizard select,
#trialWizard textarea { width: 100%; }

/* Trial modal: compact, centered, no wasted whitespace */
#trialModal .modal-content {
  max-width: 560px;
  width: min(560px, calc(100vw - 24px));
  padding: 12px 16px;
}
#trialModal h2 { text-align: center; margin-bottom: 8px; }
#trialModal #trialProgress { margin-top: 2px; margin-bottom: 10px; }
#trialModal .row.end { justify-content: center; gap: 10px; }
#trialWizard label { margin: 0; }
#trialWizard .grid { gap: 10px; }

/* Consent screen (Step 4) */
.consent-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  padding: 14px;
  max-width: 560px;
  margin: 4px auto 0;
}
.consent-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 2px auto 6px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 22px;
  box-shadow: 0 6px 18px rgba(14,165,233,.25);
}
.consent-title {
  text-align: center;
  margin: 4px 0 8px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: .2px;
}
.consent-points {
  margin: 0 0 10px;
  padding-left: 18px;
}
.consent-points li { margin: 6px 0; }
.consent-check {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: color-mix(in oklab, var(--brand) 6%, var(--bg-elev));
  border: 1px dashed color-mix(in oklab, var(--brand) 28%, var(--border));
  border-radius: 10px;
  padding: 10px 12px;
}
.consent-check input { margin-top: 3px; }

/* Assistant workspace layout: left preview+transcript, right chat+tips */
.assist-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.25fr 0.75fr;
  align-items: start;
}
.assist-left .transcript { margin-top: 10px; }

.ai-chat {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-chat-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 220px;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  padding: 10px;
}
.ai-chat .row input { flex: 1; }

/* Formatted AI markdown in chat */
.ai-chat .ai-md { line-height: 1.5; }
.ai-chat .ai-md h1, .ai-chat .ai-md h2, .ai-chat .ai-md h3, .ai-chat .ai-md h4, .ai-chat .ai-md h5, .ai-chat .ai-md h6 {
  margin: 6px 0 4px;
  font-size: 14px;
}
.ai-chat .ai-md p { margin: 6px 0; }
.ai-chat .ai-md ul { margin: 6px 0 6px 16px; padding-left: 16px; list-style: disc; }
.ai-chat .ai-md li { margin: 4px 0; }
.ai-chat .ai-md strong { font-weight: 700; }

@media (max-width: 900px) {
  .assist-grid { grid-template-columns: 1fr; }
}

/* Immersive full-screen Assistant (maximize and fit entire screen) */
body.immersive { height: 100vh; overflow: hidden; }
body.immersive .app { max-width: 100%; padding: 0; margin: 0; }
body.immersive .topbar,
body.immersive .footer { display: none !important; }
body.immersive .main { padding: 0; margin: 0; }
body.immersive #assistant.view { display: block; }
body.immersive #assistant .panel {
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
  padding: 12px 16px;
  min-height: 100vh;
}
body.immersive .assist-grid {
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: stretch;
  min-height: calc(100vh - 24px);
}
body.immersive #sharePreview { max-height: 34vh; }
body.immersive .assist-left .transcript { margin-top: 8px; }
body.immersive .transcript-box {
  max-height: 56vh;               /* larger transcript area for readability */
  overflow-y: auto;
}
body.immersive .ai-chat-box {
  min-height: 56vh;                /* taller chat on the right in immersive mode */
  max-height: 80vh;
}

/* Ensure AI Co‑pilot chat input stays visible and the panel is scrollable in immersive mode */
body.immersive #assistant .panel {
  display: flex;
  flex-direction: column;
  height: 100vh;                   /* fill viewport */
  overflow: auto;                  /* allow manual scroll */
}
body.immersive .assist-grid {
  flex: 1 1 auto;
  min-height: 0;                   /* enable children to flex properly */
  overflow: auto;                  /* grid becomes scroll area if taller than viewport */
}
body.immersive .assist-right {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
body.immersive .ai-chat {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
body.immersive .ai-chat-box {
  flex: 1 1 auto;                  /* chat area takes remaining height */
  min-height: 0;                   /* allow it to shrink to fit */
  max-height: none;                /* remove cap so flex controls height */
  overflow-y: auto;
  padding-bottom: 12px;            /* spacing so last line isn't hidden under sticky row */
}
body.immersive .ai-chat .row {
  position: sticky;                /* keep input visible at bottom */
  bottom: 0;
  background: var(--bg-elev);
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
