
[data-theme='light'] {
  --bg0: #fafaf8;
  --bg1: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #f3f2ef;
  --surface-3: #ebe9e4;
  --surface-hover: #f7f5f0;
  --stroke: rgba(33, 28, 22, 0.08);
  --stroke-strong: rgba(33, 28, 22, 0.16);
  --text: #1f1a16;
  --text-soft: #4a3f37;
  --text-muted: rgba(31, 26, 22, 0.55);
  --accent: #6b5344;
  --accent-2: #8a6f5b;
  --accent-soft: rgba(107, 83, 68, 0.1);
  --accent-onfill: #ffffff;
  --primary: #2f6d5b;
  --primary-soft: rgba(47, 109, 91, 0.12);
  --warning: #9a6a18;
  --warning-soft: rgba(154, 106, 24, 0.12);
  --info: #2d5d8b;
  --info-soft: rgba(45, 93, 139, 0.12);
  --danger: #9b2c2c;
  --danger-soft: rgba(155, 44, 44, 0.1);
  --shadow-card: 0 10px 32px rgba(33, 28, 22, 0.06), 0 1px 0 rgba(255, 255, 255, 0.9) inset;
  --shadow-soft: 0 4px 14px rgba(33, 28, 22, 0.05);
  --shadow-sidebar: 0 0 0 1px var(--stroke);
  --backdrop: rgba(31, 26, 22, 0.42);
}

[data-theme='dark'] {
  --bg0: #0e0e10;
  --bg1: #131316;
  --surface: #1a1a1d;
  --surface-2: #202023;
  --surface-3: #26262a;
  --surface-hover: #232328;
  --stroke: rgba(255, 255, 255, 0.08);
  --stroke-strong: rgba(255, 255, 255, 0.16);
  --text: #f0ece4;
  --text-soft: #d8d1c4;
  --text-muted: rgba(240, 236, 228, 0.56);
  --accent: #c4a882;
  --accent-2: #d4bc99;
  --accent-soft: rgba(196, 168, 130, 0.14);
  --accent-onfill: #1a1208;
  --primary: #7fb89a;
  --primary-soft: rgba(127, 184, 154, 0.16);
  --warning: #d4a36a;
  --warning-soft: rgba(212, 163, 106, 0.14);
  --info: #8ab4d8;
  --info-soft: rgba(138, 180, 216, 0.14);
  --danger: #e08585;
  --danger-soft: rgba(224, 133, 133, 0.14);
  --shadow-card: 0 18px 48px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-soft: 0 8px 22px rgba(0, 0, 0, 0.35);
  --shadow-sidebar: 0 0 0 1px var(--stroke);
  --backdrop: rgba(6, 5, 4, 0.66);
}

* {
  box-sizing: border-box;
}

:root {
  font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'tnum' 1, 'ss01' 1;
  color: var(--text);
  background: var(--bg0);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg0);
  color: var(--text);
}

code {
  font-family: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  font-size: 0.85em;
  padding: 0.1rem 0.36rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
}

a {
  color: var(--accent);
}

a:hover {
  color: var(--accent-2);
}

.muted {
  color: var(--text-muted);
}

.muted.small,
.small {
  font-size: 0.84rem;
}

.hidden {
  display: none !important;
}

:root {
  --container-max: 1280px;
  --gutter: clamp(16px, 4vw, 48px);
}

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg0);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 11px;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: var(--accent-onfill);
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 0.92rem;
}

.brand-mark.large {
  width: 3rem;
  height: 3rem;
  font-size: 1.1rem;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-weight: 650;
  letter-spacing: -0.01em;
}

.brand-text small {
  color: var(--text-muted);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Hide the brand tagline in the compact header bar */
.topbar-brand .brand-text small {
  display: none;
}

@media (max-width: 480px) {
  .topbar-brand .brand-text {
    display: none;
  }
}

/* ===== Header navigation (horizontal) ===== */
.header-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.header-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  border-radius: 6px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.header-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.header-nav a.active {
  background: var(--surface-2);
  color: var(--text);
}

.header-nav a.active::after {
  content: '';
  position: absolute;
  left: 0.6rem;
  right: 0.6rem;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* Group titles & extras hidden in the horizontal bar; shown in mobile drawer */
.header-nav > .nav-group-title,
.header-nav > .nav-extras {
  display: none;
}

.nav-group-title {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  font-weight: 600;
  padding: 0.85rem 0.75rem 0.35rem;
  margin: 0;
}

.nav-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  transition: color 0.15s ease;
}

.nav-ic .fa-solid,
.nav-ic .fa-regular {
  width: 1em;
  text-align: center;
}

.header-nav a:hover .nav-ic {
  color: var(--text-soft);
}

.header-nav a.active .nav-ic {
  color: var(--accent);
}

/* "More" dropdown */
.nav-more {
  position: relative;
  margin-left: 0.1rem;
}

.nav-more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.nav-more-toggle:hover,
.nav-more.open .nav-more-toggle {
  background: var(--surface-2);
  color: var(--text);
}

.nav-more-arrow {
  font-size: 0.6rem;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.nav-more.open .nav-more-arrow {
  transform: rotate(180deg);
}

.nav-more-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 50;
}

.nav-more-menu[hidden] {
  display: none;
}

.nav-more-menu a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 6px;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

.nav-more-menu a:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-more-menu a.active {
  background: var(--surface-2);
  color: var(--text);
}

.nav-more-menu a.active .nav-ic {
  color: var(--accent);
}

.nav-more-menu .nav-group-title {
  padding: 0.65rem 0.6rem 0.3rem;
}

/* Theme toggle / lang picker (live in nav-extras drawer on mobile) */
.sidebar-theme {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 0;
  background: transparent;
  border-radius: 5px;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.sidebar-theme:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sidebar-theme .nav-ic {
  color: var(--accent);
}

.workarea {
  min-width: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ===== Top bar (sticky header) ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg0);
  border-bottom: 1px solid var(--stroke);
  /* No backdrop-filter here — it creates a containing block that breaks
     position:fixed inside the header (drawer, dropdowns, etc.). */
}

/* When the drawer is open, the topbar must stack above the backdrop so that
   the drawer (inside the topbar's stacking context) isn't covered by it. */
body.sidebar-locked .topbar {
  z-index: 1200;
}

.topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0.7rem var(--gutter);
}

.topbar-context {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: clamp(1rem, 2vw, 1.6rem) 0 0.6rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.topbar-context h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 0 1 auto;
  min-width: 0;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.4rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  box-shadow: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-align: left;
  flex: 0 0 auto;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.user-chip:hover {
  border-color: var(--stroke-strong);
  background: var(--surface-2);
}

.user-chip-arrow {
  font-size: 0.62rem;
  color: var(--text-muted);
  margin-left: 0.1rem;
  transition: transform 0.15s ease, color 0.15s ease;
}

.user-menu.open .user-chip-arrow {
  color: var(--accent);
  transform: rotate(180deg);
}

.user-chip[hidden] {
  display: none !important;
}

/* ===== Profile dropdown menu ===== */
.user-menu {
  position: relative;
  flex: 0 0 auto;
}

.user-chip .user-avatar {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 50%;
}

.user-menu.open .user-chip {
  border-color: var(--stroke-strong);
  background: var(--surface-2);
}

.user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 240px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 50;
}

.user-dropdown[hidden] {
  display: none;
}

.user-dropdown-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.6rem 0.7rem;
  margin-bottom: 0.2rem;
  border-bottom: 1px solid var(--stroke);
}

.user-dropdown-head .user-avatar {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.user-dropdown-head .user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.user-dropdown-head .user-meta strong {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-head .user-meta small {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown a,
.user-dropdown-logout {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.7rem;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  text-decoration: none;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease, color 0.15s ease;
}

.user-dropdown a .nav-ic,
.user-dropdown-logout .nav-ic {
  font-size: 0.95rem;
  width: 1.2rem;
}

.user-dropdown a:hover,
.user-dropdown-logout:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* Language picker (pill row above the theme picker) */
.user-dropdown-langs {
  display: flex;
  gap: 0.3rem;
  padding: 0.55rem 0.4rem 0.3rem;
  margin: 0.3rem 0 0;
  border-top: 1px solid var(--stroke);
}

.user-dropdown-langs button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 2.2rem;
  padding: 0 0.6rem;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.user-dropdown-langs button .ul-flag {
  font-size: 0.95rem;
  line-height: 1;
}

.user-dropdown-langs button:hover {
  color: var(--text);
  border-color: var(--stroke-strong);
  background: var(--surface-3);
}

.user-dropdown-langs button:active {
  transform: translateY(1px);
}

.user-dropdown-langs button.active {
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
  color: var(--accent-onfill);
  box-shadow: 0 6px 14px -8px color-mix(in srgb, var(--accent), transparent 40%);
}

.user-dropdown-themes {
  display: flex;
  gap: 0.3rem;
  padding: 0.3rem 0.4rem 0.55rem;
  margin: 0 0 0.3rem;
  border-bottom: 1px solid var(--stroke);
}

.user-dropdown-themes button {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.1rem;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  color: var(--text-soft);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.user-dropdown-themes button:hover {
  color: var(--text);
  border-color: var(--stroke-strong);
}

.user-dropdown-themes button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-onfill);
}

.user-dropdown-logout {
  color: var(--danger);
}

.user-dropdown-logout .nav-ic {
  color: var(--danger);
}

.user-dropdown-logout:hover {
  background: var(--danger-soft);
  color: var(--danger);
}

.user-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 4px;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: var(--accent-onfill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: -0.02em;
}

.user-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-size: 0.78rem;
  min-width: 0;
}

.user-meta strong {
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.user-meta small {
  color: var(--text-muted);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.user-chip {
  flex: 0 1 auto;
  min-width: 0;
}

.view-root {
  padding: 0 0 clamp(24px, 3vw, 48px);
  flex: 1;
  display: block;
}

.btn {
  font: inherit;
  border-radius: 6px;
  border: 1px solid var(--stroke-strong);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: var(--stroke-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn.small {
  padding: 0.3rem 0.65rem;
  font-size: 0.76rem;
  border-radius: 5px;
  gap: 0.32rem;
}

.btn.tiny {
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  border-radius: 4px;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-onfill);
}

.btn.primary:hover {
  background: var(--accent-2);
  border-color: var(--accent-2);
}

.btn.success {
  background: var(--primary);
  border-color: var(--primary);
  color: #fdfbf6;
}

[data-theme='dark'] .btn.success {
  color: #0e1714;
}

.btn.ghost {
  background: transparent;
}

.btn.ghost:hover {
  background: var(--surface-2);
}

.btn.icon-only {
  width: auto;
  height: auto;
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  border-radius: 6px;
}

.btn.icon-only.small {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
  border-radius: 5px;
}

.btn.danger-inline {
  color: var(--danger);
  border-color: color-mix(in srgb, var(--danger), transparent 65%);
}

.btn.danger-inline:hover {
  background: var(--danger-soft);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
  min-width: 0;
}

.field label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
}

input[type='text'],
input[type='tel'],
input[type='email'],
input[type='search'],
input[type='number'],
input[type='url'],
input[type='password'],
input[type='datetime-local'],
input[type='date'],
input[type='time'],
.field input:not([type]),
select,
textarea {
  padding: 0.6rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent), transparent 30%);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

textarea {
  resize: vertical;
  min-height: 4.5rem;
}

[data-theme='dark'] input[type='datetime-local'],
[data-theme='dark'] input[type='date'],
[data-theme='dark'] input[type='time'] {
  color-scheme: dark;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  padding: 1rem 1.15rem 1.05rem;
  box-shadow: none;
  margin-bottom: 1rem;
}

/* ===== Home page (catalog-style design) ===== */
.home-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  border-radius: 18px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent), transparent 86%) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--stroke);
  margin-bottom: 1.1rem;
}

.home-hero-text { min-width: 0; }

.home-hero .eyebrow {
  margin: 0 0 0.5rem;
}

.home-greeting {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.home-today {
  margin: 0.55rem 0 0;
  font-size: 0.95rem !important;
  color: var(--text-muted);
}

.home-actions {
  display: flex;
  gap: 0.6rem;
  flex-shrink: 0;
}

.home-actions .btn {
  padding: 0.7rem 1.3rem;
  border-radius: 12px;
  font-size: 0.92rem;
}

.home-stats {
  margin-bottom: 1.6rem;
}

.home-section {
  margin-bottom: 1.8rem;
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.home-section-head h2 {
  margin: 0;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.home-section-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.home-section-link:hover {
  color: var(--accent);
}

.home-section-link .fa-solid {
  font-size: 0.78rem;
  transition: transform 0.15s ease;
}

.home-section-link:hover .fa-solid {
  transform: translateX(3px);
}

.section-card h2,
.section-card h3 {
  margin: 0 0 0.5rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.section-card h2 {
  font-size: 1.08rem;
}

.section-card h3 {
  font-size: 0.94rem;
}

.section-card .muted {
  font-size: 0.8rem;
  line-height: 1.5;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.6rem;
}

.kpi {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  padding: 0.75rem 0.85rem 0.8rem;
  overflow: hidden;
  transition: border-color 0.18s ease;
}

.kpi::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.kpi:hover {
  border-color: var(--stroke-strong);
}

.kpi:hover::before {
  opacity: 0.6;
}

.kpi-label {
  font-size: 0.58rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
  color: var(--text);
}

.kpi-sub {
  font-size: 0.66rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

/* ===== Compact catalog toolbar ===== */
.toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-bottom: 1.1rem;
}

.catalog-bar {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.catalog-search {
  position: relative;
  flex: 1 1 260px;
  min-width: 200px;
  display: flex;
  align-items: center;
}

.catalog-search > .fa-solid {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.catalog-search input[type='search'] {
  flex: 1;
  width: 100%;
  min-width: 0;
  font-size: 0.9rem;
  padding: 0.7rem 1rem 0.7rem 2.6rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  color: var(--text);
}

.catalog-search input[type='search']:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent), transparent 35%);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 90%);
}

.catalog-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex: 0 0 auto;
}

.catalog-bar-second {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

/* Pill buttons in the bar (sort, map, filters) */
.bar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.bar-btn:hover {
  background: var(--surface-2);
  border-color: var(--stroke-strong);
}

.bar-btn .fa-solid {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.bar-btn:hover .fa-solid {
  color: var(--text);
}

.filters-btn {
  position: relative;
}

/* Sort dropdown */
.sort-menu {
  position: relative;
}

.sort-menu.open .bar-btn {
  background: var(--surface-2);
  border-color: var(--stroke-strong);
}

.sort-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  box-shadow: var(--shadow-soft);
  padding: 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 1px;
  z-index: 30;
}

.sort-dropdown[hidden] {
  display: none;
}

.sort-dropdown button {
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--text-soft);
  cursor: pointer;
  white-space: nowrap;
}

.sort-dropdown button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.sort-dropdown button.active {
  background: color-mix(in srgb, var(--accent), transparent 88%);
  color: var(--accent);
  font-weight: 600;
}

.filters-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-onfill);
  font-size: 0.66rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-left: 0.1rem;
}

