:root {
  --bg: #f4f7fc;
  --surface: #ffffff;
  --surface-soft: #eef2fc;
  --line: rgba(27, 39, 64, 0.1);
  --ink: #1b2740;
  --ink-soft: #63728e;
  --primary: #6658c8;
  --primary-deep: #5146ab;
  --primary-soft: rgba(102, 88, 200, 0.12);
  --market: #395e8d;
  --discount: #3fbf73;
  --discount-deep: #167145;
  --shadow: 0 22px 54px rgba(32, 49, 89, 0.12);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --shell: 1320px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Assistant", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(102, 88, 200, 0.12), transparent 26%),
    linear-gradient(180deg, #fbfcff 0%, #f1f5fc 100%);
  color: var(--ink);
}

a {
  color: inherit;
}

body.sharbat-inventory-board-body {
  background:
    radial-gradient(circle at top right, rgba(102, 88, 200, 0.12), transparent 26%),
    linear-gradient(180deg, #fbfcff 0%, #f1f5fc 100%);
}

.inventory-page-board .inventory-hero {
  min-height: 0;
  padding: 20px 0 14px;
}

.inventory-page-board .hero-shell {
  padding-top: 0;
}

.inventory-page-board .topbar {
  margin-bottom: 0;
}

.template-page {
  width: min(calc(100% - 48px), var(--shell));
  margin: 0 auto;
  padding: 26px 0 40px;
}

.template-hero,
.template-controls,
.template-results,
.summary-tile,
.floor-band,
.board-floor,
.timeline-card,
.ledger-floor {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.template-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 20px;
  padding: 30px;
  background:
    linear-gradient(145deg, rgba(19, 31, 63, 0.96), rgba(81, 70, 171, 0.9)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent);
  color: #fffdf8;
}

.template-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.84rem;
  font-weight: 800;
}

.template-hero h1 {
  margin: 14px 0 0;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 1;
}

.template-hero p {
  max-width: 52ch;
  margin: 14px 0 0;
  color: rgba(255, 253, 248, 0.82);
  font-size: 1.04rem;
  line-height: 1.7;
}

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

.summary-tile {
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.summary-tile strong,
.unit-price {
  display: block;
  font-size: 1.2rem;
  line-height: 1.2;
}

.summary-tile span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 253, 248, 0.76);
}

.template-controls,
.template-results {
  margin-top: 20px;
  padding: 24px;
}

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

.filter-control {
  display: grid;
  gap: 8px;
}

.filter-control span {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

.filter-control select {
  width: 100%;
  min-height: 54px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--ink);
  font: inherit;
}

.results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.results-head h2 {
  margin: 0;
  font-size: 1.9rem;
}

.results-badge {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-deep);
  font-weight: 800;
}

#results-root {
  margin-top: 20px;
}

.program-chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
}

.program-chip.discount {
  background: linear-gradient(135deg, var(--discount) 0%, var(--discount-deep) 100%);
  color: #fff;
}

.program-chip.market {
  background: var(--market);
  color: #fff;
}

.status-chip.available {
  background: rgba(63, 191, 115, 0.15);
  color: var(--discount-deep);
}

.status-chip.sold {
  background: rgba(119, 129, 149, 0.18);
  color: #566278;
}

.plan-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.plan-link,
.plan-link:visited,
.plan-link:hover,
.plan-link:focus-visible {
  color: #fff !important;
}

.empty-state {
  padding: 32px 20px;
  border-radius: 22px;
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--ink-soft);
}

.is-sold {
  opacity: 0.82;
}

.editorial-stack,
.board-stack,
.ledger-stack {
  display: grid;
  gap: 18px;
}

.floor-band,
.board-floor,
.ledger-floor {
  overflow: hidden;
}

.floor-band-head,
.board-floor-head,
.ledger-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
}

.floor-index,
.board-floor-head h3,
.ledger-head h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
}

