/* Layout and component styles specific to this build, on top of base.css tokens. */

/* Several elements toggle visibility via the `hidden` attribute while also
   carrying an author `display: flex/block` rule for when they're shown —
   without this override the class rule's specificity wins over the UA
   default and `hidden` becomes a no-op. */
[hidden] { display: none !important; }

body {
  background: var(--bg-canvas);
}

#app {
  min-height: 100vh;
}

.prototype-badge {
  position: fixed;
  top: 72px;
  right: var(--spacing-s);
  display: flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 8px 0 10px;
  border-radius: var(--radius-pill);
  background: var(--bg-warning-subtle);
  color: var(--fg-warning);
  font-size: 12px;
  font-weight: 600;
  z-index: 200;
}
.prototype-badge-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.prototype-badge-dismiss:hover { background: rgba(0, 0, 0, 0.08); }

.gate-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-l);
}

.gate-card {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-m);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-large);
  padding: var(--spacing-xl);
}

.gate-lang { display: flex; justify-content: flex-end; margin-bottom: calc(-1 * var(--spacing-s)); }

.lang-toggle { display: inline-flex; border: 1px solid var(--border-default); border-radius: var(--radius-pill); padding: 2px; background: var(--bg-surface); flex-shrink: 0; }
.lang-toggle-option { border: 0; background: transparent; color: var(--fg-subtle); font: inherit; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-pill); cursor: pointer; }
.lang-toggle-option:hover { color: var(--fg-default); }
.lang-toggle-option.active { background: var(--bg-brand-subtle); color: var(--fg-brand); }

.icon-button.is-busy svg { animation: rp-spin 0.9s linear infinite; }

.gate-card h1 {
  font-size: var(--fs-title-lg);
  line-height: var(--lh-title-lg);
  font-weight: var(--fw-title-lg);
}

.gate-input {
  height: 44px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-default);
  padding: 0 var(--spacing-s);
  font-size: 14px;
  color: var(--fg-default);
}
.gate-input:focus {
  outline: none;
  box-shadow: var(--shadow-focus);
  border-color: var(--border-brand);
}

.gate-button {
  height: 44px;
  border: 0;
  border-radius: var(--radius-default);
  background: var(--ai-gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.gate-button:hover {
  filter: brightness(1.08);
}
.gate-button:disabled {
  opacity: 0.6;
  cursor: default;
}

.gate-error {
  font-size: 13px;
  color: var(--fg-critical);
}

.gate-notice {
  font-size: 13px;
  color: var(--fg-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-default);
  padding: var(--spacing-s);
  margin: 0;
}

/* ==========================================================================
   Shared bits: pills, icon buttons, links, fields
   ========================================================================== */

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-beta { background: var(--bg-beta-subtle); color: var(--fg-beta); }
.pill-count { border: 1px solid var(--border-default); color: var(--fg-muted); background: transparent; }
.pill-neutral { background: var(--bg-subtle); color: var(--fg-muted); }
.pill-warning { background: var(--bg-warning-subtle); color: var(--fg-warning); height: 24px; padding: 0 10px; }
.pill-critical { background: var(--bg-critical-subtle); color: var(--fg-critical); height: 24px; padding: 0 10px; }
.pill-success { background: var(--bg-success-subtle); color: var(--fg-success); height: 24px; padding: 0 10px; }

.icon-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: var(--radius-default);
  background: transparent;
  color: var(--fg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.icon-button:hover { background: var(--bg-subtle); }
.icon-button:disabled { opacity: 0.4; cursor: default; }
.icon-button-danger:hover { background: var(--bg-critical-subtle); }

.link-button {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-link);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.link-button:hover { text-decoration: underline; }
.link-button:disabled { opacity: 0.5; cursor: default; text-decoration: none; }

.field { display: flex; flex-direction: column; gap: 4px; margin-top: var(--spacing-l); }
.field:first-child { margin-top: 0; }
.field-label-row { display: flex; align-items: baseline; gap: 8px; }
.field-label-row label,
.field-label-plain { font-size: 14px; font-weight: 600; color: var(--fg-default); flex: 1; }
.field-help { font-size: 13px; color: var(--fg-muted); margin: 0; }
.field-counter { font-size: 13px; color: var(--fg-muted); flex-shrink: 0; }
.required { color: var(--fg-critical); }
.field-error { font-size: 13px; color: var(--fg-critical); }

.field-input {
  height: 44px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-default);
  padding: 0 var(--spacing-s);
  font-size: 14px;
  color: var(--fg-default);
  background: var(--bg-surface);
  width: 100%;
}
textarea.field-input { height: auto; padding: var(--spacing-s); line-height: 20px; }
.field-input:focus { outline: none; box-shadow: var(--shadow-focus); border-color: var(--border-brand); }
.time-limit-picker { display: flex; gap: 8px; }
.time-limit-option {
  height: 40px; padding: 0 var(--spacing-m); border-radius: var(--radius-default);
  border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--fg-default);
  font-size: 14px; font-weight: 600; cursor: pointer;
}
.time-limit-option:hover { background: var(--bg-subtle); }
.time-limit-option.active { border-color: var(--border-brand); background: var(--bg-brand-subtle); color: var(--fg-brand); }

.button-primary, .button-secondary, .button-danger {
  height: 44px;
  padding: 0 var(--spacing-m);
  border-radius: var(--radius-default);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.button-primary { border: 0; background: var(--bg-brand); color: #fff; }
.button-primary:hover { background: var(--brand-700); }
.button-primary.button-gradient { background: var(--ai-gradient); }
.button-primary.button-gradient:hover { background: var(--ai-gradient); filter: brightness(1.08); }
.button-secondary { border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--fg-default); }
.button-secondary:hover { background: var(--bg-subtle); }
.button-danger { border: 0; background: var(--red-600); color: #fff; }
.button-danger:hover { background: var(--red-700); }

/* ==========================================================================
   Top bar (shared by home + reused visually by the editor's own bar)
   ========================================================================== */

.topbar {
  height: 64px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: var(--spacing-m);
  padding: 0 var(--spacing-m);
}
.topbar-crumb { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.topbar-sep { color: var(--border-default); }
.topbar-current { font-size: 14px; font-weight: 600; color: var(--fg-subtle); }
.topbar-search { flex: 1; display: flex; justify-content: center; }
.topbar-search-box {
  width: 100%;
  max-width: 680px;
  height: 44px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-default);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--fg-muted);
}
.topbar-search-box input {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  color: var(--fg-default);
}
.topbar-search-box input::placeholder { color: var(--fg-muted); }
.topbar-actions { display: flex; align-items: center; gap: var(--spacing-s); flex-shrink: 0; }
.topbar-avatar {
  width: 36px; height: 36px; border-radius: 50%; background-size: cover; background-position: center; flex-shrink: 0;
}
.topbar-bell-wrap { position: relative; display: flex; }
.topbar-bell-badge {
  position: absolute; top: -4px; right: -6px; min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: var(--radius-pill); background: var(--red-600); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 14px; text-align: center;
}

.create-menu-wrap { position: relative; }
.create-button {
  height: 44px;
  padding: 0 var(--spacing-m);
  border: 0;
  border-radius: var(--radius-default);
  background: var(--brand-600);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.create-button:hover { background: var(--brand-700); }
.create-menu {
  position: absolute;
  top: 52px;
  right: 0;
  width: 260px;
  background: var(--bg-surface);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-default);
  padding: 8px;
  z-index: 60;
  display: flex;
  flex-direction: column;
}
.create-menu-label { padding: 8px 12px 4px; font-size: 12px; font-weight: 600; color: var(--fg-muted); }
.create-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  border-radius: var(--radius-default);
  font-size: 14px;
  font-weight: 600;
  color: var(--fg-default);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.create-menu-item:hover { background: var(--bg-subtle); }
.create-menu-item.disabled { color: var(--fg-disabled); cursor: default; pointer-events: none; }

/* ==========================================================================
   Home
   ========================================================================== */

.home-screen { display: flex; height: 100vh; }
.home-main { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }

.nav-rail {
  width: 96px; flex-shrink: 0; background: var(--bg-surface); border-right: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; align-items: center; gap: var(--spacing-m); padding: var(--spacing-m) 0;
}
.nav-rail-logo { width: 40px; height: 40px; border-radius: var(--radius-default); background-size: 26px; background-repeat: no-repeat; background-position: center; background-color: var(--green-100); }
.nav-rail-item {
  width: 40px; height: 40px; border: 0; border-radius: var(--radius-default); background: transparent;
  color: var(--fg-muted); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.nav-rail-item-active { background: var(--bg-brand-subtle); color: var(--fg-brand); }
.nav-rail-divider { width: 40px; height: 1px; background: var(--border-subtle); }
.nav-rail-groups { display: flex; flex-direction: column; gap: 8px; }
.nav-rail-group {
  width: 28px; height: 28px; border-radius: 50%; background: var(--bg-subtle); color: var(--fg-muted);
  display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700;
}


.home-body { flex: 1; min-height: 0; padding: var(--spacing-l) var(--spacing-m) var(--spacing-xxl); overflow-y: auto; }
.widget-header { display: flex; align-items: center; gap: var(--spacing-s); margin-bottom: var(--spacing-m); }
.widget-header h3 { flex: 0 0 auto; }

.filter-chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--spacing-l); }
.filter-chip {
  height: 32px; padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--border-default);
  display: inline-flex; align-items: center; font-size: 13px; color: var(--fg-subtle);
}

