:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --panel: #ffffff;
  --ink: #18201d;
  --muted: #637069;
  --line: #dfe5dc;
  --brand: #11806f;
  --brand-dark: #102c2d;
  --accent: #f0645a;
  --signal: #68d8c2;
  --shadow: 0 12px 34px rgba(24, 32, 29, 0.11);
  --topbar-bg: #ffffff;
  --toolbar-bg: rgba(255, 255, 255, 0.76);
  --field-bg: rgba(255, 255, 255, 0.96);
  --brand-tagline-color: #215186;
  --story-name-color: #9d7428;
  --storybook-card-bg: #fbf6ea;
  --storybook-card-border: rgba(155, 138, 91, 0.34);
  --storybook-label: #8d6c21;
  --theme-soft: rgba(15, 111, 92, 0.08);
  --theme-focus: rgba(15, 111, 92, 0.12);
  --pin-color: #9a6b18;
  --pin-bg: #fff4d7;
  --pin-border: rgba(154, 107, 24, 0.46);
  --pin-focus: rgba(154, 107, 24, 0.14);
  --favorite-color: #b66438;
  --favorite-bg: #fff0e6;
  --favorite-border: rgba(182, 100, 56, 0.46);
  --favorite-focus: rgba(182, 100, 56, 0.14);
  --card-min: 340px;
  --price-slider-low: #123f75;
  --price-slider-high: #2f7ec8;
  --price-slider-track: #d9e1d8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  height: 100vh;
  overflow: visible;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body[data-storybook-theme="fantasy"] {
  --muted: #6f6870;
  --line: #e1dce4;
  --brand: #6f5a7d;
  --brand-dark: #332b3b;
  --accent: #b88763;
  --signal: #78d9b9;
  --shadow: 0 12px 34px rgba(51, 43, 59, 0.12);
  --brand-tagline-color: #655371;
  --story-name-color: #8e6422;
  --storybook-card-bg: #faf3f8;
  --storybook-card-border: rgba(111, 90, 125, 0.28);
  --storybook-label: #6f5a7d;
  --theme-soft: rgba(111, 90, 125, 0.09);
  --theme-focus: rgba(111, 90, 125, 0.13);
  --pin-color: #c99a24;
  --pin-bg: #fff4cf;
  --pin-border: rgba(201, 154, 36, 0.5);
  --pin-focus: rgba(201, 154, 36, 0.16);
  --favorite-color: #8b6aa3;
  --favorite-bg: #f6eefb;
  --favorite-border: rgba(139, 106, 163, 0.46);
  --favorite-focus: rgba(139, 106, 163, 0.15);
  --price-slider-low: #2f916f;
  --price-slider-high: #6f5a7d;
}

body[data-storybook-theme="western"] {
  --muted: #756959;
  --line: #e5d5bf;
  --brand: #9b6030;
  --brand-dark: #3d2a1d;
  --accent: #b85f45;
  --signal: #b9bf78;
  --shadow: 0 12px 34px rgba(61, 42, 29, 0.13);
  --brand-tagline-color: #8f572d;
  --story-name-color: #8a562a;
  --storybook-card-bg: #fff2df;
  --storybook-card-border: rgba(155, 96, 48, 0.32);
  --storybook-label: #8a562a;
  --theme-soft: rgba(155, 96, 48, 0.1);
  --theme-focus: rgba(155, 96, 48, 0.15);
  --pin-color: #2f6f64;
  --pin-bg: #e4f0ea;
  --pin-border: rgba(47, 111, 100, 0.48);
  --pin-focus: rgba(47, 111, 100, 0.15);
  --favorite-color: #a95f2d;
  --favorite-bg: #fff0df;
  --favorite-border: rgba(169, 95, 45, 0.46);
  --favorite-focus: rgba(169, 95, 45, 0.15);
  --price-slider-low: #8a562a;
  --price-slider-high: #c99a36;
}

body[data-storybook-theme="none"] {
  --brand-tagline-color: #11806f;
  --price-slider-low: #0b3f34;
  --price-slider-high: #11806f;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 1100;
  display: grid;
  gap: 6px 0px;
  grid-template-columns: minmax(250px, max-content) minmax(0, 1fr) minmax(292px, 274px);
  align-items: start;
  padding: 14px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid rgba(16, 44, 45, 0.16);
  background: var(--topbar-bg);
  box-shadow: 0 10px 30px rgba(24, 32, 29, 0.08), inset 0 0px 0 rgba(255, 255, 255, 0.42);
}

.topbar > * {
  position: relative;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(23px, 2.7vw, 34px);
  line-height: 0.96;
  letter-spacing: 0;
}

.brand-block {
  position: relative;
  display: grid;
  grid-template-columns: max-content;
  align-content: start;
  align-items: start;
  gap: 5px;
  min-width: 0;
}

.brand-left {
  justify-self: start;
  min-width: 0;
}

.brand-right {
  justify-self: start;
  align-self: start;
  min-width: 0;
  max-width: 100%;
}

.brand-block h1 {
  max-width: none;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.brand-lockup-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.brand-wordmark {
  color: #102c2d;
  font-family: "Avenir Next", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(24px, 1.35vw, 42px);
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
}

.brand-tagline {
  color: var(--brand-tagline-color);
  font-family: "Avenir Next", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: clamp(9px, 0.82vw, 11px);
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-home-link {
  width: fit-content;
  color: inherit;
  text-decoration: none;
}

.brand-home-link:focus-visible {
  border-radius: 10px;
  box-shadow: 0 0 0 4px var(--theme-focus);
  outline: 0;
}

.partner-line {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: min(100%, 290px);
  margin: 0;
  border: 1px solid rgba(16, 44, 45, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.58);
  color: #d93c31;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
  font-size: 12px;
  box-shadow: 0 4px 12px rgba(24, 32, 29, 0.08);
  backdrop-filter: blur(8px) saturate(1.05);
  padding: 4px 9px;
  font-weight: 750;
  letter-spacing: 0;
  line-height: 1.2;
  white-space: normal;
  overflow-wrap: anywhere;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, color 140ms ease, transform 140ms ease;
}

.partner-line a {
  color: inherit;
  text-decoration: none;
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
  text-align: center;
}

.partner-line:hover,
.partner-line:focus-within {
  border-color: rgba(217, 60, 49, 0.54);
  background: rgba(255, 246, 237, 0.86);
  box-shadow: 0 0 0 3px rgba(217, 60, 49, 0.12), 0 8px 20px rgba(24, 32, 29, 0.12);
  color: #a92820;
  transform: translateY(-1px);
}

.partner-line a:hover,
.partner-line a:focus-visible {
  color: #a92820;
  outline: 0;
}

.brand-icon {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
}

#resultSummary {
  grid-column: 2 / 4;
  grid-row: 2;
  display: flex;
  align-items: center;
  justify-content: stretch;
  gap: 14px;
  margin-top: -2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  min-height: 26px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  justify-self: stretch;
}

#resultSummary.filters-wrapped {
  min-height: 59px;
}

#resultSummary.is-empty {
  display: none;
  min-height: 0;
  margin-top: 0;
}

.summary-count {
  position: fixed;
  left: 18px;
  bottom: 14px;
  z-index: 2100;
  display: flex;
  align-items: center;
  gap: 10;
  max-width: min(560px, calc(100vw - 36px));
  border: 1px solid rgba(213, 222, 211, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(24, 32, 29, 0.16);
  color: #3f5049;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  padding: 4px 12px;
  text-align: left;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.summary-count .pager {
  padding: 0;
}

.location-pill {
  position: fixed;
  bottom: 14px;
  z-index: 2100;
  display: flex;
  align-items: center;
  min-height: 32px;
  max-width: min(340px, calc(100vw - 36px));
  overflow: hidden;
  border: 1px solid rgba(213, 222, 211, 0.86);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(24, 32, 29, 0.16);
  color: #3f5049;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.1;
  padding: 8px 12px;
  text-align: left;
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.location-pill[hidden] {
  display: none;
}

.location-pill span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-filters {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  max-height: 26px;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

#resultSummary.filters-wrapped .summary-filters {
  max-height: none;
}

.filter-chip {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 210px;
  height: 26px;
  overflow: hidden;
  border: 1px solid #c9cec8;
  border-radius: 6px;
  background: #eef0ed;
  color: #55615b;
  box-shadow: none;
  padding: 0 10px;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 24px;
}

.filter-chip:hover,
.filter-chip:focus-visible {
  border-color: #9daa91;
  background: #d9dec9;
  outline: 0;
}

.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 1) {
  border-color: #c9cec8;
  background: #eef0ed;
  color: #55615b;
}

.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 2) {
  border-color: #c9cec8;
  background: #eef0ed;
  color: #55615b;
}

.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 3) {
  border-color: #c9cec8;
  background: #eef0ed;
  color: #55615b;
}

.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 4) {
  border-color: #c9cec8;
  background: #eef0ed;
  color: #55615b;
}

.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 1):hover,
.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 1):focus-visible {
  border-color: #9daa91;
  background: #d9dec9;
  color: #425543;
}

.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 2):hover,
.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 2):focus-visible {
  border-color: #b79f78;
  background: #e6d5b8;
  color: #65533b;
}

.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 3):hover,
.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 3):focus-visible {
  border-color: #95aaa5;
  background: #d3dfda;
  color: #3f5854;
}

.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 4):hover,
.filter-chip:not(.is-static):not(.is-inactive):nth-of-type(4n + 4):focus-visible {
  border-color: #b58d84;
  background: #dfc8c2;
  color: #68433d;
}

.filter-chip.is-inactive {
  border-color: #b8b0a4;
  border-style: dashed;
  background: #e2ded5;
  color: #7f776c;
  box-shadow: none;
  opacity: 0.72;
  text-decoration: line-through;
}

.filter-chip.is-inactive::before {
  content: "Off";
  display: inline-block;
  margin-right: 6px;
  color: #6b6258;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.filter-chip.is-inactive:hover,
.filter-chip.is-inactive:focus-visible {
  border-color: #9d9286;
  background: #d8d2c7;
  color: #5f574e;
  opacity: 1;
}

.filter-chip.is-static {
  border-color: #d8c9ad;
  background: #eee3cd;
  color: #6a5740;
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.clear-filters {
  flex: 0 0 auto;
  height: 26px;
  border: 1px solid #c9cec8;
  border-radius: 999px;
  background: #eef0ed;
  color: #5b615d;
  box-shadow: none;
  padding: 0 10px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  line-height: 24px;
}

.clear-filters:hover,
.clear-filters:focus-visible {
  border-color: #b9867c;
  background: #dfc0b8;
  color: #7d413a;
  outline: 0;
}

.toolbar {
  display: grid;
  gap: 9px;
  align-items: end;
  border: 1px solid rgba(223, 229, 220, 0.84);
  border-radius: 8px;
  background: var(--toolbar-bg);
  box-shadow: 0 6px 18px rgba(24, 32, 29, 0.055);
  padding: 10px;
}

.filter-panel {
  position: relative;
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: minmax(140px, 1fr) minmax(72px, 0.58fr) minmax(62px, 0.49fr) minmax(48px, 0.31fr) minmax(48px, 0.31fr) 220px;
  justify-self: stretch;
  width: 100%;
}

.filter-options-toggle {
  position: relative;
  display: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(213, 222, 211, 0.96);
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--brand-dark);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.filter-options-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.filter-options-toggle:hover,
.filter-options-toggle:focus-visible,
.filter-options-toggle[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--brand) 42%, transparent);
  background: var(--theme-soft);
  box-shadow: 0 0 0 3px var(--theme-focus);
  outline: 0;
}

.filter-options-toggle::after,
.view-options-toggle::after {
  position: absolute;
  z-index: 2200;
  top: calc(100% + 7px);
  left: 50%;
  content: attr(data-tooltip);
  min-width: max-content;
  border: 1px solid rgba(16, 44, 45, 0.14);
  border-radius: 6px;
  background: rgba(16, 44, 45, 0.94);
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 32, 29, 0.18);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  padding: 7px 8px;
  pointer-events: none;
  text-transform: none;
  transform: translateX(-50%) translateY(-2px);
  transition: opacity 120ms ease, transform 120ms ease;
  white-space: nowrap;
}

.filter-options-toggle:hover::after,
.filter-options-toggle:focus-visible::after,
.view-options-toggle:hover::after,
.view-options-toggle:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.filter-options-toggle[aria-expanded="true"]::after,
.view-options-toggle[aria-expanded="true"]::after {
  opacity: 0;
}

.filter-options-panel {
  display: contents;
}

.mobile-filter-action-row {
  display: none;
}

.view-action-row {
  display: contents;
}

.display-panel {
  grid-column: 3;
  grid-row: 1;
  position: relative;
  grid-template-columns: minmax(72px, 0.7fr) minmax(90px, 0.7fr) 36px;
  align-items: end;
  justify-self: end;
  width: min(100%, 274px);
}

.display-panel .storybook-field {
  grid-column: 1;
  grid-row: 1;
  position: relative;
}

.display-panel .sort-field {
  grid-column: 2;
  grid-row: 1;
  position: relative;
}

.storybook-field,
.match-field,
.sort-field {
  position: relative;
}

