/* Research atlas presentation. Scientific data and browser storage retain their original contracts. */
:root {
  --canvas: #f5f4ed;
  --canvas-deep: #eeeee5;
  --surface: #fffef9;
  --surface-soft: #f6f7f0;
  --ink: #173b36;
  --ink-soft: #36544d;
  --muted: #596c62;
  --line: #d5ddd0;
  --line-strong: #a7b7a6;
  --purple: #286b59;
  --purple-dark: #1d594a;
  --purple-soft: #e6eee3;
  --teal: #246a63;
  --teal-soft: #e3efea;
  --coral: #9b5844;
  --coral-soft: #f1e6dc;
  --gold: #9b6d20;
  --gold-soft: #f3ead4;
  --shadow-sm: 0 3px 12px #173b3606;
  --shadow-md: 0 14px 38px #173b360d;
  --shadow-lg: 0 22px 64px #173b3626;
  --radius-sm: 7px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --font-sans: "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --atlas-serif: Georgia, "Times New Roman", serif;
  --content-width: 1280px;
}

html,
body {
  height: auto;
  min-height: 100%;
  overflow: visible;
}

html { scroll-padding-top: 154px; }

body {
  background: var(--canvas);
  font-size: 16px;
  line-height: 1.6;
  overscroll-behavior: auto;
}