.home-hero {
  height: 200px; border-radius: var(--radius-large); color: #fff;
  background-image: linear-gradient(0deg, rgba(0,0,0,0.65), rgba(0,0,0,0.05) 60%), url(/assets/photos/hero.jpg);
  background-size: cover; background-position: center;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; padding: var(--spacing-l) var(--spacing-xl);
  margin-bottom: var(--spacing-l);
}
.home-hero h2 { margin: 0; font-size: 22px; }
.home-hero p { margin: 0; max-width: 560px; font-size: 14px; opacity: 0.9; }

.home-category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--spacing-m); margin-bottom: var(--spacing-xl); }
.home-category-card {
  height: 110px; border-radius: var(--radius-default); display: flex; align-items: flex-end; padding: var(--spacing-m);
  color: #fff; font-weight: 600; font-size: 14px;
  background-size: cover; background-position: center;
}
.home-category-0 { background-image: linear-gradient(0deg, rgba(0,0,0,0.55), rgba(0,0,0,0) 60%), url(/assets/photos/category-onboarding.jpg); }
.home-category-1 { background-image: linear-gradient(0deg, rgba(0,0,0,0.55), rgba(0,0,0,0) 60%), url(/assets/photos/category-continuous-learning.jpg); }
.home-category-2 { background-image: linear-gradient(0deg, rgba(0,0,0,0.55), rgba(0,0,0,0) 60%), url(/assets/photos/category-soft-skills.jpg); }

