:root {
  color-scheme: light;
  --bg: #eef3ff;
  --paper: #ffffff;
  --navy: #151a52;
  --navy-2: #2b2fa8;
  --line: #d9e3ef;
  --text: #1d224a;
  --muted: #607386;
  --orange: #ff6b2c;
  --orange-2: #ff8a3c;
  --green: #00b67a;
  --green-2: #009a67;
  --violet: #7a5cff;
  --cyan: #16c4ff;
  --danger: #ff6b6b;
  --shadow: 0 16px 36px rgba(34, 45, 128, 0.14);
  --radius-card: 14px;
  --radius-control: 10px;
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 22px;
}

body.theme-dark {
  --bg: #0e1220;
  --paper: #141a2d;
  --navy: #e8ecff;
  --navy-2: #99a9ff;
  --line: #2a3555;
  --text: #e6ebff;
  --muted: #a8b5d4;
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 0 0, rgba(122, 92, 255, 0.2), transparent 35%),
    radial-gradient(circle at 100% 0, rgba(22, 196, 255, 0.18), transparent 30%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  min-height: 100vh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #f3f5ff 100%);
  padding: 22px;
  width: 280px;
  transition: width 0.3s ease;
  overflow: hidden;
  white-space: nowrap;
}

.app-sidebar.collapsed {
  width: 80px;
  padding: 22px 12px;
}

.app-sidebar.collapsed .brand-text-wrap,
.app-sidebar.collapsed .nav-text {
  display: none;
}

.app-sidebar.collapsed .nav-item {
  text-align: center;
  padding: 13px 0;
}

.app-sidebar.collapsed .nav-icon {
  margin-right: 0;
  font-size: 20px;
}

.app-sidebar.collapsed .theme-label {
  display: none;
}

.app-sidebar.collapsed .collapse-btn {
  transform: rotate(180deg);
}

.app-sidebar.collapsed .theme-toggle-container {
  justify-content: center;
}

.app-sidebar.collapsed .brand-lockup {
  flex-direction: column;
  gap: 16px;
}

.app-sidebar.collapsed .auth-login-btn {
  padding: 10px;
  gap: 0;
}

.app-sidebar.collapsed .auth-profile {
  justify-content: center;
}

.app-sidebar.collapsed .logout-btn {
  display: none;
}

.app-main {
  min-width: 0;
  padding: 32px 36px;
  max-width: 1180px;
}

.app-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-text-wrap {
  flex: 1;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), var(--navy-2));
  color: #ffffff;
  font-weight: 900;
}

.brand-lockup p {
  margin: 0;
  color: var(--navy);
  font-weight: 900;
  font-size: 18px;
}

.brand-lockup span,
.side-card span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.side-nav {
  display: grid;
  gap: 8px;
}

.nav-item {
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 13px 14px;
  text-align: left;
  font-weight: 850;
  display: flex;
  align-items: center;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  margin-right: 8px;
  color: var(--navy-2);
}

.nav-item.active,
.nav-item:hover {
  background: linear-gradient(90deg, rgba(122, 92, 255, 0.14), rgba(22, 196, 255, 0.12));
  color: var(--navy);
  box-shadow: inset 0 0 0 1px rgba(122, 92, 255, 0.25);
}

.nav-item.active {
  font-weight: 900;
}

.auth-container {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 16px 12px 0;
  display: flex;
  flex-direction: column;
}

.auth-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--navy);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-login-btn:hover {
  background: rgba(15, 23, 42, 0.04);
}

.google-icon {
  width: 20px;
  height: 20px;
}

.auth-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
}

.profile-pic {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-name {
  flex: 1;
  font-weight: 700;
  color: var(--navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
}

.logout-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
}

.logout-btn:hover {
  color: #ef4444;
}

.logout-icon {
  width: 18px;
  height: 18px;
}

.pro-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 4px;
  background: linear-gradient(135deg, #F6D365 0%, #FDA085 100%);
  color: #1a1a2e;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 0 8px rgba(246, 211, 101, 0.4);
  flex-shrink: 0;
}

.theme-toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 10px 0;
}

.theme-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  flex: 1;
}

.minimal-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
}

.minimal-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.minimal-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--line);
  transition: .4s;
  border-radius: 20px;
}

.minimal-toggle .slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.minimal-toggle input:checked + .slider {
  background-color: var(--violet);
}

.minimal-toggle input:checked + .slider:before {
  transform: translateX(16px);
}

.collapse-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 24px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, color 0.2s ease;
}

.collapse-btn:hover {
  color: var(--violet);
}

