:root {
  --bg: #f4f6f3;
  --surface: #ffffff;
  --surface-soft: #eef3ef;
  --surface-warm: #fbf6ed;
  --text: #17251f;
  --text-strong: #0d1914;
  --muted: #67756e;
  --line: #dce4df;
  --line-strong: #c7d2cb;
  --primary: #176b4d;
  --primary-dark: #0f5139;
  --primary-soft: #e2f1ea;
  --accent: #d9772e;
  --accent-soft: #fff0e2;
  --danger: #b42318;
  --danger-soft: #fff0ee;
  --success: #157347;
  --success-soft: #e8f6ee;
  --warning: #8a5b00;
  --warning-soft: #fff4d6;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(13, 25, 20, .05), 0 6px 18px rgba(13, 25, 20, .04);
  --shadow: 0 18px 45px rgba(13, 25, 20, .09);
  --max-width: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(23, 107, 77, .08), transparent 28rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { appearance: none; }
img { display: block; max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: none; }

.shell { width: min(var(--max-width), calc(100% - 28px)); margin-inline: auto; }
.page { min-height: calc(100vh - 142px); padding-block: 28px 56px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(199, 210, 203, .85);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px);
}
.header-row {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text-strong);
  min-width: 0;
}
.brand:hover { color: var(--text-strong); }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), #248762);
  box-shadow: 0 8px 18px rgba(23, 107, 77, .22);
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand-copy { display: grid; line-height: 1.08; min-width: 0; }
.brand-name { font-size: 1rem; font-weight: 850; white-space: nowrap; }
.brand-subtitle { margin-top: 4px; color: var(--muted); font-size: .72rem; font-weight: 650; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 5px; }
.nav-link,
.link-button {
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  background: transparent;
  color: #425149;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  line-height: 1;
}
.nav-link:hover,
.link-button:hover { color: var(--primary-dark); background: var(--primary-soft); }
.nav-link.active { color: var(--primary-dark); background: var(--primary-soft); }
.inline-form { display: inline; margin: 0; }

.site-footer { border-top: 1px solid var(--line); background: rgba(255, 255, 255, .62); color: var(--muted); }
.footer-row { min-height: 70px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .86rem; }
.footer-brand { color: var(--text); font-weight: 800; }