.assigned-card {
  width: 220px; height: 249px; flex-shrink: 0; border-radius: var(--radius-large); box-shadow: inset 0 0 0 1px var(--border-default);
  display: flex; flex-direction: column; overflow: hidden; background: var(--bg-surface);
}
.assigned-card-thumb { height: 98px; flex-shrink: 0; }
.assigned-card-thumb-0 { background: linear-gradient(135deg, #e2ebfd, #c5d7fc); }
.assigned-card-thumb-1 { background: linear-gradient(135deg, #f6e0fb, #e3d2f9); }
.assigned-card-thumb-2 { background: linear-gradient(135deg, #dceee2, #aed7b8); }
.assigned-card-body { flex: 1; display: flex; flex-direction: column; gap: var(--spacing-s); padding: 12px 16px; min-height: 0; }
.assigned-card-title { font-size: 14px; font-weight: 600; color: var(--fg-default); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.assigned-card-chips { display: flex; gap: 6px; }
.assigned-card-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.assigned-card-author { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-muted); min-width: 0; }
.assigned-card-author span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.assigned-card-views { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--fg-muted); flex-shrink: 0; }

.rp-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none; /* Firefox */
}
.rp-strip::-webkit-scrollbar { display: none; } /* Chrome/Safari/Edge */

.rp-card, .rp-card-create {
  position: relative;
  width: 220px;
  height: 249px;
  flex-shrink: 0;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--border-default);
  border-radius: var(--radius-large);
  background: var(--ai-gradient-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
}
.rp-card:hover, .rp-card-create:hover { box-shadow: inset 0 0 0 1px var(--border-brand); }

.rp-card-create {
  gap: 12px;
  padding: 12px 16px;
  text-align: left;
}
.rp-card-create-icon {
  height: 98px;
  align-self: stretch;
  border-radius: var(--radius-default);
  background: linear-gradient(138.538deg, rgba(226,229,252,.9), rgba(227,210,249,.9));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--fg-subtle);
}
.rp-card-create-title { font-size: 14px; font-weight: 600; color: #000; align-self: stretch; }
.rp-card-create-body { font-size: 14px; color: var(--fg-muted); align-self: stretch; }

.rp-card {
  gap: 8px;
  padding: 4px 16px 12px;
  justify-content: center;
}
.rp-card-title {
  align-self: stretch;
  padding-right: 30px;
  font-size: 14px;
  font-weight: 600;
  color: #000;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rp-card-avatar-ring {
  width: 128px; height: 128px; border-radius: 50%;
  border: 1px solid rgba(143,75,231,.22);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rp-card-avatar-ring-inner {
  width: 112px; height: 112px; border-radius: 50%;
  border: 1px solid rgba(143,75,231,.3);
  display: flex; align-items: center; justify-content: center;
}
.rp-card-avatar { width: 96px; height: 96px; border-radius: 50%; background-size: cover; background-position: center; }
.rp-card-footer { align-self: stretch; display: flex; align-items: center; gap: 8px; height: 24px; }
.rp-card-author { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-muted); flex: 1; min-width: 0; }
.rp-card-author .chat-avatar { width: 18px; height: 18px; }
.rp-card-author span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rp-card-edit {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: var(--radius-default);
  background: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  color: var(--fg-subtle);
}
.rp-card-edit:hover { background: var(--bg-subtle); }

/* ==========================================================================
   Editor
   ========================================================================== */

.editor-screen {
  position: fixed;
  inset: 0;
  background: var(--bg-surface);
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.editor-topbar {
  height: 56px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 var(--spacing-m);
}
.editor-title-input {
  flex: 1;
  min-width: 0;
  height: 40px;
  border: 0;
  border-radius: var(--radius-default);
  padding: 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--fg-default);
  background: transparent;
}
.editor-title-input:hover, .editor-title-input:focus { background: var(--bg-subtle); outline: none; }
.editor-tabs { display: flex; gap: 12px; flex-shrink: 0; }
.editor-tab {
  width: 36px; height: 36px; border: 0; border-radius: var(--radius-default);
  background: transparent; color: var(--fg-muted); display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.editor-tab:hover { background: var(--bg-subtle); }
.editor-tab.active { color: var(--brand-600); background: var(--bg-brand-subtle); }
.editor-creator { display: flex; align-items: center; gap: 8px; flex-shrink: 0; padding-left: 8px; font-size: 14px; font-weight: 600; color: var(--fg-subtle); }
.editor-creator-avatar { width: 24px; height: 24px; border-radius: 50%; background-size: cover; background-position: center; }
.editor-menu-wrap { position: relative; flex-shrink: 0; }
.editor-menu {
  position: absolute; top: 44px; right: 0; width: 220px; background: var(--bg-surface);
  border-radius: var(--radius-default); box-shadow: var(--shadow-default); padding: 8px; z-index: 60;
  display: flex; flex-direction: column;
}
.editor-menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 12px;
  border: 0; background: transparent; border-radius: var(--radius-default); font-size: 14px; color: var(--fg-default);
  cursor: pointer; text-align: left;
}
.editor-menu-item:hover { background: var(--bg-subtle); }
.editor-menu-item-danger { color: var(--fg-critical); }
.editor-menu-item-danger:hover { background: var(--bg-critical-subtle); }
.editor-divider { width: 1px; height: 24px; background: var(--border-subtle); flex-shrink: 0; }

.editor-body-row { flex: 1; min-height: 0; display: flex; }
.editor-body { flex: 1; min-width: 0; overflow: auto; min-height: 0; }
.editor-edit { background: var(--bg-surface); }
.editor-form { max-width: 720px; margin: 0 auto; padding: var(--spacing-xl) var(--spacing-m) var(--spacing-xxl); display: flex; flex-direction: column; gap: var(--spacing-xl); }
.editor-section { display: flex; flex-direction: column; }
.editor-section-head { display: flex; align-items: baseline; gap: var(--spacing-m); margin-bottom: var(--spacing-m); }
.editor-hr { height: 1px; background: var(--border-subtle); }

.indicator-list { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.indicator-row { display: flex; align-items: flex-start; gap: 12px; }
.indicator-num { font-size: 14px; font-weight: 600; color: var(--fg-default); line-height: 44px; white-space: nowrap; flex-shrink: 0; }
.indicator-input { flex: 1; }
.indicator-counter { width: 56px; text-align: right; flex-shrink: 0; }
.indicator-add-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }

.avatar-picker-head { display: flex; align-items: center; gap: var(--spacing-m); margin-bottom: var(--spacing-m); }
.avatar-picker-strip { display: flex; gap: 16px; overflow-x: auto; padding: 2px 2px 4px; }
.avatar-pick { border: 0; background: transparent; padding: 0; width: 84px; flex-shrink: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.avatar-pick-frame { position: relative; width: 84px; height: 84px; border-radius: 50%; overflow: visible; }
.avatar-pick-img { width: 84px; height: 84px; border-radius: 50%; background-size: cover; background-position: center; }
.avatar-pick-check { position: absolute; right: -2px; bottom: 0; width: 24px; height: 24px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; }
.avatar-pick-name { font-size: 13px; color: var(--fg-muted); }
.avatar-pick-name.active { color: var(--fg-default); font-weight: 600; }

/* Avatar voice preview */
.avatar-pick-preview {
  position: absolute; left: -2px; bottom: 0; width: 24px; height: 24px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border-subtle); display: flex; align-items: center;
  justify-content: center; padding: 0; cursor: pointer; color: var(--fg-default);
}
.avatar-pick-preview:hover { background: var(--bg-subtle); }
.avatar-pick-preview.is-playing { color: var(--brand-600); border-color: var(--brand-600); }
.avatar-pick-preview.loading svg { visibility: hidden; }
.avatar-pick-preview.loading::after {
  content: ""; position: absolute; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--bg-brand-subtle); border-top-color: var(--bg-brand);
  animation: rp-spin 0.8s linear infinite;
}

.editor-preview { display: flex; min-height: 0; height: 100%; }
.editor-preview-visual { flex: 1; min-width: 0; }
.editor-preview-brief { width: 480px; flex-shrink: 0; background: var(--bg-surface); border-left: 1px solid var(--border-subtle); overflow: auto; padding: var(--spacing-xl); }

.companion-panel { width: 420px; flex-shrink: 0; background: var(--bg-surface); display: flex; flex-direction: column; min-height: 0; }
.companion-header {
  flex-shrink: 0; display: flex; align-items: center; gap: 10px;
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border-subtle); font-size: 16px; font-weight: 600; color: var(--fg-default);
}
.companion-messages { flex: 1; overflow: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.companion-msg { font-size: 14px; line-height: 20px; white-space: pre-wrap; }
.companion-msg-companion { color: var(--fg-subtle); }
.companion-msg-author { background: var(--brand-100); color: var(--fg-default); padding: 10px 14px; border-radius: var(--radius-large); align-self: flex-end; max-width: 90%; }
.companion-msg-error { color: var(--red-600); }
.companion-attachment { flex-shrink: 0; margin: 0 20px 12px; padding: 8px 12px; border-radius: var(--radius-default); background: var(--bg-subtle); font-size: 13px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.companion-attachment-remove { border: 0; background: none; cursor: pointer; color: var(--fg-muted); margin-left: auto; display: flex; }
.companion-attachment-error { color: var(--red-600); }
.companion-attachment-truncated { flex-basis: 100%; font-size: 12px; color: var(--fg-warning); }
.companion-composer { flex-shrink: 0; display: flex; gap: 8px; align-items: flex-end; padding: 12px 20px; border-top: 1px solid var(--border-subtle); }
.companion-attach-button { flex-shrink: 0; }
.companion-composer .chat-input { flex: 1; max-height: 45vh; }
.companion-disclaimer { flex-shrink: 0; padding: 0 20px 16px; font-size: 12px; color: var(--fg-muted); text-align: center; }

.editor-footer {
  height: 72px; flex-shrink: 0; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--spacing-m); padding: 0 var(--spacing-l);
}
.save-hint { font-size: 13px; color: var(--fg-muted); }
.save-button {
  height: 44px; padding: 0 var(--spacing-m); border: 0; border-radius: var(--radius-default);
  background: var(--ai-gradient); color: #fff; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; cursor: pointer;
}
.save-button:hover { filter: brightness(1.08); }

/* Brief (reused later by the learner briefing/side-panel screens) */
.brief { display: flex; flex-direction: column; gap: var(--spacing-l); }
.brief-title { font-size: 24px; line-height: 32px; font-weight: 600; }
.brief-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.brief-block { display: flex; flex-direction: column; gap: 6px; }
.brief-block-title { font-size: 16px; font-weight: 600; }
.brief-block-body { font-size: 14px; line-height: 22px; color: var(--fg-subtle); white-space: pre-wrap; }
.brief-indicators { display: flex; flex-direction: column; gap: 16px; }
.brief-indicator { display: flex; gap: 16px; align-items: flex-start; font-size: 14px; line-height: 22px; color: var(--fg-subtle); }
.brief-indicator-icon {
  width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; background: var(--bg-beta-subtle);
  display: flex; align-items: center; justify-content: center;
}

/* ==========================================================================
   Slide-overs & modals
   ========================================================================== */

.slideover-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  justify-content: flex-end;
  background: var(--black-40);
}
.slideover {
  width: 480px;
  height: 100%;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
}
.slideover-head {
  height: 56px; flex-shrink: 0; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; padding: 0 var(--spacing-m) 0 var(--spacing-l);
}
.slideover-title { flex: 1; font-size: 18px; font-weight: 600; }
.slideover-body { flex: 1; overflow: auto; padding: var(--spacing-l); display: flex; flex-direction: column; gap: var(--spacing-m); }
.slideover-body p { margin: 0; font-size: 14px; line-height: 20px; color: var(--fg-subtle); }
.callout { border: 1px solid var(--border-default); border-radius: var(--radius-default); padding: var(--spacing-m); display: flex; flex-direction: column; gap: 8px; }
.callout-title { font-size: 14px; font-weight: 600; }
.callout-body { font-size: 13px; line-height: 19px; color: var(--fg-muted); }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 130;
  background: var(--black-40);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-l);
}
.modal {
  width: 560px;
  background: var(--bg-surface);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-default);
  display: flex;
  flex-direction: column;
}
.modal-title { padding: var(--spacing-l) var(--spacing-l) 8px; font-size: 18px; font-weight: 600; }
.modal-body { padding: 0 var(--spacing-l) var(--spacing-l); font-size: 14px; line-height: 20px; color: var(--fg-subtle); }
.modal-actions {
  border-top: 1px solid var(--border-subtle);
  padding: var(--spacing-m) var(--spacing-l);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ==========================================================================
   Briefing
   ========================================================================== */

.briefing-screen { display: flex; min-height: 100vh; }
.briefing-visual {
  flex: 1;
  min-width: 0;
  background: var(--ai-gradient-subtle);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-l);
}
.briefing-back { position: absolute; top: var(--spacing-l); left: var(--spacing-l); }
.briefing-hero { display: flex; flex-direction: column; align-items: center; gap: var(--spacing-m); max-width: 420px; }
.briefing-hero-avatar-wrap { padding: 10px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.25); }
.briefing-hero-avatar { width: 220px; height: 220px; }
.briefing-online-row { display: flex; align-items: center; gap: 8px; }
.briefing-online-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green-500); }
.briefing-hero-name { font-size: 18px; font-weight: 600; color: var(--fg-default); }
.briefing-greeting { display: flex; align-items: center; gap: var(--spacing-s); width: 100%; }
.briefing-greeting-bubble {
  flex: 1;
  background: var(--bg-surface);
  border-radius: var(--radius-default);
  box-shadow: var(--shadow-default);
  padding: var(--spacing-s) var(--spacing-m);
  font-size: 14px;
  color: var(--fg-default);
}
.briefing-panel {
  width: 600px;
  flex-shrink: 0;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-subtle);
  overflow: auto;
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  gap: var(--spacing-l);
}
/* Admin-only "which model is active" hint */
.voice-testing-badge { margin: 0 0 4px; font-size: 12px; color: var(--grey-500); }
.briefing-actions { display: flex; gap: var(--spacing-s); }
.briefing-actions .button-primary, .briefing-actions .button-secondary { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; }
.briefing-last-attempt {
  background: var(--bg-subtle); border-radius: var(--radius-default); padding: var(--spacing-m);
  display: flex; flex-direction: column; gap: var(--spacing-s);
}
.briefing-last-attempt-meta { font-size: 13px; color: var(--fg-subtle); }
.briefing-last-attempt-chips { display: flex; gap: var(--spacing-s); }
.briefing-last-attempt-links { display: flex; gap: var(--spacing-m); }