.storybook-field select,
.match-field select,
.sort-field select {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.native-sort-select,
.native-storybook-select,
.native-menu-select {
  display: none;
}

.view-options-toggle {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
  margin-top: 0;
}

.pinned-tray {
  position: fixed;
  right: 18px;
  bottom: 14px;
  z-index: 2200;
  display: flex;
  align-items: center;
  gap: 8px;
  width: var(--pinned-tray-width, min(590px, calc(100vw - 12px)));
  max-width: min(590px, calc(100vw - 12px));
  overflow: hidden;
  border: 1px solid rgba(213, 222, 211, 0.88);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  padding: 7px 7px 12px;
  box-shadow: 0 14px 34px rgba(24, 32, 29, 0.18);
  backdrop-filter: blur(12px);
  transition: width 420ms cubic-bezier(0.2, 0.76, 0.22, 1), padding 420ms cubic-bezier(0.2, 0.76, 0.22, 1), box-shadow 240ms ease;
}

.pinned-tray.collapsed {
  width: 71px;
  padding: 7px;
}

.pinned-tray-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 55px;
  height: 55px;
  border: 1px solid color-mix(in srgb, var(--pin-color) 24%, transparent);
  border-radius: 999px;
  background: var(--pin-bg);
  color: var(--pin-color);
  cursor: pointer;
  font: inherit;
  padding: 0;
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.pinned-tray-toggle:hover,
.pinned-tray-toggle:focus-visible {
  border-color: var(--pin-border);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--pin-focus);
  outline: 0;
  transform: translateY(-1px);
}

.pinned-tray-toggle-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
}

.pinned-tray-toggle-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.pinned-tray-strip {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  padding-right: 10px;
  opacity: 1;
  transform: translateX(0);
  transition: opacity 300ms ease, transform 420ms cubic-bezier(0.2, 0.76, 0.22, 1), max-width 420ms cubic-bezier(0.2, 0.76, 0.22, 1);
}

.pinned-tray.collapsed .pinned-tray-strip {
  max-width: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateX(12px);
}

.pinned-tray-strip::-webkit-scrollbar {
  display: none;
}

.pinned-tray-scrollbar {
  position: absolute;
  right: 22px;
  bottom: 5px;
  left: 22px;
  display: none;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 111, 92, 0.13);
  cursor: pointer;
  touch-action: none;
}

.pinned-tray.has-overflow .pinned-tray-scrollbar {
  display: block;
}

.pinned-tray.collapsed .pinned-tray-scrollbar {
  display: none;
}

.pinned-tray-scrollbar span {
  display: block;
  width: 34px;
  height: 100%;
  border-radius: inherit;
  background: rgba(15, 111, 92, 0.58);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.74) inset;
  transition: transform 80ms linear, width 80ms linear;
  cursor: grab;
}

.pinned-tray.scrollbar-dragging .pinned-tray-scrollbar span {
  cursor: grabbing;
  transition: width 80ms linear;
}

.pinned-tray[hidden] {
  display: none;
}

.pinned-tray-item {
  position: relative;
  flex: 0 0 auto;
}

.pinned-tray-thumb {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 74px;
  height: 55px;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--pin-color) 24%, transparent);
  border-radius: 999px;
  background: #e7ece7;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
  font-weight: 850;
  padding: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.pinned-tray-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 180ms ease;
}

.pinned-tray-thumb img.storybook-locked {
  filter: saturate(0.5);
}

.pinned-tray-thumb img.storybook-unlocked {
  filter: saturate(1);
}

.pinned-tray-item.active .pinned-tray-thumb,
.pinned-tray-thumb:hover,
.pinned-tray-thumb:focus-visible {
  border-color: color-mix(in srgb, var(--pin-color) 82%, transparent);
  box-shadow: 0 0 0 3px var(--pin-focus);
  outline: 0;
  transform: translateY(-1px);
}

.pinned-tray-remove {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(154, 60, 52, 0.28);
  border-radius: 50%;
  background: rgba(255, 247, 244, 0.96);
  color: #9a3c34;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

.view-options-toggle {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 36px;
  border: 1px solid rgba(213, 222, 211, 0.96);
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--brand-dark);
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.view-options-toggle svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.view-options-toggle:hover,
.view-options-toggle:focus-visible,
.view-options-toggle[aria-expanded="true"] {
  border-color: color-mix(in srgb, var(--brand) 42%, transparent);
  background: var(--theme-soft);
  box-shadow: 0 0 0 3px var(--theme-focus);
  outline: 0;
}

.view-options-panel {
  position: absolute;
  z-index: 1200;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(126px, 1fr)) 36px 36px 36px 36px;
  gap: 16px;
  width: min(834px, calc(100vw - 32px));
  border: 2px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  box-shadow: 0 18px 40px rgba(24, 32, 29, 0.16);
  padding: 12px;
}

.view-options-panel .field {
  grid-template-rows: 13px 36px 11px;
  gap: 5px;
}

.view-options-panel > .hot-field,
.view-options-panel > .pinned-field,
.view-options-panel > .favorite-field {
  align-self: start;
  width: 36px;
}

.view-options-panel > .hot-field > span,
.view-options-panel > .pinned-field > span,
.view-options-panel > .favorite-field > span {
  text-align: center;
}

.view-options-panel > .display-reset-button {
  align-self: start;
  margin-top: 18px;
}

.view-options-panel[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.dropdown-field {
  min-width: 0;
  overflow: visible;
}

.field span {
  color: #526159;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.field input,
.field select,
.check-menu summary,
.hot-filter-button,
.pinned-filter-button,
.favorite-filter-button,
.mobile-filter-reset-button,
.display-reset-button {
  min-width: 0;
  width: 100%;
  height: 36px;
  border: 1px solid rgba(213, 222, 211, 0.96);
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--ink);
  padding: 0 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.field select {
  appearance: none;
  cursor: pointer;
  padding-right: 30px;
}

.storybook-field::after,
.match-field::after,
.sort-field::after {
  position: absolute;
  right: 10px;
  top: 31px;
  content: "⌄";
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.storybook-field::after,
.sort-field::after,
.match-field::after {
  content: none;
}

.field input:hover,
.field select:hover,
.check-menu summary:hover,
.hot-filter-button:hover,
.pinned-filter-button:hover,
.favorite-filter-button:hover,
.mobile-filter-reset-button:hover,
.display-reset-button:hover {
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
  background: var(--panel);
}

.field input:focus,
.field select:focus,
.check-menu summary:focus-visible,
.hot-filter-button:focus-visible,
.pinned-filter-button:focus-visible,
.favorite-filter-button:focus-visible,
.mobile-filter-reset-button:focus-visible,
.display-reset-button:focus-visible {
  border-color: color-mix(in srgb, var(--brand) 50%, transparent);
  box-shadow: 0 0 0 3px var(--theme-focus);
  outline: 0;
}

.hot-filter-button,
.pinned-filter-button,
.favorite-filter-button,
.mobile-filter-reset-button,
.display-reset-button {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  appearance: none;
  overflow: hidden;
  padding: 0;
  cursor: pointer;
}

.mobile-filter-reset-button {
  width: 36px;
  color: var(--brand);
}

.hot-filter-button svg,
.pinned-filter-button svg,
.favorite-filter-button svg,
.mobile-filter-reset-button svg,
.display-reset-button svg {
  width: 21px;
  height: 21px;
}

.mobile-filter-reset-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.mobile-filter-reset-spacer {
  visibility: hidden;
}

.display-reset-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.pinned-filter-button,
.favorite-filter-button {
  color: #627069;
}

.pinned-filter-button svg,
.favorite-filter-button svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.pinned-filter-button.active {
  border-color: var(--pin-border);
  background: var(--pin-bg);
  color: var(--pin-color);
  box-shadow: 0 0 0 3px var(--pin-focus);
}

.favorite-filter-button.active {
  border-color: var(--favorite-border);
  background: var(--favorite-bg);
  color: var(--favorite-color);
  box-shadow: 0 0 0 3px var(--favorite-focus);
}

.hot-filter-button .flame-outer,
.hot-filter-button .flame-inner {
  transition: fill 120ms ease;
}

.hot-filter-button .flame-outer {
  fill: #8c9690;
}

.hot-filter-button .flame-inner {
  fill: #c8d0ca;
}

.hot-filter-button:hover .flame-outer,
.hot-filter-button:focus-visible .flame-outer {
  fill: #d84b32;
}

.hot-filter-button:hover .flame-inner,
.hot-filter-button:focus-visible .flame-inner {
  fill: #ffcb55;
}

.hot-filter-button.active {
  border-color: rgba(217, 107, 95, 0.4);
  background: #fff8f4;
  box-shadow: 0 0 0 3px rgba(217, 107, 95, 0.1);
}

.hot-filter-button.active .flame-outer {
  fill: #d84b32;
}

.hot-filter-button.active .flame-inner {
  fill: #ffcb55;
}

.check-menu {
  position: relative;
  min-width: 0;
}

.check-menu summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  list-style: none;
}

.check-menu summary span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-menu summary::-webkit-details-marker {
  display: none;
}

.check-menu summary::after {
  content: "⌄";
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 13px;
  font-weight: 900;
}

.check-options {
  position: absolute;
  z-index: 1300;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: grid;
  gap: 4px;
  min-width: max(100%, 176px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(24, 32, 29, 0.14);
  padding: 8px;
}

.check-options label,
.check-options button {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 28px;
  width: 100%;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 5px 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  cursor: pointer;
}

.check-options label:hover,
.check-options button:hover,
.check-options button.active {
  background: var(--theme-soft);
}

.check-options button.active {
  color: var(--brand-dark);
}

.check-options input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin: 0;
  border: 0;
  border-radius: 3px;
  background: transparent;
  box-shadow: none;
  padding: 0;
  accent-color: var(--brand);
}

.check-options input:hover,
.check-options input:focus {
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: 0;
}

.range-pair {
  display: grid;
  grid-template-rows: 22px 11px;
  gap: 3px;
  align-items: center;
}

.range-readout {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--brand-dark);
  font-size: 11px;
  line-height: 1;
  padding: 0px 10px;
}

.range-readout b {
  font-weight: 500;
}

.rolling-char {
  display: inline-block;
  min-width: 0.58em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  will-change: transform, opacity;
}

.rolling-char:not(.changed) {
  transform: translateY(0);
}

.rolling-char.changed {
  animation: debtDigitRoll 480ms cubic-bezier(0.2, 0.78, 0.24, 1);
}

@keyframes debtDigitRoll {
  0% {
    opacity: 0.25;
    transform: translateY(0.85em);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rolling-char.changed {
    animation: none;
  }
}

.range-note {
  display: flex;
  justify-content: space-between;
  width: 100%;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
}

.range-note b {
  font-weight: 850;
}

.single-range {
  display: grid;
  align-items: center;
  height: 36px;
  margin-top: 0;
}

.zoom-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  height: 36px;
  border: 1px solid rgba(213, 222, 211, 0.96);
  border-radius: 6px;
  background: rgba(238, 241, 237, 0.96);
  padding: 3px;
}

.zoom-toggle button {
  min-width: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #56625c;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1;
}

.zoom-toggle button[aria-pressed="true"] {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: 0 1px 4px rgba(24, 32, 29, 0.12);
}

.zoom-toggle button:hover,
.zoom-toggle button:focus-visible {
  color: var(--brand-dark);
  outline: 0;
}

.zoom-toggle:focus-within {
  border-color: rgba(15, 111, 92, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.12);
}

.match-field::before {
  content: "";
  grid-row: 3;
  height: 11px;
}

.detail-field input {
  width: 100%;
  height: 36px;
  margin: 0;
  border: 0;
  background: transparent;
  padding: 0;
  accent-color: var(--brand);
  appearance: none;
}

.detail-field input::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: #d9e1d8;
}

.detail-field input::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 1px 5px rgba(24, 32, 29, 0.25);
  cursor: pointer;
  appearance: none;
}

.detail-field input::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: #d9e1d8;
}

.detail-field input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 1px 5px rgba(24, 32, 29, 0.25);
  cursor: pointer;
}

.dual-range {
  --range-start: 0%;
  --range-end: 100%;
  position: relative;
  height: 30px;
  margin-inline: 8px;
}

.range-track {
  position: absolute;
  top: 11px;
  right: 0;
  left: 0;
  height: 8px;
  border-radius: 999px;
  background:
    linear-gradient(
      to right,
      var(--price-slider-track) 0%,
      var(--price-slider-track) var(--range-start),
      var(--price-slider-low) var(--range-start),
      var(--price-slider-high) var(--range-end),
      var(--price-slider-track) var(--range-end),
      var(--price-slider-track) 100%
    );
}

.dual-range input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 30px;
  margin: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  appearance: none;
  padding: 0px 0px
}

.dual-range input[type="range"]:hover,
.dual-range input[type="range"]:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  outline: 0;
}

.dual-range input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  border: 0;
  box-shadow: none;
  background: transparent;
  appearance: none;
}

.dual-range input[type="range"]::-webkit-slider-thumb {
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--price-slider-high);
  box-shadow: 0 1px 5px rgba(24, 32, 29, 0.25);
  cursor: pointer;
  pointer-events: auto;
  appearance: none;
}