.editorial-list {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.editorial-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(180deg, #fff 0%, #f6f8ff 100%);
}

.editorial-top,
.editorial-bottom,
.board-tags,
.timeline-card-top,
.timeline-actions,
.ledger-row,
.ledger-side {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.editorial-top h3,
.board-card h4,
.timeline-card h4 {
  margin: 10px 0 0;
  font-size: 1.55rem;
}

.editorial-top p,
.board-type {
  margin: 6px 0 0;
  color: var(--ink-soft);
}

.editorial-side {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.unit-inline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.unit-inline-meta span,
.detail-pair,
.board-metrics span,
.timeline-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 700;
}

.detail-pair {
  gap: 8px;
}

.detail-pair span {
  padding: 0;
  min-height: auto;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(var(--board-card-count, 1), minmax(0, 1fr));
  gap: 20px;
  padding: 26px;
  align-items: stretch;
}

.board-card {
  display: grid;
  gap: 16px;
  padding: 24px 22px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
  align-content: start;
  height: 100%;
  box-shadow:
    0 12px 32px rgba(35, 53, 96, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.board-tags {
  align-items: center;
}

.board-card h4,
.board-type {
  text-align: center;
}

.board-card h4 {
  margin: 6px 0 0;
  font-size: 1.42rem;
  font-weight: 800;
}

.board-type {
  margin: -4px 0 0;
  font-size: 0.88rem;
}

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

.metric-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 999px;
  background: #edf2fd;
  color: #17305d;
  text-align: center;
}

.metric-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  min-width: 0;
  width: 100%;
}

.metric-copy strong {
  font-size: 1.08rem;
  line-height: 1;
  white-space: nowrap;
}

.metric-copy small {
  color: #17305d;
  font-size: 1.02rem;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.board-actions {
  display: grid;
  gap: 12px;
  margin-top: auto;
  justify-items: stretch;
}

.board-price-inline {
  display: grid;
  gap: 6px;
  min-height: auto;
  padding: 0;
  background: transparent;
  text-align: center;
  justify-items: center;
}

.board-price-label {
  color: var(--ink-soft);
  font-size: 0.92rem;
  font-weight: 700;
}

body[data-template="board"] .unit-price {
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.1;
  text-align: center;
}

body[data-template="board"] .board-sold-note {
  display: grid;
  place-items: center;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 999px;
  background: rgba(196, 73, 73, 0.12);
  color: #a63f3f;
  font-size: 1rem;
  font-weight: 800;
  text-align: center;
}

body[data-template="board"] .plan-link {
  width: 100%;
  min-height: 50px;
  border-radius: 999px;
  background: linear-gradient(135deg, #6a58cf 0%, #5446b7 100%);
  font-size: 0.98rem;
  font-weight: 800;
}

body[data-template="board"] .board-floor {
  border-radius: 36px;
}

body[data-template="board"] .board-floor-head {
  padding: 24px 32px;
  background: linear-gradient(90deg, #6b59d0 0%, #5446b7 100%);
}

body[data-template="board"] .board-floor-head h3,
body[data-template="board"] .board-floor-head span {
  font-size: 1rem;
}

body[data-template="board"] .board-floor-head h3 {
  font-size: 1.2rem;
}

body[data-template="board"] .program-chip,
body[data-template="board"] .status-chip {
  min-height: 46px;
  padding: 0 18px;
  font-size: 0.95rem;
  white-space: nowrap;
}

body[data-template="board"] .program-chip.market {
  background: #3f6799;
}

body[data-template="board"] .program-chip.discount {
  background: linear-gradient(135deg, #33b068 0%, #249357 100%);
}

body[data-template="board"] .status-chip.available {
  background: #dff4e9;
  color: #2d8b58;
}

body[data-template="board"] .status-chip.sold {
  background: #fde8e8;
  color: #a63f3f;
}

body[data-template="board"] .board-card.is-sold {
  border-color: rgba(196, 73, 73, 0.22);
  background: linear-gradient(180deg, #fff7f7 0%, #fff1f1 100%);
  box-shadow:
    0 12px 28px rgba(166, 63, 63, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

body[data-template="board"] .board-card.is-sold h4,
body[data-template="board"] .board-card.is-sold .board-type {
  color: #7b3535;
}

.timeline-shell {
  position: relative;
  display: grid;
  gap: 20px;
  padding-inline-start: 22px;
}

.timeline-shell::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  inset-inline-start: 28px;
  width: 2px;
  background: linear-gradient(180deg, var(--primary), rgba(102, 88, 200, 0.12));
}

.timeline-floor {
  position: relative;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
}

.timeline-marker {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
}

.timeline-marker span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-deep) 100%);
  color: #fff;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(81, 70, 171, 0.22);
}

.timeline-body {
  display: grid;
  gap: 12px;
}

.timeline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.timeline-head h3 {
  margin: 0;
  font-size: 1.5rem;
}

.timeline-head span {
  color: var(--ink-soft);
  font-weight: 700;
}

.timeline-cards {
  display: grid;
  gap: 12px;
}

.timeline-card {
  padding: 18px;
}

.timeline-card-top,
.timeline-actions {
  align-items: flex-start;
}

.timeline-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.timeline-row.secondary span {
  background: rgba(57, 94, 141, 0.08);
}

.ledger-list {
  display: grid;
}

.ledger-row {
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}

.ledger-row:first-child {
  border-top: 0;
}

.ledger-main {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.ledger-main span {
  color: var(--ink-soft);
  font-weight: 700;
}

.ledger-side {
  flex-wrap: wrap;
  justify-content: flex-end;
}

body[data-template="board"] .template-hero {
  background:
    linear-gradient(145deg, rgba(19, 31, 63, 0.94), rgba(57, 94, 141, 0.92)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}

body[data-template="timeline"] .template-hero {
  background:
    linear-gradient(145deg, rgba(19, 31, 63, 0.96), rgba(63, 191, 115, 0.42)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}

body[data-template="ledger"] .template-hero {
  background:
    linear-gradient(145deg, rgba(19, 31, 63, 0.96), rgba(81, 70, 171, 0.74)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}

@media (max-width: 1080px) {
  .template-hero,
  .filters-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  body[data-template="board"] .board-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .inventory-page-board .inventory-hero {
    padding: 14px 0 8px;
  }

  .inventory-page-board .hero-shell {
    width: min(calc(100% - 56px), var(--shell));
  }

  .inventory-page-board .topbar {
    width: 100%;
  }

  .inventory-page-board .drawer-panel {
    display: grid !important;
    grid-template-columns: 1fr !important;
    align-content: start !important;
    align-items: start !important;
  }

  .inventory-page-board .drawer-top,
  .inventory-page-board .drawer-links,
  .inventory-page-board .nav-cta {
    width: 100% !important;
  }

  .inventory-page-board .drawer-links {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
  }

  .inventory-page-board .drawer-top {
    justify-content: flex-start !important;
  }

  .inventory-page-board .nav-cta {
    justify-self: stretch !important;
    align-self: stretch !important;
  }

  .inventory-page-board .brand-mark {
    width: 68px;
    height: 68px;
  }

  .inventory-page-board .brand-mark img {
    width: 42px;
    height: 42px;
  }

  .inventory-page-board .mobile-menu-toggle {
    width: 44px;
    height: 44px;
  }

  .inventory-page-board .topbar .main-nav a {
    font-size: 17.68px;
  }

  .template-page {
    width: min(calc(100% - 24px), var(--shell));
    padding-top: 20px;
  }

  .template-hero,
  .template-summary,
  .filters-grid {
    grid-template-columns: 1fr;
  }

  .template-hero,
  .template-controls,
  .template-results {
    padding: 20px;
  }

  body[data-template="board"] .board-grid {
    grid-template-columns: 1fr;
  }

  .results-head,
  .floor-band-head,
  .board-floor-head,
  .ledger-head,
  .editorial-top,
  .editorial-bottom,
  .timeline-card-top,
  .timeline-actions,
  .ledger-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .timeline-floor {
    grid-template-columns: 1fr;
  }

  .timeline-shell {
    padding-inline-start: 0;
  }

  .timeline-shell::before {
    display: none;
  }

  .timeline-marker {
    justify-content: flex-start;
  }
}