.filters-count[hidden] {
  display: none;
}

/* ===== Fixation intro (5-step onboarding) ===== */
.modal-card:has(.fix-intro) {
  max-width: 600px;
  padding: 0;
  overflow: hidden;
}

.modal-card:has(.fix-intro) .modal-x {
  z-index: 2;
  top: 16px;
  right: 16px;
}

.fix-intro {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.fix-intro-head {
  padding: 1.4rem 1.5rem 1.1rem;
  border-bottom: 1px solid var(--stroke);
}

.fix-intro-head h2 {
  margin: 0 0 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.fix-intro-head p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.fix-steps {
  padding: 1.3rem 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.fix-step {
  position: relative;
  display: flex;
  gap: 1rem;
  padding-bottom: 1.5rem;
}

.fix-step:last-child {
  padding-bottom: 0;
}

/* Connector line between step numbers */
.fix-step::before {
  content: '';
  position: absolute;
  left: 1rem;
  top: 2rem;
  bottom: 0;
  width: 2px;
  background: var(--stroke);
  transform: translateX(-50%);
}

.fix-step:last-child::before {
  display: none;
}

.fix-step-num {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--stroke-strong);
  background: var(--surface);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.fix-step-body {
  min-width: 0;
  padding-top: 0.1rem;
}

.fix-step-body h4 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.fix-step-body p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.fix-step-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.75rem;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fix-step-link:hover {
  background: var(--surface-3);
  border-color: var(--stroke-strong);
}

.fix-intro-foot {
  padding: 1rem 1.5rem 1.3rem;
  border-top: 1px solid var(--stroke);
  background: var(--surface);
}

.fix-intro-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.95rem 1rem;
  border: 1px solid var(--stroke-strong);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.fix-intro-cta:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}

/* ===== Share-PDF dialog ===== */
.modal-card:has(.pdf-dialog) {
  max-width: 560px;
  padding: 0;
  overflow: hidden;
}

.modal-card:has(.pdf-dialog) .modal-x {
  z-index: 2;
  top: 16px;
  right: 16px;
}

.pdf-dialog {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.pdf-dialog-head {
  padding: 1.2rem 1.4rem 0.9rem;
  border-bottom: 1px solid var(--stroke);
}

.pdf-dialog-head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.pdf-dialog-body {
  padding: 1.2rem 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.pdf-dialog-note {
  margin: 0 0 0.3rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-soft);
}

.pdf-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.95rem 1.1rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.pdf-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.pdf-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--stroke-strong);
  transition: background 0.18s ease;
}

.pdf-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.pdf-toggle input:checked ~ .pdf-switch {
  background: #22a45d;
}

.pdf-toggle input:checked ~ .pdf-switch::after {
  transform: translateX(20px);
}

.pdf-toggle input:focus-visible ~ .pdf-switch {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 70%);
}

.pdf-dialog-foot {
  display: flex;
  justify-content: center;
  padding: 1rem 1.4rem 1.3rem;
  border-top: 1px solid var(--stroke);
}

.pdf-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 2rem;
  border-radius: 14px;
  border: 1px solid var(--stroke-strong);
  background: var(--surface-2);
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pdf-download-btn:hover {
  background: var(--surface-3);
  border-color: var(--accent);
}

/* ===== Contacts dialog ===== */
.modal-card:has(.contacts-dialog) {
  max-width: 620px;
  padding: 0;
  overflow: hidden;
}

.modal-card:has(.contacts-dialog) .modal-x {
  z-index: 2;
  top: 16px;
  right: 16px;
}

.contacts-dialog {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.contacts-head {
  padding: 1.2rem 1.4rem 0.9rem;
  border-bottom: 1px solid var(--stroke);
}

.contacts-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.contacts-list {
  padding: 0.4rem 1.4rem 1.2rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--stroke);
}

.contact-row:last-child {
  border-bottom: 0;
}

.contact-name {
  flex: 1;
  min-width: 0;
  font-size: 0.98rem;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-phone {
  flex-shrink: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  font-variant-numeric: tabular-nums;
}

.contact-phone:hover {
  color: var(--accent);
}

.contact-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.contact-msg {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: filter 0.15s ease;
}

.contact-msg:hover {
  filter: brightness(1.08);
}

.contact-msg.wa {
  background: #25a93f;
}

.contact-msg.tg {
  background: #2f9fe0;
}

@media (max-width: 560px) {
  .contact-row {
    flex-wrap: wrap;
    gap: 0.5rem 0.8rem;
  }
  .contact-actions {
    width: 100%;
  }
  .contact-msg {
    flex: 1;
    justify-content: center;
  }
}

/* ===== Add-to-collection dialog ===== */
.modal-card:has(.coll-dialog) {
  max-width: 600px;
  padding: 0;
  overflow: hidden;
}

.modal-card:has(.coll-dialog) .modal-x {
  z-index: 2;
  top: 16px;
  right: 16px;
}

.coll-dialog {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 40px);
}

.coll-dialog-head {
  padding: 1.2rem 1.4rem 0.9rem;
  border-bottom: 1px solid var(--stroke);
}

.coll-dialog-head h2 {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
}

.coll-dialog-body {
  padding: 1.2rem 1.4rem 1.4rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Listing preview */
.coll-preview {
  display: flex;
  gap: 1rem;
  padding: 0.85rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
}

.coll-preview-cover {
  width: 38%;
  max-width: 200px;
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  background: var(--surface-3) center/cover no-repeat;
  flex-shrink: 0;
}

.coll-preview-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.coll-preview-district {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.coll-preview-info h4 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.coll-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 1rem;
  font-size: 0.84rem;
  color: var(--text-soft);
}

.coll-preview-meta .fa-solid,
.coll-preview-meta .fa-regular {
  color: var(--text-muted);
  margin-right: 0.15rem;
}

.coll-preview-chips {
  margin-top: 0.15rem;
}

.coll-preview-chips .chip {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
}

.coll-preview-price {
  margin-top: 0.2rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* Name + create row */
.coll-field-label {
  font-size: 1rem;
  font-weight: 700;
}

.coll-create-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.2rem 0.2rem 0.9rem;
  border-bottom: 1px solid var(--stroke);
}

.coll-create-row input,
.coll-create-row input:focus {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  padding: 0.4rem 0;
  outline: none;
  box-shadow: none;
}

.coll-create-row input::placeholder {
  color: var(--text-muted);
}

.coll-create-btn {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.3rem 0.3rem;
}

.coll-create-btn:hover {
  filter: brightness(1.1);
}

/* Search */
.coll-search {
  position: relative;
  display: flex;
  align-items: center;
}

.coll-search > .fa-solid {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
}

.coll-search input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.6rem;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  outline: none;
}

.coll-search input:focus {
  border-color: color-mix(in srgb, var(--accent), transparent 35%);
  background: var(--surface);
}

/* Collections list */
.coll-list {
  display: flex;
  flex-direction: column;
  min-height: 120px;
}

/* Collection toggle row */
.coll-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.85rem 0.2rem;
  border-bottom: 1px solid var(--stroke);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.coll-item:last-child {
  border-bottom: 0;
}

.coll-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.coll-item-name {
  font-size: 0.98rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coll-item-sub {
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* Hidden checkbox + custom switch */
.coll-item-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.coll-switch {
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: var(--stroke-strong);
  transition: background 0.18s ease;
}

.coll-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.coll-item-toggle:checked ~ .coll-switch {
  background: #22a45d;
}

.coll-item-toggle:checked ~ .coll-switch::after {
  transform: translateX(20px);
}

.coll-item-toggle:focus-visible ~ .coll-switch {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 70%);
}

.coll-item-toggle:disabled ~ .coll-switch {
  opacity: 0.6;
}

/* Footer with create button */
.coll-dialog-foot {
  display: flex;
  justify-content: flex-end;
  padding: 0.9rem 1.4rem;
  border-top: 1px solid var(--stroke);
  background: var(--surface);
}

.coll-foot-btn {
  padding: 0.7rem 1.3rem;
  border-radius: 12px;
  gap: 0.5rem;
}

/* Empty state */
.coll-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1;
  padding: 2rem 1rem;
  text-align: center;
  color: var(--text-muted);
}

.coll-empty .fa-regular,
.coll-empty .fa-solid {
  font-size: 2.4rem;
  opacity: 0.4;
  margin-bottom: 0.4rem;
}

.coll-empty strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.coll-empty span {
  font-size: 0.88rem;
}

.modal-card:has(.filter-dialog) {
  max-width: 540px;
  padding: 0;
  overflow: hidden;
}

.modal-card:has(.filter-dialog) .modal-x {
  z-index: 2;
  top: 16px;
  right: 16px;
}

.filter-dialog {
  display: flex;
  flex-direction: column;
  margin: 0;
  max-height: calc(100vh - 40px);
}

.filter-dialog-head {
  padding: 1.2rem 1.4rem 0.9rem;
  border-bottom: 1px solid var(--stroke);
}

.filter-dialog-head h2 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.filter-dialog-body {
  padding: 1.1rem 1.4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.filter-group h4 {
  margin: 0 0 0.5rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.filter-input {
  position: relative;
  display: flex;
  align-items: center;
}

.filter-input input,
.filter-input select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.88rem;
}

.filter-input input:focus,
.filter-input select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent), transparent 35%);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 90%);
}

.filter-unit {
  position: absolute;
  right: 0.85rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  pointer-events: none;
}

.filter-input:has(.filter-unit) input {
  padding-right: 2.4rem;
}

.filter-select::after {
  content: '';
  position: absolute;
  right: 1rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--text-muted);
  border-bottom: 2px solid var(--text-muted);
  transform: translateY(-25%) rotate(45deg);
  pointer-events: none;
}

.filter-select select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 2.2rem;
  cursor: pointer;
}

.filter-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.filter-flags {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Toggle card (Авансирование-style switch) */
.filter-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
}

.filter-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.filter-switch {
  position: relative;
  flex: 0 0 auto;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--stroke-strong);
  transition: background 0.18s ease;
}

.filter-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.filter-toggle input:checked ~ .filter-switch {
  background: var(--accent);
}

.filter-toggle input:checked ~ .filter-switch::after {
  transform: translateX(18px);
}

.filter-toggle input:focus-visible ~ .filter-switch {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent), transparent 80%);
}

.filter-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.9rem 1.4rem;
  border-top: 1px solid var(--stroke);
  background: var(--surface);
  position: sticky;
  bottom: 0;
}

.filter-foot-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-dialog-foot .btn.primary {
  padding: 0.55rem 1.4rem;
}

.saved-searches {
  margin-top: 0.2rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--stroke);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.saved-searches:empty {
  display: none;
}

.saved-searches .btn {
  margin: 0;
}

.saved-searches-label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-right: 0.3rem;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.listing-card {
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  box-shadow: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: transform 0.2s ease;
}

.listing-card:hover {
  transform: translateY(-3px);
}

.listing-card:hover .card-cover {
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

[data-theme='dark'] .listing-card:hover .card-cover {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6);
}

.card-body {
  display: flex;
  flex-direction: column;
  padding: 0.85rem 0.15rem 0.2rem;
  flex: 1;
  min-width: 0;
}

.card-city {
  font-size: 0.86rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-card h3 {
  margin: 0.3rem 0 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

.card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.1rem;
  align-items: center;
  margin-top: 0.6rem;
}

.card-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.card-stat .fa-solid,
.card-stat .fa-regular {
  font-size: 0.85rem;
  color: var(--text-muted);
  width: 1em;
  text-align: center;
}

.card-price {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: -0.02em;
  line-height: 1.2;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-price-currency {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.card-price-suffix {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0;
  margin-left: auto;
  padding-left: 0.5rem;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.chip {
  font-size: 0.78rem;
  padding: 0.34rem 0.75rem;
  border-radius: 7px;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  color: var(--text-soft);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.2;
}

.chip.accent {
  border-color: color-mix(in srgb, var(--accent), transparent 65%);
  background: color-mix(in srgb, var(--accent), transparent 88%);
  color: var(--accent);
}

.chip.success {
  border-color: color-mix(in srgb, var(--primary), transparent 65%);
  background: color-mix(in srgb, var(--primary), transparent 88%);
  color: var(--primary);
}

.chip.warn {
  border-color: color-mix(in srgb, var(--warning), transparent 65%);
  background: color-mix(in srgb, var(--warning), transparent 88%);
  color: var(--warning);
}

.chip.info {
  border-color: color-mix(in srgb, var(--info), transparent 65%);
  background: color-mix(in srgb, var(--info), transparent 88%);
  color: var(--info);
}

.chip.danger {
  border-color: color-mix(in srgb, var(--danger), transparent 65%);
  background: color-mix(in srgb, var(--danger), transparent 88%);
  color: var(--danger);
}

.chip.muted-chip {
  opacity: 0.8;
}

.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
}

.quick-chips button {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--stroke);
  background: transparent;
  color: var(--text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.quick-chips button:hover {
  border-color: var(--stroke-strong);
  color: var(--text);
}

.quick-chips button.active {
  background: var(--accent);
  color: var(--accent-onfill);
  border-color: var(--accent);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.88rem;
}

.table-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: none;
}

.table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 0.55rem 0.85rem;
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  background: var(--surface-2);
  font-weight: 600;
}

.table tbody td {
  padding: 0.7rem 0.8rem;
  border-top: 1px solid var(--stroke);
  vertical-align: top;
}

.table tbody tr:hover {
  background: var(--surface-hover);
}

.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--backdrop);
  backdrop-filter: blur(8px) saturate(1.1);
}