.dual-range input[type="range"]::-moz-range-track {
  height: 8px;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.dual-range input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--price-slider-high);
  box-shadow: 0 1px 5px rgba(24, 32, 29, 0.25);
  cursor: pointer;
  pointer-events: auto;
}

#minPriceFilter {
  z-index: 2;
}

#maxPriceFilter {
  z-index: 3;
}

#minPriceFilter::-webkit-slider-thumb {
  background: var(--price-slider-low);
}

#minPriceFilter::-moz-range-thumb {
  background: var(--price-slider-low);
}

.main-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 61.8fr) 18px minmax(340px, 38.2fr);
  gap: 10px;
  align-items: stretch;
  padding: 22px clamp(14px, 3vw, 34px) 40px;
}

.listing-pane {
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
}

.split-handle {
  display: grid;
  place-items: center;
  width: 18px;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  cursor: col-resize;
  touch-action: none;
}

.split-handle::before {
  content: "";
  width: 6px;
  height: 72px;
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 -12px 0 #c9d8d1, 0 12px 0 #c9d8d1;
}

.split-handle:hover,
.split-handle.dragging,
.split-handle:focus-visible {
  border-color: rgba(15, 111, 92, 0.45);
  box-shadow: 0 0 0 4px rgba(15, 111, 92, 0.12);
  outline: 0;
}

.main-map-pane {
  height: 100%;
  min-width: 0;
}

.main-listings-map {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8ece5;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.main-listings-map .maplibregl-control-container {
  font: initial;
}

.listing-map-marker {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 10px rgba(24, 32, 29, 0.25);
  cursor: pointer;
  padding: 4px 7px;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.marker-pin-icon,
.marker-favorite-icon {
  display: none;
  place-items: center;
}

.marker-pin-icon svg,
.marker-favorite-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.4;
}

.listing-map-marker.is-pinned {
  min-width: 30px;
  width: 30px;
  height: 30px;
  border-color: color-mix(in srgb, var(--pin-color) 18%, #fff 82%);
  background: var(--pin-color);
  color: color-mix(in srgb, var(--pin-bg) 86%, #fff 14%);
  padding: 0;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--pin-color) 34%, transparent);
}

.listing-map-marker.is-favorite {
  min-width: 30px;
  width: 30px;
  height: 30px;
  border-color: color-mix(in srgb, var(--favorite-color) 18%, #fff 82%);
  background: var(--favorite-color);
  color: color-mix(in srgb, var(--favorite-bg) 88%, #fff 12%);
  padding: 0;
  box-shadow: 0 5px 14px color-mix(in srgb, var(--favorite-color) 30%, transparent);
}

.listing-map-marker.is-pinned .marker-price,
.listing-map-marker.is-favorite .marker-price {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.listing-map-marker.is-pinned .marker-pin-icon {
  display: grid;
}

.listing-map-marker.is-favorite .marker-favorite-icon {
  display: grid;
}

.marker-preview {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  z-index: 1001;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 178px;
  min-height: 150px;
  overflow: hidden;
  border: 2px solid #fff;
  border-radius: 8px;
  background: #e8ece5;
  box-shadow: 0 10px 26px rgba(24, 32, 29, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(4px) scale(0.98);
  transition: opacity 120ms ease, transform 120ms ease;
}

.marker-preview img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
}

.marker-preview strong {
  display: block;
  overflow: hidden;
  background: #fff;
  color: #26342f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  padding: 7px 8px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-map-marker:hover .marker-preview,
.listing-map-marker:focus-visible .marker-preview,
.listing-map-marker.card-hover .marker-preview {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.listing-map-marker.preview-below .marker-preview {
  top: calc(100% + 10px);
  bottom: auto;
  transform: translateX(-50%) translateY(-4px) scale(0.98);
}

.listing-map-marker.preview-below:hover .marker-preview,
.listing-map-marker.preview-below:focus-visible .marker-preview,
.listing-map-marker.preview-below.card-hover .marker-preview {
  transform: translateX(-50%) translateY(0) scale(1);
}

.listing-map-marker.grey-match {
  background: #79837d;
  opacity: 0.62;
}

.listing-map-marker.is-pinned.grey-match {
  background: var(--pin-color);
  opacity: 0.78;
}

.listing-map-marker.is-favorite.grey-match {
  background: var(--favorite-color);
  opacity: 0.76;
}

.listing-map-marker.hide-match {
  visibility: hidden;
  pointer-events: none;
}

.listing-map-marker:hover,
.listing-map-marker.card-hover {
  z-index: 1000;
  background: var(--brand-dark);
}

.listing-map-marker:focus-visible {
  z-index: 1000;
}

.maplibregl-marker:has(.listing-map-marker.is-pinned) {
  z-index: 500;
}

.maplibregl-marker:has(.listing-map-marker.is-favorite) {
  z-index: 450;
}

.maplibregl-marker:has(.listing-map-marker:hover),
.maplibregl-marker:has(.listing-map-marker:focus-visible),
.maplibregl-marker:has(.listing-map-marker.card-hover) {
  z-index: 1000;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, var(--card-min)), 1fr));
  gap: 18px;
  align-items: start;
  min-height: 100%;
  padding: 6px;
}

.cards:has(.empty) {
  align-content: center;
  justify-content: center;
  place-items: center;
}

.grid-loading {
  position: relative;
  grid-column: 1 / -1;
  display: grid;
  gap: 18px;
  place-items: center;
  justify-self: center;
  align-self: center;
}

.grid-loading-brand {
  position: relative;
  display: grid;
  place-items: center;
  width: max-content;
  max-width: calc(100vw - 48px);
}

.grid-loading-lockup {
  position: relative;
  z-index: 1;
  padding: 0;
}

.grid-loading-lockup .brand-icon {
  width: 51px;
  height: 51px;
}

.grid-loading-lockup .brand-wordmark {
  font-size: clamp(34px, 3.8vw, 48px);
}

.grid-loading-lockup .brand-tagline {
  font-size: clamp(10px, 1vw, 13px);
}

.loading-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 20px;
}

.loading-dots span {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(94, 102, 97, 0.72);
  animation: loadingPulse 900ms ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 120ms;
}

.loading-dots span:nth-child(3) {
  animation-delay: 240ms;
}

.map-loading {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

@keyframes loadingPulse {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0) scale(0.86);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px) scale(1);
  }
}

.card {
  container-type: inline-size;
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 5px 18px rgba(24, 32, 29, 0.07);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, opacity 160ms ease, filter 160ms ease;
}

.card.grey-match {
  opacity: 0.42;
  filter: grayscale(0.82);
}

.card.highlight-match {
  box-shadow: inset 0 0 0 6px rgb(23 89 46 / 62%), 0 14px 32px rgb(111 15 42 / 16%);
}

.card.status-pending {
  border-color: rgba(184, 103, 24, 0.52);
  box-shadow: inset 0 0 0 6px rgba(184, 103, 24, 0.62), 0 5px 18px rgba(24, 32, 29, 0.07);
}

.card.status-sold {
  border-color: rgba(178, 54, 54, 0.52);
  box-shadow: inset 0 0 0 6px rgba(178, 54, 54, 0.62), 0 5px 18px rgba(24, 32, 29, 0.07);
}

.card.hide-match {
  visibility: hidden;
  pointer-events: none;
}

.card:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--brand) 38%, transparent);
  box-shadow: var(--shadow);
}

.card.grey-match:hover {
  opacity: 0.92;
}

.card.highlight-match:hover {
  border-color: var(--brand-dark);
  box-shadow: 0 0 0 5px rgba(15, 111, 92, 0.28), var(--shadow);
}

.card.status-pending:hover {
  border-color: rgba(184, 103, 24, 0.72);
  box-shadow: inset 0 0 0 6px rgba(184, 103, 24, 0.62), var(--shadow);
}

.card.status-sold:hover {
  border-color: rgba(178, 54, 54, 0.72);
  box-shadow: inset 0 0 0 6px rgba(178, 54, 54, 0.62), var(--shadow);
}

.card.is-pinned {
  border-color: var(--pin-border);
}

.card.is-favorite:not(.is-pinned) {
  border-color: var(--favorite-border);
}

.pin-button,
.favorite-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  border: 1px solid rgba(213, 222, 211, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #627069;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease, color 120ms ease;
}

.pin-button svg,
.favorite-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.pin-button:hover,
.pin-button:focus-visible,
.favorite-button:hover,
.favorite-button:focus-visible {
  border-color: var(--pin-border);
  background: var(--pin-bg);
  color: var(--brand-dark);
  box-shadow: 0 0 0 3px var(--pin-focus);
  outline: 0;
}

.pin-button.pinned {
  border-color: var(--pin-border);
  background: var(--pin-bg);
  color: var(--pin-color);
}

.favorite-button:hover,
.favorite-button:focus-visible {
  border-color: var(--favorite-border);
  background: var(--favorite-bg);
  color: var(--favorite-color);
  box-shadow: 0 0 0 3px var(--favorite-focus);
}

.favorite-button.favorited {
  border-color: var(--favorite-border);
  background: var(--favorite-bg);
  color: var(--favorite-color);
}

.card-pin-button,
.card-favorite-button {
  position: absolute;
  z-index: 4;
  top: 9px;
  width: 29px;
  height: 29px;
  padding: 0;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 18px rgba(24, 32, 29, 0.14);
}

.card-pin-button {
  right: 9px;
}

.card-favorite-button {
  right: 44px;
}

.card-pin-button span,
.card-favorite-button span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.card-pin-button.pinned {
  background: var(--pin-color);
  color: #fff;
}

.card-favorite-button.favorited {
  background: var(--favorite-color);
  color: #fff;
}

.card:focus-visible,
.icon-button:focus-visible,
.pager button:focus-visible {
  outline: 3px solid rgba(15, 111, 92, 0.28);
  outline-offset: 2px;
}

.card-body {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.price {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.1;
}

.status {
  align-self: start;
  border: 1px solid rgba(15, 111, 92, 0.22);
  border-radius: 999px;
  background: #eaf5f0;
  color: var(--brand-dark);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.card-status-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.hot-card-indicator {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: transparent;
  animation: hot-strobe 1.25s ease-in-out infinite;
}

.hot-card-indicator svg {
  width: 19px;
  height: 19px;
  filter: drop-shadow(0 1px 0 rgba(120, 39, 28, 0.18));
}

.flame-outer {
  fill: #d84b32;
}

.flame-inner {
  fill: #ffcb55;
}

@keyframes hot-strobe {
  0%,
  100% {
    filter: saturate(1);
    transform: scale(1);
  }

  45% {
    filter: saturate(1.35);
    transform: scale(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hot-card-indicator {
    animation: none;
  }
}

.status.status-pending {
  border-color: rgba(184, 103, 24, 0.32);
  background: #fff0d7;
  color: #8a4a10;
}

.status.status-coming-soon {
  border-color: rgba(33, 81, 134, 0.34);
  background: #e6f0ff;
  color: #215186;
}

.status.status-sold {
  border-color: rgba(178, 54, 54, 0.32);
  background: #ffe3e3;
  color: #963333;
}

.address {
  color: #29342f;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.28;
}

.card-address {
  display: grid;
  gap: 2px;
}

.card-address span {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: clamp(11px, 4.2cqw, 15px);
}

.fantasy-house-name {
  overflow: hidden;
  color: var(--story-name-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(12px, 4.4cqw, 16px);
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(4px, 1.8cqw, 8px);
}

.fact {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, auto);
  align-items: baseline;
  justify-content: center;
  gap: clamp(2px, 1.2cqw, 5px);
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px clamp(3px, 1.5cqw, 6px);
  background: #fbfcfa;
  white-space: nowrap;
}

.fact strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(11px, 3.6cqw, 16px);
  line-height: 1;
}

.fact span {
  min-width: 0;
  margin-top: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: clamp(8px, 2.45cqw, 11px);
  font-weight: 700;
  text-transform: uppercase;
}

.gallery-wrap {
  display: grid;
  gap: 7px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.gallery {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #e8ece5;
  touch-action: pan-y;
}

.card .gallery {
  aspect-ratio: 4 / 3;
}

.gallery img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
}

.gallery.storybook-photo > img,
.lightbox-stage > img.storybook-photo,
.marker-preview img.storybook-photo {
  transition: filter 180ms ease;
}

.gallery.storybook-locked > img,
.gallery > img.storybook-locked,
.lightbox-stage > img.storybook-locked,
.marker-preview img.storybook-locked {
  filter: saturate(0.5);
}

.gallery.storybook-unlocked > img,
.gallery > img.storybook-unlocked,
.lightbox-stage > img.storybook-unlocked,
.marker-preview img.storybook-unlocked {
  filter: saturate(1);
}

.storybook-magic-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
  display: none;
  pointer-events: none;
}

.gallery.storybook-photo .storybook-magic-layer {
  display: block;
}

.gallery.storybook-photo .storybook-locked-haze {
  display: none;
}

.storybook-locked-haze {
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.2), transparent 18%),
    linear-gradient(135deg, rgba(20, 35, 42, 0.18), rgba(255, 255, 255, 0.04));
}

