:root {
  color-scheme: light;
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-2: #f0f3ef;
  --ink: #16201c;
  --muted: #63706a;
  --line: #dfe5df;
  --brand: #0f766e;
  --brand-2: #155e75;
  --accent: #b7791f;
  --danger: #b42318;
  --ok: #267344;
  --shadow: 0 18px 50px rgba(22, 32, 28, .08);
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111513;
  --panel: #1a201d;
  --panel-2: #222b27;
  --ink: #eef4ef;
  --muted: #a6b2ab;
  --line: #303a35;
  --brand: #2dd4bf;
  --brand-2: #67e8f9;
  --accent: #f7c873;
  --danger: #ff867c;
  --ok: #74d99f;
  --shadow: 0 18px 50px rgba(0, 0, 0, .24);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.45;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

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

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 16px;
  background: #15211d;
  color: #f7fbf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: #2dd4bf;
  color: #09201c;
  font-weight: 900;
}

.brand strong {
  display: block;
  font-size: 18px;
}

.brand span {
  color: #bed0c8;
  font-size: 12px;
}

.brand.compact {
  margin-bottom: 0;
}

.brand.compact span {
  color: var(--muted);
}

.nav {
  display: grid;
  gap: 6px;
}

.nav button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  color: #d9e7df;
  background: transparent;
  text-align: left;
}

.nav button.active,
.nav button:hover {
  background: rgba(45, 212, 191, .14);
  color: #ffffff;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.topbar h1 {
  margin: 0;
  font-size: 20px;
}

.topbar p {
  margin: 2px 0 0;
  color: var(--muted);
}