/* Smooth modal appearance */
.modal:not(.hidden):not(.closing) .modal-backdrop {
  animation: modal-backdrop-in 0.22s ease both;
}

.modal:not(.hidden):not(.closing) .modal-card {
  animation: modal-card-in 0.26s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.modal.closing .modal-backdrop {
  animation: modal-backdrop-out 0.2s ease both;
}

.modal.closing .modal-card {
  animation: modal-card-out 0.2s ease both;
}

@keyframes modal-backdrop-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modal-card-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes modal-backdrop-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes modal-card-out {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(8px) scale(0.985); }
}

@media (prefers-reduced-motion: reduce) {
  .modal .modal-backdrop,
  .modal .modal-card {
    animation: none !important;
  }
}

.modal-card {
  position: relative;
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  max-width: 460px;
  width: 100%;
  padding: 1.5rem 1.4rem 1.25rem;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  max-height: calc(100vh - 40px);
  overflow: auto;
}

.modal-card h2 {
  font-size: 1.08rem;
  font-weight: 600;
  margin: 0 0 0.1rem;
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.modal-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.6rem 0 0.5rem;
}

.modal-card > p:first-of-type,
.modal-card .muted:first-of-type {
  margin: 0;
  font-size: 0.82rem;
}

.modal-card .field label {
  font-size: 0.6rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.modal-card form.stack {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1rem;
}

.modal-card form.stack .field {
  gap: 0.32rem;
}

.modal-card form.stack input,
.modal-card form.stack select,
.modal-card form.stack textarea {
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  border-color: var(--stroke);
  background: var(--surface-2);
  font-size: 0.88rem;
}

.modal-card form.stack input:focus,
.modal-card form.stack select:focus,
.modal-card form.stack textarea:focus {
  border-color: color-mix(in srgb, var(--accent), transparent 30%);
  background: var(--surface);
  box-shadow:
    inset 1.5px 0 0 color-mix(in srgb, var(--accent), transparent 25%),
    0 0 0 2px color-mix(in srgb, var(--accent), transparent 92%);
}

.modal-card form.stack textarea {
  min-height: 4rem;
  resize: vertical;
}

.modal-card form.stack .btn[type='submit'] {
  align-self: flex-start;
  margin-top: 0.3rem;
  padding: 0.55rem 1.2rem;
  letter-spacing: 0.03em;
}

.modal-card .row {
  margin-top: 0.9rem;
}

.modal-x {
  position: absolute;
  top: 10px;
  right: 10px;
  border: 0;
  background: transparent;
  color: var(--text-soft);
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.modal-x:hover {
  background: var(--surface-2);
  color: var(--text);
}

.dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.7rem 1.6rem;
  margin: 0.9rem 0 0;
  font-size: 0.9rem;
  padding: 1.1rem 1.2rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
}

.dl dt {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  align-self: center;
}

.dl dd {
  margin: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.detail-layout {
  max-width: 1080px;
  margin: 0 auto;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.detail-media {
  min-width: 0;
}

.detail-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (max-width: 820px) {
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.detail-hero {
  padding: 1.15rem 1.3rem 1.25rem;
}

.detail-info > .eyebrow {
  margin: 0;
}

.detail-hero h2 {
  margin: 0.4rem 0 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.28;
}

.detail-info > .muted {
  margin: 0.4rem 0 0;
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 500;
}

.detail-hero .price {
  font-size: 1.42rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.012em;
  margin: 0.9rem 0 0;
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  line-height: 1.1;
}

.detail-hero .price-suffix {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: lowercase;
  letter-spacing: 0;
  margin: 0;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding-top: 0.95rem;
  border-top: 1px solid var(--stroke);
}

.detail-actions .btn {
  flex: 0 0 auto;
}

.detail-coll-add {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
}

.detail-coll-add select {
  flex: 1;
  min-width: 0;
}

.detail-coll-add .btn {
  flex: 0 0 auto;
}

.detail-media .gallery,
.detail-media .gallery-empty {
  margin-top: 0;
}

.detail-media .gallery-hero {
  max-height: none;
}

.detail-hero .chips-row {
  margin-top: 0.9rem !important;
}

.detail-desc {
  white-space: pre-wrap;
  line-height: 1.6;
  color: var(--text-soft);
  font-size: 0.95rem;
  margin: 0;
}

.detail-desc + .dl {
  margin-top: 1.1rem;
}

/* ===== Spec sections (Характеристики / Коммуникации / Оформление) ===== */
.spec-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
  align-items: stretch;
}

@media (max-width: 720px) {
  .spec-grid {
    grid-template-columns: 1fr;
  }
}

.spec-section {
  display: flex;
  flex-direction: column;
}

.spec-section > h3 {
  margin-bottom: 0.4rem;
}

.spec-list {
  display: flex;
  flex-direction: column;
}

.spec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: 3.25rem;
  padding: 0;
  border-bottom: 1px solid var(--stroke);
}

.spec-row:last-child {
  border-bottom: 0;
}

.spec-label {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.spec-value {
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Payment / paperwork sub-cards */
.spec-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.8rem;
}

.spec-note {
  padding: 0.9rem 1rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
}

.spec-note-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.spec-note-val {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
}

.detail-hero .dl {
  grid-template-columns: max-content 1fr max-content 1fr;
  column-gap: 1.3rem;
}

@media (max-width: 720px) {
  .detail-hero .dl {
    grid-template-columns: max-content 1fr;
  }
}

/* ============================================================
   Listing detail — reference-style layout (v2)
   ============================================================ */
.detail-layout-v2 {
  max-width: 1200px;
}

.detail-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.detail-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}

.detail-breadcrumb a:hover {
  color: var(--accent);
}

.detail-breadcrumb .bc-sep {
  color: var(--text-muted);
}

.detail-breadcrumb .bc-current {
  color: var(--text);
  font-weight: 600;
}

.detail-grid-v2 {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 1.5rem;
  align-items: start;
}

.detail-main {
  min-width: 0;
}

.detail-layout-v2 .detail-hero {
  padding: 1.5rem;
}

.detail-title {
  margin: 0 0 0.9rem;
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.detail-chips {
  margin: 0 0 1.1rem !important;
}

.detail-layout-v2 .detail-media {
  margin-bottom: 1.2rem;
}

.detail-layout-v2 .gallery-hero {
  aspect-ratio: 16 / 9;
  max-height: 460px;
  border-radius: 14px;
}

.detail-layout-v2 .gallery-thumbs {
  margin-top: 0.5rem;
}

/* Stat cards row */
.detail-stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
}

.stat-card-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  background: var(--surface-3);
  color: var(--text-soft);
  font-size: 1rem;
  flex-shrink: 0;
}

.stat-card-lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.15rem;
}

.stat-card-val {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

/* Commission / comment notes strip */
.detail-notes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-top: 1.2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--stroke);
}

.detail-note {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}

.detail-note .nic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
}

.detail-note .lbl {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}

.detail-note .val {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.35;
}

/* ===== Right aside ===== */
.detail-aside {
  position: relative;
  align-self: start;
  height: -moz-fit-content;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}

.aside-price-card {
  padding: 1.3rem !important;
}

.aside-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-bottom: 0.7rem;
}

.aside-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.aside-price {
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.aside-price-suffix {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}

.aside-persqm {
  margin-top: 0.3rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

/* Developer card with contact / fix buttons */
.aside-dev {
  margin-top: 1.1rem;
  padding: 0.9rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.aside-dev-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.aside-dev-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.aside-dev-info strong {
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aside-dev-count {
  align-self: flex-start;
  margin-top: 0.45rem;
  padding: 0.22rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--stroke-strong);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-soft);
  white-space: nowrap;
}

.aside-dev-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: var(--accent-onfill);
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.btn-contact,
.btn-fix {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn-contact {
  background: #22a45d;
}

.btn-fix {
  background: #3b73e8;
}

.btn-contact:hover,
.btn-fix:hover {
  filter: brightness(1.08);
}

.btn-contact:active,
.btn-fix:active {
  transform: translateY(1px);
}

/* Views / likes counters */
.aside-stats {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

.aside-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.aside-stat .fa-regular,
.aside-stat .fa-solid {
  font-size: 0.95rem;
}

/* Secondary action cards under the price card (icon-in-circle + label) */
.aside-actions {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.aside-actions-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.aside-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.aside-action:hover {
  background: var(--surface-2);
  border-color: var(--stroke-strong);
}

.aside-action-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.aside-action:hover .aside-action-ic {
  background: var(--surface-3);
  color: var(--text);
}

.aside-action.aside-wide {
  width: 100%;
}

/* Favorited: only the heart icon turns red — border, text and icon circle stay */
.aside-action.active .aside-action-ic .fa-heart {
  color: var(--danger);
}

.detail-aside .detail-coll-add {
  margin-top: 0;
}

@media (max-width: 900px) {
  .detail-grid-v2 {
    grid-template-columns: 1fr;
  }
  /* On mobile the aside (price, developer, contact buttons) shows ABOVE the
     main content so the most important info comes first. */
  .detail-aside {
    position: static;
    order: -1;
  }
  .detail-main {
    order: 0;
  }
}

/* ===== Chessboard — spreadsheet layout ===== */
.chessboard-card {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 1.3rem 1.4rem 1.2rem;
}

.chessboard-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.9rem;
  margin: 0 0 0.9rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--stroke);
  color: var(--text-muted);
  font-size: 0.84rem;
}

.chessboard-meta strong {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.chess-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 1rem;
}

.chess-legend .chip {
  font-size: 0.72rem;
  padding: 0.26rem 0.6rem;
}

/* The grid container — horizontal scroll for wide buildings */
.chess-grid {
  --cell: 52px;
  --gutter: 56px;
  --gap: 4px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding: 0.4rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.chess-grid::-webkit-scrollbar { height: 6px; }
.chess-grid::-webkit-scrollbar-thumb { background: var(--stroke-strong); border-radius: 999px; }

.chess-row {
  display: grid;
  grid-template-columns: var(--gutter) auto;
  gap: var(--gap);
  align-items: center;
}

.chess-floor-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--gutter);
  height: var(--cell);
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

.chess-floor-num.is-corner {
  background: transparent;
  border-color: transparent;
}

.chess-row-cells {
  display: grid;
  grid-template-columns: repeat(var(--cols, 1), var(--cell));
  gap: var(--gap);
}

/* Header row (column numbers) */
.chess-row-head .chess-col {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--cell) - 18px);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Cell — small square button */
.chess-lot {
  position: relative;
  font: inherit;
  cursor: pointer;
  width: var(--cell);
  height: var(--cell);
  padding: 0;
  border: 1px solid var(--stroke);
  background: var(--surface);
  border-radius: 8px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.chess-lot:hover {
  transform: scale(1.06);
  border-color: var(--stroke-strong);
  z-index: 2;
}

.chess-lot .lot-area {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
}

/* Small dot indicator when a per-unit plan is uploaded */
.chess-lot .lot-plan-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.85;
}

/* Empty padding cell — invisible spacer */
.chess-lot.is-empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
  box-shadow: none;
}

.chess-lot.is-empty:hover {
  transform: none;
  border-color: transparent;
}

/* Status palettes (filled, business-grade muted) */
.chess-lot.status-FREE {
  background: color-mix(in srgb, var(--primary), transparent 88%);
  border-color: color-mix(in srgb, var(--primary), transparent 65%);
  color: color-mix(in srgb, var(--primary), var(--text) 25%);
}

.chess-lot.status-HOLD {
  background: color-mix(in srgb, var(--warning), transparent 88%);
  border-color: color-mix(in srgb, var(--warning), transparent 65%);
  color: color-mix(in srgb, var(--warning), var(--text) 25%);
}

.chess-lot.status-BOOKED {
  background: color-mix(in srgb, var(--info), transparent 88%);
  border-color: color-mix(in srgb, var(--info), transparent 65%);
  color: color-mix(in srgb, var(--info), var(--text) 25%);
}

.chess-lot.status-SOLD {
  background: var(--surface-3);
  border-color: var(--stroke);
  color: var(--text-muted);
}

.chess-lot.status-SOLD::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    135deg,
    transparent 0 4px,
    color-mix(in srgb, var(--text-muted), transparent 78%) 4px 5px
  );
  pointer-events: none;
}

.chess-lot.status-SOLD .lot-area {
  opacity: 0.55;
}

.news-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.news-card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 16px;
  padding: 1.2rem 1.3rem 1.1rem;
  box-shadow: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

/* Accent hairline that lights up on hover */
.news-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.18s ease;
}

.news-card:hover {
  border-color: var(--stroke-strong);
  background: var(--surface-3);
  transform: translateY(-3px);
  box-shadow: var(--shadow-soft);
}

.news-card:hover::before {
  opacity: 1;
}

.news-card-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.news-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 11px;
  background: color-mix(in srgb, var(--accent), transparent 86%);
  color: var(--accent);
  font-size: 0.95rem;
  flex-shrink: 0;
}

.news-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
}

.news-tag {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  white-space: nowrap;
}

.news-card h3 {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: -0.015em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--stroke);
}

.news-foot-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.news-read {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  opacity: 0.85;
  transition: opacity 0.15s ease, gap 0.15s ease;
}