/* Typography and layout helpers */
h1, h2, h3 { color: var(--text-strong); letter-spacing: -.035em; }
h1 { margin: 0 0 10px; font-size: clamp(2rem, 6vw, 3.35rem); line-height: 1.02; }
h2 { margin: 0; font-size: clamp(1.25rem, 3vw, 1.65rem); line-height: 1.18; }
h3 { margin: 0; font-size: 1.05rem; }
p { line-height: 1.62; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 10px; color: var(--primary); font-size: .78rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.lead { max-width: 660px; margin: 0; color: var(--muted); font-size: clamp(1rem, 2vw, 1.1rem); }
.stack { display: grid; gap: 18px; }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.split { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.narrow { margin-inline: auto; }
.narrow-500 { max-width: 500px; }
.narrow-560 { max-width: 560px; }
.mt-12 { margin-top: 12px; }
.mt-14 { margin-top: 14px; }
.mt-16 { margin-top: 16px; }
.text-danger { color: var(--danger); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9rem; }

.card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.card-body { padding: 20px; }

/* Buttons */
.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 16px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  box-shadow: 0 7px 16px rgba(23, 107, 77, .15);
  transition: transform .16s ease, background .16s ease, box-shadow .16s ease;
}
.btn:hover { color: #fff; background: var(--primary-dark); box-shadow: 0 10px 22px rgba(23, 107, 77, .22); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-secondary { border-color: var(--line); background: #fff; color: #2f4238; box-shadow: none; }
.btn-secondary:hover { border-color: var(--line-strong); background: var(--surface-soft); color: var(--text-strong); box-shadow: none; }
.btn-danger { background: var(--danger); }
.btn-small { min-height: 36px; border-radius: 10px; padding: 7px 11px; font-size: .84rem; }
.btn-block { width: 100%; }

/* Forms */
label { display: grid; gap: 7px; color: #26362e; font-size: .9rem; font-weight: 750; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 12px 13px;
  font-weight: 400;
  box-shadow: 0 1px 0 rgba(13, 25, 20, .02);
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
input::placeholder, textarea::placeholder { color: #99a39e; font-weight: 400; }
textarea { min-height: 130px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(23, 107, 77, .13);
}
input[type="file"] { padding: 10px; background: var(--surface-soft); }
input[type="file"]::file-selector-button {
  margin-right: 10px;
  border: 0;
  border-radius: 9px;
  padding: 8px 11px;
  background: var(--primary);
  color: #fff;
  font-weight: 750;
  cursor: pointer;
}
.form-grid { display: grid; gap: 17px; }
.form-grid-2 { display: grid; gap: 15px; }
.form-card { padding: 22px; }
.help { color: var(--muted); font-size: .8rem; font-weight: 500; line-height: 1.45; }
.field-label {
  display: inline-flex;
  width: fit-content;
  align-items: baseline;
  gap: 4px;
}
.required-mark {
  display: inline;
  color: #b42318 !important;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
}
.required-note {
  display: flex;
  align-items: baseline;
  gap: 5px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}
.form-grid > .required-note { margin: -2px 0 -2px; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.checkbox-inline { width: auto; accent-color: var(--primary); }
.honeypot { position: absolute !important; left: -9999px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

/* Alerts */
.alert { border: 1px solid; border-radius: 13px; padding: 13px 15px; margin-bottom: 18px; font-size: .92rem; font-weight: 600; }
.alert-success { color: var(--success); background: var(--success-soft); border-color: #b8dfc8; }
.alert-error { color: var(--danger); background: var(--danger-soft); border-color: #f0bbb5; }
.alert-info { color: #245b49; background: #e9f4ef; border-color: #bedbce; }

/* Status */
.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 6px 10px;
  background: #edf1ee;
  color: #4c5c54;
  font-size: .75rem;
  font-weight: 850;
  line-height: 1;
}
.badge-active { color: var(--success); background: var(--success-soft); }
.badge-active::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending { color: var(--warning); background: var(--warning-soft); }
.badge-sold, .badge-removed { color: #5d6862; background: #ecefed; }

/* Public browse */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 22px;
  border: 1px solid #cfe1d7;
  border-radius: var(--radius-lg);
  padding: 28px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.96), rgba(237,246,241,.96)),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.hero::after {
  content: '';
  position: absolute;
  right: -72px;
  bottom: -92px;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217,119,46,.2), rgba(217,119,46,0) 68%);
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 1; }
.hero-stats { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 10px; }
.hero-stat { min-width: 120px; border: 1px solid rgba(23,107,77,.14); border-radius: 14px; padding: 12px 14px; background: rgba(255,255,255,.78); }
.hero-stat strong { display: block; color: var(--text-strong); font-size: 1.25rem; }
.hero-stat span { color: var(--muted); font-size: .75rem; font-weight: 700; }

.filters { margin: 20px 0 24px; border: 1px solid var(--line); border-radius: var(--radius); padding: 17px; background: var(--surface); box-shadow: var(--shadow-sm); }
.filter-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.filter-title { color: var(--text-strong); font-size: .95rem; font-weight: 850; }
.filter-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
.search-field { position: relative; }
.search-field input { padding-left: 39px; }
.search-field::before {
  content: '';
  position: absolute;
  z-index: 2;
  left: 14px;
  bottom: 15px;
  width: 12px;
  height: 12px;
  border: 2px solid #7d8b84;
  border-radius: 50%;
}
.search-field::after {
  content: '';
  position: absolute;
  z-index: 2;
  left: 26px;
  bottom: 13px;
  width: 7px;
  height: 2px;
  border-radius: 2px;
  background: #7d8b84;
  transform: rotate(45deg);
}
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(255px, 1fr)); }
.listing-card {
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.listing-card:hover { border-color: #c1d6c9; box-shadow: var(--shadow); transform: translateY(-3px); }
.listing-media { position: relative; overflow: hidden; background: #e8ede9; }
.listing-card .photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s ease; }
.listing-card:hover .photo { transform: scale(1.025); }
.photo-placeholder { display: grid; place-items: center; background: linear-gradient(145deg, #e9efeb, #dfe8e2); color: #78867f; }
.photo-placeholder::before { content: 'Photo coming soon'; font-size: .82rem; font-weight: 750; }
.listing-media .badge { position: absolute; top: 12px; left: 12px; box-shadow: 0 4px 12px rgba(13,25,20,.1); }
.listing-card .card-body { display: flex; flex: 1; flex-direction: column; gap: 11px; padding: 18px; }
.listing-kicker { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.listing-title { color: var(--text-strong); font-size: 1.08rem; font-weight: 850; line-height: 1.32; }
.listing-title:hover { color: var(--primary); }
.price { color: var(--text-strong); font-size: 1.38rem; font-weight: 900; letter-spacing: -.025em; }
.listing-location { color: var(--muted); font-size: .84rem; }
.listing-card .btn { margin-top: auto; }
.empty { text-align: center; padding: 52px 22px; color: var(--muted); }
.empty strong { display: block; margin-bottom: 7px; color: var(--text); font-size: 1.05rem; }

/* Detail page */
.breadcrumb { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 16px; color: var(--muted); font-size: .87rem; font-weight: 700; }
.breadcrumb:hover { color: var(--primary); }
.detail-grid { display: grid; gap: 24px; }
.gallery-panel {
  min-width: 0;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.gallery-stage {
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 320px;
  border-radius: 14px;
  background: linear-gradient(145deg, #eef3f0, #e4ebe7);
}
.gallery-main {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(78vh, 900px);
  border: 0;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  box-shadow: none;
}
.gallery-stage-empty .gallery-main { width: 100%; min-height: 420px; }
.thumb-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(72px, 1fr));
  gap: 9px;
  overflow-x: auto;
  margin-top: 10px;
  padding-bottom: 2px;
}
.thumb-button {
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 11px;
  padding: 0;
  background: #eef3f0;
  cursor: pointer;
}
.thumb-button:hover, .thumb-button:focus-visible, .thumb-button[aria-pressed="true"] {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 2px rgba(23, 107, 77, .12);
}
.thumb-row img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.detail-panel { padding: 22px; }
.detail-panel h1 { margin-top: 13px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
.detail-meta-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.meta-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
.meta-item { border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; background: #fafcfb; }
.meta-item dt { margin-bottom: 3px; color: var(--muted); font-size: .72rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.meta-item dd { margin: 0; color: var(--text-strong); font-size: .9rem; font-weight: 800; }
.description { color: #34463d; white-space: normal; }
.inquiry-form h2 { margin-bottom: 2px; }
.inquiry-form { border-top: 4px solid var(--primary); }
.pending-box { border-top: 4px solid #c08b27; background: #fffdf8; }

/* Authentication */
.auth-layout { display: grid; overflow: hidden; max-width: 980px; margin-inline: auto; border: 1px solid #d2ded7; border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); }
.auth-intro { position: relative; overflow: hidden; padding: 30px; background: linear-gradient(150deg, #114d39, #1b7655); color: #fff; }
.auth-intro::after { content: ''; position: absolute; width: 260px; height: 260px; right: -115px; bottom: -115px; border-radius: 50%; background: rgba(255,255,255,.09); }
.auth-intro .eyebrow { color: #bfe8d4; }
.auth-intro h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.2rem); }
.auth-intro p { max-width: 500px; color: #d6eee2; }
.auth-points { position: relative; z-index: 1; display: grid; gap: 12px; margin-top: 26px; }
.auth-point { display: grid; grid-template-columns: 34px 1fr; gap: 11px; align-items: start; }
.auth-point-number { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 10px; background: rgba(255,255,255,.13); color: #fff; font-size: .82rem; font-weight: 900; }
.auth-point strong { display: block; margin-bottom: 2px; }
.auth-point span { color: #cbe5d8; font-size: .84rem; line-height: 1.4; }
.auth-card { border: 0; border-radius: 0; box-shadow: none; padding: 28px; }
.auth-card h2 { margin-bottom: 7px; font-size: 1.7rem; }
.auth-card .form-grid { margin-top: 22px; }
.auth-security { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; border-radius: 11px; padding: 11px 12px; background: var(--surface-soft); color: var(--muted); font-size: .78rem; line-height: 1.4; }

/* Admin */
.admin-heading { margin-bottom: 22px; }
.dashboard-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin: 20px 0 22px; }
.metric-card { border: 1px solid var(--line); border-radius: 15px; padding: 16px; background: var(--surface); box-shadow: var(--shadow-sm); }
.metric-label { color: var(--muted); font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.metric-value { display: block; margin-top: 5px; color: var(--text-strong); font-size: 1.8rem; font-weight: 900; letter-spacing: -.04em; }
.metric-note { display: block; margin-top: 3px; color: var(--muted); font-size: .76rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; min-width: 850px; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); background: #f8faf8; font-size: .72rem; font-weight: 850; letter-spacing: .065em; text-transform: uppercase; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfb; }
.admin-listing-cell { display: flex; align-items: center; gap: 11px; min-width: 250px; }
.admin-thumb { width: 54px; height: 54px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 11px; object-fit: cover; background: #e8eeea; }
.admin-thumb-placeholder { display: grid; place-items: center; color: #7b8982; font-size: .7rem; font-weight: 800; }
.admin-listing-title { color: var(--text-strong); font-weight: 850; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 7px; }

.editor-grid { display: grid; gap: 18px; align-items: start; margin-top: 18px; }
.form-section { padding: 22px; }
.form-section-header { margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.form-section-header p { margin: 5px 0 0; color: var(--muted); font-size: .85rem; }
.editor-sidebar { display: grid; gap: 17px; }
.editor-actions { display: grid; gap: 9px; }

.photo-admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)); gap: 12px; }
.photo-admin { border: 1px solid var(--line); border-radius: 13px; padding: 9px; background: #fafcfb; }
.photo-admin img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 9px; margin-bottom: 9px; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.preview-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); border-radius: 10px; }

.inquiry-list { display: grid; gap: 14px; margin-top: 18px; }
.inquiry { border: 1px solid var(--line); border-radius: 16px; padding: 19px; background: var(--surface); box-shadow: var(--shadow-sm); }
.inquiry-new { border-left: 4px solid var(--primary); }
.inquiry p { margin: 14px 0; }
.inquiry-contact-grid { display: grid; gap: 10px; grid-template-columns: 1fr; border-radius: 12px; padding: 13px; background: #f7faf8; font-size: .88rem; }
.inquiry-contact-grid strong { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }

@media (min-width: 640px) {
  .hero { grid-template-columns: 1fr auto; align-items: end; padding: 36px; }
  .auth-intro, .auth-card { padding: 38px; }
  .form-grid-2 { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: repeat(4, 1fr); }
  .inquiry-contact-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 760px) {
  .filter-grid { grid-template-columns: minmax(220px, 2fr) repeat(4, minmax(125px, 1fr)); align-items: end; }
  .detail-grid { grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr); align-items: start; }
  .detail-sidebar { position: sticky; top: 96px; }
  .editor-grid { grid-template-columns: minmax(0, 1fr) 320px; }
  .editor-sidebar { position: sticky; top: 96px; }
}

@media (min-width: 860px) {
  .auth-layout { grid-template-columns: 1.05fr .95fr; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 20px, var(--max-width)); }
  .header-row { min-height: 64px; }
  .brand-subtitle { display: none; }
  .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
  .nav-link, .link-button { padding: 8px 9px; font-size: .82rem; }
  .page { padding-top: 18px; }
  .hero { padding: 23px; }
  .hero-stat { min-width: 105px; }
  .filter-top { align-items: flex-start; }
  .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .filter-actions .btn { width: 100%; }
  .meta-list { grid-template-columns: 1fr; }
  .thumb-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .auth-layout { border-radius: 18px; }
  .auth-intro, .auth-card { padding: 24px; }
  .dashboard-grid { gap: 9px; }
  .metric-card { padding: 13px; }
  .metric-value { font-size: 1.5rem; }
  .footer-row { padding-block: 17px; }
}

/* Security, inventory, privacy, and workflow upgrades */
.nav-links { flex-wrap: wrap; justify-content: flex-end; }
.badge-warning { color: var(--warning); background: var(--warning-soft); }
.badge-inquiry-new { color: var(--success); background: var(--success-soft); }
.badge-inquiry-accepted { color: #245b8a; background: #e8f1fb; }
.badge-inquiry-waitlisted { color: var(--warning); background: var(--warning-soft); }
.badge-inquiry-declined,
.badge-inquiry-cancelled,
.badge-inquiry-expired { color: #6d5b54; background: #f1ece9; }
.badge-inquiry-completed { color: #4f3f7a; background: #f0ecfb; }

.inventory-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: -4px 0 20px;
}
.inventory-strip > div {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 13px 14px;
  background: var(--surface);
}
.inventory-strip span:first-child { color: var(--muted); font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .055em; }
.inventory-strip strong { color: var(--text-strong); font-size: 1.25rem; }

.compact-filters {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 0;
}
.compact-filters label { min-width: 220px; }
.privacy-note {
  margin: 0;
  border-radius: 11px;
  padding: 11px 12px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.5;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 24px;
  color: var(--muted);
  font-weight: 750;
}

.security-grid {
  display: grid;
  gap: 18px;
  align-items: start;
}
.security-critical {
  margin-bottom: 18px;
  border-color: #e6bf72;
  background: #fffdf7;
}
.recovery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 9px;
}
.recovery-grid code,
.setup-key code {
  display: block;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  background: #f7faf8;
  color: var(--text-strong);
  font-weight: 850;
  letter-spacing: .08em;
  overflow-wrap: anywhere;
}
.setup-key { border-radius: 12px; padding: 14px; background: var(--surface-soft); }
.setup-key strong { display: block; margin-bottom: 8px; }
.security-details { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.security-details summary { cursor: pointer; color: var(--primary-dark); font-weight: 800; }
.danger-zone summary { color: var(--danger); }
.diagnostic-list { margin: 0; }
.diagnostic-list div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.diagnostic-list div:last-child { border-bottom: 0; }
.diagnostic-list dt { color: var(--muted); }
.diagnostic-list dd { margin: 0; color: var(--text-strong); font-weight: 800; text-align: right; }
.audit-details { max-width: 360px; overflow-wrap: anywhere; color: var(--muted); font-size: .8rem; }

button:disabled {
  cursor: wait;
  opacity: .65;
  transform: none !important;
}

@media (min-width: 820px) {
  .security-grid { grid-template-columns: minmax(0, 1.15fr) minmax(300px, .85fr); }
}

@media (max-width: 760px) {
  .header-row { align-items: flex-start; padding-block: 10px; }
  .nav-links { max-width: 58%; gap: 2px; }
  .nav-link, .link-button { padding: 7px 8px; }
  .compact-filters { display: grid; }
  .compact-filters label { min-width: 0; }
}

/* Local AI listing assistant */
.ai-assistant {
  border-color: #c9d9ed;
  background: linear-gradient(145deg, #ffffff, #f6f9fd);
}
.ai-heading { align-items: flex-start; }
.badge-ai { color: #345d8a; background: #eaf2fb; }
.ai-status {
  color: var(--muted);
  font-size: .84rem;
  font-weight: 700;
}
.ai-status[data-state="working"] { color: #345d8a; }
.ai-status[data-state="success"] { color: var(--success); }
.ai-status[data-state="error"] { color: var(--danger); }
.ai-result {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.ai-result-header { margin-bottom: 14px; }
.ai-result-header .eyebrow { margin-bottom: 5px; }
.ai-preview {
  display: grid;
  gap: 10px;
  margin: 0;
}
.ai-preview > div {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 13px;
  background: #fff;
}
.ai-preview dt {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.ai-preview dd {
  margin: 0;
  color: var(--text);
  font-size: .9rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.ai-advice-grid {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}
.ai-advice-grid > div {
  border-radius: 12px;
  padding: 13px 15px;
  background: var(--surface-warm);
}
.ai-advice-grid h3 { margin-bottom: 7px; font-size: .95rem; }
.ai-advice-grid ul { margin: 0; padding-left: 20px; color: #4a514d; font-size: .86rem; line-height: 1.55; }
.ai-result-actions { margin-top: 16px; }
.ai-config-note { margin-bottom: 0; }
.ai-config-note code { overflow-wrap: anywhere; }

@media (min-width: 640px) {
  .ai-preview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ai-preview > div:nth-child(2) { grid-column: 1 / -1; }
  .ai-advice-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Photo-first listing workflow and visual AI review */
.workflow-dialog {
  width: min(92vw, 560px);
  max-height: 88vh;
  padding: 0;
  border: 0;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(18, 38, 31, 0.28);
  background: transparent;
}

.workflow-dialog::backdrop {
  background: rgba(13, 28, 23, 0.62);
  backdrop-filter: blur(3px);
}

.dialog-card {
  padding: clamp(22px, 5vw, 34px);
  background: var(--surface, #fffdf8);
  border-radius: 22px;
  overflow: auto;
  max-height: 88vh;
}

.dialog-card h2 {
  margin: 4px 0 10px;
}

.dialog-actions {
  margin-top: 22px;
}

.btn-quiet {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted, #5e6a65);
}

.checkbox-list {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.checkbox-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border, #d8dfda);
  border-radius: 14px;
  background: #fff;
  cursor: pointer;
}

.checkbox-card input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: 0 0 auto;
}

.checkbox-card span {
  display: grid;
  gap: 3px;
}

.checkbox-card small {
  color: var(--muted, #68736e);
  line-height: 1.35;
}

.checkbox-card-all {
  margin-top: 18px;
  background: #f1f7f3;
  border-color: #b9ccbf;
}

.dialog-footer {
  justify-content: flex-end;
  margin-top: 20px;
}

.dialog-error {
  color: #b42318;
  font-weight: 650;
  margin: 8px 0 0;
}

.photo-admin-draft {
  position: relative;
  border-style: dashed;
}

.photo-admin-draft .badge {
  align-self: flex-start;
}

.upload-status {
  min-height: 1.35em;
  font-size: 0.93rem;
  color: var(--muted, #68736e);
}

.upload-status[data-state="error"],
.ai-status[data-state="error"] {
  color: #b42318;
}

.upload-status[data-state="success"],
.ai-status[data-state="success"] {
  color: #276749;
}

.upload-status[data-state="working"],
.ai-status[data-state="working"] {
  color: #8a5a00;
}

.ai-generate-row {
  align-items: center;
}

.ai-generate-row .btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.ai-field-results {
  display: grid;
  gap: 16px;
  margin: 18px 0;
}

.ai-compare-card {
  padding: 16px;
  border: 1px solid var(--border, #d8dfda);
  border-radius: 16px;
  background: #fff;
}

.ai-compare-card h4 {
  margin: 0 0 12px;
}

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

.ai-compare-grid > div {
  min-width: 0;
  padding: 12px;
  border-radius: 12px;
  background: #f6f8f6;
}

.ai-compare-grid p {
  margin: 6px 0 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-height: 180px;
  overflow: auto;
}

.ai-decision-options {
  margin-top: 12px;
}

.radio-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--border, #d8dfda);
  border-radius: 999px;
  background: #fff;
  cursor: pointer;
}

.radio-chip:has(input:checked) {
  border-color: #48765b;
  background: #edf6ef;
}

.radio-chip input {
  margin: 0;
}

.ai-price-insights {
  margin: 20px 0;
  padding: 18px;
  border-radius: 16px;
  background: #fff8e7;
  border: 1px solid #ead7a1;
}

.price-insight-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(100px, 1fr));
  gap: 10px;
}

.price-insight-grid > div {
  display: grid;
  gap: 5px;
  padding: 12px;
  background: rgba(255,255,255,.75);
  border-radius: 12px;
}

.price-insight-grid span {
  font-size: .83rem;
  color: var(--muted, #68736e);
}

.price-insight-grid strong {
  font-size: 1.05rem;
}

@media (max-width: 767px) {
  .workflow-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .dialog-card {
    max-height: calc(100vh - 20px);
    padding: 22px 18px;
  }

  .photo-start-dialog .btn {
    min-height: 52px;
  }

  .ai-compare-grid {
    grid-template-columns: 1fr;
  }

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

  .dialog-footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dialog-footer .btn {
    width: 100%;
  }
}


/* Compact photo-based AI action */
.photo-section-heading {
  align-items: flex-start;
  gap: 18px;
}

.photo-section-heading > div {
  min-width: 0;
}

.ai-compact-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.ai-status-compact {
  margin: 12px 0 0;
}

.ai-guidance-field {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.ai-guidance-field textarea {
  min-height: 110px;
}

@media (max-width: 640px) {
  .photo-section-heading {
    display: grid;
  }

  .ai-compact-button {
    width: 100%;
  }
}

/* Marketplace 3.0 consolidated listing editor */
.editor-grid-preview {
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
}

.editor-main-column { min-width: 0; }
.editor-preview-column { display: grid; gap: 18px; min-width: 0; }

.photo-first-section { overflow: visible; }
.photo-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.photo-frame {
  position: relative;
  overflow: hidden;
  border-radius: 11px;
  background: #e9efeb;
}
.photo-admin .photo-frame img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0;
  border-radius: 0;
}
.photo-cover-badge {
  position: absolute;
  left: 8px;
  top: 8px;
  color: #fff;
  background: rgba(15, 92, 65, .92);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}
.photo-admin.is-cover {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(23, 107, 77, .12);
}
.photo-admin.is-removed {
  opacity: .48;
  border-style: dashed;
}
.photo-admin.is-removed .photo-frame::after {
  content: "Will be removed";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  background: rgba(42, 34, 31, .72);
  color: #fff;
  font-weight: 850;
  text-align: center;
}
.photo-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 9px;
}
.photo-card-actions .btn { width: 100%; }

.empty-photo-state {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 150px;
  border: 1px dashed var(--line-strong);
  border-radius: 15px;
  padding: 24px;
  color: var(--muted);
  background: var(--surface-soft);
  text-align: center;
}
.empty-photo-state strong { color: var(--text-strong); }

.live-preview-card { padding: 18px; }
.live-preview-heading { margin-bottom: 14px; align-items: flex-start; }
.live-preview-heading h2 { font-size: 1.2rem; }
.preview-listing-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.preview-media {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #e9efeb;
}
.preview-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.preview-photo-placeholder {
  max-width: 220px;
  padding: 20px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 700;
  text-align: center;
}
.preview-card-body { display: grid; gap: 10px; padding: 16px; }
.preview-card-body h3 {
  overflow-wrap: anywhere;
  font-size: 1.12rem;
  line-height: 1.22;
}
.preview-description {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.5;
  white-space: pre-wrap;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}
.desktop-actions-card { align-content: start; }

.completion-meter { display: grid; gap: 9px; }
.completion-progress {
  display: block;
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #e4ebe7;
  appearance: none;
}
.completion-progress::-webkit-progress-bar { background: #e4ebe7; border-radius: 999px; }
.completion-progress::-webkit-progress-value { background: var(--primary); border-radius: 999px; }
.completion-progress::-moz-progress-bar { background: var(--primary); border-radius: 999px; }
.no-script-upload { display: grid; gap: 8px; margin: 12px 0; }

.badge-draft { color: #745514; background: #fff1bf; }
.drafts-section { margin: 8px 0 28px; }
.compact-heading { margin-bottom: 14px; }
.draft-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.draft-card { display: grid; grid-template-columns: 108px minmax(0, 1fr); }
.draft-card-photo {
  width: 108px;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  background: #e8eeea;
}
.draft-card-placeholder {
  display: grid;
  place-items: center;
  padding: 12px;
  color: var(--muted);
  font-size: .75rem;
  font-weight: 800;
  text-align: center;
}
.draft-card .card-body { display: grid; align-content: center; gap: 8px; padding: 15px; }
.draft-card h3 { overflow-wrap: anywhere; }
.draft-card p { margin: 0; }

.dashboard-grid-five { grid-template-columns: repeat(2, 1fr); }

button:disabled,
.btn:disabled {
  cursor: not-allowed;
}

@media (min-width: 760px) {
  .editor-grid-preview { grid-template-columns: minmax(0, 1fr) minmax(330px, 390px); }
  .editor-preview-column { position: sticky; top: 90px; align-self: start; }
  .dashboard-grid-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 759px) {
  .listing-editor-heading { align-items: flex-start; }
  .photo-action-row { display: grid; grid-template-columns: 1fr 1fr; }
  .photo-action-row .help { grid-column: 1 / -1; }
  .photo-action-row .btn { width: 100%; }
  .photo-admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-card-actions { grid-template-columns: 1fr 1fr; }
  .editor-preview-column { order: 3; }
  .live-preview-card { order: 1; }
  .desktop-actions-card { order: 2; }
  .draft-card { grid-template-columns: 92px minmax(0, 1fr); }
  .draft-card-photo { width: 92px; min-height: 140px; }
}

@media (max-width: 420px) {
  .photo-admin-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .photo-admin { padding: 7px; }
  .photo-card-actions .btn { min-height: 34px; padding-inline: 7px; font-size: .74rem; }
}
.desktop-actions-card { display: grid; gap: 17px; }


/* Respect the HTML hidden attribute even when component styles set display. */
[hidden] { display: none !important; }

.contact-method-fields {
  display: grid;
  gap: 15px;
}
.contact-extra-toggle {
  justify-self: start;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: .86rem;
  font-weight: 750;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.contact-extra-toggle:hover { color: var(--primary-dark); }
.contact-extra-toggle:focus-visible {
  outline: 3px solid #9bcdb8;
  outline-offset: 4px;
  border-radius: 4px;
}

/* Inquiry bulk deletion */
.btn-danger-outline {
  border-color: #c84a3f;
  background: transparent;
  color: #a92f26;
}
.btn-danger-outline:hover {
  border-color: #a92f26;
  background: #fff1ef;
  color: #84241d;
}
.inquiry-bulk-toolbar {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px 16px;
}
.inquiry-bulk-toolbar .help { margin: 0; }
.inquiry-select-all,
.inquiry-select-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 750;
  cursor: pointer;
}
.inquiry-select-all input,
.inquiry-select-control input {
  width: 19px;
  height: 19px;
  margin: 0;
  accent-color: var(--primary);
}
.inquiry-heading-main {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}
.inquiry-select-control {
  flex: 0 0 auto;
  padding-top: 2px;
}
.inquiry-delete-actions form { margin: 0; }

@media (max-width: 680px) {
  .inquiry-bulk-toolbar .split,
  .inquiry-delete-actions {
    align-items: stretch;
  }
  .inquiry-delete-actions {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }
  .inquiry-delete-actions form,
  .inquiry-delete-actions .btn {
    width: 100%;
  }
  .inquiry-card-heading {
    align-items: flex-start;
  }
}


/* Seller-selected reservation quantity */
.reserve-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 9px;
}
.reserve-quantity-field {
  width: 132px;
  gap: 5px;
  font-size: .78rem;
}
.reserve-quantity-field input {
  min-height: 36px;
  padding: 7px 10px;
}

@media (max-width: 759px) {
  .gallery-panel { padding: 8px; border-radius: 16px; }
  .gallery-stage { min-height: 240px; border-radius: 11px; }
  .gallery-main { max-height: 72vh; }
  .gallery-stage-empty .gallery-main { min-height: 300px; }
  .thumb-row { grid-template-columns: repeat(5, 78px); }
}

/* Marketplace 3.1.2 — individual item page balance and readability */
.detail-page {
  position: relative;
  left: 50%;
  width: min(1260px, calc(100vw - 40px));
  transform: translateX(-50%);
}

.item-detail-title {
  font-size: clamp(1.75rem, 2.5vw, 2.45rem);
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.item-description {
  margin-bottom: 0;
  font-size: .96rem;
  font-weight: 400;
  line-height: 1.68;
}

@media (min-width: 760px) {
  .detail-grid {
    grid-template-columns: minmax(0, 1.62fr) minmax(390px, .88fr);
    gap: 26px;
  }

  .gallery-main {
    max-height: min(74vh, 720px);
  }

  .detail-sidebar {
    top: 88px;
  }
}

@media (max-width: 759px) {
  .detail-page {
    left: auto;
    width: 100%;
    transform: none;
  }

  .item-detail-title {
    font-size: clamp(1.72rem, 9vw, 2.2rem);
  }
}

/* Marketplace 3.1.3 — more readable seller dashboard typography */
.dashboard-grid-five .metric-card,
.dashboard-grid .metric-card {
  padding: 18px;
}

.dashboard-grid-five .metric-label,
.dashboard-grid .metric-label {
  font-size: .82rem;
  line-height: 1.25;
}

.dashboard-grid-five .metric-note,
.dashboard-grid .metric-note {
  margin-top: 5px;
  font-size: .84rem;
  line-height: 1.4;
}

.table-wrap table {
  font-size: .95rem;
}

.table-wrap th {
  padding: 14px 16px;
  font-size: .78rem;
  line-height: 1.25;
}

.table-wrap td {
  padding: 16px;
  line-height: 1.45;
}

.admin-listing-cell {
  min-width: 300px;
  gap: 14px;
}

.admin-thumb {
  width: 66px;
  height: 66px;
  border-radius: 12px;
}

.admin-thumb-placeholder {
  font-size: .75rem;
  line-height: 1.15;
  text-align: center;
}

.admin-listing-title {
  display: inline-block;
  font-size: 1.02rem;
  line-height: 1.3;
}

.admin-listing-cell .muted {
  display: inline-block;
  margin-top: 3px;
  font-size: .88rem;
  line-height: 1.35;
}

.admin-actions {
  gap: 8px;
}

.admin-actions .btn-small {
  min-height: 40px;
  padding: 9px 13px;
  font-size: .9rem;
}

.table-wrap .badge {
  padding: 7px 10px;
  font-size: .8rem;
}

@media (max-width: 620px) {
  .dashboard-grid-five .metric-card,
  .dashboard-grid .metric-card {
    padding: 15px;
  }

  .dashboard-grid-five .metric-label,
  .dashboard-grid .metric-label {
    font-size: .76rem;
  }

  .dashboard-grid-five .metric-note,
  .dashboard-grid .metric-note {
    font-size: .79rem;
  }
}