.actions,
.row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.content {
  padding: 24px;
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.editor-panel {
  border-color: color-mix(in srgb, var(--brand) 28%, var(--line));
}

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

.panel-head h2,
.panel-head h3 {
  margin: 0;
  font-size: 16px;
}

.panel-body {
  padding: 18px;
}

.grid {
  display: grid;
  gap: 14px;
}

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

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

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

.metric {
  min-height: 112px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.metric em {
  display: block;
  margin-top: 8px;
  color: var(--brand);
  font-style: normal;
  font-size: 12px;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--panel-2);
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.status.good {
  color: #0f5132;
  background: #dff5e7;
}

.status.warn {
  color: #694500;
  background: #fff1c2;
}

.status.bad {
  color: #7a271a;
  background: #ffe2df;
}

.btn {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: var(--panel);
  font-weight: 700;
}

.btn.primary {
  border-color: var(--brand);
  color: #ffffff;
  background: var(--brand);
}

.btn.ghost {
  background: transparent;
}

.btn.danger {
  color: #ffffff;
  border-color: var(--danger);
  background: var(--danger);
}

.btn.small {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  color: var(--ink);
  background: var(--panel);
}

textarea {
  min-height: 96px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.checkline {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: end;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.checkline input {
  width: auto;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.segmented button {
  border: 0;
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.segmented button.active {
  color: #ffffff;
  background: var(--brand-2);
}

.chart {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  grid-template-columns: 120px minmax(120px, 1fr) 80px;
  align-items: center;
  gap: 10px;
}

.bar {
  height: 12px;
  border-radius: 999px;
  background: var(--panel-2);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.profile {
  display: flex;
  gap: 14px;
}

.avatar {
  flex: 0 0 auto;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  color: #09201c;
  background: #8ee8d9;
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

.notice {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

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

.record-head h3 {
  margin: 0;
}

.compact-actions {
  justify-content: flex-end;
  gap: 6px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, .6fr);
  gap: 18px;
}

.empty {
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 5;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 8px;
  color: #ffffff;
  background: #15211d;
  box-shadow: var(--shadow);
}

.welcome-page,
.auth-page,
.tenant-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 18%, rgba(15, 118, 110, .16), transparent 28%),
    linear-gradient(135deg, #f7f8f5 0%, #eef4f1 48%, #f7f2e8 100%);
  color: var(--ink);
}

[data-theme="dark"].welcome-page,
[data-theme="dark"].auth-page,
[data-theme="dark"].tenant-shell {
  background:
    radial-gradient(circle at 78% 18%, rgba(45, 212, 191, .15), transparent 28%),
    linear-gradient(135deg, #101513 0%, #17201c 52%, #211f18 100%);
}

.welcome-nav,
.tenant-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
}

.welcome-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  align-items: center;
  gap: 34px;
  min-height: calc(100vh - 86px);
  padding: 30px clamp(24px, 6vw, 84px) 70px;
}

.hero-copy h1,
.tenant-hero-band h1 {
  margin: 8px 0 14px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .95;
}

.hero-copy p,
.tenant-hero-band p {
  max-width: 660px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

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

.hero-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hero-card,
.auth-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-card {
  min-height: 138px;
  padding: 20px;
}

.hero-card.wide {
  grid-column: 1 / -1;
}

.hero-card span {
  color: var(--muted);
  font-weight: 700;
}

.hero-card strong {
  display: block;
  margin-top: 16px;
  font-size: 28px;
}

.accent-card {
  background: #15342f;
  color: #ffffff;
}

.accent-card span {
  color: #b8e8df;
}

.auth-page {
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(460px, 100%);
  display: grid;
  gap: 18px;
  padding: 24px;
}

.link-button {
  border: 0;
  padding: 0;
  color: var(--brand);
  background: transparent;
  font-weight: 900;
}

.tenant-topbar {
  position: sticky;
  top: 0;
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 78%, transparent);
  backdrop-filter: blur(18px);
}

.tenant-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: auto;
}

.tenant-tabs button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  white-space: nowrap;
}

.tenant-tabs button.active,
.tenant-tabs button:hover {
  color: #ffffff;
  background: var(--brand);
}

.tenant-hero-band {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 5vw, 54px);
  border-bottom: 1px solid var(--line);
}

.tenant-content {
  display: grid;
  gap: 18px;
  padding: 24px clamp(18px, 5vw, 54px) 54px;
}

@media (max-width: 1040px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav {
    grid-template-columns: repeat(4, minmax(120px, 1fr));
  }

  .grid.cols-4,
  .grid.cols-3,
  .split,
  .welcome-hero {
    grid-template-columns: 1fr 1fr;
  }

  .tenant-topbar,
  .tenant-hero-band {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .topbar,
  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .content {
    padding: 16px;
  }

  .nav,
  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2,
  .split,
  .welcome-hero,
  .hero-board {
    grid-template-columns: 1fr;
  }

  .welcome-nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .bar-row {
    grid-template-columns: 88px 1fr 56px;
  }
}

/* Components added for uploads, charts, messaging, and admin tools. */
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 60%, transparent);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: .6;
  cursor: progress;
}

a.btn {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

a {
  color: var(--brand);
}

.nav button .count,
.tenant-tabs button .count {
  margin-left: auto;
  min-width: 22px;
  padding: 1px 7px;
  border-radius: 999px;
  color: #09201c;
  background: #2dd4bf;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.tenant-tabs button .count {
  margin-left: 6px;
}

.small {
  font-size: 12px;
}

.block {
  display: block;
  margin-top: 4px;
}

.pad {
  margin: 0;
  padding: 0 18px 16px;
}

.panel-body.flush {
  padding: 0;
}

.panel-body p:first-child,
.notice p:first-child {
  margin-top: 0;
}

.notice p:last-child {
  margin-bottom: 0;
}

.notice h3,
.panel-body h3 {
  margin: 6px 0 0;
  font-size: 14px;
}

.notice.unread {
  border-left: 4px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--panel));
}

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

.span-3 {
  grid-column: span 3;
}

.span-4 {
  grid-column: 1 / -1;
}

.row.end {
  align-self: end;
}

.grow {
  flex: 1 1 200px;
  width: auto;
}

.toolbar {
  display: flex;
  align-items: end;
  gap: 14px;
}

.toolbar .input {
  flex: 1;
}

.toolbar label,
label.inline {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

label.inline select {
  width: auto;
  min-width: 160px;
}

.metric.alert {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
}

.metric.alert strong {
  color: var(--danger);
}

.metric.attention {
  border-color: color-mix(in srgb, var(--accent) 60%, var(--line));
}

.metric em .status {
  margin-top: 2px;
}

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

.column-chart {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  height: 220px;
}

.column {
  display: grid;
  grid-template-rows: 18px 1fr 18px;
  height: 100%;
  gap: 4px;
  text-align: center;
}

.column-bar {
  display: flex;
  align-items: flex-end;
  border-radius: 6px;
  background: var(--panel-2);
  overflow: hidden;
}

.column-bar i {
  display: block;
  width: 100%;
  min-height: 2px;
  border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
}

.column:hover .column-bar i {
  background: var(--accent);
}

.column-value,
.column-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.bank-card {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px;
  border: 1px dashed color-mix(in srgb, var(--brand) 45%, var(--line));
  border-radius: 8px;
  background: color-mix(in srgb, var(--brand) 6%, var(--panel));
}

.bank-card strong {
  display: block;
  font-size: 16px;
}

.bank-card p {
  margin: 0;
}

.thread {
  display: grid;
  gap: 12px;
  max-height: 640px;
  overflow: auto;
}

.bubble {
  max-width: 85%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px;
  background: var(--panel-2);
}

.bubble.mine {
  justify-self: end;
  border-radius: 12px 12px 4px 12px;
  background: color-mix(in srgb, var(--brand) 12%, var(--panel));
}

.bubble p {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

img.avatar {
  object-fit: cover;
  padding: 0;
}

.avatar.large {
  width: 72px;
  height: 72px;
  font-size: 22px;
}

.toast.success {
  background: var(--ok);
}

.toast.error {
  background: var(--danger);
}

.auth-panel .back {
  justify-self: start;
}

.auth-panel p {
  margin: 0;
}

@media (max-width: 1040px) {
  .nav {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  .split.even {
    grid-template-columns: 1fr;
  }

  .span-3 {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .span-2,
  .span-3 {
    grid-column: auto;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .column-chart {
    gap: 3px;
  }

  .column-value {
    display: none;
  }

  .bubble {
    max-width: 100%;
  }

  /* Tables become stacked cards on phones. */
  table {
    min-width: 0;
  }

  thead {
    display: none;
  }

  tr {
    display: block;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
  }

  td {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    padding: 6px 0;
    border: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
  }

  td[data-label=""]::before {
    content: none;
  }

  td.empty {
    display: block;
  }

  .compact-actions {
    justify-content: flex-start;
  }
}

@media print {
  .sidebar,
  .topbar .actions,
  .no-print,
  .editor-panel,
  .toast,
  button {
    display: none !important;
  }

  .shell {
    display: block;
  }

  .panel,
  .metric {
    box-shadow: none;
    break-inside: avoid;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    min-width: 0;
  }
}

/* Public property website */
.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px clamp(16px, 5vw, 56px);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 90%, transparent);
  backdrop-filter: blur(16px);
}

.site-nav .brand {
  color: inherit;
  text-decoration: none;
}

.site-hero {
  padding: clamp(36px, 7vw, 88px) clamp(16px, 5vw, 56px) clamp(28px, 4vw, 48px);
  background:
    radial-gradient(circle at 85% 10%, rgba(45, 212, 191, .22), transparent 32%),
    linear-gradient(135deg, #0f2a25 0%, #15342f 55%, #2a2616 100%);
  color: #f4faf7;
}

.site-hero h1 {
  margin: 10px 0 12px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.02;
}

.site-hero p {
  max-width: 640px;
  margin: 0 0 28px;
  color: #c7dcd4;
  font-size: 17px;
}

.site-hero .eyebrow {
  color: #5eead4;
}

.search-bar {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) repeat(3, minmax(120px, 1fr)) auto;
  align-items: end;
  gap: 12px;
  max-width: 1100px;
  padding: 16px;
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
}

.search-bar .btn {
  min-height: 40px;
  padding-inline: 22px;
}

.site-main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px clamp(16px, 4vw, 40px) 56px;
}

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

.section-head h2 {
  margin: 0;
  font-size: 20px;
}

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 22px;
}

.listing-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: inherit;
  background: var(--panel);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}

.listing-card:hover,
.listing-card:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 24px 60px rgba(22, 32, 28, .16);
}