.news-read .fa-solid {
  font-size: 0.72rem;
  transition: transform 0.15s ease;
}

.news-card:hover .news-read {
  opacity: 1;
}

.news-card:hover .news-read .fa-solid {
  transform: translateX(3px);
}

/* ===== News feed page (/news) ===== */
.news-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 2rem;
  align-items: start;
  max-width: 920px;
  margin: 0 auto;
}

@media (max-width: 760px) {
  .news-layout {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }
}

.news-side {
  position: sticky;
  top: 84px;
}

.news-side-title {
  margin: 0 0 1.2rem;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.news-cats {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.news-cats button {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.news-cats button .fa-solid {
  font-size: 0.9rem;
  color: var(--text-muted);
  width: 1.1rem;
  text-align: center;
}

.news-cats button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.news-cats button.active {
  background: var(--surface-2);
  border-color: var(--stroke);
  color: var(--text);
}

.news-cats button.active .fa-solid {
  color: var(--accent);
}

@media (max-width: 760px) {
  .news-side { position: static; }
  .news-cats { flex-direction: row; flex-wrap: wrap; }
  .news-cats button { width: auto; }
}

/* Feed of large media cards */
.news-feed {
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  min-width: 0;
}

.news-feed-card {
  cursor: pointer;
}

.news-feed-date {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.7rem;
}

.news-feed-date .fa-regular {
  font-size: 0.85rem;
}

.news-feed-media {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-2) center/cover no-repeat;
  border: 1px solid var(--stroke);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-feed-card:hover .news-feed-media {
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
}

.news-feed-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.news-feed-title {
  margin: 1rem 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.news-feed-preview {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.news-feed-more {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}

.news-feed-more:hover {
  text-decoration: underline;
}

.settings-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.1rem;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
}

@media (max-width: 800px) {
  .settings-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.settings-nav {
  position: sticky;
  top: 1rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

@media (max-width: 800px) {
  .settings-nav {
    position: static;
  }
}

.settings-id {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.5rem 0.75rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--stroke);
}

.settings-id .profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.settings-id-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.settings-id-text strong {
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settings-id-text small {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 500;
}

.settings-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  position: relative;
  transition: background 0.15s ease, color 0.15s ease;
}

.settings-nav-item i {
  width: 1.05rem;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.settings-nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.settings-nav-item.active {
  background: var(--surface-2);
  color: var(--text);
}

.settings-nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.settings-nav-item.active i {
  color: var(--accent);
}

.settings-panel {
  min-width: 0;
}

.settings-section {
  display: none;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 1.3rem 1.4rem;
  min-width: 0;
}

.settings-section .profile-stats,
.settings-section .toggle-list,
.settings-section .theme-seg,
.settings-section .settings-form {
  min-width: 0;
  max-width: 100%;
}

.settings-section.active {
  display: block;
  animation: settings-fade 0.2s ease;
}

@keyframes settings-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.settings-section-head {
  margin-bottom: 1.1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--stroke);
}

.settings-section-head h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.settings-section-head p {
  margin: 0.3rem 0 0;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.6rem;
}

.overview-contacts {
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--stroke);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  max-width: 460px;
}

.settings-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.settings-field > label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-muted);
  font-weight: 600;
}

.settings-field input {
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  font-size: 0.9rem;
}

.settings-field input:focus {
  border-color: color-mix(in srgb, var(--accent), transparent 30%);
  background: var(--surface);
  box-shadow:
    inset 1.5px 0 0 color-mix(in srgb, var(--accent), transparent 25%),
    0 0 0 2px color-mix(in srgb, var(--accent), transparent 92%);
}

.settings-field input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.settings-field small.muted {
  font-size: 0.66rem;
}

.settings-form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.3rem;
}

.security-note {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 0.9rem 1rem;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 6px;
}

.security-note > i {
  font-size: 1.1rem;
  color: var(--accent);
  margin-top: 0.1rem;
}

.security-note strong {
  font-size: 0.88rem;
  font-weight: 600;
}

.security-note p {
  margin: 0.2rem 0 0;
}

.toggle-list {
  display: flex;
  flex-direction: column;
  margin-top: 0.8rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--stroke);
  cursor: pointer;
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.toggle-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
}

.toggle-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.toggle-switch {
  position: relative;
  flex-shrink: 0;
  width: 38px;
  height: 22px;
}

.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  position: absolute;
  inset: 0;
  background: var(--surface-3, var(--surface-2));
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.toggle-track::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.18s ease, background 0.18s ease;
}

.toggle-switch input:checked + .toggle-track {
  background: color-mix(in srgb, var(--accent), transparent 35%);
  border-color: var(--accent);
}

.toggle-switch input:checked + .toggle-track::before {
  transform: translateX(16px);
  background: var(--accent);
}

.invite-item.is-used {
  opacity: 0.6;
}

.invite-copy {
  align-self: center;
}

.profile-avatar {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: var(--accent-onfill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.profile-contacts {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pc-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
}

.pc-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  flex-shrink: 0;
}

.pc-value {
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
  word-break: break-word;
}

.theme-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin-top: 0.8rem;
}

.theme-seg.theme-seg-2 {
  grid-template-columns: repeat(2, 1fr);
  max-width: 360px;
}

.theme-hint {
  margin-top: 0.7rem;
}

.theme-opt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-soft);
  font: inherit;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-align: center;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.theme-opt i {
  font-size: 1.05rem;
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.theme-opt:hover {
  border-color: var(--stroke-strong);
  color: var(--text);
}

.theme-opt.active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent), transparent 92%);
  color: var(--text);
}

.theme-opt.active i {
  color: var(--accent);
}

.invite-create {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.invite-create select {
  flex: 1;
  min-width: 0;
}

.invite-list {
  margin-top: 0.8rem;
}

.invite-list:empty {
  display: none;
}

.invite-token {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 4px;
  padding: 0.1rem 0.4rem;
  color: var(--text);
}

.my-add-details {
  margin-top: 0.9rem;
}

.my-add-details > summary {
  display: inline-flex;
  align-items: center;
  list-style: none;
  cursor: pointer;
}

.my-add-details > summary::-webkit-details-marker {
  display: none;
}

.my-add-details[open] > summary {
  margin-bottom: 0.9rem;
}

.my-add-form {
  margin-top: 0 !important;
  padding-top: 0.9rem;
  border-top: 1px solid var(--stroke);
}

.my-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.85rem;
}

.my-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.95rem 1.05rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.18s ease;
}

.my-card:hover {
  border-color: var(--stroke-strong);
}

.my-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.my-card-titles {
  min-width: 0;
}

.my-card-titles .eyebrow {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.my-card-title {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.32;
}

.my-card-price {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
}

.my-card-price .cur {
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: color-mix(in srgb, var(--accent), transparent 25%);
}

.my-card-price .suf {
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--text-muted);
}

.my-card .my-open {
  align-self: flex-start;
  text-decoration: none;
  margin-top: 0.15rem;
}

.coll-create {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.coll-create input {
  flex: 1;
  min-width: 220px;
}

.coll-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.85rem;
}

.coll-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 1.1rem 1.1rem 0.85rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 0;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.coll-card:hover {
  border-color: var(--stroke-strong);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

[data-theme='dark'] .coll-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.coll-icon {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.coll-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.32;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.coll-meta {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.coll-foot {
  margin-top: auto;
  padding-top: 0.7rem;
  border-top: 1px solid var(--stroke);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  transition: color 0.18s ease;
}

.coll-foot i {
  font-size: 0.65rem;
  transition: transform 0.18s ease;
}

.coll-card:hover .coll-foot {
  color: var(--accent);
}

.coll-card:hover .coll-foot i {
  transform: translateX(3px);
}

.coll-del {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid var(--stroke);
  background: var(--surface-2);
  color: var(--text-muted);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.coll-del:hover {
  background: color-mix(in srgb, #b35040, transparent 82%);
  border-color: color-mix(in srgb, #b35040, transparent 55%);
  color: #d98a7d;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--stroke);
}

.list-head-count {
  margin: 0;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.empty-state {
  background: var(--surface);
  border: 1px dashed var(--stroke-strong);
  border-radius: 6px;
  padding: 2.4rem 1.6rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.empty-state > i {
  font-size: 1.8rem;
  color: var(--text-muted);
  opacity: 0.4;
  margin-bottom: 0.2rem;
}

.empty-state h3 {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.empty-state p {
  margin: 0;
  max-width: 30rem;
  font-size: 0.82rem;
  line-height: 1.55;
}

.empty-state .btn {
  margin-top: 0.7rem;
  text-decoration: none;
}

#map-host {
  height: clamp(340px, 60vh, 640px);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid var(--stroke);
  box-shadow: none;
}

.leaflet-popup-content {
  font-family: inherit;
  font-size: 0.86rem;
  line-height: 1.46;
}

.leaflet-popup-content strong {
  display: block;
  margin-bottom: 0.2rem;
  font-weight: 600;
}

.leaflet-control-attribution {
  display: none !important;
}

.guest-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.guest-actions[hidden] {
  display: none !important;
}

.guest-actions .btn {
  text-decoration: none;
  white-space: nowrap;
}

body.guest-mode .global-search,
body.guest-mode #btn-notif {
  display: none;
}

.login-root {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
  background: var(--bg0);
}

.login-card {
  position: relative;
  width: min(380px, 100%);
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 1.5rem 1.35rem 1.2rem;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.32);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    color-mix(in srgb, var(--accent), transparent 40%) 20%,
    var(--accent) 50%,
    color-mix(in srgb, var(--accent), transparent 40%) 80%,
    transparent 100%
  );
}

.login-brand {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--stroke);
  position: relative;
}

.login-brand::before {
  content: '';
  position: absolute;
  left: calc(42px + 0.42rem);
  top: 4px;
  bottom: calc(0.75rem + 4px);
  width: 1px;
  background: linear-gradient(180deg,
    transparent 0%,
    var(--stroke-strong) 30%,
    var(--stroke-strong) 70%,
    transparent 100%
  );
}

.login-brand .brand-mark.large {
  width: 42px;
  height: 42px;
  font-size: 0.95rem;
  flex: 0 0 auto;
  border-radius: 6px;
  letter-spacing: -0.02em;
}

.login-brand > div {
  min-width: 0;
}

.login-brand .eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.login-brand h1 {
  margin: 0;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.18;
}

.login-brand p.muted {
  margin: 0.25rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  letter-spacing: 0.005em;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.login-form .field {
  gap: 0.32rem;
}

.login-form .field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.login-form .field-row .field {
  min-width: 0;
}

.login-form .field label {
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.optional {
  font-size: 0.54rem;
  letter-spacing: 0.12em;
  font-weight: 600;
  padding: 1.5px 5px;
  border: 1px solid var(--stroke-strong);
  border-radius: 3px;
  color: var(--text-muted);
  background: var(--surface-2);
  text-transform: uppercase;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}

.login-form input {
  padding: 0.6rem 0.75rem 0.6rem 0.85rem !important;
  font-size: 0.9rem !important;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2) !important;
  border-color: var(--stroke) !important;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease !important;
  letter-spacing: 0.01em;
}

.login-form input::placeholder {
  color: var(--text-muted);
  opacity: 0.55;
  letter-spacing: 0.02em;
}

.login-form input:hover {
  border-color: var(--stroke-strong) !important;
}

.login-form input:focus {
  border-color: color-mix(in srgb, var(--accent), transparent 30%) !important;
  background: var(--surface) !important;
  box-shadow:
    inset 1.5px 0 0 color-mix(in srgb, var(--accent), transparent 25%),
    0 0 0 2px color-mix(in srgb, var(--accent), transparent 92%) !important;
}

.login-form .field small.muted {
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  color: var(--text-muted);
}

.login-submit {
  align-self: stretch;
  padding: 0.6rem 1rem;
  font-size: 0.86rem;
  margin-top: 0.3rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.login-submit:hover {
  box-shadow: 0 4px 12px color-mix(in srgb, var(--accent), transparent 65%);
}

.login-hint {
  margin: 0;
  min-height: 1em;
  font-size: 0.72rem;
  letter-spacing: 0.01em;
}

.login-demos {
  border-top: 1px solid var(--stroke);
  padding-top: 0.8rem;
  margin-top: 0.1rem;
}

.login-demos > p {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.login-demos ul {
  list-style: none;
  margin: 0.55rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.demo-acc {
  font: inherit;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-left: 2px solid var(--stroke);
  border-radius: 0 4px 4px 0;
  padding: 0.35rem 0.65rem 0.35rem 0.7rem;
  cursor: pointer;
  color: var(--text-soft);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.005em;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  display: block;
  width: 100%;
}

.demo-acc:hover {
  background: var(--surface-2);
  color: var(--text);
  border-left-color: var(--accent);
  transform: translateX(2px);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--stroke-strong);
  border-radius: 999px;
  padding: 0.62rem 1.15rem;
  box-shadow: var(--shadow-card);
  font-size: 0.88rem;
  color: var(--text);
  z-index: 100;
  max-width: 80vw;
}

.toast.hidden {
  display: none;
}

.toast.success {
  border-color: color-mix(in srgb, var(--primary), transparent 50%);
}

.toast.error {
  border-color: color-mix(in srgb, var(--danger), transparent 50%);
  color: var(--danger);
}

.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 0.85rem;
}

.deal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.95rem 1.05rem 0.95rem 1.15rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.deal-card:hover {
  border-color: var(--stroke-strong);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

[data-theme='dark'] .deal-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5);
}

.deal-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--stroke-strong);
}

.deal-card.status-success::before { background: var(--primary); }
.deal-card.status-warn::before { background: var(--warning); }
.deal-card.status-info::before { background: var(--info); }
.deal-card.status-accent::before { background: var(--accent); }
.deal-card.status-danger::before { background: var(--danger); }

.deal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.7rem;
}

.deal-titles {
  min-width: 0;
}

.deal-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.32;
}

.deal-sub {
  margin-top: 0.3rem;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.deal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--stroke);
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--stroke);
}