/* ==========================================================================
   Chat avatars (shared: briefing, conversation, outcome)
   ========================================================================== */

.chat-avatar { border-radius: 50%; background-size: cover; background-position: center; flex-shrink: 0; }
.chat-avatar-xs { width: 24px; height: 24px; }
.chat-avatar-sm { width: 32px; height: 32px; }
.chat-avatar-msg { width: 36px; height: 36px; }
.chat-avatar-lg { width: 72px; height: 72px; }
.chat-avatar-xl { width: 96px; height: 96px; }

/* ==========================================================================
   Conversation (text chat)
   ========================================================================== */

.chat-screen { display: flex; flex-direction: column; height: 100vh; background: var(--bg-surface); }
.chat-topbar {
  height: 56px; flex-shrink: 0; border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: center; gap: 12px; padding: 0 16px 0 24px;
}
.chat-topbar-title { font-weight: 600; font-size: 18px; line-height: 24px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-end-now { margin-left: auto; height: 28px; border: 0; cursor: pointer; }
.chat-end-now:hover { filter: brightness(0.95); }
.chat-topbar-creator { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--fg-subtle); flex-shrink: 0; }
.chat-topbar-divider { width: 1px; height: 24px; background: var(--border-subtle); flex-shrink: 0; }
.chat-body { flex: 1; min-height: 0; position: relative; display: flex; }
.chat-main { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.chat-countdown-row { flex-shrink: 0; display: flex; justify-content: flex-end; padding: 16px 24px 0; }
.chat-countdown {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: var(--radius-default); font-size: 14px; font-weight: 600; white-space: nowrap; flex-shrink: 0;
  background: var(--bg-surface); border: 1px solid var(--border-default); color: var(--fg-subtle);
}
.chat-countdown-icon { display: none; flex-shrink: 0; }
.chat-countdown-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--grey-500); flex-shrink: 0; }
.chat-countdown-warning { background: var(--yellow-100); border-color: var(--yellow-200); color: var(--yellow-700); }
.chat-countdown-warning .chat-countdown-icon { display: flex; }
.chat-countdown-warning .chat-countdown-dot { background: var(--yellow-500); }
.chat-countdown-critical { background: var(--bg-surface); border-color: var(--red-500); color: var(--red-600); }
.chat-countdown-critical .chat-countdown-icon { display: flex; }
.chat-countdown-critical .chat-countdown-dot { background: var(--red-500); }
.chat-messages {
  flex: 1; min-width: 0; overflow: auto; padding: 8px 24px 24px; display: flex; flex-direction: column; gap: 24px;
}
.chat-messages-measure { max-width: 760px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 24px; }
.brief-panel-toggle {
  width: 28px; flex-shrink: 0; border: 0; border-left: 1px solid var(--border-subtle); border-right: 1px solid var(--border-subtle);
  background: var(--bg-surface); color: var(--fg-muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.brief-panel-toggle:hover { background: var(--bg-subtle); }
.chat-brief-panel { width: 480px; flex-shrink: 0; background: var(--bg-surface); display: flex; flex-direction: column; min-height: 0; }
.brief-panel-header {
  flex-shrink: 0; display: flex; align-items: center; gap: 16px;
  padding: 32px 32px 24px; border-bottom: 1px solid var(--border-subtle); margin-bottom: 24px;
}
.brief-panel-header-text { display: flex; flex-direction: column; }
.brief-panel-name { font-size: 24px; line-height: 32px; font-weight: 600; }
.brief-panel-role { font-size: 16px; line-height: 22px; color: var(--fg-subtle); }
.brief-panel-body { flex: 1; overflow: auto; padding: 0 32px 32px; }
.brief-panel-footer { flex-shrink: 0; display: flex; gap: var(--spacing-s); padding: 16px 32px 20px; border-top: 1px solid var(--border-subtle); }
.brief-panel-footer .button-secondary, .brief-panel-footer .button-primary { flex: 1; height: 44px; display: flex; align-items: center; justify-content: center; }
.chat-row { display: flex; gap: 12px; align-items: flex-start; max-width: 100%; }
.chat-row-ai { align-items: flex-start; align-self: flex-start; }
.chat-row-learner { align-self: flex-end; margin-left: auto; max-width: 80%; }
.chat-msg-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chat-msg-name { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--fg-default); }
.chat-bubble { font-size: 14px; line-height: 22px; white-space: pre-wrap; }
.chat-bubble-ai { color: var(--fg-subtle); }
.chat-bubble-learner {
  background: var(--brand-100); color: var(--fg-default);
  padding: 12px 16px; border-radius: var(--radius-large);
}
.chat-typing {
  display: flex; align-items: center; gap: 5px; height: 22px; width: fit-content;
}
.chat-typing span {
  width: 7px; height: 7px; border-radius: 50%; background: var(--fg-muted);
  animation: rp-typing-bounce 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes rp-typing-bounce {
  0%, 60%, 100% { opacity: 0.22; }
  30% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .chat-typing span { animation: none; opacity: 1; }
}
.chat-error-card {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--red-200); background: var(--red-100); border-radius: var(--radius-default);
  padding: 12px 16px; font-size: 13px; color: var(--red-700);
}
.chat-error-card span { flex: 1; }
.chat-error-card .button-danger { height: 36px; padding: 0 12px; font-size: 13px; }
.chat-composer { border-top: 1px solid var(--border-subtle); padding: 16px 24px 20px; }
.chat-composer-measure { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 6px; }

/* End-of-roleplay banner (Figma) — replaces the chat composer / call controls. */
.end-banner {
  display: flex; align-items: center; gap: 14px; width: 100%; max-width: 460px; box-sizing: border-box;
  padding: 10px 10px 10px 14px; border-radius: var(--radius-large); background: var(--bg-surface);
  box-shadow: var(--shadow-default); animation: rp-end-banner-in 260ms ease-out both;
}
.chat-composer .end-banner { max-width: none; background: var(--bg-subtle); box-shadow: none; }
.end-banner-icon { display: flex; flex-shrink: 0; color: var(--fg-subtle); }
.end-banner-limit .end-banner-icon { color: var(--yellow-600); }
.end-banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.end-banner-text strong { font-size: 13px; font-weight: 600; color: var(--fg-default); }
.end-banner-text span { font-size: 12px; color: var(--fg-subtle); }
.end-banner-cta { flex-shrink: 0; height: 36px; padding: 0 16px; font-size: 13px; }
@keyframes rp-end-banner-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .end-banner { animation: none; } }
.chat-composer-box {
  display: flex; align-items: flex-end; gap: 12px;
  border: 1px solid var(--border-default); border-radius: var(--radius-default); padding: 12px; background: var(--bg-surface);
}
.chat-composer-box:focus-within { border-color: var(--border-brand); box-shadow: var(--shadow-focus); }
.chat-input {
  flex: 1; border: 0; outline: none; background: transparent; resize: none;
  font-size: 14px; line-height: 22px; color: var(--fg-default); padding: 0; max-height: 132px; overflow-y: auto;
}
.chat-composer-meta { display: flex; justify-content: flex-end; }
.chat-char-counter { font-size: 13px; color: var(--fg-subtle); }
.chat-send {
  width: 40px; height: 40px; flex-shrink: 0; border: 0; border-radius: var(--radius-default);
  background: var(--bg-brand); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.chat-send:hover { background: var(--brand-700); }
.chat-send:disabled { opacity: 0.5; cursor: default; }

/* ==========================================================================
   Outcome
   ========================================================================== */

.outcome-loading {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--spacing-m); color: var(--fg-muted);
}
.outcome-screen { display: flex; flex-direction: column; height: 100vh; }
.outcome-body { flex: 1; overflow: auto; max-width: 720px; margin: 0 auto; width: 100%; padding: var(--spacing-xl) var(--spacing-l); display: flex; flex-direction: column; gap: var(--spacing-l); }
.outcome-header { display: flex; flex-direction: column; align-items: center; gap: var(--spacing-s); text-align: center; }
.outcome-header h2 { margin: 0; font-size: 22px; }
.outcome-mission { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.outcome-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--spacing-s); }
.outcome-card { border: 1px solid var(--border-subtle); border-radius: var(--radius-default); padding: var(--spacing-l); display: flex; flex-direction: column; gap: var(--spacing-s); }
.outcome-card h4 { margin: 0; font-size: 14px; }
.outcome-loading-card { align-items: center; justify-content: center; gap: var(--spacing-m); padding: var(--spacing-xl); color: var(--fg-muted); }
.outcome-loading-card p { color: var(--fg-muted); }
.outcome-spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--bg-brand-subtle); border-top-color: var(--bg-brand);
  animation: rp-spin 0.8s linear infinite;
}
@keyframes rp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .outcome-spinner { animation-duration: 2s; }
}
.outcome-card p { margin: 0; font-size: 14px; line-height: 20px; color: var(--fg-subtle); }

