/* A shared visual grammar for the comparison, guide and workspace pages. */
:root {
  --ui-card: 16px;
  --ui-card-large: 22px;
  --ui-control: 10px;
  --ui-soft: #edf2e9;
  --ui-border: #d6ded8;
  --ui-border-active: #78958c;
}

/* Page rhythm and typography. The photographic openings keep their own shapes. */
.page { min-width: 0; }
.page :is(.section-bar, .guide-section-heading, .guide-plan-heading, .decision-head) { min-width: 0; }
.page :is(.section-bar, .guide-section-heading, .guide-plan-heading, .decision-head) h2 {
  font-size: clamp(23px, 2.45vw, 32px);
  line-height: 1.18;
  letter-spacing: -.04em;
}
.page :is(.section-bar, .guide-section-heading, .guide-plan-heading, .decision-head) p {
  color: var(--muted);
  line-height: 1.65;
}
.page-heading { padding-block: 14px 34px; }
.page-heading .eyebrow, .profile-cover .eyebrow, .guide-hero .eyebrow { color: var(--muted); }
.page-heading > p { margin-bottom: 0; }
.page-banner { margin-bottom: 26px; }

/* The modules were authored at different times; bring their surfaces together. */
:is(.white-panel, .profile-editor-form fieldset, .offer-card, .route-card,
    .guide-resource, .guide-action, .living-card, .decision-card,
    .decision-route, .decision-task, .decision-life, .quote-matrix-card,
    .referral-card, .review-output, .review-profile, .review-payment-stages,
    .review-facts > div, .review-status-grid > div, .essentials-school) {
  border-color: var(--ui-border);
  border-radius: var(--ui-card);
  box-shadow: none;
}
:is(.quote-review, .referral-section, .essentials-panel, .relocation-panel) {
  border-radius: var(--ui-card-large);
  box-shadow: none;
}
:is(.guide-resource, .guide-action, .decision-card, .decision-route,
    .decision-task, .decision-life, .quote-matrix-card, .referral-card,
    .essentials-school) { background: var(--white); }
.decision-card:first-child, .decision-route, .decision-life { background: var(--ui-soft); }
.referral-section, .quote-review { background: #edf2e9; border-color: #cad9c9; }
.essentials-panel { background: var(--white); border-color: var(--ui-border); }
.essentials-housing { background: #f1f5ec; }
.review-profile, .review-output { background: var(--white); }
.review-facts > div, .review-status-grid > div { background: #f8faf5; }

/* All editable controls share the same height, border and focus treatment. */
.page :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea),
.journey-wizard :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
#modal :is(input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), select, textarea) {
  border: 1px solid #b9c8c3;
  border-radius: var(--ui-control);
  background-color: var(--white);
  color: var(--ink);
  min-height: 46px;
}
.page :is(input, select, textarea):hover,
.journey-wizard :is(input, select, textarea):hover,
#modal :is(input, select, textarea):hover { border-color: var(--ui-border-active); }
.page :is(input, select, textarea):focus-visible,
.journey-wizard :is(input, select, textarea):focus-visible,
#modal :is(input, select, textarea):focus-visible {
  outline: 3px solid var(--atlas-blue);
  outline-offset: 2px;
}
.page :is(input[type="checkbox"], input[type="radio"]) { min-height: 0; accent-color: var(--ink); }
.page .amount-input, .journey-wizard .amount-input { border-radius: var(--ui-control); border-color: #b9c8c3; background: var(--white); }
.page .amount-input input, .journey-wizard .amount-input input { border: 0 !important; background: transparent; }
.page .amount-input:focus-within, .journey-wizard .amount-input:focus-within { outline: 3px solid var(--atlas-blue); outline-offset: 2px; }
.page :is(.form-label, .guide-tools label, .guide-plan-filters label, .essentials-form-grid label) { color: #3f5d61; font-weight: 650; }

/* Same interaction language for filters, selectable tabs and inline links. */
:is(.guide-section-nav a, .guide-map-links a, .guide-saved-filter,
    .essentials-links a, .essentials-inline, .dossier-shortcuts a,
    .review-quote-picker label) {
  border-color: var(--ui-border);
  background: var(--white);
  color: var(--ink);
}
:is(.guide-section-nav a, .guide-map-links a, .guide-saved-filter,
    .essentials-links a, .essentials-inline, .dossier-shortcuts a,
    .review-quote-picker label):hover {
  border-color: var(--ui-border-active);
  background: #f2f6ec;
}
:is(.guide-category-tabs button, .guide-section-nav a, .essentials-options button,
    .review-switch button, .dossier-shortcuts a) { transition: background-color .18s, border-color .18s, color .18s; }
.guide-category-tabs button[aria-pressed="true"] { background: var(--atlas-lime); }
.guide-section-nav a[aria-current], .essentials-options button[aria-pressed="true"],
.review-switch button[aria-pressed="true"] { background: var(--ink); color: var(--white); }

/* Small screens: reduce chrome, preserve comfortable controls and readable grids. */
@media (max-width: 800px) {
  .page :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
  .journey-wizard :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea),
  #modal :is(input:not([type="checkbox"]):not([type="radio"]), select, textarea) { font-size: 16px; }
  .page-heading { padding-block: 7px 28px; }
  .page-banner { margin-bottom: 22px; }
  .review-profile { gap: 10px; }
}
@media (max-width: 620px) {
  .workspace-strip { padding-block: 8px 15px; margin-bottom: 15px; }
  .page :is(.section-bar, .guide-section-heading, .guide-plan-heading, .decision-head) h2 { font-size: clamp(23px, 6vw, 29px); }
  :is(.quote-review, .referral-section, .essentials-panel, .relocation-panel) { border-radius: 18px; }
  :is(.guide-resource, .guide-action, .living-card, .decision-card, .decision-route,
      .decision-task, .decision-life, .quote-matrix-card, .referral-card) { border-radius: 14px; }
  .review-profile > a { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  :is(.guide-category-tabs button, .guide-section-nav a, .essentials-options button,
      .review-switch button, .dossier-shortcuts a) { transition: none; }
}
html[dir="rtl"] .page :is(h1, h2, h3) { letter-spacing: 0; }