.timeline-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 0.7rem;
  align-items: baseline;
  font-size: 0.8rem;
  position: relative;
  padding-left: 0.85rem;
}

.timeline-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

.timeline-row:first-child::before {
  opacity: 1;
}

.timeline-row time {
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.timeline-row strong {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  flex: 0 0 auto;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.95rem;
  margin-right: 0.2rem;
}

.menu-toggle:hover {
  background: var(--surface-2);
}

.sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 1100;
}

.sidebar-backdrop[hidden] {
  display: none;
}

/* ===== Mobile bottom navigation (hidden on desktop) ===== */
.bottom-nav {
  display: none;
}

@media (max-width: 760px) {
  body > .bottom-nav,
  .bottom-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: auto !important;
    width: 100% !important;
    transform: none !important;
    z-index: 1150 !important;
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: stretch;
    background: var(--surface);
    border-top: 1px solid var(--stroke);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 0.5rem 0.25rem 0.55rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    position: relative;
    transition: color 0.15s ease;
  }

  .bottom-nav a i {
    font-size: 1.15rem;
  }

  .bottom-nav a.active {
    color: var(--accent);
  }

  .bottom-nav a.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 3px;
    border-radius: 0 0 3px 3px;
    background: var(--accent);
  }

  /* Leave room for the bottom bar */
  .view-root {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0)) !important;
  }
}

/* ===== Collapse horizontal nav into a drawer on narrow screens ===== */
@media (max-width: 1200px) {
  .menu-toggle {
    display: inline-flex;
    order: 3;
    margin-left: auto;
  }

  .topbar-brand {
    order: 1;
  }

  .topbar-actions {
    order: 2;
  }

  /* Header nav becomes a slide-down drawer */
  .header-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(320px, 86vw);
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    background: var(--surface);
    border-left: 1px solid var(--stroke);
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.35);
    padding: 1.1rem 0.85rem;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.22s ease;
    z-index: 1200;
  }

  .header-nav.open {
    transform: translateX(0);
  }

  .header-nav a {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border-radius: 6px;
  }

  .header-nav a.active::after {
    display: none;
  }

  .header-nav a.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 25%;
    bottom: 25%;
    width: 2px;
    background: var(--accent);
    border-radius: 2px;
  }

  /* Show the grouped/extras layout inside the drawer */
  .header-nav > .nav-group-title {
    display: block;
  }

  .header-nav > .nav-extras {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-top: auto;
    padding-top: 0.7rem;
    border-top: 1px solid var(--stroke);
  }

  .nav-extras a.muted {
    padding: 0.3rem 0.75rem;
  }

  /* "More" items inline in the drawer instead of a popover */
  .nav-more {
    margin-left: 0;
    display: contents;
  }

  .nav-more-toggle {
    display: none;
  }

  .nav-more-menu {
    position: static;
    min-width: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    gap: 2px;
  }

  .nav-more-menu[hidden] {
    display: flex;
  }

  .nav-more-menu a {
    padding: 0.55rem 0.75rem;
  }

  body.sidebar-locked {
    overflow: hidden;
  }
}

@media (max-width: 900px) {
  .global-search {
    display: none;
  }

  .user-meta {
    display: none;
  }

  .topbar-context h1 {
    font-size: 1.15rem;
  }
}

@media (max-width: 760px) {

  /* Profile lives in the bottom nav on mobile — hide the header chip */
  .user-menu {
    display: none;
  }

  .table-card {
    overflow-x: auto;
  }
  .table {
    min-width: 540px;
  }

  .row-item {
    grid-template-columns: 1fr;
  }
  .row-item .row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 0.2rem;
  }

  .settings-nav {
    position: static;
    flex-direction: column;
  }
  .settings-nav-list {
    flex-direction: row;
    overflow-x: auto;
    gap: 0.25rem;
    padding-bottom: 0.5rem;
    scroll-snap-type: x proximity;
  }

  .settings-nav-list.scrollable {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent 100%);
    mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent 100%);
  }

  .settings-nav-list {
    scrollbar-width: thin;
    scrollbar-color: var(--stroke-strong) transparent;
  }
  .settings-nav-list::-webkit-scrollbar {
    height: 3px;
  }
  .settings-nav-list::-webkit-scrollbar-thumb {
    background: var(--stroke-strong);
    border-radius: 999px;
  }
  .settings-nav-list::-webkit-scrollbar-track {
    background: transparent;
  }
  .settings-nav-item {
    white-space: nowrap;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }
  .settings-nav-item.active::before {
    display: none;
  }
  .settings-form {
    max-width: none;
  }

  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .theme-seg.theme-seg-2 {
    max-width: none;
  }
}

@media (max-width: 620px) {
  .catalog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }

  .listing-card .card-body {
    padding: 0.6rem 0.15rem 0.2rem;
  }

  .listing-card h3 {
    font-size: 0.92rem;
    -webkit-line-clamp: 2;
    min-height: 2.4em;
  }

  .card-price {
    font-size: 1.2rem;
    margin-top: 0.6rem;
  }

  .card-price .card-price-currency {
    font-size: 0.78rem;
  }

  .card-city {
    font-size: 0.78rem;
  }

  .card-stats {
    font-size: 0.78rem;
    gap: 0.3rem 0.7rem;
    margin-top: 0.45rem;
  }

  .card-stat {
    font-size: 0.78rem;
  }

  .card-price-suffix {
    font-size: 0.68rem;
  }

  .chip {
    font-size: 0.72rem;
    padding: 0.28rem 0.65rem;
  }

  .card-cover .fav-toggle,
  .card-cover .compare-toggle,
  .card-cover .collection-toggle {
    width: 34px;
    height: 34px;
  }

  .card-cover .compare-toggle {
    left: 52px;
    width: 30px;
    height: 30px;
  }
}

@media (max-width: 360px) {
  .catalog-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  :root {
    --gutter: 14px;
  }

  .topbar-inner {
    gap: 0.5rem;
  }

  .topbar-actions {
    gap: 0.35rem;
  }

  .guest-actions .btn {
    padding: 0.3rem 0.55rem;
    font-size: 0.72rem;
  }

  .section-card,
  .settings-section {
    padding: 1rem;
  }

  .list-head {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .detail-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .modal {
    padding: 12px;
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 16px);
    align-items: flex-start;
    padding-top: 16px;
  }

  /* Make sure modal cards fit above the mobile bottom nav */
  .modal-card {
    max-height: calc(100vh - 96px - env(safe-area-inset-bottom, 0px));
  }

  .modal-card:has(.filter-dialog),
  .modal-card:has(.fix-intro),
  .modal-card.lot-sheet {
    max-height: calc(100vh - 96px - env(safe-area-inset-bottom, 0px));
  }

  .filter-dialog,
  .fix-intro {
    max-height: calc(100vh - 96px - env(safe-area-inset-bottom, 0px));
  }

  /* Filter footer: wrap on narrow screens so all buttons stay visible */
  .filter-dialog-foot {
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
  }

  .filter-dialog-foot #ft-reset {
    flex: 0 0 auto;
  }

  .filter-foot-right {
    flex: 1 1 100%;
    justify-content: flex-end;
    gap: 0.4rem;
  }

  .filter-foot-right .btn {
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .fix-intro-foot {
    padding: 0.85rem 1rem 1rem;
  }

  /* Sort dropdown: cap width to viewport so it can't clip on narrow screens.
     A JS handler also nudges it back into view if its left edge would go off
     the viewport. */
  .sort-dropdown {
    min-width: 200px;
    max-width: calc(100vw - 24px);
  }
}

.split-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.split-row h4 {
  margin: 0 0 0.5rem;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-weight: 600;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .split-row {
    grid-template-columns: 1fr;
  }
}

.bar {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: inherit;
  width: 0;
}

.header-nav .badge {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface-2);
  color: var(--text-soft);
  min-width: 18px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* Push badge to the right when nav is the vertical drawer / dropdown menu */
.header-nav.open .badge,
.nav-more-menu .badge {
  margin-left: auto;
}

.header-nav .badge.alert {
  background: color-mix(in srgb, #b35040, transparent 80%);
  color: #b35040;
}

.header-nav .badge.soft {
  background: color-mix(in srgb, var(--accent), transparent 82%);
  color: var(--accent);
}

[data-theme='dark'] .header-nav .badge.alert {
  background: rgba(200, 120, 100, 0.22);
  color: #ffb59b;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.global-search {
  position: relative;
  flex: 0 1 320px;
  min-width: 0;
}

.global-search input[type='search'] {
  width: 100%;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid var(--border, rgba(120, 110, 90, 0.25));
  background: var(--surface);
  color: var(--text);
  font: inherit;
  outline: none;
}

.global-search input[type='search']:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(110, 90, 70, 0.12);
}

.global-search-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 380px;
  overflow-y: auto;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border, rgba(120, 110, 90, 0.22));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  z-index: 60;
  padding: 6px;
}

.global-search-dropdown.hidden {
  display: none;
}

.gs-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  color: var(--text);
}

.gs-item:hover,
.gs-item.active {
  background: var(--surface-2);
}

.gs-item .gs-kind {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
}

.gs-item .gs-thumb {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-2) center/cover no-repeat;
  flex-shrink: 0;
}

.gs-empty {
  padding: 10px 14px;
  color: var(--muted);
  font-size: 13px;
}

.notif-bell {
  position: relative;
}

.notif-bell .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #b35040;
  color: #fff;
  font-size: 10px;
  border-radius: 999px;
  min-width: 18px;
  padding: 1px 5px;
  text-align: center;
}

.notif-popover {
  position: fixed;
  top: 64px;
  right: 24px;
  width: min(380px, 92vw);
  background: var(--surface);
  border: 1px solid var(--border, rgba(120, 110, 90, 0.22));
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
  z-index: 70;
  overflow: hidden;
}

.notif-popover.hidden {
  display: none;
}

.notif-popover header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, rgba(120, 110, 90, 0.16));
  font-weight: 600;
}

.notif-list {
  max-height: 60vh;
  overflow-y: auto;
}

.notif-item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, rgba(120, 110, 90, 0.08));
  color: var(--text);
  text-decoration: none;
}

.notif-item:hover {
  background: var(--surface-2);
}

.notif-item .notif-kind {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}

.notif-item .notif-title {
  font-weight: 600;
  margin: 2px 0;
}

.notif-item .notif-body {
  color: var(--muted);
  font-size: 13px;
}

.notif-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.card-cover {
  position: relative;
  aspect-ratio: 16 / 11;
  background: var(--surface-2) center/cover no-repeat;
  border-radius: 16px;
  overflow: hidden;
  margin: 0;
  border: 0;
  flex-shrink: 0;
  transition: box-shadow 0.2s ease;
}

.card-cover.placeholder {
  background:
    linear-gradient(135deg, var(--surface-2) 0%, var(--surface) 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.card-cover.placeholder::before {
  content: '';
  width: 34px;
  height: 34px;
  background-color: var(--text-muted, currentColor);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='18' rx='2.5' ry='2.5'/><circle cx='8.5' cy='8.5' r='1.6' fill='black'/><polyline points='21 15 16 10 5 21'/></svg>") center/contain no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='18' height='18' rx='2.5' ry='2.5'/><circle cx='8.5' cy='8.5' r='1.6' fill='black'/><polyline points='21 15 16 10 5 21'/></svg>") center/contain no-repeat;
  opacity: 0.45;
}

.card-cover-noimg {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.6;
  font-weight: 500;
}

.card-cover:not(.placeholder) .card-cover-noimg { display: none; }

/* Photo gallery on the card cover: arrows + dot indicator. Only shown when
   the cover has the .has-gallery class (set when there is more than one photo). */
.card-cover .cover-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(18, 18, 22, 0.55);
  color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  z-index: 2;
  padding: 0;
}

.card-cover.has-gallery:hover .cover-nav,
.card-cover .cover-nav:focus-visible {
  opacity: 1;
}

.card-cover .cover-nav:hover {
  background: rgba(18, 18, 22, 0.8);
}

.card-cover .cover-nav.prev { left: 10px; }
.card-cover .cover-nav.next { right: 10px; }

.card-cover .cover-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  pointer-events: none;
  z-index: 2;
}

.card-cover .cover-dot {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  transition: width 0.2s ease, background 0.2s ease;
}

.card-cover .cover-dot.active {
  width: 14px;
  background: #fff;
}

/* On touch devices the arrows must be tappable — keep them visible. */
@media (hover: none) {
  .card-cover.has-gallery .cover-nav { opacity: 0.85; }
}

.card-cover .photo-count {
  position: absolute;
  left: 0.7rem;
  top: 0.7rem;
  padding: 3px 9px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  border-radius: 999px;
  z-index: 1;
}

/* When a video badge is present, shift the photo count to its right */
.card-cover .video-badge + .photo-count {
  left: calc(0.7rem + 28px + 6px);
}

.card-cover .fav-toggle,
.card-cover .compare-toggle,
.card-cover .collection-toggle {
  position: absolute;
  top: auto;
  bottom: 12px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: rgba(18, 18, 22, 0.62);
  color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  padding: 0;
  z-index: 2;
}

.card-cover .fav-toggle:hover,
.card-cover .compare-toggle:hover,
.card-cover .collection-toggle:hover {
  background: rgba(18, 18, 22, 0.82);
  color: #fff;
  transform: translateY(-1px);
}

.card-cover .fav-toggle {
  right: 12px;
  font-size: 15px;
}

.card-cover .collection-toggle {
  left: 12px;
  font-size: 15px;
}