.gallery.storybook-locked .storybook-locked-haze {
  display: block;
}

.storybook-sparkles {
  opacity: 0;
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(255, 231, 151, 0.86) 0 1.5px, transparent 2.5px),
    radial-gradient(circle, rgba(177, 238, 223, 0.82) 0 1px, transparent 2px);
  background-position: 12% 16%, 81% 24%, 20% 78%;
  background-size: 70px 82px, 92px 74px, 110px 96px;
  mix-blend-mode: screen;
}

.gallery.storybook-locked .storybook-sparkles {
  animation: storybookSparkleDrift 4.8s ease-in-out infinite;
  animation-direction: alternate;
  opacity: 0.64;
}

.storybook-shimmer {
  opacity: 0;
  overflow: hidden;
}

.storybook-shimmer::before {
  position: absolute;
  top: -18%;
  bottom: -18%;
  left: -55%;
  width: 44%;
  content: '';
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.2), rgba(255, 238, 166, 0.62), rgba(255, 255, 255, 0.25), transparent);
  filter: blur(1px);
  transform: skewX(-16deg);
}

.gallery.storybook-just-unlocked .storybook-shimmer {
  animation: storybookShimmerLayer 960ms ease-out both;
}

.gallery.storybook-just-unlocked .storybook-shimmer::before {
  animation: storybookShimmerSweep 960ms ease-out both;
}

@keyframes storybookSparkleDrift {
  0% {
    background-position: 12% 16%, 81% 24%, 20% 78%;
    opacity: 0.36;
  }
  50% {
    opacity: 0.76;
  }
  100% {
    background-position: 14% 22%, 78% 18%, 24% 72%;
    opacity: 0.36;
  }
}

@keyframes storybookShimmerLayer {
  0%, 100% {
    opacity: 0;
  }
  20%, 68% {
    opacity: 1;
  }
}

@keyframes storybookShimmerSweep {
  from {
    transform: translateX(0) skewX(-16deg);
  }
  to {
    transform: translateX(360%) skewX(-16deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery.storybook-locked .storybook-sparkles,
  .gallery.storybook-just-unlocked .storybook-shimmer,
  .gallery.storybook-just-unlocked .storybook-shimmer::before {
    animation: none;
  }
}

.storybook-info-button {
  position: absolute;
  left: 9px;
  top: 9px;
  z-index: 6;
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 50%;
  background: rgba(24, 32, 29, 0.68);
  color: #fff;
  cursor: help;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transform: none;
  transition: opacity 140ms ease, background 140ms ease;
}

.storybook-info-button svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.storybook-info-button:hover,
.storybook-info-button:focus-visible {
  background: rgba(24, 32, 29, 0.86);
  outline: 0;
}

.storybook-info-popover {
  position: absolute;
  left: 50%;
  top: 44px;
  z-index: 7;
  width: min(380px, calc(100% - 18px));
  max-height: min(290px, calc(100% - 54px));
  overflow-x: hidden;
  overflow-y: scroll;
  scrollbar-gutter: stable;
  border: 1px solid rgba(255, 255, 255, 0.64);
  border-radius: 8px;
  background: rgba(17, 24, 21, 0.9);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.32);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.58;
  opacity: 0;
  padding: 11px 12px 12px;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 120ms ease;
  white-space: pre-wrap;
}

.storybook-info-popover::-webkit-scrollbar {
  width: 10px;
}

.storybook-info-popover::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.storybook-info-popover::-webkit-scrollbar-thumb {
  border: 2px solid rgba(17, 24, 21, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
}

.storybook-info-popover::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.68);
}

.storybook-info-popover p {
  margin: 0 0 9px;
}

.storybook-info-popover p:last-child {
  margin-bottom: 0;
}

.storybook-house-link {
  color: var(--brand-dark);
  font-weight: 850;
  text-decoration: underline;
  text-decoration-color: rgba(16, 44, 45, 0.42);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.storybook-house-link:hover,
.storybook-house-link:focus-visible {
  color: var(--brand);
  outline: 0;
  text-decoration-color: currentColor;
}

.storybook-info-popover .storybook-house-link {
  color: #fff0b7;
  text-decoration-color: rgba(255, 240, 183, 0.64);
}

.storybook-info-popover .storybook-house-link:hover,
.storybook-info-popover .storybook-house-link:focus-visible {
  color: #ffffff;
  text-decoration-color: currentColor;
}

.storybook-info-button:hover + .storybook-info-popover,
.storybook-info-button:focus + .storybook-info-popover,
.storybook-info-popover:hover {
  opacity: 1;
  pointer-events: auto;
}

.gallery button {
  position: absolute;
  z-index: 6;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(24, 32, 29, 0.62);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, background 140ms ease;
}

.gallery .storybook-info-button {
  top: 9px;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  transform: none;
}

.gallery .card-pin-button,
.gallery .card-favorite-button {
  top: 9px;
  left: auto;
  z-index: 6;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  opacity: 0.96;
  pointer-events: auto;
  transform: none;
}

.gallery .card-pin-button {
  right: 9px;
}

.gallery .card-favorite-button {
  right: 44px;
}

.gallery:hover .storybook-info-button,
.gallery:focus-within .storybook-info-button {
  opacity: 0.96;
  pointer-events: auto;
}

.gallery:hover button,
.gallery:focus-within button,
.gallery:hover .photo-count,
.gallery:focus-within .photo-count {
  opacity: 1;
  pointer-events: auto;
}

.gallery button:hover {
  background: rgba(24, 32, 29, 0.8);
}

.gallery .card-pin-button:hover,
.gallery .card-pin-button:focus-visible {
  background: color-mix(in srgb, var(--pin-bg) 82%, #fff 18%);
  color: var(--pin-color);
}

.gallery .card-favorite-button:hover,
.gallery .card-favorite-button:focus-visible {
  background: color-mix(in srgb, var(--favorite-bg) 82%, #fff 18%);
  color: var(--favorite-color);
}

.gallery .card-pin-button.pinned:hover,
.gallery .card-pin-button.pinned:focus-visible {
  background: color-mix(in srgb, var(--pin-color) 76%, #fff 24%);
  color: #fff;
}

.gallery .card-favorite-button.favorited:hover,
.gallery .card-favorite-button.favorited:focus-visible {
  background: color-mix(in srgb, var(--favorite-color) 76%, #fff 24%);
  color: #fff;
}

.gallery .prev {
  left: 9px;
}

.gallery .next {
  right: 9px;
}

.photo-count {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(24, 32, 29, 0.62);
  color: #fff;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease, background 140ms ease;
  white-space: nowrap;
}

.gallery-thumbs {
  display: flex;
  gap: 6px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  padding: 1px 1px 4px;
  scrollbar-width: thin;
}

.gallery-thumb {
  position: relative;
  flex: 0 0 84px;
  width: 84px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 6px;
  background: #dfe5dc;
  cursor: pointer;
  padding: 0;
}

.gallery-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 160ms ease, opacity 160ms ease;
}

.gallery-thumb.storybook-locked img {
  filter: saturate(0.45);
  opacity: 0.72;
}

.gallery-thumb.storybook-locked::after {
  position: absolute;
  inset: 0;
  content: '';
  background:
    radial-gradient(circle at 22% 22%, rgba(255, 255, 255, 0.54), transparent 12%),
    linear-gradient(135deg, rgba(20, 35, 42, 0.2), rgba(255, 255, 255, 0.04));
  mix-blend-mode: screen;
  pointer-events: none;
}

.gallery-thumb.storybook-unlocked {
  border-color: rgba(255, 231, 151, 0.82);
}

.gallery-thumb.storybook-unlocked img {
  filter: saturate(1.08);
}

.gallery-thumb.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 111, 92, 0.14);
}

.gallery-thumb:hover,
.gallery-thumb:focus-visible {
  border-color: rgba(15, 111, 92, 0.55);
  outline: 0;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.meta-row span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.meta-row span:last-child {
  flex: 0 0 auto;
  text-align: right;
}

.meta-days {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 28px 0 8px;
}

.summary-count .pager {
  gap: 6px;
}

.pager[hidden] {
  display: none;
}

.pager button,
.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
}

.summary-count .pager button {
  width: 26px;
  height: 26px;
  border-color: rgba(213, 222, 211, 0.92);
  color: #0f6f5c;
  font-size: 18px;
  line-height: 1;
}

.pager button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

#pageInfo {
  min-width: 120px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.summary-count #pageInfo {
  min-width: 42px;
  color: #4f5d57;
  font-size: 12px;
  font-weight: 900;
}

.scrim {
  position: fixed;
  inset: 0;
  z-index: 1900;
  background: rgba(24, 32, 29, 0.34);
}

.drawer {
  --drawer-content-inset: clamp(16px, 4vw, 30px);
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  right: auto;
  z-index: 2300;
  width: min(100vw, max(560px, 38.2vw));
  overflow-x: hidden;
  overflow-y: auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 22px 54px rgba(24, 32, 29, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.985);
  transition: transform 220ms ease, opacity 180ms ease;
}

.drawer.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

.pinned-drawer-deck {
  --pinned-drawer-width: clamp(360px, 38.2vw, 560px);
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 56px 18px;
  scroll-snap-type: x proximity;
}

.pinned-drawer-deck[hidden] {
  display: none;
}

.pinned-drawer {
  position: relative;
  inset: auto;
  left: auto;
  right: auto;
  flex: 0 0 min(calc(100vw - 36px), var(--pinned-drawer-width));
  width: min(calc(100vw - 36px), var(--pinned-drawer-width));
  height: min(880px, calc(100vh - 112px));
  max-height: calc(100vh - 112px);
  overflow-x: hidden;
  overflow-y: auto;
  border-radius: 14px;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  scroll-snap-align: start;
}

.pinned-drawer.open {
  transform: none;
}

.close-button {
  position: sticky;
  top: 12px;
  isolation: isolate;
  z-index: 20;
  margin: 0px 12px 0 auto;
}

#detailDrawer > .close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
}

.pinned-drawer > .close-button {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
}

#detailDrawer > .close-button,
.pinned-drawer > .close-button {
  z-index: 30;
}

.drawer-inner {
  position: relative;
  display: grid;
  gap: 18px;
  min-width: 0;
  padding: var(--drawer-content-inset) var(--drawer-content-inset) 30px;
}

.drawer-hero {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.drawer .gallery {
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 10;
}

.drawer .gallery img {
  cursor: zoom-in;
}

.drawer .gallery-thumbs {
  gap: 8px;
}

.drawer .gallery-thumb {
  flex-basis: 128px;
  width: 128px;
}

.drawer-title {
  display: grid;
  gap: 8px;
}

.drawer-address span {
  font-size: 16px;
}

.drawer-address .fantasy-house-name {
  font-size: 18px;
}

.drawer-address-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.drawer-address-row .drawer-address {
  min-width: 0;
}

.drawer-address.card-address span,
.drawer-address .fantasy-house-name {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
}

.drawer-activity {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: max-content;
}

.drawer-stats {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  color: #5c6962;
  padding-top: 1px;
}

.drawer-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.drawer-stat svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drawer-stat strong {
  color: #38433e;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.drawer-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-price-row .status {
  align-self: center;
  flex: 0 0 auto;
}

.drawer-title-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.drawer-listing-nav {
  position: fixed;
  inset: 0;
  z-index: 2301;
  pointer-events: none;
}

.drawer-listing-nav-button {
  position: fixed;
  top: 50%;
  display: grid;
  place-items: center;
  width: 46px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: 8px;
  background: rgba(24, 32, 29, 0.48);
  color: #fff;
  cursor: pointer;
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  padding: 0 0 5px;
  pointer-events: auto;
  transform: translateY(-50%);
  transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.drawer-listing-nav-button:hover,
.drawer-listing-nav-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(24, 32, 29, 0.62);
  outline: 0;
}

.drawer-listing-prev {
  left: max(18px, calc(50vw - (min(100vw, max(560px, 38.2vw)) / 2) - 64px));
}

.drawer-listing-next {
  right: max(18px, calc(50vw - (min(100vw, max(560px, 38.2vw)) / 2) - 64px));
}

.drawer-listing-nav-button:disabled {
  cursor: not-allowed;
  opacity: 0.28;
}

.drawer-save-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.drawer-pin-button,
.drawer-favorite-button {
  height: 30px;
  padding: 0 10px;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2400;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  gap: 0;
  background: rgba(12, 17, 15, 0.82);
  padding: clamp(14px, 3vw, 34px);
}

.photo-lightbox[hidden] {
  display: none;
}

.map-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  background: rgba(12, 17, 15, 0.78);
  padding: clamp(14px, 3vw, 34px);
}

.map-lightbox[hidden] {
  display: none;
}

.pinned-compare-modal {
  position: fixed;
  inset: 0;
  z-index: 2100;
  display: grid;
  place-items: center;
  background: rgba(12, 17, 15, 0.72);
  padding: clamp(12px, 2.5vw, 28px);
}

.pinned-compare-modal[hidden] {
  display: none;
}

.pinned-compare-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  width: min(1180px, 96vw);
  height: min(820px, 90vh);
  border: 1px solid rgba(223, 229, 220, 0.84);
  border-radius: 10px;
  background: #f7f9f6;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  padding: 14px;
}