::selection { color: #fff; background: #286b59; }

:focus-visible {
  outline: 3px solid #286b59;
  outline-offset: 4px;
}

.app-shell {
  display: block;
  width: min(calc(100% - 80px), var(--content-width));
  height: auto;
  margin-inline: auto;
}

.site-header {
  position: sticky;
  z-index: 40;
  top: 0;
  display: block;
  min-height: 0;
  padding-top: 8px;
  background: var(--canvas);
}

.header-main {
  min-height: 82px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.header-links { display: flex; align-items: center; gap: 20px; }
.header-links .feedback-link { font-size: 0.79rem; font-weight: 650; white-space: nowrap; }

.brand { gap: 13px; }

.brand-mark {
  width: 42px;
  height: 46px;
  border: 1px solid var(--ink);
  border-radius: 7px;
  background: var(--ink);
  box-shadow: none;
}

.brand-name { font-size: 1.03rem; font-weight: 750; letter-spacing: -0.025em; }
.brand-tagline { font-size: 0.62rem; letter-spacing: 0.14em; margin-top: 6px; }

.button,
.icon-button,
.save-button { border-radius: 8px; }

.button-primary { background: var(--ink); }
.button-primary:not(:disabled):hover { background: #235347; }
.button-secondary { border-color: var(--line-strong); background: var(--surface); }
.collection-trigger { min-height: 44px; border-color: var(--line-strong); color: var(--ink); background: transparent; }
.collection-trigger:not(:disabled):hover { color: var(--ink); background: var(--purple-soft); }
.count-badge { color: #fff; background: var(--ink); }

.breadcrumbs {
  min-height: 48px;
  padding: 6px 0;
  border-top: 0;
  border-bottom: 1px solid var(--line);
}

.breadcrumb-list { gap: 5px; }
.breadcrumb-button,
.breadcrumb-current { min-height: 36px; border-radius: 5px; padding: 4px 9px; }
.breadcrumb-current { color: var(--ink); background: #e3e9dc; }
.breadcrumb-level { color: var(--muted); font-size: 0.57rem; }
.breadcrumb-label { font-size: 0.74rem; }

.app-main { min-height: 65vh; overflow: visible; }
.app-status { position: relative; top: auto; left: auto; margin: 80px auto; transform: none; }

.home-stage,
.workspace {
  position: relative;
  inset: auto;
  height: auto;
  min-height: 0;
}

.home-stage { display: block; padding-bottom: 72px; }
.atlas-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: end; padding: 52px 0 36px; }
.atlas-intro { max-width: 790px; }
.atlas-intro .eyebrow { margin: 0 0 16px; }
.eyebrow,
.section-kicker { color: var(--purple-dark); font-size: 0.67rem; font-weight: 750; letter-spacing: 0.15em; }
.eyebrow > span { background: var(--gold); box-shadow: none; }
.atlas-intro h1,
.atlas-hero h1 { max-width: 17ch; margin: 0; font: 400 clamp(2.7rem, 4.4vw, 4.2rem)/1.08 var(--atlas-serif); letter-spacing: -0.045em; }
.atlas-intro h1 em { color: var(--purple-dark); font-weight: 400; }
.atlas-intro > p:not(.eyebrow),
.atlas-hero__description { max-width: 63ch; margin: 22px 0 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.7; }
.atlas-stats { display: grid; grid-template-columns: 1fr; gap: 20px; min-width: 235px; margin: 0 0 5px; padding: 12px 0 12px 32px; border-left: 1px solid var(--line-strong); }
.atlas-stats > * { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: baseline; gap: 12px; margin: 0; }
.atlas-stats strong,
.atlas-stats dt { font: 400 2.15rem/1.15 var(--atlas-serif); letter-spacing: -0.045em; }
.atlas-stats span,
.atlas-stats dd { margin: 0; color: var(--muted); font-size: 0.71rem; }

.journey-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: 0 0 38px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); list-style: none; }
.journey-step { position: relative; display: flex; gap: 13px; align-items: start; min-width: 0; padding: 0 20px; border-left: 1px solid var(--line); }
.journey-step:first-child { border-left: 0; padding-left: 0; }
.journey-step strong { display: block; font-size: 0.79rem; font-weight: 750; }
.journey-step span,
.journey-step p { display: block; margin: 3px 0 0; color: var(--muted); font-size: 0.73rem; line-height: 1.45; }
.journey-step small { color: var(--gold); margin-right: 6px; font-size: 0.7rem; }
.journey-step .journey-step__number { display: block; flex: 0 0 auto; margin-top: 0; color: var(--gold); font: 400 1.2rem/1.3 var(--atlas-serif); }

.home-intro { align-items: end; gap: 24px; padding: 0; margin: 0 0 19px; }
.home-intro h1,
.home-intro h2 { margin: 0; font: 400 clamp(1.9rem, 2.8vw, 2.65rem)/1.15 var(--atlas-serif); letter-spacing: -0.035em; }
.home-intro .eyebrow { margin: 0 0 7px; }
.home-intro__actions { max-width: 360px; margin: 0 0 2px; }
.home-intro__actions p { color: var(--muted); font-size: 0.73rem; }
.layout-reset { min-height: 28px; font-size: 0.75rem; color: var(--purple-dark); }

.interest-map { position: relative; padding: 0; overflow: visible; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.interest-map > .area-grid { position: relative; display: grid; width: 100%; height: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: none; grid-auto-rows: auto; align-content: start; gap: 18px; padding: 0; overflow: visible; overscroll-behavior: auto; }
.interest-tile { min-height: 260px; will-change: auto; }
.interest-tile__open { min-height: 260px; grid-template-rows: minmax(140px, 1fr) auto; gap: 12px; padding: 23px 25px 23px; border: 1px solid #d2dbcd; border-radius: 12px; background: var(--surface); box-shadow: none; }
.interest-tile__open::before { position: absolute; inset: 0 0 auto; height: 3px; background: var(--card-accent); opacity: 0; content: ""; transition: opacity 160ms ease; }
.interest-tile__open:hover { border-color: var(--card-accent); background: #fffffb; box-shadow: 0 10px 26px #173b3612; transform: translateY(-3px); }
.interest-tile__open:hover::before { opacity: 1; }
.interest-tile { --card-accent: #376b59; --card-tint: #e6eee3; }
.interest-tile[data-tone="2"] { --card-accent: #406c83; --card-tint: #e5edf1; }
.interest-tile[data-tone="3"] { --card-accent: #90614a; --card-tint: #f1e7df; }
.interest-tile[data-tone="4"] { --card-accent: #8d6d29; --card-tint: #f2ecdb; }
.area-graphic { width: min(100%, 230px); height: 140px; min-height: 140px; max-height: 140px; }
.area-graphic::before { width: 146px; background: var(--card-tint); opacity: 0.45; filter: none; }
.area-graphic img { object-fit: contain; }
.interest-tile__footer { gap: 16px; align-items: center; }
.interest-tile__name { max-width: 25ch; font-size: 1.04rem; font-weight: 650; line-height: 1.3; letter-spacing: -0.025em; }
.interest-tile__arrow { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); background: transparent; }
.interest-tile__meta { display: block; margin-top: 6px; color: var(--muted); font-size: 0.69rem; font-weight: 400; letter-spacing: 0; }
.area-node__drag { top: 12px; right: 12px; width: 36px; height: 36px; border-color: transparent; border-radius: 7px; color: #718172; background: transparent; box-shadow: none; }
.area-node__drag:hover { color: var(--ink); border-color: var(--line); background: var(--surface-soft); }
.interest-tile.is-dragging .interest-tile__open { box-shadow: var(--shadow-lg); }

.workspace { padding: 30px 0 72px; background: transparent; }
.layer-stage { width: 100%; height: auto; }
.layer-card,
.layer-card--depth-1,
.layer-card--depth-2,
.layer-card--depth-3,
.layer-card--depth-4 { position: relative; inset: auto; display: block; min-width: 0; overflow: visible; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: none; animation: atlas-enter 180ms ease both; }
@keyframes atlas-enter { from { opacity: 0; transform: translateY(7px); } }
.layer-card__header { align-items: start; gap: 30px; padding: 36px 42px 32px; overflow: visible; border-radius: 16px 16px 0 0; border-bottom-color: var(--line); background: #edf1e6; }
.layer-card__heading { max-width: 100%; }
.layer-level { color: var(--purple-dark); font-size: 0.67rem; font-weight: 750; letter-spacing: 0.14em; margin-bottom: 12px; }
.layer-card__heading h2,
.layer-card--depth-3 .layer-card__heading h2,
.layer-card--depth-4 .layer-card__heading h2 { max-width: 32ch; font: 400 clamp(1.85rem, 3.15vw, 2.8rem)/1.17 var(--atlas-serif); letter-spacing: -0.035em; overflow-wrap: break-word; }
.layer-card--depth-1 .layer-card__heading h2 { font-size: clamp(2.4rem, 3.8vw, 3.4rem); }
.layer-card__actions { flex-wrap: wrap; justify-content: end; gap: 8px; }
.layer-card__actions .icon-button { min-width: 44px; min-height: 44px; }
.layer-card__actions .save-button { min-height: 44px; color: var(--ink-soft); border-color: var(--line-strong); background: var(--surface); }
.layer-card__actions .save-button.is-saved { color: #fff; background: var(--purple-dark); border-color: var(--purple-dark); }
.discuss-button { width: auto; min-width: 44px; padding-inline: 11px; gap: 7px; color: #fff; border-color: var(--ink); background: var(--ink); font-size: 0.76rem; }
.discuss-button:not(:disabled):hover { color: #fff; border-color: #285747; background: #285747; }
.layer-close { border-color: var(--line-strong); background: transparent; }
.layer-card__body { padding: 30px 42px 42px; overflow: visible; overscroll-behavior: auto; scrollbar-gutter: auto; }
.layer-card__body > * { width: 100%; max-width: none; }
.layer-section-title { margin-top: 32px; margin-bottom: 15px; color: var(--ink); font-size: 0.72rem; font-weight: 750; letter-spacing: 0.14em; }

.path-guide { width: 100%; margin: 0 0 24px; padding: 0 0 23px; border-bottom: 1px solid var(--line); color: var(--muted); }
.path-guide > p { margin: 0 0 10px; font-size: 0.66rem; font-weight: 750; letter-spacing: 0.12em; text-transform: uppercase; }
.path-guide ol { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; padding: 0; list-style: none; counter-reset: path-step; }
.path-guide li { display: flex; align-items: center; gap: 7px; counter-increment: path-step; font-size: 0.76rem; }
.path-guide li::before { content: none; }
.path-guide__stage,
.path-guide li > button { display: inline-flex; align-items: center; gap: 7px; }
.path-guide__number { display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; color: var(--muted); font-size: 0.63rem; }
.path-guide [aria-current="step"] { color: var(--ink); font-weight: 700; }
.path-guide li[aria-current="step"] .path-guide__number { color: #fff; border-color: var(--purple-dark); background: var(--purple-dark); }
.path-guide button { min-height: 32px; padding: 0 3px; border: 0; color: var(--purple-dark); background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.layer-card > .path-guide { margin: 0; padding: 17px 42px; border-bottom: 1px solid var(--line); }
.layer-card > .path-guide + .layer-card__header { border-radius: 0; }

.disclosure { margin-bottom: 16px; border-color: var(--line); border-radius: 9px; background: #f6f7ef; }
.disclosure__summary { min-height: 54px; padding: 15px 19px; color: var(--ink); font-size: 0.86rem; }
.disclosure__summary:hover { background: #edf1e6; }
.disclosure[open] .disclosure__summary { background: #edf1e6; }
.disclosure__content { padding: 20px; font-size: 0.98rem; line-height: 1.8; }
.disclosure__content > p { max-width: 79ch; }
.disclosure__chevron { color: var(--purple-dark); }
.expanded-section { margin-bottom: 20px; overflow: visible; border: 0; border-radius: 0; background: transparent; }
.expanded-section__heading { min-height: 0; display: block; margin: 0 0 10px; padding: 0; border: 0; background: transparent; color: var(--purple-dark); font-size: 0.73rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; }
.expanded-section__content { max-width: 82ch; padding: 0; color: var(--ink-soft); font-size: 1rem; line-height: 1.85; }
.expanded-section__content p { margin: 0 0 14px; }
.expanded-section + .expanded-section { padding-top: 20px; border-top: 1px solid var(--line); }
.route-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.route-row { display: flex; flex-direction: column; border-radius: 10px; background: var(--surface); }
.route-row:hover { border-color: #88a18a; box-shadow: 0 4px 16px #173b360a; }
.route-row__open { flex: 1; min-height: 110px; gap: 18px; padding: 22px; align-items: start; }
.route-row__open:hover,
.paper-route:hover { background: #f0f4e9; }
.route-row__copy { gap: 9px; }
.route-row__copy small { color: var(--muted); font-size: 0.63rem; letter-spacing: 0.12em; }
.route-row__copy strong { font-size: 1rem; font-weight: 650; line-height: 1.5; }
.route-row__arrow { width: 30px; height: 30px; margin-top: 4px; border: 1px solid var(--line); border-radius: 50%; color: var(--purple-dark); background: transparent; }
.disclosure--row { flex: 0 0 auto; margin: 0; border-radius: 0 0 9px 9px; background: #f8f9f3; }
.disclosure--row .disclosure__summary { min-height: 42px; padding: 11px 22px; font-size: 0.73rem; color: var(--muted); }
.disclosure--row .disclosure__content { padding: 17px 22px 22px; font-size: 0.91rem; line-height: 1.75; }
.paper-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.paper-route { align-items: start; min-height: 128px; padding: 22px; border-radius: 10px; }
.paper-route:hover { border-color: #88a18a; }
.paper-route__copy { gap: 10px; }
.paper-route__copy strong { font: 400 1.19rem/1.45 var(--atlas-serif); }
.paper-route__copy small { color: var(--muted); font-size: 0.76rem; }
.paper-layer__citation { margin-bottom: 18px; font-size: 0.95rem; font-weight: 600; }
.paper-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
.paper-links a { min-height: 40px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 7px; color: var(--purple-dark); font-size: 0.81rem; background: #f4f6ee; }
.paper-links a:hover { color: #fff; background: var(--purple-dark); }
.paper-limitations { padding: 20px 24px; border-left: 3px solid #ae822f; background: #f6f0df; }
.paper-limitations h4 { margin: 0 0 10px; color: #6c501e; font-size: 0.85rem; }
.paper-limitations ul { padding-left: 20px; font-size: 0.95rem; line-height: 1.8; }
.paper-limitations li + li { margin-top: 9px; }
.evidence-region { margin-top: 30px; padding-top: 26px; }
.evidence-visual { padding: 14px; border-color: var(--line); background: var(--surface); }
.evidence-visual:hover { border-color: #88a18a; }
.visual-media { min-height: 220px; background: #fff; border-radius: 6px; }
.visual-caption { margin: 14px 4px 8px; font-size: 0.9rem; line-height: 1.65; }
.visual-credit,
.visual-description { color: var(--muted); font-size: 0.77rem; line-height: 1.6; }
.snapshot-fields { gap: 16px 24px; }
.snapshot-fields dt { color: var(--purple-dark); font-size: 0.67rem; }
.snapshot-fields dd { font-size: 0.9rem; line-height: 1.7; }

.drawer-header { background: #edf1e6; }
.drawer-header h2 { margin: 5px 0 0; font: 400 2.2rem/1.15 var(--atlas-serif); letter-spacing: -0.04em; }
.drawer-footer { background: #f1f3e9; }
.collection-group-title { color: var(--purple-dark); font-size: 0.7rem; }
.collection-item { padding: 17px; background: var(--surface); }
.collection-item__main strong { font-size: 0.94rem; line-height: 1.5; }
.collection-item__main small { font-size: 0.75rem; }
.collection-item__remove { min-height: 44px; }
.collection-content { padding-top: 28px; }
.collection-empty h3,
.empty-collection h3 { color: var(--ink); }
.modal { border: 1px solid var(--line); border-radius: 16px; }
.modal__header { padding: 20px 24px; background: #edf1e6; }
.modal__header h2,
.modal__header h3 { font: 400 1.6rem/1.2 var(--atlas-serif); letter-spacing: -0.03em; }
.modal__close { min-width: 44px; min-height: 44px; }
.modal__surface { background: var(--surface); }
.ai-prompt-dialog__body { padding: 24px; }
.ai-prompt-history { border-color: var(--line); background: #f0f4e9; }
.ai-prompt-history__control:checked { border-color: var(--purple-dark); background: var(--purple-dark); }
.ai-prompt-dialog__preview { border-radius: 7px; border-color: var(--line-strong); background: #f5f6ef; font-size: 0.82rem; line-height: 1.6; }
.ai-prompt-dialog__meta { font-size: 0.75rem; }
.ai-prompt-dialog__warning { border-color: #dfce9e; background: #f9f2df; }
.ai-prompt-dialog__status { color: var(--purple-dark); }
.visual-lightbox .modal__body { background: var(--surface); }
.feedback-link,
.atlas-footer a { color: var(--purple-dark); text-underline-offset: 4px; }
.atlas-footer { padding: 24px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.78rem; }

@media (max-width: 1050px) {
  .app-shell { width: calc(100% - 48px); }
  .atlas-hero { gap: 28px; padding-top: 40px; }
  .atlas-stats { min-width: 180px; padding-left: 25px; gap: 20px; }
  .atlas-stats strong,
  .atlas-stats dt { font-size: 1.9rem; }
  .interest-map > .area-grid { gap: 15px; }
  .interest-tile__open { padding: 22px 19px; }
  .layer-card__header { padding: 30px; gap: 18px; }
  .layer-card__body { padding: 28px 30px 36px; }
  .layer-card__actions { max-width: 210px; }
}

@media (max-width: 780px) {
  .app-shell { width: calc(100% - 36px); }
  .header-main { min-height: 74px; }
  .brand-name { font-size: 0.96rem; }
  .breadcrumbs { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; }
  .breadcrumb-list { width: max-content; min-width: 100%; }
  .breadcrumb-item { flex: 0 0 auto; }
  .breadcrumb-button,
  .breadcrumb-current { min-width: 135px; max-width: 220px; }
  .breadcrumb-item:first-child .breadcrumb-button,
  .breadcrumb-item:first-child .breadcrumb-current { min-width: 95px; }
  .atlas-hero { grid-template-columns: 1fr; gap: 25px; padding: 33px 0 27px; }
  .atlas-intro h1,
  .atlas-hero h1 { max-width: 19ch; font-size: clamp(2.6rem, 7vw, 3.8rem); }
  .atlas-intro > p:not(.eyebrow) { max-width: 62ch; font-size: 0.95rem; margin-top: 18px; }
  .atlas-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); border-left: 0; padding: 0; margin: 0; }
  .atlas-stats > * { grid-template-columns: 1fr; gap: 2px; }
  .atlas-stats strong,
  .atlas-stats dt { font-size: 1.7rem; }
  .journey-strip { margin-bottom: 30px; }
  .journey-step { padding-inline: 12px; }
  .journey-step strong { font-size: 0.74rem; }
  .journey-step span,
  .journey-step p { font-size: 0.68rem; }
  .interest-map > .area-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; gap: 14px; }
  .interest-tile,
  .interest-tile__open { min-height: 245px; }
  .home-intro { gap: 20px; }
  .home-intro h1,
  .home-intro h2 { font-size: 2.1rem; }
  .home-intro__actions { max-width: 245px; }
  .layer-card__header { grid-template-columns: 1fr; gap: 22px; }
  .layer-card__actions { max-width: none; justify-content: start; }
  .layer-card > .path-guide { padding-inline: 30px; }
  .layer-card__heading h2,
  .layer-card--depth-3 .layer-card__heading h2,
  .layer-card--depth-4 .layer-card__heading h2 { max-width: 33ch; font-size: 2.05rem; }
  .layer-card--depth-1 .layer-card__heading h2 { font-size: 2.6rem; }
  .layer-card__actions .save-button { width: auto; min-width: 44px; padding: 0 12px; font-size: 0.82rem; }
  .route-list,
  .paper-list { grid-template-columns: 1fr; }
  .route-row__open { min-height: 100px; }
  .discuss-button { min-height: 44px; }
}

@media (max-width: 480px) {
  html { scroll-padding-top: 136px; }
  .app-shell { width: calc(100% - 30px); }
  .site-header { padding-top: 3px; }
  .header-main { min-height: 72px; gap: 12px; }
  .header-links { gap: 9px; }
  .header-links .feedback-link { max-width: 74px; white-space: normal; font-size: 0.66rem; line-height: 1.3; }
  .brand-mark { width: 32px; height: 38px; flex: 0 0 auto; }
  .brand-mark svg { width: 25px; }
  .brand { gap: 8px; }
  .brand-copy { display: grid; }
  .brand-name { max-width: 135px; font-size: 0.88rem; line-height: 1.14; }
  .brand-tagline { display: none; }
  .collection-trigger { flex: 0 0 auto; min-width: 44px; padding: 0 8px; gap: 5px; }
  .collection-trigger svg { flex: 0 0 18px; }
  .collection-trigger > span:not(.count-badge) { display: none; }
  .count-badge { min-width: 20px; }
  .breadcrumbs { min-height: 44px; }
  .breadcrumb-button,
  .breadcrumb-current { min-width: 135px; max-width: 190px; }
  .breadcrumb-label { font-size: 0.7rem; }
  .atlas-hero { padding-top: 27px; gap: 25px; }
  .atlas-intro h1,
  .atlas-hero h1 { max-width: 15ch; font-size: clamp(2.6rem, 10.5vw, 3.25rem); }
  .atlas-intro .eyebrow { font-size: 0.59rem; margin-bottom: 13px; }
  .atlas-intro > p:not(.eyebrow) { font-size: 0.91rem; line-height: 1.7; }
  .atlas-stats { gap: 13px; }
  .atlas-stats strong,
  .atlas-stats dt { font-size: 1.6rem; }
  .atlas-stats span,
  .atlas-stats dd { font-size: 0.64rem; }
  .journey-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 0; padding-block: 18px; }
  .journey-step { padding-inline: 15px; }
  .journey-step:nth-child(3) { padding-left: 0; border-left: 0; }
  .journey-step strong { font-size: 0.76rem; }
  .journey-step span,
  .journey-step p { font-size: 0.69rem; }
  .home-intro { display: block; margin-bottom: 19px; }
  .home-intro h1,
  .home-intro h2 { font-size: 2.1rem; }
  .home-intro__actions { max-width: none; justify-items: start; margin: 12px 0 0; }
  .home-intro__actions p { text-align: left; font-size: 0.72rem; }
  .interest-map > .area-grid { grid-template-columns: 1fr; grid-auto-rows: auto; gap: 12px; }
  .interest-tile { min-height: 148px; }
  .interest-tile__open { min-height: 148px; grid-template-columns: 112px minmax(0, 1fr); grid-template-rows: 1fr 1fr; gap: 4px 13px; padding: 20px 22px 20px 13px; border-radius: 10px; }
  .area-graphic { width: 112px; height: 105px; min-height: 105px; max-height: 105px; }
  .interest-tile__open > .area-graphic { grid-row: 1 / 3; }
  .interest-tile__footer { grid-column: 2; grid-row: 1; align-self: end; padding-bottom: 5px; }
  .interest-tile__meta { grid-column: 2; grid-row: 2; align-self: start; margin-top: 0; }
  .area-graphic::before { width: 96px; }
  .interest-tile__name { font-size: 1.02rem; max-width: 20ch; }
  .interest-tile__arrow { display: none; }
  .area-node__drag { width: 34px; height: 34px; top: 4px; right: 4px; }
  .workspace { padding-top: 20px; }
  .layer-card { border-radius: 12px; }
  .layer-card__header { gap: 20px; padding: 23px 20px; border-radius: 12px 12px 0 0; }
  .layer-card__heading,
  .layer-card__actions { grid-row: auto; }
  .layer-card__heading h2,
  .layer-card--depth-3 .layer-card__heading h2,
  .layer-card--depth-4 .layer-card__heading h2 { max-width: none; font-size: 1.85rem; line-height: 1.2; }
  .layer-card--depth-1 .layer-card__heading h2 { font-size: 2.4rem; }
  .layer-card__actions { justify-self: start; gap: 8px; }
  .layer-card__actions .save-button { width: auto; color: var(--ink-soft); font-size: 0.8rem; }
  .layer-card__actions .save-button::before { content: none; }
  .layer-card__actions .save-button.is-saved { color: #fff; }
  .layer-card__body { padding: 24px 20px 30px; }
  .layer-card > .path-guide { padding: 16px 20px; }
  .expanded-section__content { font-size: 0.96rem; line-height: 1.8; }
  .route-row__open { min-height: 90px; padding: 18px; }
  .route-row__copy strong { font-size: 0.96rem; }
  .disclosure--row .disclosure__summary { padding-inline: 18px; }
  .disclosure--row .disclosure__content { padding: 16px 18px; }
  .disclosure__content { padding: 18px; font-size: 0.93rem; }
  .paper-route { padding: 18px; }
  .paper-route__copy strong { font-size: 1.12rem; }
  .paper-limitations { padding: 18px; }
  .paper-limitations ul { font-size: 0.91rem; }
  .snapshot-fields { grid-template-columns: 1fr; }
  .path-guide { padding-bottom: 18px; margin-bottom: 20px; }
  .path-guide ol { gap: 8px 15px; }
  .path-guide li { font-size: 0.7rem; }
  .path-guide__number { width: 23px; height: 23px; }
  .visual-media { min-height: 160px; }
  .drawer-header { padding: 22px; }
  .drawer-header h2 { font-size: 2rem; }
  .collection-content { padding: 22px; }
  .drawer-footer { padding: 18px 22px 22px; }
  .collection-item { grid-template-columns: 1fr; gap: 7px; }
  .collection-item__remove { justify-self: start; padding-inline: 0; }
  .modal__header h2,
  .modal__header h3 { font-size: 1.35rem; }
  .ai-prompt-dialog__body { padding: 16px; overflow: auto; }
  .modal__header { padding: 16px; }
  .ai-prompt-dialog__preview { font-size: 0.75rem; }
}

@media (max-height: 620px) {
  .ai-prompt-dialog { max-height: calc(100dvh - 16px); }
  .ai-prompt-dialog__surface { height: calc(100dvh - 16px); max-height: calc(100dvh - 16px); }
  .ai-prompt-dialog .modal__header { padding: 8px 16px; }
  .ai-prompt-dialog .modal__header h2 { font-size: 1.25rem; }
  .ai-prompt-dialog__body { grid-template-rows: auto auto auto minmax(42px, 1fr) auto auto auto auto; gap: 5px; padding: 10px 16px; overflow-y: auto; }
  .ai-prompt-dialog__description { font-size: 0.75rem; line-height: 1.4; }
  .ai-prompt-history { min-height: 36px; padding: 6px 10px; }
  .ai-prompt-history__title { font-size: 0.75rem; }
  .ai-prompt-dialog__label { font-size: 0.67rem; line-height: 1.3; }
  .ai-prompt-dialog__preview { padding: 9px 12px; font-size: 0.72rem; }
  .ai-prompt-dialog__meta,
  .ai-prompt-dialog__status { min-height: 0; font-size: 0.65rem; line-height: 1.35; }
  .ai-prompt-dialog__status:empty { display: none; }
  .ai-prompt-dialog__warning { padding: 5px 9px; font-size: 0.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

@media (forced-colors: active) {
  .interest-tile__open,
  .layer-card,
  .route-row,
  .paper-route,
  .disclosure,
  .paper-limitations { border: 1px solid CanvasText; }
  :focus-visible { outline-color: Highlight; }
}