.breadcrumbs {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.walkthrough-card {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: min(320px, calc(100% - 28px));
  z-index: 20;
  border: 1px solid #dce3f8;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 12px;
}

.walkthrough-card strong {
  color: var(--navy);
}

.walkthrough-card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.walkthrough-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.btn-loading {
  position: relative;
  opacity: 0.85;
  pointer-events: none;
}

.btn-loading::after {
  content: "";
  width: 12px;
  height: 12px;
  margin-left: 8px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: #ffffff;
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  animation: spin 0.9s linear infinite;
}

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

.side-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 140, 0, 0.1), rgba(15, 76, 129, 0.06));
  padding: 14px;
}

.side-card strong {
  display: block;
  margin: 8px 0;
  color: var(--navy);
}

.side-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.eyebrow,
.tag {
  margin: 0 0 6px;
  color: var(--navy-2);
  text-transform: uppercase;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 800;
}

.page-greeting {
  margin: 0 0 4px;
  color: var(--navy);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--navy);
  font-size: clamp(28px, 3.2vw, 42px);
  line-height: 1.15;
}

h2 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
  gap: 18px;
  margin-bottom: 16px;
}

.hero-panel > div {
  border: 1px solid #d8dffd;
  border-radius: var(--radius-card);
  background: linear-gradient(150deg, #ffffff 0%, #f4f6ff 100%);
  box-shadow: var(--shadow);
  padding: var(--space-4);
}

.hero-kicker {
  margin: 0 0 8px;
  color: var(--violet);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}

.hero-copy {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 58ch;
  line-height: 1.55;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.hero-cta-row .primary,
.hero-cta-row .secondary {
  width: auto;
  margin: 0;
  min-width: 180px;
}

.hero-progress-card span {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
}

.hero-progress-card strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: clamp(24px, 2.6vw, 34px);
}

.hero-progress-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.progress-track {
  height: 10px;
  margin-top: 14px;
  border-radius: 999px;
  background: #e6eaff;
  overflow: hidden;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--violet), var(--cyan));
  transition: width 200ms ease;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.trust-strip-footer {
  margin-top: 22px;
  margin-bottom: 0;
}

.trust-strip div {
  border: 1px solid #dce3f8;
  border-radius: var(--radius-card);
  background: #ffffffcc;
  padding: 14px;
}

.trust-strip strong {
  display: block;
  color: var(--navy);
  font-size: 14px;
}

.trust-strip p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #d0d8f6;
  padding: 10px 14px;
  color: var(--navy);
  background: #ffffffcc;
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-weight: 800;
}

.status-pill span {
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 0 8px rgba(0, 182, 122, 0.15);
  animation: supportPulse 1.8s infinite;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.source-row a,
.quick-prompts button {
  border: 1px solid var(--line);
  color: var(--navy);
  background: var(--paper);
  border-radius: 8px;
  padding: 10px 12px;
  text-decoration: none;
}

.source-row.vertical {
  display: grid;
  margin-top: auto;
}

.source-row a:hover,
.quick-prompts button:hover {
  border-color: var(--orange);
}

.panel-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.workspace {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 300px;
  gap: 14px;
}

.workspace.two-col {
  grid-template-columns: 320px minmax(0, 1fr);
}

.chat-app {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 680px;
}

.chat-sidebar, .chat-sidebar * {
  box-sizing: border-box;
}

.chat-sidebar {
  border-right: 1px solid var(--line);
  background: transparent;
  overflow-x: hidden !important;
}

.chat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.mini-actions {
  display: flex;
  gap: 6px;
}

.chat-sidebar-head p {
  margin: 0;
  color: var(--navy);
  font-weight: 900;
}

.chat-sidebar-tools {
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.chat-sidebar-tools input {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  font-size: 13px;
}

.chat-sidebar-tools input:focus {
  border-color: var(--violet);
  outline: none;
}

.chat-sidebar-row {
  display: flex;
  gap: 8px;
}

.chat-sidebar .mini-btn {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: normal;
  transition: background 0.2s ease;
}

.chat-sidebar .mini-btn:hover {
  background: rgba(0,0,0,0.04);
}

.mini-btn {
  border: 1px solid #c8ddef;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--navy);
  cursor: pointer;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 850;
}

.chat-app.history-hidden {
  grid-template-columns: 1fr;
}

.chat-app.history-hidden .chat-sidebar {
  display: none;
}

.history-toggle-floating {
  display: none;
  margin: 10px 14px 0;
}

.chat-app.history-hidden .history-toggle-floating {
  display: inline-flex;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.flowbar {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 18px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--muted);
  padding: 11px 12px;
  font-size: 13px;
  font-weight: 800;
}

.step span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #edf4f8;
  color: var(--navy);
}

.step.active {
  border-color: #c7bafc;
  color: var(--navy);
  box-shadow: var(--shadow);
}

.step.active span {
  background: linear-gradient(135deg, var(--violet), var(--navy-2));
  color: #ffffff;
}

.main-card {
  max-width: none;
  margin: 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 10px;
  padding-top: 16px;
}

.profile-advanced {
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 12px 14px;
}

.profile-advanced summary {
  cursor: pointer;
  color: var(--navy);
  font-weight: 900;
  list-style: none;
}

.profile-advanced summary::-webkit-details-marker {
  display: none;
}

.profile-advanced summary::after {
  content: " +";
  color: var(--muted);
  font-weight: 900;
}

.profile-advanced[open] summary::after {
  content: " –";
}

.advanced-grid {
  padding-top: 12px;
}

.priority-card {
  border: 1px solid #dce3f8;
  border-radius: 12px;
  background: #ffffff;
  margin-top: 8px;
  overflow: hidden;
}

.priority-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.priority-head p {
  margin: 0;
  font-weight: 900;
  color: var(--navy);
}

.priority-head span {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  font-weight: 800;
}

.priority-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 14px;
}