.pinned-compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.pinned-compare-header > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pinned-compare-header strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.pinned-compare-header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.pinned-compare-content {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 340px);
  gap: 14px;
  min-height: 0;
  overflow: auto hidden;
  padding: 2px 2px 10px;
  scroll-snap-type: x proximity;
}

.pinned-compare-card {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
  scroll-snap-align: start;
  border: 1px solid rgba(213, 222, 211, 0.94);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(24, 32, 29, 0.08);
  padding: 12px;
}

.compare-remove-pin {
  justify-self: end;
  height: 30px;
  padding: 0 10px;
}

.pinned-compare-image {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #e8ece5;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
}

.pinned-compare-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pinned-compare-main {
  display: grid;
  gap: 11px;
}

.pinned-compare-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.pinned-compare-price-row strong {
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
}

.pinned-compare-address {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.pinned-compare-address:hover span,
.pinned-compare-address:focus-visible span {
  color: var(--brand-dark);
  text-decoration: underline;
}

.pinned-compare-facts {
  gap: 6px;
}

.pinned-compare-details {
  display: grid;
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--line);
}

.pinned-compare-details div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.pinned-compare-details dt {
  color: #65736c;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.pinned-compare-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}

.pinned-empty {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-weight: 800;
}

.map-lightbox-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  width: min(1120px, 94vw);
  height: min(820px, 88vh);
  border: 1px solid rgba(223, 229, 220, 0.2);
  border-radius: 10px;
  background: #f7f9f6;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  padding: 12px;
}

.map-lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.map-lightbox-header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.maximized-listing-map {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8ece5;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(calc(100vw - 184px), 1180px);
  height: min(calc(100vh - 198px), 820px);
  min-height: 0;
  overflow: visible;
  touch-action: pan-y;
}

.lightbox-stage .storybook-info-button {
  left: 12px;
  top: 12px;
  z-index: 1502;
}

.lightbox-stage .storybook-info-popover {
  left: 50%;
  top: 50px;
  z-index: 1502;
  width: min(460px, calc(100vw - 72px));
  max-height: min(360px, calc(100vh - 148px));
}

.lightbox-stage > img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  object-fit: contain;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 46px;
  height: 56px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 8px;
  background: rgba(12, 17, 15, 0.58);
  color: #fff;
  cursor: pointer;
  font-size: 38px;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  transform: translateY(-50%);
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.lightbox-nav:hover,
.lightbox-nav:focus-visible {
  border-color: rgba(255, 255, 255, 0.82);
  background: rgba(12, 17, 15, 0.72);
  transform: translateY(-50%) scale(1.03);
}

.lightbox-nav[hidden] {
  display: none;
}

.lightbox-prev {
  left: -74px;
}

.lightbox-next {
  right: -74px;
}

.lightbox-thumbs {
  display: flex;
  gap: 6px;
  max-width: min(100%, 860px);
  overflow-x: auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  padding: 6px;
  scrollbar-width: none;
}

.lightbox-thumbs::-webkit-scrollbar {
  display: none;
}

.lightbox-thumbs .gallery-thumb {
  flex-basis: 144px;
  width: 144px;
  border-color: rgba(255, 255, 255, 0.28);
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1501;
}

.drawer-title h2 {
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
  letter-spacing: 0;
}

.drawer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.map-section {
  gap: 8px;
}

.listing-map {
  position: relative;
  display: grid;
  place-items: center;
  height: 250px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #e8ece5;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.listing-map-wrap {
  position: relative;
}

.map-maximize-button {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(213, 222, 211, 0.96);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--brand-dark);
  box-shadow: 0 6px 16px rgba(24, 32, 29, 0.14);
  cursor: pointer;
}

.map-maximize-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.map-maximize-button:hover,
.map-maximize-button:focus-visible {
  border-color: rgba(15, 111, 92, 0.42);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(15, 111, 92, 0.1), 0 6px 16px rgba(24, 32, 29, 0.14);
  outline: 0;
}

.listing-map .maplibregl-control-container {
  font: initial;
}

.street-view-link {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 7px;
  border: 1px solid rgba(15, 111, 92, 0.38);
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 5px 14px rgba(15, 111, 92, 0.18);
}

.street-view-link svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.street-view-link:hover {
  border-color: rgba(15, 111, 92, 0.5);
  background: var(--brand-dark);
}

.detail-section {
  display: grid;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.detail-section h3 {
  font-size: 15px;
  letter-spacing: 0;
}

.detail-heading-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.detail-heading-row > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hospital-list {
  display: grid;
  gap: 8px;
}

.hospital-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  border-bottom: 1px solid #eef2ed;
  padding: 8px 0;
}

.hospital-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.hospital-item strong {
  overflow: hidden;
  color: #29342f;
  font-size: 14px;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.hospital-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  gap: 8px;
}

.hospital-actions b {
  flex: 0 0 auto;
  border: 1px solid rgba(15, 111, 92, 0.18);
  border-radius: 999px;
  background: rgba(15, 111, 92, 0.07);
  color: var(--brand-dark);
  padding: 4px 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
}

.hospital-actions button {
  flex: 0 0 auto;
  border: 1px solid rgba(15, 111, 92, 0.28);
  border-radius: 6px;
  background: #fff;
  color: var(--brand-dark);
  cursor: pointer;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.hospital-actions button:hover,
.hospital-actions button:focus-visible {
  border-color: rgba(15, 111, 92, 0.48);
  background: rgba(15, 111, 92, 0.08);
  outline: 0;
}

.hospital-actions button[aria-pressed="true"] {
  border-color: rgba(217, 107, 95, 0.42);
  background: #fff0ea;
  color: #9e3f35;
}

.description {
  color: #34413b;
  line-height: 1.55;
  white-space: pre-line;
}

.storybook-riddle {
  border: 1px solid var(--storybook-card-border);
  border-radius: 8px;
  background: var(--storybook-card-bg);
  color: #32443d;
  overflow: clip;
}

.storybook-riddle.adult {
  border-color: rgba(15, 111, 92, 0.25);
  background: #f4faf5;
}

.storybook-riddle.solved {
  border-color: rgba(15, 111, 92, 0.42);
  background: #eaf7ee;
  box-shadow: inset 0 0 0 1px rgba(15, 111, 92, 0.08);
}

.storybook-riddle.solved .storybook-riddle-label,
.storybook-riddle.solved .storybook-riddle-cue,
.storybook-riddle.solved .storybook-riddle-status {
  color: #0f6f5c;
}

.storybook-riddle.solved .storybook-riddle-body {
  border-top-color: rgba(15, 111, 92, 0.18);
}

.storybook-riddle-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
}

.storybook-riddle-toggle::-webkit-details-marker {
  display: none;
}

.storybook-riddle-label {
  color: var(--storybook-label);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.storybook-riddle.adult .storybook-riddle-label {
  color: #0f6f5c;
}

.storybook-challenge-control {
  margin-top: 13px;
  width: 100%;
}

.storybook-challenge-slider {
  display: block;
  margin-top: 4px;
  width: 100%;
  accent-color: var(--brand);
  cursor: pointer;
}

.storybook-challenge-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  color: #6c756f;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.storybook-challenge-levels button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-transform: inherit;
  padding: 4px 6px;
}

.storybook-challenge-levels button:hover,
.storybook-challenge-levels button:focus-visible {
  background: var(--theme-soft);
  color: var(--brand);
  outline: 0;
}

.storybook-challenge-levels button.active {
  background: var(--theme-focus);
  color: var(--brand);
}

.storybook-challenge-levels button.unavailable {
  cursor: not-allowed;
  opacity: 0.38;
}

.storybook-challenge-panel {
  display: none;
}

.storybook-challenge-panel.active {
  display: block;
}

.storybook-riddle-cue {
  flex: 0 0 auto;
  border: 1px solid rgba(141, 108, 33, 0.25);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: #6f4f12;
  font-size: 12px;
  font-weight: 900;
  padding: 4px 9px;
}

.storybook-riddle.adult .storybook-riddle-cue {
  border-color: rgba(15, 111, 92, 0.25);
  color: #0f6f5c;
}

.storybook-riddle[open] .storybook-riddle-cue {
  color: #59665f;
}

.storybook-riddle-cue::before {
  content: "Open";
}

.storybook-riddle[open] .storybook-riddle-cue::before {
  content: "Close";
}

.storybook-riddle-body {
  position: relative;
  border-top: 1px solid rgba(155, 138, 91, 0.18);
  padding: 0 16px 14px;
}

.storybook-riddle.adult .storybook-riddle-body {
  border-top-color: rgba(15, 111, 92, 0.14);
}

.storybook-riddle p {
  margin: 12px 0 0;
  line-height: 1.55;
}

.storybook-riddle-actions {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.storybook-riddle-reset {
  flex: 0 0 auto;
  margin-left: auto;
  border: 1px solid rgba(141, 108, 33, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: #7d6121;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 6px 10px;
}

.storybook-riddle-reset:hover,
.storybook-riddle-reset:focus-visible {
  border-color: rgba(141, 108, 33, 0.42);
  background: #fff;
  outline: 0;
}

.storybook-riddle-reset:disabled {
  cursor: default;
  opacity: 0.42;
}

.storybook-riddle-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.storybook-riddle-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.storybook-riddle-form span {
  color: #59665f;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.storybook-riddle-form input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(92, 109, 97, 0.28);
  border-radius: 7px;
  background: #fffef9;
  color: #24352f;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  padding: 10px 11px;
}

.storybook-riddle-form input:focus {
  border-color: rgba(15, 111, 92, 0.55);
  outline: 3px solid rgba(15, 111, 92, 0.14);
}

.storybook-riddle-form button {
  border: 1px solid rgba(15, 111, 92, 0.28);
  border-radius: 7px;
  background: #0f6f5c;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 900;
  padding: 10px 14px;
}

.storybook-riddle-form button:disabled,
.storybook-riddle-form input:disabled {
  cursor: default;
  opacity: 0.62;
}

.storybook-riddle-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: #59665f;
  font-size: 13px;
  font-weight: 750;
}

.storybook-riddle-form.has-error .storybook-riddle-status {
  color: #9e3f35;
}

.storybook-riddle.solved .storybook-riddle-status {
  color: #0f6f5c;
}

.storybook-riddle-answer {
  margin-top: 0;
}

.storybook-riddle-answer summary {
  width: max-content;
  max-width: 100%;
  color: var(--brand-dark);
  cursor: pointer;
  font-size: 14px;
  font-weight: 850;
}

.storybook-riddle-answer strong {
  display: inline-block;
  margin-top: 8px;
  color: #6f4f12;
  font-size: 15px;
  text-transform: capitalize;
}

@media (max-width: 560px) {
  .storybook-riddle-form {
    grid-template-columns: 1fr;
  }

  .storybook-riddle-form button {
    width: 100%;
  }
}

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

.kv div {
  min-width: 0;
  border-bottom: 1px solid rgba(223, 229, 220, 0.72);
  padding: 9px 0;
}

.kv span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.kv strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 15px;
  line-height: 1.25;
}

.area-insights {
  gap: 12px;
}

.area-insight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.area-insight-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid rgba(187, 197, 190, 0.64);
  border-radius: 8px;
  background: #f4f6f3;
  padding: 11px 12px;
}

.area-insight-card.is-loaded {
  border-color: rgba(187, 197, 190, 0.72);
  background: #f4f6f3;
}

.area-insight-card.is-pending {
  background: #fbfbf8;
}

.area-insight-card.is-crime-good,
.area-insight-card.is-crime-worse {
  border-color: var(--insight-border);
  background: var(--insight-tint);
}

.area-insight-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.area-insight-head span {
  color: #52666f;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.area-insight-year {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 4px;
  border: 1px solid rgba(100, 113, 106, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  padding: 2px 5px;
  color: #52666f;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.area-insight-year span {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: 0;
  text-transform: none;
}

.area-insight-year button {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 0;
  border-radius: 999px;
  background: rgba(100, 113, 106, 0.12);
  color: #56635d;
  cursor: pointer;
  font: inherit;
  line-height: 1;
  padding: 0;
}

.area-insight-year button:disabled {
  opacity: 0.35;
  cursor: default;
}

.area-insight-head em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(15, 111, 92, 0.1);
  color: #0f6f5c;
  padding: 3px 7px;
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
}

.area-insight-card.is-pending .area-insight-head em {
  background: #eef1ec;
  color: #6c7770;
}

.area-insight-card strong {
  display: block;
  overflow-wrap: anywhere;
  color: #16201c;
  font-size: 18px;
  line-height: 1.05;
}

.area-insight-trend {
  display: block;
  margin-top: 5px;
  color: #236f9f;
  font-size: 14px;
  font-weight: 900;
}

.area-insight-card.is-crime-good .area-insight-trend,
.area-insight-card.is-crime-worse .area-insight-trend {
  color: var(--insight-accent);
}

.area-insight-card small {
  display: block;
  margin-top: auto;
  padding-top: 8px;
  color: #56635d;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.area-insight-note {
  display: flex;
  flex-direction: column-reverse;
  margin-top: auto;
  padding-top: 8px;
}