.outcome-reaction { border: 1px solid var(--border-subtle); border-radius: var(--radius-default); padding: var(--spacing-l); display: flex; flex-direction: column; gap: var(--spacing-s); align-items: flex-start; }
.outcome-reaction-label { font-size: 14px; font-weight: 600; }
.outcome-reaction-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.outcome-reaction-btn { border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--fg-default); border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.outcome-reaction-btn:hover:not(:disabled) { background: var(--bg-subtle); }
.outcome-reaction-btn:disabled { cursor: default; opacity: 0.5; }
.outcome-reaction-btn.selected { border-color: var(--border-brand); background: var(--bg-brand-subtle); color: var(--fg-brand); opacity: 1; }
.outcome-reaction-thanks { font-size: 13px; color: var(--fg-subtle); }
.outcome-accordion { border: 1px solid var(--border-subtle); border-radius: var(--radius-default); padding: var(--spacing-m) var(--spacing-l); }
.outcome-accordion summary { cursor: pointer; font-size: 14px; font-weight: 600; padding: var(--spacing-xs) 0; display: flex; align-items: center; gap: var(--spacing-s); }
.outcome-section-icon {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.outcome-section-icon-improve { background: var(--bg-critical-subtle); color: var(--fg-critical); }
.outcome-section-icon-well { background: var(--bg-success-subtle); color: var(--fg-success); }
.outcome-indicator-list { display: flex; flex-direction: column; gap: var(--spacing-m); margin-top: var(--spacing-m); }
.outcome-empty { margin: var(--spacing-m) 0 0; font-size: 13px; color: var(--fg-muted); }
.outcome-indicator-card { display: flex; flex-direction: column; gap: 6px; padding: var(--spacing-m); border-radius: var(--radius-default); background: var(--bg-subtle); }
.outcome-indicator-number { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: var(--fg-subtle); }
.outcome-indicator-label { font-size: 14px; font-weight: 600; }
.outcome-indicator-rationale { font-size: 13px; color: var(--fg-subtle); }
.outcome-quote { border-left: 3px solid; padding: 6px 0 6px var(--spacing-s); display: flex; flex-direction: column; gap: 2px; }
.outcome-quote-label { font-size: 12px; font-weight: 600; }
.outcome-quote-text { font-size: 13px; font-style: italic; }
.outcome-quote-improve { border-color: var(--red-500); }
.outcome-quote-improve .outcome-quote-label { color: var(--fg-critical); }
.outcome-quote-well { border-color: var(--green-500); }
.outcome-quote-well .outcome-quote-label { color: var(--fg-success); }
.outcome-transcript { max-height: 320px; padding: var(--spacing-m); border: 1px solid var(--border-subtle); border-radius: var(--radius-default); margin-top: var(--spacing-m); }
.outcome-footer {
  height: 72px; flex-shrink: 0; border-top: 1px solid var(--border-subtle);
  display: flex; align-items: center; justify-content: flex-end; gap: var(--spacing-m); padding: 0 var(--spacing-l);
}

/* Illustrative score + learning-path + manager-view */
.outcome-score-disclaimer { margin: 0; font-size: 12px; color: var(--fg-muted); text-align: center; }
.outcome-transcript-privacy { font-size: 12px; font-weight: 400; color: var(--fg-muted); margin-left: 8px; }
.outcome-learning-path-link, .outcome-manager-view-link { display: block; text-align: center; }
.outcome-manager-view-note { margin: 0 0 var(--spacing-m); }

/* Deliberately unobtrusive — testing
   aid, not a feature for the demo audience to notice. */
.outcome-usage-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin: var(--spacing-s) auto 0; border-radius: 50%;
  color: var(--fg-muted); opacity: 0.35; transition: opacity 0.15s;
}
.outcome-usage-toggle:hover { opacity: 1; }
.usage-stats { list-style: none; padding: 0; margin: 0 0 var(--spacing-m); display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.usage-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.usage-table td { padding: 6px 4px; border-bottom: 1px solid var(--border-subtle); }
.usage-table td:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* Admin usage/cost dashboard */
.dashboard-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--spacing-m); margin-bottom: var(--spacing-l); }
.dashboard-stat-card { display: flex; flex-direction: column; gap: 4px; padding: var(--spacing-m); border: 1px solid var(--border-subtle); border-radius: var(--radius-default); }
.dashboard-stat-value { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.dashboard-stat-label { font-size: 12px; color: var(--fg-muted); }

/* Learning path — modeled on 360Learning's real path-overview page layout */
.lp-tabs { padding: 0 var(--spacing-l); border-bottom: 1px solid var(--border-subtle); display: flex; gap: var(--spacing-l); flex-shrink: 0; }
.lp-tab { padding: 12px 2px; font-size: 14px; font-weight: 600; color: var(--fg-muted); }
.lp-tab-active { color: var(--fg-default); border-bottom: 2px solid var(--bg-brand); }

.lp-body { padding: var(--spacing-xl) var(--spacing-l); }
.lp-columns { display: flex; gap: var(--spacing-xl); max-width: 1100px; margin: 0 auto; align-items: flex-start; }
.lp-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--spacing-s); }
.lp-sidebar { width: 300px; flex-shrink: 0; display: flex; flex-direction: column; gap: var(--spacing-s); }

