/* A quiet warm ivory for Atlas surfaces. Loaded after the collection/mobile
   styles; keep blue actions, selected states, photographs and map tiles intact. */
body.is-v2 {
  --warm-surface:#f8f7f3;
  --warm-raised:#faf9f5;
  --warm-inset:#f0efeb;
  --warm-line:#e1e1da;
  --paper:var(--warm-surface);
  --paper-raised:var(--warm-raised);
  --paper-deep:var(--warm-inset);
  --paper-deepest:#e8e7e1;
  --canvas:var(--warm-surface);
  --canvas-sunk:var(--warm-inset);
  --ui-line:var(--warm-line);
  --explorer-dark:var(--warm-surface);
}

/* Only the background colour is locked on structural shells. Earlier compact,
   expanded and phone layouts use different specificity for these same panels. */
body.is-v2 :is(
  .v2-topbar,.v2-mbar,.v2-rail,.v2-navctl,.atlas-collection-actions,
  .v2-dd-menu,.v2-layers-menu,.v2-search-menu,.atlas-map-extra,
  #v2Mmenu,#v2Msearch,#atlasInvestmentHUD,
  .hp-collection,.hp-almaro-card,.hp-deal-card,
  .msrf-launcher,.msrf-dialog,#v2DealCard.is-msrf-card,.msrf-photo-dialog,
  .v2-panel-tasks,.v2-panel-wide,.v2-panel-sel,.v2-jarvis-panel,.v2-grok-panel,
  .br-review,#v2AskDialog,.atlas-reminders,.hp-message-status,
  .opportunity-arrival-copy,.opportunity-orbit,.opportunity-map-retry
) {
  background-color:var(--warm-surface)!important;
}

/* Mobile and desktop chrome retain a little of the map showing through. */
body.is-v2 :is(.v2-topbar,.v2-mbar,.v2-rail,.v2-navctl,.atlas-collection-actions) {
  background-color:rgba(248,247,243,.96)!important;
  border-color:var(--warm-line);
}

/* Headers, sticky tabs and footers should read as one continuous card. */
body.is-v2 :is(.hp-deal-card,.hp-almaro-collection) :is(
  .hp-card-head,.hp-collection-head,.hp-card-foot,.hp-deal-tabs
),
body.is-v2 :is(.msrf-dialog,.msrf-photo-dialog)>header,
body.is-v2 #v2DealCard.is-msrf-card :is(.msrf-card-head,.msrf-card-tabs),
body.is-v2 #v2DealCard.is-msrf-card>footer,
body.is-v2 .msrf-photo-dialog>footer,
body.is-v2 .br-review :is(.br-header,.br-footer),
body.is-v2 .pj-detail {
  background-color:var(--warm-surface)!important;
}

body.is-v2 :is(.msrf-launcher,.msrf-dialog,#v2DealCard.is-msrf-card,.msrf-photo-dialog) {
  --msrf-line:var(--warm-line);
}

/* A slightly brighter ivory keeps editable fields and quiet controls legible.
   Explicit idle-state selectors leave existing blue focus/hover/selection cues. */
body.is-v2 #v2Search .v2-search-field {
  background-color:var(--warm-inset);
}
body.is-v2 #v2Search .v2-search-field:focus-within {
  background-color:var(--warm-raised);
}
body.is-v2 :is(
  .msrf-search input,.pj-search input,
  .atlas-command-trigger,.atlas-reminders-toggle
),
body.is-v2 .hp-almaro-collection .hp-controls :is(input,select),
body.is-v2 .msrf-list-search input,
body.is-v2 #v2AskDialog :is(input,textarea) {
  background-color:var(--warm-raised);
}
body.is-v2 :is(.msrf-close,.atlas-command-trigger,.atlas-reminders-toggle):not(:hover),
body.is-v2 .atlas-reminders :is([data-close-reminders],[data-browser-alerts]):not(:hover),
body.is-v2 .msrf-city-filters button:not([aria-pressed="true"]):not(:hover),
body.is-v2 .msrf-list-row:not([aria-current="true"]):not(:hover),
body.is-v2 .msrf-photo-nav button:not(:hover),
body.is-v2 .msrf-quick-links a:not(:first-child):not(:hover),
body.is-v2 #v2DealCard.is-msrf-card>footer button:not(:hover),
body.is-v2 #atlasInvestmentHUD .ih-deal-action:not(.ih-deal-primary):not([aria-pressed="true"]):not(:hover),
body.is-v2.is-almaro-collection #atlasInvestmentHUD :is(.ih-property-nav,.ih-property-actions) button:not(:hover):not(:disabled),
body.is-v2.is-almaro-collection .hp-deal-card :is(.hp-close,.hp-deal-next):not(:hover),
body.is-v2 .pj-card:not([aria-current="true"]):not(:hover) {
  background-color:var(--warm-raised);
}

body.is-v2 .msrf-scope-switch button[aria-pressed="true"],
body.is-v2.is-almaro-collection .hp-deal-card .hp-deal-scenarios button[aria-pressed="true"] {
  background-color:var(--warm-raised);
}

/* Warm the chrome laid over photos, without altering the images themselves. */
body.is-v2 .msrf-photo-enlarge,
body.is-v2.is-almaro-collection .hp-deal-card .hp-deal-gallery button {
  background-color:rgba(250,249,245,.95);
}

@media(max-width:768px) {
  body.is-v2.is-almaro-collection .hp-deal-card .hp-table:has(thead th:nth-child(3)) tbody tr:not(.hp-total) th:first-child {
    background-color:var(--warm-surface);
  }
}