.area-insight-note summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  color: #56635d;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
  list-style: none;
}

.area-insight-note summary::-webkit-details-marker {
  display: none;
}

.area-insight-note summary::after {
  display: block;
  width: 0;
  height: 0;
  border-top: 3.5px solid transparent;
  border-bottom: 3.5px solid transparent;
  border-left: 5px solid currentColor;
  content: "";
  opacity: 0.85;
  transition: transform 120ms ease;
}

.area-insight-note[open] summary::after {
  transform: rotate(90deg);
}

.area-insight-note p {
  margin: 0 0 6px;
  color: #65716b;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}

.area-insight-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 10px;
}

.area-insight-metrics div {
  min-width: 0;
  border: 1px solid rgba(214, 224, 218, 0.72);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.62);
  padding: 7px 8px;
}

.area-insight-metrics div.is-trend-coded {
  border-color: var(--metric-border);
  background: var(--metric-tint);
}

.area-insight-metrics div.is-trend-coded em {
  color: var(--metric-accent);
}

.area-insight-metrics span {
  display: block;
  color: #65716b;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.area-insight-metrics strong {
  display: inline;
  margin-right: 4px;
  font-size: 13px;
  line-height: 1.1;
}

.area-insight-metrics em {
  color: #0f6f5c;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.area-attribution {
  display: grid;
  gap: 4px;
  color: #87938d;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.area-attribution div {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
}

.area-attribution a {
  color: #6f7c75;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.facts-features {
  gap: 18px;
}

.facts-feature-group {
  display: grid;
  gap: 8px;
  border-left: 3px solid rgba(15, 111, 92, 0.22);
  padding: 2px 0 2px 12px;
}

.facts-feature-group h4 {
  margin: 0;
  color: #1f2925;
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0;
}

.facts-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.facts-feature-grid div {
  min-width: 0;
  border: 1px solid rgba(223, 229, 220, 0.86);
  border-radius: 6px;
  background: rgba(251, 253, 249, 0.72);
  padding: 8px 10px;
}

.facts-feature-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.025em;
  text-transform: uppercase;
}

.facts-feature-grid strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  color: #1f2925;
  font-size: 14px;
  line-height: 1.25;
}

.drawer-source {
  border-top: 1px solid #eef2ed;
  padding-top: 12px;
  color: #87938d;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.empty {
  grid-column: 1 / -1;
  justify-self: center;
  width: min(420px, 100%);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  padding: 28px;
  text-align: center;
}

@media (max-width: 1360px) {
  .topbar {
    grid-template-columns: minmax(150px, max-content) minmax(0, 1fr) 274px;
    align-items: start;
    gap: 8px 14px;
  }

  .brand-block {
    grid-column: 1;
    grid-row: 1;
  }

  .brand-icon {
    width: 42px;
    height: 42px;
  }

  .brand-block h1 {
    font-size: clamp(25px, 2.05vw, 32px);
  }

  .brand-wordmark {
    font-size: clamp(29px, 1.35vw, 40px);
  }

  .partner-line {
    max-width: min(100%, 240px);
    padding: 2px 8px;
    font-size: 11px;
    line-height: 1.15;
  }

  .filter-panel {
    grid-column: 2;
    grid-row: 1;
    justify-self: stretch;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 42px;
    align-items: end;
  }

  .filter-panel .search-field {
    grid-column: 1;
    grid-row: 1;
  }

  .filter-panel .filter-options-toggle {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    justify-self: end;
  }

  .filter-options-panel {
    position: absolute;
    z-index: 1250;
    top: calc(100% + 8px);
    right: 0;
    display: none;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 14px 12px;
    width: min(520px, calc(100vw - 24px));
    border: 2px solid rgba(223, 229, 220, 0.92);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(24, 32, 29, 0.16);
    padding: 14px;
  }

  .filter-options-panel.open {
    display: grid;
  }

  .filter-options-panel .price-range-field {
    grid-column: 1 / -1;
  }

  .filter-options-panel .storybook-field {
    margin-top: 4px;
  }

  .search-field > span,
  .display-panel .storybook-field > span,
  .display-panel .sort-field > span {
    display: none;
  }

  #resultSummary {
    grid-column: 2 / 4;
    grid-row: 2;
    justify-self: stretch;
    width: 100%;
    padding-top: 8px;
  }

  .display-panel {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    width: min(100%, 274px);
  }

}

@media (max-width: 762px) {
  body {
    height: auto;
    min-height: 100vh;
    overflow: auto;
    display: block;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 1700;
    grid-template-columns: 1fr;
  }

  .brand-block {
    grid-column: 1;
    grid-row: 1;
    grid-template-columns: max-content minmax(0, 1fr);
    align-items: end;
    gap: 12px;
    max-height: 128px;
    min-height: 0;
    width: 100%;
    transition: max-height 180ms ease, opacity 160ms ease, margin 180ms ease;
  }

  .topbar.brand-collapsed {
    row-gap: 0;
  }

  .topbar.brand-collapsed .brand-block {
    max-height: 0;
    margin: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .brand-right {
    justify-self: end;
    align-self: end;
  }

  .brand-block h1 {
    max-width: none;
  }

  .drawer-listing-nav {
    display: none;
  }

  .lightbox-stage {
    max-width: 100%;
  }

  .lightbox-nav {
    display: grid;
    width: 46px;
    height: 56px;
    font-size: 40px;
  }

  .lightbox-prev {
    left: 8px;
  }

  .lightbox-next {
    right: 8px;
  }

  .filter-panel {
    grid-column: 1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) 42px 42px;
    align-items: end;
    justify-self: stretch;
    width: 100%;
  }

  .filter-panel .search-field {
    grid-column: 1;
    grid-row: 1;
  }

  .filter-panel .filter-options-toggle {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    justify-self: end;
  }

  .filter-panel > .view-options-toggle {
    display: grid;
    grid-column: 3;
    grid-row: 1;
    align-self: end;
    justify-self: end;
  }

  .filter-options-panel {
    position: absolute;
    z-index: 1800;
    top: calc(100% + 8px);
    right: auto;
    left: 50%;
    display: none;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    gap: 10px;
    width: min(520px, calc(100vw - 24px));
    border: 1px solid rgba(223, 229, 220, 0.92);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(24, 32, 29, 0.16);
    padding: 12px;
    transform: translateX(-50%);
  }

  .filter-options-panel.open {
    display: grid;
  }

  .filter-options-panel .price-range-field {
    grid-column: 1 / -1;
  }

  .filter-options-panel .detail-field .range-note {
    display: none;
  }

  .filter-options-panel .hot-field {
    grid-column: 1;
  }

  .filter-options-panel .pinned-field {
    grid-column: 2;
  }

  .filter-options-panel .mobile-filter-action-row {
    display: none;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
    margin-top: 0;
    order: 30;
  }

  .filter-options-panel .mobile-filter-action-row .field {
    align-self: end;
    grid-template-rows: 36px;
    justify-items: center;
    width: 100%;
  }

  .filter-options-panel .mobile-filter-action-row .field > span {
    display: none;
  }

  .filter-options-panel .mobile-filter-action-row .hot-field {
    grid-column: 1;
  }

  .filter-options-panel .mobile-filter-action-row .pinned-field {
    grid-column: 2;
  }

  .filter-options-panel .mobile-filter-action-row .mobile-filter-reset-field {
    display: grid;
    grid-column: 3;
    align-content: end;
  }

  .filter-options-panel .mobile-filter-action-row .mobile-filter-reset-button {
    grid-row: 1;
  }

  .filter-options-panel .hot-field,
  .filter-options-panel .pinned-field {
    justify-self: stretch;
    width: 100%;
  }

  .filter-options-panel .sort-field {
    grid-column: 1 / -1;
    order: 20;
  }

  #resultSummary {
    grid-column: 1;
    grid-row: 3;
  }

  .main-layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto;
    min-height: 0;
  }

  .listing-pane {
    height: auto;
    overflow: visible;
    padding-right: 0;
  }

  .split-handle {
    display: none;
  }

  .main-map-pane {
    grid-column: 1 / -1;
    height: auto;
  }

  .main-listings-map {
    height: 420px;
    min-height: 360px;
  }

  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dual-range,
  .dual-range input[type="range"] {
    height: 32px;
  }

  .range-track {
    top: 12px;
    height: 8px;
  }

  .dual-range input[type="range"]::-webkit-slider-runnable-track {
    height: 8px;
  }

  .dual-range input[type="range"]::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    margin-top: -8px;
  }

  .dual-range input[type="range"]::-moz-range-track {
    height: 8px;
  }

  .dual-range input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
  }

  .display-panel {
    grid-column: 1;
    grid-row: 4;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 42px;
    justify-self: stretch;
    width: 100%;
  }

  .display-panel.view-in-filter {
    display: none;
  }

  .display-panel .storybook-field {
    grid-column: 1;
    grid-row: 1;
  }

  .display-panel .sort-field {
    grid-column: 2;
    grid-row: 1;
  }

  .view-options-toggle {
    display: grid;
    grid-column: 3;
    grid-row: 1;
    align-self: end;
    justify-self: end;
  }

  .filter-options-panel .sort-options {
    top: auto;
    bottom: calc(100% + 6px);
  }

  .view-options-panel {
    position: absolute;
    right: auto;
    left: 50%;
    top: calc(100% + 8px);
    bottom: auto;
    z-index: 1800;
    grid-template-columns: repeat(2, minmax(130px, 1fr));
    width: min(520px, calc(100vw - 24px));
    transform: translateX(-50%);
  }

  .view-options-panel > .view-action-row {
    display: grid;
    grid-column: 2;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-items: end;
  }

  .view-options-panel > .match-field {
    grid-column: 1;
  }

  .view-options-panel > .view-action-row > .field {
    justify-items: center;
    width: 100%;
  }

  .view-options-panel > .view-action-row > .hot-field {
    grid-column: 1;
  }

  .view-options-panel > .view-action-row > .pinned-field {
    grid-column: 2;
  }

  .view-options-panel > .view-action-row > .favorite-field {
    grid-column: 3;
  }

  .view-options-panel > .view-action-row > .reset-field {
    grid-column: 4;
  }
}

@media (max-width: 560px) {
  .main-layout {
    grid-template-rows: auto auto;
    padding-inline: 10px;
  }

  .main-listings-map {
    height: 340px;
    min-height: 300px;
  }

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

  .filter-panel {
    grid-template-columns: minmax(0, 1fr) 42px 42px;
    align-items: end;
  }

  .filter-panel .search-field {
    grid-column: 1;
    grid-row: 1;
  }

  .filter-panel .filter-options-toggle {
    display: grid;
    grid-column: 2;
    grid-row: 1;
    align-self: end;
    justify-self: end;
  }

  .filter-panel .filter-options-panel {
    right: auto;
    left: 50%;
    z-index: 1800;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 10px;
    width: min(360px, calc(100vw - 20px));
    max-height: min(72vh, 560px);
    overflow-y: auto;
    transform: translateX(-50%);
  }

  .filter-panel .filter-options-panel .field,
  .filter-panel .filter-options-panel .price-range-field {
    grid-column: 1 / -1;
  }

  .filter-panel .filter-options-panel .mobile-filter-action-row {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-panel .filter-options-panel .hot-field {
    grid-column: 1;
  }

  .filter-panel .filter-options-panel .pinned-field {
    grid-column: 2;
  }

  .filter-panel .filter-options-panel .hot-field,
  .filter-panel .filter-options-panel .pinned-field {
    width: 100%;
  }

  .filter-panel .filter-options-panel .mobile-filter-action-row .hot-field {
    grid-column: 1;
  }

  .filter-panel .filter-options-panel .mobile-filter-action-row .pinned-field {
    grid-column: 2;
  }

  .filter-panel .filter-options-panel .mobile-filter-action-row .mobile-filter-reset-field {
    grid-column: 3;
  }

  #resultSummary {
    gap: 7px;
    min-height: 26px;
  }

  #resultSummary.is-empty {
    display: none;
    min-height: 0;
  }

  .summary-count {
    left: 50%;
    transform: translateX(-50%);
  }

  .location-pill {
    max-width: min(42vw, 220px);
  }

  .summary-filters {
    flex-wrap: wrap;
    gap: 5px;
    max-height: 26px;
  }

  #resultSummary.filters-wrapped .summary-filters {
    max-height: none;
  }

  .filter-chip {
    max-width: min(210px, calc(100vw - 40px));
  }

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

  .display-panel {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 42px;
  }

  .view-options-panel {
    grid-template-columns: 1fr;
    width: min(320px, calc(100vw - 20px));
  }

  .search-field,
  .price-range-field,
  .detail-field,
  .zoom-field {
    grid-column: auto;
  }

  .drawer-grid,
  .kv {
    grid-template-columns: 1fr 1fr;
  }

  .drawer-address-row {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .drawer-stats {
    margin-left: auto;
  }

  .pinned-compare-panel {
    width: min(100%, calc(100vw - 16px));
    height: min(92vh, 820px);
    padding: 10px;
  }

  .pinned-compare-content {
    grid-auto-columns: minmax(238px, 84vw);
    gap: 10px;
  }

  .pinned-compare-header strong {
    font-size: 16px;
  }

  .area-insight-grid {
    grid-template-columns: 1fr;
  }
}