.range-field {
  display: grid;
  grid-template-columns: 120px 1fr 36px;
  gap: 10px;
  align-items: center;
  padding: 10px 10px;
  border: 1px solid #e1e9f7;
  border-radius: 12px;
  background: #fbfdff;
}

.range-field label {
  padding: 0;
  margin: 0;
  font-size: 13px;
  color: var(--navy);
  font-weight: 850;
}

.range-field input[type="range"] {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.range-field output {
  display: grid;
  place-items: center;
  width: 36px;
  height: 28px;
  border-radius: 10px;
  background: #eef6ff;
  color: var(--navy);
  font-weight: 900;
}

.profile-visuals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}

.visual-card {
  border: 1px solid #dce3f8;
  border-radius: 12px;
  background: #fbfdff;
  padding: 14px;
}

.visual-card strong {
  display: block;
  margin: 6px 0 10px;
  color: var(--navy);
}

.visual-card .muted {
  padding: 0;
  margin: 0;
}

.edit-history {
  padding: 0 16px 16px;
}

.history-log {
  border: 1px solid #dce3f8;
  border-radius: 12px;
  background: #fbfdff;
  padding: 12px 14px;
}

.history-log strong {
  display: block;
  color: var(--navy);
  margin-bottom: 8px;
}

.history-log ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.profile-actions {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  padding: 0 16px 16px;
}

.profile-actions .primary,
.profile-actions .secondary {
  width: 100%;
  margin: 0;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 0 0 18px;
}

.tool-grid.three-tools {
  display: block;
  margin: 0;
}

.feature-slider {
  position: relative;
  display: grid;
  grid-template-columns: 46px minmax(0, 760px) 46px;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

#featureTrack {
  overflow: visible;
  border-radius: 16px;
}

.slider-arrow {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid #c8ddef;
  border-radius: 50%;
  background: #ffffff;
  color: var(--navy);
  cursor: pointer;
  font-size: 32px;
  box-shadow: 0 6px 16px rgba(15, 76, 129, 0.12);
}

.slider-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: #bfd3e2;
  cursor: pointer;
  padding: 0;
}

.dot.active {
  width: 28px;
  background: linear-gradient(90deg, var(--violet), var(--orange));
}

.live-strip {
  position: sticky;
  top: 12px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #cde8d9;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: linear-gradient(90deg, #f0fff7, #f8fffc);
  box-shadow: 0 10px 24px rgba(26, 89, 63, 0.12);
}

.live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0f6138;
}

.live-status .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1aa667;
  animation: liveBlink 1.1s infinite;
}

.live-strip p {
  margin: 0;
  color: #0f6138;
  font-weight: 700;
}

.live-strip b {
  color: #0f5132;
}

.cleaner-home {
  margin-top: 10px;
  gap: 14px;
}

.insights-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 26px;
  line-height: 1.2;
}

.insights-card > p {
  margin: 8px 0 0;
  color: var(--muted);
}

.pick-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pick-chip {
  border: 1px solid #d7e3ff;
  border-radius: 999px;
  background: #f5f8ff;
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
  padding: 8px 12px;
}

.insight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.insight-actions .primary,
.insight-actions .secondary {
  margin: 0;
  width: auto;
  min-width: 190px;
}

.smart-cards .smart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.smart-card {
  border: 1px solid #d8e2f4;
  border-radius: 12px;
  background: #ffffff;
  text-align: left;
  padding: 14px;
  cursor: pointer;
}

.smart-card strong {
  color: var(--navy);
  font-size: 15px;
}

.smart-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.smart-card:hover {
  border-color: var(--violet);
  transform: translateY(-2px);
}

.smart-card.urgent {
  border-color: rgba(255, 107, 107, 0.45);
  background: #fff6f6;
}

.bottom-updates .eyebrow {
  margin: 0 0 4px;
}

.bottom-updates .home-section-title {
  margin: 0 0 14px;
  color: var(--navy);
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.bottom-updates .bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.update-box {
  border: 1px solid #d8e2f4;
  border-radius: 12px;
  background: #fbfdff;
  padding: 14px;
  min-height: 150px;
}

.update-box h4 {
  margin: 0;
  color: var(--navy);
}

.update-box p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.4;
}