/* Compare toggle: keep but tuck it next to the bookmark, smaller */
.card-cover .compare-toggle {
  left: 60px;
  width: 36px;
  height: 36px;
  bottom: 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.card-cover .fav-toggle.active {
  background: rgba(179, 80, 64, 0.95);
  color: #fff;
}

.card-cover .collection-toggle.active {
  background: var(--accent);
  color: var(--accent-onfill);
}

.card-cover .compare-toggle.active {
  background: var(--accent);
  color: var(--accent-onfill);
}

.gallery {
  display: grid;
  gap: 6px;
  margin: 0.85rem 0 0;
}

.gallery-hero {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 320px;
  background: var(--surface-2) center/cover no-repeat;
  border-radius: 5px;
  cursor: zoom-in;
  overflow: hidden;
  border: 1px solid var(--stroke);
}

.gallery-hero .photo-count {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 3px;
  backdrop-filter: blur(8px);
}

/* ===== Gallery prev/next arrows ===== */
.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 50%;
  background: rgba(20, 20, 24, 0.42);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px) saturate(1.3);
  backdrop-filter: blur(10px) saturate(1.3);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  opacity: 0;
  transform: translateY(-50%) scale(0.85);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.18s ease, border-color 0.18s ease;
}

.gallery-nav.prev { left: 16px; }
.gallery-nav.next { right: 16px; }

/* Reveal on hover/focus of the hero */
.gallery-hero:hover .gallery-nav,
.gallery-hero:focus-within .gallery-nav {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.gallery-nav:hover {
  background: rgba(20, 20, 24, 0.72);
  border-color: rgba(255, 255, 255, 0.55);
  transform: translateY(-50%) scale(1.1);
}

.gallery-nav:active {
  transform: translateY(-50%) scale(0.96);
}

.gallery-nav:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  opacity: 1;
}

.gallery-nav .fa-solid {
  transition: transform 0.18s ease;
}

.gallery-nav.prev:hover .fa-solid { transform: translateX(-2px); }
.gallery-nav.next:hover .fa-solid { transform: translateX(2px); }

/* On touch devices keep them visible (no hover) */
@media (hover: none) {
  .gallery-nav {
    opacity: 1;
    transform: translateY(-50%) scale(1);
    width: 42px;
    height: 42px;
  }
}

.gallery-empty {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.95rem;
  background: var(--surface-2);
  border: 1px dashed var(--stroke);
  border-radius: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  margin: 0.85rem 0 0;
}

.gallery-empty .fa-images {
  font-size: 0.95rem;
  opacity: 0.55;
  flex-shrink: 0;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px;
}

.gallery-thumbs .thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--surface-2) center/cover no-repeat;
  border-radius: 4px;
  cursor: pointer;
  border: 1.5px solid var(--stroke);
  transition: border-color 0.15s ease;
}

.gallery-thumbs .thumb:hover {
  border-color: var(--stroke-strong);
}

.gallery-thumbs .thumb.cover {
  border-color: color-mix(in srgb, var(--accent), transparent 55%);
}

.gallery-thumbs .thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.gallery-thumbs .thumb .thumb-actions {
  position: absolute;
  inset: auto 4px 4px 4px;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.gallery-thumbs .thumb .thumb-actions button {
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 11px;
  cursor: pointer;
}

.photo-uploader {
  border: 1px dashed var(--stroke-strong);
  border-radius: 5px;
  padding: 0.9rem 1rem;
  text-align: center;
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.photo-uploader strong {
  font-size: 0.82rem;
}

.photo-uploader.drag {
  border-color: var(--accent);
  background: rgba(110, 90, 70, 0.08);
  color: var(--text);
}

.photo-uploader input[type='file'] {
  display: none;
}

.photo-uploader strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.upload-progress {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 6, 4, 0.92);
  z-index: 200;
  display: grid;
  place-items: center;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-x,
.lightbox-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: none;
  font-size: 26px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(6px);
}

.lightbox-x {
  top: 24px;
  right: 24px;
}

.lightbox-nav.prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px 12px;
  border-radius: 999px;
}

.cma-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem 1.2rem;
  padding: 1.2rem;
  background: var(--surface-2);
  border-radius: 14px;
  border: 1px solid var(--stroke);
}

.cma-stat {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.cma-stat .lbl {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.cma-stat .val {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  color: var(--text);
}

.cma-histogram {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 64px;
  grid-column: 1 / -1;
  margin-top: 0.5rem;
  padding: 0.9rem 0.9rem 0;
  border-top: 1px solid var(--stroke);
  background: var(--surface);
  border-radius: 10px;
}

.cma-histogram .bar {
  flex: 1 1 0;
  height: 100%;
  background: transparent;
  border-radius: 4px 4px 0 0;
  position: relative;
}

.cma-histogram .bar > span {
  display: block;
  min-height: 3px;
  background: linear-gradient(180deg, var(--accent-2), var(--accent));
  border-radius: 4px 4px 0 0;
  width: 100%;
  position: absolute;
  bottom: 0;
}

/* Compare page header */
.cmp-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed var(--stroke);
}

.cmp-head-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cmp-head-count {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.cmp-head-sub {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.cmp-head-link {
  align-self: center;
  gap: 0.4rem;
}

.cmp-legend-wrap {
  display: flex;
  justify-content: center;
  margin-top: 1.4rem;
}

@media (max-width: 560px) {
  .cmp-head {
    margin-bottom: 1rem;
    padding-bottom: 0.8rem;
  }
  .cmp-head-count { font-size: 1.8rem; }
  .cmp-head-sub { font-size: 0.6rem; letter-spacing: 0.18em; }
}

/* ===== Compare — same look as the catalog cards =====
   We reuse `.listing-card` and only add: a close (×) button on the cover and
   a subtle "best value" treatment on individual card-stat rows. Up to 4
   cards side-by-side so the user can compare them column-by-column. */
.cmp-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

@media (max-width: 1100px) {
  .cmp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.cmp-card {
  position: relative;
}

/* Close button on the cover — circular, glassy, sits in the top-right
   without colliding with fav/compare icons (those are hidden here). */
.cmp-card .cmp-remove {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(18, 18, 22, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.cmp-card .cmp-remove:hover {
  background: var(--danger);
  transform: scale(1.06);
}

/* Vertical datasheet inside each compare card so the spec rows line up
   across cards when read column-by-column. */
.cmp-rows {
  margin: 0.9rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.cmp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--stroke);
  min-height: 2.2rem;          /* fixed row height so rows align across cards */
}

.cmp-row:last-child { border-bottom: 0; }

.cmp-row dt {
  margin: 0;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  flex-shrink: 0;
}

.cmp-row dd {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  justify-content: flex-end;
}

.cmp-row.is-best dd {
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary), transparent 88%);
  border: 1px solid color-mix(in srgb, var(--primary), transparent 65%);
  color: var(--primary);
  font-weight: 700;
}

.cmp-row .best-tick {
  font-size: 0.6rem;
  color: var(--primary);
}

.cmp-legend {
  margin: 0;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  font-size: 0.74rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: 0.01em;
}

.cmp-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary), transparent 80%);
}

/* Tablet/mobile — keep cards side-by-side for actual comparison */
@media (max-width: 760px) {
  .cmp-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
  }
  .cmp-card h3 { font-size: 0.96rem; min-height: 2.4em; }
  .cmp-card .card-price { font-size: 1.2rem; }
  .cmp-card .cmp-remove { width: 28px; height: 28px; font-size: 0.78rem; top: 8px; right: 8px; }
  .cmp-row { padding: 0.45rem 0; min-height: 2rem; }
  .cmp-row dt { font-size: 0.54rem; letter-spacing: 0.14em; }
  .cmp-row dd { font-size: 0.8rem; }
}

.row-list {
  display: grid;
  gap: 0.5rem;
}

.row-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 1rem 0.85rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.18s ease;
}

.row-item:hover {
  border-color: var(--stroke-strong);
}

.row-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--stroke-strong);
}

.row-item.status-success::before { background: var(--primary); }
.row-item.status-warn::before { background: var(--warning); }
.row-item.status-info::before { background: var(--info); }
.row-item.status-accent::before { background: var(--accent); }
.row-item.status-danger::before { background: var(--danger); }

.row-item.overdue {
  border-color: color-mix(in srgb, var(--danger), transparent 55%);
}

.row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.row-item .row-title {
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.row-item .row-meta {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.5;
  letter-spacing: 0.01em;
}

.row-item .row-meta a {
  color: var(--text-soft);
  text-decoration: none;
}

.row-item .row-meta a:hover {
  color: var(--accent);
}

.row-meta-phone {
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

.row-note {
  display: block;
  margin-top: 0.3rem;
  color: var(--text-soft);
  font-style: italic;
}

.row-meta-due {
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
}

.row-meta-due.overdue {
  color: var(--danger);
  font-weight: 600;
}

.row-item.is-done {
  opacity: 0.62;
}

.row-item.is-done .row-title {
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--text-muted), transparent 40%);
}

.task-group-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1.3rem 0 0.6rem;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.task-group-title:first-child {
  margin-top: 0.2rem;
}

.task-group-title span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 5px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 3px;
  font-size: 0.62rem;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}

.row-item .row-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.status-chip {
  font-size: 0.58rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  background: transparent;
  border: 1px solid var(--stroke);
  color: var(--text-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
}

.status-chip.success {
  border-color: color-mix(in srgb, var(--primary), transparent 60%);
  color: var(--primary);
}

.status-chip.warn {
  border-color: color-mix(in srgb, var(--warning), transparent 60%);
  color: var(--warning);
}

.status-chip.info {
  border-color: color-mix(in srgb, var(--info), transparent 60%);
  color: var(--info);
}

.status-chip.accent {
  border-color: color-mix(in srgb, var(--accent), transparent 60%);
  color: var(--accent);
}

.status-chip.danger {
  border-color: color-mix(in srgb, var(--danger), transparent 60%);
  color: var(--danger);
}

.status-chip.muted-chip {
  color: var(--text-muted);
  opacity: 0.85;
}

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s linear infinite;
  border-radius: 8px;
}

@keyframes skeleton-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-card {
  height: 220px;
}

.toast-undo {
  display: inline-block;
  margin-left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  cursor: pointer;
  border: none;
  color: inherit;
  font-weight: 600;
}

.ticket-list {
  display: grid;
  gap: 0.7rem;
}

.ticket-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 1rem 1.1rem 1.05rem 1.2rem;
  overflow: hidden;
}

.ticket-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--stroke-strong);
}

.ticket-card.status-success::before { background: var(--primary); }
.ticket-card.status-accent::before { background: var(--accent); }
.ticket-card.status-info::before { background: var(--info); }

.ticket-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
}

.ticket-titles {
  min-width: 0;
}

.ticket-titles .eyebrow {
  font-size: 0.58rem;
  letter-spacing: 0.12em;
}

.ticket-subject {
  margin: 0.3rem 0 0;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.ticket-body {
  margin: 0.6rem 0 0;
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-soft);
}

.ticket-thread {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--stroke);
}

.ticket-msg {
  padding: 0.55rem 0.75rem;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-soft);
  max-width: 85%;
}

.ticket-msg.mine {
  background: color-mix(in srgb, var(--accent), transparent 90%);
  border-color: color-mix(in srgb, var(--accent), transparent 70%);
  margin-left: auto;
}

.ticket-msg .who {
  font-size: 0.56rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.ticket-msg-body {
  color: var(--text);
}

.ticket-reply {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  margin-top: 0.85rem;
}

.ticket-reply textarea {
  flex: 1;
  min-height: 2.5rem;
  resize: vertical;
}

.ticket-reply .btn {
  flex: 0 0 auto;
}

/* ============================================================
   PHASE 2-11 — top placement, plans, videos, docs, calendar, i18n
   ============================================================ */

.top-badge {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-weight: 600;
  font-size: 0.74rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  text-transform: none;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 18px -8px rgba(239, 68, 68, 0.7);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.top-badge.inline {
  position: static;
  font-size: 0.6rem;
  padding: 0.2rem 0.45rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.video-badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.collection-toggle {
  position: absolute;
  right: 0.6rem;
  top: 3rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border: 1px solid var(--stroke);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}
[data-theme='dark'] .collection-toggle {
  background: rgba(28, 28, 32, 0.85);
  color: var(--text);
}
.collection-toggle:hover {
  background: var(--accent);
  color: #fff;
}

.collection-popover {
  width: 300px;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.4);
  padding: 0.6rem;
  z-index: 9999;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.collection-popover.open {
  opacity: 1;
  transform: translateY(0);
}
.collection-popover .cp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}
.collection-popover .cp-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
}
.collection-popover .cp-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
  max-height: 240px;
  overflow-y: auto;
}
.collection-popover .cp-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  background: transparent;
  border: 1px solid var(--stroke);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  margin-bottom: 0.3rem;
  color: var(--text);
}
.collection-popover .cp-item.on {
  background: color-mix(in srgb, var(--accent), transparent 90%);
  border-color: var(--accent);
}
.collection-popover .cp-new {
  display: flex;
  gap: 0.4rem;
}
.collection-popover .cp-new input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  color: var(--text);
}

/* ===== Payments page (elegant business design) ===== */
.pay-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border-radius: 20px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent), transparent 84%) 0%, transparent 60%),
    var(--surface);
  border: 1px solid var(--stroke);
  margin-bottom: 1.4rem;
  overflow: hidden;
}

.pay-hero-text { min-width: 0; flex: 1 1 320px; }
.pay-hero .eyebrow { margin: 0 0 0.6rem; }

.pay-hero-title {
  margin: 0;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.pay-hero-sub {
  margin: 0.65rem 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  max-width: 560px;
}

.pay-hero-badge {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.95rem 1.2rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  min-width: 200px;
}

.pay-hero-badge-lbl {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}

.pay-hero-badge-val {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.pay-hero-badge-until {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.pay-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.6rem;
}

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 0 0 1.6rem;
}

.plan-grid-v2 {
  align-items: stretch;
}

.plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 1.6rem 1.4rem 1.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.plan-card:hover {
  transform: translateY(-3px);
  border-color: var(--stroke-strong);
  box-shadow: var(--shadow-soft);
}

.plan-card.active {
  border-color: var(--accent);
}

.plan-card.featured {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent), transparent 92%) 0%, var(--surface) 60%),
    var(--surface);
  border-color: color-mix(in srgb, var(--accent), transparent 50%);
  box-shadow: 0 18px 48px -24px color-mix(in srgb, var(--accent), transparent 35%);
}