.lp-hero { height: 180px; border-radius: var(--radius-large); background: linear-gradient(135deg, #ece3fb, #e0d4fa); display: flex; align-items: center; justify-content: center; }
.lp-hero-bubble { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.55); }
.lp-title { margin: var(--spacing-s) 0 0; font-size: 24px; }
.lp-resume-button { align-self: flex-start; background: var(--green-700); }
.lp-resume-button:disabled { opacity: 1; cursor: default; }
.lp-section-heading { margin: var(--spacing-m) 0 0; font-size: 15px; }
.lp-section-heading-first { margin-top: 0; }
.lp-pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.lp-description { margin: 0; font-size: 14px; line-height: 20px; color: var(--fg-subtle); }
.lp-see-more { cursor: default; }

.lp-step-list { display: flex; flex-direction: column; gap: var(--spacing-m); }
.lp-step-card { display: flex; gap: var(--spacing-m); border: 1px solid var(--border-subtle); border-radius: var(--radius-default); padding: var(--spacing-m); }
.lp-step-thumb { width: 96px; height: 72px; border-radius: var(--radius-default); flex-shrink: 0; }
.lp-step-thumb-roleplay { display: flex; align-items: center; justify-content: center; }
.lp-step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.lp-step-title-row { display: flex; align-items: center; gap: 8px; }
.lp-step-title { font-size: 14px; font-weight: 600; color: var(--fg-default); }
.lp-step-tag { flex-shrink: 0; }
.lp-step-desc { margin: 0; font-size: 13px; color: var(--fg-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-step-footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lp-step-status { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; }
.lp-step-status-done { color: var(--fg-success); }
.lp-progress { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-muted); }
.lp-progress-track { width: 56px; height: 4px; border-radius: 2px; background: var(--bg-subtle); overflow: hidden; }
.lp-progress-fill { display: block; height: 100%; background: var(--bg-brand); }
.lp-step-locked-hint { margin: 0; font-size: 11px; color: var(--fg-muted); display: flex; align-items: center; gap: 4px; }

.lp-ai-bubble { width: 32px; height: 32px; border-radius: 50%; background: var(--ai-gradient); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.lp-session-card { border: 1px solid var(--border-subtle); border-radius: var(--radius-default); padding: var(--spacing-m); display: flex; flex-direction: column; gap: 4px; }
.lp-session-title { font-size: 14px; font-weight: 600; }
.lp-session-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-muted); }
.lp-session-fact { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--fg-subtle); }
.lp-stepper { display: flex; flex-direction: column; gap: 8px; padding: var(--spacing-s) 0; }
.lp-stepper-item { width: 28px; height: 18px; border: 1.5px solid var(--border-subtle); border-radius: 4px; }

