:root {
  color-scheme: light;
  --ink: #102033;
  --muted: #66788d;
  --line: #d7e2eb;
  --paper: #f4f8fb;
  --panel: #ffffff;
  --blue: #0b63ce;
  --blue-dark: #07386f;
  --green: #00856f;
  --gold: #c88a12;
  --coral: #d44530;
  --harbour: #0a8fbf;
  --mtr-red: #d51f2a;
  --shadow: 0 18px 48px rgba(13, 38, 68, 0.14);
  --soft-shadow: 0 10px 28px rgba(13, 38, 68, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    Inter, "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", Arial,
    sans-serif;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(10, 143, 191, 0.08), rgba(244, 248, 251, 0) 360px),
    var(--paper);
}

button,
input,
select,
textarea {
  font: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  justify-content: space-between;
  padding: 12px clamp(18px, 4vw, 56px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(215, 226, 235, 0.78);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 28px rgba(13, 38, 68, 0.06);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  min-width: 156px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background:
    linear-gradient(135deg, var(--mtr-red), #f05243 48%, var(--blue) 49%, var(--blue));
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(11, 99, 206, 0.18);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: #eef5f9;
  border: 1px solid #d8e7ef;
  border-radius: 8px;
}

.nav a {
  white-space: nowrap;
}

.nav a,
.top-action {
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav a {
  padding: 9px 14px;
  border-radius: 6px;
  color: #334355;
}

.nav a:hover {
  background: #fff;
  color: var(--blue-dark);
}

.top-action,
.filters button,
.publish-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--harbour));
  font-weight: 700;
  cursor: pointer;
}

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

.account-button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #eef6fb;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.top-action {
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(310px, 0.88fr) minmax(360px, 1.12fr);
  gap: 26px;
  align-items: stretch;
  padding: 34px 0 22px;
}

.search-panel,
.side-panel,
.listings-section,
.publish-section,
.admin-section {
  background: var(--panel);
  border: 1px solid rgba(215, 226, 235, 0.9);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.search-panel {
  padding: clamp(22px, 4vw, 34px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(249, 252, 253, 0.96)),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(10, 143, 191, 0.06) 23px 24px);
}

.panel-heading p,
.section-heading p {
  margin: 0 0 8px;
  color: var(--harbour);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.hk-signal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 20px;
}

.value-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -12px 0 20px;
}

.value-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--mtr-red), #f05243);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(213, 31, 42, 0.16);
}

.value-badges span:nth-child(2) {
  background: linear-gradient(135deg, var(--green), #0aa484);
  box-shadow: 0 10px 20px rgba(0, 133, 111, 0.16);
}

.value-badges span:nth-child(3) {
  color: var(--blue-dark);
  background: #e8f3ff;
  border: 1px solid #bdd8f2;
  box-shadow: none;
}

.hk-signal button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #dbe7ee;
  border-radius: 999px;
  color: #21405f;
  background: #fff;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.hk-signal button:hover,
.hk-signal button.active {
  transform: translateY(-1px);
  border-color: rgba(10, 143, 191, 0.42);
  box-shadow: 0 8px 18px rgba(13, 38, 68, 0.12);
}

.hk-signal button.active {
  color: #fff;
  background: var(--blue);
}

.hk-signal button::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 7px;
  border-radius: 999px;
  background: var(--mtr-red);
}

.hk-signal button:nth-child(2)::before {
  background: var(--green);
}

.hk-signal button:nth-child(3)::before {
  background: var(--blue);
}

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

h1 {
  margin-bottom: 22px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: 0;
}

.filters,
.publish-form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: #34465a;
  font-size: 14px;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 0 12px;
  color: var(--ink);
  background: #f9fbfd;
  border: 1px solid #cbd7e1;
  border-radius: 8px;
  outline: none;
}

textarea {
  min-height: 112px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(21, 87, 176, 0.13);
}

.filter-actions,
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row > label:only-child {
  grid-column: 1 / -1;
}

.filters button:nth-child(2) {
  color: var(--blue);
  background: #e8f0fb;
}

.hero-media {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 8px;
  background: #d8e7f3;
  box-shadow: var(--shadow);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(8, 24, 39, 0.06), rgba(8, 24, 39, 0.36)),
    linear-gradient(90deg, rgba(213, 31, 42, 0.18), transparent 34%, rgba(0, 133, 111, 0.16));
  pointer-events: none;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.market-strip {
  z-index: 1;
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(9, 29, 49, 0.82);
  color: #fff;
  backdrop-filter: blur(12px);
}