#newsFeed {
  margin-top: 2px;
}

.news-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.news-list li {
  position: relative;
  padding-left: 14px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 14px;
}

.news-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
}

.update-box.success {
  background: linear-gradient(160deg, #f7fffb 0%, #ffffff 100%);
}

.tool-card {
  display: none;
  width: 100%;
  min-height: 320px;
  border: 1px solid #cfe0ec;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(122, 92, 255, 0.16), rgba(22, 196, 255, 0.06) 60%),
    var(--paper);
  color: var(--navy);
  padding: 26px;
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.tool-card.active {
  display: block;
}

.tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--violet);
}

.tool-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--violet);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
}

.tool-card strong {
  display: block;
  max-width: 420px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.16;
  letter-spacing: -0.02em;
}

.tool-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.demo {
  margin-top: 22px;
  border: 1px solid #dbe8f1;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.demo-chat {
  display: grid;
  gap: 8px;
}

.bubble {
  width: fit-content;
  max-width: 86%;
  border-radius: 14px;
  padding: 9px 11px;
  font-size: 12px;
  line-height: 1.35;
  animation: bubbleIn 5s infinite;
  color: #1E293B;
}

.bubble.student {
  justify-self: end;
  background: #eef6ff;
  color: #1E293B;
}

.bubble.bot {
  justify-self: start;
  background: #eef6ff;
  color: #1E293B;
  animation-delay: 1.2s;
}

.typing {
  display: flex;
  gap: 4px;
  align-items: center;
  width: 44px;
  border-radius: 999px;
  background: #eef6ff;
  padding: 8px 10px;
}

.typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--navy-2);
  animation: pulseDot 1.1s infinite ease-in-out;
}

.typing i:nth-child(2) {
  animation-delay: 0.15s;
}

.typing i:nth-child(3) {
  animation-delay: 0.3s;
}

.demo-compare {
  display: grid;
  gap: 10px;
}

.compare-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid #dbe8f1;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
  animation: rowGlow 4.8s infinite;
}

.compare-row b {
  color: #1E293B;
  font-size: 12px;
}

.compare-row em {
  color: var(--green);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.compare-row.active {
  border-color: rgba(40, 167, 69, 0.45);
}

.meter {
  height: 8px;
  border-radius: 999px;
  background: #e7eef4;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  width: 72%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--orange), var(--green));
  animation: meterMove 4.8s infinite;
}

@keyframes bubbleIn {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.9;
  }
  45% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

@keyframes pulseDot {
  0%,
  80%,
  100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

@keyframes rowGlow {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(4px);
  }
}

@keyframes meterMove {
  0%,
  100% {
    width: 48%;
  }
  50% {
    width: 82%;
  }
}

@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes supportPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 182, 122, 0.25); }
  50% { box-shadow: 0 0 0 10px rgba(0, 182, 122, 0); }
}

.quick-strip {
  display: grid;
  grid-template-columns: 1fr 1fr 180px;
  gap: 12px;
  margin: 8px 0 0;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 22px;
}

.home-grid .compact-card {
  min-height: 0;
}

.home-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
  padding: var(--space-4);
  box-shadow: var(--shadow);
}

.home-card.wide {
  grid-column: 1 / -1;
}

.home-card span {
  display: block;
  margin-bottom: 12px;
  color: var(--violet);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.home-card ol {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  line-height: 1.8;
}

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

.mini-steps div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fbfdff;
  padding: 16px;
}

.mini-steps b {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(122, 92, 255, 0.2), rgba(22, 196, 255, 0.2));
  color: var(--navy-2);
  font-size: 13px;
}

.mini-steps p {
  margin: 10px 0 0;
  color: var(--navy);
  font-weight: 700;
  line-height: 1.35;
}

.tool-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tool-pills button {
  border: 1px solid #d6d9ff;
  border-radius: 999px;
  background: #f4f2ff;
  color: var(--navy);
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 800;
}

.tool-pills button:hover {
  border-color: var(--violet);
  background: #ece7ff;
}

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

.feature-list p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
  color: var(--muted);
  padding: 14px;
  line-height: 1.45;
}

.feature-list strong {
  display: block;
  margin-bottom: 6px;
  color: var(--navy);
}

.resource-stack {
  display: grid;
  gap: 10px;
}

.resource-stack div,
.resource-link {
  border: 1px solid #dce3f8;
  border-radius: 12px;
  background: #ffffff;
  padding: 16px;
}

.resource-stack strong {
  display: block;
  margin-bottom: 4px;
  color: var(--navy);
}

.resource-stack p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.resource-stack.compact {
  gap: 8px;
}