/* Recommended badge — quiet, business-grade.
   Thin outlined pill, accent letters, subtle vertical divider before label. */
.plan-card-ribbon {
  position: absolute;
  top: 0.95rem;
  right: 0.95rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.38rem 0.8rem;
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent), transparent 92%);
  border: 1px solid color-mix(in srgb, var(--accent), transparent 65%);
  border-radius: 999px;
  line-height: 1;
}

.plan-card-ribbon .fa-solid {
  font-size: 0.62rem;
  opacity: 0.95;
}

/* Hairline divider between icon and label */
.plan-card-ribbon span {
  position: relative;
  padding-left: 0.55rem;
}

.plan-card-ribbon span::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 1px;
  height: 0.8em;
  background: color-mix(in srgb, var(--accent), transparent 55%);
  transform: translateY(-50%);
}

/* Plan card decoration layer — sits behind the content, never blocks clicks */
.plan-card { overflow: hidden; }
.plan-card > *:not(.plan-card-deco):not(.plan-card-ribbon) { position: relative; z-index: 1; }

.plan-card-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
  transition: opacity 0.25s ease, transform 0.4s ease;
}

.plan-card:hover .plan-card-deco {
  opacity: 1;
  transform: scale(1.04);
}

/* ── Basic: clean architectural blueprint
   subtle grid + a faint building outline floating in the top-right corner ── */
.plan-card.tier-basic .plan-card-deco {
  background-image:
    /* tiny grid */
    linear-gradient(to right, color-mix(in srgb, var(--text-muted), transparent 92%) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--text-muted), transparent 92%) 1px, transparent 1px),
    /* corner building icon */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='none' stroke='%23c4a882' stroke-width='1.2' opacity='0.22'><rect x='40' y='70' width='40' height='90' rx='2'/><rect x='90' y='40' width='50' height='120' rx='2'/><rect x='150' y='90' width='30' height='70' rx='2'/><line x1='50' y1='90' x2='70' y2='90'/><line x1='50' y1='110' x2='70' y2='110'/><line x1='50' y1='130' x2='70' y2='130'/><line x1='100' y1='60' x2='130' y2='60'/><line x1='100' y1='85' x2='130' y2='85'/><line x1='100' y1='110' x2='130' y2='110'/><line x1='100' y1='135' x2='130' y2='135'/><line x1='160' y1='110' x2='170' y2='110'/><line x1='160' y1='130' x2='170' y2='130'/></g></svg>");
  background-size: 24px 24px, 24px 24px, 220px 220px;
  background-position: 0 0, 0 0, calc(100% + 30px) calc(100% + 20px);
  background-repeat: repeat, repeat, no-repeat;
  -webkit-mask-image: linear-gradient(135deg, transparent 30%, #000 100%);
  mask-image: linear-gradient(135deg, transparent 30%, #000 100%);
}

/* ── Pro: dynamic motion
   diagonal accent waves + rising rocket trail emblem ── */
.plan-card.tier-pro .plan-card-deco {
  background-image:
    /* radial accent glow top-right */
    radial-gradient(60% 60% at 100% 0%, color-mix(in srgb, var(--accent), transparent 70%) 0%, transparent 60%),
    /* diagonal stripes */
    repeating-linear-gradient(135deg, color-mix(in srgb, var(--accent), transparent 92%) 0 2px, transparent 2px 14px),
    /* rocket trail emblem bottom-right */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='none' opacity='0.35'><path d='M30 170 Q90 110 160 60' stroke='%23c4a882' stroke-width='1.4' stroke-linecap='round'/><path d='M40 175 Q100 120 165 70' stroke='%23c4a882' stroke-width='0.9' stroke-linecap='round' opacity='0.6'/><circle cx='160' cy='60' r='3.2' fill='%23c4a882'/><circle cx='150' cy='75' r='1.8' fill='%23c4a882' opacity='0.7'/><circle cx='135' cy='90' r='1.2' fill='%23c4a882' opacity='0.5'/></g></svg>");
  background-size: 100% 100%, auto, 240px 240px;
  background-position: 0 0, 0 0, calc(100% + 20px) calc(100% + 15px);
  background-repeat: no-repeat, repeat, no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 35%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 35%);
}

/* ── Pro+: premium emblem
   radiating rays + ornate diamond/crown emblem ── */
.plan-card.tier-pro-plus .plan-card-deco {
  background-image:
    /* twin radial glows */
    radial-gradient(70% 70% at 100% 0%, color-mix(in srgb, var(--accent), transparent 60%) 0%, transparent 65%),
    radial-gradient(50% 50% at 0% 100%, color-mix(in srgb, var(--primary), transparent 80%) 0%, transparent 65%),
    /* ornate emblem bottom-right */
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><g fill='none' stroke='%23c4a882' stroke-width='1.1' opacity='0.32' stroke-linecap='round' stroke-linejoin='round'><g transform='translate(140 140)'><circle r='44' opacity='0.45'/><circle r='34' opacity='0.6'/><circle r='24' opacity='0.8'/><polygon points='0,-24 7,-8 24,-8 11,4 16,22 0,12 -16,22 -11,4 -24,-8 -7,-8' fill='%23c4a882' opacity='0.5'/><g><line x1='0' y1='-46' x2='0' y2='-58'/><line x1='32' y1='-32' x2='41' y2='-41'/><line x1='46' y1='0' x2='58' y2='0'/><line x1='32' y1='32' x2='41' y2='41'/><line x1='0' y1='46' x2='0' y2='58'/><line x1='-32' y1='32' x2='-41' y2='41'/><line x1='-46' y1='0' x2='-58' y2='0'/><line x1='-32' y1='-32' x2='-41' y2='-41'/></g></g></g></svg>");
  background-size: 100% 100%, 100% 100%, 280px 280px;
  background-position: 0 0, 0 0, calc(100% + 30px) calc(100% + 30px);
  background-repeat: no-repeat, no-repeat, no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 25%);
  mask-image: linear-gradient(180deg, transparent 0%, #000 25%);
}

/* Boost contrast slightly on the featured card */
.plan-card.featured .plan-card-deco { opacity: 1; }

.plan-card-current {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--primary), transparent 82%);
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary), transparent 60%);
}

.plan-card-current .fa-solid {
  font-size: 0.7rem;
}

.plan-card-head h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.plan-card-price {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  margin-top: 0.2rem;
}

.plan-card-amt {
  font-size: 2.1rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
}

.plan-card-price .cur {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.plan-card-price .per {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-left: 0.15rem;
}

.plan-card-divider {
  height: 1px;
  background: var(--stroke);
  margin: 0.4rem -0.2rem 0.2rem;
}

.plan-card-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}

.plan-card-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  color: var(--text-soft);
  font-size: 0.9rem;
  line-height: 1.4;
}

.plan-card-features li i {
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent), transparent 88%);
  color: var(--accent);
  font-size: 0.78rem;
}

.plan-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease, border-color 0.15s ease;
}

.plan-cta .fa-solid {
  font-size: 0.78rem;
  transition: transform 0.15s ease;
}

.plan-cta:hover .fa-solid {
  transform: translateX(3px);
}

.plan-cta.is-default {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--stroke);
}

.plan-cta.is-default:hover {
  background: var(--surface-3);
  border-color: var(--stroke-strong);
}

.plan-cta.is-featured {
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: var(--accent-onfill);
}

.plan-cta.is-featured:hover {
  filter: brightness(1.06);
}

.plan-cta.is-current {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--stroke);
  cursor: not-allowed;
}

.plan-cta:active { transform: translateY(1px); }

/* Payment history */
.pay-history {
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 1.4rem;
}

.pay-history-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.pay-history-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.pay-history-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 22px;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pay-history-list {
  display: flex;
  flex-direction: column;
}

.pay-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0.2rem;
  border-bottom: 1px solid var(--stroke);
}

.pay-row:last-child {
  border-bottom: 0;
}

.pay-row-ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 12px;
  font-size: 1rem;
  flex-shrink: 0;
}

.pay-row.ok .pay-row-ic {
  background: color-mix(in srgb, var(--primary), transparent 84%);
  color: var(--primary);
}

.pay-row.fail .pay-row-ic {
  background: color-mix(in srgb, var(--danger), transparent 84%);
  color: var(--danger);
}

.pay-row-main {
  min-width: 0;
}

.pay-row-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pay-row-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pay-row-meta {
  text-align: right;
  white-space: nowrap;
}

.pay-row-amount {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.005em;
}

.pay-row-amount .cur {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 0.15rem;
}

.pay-row-date {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
  font-variant-numeric: tabular-nums;
}

.pay-row-status {
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.pay-row-status.ok {
  background: color-mix(in srgb, var(--primary), transparent 82%);
  color: var(--primary);
}

.pay-row-status.fail {
  background: color-mix(in srgb, var(--danger), transparent 82%);
  color: var(--danger);
}

.pay-history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.pay-history-empty .fa-regular {
  font-size: 2rem;
  opacity: 0.4;
}

@media (max-width: 720px) {
  .pay-row {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    row-gap: 0.5rem;
  }
  .pay-row-meta {
    grid-column: 1 / -1;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .pay-row-status {
    grid-column: 1 / -1;
    align-self: flex-start;
  }
  .pay-row-date {
    margin-top: 0;
  }
}

.lang-picker {
  display: inline-flex;
  gap: 4px;
  margin-bottom: 0.6rem;
}
.lang-picker .lang-btn {
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--text-muted);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
}
.lang-picker .lang-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.my-card-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.my-card-head {
  align-items: flex-start;
}
.my-section {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--stroke);
}
.my-section h4 {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.video-uploader,
.doc-uploader {
  border: 1px dashed var(--stroke);
  border-radius: 10px;
  padding: 0.7rem;
  text-align: center;
  cursor: pointer;
  position: relative;
  background: var(--surface-2);
  margin-top: 0.4rem;
}
.video-uploader input[type='file'],
.doc-uploader input[type='file'] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.video-uploader.drag,
.doc-uploader.drag {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent), transparent 92%);
}
.doc-uploader .doc-title {
  display: block;
  width: 100%;
  margin-bottom: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 6px;
  padding: 0.35rem 0.55rem;
  color: var(--text);
}
.doc-uploader .upload-progress,
.video-uploader .upload-progress {
  margin-top: 0.4rem;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.video-list {
  display: grid;
  gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.video-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.video-item video {
  width: 100%;
  height: auto;
  max-height: 220px;
  border-radius: 10px;
  background: #000;
}

.doc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}
.doc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  font-size: 0.88rem;
}
.doc-item a {
  color: var(--text);
  text-decoration: none;
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-add {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) auto;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
.cal-add input {
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  color: var(--text);
}
.cal-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.3rem;
}
.cal-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.4rem 0.55rem;
  background: var(--surface-2);
  border-radius: 8px;
  font-size: 0.85rem;
}

.rental-calendar-public {
  margin-top: 1rem;
}
/* ============================================================
   Rental calendar & reviews — elegant, modern restyle
   ============================================================ */

/* Months laid out as cards in a responsive grid */
.cal-months {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 0.4rem;
}
.cal-month-grid {
  padding: 1.1rem 1.2rem 1.2rem;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
}
.cal-month-title {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-transform: capitalize;
  color: var(--text);
  margin-bottom: 0.7rem;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1 / 1;
  border-radius: 9px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
  position: relative;
  transition: background 0.12s ease, color 0.12s ease;
}
/* free days get a faint fill so the grid reads as a surface */
.cal-cell:not(.weekday):not(.empty):not(.booked) {
  background: var(--surface);
  border: 1px solid var(--stroke);
}
.cal-cell.empty {
  background: transparent;
  border: 0;
}
.cal-cell.booked {
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: var(--accent-onfill);
  font-weight: 700;
  border: 0;
}
.cal-cell.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  color: var(--accent);
  font-weight: 700;
}
.cal-cell.today.booked {
  outline-color: var(--accent-onfill);
  color: var(--accent-onfill);
}
.cal-cell.weekday {
  font-size: 0.66rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  font-weight: 600;
  text-transform: uppercase;
}

.cal-legend {
  display: flex;
  gap: 1.2rem;
  margin: 1.1rem 0 0.3rem;
  font-size: 0.84rem;
  color: var(--text-soft);
  flex-wrap: wrap;
}
.cal-legend .lg {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.cal-legend .swatch {
  width: 16px;
  height: 16px;
  border-radius: 5px;
}
.cal-legend .sw-free { background: var(--surface); border: 1px solid var(--stroke); }
.cal-legend .sw-booked { background: linear-gradient(160deg, var(--accent), var(--accent-2)); }
.cal-legend .sw-today { background: var(--surface); border: 2px solid var(--accent); }

/* Stat cards (rentals / days / last) */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.8rem;
  margin: 0 0 1.3rem;
}
.kpi-card {
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 0.95rem 1.1rem;
}
.kpi-card .lbl {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.kpi-card .val {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.kpi-card .val.small { font-size: 1rem; }

/* ===== Reviews ===== */
.reviews-summary {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 1.2rem 1.3rem;
  border-radius: 16px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  margin-bottom: 1.2rem;
}
.reviews-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding-right: 1.4rem;
  border-right: 1px solid var(--stroke);
}
.reviews-score-num {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--text);
}
.reviews-score-stars {
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 1px;
}
.reviews-score-count {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.reviews-summary-note {
  font-size: 0.92rem;
  color: var(--text-soft);
  line-height: 1.5;
}

.reviews-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.review-card {
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 14px;
  padding: 1rem 1.1rem;
}
.review-card .review-head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.55rem;
}
.review-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: linear-gradient(160deg, var(--accent), var(--accent-2));
  color: var(--accent-onfill);
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}
.review-author {
  display: flex;
  flex-direction: column;
  min-width: 0;
  flex: 1;
}
.review-author strong {
  font-size: 0.95rem;
  font-weight: 600;
}
.review-author .review-dates {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.review-card .review-body {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text-soft);
}
.review-stay {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.75rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
}
.review-stay .fa-regular,
.review-stay .fa-solid {
  color: var(--accent);
  font-size: 0.82rem;
}
.stars {
  color: var(--accent);
  letter-spacing: 1px;
}
.stars.input { cursor: pointer; font-size: 1.1rem; display: inline-flex; gap: 0.2rem; }
.stars.input span { cursor: pointer; transition: transform 0.12s ease; }
.stars.input span:hover { transform: scale(1.18); }