.hk-route {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hk-route span {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 11px;
  color: #fff;
  background: rgba(8, 24, 39, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  backdrop-filter: blur(10px);
}

.hk-route span::before {
  content: "";
  width: 22px;
  height: 4px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--mtr-red);
}

.hk-route span:nth-child(2)::before {
  background: var(--green);
}

.hk-route span:nth-child(3)::before {
  background: var(--blue);
}

.market-strip span {
  display: grid;
  gap: 2px;
  min-height: 74px;
  align-content: center;
  padding: 12px;
  font-size: 13px;
}

.market-strip strong {
  font-size: 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 24px;
  align-items: start;
  padding: 16px 0 24px;
}

.side-panel,
.listings-section,
.publish-section,
.admin-section {
  padding: 22px;
}

.side-panel {
  position: sticky;
  top: 88px;
}

.side-eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.side-panel h2 {
  margin: 12px 0 10px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.08;
}

.side-intro {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.65;
}

.value-card,
.trust-box {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #d8e5ee;
  border-radius: 8px;
  background: #f8fbfd;
}

.value-card span {
  width: fit-content;
  padding: 4px 8px;
  color: var(--blue);
  background: #e9f4ff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.value-card h3,
.trust-box h3,
.value-card p,
.trust-box p {
  margin: 0;
}

.owner-value {
  border-left: 4px solid var(--green);
  background:
    linear-gradient(90deg, rgba(0, 133, 111, 0.1), rgba(255, 255, 255, 0.96)),
    #edf8f2;
}

.buyer-value {
  border-left: 4px solid var(--blue);
  background:
    linear-gradient(90deg, rgba(11, 99, 206, 0.09), rgba(255, 255, 255, 0.96)),
    #f3f9fd;
}

.trust-box {
  border-left: 4px solid var(--gold);
  background:
    linear-gradient(90deg, rgba(200, 138, 18, 0.11), rgba(255, 255, 255, 0.96)),
    #fff9ec;
}

.offer-assurance {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid #cfe2f0;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(11, 99, 206, 0.08), rgba(255, 255, 255, 0.94)),
    #f3f9fd;
}

.value-card p,
.trust-box p,
.preview-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.view-toggle,
.favorite-toggle {
  display: flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef5f9;
}

.view-toggle button,
.favorite-toggle button {
  min-width: 56px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.view-toggle .active,
.favorite-toggle .active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 2px 8px rgba(23, 33, 43, 0.08);
}

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

.listing-grid.compact {
  grid-template-columns: 1fr;
}

.listing-card {
  overflow: hidden;
  border: 1px solid rgba(215, 226, 235, 0.96);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--soft-shadow);
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.listing-card:hover {
  transform: translateY(-2px);
  border-color: rgba(10, 143, 191, 0.36);
  box-shadow: 0 18px 42px rgba(13, 38, 68, 0.14);
}

.listing-image {
  position: relative;
  min-height: 162px;
  padding: 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(7, 56, 111, 0.22)),
    var(--card-bg);
  background-position: center;
  background-size: cover;
}

.listing-image::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 72px;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--mtr-red) 0 33%, var(--green) 33% 66%, var(--gold) 66% 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.listing-image span {
  position: relative;
  z-index: 1;
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  padding: 0 10px;
  color: #fff;
  background: rgba(15, 32, 50, 0.78);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.listing-body {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.listing-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.listing-meta,
.listing-notes {
  color: var(--muted);
  line-height: 1.55;
}

.listing-price {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--blue-dark);
  font-size: 22px;
  font-weight: 850;
}

.listing-price small {
  color: var(--green);
  font-size: 13px;
}

.card-tags,
.detail-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-tags span,
.detail-specs span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  color: #31516d;
  background: #f1f6f9;
  border: 1px solid #d8e4ec;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.card-tags .featured-tag,
.status-pill.featured {
  color: #784600;
  background: #fff1d4;
  border-color: #edcc85;
}

.card-tags .favorite-tag {
  color: #8a3552;
  background: #fff0f5;
  border-color: #efbfd0;
}

.card-tags .free-tag,
.badge.free-badge {
  color: #fff;
  background: linear-gradient(135deg, var(--mtr-red), #f05243);
  border-color: rgba(213, 31, 42, 0.72);
}

.agent-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  background:
    linear-gradient(90deg, rgba(10, 143, 191, 0.08), rgba(255, 255, 255, 0.96));
  border: 1px solid #e1e9ef;
  border-radius: 8px;
  color: #40566d;
  font-size: 13px;
}

.agent-line span {
  color: var(--muted);
}

.listing-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
}