.card-photo {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--panel-2);
}

.card-photo img,
.card-photo .photo-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1d4d45, #0f766e 55%, #b7791f);
  color: rgba(255, 255, 255, .85);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: .04em;
}

.photo-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, .6);
  font-size: 12px;
  font-weight: 700;
}

.card-body {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.card-body h3 {
  margin: 0;
  font-size: 17px;
}

.card-body p {
  margin: 0;
}

.price {
  color: var(--brand);
  font-size: 22px;
  font-weight: 900;
}

.price small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.price.large {
  margin: 10px 0 18px;
  font-size: 30px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0;
}

.chips span {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  font-size: 12px;
  font-weight: 700;
}

.how-it-works {
  margin-top: 56px;
}

.how-it-works h2 {
  margin: 0 0 16px;
}

.step {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}

.step span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.step p {
  margin: 0;
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 28px clamp(16px, 5vw, 56px);
  border-top: 1px solid var(--line);
  background: var(--panel);
}

.site-footer p {
  margin: 4px 0 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 14px;
  font-weight: 700;
  text-decoration: none;
}

.gallery {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
}

.gallery-main {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  aspect-ratio: 16 / 9;
  max-height: 560px;
  background: var(--panel-2);
}

.gallery-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .5);
  font-size: 28px;
  line-height: 1;
  transform: translateY(-50%);
}

.gallery-nav:hover {
  background: rgba(0, 0, 0, .75);
}

.gallery-nav.prev {
  left: 14px;
}

.gallery-nav.next {
  right: 14px;
}

.thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.thumb {
  flex: 0 0 96px;
  height: 68px;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 8px;
  background: none;
  opacity: .7;
}

.thumb.active,
.thumb:hover {
  border-color: var(--brand);
  opacity: 1;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  align-items: start;
  gap: 32px;
}