.resource-link {
  color: var(--navy);
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.resource-link:hover {
  border-color: var(--violet);
}

.quick-strip > div {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  padding: 14px 16px;
}

.quick-strip span,
.decision-notes p {
  color: var(--muted);
}

.quick-strip strong {
  display: block;
  margin-top: 4px;
  color: var(--navy);
}

.view-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 14px;
}

.view-head.compact-head {
  justify-content: space-between;
}

.icon-back {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #c8ddef;
  border-radius: 50%;
  background: #eef6ff;
  color: var(--navy);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.support-mini {
  margin-left: auto;
}

.compare-only {
  grid-template-columns: minmax(0, 720px);
}

.compare-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 0 16px 10px;
}

.compare-actions .secondary {
  width: auto;
  margin: 0;
}

.compare-table-panel,
.compare-saved-panel {
  margin: 0 16px 12px;
}

.compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 680px;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

.compare-table th {
  color: var(--navy);
  background: #ffffff;
}

.compare-metric {
  color: var(--navy);
  font-weight: 900;
}

.compare-better {
  border: 1px solid rgba(0, 182, 122, 0.3);
  background: #effdf6;
  border-radius: 10px;
  padding: 8px;
}

.compare-mid {
  border: 1px solid #dce3f8;
  background: #fbfdff;
  border-radius: 10px;
  padding: 8px;
}

.compare-low {
  border: 1px solid rgba(255, 138, 60, 0.25);
  background: #fff9ef;
  border-radius: 10px;
  padding: 8px;
}

.preference-intro {
  display: grid;
  grid-template-columns: 1fr repeat(5, auto);
  gap: 12px;
  align-items: center;
  padding: 16px;
}

.preference-intro p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.preference-intro .primary,
.preference-intro .secondary {
  width: auto;
  margin: 0;
  white-space: nowrap;
}

.preference-meta {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 0 16px 14px;
}

.meta-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  border: 1px solid #dce3f8;
  background: #fbfdff;
  border-radius: 999px;
  padding: 8px 12px;
}

.meta-pill strong {
  color: var(--navy);
  font-size: 18px;
}

.meta-pill span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.pref-warnings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.warning-chip {
  border: 1px solid rgba(255, 138, 60, 0.35);
  background: #fff9ef;
  color: #7a4a00;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 800;
}

.pref-layout {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 12px;
  padding: 0 16px 14px;
}

.pref-list-wrap,
.pref-history-wrap {
  border: 1px solid #dce3f8;
  border-radius: 14px;
  background: #fbfdff;
  padding: 12px;
}

.pref-list-wrap h4,
.pref-history-wrap h4 {
  margin: 0 0 10px;
  color: var(--navy);
}

.preference-dnd-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.pref-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid #dce3f8;
  border-radius: 12px;
  background: #ffffff;
  padding: 10px;
}

.pref-item.safe {
  border-left: 5px solid #00b67a;
}

.pref-item.balanced {
  border-left: 5px solid #ff8a3c;
}

.pref-item.ambitious {
  border-left: 5px solid #ff6b6b;
}

.drag-handle {
  cursor: grab;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 1px;
}

.pref-main b {
  color: var(--navy);
}

.pref-main p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pref-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pref-band {
  border-radius: 999px;
  padding: 4px 8px;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 900;
}

.pref-band.safe {
  background: #effdf6;
  color: #0f6138;
}

.pref-band.balanced {
  background: #fff9e6;
  color: #7a4a00;
}

.pref-band.ambitious {
  background: #fff2f2;
  color: #7f1d1d;
}

.remove-pref {
  margin: 0;
}

.preference-history {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.support-dialog {
  width: min(520px, calc(100% - 28px));
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  color: var(--text);
  padding: 0;
  box-shadow: var(--shadow);
}

.support-dialog::backdrop {
  background: rgba(16, 32, 51, 0.28);
}

.support-dialog .secondary {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 13px 14px;
}

.view-head h3 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(30px, 4vw, 52px);
  line-height: 1;
}

.view-head .eyebrow {
  margin-bottom: 4px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: var(--space-3);
  border-bottom: 1px solid var(--line);
}

.panel-head p {
  margin: 0;
  font-weight: 800;
}

.chances-panel {
  overflow: hidden;
}

.chances-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 16px 0;
}

.tab-pill {
  border: 1px solid #d8d0ff;
  background: #f4f2ff;
  color: var(--navy);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 900;
}

.tab-pill.active {
  border-color: rgba(122, 92, 255, 0.5);
  background: linear-gradient(90deg, rgba(122, 92, 255, 0.18), rgba(22, 196, 255, 0.12));
}

.chances-filters {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 10px;
  padding: 12px 16px 6px;
}

.chances-filters label {
  padding: 0;
}