.listing-actions button,
.listing-actions a,
.listing-actions span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  font-weight: 750;
}

.listing-actions button:hover,
.listing-actions a:hover,
.listing-actions span:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(13, 38, 68, 0.12);
}

.listing-actions button[data-favorite] {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.listing-actions button.saved {
  color: #fff;
  background: #b83264;
  border-color: #b83264;
}

.listing-actions .whatsapp-share,
.detail-share-actions .whatsapp-share {
  color: #fff;
  background: linear-gradient(135deg, #128c55, #0c7a48);
  border-color: #128c55;
}

.listing-actions .agent-whatsapp,
.agent-contact-actions .agent-whatsapp {
  color: #fff;
  background: #0c7a48;
  border-color: #0c7a48;
}

.listing-actions .wechat-share,
.detail-share-actions .wechat-share {
  color: #fff;
  background: linear-gradient(135deg, #18a058, #0a8c6a);
  border-color: #18a058;
}

.detail-share-actions,
.agent-contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.agent-contact-actions {
  padding: 12px;
  background: #f5f9fc;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
}

.detail-share-actions a,
.detail-share-actions button,
.detail-share-actions span,
.agent-contact-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid;
  border-radius: 8px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.viewing-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  background:
    linear-gradient(180deg, #f7fafc, #ffffff);
  border: 1px solid #dfe8ef;
  border-radius: 8px;
}

.viewing-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.viewing-heading h3 {
  margin: 0;
  font-size: 18px;
}

.viewing-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

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

.viewing-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 850;
  cursor: pointer;
}

.publish-section {
  margin: 8px 0 34px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: #6a3d00;
  background: #fff0cf;
  border: 1px solid #f0cf8a;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.badge.free-badge {
  box-shadow: 0 10px 20px rgba(213, 31, 42, 0.16);
}

.publish-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(280px, 1.08fr);
  gap: 20px;
}

.publish-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #f9fbfd, #f5f9fc);
}

.upload-box {
  padding: 14px;
  border: 1px dashed #aebdca;
  border-radius: 8px;
  background: #fff;
}

.upload-box input {
  padding: 11px;
  background: #f7fafc;
}

.upload-box span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.preview-card {
  min-height: 100%;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.94)),
    url("assets/hk-local-hero.png") center/cover;
  box-shadow: var(--soft-shadow);
}

.publish-success {
  display: grid;
  gap: 14px;
  align-content: center;
  min-height: 360px;
}

.publish-success h3 {
  margin: 0;
  font-size: 28px;
}

