/* Scoped to the funnel; existing chat and workspace styles remain independent. */
.qf-card, .qf-dialog, .qf-notice, .qf-refresh-recovery {
  --qf-text: var(--txt, #ecf2fb);
  --qf-muted: var(--muted, #b0bdd0);
  --qf-panel: var(--panel, #111c2e);
  --qf-border: var(--panel-border, #44546b);
  --qf-accent: var(--signal, #79dcd2);
  color: var(--qf-text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.6;
  overflow-wrap: anywhere;
  color-scheme: dark;
}
.qf-card *, .qf-dialog * { box-sizing: border-box; }
.qf-card {
  flex: 0 0 auto;
  width: 100%;
  margin: 18px 0;
  padding: clamp(16px, 3vw, 26px);
  border: 1px solid var(--qf-border);
  border-radius: 18px;
  background: var(--qf-panel);
}
.qf-card h3, .qf-dialog h2 { margin: 6px 0 14px; font-family: var(--font-display, inherit); font-size: 1.4rem; font-weight: 720; letter-spacing: -0.01em; line-height: 1.25; }
.qf-card h4, .qf-dialog h3, .qf-dialog h4 { margin: 0 0 9px; font-family: var(--font-display, inherit); font-weight: 700; line-height: 1.35; }
.qf-card p, .qf-dialog p { margin: 8px 0 14px; }
.qf-eyebrow { color: var(--qf-muted); font-size: .85rem; font-weight: 700; }
.qf-note { color: var(--qf-muted); font-size: .87rem; }
.qf-price { font-family: var(--font-display, inherit); font-size: 1.6rem; font-weight: 750; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 4px 0 10px; }
.qf-plan-grid, .qf-before-after, .qf-core-services { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.qf-plan-grid { align-items: start; }
.qf-core-services { grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); margin: 18px 0; }
.qf-plan, .qf-service, .qf-tip, .qf-before-after > section, .qf-advanced-next {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--qf-border);
  border-radius: 16px;
  background: var(--surface, transparent);
}
.qf-plan { display: flex; flex-direction: column; align-items: flex-start; }
.qf-plan > .qf-button { margin-top: auto; }
.qf-advanced { border: 2px solid var(--marigold, var(--qf-accent)); }
.qf-advanced .qf-primary { background: var(--marigold, #b9efe7); border-color: var(--marigold, #b9efe7); color: var(--marigold-ink, #123933); }
.qf-advanced .qf-features li::marker { color: var(--marigold, currentColor); }
.qf-plan-promise { font-size: 1.05rem; font-weight: 650; line-height: 1.5; }
.qf-tip { margin: 18px 0; border-inline-start: 3px solid var(--qf-accent); }
.qf-core-choice > h3 { margin-bottom: 18px; }
.qf-direct { padding: 12px 16px; border-inline-start: 3px solid var(--qf-accent); }
.qf-preserve, .qf-reply { white-space: pre-wrap; }
.qf-selection { display:grid; gap:12px; margin-block:18px; min-width:0; }
.qf-selection label { display:flex; flex-wrap:wrap; gap:10px; align-items:center; min-width:0; }
.qf-selection input[type=text] { width:100%; min-width:0; min-height:44px; padding:10px; color:var(--qf-text); background:var(--qf-panel); border:1px solid var(--qf-border); border-radius:8px; font:inherit; }
.qf-selection input[type=checkbox] { width:20px; height:20px; flex-shrink:0; }
.qf-selection label span { flex:1; }
.qf-features { margin: 8px 0 18px; padding-inline-start: 22px; }
.qf-features li { margin-block: 7px; }
.qf-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-block: 16px; }
.qf-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  max-width: 100%;
  padding: 10px 16px;
  border: 1px solid var(--qf-border, #44546b);
  border-radius: 999px;
  background: var(--qf-panel, #111c2e);
  color: var(--qf-text, #ecf2fb);
  font: inherit;
  font-size: .9rem;
  font-weight: 650;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.qf-button:hover { border-color: var(--ink, var(--qf-accent)); }
.qf-primary { background: var(--primary, #b9efe7); border-color: var(--primary, #b9efe7); color: var(--primary-ink, #123933); }
.qf-primary:hover { background: var(--primary-hover, #b9efe7); }
.qf-button:disabled { opacity: .55; cursor: wait; }
.qf-link { color: var(--qf-accent); text-decoration: underline; text-underline-offset: 3px; }
.qf-button:focus-visible, .qf-link:focus-visible,
.qf-card summary:focus-visible, .qf-dialog summary:focus-visible {
  outline: 3px solid var(--qf-accent);
  outline-offset: 4px;
}
.qf-card details, .qf-dialog details { margin-block: 18px; }
.qf-card summary, .qf-dialog summary { min-height: 44px; padding-block: 10px; font-weight: 650; cursor: pointer; }
.qf-catalog > .qf-plan-grid { margin-block-start: 12px; }
.qf-dialog {
  width: min(860px, calc(100vw - 28px));
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: clamp(16px, 4vw, 28px);
  border: 1px solid var(--qf-border);
  border-radius: 18px;
  background: var(--qf-panel);
  overflow: auto;
  overscroll-behavior: contain;
}
.qf-dialog::backdrop { background: rgb(10 22 38 / .6); }
.qf-dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.qf-dialog-head > .qf-button { flex-shrink: 0; }
.qf-access, .qf-preview-box, .qf-checkout-result { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--qf-border); }
.qf-status, .qf-notice { color: var(--qf-muted); font-size: .9rem; }
.qf-status:empty { display: none; }
.qf-reminders { margin-block: 18px; padding-block-start: 14px; border-top: 1px solid var(--qf-border); }
.qf-reminder-label { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.qf-reminder-label input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--qf-accent); }
.qf-reminder-label input:focus-visible { outline: 3px solid var(--qf-accent); outline-offset: 4px; }
.qf-notice { margin: 0; padding: 10px 16px; background: var(--qf-panel); }
.qf-notice[hidden] { display: none; }
.qf-refresh-recovery { padding: 10px 16px; background: var(--qf-panel); border-block-start: 1px solid var(--qf-border); }
.qf-refresh-recovery p { margin: 0 0 8px; }
[data-theme="light"] .qf-card, [data-theme="light"] .qf-dialog, [data-theme="light"] .qf-notice, [data-theme="light"] .qf-refresh-recovery {
  --qf-accent: var(--signal, #166d64);
  color-scheme: light;
}
@media (max-width: 560px) {
  /* Grid's default min-content width can otherwise clip long plan reports
     and the university selector outside a phone's viewport. */
  #app-view .app-layout { grid-template-columns:minmax(0,1fr); }
  #app-view .chat-pane, #app-view #chat { min-width:0; min-height:0; }
  #app-view .sidebar { min-width:0; flex-wrap:wrap; }
  #app-view #chat { padding:14px; }
  #app-view #chat .msg { max-width:100%; box-sizing:border-box; overflow-wrap:anywhere; }
  #app-view .chat-footer .row > * { min-width:0; }
  .qf-plan-grid, .qf-before-after { grid-template-columns: minmax(0, 1fr); }
  .qf-actions > .qf-button { flex: 1 1 100%; }
  .qf-dialog-head { gap: 12px; }
  .qf-dialog-head h2 { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  .qf-card *, .qf-dialog * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
@media print { .qf-card, .qf-dialog, .qf-notice, .qf-refresh-recovery { display: none !important; } }