.lp-comments { margin-top: var(--spacing-m); padding-top: var(--spacing-l); border-top: 1px solid var(--border-subtle); display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; color: var(--fg-muted); }
.lp-comments-icon { color: var(--border-default); margin-bottom: 4px; }
.lp-comments-title { font-size: 14px; font-weight: 600; color: var(--fg-default); }
.lp-comments-subtitle { font-size: 12px; max-width: 220px; }
.lp-comments button { margin-top: var(--spacing-s); }

@media (max-width: 860px) {
  .lp-columns { flex-direction: column; }
  .lp-sidebar { width: 100%; }
}

/* ==========================================================================
   Voice call
   ========================================================================== */

.voice-screen { display: flex; flex-direction: column; height: 100vh; }
.voice-body { flex: 1; min-height: 0; display: flex; }
.voice-main {
  flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column;
  background: linear-gradient(135deg, #E2EBFD, #E3D2F9);
}
.chat-countdown-row-center { justify-content: center; }
.voice-center { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--spacing-l); padding: 24px 40px; }

.voice-tiles { display: flex; width: 100%; max-width: 720px; gap: 16px; }
.voice-tile {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 16px;
  background: var(--bg-surface); border-radius: var(--radius-large); padding: 20px 16px 24px;
  box-shadow: inset 0 0 0 1px var(--grey-200), 0 0 0 10px rgba(199, 201, 209, 0.18);
  transition: box-shadow 150ms ease-out;
}
.voice-tile-name { font-size: 16px; line-height: 22px; font-weight: 600; color: var(--fg-default); }
.voice-tile-ring {
  width: 180px; height: 180px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.voice-tile-ai .voice-tile-ring { background: radial-gradient(circle, rgba(227, 210, 249, 0.6) 0%, rgba(227, 210, 249, 0.6) 60%, transparent 70%); }
.voice-tile-learner .voice-tile-ring { background: radial-gradient(circle, rgba(226, 235, 253, 0.7) 0%, rgba(226, 235, 253, 0.7) 60%, transparent 70%); }
.voice-tile-avatar { width: 132px; height: 132px; }
.voice-tile-ai.voice-tile-active { box-shadow: inset 0 0 0 2px #8F4BE7, 0 0 0 10px rgba(143, 75, 231, 0.12), 0 0 0 22px rgba(143, 75, 231, 0.06); }
.voice-tile-learner.voice-tile-active { box-shadow: inset 0 0 0 2px #0A47C2, 0 0 0 10px rgba(10, 71, 194, 0.12), 0 0 0 22px rgba(10, 71, 194, 0.06); }

.voice-waveform { display: flex; align-items: center; justify-content: center; gap: 5px; height: 22px; }
.voice-waveform span { width: 3px; border-radius: 2px; height: 4px; transition: height 120ms; background: var(--grey-300); }
.voice-tile-ai .voice-waveform span { background: #8F4BE7; }
.voice-tile-learner .voice-waveform span { background: #0A47C2; }
.voice-tile-ai.voice-tile-active .voice-waveform span:nth-child(1) { height: 16px; }
.voice-tile-ai.voice-tile-active .voice-waveform span:nth-child(2) { height: 9px; }
.voice-tile-ai.voice-tile-active .voice-waveform span:nth-child(3) { height: 20px; }
.voice-tile-ai.voice-tile-active .voice-waveform span:nth-child(4) { height: 11px; }
.voice-tile-learner.voice-tile-active .voice-waveform span:nth-child(1) { height: 18px; }
.voice-tile-learner.voice-tile-active .voice-waveform span:nth-child(2) { height: 8px; }
.voice-tile-learner.voice-tile-active .voice-waveform span:nth-child(3) { height: 14px; }
.voice-tile-learner.voice-tile-active .voice-waveform span:nth-child(4) { height: 20px; }
@media (prefers-reduced-motion: reduce) {
  .voice-tile, .voice-waveform span { transition: none; }
}

/* Subtitle-style: fixed two-line window (the latest lines scroll into view,
   see showCaption() in app.js) so the call layout never jumps as the
   AI's reply is revealed word by word. */
.voice-caption {
  /* Vertical breathing room comes from transparent borders, not padding:
     padding scrolls with the text and would leave a half-cut line at the
     top; borders don't, so exactly the last two lines show. */
  width: min(520px, 100%); box-sizing: border-box; border-radius: var(--radius-large);
  padding: 0 20px; border-top: 10px solid transparent; border-bottom: 10px solid transparent;
  font-size: 14px; line-height: 20px; height: calc(2 * 20px + 20px); overflow: hidden;
  color: var(--fg-default); text-align: center; margin: 0;
}
/* New words fade and un-blur in; opacity/filter work on inline spans, so
   word spacing and line wrapping stay exactly as plain text. */
.voice-caption-word { animation: rp-caption-word-in 320ms ease-out both; }
@keyframes rp-caption-word-in {
  from { opacity: 0; filter: blur(3px); }
  to { opacity: 1; filter: blur(0); }
}
@media (prefers-reduced-motion: reduce) {
  .voice-caption-word { animation: none; }
}
.voice-caption-ai { background: rgba(255, 255, 255, 0.86); }
.voice-caption-learner { background: var(--brand-100); }
.voice-status { margin: 0; font-size: 13px; color: var(--grey-700); }
/* Per-stage latency readout for the cascaded STT/TTS call */
.voice-timing { margin: 0; font-size: 12px; font-family: ui-monospace, monospace; color: var(--grey-500); }
.voice-controls { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px 24px 24px; }
.voice-talk-button {
  height: 44px; padding: 0 20px; border: 0; border-radius: var(--radius-default);
  background: var(--bg-brand); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
  user-select: none; touch-action: none;
}
.voice-talk-button:disabled { opacity: 0.5; cursor: default; }
.voice-talk-button:active:not(:disabled) { background: var(--brand-700); }
.voice-mute-button {
  height: 44px; padding: 0 16px; border-radius: var(--radius-default); border: 1px solid var(--border-default);
  background: var(--bg-surface); color: var(--fg-subtle); font-size: 14px; font-weight: 600; cursor: pointer;
}
.voice-mute-button.muted { border-color: var(--red-600); color: var(--red-600); }

/* Figma control bar: CC · mic · settings in one white pill. */
.voice-control-bar {
  display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: var(--radius-large);
  background: var(--bg-surface); box-shadow: var(--shadow-default);
}
.voice-ctrl {
  position: relative; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius-default); background: transparent; color: var(--fg-subtle); cursor: pointer;
}
.voice-ctrl:hover { background: var(--bg-subtle); color: var(--fg-default); }
.voice-ctrl.is-off { color: var(--fg-muted); }
.voice-mic-toggle { background: var(--bg-brand); color: #fff; }
.voice-mic-toggle:hover { background: var(--brand-700); color: #fff; }
.voice-mic-toggle.is-muted { background: var(--red-600); }
.voice-mic-toggle.is-muted:hover { background: var(--red-600); filter: brightness(0.92); }
/* Dark tooltip above the control, as in the Figma ("Mute microphone (Space)"). */
.voice-ctrl[data-tooltip]:hover::after, .voice-ctrl[data-tooltip]:focus-visible::after {
  content: attr(data-tooltip); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  white-space: nowrap; padding: 5px 9px; border-radius: 6px; background: var(--grey-900, #18191d); color: #fff;
  font-size: 12px; font-weight: 500; pointer-events: none; z-index: 10;
}
.voice-settings-wrap { position: relative; }
.voice-settings-wrap:has(.voice-settings-menu:not([hidden])) .voice-ctrl::after { display: none; }
.voice-settings-menu {
  position: absolute; bottom: calc(100% + 10px); right: 0; width: 290px; padding: var(--spacing-m);
  border-radius: var(--radius-large); background: var(--bg-surface); box-shadow: var(--shadow-default);
  display: flex; flex-direction: column; gap: var(--spacing-s); z-index: 20; text-align: left;
}
.voice-settings-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--fg-default); }
.voice-settings-option { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: var(--radius-default); cursor: pointer; }
.voice-settings-option:hover { background: var(--bg-subtle); }
.voice-settings-option input { margin-top: 3px; accent-color: var(--bg-brand); }
.voice-settings-option span { display: flex; flex-direction: column; gap: 2px; }
.voice-settings-option strong { font-size: 13px; color: var(--fg-default); }
.voice-settings-option small { font-size: 12px; line-height: 16px; color: var(--fg-subtle); }
.voice-settings-option.is-disabled { opacity: 0.5; cursor: default; }
.voice-settings-note { margin: 0; font-size: 12px; color: var(--fg-muted); }
.voice-fallback-card {
  max-width: 420px; padding: var(--spacing-l); border-radius: var(--radius-large); background: var(--bg-surface);
  box-shadow: var(--shadow-default); display: flex; flex-direction: column; gap: var(--spacing-s); text-align: center;
}
.voice-fallback-title { margin: 0; font-size: 16px; font-weight: 600; color: var(--fg-default); }
.voice-fallback-body { margin: 0; font-size: 14px; line-height: 20px; color: var(--fg-subtle); }
.voice-fallback-technical { margin: 0; font-size: 13px; color: var(--fg-muted); font-family: monospace; }
.voice-fallback-actions { display: flex; gap: var(--spacing-s); margin-top: var(--spacing-xs); }
.voice-fallback-actions .button-secondary, .voice-fallback-actions .button-primary { flex: 1; display: flex; align-items: center; justify-content: center; }

/* 3615Learn embed (Slack popover): the outcome scrolls full width, so its
   scrollbar sits at the popover's edge instead of floating mid-screen. */
.is-embedded .outcome-body { max-width: none; padding-left: max(var(--spacing-l), calc((100% - 672px) / 2)); padding-right: max(var(--spacing-l), calc((100% - 672px) / 2)); }