.chances-notice {
  margin: 8px 16px 0;
  border: 1px solid #dce3f8;
  border-radius: 12px;
  background: #fbfdff;
  padding: 12px 14px;
  color: var(--muted);
  line-height: 1.45;
}

.table-wrap {
  overflow: auto;
  padding: 12px 16px 16px;
}

.chances-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 920px;
}

.chances-table th,
.chances-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  font-size: 13px;
}

.chances-table th {
  position: sticky;
  top: 0;
  background: #ffffff;
  z-index: 2;
  color: var(--navy);
}

.inst-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inst-badge b {
  color: var(--navy);
}

.inst-type {
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid #dce3f8;
  border-radius: 999px;
  padding: 4px 8px;
  background: #fbfdff;
}

.verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 12px;
  border: 1px solid transparent;
}

.verdict.safe {
  background: #effdf6;
  border-color: rgba(0, 182, 122, 0.28);
  color: #0f6138;
}

.verdict.borderline {
  background: #fff9e6;
  border-color: rgba(255, 138, 60, 0.35);
  color: #7a4a00;
}

.verdict.reach {
  background: #fff2f2;
  border-color: rgba(255, 107, 107, 0.4);
  color: #7f1d1d;
}

.row-safe {
  background: linear-gradient(90deg, rgba(0, 182, 122, 0.06), transparent 46%);
}

.row-borderline {
  background: linear-gradient(90deg, rgba(255, 138, 60, 0.08), transparent 46%);
}

.row-reach {
  background: linear-gradient(90deg, rgba(255, 107, 107, 0.08), transparent 46%);
}

.row-action {
  white-space: nowrap;
}

.add-pref {
  border: 1px solid #dce3f8;
  background: #ffffff;
  color: var(--navy);
  border-radius: 12px;
  padding: 9px 10px;
  cursor: pointer;
  font-weight: 900;
}

.add-pref:hover {
  border-color: var(--violet);
}

label {
  display: grid;
  gap: 8px;
  padding: 0 16px 14px;
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
  resize: vertical;
  border-radius: var(--radius-control);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(15, 76, 129, 0.12);
}

.primary,
.secondary,
.send {
  border: 0;
  cursor: pointer;
  font-weight: 850;
}

.primary,
.secondary {
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  padding: 12px 14px;
}

.primary {
  background: linear-gradient(90deg, var(--orange), var(--orange-2));
  color: #ffffff;
  border-radius: 10px;
}

.secondary,
.send {
  background: linear-gradient(90deg, var(--violet), var(--navy-2));
  color: #ffffff;
  border-radius: 10px;
}

.secondary.subtle {
  background: #f1eeff;
  color: var(--navy-2);
  border: 1px solid #d8d0ff;
}

.secondary:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.messages {
  height: 480px;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mode-pill {
  border: 1px solid #d8d0ff;
  background: #f4f2ff;
  color: var(--navy);
  border-radius: 999px;
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.mode-pill.active {
  border-color: rgba(122, 92, 255, 0.5);
  background: linear-gradient(90deg, rgba(122, 92, 255, 0.18), rgba(22, 196, 255, 0.12));
}

.chat-empty {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px dashed #c8ddef;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border-radius: 14px;
  padding: 16px;
}

.mascot {
  width: 160px;
  height: 140px;
  display: grid;
  place-items: center;
}

.empty-copy strong {
  color: var(--navy);
  font-size: 18px;
}

.empty-copy p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.chip {
  border: 1px solid #dce3f8;
  background: #ffffff;
  color: var(--navy);
  border-radius: 999px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 850;
  text-align: left;
}

.chip:hover {
  border-color: var(--violet);
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.action-btn {
  border: 1px solid #dce3f8;
  background: #ffffff;
  color: var(--navy);
  border-radius: 999px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 900;
  font-size: 12px;
}

.action-btn.active {
  border-color: rgba(122, 92, 255, 0.6);
  background: #f4f2ff;
}

.followups {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.followups .chip {
  padding: 7px 10px;
  font-size: 12px;
  background: #fbfdff;
}

.message {
  width: min(82%, 720px);
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #f7fafc;
  border-radius: var(--radius-control);
}

.message span {
  display: block;
  margin-bottom: 6px;
  color: var(--navy-2);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.message p {
  margin-bottom: 0;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
}

.message.user {
  align-self: flex-end;
  background: #eef6ff;
  border-color: #c8ddef;
}

.quick-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 14px;
}

.composer {
  display: grid;
  grid-template-columns: 1fr 96px;
  gap: 10px;
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
}

.send {
  min-height: 54px;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
  padding: 0 16px;
}

.history-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  max-height: 610px;
  overflow-y: auto;
}

.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.history-item {
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  padding: 12px 16px;
  margin-bottom: 4px;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease;
}

.history-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

b.history-title {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  color: var(--fg);
  font-size: 13px;
}

.history-title-wrap {
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
}

.rename-btn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease;
  font-size: 12px;
  padding: 2px;
}

.history-item:hover .rename-btn {
  opacity: 0.6;
}

.rename-btn:hover {
  opacity: 1 !important;
}

.history-item > span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

#newChatBtn {
  margin: 0;
}

.decision-notes {
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
  padding: 12px;
}

.decision-notes p {
  margin: 0;
  line-height: 1.5;
}

#compareResult {
  padding-top: 0;
}