/* Compact review form */
.review-form {
  margin-top: 1.2rem;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.review-form-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.review-form-top h4 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
}
.review-form-text {
  width: 100%;
  min-height: 2.6rem;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  border: 1px solid var(--stroke);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  resize: vertical;
}
.review-form-text:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent), transparent 35%);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.review-form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.review-form-dates {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.review-form-dates input[type='date'] {
  width: auto;
  padding: 0.45rem 0.6rem;
  border-radius: 9px;
  font-size: 0.82rem;
  color-scheme: dark;
}
.review-form-dates .rdash {
  color: var(--text-muted);
}
.review-form-foot .btn.primary {
  padding: 0.5rem 1.1rem;
  margin-left: auto;
}

.detail-tabs {
  display: flex;
  gap: 0.4rem;
  margin: 1.4rem 0 1rem;
  border-bottom: 1px solid var(--stroke);
  overflow-x: auto;
}
.detail-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: 0;
  padding: 0.7rem 1rem;
  color: var(--text-muted);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.92rem;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s ease;
}
.detail-tab:hover {
  color: var(--text);
}
.detail-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.detail-tab .fa-solid {
  font-size: 0.88rem;
}

/* Make all three tabs fit on a narrow phone screen without horizontal scroll */
@media (max-width: 560px) {
  .detail-tabs {
    gap: 0;
  }
  .detail-tab {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    gap: 0.25rem;
    padding: 0.55rem 0.2rem;
    font-size: 0.72rem;
    letter-spacing: -0.01em;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .detail-tab .fa-solid {
    font-size: 0.7rem;
    flex-shrink: 0;
  }
}

/* Tab-panel cards adopt the rounded card look */
.detail-tabpanel .section-card {
  border-radius: 16px;
  padding: 1.4rem;
}
.detail-tabpanel .section-card + .section-card {
  margin-top: 1rem;
}
.detail-tabpanel .section-card > h3:first-child {
  margin-top: 0;
}

.adv-filters {
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  border-radius: 10px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
}
.adv-filters summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  list-style: none;
}
.adv-filters summary::before {
  content: '▸';
  margin-right: 0.4rem;
  display: inline-block;
  transition: transform 200ms;
}
.adv-filters[open] summary::before { transform: rotate(90deg); }
.adv-filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.adv-filters-grid label {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.2rem;
}
.adv-filters-grid input,
.adv-filters-grid select {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--stroke);
  border-radius: 8px;
  padding: 0.4rem 0.55rem;
  color: var(--text);
}
.adv-filters-grid .check-row {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.85rem;
}

.chess-plan-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.chess-plan-thumb {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  background: var(--surface-2);
  border: 1px solid var(--stroke);
  color: var(--text-muted);
  font-size: 0.65rem;
  text-align: center;
  line-height: 22px;
  margin-left: 4px;
  cursor: pointer;
}
.chess-plan-thumb.has-plan {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.chess-plan-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 0.6rem 0;
}
.lot-plan {
  margin: 0.6rem 0;
}

/* Lot sheet — themable bottom-sheet modal.
   Palette is bound to the app's own tokens (warm brown --accent, deep green
   --primary, warm neutrals) so the modal always feels like part of the app. */
.lot-sheet {
  --ls-surface: var(--surface);
  --ls-surface-2: var(--surface-2);
  --ls-text: var(--text);
  --ls-text-muted: var(--text-muted);
  --ls-text-soft: var(--text-soft);
  --ls-stroke: var(--stroke);
  --ls-stroke-strong: var(--stroke-strong);
  --ls-handle: var(--stroke-strong);
  --ls-shadow-plan: var(--shadow-card);
  --ls-cta: var(--accent);
  --ls-cta-hover: var(--accent-2);
  --ls-cta-ink: var(--accent-onfill);
  --ls-cta-shadow: 0 10px 22px -10px color-mix(in srgb, var(--accent), transparent 40%);
  --ls-link: var(--accent);
  --ls-active: var(--danger);
  --ls-active-border: color-mix(in srgb, var(--danger), #000 12%);
  --ls-active-ring: color-mix(in srgb, var(--danger), transparent 72%);
  --ls-cell-free-bg: var(--primary-soft);
  --ls-cell-free-bd: color-mix(in srgb, var(--primary), transparent 55%);
  --ls-cell-hold-bg: var(--warning-soft);
  --ls-cell-hold-bd: color-mix(in srgb, var(--warning), transparent 55%);
  --ls-cell-booked-bg: var(--info-soft);
  --ls-cell-booked-bd: color-mix(in srgb, var(--info), transparent 55%);
  --ls-cell-sold-bg: color-mix(in srgb, var(--text-muted), transparent 80%);
  --ls-cell-sold-bd: color-mix(in srgb, var(--text-muted), transparent 60%);
  --ls-cell-bg: var(--surface);
  --ls-cell-bd: var(--stroke);
  --ls-notch: var(--backdrop);
}

/* The whole modal card behaves like a bottom-sheet, with the plan
   visually popping out of the top edge. */
.modal-card.lot-sheet {
  max-width: 440px;
  width: calc(100% - 32px);
  padding: 0;
  overflow: visible;          /* let the plan card peek above the sheet */
  background: transparent;
  border: 0;
  box-shadow: none;
}

.modal-card.lot-sheet .modal-x {
  display: none;
}

/* Floating plan card — centered inside the (now larger) ticket body,
   sits at the top with a clear gap before the brand bar. */
.lot-sheet-plan-card {
  position: relative;
  z-index: 2;
  width: 210px;
  height: 210px;
  margin: 24px auto 18px;
  background: var(--ls-surface);
  border-radius: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-shadow: var(--ls-shadow-plan);
}

.lot-sheet-plan-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.lot-sheet-plan-card .lot-sheet-plan-ph {
  width: 100%;
  height: 100%;
  color: var(--ls-text-muted);
  opacity: 0.7;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lot-sheet-plan-card .lot-sheet-plan-ph svg {
  width: 88%;
  height: auto;
  display: block;
}

/* The body itself — themable "ticket" card. Plan now sits inside the body
   at the top (no overflow), so no extra margins are needed. */
.modal-card.lot-sheet .lot-sheet {
  position: relative;
  background: var(--ls-surface);
  color: var(--ls-text);
  border-radius: 22px;
  overflow: hidden;
  padding-top: 0;
  background-image:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent), transparent 90%), transparent 55%),
    radial-gradient(circle at -10% 110%, color-mix(in srgb, var(--primary), transparent 92%), transparent 50%);
}

.lot-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--ls-handle);
  margin: 12px auto 0;
  cursor: pointer;
  opacity: 0.7;
}

.lot-sheet-body {
  padding: 0.6rem 1.4rem 1.3rem;
  text-align: center;
  position: relative;
}

/* Brand strip — small mark + uppercase tracking + unit id, like a ticket header */
.lot-ticket-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.55rem;
  padding: 0 0.1rem;
}

.lot-ticket-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--ls-text);
  color: var(--ls-surface);
  font-weight: 800;
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.lot-ticket-brandtxt {
  flex: 1;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--ls-text-soft);
  text-transform: uppercase;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.lot-ticket-id {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ls-text);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.lot-ticket-rule {
  height: 1px;
  margin: 0 -0.2rem 0.85rem;
  background: linear-gradient(to right, transparent, var(--ls-stroke) 14%, var(--ls-stroke) 86%, transparent);
}

.lot-ticket-price-wrap {
  margin-bottom: 0.85rem;
}

.lot-sheet-price {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.35rem;
  color: var(--ls-text);
  font-variant-numeric: tabular-nums;
}

.lot-sheet-price em {
  font-style: normal;
  font-weight: 600;
  font-size: 0.72em;
  color: var(--ls-text-muted);
  letter-spacing: 0.06em;
  margin-left: 0.18em;
}

.lot-sheet-meta {
  font-size: 0.82rem;
  color: var(--ls-text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.lot-sheet-status {
  margin: 0 0 0.4rem;
}

/* Diagonal stamp for status — uses the legend color via --stamp-c */
.lot-stamp {
  display: inline-block;
  position: relative;
  padding: 0.4rem 1.1rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--stamp-c, var(--ls-text));
  border: 2px solid var(--stamp-c, var(--ls-stroke));
  border-radius: 6px;
  transform: rotate(-4deg);
  background: color-mix(in srgb, var(--stamp-c, var(--ls-text)), transparent 92%);
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.lot-stamp::before,
.lot-stamp::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.lot-stamp::before { top: -4px; }
.lot-stamp::after { bottom: -4px; }

/* Perforated dotted line — the ticket tear line */
.lot-ticket-dots {
  position: relative;
  height: 18px;
  margin: 0.5rem -1.4rem 0.6rem;
}

.lot-ticket-dots::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 24px;
  right: 24px;
  height: 0;
  border-top: 2px dotted var(--ls-stroke-strong);
  transform: translateY(-50%);
}

/* Side notches — render as circles cut out of the ticket by overlapping
   with the modal backdrop. We use the modal backdrop tone for the "hole". */
.lot-ticket-dots::after {
  content: "";
  position: absolute;
  left: -9px;
  right: -9px;
  top: 50%;
  height: 18px;
  transform: translateY(-50%);
  background:
    radial-gradient(circle at 9px 50%, var(--ls-notch, rgba(0,0,0,0.55)) 8.5px, transparent 9.5px) left center / 18px 18px no-repeat,
    radial-gradient(circle at calc(100% - 9px) 50%, var(--ls-notch, rgba(0,0,0,0.55)) 8.5px, transparent 9.5px) right center / 18px 18px no-repeat;
  pointer-events: none;
}

.lot-sheet-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
  margin: 0 0 1rem;
  padding: 0.5rem 0;
  position: relative;
}

.lot-sheet-trio::before,
.lot-sheet-trio::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  height: 1px;
  background: var(--ls-stroke);
}
.lot-sheet-trio::before { top: 0; }
.lot-sheet-trio::after { bottom: 0; }

.lot-sheet-stat {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: center;
  position: relative;
}

.lot-sheet-stat + .lot-sheet-stat::before {
  content: "";
  position: absolute;
  left: 0;
  top: 18%;
  bottom: 18%;
  width: 1px;
  background: var(--ls-stroke);
}

.lot-sheet-stat span {
  font-size: 0.58rem;
  color: var(--ls-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.lot-sheet-stat strong {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--ls-text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* Floor section — labelled wrapper + SVG silhouette of the floor */
.lot-ticket-floor {
  margin: 0 0 1rem;
}

.lot-ticket-floor-label {
  font-size: 0.58rem;
  color: var(--ls-text-soft);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 700;
  margin-bottom: 0.45rem;
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

.lot-sheet-floor-map {
  margin: 0 auto;
  max-width: 320px;
  padding: 0.6rem 0.7rem;
  border-radius: 14px;
  background: var(--ls-surface-2);
  border: 1px solid var(--ls-stroke);
  color: var(--ls-text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lot-sheet-floor-map svg {
  width: 100%;
  height: auto;
  display: block;
}


.lot-sheet-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.lot-sheet-actions .btn.primary {
  flex: 1;
  min-width: 140px;
  background: var(--ls-cta);
  border: 1px solid var(--ls-cta);
  color: var(--ls-cta-ink);
  font-weight: 600;
  padding: 0.7rem 1rem;
  border-radius: 12px;
  box-shadow: var(--ls-cta-shadow);
}

.lot-sheet-actions .btn.primary:hover {
  background: var(--ls-cta-hover);
  border-color: var(--ls-cta-hover);
}

.lot-sheet-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ls-link);
  text-decoration: none;
  white-space: nowrap;
}

.lot-sheet-link:hover {
  text-decoration: underline;
}

.lot-sheet-edit {
  margin-top: 0.95rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--ls-stroke-strong);
  justify-content: center;
}

.lot-sheet-edit .btn {
  color: var(--ls-text-muted);
  border-color: var(--ls-stroke-strong);
  background: var(--ls-surface);
}

.lot-sheet-edit .btn:hover {
  background: var(--ls-surface-2);
  color: var(--ls-text);
}

.chess-lot.is-selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
  z-index: 3;
  transform: scale(1.08);
}

.lot-sold-badge {
  position: absolute;
  top: 3px;
  right: 3px;
  font-size: 0.48rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--danger, #b44);
  background: color-mix(in srgb, var(--danger, #b44), transparent 88%);
  padding: 1px 4px;
  border-radius: 2px;
  line-height: 1.3;
}

.chess-lot.status-SOLD .lot-area {
  opacity: 0.55;
}

.toolbar-adv {
  margin-top: 0.6rem;
  border-top: 1px dashed var(--stroke);
  padding-top: 0.6rem;
}
.toolbar-adv summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  list-style: none;
  padding: 0.3rem 0;
}
.toolbar-adv summary::before {
  content: '▸';
  margin-right: 0.4rem;
  display: inline-block;
  transition: transform 200ms;
}
.toolbar-adv[open] summary::before { transform: rotate(90deg); }
.toolbar-flags {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  align-items: center;
  padding: 0.4rem 0 0.2rem;
}
.toolbar-flags .flag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
}
.toolbar-flags .flag input {
  accent-color: var(--accent);
}

.btn.danger-inline {
  color: var(--danger, #ef4444);
  border-color: var(--danger, #ef4444);
}