.publish-success p,
.publish-success small {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

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

.review-steps span {
  display: grid;
  gap: 6px;
  min-height: 76px;
  align-content: center;
  padding: 10px;
  border: 1px solid #dbe7ee;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: #27445f;
  font-size: 13px;
  font-weight: 850;
}

.review-steps strong {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #fff;
  background: var(--green);
  border-radius: 999px;
}

.preview-card h3 {
  margin: 18px 0 10px;
  font-size: clamp(22px, 3vw, 34px);
}

.preview-open {
  margin-top: 18px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.listing-dialog {
  width: min(1120px, calc(100% - 26px));
  max-height: calc(100vh - 30px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.auth-dialog {
  width: min(440px, calc(100% - 28px));
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.edit-dialog {
  width: min(760px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}

.edit-dialog::backdrop {
  background: rgba(18, 31, 43, 0.58);
  backdrop-filter: blur(4px);
}

.auth-dialog::backdrop {
  background: rgba(18, 31, 43, 0.58);
  backdrop-filter: blur(4px);
}

.auth-card,
.edit-card,
.admin-login .auth-card {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow);
}

.edit-card {
  max-height: calc(100vh - 28px);
  overflow: auto;
}

.auth-card h1,
.auth-card h2,
.edit-card h2 {
  margin-bottom: 0;
}

.auth-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.auth-card button[type="submit"],
.edit-card button[type="submit"] {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.auth-card button:disabled,
.edit-card button:disabled {
  opacity: 0.62;
  cursor: wait;
}

.forgot-password {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.close-auth {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fafc;
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.listing-dialog::backdrop {
  background: rgba(18, 31, 43, 0.58);
  backdrop-filter: blur(4px);
}

.dialog-shell {
  position: relative;
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(360px, 1.05fr);
  gap: 0;
  overflow: hidden;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
}

.close-dialog {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  color: #fff;
  background: rgba(16, 31, 47, 0.76);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.detail-panel {
  border-right: 1px solid var(--line);
  background: #f8fbfd;
}

.detail-hero {
  min-height: 260px;
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)),
    var(--card-bg);
  background-position: center;
  background-size: cover;
}

.detail-hero span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 32, 50, 0.78);
  font-size: 13px;
  font-weight: 800;
}

.detail-body {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.detail-body h2 {
  font-size: clamp(26px, 4vw, 40px);
}

.detail-price {
  color: var(--blue-dark);
  font-size: 30px;
  font-weight: 850;
}

.detail-price small {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 14px;
}

.detail-body p {
  color: #40566d;
  line-height: 1.7;
}

.deal-panel {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr);
  max-height: calc(100vh - 30px);
  overflow: auto;
  background: #fff;
}

.auction-box,
.chat-box {
  padding: 20px;
}

.auction-box {
  border-bottom: 1px solid var(--line);
}

.mini-heading p {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
}

.mini-heading h3 {
  margin-bottom: 14px;
  font-size: 22px;
}

.bid-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.bid-summary span {
  display: grid;
  gap: 4px;
  min-height: 70px;
  align-content: center;
  padding: 10px;
  background: #f4f8fb;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}

.bid-summary strong {
  color: var(--ink);
  font-size: 17px;
}

.bid-form,
.chat-form {
  display: grid;
  gap: 10px;
}

.bid-form {
  grid-template-columns: 1fr 1fr auto;
  align-items: end;
}

.offer-assurance {
  display: grid;
  gap: 5px;
  margin-top: 10px;
}

.offer-assurance strong {
  color: var(--blue-dark);
}

.offer-assurance span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.bid-form button,
.chat-form button {
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.bid-log {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.bid-item {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-left: 4px solid var(--gold);
  background: #fff9ec;
  border-radius: 8px;
}

.my-offer-box {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  color: #0b5b3a;
  background: #e7f7ef;
  border: 1px solid #bfe9d1;
  border-radius: 8px;
}

.my-offer-box strong,
.my-offer-box span {
  display: block;
}

.my-offer-box span {
  font-size: 13px;
  font-weight: 800;
}

.bid-item span,
.empty-state {
  color: var(--muted);
  margin: 0;
}

.admin-empty {
  padding: 18px;
  background: #f7fafc;
  border: 1px dashed #cbd7e1;
  border-radius: 8px;
}

.agent-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: #f4f8fb;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #fff;
  background: var(--blue-dark);
  font-weight: 900;
}

.agent-card strong,
.agent-card span {
  display: block;
}

.agent-card span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.messages {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 260px;
  margin: 14px 0;
  padding: 14px;
  overflow: auto;
  background: #f7fafc;
  border: 1px solid #e1e9ef;
  border-radius: 8px;
}

.message {
  max-width: 82%;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  color: #33475d;
  line-height: 1.45;
  box-shadow: 0 4px 12px rgba(33, 48, 66, 0.06);
}

.message span {
  display: block;
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.message p {
  margin: 0;
}

.message small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}

.message.mine {
  align-self: flex-end;
  color: #fff;
  background: var(--blue);
}

.message.mine span {
  color: #dcecff;
  text-align: right;
}

.message.mine small {
  color: #dcecff;
  text-align: right;
}

.chat-state {
  align-self: center;
  padding: 6px 10px;
  color: var(--muted);
  background: #edf3f8;
  border: 1px solid #dfe8ef;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.chat-form {
  grid-template-columns: 1fr auto;
}

.buyer-quick-questions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.buyer-quick-questions button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #cbd7e1;
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.buyer-quick-questions button:hover {
  border-color: var(--blue);
  background: #eef4fb;
}

.admin-section {
  margin: 8px 0 34px;
}

.admin-login {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 180px);
  padding: 32px 0;
}

.admin-login .auth-card {
  width: min(520px, 100%);
}

.admin-section.locked {
  display: none;
}

.admin-login.unlocked {
  display: none;
}

.reset-demo {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #eef4fb;
  font-weight: 800;
  cursor: pointer;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.admin-stats span,
.admin-stat-button {
  display: grid;
  gap: 4px;
  min-height: 76px;
  align-content: center;
  padding: 12px;
  color: var(--muted);
  background: #f5f8fb;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  font-weight: 700;
  text-align: left;
}

.admin-stat-button {
  cursor: pointer;
  font: inherit;
}

.admin-stat-button:hover {
  border-color: var(--blue);
  background: #eef4fb;
}

.admin-stats strong,
.admin-stat-button strong {
  color: var(--ink);
  font-size: 28px;
}

.admin-data-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  color: var(--muted);
  background: #f7fafc;
  font-weight: 700;
}

.admin-data-notice.is-live {
  color: #0b5b3a;
  background: #e7f7ef;
  border-color: #bfe9d1;
}

.admin-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 0.35fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.admin-toolbar button {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.admin-list {
  display: grid;
  gap: 12px;
}

.admin-item {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, 0.75fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.admin-item h3 {
  margin: 8px 0 6px;
  font-size: 18px;
}

.admin-item p {
  margin: 0 0 4px;
  color: var(--muted);
}

.admin-latest-message {
  color: var(--blue) !important;
  font-weight: 800;
}

.admin-listing-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.admin-listing-stats span {
  display: grid;
  gap: 2px;
  padding: 8px;
  color: var(--muted);
  background: #f5f8fb;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  font-size: 12px;
}

.admin-listing-stats strong {
  color: var(--ink);
  font-size: 18px;
}

.admin-assignment {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.admin-assignment label {
  font-size: 12px;
}

.admin-assignment select {
  min-height: 38px;
}

.admin-assignment button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.status-pill.approved {
  color: #0b5b3a;
  background: #e7f7ef;
  border: 1px solid #bfe9d1;
}

.status-pill.pending {
  color: #7a4804;
  background: #fff3d8;
  border: 1px solid #f2d391;
}

.status-pill.archived {
  color: #5b6674;
  background: #eef1f4;
  border: 1px solid #d3dae2;
}

.status-pill.off_market {
  color: #7a4804;
  background: #fff3d8;
  border: 1px solid #f2d391;
}

.status-pill.appointment-alert {
  color: #8a330f;
  background: #ffe9df;
  border: 1px solid #f0b49c;
}

.status-pill.unread-alert {
  color: #8a330f;
  background: #ffe9df;
  border: 1px solid #f0b49c;
}

.admin-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(104px, auto));
  gap: 8px;
}

.admin-actions button {
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
}

.admin-actions button:nth-child(2) {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.admin-actions button:nth-child(3) {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.admin-actions button[data-admin-feature] {
  color: #fff;
  background: var(--gold);
  border-color: var(--gold);
}

.admin-actions button[data-admin-delete],
.admin-actions button[data-admin-purge] {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
}

.admin-actions button[data-admin-toggle],
.admin-actions button[data-admin-restore] {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.appointment-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-subheading {
  color: var(--ink);
  font-weight: 900;
}

.inquiry-thread {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f7fafc;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
}

.inquiry-thread.needs-reply {
  background: #fff8f3;
  border-color: #f0b49c;
}

.inquiry-messages {
  display: grid;
  gap: 6px;
}

.inquiry-messages strong,
.inquiry-messages span {
  display: block;
}

.reply-state {
  display: inline-flex;
  width: max-content;
  margin-top: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
}

.reply-state.unread {
  color: #8a330f;
  background: #ffe9df;
  border: 1px solid #f0b49c;
}

.reply-state.done {
  color: #0b5b3a;
  background: #e7f7ef;
  border: 1px solid #bfe9d1;
}

.inquiry-bubble {
  display: grid;
  gap: 4px;
  max-width: min(760px, 86%);
  padding: 8px 10px;
  color: #33475d;
  background: #fff;
  border: 1px solid #e1e9ef;
  border-radius: 8px;
}

.inquiry-bubble span {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.inquiry-bubble p {
  margin: 0;
}

.inquiry-bubble.agent-reply {
  justify-self: end;
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

.inquiry-bubble.agent-reply span,
.inquiry-messages .inquiry-bubble.agent-reply span {
  color: #dcecff;
  text-align: right;
}

.inquiry-bubble.agent-reply p,
.inquiry-messages .inquiry-bubble.agent-reply p {
  color: #fff;
}

.inquiry-messages span {
  color: var(--muted);
  font-size: 12px;
}

.inquiry-reply-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.quick-replies {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quick-replies button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid #cbd7e1;
  border-radius: 8px;
  color: var(--blue);
  background: #fff;
  font-weight: 800;
  cursor: pointer;
}

.quick-replies button:hover {
  border-color: var(--blue);
  background: #eef4fb;
}

.inquiry-reply-form > button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.site-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  max-width: min(340px, calc(100vw - 44px));
  padding: 14px 16px;
  color: #fff;
  background: var(--blue);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(15, 41, 69, 0.22);
  font-weight: 900;
}

.site-toast.leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.appointment-item {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: #f7fafc;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
}

.appointment-item strong {
  display: block;
  margin-bottom: 3px;
}

.appointment-item p {
  margin: 0;
  color: var(--muted);
}

.appointment-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 9px;
  color: #7a4804;
  background: #fff3d8;
  border: 1px solid #f2d391;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.appointment-status.confirmed {
  color: #0b5b3a;
  background: #e7f7ef;
  border-color: #bfe9d1;
}

.appointment-status.declined {
  color: #7b1f1f;
  background: #fde7e7;
  border-color: #eeb5b5;
}

.appointment-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.appointment-actions button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.appointment-actions button[data-admin-decline-appointment] {
  background: var(--coral);
  border-color: var(--coral);
}

.activity-panel {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.activity-list {
  display: grid;
  gap: 10px;
}

.activity-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px;
  border: 1px solid #dfe8ef;
  border-radius: 8px;
  background: #f8fafc;
}

.activity-item > span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--blue);
  background: #eaf2fb;
  border: 1px solid #cfe0f2;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.activity-item strong,
.activity-item p {
  display: block;
}

.activity-item p {
  margin: 4px 0 0;
  color: var(--muted);
}

.admin-offer-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid #dfe8ef;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fffaf0;
}

.admin-offer-item.accepted {
  border-left-color: var(--green);
  background: #eefaf4;
}

.admin-offer-item strong,
.admin-offer-item span {
  display: block;
}

.admin-offer-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.admin-offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.admin-offer-actions button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  font-weight: 850;
  cursor: pointer;
}

.admin-offer-actions button[data-admin-accept-offer] {
  color: #fff;
  background: var(--green);
  border-color: var(--green);
}

.admin-offer-actions button[data-admin-reject-offer] {
  color: #9b2d1f;
  background: #fff0ed;
  border-color: #f1c2ba;
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 24px clamp(18px, 4vw, 56px);
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .topbar {
    flex-wrap: wrap;
  }

  .nav {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }

  .workspace,
  .content-grid,
  .publish-layout,
  .dialog-shell,
  .admin-item {
    grid-template-columns: 1fr;
  }

  .hero-media {
    min-height: 380px;
  }

  .side-panel {
    position: static;
  }

  .deal-panel {
    max-height: none;
  }

  .detail-panel {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 640px) {
  main {
    width: min(100% - 22px, 1180px);
  }

  .topbar {
    padding: 12px;
  }

  .top-action {
    padding: 0 12px;
  }

  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .workspace {
    padding-top: 14px;
  }

  .filter-actions,
  .form-row,
  .listing-grid,
  .market-strip,
  .listing-actions,
  .bid-summary,
  .bid-form,
  .chat-form,
  .viewing-grid,
  .admin-stats,
  .admin-actions,
  .admin-toolbar,
  .inquiry-reply-form,
  .activity-item {
    grid-template-columns: 1fr;
  }

  .appointment-item {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .viewing-heading {
    display: grid;
  }

  .listing-dialog {
    width: calc(100% - 12px);
    max-height: calc(100vh - 12px);
  }

  .dialog-shell {
    max-height: calc(100vh - 12px);
    overflow: auto;
  }

  .market-strip {
    position: static;
    margin: 0;
    border-radius: 0;
  }

  .hero-media img {
    height: 300px;
  }

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

  footer {
    flex-direction: column;
  }
}