.compare-analysis {
  white-space: pre-wrap;
}

.recommendations,
.ticket {
  padding: 0 16px 16px;
}

.rec-card,
.ticket-card {
  border: 1px solid var(--line);
  background: #fbfdff;
  border-radius: var(--radius-control);
  padding: 11px 12px;
  margin-bottom: 10px;
}

/* Consistent section heading rhythm */
.panel-head p,
.pref-list-wrap h4,
.pref-history-wrap h4,
.update-box h4 {
  letter-spacing: -0.01em;
}

.rec-card strong {
  color: var(--text);
}

.rec-card span {
  color: var(--green);
  font-size: 12px;
  text-transform: uppercase;
}

.rec-card p,
.ticket-card p {
  color: var(--muted);
  margin: 8px 0 0;
  line-height: 1.45;
}

.warning {
  border-color: rgba(255, 107, 107, 0.45);
  color: #7f1d1d;
}

@media (max-width: 1120px) {
  .workspace,
  .workspace.two-col,
  .chat-app,
  .preference-intro,
  .home-grid,
  .mini-steps,
  .feature-list,
  .quick-strip,
  .hero-panel,
  .trust-strip,
  .smart-cards .smart-grid,
  .bottom-updates .bottom-grid,
  .profile-visuals,
  .priority-grid,
  .chances-filters,
  .pref-layout,
  .compare-actions {
    grid-template-columns: 1fr;
  }

  .live-strip {
    top: 8px;
    flex-direction: column;
    align-items: flex-start;
  }

  .feature-slider {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
  }

  .slider-arrow {
    width: 38px;
    height: 38px;
  }

  .tool-card {
    min-height: 390px;
    padding: 22px;
  }

  .chat-sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .history-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 240px);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .messages {
    height: 470px;
  }

  .chat-empty {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .app-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 12px 8px;
    align-items: center;
  }

  .app-main {
    padding: 14px;
    min-width: 0;
  }

  .app-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .side-nav {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .brand-lockup {
    justify-content: center;
  }

  .brand-lockup div:not(.brand-mark) {
    display: none;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }

  .nav-item {
    min-height: 54px;
    padding: 8px 4px;
    text-align: center;
    font-size: 10px;
    line-height: 1.1;
  }

  .source-row.vertical,
  .side-card,
  .side-prefs {
    display: none;
  }

  h1 {
    font-size: 27px;
  }

  .flowbar {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .step {
    padding: 9px;
  }

  .composer {
    grid-template-columns: 1fr;
  }

  .message {
    width: 100%;
  }

  .flowbar,
  .profile-grid,
  .profile-actions {
    grid-template-columns: 1fr;
  }

  .tool-card {
    min-height: 190px;
    padding: 22px;
  }
}

/* Dark mode surface overrides */
body.theme-dark .app-sidebar {
  background: linear-gradient(180deg, #11182c 0%, #0f1526 100%);
}

body.theme-dark .brand-logo {
  filter: invert(1) hue-rotate(180deg) brightness(1.5);
}

body.theme-dark .auth-login-btn {
  color: #e2e8f0;
  border-color: #2a3555;
}

body.theme-dark .auth-login-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

body.theme-dark .auth-container {
  border-color: #2a3555;
}

body.theme-dark .profile-name {
  color: #e2e8f0;
}

body.theme-dark .side-prefs,
body.theme-dark .walkthrough-card,
body.theme-dark .trust-strip div,
body.theme-dark .update-box,
body.theme-dark .visual-card,
body.theme-dark .history-log,
body.theme-dark .chat-empty,
body.theme-dark .pref-list-wrap,
body.theme-dark .pref-history-wrap,
body.theme-dark .pref-item,
body.theme-dark .panel,
body.theme-dark .home-card,
body.theme-dark .tool-card,
body.theme-dark .chances-notice,
body.theme-dark .support-dialog,
body.theme-dark .history-item,
body.theme-dark .rec-card,
body.theme-dark .ticket-card,
body.theme-dark .smart-card,
body.theme-dark .compare-low,
body.theme-dark .compare-mid,
body.theme-dark .compare-better {
  background: #151d33 !important;
  border-color: #2a3555 !important;
}

body.theme-dark .hero-panel > div {
  background: linear-gradient(150deg, #151d33 0%, #12192d 100%);
  border-color: #2a3555;
}

body.theme-dark .live-strip {
  background: linear-gradient(90deg, #133126, #11281f);
  border-color: #245845;
}

body.theme-dark .compare-table th,
body.theme-dark .chances-table th {
  background: #141a2d;
  color: var(--navy);
}

body.theme-dark .chances-table td,
body.theme-dark .compare-table td {
  border-bottom-color: #2a3555;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  background: #0f1526;
  color: var(--text);
  border-color: #2a3555;
}

body.theme-dark .secondary.subtle,
body.theme-dark .mini-btn,
body.theme-dark .action-btn,
body.theme-dark .chip,
body.theme-dark .add-pref,
body.theme-dark .resource-link {
  background: #1a2440;
  color: var(--navy);
  border-color: #33466e;
}

body.theme-dark .message.user {
  background: #1b2742;
  border-color: #3b4c74;
}

body.theme-dark .message.bot,
body.theme-dark .message {
  background: #121a2e;
  border-color: #2a3555;
}

body.theme-dark .inst-type,
body.theme-dark .pref-band,
body.theme-dark .meta-pill,
body.theme-dark .warning-chip {
  border-color: #33466e;
}

/* Segmented Control (Toggle) */
.segmented-control {
  display: flex;
  gap: 8px; /* Gap so individual buttons can have full borders */
  margin: 0 16px 16px;
}

.segment-btn {
  flex: 1;
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

body.theme-dark .segment-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
}

/* Hover state */
.segment-btn:hover {
  color: rgba(0, 0, 0, 1);
  border-color: rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.08);
}

body.theme-dark .segment-btn:hover {
  color: rgba(255, 255, 255, 1);
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.1);
}

/* Active state */
.segment-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

body.theme-dark .segment-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

@media (max-width: 600px) {
  .segment-btn {
    padding: 14px 16px; /* easier to tap on phone */
  }
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(15, 23, 42, 0.92);
  color: #ffffff;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, transform 0.4s ease, visibility 0.4s ease;
  pointer-events: none;
  max-width: 420px;
  text-align: center;
  line-height: 1.4;
}

.toast.visible {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

body.theme-dark .toast {
  background: rgba(30, 41, 59, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Add to preference button states */
.add-pref.added {
  background: rgba(0, 182, 122, 0.15) !important;
  color: #00b67a !important;
  border-color: rgba(0, 182, 122, 0.4) !important;
  cursor: default;
  pointer-events: none;
}

.add-pref.already {
  background: rgba(251, 191, 36, 0.1) !important;
  color: #d97706 !important;
  border-color: rgba(251, 191, 36, 0.3) !important;
  cursor: default;
  pointer-events: none;
}

.launch-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  color: var(--navy);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.launch-card:hover {
  transform: translateY(-4px);
  border-color: var(--violet);
  box-shadow: var(--shadow);
}

.launch-card .launch-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.launch-card strong {
  font-size: 18px;
  font-weight: 900;
  display: block;
}

.launch-card small {
  color: var(--muted);
  margin-top: 6px;
  font-size: 13px;
  display: block;
}

.prompt-card {
  background: var(--surface);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 15px;
  font-size: 14px;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
  white-space: normal;
  word-wrap: break-word;
}

.prompt-card:hover {
  background: var(--nav-hover);
  border-color: var(--violet);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transform: translateY(-1px);
}

#emptyChips {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(250px, 1fr)) !important;
  gap: 20px !important;
  width: 100% !important;
  max-width: 700px !important;
  margin: 0 auto !important;
}

/* ─── Paywall Modal ─────────────────────────────────────────────────────── */
.paywall-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.paywall-card {
  position: relative;
  max-width: 420px;
  width: 90%;
  padding: 40px 36px;
  border-radius: 20px;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 100%);
  border: 1px solid rgba(122, 92, 255, 0.3);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(122, 92, 255, 0.15);
  color: #e2e8f0;
  text-align: center;
  animation: paywallIn 0.35s ease;
}

@keyframes paywallIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.paywall-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.2s;
}

.paywall-close:hover {
  color: #ffffff;
}

.paywall-badge {
  display: inline-block;
  padding: 4px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--violet), #16c4ff);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.paywall-headline {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 900;
  color: #ffffff;
}

.paywall-subtext {
  margin: 0 0 24px;
  font-size: 14px;
  color: #94a3b8;
  line-height: 1.6;
}

.paywall-features {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
  text-align: left;
}

.paywall-features li {
  padding: 6px 0;
  font-size: 14px;
  color: #cbd5e1;
}

.paywall-price {
  margin-bottom: 24px;
  font-size: 36px;
  font-weight: 900;
  color: #ffffff;
}

.paywall-price span {
  font-size: 14px;
  font-weight: 500;
  color: #94a3b8;
}

.paywall-cta {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--violet), #16c4ff);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.paywall-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(122, 92, 255, 0.4);
}