/* Story app layer: keep template UI, swap the domain to books. */
.story-main-layout {
  grid-template-columns: 1fr;
  padding: 22px clamp(14px, 3vw, 34px) 40px;
}
.story-main-layout .listing-pane {
  height: auto;
  overflow: visible;
  padding-right: 0;
}
.story-title-card {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta-line {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.story-stars {
  color: #b66f2b;
  letter-spacing: 0;
  white-space: nowrap;
}
.story-drawer {
  width: min(100vw, max(760px, 61.8vw));
}
.drawer-listing-prev {
  left: max(18px, calc(50vw - (min(100vw, max(760px, 61.8vw)) / 2) - 64px));
}
.drawer-listing-next {
  right: max(18px, calc(50vw - (min(100vw, max(760px, 61.8vw)) / 2) - 64px));
}
.story-reader {
  gap: 14px;
}
.reader-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding-right: 46px;
}
.reader-toolbar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}
.reader-toolbar strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(20px, 2vw, 30px);
  font-weight: 900;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.reader-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}
.reader-mini-button {
  height: 30px;
  border: 1px solid rgba(213, 222, 211, 0.96);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #526159;
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
  padding: 0 10px;
}
.reader-mini-button:hover,
.reader-mini-button:focus-visible {
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--theme-focus);
  outline: 0;
}
.reader-page {
  display: grid;
  grid-template-columns: minmax(240px, .9fr) minmax(320px, 1.1fr);
  gap: clamp(18px, 3vw, 34px);
  align-items: stretch;
  min-width: 0;
}
.reader-image {
  display: grid;
  place-items: center;
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #efe6d4;
  padding: 12px;
}
.reader-image img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 230px);
  object-fit: contain;
  transition: filter 180ms ease;
}
.reader-image img.storybook-locked {
  filter: saturate(.5);
}
.reader-image img.storybook-unlocked {
  filter: saturate(1);
}
.reader-copy {
  display: grid;
  align-content: center;
  gap: 16px;
  min-width: 0;
}
.reader-copy h2 {
  margin: 0;
  color: var(--brand-dark);
  font-size: clamp(38px, 5vw, 74px);
  line-height: .98;
  letter-spacing: 0;
}
.book-source {
  color: var(--brand);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1;
  text-transform: uppercase;
}
.book-summary {
  color: #454b45;
  font-size: 18px;
  line-height: 1.55;
}
.book-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
.book-details div {
  min-width: 0;
  border: 1px solid rgba(31,36,32,.1);
  border-radius: 8px;
  background: rgba(247,246,241,.72);
  padding: 10px;
}
.book-details dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .1em;
  line-height: 1;
  text-transform: uppercase;
}
.book-details dd {
  margin: 4px 0 0;
  font-weight: 760;
}
.story-copy {
  align-content: start;
  min-height: 420px;
  border: 1px solid rgba(31,36,32,.1);
  border-radius: 8px;
  background: #fffaf0;
  box-shadow: inset 0 0 34px rgba(132,91,54,.06);
  color: #2f352f;
  font-size: clamp(21px, 2vw, 30px);
  line-height: 1.52;
  padding: clamp(20px, 3vw, 34px);
}
.story-copy p + p {
  margin-top: 14px;
}
.story-copy em {
  color: #6b3c80;
}
.reader-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4dfd2;
}
.reader-progress div {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--signal), var(--brand));
}
.reader-nav {
  display: grid;
  grid-template-columns: 1fr max-content 1fr;
  gap: 12px;
  align-items: center;
}
.reader-nav button {
  min-height: 42px;
  border: 1px solid rgba(213, 222, 211, 0.96);
  border-radius: 6px;
  background: var(--field-bg);
  color: var(--brand-dark);
  cursor: pointer;
  font-weight: 850;
}
.reader-nav button:last-child {
  background: var(--brand);
  color: #fff;
}
.reader-nav button:disabled {
  cursor: not-allowed;
  opacity: .42;
}
.reader-nav span {
  min-width: 120px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}
.pinned-tray-thumb img.storybook-locked,
.card .gallery.storybook-locked img {
  filter: saturate(.5);
}
.pinned-tray-thumb img.storybook-unlocked,
.card .gallery.storybook-unlocked img {
  filter: saturate(1);
}
@media (max-width: 762px) {
  .story-main-layout {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto;
  }
  .story-drawer {
    width: 100vw;
  }
  .reader-toolbar {
    display: grid;
    padding-right: 42px;
  }
  .drawer-save-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .reader-page {
    grid-template-columns: 1fr;
  }
  .reader-image {
    min-height: 260px;
  }
  .reader-image img {
    max-height: 38vh;
  }
  .book-details {
    grid-template-columns: 1fr;
  }
  .reader-copy h2 {
    font-size: 42px;
  }
  .story-copy {
    min-height: 0;
    font-size: 21px;
  }
  .reader-nav {
    grid-template-columns: 1fr;
  }
}


/* Story removes the template Storybook mode, so the display panel is Sort + View Options. */
.display-panel {
  grid-template-columns: minmax(90px, 1fr) 36px;
}
.display-panel .sort-field {
  grid-column: 1;
}
.display-panel > .view-options-toggle {
  grid-column: 2;
}
@media (max-width: 762px) {
  .display-panel {
    grid-template-columns: minmax(0, 1fr) 42px;
  }
  .display-panel .sort-field {
    grid-column: 1;
  }
  .display-panel > .view-options-toggle {
    grid-column: 2;
  }
}


.story-card-description span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  white-space: normal;
}


.pinned-story-reader .reader-toolbar {
  padding-right: 42px;
}
.pinned-story-reader .reader-page {
  grid-template-columns: 1fr;
}
.pinned-story-reader .reader-image {
  min-height: 260px;
}
.pinned-story-reader .reader-image img {
  max-height: 38vh;
}
.pinned-story-reader .reader-copy h2 {
  font-size: clamp(32px, 4vw, 48px);
}
.pinned-story-reader .book-details {
  grid-template-columns: 1fr;
}
.pinned-story-reader .story-copy {
  min-height: 0;
  font-size: clamp(18px, 1.65vw, 22px);
}


.reader-nav {
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 762px) {
  .reader-nav {
    grid-template-columns: 1fr;
  }
}


.story-reader {
  min-height: 100vh;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
.story-reader .reader-page {
  min-height: 0;
  align-self: stretch;
}
.story-reader .reader-image {
  min-height: 520px;
  height: 100%;
}
.story-reader .reader-image img {
  max-height: calc(100vh - 170px);
}
.story-reader .reader-nav {
  align-self: end;
  margin-top: auto;
}
.pinned-story-reader {
  min-height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}
.pinned-story-reader .reader-image {
  min-height: 360px;
}
.pinned-story-reader .reader-image img {
  max-height: calc(100vh - 190px);
}
@media (max-width: 762px) {
  .story-reader {
    min-height: 100vh;
  }
  .story-reader .reader-image {
    min-height: 360px;
  }
  .story-reader .reader-image img {
    max-height: 52vh;
  }
}


.story-reader .reader-page.image-vertical {
  grid-template-columns: minmax(240px, .9fr) minmax(320px, 1.1fr);
}
.story-reader .reader-page.image-horizontal {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1.15fr) auto;
  align-content: stretch;
}
.story-reader .reader-page.image-horizontal .reader-image {
  min-height: min(58vh, 620px);
}
.story-reader .reader-page.image-horizontal .reader-image img {
  max-height: min(58vh, 620px);
}
.story-reader .reader-page.image-horizontal .reader-copy {
  align-content: start;
}
.story-reader .reader-page.image-horizontal .story-copy {
  min-height: 0;
}
.pinned-story-reader .reader-page.image-horizontal,
.pinned-story-reader .reader-page.image-vertical {
  grid-template-columns: 1fr;
}
@media (max-width: 762px) {
  .story-reader .reader-page.image-vertical,
  .story-reader .reader-page.image-horizontal {
    grid-template-columns: 1fr;
  }
}


/* Reader refinement: quieter book spread, less empty matting. */
.story-reader {
  --reader-gap: clamp(18px, 2.4vw, 28px);
  --reader-page-bg: #fffaf0;
  --reader-mat-bg: #f1e6d3;
}
.story-reader .reader-page.image-vertical {
  grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr);
  gap: var(--reader-gap);
  align-items: stretch;
}
.story-reader .reader-image {
  min-height: min(68vh, 690px);
  border-color: rgba(31, 36, 32, 0.1);
  background: var(--reader-mat-bg);
  padding: clamp(10px, 1.4vw, 18px);
}
.story-reader .reader-page.image-vertical .reader-image img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 182px);
  object-fit: contain;
}
.story-reader .reader-page.image-horizontal .reader-image {
  min-height: min(56vh, 610px);
}
.story-reader .reader-page.image-horizontal .reader-image img {
  width: 100%;
  height: 100%;
  max-height: min(56vh, 610px);
}
.story-copy {
  display: grid;
  align-content: start;
  min-height: 0;
  background: var(--reader-page-bg);
  font-size: clamp(20px, 1.65vw, 25px);
  line-height: 1.5;
  padding: clamp(28px, 3.2vw, 48px);
}
.story-copy p + p {
  margin-top: clamp(16px, 2.4vw, 30px);
}
.cover-page .reader-copy {
  align-content: center;
}
.reader-progress {
  margin-top: 2px;
}
.reader-nav {
  gap: clamp(10px, 1.6vw, 18px);
}
@media (min-width: 1200px) {
  .story-drawer {
    width: min(96vw, 1240px);
  }
}
@media (max-width: 900px) {
  .story-reader .reader-page.image-vertical {
    grid-template-columns: 1fr;
  }
  .story-reader .reader-image {
    min-height: 360px;
  }
  .story-reader .reader-page.image-vertical .reader-image img,
  .story-reader .reader-page.image-horizontal .reader-image img {
    max-height: 52vh;
  }
}


/* Story read-state saturation: fresh books are full color; completed books dim. */
.reader-image img.storybook-locked,
.pinned-tray-thumb img.storybook-locked,
.card .gallery.storybook-locked img {
  filter: saturate(1);
}
.reader-image img.storybook-unlocked,
.pinned-tray-thumb img.storybook-unlocked,
.card .gallery.storybook-unlocked img {
  filter: saturate(.5);
}

/* Back cover review mock */
.back-cover-page .reader-copy {
  align-content: center;
  gap: 16px;
}
.mock-review-card {
  display: grid;
  gap: 14px;
  margin-top: clamp(10px, 1.8vw, 20px);
  padding: clamp(16px, 2.2vw, 24px);
  border: 1px solid rgba(31, 36, 32, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.48);
  box-shadow: 0 14px 30px rgba(55, 46, 31, 0.06);
}
.mock-review-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
}
.mock-review-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}
.mock-rating {
  display: flex;
  gap: 6px;
}
.mock-rating button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(189, 137, 24, 0.24);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.85);
  color: #bd8918;
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1;
}
.mock-rating button.selected {
  background: rgba(255, 239, 190, 0.8);
}
.mock-review-input {
  width: 100%;
  min-height: 122px;
  resize: vertical;
  border: 1px solid rgba(31, 36, 32, 0.14);
  border-radius: 8px;
  background: rgba(255, 250, 240, 0.86);
  color: var(--ink);
  font: 700 0.95rem/1.45 var(--font-body);
  padding: 12px 14px;
}
.mock-review-input::placeholder {
  color: rgba(79, 85, 78, 0.58);
}
.mock-review-submit {
  justify-self: start;
}

/* Scrollable reader progress */
.reader-progress {
  display: block;
  height: auto;
  margin-top: 2px;
  padding: 4px 0 7px;
  overflow-x: auto;
  overflow-y: hidden;
  background: transparent;
  border-radius: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 98, 141, 0.42) rgba(224, 221, 211, 0.85);
}
.reader-progress::-webkit-scrollbar {
  height: 8px;
}
.reader-progress::-webkit-scrollbar-track {
  background: rgba(224, 221, 211, 0.85);
  border-radius: 999px;
}
.reader-progress::-webkit-scrollbar-thumb {
  background: rgba(122, 98, 141, 0.42);
  border-radius: 999px;
}
.reader-progress-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 28px;
  gap: 5px;
  min-width: max-content;
  padding: 0 2px;
}
.reader-progress .reader-progress-strip {
  width: auto;
  height: auto;
  background: transparent;
}
.reader-progress-page {
  width: 28px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(224, 221, 211, 0.95);
  box-shadow: inset 0 0 0 1px rgba(31, 36, 32, 0.05);
  cursor: pointer;
}
.reader-progress-page.passed {
  background: rgba(119, 211, 181, 0.88);
}
.reader-progress-page.active {
  background: var(--purple);
  box-shadow: 0 0 0 3px rgba(122, 98, 141, 0.16);
}
.reader-progress-page:focus-visible {
  outline: 3px solid rgba(122, 98, 141, 0.35);
  outline-offset: 2px;
}

