:root {
  color-scheme: light;
  --bg: #f7f8f7;
  --text: #121827;
  --muted: #64716e;
  --line: #e2e7e4;
  --panel: #ffffff;
  --accent: #0f7a62;
  --accent-dark: #0b5c4a;
  --accent-soft: #e7f3ee;
  --sold: #a23b3b;
  --available: #147a48;
  --shadow: 0 16px 36px rgba(18, 24, 39, 0.07);
}

/* Lifecycle, favorites, activity log and exchange-rate reliability */
.project-lifecycle {
  align-items: center;
  background: var(--theme-success-soft, #e7f4ee);
  border: 1px solid var(--theme-success-line, #c9e4d8);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  min-height: 24px;
  padding: 5px 8px;
  white-space: nowrap;
}

.project-lifecycle.lifecycle-paused {
  background: var(--theme-warning-soft, #fff5e6);
  border-color: var(--theme-warning-line, #f2d4a5);
  color: var(--theme-warning-text, #8a5200);
}

.project-lifecycle.lifecycle-sold_out {
  background: var(--theme-info-soft, #eef3ff);
  border-color: var(--theme-info-line, #cfdcf7);
  color: var(--theme-info-text, #315c9e);
}

.project-lifecycle.lifecycle-archived {
  background: var(--theme-subtle, #f1f3f2);
  border-color: var(--theme-line, #d8ddda);
  color: var(--theme-muted, #66716c);
}

.project-ownership-badge {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  line-height: 1;
  min-height: 28px;
  padding: 6px 10px;
  white-space: nowrap;
}

.project-ownership-badge::before {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 6px;
  opacity: .72;
  width: 6px;
}

.project-ownership-badge.ownership-leasehold {
  background: var(--theme-warning-soft, #fff1df);
  border-color: var(--theme-warning-line, #edc995);
  color: var(--theme-warning-text, #9a5700);
}

.project-ownership-badge-small {
  font-size: 10px;
  min-height: 22px;
  padding: 4px 7px;
}

.project-feature-badge {
  align-items: center;
  background: var(--theme-success-soft, #eaf7f2);
  border: 1px solid var(--theme-success-line, #b9dccf);
  border-radius: 999px;
  color: var(--theme-success-text, #17644f);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 850;
  gap: 6px;
  line-height: 1;
  min-height: 28px;
  padding: 6px 10px;
  white-space: nowrap;
}

.project-feature-badge[hidden],
.project-ownership-badge[hidden] {
  display: none;
}

.project-feature-badge::before {
  background: currentColor;
  border-radius: 50% 50% 45% 45%;
  box-shadow: -4px -3px 0 -1px currentColor, 0 -5px 0 -1px currentColor, 4px -3px 0 -1px currentColor;
  content: "";
  height: 6px;
  opacity: .78;
  width: 7px;
}

.project-feature-badge-small {
  font-size: 10px;
  min-height: 22px;
  padding: 4px 7px;
}

.project-feature-badge-table {
  gap: 0;
  height: 20px;
  justify-content: center;
  min-height: 18px;
  padding: 3px;
  width: 20px;
}

.project-feature-badge-table::before {
  height: 4px;
  transform: translateY(2px);
  width: 5px;
}

.project-card-title-row {
  align-items: flex-start;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.project-card-title-row h3 {
  min-width: 0;
}

.project-card-heading {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.unit-room-cell {
  white-space: nowrap;
}

.unit-room-content {
  align-items: center;
  display: inline-flex;
  gap: 7px;
}

.unit-room-heading .sort-link {
  margin-inline-start: 65px;
}

.unit-favorite-form {
  display: inline-flex;
  flex: 0 0 auto;
  margin: 0;
}

.favorite-button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--theme-muted, #8a948f);
  cursor: pointer;
  display: inline-flex;
  flex: 0 0 auto;
  height: 30px;
  justify-content: center;
  padding: 5px;
  transition: background-color .15s ease, color .15s ease;
  width: 30px;
}

.favorite-button:hover {
  background: var(--theme-warning-soft, #fff7df);
  color: var(--theme-warning-text, #a36b00);
}

.favorite-button.is-active {
  color: var(--theme-warning-text, #b87b00);
}

.favorite-button.is-active .ui-icon {
  fill: #f1bd42;
}

.favorite-button:disabled {
  cursor: wait;
  opacity: .55;
}

.favorite-button-labeled {
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  gap: 7px;
  height: 34px;
  padding: 6px 10px;
  width: auto;
}

.favorite-button-labeled.is-active {
  background: var(--theme-warning-soft, #fff9e9);
  border-color: var(--theme-warning-line, #e6ca82);
  color: var(--theme-warning-text, #805500);
}

.favorite-filter-button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 750;
  gap: 7px;
  min-height: 40px;
  padding: 8px 11px;
  text-decoration: none;
}

.favorite-filter-button:hover,
.favorite-filter-button.is-active {
  background: var(--theme-warning-soft, #fff9e9);
  border-color: var(--theme-warning-text, #e2c46e);
  color: var(--theme-warning-text, #805500);
}

.favorite-filter-button.is-active .ui-icon {
  fill: #f1bd42;
}

.favorites-title-count {
  align-items: center;
  background: var(--theme-warning-soft, #fff7df);
  border: 1px solid var(--theme-warning-line, #ecd28d);
  border-radius: 999px;
  color: var(--theme-warning-text, #805500);
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  height: 26px;
  justify-content: center;
  margin-left: 7px;
  min-width: 26px;
  padding: 0 8px;
  vertical-align: middle;
}

.favorites-empty-state {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  margin-top: 8px;
  padding: 54px 24px;
  text-align: center;
}

.favorites-empty-state[hidden] {
  display: none;
}

.favorites-empty-icon {
  align-items: center;
  background: var(--theme-warning-soft, #fff7df);
  border: 1px solid var(--theme-warning-line, #ecd28d);
  border-radius: 50%;
  color: var(--theme-warning-text, #a36b00);
  display: inline-flex;
  height: 52px;
  justify-content: center;
  margin-bottom: 16px;
  width: 52px;
}

.favorites-empty-icon .ui-icon {
  fill: #f1bd42;
  height: 24px;
  width: 24px;
}

.favorites-empty-state h2 {
  font-size: 19px;
  margin: 0 0 7px;
}

.favorites-empty-state p {
  color: var(--muted);
  margin: 0 0 18px;
}

.fx-rates {
  align-items: stretch;
  display: grid;
  gap: 3px;
  justify-items: end;
}

.fx-rate-values {
  display: flex;
  gap: 6px;
}

.fx-rate-freshness {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 10px;
  gap: 4px;
  line-height: 1;
  min-height: 11px;
  padding-right: 4px;
}

.fx-rate-freshness .ui-icon {
  height: 11px;
  width: 11px;
}

.fx-rates.is-degraded .fx-rate-freshness {
  color: var(--warning);
  font-weight: 750;
}

.system-activity-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(0, 180px));
  margin-bottom: 14px;
}

.system-activity-summary article {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 82px;
  padding: 13px 14px;
}

.system-activity-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.system-activity-summary strong {
  font-size: 24px;
}

.system-activity-summary article.is-filtered {
  background: var(--accent-soft);
  border-color: var(--theme-success-line, #c7e2d7);
}

.system-activity-filters {
  align-items: end;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(240px, 1.45fr) repeat(3, minmax(155px, 1fr));
  margin-bottom: 14px;
  padding: 12px;
}

.system-activity-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.system-activity-filters label > span {
  color: var(--muted);
  font-size: 11px;
}

.system-activity-filter-actions {
  display: flex;
  gap: 8px;
}

.system-activity-day {
  background: var(--theme-subtle, #f5f7f6);
  border-bottom: 1px solid var(--line);
  color: var(--theme-muted, #53605b);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0;
  padding: 9px 14px;
  text-transform: uppercase;
}

.system-activity-list {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.system-activity-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 48px 32px minmax(0, 1fr) minmax(130px, 180px);
  min-height: 68px;
  padding: 10px 14px;
}

.system-activity-item:last-child {
  border-bottom: 0;
}

.system-activity-item > time {
  color: var(--muted);
  display: grid;
  font-size: 11px;
  justify-items: start;
}

.system-activity-item > time strong {
  color: var(--text);
  font-size: 12px;
}

.system-activity-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 6px;
  color: var(--theme-success-text, var(--accent));
  display: inline-flex;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.system-activity-icon .ui-icon {
  height: 16px;
  width: 16px;
}

.system-activity-item.tone-inventory .system-activity-icon {
  background: var(--theme-info-soft, #edf3ff);
  color: var(--theme-info-text, #315c9e);
}

.system-activity-item.tone-operations .system-activity-icon {
  background: var(--theme-warning-soft, #fff3df);
  color: var(--theme-warning-text, #945900);
}

.system-activity-item.tone-content .system-activity-icon {
  background: var(--theme-subtle, #f3eff8);
  color: var(--theme-purple-text, #70508b);
}

.system-activity-item.tone-administration .system-activity-icon {
  background: var(--theme-subtle, #eff2f1);
  color: var(--theme-muted, #52615c);
}

.system-activity-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.system-activity-copy > div {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.system-activity-copy strong {
  font-size: 13px;
}

.system-activity-copy a,
.system-activity-copy > div > span {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 13px;
  font-weight: 750;
  min-width: 0;
  overflow-wrap: anywhere;
  text-decoration: none;
}

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

.system-activity-category {
  background: var(--theme-subtle, #f2f5f4);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 4px 6px;
  white-space: nowrap;
}

.system-activity-actor {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.system-activity-actor .avatar {
  height: 28px;
  width: 28px;
}

.system-activity-actor strong {
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1250px) and (min-width: 901px) {
  .fx-rate-freshness {
    display: none;
  }

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

  .system-activity-filter-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 900px) {
  .system-activity-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .system-activity-filter-actions {
    grid-column: 1 / -1;
  }

  .system-activity-item {
    grid-template-columns: 48px 28px minmax(0, 1fr);
  }

  .system-activity-actor {
    display: none;
  }
}

@media (max-width: 620px) {
  .favorite-filter-button {
    flex: 1 1 auto;
    justify-content: center;
  }

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

  .system-activity-summary article {
    min-height: 70px;
    padding: 10px;
  }

  .system-activity-summary strong {
    font-size: 20px;
  }

  .system-activity-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .system-activity-filter-actions {
    display: grid;
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .system-activity-item {
    align-items: start;
    gap: 8px;
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 10px;
  }

  .system-activity-icon {
    display: none;
  }
}

* {
  box-sizing: border-box;
}

html {
  height: 100%;
  overflow-x: hidden;
}

/* The app owns its scroll containers; standalone login/print pages do not. */
html.app-document {
  overflow: hidden;
  /* Keep native horizontal history gestures and visual-viewport zoom/pan. */
  overscroll-behavior-x: auto;
  overscroll-behavior-y: none;
}

.app-document .app-shell,
.app-document .app-main {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
}

.app-document .app-main,
.app-document .sidebar {
  overscroll-behavior-x: auto;
  overscroll-behavior-y: none;
}

@media (min-width: 901px) {
  .app-document .sidebar {
    height: 100vh;
    height: 100dvh;
  }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  height: 100%;
  overflow: hidden;
}

.login-body {
  background:
    linear-gradient(135deg, rgba(15, 122, 98, 0.08), rgba(18, 24, 39, 0)),
    var(--bg);
  display: grid;
  min-height: 100vh;
  overflow: auto;
}

.login-shell {
  align-items: center;
  display: grid;
  justify-items: center;
  min-height: 100vh;
  padding: 24px;
}

.login-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 20px;
  max-width: 420px;
  padding: 26px;
  width: 100%;
}

.login-brand {
  padding: 0;
}

.login-card h1 {
  margin: 0 0 6px;
}

.login-card p {
  color: var(--muted);
  margin: 0;
}

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

.login-form .button {
  justify-content: center;
  width: 100%;
}

.login-welcome {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-items: center;
  text-align: center;
  gap: 4px;
}

.login-gecko { width: 110px; aspect-ratio: 180 / 140; pointer-events: none; }
.login-gecko > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gecko-head { transform-origin: 94px 95px; transform: rotate(var(--gecko-tilt, 0deg)); transition: transform 280ms ease; }
.gecko-pupils { transform: translate(var(--gecko-look-x, 0px), var(--gecko-look-y, 0px)); transition: transform 120ms ease-out; }
.gecko-eyes { transform-origin: 94px 54px; animation: gecko-blink 6.8s infinite; }
.gecko-hand { transition: opacity 180ms ease; }
.gecko-peek-hands { opacity: 0; transform: translateY(42px); transition: transform 280ms ease, opacity 180ms ease; }
.login-gecko[data-state="private"] .gecko-head { transform: translateY(3px) rotate(3deg); }
.login-gecko[data-state="private"] .gecko-eyes { animation: none; transform: scaleY(.8); }
.login-gecko[data-state="private"] .gecko-pupils { transform: translate(1px, 0); }
.login-gecko[data-state="private"] .gecko-peek-hands { opacity: 1; transform: translateY(0); }
.login-gecko[data-state="private"] .gecko-hand { opacity: 0; }
.login-gecko[data-state="password"] .gecko-head { transform: translateY(3px) rotate(-4deg); }

@keyframes gecko-blink {
  0%, 43%, 47%, 100% { transform: scaleY(1); }
  45% { transform: scaleY(.08); }
}

.login-password { position: relative; min-width: 0; }
.login-password input { width: 100%; }
.login-password.has-toggle input { padding-right: 48px; }
.login-password-toggle {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 36px;
  padding: 0;
  color: var(--theme-muted, #536d62);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}
.login-password-toggle:hover { color: var(--theme-success-text, #12664f); background: var(--theme-subtle, #edf5ef); }
.login-password-toggle:focus-visible { outline: 2px solid var(--theme-success-text, #16735b); outline-offset: 1px; }
.login-password-toggle[hidden], .login-password-toggle [hidden] { display: none !important; }

@media (max-width: 380px) {
  .login-shell { padding: 16px; }
  .login-card { padding: 20px; }
  .login-gecko { width: 96px; }
}

@media (prefers-reduced-motion: reduce) {
  .login-gecko * { animation: none !important; transition: none !important; }
}

a {
  color: inherit;
}

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

.sidebar {
  background: var(--theme-surface, #fff);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 18px;
  height: 100vh;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 14px;
  position: sticky;
  top: 0;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  min-height: 48px;
  padding: 0 8px;
  text-decoration: none;
}

.brand img {
  display: block;
  height: 38px;
  object-fit: contain;
  width: 38px;
}

.brand span {
  color: var(--text);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-nav-bottom {
  border-top: 1px solid var(--line);
  margin-top: auto;
  padding-top: 12px;
}

.side-nav-label {
  color: var(--theme-muted, #8c9994);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  margin: 10px 10px 2px;
  text-transform: uppercase;
}

.side-nav-label:first-child {
  margin-top: 0;
}

.side-nav-link {
  align-items: center;
  border-radius: 8px;
  color: var(--text);
  display: flex;
  font-size: 15px;
  font-weight: 700;
  gap: 12px;
  min-height: 44px;
  position: relative;
  padding: 10px 12px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.side-nav-link:hover {
  background: var(--theme-subtle, #f3f6f4);
  color: var(--theme-success-text, var(--accent-dark));
  transform: translateX(2px);
}

.side-nav-link:focus-visible {
  outline: 2px solid var(--theme-success-text, rgba(13, 118, 83, 0.25));
  outline-offset: 2px;
}

.side-nav-link.active {
  background: linear-gradient(90deg, var(--theme-success-soft, #dcefe7), var(--theme-subtle, #f3faf7));
  color: var(--theme-success-text, var(--accent-dark));
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-nav-link.active .nav-icon {
  background: rgba(13, 118, 83, 0.1);
}

.side-nav-link.disabled {
  color: var(--theme-muted, #909995);
  pointer-events: none;
}

.side-subnav {
  border-left: 1px solid var(--theme-line, #dfe7e3);
  display: grid;
  gap: 3px;
  margin: -2px 0 5px 24px;
  padding-left: 12px;
}

.side-subnav a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  padding: 7px 9px;
  text-decoration: none;
}

.side-subnav a:hover,
.side-subnav a.active {
  background: var(--theme-subtle, #eef7f3);
  color: var(--theme-success-text, var(--accent-dark));
}

.side-subnav-single {
  margin-bottom: 6px;
}

.nav-icon {
  align-items: center;
  color: currentColor;
  display: inline-flex;
  font-size: 18px;
  justify-content: center;
  line-height: 1;
  min-width: 28px;
  height: 28px;
  width: 28px;
  border-radius: 8px;
}

.app-main {
  height: 100vh;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
}

.topbar {
  align-items: center;
  background: var(--theme-surface, #ffffff);
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
  min-height: 78px;
  padding: 14px 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.global-search {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 26px rgba(18, 24, 39, 0.04);
  display: grid;
  flex: 1 1 340px;
  gap: 8px;
  grid-template-columns: auto minmax(160px, 1fr) auto;
  max-width: 540px;
  min-height: 44px;
  padding: 0 10px 0 16px;
  position: relative;
  width: 36vw;
}

.global-search > span {
  color: var(--muted);
  font-size: 18px;
}

.global-search input {
  border: 0;
  min-height: 38px;
  padding: 0;
}

.global-search input[type="hidden"] {
  display: none;
}

.global-search input:focus {
  outline: 0;
}

.global-search-results {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 22px 50px rgba(18, 24, 39, 0.16);
  left: 0;
  max-height: min(620px, calc(100vh - 110px));
  overflow: auto;
  padding: 8px;
  position: absolute;
  top: calc(100% + 9px);
  width: min(680px, calc(100vw - 48px));
  z-index: 120;
}

.global-search-results[hidden] {
  display: none;
}

.global-search-group + .global-search-group {
  border-top: 1px solid var(--line);
  margin-top: 7px;
  padding-top: 7px;
}

.global-search-group h3 {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0;
  padding: 7px 10px 6px;
  text-transform: uppercase;
}

.global-search-result {
  align-items: center;
  border-radius: 7px;
  display: grid;
  gap: 11px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 8px 10px;
  text-decoration: none;
}

.global-search-result:hover,
.global-search-result.active {
  background: var(--theme-subtle, #edf6f2);
}

.global-search-result-icon {
  align-items: center;
  align-self: center;
  background: var(--accent-soft);
  border-radius: 7px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  font-size: 15px;
  font-weight: 850;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.global-search-result.unit .global-search-result-icon {
  background: var(--theme-subtle, #f0f2f1);
  color: var(--theme-muted, #52605b);
}

.global-search-result-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.global-search-result-title {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.global-search-result-title strong {
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-result-title .status {
  flex: 0 0 auto;
  font-style: normal;
  padding: 2px 7px;
}

.global-search-result-body small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.global-search-result-body .global-search-result-details {
  color: var(--theme-text, #394641);
}

.global-search-result-price {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  padding-left: 10px;
  white-space: nowrap;
}

.global-search-loading,
.global-search-empty {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  padding: 18px 12px;
  text-align: center;
}

.global-search-all {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--theme-success-text, var(--accent-dark));
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
  margin-top: 7px;
  min-height: 40px;
  padding: 8px 10px 3px;
  text-decoration: none;
}

.global-search-all:hover {
  color: var(--theme-success-text, var(--accent));
}

kbd {
  background: var(--theme-subtle, #f1f3f2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 7px;
}

.topbar-widgets,
.fx-rates,
.user-chip,
.language-switcher {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.topbar-widgets {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  gap: 10px;
  min-width: 0;
}

.fx-rates,
.user-chip,
.language-switcher,
.logout-form {
  flex: 0 0 auto;
}

.fx-rates {
  flex-wrap: nowrap;
}

.fx-rates span,
.user-chip {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  box-shadow: 0 8px 24px rgba(18, 24, 39, 0.04);
  box-sizing: border-box;
  display: inline-flex;
  font-size: 13px;
  justify-content: center;
  line-height: 1;
  min-height: 38px;
  padding: 7px 11px;
}

.fx-rates strong,
.user-chip strong {
  color: var(--text);
  font-weight: 750;
  line-height: 1;
}

.user-chip {
  color: var(--text);
  font-weight: 750;
  padding-left: 7px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.user-chip:hover {
  border-color: var(--theme-line, #cbd8d2);
  box-shadow: 0 10px 26px rgba(18, 24, 39, 0.08);
  transform: translateY(-1px);
}

.user-chip.active {
  border-color: var(--theme-success-line, #bad7cb);
  box-shadow: 0 10px 28px rgba(13, 118, 83, 0.12);
}

.user-chip small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.1;
}

.logout-form {
  margin: 0;
}

.language-switcher {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(18, 24, 39, 0.04);
  gap: 2px;
  margin: 0;
  min-height: 38px;
  padding: 3px;
}

.language-switcher button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  min-height: 30px;
  padding: 5px 9px;
}

.language-switcher button.active {
  background: var(--accent);
  color: #fff;
}

.logout-form button {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(18, 24, 39, 0.04);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  min-height: 38px;
  padding: 7px 12px;
}

.logout-form button:hover {
  border-color: var(--theme-danger-line, #d8bebc);
  color: var(--theme-danger-text, var(--sold));
}

.avatar {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.page {
  margin: 0 auto;
  max-width: 1480px;
  padding: 28px 28px 56px;
}

.page-heading,
.home-hero,
.import-page-head,
.units-page-head {
  align-items: center;
  background:
    linear-gradient(90deg, rgba(15, 122, 98, 0.08), rgba(15, 122, 98, 0) 46%),
    var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(18, 24, 39, 0.05);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
  min-height: 82px;
  padding: 18px 20px;
}

.page-heading > div:first-child,
.home-hero > div:first-child,
.import-page-head > div:first-child,
.units-page-head > div:first-child {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.page-heading h1,
.home-hero h1,
.import-page-head h1,
.units-page-head h1 {
  font-size: clamp(24px, 2vw, 32px);
  line-height: 1.08;
  margin: 0;
}

.page-heading p,
.home-hero p,
.import-page-head p,
.units-page-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.35;
  max-width: 760px;
}

.page-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.hero-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

h1 {
  font-size: 32px;
  letter-spacing: 0;
  line-height: 1.1;
  margin: 0 0 8px;
}

h2 {
  font-size: 20px;
  letter-spacing: 0;
}

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

.button {
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  padding: 12px 16px;
  text-decoration: none;
  white-space: nowrap;
}

.button:hover {
  background: var(--accent-dark);
}

.button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button:disabled:hover {
  background: var(--accent);
}

.button-muted {
  background: var(--theme-hover, #e5e6e0);
  color: var(--text);
}

.button-muted:hover {
  background: var(--theme-hover, #d9dbd3);
}

.button-danger {
  background: var(--sold);
}

.button-danger:hover {
  background: #842f2f;
}

.button-danger-outline {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-danger-line, #e1b7b7);
  color: var(--theme-danger-text, var(--sold));
}

.button-danger-outline:hover {
  background: var(--theme-danger-soft, #f7e6e6);
}

.button-small {
  font-size: 14px;
  padding: 9px 12px;
}

.import-choice-list {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.import-choice-row {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--text);
  display: grid;
  gap: 16px;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  min-height: 104px;
  padding: 18px;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.import-choice-row:not(:has(.import-choice-action)) {
  grid-template-columns: 46px minmax(0, 1fr);
}

.import-choice-row:hover {
  border-color: var(--theme-success-line, #b9d7cc);
  box-shadow: 0 18px 40px rgba(18, 24, 39, 0.08);
  transform: translateY(-1px);
}

.import-choice-row-disabled {
  background: var(--theme-subtle, #f7f7f4);
  color: var(--theme-muted, #7a8581);
  cursor: default;
}

.import-choice-row-disabled:hover {
  border-color: var(--line);
  box-shadow: var(--shadow);
  transform: none;
}

.import-choice-icon {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--theme-success-line, #c8e2d7);
  border-radius: 8px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  font-size: 24px;
  height: 46px;
  justify-content: center;
  width: 46px;
}

.import-choice-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.import-choice-main strong {
  font-size: 20px;
}

.import-choice-main small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.import-choice-action {
  align-items: center;
  background: var(--accent);
  border-radius: 6px;
  color: #fff;
  display: inline-flex;
  font-size: 14px;
  font-weight: 800;
  min-height: 38px;
  padding: 9px 12px;
  white-space: nowrap;
}

.import-choice-action.muted {
  background: var(--theme-hover, #e5e6e0);
  color: var(--muted);
}

.import-note-panel {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 8px;
  padding: 18px;
}

.import-note-panel h2 {
  margin: 0;
}

.import-progress {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 10px;
  font-size: 14px;
}

.import-progress[hidden] {
  display: none;
}

.spinner {
  animation: spin 0.8s linear infinite;
  border: 2px solid var(--theme-line, #d7ddd5);
  border-top-color: var(--theme-success-text, var(--accent));
  border-radius: 999px;
  display: inline-flex;
  height: 18px;
  width: 18px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.import-workspace {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(320px, .9fr) minmax(280px, .8fr) minmax(300px, .8fr);
}

.import-upload-card,
.import-settings-card,
.import-summary-card,
.import-results-panel,
.import-conflict-panel {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.import-step-title {
  align-items: start;
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.import-step-title > span {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  flex: 0 0 auto;
  font-weight: 850;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.import-step-title h2 {
  font-size: 17px;
  margin: 0 0 4px;
}

.file-dropzone {
  align-items: center;
  border: 1px dashed var(--theme-line, #b6c7c0);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  justify-items: center;
  min-height: 210px;
  padding: 22px;
  text-align: center;
}

.file-dropzone:hover,
.file-dropzone:focus-within {
  background: var(--theme-subtle, #f7fbf9);
  border-color: var(--theme-success-text, var(--accent));
}

.file-dropzone:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.file-dropzone input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.file-dropzone-icon {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 24px;
  height: 54px;
  justify-content: center;
  margin-bottom: 10px;
  width: 54px;
}

.file-dropzone strong {
  color: var(--text);
  font-size: 17px;
}

.file-dropzone small {
  margin-top: 4px;
}

.selected-files {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.selected-files span {
  align-items: center;
  background: var(--theme-subtle, #f6f8f7);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 42px;
  padding: 9px 11px;
}

.selected-files strong {
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-settings-card,
.import-summary-card {
  align-content: start;
  display: grid;
  gap: 14px;
}

.import-project-lock {
  background: var(--theme-subtle, #f6f8f7);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 14px;
}

.import-project-lock small {
  color: var(--muted);
}

.import-project-lock strong {
  font-size: 18px;
}

.import-checklist {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
}

.import-mapping-toggle {
  align-items: flex-start;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  padding: 12px;
}

.import-mapping-toggle input {
  margin-top: 3px;
}

.import-mapping-toggle span {
  color: var(--muted);
  display: grid;
  gap: 3px;
  font-size: 12px;
}

.import-mapping-toggle strong {
  color: var(--text);
  font-size: 13px;
}

.import-advanced-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.import-advanced-settings > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 11px 12px;
}

.import-advanced-settings > summary::-webkit-details-marker {
  display: none;
}

.import-advanced-settings > summary::after {
  color: var(--muted);
  content: "▾";
}

.import-advanced-settings[open] > summary {
  border-bottom: 1px solid var(--line);
}

.import-advanced-settings .import-mapping-toggle {
  border: 0;
  border-radius: 0;
}

.import-result-technical {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
}

.import-result-technical > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 800;
  gap: 10px;
  list-style: none;
  padding: 13px 15px;
}

.import-result-technical > summary::-webkit-details-marker {
  display: none;
}

.import-result-technical > summary strong {
  background: var(--theme-warning-soft, #fff4e5);
  border-radius: 999px;
  color: var(--theme-warning-text, #9a5a00);
  font-size: 12px;
  padding: 4px 8px;
}

.import-result-technical > summary::after {
  color: var(--muted);
  content: "▾";
  margin-left: auto;
}

.import-result-technical[open] > summary {
  border-bottom: 1px solid var(--line);
}

.import-result-technical .import-attention-panel {
  border: 0;
  border-radius: 0;
  margin: 0;
}

.control-tabs {
  align-items: center;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  overflow-x: auto;
  padding: 5px;
}

.control-tabs a {
  border-radius: 6px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
  padding: 9px 13px;
  text-decoration: none;
}

.control-tabs a:hover,
.control-tabs a.active {
  background: var(--theme-surface, #fff);
  box-shadow: 0 4px 12px rgba(18, 24, 39, 0.05);
  color: var(--theme-success-text, var(--accent-dark));
}

.promotion-price {
  display: inline-grid;
  gap: 5px;
  max-width: 100%;
  vertical-align: middle;
}

.promotion-price-reference {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
}

.numeric .promotion-price-reference {
  justify-content: flex-end;
}

.promotion-price-reference del {
  color: var(--muted);
}

.promotion-badge {
  background: var(--theme-success-soft, #e4f3ea);
  border-radius: 4px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  padding: 3px 5px;
  white-space: nowrap;
}

.promotion-warning-text {
  color: var(--theme-warning-text, #8a5200);
}

.control-unit-row.promotion-project-link {
  grid-template-columns: minmax(0, 1fr) auto;
}

.promotion-project-link > small {
  grid-column: 1 / -1;
}

.promotion-add-panel {
  margin-bottom: 16px;
}

.promotion-unit-picker {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.promotion-unit-picker label {
  flex: 0 1 320px;
  min-width: 0;
}

.promotion-unit-picker select {
  min-width: 0;
}

.promotion-table-wrap {
  overflow-x: auto;
}

.promotion-table {
  min-width: 720px;
}

.promotion-table td {
  vertical-align: top;
}

.promotion-status,
.promotion-application small {
  display: block;
  font-size: 12px;
  margin-top: 5px;
}

.promotion-application {
  max-width: 230px;
  white-space: normal;
}

.promotion-edit-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
}

.promotion-edit-layout > section {
  min-width: 0;
}

.promotion-event-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.promotion-event-list li {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
  overflow-wrap: anywhere;
  padding: 12px 0;
}

.promotion-event-list small {
  font-size: 12px;
}

@media (max-width: 1180px) {
  .promotion-edit-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .control-unit-row.promotion-project-link {
    grid-template-columns: minmax(0, 1fr);
  }

  .promotion-unit-picker {
    align-items: stretch;
    flex-direction: column;
  }

  .promotion-unit-picker label {
    flex-basis: auto;
  }
}

.mapping-file-list {
  display: grid;
  gap: 16px;
}

.mapping-file-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 20px;
}

.mapping-file-head,
.mapping-preview-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.mapping-state {
  background: var(--theme-subtle, #f1f4f3);
  border: 1px solid var(--theme-line, #dfe6e3);
  border-radius: 999px;
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 7px 11px;
}

.mapping-state.is-ready {
  background: var(--theme-success-soft, #eaf7f0);
  border-color: var(--theme-success-line, #b9e3cc);
  color: var(--theme-success-text, #087443);
}

.mapping-state.has-errors {
  background: var(--theme-danger-soft, #fff0ee);
  border-color: var(--theme-danger-line, #f1c2bc);
  color: var(--theme-danger-text, #b42318);
}

.mapping-preset-note {
  background: var(--theme-subtle, #eef8f3);
  border-left: 3px solid var(--available);
  color: var(--theme-success-text, #087443);
  font-size: 13px;
  margin: -4px 0 0;
  padding: 9px 12px;
}

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

.mapping-schema-check {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.mapping-schema-check > span {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 9px 11px;
}

.mapping-schema-check > span::before {
  content: "✓";
  font-weight: 900;
}

.mapping-schema-check > span.complete {
  background: var(--theme-subtle, #f1f8f4);
  border-color: var(--theme-success-line, #c6e4d3);
  color: var(--theme-success-text, #087443);
}

.mapping-schema-check > span.missing {
  background: var(--theme-danger-soft, #fff2f0);
  border-color: var(--theme-danger-line, #efc7c1);
  color: var(--theme-danger-text, #a9261c);
}

.mapping-schema-check > span.partial {
  background: var(--theme-warning-soft, #fff8eb);
  border-color: var(--theme-warning-line, #ead5a7);
  color: var(--theme-warning-text, #8b5b08);
}

.mapping-schema-check > span.partial::before {
  content: "~";
}

.mapping-schema-check > span.missing::before {
  content: "!";
}

.mapping-schema-check strong {
  flex: 1;
  font-size: 12px;
}

.mapping-schema-check small {
  font-size: 11px;
  white-space: nowrap;
}

.mapping-summary > div {
  background: var(--theme-subtle, #f7f9f8);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 12px 14px;
}

.mapping-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.mapping-summary strong {
  font-size: 20px;
}

.mapping-diagnostic-list {
  display: grid;
  gap: 7px;
}

.mapping-diagnostic-list p {
  border: 1px solid;
  border-radius: 7px;
  font-size: 13px;
  margin: 0;
  padding: 9px 11px;
}

.mapping-diagnostic-list .error {
  background: var(--theme-danger-soft, #fff3f1);
  border-color: var(--theme-danger-line, #f0c6c0);
  color: var(--theme-danger-text, #a9261c);
}

.mapping-diagnostic-list .warning {
  background: var(--theme-warning-soft, #fff8eb);
  border-color: var(--theme-warning-line, #eed7a8);
  color: var(--theme-warning-text, #8b5b08);
}

.mapping-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(300px, 0.26fr) minmax(0, 0.74fr);
  min-width: 0;
}

.mapping-fields,
.mapping-preview {
  min-width: 0;
}

.mapping-fields {
  align-content: start;
  display: grid;
  gap: 10px;
  max-height: 650px;
  overflow: auto;
  padding-right: 5px;
}

.mapping-fields h2,
.mapping-preview h2 {
  font-size: 17px;
  margin: 0;
}

.mapping-fields label {
  background: var(--theme-subtle, #fafbfa);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 7px;
  padding: 9px 10px;
}

.mapping-fields label.is-required {
  border-left: 3px solid var(--theme-danger-text, #d0574b);
}

.mapping-fields label span {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  justify-content: space-between;
}

.mapping-fields em {
  color: var(--theme-danger-text, #b42318);
  font-size: 11px;
  font-style: normal;
}

.mapping-advanced {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 10px;
}

.mapping-advanced > summary {
  color: var(--theme-success-text, var(--accent-dark));
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  padding: 4px 0;
}

.mapping-advanced > summary::after {
  content: "+";
  float: right;
}

.mapping-advanced[open] > summary::after {
  content: "−";
}

.mapping-advanced > div {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.mapping-preview {
  display: grid;
  gap: 10px;
}

.mapping-preview-head > span {
  color: var(--muted);
  font-size: 11px;
}

.mapping-preview .table-wrap {
  max-height: 650px;
}

.mapping-preview table {
  min-width: 1840px;
}

.mapping-preview th,
.mapping-preview td {
  min-width: 130px;
  white-space: nowrap;
}

.mapping-preview th > span,
.mapping-preview th > small,
.mapping-preview td > span,
.mapping-preview td > del {
  display: block;
}

.mapping-preview th > small {
  color: var(--theme-success-text, #087443);
  font-size: 10px;
  margin-top: 4px;
}

.mapping-preview td > del {
  color: var(--theme-danger-text, #9b655e);
  font-size: 10px;
  margin-bottom: 3px;
  text-decoration-thickness: 1px;
}

.mapping-preview td > span {
  color: var(--text);
  font-weight: 650;
}

.import-checklist span {
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  padding: 12px 14px;
}

.import-checklist span:last-child {
  border-bottom: 0;
}

.import-checklist span::before {
  color: var(--theme-success-text, var(--available));
  content: "✓";
  font-weight: 850;
  margin-right: 8px;
}

.import-submit {
  width: 100%;
}

.import-result-kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 14px;
}

.import-results-panel .table-wrap {
  max-height: none;
}

.import-conflict-panel {
  max-width: 980px;
}

.mapping-panel {
  max-width: none;
}

.calculated-price-note {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 700;
  margin-top: 3px;
}

.villa-price-sqm-note {
  background: var(--theme-subtle, #f3f8f5);
  border-left: 3px solid var(--available);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  margin: 2px 0 0;
  padding: 8px 10px;
}

.villa-price-sqm-note strong {
  color: var(--text);
}

.summary-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 18px;
}

.summary-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 24, 39, 0.04);
  display: grid;
  gap: 10px;
  min-height: 108px;
  padding: 18px;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.summary-card strong {
  color: var(--text);
  font-size: clamp(22px, 2.1vw, 28px);
  letter-spacing: 0;
  line-height: 1;
  overflow-wrap: anywhere;
}

.summary-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.dashboard-search {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 24, 39, 0.04);
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px;
}

.dashboard-search input {
  flex: 1 1 auto;
  max-width: 520px;
}

.home-hero-simple {
  margin-bottom: 18px;
}

.home-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(320px, .95fr) minmax(320px, 1.05fr);
  margin-bottom: 14px;
}

.home-panel {
  align-content: start;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  padding: 18px;
}

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

.quick-actions-grid a,
.home-project-list a,
.recent-imports a {
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 5px;
  padding: 13px;
  text-decoration: none;
}

.quick-actions-grid a:hover,
.home-project-list a:hover,
.recent-imports a:hover {
  background: var(--accent-soft);
  border-color: var(--theme-success-line, #beded0);
  color: var(--theme-success-text, var(--accent-dark));
}

.quick-actions-grid span,
.home-project-list span,
.recent-imports span,
.recent-imports small {
  color: var(--muted);
  font-size: 13px;
}

.recent-imports,
.home-project-list {
  display: grid;
  gap: 10px;
}

.recent-imports a {
  grid-template-columns: minmax(0, 1fr) auto;
}

.recent-imports strong {
  color: var(--text);
  display: block;
  margin-bottom: 3px;
}

.home-imports-panel {
  gap: 16px;
}

.project-import-list {
  display: grid;
  gap: 9px;
}

.project-import-row {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, 1fr) minmax(260px, auto) auto;
  padding: 12px 14px;
  position: relative;
}

.project-import-row:hover {
  border-color: var(--theme-success-line, #beded0);
  box-shadow: 0 12px 28px rgba(9, 43, 37, 0.07);
}

.project-import-row.is-empty {
  background: var(--theme-subtle, #fbfbf8);
}

.project-import-row-link {
  border-radius: inherit;
  inset: 0;
  position: absolute;
  z-index: 1;
}

.project-import-main {
  display: grid;
  gap: 3px;
  min-width: 0;
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.project-import-title {
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.project-import-row:hover .project-import-title {
  color: var(--theme-success-text, var(--accent-dark));
}

.project-import-main span {
  color: var(--muted);
  font-size: 13px;
}

.project-import-main small {
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-import-meta {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(92px, auto));
  pointer-events: none;
  position: relative;
  z-index: 2;
}

.project-import-meta span {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
}

.project-import-meta small {
  color: var(--muted);
  font-size: 11px;
}

.project-import-meta strong {
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.project-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  position: relative;
  z-index: 3;
}

.project-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}

.project-card,
.panel,
.empty {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.project-card {
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.project-cover {
  background: var(--theme-success-soft, #d7e9e2);
  background-position: center;
  background-size: cover;
  color: var(--theme-success-text, var(--accent-dark));
  display: flex;
  min-height: 170px;
  padding: 12px;
  position: relative;
  text-decoration: none;
}

.project-cover::before {
  background:
    linear-gradient(135deg, rgba(11, 92, 74, 0.78), rgba(15, 122, 98, 0.18)),
    radial-gradient(circle at 22% 24%, var(--theme-glass, rgba(255, 255, 255, 0.95)) 0 2px, transparent 3px),
    radial-gradient(circle at 58% 42%, var(--theme-glass, rgba(255, 255, 255, 0.7)) 0 2px, transparent 3px),
    linear-gradient(155deg, var(--theme-success-soft, #cfe8dc), #8ebfae 48%, #335c64);
  content: "";
  inset: 0;
  position: absolute;
}

.project-cover.cover-b::before {
  background:
    linear-gradient(135deg, rgba(11, 92, 74, 0.72), rgba(241, 160, 44, 0.22)),
    linear-gradient(150deg, var(--theme-success-soft, #d7ebe3), #9ec4b6 52%, #667d70);
}

.project-cover.cover-c::before {
  background:
    linear-gradient(135deg, rgba(11, 92, 74, 0.68), rgba(66, 125, 148, 0.28)),
    linear-gradient(150deg, var(--theme-success-soft, #e0eee9), #8fb9bf 54%, #47677a);
}

.project-cover.cover-d::before {
  background:
    linear-gradient(135deg, rgba(11, 92, 74, 0.72), rgba(196, 55, 55, 0.22)),
    linear-gradient(150deg, var(--theme-hover, #e5efea), #ba9f8f 54%, #5d6973);
}

.project-cover.has-image::before {
  background: linear-gradient(180deg, rgba(8, 49, 43, 0.18), rgba(8, 49, 43, 0.62));
}

.project-cover span {
  align-self: flex-start;
  background: var(--theme-glass, rgba(255, 255, 255, 0.9));
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
  font-weight: 750;
  padding: 6px 10px;
  position: relative;
  z-index: 1;
}

.project-card-body {
  display: grid;
  gap: 8px;
  padding: 14px 14px 12px;
}

.project-card:hover {
  border-color: var(--theme-success-text, var(--accent));
}

.project-name {
  color: var(--text);
  font-size: 18px;
  font-weight: 750;
  text-decoration: none;
}

.project-date {
  color: var(--muted);
  font-size: 14px;
}

.project-location {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 13px;
  font-weight: 700;
}

.project-hero {
  align-items: stretch;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(220px, 330px) 118px minmax(0, 1fr) auto;
  margin-bottom: 18px;
}

.project-hero-v2 {
  align-items: stretch;
  grid-template-columns: minmax(340px, 0.78fr) minmax(0, 1.22fr);
}

.project-visual,
.project-logo-card,
.project-hero-main {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.project-visual {
  min-height: 150px;
  overflow: hidden;
  position: relative;
}

.project-hero-v2 .project-visual {
  min-height: clamp(250px, 22vw, 300px);
}

.project-visual-art {
  background:
    linear-gradient(135deg, rgba(9, 72, 62, 0.82), rgba(15, 122, 98, 0.16)),
    radial-gradient(circle at 22% 68%, var(--theme-success-soft, rgba(229, 246, 238, 0.9)) 0 3px, transparent 4px),
    radial-gradient(circle at 72% 38%, var(--theme-success-soft, rgba(229, 246, 238, 0.8)) 0 2px, transparent 3px),
    linear-gradient(150deg, var(--theme-success-soft, #d5ebe2), #8fbfae 52%, #44646b);
  inset: 0;
  position: absolute;
}

.project-visual-image {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.project-visual.has-image::after {
  background: linear-gradient(180deg, rgba(8, 49, 43, 0.08), rgba(8, 49, 43, 0.54));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.project-visual-art::before,
.project-visual-art::after {
  background: var(--theme-glass, rgba(255, 255, 255, 0.18));
  border: 1px solid var(--theme-line, rgba(255, 255, 255, 0.24));
  border-radius: 5px 5px 0 0;
  bottom: 0;
  content: "";
  position: absolute;
  width: 72px;
}

.project-visual-art::before {
  height: 82px;
  left: 52px;
}

.project-visual-art::after {
  height: 112px;
  right: 58px;
}

.project-badge {
  background: var(--theme-glass, rgba(255, 255, 255, 0.92));
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
  font-weight: 750;
  left: 14px;
  padding: 7px 10px;
  position: absolute;
  top: 14px;
  z-index: 1;
}

.project-visual-overlay {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 8px;
  inset: 0;
  justify-content: space-between;
  padding: 14px;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.project-visual-overlay .project-badge {
  left: auto;
  position: static;
  top: auto;
}

.project-visual-overlay small {
  background: var(--theme-glass, rgba(255, 255, 255, 0.92));
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  max-width: 100%;
  overflow: hidden;
  padding: 7px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-logo-card {
  align-content: center;
  display: grid;
  justify-items: center;
  min-height: 150px;
  padding: 16px;
  text-align: center;
}

.project-hero-v2 .project-logo-card {
  border-radius: 8px;
  box-shadow: none;
  flex: 0 0 104px;
  min-height: 104px;
  padding: 12px;
}

.project-hero-v2 .project-logo-card span {
  font-size: 13px;
  letter-spacing: 3px;
}

.project-hero-v2 .project-logo-card strong {
  font-size: 15px;
  letter-spacing: 2px;
}

.project-hero-v2 .project-logo-card small {
  display: none;
}

.project-logo-card span {
  color: var(--muted);
  font-size: 22px;
  letter-spacing: 5px;
}

.project-logo-card strong {
  color: var(--text);
  font-size: 22px;
  letter-spacing: 4px;
}

.project-logo-card small {
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}

.project-logo-image {
  display: block;
  max-height: 92px;
  max-width: 100%;
  object-fit: contain;
}

.project-hero-v2 .project-logo-image {
  max-height: 78px;
}

.project-hero-main {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 18px 20px;
}

.project-hero-v2 .project-hero-main {
  align-content: start;
  gap: 14px;
}

.breadcrumbs {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
}

.breadcrumbs a {
  color: var(--theme-success-text, var(--accent-dark));
  font-weight: 700;
  text-decoration: none;
}

.project-title-row {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.project-title-block {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  min-width: 0;
}

.project-title-kicker {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
  margin-bottom: 7px;
}

.project-title-row h1 {
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}

.project-name-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-bottom: 6px;
}

.project-name-line h1 {
  margin-bottom: 0;
}

.project-title-row > div {
  min-width: 0;
}

.project-state {
  background: var(--theme-success-soft, #e2f3eb);
  border-radius: 999px;
  color: var(--theme-success-text, var(--available));
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
  padding: 6px 10px;
}

.project-title-kicker .project-state {
  padding: 5px 9px;
}

.project-meta {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  padding-top: 14px;
}

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

.project-meta span {
  color: var(--text);
  display: grid;
  font-size: 13px;
  gap: 5px;
}

.project-meta strong {
  color: var(--muted);
  font-size: 12px;
}

.project-hero-actions {
  align-content: start;
  display: grid;
  gap: 10px;
  min-width: 150px;
}

.project-hero-v2 .project-hero-actions {
  grid-column: 1 / -1;
  min-width: 0;
}

.project-action-bar {
  align-items: center;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 8px;
}

.project-action-bar .button {
  background: var(--theme-surface, #fff);
  border-color: var(--line);
  box-shadow: 0 6px 14px rgba(18, 24, 39, 0.04);
  color: var(--text);
  justify-content: center;
  min-height: 38px;
  padding: 9px 12px;
  text-align: center;
}

.project-action-bar .button:hover {
  background: var(--accent-soft);
  color: var(--theme-success-text, var(--accent-dark));
}

.project-action-bar .project-primary-action,
.project-action-bar .project-primary-action:hover {
  background: var(--accent);
  color: #fff;
}

.page-action-menu {
  position: relative;
}

.page-action-menu > summary {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 750;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  white-space: nowrap;
}

.page-action-menu > summary::-webkit-details-marker {
  display: none;
}

.page-action-menu > summary::after {
  color: var(--muted);
  content: "▾";
  font-size: 11px;
}

.page-action-menu > div {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(18, 24, 39, 0.14);
  display: grid;
  min-width: 220px;
  padding: 7px;
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 90;
}

.page-action-menu > div a {
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  padding: 9px 10px;
  text-decoration: none;
}

.page-action-menu > div a:hover {
  background: var(--theme-subtle, #f4f7f5);
}

.page-action-menu > div a.danger {
  color: var(--theme-danger-text, var(--sold));
}

.project-action-bar .project-delete-action {
  color: var(--theme-danger-text, #9d3434);
}

.project-action-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-admin-actions {
  justify-content: flex-start;
}

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

@media (min-width: 1600px) {
  .project-kpi-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}

.project-insight-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  margin-bottom: 14px;
}

.project-insight-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 24, 39, 0.04);
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 14px 16px;
}

.project-insight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.project-insight-card strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.project-insight-card small {
  color: var(--muted);
}

.kpi-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 24, 39, 0.04);
  display: grid;
  gap: 9px;
  min-height: 104px;
  padding: 16px;
}

.kpi-card > span {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
}

.kpi-card i {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  flex: 0 0 26px;
  font-style: normal;
  height: 26px;
  justify-content: center;
  width: 26px;
}

.kpi-card strong {
  color: var(--text);
  font-size: clamp(22px, 2vw, 26px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.kpi-card small {
  color: var(--muted);
}

.kpi-money-value {
  font-size: clamp(21px, 1.7vw, 25px);
  white-space: nowrap;
}

.kpi-range-value {
  display: grid;
  font-size: clamp(18px, 1.45vw, 22px);
  gap: 4px;
  line-height: 1.08;
}

.kpi-range-value span,
.kpi-range-value em {
  display: block;
  font-style: normal;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kpi-range-value em {
  color: var(--muted);
  font-size: .9em;
}

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

.metrics span {
  color: var(--muted);
  font-size: 13px;
}

.metrics strong {
  color: var(--text);
  display: block;
  font-size: 22px;
}

.metrics small {
  color: var(--theme-warning-text, #9a6a16);
  display: block;
  font-size: 9px;
  line-height: 1.2;
  margin-top: 3px;
}

.panel,
.empty {
  padding: 24px;
}

.danger-panel {
  border-color: var(--theme-danger-line, #e1b7b7);
}

.warning-panel {
  border-color: var(--theme-warning-line, #e0c788);
}

.upload-confirm-panel {
  max-width: 880px;
}

.delete-summary {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0;
  margin: 20px 0;
}

.delete-summary span {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  padding: 12px 14px;
}

.delete-summary span:last-child {
  border-bottom: 0;
}

.delete-summary strong {
  color: var(--text);
}

.delete-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.project-overview-layout {
  margin-bottom: 14px;
}

.project-current-panel {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 24, 39, 0.04);
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
}

.project-current-panel .section-head {
  align-items: flex-start;
}

.section-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: flex-end;
}

.current-price-card {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-width: 0;
  padding: 12px 14px;
}

.project-price-summary {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.current-price-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.current-price-main strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
}

.current-price-main span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.current-price-facts {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  margin: 0;
}

.current-price-facts div {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 2px;
  min-width: 112px;
  padding: 6px 9px;
}

.current-price-facts dt,
.current-price-facts dd {
  margin: 0;
}

.current-price-facts dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.current-price-facts dd {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

.project-visual-gallery {
  bottom: 14px;
  display: flex;
  gap: 8px;
  left: 14px;
  max-width: calc(100% - 28px);
  position: absolute;
  z-index: 2;
}

.project-visual-gallery img {
  border: 2px solid var(--theme-line, rgba(255, 255, 255, 0.9));
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(4, 23, 21, 0.22);
  height: 48px;
  object-fit: cover;
  width: 72px;
}

.empty-mini {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 5px;
  padding: 14px;
}

.empty-mini strong {
  color: var(--text);
}

.confirm-actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.confirm-actions-row {
  display: flex;
  justify-content: flex-end;
}

.batch-confirm-form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.import-review-summary {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.import-review-summary div {
  background: var(--theme-subtle, #fbfbf8);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 12px 14px;
}

.import-review-summary strong {
  color: var(--text);
  font-size: 22px;
}

.import-review-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.import-attention-panel {
  background: var(--theme-subtle, #fbfbf8);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.import-attention-grid,
.import-issue-groups {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.import-attention-card,
.import-issue-groups span {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-left: 3px solid var(--theme-line, #c8c1b4);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 4px;
  padding: 10px 12px;
}

.import-attention-card strong,
.import-issue-groups strong {
  color: var(--text);
  font-size: 13px;
}

.import-attention-card span {
  color: var(--theme-success-text, var(--accent-dark));
  font-weight: 800;
}

.import-attention-card small,
.import-attention-card em,
.import-issue-groups small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.import-attention-card.blocking,
.import-issue-groups .blocking {
  border-left-color: var(--theme-danger-text, #b42318);
}

.import-attention-card.manual,
.import-issue-groups .manual {
  border-left-color: var(--theme-info-line, #7b61ff);
}

.import-attention-card.identity,
.import-issue-groups .identity {
  border-left-color: var(--theme-info-text, #2563eb);
}

.import-attention-card.inventory,
.import-issue-groups .inventory {
  border-left-color: var(--theme-success-text, #0f8a67);
}

.import-attention-card.fields,
.import-issue-groups .fields,
.import-attention-card.types,
.import-issue-groups .types {
  border-left-color: var(--theme-warning-text, #d97706);
}

.import-attention-card.prices,
.import-issue-groups .prices {
  border-left-color: var(--theme-success-text, #16a34a);
}

.import-attention-card.duplicates,
.import-issue-groups .duplicates {
  border-left-color: var(--theme-line, #64748b);
}

.import-issue-groups.compact {
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  margin-top: 8px;
}

.import-issue-groups.compact span {
  border-radius: 6px;
  padding: 7px 9px;
}

.batch-file-list {
  display: grid;
  gap: 14px;
}

.batch-file-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.batch-file-error {
  border-color: var(--theme-danger-line, #e5bcbc);
}

.batch-file-item.quality-card-warning {
  border-color: var(--theme-warning-line, #ead3a7);
}

.batch-file-item.quality-card-error {
  border-color: var(--theme-danger-line, #e5bcbc);
}

.batch-file-main {
  display: grid;
  gap: 4px;
}

.batch-file-main span,
.batch-file-note {
  color: var(--muted);
  font-size: 13px;
}

.batch-file-note {
  margin: 0;
}

.import-decision {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.import-decision strong {
  font-size: 15px;
}

.import-decision span {
  color: var(--muted);
  font-size: 13px;
}

.import-decision.ok {
  background: var(--theme-subtle, #f0f8f4);
  border-color: var(--theme-success-line, #b9dccb);
}

.import-decision.ok strong {
  color: var(--theme-success-text, #067047);
}

.import-decision.warning {
  background: var(--theme-warning-soft, #fff8ea);
  border-color: var(--theme-warning-line, #edd7af);
}

.import-decision.warning strong {
  color: var(--theme-warning-text, #9a5a00);
}

.import-decision.error {
  background: var(--theme-danger-soft, #fff3f3);
  border-color: var(--theme-danger-line, #e9b8b8);
}

.import-decision.error strong {
  color: var(--theme-danger-text, #b42318);
}

.import-quality-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.import-quality-metrics span {
  background: var(--theme-subtle, #f7f7f3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 2px;
  padding: 9px 10px;
}

.import-quality-metrics strong {
  color: var(--text);
  font-size: 15px;
}

.import-quality-metrics small {
  color: var(--muted);
  font-size: 11px;
}

.import-preview-panel {
  background: var(--theme-subtle, #fbfbf8);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.import-preview-head {
  align-items: start;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.import-preview-head h2 {
  font-size: 17px;
  margin: 0;
}

.import-preview-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 5px 0 0;
}

.import-preview-head > span {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  max-width: 360px;
  overflow: hidden;
  padding: 7px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-preview-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.import-preview-metrics span {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  font-size: 12px;
  gap: 2px;
  padding: 10px 12px;
}

.import-preview-metrics strong {
  color: var(--text);
  font-size: 20px;
}

.import-preview-lists {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.import-preview-list {
  align-content: start;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  padding: 12px;
}

.import-preview-list h3 {
  align-items: center;
  display: flex;
  font-size: 14px;
  gap: 8px;
  justify-content: space-between;
  margin: 0 0 2px;
}

.import-preview-list h3 small {
  background: var(--theme-warning-soft, #fff3df);
  border: 1px solid var(--theme-warning-line, #f0d4a7);
  border-radius: 999px;
  color: var(--theme-warning-text, #9a5a00);
  font-size: 11px;
  padding: 4px 7px;
}

.import-preview-list > span {
  background: var(--theme-subtle, #f7f7f3);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  padding: 7px 9px;
}

.import-preview-list > small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.price-change-list > span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: space-between;
}

.price-change-list em {
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 3px 7px;
}

.price-change-list em.up {
  background: var(--theme-success-soft, #e6f4ed);
  color: var(--theme-success-text, #067047);
}

.price-change-list em.down {
  background: var(--theme-danger-soft, #fdeaea);
  color: var(--theme-danger-text, #b42318);
}

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

.batch-file-actions .radio-card {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: center;
  min-height: 44px;
  padding: 10px 12px;
  position: relative;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.batch-file-actions .radio-card input {
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none;
  position: absolute;
  width: 1px !important;
}

.batch-file-actions .radio-card span {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.batch-file-actions .radio-card:has(input:checked) {
  background: var(--theme-success-soft, #e6f2ed);
  border-color: var(--theme-line, #7cab98);
  color: var(--theme-success-text, var(--accent-dark));
}

.same-date-list {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
}

.same-date-list h2 {
  font-size: 16px;
  margin: 0;
}

.same-date-item {
  background: var(--theme-subtle, #f7f7f3);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.same-date-item span {
  color: var(--muted);
  font-size: 13px;
}

.quality-inline {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.quality-inline small,
.quality-details summary {
  color: var(--muted);
  font-size: 12px;
}

.quality-badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 10px;
  white-space: nowrap;
}

.quality-badge.ok {
  background: var(--theme-success-soft, #e6f4ed);
  border-color: var(--theme-success-line, #b9dccb);
  color: var(--theme-success-text, #067047);
}

.quality-badge.warning {
  background: var(--theme-warning-soft, #fff3df);
  border-color: var(--theme-warning-line, #f0d4a7);
  color: var(--theme-warning-text, #9a5a00);
}

.quality-badge.error {
  background: var(--theme-danger-soft, #fdeaea);
  border-color: var(--theme-danger-line, #ebb7b7);
  color: var(--theme-danger-text, #b42318);
}

.quality-panel {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.quality-panel.compact {
  background: var(--theme-subtle, #fbfbf8);
  border-color: var(--theme-line, #e6e2d8);
}

.quality-panel.report-quality {
  margin-bottom: 16px;
}

.quality-panel.report-quality.warning {
  border-color: var(--theme-warning-line, #ecd4aa);
}

.quality-panel.report-quality.error {
  border-color: var(--theme-danger-line, #e8b3b3);
}

.quality-panel-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.quality-panel-head span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.quality-panel-head h2 {
  font-size: 18px;
  margin: 2px 0 0;
}

.quality-panel-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}

.quality-panel-head strong {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 28px;
  white-space: nowrap;
}

.quality-issue-list {
  display: grid;
  gap: 8px;
}

.quality-issue {
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 10px 12px;
}

.quality-issue strong {
  font-size: 12px;
}

.quality-issue-head {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.quality-issue span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.quality-issue small {
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
}

.quality-action {
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  padding: 5px 8px;
}

.quality-action.block {
  background: var(--theme-danger-soft, #fdeaea);
  border-color: var(--theme-danger-line, #ebb7b7);
  color: var(--theme-danger-text, #b42318);
}

.quality-action.review {
  background: var(--theme-warning-soft, #fff3df);
  border-color: var(--theme-warning-line, #f0d4a7);
  color: var(--theme-warning-text, #9a5a00);
}

.quality-action.pass {
  background: var(--theme-success-soft, #e6f4ed);
  border-color: var(--theme-success-line, #b9dccb);
  color: var(--theme-success-text, #067047);
}

.quality-issue.warning {
  background: var(--theme-warning-soft, #fffaf1);
  border-color: var(--theme-warning-line, #edd7af);
}

.quality-issue.warning strong {
  color: var(--theme-warning-text, #9a5a00);
}

.quality-issue.error {
  background: var(--theme-danger-soft, #fff3f3);
  border-color: var(--theme-danger-line, #e9b8b8);
}

.quality-issue.error strong {
  color: var(--theme-danger-text, #b42318);
}

.quality-details {
  margin-top: 8px;
}

.quality-details summary {
  cursor: pointer;
  font-weight: 800;
}

.quality-details .quality-issue-list {
  margin-top: 8px;
  min-width: 260px;
}

.quality-empty {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.narrow {
  max-width: 520px;
}

.form {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.form-context {
  background: var(--theme-hover, #f0f1ed);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 4px;
  padding: 12px 14px;
}

.form-context span {
  color: var(--muted);
  font-size: 13px;
}

.form-context strong {
  font-size: 16px;
}

.form-errors {
  background: var(--theme-danger-soft, #f7e6e6);
  border: 1px solid var(--theme-danger-line, #e5bcbc);
  border-radius: 6px;
  color: var(--theme-danger-text, var(--sold));
  font-size: 14px;
  padding: 10px 12px;
}

.form-errors ul {
  margin: 0;
  padding-left: 18px;
}

.form-error {
  background: var(--theme-danger-soft, #f7e6e6);
  border: 1px solid var(--theme-danger-line, #e5bcbc);
  border-radius: 6px;
  color: var(--theme-danger-text, var(--sold));
  font-size: 14px;
  padding: 10px 12px;
}

label {
  display: grid;
  gap: 8px;
}

label span {
  font-weight: 700;
}

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

input,
select {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

input:disabled,
select:disabled {
  background: var(--theme-hover, #eeeeea);
  color: var(--theme-muted, #909692);
  cursor: not-allowed;
}

.filters-panel {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
  padding: 10px;
}

.filter-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.filter-search-input {
  flex: 0 1 190px;
  max-width: 220px;
}

.units-filters-panel .filter-search-input {
  flex-basis: 160px;
  max-width: 160px;
}

.filter-toolbar > .filter-select {
  flex: 0 0 136px;
  inline-size: 136px;
  max-width: 136px;
  min-height: 40px;
  width: 136px;
}

.filter-dropdown {
  flex: 0 0 auto;
  min-width: 0;
  position: relative;
}

.filter-dropdown summary {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
  max-width: 240px;
  min-height: 40px;
  overflow: hidden;
  padding: 8px 11px;
  text-overflow: ellipsis;
  user-select: none;
  white-space: nowrap;
}

.filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.filter-dropdown summary::after {
  color: var(--muted);
  content: "▾";
  font-size: 11px;
}

.filter-dropdown[open] summary {
  border-color: var(--theme-line, #bfd2ca);
  box-shadow: 0 8px 22px rgba(18, 24, 39, 0.08);
}

.filter-more-panel {
  flex: 0 0 auto;
  position: relative;
}

.filter-more-panel > summary {
  align-items: center;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 750;
  gap: 8px;
  min-height: 40px;
  padding: 8px 11px;
  user-select: none;
  white-space: nowrap;
}

.filter-more-panel > summary::-webkit-details-marker {
  display: none;
}

.filter-more-panel > summary::after {
  color: var(--muted);
  content: "+";
  font-size: 15px;
}

.filter-more-panel[open] > summary {
  background: var(--theme-subtle, #edf6f2);
  border-color: var(--theme-line, #bfd2ca);
  color: var(--theme-success-text, var(--accent-dark));
}

.filter-more-panel.has-active > summary {
  border-color: var(--theme-success-line, #9fc8b8);
  box-shadow: inset 0 0 0 1px rgba(8, 117, 90, 0.08);
}

.filter-more-panel[open] > summary::after {
  content: "−";
}

.filter-more-grid {
  align-items: start;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(18, 24, 39, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  right: 0;
  margin-top: 6px;
  max-width: calc(100vw - 48px);
  min-width: min(620px, calc(100vw - 48px));
  padding: 10px;
  position: absolute;
  top: 100%;
  z-index: 75;
}


.filter-boolean-option {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
}

.filter-boolean-option.is-active {
  background: var(--theme-success-soft, #eaf7f2);
  border-color: var(--theme-success-line, #9fc8b8);
  color: var(--theme-success-text, var(--accent-dark));
}

.filter-boolean-option input {
  accent-color: var(--theme-success-text, var(--accent));
  flex: 0 0 auto;
  height: 16px;
  margin: 0;
  min-height: 16px;
  padding: 0;
  width: 16px;
}

@media (max-width: 700px) {
  .filter-more-grid {
    left: 0;
    min-width: min(360px, calc(100vw - 36px));
    right: auto;
  }
}

.filter-dropdown-menu {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(18, 24, 39, 0.14);
  display: grid;
  gap: 4px;
  left: 0;
  margin-top: 6px;
  min-width: 190px;
  padding: 8px;
  position: absolute;
  top: 100%;
  z-index: 80;
}

.filter-dropdown-wide .filter-dropdown-menu {
  min-width: 320px;
  width: min(440px, calc(100vw - 48px));
}

.filter-dropdown-menu-scroll {
  max-height: min(420px, calc(100vh - 220px));
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.filter-dropdown-menu-scroll::-webkit-scrollbar {
  width: 8px;
}

.filter-dropdown-menu-scroll::-webkit-scrollbar-thumb {
  background: var(--theme-hover, #cfd9d4);
  border-radius: 999px;
}

.filter-dropdown-menu label {
  align-items: center;
  border-radius: 6px;
  display: flex;
  gap: 8px;
  min-height: 32px;
  padding: 6px 7px;
}

.filter-dropdown-menu label:hover {
  background: var(--theme-subtle, #f5f8f6);
}

.filter-dropdown-menu input[type="checkbox"] {
  flex: 0 0 auto;
  min-height: auto;
  padding: 0;
  width: auto;
}

.filter-range-menu {
  grid-template-columns: repeat(2, 128px);
}

.filter-dropdown-range .filter-range-menu {
  grid-template-columns: 158px repeat(2, 128px);
}

.filter-dropdown-price .filter-range-menu {
  grid-template-columns: repeat(2, 128px);
}

.filter-area-scope {
  min-width: 0;
}

.filter-dropdown-range .filter-dropdown-menu,
.filter-dropdown-price .filter-dropdown-menu {
  left: auto;
  right: 0;
}

.filter-groups {
  display: grid;
  align-items: start;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.filter-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  margin: 0;
  min-inline-size: 0;
  min-width: 0;
  padding: 12px 10px 10px;
  width: 100%;
  justify-content: start;
}

.filter-group > * {
  min-width: 0;
}

.compact-field {
  display: grid;
  gap: 4px;
}

.compact-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}

.filter-group legend {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  padding: 0 6px;
  text-transform: uppercase;
}

.filter-group-search {
  grid-template-columns: minmax(150px, 230px) minmax(128px, 156px);
}

.filter-group-characteristics {
  grid-template-columns: minmax(220px, 310px) repeat(2, 94px);
}

.filter-group-price {
  grid-template-columns: 68px repeat(2, 128px);
  max-width: 344px;
}

.filter-room-type {
  min-width: 0;
}

.filter-currency {
  font-weight: 750;
}

.filter-advanced {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.filter-advanced summary {
  color: var(--theme-success-text, var(--accent-dark));
  cursor: pointer;
  display: inline-flex;
  font-size: 14px;
  font-weight: 750;
}

.filter-advanced-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(140px, 180px));
  margin-top: 8px;
}

.filter-advanced-grid label span {
  color: var(--muted);
  font-size: 12px;
}

.filter-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  justify-content: flex-end;
  min-height: 40px;
}

@media (min-width: 1100px) {
  .filter-groups {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

.link-reset {
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}

.link-reset.button-danger-outline {
  color: var(--theme-danger-text, var(--sold));
}

.link-reset.button-danger-outline:hover {
  color: var(--theme-danger-text, var(--sold));
}

.table-summary {
  color: var(--muted);
  font-size: 14px;
  margin: -4px 0 10px;
}

.table-summary strong {
  color: var(--text);
  font-weight: 750;
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.filter-chips a {
  align-items: center;
  background: var(--theme-success-soft, #e6f2ed);
  border: 1px solid var(--theme-success-line, #c1ded3);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  font-size: 13px;
  font-weight: 700;
  gap: 7px;
  padding: 6px 10px;
  text-decoration: none;
}

.filter-chips a > span:not(.ui-stable-label) {
  color: var(--theme-muted, #66827a);
  font-size: 15px;
  line-height: 1;
}

.change-metrics {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, .8fr) minmax(150px, .8fr) minmax(280px, 1.4fr);
  min-width: 0;
}

.change-summary-card {
  align-content: start;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
}

.change-summary-head {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.change-summary-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.change-summary-head strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.change-mini-list {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
}

.change-mini-list a,
.muted {
  color: var(--muted);
  font-size: 13px;
}

.change-mini-list a {
  background: var(--theme-hover, #f0f1ed);
  border-radius: 999px;
  max-width: 100%;
  overflow: hidden;
  padding: 5px 8px;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-mini-list a:hover {
  color: var(--theme-success-text, var(--accent-dark));
}

.price-preview-list {
  display: grid;
  gap: 6px;
}

.price-preview-list a {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(0, 1fr);
  min-width: 0;
  overflow: visible;
  padding: 7px 8px;
  text-overflow: clip;
  white-space: normal;
  width: 100%;
}

.price-preview-list a strong {
  color: var(--text);
  flex: 0 0 auto;
  font-size: 12px;
}

.price-preview-list a span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
  min-width: 0;
  text-align: right;
  white-space: normal;
}

.change-report-link {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
  font-weight: 850;
  justify-self: start;
  text-decoration: none;
}

.change-report-link:hover {
  text-decoration: underline;
}

.uploads-panel {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  margin: 0 0 14px;
}

.uploads-panel summary,
.internal-notes-summary {
  color: var(--text);
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
  list-style: none;
  padding: 12px 14px;
}

.uploads-panel summary::-webkit-details-marker {
  display: none;
}

.uploads-panel summary::after {
  color: var(--muted);
  content: "↓";
  float: right;
}

.uploads-panel[open] > summary::after {
  content: "↑";
}

.upload-list {
  border-top: 1px solid var(--line);
  display: grid;
}

.upload-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  padding: 10px 14px;
}

.upload-item:last-child {
  border-bottom: 0;
}

.upload-item span {
  color: var(--muted);
  font-size: 14px;
}

.upload-item strong {
  color: var(--text);
  margin-right: 8px;
}

.upload-item-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: flex-end;
}

.media-heading {
  align-items: flex-end;
}

.media-heading .breadcrumbs {
  margin-bottom: 12px;
}

.media-workspace {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(320px, 0.82fr) minmax(320px, 1fr);
  margin-bottom: 16px;
}

.media-upload-card,
.media-cover-card,
.media-gallery-panel {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

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

.media-dropzone {
  min-height: 190px;
}

.media-dropzone input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}

.form-field {
  align-content: start;
  display: grid;
  gap: 6px;
  min-width: 0;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
}

.form-field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.media-checkbox {
  align-items: center;
  display: flex;
  gap: 10px;
}

.media-checkbox input {
  accent-color: var(--theme-success-text, var(--accent));
  height: 16px;
  width: 16px;
}

.media-checkbox span {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.media-cover-card {
  align-content: start;
  display: grid;
  gap: 12px;
}

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

.media-cover-preview {
  display: grid;
  gap: 8px;
}

.media-cover-preview > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

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

.media-cover-card img,
.media-cover-preview img {
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.media-cover-card > strong,
.media-cover-preview strong {
  color: var(--text);
  font-size: 16px;
}

.media-cover-card > span {
  color: var(--muted);
  font-size: 13px;
}

.media-empty-cover {
  align-content: center;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, rgba(11, 92, 74, 0.74), rgba(15, 122, 98, 0.18)),
    linear-gradient(150deg, var(--theme-success-soft, #d5ebe2), #8fbfae 52%, #44646b);
  border-radius: 8px;
  color: #fff;
  display: grid;
  gap: 8px;
  padding: 22px;
}

.media-empty-cover span {
  color: rgba(255, 255, 255, 0.82);
}

.media-gallery-panel {
  display: grid;
  gap: 16px;
}

.media-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.media-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.media-card.is-cover {
  border-color: var(--theme-success-text, rgba(15, 122, 98, 0.42));
  box-shadow: 0 16px 34px rgba(15, 122, 98, 0.12);
}

.media-card.is-detail-cover {
  border-color: var(--theme-info-text, rgba(39, 92, 148, 0.38));
}

.media-card-image {
  aspect-ratio: 16 / 9;
  background: var(--theme-subtle, #eef4f1);
  position: relative;
}

.media-card-image > .media-badge {
  background: var(--theme-glass, rgba(255, 255, 255, 0.92));
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
  font-weight: 800;
  left: 10px;
  padding: 6px 9px;
  position: absolute;
  top: 10px;
}

.media-card-image > .media-badge-detail {
  color: var(--theme-info-text, #275c94);
  left: auto;
  right: 10px;
}

.media-select {
  align-items: center;
  background: var(--theme-glass, rgba(255, 255, 255, 0.9));
  border-radius: 999px;
  bottom: 10px;
  color: var(--text);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  left: 10px;
  padding: 6px 9px;
  position: absolute;
}

.media-select input {
  accent-color: var(--theme-success-text, var(--accent));
}

.media-card-body {
  display: grid;
  gap: 10px;
  padding: 12px 12px 10px;
}

.media-card-body strong {
  color: var(--text);
  font-size: 15px;
}

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

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

.media-gallery-form {
  display: grid;
  gap: 14px;
}

.media-gallery-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.media-order-field input {
  max-width: 120px;
}

.project-admin-heading {
  align-items: flex-end;
}

.project-admin-heading .breadcrumbs {
  margin-bottom: 12px;
}

.project-admin-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
}

.project-form-card,
.project-admin-preview {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.project-form-card {
  background:
    linear-gradient(180deg, var(--theme-glass, rgba(255, 255, 255, .96)), var(--theme-surface, #fff)),
    radial-gradient(circle at top right, rgba(15, 122, 98, .08), transparent 32%);
  overflow: hidden;
}

.project-edit-form {
  display: grid;
  gap: 0;
}

.project-edit-form > .form-error {
  margin: 18px 18px 0;
}

.project-form-section {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  padding: 20px;
}

.project-form-section-head {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
}

.project-form-section-head > span {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--theme-success-line, #cce4d9);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  letter-spacing: .04em;
  width: 42px;
}

.project-form-section-sales .project-form-section-head > span {
  background: var(--theme-warning-soft, #fff4e5);
  border-color: var(--theme-warning-line, #efd5ac);
  color: var(--theme-warning-text, #8a5200);
}

.project-form-section-content .project-form-section-head > span {
  background: var(--theme-info-soft, #edf3ff);
  border-color: var(--theme-info-line, #cfdbf3);
  color: var(--theme-info-text, #315c9e);
}

.project-form-section-brand .project-form-section-head > span {
  background: var(--theme-info-soft, #f3edff);
  border-color: var(--theme-info-line, #ddd0f5);
  color: var(--theme-info-text, #6740a0);
}

.project-form-section-head h2 {
  color: var(--text);
  font-size: 19px;
  letter-spacing: 0;
  margin: 0 0 3px;
}

.project-form-section-head p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

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

.project-completion-field {
  min-width: 0;
}

.project-completion-period {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 340px;
  min-width: 0;
}

.project-completion-period select {
  min-width: 0;
  width: 100%;
}

.field-wide {
  grid-column: 1 / -1;
}

.project-form-section .form-field {
  background: var(--theme-glass, rgba(255, 255, 255, .9));
  border: 1px solid var(--theme-line, #e1e6e3);
  border-radius: 8px;
  gap: 7px;
  padding: 10px 11px 11px;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.project-form-section .form-field:focus-within {
  background: var(--theme-surface, #fbfefd);
  border-color: var(--theme-success-text, rgba(9, 114, 84, .42));
  box-shadow: 0 0 0 3px rgba(9, 114, 84, .09);
}

.project-form-section .form-field > span {
  color: var(--theme-muted, #66736f);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .045em;
  line-height: 1.2;
  text-transform: uppercase;
}

.project-form-section .form-field input,
.project-form-section .form-field select,
.project-form-section .form-field textarea {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text);
  font-size: 16px;
  font-weight: 720;
  min-height: 32px;
  outline: none;
  padding: 0;
}

.project-form-section .form-field textarea {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  min-height: 104px;
}

.project-coordinate-helper {
  background: linear-gradient(135deg, var(--theme-subtle, #f4faf7), var(--theme-surface, #fbfdfc));
  border: 1px solid var(--theme-success-line, #cfe2da);
  border-radius: 10px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.project-coordinate-helper-head {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.project-coordinate-helper-head > div {
  display: grid;
  gap: 3px;
}

.project-coordinate-helper-head strong {
  color: var(--text);
  font-size: 15px;
}

.project-coordinate-helper-head p,
.project-coordinate-helper > small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.project-coordinate-fields {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-coordinate-import {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.project-coordinate-import label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.project-coordinate-import label > span {
  color: var(--theme-muted, #66736f);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.project-coordinate-import input {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-line, #d5dfda);
  border-radius: 7px;
  color: var(--text);
  font: inherit;
  min-height: 38px;
  min-width: 0;
  padding: 8px 10px;
  width: 100%;
}

.project-coordinate-import input:focus {
  border-color: var(--theme-success-text, rgba(9, 114, 84, .5));
  box-shadow: 0 0 0 3px rgba(9, 114, 84, .09);
  outline: none;
}

.project-coordinate-feedback {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
  font-weight: 750;
  min-height: 17px;
  margin: -4px 0 0;
}

.project-coordinate-feedback.is-error {
  color: var(--theme-danger-text, var(--sold));
}

.form-field textarea {
  resize: vertical;
}

.project-ownership-field {
  background: var(--theme-warning-soft, #fffbf2) !important;
  border-color: var(--theme-warning-line, #ead4aa) !important;
}

.project-ownership-field:focus-within {
  border-color: var(--theme-warning-text, #d29c47) !important;
  box-shadow: 0 0 0 3px rgba(210, 156, 71, .12) !important;
}

.project-form-section-manager .project-ownership-field {
  max-width: 520px;
}

.project-pet-friendly-field {
  align-content: center;
  background: var(--theme-subtle, #f4faf7);
  border: 1px solid var(--theme-success-line, #d6e9e1);
  border-radius: 8px;
  padding: 11px 12px;
}

.project-pet-friendly-field > .media-checkbox input {
  min-height: 16px;
}

.project-pet-building-picker {
  border-top: 1px solid var(--theme-success-line, #d6e9e1);
  display: grid;
  gap: 8px;
  margin-top: 4px;
  padding-top: 11px;
}

.project-pet-building-picker[hidden] {
  display: none;
}

.project-pet-building-picker > span {
  color: var(--theme-success-text, #386355);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.project-pet-building-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.project-pet-building-picker > div > div {
  display: contents;
}

.project-pet-building-picker label {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-success-line, #c8ded5);
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 800;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
}

.project-form-section .project-pet-building-picker input {
  accent-color: var(--theme-success-text, var(--accent));
  height: 15px;
  min-height: 15px;
  padding: 0;
  width: 15px;
}

.form-field .errorlist {
  color: var(--theme-danger-text, var(--sold));
  font-size: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.project-logo-field a {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 13px;
  overflow-wrap: anywhere;
}

.project-form-actions {
  background: var(--theme-subtle, #f8faf8);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 16px 20px;
}

.project-admin-preview {
  align-self: start;
  align-content: start;
  background:
    linear-gradient(180deg, var(--theme-surface, #fff), var(--theme-subtle, #fbfcfb)),
    radial-gradient(circle at top right, rgba(15, 122, 98, .12), transparent 38%);
  display: grid;
  gap: 16px;
  padding: 18px;
  position: sticky;
  top: 84px;
}

.project-preview-logo {
  align-content: center;
  aspect-ratio: 16 / 9;
  background: var(--theme-subtle, #f4f6f3);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.project-preview-logo img {
  display: block;
  max-height: 120px;
  max-width: 100%;
  object-fit: contain;
}

.project-preview-logo span {
  color: var(--muted);
  font-size: 24px;
  letter-spacing: 5px;
}

.project-preview-logo strong {
  color: var(--text);
  font-size: 24px;
  letter-spacing: 4px;
}

.project-preview-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.project-preview-title-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-preview-title-line > strong {
  font-size: 20px;
  overflow-wrap: anywhere;
}

.project-preview-list div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding-bottom: 10px;
}

.project-preview-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.project-preview-list dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.project-preview-list dd {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  margin: 0;
  overflow-wrap: anywhere;
}

.users-heading,
.user-form-heading {
  align-items: flex-end;
}

.user-form-heading .breadcrumbs {
  margin-bottom: 12px;
}

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

.users-panel,
.user-form-card,
.user-role-help {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.users-table td strong {
  display: block;
  font-size: 14px;
}

.users-table td small {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 11px;
  font-weight: 800;
}

.role-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 8px;
  white-space: nowrap;
}

.role-admin {
  background: var(--theme-success-soft, #e4f3ea);
  color: var(--theme-success-text, var(--accent-dark));
}

.role-manager {
  background: var(--theme-info-soft, #eef3fb);
  color: var(--theme-info-text, #275c94);
}

.role-agent,
.role-viewer {
  background: var(--theme-hover, #f1f1ed);
  color: var(--muted);
}

.user-form-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
}

.user-edit-form {
  display: grid;
  gap: 18px;
}

.user-form-section {
  display: grid;
  gap: 12px;
}

.user-form-section h2,
.user-role-help h2 {
  font-size: 17px;
  margin: 0;
}

.user-form-section p {
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

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

.unit-create-card {
  background:
    linear-gradient(180deg, var(--theme-glass, rgba(255, 255, 255, 0.96)), var(--theme-surface, rgba(255, 255, 255, 1))),
    radial-gradient(circle at top right, rgba(18, 141, 101, 0.08), transparent 34%);
  padding: 0;
  overflow: hidden;
}

.unit-create-form {
  display: grid;
  gap: 0;
}

.unit-form-section {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  padding: 20px;
}

.unit-form-section:last-of-type {
  border-bottom: 0;
}

.unit-form-section-head {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
}

.unit-form-section-head > span {
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--theme-success-line, #cce4d9);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 30px;
  justify-content: center;
  letter-spacing: .04em;
  width: 42px;
}

.unit-form-section-head h2 {
  color: var(--text);
  font-size: 19px;
  letter-spacing: 0;
  margin: 0 0 3px;
}

.unit-form-section-head p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.unit-form-grid {
  gap: 12px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.unit-form-grid-areas {
  grid-template-columns: repeat(3, minmax(160px, 1fr));
}

.unit-form-grid-money {
  grid-template-columns: repeat(3, minmax(170px, 1fr));
}

.unit-create-form .form-field {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-line, #e3e5df);
  border-radius: 8px;
  gap: 7px;
  padding: 10px 11px 11px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.unit-create-form .form-field:focus-within {
  background: var(--theme-surface, #fbfefd);
  border-color: var(--theme-success-text, rgba(9, 114, 84, 0.42));
  box-shadow: 0 0 0 3px rgba(9, 114, 84, 0.09);
}

.unit-create-form .form-field > span {
  color: var(--theme-muted, #66736f);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .045em;
  line-height: 1.2;
  text-transform: uppercase;
}

.unit-create-form .form-field input,
.unit-create-form .form-field select,
.unit-create-form .form-field textarea {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 760;
  min-height: 30px;
  outline: none;
  padding: 0;
}

.unit-create-form .form-field input::placeholder {
  color: var(--theme-muted, #a2aaa5);
  font-weight: 600;
}

.unit-create-form .errorlist {
  color: var(--theme-danger-text, #b42318);
  font-size: 12px;
  font-weight: 700;
  list-style: none;
  margin: 2px 0 0;
  padding: 0;
}

.unit-create-form .project-form-actions {
  background: var(--theme-subtle, #fbfbf8);
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 16px 20px;
}

.user-access-grid {
  align-items: end;
}

.user-active-field {
  min-height: 42px;
}

.user-project-access-field ul {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
}

.user-project-access-field label {
  align-items: center;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  padding: 9px 10px;
}

.user-project-access-field input {
  accent-color: var(--theme-success-text, var(--accent));
  width: auto;
}

.user-role-help {
  align-content: start;
  display: grid;
  gap: 14px;
}

.user-role-help dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

.user-role-help div {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 5px;
  padding-bottom: 12px;
}

.user-role-help div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.user-role-help dt {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
}

.user-role-help dd {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.account-heading {
  align-items: flex-end;
}

.account-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
}

.account-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.account-side {
  align-content: start;
  display: grid;
  gap: 16px;
}

.account-summary-card {
  display: grid;
  gap: 14px;
}

.account-summary-card h2,
.account-access-card h2,
.account-language-card h2 {
  font-size: 17px;
  margin: 0;
}

.account-avatar {
  align-items: center;
  background: var(--accent);
  border-radius: 18px;
  color: #fff;
  display: inline-flex;
  font-size: 28px;
  font-weight: 850;
  height: 72px;
  justify-content: center;
  width: 72px;
}

.account-meta {
  display: grid;
  gap: 10px;
  margin: 0;
}

.account-meta div {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding-top: 10px;
}

.account-meta dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.account-meta dd {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  margin: 0;
  overflow-wrap: anywhere;
}

.account-access-card,
.account-language-card {
  display: grid;
  gap: 12px;
}

.account-access-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.account-language-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.workspace-settings-heading {
  align-items: flex-end;
}

.workspace-config-form {
  width: 100%;
  max-width: 1120px;
  min-width: 0;
}

.workspace-config-section {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
  min-width: 0;
}

.workspace-config-section:first-of-type {
  padding-top: 8px;
}

.workspace-config-section-head {
  display: flex;
  align-items: center;
  align-self: start;
  gap: 10px;
  padding-top: 8px;
  min-width: 0;
}

.workspace-config-section-head > span {
  display: inline-flex;
  color: var(--theme-success-text, var(--accent));
}

.workspace-config-section-head h2 {
  font-size: 16px;
  line-height: 1.4;
  letter-spacing: 0;
  margin: 0;
}

.workspace-config-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 20px;
  min-width: 0;
}

.workspace-config-fields .form-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  min-width: 0;
  margin: 0;
}

.workspace-config-fields .form-field > span,
.workspace-config-fields .form-field > label {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

.workspace-config-fields input:not([type="checkbox"]):not([type="file"]),
.workspace-config-fields select,
.workspace-config-fields textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 14px;
}

.workspace-config-fields input:not([type="checkbox"]):not([type="file"]),
.workspace-config-fields select {
  height: 42px;
}

.workspace-config-fields textarea {
  min-height: 112px;
  resize: vertical;
}

.workspace-config-fields small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.workspace-config-logo {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-width: 0;
  padding-top: 4px;
}

.workspace-config-logo > img,
.workspace-config-logo-placeholder {
  width: 88px;
  height: 88px;
  object-fit: contain;
  box-sizing: border-box;
  padding: 10px;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workspace-config-logo-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.workspace-config-logo .custom-file-picker,
.workspace-config-logo .custom-file-current {
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  overflow-wrap: anywhere;
}

.workspace-config-actions {
  display: flex;
  justify-content: flex-end;
  padding: 20px 0;
}

@media (max-width: 1100px) {
  .workspace-config-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }
}

@media (max-width: 600px) {
  .workspace-config-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }

  .workspace-config-logo {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

.workspace-settings-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 360px);
}

.workspace-settings-card,
.workspace-preview-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.workspace-settings-form,
.workspace-settings-side {
  display: grid;
  gap: 18px;
}

.workspace-settings-form .user-form-grid {
  align-items: start;
}

.form-field-wide {
  grid-column: 1 / -1;
}

.workspace-preview-card {
  display: grid;
  gap: 12px;
}

.workspace-preview-card > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace-preview-logo {
  max-height: 62px;
  max-width: 220px;
  object-fit: contain;
}

.workspace-preview-card h2 {
  font-size: 18px;
  margin: 0;
}

.workspace-preview-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.workspace-preview-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.workspace-preview-card dl div {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding-top: 10px;
}

.workspace-preview-card dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.workspace-preview-card dd {
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
  margin: 0;
  overflow-wrap: anywhere;
}

.link-danger {
  color: var(--theme-danger-text, var(--sold));
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.link-muted {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.link-muted:hover,
.link-danger:hover {
  text-decoration: underline;
}

.table-wrap {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: calc(100vh - 180px);
  overflow: auto;
  scroll-margin-top: 18px;
}

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

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

th {
  background: var(--theme-hover, #f0f1ed);
  color: var(--theme-text, #4b504f);
  font-size: 12px;
  letter-spacing: 0;
  position: sticky;
  top: 0;
  text-transform: uppercase;
  z-index: 2;
}

tbody tr:nth-child(even) td {
  background: var(--theme-subtle, #fbfbf8);
}

tbody tr:hover td {
  background: var(--theme-subtle, #edf6f2);
}

.clickable-row {
  cursor: pointer;
}

.numeric {
  text-align: right;
  white-space: nowrap;
}

.numeric .sort-link {
  justify-content: flex-end;
  width: auto;
}

.sticky-col {
  background: var(--theme-surface, #fff);
  position: sticky;
}

th.sticky-col {
  background: var(--theme-hover, #f0f1ed);
  z-index: 5;
}

td.sticky-col {
  z-index: 3;
}

tbody tr:nth-child(even) td.sticky-col {
  background: var(--theme-subtle, #fbfbf8);
}

tbody tr:hover td.sticky-col {
  background: var(--theme-subtle, #edf6f2);
}

.sticky-status {
  left: 0;
  min-width: 104px;
}

.sticky-room {
  left: 104px;
  min-width: 118px;
}

.project-units-table .sticky-room {
  box-sizing: border-box;
  left: 0;
  max-width: 170px;
  min-width: 170px;
  width: 170px;
}

.project-units-table .sticky-status {
  box-sizing: border-box;
  left: 170px;
  max-width: 112px;
  min-width: 112px;
  width: 112px;
}

.sort-link {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 6px;
  min-height: 24px;
  text-decoration: none;
}

.sort-link > .ui-stable-label {
  flex-shrink: 0;
  white-space: nowrap;
}

.sort-link > span:not(.ui-stable-label) {
  color: var(--theme-muted, #87908d);
  font-size: 13px;
  line-height: 1;
}

.sort-link.active,
.sort-link.active > span:not(.ui-stable-label),
.sort-link:hover {
  color: var(--theme-success-text, var(--accent-dark));
}

.room {
  font-weight: 750;
}

.room a {
  color: var(--theme-success-text, var(--accent-dark));
  text-decoration: none;
}

.room a:hover {
  text-decoration: underline;
}

.status {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 750;
  padding: 4px 8px;
  white-space: nowrap;
}

.status.available {
  background: var(--theme-success-soft, #e4f3ea);
  color: var(--theme-success-text, var(--available));
}

.status.sold {
  background: var(--theme-danger-soft, #f7e6e6);
  color: var(--theme-danger-text, var(--sold));
}

.status.reserved {
  background: var(--theme-info-soft, #e7eefc);
  color: var(--theme-info-text, #315c9e);
}

.status.manual {
  background: var(--theme-hover, #eef1ef);
  color: var(--theme-muted, #59645f);
}

.messages {
  margin-bottom: 18px;
}

.message {
  background: var(--theme-success-soft, #e6f2ed);
  border: 1px solid var(--theme-success-line, #c1ded3);
  border-radius: 6px;
  color: var(--theme-success-text, var(--accent-dark));
  padding: 12px 14px;
}

.message.error {
  background: var(--theme-danger-soft, #f7e6e6);
  border-color: var(--theme-danger-line, #e5bcbc);
  color: var(--theme-danger-text, var(--sold));
}

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

.unit-hero {
  margin-bottom: 18px;
}

.unit-hero-main,
.unit-gallery-card,
.unit-plan-card,
.unit-price-card,
.unit-info-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.unit-hero-main {
  display: grid;
  gap: 16px;
  padding: 18px 20px;
}

.unit-title-row {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.unit-title-row h1 {
  font-size: clamp(26px, 2.4vw, 34px);
  letter-spacing: 0;
  line-height: 1.12;
  margin-bottom: 6px;
}

.unit-title-row p {
  color: var(--muted);
  font-weight: 650;
  margin: 0;
}

.unit-title-row .status {
  margin-top: 4px;
}

.unit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.unit-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(280px, .95fr) minmax(280px, .95fr) minmax(300px, .8fr);
  margin-bottom: 14px;
}

.unit-overview {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(230px, .95fr) minmax(250px, 1fr) minmax(220px, .9fr) minmax(250px, 1fr);
  margin-bottom: 14px;
}

.unit-overview-villa {
  grid-template-columns: minmax(280px, 1.05fr) minmax(300px, 1.1fr) minmax(220px, .85fr) minmax(250px, 1fr);
}

.unit-overview-sold .unit-price-card {
  background: var(--theme-subtle, #fbfbf8);
}

.unit-overview-sold .unit-main-price {
  color: var(--muted);
}

.unit-gallery-card,
.unit-plan-card,
.unit-price-card,
.unit-info-card {
  padding: 16px;
}

.unit-gallery-main {
  align-items: start;
  background:
    linear-gradient(135deg, rgba(10, 71, 61, 0.42), var(--theme-glass, rgba(255, 255, 255, 0.08))),
    linear-gradient(150deg, var(--theme-success-soft, #d9e7e1), var(--theme-hover, #a7bfb5) 45%, #657f7b);
  border-radius: 7px;
  display: flex;
  min-height: 220px;
  padding: 12px;
}

.unit-gallery-main span {
  background: var(--theme-glass, rgba(255, 255, 255, 0.9));
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
  font-weight: 750;
  padding: 7px 10px;
}

.unit-thumbs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 8px;
}

.unit-thumbs span {
  background: linear-gradient(150deg, var(--theme-subtle, #eef5f2), var(--theme-hover, #bccfc8));
  border-radius: 6px;
  min-height: 46px;
}

.unit-plan-card {
  display: grid;
  gap: 14px;
}

.unit-plan-card h2,
.unit-price-card h2,
.unit-info-card h2 {
  font-size: 16px;
  margin: 0;
}

.plan-placeholder {
  align-content: center;
  background:
    linear-gradient(var(--theme-hover, #d2d8d5) 1px, transparent 1px),
    linear-gradient(90deg, var(--theme-hover, #d2d8d5) 1px, transparent 1px),
    var(--theme-subtle, #f6f7f5);
  background-size: 34px 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 220px;
  text-align: center;
}

.plan-placeholder span {
  color: var(--muted);
  font-size: 15px;
}

.plan-placeholder strong {
  color: var(--text);
  font-size: 22px;
}

.unit-price-card {
  align-content: start;
  display: grid;
  gap: 12px;
}

.unit-price-card > div:first-child {
  align-items: start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.price-date {
  background: var(--theme-success-soft, #e2f3eb);
  border-radius: 999px;
  color: var(--theme-success-text, var(--available));
  font-size: 12px;
  font-weight: 750;
  padding: 5px 8px;
}

.unit-main-price {
  color: var(--text);
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1;
}

.unit-price-sqm {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.unit-sold-note {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
  padding: 10px 12px;
}

.price-breakdown {
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  margin-top: 8px;
}

.price-breakdown span {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 11px 12px;
}

.price-breakdown span:last-child {
  border-bottom: 0;
}

.price-breakdown small {
  color: var(--muted);
}

.price-breakdown strong {
  font-size: 13px;
  text-align: right;
}

.villa-price-components {
  background: var(--theme-subtle, #fbfbf8);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.villa-price-components h3 {
  color: var(--text);
  font-size: 13px;
  margin: 0;
}

.villa-price-components dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.villa-price-components div {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 9px 0;
}

.villa-price-components div:first-child {
  border-top: 0;
  padding-top: 0;
}

.villa-price-components div:last-child {
  padding-bottom: 0;
}

.villa-price-components dt {
  color: var(--muted);
  font-size: 12px;
}

.villa-price-components dd {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.unit-spec-card dd {
  overflow-wrap: anywhere;
}

.unit-key-card {
  align-content: start;
}

.unit-key-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

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

.unit-key-grid div {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 6px;
  min-height: 82px;
  padding: 12px;
}

.unit-key-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.unit-key-grid strong {
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.unit-key-grid strong small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 750;
  margin-top: 4px;
}

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

.unit-source-card {
  align-content: start;
}

.unit-source-file {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 12px;
}

.unit-source-file strong {
  font-size: 20px;
}

.unit-source-file span {
  color: var(--muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.unit-info-grid {
  align-items: stretch;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.3fr) minmax(260px, .9fr);
  margin-bottom: 14px;
}

.unit-info-grid-two {
  align-items: start;
  grid-template-columns: minmax(360px, 1.15fr) minmax(280px, .85fr);
}

.unit-status-grid {
  grid-template-columns: minmax(0, 1fr);
}

.unit-info-card {
  align-content: start;
  display: grid;
  gap: 14px;
}

.unit-card-head {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.unit-card-head .status {
  flex: 0 0 auto;
}

.unit-info-card dl {
  display: grid;
  gap: 0;
  margin: 0;
}

.unit-info-card dl div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 0;
}

.unit-info-card dl div:last-child {
  border-bottom: 0;
}

.unit-info-card dt {
  color: var(--muted);
  font-size: 13px;
}

.unit-info-card dd {
  font-weight: 750;
  margin: 0;
  text-align: right;
}

.unit-price-trend {
  align-items: end;
  display: flex;
  gap: 8px;
  min-height: 150px;
}

.unit-price-trend span {
  align-items: center;
  display: grid;
  flex: 1 1 0;
  gap: 7px;
  grid-template-rows: 110px auto;
  min-width: 20px;
}

.unit-price-trend i {
  align-self: end;
  background: linear-gradient(180deg, #51b98d, var(--accent));
  border-radius: 5px 5px 2px 2px;
  display: block;
  min-height: 4px;
}

.unit-price-trend small {
  font-size: 10px;
  text-align: center;
}

.unit-price-history-card p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.unit-price-timeline {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.unit-price-timeline-row {
  align-items: center;
  background: var(--theme-surface, #fff);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  min-height: 64px;
  padding: 12px 14px;
}

.unit-price-timeline-row:last-child {
  border-bottom: 0;
}

.unit-price-timeline-row.current {
  background: var(--theme-success-soft, #eaf5f0);
}

.unit-price-timeline-row.first {
  background: var(--theme-subtle, #fbfbf8);
}

.unit-price-timeline-row.muted-row {
  background: var(--theme-subtle, #f7f7f4);
}

.unit-price-timeline-row.no-change {
  background: var(--theme-subtle, #f7f7f4);
}

.unit-price-timeline-row.no-change strong {
  color: var(--muted);
}

.unit-price-timeline-row span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.unit-price-timeline-row small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.unit-price-timeline-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
}

.unit-price-timeline-row strong {
  color: var(--text);
  font-size: 17px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.unit-price-timeline-row.current strong {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 20px;
}

.unit-price-timeline-row b {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.unit-overview .unit-price-history-card {
  gap: 10px;
}

.unit-overview .unit-price-timeline-row {
  gap: 10px;
  min-height: 50px;
  padding: 9px 10px;
}

.unit-overview .unit-price-timeline-row small,
.unit-overview .unit-price-timeline-row em,
.unit-overview .unit-price-timeline-row b {
  font-size: 11px;
}

.unit-overview .unit-price-timeline-row strong {
  font-size: 15px;
}

.unit-overview .unit-price-timeline-row.current strong {
  font-size: 17px;
}

.unit-overview .unit-timeline-more summary {
  padding: 10px;
}

.unit-timeline-more,
.unit-history-more {
  background: var(--theme-subtle, #f7f7f4);
  border-bottom: 1px solid var(--line);
}

.unit-timeline-more summary,
.unit-history-more summary {
  color: var(--theme-success-text, var(--accent-dark));
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  padding: 12px 14px;
}

.unit-timeline-more summary::-webkit-details-marker,
.unit-history-more summary::-webkit-details-marker {
  display: none;
}

.unit-timeline-more summary::after,
.unit-history-more summary::after {
  content: "↓";
  float: right;
}

.unit-timeline-more[open] summary::after,
.unit-history-more[open] summary::after {
  content: "↑";
}

.unit-timeline-more-list,
.unit-manual-history-scroll {
  display: grid;
  max-height: 260px;
  overflow: auto;
}

.unit-timeline-more-list .unit-price-timeline-row {
  border-top: 1px solid var(--line);
}

.unit-price-history-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.unit-price-history-list div {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.unit-price-history-list div:last-child {
  border-bottom: 0;
}

.unit-price-history-list span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.unit-price-history-list strong {
  color: var(--text);
}

.unit-price-history-list small {
  color: var(--muted);
  font-size: 12px;
}

.unit-price-history-list b {
  font-size: 13px;
  white-space: nowrap;
}

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

.activity-list span {
  border-left: 3px solid var(--accent);
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 3px;
  padding-left: 10px;
}

.activity-list strong {
  color: var(--text);
}

.unit-availability-card {
  align-content: start;
  gap: 12px;
}

.unit-status-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(260px, .85fr) minmax(360px, 1.15fr);
}

.unit-status-source {
  display: grid;
  gap: 10px;
}

.unit-status-layout-readonly {
  grid-template-columns: minmax(0, 1fr);
}

.unit-availability-status {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.unit-availability-status-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.unit-availability-status-line > span:not(.status) {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.unit-availability-status p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.unit-availability-facts {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 0;
  grid-template-columns: 1fr;
  padding: 0;
}

.unit-info-card .unit-availability-facts div {
  align-items: start;
  border-bottom: 1px solid var(--line);
  border-right: 0;
  display: grid;
  gap: 3px;
  justify-content: stretch;
  padding: 9px 10px;
}

.unit-info-card .unit-availability-facts div:last-child {
  border-bottom: 0;
}

.unit-availability-facts dd {
  text-align: left;
}

.unit-manual-control-inline {
  display: grid;
  gap: 12px;
}

.unit-manual-inline-head {
  display: grid;
  gap: 8px;
}

.unit-manual-inline-head h3 {
  font-size: 15px;
  margin: 0 0 4px;
}

.unit-manual-inline-head p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.unit-manual-current {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  margin-top: 10px;
  padding: 10px;
}

.unit-manual-current strong {
  color: var(--text);
  font-size: 13px;
}

.unit-manual-current span,
.unit-manual-current p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}

.unit-manual-control-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.unit-availability-card .unit-manual-control-grid {
  grid-template-columns: 1fr;
}

.unit-manual-control-state {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  padding: 12px;
}

.unit-manual-control-state strong {
  color: var(--text);
  font-size: 14px;
}

.unit-manual-control-state span,
.unit-manual-control-state p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.unit-manual-resolution {
  background: var(--theme-subtle, #edf6f2);
  border: 1px solid var(--theme-success-line, #cfe6dc);
  border-radius: 7px;
  display: grid;
  gap: 3px;
  margin-top: 9px;
  padding: 9px 10px;
}

.unit-manual-resolution strong {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
}

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

.unit-manual-status-panel {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.unit-manual-status-panel summary {
  color: var(--theme-success-text, var(--accent-dark));
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  padding: 12px;
}

.unit-manual-status-panel summary::-webkit-details-marker {
  display: none;
}

.unit-manual-status-panel summary::after {
  content: "↓";
  float: right;
}

.unit-manual-status-panel[open] summary::after {
  content: "↑";
}

.unit-manual-status-note,
.unit-manual-status-form {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.unit-manual-status-panel .unit-manual-status-form {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.unit-manual-form-head {
  display: grid;
  gap: 3px;
}

.unit-manual-form-head strong {
  color: var(--text);
  font-size: 13px;
}

.unit-manual-form-head small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.unit-manual-status-fields {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, .45fr) minmax(150px, .35fr) minmax(0, 1fr);
}

.unit-manual-status-fields.compact {
  grid-template-columns: minmax(160px, .36fr) minmax(0, 1fr);
}

.unit-manual-status-note strong {
  font-size: 13px;
}

.unit-manual-status-note span,
.unit-manual-status-note p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.unit-manual-status-form textarea {
  resize: vertical;
  width: 100%;
}

.unit-manual-status-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.unit-manual-status-actions .button {
  justify-self: start;
}

.unit-manual-history {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  overflow: hidden;
}

.unit-manual-history summary {
  color: var(--theme-success-text, var(--accent-dark));
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style: none;
  padding: 12px;
}

.unit-manual-history summary::-webkit-details-marker {
  display: none;
}

.unit-manual-history summary::after {
  content: "↓";
  float: right;
}

.unit-manual-history[open] > summary::after {
  content: "↑";
}

.unit-manual-history-head {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.unit-manual-history-head strong {
  font-size: 13px;
}

.unit-manual-history-head small {
  color: var(--muted);
  font-size: 12px;
}

.unit-manual-history-list {
  display: grid;
  gap: 8px;
}

.unit-manual-history > .unit-manual-history-list {
  border-top: 1px solid var(--line);
  max-height: 190px;
  overflow: auto;
  padding: 12px;
}

.unit-history-more {
  border: 0;
  border-radius: 7px;
}

.unit-history-more summary {
  padding: 8px 10px;
}

.unit-manual-history-scroll {
  gap: 8px;
  max-height: 260px;
  padding: 0 10px 10px;
}

.unit-manual-history-item {
  border-left: 2px solid var(--theme-success-text, rgba(9, 114, 84, 0.3));
  display: grid;
  gap: 4px;
  grid-template-columns: auto minmax(0, 1fr);
  padding-left: 10px;
}

.unit-manual-history-item > .status {
  align-self: start;
  grid-row: span 2;
  margin-top: 1px;
}

.unit-manual-history-item div {
  display: grid;
  gap: 2px;
}

.unit-manual-history-item b {
  color: var(--text);
  font-size: 13px;
}

.unit-manual-history-item span,
.unit-manual-history-item p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.unit-manual-history-item > .status.available {
  color: var(--theme-success-text, var(--available));
}

.unit-manual-history-item > .status.reserved {
  color: var(--theme-info-text, #315c9e);
}

.unit-manual-history-item > .status.sold {
  color: var(--theme-danger-text, var(--sold));
}

.unit-presence-alert,
.unit-presence-note {
  border-radius: 8px;
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 12px;
}

.unit-presence-alert {
  background: var(--theme-warning-soft, #fff3df);
  border: 1px solid var(--theme-warning-line, #f0d4a7);
}

.unit-presence-alert strong {
  color: var(--theme-warning-text, #9a5a00);
  font-size: 13px;
}

.unit-presence-alert span,
.unit-presence-note {
  color: var(--muted);
  font-size: 13px;
}

.unit-presence-note {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
}

.control-kpi-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  margin-bottom: 14px;
}

.control-kpi-grid article,
.control-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
}

.control-kpi-grid article {
  display: grid;
  gap: 7px;
  min-height: 112px;
  padding: 16px;
}

.control-kpi-grid span,
.control-kpi-grid small {
  color: var(--muted);
  font-size: 13px;
}

.control-kpi-grid strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.control-layout {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .36fr);
}

.control-main,
.control-sidebar {
  display: grid;
  gap: 14px;
}

.control-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.control-card h2 {
  font-size: 16px;
  margin: 0;
}

.control-list,
.control-event-list {
  display: grid;
  gap: 9px;
}

.control-unit-row {
  align-items: center;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: inherit;
  display: grid;
  gap: 5px 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 11px 12px;
  text-decoration: none;
}

.control-unit-row:hover {
  border-color: var(--theme-success-text, rgba(9, 114, 84, 0.35));
}

.control-unit-action-row {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.control-unit-action-row form {
  margin: 0;
}

.control-unit-action-row.compact {
  align-items: stretch;
  grid-template-columns: 1fr;
}

.control-unit-action-row.compact .button {
  width: 100%;
}

.control-unit-row.danger {
  background: var(--theme-warning-soft, #fff7f2);
  border-color: var(--theme-warning-line, #f0d4c2);
}

.control-unit-row .status {
  align-self: start;
  grid-row: span 2;
}

.control-unit-row strong {
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.control-unit-row small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.control-list.compact .control-unit-row {
  grid-template-columns: minmax(0, 1fr);
}

.control-event-list a {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: inherit;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 8px 0;
  text-decoration: none;
}

.control-event-list a:last-child {
  border-bottom: 0;
}

.control-event-list span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.control-event-list strong {
  color: var(--text);
  font-size: 13px;
}

.control-event-list small,
.control-event-list em,
.empty-muted {
  color: var(--muted);
  font-size: 12px;
}

.control-event-list em {
  font-style: normal;
  white-space: nowrap;
}

.control-archive-card {
  margin-top: 14px;
  padding: 0;
}

.control-archive > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  font-size: 15px;
  font-weight: 800;
  justify-content: space-between;
  list-style: none;
  padding: 16px;
}

.control-archive > summary::-webkit-details-marker {
  display: none;
}

.control-archive > summary::after {
  color: var(--muted);
  content: "⌄";
  font-size: 18px;
  margin-left: 10px;
  transition: transform .2s ease;
}

.control-archive[open] > summary::after {
  transform: rotate(180deg);
}

.control-archive > summary strong {
  background: var(--theme-subtle, #edf6f2);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
  margin-left: auto;
  min-width: 28px;
  padding: 5px 8px;
  text-align: center;
}

.control-archive > .control-list {
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}

.unit-quality-card {
  margin-bottom: 14px;
}

.internal-notes-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  margin-bottom: 14px;
  padding: 0;
}

.internal-notes-details {
  display: block;
}

.internal-notes-summary::-webkit-details-marker,
.internal-note-add summary::-webkit-details-marker {
  display: none;
}

.internal-notes-summary::after {
  color: var(--muted);
  content: "↓";
  float: right;
}

.internal-notes-details[open] > .internal-notes-summary::after {
  content: "↑";
}

.internal-notes-layout {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  padding: 14px;
}

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

.internal-note,
.internal-note-form {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.internal-note-add {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.internal-note-add summary {
  color: var(--theme-success-text, var(--accent-dark));
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
  list-style: none;
  padding: 12px;
}

.internal-note-add summary::after {
  content: "↓";
  float: right;
}

.internal-note-add[open] summary::after {
  content: "↑";
}

.internal-note-add .internal-note-form {
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
}

.internal-note-form {
  align-items: end;
  grid-template-columns: minmax(0, 1fr) auto;
}

.internal-note p,
.internal-notes-empty {
  color: var(--text);
  font-size: 13px;
  margin: 0;
}

.internal-note span,
.internal-notes-empty {
  color: var(--muted);
  font-size: 12px;
}

.internal-note-actions {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
}

.internal-note-actions details {
  flex: 0 0 auto;
  min-width: 0;
}

.internal-note-actions details[open] {
  flex-basis: 100%;
}

.internal-note-actions summary {
  color: var(--theme-success-text, var(--accent-dark));
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.internal-note-actions form {
  margin: 0;
}

.internal-note-delete-form {
  flex: 0 0 auto;
}

.internal-note-edit-form {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.internal-note-edit-form textarea {
  min-height: 76px;
  resize: vertical;
  width: 100%;
}

.internal-note-edit-form .button {
  justify-self: start;
}

.internal-note-form textarea {
  min-height: 76px;
  resize: vertical;
  width: 100%;
}

.internal-note-form .button {
  align-self: end;
  justify-self: end;
  min-height: 42px;
  white-space: nowrap;
}

.type-settings-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  margin-bottom: 16px;
}

.dictionary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.dictionary-card {
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-rows: auto auto 1fr auto;
  text-decoration: none;
}

.dictionary-card:hover,
.dictionary-card:focus-visible {
  border-color: var(--accent);
}

.dictionary-card-icon {
  color: var(--theme-success-text, var(--accent-dark));
}

.dictionary-card h2 {
  font-size: 18px;
  margin: 0;
}

.dictionary-card p,
.dictionary-card small,
.district-row-info small,
.system-dictionary-row p,
.system-dictionary-row small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.district-settings-layout {
  align-items: start;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
}

.district-settings-layout > section {
  min-width: 0;
}

.dictionary-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.district-row,
.system-dictionary-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  padding: 14px 0;
}

.district-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.district-row-info {
  display: grid;
  gap: 5px;
  overflow-wrap: anywhere;
}

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

.dictionary-row-actions .button {
  font-size: 12px;
  min-height: 34px;
  padding: 6px 9px;
}

.system-dictionary-row {
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  overflow-wrap: anywhere;
}

@media (max-width: 1180px) {
  .district-settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .district-row,
  .system-dictionary-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }
}

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

.type-rule-item {
  align-items: center;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px;
}

.type-rule-item span {
  display: grid;
  gap: 3px;
}

.type-rule-item small {
  color: var(--muted);
}

.type-source-table-wrap {
  overflow-x: auto;
}

.type-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 280px;
}

.type-quick-actions button,
.type-inline-action button {
  background: var(--theme-subtle, #f0f7f4);
  border: 1px solid var(--theme-success-line, #cfe4d9);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
}

.type-inline-action button.link-danger,
.type-inline-action .link-danger {
  background: var(--theme-danger-soft, #fff3f3);
  border-color: var(--theme-danger-line, #e9b8b8);
  color: var(--theme-danger-text, #b42318);
}

.unit-quality-head {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.unit-quality-head h2 {
  margin: 0 0 4px;
}

.unit-quality-head p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.unit-history-section {
  display: grid;
  gap: 12px;
}

.similar-units-section {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.similar-units-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.similar-unit-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(18, 24, 39, 0.04);
  color: var(--text);
  display: grid;
  gap: 6px;
  padding: 13px;
  text-decoration: none;
}

.similar-unit-card > div {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.similar-unit-card:hover {
  background: var(--accent-soft);
  border-color: var(--theme-success-line, #beded0);
  color: var(--theme-success-text, var(--accent-dark));
}

.similar-unit-card strong {
  font-size: 16px;
}

.similar-unit-card em {
  background: var(--theme-success-soft, #eaf5f0);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 5px 7px;
  white-space: nowrap;
}

.similar-unit-card span,
.similar-unit-card small {
  color: var(--muted);
  font-size: 12px;
}

.similar-unit-card b {
  font-size: 15px;
}

.units-kpi-grid {
  margin-bottom: 14px;
}

.units-filter-info {
  grid-column: 1 / -1;
  grid-template-columns: minmax(130px, 170px) minmax(280px, 1fr) 140px 120px 120px;
  max-width: 930px;
}

.units-filter-groups {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.units-table {
  min-width: 1320px;
}

.units-table-wrap {
  max-height: calc(100vh - 220px);
}

[data-unit-table-wrap] thead th {
  z-index: 4;
}

[data-unit-table-wrap] thead th.sticky-col {
  z-index: 5;
}

.unit-table-details {
  align-items: center;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  white-space: nowrap;
}

.unit-table-details b {
  color: var(--text);
  font-weight: 850;
}

.unit-table-area-stack {
  align-items: flex-end;
  display: inline-grid;
  gap: 3px 8px;
  grid-template-columns: auto auto;
  justify-content: end;
  min-width: 86px;
}

.unit-table-area-stack small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  text-align: right;
}

.unit-table-area-stack strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.unit-history-price-parts {
  display: grid;
  gap: 3px;
  justify-items: end;
}

.unit-history-price-parts small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.15;
  white-space: nowrap;
}

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

.section-head h2 {
  margin: 0 0 4px;
}

.history-table {
  max-height: none;
}

.report-panel {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  padding: 16px;
}

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

.report-metrics span {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  padding: 12px;
}

.report-metrics strong {
  color: var(--text);
  display: block;
  font-size: 24px;
}

.report-metrics small {
  color: var(--theme-warning-text, #9a6a16);
  display: block;
  font-size: 9px;
  margin-top: 3px;
}

.report-file {
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  min-width: 0;
  padding-top: 14px;
}

.report-file strong {
  color: var(--text);
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.report-inventory-note {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 1fr) minmax(360px, 1.4fr);
  margin-bottom: 16px;
  padding: 16px;
}

.report-inventory-note > div:first-child span {
  color: var(--theme-success-text, var(--accent));
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.report-inventory-note h2 {
  font-size: 18px;
  margin: 0 0 6px;
}

.report-inventory-note p {
  color: var(--muted);
  margin: 0;
}

.inventory-comparison-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.inventory-comparison-grid span {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.inventory-comparison-grid small {
  color: var(--muted);
  display: block;
  font-size: 12px;
}

.inventory-comparison-grid strong {
  display: block;
  font-size: 22px;
  margin-top: 3px;
}

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

.report-list {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
  padding: 14px;
}

.report-list h2 {
  font-size: 16px;
  margin: 0 0 4px;
}

.report-list a {
  background: var(--theme-subtle, #f7f7f4);
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
  padding: 8px 10px;
  text-decoration: none;
}

.report-list a:hover {
  background: var(--theme-subtle, #edf6f2);
  color: var(--theme-success-text, var(--accent-dark));
}

.analytics-v2-panel {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  overflow: hidden;
  padding: 16px;
}

.analytics-v2-head {
  align-items: start;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.analytics-v2-head span {
  color: var(--theme-success-text, #08755a);
  display: inline-block;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.analytics-v2-head h2 {
  font-size: 22px;
  margin: 0 0 4px;
}

.analytics-v2-head p {
  color: var(--muted);
  margin: 0;
}

.analytics-v2-table-wrap {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-height: min(680px, calc(100vh - 124px));
  overflow: auto;
  scrollbar-gutter: stable;
}

.analytics-v2-table {
  border-collapse: collapse;
  min-width: 1480px;
  width: 100%;
}

.analytics-v2-table th,
.analytics-v2-table td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: middle;
}

.analytics-v2-table th {
  background: var(--theme-subtle, #f7f7f4);
  box-shadow: 0 1px 0 var(--line), 0 5px 12px rgba(18, 24, 39, 0.05);
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  position: sticky;
  top: 0;
  white-space: nowrap;
  z-index: 4;
}

.analytics-v2-table tr:last-child td {
  border-bottom: 0;
}

.analytics-v2-table .numeric {
  text-align: right;
  white-space: nowrap;
}

.analytics-presale-sold {
  color: var(--theme-warning-text, #9a6a16);
  display: block;
  font-size: 9px;
  margin-top: 3px;
}

.analytics-v2-project {
  color: var(--text);
  display: grid;
  gap: 3px;
  min-width: 180px;
  text-decoration: none;
}

.analytics-v2-project strong {
  font-size: 14px;
}

.analytics-v2-project span,
.analytics-v2-value-stack span {
  color: var(--muted);
  font-size: 12px;
}

.analytics-v2-value-stack {
  display: grid;
  gap: 3px;
}

.analytics-v2-value-stack strong {
  font-size: 14px;
}

.analytics-v2-signal-list {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 220px;
}

.analytics-v2-signal {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  padding: 5px 8px;
}

.signal-good {
  background: var(--theme-success-soft, #e8f6ef);
  border-color: var(--theme-success-line, #b8e0cd);
  color: var(--theme-success-text, #08755a);
}

.signal-neutral {
  background: var(--theme-info-soft, #eef4ff);
  border-color: var(--theme-info-line, #c8d8ff);
  color: var(--theme-info-text, #2452a5);
}

.signal-watch {
  background: var(--theme-warning-soft, #fff7e6);
  border-color: var(--theme-warning-line, #f6d28b);
  color: var(--theme-warning-text, #a45c00);
}

.signal-alert {
  background: var(--theme-danger-soft, #fff1f2);
  border-color: var(--theme-danger-line, #fecdd3);
  color: var(--theme-danger-text, #be123c);
}

.analytics-panel {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 16px;
  overflow: hidden;
  padding: 16px;
}

.analytics-overview-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
}

.analytics-filter-panel {
  align-items: end;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(140px, 180px) minmax(240px, 1fr) minmax(170px, 220px) auto auto;
  margin-bottom: 16px;
  padding: 12px;
}

.analytics-filter-panel label {
  min-width: 0;
}

.analytics-filter-panel label span {
  color: var(--muted);
  font-size: 12px;
}

.analytics-filter-panel select {
  width: 100%;
}

.analytics-filter-panel .button,
.analytics-filter-panel .link-reset {
  align-items: center;
  align-self: end;
  display: inline-flex;
  min-height: 40px;
}

.analytics-filter-panel .link-reset:not(.button) {
  padding: 0 2px;
}

.analytics-project-filter {
  min-width: min(320px, 100%);
}

.analytics-project-filter label {
  display: grid;
  gap: 5px;
}

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

.analytics-project-filter select {
  width: 100%;
}

.analytics-selected-project {
  align-items: center;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  justify-content: space-between;
  margin-bottom: 14px;
  padding: 12px;
}

.analytics-selected-project strong {
  font-size: 18px;
}

.analytics-selected-project span {
  color: var(--muted);
  font-size: 13px;
}

.analytics-object-kpis {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.analytics-object-kpi {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  min-height: 118px;
  padding: 13px;
}

.analytics-object-kpi span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.analytics-object-kpi strong {
  color: var(--text);
  font-size: clamp(18px, 1.45vw, 23px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.analytics-object-kpi small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.analytics-smart-insights {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
  padding-top: 16px;
}

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

.analytics-insight {
  align-items: start;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-left: 4px solid var(--theme-line, #9ca3af);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  min-height: 86px;
  padding: 12px;
}

.analytics-insight strong,
.analytics-insight span {
  display: block;
}

.analytics-insight strong {
  font-size: 14px;
  margin-bottom: 4px;
}

.analytics-insight span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.analytics-insight-good {
  border-left-color: var(--theme-success-text, #16865c);
}

.analytics-insight-watch {
  border-left-color: var(--theme-warning-text, #f59e0b);
}

.analytics-insight-alert {
  border-left-color: var(--theme-danger-text, #dc2626);
}

.analytics-insight-neutral {
  border-left-color: var(--theme-line, #64748b);
}

.analytics-category-sales {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
}

.analytics-subhead h3 {
  font-size: 16px;
  margin: 0 0 3px;
}

.analytics-subhead p {
  font-size: 13px;
}

.analytics-category-bars {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

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

.analytics-head h2 {
  font-size: 18px;
  margin: 0 0 4px;
}

.analytics-kpis {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  min-width: min(680px, 100%);
}

.analytics-kpis span {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  padding: 10px;
}

.analytics-kpis strong {
  color: var(--text);
  display: block;
  font-size: 20px;
}

.analytics-kpis-compact {
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  min-width: min(340px, 100%);
}

.trend-summary-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  margin-bottom: 12px;
}

.trend-summary-card {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.trend-summary-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  text-transform: uppercase;
}

.trend-summary-card strong {
  font-size: 26px;
  line-height: 1;
}

.trend-summary-card small {
  font-size: 13px;
}

.trend-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: auto;
}

.trend-table {
  min-width: 620px;
}

.trend-table th {
  position: static;
}

.trend-table td,
.trend-table th {
  padding: 9px 10px;
}

.insight-list,
.category-bars,
.recent-imports {
  display: grid;
  gap: 10px;
}

.insight-item {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 12px;
}

.insight-item strong {
  color: var(--text);
  font-size: 14px;
}

.insight-item span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.category-bar-row {
  display: grid;
  gap: 8px;
}

.category-bar-row > div {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.category-bar-row strong {
  font-size: 14px;
}

.category-bar-row strong small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-left: 4px;
}

.category-bar-row span {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.category-bar-row i {
  background: var(--theme-subtle, #eef2ef);
  border-radius: 999px;
  display: block;
  height: 8px;
  overflow: hidden;
}

.category-bar-row b {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 4px;
}

.category-comparison-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.category-comparison-card {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.category-comparison-card > div {
  display: grid;
  gap: 3px;
}

.category-comparison-card strong {
  font-size: 15px;
}

.category-comparison-card span {
  color: var(--muted);
  font-size: 13px;
}

.category-comparison-card i {
  background: var(--theme-subtle, #eef2ef);
  border-radius: 999px;
  display: block;
  height: 8px;
  overflow: hidden;
}

.category-comparison-card b {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 4px;
}

.category-comparison-card dl {
  display: grid;
  gap: 7px 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 0;
}

.category-comparison-card dt {
  color: var(--muted);
  font-size: 12px;
}

.category-comparison-card dd {
  font-size: 13px;
  font-weight: 750;
  margin: 0;
  text-align: right;
  white-space: nowrap;
}

.analytics-chart-wide {
  border-top: 0;
  padding-top: 0;
}

.analytics-table {
  max-height: none;
}

.analytics-table table {
  min-width: 1480px;
}

.analytics-trend-table {
  min-width: 820px;
}

.data-quality-summary {
  margin-bottom: 16px;
}

.plan-control-summary .summary-card.is-zero {
  background: var(--theme-subtle, #f8faf9);
  box-shadow: none;
}

.plan-control-summary .summary-card.is-zero strong {
  color: var(--theme-muted, #85918c);
}

.plan-control-filter-panel,
.plan-control-projects {
  margin-bottom: 16px;
}

.plan-control-filter label {
  min-width: min(360px, 100%);
}

.plan-control-projects {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 14px;
  padding: 16px;
}

.plan-control-project-table-wrap,
.plan-control-issue-table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
}

.plan-control-project-table {
  min-width: 980px;
}

.plan-control-project-table td,
.plan-control-project-table th,
.plan-control-issue-table td,
.plan-control-issue-table th {
  padding: 9px 10px;
}

.plan-control-project-table td:first-child > small,
.plan-control-issue-table td small {
  color: var(--muted);
  display: block;
  font-size: 11px;
  margin-top: 3px;
}

.plan-control-project-name {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.plan-control-project-name:hover {
  color: var(--theme-success-text, var(--accent-dark));
  text-decoration: underline;
}

.plan-control-plan-counts {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.plan-control-plan-counts b {
  color: var(--text);
}

.plan-control-coverage {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.plan-control-coverage > span {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.plan-control-coverage strong {
  font-size: 13px;
}

.plan-control-coverage small {
  color: var(--muted);
  font-size: 10px;
}

.plan-control-coverage > i {
  background: var(--theme-hover, #e8eeeb);
  border-radius: 999px;
  display: block;
  height: 6px;
  overflow: hidden;
}

.plan-control-coverage > i > b {
  background: var(--accent);
  border-radius: inherit;
  display: block;
  height: 100%;
  min-width: 2px;
}

.plan-control-no-data {
  color: var(--muted);
}

.plan-control-project-table td.numeric a {
  color: var(--theme-success-text, var(--accent-dark));
  font-weight: 850;
  text-decoration: none;
}

.plan-control-overview {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 16px;
}

.plan-control-overview-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-left: 4px solid var(--theme-line, #aebbb5);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 5px;
  min-height: 118px;
  padding: 14px;
  text-decoration: none;
}

.plan-control-overview-card:hover {
  box-shadow: 0 10px 26px rgba(18, 24, 39, .06);
}

.plan-control-overview-card.error {
  border-left-color: var(--theme-danger-text, #b42318);
}

.plan-control-overview-card.warning {
  border-left-color: var(--theme-warning-text, #d97706);
}

.plan-control-overview-card.neutral {
  border-left-color: var(--theme-line, #66847a);
}

.plan-control-overview-card.is-zero {
  background: var(--theme-subtle, #f8faf9);
  box-shadow: none;
  opacity: .68;
}

.plan-control-overview-card > span {
  font-size: 12px;
  font-weight: 850;
}

.plan-control-overview-card > strong {
  font-size: 25px;
  line-height: 1;
}

.plan-control-overview-card > small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.plan-control-group.neutral {
  border-color: var(--theme-line, #c8d6d0);
}

.plan-control-group-badge {
  background: var(--theme-subtle, #eef3f1);
  border: 1px solid var(--theme-line, #d4dfda);
  border-radius: 999px;
  color: var(--theme-muted, #52675f);
  font-size: 10px;
  font-weight: 850;
  padding: 6px 9px;
}

.plan-control-group-badge.error {
  background: var(--theme-danger-soft, #fff0ef);
  border-color: var(--theme-danger-line, #e9c1bd);
  color: var(--theme-danger-text, #a1322a);
}

.plan-control-group-badge.warning {
  background: var(--theme-warning-soft, #fff7e8);
  border-color: var(--theme-warning-line, #edd5a8);
  color: var(--theme-warning-text, #986000);
}

.plan-control-issue-table {
  min-width: 1160px;
}

.plan-control-match-list {
  display: grid;
  gap: 4px;
  min-width: 190px;
}

.plan-control-match-list a,
.plan-control-match-list span {
  color: var(--theme-text, #41544c);
  font-size: 11px;
  line-height: 1.3;
}

.plan-control-match-list a {
  font-weight: 750;
  text-decoration-color: var(--theme-muted, #aebeb7);
  text-underline-offset: 2px;
}

.plan-control-complete {
  margin-top: 0;
}

.data-quality-panel {
  margin-bottom: 16px;
}

.data-quality-filter {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.data-quality-filter label {
  min-width: 190px;
}

.data-quality-filter .data-quality-check {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: inline-flex;
  gap: 8px;
  min-height: 38px;
  min-width: 0;
  padding: 0 12px;
}

.data-quality-filter .data-quality-check input {
  flex: 0 0 auto;
  height: 17px;
  margin: 0;
  min-height: 17px;
  padding: 0;
  width: 17px;
}

.data-quality-active-filters {
  align-items: center;
  border-top: 1px solid var(--line);
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
}

.data-quality-active-filters span {
  font-weight: 800;
}

.data-quality-active-filters strong,
.data-quality-active-filters em {
  background: var(--theme-subtle, #f3f6f4);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 6px 9px;
}

.data-quality-active-filters em {
  background: var(--theme-success-soft, #e9f5ef);
  border-color: var(--theme-success-line, #c9dfd5);
  color: var(--theme-success-text, var(--accent-dark));
}

.data-quality-overview {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
}

.data-quality-overview-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.data-quality-overview-card {
  background: var(--theme-subtle, #fbfbf8);
  border: 1px solid var(--line);
  border-left: 4px solid var(--theme-line, #c8c1b4);
  border-radius: 8px;
  color: var(--muted);
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px 14px;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.data-quality-overview-card:hover {
  box-shadow: 0 12px 28px rgba(18, 24, 39, 0.06);
  transform: translateY(-1px);
}

.data-quality-overview-card.error {
  border-left-color: var(--theme-danger-text, #b42318);
}

.data-quality-overview-card.warning {
  border-left-color: var(--theme-warning-text, #d97706);
}

.data-quality-overview-card.active {
  background: var(--theme-subtle, #eef8f4);
  border-color: var(--theme-success-line, #bad7cb);
  border-left-color: var(--theme-success-text, var(--accent));
}

.data-quality-overview-card span {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-quality-overview-card strong {
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.data-quality-overview-card em {
  color: var(--text);
  font-size: 14px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.25;
}

.data-quality-overview-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.data-quality-groups {
  display: grid;
  gap: 16px;
}

.data-quality-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 14px;
  padding: 16px;
}

.data-quality-group.error {
  border-color: var(--theme-danger-line, #e8b3b3);
}

.data-quality-group.warning {
  border-color: var(--theme-warning-line, #ecd4aa);
}

.data-quality-group h2 span {
  color: var(--muted);
  font-size: 14px;
}

.data-quality-group-actions,
.data-quality-row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.data-quality-row-actions {
  justify-content: flex-start;
}

.data-quality-row-actions form {
  margin: 0;
}

.data-quality-group td small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  margin-top: 2px;
}

.quality-row-acknowledged {
  opacity: 0.62;
}

.data-quality-more {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.recent-import-item {
  align-items: center;
}

.recent-import-metrics {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.recent-import-metrics b {
  background: var(--theme-hover, #f0f1ed);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  padding: 4px 8px;
  white-space: nowrap;
}

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

.price-mover-list,
.stale-project-list {
  display: grid;
  gap: 8px;
}

.price-mover-list h3 {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  text-transform: uppercase;
}

.price-mover-list a,
.stale-project-list a {
  align-items: center;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
  text-decoration: none;
}

.price-mover-list a:hover,
.stale-project-list a:hover {
  background: var(--accent-soft);
  border-color: var(--theme-success-line, #beded0);
  color: var(--theme-success-text, var(--accent-dark));
}

.price-mover-list span,
.stale-project-list span {
  color: var(--muted);
  display: grid;
  font-size: 13px;
  gap: 2px;
  min-width: 0;
}

.price-mover-list strong,
.stale-project-list strong {
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-mover-list small {
  color: var(--muted);
  font-size: 12px;
}

.price-mover-list b,
.stale-project-list b {
  background: var(--theme-hover, #f0f1ed);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  padding: 5px 8px;
  white-space: nowrap;
}

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

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

.analytics-chart {
  border-top: 1px solid var(--line);
  min-width: 0;
  overflow: hidden;
  padding-top: 12px;
}

.analytics-chart h3 {
  font-size: 13px;
  margin: 0 0 10px;
  text-transform: uppercase;
}

.bar-chart {
  align-items: end;
  display: flex;
  gap: 6px;
  max-width: 100%;
  min-height: 150px;
  overflow-x: auto;
  padding-bottom: 4px;
  width: 100%;
}

.bar-point {
  align-items: center;
  display: grid;
  flex: 0 0 20px;
  gap: 6px;
  grid-template-rows: 18px 112px auto;
  padding-left: 0;
}

.bar-point.year-start {
  border-left: 1px solid var(--theme-line, #cfd5d1);
  flex-basis: 32px;
  padding-left: 8px;
}

.bar-point em {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
  grid-row: 1;
  line-height: 1;
  opacity: 0;
  text-align: center;
}

.bar-point.year-start em {
  opacity: 1;
}

.bar-point span {
  align-self: end;
  background: var(--accent);
  border-radius: 4px 4px 2px 2px;
  display: block;
  grid-row: 2;
  min-height: 2px;
  width: 100%;
}

.bar-point.alert span {
  background: var(--sold);
}

.bar-point.price span {
  background: #756b35;
}

.bar-point small {
  color: var(--muted);
  font-size: 9px;
  grid-row: 3;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.history-timeline {
  display: grid;
  gap: 22px;
}

.history-summary-grid {
  grid-template-columns: repeat(6, minmax(130px, 1fr));
}

.type-settings-layout > .workspace-settings-card:first-child {
  align-self: start;
}

.custom-file-current,
.custom-file-picker {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-file-current {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
  padding: 10px 12px;
}

.custom-file-current > span:first-child,
.custom-file-picker > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.custom-file-current > a {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
  font-weight: 750;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.custom-file-clear {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

.custom-file-clear input {
  flex: 0 0 auto;
  height: 16px;
  margin: 0;
  min-height: 16px;
  min-width: 16px;
  padding: 0;
  width: 16px;
}

.custom-file-native {
  height: 1px !important;
  opacity: 0;
  overflow: hidden;
  padding: 0 !important;
  pointer-events: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 1px !important;
}

.custom-file-picker {
  /* Keep focus on the hidden input inside the scrolling form, not the document. */
  position: relative;
}

.custom-file-picker .button {
  font-size: 12px;
  min-height: 36px;
  padding: 8px 12px;
}

.custom-file-picker > span.has-file {
  color: var(--text);
}

.history-monthly-panel {
  display: grid;
  gap: 12px;
}

.history-monthly-panel h2 {
  margin: 0 0 4px;
}

.history-monthly-panel p {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
}

.history-monthly-panel .table-wrap {
  max-height: 360px;
}

.history-year-group {
  display: grid;
  gap: 12px;
}

.history-year-group > summary {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(18, 24, 39, 0.035);
  cursor: pointer;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
  padding: 14px 16px;
}

.history-year-group > summary::-webkit-details-marker {
  display: none;
}

.history-year-group > summary > span:not(.ui-stable-label) {
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
}

.history-year-group > summary small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.history-year-group > summary::after {
  color: var(--theme-success-text, var(--accent-dark));
  content: '+';
  font-size: 20px;
  line-height: 1;
}

.history-year-group[open] > summary::after {
  content: '−';
}

.history-entry {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.history-entry-signal {
  border-color: var(--theme-warning-line, #e5c485);
  box-shadow: 0 12px 28px rgba(154, 90, 0, 0.08);
}

.history-entry-head {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.history-entry-head h2 {
  font-size: 20px;
  margin: 0 0 4px;
}

.history-actions {
  display: flex;
  justify-content: flex-end;
}

.history-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.history-signals span {
  background: var(--theme-warning-soft, #fff3df);
  border: 1px solid var(--theme-warning-line, #f0d4a7);
  border-radius: 999px;
  color: var(--theme-warning-text, #9a5a00);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
}

.history-metrics {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  margin-bottom: 14px;
}

.history-metrics span {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  padding: 10px;
}

.history-metrics strong {
  color: var(--text);
  display: block;
  font-size: 22px;
}

.history-details {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.history-details summary {
  align-items: center;
  color: var(--theme-success-text, var(--accent-dark));
  cursor: pointer;
  display: flex;
  font-size: 14px;
  font-weight: 800;
  gap: 12px;
  justify-content: space-between;
  list-style: none;
}

.history-details summary::-webkit-details-marker {
  display: none;
}

.history-details summary::after {
  content: '+';
  font-size: 18px;
  line-height: 1;
}

.history-details[open] summary::after {
  content: '−';
}

.history-details summary > span:not(.ui-stable-label) {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.history-details .history-lists {
  margin-top: 12px;
}

.history-lists a {
  align-items: center;
  display: inline-flex;
  flex: 0 1 auto;
  line-height: 1.25;
  max-width: 100%;
  min-height: 26px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
  white-space: nowrap;
}

.history-lists div {
  align-items: flex-start;
  align-content: flex-start;
  flex-direction: column;
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.history-lists h3 {
  flex-basis: auto;
  width: 100%;
}

.history-lists .history-more {
  background: transparent;
  border: 1px dashed var(--theme-line, #c6cec9);
  color: var(--theme-success-text, var(--accent-dark));
}

.history-lists .history-more:hover {
  background: var(--theme-subtle, #edf6f2);
}

@media (max-width: 900px) {
  .app-shell {
    display: flex;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .sidebar {
    gap: 12px;
    border-bottom: 1px solid var(--line);
    border-right: 0;
    height: auto;
    min-height: auto;
    overflow-y: visible;
    position: relative;
    flex: 0 0 auto;
    padding: 12px 14px;
  }

  .app-main {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
  }

  .side-nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .side-subnav {
    display: none;
  }

  .side-nav-bottom {
    display: none;
  }

  .side-nav-label {
    display: none;
  }

  .side-nav-link {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 8px 11px;
    white-space: nowrap;
  }

  .side-nav-link:hover {
    transform: none;
  }

  .topbar {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px 18px;
  }

  .global-search {
    flex: 0 0 auto;
    max-width: none;
    width: 100%;
  }

  .global-search-results {
    max-height: min(560px, calc(100vh - 102px));
    width: 100%;
  }

  .topbar-widgets {
    flex-wrap: nowrap;
    justify-content: flex-start;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .language-switcher {
    order: 1;
  }

  .user-chip {
    order: 2;
  }

  .logout-form {
    order: 3;
  }

  .fx-rates {
    order: 4;
  }

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

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

  .mapping-fields {
    max-height: none;
  }

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

  .page {
    padding: 24px 18px 40px;
  }

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

  .home-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-grid,
  .quick-actions-grid {
    grid-template-columns: 1fr;
  }

  .project-import-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

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

  .project-import-actions {
    justify-content: flex-start;
  }

  .import-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .units-page-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

  .media-workspace,
  .media-cover-stack {
    grid-template-columns: 1fr;
  }

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

  .users-summary-grid,
  .user-form-layout,
  .account-layout,
  .workspace-settings-layout {
    grid-template-columns: 1fr;
  }

  .import-result-kpis {
    grid-template-columns: 1fr;
  }

  .project-hero {
    grid-template-columns: minmax(0, 1fr) 120px;
  }

  .project-hero-main,
  .project-hero-actions {
    grid-column: 1 / -1;
  }

  .project-hero-actions {
    display: grid;
  }

  .project-meta,
  .project-kpi-grid,
  .project-overview-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unit-hero {
    grid-template-columns: 1fr;
  }

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

  .unit-layout,
  .unit-info-grid {
    grid-template-columns: 1fr;
  }

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

  .filter-group-search,
  .units-filter-info,
  .filter-group-characteristics,
  .filter-group-price {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-price-summary,
  .change-metrics {
    grid-template-columns: 1fr;
  }

  .current-price-card {
    flex-direction: column;
  }

  .current-price-facts {
    justify-content: flex-start;
  }

  .analytics-head {
    flex-direction: column;
  }

  .analytics-v2-head {
    flex-direction: column;
  }

  .analytics-kpis {
    min-width: 0;
    width: 100%;
  }

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

  .report-metrics,
  .report-grid,
  .report-inventory-note,
  .analytics-overview-grid,
  .analytics-filter-panel,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .history-entry-head {
    flex-direction: column;
  }
}

@media (max-width: 620px) {
  .side-nav {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow-x: visible;
    padding-bottom: 0;
  }

  .side-nav-link {
    font-size: 13px;
    gap: 6px;
    justify-content: center;
    min-width: 0;
    padding: 8px 6px;
  }

  .topbar-widgets {
    display: grid;
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    overflow: visible;
    padding-bottom: 0;
    width: 100%;
  }

  .language-switcher {
    grid-column: 1;
    grid-row: 1;
  }

  .user-chip {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
  }

  .logout-form {
    grid-column: 3;
    grid-row: 1;
  }

  .fx-rates {
    display: grid;
    gap: 5px;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .fx-rates span {
    font-size: 11px;
    min-width: 0;
    padding: 7px 5px;
    white-space: nowrap;
  }

  .mapping-file-head,
  .mapping-preview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mapping-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .side-nav-link {
    font-size: 12px;
    gap: 4px;
    padding-inline: 4px;
  }
}

@media (max-width: 1350px) and (min-width: 901px) {
  .user-chip {
    display: inline-flex;
    padding: 5px;
  }

  .user-chip > span:not(.avatar) {
    display: none;
  }

  .global-search {
    max-width: 460px;
  }

  .project-hero {
    grid-template-columns: minmax(260px, 330px) 118px minmax(0, 1fr);
  }

  .project-hero-actions {
    display: grid;
    grid-column: 1 / -1;
  }

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

  .units-filter-info {
    grid-template-columns: minmax(130px, 170px) minmax(260px, 1fr) minmax(126px, 150px);
    max-width: none;
  }

  .filter-group-characteristics {
    grid-template-columns: minmax(180px, 1fr) repeat(2, 90px);
  }

  .filter-group-price {
    grid-template-columns: 68px repeat(2, 128px);
  }

  .filter-search-input {
    flex-basis: 170px;
  }

  .analytics-filter-panel {
    grid-template-columns: minmax(140px, 180px) minmax(220px, 1fr) minmax(160px, 200px) auto auto;
  }
}

@media (max-width: 560px) {
  .dashboard-search {
    align-items: stretch;
    flex-direction: column;
  }

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

  .import-choice-row {
    align-items: start;
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .import-choice-action {
    grid-column: 2;
    justify-self: start;
  }

  .project-hero,
  .project-meta,
  .project-insight-grid,
  .project-kpi-grid,
  .project-overview-layout,
  .media-workspace,
  .media-cover-stack,
  .project-admin-layout,
  .project-form-grid,
  .users-summary-grid,
  .user-form-layout,
  .account-layout,
  .workspace-settings-layout,
  .user-form-grid,
  .import-review-summary,
  .internal-notes-layout,
  .type-settings-layout {
    grid-template-columns: 1fr;
  }

  .project-logo-card {
    display: none;
  }

  .metrics,
  .analytics-overview-grid,
  .analytics-filter-panel,
  .analytics-grid-two,
  .price-movers-grid,
  .trend-summary-grid,
  .filter-group-search,
  .units-filter-info,
  .filter-group-characteristics,
  .filter-group-price,
  .filter-advanced-grid,
  .analytics-kpis,
  .history-metrics,
  .history-lists {
    grid-template-columns: 1fr;
  }

  .filter-search-input {
    flex: 0 1 190px;
    max-width: 220px;
  }

  .project-import-row {
    padding: 12px;
  }

  .project-import-meta {
    grid-template-columns: 1fr;
  }

  .project-import-actions {
    flex-direction: column;
  }

  .filter-dropdown {
    flex: 1 1 calc(50% - 8px);
  }

  .filter-toolbar > .filter-select {
    flex: 0 0 136px;
    inline-size: 136px;
    max-width: 136px;
    width: 136px;
  }

  .filter-dropdown summary {
    justify-content: space-between;
    width: 100%;
  }

  .filter-dropdown-menu,
  .filter-dropdown-wide .filter-dropdown-menu,
  .filter-dropdown-range .filter-dropdown-menu,
  .filter-dropdown-price .filter-dropdown-menu {
    left: 0;
    right: auto;
    width: min(100%, calc(100vw - 56px));
  }

  .filter-range-menu,
  .filter-dropdown-price .filter-range-menu {
    grid-template-columns: 1fr;
  }

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

/* Presentation-only client shortlist preview. */
.client-preview-page {
  background:
    radial-gradient(circle at 14% 0, rgba(15, 122, 98, .09), transparent 32%),
    var(--theme-subtle, #f2f5f3);
  height: auto;
  min-height: 100%;
  overflow: auto;
}

.client-preview-toolbar {
  align-items: center;
  backdrop-filter: blur(14px);
  background: var(--theme-glass, rgba(255, 255, 255, .94));
  border-bottom: 1px solid var(--theme-line, #dce5e0);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  min-height: 66px;
  padding: 10px max(20px, calc((100vw - 1380px) / 2));
  position: sticky;
  top: 0;
  z-index: 20;
}

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

.client-preview-brand img {
  border-radius: 10px;
  height: 40px;
  object-fit: contain;
  width: 40px;
}

.client-preview-brand > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.client-preview-brand strong {
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-preview-brand small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.client-preview-toolbar-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.client-preview-currencies {
  background: var(--theme-hover, #edf2ef);
  border-radius: 9px;
  display: inline-flex;
  padding: 3px;
}

.client-preview-currencies a {
  border-radius: 7px;
  color: var(--theme-muted, #68756f);
  font-size: 10px;
  font-weight: 850;
  padding: 7px 9px;
  text-decoration: none;
}

.client-preview-currencies a.is-active {
  background: var(--theme-surface, #fff);
  box-shadow: 0 2px 7px rgba(22, 47, 38, .1);
  color: var(--theme-success-text, var(--accent-dark));
}

.client-preview-document {
  margin: 0 auto;
  max-width: 1420px;
  padding: 22px 20px 34px;
}

.client-preview-hero {
  background:
    radial-gradient(circle at 90% 15%, var(--theme-glass, rgba(255, 255, 255, .16)), transparent 28%),
    linear-gradient(135deg, #0b5f4c, #123e32);
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(18, 55, 42, .16);
  color: #fff;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) minmax(480px, .9fr);
  margin-bottom: 18px;
  overflow: hidden;
  padding: 28px 30px;
}

.client-preview-hero-copy {
  align-content: center;
  display: grid;
  min-width: 0;
}

.client-preview-hero-copy > span {
  color: #bfe8d8;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.client-preview-hero-copy h1 {
  font-size: clamp(31px, 4.2vw, 52px);
  letter-spacing: -.045em;
  line-height: 1;
  margin: 7px 0 9px;
  overflow-wrap: anywhere;
}

.client-preview-hero-copy p {
  color: rgba(255, 255, 255, .78);
  font-size: 13px;
  margin: 0;
}

.client-preview-summary {
  align-self: stretch;
  background: var(--theme-glass, rgba(255, 255, 255, .1));
  border: 1px solid var(--theme-line, rgba(255, 255, 255, .13));
  border-radius: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  overflow: hidden;
}

.client-preview-summary > span {
  align-content: center;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 13px 16px;
}

.client-preview-summary > span:nth-child(even) {
  border-left: 1px solid var(--theme-line, rgba(255, 255, 255, .12));
}

.client-preview-summary > span:nth-child(n + 3) {
  border-top: 1px solid var(--theme-line, rgba(255, 255, 255, .12));
}

.client-preview-summary small {
  color: rgba(255, 255, 255, .7);
  font-size: 9px;
  font-weight: 750;
}

.client-preview-summary strong {
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-preview-intro {
  align-items: start;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-line, #dce5e0);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  display: grid;
  gap: 5px;
  margin: -2px 0 18px;
  padding: 14px 17px;
}

.client-preview-intro > span {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.client-preview-intro p {
  color: var(--theme-text, #33473f);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

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

.client-preview-unit {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-line, #dce5e0);
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(21, 48, 38, .06);
  display: grid;
  grid-template-rows: 270px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
}

.client-preview-visual {
  background: var(--theme-subtle, #f4f7f5);
  min-height: 270px;
  overflow: hidden;
  position: relative;
}

.client-preview-carousel .media-carousel-open > img {
  background: var(--theme-surface, #fff);
  object-fit: contain;
  padding: 12px 16px 78px;
}

.client-preview-carousel .media-carousel-caption {
  bottom: 35px;
  left: 12px;
  padding: 7px 9px;
  right: 12px;
}

.client-preview-carousel .media-carousel-dots {
  bottom: 13px;
  max-width: calc(100% - 116px);
  overflow-x: auto;
  scrollbar-width: none;
}

.client-preview-carousel .media-carousel-dots::-webkit-scrollbar {
  display: none;
}

.client-preview-carousel .media-carousel-arrow {
  height: 34px;
  width: 34px;
}

.client-preview-carousel .media-carousel-arrow.is-previous {
  left: 9px;
}

.client-preview-carousel .media-carousel-arrow.is-next {
  right: 9px;
}

.client-preview-no-plan {
  align-content: center;
  color: var(--theme-muted, #718078);
  display: grid;
  gap: 8px;
  inset: 0;
  justify-items: center;
  position: absolute;
}

.client-preview-no-plan .ui-icon {
  height: 34px;
  opacity: .45;
  width: 34px;
}

.client-preview-no-plan strong {
  font-size: 12px;
}

.client-preview-unit-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 17px 18px 14px;
}

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

.client-preview-unit-head > div {
  min-width: 0;
}

.client-preview-unit-head small {
  color: var(--theme-success-text, var(--accent-dark));
  display: block;
  font-size: 10px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-preview-unit-head h2 {
  font-size: 27px;
  letter-spacing: -.035em;
  line-height: 1;
  margin: 5px 0 0;
}

.client-preview-unit-head .status {
  flex: 0 0 auto;
}

.client-preview-badges {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  min-height: 22px;
}

.client-preview-unit-note {
  background: var(--theme-warning-soft, #fff9e8);
  border: 1px solid var(--theme-warning-line, #eee0b8);
  border-radius: 9px;
  color: var(--theme-warning-text, #6f5819);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  margin: 10px 0 0;
  padding: 8px 10px;
}

.client-preview-readiness {
  background: var(--theme-subtle, #f1f4f2);
  border: 1px solid var(--theme-line, #dce3df);
  border-radius: 999px;
  color: var(--theme-muted, #596861);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  min-height: 22px;
  padding: 5px 8px;
}

.client-preview-price {
  align-items: end;
  background: var(--theme-subtle, #eef7f3);
  border: 1px solid var(--theme-success-line, #d5e9e0);
  border-radius: 11px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-top: 13px;
  padding: 10px 12px;
}

.client-preview-price > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.client-preview-price > span:last-child {
  text-align: right;
}

.client-preview-price small {
  color: var(--theme-muted, #61736b);
  font-size: 9px;
  font-weight: 750;
}

.client-preview-price strong {
  color: var(--theme-success-text, #0b5f4c);
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
}

.client-preview-price b {
  font-size: 12px;
  white-space: nowrap;
}

.client-preview-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 11px 0 0;
}

.client-preview-facts > div {
  border-bottom: 1px solid var(--theme-line, #edf1ef);
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 5px;
}

.client-preview-facts > div:nth-child(odd) {
  padding-left: 0;
  padding-right: 12px;
}

.client-preview-facts > div:nth-child(even) {
  border-left: 1px solid var(--theme-line, #edf1ef);
  padding-left: 12px;
  padding-right: 0;
}

.client-preview-facts dt {
  color: var(--muted);
  font-size: 9px;
}

.client-preview-facts dd {
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 2px;
  margin: 0;
  overflow-wrap: anywhere;
}

.client-preview-facts dd small {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 9px;
  font-weight: 750;
}

.client-preview-unit-body > footer {
  color: var(--muted);
  font-size: 9px;
  margin-top: auto;
  padding-top: 10px;
}

.client-preview-note {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 10px;
  gap: 8px;
  justify-content: center;
  padding: 22px 10px 0;
  text-align: center;
}

.client-preview-note strong {
  color: var(--theme-success-text, var(--accent-dark));
}

.client-preview-empty {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-line, #dce5e0);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  min-height: 310px;
  padding: 40px;
  text-align: center;
}

.client-preview-empty > .ui-icon {
  color: var(--theme-success-text, var(--accent));
  height: 42px;
  width: 42px;
}

.client-preview-empty h2 {
  margin: 16px 0 4px;
}

.client-preview-empty p {
  color: var(--muted);
  margin: 0 0 18px;
}

@media (max-width: 1050px) {
  .client-preview-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-preview-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-preview-unit {
    grid-template-columns: minmax(300px, .82fr) minmax(0, 1fr);
    grid-template-rows: minmax(340px, auto);
  }

  .client-preview-visual {
    min-height: 340px;
  }
}

@media (max-width: 760px) {
  .client-preview-toolbar {
    align-items: stretch;
    padding: 9px 12px;
    position: static;
  }

  .client-preview-brand small {
    display: none;
  }

  .client-preview-toolbar-actions > .button:first-of-type {
    display: none;
  }

  .client-preview-document {
    padding: 12px 10px 24px;
  }

  .client-preview-hero {
    border-radius: 14px;
    padding: 21px 18px;
  }

  .client-preview-unit {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 250px auto;
  }

  .client-preview-visual {
    min-height: 250px;
  }
}

@media (max-width: 520px) {
  .client-preview-toolbar {
    gap: 8px;
  }

  .client-preview-brand img {
    height: 34px;
    width: 34px;
  }

  .client-preview-brand > span {
    display: none;
  }

  .client-preview-toolbar-actions {
    gap: 5px;
  }

  .client-preview-currencies a {
    padding: 6px 7px;
  }

  .client-preview-back {
    min-width: 34px;
    padding: 7px 9px;
  }

  .client-preview-back b {
    display: none;
  }

  .client-preview-hero-copy h1 {
    font-size: 34px;
  }

  .client-preview-summary > span {
    padding: 11px 12px;
  }

  .client-preview-summary strong {
    font-size: 15px;
  }

  .client-preview-unit {
    grid-template-rows: 220px auto;
  }

  .client-preview-visual {
    min-height: 220px;
  }

  .client-preview-unit-body {
    padding: 14px;
  }

  .client-preview-price strong {
    font-size: 19px;
  }

  .client-preview-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-preview-facts > div:nth-child(odd),
  .client-preview-facts > div:nth-child(even) {
    border-left: 0;
    padding-inline: 0;
  }
}

@media print {
  .client-preview-page {
    background: #fff;
  }

  .client-preview-toolbar {
    display: none;
  }

  .client-preview-document {
    max-width: none;
    padding: 0;
  }

  .client-preview-hero,
  .client-preview-unit {
    box-shadow: none;
  }

  .client-preview-unit {
    break-inside: avoid;
  }
}

@media (max-width: 700px) {
  .unit-profile-visual.unit-profile-visual-plans {
    min-height: 310px;
  }
}

@media (max-width: 430px) {
  .unit-profile-visual.unit-profile-visual-plans {
    min-height: 300px;
  }
}

/* Inline project and unit media carousels */
.media-carousel {
  height: 100%;
  inset: 0;
  min-height: inherit;
  position: absolute;
}

.media-carousel-viewport {
  height: 100%;
  min-height: inherit;
  outline: 0;
  position: relative;
  touch-action: auto;
}

.media-carousel-slide {
  height: 100%;
  inset: 0;
  margin: 0;
  position: absolute;
}

.media-carousel-slide[hidden] {
  display: none;
}

.media-carousel-open {
  background: transparent;
  border: 0;
  cursor: zoom-in;
  display: block;
  height: 100%;
  padding: 0;
  width: 100%;
}

.media-carousel-open > img {
  display: block;
  height: 100%;
  width: 100%;
}

.media-carousel-arrow {
  align-items: center;
  backdrop-filter: blur(8px);
  background: var(--theme-glass, rgba(255, 255, 255, .9));
  border: 1px solid var(--theme-success-text, rgba(34, 68, 56, .18));
  border-radius: 50%;
  box-shadow: 0 7px 20px rgba(12, 37, 29, .18);
  color: var(--theme-success-text, #244b3d);
  cursor: pointer;
  display: flex;
  font-size: 27px;
  height: 38px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 3px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  z-index: 4;
}

.media-carousel-arrow:hover,
.media-carousel-arrow:focus-visible {
  background: var(--theme-surface, #fff);
  border-color: var(--theme-line, #78a893);
  outline: 0;
}

.media-carousel-arrow.is-previous {
  left: 12px;
}

.media-carousel-arrow.is-next {
  right: 12px;
}

.media-carousel-counter {
  backdrop-filter: blur(8px);
  background: rgba(24, 49, 41, .76);
  border: 1px solid var(--theme-line, rgba(255, 255, 255, .28));
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 850;
  padding: 6px 9px;
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 4;
}

.media-carousel-dots {
  align-items: center;
  bottom: 16px;
  display: flex;
  gap: 5px;
  justify-content: center;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  z-index: 4;
}

.media-carousel-dots button {
  background: var(--theme-hover, #b8c8c0);
  border: 2px solid var(--theme-line, rgba(255, 255, 255, .92));
  border-radius: 999px;
  cursor: pointer;
  height: 9px;
  padding: 0;
  transition: background .15s ease, width .15s ease;
  width: 9px;
}

.media-carousel-dots button.is-active {
  background: var(--accent);
  width: 23px;
}

.media-carousel-caption {
  backdrop-filter: blur(10px);
  background: var(--theme-glass, rgba(255, 255, 255, .92));
  border: 1px solid var(--theme-line, rgba(210, 225, 218, .94));
  border-radius: 11px;
  bottom: 40px;
  box-shadow: 0 8px 22px rgba(22, 56, 43, .12);
  display: grid;
  gap: 2px;
  left: 18px;
  max-width: calc(100% - 36px);
  padding: 8px 10px;
  position: absolute;
  right: 18px;
  z-index: 3;
}

.media-carousel-caption > span {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.media-carousel-caption strong {
  color: var(--theme-success-text, #1d3329);
  font-size: 13px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-carousel-caption small {
  color: var(--theme-muted, #6d7e75);
  font-size: 10px;
  min-height: 12px;
}

.project-visual.has-carousel::after,
.unit-profile-visual.unit-profile-visual-plans::after {
  display: none;
}

.project-media-carousel .media-carousel-open > img {
  object-fit: cover;
}

.project-media-carousel::after {
  background: linear-gradient(180deg, rgba(8, 31, 24, .08), transparent 38%, rgba(8, 31, 24, .34));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.project-media-carousel .project-visual-gallery {
  max-width: calc(100% - 118px);
  overflow-x: auto;
  padding: 3px 2px 2px;
  scrollbar-width: none;
}

.project-media-carousel .project-visual-gallery::-webkit-scrollbar {
  display: none;
}

.project-media-carousel .project-visual-gallery button.is-active img {
  border-color: var(--theme-line, #fff);
  opacity: 1;
  transform: translateY(-2px);
}

.project-media-carousel .media-carousel-counter {
  right: 14px;
  top: 14px;
}

.unit-profile-visual-plans {
  background: var(--theme-subtle, #f5f8f6);
}

.unit-media-carousel .media-carousel-open > img {
  background: var(--theme-surface, #fff);
  object-fit: contain;
  padding: 16px 22px 96px;
}

.unit-media-carousel .media-carousel-counter {
  right: 14px;
  top: 14px;
}

.unit-media-empty {
  align-content: center;
  display: grid;
  gap: 5px;
  inset: 0;
  justify-items: center;
  overflow: hidden;
  padding: 28px;
  position: absolute;
  text-align: center;
}

.unit-media-empty .unit-profile-visual-art {
  opacity: .28;
}

.unit-media-empty strong,
.unit-media-empty small {
  position: relative;
  z-index: 1;
}

.unit-media-empty strong {
  color: var(--theme-success-text, #29473b);
  font-size: 17px;
}

.unit-media-empty small {
  color: var(--theme-muted, #708078);
  font-size: 12px;
}

.media-viewer-dialog .unit-plan-dialog-canvas img {
  min-height: min(62vh, 420px);
}

.media-viewer-dialog .unit-plan-dialog-canvas {
  position: relative;
}

.media-viewer-arrow {
  align-items: center;
  backdrop-filter: blur(8px);
  background: var(--theme-glass, rgba(255, 255, 255, .9));
  border: 1px solid var(--theme-line, #d5e1db);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(12, 37, 29, .2);
  color: var(--theme-success-text, #244b3d);
  cursor: pointer;
  display: flex;
  font-size: 30px;
  height: 42px;
  justify-content: center;
  line-height: 1;
  padding: 0 0 4px;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  z-index: 2;
}

.media-viewer-arrow[hidden] {
  display: none;
}

.media-viewer-arrow.is-previous {
  left: 12px;
}

.media-viewer-arrow.is-next {
  right: 12px;
}

.unit-result-cover.has-plan {
  background-color: var(--theme-surface, #fff);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.unit-result-cover.has-plan::after {
  background: linear-gradient(180deg, rgba(15, 52, 39, .08), transparent 38%, rgba(15, 52, 39, .12));
}

.unit-quick-preview-visual.has-plan {
  background: var(--theme-surface, #fff);
}

.unit-quick-preview-visual.has-plan img {
  object-fit: contain;
  padding: 6px;
}

.unit-quick-preview-visual.has-plan::after {
  background: linear-gradient(transparent, var(--theme-glass, rgba(238, 245, 241, .88)));
}

.unit-quick-preview-visual.has-plan .unit-quick-preview-freshness {
  background: var(--theme-glass, rgba(255, 255, 255, .92));
  border-radius: 999px;
  color: var(--theme-success-text, #315548);
  padding: 4px 7px;
}

@media (max-width: 700px) {
  .media-carousel-arrow {
    height: 34px;
    width: 34px;
  }

  .media-carousel-arrow.is-previous {
    left: 8px;
  }

  .media-carousel-arrow.is-next {
    right: 8px;
  }

  .unit-media-carousel .media-carousel-open > img {
    padding: 10px 12px 82px;
  }

  .media-carousel-caption {
    bottom: 32px;
    left: 10px;
    padding: 6px 8px;
    right: 10px;
  }

  .media-carousel-dots {
    bottom: 10px;
  }

  .project-media-carousel .project-visual-gallery {
    max-width: calc(100% - 90px);
  }
}

/* Project plans and unit-plan presentation */
.unit-plans-section {
  background: linear-gradient(135deg, var(--theme-subtle, #f7fbf9) 0%, var(--theme-surface, #ffffff) 70%);
  border: 1px solid var(--theme-line, #dfe9e4);
  border-radius: 22px;
  margin: 18px 0;
  padding: 18px;
}

.unit-plans-section .section-head {
  margin-bottom: 14px;
}

.unit-plans-section .section-head h2 {
  margin-bottom: 3px;
}

.unit-plans-section .section-head p {
  color: var(--theme-muted, #718078);
  margin: 0;
}

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

.unit-plans-grid-single {
  grid-template-columns: minmax(0, 1fr);
}

.unit-plan-group {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-line, #e4ebe7);
  border-radius: 16px;
  min-width: 0;
  overflow: hidden;
}

.unit-plan-group-head {
  align-items: center;
  border-bottom: 1px solid var(--theme-line, #edf2ef);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 44px;
  padding: 9px 12px;
}

.unit-plan-group-head > span {
  color: var(--theme-success-text, #233c31);
  font-size: 13px;
  font-weight: 800;
}

.unit-plan-group-head small {
  color: var(--theme-muted, #77867e);
  font-size: 11px;
}

.unit-plan-thumbnails {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px;
  scrollbar-width: thin;
}

.unit-plan-thumbnail {
  background: var(--theme-subtle, #f8faf9);
  border: 1px solid var(--theme-line, #e5ebe8);
  border-radius: 12px;
  color: inherit;
  cursor: zoom-in;
  display: grid;
  flex: 0 0 min(100%, 380px);
  grid-template-columns: 124px minmax(0, 1fr);
  min-height: 112px;
  overflow: hidden;
  padding: 0;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.unit-plan-thumbnail:hover,
.unit-plan-thumbnail:focus-visible {
  border-color: var(--theme-line, #79a78f);
  box-shadow: 0 10px 24px rgba(33, 72, 54, .10);
  outline: 0;
  transform: translateY(-1px);
}

.unit-plan-thumbnail img {
  background: var(--theme-surface, #fff);
  height: 100%;
  object-fit: contain;
  width: 124px;
}

.unit-plan-thumbnail > span {
  align-self: center;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 12px;
}

.unit-plan-thumbnail strong {
  color: var(--theme-success-text, #1f3229);
  font-size: 13px;
  line-height: 1.3;
}

.unit-plan-thumbnail small {
  color: var(--theme-muted, #748178);
  font-size: 11px;
  line-height: 1.35;
}

.unit-plan-dialog {
  background: var(--theme-subtle, #f4f7f5);
  border: 0;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(15, 31, 23, .30);
  max-height: 92vh;
  max-width: min(94vw, 1500px);
  padding: 0;
  width: max-content;
}

.unit-plan-dialog::backdrop {
  background: rgba(12, 25, 19, .72);
  backdrop-filter: blur(3px);
}

.unit-plan-dialog-head {
  align-items: center;
  background: var(--theme-surface, #fff);
  border-bottom: 1px solid var(--theme-line, #e1e8e4);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 50px;
  padding: 8px 10px 8px 16px;
}

.unit-plan-dialog-head strong {
  color: var(--theme-success-text, #1e3429);
  font-size: 14px;
}

.unit-plan-dialog-head button {
  align-items: center;
  background: var(--theme-subtle, #edf3f0);
  border: 0;
  border-radius: 50%;
  color: var(--theme-text, #385346);
  cursor: pointer;
  display: flex;
  font-size: 23px;
  height: 34px;
  justify-content: center;
  line-height: 1;
  width: 34px;
}

.unit-plan-dialog-canvas {
  align-items: center;
  display: flex;
  justify-content: center;
  max-height: calc(92vh - 106px);
  max-width: 92vw;
  overflow: auto;
}

.unit-plan-dialog-canvas img {
  background: var(--theme-surface, #fff);
  display: block;
  max-height: calc(92vh - 106px);
  max-width: 92vw;
  object-fit: contain;
}

.unit-plan-dialog > .button {
  margin: 8px 12px;
}

.plan-admin-summary {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 240px));
  margin-bottom: 14px;
}

.plan-admin-summary > div {
  align-items: center;
  background: var(--theme-subtle, #f2f7f4);
  border: 1px solid var(--theme-line, #dce8e1);
  border-radius: 14px;
  display: flex;
  gap: 10px;
  padding: 10px 14px;
}

.plan-admin-summary strong {
  color: var(--theme-success-text, #20513a);
  font-size: 22px;
}

.plan-admin-summary span {
  color: var(--theme-muted, #65756c);
  font-size: 12px;
}

.plan-admin-workspace {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, .8fr);
  margin-bottom: 18px;
}

.plan-upload-card {
  max-width: none;
}

.plan-upload-form {
  display: grid;
  gap: 11px 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.plan-upload-form .plan-field-image,
.plan-upload-form .plan-field-title,
.plan-upload-form .plan-field-source_url {
  grid-column: span 2;
}

.plan-upload-form .button,
.plan-upload-form .form-error {
  grid-column: 1 / -1;
  justify-self: start;
}

.plan-admin-help {
  background: linear-gradient(145deg, #244f3b, #17382a);
  border-radius: 18px;
  color: #fff;
  padding: 20px;
}

.plan-admin-help > span {
  color: var(--theme-success-text, #acd3bf);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.plan-admin-help h2 {
  font-size: 20px;
  margin: 7px 0 18px;
}

.plan-admin-help dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.plan-admin-help dl > div {
  border-top: 1px solid var(--theme-line, rgba(255, 255, 255, .14));
  display: grid;
  gap: 3px;
  padding-top: 12px;
}

.plan-admin-help dt {
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.plan-admin-help dd {
  color: #c9ddd2;
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

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

.plan-admin-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-line, #e0e8e4);
  border-radius: 14px;
  min-width: 0;
  overflow: hidden;
}

.plan-admin-image {
  background: var(--theme-subtle, #f5f7f6);
  display: block;
  height: 170px;
  position: relative;
}

.plan-admin-image img {
  height: 100%;
  object-fit: contain;
  width: 100%;
}

.plan-admin-image span {
  background: rgba(25, 58, 43, .88);
  border-radius: 999px;
  bottom: 8px;
  color: #fff;
  font-size: 10px;
  left: 8px;
  padding: 4px 8px;
  position: absolute;
}

.plan-admin-card-body {
  display: grid;
  gap: 9px;
  padding: 11px;
}

.plan-admin-card-body > strong {
  color: var(--theme-success-text, #23372e);
  font-size: 12px;
  line-height: 1.35;
  min-height: 33px;
}

.plan-admin-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.plan-admin-tags span {
  background: var(--theme-subtle, #eff4f1);
  border-radius: 999px;
  color: var(--theme-muted, #607168);
  font-size: 10px;
  padding: 4px 7px;
}

.plan-admin-actions {
  align-items: center;
  display: flex;
  gap: 6px;
}

.plan-admin-actions form {
  margin: 0;
}

.plan-pagination {
  justify-content: center;
  margin-top: 16px;
}

@media (max-width: 1180px) {
  .plan-admin-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .unit-plans-grid,
  .plan-admin-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

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

@media (max-width: 620px) {
  .unit-plans-section {
    border-radius: 16px;
    padding: 13px;
  }

  .unit-plan-thumbnail {
    flex-basis: 100%;
    grid-template-columns: 102px minmax(0, 1fr);
  }

  .unit-plan-thumbnail img {
    width: 102px;
  }

  .plan-admin-summary,
  .plan-admin-grid,
  .plan-upload-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .plan-upload-form .plan-field-image,
  .plan-upload-form .plan-field-title,
  .plan-upload-form .plan-field-source_url {
    grid-column: auto;
  }
}

/* Unit Quick Preview */
.unit-quick-preview-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(440px, calc(100vw - 24px));
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 24px 0 0 24px;
  background: var(--theme-subtle, #f6faf8);
  box-shadow: -18px 0 56px rgba(19, 54, 44, .2);
  color: var(--text);
}

.unit-quick-preview-dialog[open] {
  animation: unit-quick-preview-in .2s ease-out;
}

.unit-quick-preview-dialog::backdrop {
  background: rgba(14, 35, 30, .34);
  backdrop-filter: blur(2px);
}

.unit-quick-preview-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.unit-quick-preview-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--theme-glass, rgba(255, 255, 255, .96));
}

.unit-quick-preview-header > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.unit-quick-preview-header span {
  color: var(--theme-success-text, var(--accent));
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.unit-quick-preview-header strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-quick-preview-header > button {
  display: inline-grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--theme-surface, #fff);
  color: var(--text);
  cursor: pointer;
}

.unit-quick-preview-header > button:hover {
  border-color: var(--theme-success-text, rgba(25, 119, 91, .35));
  color: var(--theme-success-text, var(--accent));
}

.unit-quick-preview-content {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.unit-quick-preview-state {
  display: grid;
  min-height: 55vh;
  padding: 32px;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--muted);
  text-align: center;
}

.unit-quick-preview-state > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.unit-quick-preview-state.is-error strong {
  color: var(--theme-danger-text, var(--sold));
}

.unit-quick-preview-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--theme-success-text, rgba(25, 119, 91, .16));
  border-top-color: var(--theme-success-text, var(--accent));
  border-radius: 50%;
  animation: unitsdeck-spin .75s linear infinite;
}

.unit-quick-preview-card {
  min-height: 100%;
  background: var(--theme-subtle, #f6faf8);
}

.unit-quick-preview-visual {
  position: relative;
  height: 132px;
  overflow: hidden;
  background:
    radial-gradient(circle at 80% 15%, var(--theme-glass, rgba(255, 255, 255, .55)), transparent 28%),
    linear-gradient(145deg, var(--theme-success-soft, #bcd7ce), #7fae9f);
}

.unit-quick-preview-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.unit-quick-preview-visual::after {
  position: absolute;
  inset: auto 0 0;
  height: 55%;
  background: linear-gradient(transparent, rgba(12, 39, 31, .48));
  content: '';
  pointer-events: none;
}

.unit-quick-preview-visual > .status {
  position: absolute;
  z-index: 1;
  top: 10px;
  right: 12px;
}

.unit-quick-preview-freshness {
  position: absolute;
  z-index: 1;
  right: 12px;
  bottom: 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.unit-quick-preview-body {
  display: grid;
  gap: 10px;
  padding: 14px 16px 16px;
}

.unit-quick-preview-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.unit-quick-preview-title-row > div {
  min-width: 0;
}

.unit-quick-preview-title-row > div > a {
  color: var(--theme-success-text, var(--accent));
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.unit-quick-preview-title-row p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.unit-quick-preview-name-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.unit-quick-preview-name-line h2 {
  margin: 0;
  font-size: clamp(24px, 4vw, 29px);
  line-height: 1;
}

.unit-quick-preview-title-row .favorite-button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  background: var(--theme-surface, #fff);
}

.unit-quick-preview-price {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border: 1px solid var(--theme-success-text, rgba(25, 119, 91, .16));
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(25, 119, 91, .1), var(--theme-glass, rgba(255, 255, 255, .9)));
}

.unit-quick-preview-price span,
.unit-quick-preview-price small {
  color: var(--muted);
  font-size: 12px;
}

.unit-quick-preview-price strong {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 24px;
  line-height: 1.05;
}

.unit-quick-preview-status-note {
  margin: 0;
  padding: 9px 11px;
  border-radius: 13px;
  background: var(--warning-soft);
  color: var(--theme-warning-text, #7c5420);
  font-size: 12px;
  line-height: 1.35;
}

.unit-quick-preview-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

.unit-quick-preview-facts > div {
  display: grid;
  align-content: start;
  gap: 2px;
  min-height: 50px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--theme-surface, #fff);
}

.unit-quick-preview-facts dt {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.unit-quick-preview-facts dd {
  display: grid;
  gap: 2px;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  font-weight: 750;
  line-height: 1.2;
}

.unit-quick-preview-facts dd small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.unit-quick-preview-badges {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.unit-quick-preview-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.unit-quick-preview-actions > .button,
.unit-quick-preview-actions > .unit-compare-picker {
  min-height: 38px;
  justify-content: center;
}

.unit-quick-preview-collection {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--theme-surface, #fff);
}

.unit-quick-preview-collection > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
  list-style: none;
}

.unit-quick-preview-collection > summary::-webkit-details-marker {
  display: none;
}

.unit-quick-preview-collection > summary::after {
  margin-left: auto;
  color: var(--muted);
  content: '+';
  font-size: 18px;
}

.unit-quick-preview-collection[open] > summary::after {
  content: '−';
}

.unit-quick-preview-collection > div {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
}

.unit-quick-preview-collection form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
  padding-top: 13px;
}

.unit-quick-preview-collection label {
  display: grid;
  gap: 5px;
}

.unit-quick-preview-collection label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.unit-quick-preview-collection select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--theme-surface, #fff);
}

.unit-quick-preview-collection form > small {
  grid-column: 1 / -1;
  min-height: 16px;
  color: var(--theme-success-text, var(--accent));
  font-size: 11px;
}

.unit-quick-preview-collection form > small.is-error {
  color: var(--theme-danger-text, var(--sold));
}

.unit-quick-preview-collection p {
  margin: 12px 0 4px;
  color: var(--muted);
  font-size: 12px;
}

.unit-quick-preview-collection > div > a {
  color: var(--theme-success-text, var(--accent));
  font-size: 12px;
  font-weight: 750;
}

.unit-quick-preview-similar {
  display: grid;
  gap: 7px;
}

.unit-quick-preview-similar header h3 {
  margin: 0;
  font-size: 14px;
}

.unit-quick-preview-similar > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.unit-quick-preview-similar button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  width: 100%;
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--theme-surface, #fff);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.unit-quick-preview-similar button:hover {
  border-color: var(--theme-success-text, rgba(25, 119, 91, .35));
  box-shadow: 0 8px 20px rgba(18, 58, 46, .08);
}

.unit-quick-preview-similar button span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.unit-quick-preview-similar button small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-quick-preview-similar button b {
  flex: 0 0 auto;
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 11px;
}

@keyframes unit-quick-preview-in {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 760px) {
  .unit-quick-preview-dialog {
    inset: auto 0 0;
    width: 100%;
    height: min(86dvh, 760px);
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 24px 24px 0 0;
  }

  .unit-quick-preview-dialog[open] {
    animation-name: unit-quick-preview-mobile-in;
  }

  .unit-quick-preview-header {
    min-height: 54px;
    padding: 11px 14px;
  }

  .unit-quick-preview-header::before {
    position: absolute;
    top: 7px;
    left: 50%;
    width: 44px;
    height: 4px;
    border-radius: 999px;
    background: rgba(25, 63, 52, .18);
    content: '';
    transform: translateX(-50%);
  }

  .unit-quick-preview-header strong {
    display: none;
  }

  .unit-quick-preview-visual {
    height: 128px;
  }

  .unit-quick-preview-body {
    gap: 10px;
    padding: 12px;
  }

  .unit-quick-preview-price strong {
    font-size: 23px;
  }
}

@media (max-width: 440px) {
  .unit-quick-preview-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-quick-preview-collection form {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-quick-preview-collection form > small {
    grid-column: 1;
  }
}

@media (min-width: 761px) and (max-height: 820px) {
  .unit-quick-preview-header {
    min-height: 52px;
    padding-block: 8px;
  }

  .unit-quick-preview-header strong {
    display: none;
  }

  .unit-quick-preview-visual {
    height: 106px;
  }

  .unit-quick-preview-body {
    gap: 8px;
    padding: 12px 14px 14px;
  }

  .unit-quick-preview-facts > div {
    min-height: 46px;
    padding: 7px 9px;
  }

  .unit-quick-preview-actions > .button,
  .unit-quick-preview-actions > .unit-compare-picker {
    min-height: 36px;
  }

  .unit-quick-preview-collection > summary {
    padding-block: 9px;
  }

  .unit-quick-preview-similar button {
    min-height: 44px;
    padding-block: 6px;
  }
}

@media (max-width: 360px) {
  .unit-quick-preview-facts,
  .unit-quick-preview-similar > div {
    grid-template-columns: minmax(0, 1fr);
  }
}

@keyframes unit-quick-preview-mobile-in {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1350px) {
  .analytics-insight-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-kpi-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

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

  .unit-overview {
    grid-template-columns: minmax(280px, .95fr) minmax(320px, 1.05fr);
  }

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

@media (max-width: 900px) {
  .control-kpi-grid {
    grid-template-columns: 1fr;
  }

  .unit-manual-control-grid {
    grid-template-columns: 1fr;
  }

  .unit-availability-facts {
    grid-template-columns: 1fr;
  }

  .unit-overview {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .unit-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .unit-key-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .unit-quality-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .unit-key-grid {
    grid-template-columns: 1fr;
  }

  .unit-price-timeline-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .unit-manual-status-fields {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 1350px) and (min-width: 901px) {
  .project-hero-v2 {
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  }

  .project-hero-v2 .project-hero-actions {
    display: grid;
    grid-column: 1 / -1;
  }

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

  .unit-form-grid,
  .unit-form-grid-areas,
  .unit-form-grid-money {
    grid-template-columns: repeat(2, minmax(190px, 1fr));
  }
}

@media (max-width: 940px) and (min-width: 901px) {
  .project-kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .project-hero-v2 {
    grid-template-columns: 1fr;
  }

  .project-hero-v2 .project-visual {
    min-height: 260px;
  }

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

  .project-price-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .unit-form-section {
    padding: 16px;
  }

  .unit-form-section-head {
    grid-template-columns: 1fr;
  }

  .unit-form-section-head > span {
    height: 28px;
    width: 38px;
  }

  .unit-create-form .form-field input,
  .unit-create-form .form-field select,
  .unit-create-form .form-field textarea {
    font-size: 16px;
  }

  .project-title-block {
    flex-direction: column;
  }

  .project-hero-v2 .project-logo-card {
    min-height: 86px;
    width: 112px;
  }

  .project-meta-v2,
  .project-action-group {
    grid-template-columns: 1fr;
  }

  .project-action-bar {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  }

  .project-action-group {
    align-items: stretch;
    flex-direction: column;
  }

  .internal-note-form {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .internal-note-form .button {
    justify-self: start;
  }

  .project-visual-gallery img {
    height: 42px;
    width: 58px;
  }
}

/* Manual construction progress is independent of the project's readiness status. */
.project-construction-progress {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}
.project-construction-progress > div {
  align-items: baseline;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 12px;
  justify-content: space-between;
}
.project-construction-progress strong {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 14px;
}
.project-construction-progress progress {
  appearance: none;
  background: var(--theme-subtle, #eef4f1);
  border: 0;
  border-radius: 999px;
  display: block;
  height: 7px;
  overflow: hidden;
  width: 100%;
}
.project-construction-progress progress::-webkit-progress-bar {
  background: var(--theme-subtle, #eef4f1);
  border-radius: 999px;
}
.project-construction-progress progress::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}
.project-construction-progress progress::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.project-hero-v2 .project-action-bar {
  background: transparent;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  padding: 0;
}

/* UnitsDeck interface system */
:root {
  --surface-subtle: #f4f7f5;
  --surface-hover: #edf5f1;
  --line-strong: #cfd8d4;
  --focus: rgba(15, 122, 98, 0.24);
  --warning: #9a5a00;
  --warning-soft: #fff5e6;
  --danger-soft: #fff1f0;
  --info: #315c9e;
  --info-soft: #edf3ff;
  --shadow-soft: 0 8px 22px rgba(18, 24, 39, 0.045);
  --control-height: 40px;
}

.ui-icon {
  display: inline-block;
  fill: none;
  flex: 0 0 auto;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  vertical-align: middle;
  width: 18px;
}

.mobile-brand {
  display: none;
}

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

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.app-shell {
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  gap: 14px;
  padding: 16px 12px;
}

.brand {
  min-height: 44px;
  padding-inline: 7px;
}

.brand img {
  height: 34px;
  width: 34px;
}

.brand span {
  font-size: 22px;
}

.side-nav-link {
  gap: 9px;
  min-height: 42px;
  padding: 8px 10px;
}

.side-nav-link:hover {
  transform: none;
}

.nav-icon {
  height: 28px;
  min-width: 28px;
  width: 28px;
}

.nav-icon .ui-icon {
  height: 18px;
  width: 18px;
}

.topbar {
  flex-wrap: nowrap;
  gap: 12px;
  min-height: 70px;
  padding: 11px 20px;
}

.global-search {
  flex: 1 1 300px;
  max-width: 440px;
  min-height: var(--control-height);
  padding-inline: 14px 10px;
  width: auto;
}

.global-search-icon {
  align-items: center;
  display: inline-flex;
}

.global-search-icon .ui-icon {
  height: 17px;
  width: 17px;
}

.topbar-widgets {
  gap: 6px;
}

.fx-rates {
  gap: 6px;
}

.fx-rates span,
.user-chip {
  box-shadow: none;
  font-size: 12px;
  min-height: 36px;
  padding: 6px 9px;
}

.language-switcher,
.logout-form button {
  box-shadow: none;
  min-height: 36px;
}

.logout-form button {
  align-items: center;
  display: inline-flex;
  gap: 7px;
  justify-content: center;
  padding: 7px 10px;
}

.logout-form .ui-icon {
  height: 16px;
  width: 16px;
}

.page {
  padding: 22px 24px 48px;
}

.page-heading,
.home-hero,
.import-page-head,
.units-page-head {
  background: var(--theme-surface, #fff);
  border: 0;
  border-bottom: 1px solid var(--line);
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
  margin-bottom: 18px;
  min-height: 66px;
  padding: 10px 4px 14px 18px;
  position: relative;
}

.page-heading::before,
.home-hero::before,
.import-page-head::before,
.units-page-head::before {
  background: var(--accent);
  border-radius: 2px;
  content: "";
  height: 32px;
  left: 0;
  position: absolute;
  top: 14px;
  width: 3px;
}

.page-heading h1,
.home-hero h1,
.import-page-head h1,
.units-page-head h1 {
  font-size: clamp(24px, 2vw, 30px);
}

.page-heading p,
.home-hero p,
.import-page-head p,
.units-page-head p {
  line-height: 1.3;
}

.page-actions,
.hero-actions,
.section-actions {
  gap: 8px;
}

.button {
  align-items: center;
  border: 1px solid transparent;
  gap: 8px;
  min-height: var(--control-height);
  padding: 9px 14px;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease, color .15s ease;
}

.button:hover {
  box-shadow: 0 6px 16px rgba(15, 122, 98, .15);
}

.button-muted {
  background: var(--theme-surface, #fff);
  border-color: var(--line-strong);
  color: var(--text);
}

.button-muted:hover {
  background: var(--surface-hover);
  border-color: var(--theme-line, #aebfb7);
  box-shadow: none;
  color: var(--theme-success-text, var(--accent-dark));
}

.button-danger-outline:hover {
  box-shadow: none;
}

.button-small {
  font-size: 13px;
  min-height: 34px;
  padding: 7px 10px;
}

.button:disabled,
.button[aria-disabled="true"] {
  background: var(--theme-hover, #e8ecea);
  border-color: var(--theme-line, #dfe5e2);
  box-shadow: none;
  color: var(--theme-muted, #82908a);
  cursor: not-allowed;
  opacity: 1;
}

.button[aria-busy="true"]::before {
  animation: unitsdeck-spin .75s linear infinite;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 999px;
  content: "";
  height: 14px;
  width: 14px;
}

.button[aria-busy="true"] {
  cursor: progress;
}

@keyframes unitsdeck-spin {
  to {
    transform: rotate(360deg);
  }
}

.section-head {
  align-items: center;
  gap: 12px;
}

.section-head h2 {
  font-size: 18px;
  line-height: 1.2;
}

.section-head p {
  font-size: 13px;
  line-height: 1.4;
}

.home-panel,
.control-card,
.unit-info-card,
.report-panel,
.workspace-settings-card,
.account-card,
.user-form-card {
  box-shadow: var(--shadow-soft);
}

.home-imports-panel {
  gap: 14px;
}

.project-import-list {
  border: 1px solid var(--line);
  border-radius: 8px;
  gap: 0;
  overflow: hidden;
}

.project-import-row {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  min-height: 72px;
  padding: 10px 12px;
}

.project-import-row:last-child {
  border-bottom: 0;
}

.project-import-row:hover {
  background: var(--surface-hover);
  border-color: var(--line);
  box-shadow: none;
}

.project-import-meta span {
  background: transparent;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  min-width: 100px;
  padding: 4px 10px;
}

.project-card {
  box-shadow: var(--shadow-soft);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.project-card:hover {
  box-shadow: 0 12px 28px rgba(18, 24, 39, .08);
  transform: translateY(-1px);
}

.messages {
  display: grid;
  gap: 8px;
}

.message {
  border-left: 4px solid var(--available);
  border-radius: 6px;
  line-height: 1.45;
  padding: 11px 14px;
}

.message.info {
  background: var(--info-soft);
  border-color: var(--theme-info-line, #b9caec);
  border-left-color: var(--info);
  color: var(--info);
}

.message.warning {
  background: var(--warning-soft);
  border-color: var(--theme-warning-line, #ecd3a8);
  border-left-color: var(--warning);
  color: var(--warning);
}

.message.error {
  background: var(--danger-soft);
  border-left-color: var(--theme-danger-text, var(--sold));
}

.empty,
.empty-state,
.empty-mini {
  background: var(--surface-subtle);
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  box-shadow: none;
  color: var(--muted);
  text-align: center;
}

.empty-state,
.empty-mini {
  padding: 24px;
}

.empty-muted,
.quality-empty {
  background: var(--surface-subtle);
  border: 1px dashed var(--line);
  border-radius: 7px;
  display: block;
  margin: 0;
  padding: 12px;
  text-align: center;
}

.table-wrap {
  box-shadow: var(--shadow-soft);
}

th {
  background: var(--theme-subtle, #f4f6f5);
  border-bottom-color: var(--line-strong);
  color: var(--theme-muted, #53605b);
}

tbody tr:nth-child(even) td {
  background: var(--theme-surface, #fcfdfc);
}

tbody tr:hover td {
  background: var(--surface-hover);
}

.status {
  align-items: center;
  line-height: 1.15;
  min-height: 24px;
}

.filters-panel {
  box-shadow: var(--shadow-soft);
}

.filter-dropdown summary,
.filter-more-panel > summary,
.filter-toolbar > .filter-select,
.filter-search-input {
  min-height: var(--control-height);
}

@media (max-width: 1250px) and (min-width: 901px) {
  .app-shell {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .topbar {
    padding-inline: 16px;
  }

  .global-search {
    max-width: 360px;
  }

  .user-chip > span:not(.avatar),
  .logout-form button span {
    display: none;
  }

  .fx-rates span:nth-child(3) {
    display: none;
  }
}

@media (max-width: 1020px) and (min-width: 901px) {
  .fx-rates span:nth-child(2) {
    display: none;
  }
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .app-shell {
    display: block;
    height: 100vh;
    min-height: 100vh;
  }

  .sidebar {
    align-items: stretch;
    background: var(--theme-glass, rgba(255, 255, 255, .97));
    border: 0;
    border-top: 1px solid var(--line);
    bottom: 0;
    display: flex;
    flex-direction: row;
    gap: 0;
    height: 68px;
    left: 0;
    min-height: 68px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 7px calc(5px + env(safe-area-inset-bottom));
    position: fixed;
    right: 0;
    top: auto;
    z-index: 100;
  }

  .sidebar > .brand,
  .side-nav-label,
  .side-subnav {
    display: none;
  }

  .sidebar .side-nav,
  .sidebar .side-nav-bottom {
    border: 0;
    display: flex;
    flex: 0 0 auto;
    gap: 3px;
    margin: 0;
    overflow: visible;
    padding: 0;
  }

  .side-nav-link {
    align-items: center;
    border-radius: 7px;
    flex: 0 0 70px;
    flex-direction: column;
    font-size: 10px;
    gap: 2px;
    height: 56px;
    justify-content: center;
    line-height: 1.05;
    min-height: 56px;
    padding: 4px 3px;
    white-space: nowrap;
  }

  .side-nav-link.active {
    box-shadow: inset 0 2px 0 var(--accent);
  }

  .nav-icon {
    height: 25px;
    min-width: 25px;
    width: 25px;
  }

  .nav-icon .ui-icon {
    height: 17px;
    width: 17px;
  }

  .app-main {
    height: 100vh;
    min-height: 100vh;
    padding-bottom: 68px;
  }

  .topbar {
    align-items: center;
    display: grid;
    gap: 8px 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 106px;
    padding: 9px 14px 10px;
  }

  .mobile-brand {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 0;
    text-decoration: none;
  }

  .mobile-brand img {
    height: 30px;
    object-fit: contain;
    width: 30px;
  }

  .mobile-brand strong {
    font-size: 17px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .global-search {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: none;
    width: 100%;
  }

  .topbar-widgets {
    display: flex;
    gap: 5px;
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-end;
    overflow: visible;
    padding: 0;
    width: auto;
  }

  .fx-rates {
    display: none;
  }

  .language-switcher,
  .user-chip,
  .logout-form {
    order: initial;
  }

  .language-switcher {
    min-height: 34px;
  }

  .language-switcher button {
    min-height: 26px;
    padding: 4px 7px;
  }

  .user-chip {
    min-height: 34px;
    padding: 4px 6px;
  }

  .logout-form button {
    min-height: 34px;
    padding: 6px 8px;
  }

  .logout-form button span {
    display: none;
  }

  .page {
    padding: 18px 16px 92px;
  }

  .page-heading,
  .home-hero,
  .import-page-head,
  .units-page-head {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
    min-height: 58px;
    padding: 8px 2px 12px 15px;
  }

  .page-heading::before,
  .home-hero::before,
  .import-page-head::before,
  .units-page-head::before {
    height: 28px;
    top: 10px;
  }

  .project-import-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .project-import-meta {
    display: none;
  }

  .project-import-actions {
    align-items: center;
  }

  .project-import-actions .button-muted {
    display: none;
  }
}

@media (max-width: 620px) {
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mobile-brand strong {
    max-width: 125px;
  }

  .user-chip > span:not(.avatar) {
    display: none;
  }

  .page {
    padding-inline: 12px;
  }

  .page-heading,
  .home-hero,
  .import-page-head,
  .units-page-head {
    gap: 10px;
  }

  .page-heading h1,
  .home-hero h1,
  .import-page-head h1,
  .units-page-head h1 {
    font-size: 24px;
  }

  .page-heading p,
  .home-hero p,
  .import-page-head p,
  .units-page-head p {
    font-size: 13px;
  }

  .page-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .project-import-row {
    gap: 9px;
    min-height: 76px;
    padding: 10px;
  }

  .project-import-main small {
    display: none;
  }

  .project-import-actions .button {
    min-height: 34px;
    padding-inline: 9px;
  }

  .units-page-head .page-actions {
    width: auto;
  }

  .units-page-head .button {
    font-size: 0;
    min-width: 40px;
    padding: 8px;
  }

  .units-page-head .button .ui-icon {
    height: 18px;
    width: 18px;
  }

  .units-table {
    min-width: 100%;
    table-layout: fixed;
  }

  .units-table th:nth-child(3),
  .units-table td:nth-child(3),
  .units-table th:nth-child(4),
  .units-table td:nth-child(4),
  .units-table th:nth-child(5),
  .units-table td:nth-child(5),
  .units-table th:nth-child(6),
  .units-table td:nth-child(6),
  .units-table th:nth-child(9),
  .units-table td:nth-child(9),
  .units-table th:nth-child(10),
  .units-table td:nth-child(10) {
    display: none;
  }

  .units-table th,
  .units-table td {
    font-size: 12px;
    padding: 9px 6px;
  }

  .units-table th:nth-child(1) {
    width: 18%;
  }

  .units-table th:nth-child(2) {
    width: 31%;
  }

  .units-table th:nth-child(7) {
    width: 23%;
  }

  .units-table th:nth-child(8) {
    width: 28%;
  }

  .units-table .status {
    font-size: 10px;
    padding-inline: 6px;
  }

  .filter-toolbar {
    align-items: stretch;
  }

  .filter-search-input {
    flex: 1 1 100%;
    max-width: none;
  }

  .filter-actions {
    display: grid;
    flex: 1 1 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

/* Manager workflow refinements */
.units-table {
  min-width: 1080px;
}

.global-search-error {
  background: var(--danger-soft);
  border-radius: 6px;
  color: var(--theme-danger-text, var(--sold));
}

.unit-title-actions {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 8px;
}

.unit-status-shortcut {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 6px;
  min-height: 32px;
  padding: 6px 9px;
  text-decoration: none;
}

.unit-status-shortcut:hover {
  background: var(--surface-hover);
  border-color: var(--theme-line, #aebfb7);
}

.unit-status-shortcut .ui-icon {
  height: 15px;
  width: 15px;
}

.control-kpi-grid article.is-zero {
  background: var(--theme-subtle, #f8faf9);
  box-shadow: none;
}

.control-kpi-grid article.is-zero strong {
  color: var(--theme-muted, #85918c);
}

@media (max-width: 1250px) and (min-width: 901px) {
  .import-workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-summary-card {
    grid-column: 1 / -1;
  }

  .units-table {
    min-width: 100%;
    table-layout: fixed;
  }

  .units-table th:nth-child(3),
  .units-table td:nth-child(3),
  .units-table th:nth-child(4),
  .units-table td:nth-child(4),
  .units-table th:nth-child(5),
  .units-table td:nth-child(5),
  .units-table th:nth-child(6),
  .units-table td:nth-child(6),
  .units-table th:nth-child(9),
  .units-table td:nth-child(9),
  .units-table th:nth-child(10),
  .units-table td:nth-child(10) {
    display: none;
  }

  .units-table th:nth-child(1) {
    width: 17%;
  }

  .units-table th:nth-child(2) {
    width: 38%;
  }

  .units-table th:nth-child(7) {
    width: 20%;
  }

  .units-table th:nth-child(8) {
    width: 25%;
  }
}

@media (max-width: 620px) {
  .units-filters-panel {
    position: relative;
  }

  .units-filters-panel .filter-more-panel {
    position: static;
  }

  .units-filters-panel .filter-dropdown-menu,
  .units-filters-panel .filter-dropdown-wide .filter-dropdown-menu,
  .units-filters-panel .filter-dropdown-range .filter-dropdown-menu,
  .units-filters-panel .filter-dropdown-price .filter-dropdown-menu,
  .units-filters-panel .filter-more-grid {
    bottom: 78px;
    left: 12px;
    margin: 0;
    max-height: min(58vh, 470px);
    max-width: none;
    min-width: 0;
    overflow: auto;
    position: fixed;
    right: 12px;
    top: auto;
    width: auto;
    z-index: 160;
  }

  .project-hero-v2 .project-visual {
    min-height: 190px;
  }

  .project-hero-main {
    gap: 10px;
    padding: 14px;
  }

  .project-title-block {
    gap: 10px;
  }

  .project-meta-v2 {
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 10px;
  }

  .project-kpi-grid {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-kpi-grid .kpi-card {
    gap: 6px;
    min-height: 92px;
    padding: 12px;
  }

  .project-kpi-grid .kpi-card > span {
    font-size: 11px;
  }

  .project-kpi-grid .kpi-card strong {
    font-size: 20px;
  }

  .project-kpi-grid .kpi-card small {
    font-size: 10px;
    line-height: 1.25;
  }

  .unit-title-actions {
    align-items: flex-start;
  }

  .unit-status-shortcut {
    min-height: 34px;
  }

  .control-kpi-grid {
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-kpi-grid article {
    gap: 4px;
    min-height: 78px;
    padding: 11px;
  }

  .control-kpi-grid strong {
    font-size: 22px;
  }

  .control-kpi-grid small {
    display: none;
  }
}

@media (min-width: 901px) {
  .fx-rates {
    align-items: center;
    display: flex;
    position: relative;
  }

  .fx-rate-values > span {
    gap: 4px;
  }

  .fx-rate-freshness {
    left: 50%;
    position: absolute;
    top: calc(100% + 3px);
    transform: translateX(-50%);
    white-space: nowrap;
  }
}

@media (max-width: 620px) {
  td.unit-room-cell {
    display: table-cell;
    white-space: nowrap;
  }

  .units-table .unit-room-heading .sort-link {
    margin-inline-start: 0;
  }

  .units-table .unit-room-content {
    align-items: center;
    display: inline-grid;
    gap: 2px 4px;
    grid-template-areas:
      "room room"
      "compare favorite";
    grid-template-columns: 21px 24px;
    justify-content: start;
  }

  .units-table .unit-room-content > .unit-compare-picker {
    grid-area: compare;
  }

  .units-table .unit-room-content > .unit-favorite-form {
    grid-area: favorite;
  }

  .units-table .unit-room-content > a {
    grid-area: room;
  }

  .unit-room-cell .favorite-button {
    height: 24px;
    margin-right: 2px;
    padding: 3px;
    vertical-align: middle;
    width: 24px;
  }

  .unit-room-cell .favorite-button .ui-icon {
    height: 15px;
    width: 15px;
  }

  .unit-room-content > a {
    vertical-align: middle;
  }

  .units-table {
    min-width: 100%;
    table-layout: fixed;
  }

  .units-table th:nth-child(3),
  .units-table td:nth-child(3),
  .units-table th:nth-child(4),
  .units-table td:nth-child(4),
  .units-table th:nth-child(5),
  .units-table td:nth-child(5),
  .units-table th:nth-child(6),
  .units-table td:nth-child(6),
  .units-table th:nth-child(9),
  .units-table td:nth-child(9),
  .units-table th:nth-child(10),
  .units-table td:nth-child(10) {
    display: none;
  }

  .units-table th:nth-child(1) {
    width: 27%;
  }

  .units-table th:nth-child(2) {
    width: 23%;
  }

  .units-table th:nth-child(7) {
    width: 22%;
  }

  .units-table th:nth-child(8) {
    width: 28%;
  }
}

/* Project lifecycle v2 */
.project-directory-controls {
  align-items: flex-end;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  display: flex;
  gap: 20px;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 12px;
}

.project-directory-control-group {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.project-directory-view-group {
  justify-items: end;
}

.project-directory-control-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.project-type-tabs,
.project-view-toggle {
  align-items: center;
  background: var(--theme-subtle, #eef3f1);
  border-radius: 8px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.project-type-tabs a,
.project-view-toggle a,
.project-view-toggle > span {
  align-items: center;
  border-radius: 6px;
  color: var(--muted);
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  gap: 5px;
  justify-content: center;
  line-height: 1;
  min-height: 34px;
  padding: 9px 12px;
  text-decoration: none;
  white-space: nowrap;
}

.project-type-tabs a:hover,
.project-view-toggle a:hover {
  color: var(--theme-success-text, var(--accent-dark));
}

.project-type-tabs a.is-active,
.project-view-toggle a.is-active {
  background: var(--theme-surface, #fff);
  box-shadow: 0 2px 8px rgba(18, 45, 36, .09);
  color: var(--theme-success-text, var(--accent-dark));
}

.project-view-toggle > span.is-upcoming {
  cursor: not-allowed;
  opacity: .6;
}

.project-view-toggle > span small {
  background: var(--theme-hover, #dfe7e3);
  border-radius: 999px;
  font-size: 8px;
  letter-spacing: .02em;
  padding: 3px 5px;
  text-transform: uppercase;
}

.project-grid.project-directory-list {
  grid-template-columns: minmax(0, 1fr);
}

.project-directory-list .project-card {
  display: grid;
  grid-template-columns: minmax(210px, 270px) minmax(0, 1fr);
  min-height: 158px;
}

.project-directory-list .project-cover {
  height: 100%;
  min-height: 158px;
}

.project-directory-list .project-card-body {
  align-content: center;
  padding: 18px;
}

.project-map-section {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.project-map-summary {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 9px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 11px 14px;
}

.project-map-summary > div {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.project-map-summary-icon {
  align-items: center;
  background: var(--theme-success-soft, #e2f1eb);
  border-radius: 8px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.project-map-summary h2 {
  font-size: 15px;
  margin: 0 0 2px;
}

.project-map-summary p,
.project-map-summary-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
}

.project-map-summary-hint {
  text-align: right;
}

.project-map-canvas {
  background: var(--theme-hover, #dce8e3);
  border: 1px solid var(--theme-line, #cbd9d3);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  height: clamp(500px, calc(100dvh - 300px), 720px);
  isolation: isolate;
  min-height: 500px;
  overflow: hidden;
  position: relative;
  z-index: 0;
}

.project-map-canvas.leaflet-container {
  font-family: inherit;
}

.project-map-canvas.is-empty {
  align-items: center;
  display: flex;
  justify-content: center;
}

.project-map-canvas.has-error {
  background: var(--theme-subtle, #f7f3ef);
}

.project-map-state {
  align-items: center;
  color: var(--theme-muted, #52645d);
  display: flex;
  flex-direction: column;
  gap: 10px;
  inset: 0;
  justify-content: center;
  padding: 30px;
  position: absolute;
  text-align: center;
}

.project-map-state strong {
  font-size: 14px;
  max-width: 420px;
}

.project-map-loader {
  animation: project-map-loading .8s linear infinite;
  border: 3px solid var(--theme-success-text, rgba(21, 105, 79, .18));
  border-radius: 50%;
  border-top-color: var(--theme-success-text, var(--accent));
  height: 30px;
  width: 30px;
}

@keyframes project-map-loading {
  to { transform: rotate(360deg); }
}

.project-map-canvas .leaflet-control-zoom a {
  color: var(--theme-success-text, var(--accent-dark));
}

.project-map-canvas .leaflet-control-attribution {
  color: var(--theme-muted, #607069);
  font-size: 9px;
}

.project-map-marker-shell,
.project-map-cluster-shell {
  background: transparent;
  border: 0;
}

.project-map-marker-pin {
  align-items: center;
  background: #147a5e;
  border: 3px solid var(--theme-line, #fff);
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 5px 15px rgba(19, 50, 39, .32);
  color: #fff;
  display: flex;
  font-size: 12px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  margin: 1px 0 0 2px;
  transform: rotate(-45deg);
  transition: filter .16s ease, transform .16s ease;
  width: 38px;
}

.project-map-marker-pin > span {
  transform: rotate(45deg);
}

.project-map-marker-pin.type-villa {
  background: #ad684a;
}

.project-map-marker-pin.type-townhouse {
  background: #557eb1;
}

.project-map-marker-pin.type-project {
  background: #66746e;
}

.project-map-marker-pin.lifecycle-paused {
  background: #ad7a2d;
}

.project-map-marker-pin.lifecycle-sold_out,
.project-map-marker-pin.lifecycle-archived {
  background: #7b8983;
  filter: saturate(.35);
}

.project-map-marker-pin.is-selected {
  filter: saturate(1.1);
  transform: rotate(-45deg) scale(1.13);
}

.project-map-marker-shell:focus-visible .project-map-marker-pin {
  outline: 3px solid var(--theme-success-text, rgba(20, 122, 94, .35));
  outline-offset: 3px;
}

.project-map-cluster {
  align-items: center;
  background: var(--theme-glass, rgba(255, 255, 255, .88));
  border: 2px solid var(--theme-line, #fff);
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(19, 50, 39, .28);
  display: flex;
  height: 46px;
  justify-content: center;
  position: relative;
  width: 46px;
}

.project-map-cluster::before {
  background: #167c60;
  border-radius: 50%;
  content: '';
  inset: 6px;
  position: absolute;
}

.project-map-cluster strong {
  color: #fff;
  font-size: 13px;
  position: relative;
  z-index: 1;
}

.project-map-canvas .leaflet-tooltip {
  background: var(--panel);
  border: 0;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(21, 43, 35, .18);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 9px;
}
.project-map-canvas .leaflet-tooltip-top::before { border-top-color: var(--panel); }
.project-map-canvas .leaflet-tooltip-bottom::before { border-bottom-color: var(--panel); }
.project-map-canvas .leaflet-tooltip-left::before { border-left-color: var(--panel); }
.project-map-canvas .leaflet-tooltip-right::before { border-right-color: var(--panel); }

.project-map-popup .leaflet-popup-content-wrapper {
  border-radius: 11px;
  box-shadow: 0 12px 34px rgba(17, 48, 37, .24);
  overflow: hidden;
  padding: 0;
}

.project-map-popup .leaflet-popup-content {
  margin: 0;
  width: min(300px, calc(100vw - 70px)) !important;
}

.project-map-popup .leaflet-popup-content p {
  margin: 0;
}

.project-map-popup .leaflet-popup-close-button {
  align-items: center;
  background: var(--theme-glass, rgba(255, 255, 255, .94));
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  color: var(--text) !important;
  display: flex;
  font-size: 20px !important;
  height: 28px !important;
  justify-content: center;
  right: 8px !important;
  top: 8px !important;
  width: 28px !important;
  z-index: 2;
}

.project-map-popup-card {
  background: var(--theme-surface, #fff);
  overflow: hidden;
}

.project-map-popup-card.lifecycle-sold_out,
.project-map-popup-card.lifecycle-archived {
  background: var(--theme-subtle, #f6f8f7);
}

.project-map-popup-visual {
  display: block;
  background: var(--theme-hover, #dce8e3);
  height: 104px;
  overflow: hidden;
}

.project-map-popup-visual img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.project-map-popup-body {
  align-content: start;
  display: grid;
  gap: 6px;
  padding: 11px;
}

.project-map-popup-heading h3 {
  font-size: 16px;
  line-height: 1.2;
  margin: 0;
}

.project-map-popup-heading h3 a {
  color: var(--text);
  text-decoration: none;
}

.project-map-popup-heading h3 a:hover {
  color: var(--theme-success-text, var(--accent-dark));
}

.project-map-popup-heading h3 a::after {
  color: var(--theme-success-text, var(--accent));
  content: ' ↗';
  font-size: .72em;
  vertical-align: .12em;
}

.project-map-popup-heading p,
.project-map-popup-details {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.project-map-popup-heading p {
  margin-top: 2px;
}

.project-map-popup-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.project-map-popup-badge {
  background: var(--theme-subtle, #edf3f0);
  border-radius: 999px;
  color: var(--theme-muted, #426257);
  font-size: 9px;
  font-weight: 850;
  line-height: 1.2;
  padding: 4px 7px;
}

.project-map-popup-metrics {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.project-map-popup-metrics > div {
  background: var(--theme-subtle, #f2f5f3);
  border-radius: 7px;
  min-width: 0;
  padding: 7px;
}

.project-map-popup-metrics dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 4px;
}

.project-map-popup-metrics dd {
  color: var(--text);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.1;
  margin: 0;
  overflow-wrap: anywhere;
}

.project-map-popup-details {
  color: var(--theme-muted, #4d6159);
}

.project-map-popup-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.project-map-popup-actions .button {
  min-height: 34px;
  padding-inline: 8px;
  width: 100%;
}

.project-map-popup-actions .button:only-child {
  grid-column: 1 / -1;
}

.project-map-canvas .project-map-popup-actions .button:not(.button-muted) {
  color: #fff;
}

.project-map-canvas .project-map-popup-actions .button-muted {
  color: var(--text);
}

.project-lifecycle-toolbar {
  align-items: flex-end;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
  padding: 11px 12px;
}

.project-lifecycle-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 230px;
}

.project-lifecycle-toolbar label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.project-lifecycle-toolbar select {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 38px;
  padding: 7px 34px 7px 10px;
}

.project-lifecycle-toolbar .button {
  min-height: 38px;
}

.project-lifecycle-group {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.project-lifecycle-group > h2,
.project-lifecycle-group-head h2 {
  font-size: 15px;
  margin: 0;
}

.project-lifecycle-group-head {
  align-items: center;
  display: flex;
  gap: 8px;
}

.project-lifecycle-group-head > span {
  align-items: center;
  background: var(--theme-hover, #edf1ef);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  justify-content: center;
  min-height: 22px;
  min-width: 22px;
  padding: 3px 7px;
}

.project-lifecycle-group-completed {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.project-card.lifecycle-sold_out {
  border-top: 3px solid var(--theme-info-text, #7796c7);
}

.project-card.lifecycle-archived {
  border-top: 3px solid var(--theme-line, #adb6b1);
}

.project-card.lifecycle-archived .project-cover {
  filter: saturate(.55);
}

.project-card.is-closed .project-location,
.project-card.is-closed .project-date {
  color: var(--theme-muted, #737d78);
}

.project-lifecycle-notice {
  align-items: flex-start;
  border: 1px solid;
  border-radius: 8px;
  display: flex;
  gap: 12px;
  margin: -4px 0 16px;
  padding: 13px 15px;
}

.project-lifecycle-notice-paused {
  background: var(--theme-warning-soft, #fff8ec);
  border-color: var(--theme-warning-line, #efd6ad);
}

.project-lifecycle-notice-archived {
  background: var(--theme-subtle, #f4f6f5);
  border-color: var(--theme-line, #d6ddda);
}

.project-lifecycle-notice-icon {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  flex: 0 0 auto;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.project-lifecycle-notice-paused .project-lifecycle-notice-icon {
  background: var(--theme-warning-soft, #fde8c4);
  color: var(--theme-warning-text, #8a5200);
}

.project-lifecycle-notice-archived .project-lifecycle-notice-icon {
  background: var(--theme-hover, #e2e7e4);
  color: var(--theme-muted, #5d6863);
}

.project-lifecycle-notice-icon .ui-icon {
  height: 17px;
  width: 17px;
}

.project-lifecycle-notice strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}

.project-lifecycle-notice p {
  font-size: 13px;
  line-height: 1.4;
}

.archived-import-confirm {
  align-items: flex-start;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-left: 4px solid var(--theme-line, #87928d);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  display: grid;
  gap: 16px;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 20px;
}

.archived-import-confirm-icon {
  align-items: center;
  background: var(--theme-hover, #edf1ef);
  border-radius: 8px;
  color: var(--theme-muted, #5d6863);
  display: flex;
  height: 48px;
  justify-content: center;
  width: 48px;
}

.archived-import-confirm-icon .ui-icon {
  height: 22px;
  width: 22px;
}

.archived-import-confirm-copy {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.archived-import-confirm-copy h2 {
  font-size: 22px;
  margin: 0;
}

.archived-import-confirm-copy p {
  font-size: 14px;
  line-height: 1.45;
}

.archived-import-files {
  background: var(--theme-subtle, #f7f8f7);
  border: 1px solid var(--line);
  border-radius: 6px;
  display: grid;
  gap: 5px;
  margin-top: 5px;
  padding: 10px 12px;
}

.archived-import-files strong {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.archived-import-files span {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.archived-import-confirm-actions {
  align-items: stretch;
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 180px;
}

@media (max-width: 760px) {
  .project-directory-controls {
    align-items: stretch;
    display: grid;
    gap: 12px;
  }

  .project-directory-view-group {
    justify-items: stretch;
  }

  .project-type-tabs,
  .project-view-toggle {
    display: flex;
    overflow-x: auto;
    width: 100%;
  }

  .project-type-tabs a,
  .project-view-toggle a,
  .project-view-toggle > span {
    flex: 1 0 auto;
  }

  .project-directory-list .project-card {
    display: grid;
    grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
    min-height: 0;
  }

  .project-directory-list .project-cover {
    height: 100%;
    min-height: 178px;
  }

  .project-directory-list .project-card-body {
    padding: 14px 14px 12px;
  }

  .project-map-summary {
    align-items: flex-start;
  }

  .project-map-summary-hint {
    max-width: 210px;
  }

  .project-map-canvas {
    height: min(62dvh, 560px);
    min-height: 420px;
  }

  .project-lifecycle-toolbar {
    align-items: stretch;
  }

  .project-lifecycle-toolbar label {
    flex: 1 1 100%;
    min-width: 0;
  }

  .archived-import-confirm {
    grid-template-columns: 42px minmax(0, 1fr);
    padding: 15px;
  }

  .archived-import-confirm-icon {
    height: 42px;
    width: 42px;
  }

  .archived-import-confirm-actions {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    min-width: 0;
  }
}

@media (max-width: 480px) {
  .project-directory-controls {
    padding: 10px;
  }

  .project-type-tabs a,
  .project-view-toggle a,
  .project-view-toggle > span {
    font-size: 11px;
    padding-inline: 9px;
  }

  .project-directory-list .project-card {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .project-directory-list .project-cover {
    min-height: 190px;
  }

  .project-directory-list .project-card-body {
    gap: 6px;
    padding: 12px;
  }

  .project-map-summary {
    align-items: stretch;
    display: grid;
    gap: 7px;
    padding: 10px 11px;
  }

  .project-map-summary-icon {
    height: 34px;
    width: 34px;
  }

  .project-map-summary-hint {
    max-width: none;
    padding-left: 44px;
    text-align: left;
  }

  .project-map-canvas {
    border-radius: 10px;
    height: 58dvh;
    min-height: 360px;
  }

  .project-map-popup-visual {
    height: 74px;
  }

  .project-map-popup-body {
    gap: 5px;
    padding: 8px;
  }

  .project-map-popup-heading h3 {
    font-size: 15px;
  }

  .project-map-popup-heading p,
  .project-map-popup-details {
    font-size: 10px;
  }

  .project-map-popup-metrics > div {
    padding: 6px;
  }

  .project-map-popup-metrics dd {
    font-size: 14px;
  }

  .project-lifecycle-toolbar .button {
    flex: 1 1 auto;
  }

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

  .project-card .metrics span {
    font-size: 11px;
  }

  .project-card .metrics strong {
    font-size: 20px;
  }

  .archived-import-confirm-actions .button {
    flex: 1 1 100%;
  }
}

@media (max-width: 1180px) {
  .project-admin-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-admin-preview {
    position: static;
  }
}

@media (max-width: 560px) {
  .project-form-section {
    padding: 16px;
  }

  .project-form-section-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-form-section-head > span {
    height: 28px;
    width: 38px;
  }

  .project-form-actions {
    align-items: stretch;
    padding: 14px 16px;
  }

  .project-form-actions .button {
    justify-content: center;
  }

  .project-coordinate-helper-head,
  .project-coordinate-import {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .project-coordinate-helper-head .button,
  .project-coordinate-import .button {
    justify-content: center;
    width: 100%;
  }

  .project-coordinate-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Property discovery home */
.discovery-home {
  display: grid;
  gap: 30px;
}

.discovery-hero {
  background:
    radial-gradient(circle at 92% 8%, var(--theme-glass, rgba(255, 255, 255, .7)) 0 8%, transparent 28%),
    linear-gradient(135deg, var(--theme-success-soft, #e7f4ef) 0%, var(--theme-subtle, #f4f8f6) 52%, var(--theme-subtle, #eef2f7) 100%);
  border: 1px solid var(--theme-line, #d5e4de);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(20, 69, 57, .08);
  display: grid;
  gap: 22px;
  overflow: visible;
  padding: clamp(28px, 4vw, 54px);
  position: relative;
}

.discovery-hero-copy {
  max-width: 820px;
  position: relative;
  z-index: 1;
}

.discovery-eyebrow,
.discovery-section-kicker {
  color: var(--theme-success-text, var(--accent-dark));
  display: block;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.discovery-hero h1 {
  color: var(--theme-success-text, #143a32);
  font-size: clamp(32px, 4vw, 52px);
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: 0;
  max-width: 760px;
}

.discovery-hero-copy p {
  color: var(--theme-muted, #4c6861);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.45;
  margin: 12px 0 0;
}

.discovery-search-form {
  background: var(--theme-glass, rgba(255, 255, 255, .94));
  border: 1px solid var(--theme-line, rgba(194, 214, 206, .9));
  border-radius: 14px;
  box-shadow: 0 16px 36px rgba(17, 62, 52, .1);
  display: grid;
  gap: 16px;
  padding: 16px;
  position: relative;
  z-index: 2;
}

.discovery-search-bar {
  align-items: center;
  border: 2px solid var(--theme-success-line, #9ccfbd);
  border-radius: 10px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 58px;
  overflow: hidden;
}

.discovery-search-bar > span {
  color: var(--theme-success-text, var(--accent));
  display: inline-flex;
  padding-left: 16px;
}

.discovery-search-bar .ui-icon {
  height: 22px;
  width: 22px;
}

.discovery-search-bar input {
  background: transparent;
  border: 0;
  box-shadow: none;
  font-size: 16px;
  min-width: 0;
  outline: 0;
  padding: 15px 14px;
  width: 100%;
}

.discovery-search-submit {
  border-radius: 8px;
  margin-right: 5px;
  min-height: 46px;
}

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

.discovery-quick-filters label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.discovery-quick-filters label > span,
.discovery-area-range legend,
.discovery-price-range legend,
.discovery-multi-filter summary > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  padding-left: 2px;
}

.discovery-area-range,
.discovery-price-range {
  border: 0;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.discovery-area-range legend,
.discovery-price-range legend {
  margin-bottom: 5px;
}

.discovery-area-range > div,
.discovery-price-range > div {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.discovery-price-range {
  grid-column: span 2;
  max-width: 440px;
}

.discovery-price-range > div {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(84px, .8fr);
}

.discovery-area-range {
  max-width: 250px;
}

.discovery-size-filters {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 190px) minmax(0, 140px);
  max-width: 100%;
  width: 340px;
}

.units-filters-panel .filter-completion-select {
  flex: 0 0 auto;
  max-width: 100%;
  width: 230px;
}

@media (min-width: 1181px) {
  .discovery-quick-filters {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
  }

  .discovery-quick-filters > label,
  .discovery-quick-filters > details {
    flex: 1 1 180px;
    width: 180px;
  }

  .discovery-quick-filters > .discovery-price-range {
    flex: 0 1 400px;
    width: 400px;
  }

  .discovery-quick-filters > .discovery-size-filters {
    flex: 0 1 340px;
  }

  .discovery-quick-filters > .discovery-filter-actions {
    flex: 1 1 360px;
    min-height: 42px;
  }
}

.discovery-multi-filter {
  min-width: 0;
  position: relative;
}

.discovery-multi-filter summary {
  cursor: pointer;
  display: grid;
  gap: 5px;
  list-style: none;
}

.discovery-multi-filter summary::-webkit-details-marker {
  display: none;
}

.discovery-multi-filter summary > strong {
  align-items: center;
  background: var(--theme-subtle, #f8faf9);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: flex;
  font-size: 13px;
  font-weight: 500;
  min-height: 42px;
  min-width: 0;
  overflow: hidden;
  padding: 8px 34px 8px 10px;
  position: relative;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-multi-filter summary > strong::after {
  content: "▾";
  font-size: 12px;
  position: absolute;
  right: 12px;
}

.discovery-multi-filter[open] summary > strong,
.discovery-multi-filter summary:focus-visible > strong {
  border-color: var(--theme-success-text, var(--accent));
  outline: 2px solid var(--theme-success-text, rgba(15, 122, 98, .12));
}

.discovery-multi-options {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(18, 24, 39, .14);
  display: grid;
  gap: 2px;
  left: 0;
  margin-top: 6px;
  max-height: min(320px, 55vh);
  max-width: min(320px, calc(100vw - 48px));
  min-width: 100%;
  overflow: auto;
  padding: 6px;
  position: absolute;
  top: 100%;
  width: max-content;
  z-index: 30;
}

.discovery-multi-filter:nth-child(3) .discovery-multi-options {
  left: auto;
  right: 0;
}

.discovery-multi-options label {
  align-items: center;
  border-radius: 6px;
  display: flex;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
}

.discovery-multi-options label:hover {
  background: var(--theme-subtle, #f5f8f6);
}

.discovery-multi-options input[type="checkbox"] {
  accent-color: var(--theme-success-text, var(--accent));
  flex: 0 0 auto;
  height: 16px;
  min-height: 16px;
  padding: 0;
  width: 16px;
}

.discovery-multi-options label > span {
  color: var(--text);
  font-size: 13px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.discovery-quick-filters select,
.discovery-quick-filters input {
  background: var(--theme-subtle, #f8faf9);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  min-height: 42px;
  min-width: 0;
  padding: 8px 10px;
  width: 100%;
}

.discovery-quick-filters select:focus,
.discovery-quick-filters input:focus {
  background: var(--theme-surface, #fff);
  border-color: var(--theme-success-text, var(--accent));
  outline: 2px solid var(--theme-success-text, rgba(15, 122, 98, .12));
}

.discovery-filter-actions {
  align-items: center;
  display: flex;
  gap: 14px;
  grid-column: 1 / -1;
  justify-content: flex-end;
}

.discovery-filter-actions > a {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 13px;
  font-weight: 750;
  text-decoration: none;
}

.discovery-count-button strong {
  font-size: 16px;
}

.discovery-entry-points {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  position: relative;
  z-index: 1;
}

.discovery-entry-points a {
  align-items: center;
  background: var(--theme-glass, rgba(255, 255, 255, .72));
  border: 1px solid var(--theme-line, rgba(175, 203, 193, .88));
  border-radius: 12px;
  color: var(--text);
  display: grid;
  gap: 2px 12px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 15px 17px;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}

.discovery-entry-points a:hover {
  background: var(--theme-surface, #fff);
  border-color: var(--theme-success-text, var(--accent));
  transform: translateY(-1px);
}

.discovery-entry-points a.is-primary {
  background: #174d40;
  border-color: var(--theme-success-text, #174d40);
  color: #fff;
}

.discovery-entry-points a.is-primary:hover {
  background: #0d6a56;
}

.discovery-entry-points a > span {
  align-items: center;
  background: rgba(15, 122, 98, .1);
  border-radius: 9px;
  display: inline-flex;
  grid-row: 1 / span 2;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.discovery-entry-points a.is-primary > span {
  background: var(--theme-glass, rgba(255, 255, 255, .14));
}

.discovery-entry-points .ui-icon {
  height: 20px;
  width: 20px;
}

.discovery-entry-points strong {
  font-size: 15px;
}

.discovery-entry-points small {
  color: var(--muted);
  font-size: 12px;
}

.discovery-entry-points a.is-primary small {
  color: rgba(255, 255, 255, .72);
}

.discovery-section {
  min-width: 0;
}

#all-projects {
  scroll-margin-top: 92px;
}

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

.discovery-section-head h2 {
  color: var(--text);
  font-size: clamp(23px, 2.5vw, 30px);
  letter-spacing: -.02em;
  line-height: 1.15;
  margin: 0;
}

.discovery-section-head p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  margin: 6px 0 0;
}

.discovery-section-kicker {
  margin-bottom: 5px;
}

.discovery-project-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
}

.discovery-project-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(19, 49, 41, .06);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.discovery-project-card:hover {
  border-color: var(--theme-success-line, #a7cdbf);
  box-shadow: 0 18px 38px rgba(19, 49, 41, .11);
  transform: translateY(-2px);
}

.discovery-project-card.is-unavailable {
  background: var(--theme-subtle, #fafbfa);
}

.discovery-project-image {
  align-items: flex-start;
  background-position: center;
  background-size: cover;
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: 178px;
  overflow: hidden;
  padding: 12px;
  position: relative;
  text-decoration: none;
}

.discovery-project-image::before {
  background:
    linear-gradient(160deg, rgba(9, 76, 62, .18), rgba(9, 54, 48, .68)),
    linear-gradient(135deg, #8fc9b6, #315d61);
  content: "";
  inset: 0;
  position: absolute;
}

.discovery-project-image.discovery-cover-b::before {
  background: linear-gradient(160deg, rgba(45, 70, 91, .08), rgba(27, 55, 68, .72)), linear-gradient(135deg, var(--theme-info-soft, #9bc5ca), #536a7e);
}

.discovery-project-image.discovery-cover-c::before {
  background: linear-gradient(160deg, rgba(99, 75, 49, .08), rgba(69, 53, 46, .72)), linear-gradient(135deg, var(--theme-warning-soft, #d5bf9c), #76675e);
}

.discovery-project-image.discovery-cover-d::before {
  background: linear-gradient(160deg, rgba(64, 65, 105, .08), rgba(41, 55, 78, .72)), linear-gradient(135deg, var(--theme-info-soft, #a9b3cf), #4d6276);
}

.discovery-project-image.has-image::before {
  background: linear-gradient(180deg, rgba(10, 30, 27, .08), rgba(10, 34, 30, .62));
}

.discovery-project-image span,
.discovery-project-image small {
  background: var(--theme-glass, rgba(255, 255, 255, .9));
  border-radius: 999px;
  color: var(--theme-success-text, #23483e);
  font-size: 11px;
  font-weight: 800;
  max-width: 62%;
  overflow: hidden;
  padding: 6px 9px;
  position: relative;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 1;
}

.discovery-project-image small {
  bottom: 12px;
  color: var(--theme-muted, #4e625d);
  max-width: calc(100% - 24px);
  position: absolute;
  right: 12px;
}

.discovery-project-body {
  color: var(--text);
  display: grid;
  flex: 1 1 auto;
  gap: 13px;
  padding: 15px;
  text-decoration: none;
}

.discovery-project-title-row {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.discovery-project-title-row > div {
  min-width: 0;
}

.discovery-project-title-row h3 {
  font-size: 17px;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
}

.discovery-project-body:hover {
  color: var(--text);
  text-decoration: none;
}

.discovery-project-body:hover h3 {
  color: var(--theme-success-text, var(--accent-dark));
}

.discovery-project-description {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  margin: -6px 0 0;
}

.discovery-project-title-row .project-ownership-badge {
  flex: 0 0 auto;
}

.discovery-project-badges {
  align-items: flex-end;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 5px;
}

.discovery-project-layouts {
  align-content: flex-start;
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.discovery-project-layouts span {
  align-items: center;
  background: var(--theme-subtle, #f0f6f3);
  border: 1px solid var(--theme-success-line, #dceae4);
  border-radius: 999px;
  color: var(--theme-text, #416057);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  min-height: 25px;
  padding: 5px 8px;
  white-space: nowrap;
}

.discovery-project-offer {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: auto;
  padding-top: 12px;
}

.discovery-project-offer > span {
  align-content: start;
  display: grid;
  gap: 3px;
}

.discovery-project-offer small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
  white-space: nowrap;
}

.discovery-project-offer strong {
  color: var(--theme-success-text, #173f35);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.discovery-project-footer {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}

.discovery-project-footer a,
.discovery-project-footer > span {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: center;
  min-height: 42px;
  padding: 8px;
  text-align: center;
  text-decoration: none;
}

.discovery-project-footer a:hover {
  background: var(--accent-soft);
  color: var(--theme-success-text, var(--accent-dark));
}

.discovery-project-footer > span {
  color: var(--muted);
}

.discovery-collections-section,
.discovery-updates-section,
.discovery-personal-section {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 30px rgba(19, 49, 41, .05);
  padding: 20px;
}

.discovery-collection-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.discovery-collection-card {
  background: var(--theme-subtle, #f5f8f7);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  display: grid;
  gap: 5px;
  min-height: 112px;
  padding: 14px;
  text-decoration: none;
  transition: border-color .15s ease, transform .15s ease;
}

.discovery-collection-card:hover {
  border-color: var(--theme-success-text, var(--accent));
  transform: translateY(-1px);
}

.discovery-collection-card.tone-price {
  background: var(--theme-subtle, #f2f8f0);
}

.discovery-collection-card.tone-layout {
  background: var(--theme-subtle, #f3f6fa);
}

.discovery-collection-card.tone-ready {
  background: var(--theme-warning-soft, #faf6ed);
}

.discovery-collection-card.tone-location {
  background: var(--theme-subtle, #f6f3fa);
}

.discovery-collection-icon {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--theme-line, rgba(100, 130, 120, .18));
  border-radius: 8px;
  color: var(--theme-success-text, var(--accent));
  display: inline-flex;
  height: 32px;
  justify-content: center;
  margin-bottom: 5px;
  width: 32px;
}

.discovery-collection-icon .ui-icon {
  height: 15px;
  width: 15px;
}

.discovery-collection-card strong {
  font-size: 14px;
}

.discovery-collection-card small {
  color: var(--muted);
  font-size: 12px;
}

.discovery-lower-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
}

.discovery-update-list {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.discovery-update-list > a {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 11px 13px;
  text-decoration: none;
}

.discovery-update-list > a:last-child {
  border-bottom: 0;
}

.discovery-update-list > a:hover {
  background: var(--surface-hover);
}

.discovery-update-list > a > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.discovery-update-list strong {
  font-size: 13px;
}

.discovery-update-list small,
.discovery-update-list time {
  color: var(--muted);
  font-size: 11px;
}

.discovery-update-list time {
  background: var(--theme-subtle, #f3f6f5);
  border-radius: 999px;
  flex: 0 0 auto;
  font-weight: 750;
  padding: 5px 8px;
}

.discovery-favorites-card {
  align-items: center;
  background: linear-gradient(135deg, #173f35, #0d745c);
  border-radius: 12px;
  color: #fff;
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  min-height: 116px;
  padding: 18px;
  text-decoration: none;
}

.discovery-favorites-card > span:first-child {
  align-items: center;
  background: var(--theme-glass, rgba(255, 255, 255, .13));
  border-radius: 10px;
  display: flex;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.discovery-favorites-card > span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.discovery-favorites-card strong {
  font-size: 15px;
}

.discovery-favorites-card small {
  color: rgba(255, 255, 255, .72);
  font-size: 12px;
  line-height: 1.35;
}

.discovery-favorites-card b {
  font-size: 30px;
}

@media (max-width: 1400px) {
  .discovery-quick-filters {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .discovery-quick-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .discovery-lower-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 760px) {
  .discovery-home {
    gap: 24px;
  }

  .discovery-hero {
    border-radius: 14px;
    gap: 18px;
    padding: 24px 18px;
  }

  .discovery-search-bar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .discovery-search-submit {
    grid-column: 1 / -1;
    margin: 0 5px 5px;
  }

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

  .discovery-entry-points {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .discovery-section-head .button {
    justify-content: center;
    width: 100%;
  }

}

@media (max-width: 520px) {
  .discovery-hero h1 {
    font-size: 31px;
  }

  .discovery-search-form {
    padding: 11px;
  }

  .discovery-search-bar input {
    font-size: 14px;
    padding-inline: 9px;
  }

  .discovery-search-bar > span {
    padding-left: 11px;
  }

  .discovery-filter-actions {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .discovery-filter-actions > a {
    text-align: center;
  }

  .discovery-count-button {
    justify-content: center;
    width: 100%;
  }

  .discovery-collections-section,
  .discovery-updates-section,
  .discovery-personal-section {
    padding: 16px;
  }

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

  .discovery-favorites-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .discovery-favorites-card b {
    grid-column: 2;
  }
}

@media (max-width: 360px) {
  .discovery-quick-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .discovery-price-range {
    grid-column: auto;
  }
}

/* Unit search results */
.units-page-kicker {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .09em;
  line-height: 1;
  text-transform: uppercase;
}

.units-page-head h1 > span:not(.favorites-title-count) {
  color: var(--theme-success-text, var(--accent-dark));
}

.units-filters-panel {
  background: var(--theme-subtle, #f9fbfa);
  border-color: var(--theme-line, #dbe6e1);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(19, 55, 44, .035);
  padding: 12px;
}

.units-filters-panel .filter-search-input {
  flex: 1 1 180px;
  max-width: 240px;
  min-width: 160px;
}

.unit-results-toolbar {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  margin: 0 0 14px;
  min-height: 58px;
  padding: 9px 10px 9px 14px;
}

.unit-results-count {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.unit-results-count strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.unit-results-count b {
  color: var(--text-soft);
  font-weight: 750;
}

.unit-results-controls {
  align-items: center;
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  gap: 9px;
  max-width: 100%;
  min-width: 0;
}

.inventory-currency-picker {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  max-width: 100%;
}

.inventory-currency-picker > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.inventory-currency-picker > select {
  font-size: 12px;
  font-weight: 700;
  min-height: 36px;
  min-width: 0;
  padding-block: 6px;
  width: 94px;
}

.inventory-results-summary {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.unit-results-sort {
  align-items: center;
  display: flex;
  gap: 7px;
  min-width: 0;
}

.unit-results-sort > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.unit-results-sort select {
  font-size: 12px;
  font-weight: 700;
  min-height: 36px;
  min-width: 0;
  max-width: 100%;
  padding-block: 6px;
  width: 194px;
}

.unit-view-toggle {
  align-items: center;
  background: var(--theme-subtle, #eef3f1);
  border-radius: 8px;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
}

.unit-view-toggle a {
  border-radius: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 9px 10px;
  text-decoration: none;
}

.unit-view-toggle a:hover {
  color: var(--theme-success-text, var(--accent-dark));
}

.unit-view-toggle a.is-active {
  background: var(--theme-surface, #fff);
  box-shadow: 0 2px 8px rgba(18, 45, 36, .09);
  color: var(--theme-success-text, var(--accent-dark));
}

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

.unit-result-grid[hidden],
.units-table-wrap[hidden],
.unit-results-pagination[hidden],
.unit-results-empty[hidden],
[data-favorites-populated-action][hidden],
[data-favorites-content][hidden],
[data-favorite-result][hidden] {
  display: none !important;
}

.unit-result-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(18, 44, 35, .05);
  display: grid;
  grid-template-rows: 172px 1fr auto;
  min-width: 0;
  overflow: hidden;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.unit-result-card:hover {
  border-color: var(--theme-success-line, #b9d4c9);
  box-shadow: 0 18px 38px rgba(18, 62, 47, .1);
  transform: translateY(-2px);
}

.unit-result-card.has-promotion:not(:hover):not(.is-selected-for-comparison) {
  background: var(--promotion-result-bg, #e0f1e7);
  border-color: var(--promotion-result-line, #9bc9b3);
}

.clickable-row.has-promotion:not(:hover):not(.is-selected-for-comparison) > td {
  background: var(--promotion-result-bg, #e0f1e7);
}

.unit-result-cover {
  background-color: var(--theme-success-soft, #dceae4);
  background-position: center;
  background-size: cover;
  overflow: hidden;
  position: relative;
}

.unit-result-cover::after {
  background: linear-gradient(180deg, rgba(8, 31, 24, .12), rgba(8, 31, 24, .02) 42%, rgba(8, 31, 24, .5));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.unit-result-cover-a {
  background-image: linear-gradient(135deg, var(--theme-success-soft, #b9d9cd), #5e927e);
}

.unit-result-cover-b {
  background-image: linear-gradient(135deg, var(--theme-hover, #d8d7c7), #8d9e7d);
}

.unit-result-cover-c {
  background-image: linear-gradient(135deg, var(--theme-info-soft, #b9d4dc), #607f8c);
}

.unit-result-cover-d {
  background-image: linear-gradient(135deg, var(--theme-warning-soft, #d9cdbf), #9a806d);
}

.unit-result-cover-link {
  inset: 0;
  position: absolute;
  z-index: 1;
}

.unit-result-location,
.unit-result-cover > .status {
  backdrop-filter: blur(8px);
  position: absolute;
  top: 12px;
  z-index: 2;
}

.unit-result-location {
  background: var(--theme-glass, rgba(255, 255, 255, .9));
  border-radius: 999px;
  color: var(--theme-success-text, #29463c);
  font-size: 11px;
  font-weight: 800;
  left: 12px;
  max-width: calc(100% - 120px);
  overflow: hidden;
  padding: 6px 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-result-cover > .status {
  box-shadow: 0 4px 14px rgba(14, 36, 29, .12);
  right: 12px;
}

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

.unit-result-head {
  align-items: flex-start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.unit-result-head > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.unit-result-title-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.unit-change-badge {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.15;
  min-height: 23px;
  padding: 4px 8px;
  white-space: nowrap;
}

.unit-change-badge.new {
  background: var(--theme-info-soft, #e7f3fb);
  border-color: var(--theme-info-line, #c7dfef);
  color: var(--theme-info-text, #236a91);
}

.unit-change-badge.returned {
  background: var(--theme-info-soft, #f0ebff);
  border-color: var(--theme-info-line, #dcd0fa);
  color: var(--theme-info-text, #6442a3);
}

.unit-change-badge.price-down {
  background: var(--theme-success-soft, #e4f3ea);
  border-color: var(--theme-success-line, #c8e5d4);
  color: var(--theme-success-text, #1f7048);
}

.unit-change-badge.price-up {
  background: var(--theme-warning-soft, #fff1d9);
  border-color: var(--theme-warning-line, #efd8af);
  color: var(--theme-warning-text, #8a5709);
}

.unit-change-badge.is-compact {
  font-size: 9px;
  min-height: 19px;
  padding: 3px 6px;
}

.unit-table-status-stack {
  align-items: flex-start;
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
}

td.unit-status-cell {
  white-space: nowrap;
}

.unit-result-head small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.unit-result-head h2 {
  font-size: 23px;
  line-height: 1;
  margin: 0;
}

.unit-result-head h2 a {
  color: var(--text);
  text-decoration: none;
}

.unit-result-head h2 a:hover {
  color: var(--theme-success-text, var(--accent-dark));
}

.unit-result-project {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
  overflow: hidden;
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.unit-result-project:hover {
  text-decoration: underline;
}

.unit-result-readiness {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  margin-top: -6px;
  min-height: 14px;
}

.unit-result-facts {
  border-bottom: 1px solid var(--theme-line, #edf1ef);
  border-top: 1px solid var(--theme-line, #edf1ef);
  display: grid;
  grid-template-columns: 1.15fr .9fr .8fr;
  min-width: 0;
  padding: 10px 0;
}

.unit-result-facts > div {
  align-content: start;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0 9px;
}

.unit-result-facts > div:first-child {
  padding-left: 0;
}

.unit-result-facts > div + div {
  border-left: 1px solid var(--theme-line, #edf1ef);
}

.unit-result-facts > div:last-child {
  padding-right: 0;
}

.unit-result-facts small,
.unit-result-price small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.15;
}

.unit-result-facts strong {
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.unit-result-facts > div > span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.15;
}

.unit-result-area-parts {
  display: grid;
  gap: 1px 5px;
  grid-template-columns: auto auto;
}

.unit-result-area-parts strong {
  white-space: nowrap;
}

.unit-result-price {
  align-items: end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.unit-result-price > span {
  display: grid;
  gap: 3px;
}

.unit-result-price > span:last-child {
  justify-items: end;
  text-align: right;
}

.unit-result-price strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1;
  white-space: nowrap;
}

.unit-result-price b {
  color: var(--text-soft);
  font-size: 12px;
  white-space: nowrap;
}

.unit-result-footer {
  align-items: center;
  background: var(--theme-subtle, #f7faf8);
  border-top: 1px solid var(--theme-line, #e8efeb);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 43px;
  padding: 9px 15px;
}

.unit-result-footer span {
  color: var(--muted);
  font-size: 10px;
}

.unit-result-footer a {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.unit-results-empty {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px dashed var(--theme-line, #c8d7d1);
  border-radius: 12px;
  color: var(--muted);
  display: grid;
  gap: 9px;
  grid-column: 1 / -1;
  justify-items: center;
  min-height: 220px;
  padding: 28px;
  text-align: center;
}

.unit-results-empty .ui-icon {
  color: var(--theme-muted, #8eaaa0);
  height: 28px;
  width: 28px;
}

.unit-results-empty strong {
  color: var(--text);
}

.unit-results-empty a {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 13px;
  font-weight: 800;
}

.unit-results-pagination {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 18px;
}

.unit-results-pagination > a,
.unit-results-pagination > span {
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  min-height: 38px;
  padding: 10px 13px;
}

.unit-results-pagination > a {
  background: var(--theme-surface, #fff);
  color: var(--theme-success-text, var(--accent-dark));
  text-decoration: none;
}

.unit-results-pagination > a:hover {
  background: var(--accent-soft);
  border-color: var(--theme-success-line, #bad5ca);
}

.unit-results-pagination > span {
  background: var(--theme-subtle, #f4f7f5);
  color: var(--muted);
}

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

  .unit-results-toolbar {
    align-items: flex-start;
  }

  .unit-results-controls {
    align-items: flex-end;
  }

  .unit-results-sort {
    align-items: stretch;
    display: grid;
    gap: 3px;
  }
}

@media (max-width: 760px) {
  .units-page-head {
    align-items: flex-start;
  }

  .units-page-head h1 {
    font-size: 26px;
  }

  .units-filters-panel .filter-search-input {
    flex-basis: 100%;
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .unit-results-toolbar {
    align-items: stretch;
    display: grid;
    gap: 10px;
  }

  .unit-results-controls {
    justify-content: space-between;
  }

  .unit-results-sort {
    flex: 1 1 auto;
  }

  .unit-results-sort select {
    width: 100%;
  }

  .unit-result-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-result-card {
    grid-template-columns: 150px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }

  .unit-result-cover {
    grid-row: 1 / 3;
    min-height: 250px;
  }

  .unit-result-location {
    bottom: 12px;
    left: 10px;
    max-width: calc(100% - 20px);
    top: auto;
  }

  .unit-result-cover > .status {
    left: 10px;
    right: auto;
    top: 10px;
  }

  .unit-result-body {
    padding: 13px;
  }

  .unit-result-footer {
    padding-inline: 13px;
  }
}

@media (max-width: 520px) {
  .unit-results-controls {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .unit-results-sort > span {
    display: none;
  }

  .unit-results-controls .inventory-currency-picker {
    grid-column: 1 / -1;
  }

  .unit-view-toggle a {
    padding-inline: 8px;
  }

  .unit-result-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 150px auto auto;
  }

  .unit-result-cover {
    grid-row: auto;
    min-height: 150px;
  }

  .unit-result-location {
    bottom: auto;
    left: 10px;
    max-width: calc(100% - 115px);
    top: 10px;
  }

  .unit-result-cover > .status {
    left: auto;
    right: 10px;
  }

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

  .unit-result-price strong {
    font-size: 18px;
  }

  .unit-result-footer span {
    max-width: 52%;
  }

  .unit-results-pagination {
    gap: 7px;
  }

  .unit-results-pagination > a,
  .unit-results-pagination > span {
    padding-inline: 9px;
  }
}

/* Client-facing project profile */
.project-hero-v2 {
  gap: 14px;
  grid-template-columns: minmax(360px, .9fr) minmax(0, 1.1fr);
}

.project-hero-v2 .project-visual,
.project-hero-v2 .project-hero-main {
  border-radius: 14px;
  box-shadow: 0 16px 38px rgba(18, 49, 39, .07);
}

.project-hero-v2 .project-visual {
  min-height: 390px;
}

.project-hero-v2 .project-hero-main {
  align-content: stretch;
  padding: 20px;
}

.project-hero-v2 .project-title-row {
  align-items: center;
}

.project-hero-v2 .project-title-block {
  align-items: center;
}

.project-hero-v2 .project-logo-card {
  background: var(--theme-subtle, #f8faf9);
  border-color: var(--theme-line, #dfe8e4);
  border-radius: 12px;
  flex-basis: 92px;
  min-height: 92px;
}

.project-hero-v2 .project-name-line h1 {
  font-size: clamp(28px, 2.45vw, 39px);
  letter-spacing: -.025em;
  line-height: 1.02;
}

.project-hero-v2 .project-title-block > div:last-child > p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  max-width: 760px;
}

.project-offer-grid {
  align-self: end;
  border: 1px solid var(--theme-line, #dfe8e4);
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1.15fr .72fr 1.2fr .9fr;
  min-width: 0;
  overflow: hidden;
}

.project-offer-grid article {
  align-content: start;
  background: var(--theme-subtle, #fbfcfb);
  display: grid;
  gap: 5px;
  min-height: 105px;
  min-width: 0;
  padding: 14px;
}

.project-offer-grid article + article {
  border-left: 1px solid var(--theme-line, #e5ebe8);
}

.project-offer-grid article > span,
.project-offer-grid article > small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  line-height: 1.2;
}

.project-offer-grid article > span {
  letter-spacing: .035em;
  text-transform: uppercase;
}

.project-offer-grid article > strong {
  color: var(--text);
  font-size: 21px;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.project-offer-grid .project-offer-price {
  background: linear-gradient(145deg, var(--theme-success-soft, #e8f4ef), var(--theme-subtle, #f6faf8));
}

.project-offer-grid .project-offer-price strong {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 23px;
  white-space: nowrap;
}

.project-offer-layouts > div {
  align-content: start;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.project-offer-layouts b {
  background: var(--theme-subtle, #eef4f1);
  border-radius: 999px;
  color: var(--theme-text, #36544a);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  padding: 5px 7px;
  white-space: nowrap;
}

.project-offer-grid article:last-child > strong {
  font-size: 16px;
  white-space: nowrap;
}

.project-hero-v2 .project-action-bar {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(18, 49, 39, .04);
  justify-content: flex-start;
  padding: 8px;
}

.project-hero-v2 .project-action-bar .page-action-menu {
  margin-left: auto;
}

.project-action-bar .project-client-action,
.project-action-bar .project-client-action:hover {
  background: var(--accent);
  border-color: var(--theme-success-text, var(--accent));
  color: #fff;
}

.project-client-action b {
  align-items: center;
  background: var(--theme-glass, rgba(255, 255, 255, .18));
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  justify-content: center;
  min-width: 24px;
  padding: 3px 7px;
}

.project-visual-gallery {
  align-items: center;
  gap: 6px;
}

.project-visual-gallery button {
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  flex: 0 0 auto;
  padding: 0;
}

.project-visual-gallery button img {
  border: 2px solid var(--theme-line, rgba(255, 255, 255, .72));
  border-radius: 9px;
  box-shadow: 0 8px 20px rgba(4, 23, 21, .22);
  display: block;
  height: 50px;
  object-fit: cover;
  opacity: .78;
  transition: border-color .15s ease, opacity .15s ease, transform .15s ease;
  width: 68px;
}

.project-visual-gallery button:hover img,
.project-visual-gallery button.is-active img {
  border-color: var(--theme-line, #fff);
  opacity: 1;
  transform: translateY(-2px);
}

.project-visual-gallery button:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .55);
  outline: 0;
}

.project-gallery-count {
  background: rgba(20, 42, 35, .72);
  backdrop-filter: blur(8px);
  border: 1px solid var(--theme-line, rgba(255, 255, 255, .3));
  border-radius: 999px;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  padding: 6px 9px;
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 2;
}

.project-detail-flow {
  display: flex;
  flex-direction: column;
}

.project-presentation-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.42fr) minmax(300px, .78fr);
  margin-bottom: 16px;
  order: 1;
}

.project-about-card,
.project-facts-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(18, 49, 39, .045);
  min-width: 0;
  padding: 20px;
}

.project-section-kicker {
  color: var(--theme-success-text, var(--accent-dark));
  display: block;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .09em;
  line-height: 1;
  margin-bottom: 7px;
  text-transform: uppercase;
}

.project-about-card h2,
.project-facts-card h2,
.project-inventory-head h2 {
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
}

.project-description-text {
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.65;
  margin-top: 13px;
}

.project-description-text p {
  margin: 0 0 10px;
}

.project-description-text p:last-child {
  margin-bottom: 0;
}

.project-description-empty {
  color: var(--muted);
  font-size: 14px;
  margin-top: 13px;
}

.project-facts-head {
  margin-bottom: 12px;
}

.project-facts-list {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.project-facts-list div {
  border-top: 1px solid var(--theme-line, #edf1ef);
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 8px 10px 0;
}

.project-facts-list div:nth-child(even) {
  padding-left: 10px;
  padding-right: 0;
}

.project-facts-list dt,
.project-facts-list dd {
  margin: 0;
}

.project-facts-list dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.project-facts-list dd {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.project-facts-list dd small {
  color: var(--theme-warning-text, #9a6a16);
  display: block;
  font-size: 9px;
  font-weight: 750;
  margin-top: 3px;
}

.project-inventory-section {
  margin-bottom: 16px;
  order: 2;
  scroll-margin-top: 88px;
}

.project-inventory-head {
  align-items: flex-end;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 11px;
  padding: 2px 2px 0;
}

.project-inventory-head > div {
  display: grid;
  gap: 4px;
}

.project-inventory-head p {
  color: var(--muted);
  font-size: 13px;
}

.project-inventory-section > .filters-panel {
  border-radius: 12px;
}

.project-operations-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(18, 49, 39, .04);
  margin-bottom: 16px;
  order: 3;
  overflow: visible;
}

.project-operations-card > summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 11px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  list-style: none;
  min-height: 64px;
  padding: 11px 14px;
}

.project-operations-card > summary::-webkit-details-marker {
  display: none;
}

.project-operations-card > summary::after {
  color: var(--muted);
  content: "⌄";
  font-size: 18px;
  grid-column: 4;
  transition: transform .18s ease;
}

.project-operations-card[open] > summary::after {
  transform: rotate(180deg);
}

.project-operations-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 9px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.project-operations-card > summary > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.project-operations-card > summary strong {
  color: var(--text);
  font-size: 14px;
}

.project-operations-card > summary small {
  color: var(--muted);
  font-size: 11px;
}

.project-operations-summary-facts {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.project-operations-summary-facts b {
  background: var(--theme-subtle, #f2f5f3);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  padding: 5px 7px;
}

.project-operations-body {
  background: var(--theme-subtle, #f7f9f8);
  border-radius: 0 0 12px 12px;
  border-top: 1px solid var(--line);
  padding: 12px;
}

.project-operations-body .project-overview-layout,
.project-operations-body .internal-notes-card,
.project-operations-body .uploads-panel {
  margin-bottom: 10px;
}

.project-operations-body .uploads-panel:last-child {
  margin-bottom: 0;
}

@media (max-width: 1180px) {
  .project-hero-v2 {
    grid-template-columns: minmax(320px, .82fr) minmax(0, 1.18fr);
  }

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

  .project-offer-grid article:nth-child(3) {
    border-left: 0;
    border-top: 1px solid var(--theme-line, #e5ebe8);
  }

  .project-offer-grid article:nth-child(4) {
    border-top: 1px solid var(--theme-line, #e5ebe8);
  }
}

@media (max-width: 1100px) {
  .project-hero-v2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-hero-v2 .project-visual {
    min-height: 330px;
  }

  .project-presentation-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .project-hero-v2 .project-visual {
    min-height: 250px;
  }

  .project-hero-v2 .project-title-block {
    align-items: flex-start;
  }

  .project-hero-v2 .project-title-block > div:last-child {
    width: 100%;
  }

  .project-hero-v2 .project-name-line h1 {
    font-size: 30px;
  }

  .project-hero-v2 .project-action-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .project-action-bar .project-client-action {
    grid-column: 1 / -1;
  }

  .project-action-bar .page-action-menu > summary,
  .project-action-bar > .button {
    justify-content: center;
    width: 100%;
  }

  .project-hero-v2 .project-action-bar .page-action-menu {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .project-inventory-head {
    align-items: stretch;
    flex-direction: column;
  }

  .project-inventory-head .button {
    justify-content: center;
    width: 100%;
  }

  .project-operations-card > summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .project-operations-summary-facts {
    display: none;
  }

  .project-operations-card > summary::after {
    grid-column: 3;
  }
}

@media (max-width: 520px) {
  .project-hero-v2 .project-visual {
    min-height: 210px;
  }

  .project-visual-gallery {
    overflow-x: auto;
    padding-top: 3px;
    scrollbar-width: none;
  }

  .project-visual-gallery::-webkit-scrollbar {
    display: none;
  }

  .project-visual-gallery button img {
    height: 40px;
    width: 54px;
  }

  .project-gallery-count {
    right: 10px;
    top: 10px;
  }

  .project-hero-v2 .project-hero-main,
  .project-about-card,
  .project-facts-card {
    padding: 15px;
  }

  .project-offer-grid article {
    min-height: 92px;
    padding: 11px;
  }

  .project-offer-grid article > strong,
  .project-offer-grid .project-offer-price strong {
    font-size: 18px;
  }

  .project-offer-layouts b {
    font-size: 9px;
  }

  .project-facts-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .project-facts-list div:nth-child(even) {
    padding-left: 0;
  }

  .project-operations-body {
    padding: 8px;
  }
}

/* Unit detail: client-first presentation with operational data kept secondary. */
.unit-profile-hero {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 42px rgba(18, 49, 39, .07);
  display: grid;
  grid-template-columns: minmax(330px, .86fr) minmax(0, 1.14fr);
  margin-bottom: 18px;
  overflow: hidden;
}

.unit-profile-visual {
  background: linear-gradient(145deg, var(--theme-success-soft, #dcebe4), #8caf9f 56%, #406b61);
  min-height: 450px;
  overflow: hidden;
  position: relative;
}

.unit-profile-visual::after {
  background: linear-gradient(180deg, rgba(8, 37, 31, .03) 34%, rgba(8, 37, 31, .8) 100%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.unit-profile-visual > img {
  height: 100%;
  inset: 0;
  object-fit: cover;
  position: absolute;
  width: 100%;
}

.unit-profile-visual-art {
  background:
    radial-gradient(circle at 70% 20%, var(--theme-glass, rgba(255, 255, 255, .32)), transparent 24%),
    linear-gradient(135deg, transparent 0 48%, var(--theme-glass, rgba(255, 255, 255, .15)) 48% 52%, transparent 52%),
    linear-gradient(145deg, var(--theme-success-soft, #dcebe4), #8caf9f 56%, #406b61);
  inset: 0;
  position: absolute;
}

.unit-profile-visual-overlay {
  bottom: 20px;
  color: #fff;
  display: grid;
  gap: 4px;
  left: 20px;
  position: absolute;
  right: 20px;
  z-index: 1;
}

.unit-profile-visual-overlay strong {
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.1;
}

.unit-profile-visual-overlay span {
  color: rgba(255, 255, 255, .82);
  font-size: 13px;
  font-weight: 750;
}

.unit-profile-freshness {
  backdrop-filter: blur(8px);
  background: var(--theme-glass, rgba(255, 255, 255, .9));
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 11px;
  font-weight: 850;
  left: 16px;
  padding: 7px 9px;
  position: absolute;
  top: 16px;
  z-index: 1;
}

.unit-profile-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px 22px;
}

.unit-profile-main > .breadcrumbs {
  margin-bottom: 20px;
}

.unit-profile-title-row {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.unit-profile-kicker {
  color: var(--theme-success-text, var(--accent-dark));
  display: block;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.unit-profile-name-line {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.unit-profile-name-line h1 {
  font-size: clamp(34px, 4vw, 52px);
  letter-spacing: -.035em;
  line-height: 1;
  margin: 0;
}

.unit-profile-title-row p {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  margin: 8px 0 0;
}

.unit-profile-title-actions {
  align-items: flex-end;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.unit-profile-title-actions .unit-favorite-form {
  margin: 0;
}

.unit-profile-offer {
  align-items: end;
  background: linear-gradient(135deg, var(--theme-subtle, #edf7f2), var(--theme-subtle, #f8fbf9));
  border: 1px solid var(--theme-success-line, #d5e9df);
  border-radius: 11px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: space-between;
  margin-top: 20px;
  padding: 15px 16px;
}

.unit-profile-price {
  display: grid;
  gap: 3px;
}

.unit-profile-price > span,
.unit-profile-facts span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.unit-profile-price > strong {
  color: var(--text);
  font-size: clamp(30px, 3.2vw, 42px);
  letter-spacing: -.035em;
  line-height: 1.02;
}

.unit-price-history-trigger {
  align-items: center;
  background: none;
  border: 0;
  border-radius: 4px;
  color: inherit;
  display: inline-flex;
  font: inherit;
  gap: 10px;
  letter-spacing: inherit;
  max-width: 100%;
  padding: 0;
  text-align: left;
}

.unit-price-history-trigger > .ui-icon {
  color: var(--muted);
  flex: 0 0 18px;
  height: 18px;
  width: 18px;
}

.unit-price-history-trigger .promotion-price-current {
  white-space: nowrap;
}

.unit-price-history-label {
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.unit-price-history-trigger:hover,
.unit-price-history-trigger:hover > .ui-icon {
  color: var(--theme-success-text, var(--accent-dark));
}

.unit-price-history-trigger:focus-visible {
  outline: 2px solid var(--theme-success-text, var(--accent-dark));
  outline-offset: 5px;
}

.unit-profile-price > small {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
  font-weight: 800;
}

.unit-profile-currencies {
  display: grid;
  gap: 7px;
  min-width: 135px;
}

.unit-profile-currencies > span {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.unit-profile-currencies small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.unit-profile-currencies strong {
  font-size: 12px;
  white-space: nowrap;
}

.unit-profile-facts {
  border: 1px solid var(--line);
  border-radius: 11px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 12px;
  overflow: hidden;
}

.unit-profile-facts-villa {
  grid-template-columns: 1.45fr 1.1fr repeat(3, minmax(0, 1fr));
}

.unit-profile-facts > div {
  border-left: 1px solid var(--line);
  display: grid;
  gap: 5px;
  min-height: 70px;
  padding: 11px;
}

.unit-profile-facts > div:first-child {
  border-left: 0;
}

.unit-profile-facts strong {
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.unit-profile-facts strong small {
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 750;
  margin-top: 3px;
}

.unit-profile-status-note,
.unit-profile-empty {
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 12px 0 0;
  padding: 10px 12px;
}

.unit-profile-empty {
  display: grid;
  gap: 4px;
  margin-top: 20px;
}

.unit-profile-empty strong {
  color: var(--text);
}

.unit-profile-actions {
  align-items: stretch;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 16px;
}

.unit-profile-actions-manage {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.unit-profile-actions > .button,
.unit-profile-actions > .unit-collection-action > summary {
  justify-content: center;
  min-height: 40px;
  width: 100%;
}

.unit-profile-actions > .unit-collection-action {
  min-width: 0;
}

.unit-profile-actions > .unit-collection-action > div {
  width: min(310px, 100%);
}

.unit-profile-inactive .unit-profile-offer {
  background: var(--theme-subtle, #f7f7f4);
  border-color: var(--line);
}

.unit-profile-inactive .unit-profile-price > strong {
  color: var(--muted);
}

.unit-profile-similar {
  margin-bottom: 18px;
}

.unit-profile-similar .similar-unit-card {
  border-radius: 11px;
  box-shadow: 0 8px 22px rgba(18, 49, 39, .04);
  padding: 14px;
}

.unit-operations-card {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(18, 49, 39, .04);
  overflow: hidden;
}

.unit-operations-card > summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 11px;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  list-style: none;
  min-height: 64px;
  padding: 11px 14px;
}

.unit-operations-card > summary::-webkit-details-marker {
  display: none;
}

.unit-operations-card > summary::after {
  color: var(--muted);
  content: "⌄";
  font-size: 18px;
  grid-column: 4;
  transition: transform .18s ease;
}

.unit-operations-card[open] > summary::after {
  transform: rotate(180deg);
}

.unit-operations-icon {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 9px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.unit-operations-card > summary > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.unit-operations-card > summary strong {
  color: var(--text);
  font-size: 14px;
}

.unit-operations-card > summary small {
  color: var(--muted);
  font-size: 11px;
}

.unit-operations-summary-facts {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.unit-operations-summary-facts b {
  background: var(--theme-subtle, #f2f5f3);
  border-radius: 999px;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  padding: 5px 7px;
}

.unit-operations-body {
  background: var(--theme-subtle, #f7f9f8);
  border-top: 1px solid var(--line);
  padding: 12px;
}

.unit-operations-body .unit-overview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.unit-operations-body .unit-overview > :only-child {
  grid-column: 1 / -1;
}

.unit-operations-body .unit-history-section {
  margin-top: 14px;
}

@media (max-width: 1100px) {
  .unit-profile-hero {
    grid-template-columns: minmax(290px, .74fr) minmax(0, 1.26fr);
  }

  .unit-profile-visual {
    min-height: 430px;
  }

  .unit-profile-facts-villa {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .unit-profile-facts-villa > div:nth-child(4) {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .unit-profile-facts-villa > div:nth-child(5) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 850px) {
  .unit-profile-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .unit-profile-visual {
    min-height: 300px;
  }

  .unit-operations-body .unit-overview {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .unit-profile-visual {
    min-height: 245px;
  }

  .unit-profile-main {
    padding: 16px;
  }

  .unit-profile-main > .breadcrumbs {
    margin-bottom: 15px;
  }

  .unit-profile-title-row {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
  }

  .unit-profile-title-actions {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }

  .unit-profile-offer {
    align-items: flex-start;
    flex-direction: column;
  }

  .unit-profile-currencies {
    border-top: 1px solid var(--theme-success-line, #d5e9df);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 10px;
    width: 100%;
  }

  .unit-profile-currencies > span {
    display: grid;
    gap: 2px;
    justify-items: start;
  }

  .unit-profile-currencies > span + span {
    border-left: 1px solid var(--theme-success-line, #d5e9df);
    padding-left: 12px;
  }

  .unit-profile-currencies strong {
    font-size: 11px;
  }

  .unit-profile-facts,
  .unit-profile-facts-villa {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .unit-profile-facts > div:nth-child(odd) {
    border-left: 0;
  }

  .unit-profile-facts > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .unit-profile-facts-villa > div:nth-child(4) {
    border-left: 1px solid var(--line);
  }

  .unit-operations-card > summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .unit-operations-summary-facts {
    display: none;
  }

  .unit-operations-card > summary::after {
    grid-column: 3;
  }

  .unit-operations-body {
    padding: 8px;
  }
}

@media (max-width: 430px) {
  .unit-profile-visual {
    min-height: 210px;
  }

  .unit-profile-name-line h1 {
    font-size: 36px;
  }

  .unit-profile-price > strong {
    font-size: 29px;
  }
}

/* Favorites: client shortlist and side-by-side comparison. */
.collection-detail-hero {
  background: linear-gradient(135deg, var(--theme-surface, #ffffff), var(--theme-subtle, #f3f8f5));
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 12px 30px rgba(18, 44, 35, .05);
  margin-bottom: 14px;
  overflow: hidden;
}

.collection-detail-back {
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  margin: 13px 17px 0;
  text-decoration: none;
}

.collection-detail-back:hover {
  text-decoration: underline;
}

.collection-detail-main {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  padding: 10px 17px 15px;
}

.collection-detail-main > div:first-child {
  min-width: 0;
}

.collection-detail-main h1 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.04em;
  line-height: 1.05;
  margin: 4px 0 6px;
  overflow-wrap: anywhere;
}

.collection-detail-main p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.collection-detail-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.collection-detail-actions .button {
  min-height: 38px;
  padding: 8px 11px;
}

.collection-detail-actions button b {
  align-items: center;
  background: var(--theme-glass, rgba(255, 255, 255, .22));
  border-radius: 999px;
  display: inline-flex;
  font-size: 9px;
  height: 18px;
  justify-content: center;
  min-width: 18px;
}

.collection-export-menu > summary {
  border-color: var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  min-height: 38px;
  padding: 8px 11px;
}

.collection-export-menu > summary:hover {
  background: var(--surface-hover);
  border-color: var(--theme-line, #aebfb7);
  color: var(--theme-success-text, var(--accent-dark));
}

.collection-export-menu > summary .ui-icon,
.collection-export-menu > div .ui-icon {
  height: 15px;
  width: 15px;
}

.collection-export-menu > div {
  min-width: 205px;
}

.collection-export-menu > div a {
  align-items: center;
  display: flex;
  gap: 9px;
}

.collection-detail-metrics {
  background: var(--theme-subtle, #f8faf9);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.collection-detail-metrics > span {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 11px 17px;
}

.collection-detail-metrics > span + span {
  border-left: 1px solid var(--line);
}

.collection-detail-metrics small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.collection-detail-metrics strong {
  font-size: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.collection-shortlist-card {
  grid-template-rows: 138px 1fr auto;
}

.collection-shortlist-card .unit-result-body {
  align-content: start;
  gap: 8px;
  grid-template-rows: 36px 24px 14px 88px 44px minmax(39px, auto);
  padding: 13px;
}

.collection-shortlist-card .unit-result-head,
.collection-shortlist-card .unit-result-project-line,
.collection-shortlist-card .unit-result-readiness,
.collection-shortlist-card .unit-result-facts,
.collection-shortlist-card .unit-result-price {
  min-height: 0;
}

.collection-shortlist-card .unit-result-project-line {
  overflow: hidden;
}

.collection-shortlist-card .unit-result-project:hover {
  text-decoration: none;
}

.collection-shortlist-card .unit-result-readiness {
  margin: 0;
}

.collection-shortlist-card .unit-result-readiness.is-empty {
  visibility: hidden;
}

.collection-shortlist-card .unit-result-facts {
  height: 88px;
  padding-block: 8px;
}

.collection-shortlist-card .unit-result-price {
  align-self: stretch;
}

.collection-shortlist-card .unit-result-footer {
  min-height: 40px;
  padding: 8px 13px;
}

.collection-shortlist-card .unit-result-footer-actions {
  align-items: center;
  display: inline-flex;
  gap: 8px;
}

.collection-shortlist-card .unit-result-footer-actions form {
  margin: 0;
}

.collection-shortlist-card .unit-result-footer-actions button {
  background: transparent;
  border: 0;
  color: var(--theme-danger-text, #9a3342);
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 800;
  padding: 0;
}

.collection-order-toolbar {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 11px;
  gap: 12px;
  justify-content: space-between;
  margin: -2px 1px 10px;
  min-height: 22px;
}

.collection-order-toolbar > span {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.collection-order-toolbar .ui-icon {
  color: var(--theme-success-text, var(--accent));
  height: 15px;
  width: 15px;
}

.collection-order-toolbar output {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  min-height: 15px;
  text-align: right;
}

.collection-order-toolbar output[data-state="saving"] {
  color: var(--theme-success-text, var(--accent-dark));
}

.collection-order-toolbar output[data-state="saved"] {
  color: var(--theme-success-text, #28724f);
}

.collection-order-toolbar output[data-state="error"] {
  color: var(--theme-danger-text, #a33746);
}

.unit-result-head > .unit-result-head-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
}

.collection-unit-grid[data-collection-sortable] .collection-shortlist-card {
  cursor: grab;
}

.collection-unit-grid[data-collection-sortable] .collection-shortlist-card:active {
  cursor: grabbing;
}

.collection-unit-grid[data-collection-sortable] .collection-shortlist-card :is(a, button, input, textarea, select, label, summary) {
  cursor: pointer;
}

.collection-shortlist-card.is-dragging {
  border-color: var(--theme-success-text, var(--accent));
  box-shadow: 0 18px 40px rgba(18, 62, 47, .15);
  opacity: .52;
  position: relative;
  transform: scale(.985);
  z-index: 3;
}

.collection-unit-grid.is-saving-order .collection-shortlist-card {
  cursor: wait;
}

body.is-reordering-collection,
body.is-reordering-collection * {
  cursor: grabbing !important;
  user-select: none !important;
}

.collection-presentation-settings {
  border-top: 1px solid var(--line);
}

.collection-presentation-settings > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  list-style: none;
  padding: 11px 17px;
}

.collection-presentation-settings > summary::-webkit-details-marker,
.collection-unit-presentation > summary::-webkit-details-marker {
  display: none;
}

.collection-presentation-settings > summary > span {
  align-items: center;
  display: grid;
  gap: 2px 8px;
  grid-template-columns: 20px minmax(0, 1fr);
  min-width: 0;
}

.collection-presentation-settings > summary .ui-icon {
  color: var(--theme-success-text, var(--accent));
  grid-row: 1 / 3;
  height: 16px;
  width: 16px;
}

.collection-presentation-settings > summary strong {
  font-size: 11px;
}

.collection-presentation-settings > summary small {
  color: var(--muted);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-presentation-settings > summary > b {
  color: var(--theme-success-text, var(--accent-dark));
  flex: 0 0 auto;
  font-size: 10px;
}

.collection-presentation-settings[open] > summary {
  background: var(--theme-subtle, #f4f8f6);
}

.collection-presentation-form {
  align-items: end;
  border-top: 1px solid var(--theme-line, #e7ece9);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px 17px 14px;
}

.collection-presentation-form label {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.collection-presentation-form label > span {
  color: var(--theme-text, #46554e);
  font-size: 10px;
  font-weight: 800;
}

.collection-presentation-form label > small {
  color: var(--muted);
  font-size: 9px;
}

.collection-presentation-form textarea {
  line-height: 1.35;
  min-height: 66px;
  resize: vertical;
}

.collection-unit-presentation {
  border: 1px solid var(--theme-line, #e3e9e6);
  border-radius: 9px;
  margin-top: 2px;
  overflow: hidden;
}

.collection-unit-presentation > summary {
  align-items: center;
  background: var(--theme-subtle, #f8faf9);
  cursor: pointer;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  list-style: none;
  padding: 8px 9px;
}

.collection-unit-presentation > summary > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.collection-unit-presentation > summary strong {
  color: var(--theme-text, #46554e);
  font-size: 9px;
}

.collection-unit-presentation > summary small {
  color: var(--muted);
  font-size: 9px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-unit-presentation > summary .ui-icon {
  color: var(--theme-success-text, var(--accent));
  flex: 0 0 auto;
  height: 14px;
  width: 14px;
}

.collection-unit-presentation .collection-presentation-form {
  padding: 9px;
}

.collection-unit-presentation .collection-presentation-form textarea {
  min-height: 56px;
}

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

.favorites-client-head {
  align-items: flex-end;
  margin-bottom: 16px;
}

.favorites-head-compare b {
  align-items: center;
  background: var(--theme-glass, rgba(255, 255, 255, .2));
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 5px;
}

.favorites-head-compare:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.favorites-client-guide {
  align-items: center;
  background: linear-gradient(135deg, var(--theme-success-soft, #eaf6f0), var(--theme-subtle, #f8fbf9));
  border: 1px solid var(--theme-success-line, #d0e6db);
  border-radius: 12px;
  display: grid;
  gap: 13px;
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 12px;
  padding: 14px 16px;
}

.favorites-client-guide-icon {
  align-items: center;
  background: var(--theme-surface, #fff);
  border-radius: 10px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.favorites-client-guide > div {
  display: grid;
  gap: 3px;
}

.favorites-client-guide strong {
  font-size: 14px;
}

.favorites-client-guide p,
.favorites-client-guide small {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}

.favorites-client-guide > small {
  max-width: 210px;
  text-align: right;
}

.favorites-filters {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 11px;
  margin-bottom: 12px;
  overflow: visible;
}

.favorites-filters > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  list-style: none;
  min-height: 50px;
  padding: 10px 13px;
}

.favorites-filters > summary::-webkit-details-marker {
  display: none;
}

.favorites-filters > summary > span {
  align-items: center;
  color: var(--text);
  display: flex;
  font-size: 13px;
  font-weight: 850;
  gap: 8px;
}

.favorites-filters > summary > span .ui-icon {
  color: var(--theme-success-text, var(--accent-dark));
}

.favorites-filters > summary > small {
  color: var(--muted);
  font-size: 11px;
  margin-left: auto;
}

.favorites-filters > summary::after {
  color: var(--muted);
  content: "⌄";
  font-size: 18px;
  transition: transform .18s ease;
}

.favorites-filters[open] > summary::after {
  transform: rotate(180deg);
}

.favorites-filters-body {
  border-top: 1px solid var(--line);
  padding: 10px;
}

.favorites-filters-body .units-filters-panel {
  border: 0;
  box-shadow: none;
  margin: 0;
  padding: 0;
}

.favorites-filters-body > .filter-chips {
  margin: 10px 0 0;
}

.favorites-results-toolbar {
  margin-top: 14px;
}

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

.favorite-shortlist-card {
  grid-template-rows: 192px 1fr auto;
}

.unit-result-card.is-selected-for-comparison,
.favorite-shortlist-card.is-selected-for-comparison {
  border-color: var(--theme-success-text, #6ead91);
  box-shadow: 0 18px 38px rgba(27, 103, 78, .14), inset 0 0 0 1px #6ead91;
}

.clickable-row.is-selected-for-comparison > td {
  background: var(--theme-subtle, #eff8f3);
}

.unit-result-project-line {
  align-items: center;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.unit-result-project-line .unit-result-project {
  min-width: 0;
}

.unit-result-project-line .project-ownership-badge {
  flex: 0 0 auto;
  font-size: 9px;
  padding: 4px 6px;
}

.unit-compare-picker {
  align-items: center;
  backdrop-filter: blur(8px);
  background: var(--theme-glass, rgba(255, 255, 255, .93));
  border: 1px solid var(--theme-line, rgba(255, 255, 255, .7));
  border-radius: 999px;
  bottom: 12px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  gap: 7px;
  left: 12px;
  padding: 7px 10px;
  position: absolute;
  z-index: 3;
}

.unit-compare-picker:hover {
  color: var(--theme-success-text, var(--accent-dark));
}

.unit-compare-picker:has(input:checked) {
  background: var(--theme-success-soft, #e7f4ed);
  border-color: var(--theme-success-text, #8fc5ad);
  color: var(--theme-success-text, var(--accent-dark));
}

.unit-compare-picker:has(input:disabled) {
  cursor: not-allowed;
  opacity: .58;
}

.unit-compare-picker input {
  accent-color: var(--theme-success-text, var(--accent));
  flex: 0 0 15px;
  height: 15px;
  margin: 0;
  min-height: 15px;
  width: 15px;
}

.unit-compare-picker.is-compact {
  background: transparent;
  border: 0;
  border-radius: 5px;
  bottom: auto;
  left: auto;
  padding: 3px;
  position: static;
}

.unit-compare-picker.is-compact span {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.unit-compare-picker.is-inline {
  background: var(--theme-subtle, #f3f7f5);
  border: 1px solid var(--theme-line, #d9e6df);
  bottom: auto;
  left: auto;
  padding: 7px 10px;
  position: static;
}

.unit-comparison-root {
  display: contents;
}

.favorite-comparison-feedback {
  align-self: center;
  color: var(--muted);
  font-size: 13px;
  grid-column: 1 / -1;
  justify-self: center;
  margin: 28px;
  text-align: center;
}

.favorite-comparison-feedback.is-error {
  color: var(--danger);
}

.similar-unit-card-shell {
  min-width: 0;
  position: relative;
}

.similar-unit-card-shell .similar-unit-card {
  height: 100%;
  padding-bottom: 50px;
}

.similar-unit-card-shell .unit-compare-picker {
  bottom: 10px;
  left: 10px;
  position: absolute;
}

.similar-unit-card-shell.is-selected-for-comparison .similar-unit-card {
  border-color: var(--theme-success-text, #6ead91);
  box-shadow: 0 12px 28px rgba(27, 103, 78, .12), inset 0 0 0 1px #6ead91;
}

.favorites-comparison-selection {
  align-items: center;
  background: rgba(23, 55, 45, .96);
  border: 1px solid var(--theme-line, rgba(255, 255, 255, .15));
  border-radius: 13px;
  bottom: 18px;
  box-shadow: 0 18px 46px rgba(8, 29, 23, .3);
  color: #fff;
  display: flex;
  gap: 20px;
  justify-content: space-between;
  left: calc(50% + 112px);
  max-width: calc(100vw - 280px);
  min-width: min(620px, calc(100vw - 300px));
  padding: 11px 12px 11px 16px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 40;
}

.favorites-comparison-selection[hidden] {
  display: none;
}

.favorites-comparison-selection > div:first-child {
  display: grid;
  gap: 2px;
}

.favorites-comparison-selection span {
  font-size: 13px;
  font-weight: 800;
}

.favorites-comparison-selection small {
  color: rgba(255, 255, 255, .68);
  font-size: 10px;
}

.favorites-comparison-selection > div:last-child {
  display: flex;
  gap: 7px;
}

.favorites-comparison-selection .button-muted {
  background: var(--theme-glass, rgba(255, 255, 255, .1));
  border-color: var(--theme-line, rgba(255, 255, 255, .2));
  color: #fff;
}

.favorites-comparison-selection .button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.favorites-comparison-dialog {
  background: transparent;
  border: 0;
  height: min(820px, calc(100vh - 36px));
  max-height: calc(100vh - 36px);
  max-width: min(1220px, calc(100vw - 36px));
  padding: 0;
  width: min(1220px, calc(100vw - 36px));
}

.favorites-comparison-dialog::backdrop {
  backdrop-filter: blur(5px);
  background: rgba(10, 28, 22, .62);
}

.comparison-collection-dialog {
  background: transparent;
  border: 0;
  max-height: calc(100vh - 32px);
  max-width: min(470px, calc(100vw - 28px));
  padding: 0;
  width: min(470px, calc(100vw - 28px));
}

.comparison-collection-dialog::backdrop {
  backdrop-filter: blur(5px);
  background: rgba(10, 28, 22, .62);
}

.comparison-collection-shell {
  background: var(--theme-surface, #fff);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(8, 29, 23, .3);
  overflow: hidden;
}

.comparison-collection-head {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 17px 18px 15px;
}

.comparison-collection-head > div {
  display: grid;
  gap: 3px;
}

.comparison-collection-head span {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.comparison-collection-head h2 {
  font-size: 21px;
  line-height: 1.16;
  margin: 0;
}

.comparison-collection-head p {
  color: var(--muted);
  font-size: 11px;
  margin: 2px 0 0;
}

.comparison-collection-body {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
}

.comparison-collection-field {
  display: grid;
  gap: 6px;
}

.comparison-collection-field > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.comparison-collection-field select,
.comparison-collection-field input {
  background: var(--theme-subtle, #f8faf9);
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  font: inherit;
  min-height: 42px;
  padding: 8px 11px;
  width: 100%;
}

.comparison-collection-field select:focus,
.comparison-collection-field input:focus {
  border-color: var(--theme-success-text, var(--accent));
  box-shadow: 0 0 0 3px rgba(27, 103, 78, .1);
  outline: 0;
}

.comparison-collection-divider {
  align-items: center;
  color: var(--muted);
  display: grid;
  font-size: 10px;
  gap: 9px;
  grid-template-columns: 1fr auto 1fr;
  text-transform: uppercase;
}

.comparison-collection-divider::before,
.comparison-collection-divider::after {
  background: var(--line);
  content: "";
  height: 1px;
}

.comparison-collection-feedback {
  background: var(--theme-subtle, #edf7f2);
  border: 1px solid var(--theme-success-line, #cce6d9);
  border-radius: 9px;
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 11px;
  font-weight: 700;
  margin: 0;
  padding: 9px 10px;
}

.comparison-collection-feedback[hidden] {
  display: none;
}

.comparison-collection-feedback.is-error {
  background: var(--theme-danger-soft, #fff3f1);
  border-color: var(--theme-danger-line, #f0cbc5);
  color: var(--danger);
}

.comparison-collection-actions {
  align-items: center;
  background: var(--theme-subtle, #f8faf9);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 11px 18px;
}

.comparison-collection-actions > div {
  display: flex;
  gap: 7px;
  margin-left: auto;
}

.comparison-collection-actions [hidden] {
  display: none;
}

.favorites-comparison-shell {
  background: var(--theme-subtle, #f5f8f6);
  border-radius: 16px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  overflow: hidden;
}

.favorites-comparison-head {
  align-items: flex-start;
  background: var(--theme-surface, #fff);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 17px 20px;
}

.favorites-comparison-head > div {
  display: grid;
  gap: 3px;
}

.favorites-comparison-head > div > span {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.favorites-comparison-head h2 {
  font-size: 24px;
  margin: 0;
}

.favorites-comparison-head p {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}

.favorite-comparison-close {
  align-items: center;
  background: var(--theme-subtle, #f2f5f3);
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  height: 36px;
  justify-content: center;
  width: 36px;
}

.favorites-comparison-grid {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  overflow: auto;
  padding: 12px;
}

.favorite-comparison-unit {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 11px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.favorite-comparison-visual {
  background: var(--theme-subtle, #f7faf8);
  height: 92px;
  overflow: hidden;
  position: relative;
}

.favorite-comparison-visual::after {
  content: none;
}

.favorite-comparison-visual img {
  height: 100%;
  object-fit: contain;
  padding: 4px;
  width: 100%;
}

.favorite-comparison-visual .status {
  bottom: 9px;
  position: absolute;
  right: 9px;
  z-index: 1;
}

.favorite-comparison-unit-head {
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 2px;
  padding: 9px 10px;
}

.favorite-comparison-unit-head small {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 11px;
  font-weight: 800;
}

.favorite-comparison-unit-head h3 {
  font-size: 22px;
  line-height: 1;
  margin: 0;
}

.favorite-comparison-unit-head p {
  color: var(--muted);
  font-size: 10px;
  margin: 0;
}

.favorite-comparison-unit dl {
  display: grid;
  margin: 0;
}

.favorite-comparison-fact {
  align-items: center;
  border-bottom: 1px solid var(--theme-line, #edf1ef);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-height: 34px;
  padding: 6px 10px;
}

.favorite-comparison-fact dt {
  color: var(--muted);
  font-size: 10px;
}

.favorite-comparison-fact dd {
  font-size: 11px;
  font-weight: 800;
  margin: 0;
  max-width: 62%;
  overflow-wrap: anywhere;
  text-align: right;
}

.favorite-comparison-unit > .button {
  justify-content: center;
  margin: 8px 9px 9px;
}

.favorites-comparison-actions {
  align-items: center;
  background: var(--theme-surface, #fff);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 12px 18px;
}

.favorites-comparison-actions > small {
  color: var(--muted);
  font-size: 10px;
}

.favorites-comparison-actions > div {
  display: flex;
  gap: 8px;
}

@media (max-width: 1250px) and (min-width: 901px) {
  .favorites-comparison-selection {
    left: calc(50% + 105px);
  }
}

@media (max-width: 900px) {
  .favorites-comparison-selection {
    bottom: 78px;
    left: 50%;
    max-width: calc(100vw - 24px);
    min-width: min(620px, calc(100vw - 24px));
  }
}

@media (max-width: 760px) {
  .collection-detail-main {
    align-items: stretch;
    display: grid;
    gap: 13px;
  }

  .collection-detail-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .collection-detail-actions .button {
    justify-content: center;
    min-width: 0;
  }

  .collection-export-menu {
    grid-column: 1 / -1;
  }

  .collection-export-menu > summary {
    justify-content: center;
  }

  .collection-export-menu > div {
    left: 0;
    min-width: 0;
    right: 0;
  }

  .collection-unit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .collection-shortlist-card {
    grid-template-columns: 140px minmax(0, 1fr);
    grid-template-rows: 1fr auto;
  }

  .collection-shortlist-card .unit-result-cover {
    grid-row: 1 / 3;
    min-height: 245px;
  }

  .collection-presentation-form {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .collection-presentation-form .button {
    justify-content: center;
  }

  .favorites-client-head {
    align-items: stretch;
  }

  .favorites-client-head .page-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .favorites-client-head .page-actions .favorites-head-compare {
    grid-column: 1 / -1;
  }

  .favorites-client-head .page-actions > * {
    justify-content: center;
  }

  .favorites-client-head .page-actions .button {
    font-size: 12px;
    min-width: 0;
    padding: 8px 10px;
  }

  .favorites-client-head .page-actions .personal-inline-action {
    min-width: 0;
  }

  .favorites-client-head .page-actions .personal-inline-action > summary {
    width: 100%;
  }

  .favorites-page-head .favorites-head-export {
    grid-column: 1 / -1;
  }

  .favorites-client-guide {
    align-items: start;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .favorites-client-guide > small {
    grid-column: 2;
    max-width: none;
    text-align: left;
  }

  .favorites-filters > summary > small {
    display: none;
  }

  .favorites-unit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .favorites-comparison-selection {
    align-items: stretch;
    gap: 9px;
    padding: 10px;
  }

  .favorites-comparison-selection [data-clear-comparison] {
    display: none;
  }

  .favorites-comparison-dialog {
    height: calc(100vh - 16px);
    max-height: calc(100vh - 16px);
    max-width: calc(100vw - 16px);
    width: calc(100vw - 16px);
  }

  .favorites-comparison-head {
    padding: 14px;
  }

  .favorites-comparison-head h2 {
    font-size: 21px;
  }

  .favorites-comparison-grid {
    grid-auto-columns: minmax(235px, 82vw);
    grid-auto-flow: column;
    grid-template-columns: none;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
  }

  .favorite-comparison-unit {
    scroll-snap-align: start;
  }

  .favorites-comparison-actions {
    align-items: stretch;
    padding: 10px;
  }

  .favorites-comparison-actions > small {
    display: none;
  }

  .favorites-comparison-actions > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .favorites-comparison-actions .button {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .collection-detail-back {
    margin-inline: 13px;
  }

  .collection-detail-main {
    padding: 9px 13px 13px;
  }

  .collection-detail-main h1 {
    font-size: 29px;
  }

  .collection-detail-main p {
    line-height: 1.35;
  }

  .collection-detail-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .collection-export-menu {
    grid-column: auto;
  }

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

  .collection-detail-metrics > span:last-child {
    border-left: 0;
    border-top: 1px solid var(--line);
    grid-column: 1 / -1;
  }

  .collection-detail-metrics > span {
    padding: 9px 10px;
  }

  .collection-detail-metrics small {
    font-size: 11px;
  }

  .collection-detail-metrics strong {
    font-size: 15px;
  }

  .collection-shortlist-card {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 130px auto auto;
  }

  .collection-shortlist-card .unit-result-cover {
    grid-row: auto;
    min-height: 130px;
  }

  .collection-order-toolbar {
    display: none;
  }

}

@media (max-width: 520px) {
  .favorites-client-guide {
    padding: 12px;
  }

  .favorites-client-guide-icon {
    height: 36px;
    width: 36px;
  }

  .favorites-comparison-selection > div:first-child {
    max-width: 118px;
  }

  .favorites-comparison-selection .button {
    font-size: 11px;
    padding-inline: 8px;
  }

  .comparison-collection-head {
    padding: 14px;
  }

  .comparison-collection-head h2 {
    font-size: 19px;
  }

  .comparison-collection-body {
    padding: 14px;
  }

  .comparison-collection-actions {
    align-items: stretch;
    flex-direction: column;
    padding: 10px 14px 14px;
  }

  .comparison-collection-actions > .button,
  .comparison-collection-actions > div {
    width: 100%;
  }

  .comparison-collection-actions > div {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .comparison-collection-actions .button {
    justify-content: center;
  }
}

/* Personal workspace, saved searches and client shortlists */
.discovery-personal-list {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.discovery-personal-list > :is(a, button) {
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 54px;
  padding: 9px 11px;
  text-decoration: none;
}

.discovery-personal-list > :is(a, button):last-child {
  border-bottom: 0;
}

.discovery-personal-list > :is(a, button):hover {
  background: var(--surface-hover);
}

.discovery-personal-list > :is(a, button) > span:first-child {
  align-items: center;
  background: var(--accent-soft);
  border-radius: 9px;
  color: var(--theme-success-text, var(--accent-dark));
  display: flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.discovery-personal-list > :is(a, button) > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.discovery-personal-list strong,
.discovery-personal-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.discovery-personal-list strong {
  font-size: 13px;
}

.discovery-personal-list small {
  color: var(--muted);
  font-size: 11px;
}

.discovery-personal-list b {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 19px;
}

.discovery-personal-list .discovery-personal-primary {
  background: linear-gradient(135deg, #173f35, #0d745c);
  color: #fff;
}

.discovery-personal-list .discovery-personal-primary:hover {
  background: linear-gradient(135deg, #12372e, #09644f);
}

.discovery-personal-list .discovery-personal-primary > span:first-child {
  background: var(--theme-glass, rgba(255, 255, 255, .14));
  color: #fff;
}

.discovery-personal-list .discovery-personal-primary small,
.discovery-personal-list .discovery-personal-primary b {
  color: rgba(255, 255, 255, .78);
}

.discovery-personal-all {
  align-items: center;
  color: var(--theme-success-text, var(--accent-dark));
  display: flex;
  font-size: 12px;
  font-weight: 800;
  justify-content: space-between;
  gap: 10px;
  margin-top: 11px;
  min-height: 36px;
  text-decoration: none;
  white-space: nowrap;
}

.discovery-personal-all span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}

.personal-workspace-head {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.personal-workspace-head h1 {
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -.035em;
  margin: 4px 0 7px;
}

.personal-workspace-head p,
.personal-workspace-section .section-head p {
  color: var(--muted);
  margin: 0;
}

.personal-workspace-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(18, 24, 39, .045);
  min-width: 0;
  padding: 18px;
}

.personal-workspace-section + .personal-workspace-grid,
.personal-workspace-grid {
  margin-top: 16px;
}

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

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

.personal-recent-card {
  background: var(--theme-subtle, #f9fbfa);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--text);
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px;
  text-decoration: none;
}

.personal-recent-card:hover {
  border-color: var(--theme-success-line, #bad3c9);
  box-shadow: 0 8px 18px rgba(18, 24, 39, .05);
}

.personal-recent-card > strong {
  font-size: 18px;
}

.personal-recent-card > small,
.personal-recent-project,
.personal-recent-card time {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-recent-project {
  color: var(--theme-success-text, var(--accent-dark));
  font-weight: 800;
}

.personal-recent-card > span:last-child {
  align-items: end;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-top: 4px;
}

.personal-recent-card b {
  font-size: 13px;
}

.personal-item-list {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: visible;
}

.personal-list-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  position: relative;
}

.personal-list-item:last-child {
  border-bottom: 0;
}

.personal-list-item > a {
  align-items: center;
  color: var(--text);
  display: grid;
  gap: 10px;
  grid-template-columns: 30px minmax(0, 1fr);
  min-height: 56px;
  min-width: 0;
  padding: 9px 11px;
  text-decoration: none;
}

.personal-list-item > a:hover {
  background: var(--surface-hover);
}

.personal-list-item > a > .ui-icon {
  color: var(--theme-success-text, var(--accent));
}

.personal-list-item > a > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.personal-list-item strong,
.personal-list-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.personal-list-item strong {
  font-size: 13px;
}

.personal-list-item small {
  color: var(--muted);
  font-size: 11px;
}

.personal-delete-action {
  margin-right: 8px;
  position: relative;
}

.personal-delete-action > summary {
  align-items: center;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  height: 38px;
  justify-content: center;
  list-style: none;
  width: 38px;
}

.personal-delete-action > summary::-webkit-details-marker,
.personal-inline-action > summary::-webkit-details-marker,
.unit-collection-action > summary::-webkit-details-marker {
  display: none;
}

.personal-delete-action[open] > summary,
.personal-delete-action > summary:hover {
  background: var(--theme-danger-soft, #fff0f0);
  color: var(--theme-danger-text, #a23b3b);
}

.personal-delete-action form {
  background: var(--panel);
  border: 1px solid var(--theme-danger-line, #efcaca);
  border-radius: 9px;
  box-shadow: var(--shadow);
  padding: 7px;
  position: absolute;
  right: 0;
  top: 42px;
  width: max-content;
  z-index: 12;
}

.personal-delete-action button,
.collection-table-remove button,
.unit-result-footer-actions button {
  background: transparent;
  border: 0;
  color: var(--theme-danger-text, #a23b3b);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
}

.personal-create-form {
  align-items: end;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 12px;
}

.personal-create-form label,
.personal-inline-action label,
.unit-collection-action label {
  display: grid;
  gap: 5px;
}

.personal-create-form label > span,
.personal-inline-action label > span,
.unit-collection-action label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.personal-create-form input,
.personal-inline-action input,
.unit-collection-action select {
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  min-height: 40px;
  padding: 8px 10px;
  width: 100%;
}

.personal-empty-state {
  align-items: center;
  background: var(--theme-subtle, #f8faf9);
  border: 1px dashed var(--theme-line, #cfdad5);
  border-radius: 10px;
  color: var(--muted);
  display: flex;
  gap: 11px;
  min-height: 76px;
  padding: 13px;
}

.personal-empty-state > .ui-icon {
  color: var(--theme-success-text, var(--accent));
  height: 24px;
  width: 24px;
}

.personal-empty-state > span {
  display: grid;
  gap: 3px;
}

.personal-empty-state strong {
  color: var(--text);
  font-size: 13px;
}

.personal-empty-state small {
  font-size: 11px;
}

.personal-inline-action,
.unit-collection-action {
  position: relative;
}

.personal-inline-action > summary,
.unit-collection-action > summary {
  cursor: pointer;
  list-style: none;
}

.personal-inline-action > form,
.unit-collection-action > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 10px;
  padding: 12px;
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  width: min(310px, 82vw);
  z-index: 30;
}

.unit-collection-action > div p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.unit-collection-action > div {
  bottom: calc(100% + 7px);
  left: 0;
  right: auto;
  top: auto;
}

.unit-collection-action > div > a {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.unit-collection-action form {
  display: grid;
  gap: 9px;
}

.unit-result-footer-actions {
  align-items: center;
  display: flex;
  gap: 11px;
}

.unit-result-footer-actions form,
.collection-table-remove {
  margin: 0;
}

.collection-table-remove {
  display: inline-flex;
  margin-left: 4px;
}

.collection-table-remove button {
  align-items: center;
  border-radius: 6px;
  display: flex;
  height: 26px;
  justify-content: center;
  padding: 0;
  width: 26px;
}

.collections-hub-head {
  align-items: flex-end;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 14px;
}

.collections-hub-head h1 {
  font-size: clamp(30px, 4vw, 44px);
  letter-spacing: -.04em;
  margin: 4px 0 6px;
}

.collections-hub-head p,
.collections-hub-section-head p {
  color: var(--muted);
  margin: 0;
}

.collections-hub-summary {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
}

.collections-hub-summary > div {
  align-items: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  display: grid;
  gap: 4px 10px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 58px;
  padding: 9px 12px;
}

.collections-hub-summary > div > span {
  align-items: center;
  background: var(--theme-hover, #eaf4ef);
  border-radius: 9px;
  color: var(--theme-success-text, var(--accent-dark));
  display: flex;
  grid-row: 1 / 3;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.collections-hub-summary small {
  align-self: end;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.collections-hub-summary strong {
  font-size: 22px;
  grid-column: 3;
  grid-row: 1 / 3;
}

.collections-hub-featured {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, .75fr);
}

.collection-hub-card,
.collection-hub-create,
.collections-hub-section,
.collections-work-tools {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(18, 24, 39, .045);
}

.collection-hub-card {
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: visible;
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.collection-hub-card:hover {
  border-color: var(--theme-line, #b9d2c8);
  box-shadow: 0 14px 34px rgba(18, 24, 39, .075);
  transform: translateY(-1px);
}

.collection-hub-card > header {
  align-items: center;
  display: grid;
  gap: 11px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  padding: 14px 15px 10px;
}

.collection-hub-card > header > span:nth-child(2) {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.collection-hub-card > header small,
.collection-hub-create > div > small {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.collection-hub-card > header strong {
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-hub-card > header em {
  background: var(--theme-hover, #eaf4ef);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  padding: 5px 8px;
  white-space: nowrap;
}

.collection-hub-icon {
  align-items: center;
  background: linear-gradient(145deg, var(--theme-success-soft, #e5f2ec), var(--theme-subtle, #f4faf7));
  border: 1px solid var(--theme-success-line, #cfe3da);
  border-radius: 11px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.collection-hub-icon .ui-icon {
  height: 19px;
  width: 19px;
}

.collection-hub-card > p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
  padding: 0 15px 11px;
}

.collection-hub-card-body {
  color: var(--text);
  display: grid;
  gap: 11px;
  padding: 0 15px 13px;
  text-decoration: none;
}

.collection-hub-card-system .collection-hub-metrics,
.collection-hub-card-system .collection-hub-projects {
  margin-inline: 15px;
}

.collection-hub-metrics {
  background: var(--theme-subtle, #f7faf8);
  border: 1px solid var(--theme-line, #e5ece8);
  border-radius: 10px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  overflow: hidden;
}

.collection-hub-metrics > span {
  border-right: 1px solid var(--theme-line, #e5ece8);
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 9px 10px;
}

.collection-hub-metrics > span:last-child {
  border-right: 0;
}

.collection-hub-metrics small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
}

.collection-hub-metrics b {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-hub-projects {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.collection-hub-projects > span {
  background: var(--theme-subtle, #eef4f1);
  border-radius: 999px;
  color: var(--theme-muted, #49665b);
  font-size: 9px;
  font-weight: 750;
  max-width: 160px;
  overflow: hidden;
  padding: 4px 7px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-hub-card > footer {
  align-items: center;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: auto;
  min-height: 42px;
  padding: 9px 15px;
}

.collection-hub-card > footer > span {
  color: var(--muted);
  font-size: 9px;
}

.collection-hub-card > footer a,
.collection-hub-card > footer b {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 11px;
  font-weight: 850;
  text-decoration: none;
}

.collection-hub-card-system > footer {
  margin-top: 11px;
}

.collection-hub-card .personal-delete-action {
  margin: 0;
}

.collection-hub-create {
  display: grid;
  gap: 10px 12px;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 15px;
}

.collection-hub-create > div {
  display: grid;
  gap: 3px;
}

.collection-hub-create h2 {
  font-size: 19px;
  margin: 0;
}

.collection-hub-create p {
  color: var(--muted);
  font-size: 11px;
  margin: 0;
}

.collection-hub-create form {
  display: grid;
  gap: 9px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
}

.collection-hub-create label {
  display: grid;
  gap: 5px;
}

.collection-hub-create label > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.collection-hub-create input {
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
  min-height: 42px;
  padding: 8px 10px;
  width: 100%;
}

.collection-hub-create .button {
  align-self: end;
  min-height: 42px;
}

.collections-hub-section {
  margin-top: 14px;
  padding: 17px;
}

.collections-hub-section-head {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 13px;
}

.collections-hub-section-head h2 {
  margin: 3px 0 4px;
}

.collections-hub-section-head > strong {
  align-items: center;
  background: var(--theme-hover, #eaf4ef);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  display: flex;
  font-size: 12px;
  height: 30px;
  justify-content: center;
  min-width: 30px;
  padding: 0 9px;
}

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

.collection-hub-grid .collection-hub-card {
  box-shadow: none;
}

.collections-hub-empty {
  align-items: center;
  background: var(--theme-subtle, #f8faf9);
  border: 1px dashed var(--theme-line, #cfdad5);
  border-radius: 11px;
  display: grid;
  gap: 13px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  padding: 14px;
}

.collections-hub-empty > span {
  align-items: center;
  background: var(--theme-hover, #eaf4ef);
  border-radius: 9px;
  color: var(--theme-success-text, var(--accent-dark));
  display: flex;
  height: 38px;
  justify-content: center;
}

.collections-hub-empty strong {
  font-size: 13px;
}

.collections-hub-empty p {
  color: var(--muted);
  font-size: 11px;
  margin: 2px 0 0;
}

.collections-work-tools {
  margin-top: 14px;
  overflow: hidden;
}

.collections-work-tools > summary {
  align-items: center;
  cursor: pointer;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  list-style: none;
  min-height: 54px;
  padding: 11px 15px;
}

.collections-work-tools > summary::-webkit-details-marker {
  display: none;
}

.collections-work-tools > summary > span {
  align-items: center;
  display: flex;
  gap: 9px;
}

.collections-work-tools > summary > span .ui-icon {
  color: var(--theme-success-text, var(--accent));
}

.collections-work-tools > summary small {
  color: var(--muted);
  font-size: 10px;
}

.collections-work-tools[open] > summary {
  border-bottom: 1px solid var(--line);
}

.collections-work-tools-grid {
  background: var(--theme-subtle, #f7faf8);
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 12px;
}

.collections-work-tools-grid .personal-workspace-section {
  box-shadow: none;
  padding: 14px;
}

.collections-work-tools-grid .section-head {
  margin-bottom: 10px;
}

.collections-work-tools-grid .section-head h2 {
  font-size: 17px;
  margin: 0 0 3px;
}

.collections-work-tools-grid .section-head p {
  font-size: 10px;
}

.collections-recent-list {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
}

.collections-recent-list > a {
  align-items: center;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 55px;
  padding: 8px 10px;
  text-decoration: none;
}

.collections-recent-list > a:last-child {
  border-bottom: 0;
}

.collections-recent-list > a:hover {
  background: var(--surface-hover);
}

.collections-recent-list > a > span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.collections-recent-list > a > span:last-child {
  flex: 0 0 auto;
  text-align: right;
}

.collections-recent-list small,
.collections-recent-list time {
  color: var(--muted);
  font-size: 9px;
}

.collections-recent-list strong,
.collections-recent-list b {
  font-size: 12px;
}

@media (max-width: 1180px) {
  .personal-recent-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 820px) {
  .personal-workspace-head {
    align-items: stretch;
    flex-direction: column;
  }

  .personal-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .collections-hub-head {
    align-items: stretch;
    flex-direction: column;
  }

  .collections-hub-featured,
  .collections-work-tools-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 520px) {
  .discovery-personal-list > :is(a, button) {
    min-height: 58px;
  }

  .discovery-personal-all {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .personal-workspace-section {
    padding: 14px;
  }

  .personal-recent-grid,
  .personal-create-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .personal-create-form .button {
    justify-content: center;
    min-height: 44px;
  }

  .personal-inline-action {
    width: 100%;
  }

  .personal-inline-action > summary {
    justify-content: center;
    width: 100%;
  }

  .personal-inline-action > form {
    left: 0;
    right: auto;
    width: min(100%, 310px);
  }

  .collections-hub-head {
    gap: 13px;
  }

  .collections-hub-head .button {
    justify-content: center;
    width: 100%;
  }

  .collections-hub-summary {
    gap: 6px;
  }

  .collections-hub-summary > div {
    gap: 4px;
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 73px;
    padding: 8px;
  }

  .collections-hub-summary > div > span {
    grid-row: 1;
    height: 28px;
    width: 28px;
  }

  .collections-hub-summary small {
    font-size: 8px;
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .collections-hub-summary strong {
    font-size: 18px;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  .collection-hub-create form,
  .collection-hub-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .collection-hub-create .button {
    justify-content: center;
  }

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

  .collection-hub-metrics > span:nth-child(2) {
    border-right: 0;
  }

  .collection-hub-metrics > span:last-child {
    border-top: 1px solid var(--theme-line, #e5ece8);
    grid-column: 1 / -1;
  }

  .collection-hub-card > header em {
    display: none;
  }

  .collections-hub-section {
    padding: 13px;
  }

  .collections-hub-empty {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .collections-hub-empty .button {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .collections-work-tools > summary {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }
}

@media (max-width: 1200px) {
  .history-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .analytics-summary-grid,
  .data-quality-summary,
  .users-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .plan-control-summary .summary-card:last-child {
    grid-column: 1 / -1;
  }

}

@media (max-width: 700px) {
  .plan-control-overview {
    grid-template-columns: minmax(0, 1fr);
  }
}

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

  .analytics-summary-grid .summary-card,
  .data-quality-summary .summary-card,
  .users-summary-grid .kpi-card {
    min-height: 96px;
    padding: 14px;
  }

  .plan-control-filter label,
  .plan-control-filter .button {
    width: 100%;
  }
}

/* Layout review keeps uncertain suggestions out of unit-facing media. */
.layout-review-filter, .layout-review-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 18px 0;
}
.layout-review-filter label {
  display: grid;
  gap: 6px;
  width: 280px;
  max-width: 100%;
  min-width: 0;
}
.layout-review-filter select { width: 100%; min-width: 0; }
.layout-review-search { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 8px; max-width: 380px; margin: 12px 0; }
.layout-review-search label { display: grid; gap: 6px; min-width: 0; }
.layout-review-search label span { font-size: 12px; font-weight: 600; }
.layout-review-search input { width: 100%; min-width: 0; }
.layout-review-search .button { height: 40px; }
.layout-review-matches { display: block; max-width: 150px; margin-top: 4px; font-size: 12px; white-space: normal; overflow-wrap: anywhere; color: var(--theme-muted, #586763); }
.layout-review-filter [data-layout-target-submit][hidden] { display: none; }
.layout-review-filter label > span { font-size: 12px; font-weight: 600; }
.layout-review-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.layout-review-workbench, .layout-review-projects, .layout-review-groups {
  min-width: 0;
  margin: 24px 0;
  padding: 20px 0;
  border-top: 1px solid var(--theme-line, #dce5e1);
}
.layout-review-workbench h2, .layout-review-projects h2, .layout-review-groups h2 {
  font-size: 18px;
  overflow-wrap: anywhere;
}
.layout-review-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 32px;
  margin: 16px 0;
}
.layout-review-facts span { display: grid; gap: 5px; min-width: 0; }
.layout-review-facts small, .layout-review-choice small { color: var(--theme-muted, #586763); font-size: 12px; }
.layout-review-unit-list { display: flex; flex-wrap: wrap; gap: 8px 16px; max-height: 100px; overflow: auto; }
.layout-review-choices {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 16px;
  margin: 18px 0;
}
.layout-review-choice {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  border: 1px solid var(--theme-line, #dce5e1);
  border-radius: 8px;
  padding: 12px;
  min-width: 0;
  background: var(--theme-surface, #fff);
}
.layout-review-choice > a:first-child { display: block; aspect-ratio: 4 / 3; background: var(--theme-subtle, #f6f8f7); }
.layout-review-choice img { display: block; width: 100%; height: 100%; object-fit: contain; }
.layout-review-choice-label { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0; }
.layout-review-choice-label input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; padding: 0; }
.layout-review-choice-label strong { font-size: 14px; line-height: 1.4; overflow-wrap: anywhere; }
.layout-review-choice > .button { align-self: start; margin-top: auto; }
.layout-review-choice.has-conflict { border-color: var(--theme-danger-line, #e2b6b0); }
.layout-review-choice .layout-review-conflict { color: var(--theme-danger-text, #a63c32); }
.layout-review-type-code { display: block; font-size: 12px; color: var(--theme-muted, #586763); margin-top: 4px; }
.layout-review-state { font-size: 12px; font-weight: 600; color: var(--theme-warning-text, #885719); white-space: nowrap; }
.layout-review-state.state-confirmed { color: var(--theme-success-text, #087259); }
.layout-review-state.state-missing { color: var(--theme-danger-text, #a63c32); }
.layout-review-actions { align-items: center; }
.layout-review-actions .button { white-space: normal; text-align: center; }
.layout-review-projects table { min-width: 660px; }
.layout-review-groups table { min-width: 780px; }
.layout-review-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.layout-review-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--theme-line, #dce5e1);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--theme-text, #415d53);
  background: var(--theme-surface, #fff);
  text-decoration: none;
}
.layout-review-tabs a:hover { background: var(--theme-subtle, #f0f6f3); }
.layout-review-tabs a[aria-current="page"] { background: var(--theme-success-soft, #e4f2ec); border-color: var(--theme-success-text, #82b9a3); color: var(--theme-success-text, #07654c); }
.layout-review-tabs > a > span:not(.ui-stable-label) { font-size: 12px; font-variant-numeric: tabular-nums; }
.layout-review-groups [data-layout-group-row],
.layout-review-projects [data-layout-project-row] { cursor: pointer; }
.layout-review-groups [data-layout-group-row]:hover > td,
.layout-review-groups [data-layout-group-row]:focus-within > td,
.layout-review-projects [data-layout-project-row]:hover > td,
.layout-review-projects [data-layout-project-row]:focus-within > td { background: var(--theme-subtle, #eef6f2); }
.layout-review-groups [data-layout-group-link],
.layout-review-projects [data-layout-project-link] { font-weight: 600; }
.layout-review-groups [data-layout-group-link] { position: relative; }
.layout-review-groups .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.layout-review-workbench, .layout-review-groups { scroll-margin-top: 100px; }
.unit-layout-pending { display: block; padding: 8px 12px; background: var(--theme-subtle, #f0f4f2); font-size: 12px; }
.product-wordmark {
  display: block;
  width: 100%;
  max-width: 220px;
  height: auto;
  aspect-ratio: 1080 / 325;
  overflow: hidden;
  flex: 0 1 auto;
}
.brand.product-brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
}
.brand-organization {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.brand .brand-organization img {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}
.mobile-brand .product-wordmark { width: 140px; max-width: 100%; }
.login-brand .product-wordmark-full {
  max-width: 320px;
  aspect-ratio: 1080 / 405;
}
.brand.login-brand.product-brand { align-items: center; padding: 0; }

/* Literal fallbacks above preserve the light palette. Dark roles only apply on screen. */
@media screen {
  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #141618;
    --panel: #1d2023;
    --text: #edf0ef;
    --muted: #a7b0ad;
    --line: #363c3f;
    --line-strong: #515b5f;
    --accent-soft: #213b32;
    --surface-subtle: #25292c;
    --surface-hover: #303639;
    --warning: #f3c17c;
    --warning-soft: #3b3022;
    --danger-soft: #3d272b;
    --info: #a5c6f7;
    --info-soft: #263447;
    --focus: rgba(100, 212, 169, .55);
    --shadow: 0 16px 36px rgba(0, 0, 0, .22);
    --shadow-soft: 0 8px 22px rgba(0, 0, 0, .15);
    --theme-surface: var(--panel);
    --theme-subtle: var(--surface-subtle);
    --theme-hover: var(--surface-hover);
    --theme-text: var(--text);
    --theme-muted: var(--muted);
    --theme-line: var(--line);
    --theme-glass: rgba(29, 32, 35, .96);
    --theme-success-text: #8edcbb;
    --theme-success-soft: #213b32;
    --theme-success-line: #416153;
    --promotion-result-bg: color-mix(in srgb, var(--theme-success-soft) 34%, var(--theme-surface));
    --promotion-result-line: var(--theme-success-line);
    --theme-warning-text: var(--warning);
    --theme-warning-soft: var(--warning-soft);
    --theme-warning-line: #715837;
    --theme-danger-text: #f4a6ac;
    --theme-danger-soft: var(--danger-soft);
    --theme-danger-line: #71454c;
    --theme-info-text: var(--info);
    --theme-info-soft: var(--info-soft);
    --theme-info-line: #465e7d;
    --theme-purple-text: #d4b5ed;
  }

  /* Only the product wordmark is adapted; photos, company logos and plans stay untouched. */
  :root[data-theme="dark"] .product-wordmark {
    filter: invert(1) hue-rotate(180deg);
    mix-blend-mode: screen;
  }

  :root[data-theme="dark"] .unit-profile-visual-art {
    background: linear-gradient(145deg, #24382f, #222a29);
  }

  /* Technical drawings may have transparent pixels and black linework. */
  :root[data-theme="dark"] :is(
    .unit-media-carousel .media-carousel-open > img,
    .client-preview-carousel .media-carousel-open > img,
    .unit-quick-preview-visual.has-plan img,
    .unit-plan-thumbnail img,
    .unit-plan-dialog-canvas img,
    .plan-admin-image img,
    .layout-review-choice img
  ) { background: #fff; }

  :root[data-theme="dark"] input::placeholder,
  :root[data-theme="dark"] textarea::placeholder { color: var(--muted); opacity: 1; }

  :root[data-theme="dark"] input:autofill {
    box-shadow: 0 0 0 100px var(--panel) inset;
    -webkit-text-fill-color: var(--text);
  }
}

.theme-picker { min-width: 0; width: 100%; }
.topbar-theme { position: relative; flex: 0 0 auto; }
.topbar-theme > summary {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; list-style: none; cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--text);
}
.topbar-theme > summary::-webkit-details-marker { display: none; }
.topbar-theme > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.topbar-theme > summary .ui-icon { width: 18px; height: 18px; }
.topbar-theme [data-theme-indicator] { display: none; }
html[data-theme-mode="light"] .topbar-theme [data-theme-indicator="light"],
html[data-theme-mode="dark"] .topbar-theme [data-theme-indicator="dark"],
html[data-theme-mode="system"] .topbar-theme [data-theme-indicator="system"] { display: flex; }
.topbar-theme > .theme-picker {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 1100;
  width: 290px; max-width: calc(100vw - 28px); padding: 12px; margin: 0;
  border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: var(--shadow-soft);
}
.topbar-theme .theme-feedback:empty { display: none; }
.project-facts-list .project-floor-source { color: var(--muted); }
@media (max-width: 760px) {
  .topbar-theme > .theme-picker { position: fixed; top: 55px; right: 14px; }
}
.theme-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 3px;
  padding: 4px;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  border-radius: 8px;
}

select:not([multiple]):not([size]) {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 6 4.5 4 4.5-4' fill='none' stroke='%23677783' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.7'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
  padding-right: 34px;
}
.theme-options button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 62px;
  min-width: 0;
  padding: 8px 4px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
}
.theme-options button[aria-pressed="true"] {
  background: var(--panel);
  color: var(--theme-success-text, var(--accent-dark));
  border-color: var(--theme-success-line, #b9d4c9);
  box-shadow: var(--shadow-soft);
}
.theme-options button:hover { color: var(--text); }
.theme-options button:focus-visible { outline: 2px solid var(--theme-success-text, var(--accent)); outline-offset: 1px; }
.theme-options button:disabled { cursor: wait; }
.theme-picker .theme-feedback {
  min-height: 18px;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.theme-picker .theme-feedback.is-error { color: var(--theme-danger-text, var(--sold)); }
.account-appearance-card { min-width: 0; }
.security-controls { display: grid; gap: 20px; }
.security-limit-form, .security-history-filters { display: flex; align-items: end; flex-wrap: wrap; gap: 12px; }
.security-limit-form label { width: 150px; }
.security-limit-form small { flex-basis: 100%; color: var(--muted); }
.security-history-filters label { flex: 0 1 280px; min-width: 0; }
.security-history-filters select { width: 100%; }
.security-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.security-actions form { margin: 0; }
.session-list { display: grid; }
.session-row { display: grid; grid-template-columns: minmax(160px, 1.4fr) 1fr 1fr minmax(110px, 1fr) auto; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.session-row > div { min-width: 0; overflow-wrap: anywhere; }
.session-row small, .session-choice small { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; }
.session-row span { font-size: 13px; }
.session-device { display: flex; align-items: center; gap: 10px; }
.session-device strong { font-size: 14px; }
.session-row form { margin: 0; }
.security-caption { font-size: 12px; margin-bottom: 0; }
.session-admission { max-width: 680px; }
.session-admission fieldset { padding: 0; border: 0; margin: 0 0 18px; }
.session-admission legend { margin-bottom: 12px; font-weight: 700; }
.session-admission > form + form { margin-top: 12px; }
.session-choice { display: flex; align-items: center; gap: 12px; padding: 16px; margin: 8px 0; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.session-choice:has(input:checked) { border-color: var(--theme-success-text, var(--accent)); background: var(--accent-soft); }
.session-choice input[type="radio"] { width: 18px; height: 18px; min-width: 18px; margin: 0; }
.session-choice span { min-width: 0; overflow-wrap: anywhere; }
.login-event-table { min-width: 900px; }
.login-event-table small { display: block; color: var(--muted); font-size: 12px; }
@media (max-width: 1200px) { .session-row { grid-template-columns: minmax(160px, 1fr) 1fr auto; } }
@media (max-width: 600px) { .session-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; } .session-device { grid-column: 1 / -1; } .security-history-filters label { flex: 1 1 100%; } }
.account-appearance-card h2 { margin: 0 0 14px; }
.floor-pdf-upload { max-width: 640px; display: grid; gap: 18px; }
.floor-pdf-upload p { margin: 0; color: var(--muted); }
.floor-pdf-filename { min-width: 0; overflow-wrap: anywhere; }
.floor-pdf-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 16px; margin-bottom: 20px; }
.floor-pdf-toolbar > .form-field { width: 190px; }
.floor-pdf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; align-items: start; }
.floor-pdf-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--theme-surface, #fff); }
.floor-pdf-card-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 16px; font-size: 14px; }
.floor-pdf-image { display: block; aspect-ratio: 4 / 3; background: #fff; }
.floor-pdf-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.floor-pdf-fields { display: grid; grid-template-columns: minmax(80px, 1fr) minmax(0, 2fr); gap: 12px; padding: 16px; }
.floor-pdf-fields .form-field, .floor-pdf-upload .form-field { min-width: 0; display: grid; align-content: start; gap: 6px; }
.floor-pdf-fields input, .floor-pdf-fields select, .floor-pdf-upload input { min-width: 0; width: 100%; }
.floor-pdf-confirm { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 14px; }
.floor-pdf-confirm input[type="checkbox"] { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; }
.floor-pdf-review > .floor-pdf-confirm { margin-bottom: 16px; }
.floor-pdf-notice { padding: 12px 16px; border-left: 3px solid var(--accent); background: var(--accent-soft); margin: 0 0 16px; overflow-wrap: anywhere; }
.floor-pdf-notice p { margin: 0 0 12px; }
.floor-pdf-discard { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 24px; }
.floor-pdf-versions { margin-bottom: 24px; }
.floor-pdf-versions h2 { font-size: 18px; margin: 0 0 12px; }
.floor-pdf-version { display: grid; grid-template-columns: 100px minmax(0, 1fr) 120px 16px; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); color: inherit; }
.floor-pdf-version:hover { background: var(--accent-soft); }
@media (max-width: 600px) {
  .floor-pdf-version { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
  .floor-pdf-version .floor-pdf-filename { grid-column: 1 / -1; grid-row: 2; }
  .floor-pdf-version > :last-child { display: none; }
  .floor-pdf-toolbar .page-actions { width: 100%; flex-wrap: wrap; }
}
.login-card .theme-picker { margin-bottom: -12px; }

.login-data-link {
  color: var(--muted);
  font-size: 13px;
  justify-self: center;
  text-align: center;
  text-underline-offset: 3px;
}
.account-data-link {
  display: block;
  margin-top: 14px;
  font-size: 13px;
  text-underline-offset: 3px;
}
.data-notice-body { height: auto; }
.data-notice-shell { align-items: start; }
.login-card.data-notice {
  gap: 24px;
  max-width: 780px;
  min-width: 0;
  padding: 28px;
}
.data-notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.data-notice-header > .product-brand {
  flex: 0 1 220px;
  max-width: 100%;
  min-width: 0;
}
.data-notice .theme-picker { margin-bottom: 0; }
.data-notice h1 { font-size: clamp(24px, 4vw, 30px); margin: 0; }
.data-notice h2 { font-size: 18px; line-height: 1.4; margin: 0 0 8px; }
.data-notice p, .data-notice li { color: var(--text); line-height: 1.65; }
.data-notice p + p { margin-top: 12px; }
.data-notice .data-notice-date { color: var(--muted); font-size: 12px; margin: 8px 0 16px; }
.data-notice ul { margin: 0; padding-left: 20px; }
.data-notice li + li { margin-top: 8px; }
.data-notice-footer { border-top: 1px solid var(--line); padding-top: 20px; }
.account-delete-panel > p { overflow-wrap: anywhere; }
.account-delete-panel .delete-summary span { gap: 12px; }
.account-delete-panel .delete-actions { flex-wrap: wrap; }
@media (max-width: 520px) {
  .login-card.data-notice { padding: 20px; }
}

@media print {
  :root { color-scheme: light; }
  .theme-picker { display: none; }
}
@media (max-width: 760px) {
  .layout-review-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .layout-review-workbench .section-head { flex-wrap: wrap; gap: 12px; }
}

/* Inventory controls keep their widths; narrower toolbars wrap whole controls. */
.inventory-filters-panel {
  --inventory-filter-width: 128px;
  position: relative;
}

.inventory-filters-panel .filter-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
}

.inventory-filters-panel .filter-toolbar > * {
  flex: 0 0 auto;
  max-width: 100%;
  min-width: 0;
  width: var(--inventory-filter-width);
}

.inventory-filters-panel .filter-toolbar > .filter-search-input {
  width: 280px;
}

.inventory-filters-panel .filter-toolbar > .filter-select {
  inline-size: var(--inventory-filter-width);
}

.inventory-filters-panel .filter-toolbar > .filter-more-panel {
  width: 144px;
}

.inventory-filters-panel .filter-dropdown > summary,
.inventory-filters-panel .filter-more-panel > summary,
.inventory-filters-panel .filter-boolean-option,
.inventory-filters-panel .favorite-filter-button {
  height: var(--control-height, 40px);
  justify-content: space-between;
  max-width: none;
  min-height: var(--control-height, 40px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-filters-panel .filter-dropdown > summary,
.inventory-filters-panel .filter-more-panel > summary {
  width: 100%;
}

.inventory-filters-panel .filter-boolean-option,
.inventory-filters-panel .favorite-filter-button {
  justify-content: center;
}

.inventory-filters-panel .filter-dropdown > summary > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.inventory-filters-panel .filter-more-panel > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16px;
  gap: 8px;
}

.inventory-filters-panel .filter-dropdown > summary::after,
.inventory-filters-panel .filter-more-panel > summary::after {
  flex-shrink: 0;
}

.inventory-filters-panel .filter-more-panel > summary::after {
  text-align: center;
  width: 16px;
}

.inventory-filters-panel .filter-toolbar > .filter-actions {
  align-items: stretch;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
  width: calc(2 * var(--inventory-filter-width) + 8px);
}

.inventory-filters-panel .filter-actions > .button {
  flex: 0 0 auto;
  height: var(--control-height, 40px);
  max-width: 100%;
  min-width: 0;
  width: var(--inventory-filter-width);
}

.inventory-filters-panel .filter-more-panel {
  position: static;
}

.inventory-filters-panel .filter-more-grid {
  bottom: auto;
  display: flex;
  flex-wrap: wrap;
  left: auto;
  max-height: none;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  position: absolute;
  right: 0;
  top: 100%;
  width: min(100%, 820px);
  z-index: 75;
}

.inventory-filters-panel .filter-more-grid > * {
  flex: 0 0 auto;
  max-width: 100%;
  min-width: 0;
  width: var(--inventory-filter-width);
}

.inventory-filters-panel .filter-more-grid > select,
.inventory-filters-panel.units-filters-panel .filter-more-grid > .filter-completion-select,
.inventory-filters-panel .filter-more-grid > .filter-pet-select {
  height: var(--control-height, 40px);
}

.inventory-filters-panel .filter-more-grid > .filter-dropdown-readiness {
  width: 176px;
}

.inventory-filters-panel.units-filters-panel .filter-more-grid > .filter-completion-select {
  width: 224px;
}

.inventory-filters-panel .filter-more-grid > .filter-pet-select {
  width: 216px;
}

.filter-pet-select {
  align-items: center;
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  gap: 4px;
  padding-left: 10px;
}

.filter-pet-select > span {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.filter-pet-select > select {
  border: 0;
  flex: 1 1 0;
  font-size: 13px;
  min-height: 0;
  min-width: 0;
  padding-left: 4px;
}

.filter-pet-select:focus-within {
  border-color: var(--theme-success-line, #9fc8b8);
}

/* Account controls, bounded navigation slots and translated result paging. */
.account-organization-card,
.account-security-card {
  align-content: start;
  display: grid;
  gap: 12px;
}
.account-organization-card > h2,
.account-security-card > h2 {
  font-size: 17px;
  line-height: 1.35;
  margin: 0;
}
.account-organization-card > p,
.account-security-card > p {
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}
.account-security-card > .account-data-link {
  line-height: 1.45;
  margin: 0;
}
.account-organization-card p,
.workspace-settings-heading p {
  overflow-wrap: anywhere;
}
.account-organization-card .button {
  display: flex;
  width: 100%;
  min-width: 0;
  text-align: center;
  white-space: normal;
}
.workspace-account-return {
  display: inline-block;
  font-size: 12px;
  margin-bottom: 8px;
}
.unit-results-pagination {
  display: grid;
  grid-template-columns: minmax(76px, 1fr) minmax(112px, 1.4fr) minmax(76px, 1fr);
  align-items: center;
  gap: 8px;
  max-width: 420px;
  min-width: 0;
  margin: 12px auto;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
#unit-results {
  scroll-margin-top: 120px;
}
.unit-results-pagination > * {
  align-items: center;
  display: flex;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 38px;
  padding: 0;
  text-align: center;
  white-space: nowrap;
}
.unit-results-pagination > a,
.unit-results-pagination > .is-disabled {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px;
  font-weight: 700;
  text-decoration: none;
}
.unit-results-pagination > a:hover {
  background: var(--theme-subtle, #edf5ef);
}
.unit-results-pagination > span:not(.is-disabled) {
  background: none;
  border: 0;
  padding: 0;
}
.unit-results-pagination > .is-disabled {
  color: var(--theme-muted, #8c9994);
}
.unit-results-pagination .ui-stable-label__current {
  text-align: center;
}
@media (max-width: 900px) {
  .sidebar {
    height: calc(68px + env(safe-area-inset-bottom));
    min-height: calc(68px + env(safe-area-inset-bottom));
  }
  .app-main {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }
  .sidebar .side-nav-link {
    flex: 0 0 78px;
    width: 78px;
    min-width: 78px;
  }
  .sidebar .side-nav-link > span:last-child {
    width: 100%;
    min-height: 22px;
    text-align: center;
    white-space: normal;
  }
  .sidebar .side-nav-link .ui-stable-label {
    display: block;
    width: 100%;
  }
  .sidebar .side-nav-link .ui-stable-label__current {
    display: block;
    overflow: visible;
    white-space: normal;
  }
  .sidebar .side-nav-link .ui-stable-label__measure {
    display: none;
  }
}
@media (max-width: 380px) {
  .unit-results-pagination {
    gap: 4px;
    grid-template-columns: minmax(72px, 1fr) minmax(106px, 1.4fr) minmax(72px, 1fr);
  }
}
/* Reserve the same intrinsic action-label width in both UI languages. */
.ui-stable-label {
  display: inline-grid;
  align-items: center;
  min-width: 0;
  vertical-align: middle;
}
.ui-stable-label > .ui-stable-label__current,
.ui-stable-label > .ui-stable-label__measure,
.ui-stable-label__measure > span {
  grid-area: 1 / 1;
}
.ui-stable-label__measure {
  display: grid;
  pointer-events: none;
  user-select: none;
  visibility: hidden;
}
.ui-stable-label > .ui-stable-label__current {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action-label internals must not inherit decorative descendant-span boxes. */
.ui-stable-label.ui-stable-label,
.ui-stable-label > .ui-stable-label__current,
.ui-stable-label > .ui-stable-label__measure,
.ui-stable-label > .ui-stable-label__measure > span {
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  color: inherit;
  font: inherit;
  height: auto;
  letter-spacing: inherit;
  margin: 0;
  max-width: none;
  min-height: 0;
  padding: 0;
  text-transform: inherit;
}

/* Unit-card dialogs share a fixed header and a scrolling content area. */
.unit-detail-dialog {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  color: var(--text);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: 0;
  width: min(620px, calc(100% - 32px));
}
.unit-detail-dialog[open] {
  display: flex;
  flex-direction: column;
}
.unit-detail-dialog::backdrop {
  background: rgba(9, 20, 17, .55);
}
.unit-detail-dialog-head {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-shrink: 0;
  gap: 16px;
  justify-content: space-between;
  padding: 18px 20px;
}
.unit-detail-dialog-head h2 {
  font-size: 18px;
  line-height: 1.35;
  margin: 0 0 4px;
}
.unit-detail-dialog-head span,
.unit-status-source-note,
.unit-status-context {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.unit-detail-dialog-head > button {
  align-items: center;
  background: var(--theme-subtle, #f7f7f4);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  display: flex;
  flex: 0 0 36px;
  height: 36px;
  justify-content: center;
  padding: 0;
}
.unit-detail-dialog-content {
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr);
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
}
.unit-status-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.unit-status-section + .unit-status-section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
}
.unit-status-section h3 {
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
}
.unit-status-current {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.unit-status-source-note,
.unit-status-context p {
  margin: 0;
}
.unit-status-context {
  border-left: 2px solid var(--line);
  display: grid;
  gap: 5px;
  padding-left: 10px;
}
.unit-status-dates {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 2px 0;
}
.unit-status-dates dt {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.unit-status-dates dd {
  font-size: 13px;
  font-weight: 700;
  margin: 4px 0 0;
}
.unit-status-dialog .unit-manual-status-form {
  background: none;
  border: 0;
  gap: 14px;
  padding: 0;
}
.unit-status-dialog .unit-manual-status-fields.compact {
  grid-template-columns: minmax(0, 1fr);
}
.unit-status-dialog .form-field {
  min-width: 0;
}
.unit-status-dialog select {
  max-width: 260px;
}
.unit-status-dialog textarea,
.unit-notes-dialog textarea {
  background: var(--theme-surface, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  font-size: 13px;
  line-height: 1.45;
  min-height: 68px;
  padding: 10px;
}
.unit-status-dialog .unit-manual-history-item {
  overflow-wrap: anywhere;
}
.unit-status-history-more > summary {
  color: var(--theme-success-text, var(--accent-dark));
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}
.unit-status-history-more > .unit-manual-history-list {
  margin-top: 12px;
}
.unit-price-history-dialog .unit-timeline-more-list {
  max-height: none;
  overflow: visible;
}
.unit-action-count {
  align-items: center;
  background: var(--theme-success-soft, #eaf5f0);
  border-radius: 999px;
  color: var(--theme-success-text, var(--accent-dark));
  display: inline-flex;
  font-size: 11px;
  height: 20px;
  justify-content: center;
  min-width: 20px;
  padding: 0 6px;
}
.unit-history-dialog {
  width: min(1080px, calc(100% - 32px));
}
.unit-history-dialog .unit-overview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}
.unit-history-dialog .unit-overview > :only-child {
  grid-column: 1 / -1;
}
.unit-history-dialog .unit-info-card,
.unit-history-dialog .unit-history-section {
  margin: 0;
  min-width: 0;
}
.unit-history-dialog .unit-source-card dl {
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.unit-history-dialog .unit-source-card dl > div {
  border: 0;
  display: grid;
  gap: 6px;
  justify-content: normal;
  padding: 0;
}
.unit-history-dialog .unit-source-card dd {
  overflow-wrap: anywhere;
  text-align: left;
}
.unit-notes-dialog .internal-notes-layout {
  border: 0;
  min-width: 0;
  padding: 0;
}
.unit-notes-dialog .internal-note-form {
  grid-template-columns: minmax(0, 1fr);
}
.unit-notes-dialog .internal-note-form > .button {
  justify-self: start;
}
.unit-notes-dialog .form-field,
.unit-notes-dialog .internal-note {
  min-width: 0;
}
.unit-notes-dialog .internal-note p {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.unit-notes-dialog .internal-note-delete-form .link-danger {
  background: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  padding: 0;
}
@media (max-width: 720px) {
  .unit-history-dialog .unit-overview,
  .unit-history-dialog .unit-source-card dl {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 520px) {
  .unit-profile-actions-manage {
    grid-template-columns: minmax(0, 1fr);
  }
  .unit-detail-dialog-head {
    padding: 16px;
  }
  .unit-detail-dialog-content {
    padding: 16px;
  }
  .unit-status-dates {
    grid-template-columns: minmax(0, 1fr);
  }
  .unit-status-dialog .unit-manual-status-actions > .button {
    width: 100%;
  }
}

/* File and checkbox content must not enlarge the narrow media form's tracks. */
.media-workspace > *,
.media-form > *,
.media-checkbox > span {
  min-width: 0;
}
.media-form {
  grid-template-columns: minmax(0, 1fr);
}
.media-checkbox > input {
  flex: 0 0 16px;
}
.media-checkbox > span {
  overflow-wrap: anywhere;
}
@media (max-width: 1180px) {
  .media-workspace,
  .media-cover-stack {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Compact resume lists and project working dialogs reuse the unit-card modal shell. */
.home-resume-list {
  display: grid;
  min-width: 0;
}
.home-resume-list > a {
  border-bottom: 1px solid var(--line);
  color: var(--text);
  display: grid;
  gap: 5px;
  padding: 12px 0;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.home-resume-list > a:last-child {
  border-bottom: 0;
}
.home-resume-list > a:hover {
  color: var(--theme-success-text, var(--accent-dark));
}
.home-resume-list small {
  color: var(--muted);
}
.project-prices-dialog {
  width: min(1080px, calc(100% - 32px));
}
.project-prices-dialog .project-overview-layout {
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
}
.project-prices-dialog .project-current-panel,
.project-prices-dialog .uploads-panel {
  margin: 0;
  min-width: 0;
}
.project-prices-dialog .current-price-main span,
.project-prices-dialog .upload-item > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* Directory cards share corresponding rows, even with long names or optional badges. */
.project-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
}
.project-grid > .project-card {
  min-width: 0;
}
.project-card-body {
  align-content: start;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
}
.project-card-title-row {
  align-items: baseline;
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(0, 1fr) auto;
}
.project-card-name-location {
  min-width: 0;
  overflow-wrap: anywhere;
}
.project-card-title-row > .project-lifecycle {
  font-size: 10px;
  max-width: 8em;
  text-align: center;
  white-space: normal;
}
.project-card-badges {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}
.project-card-title-row .project-location {
  font-size: 12px;
  margin-inline-start: 4px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.project-card-title-row .project-location.is-empty {
  color: var(--muted);
}
.project-card-construction {
  align-items: center;
  display: flex;
  gap: 8px;
  min-height: 24px;
  min-width: 0;
}
.project-catalog-progress {
  background: var(--theme-subtle, #eef4f1);
  border: 1px solid var(--line);
  border-radius: 5px;
  display: block;
  flex: 1;
  height: 24px;
  min-width: 64px;
  overflow: hidden;
  position: relative;
}
.project-catalog-progress progress {
  appearance: none;
  background: transparent;
  border: 0;
  display: block;
  height: 100%;
  width: 100%;
}
.project-catalog-progress progress::-webkit-progress-bar {
  background: transparent;
}
.project-catalog-progress progress::-webkit-progress-value {
  background: var(--theme-success-line, #b7d8cb);
}
.project-catalog-progress progress::-moz-progress-bar {
  background: var(--theme-success-line, #b7d8cb);
}
.project-catalog-progress-label {
  color: var(--theme-success-text, var(--accent-dark));
  display: grid;
  font-size: 11px;
  font-weight: 800;
  inset: 0;
  line-height: 1;
  place-items: center;
  pointer-events: none;
  position: absolute;
}
.project-catalog-progress.is-unknown .project-catalog-progress-label {
  color: var(--muted);
}
.project-card-completion {
  color: var(--muted);
  flex: 0 1 auto;
  font-size: 12px;
  line-height: 1.3;
  max-width: 10em;
  overflow-wrap: anywhere;
}
.project-card-ready {
  color: var(--theme-success-text, var(--accent-dark));
  font-size: 13px;
  font-weight: 700;
}
.project-card-metrics {
  align-items: start;
}
.project-card-metrics dd {
  font-size: 16px;
}
.project-card-metrics > div:first-child dd {
  color: var(--theme-success-text, var(--accent-dark));
}
.project-directory-list .project-card-body {
  align-content: start;
}
@supports (grid-template-rows: subgrid) {
  .project-grid:not(.project-directory-list) > .project-card {
    display: grid;
    grid-row: span 5;
    grid-template-rows: subgrid;
    row-gap: 0;
  }
  .project-grid:not(.project-directory-list) .project-card-body {
    grid-row: span 4;
    grid-template-rows: subgrid;
    row-gap: 8px;
  }
}
@media (max-width: 520px) {
  .project-directory-list .project-card {
    grid-template-columns: minmax(0, 1fr);
  }
  .project-directory-list .project-cover {
    height: 96px;
    min-height: 96px;
  }
  .project-card-completion {
    max-width: 8em;
  }
}

/* Leaflet clones the same content as the grid/list cards. */
.project-map-popup-body .project-name {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
}
.project-map-popup-body .project-location {
  font-size: 11px;
}
.project-map-popup-body .project-card-metrics dd {
  font-size: 14px;
}
.project-map-popup-card:not(.has-image) .project-map-popup-body {
  padding-top: 38px;
}
.project-map-popup-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 168px);
}
.project-map-popup-visual {
  flex-shrink: 0;
}
.project-map-popup-body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
