:root {
  /* Published catalog migration keeps the existing AB HOME theme. */
  --ink: #172333;
  --muted: #667085;
  --line: #d8dee7;
  --line-strong: #b8c2d0;
  --surface: #ffffff;
  --surface-soft: #f4f7fa;
  --blue: #155eef;
  --blue-dark: #0c3fa8;
  --blue-soft: #eaf1ff;
  --green: #11875d;
  --green-soft: #e6f7f0;
  --orange: #ef7b45;
  --orange-soft: #fff0e8;
  --yellow: #f6c945;
  --danger: #bf3b44;
  --shadow-sm: 0 4px 16px rgba(23, 35, 51, 0.08);
  --shadow-md: 0 18px 48px rgba(23, 35, 51, 0.16);
  --header-height: 70px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface);
  font-family: "Noto Sans Thai", "Noto Sans", "Thonburi", sans-serif;
  letter-spacing: 0;
}

body.dialog-open {
  overflow: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(21, 94, 239, 0.28);
  outline-offset: 2px;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.demo-notice {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 6px 16px;
  color: #60300c;
  background: #ffe7c7;
  border-bottom: 1px solid #f2c993;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.demo-notice svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.site-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(216, 222, 231, 0.9);
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 190px;
}

.brand-mark {
  width: 43px;
  height: 43px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  border-radius: 6px;
  font-size: 18px;
  font-weight: 900;
}

.brand-copy {
  display: grid;
  gap: 1px;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 16px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 11px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}

.desktop-nav a {
  color: #344054;
  font-size: 14px;
  font-weight: 700;
}

.desktop-nav a:hover {
  color: var(--blue);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  position: relative;
}

.icon-button:hover {
  background: var(--surface-soft);
  border-color: var(--line-strong);
}

.icon-button svg,
.button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.favorite-count {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  position: absolute;
  top: -7px;
  right: -7px;
  padding: 0 5px;
  color: #ffffff;
  background: var(--orange);
  border: 2px solid #ffffff;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 800;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.button-primary {
  color: #ffffff;
  background: var(--blue);
  border-color: var(--blue);
}

.button-primary:hover {
  background: var(--blue-dark);
  border-color: var(--blue-dark);
}

.button-secondary {
  color: var(--blue-dark);
  background: var(--surface);
  border-color: #b9caef;
}

.button-secondary:hover {
  background: var(--blue-soft);
}

.button-light {
  color: var(--ink);
  background: #ffffff;
  border-color: #d7dde6;
}

.button-light:hover {
  background: #f7f8fa;
}

.button-accent {
  color: #ffffff;
  background: var(--orange);
  border-color: var(--orange);
}

.button-accent:hover {
  background: #d9622d;
}

.mobile-menu-button,
.mobile-menu {
  display: none;
}

.hero {
  min-height: min(700px, 72svh);
  display: flex;
  align-items: center;
  background-color: #dbeafa;
  background-image: url("assets/hero-renovated-home.jpg");
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  padding-block: 54px 112px;
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 650px;
  margin: 0;
  color: #0e2746;
  font-size: 58px;
  line-height: 1.13;
  font-weight: 900;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.hero-support {
  max-width: 540px;
  margin: 20px 0 0;
  color: #263b55;
  font-size: 18px;
  line-height: 1.75;
  font-weight: 600;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
}

.hero-actions .button {
  min-height: 50px;
}

.image-label {
  position: absolute;
  right: 18px;
  bottom: 16px;
  padding: 6px 9px;
  color: #253247;
  background: rgba(255, 255, 255, 0.84);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
}

.search-band {
  margin-top: -64px;
  position: relative;
  z-index: 5;
}

.filter-grid {
  min-height: 128px;
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) repeat(3, minmax(135px, 0.8fr)) auto;
  gap: 14px;
  align-items: end;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

.search-field {
  min-width: 0;
  display: grid;
  gap: 7px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.field-control {
  position: relative;
}

.field-control svg {
  width: 17px;
  height: 17px;
  position: absolute;
  top: 50%;
  left: 13px;
  color: #667085;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-field input,
.search-field select,
.sort-control select,
.lead-dialog input,
.lead-dialog select,
.draft-editor textarea {
  width: 100%;
  min-height: 44px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
}

.search-field input {
  padding: 0 12px 0 40px;
}

.search-field select,
.sort-control select,
.lead-dialog select {
  padding: 0 36px 0 12px;
}

.filter-button {
  min-height: 44px;
}

.filter-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.filter-actions .filter-button {
  min-width: 150px;
}

.property-section {
  padding: 98px 0 90px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section-heading h2,
.finance-layout h2,
.trust-section h2,
.panel-heading h2 {
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  line-height: 1.25;
}

.section-heading p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.sort-control select {
  min-width: 178px;
  padding-left: 12px;
}

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

.property-card {
  min-width: 0;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.property-card:hover {
  border-color: #b8c9ec;
  box-shadow: var(--shadow-sm);
  transform: translateY(-3px);
}

.property-image-wrap {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--surface-soft);
  position: relative;
}

.property-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}

.property-card:hover .property-image-wrap img {
  transform: scale(1.025);
}

.property-status {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 9px;
  color: #075e41;
  background: rgba(230, 247, 240, 0.94);
  border: 1px solid #a9dfc9;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 900;
}

.favorite-button {
  width: 38px;
  height: 38px;
  position: absolute;
  top: 10px;
  right: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  cursor: pointer;
}

.favorite-button svg {
  width: 18px;
  height: 18px;
}

.favorite-button.active {
  color: #ffffff;
  background: var(--orange);
  border-color: var(--orange);
}

.favorite-button.active svg {
  fill: currentColor;
}

.property-body {
  padding: 18px 18px 16px;
}

.property-location {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.property-location svg {
  width: 15px;
  height: 15px;
  color: var(--orange);
}

.property-card h3 {
  min-height: 48px;
  margin: 0;
  font-size: 19px;
  line-height: 1.42;
}

.property-id {
  margin: 5px 0 0;
  color: #8290a3;
  font-size: 11px;
}

.property-price {
  margin: 16px 0 13px;
  color: var(--blue-dark);
  font-size: 25px;
  font-weight: 900;
}

.property-price small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.property-features {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid #e6eaf0;
}

.property-features span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
}

.property-features svg {
  width: 16px;
  height: 16px;
  color: var(--blue);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 18px;
  background: #fbfcfd;
  border-top: 1px solid var(--line);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.card-footer svg {
  width: 17px;
  height: 17px;
}

.empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 36px;
  background: var(--surface-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  text-align: center;
}

.empty-state svg {
  width: 42px;
  height: 42px;
  color: var(--blue);
}

.empty-state h3,
.empty-state p {
  margin: 0;
}

.empty-state p {
  color: var(--muted);
}

.finance-band {
  padding: 54px 0;
  color: #ffffff;
  background: #123d73;
}

.finance-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr auto;
  gap: 44px;
  align-items: center;
}

.finance-layout .eyebrow {
  color: #91b7ff;
}

.finance-layout h2 {
  color: #ffffff;
}

.finance-layout p:not(.eyebrow) {
  max-width: 560px;
  margin: 12px 0 0;
  color: #dce8f8;
  line-height: 1.7;
}

.finance-points {
  display: grid;
  gap: 12px;
}

.finance-points span {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f4f8ff;
  font-size: 14px;
  font-weight: 700;
}

.finance-points svg {
  width: 18px;
  color: var(--yellow);
}

.trust-section {
  padding: 84px 0;
  background: var(--surface-soft);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line-strong);
}

.trust-item {
  padding: 28px 32px 12px 0;
}

.trust-item + .trust-item {
  padding-left: 32px;
  border-left: 1px solid var(--line-strong);
}

.trust-item > svg {
  width: 28px;
  height: 28px;
  color: var(--orange);
}

.trust-item h3 {
  margin: 16px 0 8px;
  font-size: 18px;
}

.trust-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.site-footer {
  padding: 34px 0;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

.footer-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-layout > p {
  color: var(--muted);
  font-size: 12px;
}

.mobile-contact {
  display: none;
}

dialog {
  padding: 0;
  color: var(--ink);
  background: #ffffff;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
}

dialog::backdrop {
  background: rgba(10, 19, 32, 0.72);
}

.property-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(850px, calc(100svh - 32px));
  overflow: auto;
}

.dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
}

.property-dialog-layout {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  min-height: 580px;
}

.dialog-property-image {
  min-height: 580px;
  position: relative;
  background: var(--surface-soft);
}

.dialog-property-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.dialog-property-image .image-label {
  right: 12px;
  bottom: 12px;
}

.dialog-property-content {
  padding: 50px 38px 34px;
}

.dialog-property-content h2 {
  margin: 10px 0 6px;
  font-size: 30px;
  line-height: 1.35;
}

.dialog-property-content .property-price {
  margin: 18px 0;
  font-size: 30px;
}

.dialog-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.dialog-feature-grid span {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 0;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.dialog-feature-grid svg {
  width: 18px;
  color: var(--blue);
}

.dialog-copy {
  color: #475467;
  line-height: 1.75;
}

.dialog-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 20px 0;
}

.dialog-tags span {
  padding: 6px 10px;
  color: #31445b;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.lead-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  overflow: auto;
}

.lead-dialog-content {
  padding: 42px 34px 32px;
}

.lead-dialog h2 {
  margin: 0;
  font-size: 28px;
}

.form-note {
  margin: 8px 0 22px;
  color: var(--muted);
  font-size: 12px;
}

.lead-dialog form {
  display: grid;
  gap: 14px;
}

.lead-dialog label {
  display: grid;
  gap: 7px;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.lead-dialog input {
  padding: 0 12px;
}

.lead-dialog .consent-field {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px 0 2px;
  line-height: 1.5;
}

.lead-dialog .consent-field input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  padding: 0;
  accent-color: var(--blue);
}

.full-width {
  width: 100%;
}

.toast {
  max-width: min(420px, calc(100vw - 32px));
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
  padding: 13px 17px;
  color: #ffffff;
  background: #173452;
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  font-weight: 700;
}

/* Content Factory */
.studio-view {
  min-height: calc(100svh - 32px);
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  background: #f4f6f8;
}

.studio-sidebar {
  min-height: calc(100svh - 32px);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  color: #ffffff;
  background: #142f4c;
  position: sticky;
  top: 32px;
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 7px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.studio-brand .brand-mark {
  background: #ffffff;
  color: var(--blue);
}

.studio-brand div {
  display: grid;
  gap: 2px;
}

.studio-brand strong {
  font-size: 14px;
}

.studio-brand small {
  color: #9fbbd9;
  font-size: 11px;
}

.studio-sidebar nav {
  display: grid;
  gap: 5px;
  margin-top: 22px;
}

.studio-nav {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  color: #cbd9e7;
  background: transparent;
  border: 0;
  border-radius: 6px;
  text-align: left;
  cursor: pointer;
}

.studio-nav svg {
  width: 18px;
  height: 18px;
}

.studio-nav:hover,
.studio-nav.active {
  color: #ffffff;
  background: #25527f;
}

.studio-back {
  width: 100%;
  margin-top: auto;
}

.studio-main {
  min-width: 0;
  padding: 26px 30px 40px;
}

.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.studio-header h1 {
  margin: 0;
  font-size: 30px;
}

.studio-header p:not(.eyebrow) {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.studio-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-status {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: #06704c;
  background: var(--green-soft);
  border: 1px solid #b4e2d0;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 800;
}

.sync-status svg {
  width: 16px;
  height: 16px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.metrics-strip > div {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 18px 20px;
}

.metrics-strip > div + div {
  border-left: 1px solid var(--line);
}

.metrics-strip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.metrics-strip strong {
  font-size: 30px;
}

.metrics-strip small {
  color: #8390a2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metrics-strip .metric-warning strong {
  color: var(--orange);
}

.studio-workspace {
  display: grid;
  grid-template-columns: minmax(600px, 1.45fr) minmax(340px, 0.78fr);
  gap: 18px;
  margin-top: 18px;
}

.queue-panel,
.draft-panel {
  min-width: 0;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.panel-heading {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
  font-size: 20px;
}

.segmented-control {
  display: inline-flex;
  padding: 3px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.segmented-control button {
  min-height: 32px;
  padding: 0 11px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.segmented-control button.active {
  color: var(--blue-dark);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(23, 35, 51, 0.12);
}

.queue-table {
  min-height: 420px;
}

.queue-header,
.queue-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) 100px 130px 112px 40px;
  gap: 10px;
  align-items: center;
  padding: 12px 16px;
}

.queue-header {
  color: #5f6c7d;
  background: #edf5ff;
  border-bottom: 3px solid var(--orange);
  font-size: 11px;
  font-weight: 900;
}

.queue-row {
  min-height: 68px;
  border-bottom: 1px solid #e7eaf0;
  cursor: pointer;
}

.queue-row:hover,
.queue-row.active {
  background: #f7faff;
}

.queue-home {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.queue-home strong,
.queue-home span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-home strong {
  font-size: 13px;
}

.queue-home span {
  color: var(--muted);
  font-size: 11px;
}

.queue-cell {
  color: #475467;
  font-size: 12px;
}

.status-chip {
  width: fit-content;
  padding: 5px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 900;
}

.status-review {
  color: #714704;
  background: #fff3ca;
}

.status-blocked {
  color: #9a2e37;
  background: #ffe8ea;
}

.status-approved {
  color: #05704b;
  background: var(--green-soft);
}

.queue-arrow {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--blue);
  background: transparent;
  border: 0;
}

.queue-arrow svg {
  width: 17px;
  height: 17px;
}

.draft-panel {
  min-height: 496px;
}

.draft-panel-empty {
  min-height: 496px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  padding: 30px;
  text-align: center;
}

.draft-panel-empty svg {
  width: 34px;
  height: 34px;
  color: var(--blue);
}

.draft-panel-empty h3,
.draft-panel-empty p {
  margin: 0;
}

.draft-panel-empty p {
  color: var(--muted);
  font-size: 13px;
}

.draft-detail {
  padding: 20px;
}

.draft-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.draft-detail h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.4;
}

.draft-detail .property-id {
  margin-top: 3px;
}

.source-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.source-list div {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  background: var(--surface-soft);
  border-left: 3px solid var(--blue);
}

.source-list span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.source-list strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-editor label {
  display: grid;
  gap: 7px;
  color: #475467;
  font-size: 12px;
  font-weight: 800;
}

.draft-editor textarea {
  min-height: 156px;
  padding: 12px;
  line-height: 1.65;
  resize: vertical;
}

.blocker-message {
  display: flex;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  color: #8e2830;
  background: #fff0f1;
  border: 1px solid #f2bec2;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
}

.blocker-message svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.draft-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  margin-top: 14px;
}

@media (max-width: 1050px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .search-field-wide {
    grid-column: span 2;
  }

  .filter-button {
    grid-column: span 2;
  }

  .search-band {
    margin-top: -38px;
  }

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

  .finance-layout {
    grid-template-columns: 1.2fr 1fr;
  }

  .finance-layout > .button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .studio-view {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .studio-sidebar {
    align-items: center;
  }

  .studio-brand div,
  .studio-nav:not(.active) > :not(svg),
  .studio-nav {
    font-size: 0;
  }

  .studio-nav {
    width: 46px;
    justify-content: center;
    padding: 0;
  }

  .studio-back {
    width: 46px;
    padding: 0;
    font-size: 0;
  }

  .studio-workspace {
    grid-template-columns: 1fr;
  }

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

  .metrics-strip > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .metrics-strip > div:nth-child(4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 780px) {
  :root {
    --header-height: 62px;
  }

  .shell {
    width: min(100% - 28px, 680px);
  }

  .site-header {
    padding-inline: 14px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 39px;
    height: 39px;
    font-size: 16px;
  }

  .brand-copy small,
  .desktop-nav,
  .staff-button,
  #favoritesButton {
    display: none;
  }

  .mobile-menu-button {
    display: inline-grid;
  }

  .mobile-menu {
    display: grid;
    gap: 6px;
    padding: 12px 14px 16px;
    background: #ffffff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    position: fixed;
    top: 94px;
    left: 0;
    right: 0;
    z-index: 29;
  }

  .mobile-menu[hidden] {
    display: none;
  }

  .mobile-menu a {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-bottom: 1px solid #edf0f4;
    font-weight: 700;
  }

  .hero {
    min-height: 610px;
    align-items: flex-start;
    background-position: 58% center;
  }

  .hero-content {
    padding-top: 48px;
  }

  .hero h1 {
    max-width: 420px;
    font-size: 39px;
  }

  .hero-support {
    max-width: 355px;
    font-size: 15px;
  }

  .hero-actions {
    max-width: 260px;
    display: grid;
  }

  .hero-actions .button {
    width: 100%;
  }

  .search-band {
    margin-top: -46px;
  }

  .filter-grid {
    grid-template-columns: 1fr 1fr;
    padding: 18px;
  }

  .filter-grid .search-field {
    gap: 8px;
    font-size: 14px;
  }

  /* Explicit sizing avoids the compact native iOS select appearance. */
  .filter-grid .search-field select {
    -webkit-appearance: none;
    appearance: none;
    display: block;
    width: 100%;
    min-width: 0;
    height: 56px;
    min-height: 56px;
    padding: 12px 42px 12px 16px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    background-image: linear-gradient(45deg, transparent 50%, #475467 50%),
      linear-gradient(135deg, #475467 50%, transparent 50%);
    background-position: calc(100% - 21px) 50%, calc(100% - 16px) 50%;
    background-size: 5px 5px;
    background-repeat: no-repeat;
  }

  .filter-grid .search-field input,
  .filter-grid .filter-button {
    min-height: 56px;
    font-size: 16px;
  }

  .search-field-wide,
  .filter-button {
    grid-column: span 2;
  }

  .property-section {
    padding: 70px 0 76px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading h2,
  .finance-layout h2,
  .trust-section h2 {
    font-size: 27px;
  }

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

  .property-card h3 {
    min-height: auto;
  }

  .finance-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .finance-layout > .button {
    grid-column: auto;
    width: 100%;
  }

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

  .trust-item,
  .trust-item + .trust-item {
    padding: 24px 0;
    border-left: 0;
    border-bottom: 1px solid var(--line-strong);
  }

  .footer-layout {
    align-items: flex-start;
    flex-direction: column;
  }

  .mobile-contact {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 20;
    padding: 0 18px;
    color: #ffffff;
    background: var(--green);
    border: 0;
    border-radius: 6px;
    box-shadow: var(--shadow-md);
    font-weight: 900;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px);
    transition: opacity 160ms ease, transform 160ms ease;
  }

  .mobile-contact.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .mobile-contact svg {
    width: 19px;
    height: 19px;
  }

  .property-dialog-layout {
    grid-template-columns: 1fr;
  }

  .dialog-property-image {
    min-height: 300px;
  }

  .dialog-property-content {
    padding: 30px 22px 24px;
  }

  .dialog-property-content h2 {
    padding-right: 40px;
    font-size: 25px;
  }

  .studio-view {
    grid-template-columns: 1fr;
  }

  .studio-sidebar {
    min-height: auto;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    position: sticky;
    top: 0;
    z-index: 12;
  }

  .studio-brand {
    padding: 0;
    border: 0;
  }

  .studio-brand .brand-mark {
    width: 38px;
    height: 38px;
  }

  .studio-sidebar nav {
    display: none;
  }

  .studio-back {
    width: 42px;
    margin: 0 0 0 auto;
  }

  .studio-main {
    padding: 20px 14px 32px;
  }

  .studio-header {
    align-items: flex-start;
  }

  .sync-status {
    display: none;
  }

  .metrics-strip {
    grid-template-columns: 1fr 1fr;
  }

  .metrics-strip > div {
    padding: 15px;
  }

  .metrics-strip strong {
    font-size: 25px;
  }

  .panel-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .queue-table {
    overflow-x: hidden;
  }

  .queue-header,
  .queue-row {
    min-width: 0;
    grid-template-columns: minmax(128px, 1fr) 62px 76px 26px;
    gap: 6px;
    padding-inline: 12px;
  }

  .queue-header > :nth-child(3),
  .queue-row > :nth-child(3) {
    display: none;
  }

  .queue-cell,
  .status-chip {
    font-size: 9px;
  }

  .queue-arrow {
    width: 26px;
    height: 30px;
  }

  .draft-panel {
    min-height: 420px;
  }
}

@media (max-width: 460px) {
  .demo-notice {
    min-height: 38px;
    font-size: 11px;
  }

  .mobile-menu {
    top: 100px;
  }

  .hero {
    min-height: 590px;
    background-position: 62% center;
  }

  .hero h1 {
    max-width: 330px;
    font-size: 34px;
  }

  .hero-support {
    max-width: 305px;
    font-size: 14px;
  }

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

  .search-field-wide,
  .filter-button {
    grid-column: auto;
  }

  .filter-actions .filter-button {
    flex: 1;
    min-width: 0;
    padding-inline: 8px;
  }

  .sort-control {
    width: 100%;
    align-items: flex-start;
    flex-direction: column;
  }

  .sort-control select {
    width: 100%;
  }

  .property-features {
    gap: 4px;
  }

  .property-features span {
    font-size: 11px;
  }

  .metrics-strip {
    grid-template-columns: 1fr;
  }

  .metrics-strip > div + div,
  .metrics-strip > div:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .dialog-actions,
  .draft-actions {
    grid-template-columns: 1fr;
  }

  .lead-dialog-content {
    padding: 40px 22px 24px;
  }
}

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