.detail-main h1 {
  margin: 6px 0;
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.1;
}

.detail-main h2 {
  margin: 30px 0 12px;
  font-size: 19px;
}

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

.fact-grid div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
}

.fact-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.fact-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
}

.description {
  font-size: 15px;
  line-height: 1.7;
}

.amenity-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.amenity-list li {
  position: relative;
  padding-left: 26px;
}

.amenity-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand);
  font-size: 11px;
  font-weight: 900;
}

.apply-card {
  position: sticky;
  top: 90px;
  display: grid;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.apply-card p {
  margin: 0;
}

.apply-card h3 {
  margin: 4px 0 0;
}

.btn.large {
  min-height: 46px;
  font-size: 15px;
}

.apply-success {
  display: grid;
  gap: 10px;
  padding: 16px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ok) 14%, var(--panel));
}

.apply-success p {
  margin: 0;
}

.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Layout fixes: grid children may shrink, so wide tables scroll inside their panel instead of widening the page. */
.content > *,
.tenant-content > *,
.grid > *,
.split > * {
  min-width: 0;
}

.split {
  align-items: start;
}

.card-photo {
  overflow: hidden;
}

.card-photo img,
.card-photo .photo-placeholder {
  position: absolute;
  inset: 0;
}

.gallery-main {
  width: 100%;
  aspect-ratio: auto;
  height: clamp(260px, 52vw, 560px);
}

.gallery-nav {
  color: #16201c;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

.gallery-nav:hover {
  background: #fff;
}

.tenant-topbar > *,
.tenant-hero-band > * {
  min-width: 0;
  max-width: 100%;
}

.tenant-tabs {
  max-width: 100%;
  scrollbar-width: none;
}

.footer-contact {
  display: grid;
  gap: 6px;
  justify-items: end;
  text-align: right;
}

.footer-contact a {
  font-weight: 700;
}

.contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.contact-row .btn {
  flex: 1 1 auto;
  justify-content: center;
}

.btn.whatsapp {
  border-color: #1fa855;
  color: #fff;
  background: #1fa855;
}

.setup-panel {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checklist li > span:nth-child(2) {
  flex: 1;
}

.checklist .check {
  display: grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.checklist li.done .check {
  border-color: var(--ok);
  background: var(--ok);
}

.checklist li.done > span:nth-child(2) {
  color: var(--muted);
  text-decoration: line-through;
}

.inline-option {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 600;
}

.inline-option input {
  width: auto;
}

@media (max-width: 720px) {
  .site-nav .hide-mobile {
    display: none;
  }

  .site-nav {
    flex-wrap: nowrap;
    gap: 10px;
    padding: 10px 16px;
  }

  .site-nav .brand strong {
    white-space: nowrap;
    font-size: 16px;
  }

  .site-nav .brand span {
    display: none;
  }

  .site-nav .actions {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .site-nav .btn {
    padding: 7px 12px;
    font-size: 13px;
    white-space: nowrap;
  }

  /* The theme toggle becomes an icon button on phones. */
  .site-nav [data-theme-toggle],
  .tenant-topbar [data-theme-toggle] {
    width: 38px;
    padding: 0;
    font-size: 0;
  }

  .site-nav [data-theme-toggle]::before,
  .tenant-topbar [data-theme-toggle]::before {
    content: "\263E";
    font-size: 17px;
  }

  .footer-contact {
    justify-items: start;
    text-align: left;
  }

  .tenant-topbar {
    gap: 10px;
    padding: 12px 16px;
  }

  .tenant-tabs {
    width: 100%;
  }

  .tenant-hero-band h1 {
    font-size: 36px;
  }

  /* Show every other month label so they don't collide on narrow screens. */
  .column:nth-child(even) .column-label {
    visibility: hidden;
  }

  .column-chart {
    height: 160px;
  }
}

/* Admin listing editor */
.listing-fields {
  display: grid;
  gap: 14px;
  margin: 6px 0 0;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: 10px;
}

.listing-fields legend {
  padding: 0 6px;
  color: var(--brand);
  font-weight: 800;
}

.amenity-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.amenity-picker .checkline {
  color: var(--ink);
  font-weight: 600;
}

.photo-manager {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.photo-tile {
  gap: 6px;
  color: var(--ink);
}

.photo-tile img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 8px;
  object-fit: cover;
}

.photo-tile span {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 1040px) {
  .search-bar {
    grid-template-columns: 1fr 1fr;
  }

  .search-bar label:first-child {
    grid-column: 1 / -1;
  }

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

  .apply-card {
    position: static;
  }
}

@media (max-width: 720px) {
  .search-bar {
    grid-template-columns: 1fr;
  }

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

  .amenity-list {
    grid-template-columns: 1fr;
  }

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