/* Reader artwork: no mat, larger image, softened corners */
.story-reader .reader-image {
  min-height: min(72vh, 760px);
  overflow: visible;
  border-color: transparent;
  background: transparent;
  padding: 0;
}
.story-reader .reader-image img {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 148px);
  object-fit: contain;
  border-radius: 18px;
}
.story-reader .reader-page.image-vertical .reader-image img {
  max-height: calc(100vh - 148px);
}
.story-reader .reader-page.image-horizontal .reader-image {
  min-height: min(64vh, 700px);
}
.story-reader .reader-page.image-horizontal .reader-image img {
  width: 100%;
  height: 100%;
  max-height: min(64vh, 700px);
  object-fit: contain;
}
.pinned-story-reader .reader-image {
  min-height: 390px;
}
.pinned-story-reader .reader-image img {
  border-radius: 14px;
}
@media (max-width: 900px) {
  .story-reader .reader-image {
    min-height: 390px;
  }
  .story-reader .reader-page.image-vertical .reader-image img,
  .story-reader .reader-page.image-horizontal .reader-image img {
    max-height: 58vh;
  }
}

/* Reader layout: bottom controls get their own reserved row */
.story-reader {
  min-height: calc(100vh - (var(--drawer-content-inset) * 2));
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.story-reader .reader-page {
  min-height: 0;
  max-height: calc(100vh - 198px);
  overflow: hidden;
}
.reader-bottom-controls {
  align-self: end;
  display: grid;
  gap: 10px;
  min-height: 94px;
  padding-top: 8px;
  background: var(--panel);
}
.reader-bottom-controls .reader-progress {
  margin-top: 0;
}
.story-reader .reader-image,
.story-reader .reader-page.image-horizontal .reader-image {
  min-height: 0;
}
.story-reader .reader-image img,
.story-reader .reader-page.image-vertical .reader-image img {
  max-height: calc(100vh - 228px);
}
.story-reader .reader-page.image-horizontal .reader-image img {
  max-height: calc(100vh - 268px);
  border: 1px solid rgba(31, 36, 32, 0.12);
  border-radius: 28px;
  box-shadow: 0 18px 42px rgba(55, 46, 31, 0.1);
}
@media (max-width: 900px) {
  .story-reader {
    min-height: calc(100vh - 24px);
  }
  .story-reader .reader-page {
    max-height: calc(100vh - 220px);
    overflow: auto;
  }
  .reader-bottom-controls {
    min-height: 90px;
  }
  .story-reader .reader-image img,
  .story-reader .reader-page.image-vertical .reader-image img,
  .story-reader .reader-page.image-horizontal .reader-image img {
    max-height: calc(100vh - 258px);
  }
  .story-reader .reader-page.image-horizontal .reader-image img {
    border-radius: 22px;
  }
}

/* Blur the page behind an open book */
body.book-open .scrim {
  background: rgba(8, 12, 10, 0.78);
  -webkit-backdrop-filter: blur(8px) saturate(0.82);
  backdrop-filter: blur(8px) saturate(0.82);
}

/* Stabilize reader bottom controls while paging */
.reader-bottom-controls {
  grid-template-rows: 24px 42px;
  height: 102px;
  min-height: 102px;
  contain: layout paint;
}
.reader-bottom-controls .reader-progress {
  height: 24px;
  min-height: 24px;
  padding: 4px 0 6px;
  overscroll-behavior-x: contain;
}
.reader-bottom-controls .reader-nav {
  min-height: 42px;
}
.reader-bottom-controls .reader-nav button {
  min-height: 42px;
}
.reader-bottom-controls .reader-progress-page.active {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72), 0 0 0 2px rgba(122, 98, 141, 0.1);
}
@media (max-width: 900px) {
  .reader-bottom-controls {
    height: 98px;
    min-height: 98px;
  }
}

/* Reader anti-bounce: fixed drawer grid with reserved bottom controls */
.story-drawer.open {
  overflow: hidden;
}
.story-drawer #drawerContent {
  height: 100%;
  min-height: 0;
}
.story-drawer .story-reader {
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr) 102px;
  gap: 12px;
}
.story-reader .reader-toolbar {
  align-self: start;
}
.story-reader .reader-page {
  align-self: stretch;
  height: 100%;
  max-height: none;
  overflow: hidden;
}
.story-reader .reader-copy,
.story-reader .story-copy {
  min-height: 0;
}
.story-reader .story-copy {
  overflow: auto;
}
.story-reader .reader-image,
.story-reader .reader-page.image-horizontal .reader-image {
  height: 100%;
  min-height: 0;
}
.story-reader .reader-image img,
.story-reader .reader-page.image-vertical .reader-image img,
.story-reader .reader-page.image-horizontal .reader-image img {
  max-height: 100%;
}
.story-reader .reader-bottom-controls {
  align-self: end;
  height: 102px;
  min-height: 102px;
  max-height: 102px;
  overflow: hidden;
}
.story-reader .reader-progress {
  overflow-x: auto;
}
@media (max-width: 900px) {
  .story-drawer .story-reader {
    grid-template-rows: auto minmax(0, 1fr) 98px;
  }
  .story-reader .reader-page {
    max-height: none;
    overflow: auto;
  }
  .story-reader .reader-bottom-controls {
    height: 98px;
    min-height: 98px;
    max-height: 98px;
  }
}

/* Clip reader art to the reserved page row */
.story-reader .reader-page {
  position: relative;
  contain: layout paint;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(122, 98, 141, 0.34) rgba(224, 221, 211, 0.7);
}
.story-reader .reader-page::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}
.story-reader .reader-page::-webkit-scrollbar-track {
  background: rgba(224, 221, 211, 0.7);
  border-radius: 999px;
}
.story-reader .reader-page::-webkit-scrollbar-thumb {
  background: rgba(122, 98, 141, 0.34);
  border-radius: 999px;
}
.story-reader .reader-image,
.story-reader .reader-page.image-horizontal .reader-image {
  align-self: stretch;
  justify-self: stretch;
  max-height: 100%;
  overflow: hidden;
}
.story-reader .reader-image img,
.story-reader .reader-page.image-vertical .reader-image img,
.story-reader .reader-page.image-horizontal .reader-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Horizontal artwork should reveal the full image and let the page row scroll. */
.story-reader .reader-page.image-horizontal {
  overflow: auto;
}
.story-reader .reader-page.image-horizontal .reader-image {
  height: auto;
  max-height: none;
  overflow: visible;
}
.story-reader .reader-page.image-horizontal .reader-image img {
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
}

/* Reader image zoom */
.reader-image {
  position: relative;
}
.reader-image-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  height: 30px;
  border: 1px solid rgba(213, 222, 211, 0.84);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #526159;
  cursor: zoom-in;
  font-size: 12px;
  font-weight: 850;
  opacity: 0;
  padding: 0 10px;
  transition: opacity 160ms ease, background 160ms ease;
}
.reader-image:hover .reader-image-zoom,
.reader-image:focus-within .reader-image-zoom {
  opacity: 1;
}
.reader-image-zoom:hover,
.reader-image-zoom:focus-visible {
  background: rgba(255, 255, 255, 0.94);
  outline: 0;
}
.reader-image img[data-image-zoom] {
  cursor: zoom-in;
}
.reader-page.image-zoomed {
  overflow: auto;
}
.reader-page.image-zoomed .reader-image {
  overflow: visible;
}
.reader-page.image-zoomed .reader-image-zoom {
  cursor: zoom-out;
  opacity: 1;
}
.reader-page.image-zoomed .reader-image img[data-image-zoom] {
  width: 150%;
  height: auto;
  max-width: none;
  max-height: none;
  cursor: zoom-out;
}
.reader-page.image-horizontal.image-zoomed .reader-image img[data-image-zoom] {
  width: 150%;
}
.reader-page.image-vertical.image-zoomed .reader-image img[data-image-zoom] {
  width: auto;
  height: 150%;
}
@media (max-width: 900px) {
  .reader-page.image-zoomed .reader-image img[data-image-zoom],
  .reader-page.image-horizontal.image-zoomed .reader-image img[data-image-zoom] {
    width: 175%;
  }
  .reader-page.image-vertical.image-zoomed .reader-image img[data-image-zoom] {
    height: 175%;
  }
}

/* Default reading view: fit artwork; scroll text if needed. */
.story-reader .reader-page:not(.image-zoomed) {
  overflow: hidden;
}
.story-reader .reader-page:not(.image-zoomed) .reader-image,
.story-reader .reader-page.image-horizontal:not(.image-zoomed) .reader-image {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}
.story-reader .reader-page:not(.image-zoomed) .reader-image img,
.story-reader .reader-page.image-horizontal:not(.image-zoomed) .reader-image img,
.story-reader .reader-page.image-vertical:not(.image-zoomed) .reader-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.story-reader .reader-page.image-horizontal:not(.image-zoomed) {
  grid-template-rows: minmax(0, 1fr) minmax(140px, auto);
}
.story-reader .reader-page:not(.image-zoomed) .reader-copy,
.story-reader .reader-page:not(.image-zoomed) .story-copy {
  min-height: 0;
  overflow: auto;
}

/* Horizontal story pages: artwork gets the viewport-height page area; text follows below. */
.story-reader .reader-page.image-horizontal:not(.image-zoomed) {
  grid-template-rows: minmax(100%, 100%) auto;
  align-content: start;
  overflow: auto;
}
.story-reader .reader-page.image-horizontal:not(.image-zoomed) .reader-image {
  height: 100%;
  min-height: 100%;
  max-height: none;
  overflow: hidden;
}
.story-reader .reader-page.image-horizontal:not(.image-zoomed) .reader-image img {
  width: 100%;
  height: 100%;
  max-height: 100%;
  object-fit: contain;
}
.story-reader .reader-page.image-horizontal:not(.image-zoomed) .reader-copy,
.story-reader .reader-page.image-horizontal:not(.image-zoomed) .story-copy {
  overflow: visible;
}

/* Final reader spread: image on one side, page text on the other. */
.story-reader .reader-page,
.story-reader .reader-page.image-horizontal,
.story-reader .reader-page.image-vertical,
.story-reader .reader-page.image-horizontal:not(.image-zoomed),
.story-reader .reader-page.image-vertical:not(.image-zoomed) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--reader-gap, clamp(18px, 2.4vw, 28px));
  align-content: stretch;
  overflow: hidden;
}
.story-reader .reader-page.image-side-left .reader-image,
.story-reader .reader-page.image-side-right .reader-copy {
  grid-column: 1;
  grid-row: 1;
}
.story-reader .reader-page.image-side-right .reader-image,
.story-reader .reader-page.image-side-left .reader-copy {
  grid-column: 2;
  grid-row: 1;
}
.story-reader .reader-page .reader-image,
.story-reader .reader-page.image-horizontal .reader-image,
.story-reader .reader-page.image-vertical .reader-image {
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  overflow: hidden;
}
.story-reader .reader-page .reader-image img,
.story-reader .reader-page.image-horizontal .reader-image img,
.story-reader .reader-page.image-vertical .reader-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 18px;
  box-shadow: none;
}
.story-reader .reader-page .reader-copy,
.story-reader .reader-page .story-copy,
.story-reader .reader-page.image-horizontal .reader-copy,
.story-reader .reader-page.image-horizontal .story-copy {
  align-self: stretch;
  min-height: 0;
  overflow: auto;
}

/* Image zoom modal: fit as large as possible without overflow. */
.image-zoom-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 56px clamp(16px, 3vw, 36px) 28px;
  background: rgba(247, 246, 241, 0.78);
  -webkit-backdrop-filter: blur(14px) saturate(0.9);
  backdrop-filter: blur(14px) saturate(0.9);
  overflow: hidden;
}
.image-zoom-modal img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 84px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(24, 32, 29, 0.24);
}
.image-zoom-close {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 1;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(213, 222, 211, 0.94);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  cursor: pointer;
  font-size: 24px;
  font-weight: 850;
  line-height: 1;
}
body.image-zoom-open {
  overflow: hidden;
}
@media (max-width: 762px) {
  .story-reader .reader-page,
  .story-reader .reader-page.image-horizontal,
  .story-reader .reader-page.image-vertical {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.58fr) minmax(0, 0.42fr);
  }
  .story-reader .reader-page.image-side-left .reader-image,
  .story-reader .reader-page.image-side-right .reader-image {
    grid-column: 1;
    grid-row: 1;
  }
  .story-reader .reader-page.image-side-left .reader-copy,
  .story-reader .reader-page.image-side-right .reader-copy {
    grid-column: 1;
    grid-row: 2;
  }
}

/* Pinned drawer always previews the cover page. */
.pinned-story-reader {
  grid-template-rows: auto minmax(0, 1fr);
}
.pinned-story-reader .cover-page,
.pinned-story-reader .cover-page.image-horizontal,
.pinned-story-reader .cover-page.image-vertical {
  grid-template-columns: 1fr;
  grid-template-rows: minmax(220px, 42vh) auto;
  gap: 16px;
  overflow: auto;
}
.pinned-story-reader .cover-page .reader-image,
.pinned-story-reader .cover-page .reader-copy {
  grid-column: 1;
}
.pinned-story-reader .cover-page .reader-image {
  grid-row: 1;
}
.pinned-story-reader .cover-page .reader-copy {
  grid-row: 2;
}
