/* ==========================================================================
   NhaTot Telegram WebApp — Modern Responsive UI (Dark & Light Themes)
   ========================================================================== */

:root,
html[data-theme="dark"] {
  --bg-primary: #0b1120;
  --bg-secondary: #131c31;
  --bg-card: #172138;
  --bg-card-hover: #1d2945;
  --bg-elevated: #223052;
  --bg-input: #0f172a;
  --bg-glass: rgba(19, 28, 49, 0.88);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border-color: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);

  --accent-primary: #ff7a00;
  --accent-primary-hover: #ff8f26;
  --accent-primary-soft: rgba(255, 122, 0, 0.16);

  --accent-blue: #38bdf8;
  --accent-blue-soft: rgba(56, 189, 248, 0.15);

  --accent-green: #10b981;
  --accent-green-soft: rgba(16, 185, 129, 0.16);

  --accent-amber: #f59e0b;
  --accent-amber-soft: rgba(245, 158, 11, 0.18);
  --accent-amber-border: rgba(245, 158, 11, 0.65);

  --accent-danger: #ef4444;
  --accent-danger-soft: rgba(239, 68, 68, 0.15);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 18px 42px rgba(0, 0, 0, 0.55);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
}

html[data-theme="light"] {
  --bg-primary: #f1f5f9;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-elevated: #e2e8f0;
  --bg-input: #f8fafc;
  --bg-glass: rgba(255, 255, 255, 0.92);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border-color: rgba(15, 23, 42, 0.1);
  --border-strong: rgba(15, 23, 42, 0.2);

  --accent-primary: #ea580c;
  --accent-primary-hover: #c2410c;
  --accent-primary-soft: rgba(234, 88, 12, 0.12);

  --accent-blue: #0284c7;
  --accent-blue-soft: rgba(2, 132, 199, 0.11);

  --accent-green: #059669;
  --accent-green-soft: rgba(5, 150, 105, 0.12);

  --accent-amber: #d97706;
  --accent-amber-soft: rgba(217, 119, 6, 0.13);
  --accent-amber-border: rgba(217, 119, 6, 0.65);

  --accent-danger: #dc2626;
  --accent-danger-soft: rgba(220, 38, 38, 0.12);

  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.18);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

button,
input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

/* App Shell */
.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

/* ==========================================================================
   Sticky Top Header & Navigation Tabs
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 14px 0;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff7a00, #f59e0b);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(255, 122, 0, 0.3);
  flex-shrink: 0;
}

.brand-text {
  min-width: 0;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-title-short {
  display: none;
}

.brand-subtitle {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
}

.icon-btn:active {
  transform: scale(0.94);
}

/* 3-Mode Theme Switcher (Auto / Light / Dark) */
.theme-mode-group {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  gap: 2px;
}

.theme-mode-btn {
  height: 30px;
  padding: 0 9px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.theme-mode-btn:hover {
  color: var(--text-primary);
}

.theme-mode-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(255, 122, 0, 0.3);
}

/* Main Navigation Tabs */
.nav-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.nav-tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2.5px solid transparent;
  transition: all 0.18s ease;
  white-space: nowrap;
  min-width: 0;
}

.tab-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--text-primary);
}

.nav-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 19px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Compact mobile header: prevent tabs and theme controls from overflowing */
@media (max-width: 520px) {
  .app-header {
    padding: 8px 10px 0;
  }

  .header-top {
    gap: 8px;
    padding-bottom: 8px;
  }

  .brand-wrap {
    gap: 8px;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    font-size: 17px;
  }

  .brand-title {
    font-size: 14px;
  }

  .brand-title-full {
    display: none;
  }

  .brand-title-short {
    display: inline;
  }

  .brand-subtitle {
    display: none;
  }

  .header-actions {
    gap: 5px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
    font-size: 14px;
  }

  .theme-mode-group {
    padding: 2px;
    gap: 1px;
    border-radius: 8px;
  }

  .theme-mode-btn {
    height: 28px;
    padding: 0 6px;
    font-size: 11px;
    border-radius: 6px;
    gap: 2px;
  }

  .theme-mode-btn[data-theme-mode="auto"] span {
    font-size: 0;
  }

  .theme-mode-btn[data-theme-mode="auto"] span::after {
    content: "А";
    font-size: 11px;
  }

  .nav-tabs {
    gap: 2px;
  }

  .nav-tab {
    padding: 8px 2px;
    font-size: 11.5px;
    gap: 3px;
  }

  .tab-badge {
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 9.5px;
  }
}

@media (max-width: 360px) {
  .brand-title {
    font-size: 13px;
  }

  .theme-mode-btn {
    padding: 0 4px;
  }

  .nav-tab {
    font-size: 10.5px;
    gap: 2px;
  }
}

.nav-tab.active .tab-badge {
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
}

/* Main container & Tab panels */
.app-main {
  padding: 14px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Filter Card
   ========================================================================== */
.filter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
}

.filter-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(180deg, rgba(255, 122, 0, 0.05), transparent);
}

.filter-header-left {
  flex: 1;
  min-width: 0;
}

.filter-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.filter-title-icon {
  font-size: 16px;
}

.filter-title-text {
  font-size: 14.5px;
  font-weight: 700;
}

.filter-active-indicator {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.filter-summary-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-input);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.summary-pill.highlight {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border-color: var(--accent-amber-border);
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.filter-card-body {
  padding: 4px 15px 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filter-card.collapsed .filter-card-body {
  display: none;
}

.filter-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 640px) {
  .filter-grid-2 {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.form-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

.label-hint {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-primary);
}

/* Inputs & Selects */
.select-wrap {
  position: relative;
}

.form-select,
.form-input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-select:focus,
.form-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.budget-inputs-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-sep {
  color: var(--text-muted);
  font-weight: 600;
}

.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  height: 40px;
  padding: 0 10px;
}

.input-with-unit:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-primary-soft);
}

.input-prefix {
  font-size: 12px;
  color: var(--text-muted);
  margin-right: 6px;
  font-weight: 600;
}

.input-suffix {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: 6px;
  font-weight: 600;
}

.input-with-unit .form-input {
  border: none;
  background: transparent;
  height: 100%;
  padding: 0;
  box-shadow: none !important;
}

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

.size-input-box {
  max-width: 140px;
  flex: 0 0 140px;
}

/* Search Keyword Input */
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input-icon {
  position: absolute;
  left: 11px;
  font-size: 14px;
  pointer-events: none;
}

.form-input.has-icon {
  padding-left: 34px;
  padding-right: 34px;
}

.input-clear-btn {
  position: absolute;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Chips */
.chips-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

.chip.active {
  background: var(--accent-primary-soft);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.chip-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.project-tags-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.project-tags-label {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 600;
}

.chip-tag {
  padding: 4px 9px;
  font-size: 11.5px;
  border-radius: 999px;
}

/* Smart Toggles Grid */
.apt-types-details {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  overflow: hidden;
}

.apt-types-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
}

.apt-types-summary::-webkit-details-marker {
  display: none;
}

.apt-types-title {
  font-weight: 700;
}

.apt-types-value {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apt-types-arrow {
  color: var(--text-muted);
  transition: transform 0.18s ease;
}

.apt-types-details[open] .apt-types-arrow {
  transform: rotate(180deg);
}

.apt-types-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--border-color);
}

@media (max-width: 560px) {
  .apt-types-panel {
    grid-template-columns: 1fr;
  }
}

.apt-type-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  font-size: 12.5px;
  line-height: 1.25;
}

.apt-type-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-primary);
  flex-shrink: 0;
}

.apt-type-option.is-checked {
  border-color: var(--accent-primary);
  background: var(--accent-primary-soft);
}

.apt-types-clear {
  grid-column: 1 / -1;
  justify-self: start;
  margin-top: 2px;
  padding: 6px 10px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 12px;
}

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

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

.toggle-chip {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  text-align: left;
  transition: all 0.16s ease;
}

.toggle-chip-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.toggle-chip-text {
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.toggle-chip-check {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: transparent;
  transition: all 0.15s ease;
}

.toggle-chip.active {
  background: var(--accent-primary-soft);
  border-color: var(--accent-primary);
}

.toggle-chip.active .toggle-chip-text {
  color: var(--text-primary);
}

.toggle-chip.active .toggle-chip-check {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.toggle-chip.active .toggle-chip-check::after {
  content: "✓";
  font-weight: 800;
}

/* Filter Action Buttons */
.filter-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 42px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #ff7a00, #ea580c);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.35);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff8c1a, #f97316);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--accent-primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: var(--bg-input);
}

.btn-danger {
  background: var(--accent-danger-soft);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn-search-main {
  flex: 1 1 200px;
}

/* ==========================================================================
   Results Toolbar & Short-Term Top Highlight Banner
   ========================================================================== */
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 0 2px;
}

.results-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.results-count-text {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.results-shortterm-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.btn-link {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-blue);
}

.btn-link:hover {
  text-decoration: underline;
}

.short-term-top-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(234, 88, 12, 0.12));
  border: 1.5px solid var(--accent-amber-border);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.12);
}

.st-banner-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.st-banner-title {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--accent-amber);
}

.st-banner-desc {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ==========================================================================
   Listings Responsive Grid & Ad Cards
   ========================================================================== */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 980px) {
  .listings-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.listing-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.listing-card-simple {
  padding: 14px 16px;
  gap: 6px;
  border-left: 4px solid var(--accent-primary);
}

.simple-card-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.simple-card-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--accent-primary);
}

.simple-card-meta {
  font-size: 12px;
  color: var(--text-secondary);
}

.listing-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.listing-card.is-short-term {
  border: 1.5px solid var(--accent-amber-border);
  box-shadow: inset 3px 0 0 var(--accent-amber), 0 4px 18px rgba(245, 158, 11, 0.14);
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.06), transparent 42%), var(--bg-card);
}

.listing-card.is-inactive {
  filter: grayscale(1);
  opacity: 0.55;
  border-style: dashed;
}

.card-checked {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.badge-inactive {
  background: var(--accent-danger-soft);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.badge-price-changed {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.card-old-price {
  font-size: 11.5px;
  color: var(--text-muted);
  text-decoration: line-through;
}

.card-short-ribbon {
  background: linear-gradient(90deg, #f59e0b, #ea580c);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 12px;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: var(--bg-input);
  overflow: hidden;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.listing-card:hover .card-img {
  transform: scale(1.03);
}

.card-price-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 5px 10px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.card-date-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.78);
  color: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
}

.card-fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  backdrop-filter: none;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(148, 163, 184, 0.85);
  z-index: 3;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.85));
  transition: transform 0.16s ease, color 0.16s ease, filter 0.16s ease;
}

.card-fav-btn svg {
  width: 24px;
  height: 24px;
  display: block;
}

.card-fav-btn:hover {
  transform: scale(1.12);
  background: transparent;
  color: rgba(226, 232, 240, 0.95);
}

.card-fav-btn.active {
  color: #fbbf24;
  background: transparent;
  border: none;
  box-shadow: none;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.75));
}

.card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.badge-shortterm {
  background: var(--accent-amber-soft);
  color: var(--accent-amber);
  border: 1px solid var(--accent-amber-border);
}

.badge-officetel {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(129, 140, 248, 0.35);
}

html[data-theme="light"] .badge-officetel {
  background: rgba(79, 70, 229, 0.1);
  color: #4338ca;
  border-color: rgba(79, 70, 229, 0.3);
}

.badge-pool {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.badge-gym {
  background: rgba(168, 85, 247, 0.16);
  color: #c084fc;
}

html[data-theme="light"] .badge-gym {
  background: rgba(147, 51, 234, 0.12);
  color: #7e22ce;
}

.badge-new {
  background: rgba(20, 184, 166, 0.18);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.35);
}

html[data-theme="light"] .badge-new {
  background: rgba(13, 148, 136, 0.12);
  color: #0f766e;
  border-color: rgba(13, 148, 136, 0.35);
}

.guest-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: var(--radius-md);
  background: var(--accent-amber-soft);
  border: 1px solid var(--accent-amber-border);
  color: var(--accent-amber);
  font-size: 12.5px;
  line-height: 1.4;
}

.guest-banner-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.guest-banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.badge-owner {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.badge-agent {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.card-title-ru {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-title-vi {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.spec-pill {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-location {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-project {
  font-weight: 700;
  color: var(--accent-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-area {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Pagination Bar
   ========================================================================== */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.pagination-info {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
}

.pagination-btn {
  min-width: 110px;
}

/* ==========================================================================
   Section Headers, Loading & Empty States
   ========================================================================== */
.section-header-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 15px 16px;
  margin-bottom: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.section-title {
  font-size: 16px;
  font-weight: 800;
}

.section-subtitle {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 42px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin: 12px 0;
}

.spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3.5px solid var(--border-strong);
  border-top-color: var(--accent-primary);
  animation: spin 0.75s linear infinite;
  margin-bottom: 14px;
}

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

.loading-title,
.empty-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.loading-subtitle,
.empty-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  max-width: 420px;
  margin-bottom: 14px;
}

.empty-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

/* ==========================================================================
   Subscriptions List
   ========================================================================== */
.subscriptions-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.sub-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.sub-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sub-id-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sub-id-badge {
  font-size: 11.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-secondary);
}

.sub-status-badge {
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
}

.sub-status-badge.active {
  background: var(--accent-green-soft);
  color: var(--accent-green);
}

.sub-status-badge.paused {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}

.sub-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
}

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

.sub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

/* ==========================================================================
   Ad Detail Modal / Drawer
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.18s ease;
}

@media (min-width: 768px) {
  .modal-backdrop {
    align-items: center;
    padding: 20px;
  }
}

.modal-drawer {
  width: 100%;
  max-width: 780px;
  max-height: 93vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

@media (min-width: 768px) {
  .modal-drawer {
    border-radius: var(--radius-xl);
    max-height: 90vh;
  }
}

.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-back-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.modal-close-icon {
  font-size: 16px;
  line-height: 1;
}

.modal-topbar-id {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.modal-fav-top-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.16s ease;
}

.modal-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.modal-share-top-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.16s ease;
}

.modal-share-top-btn:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.modal-share-top-btn:active {
  transform: scale(0.94);
}

/* Compact modal top bar on phones: circular icon-only close, share and favorite */
@media (max-width: 640px) {
  .modal-topbar {
    padding: 8px 10px;
    gap: 6px;
  }

  .modal-back-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    flex-shrink: 0;
  }

  .modal-close-label {
    display: none;
  }

  .modal-topbar-id {
    font-size: 10.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .modal-topbar-actions {
    gap: 6px;
  }

  .modal-share-top-btn,
  .modal-fav-top-btn {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    flex-shrink: 0;
  }

  .modal-share-top-btn {
    color: var(--text-secondary);
  }

  .modal-fav-top-label {
    display: none;
  }

  .modal-fav-top-btn.fav-active {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    border-color: #f59e0b;
    color: #0f172a;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.45);
  }

  .modal-fav-top-btn .fav-svg-wrap svg {
    width: 21px;
    height: 21px;
  }
}

.modal-fav-top-btn svg,
.fav-svg-wrap svg {
  width: 17px;
  height: 17px;
  display: block;
}

.modal-fav-top-btn.fav-active {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  border-color: #f59e0b;
  color: #0f172a;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.45);
}

.modal-body {
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

/* Gallery Carousel */
.gallery-container {
  background: #050811;
  user-select: none;
}

.gallery-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  max-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.gallery-main-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: zoom-in;
}

.gallery-fullscreen-btn {
  position: absolute;
  bottom: 10px;
  left: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(6px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  z-index: 4;
  transition: background 0.15s ease, transform 0.15s ease;
}

.gallery-fullscreen-btn:hover {
  background: rgba(255, 122, 0, 0.9);
  border-color: transparent;
}

.gallery-fullscreen-btn:active {
  transform: scale(0.95);
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.72);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 24px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 4;
}

.gallery-nav-btn.prev {
  left: 10px;
}

.gallery-nav-btn.next {
  right: 10px;
}

.gallery-counter {
  position: absolute;
  bottom: 10px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 12px;
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.95);
}

.gallery-thumb {
  width: 58px;
  height: 44px;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  opacity: 0.55;
  flex-shrink: 0;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gallery-thumb.active {
  border-color: var(--accent-primary);
  opacity: 1;
}

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

/* Modal Content Sections */
.modal-section {
  padding: 15px 16px;
  border-bottom: 1px solid var(--border-color);
}

.modal-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.modal-title-ru {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 4px;
}

.modal-title-vi {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.financial-summary-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
}

.fin-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fin-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  font-weight: 600;
}

.fin-value {
  font-size: 15px;
  font-weight: 800;
}

.fin-value.price-accent {
  color: var(--accent-primary);
  font-size: 16.5px;
}

.modal-section-title {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 10px;
}

/* Structured Specs Grid */
.specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

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

.spec-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.spec-item.full-width {
  grid-column: 1 / -1;
}

.spec-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.spec-val {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: right;
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-phone-btn {
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--accent-primary-soft);
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  font-size: 11px;
  font-weight: 700;
}

.osm-link {
  color: var(--accent-blue);
  text-decoration: underline;
  font-weight: 700;
}

.share-ad-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 12.5px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.share-ad-btn:hover {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: transparent;
}

.share-ad-btn:active {
  transform: scale(0.98);
}

.extra-params-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

@media (max-width: 540px) {
  .extra-params-list {
    grid-template-columns: 1fr;
  }
}

/* Description & Language Toggle */
.desc-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.desc-header-row .modal-section-title {
  margin-bottom: 0;
}

.lang-segmented {
  display: inline-flex;
  padding: 3px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
}

.lang-btn {
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}

.lang-btn.active {
  background: var(--accent-primary);
  color: #ffffff;
}

.listing-description-box {
  padding: 13px;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  font-size: 13.5px;
  line-height: 1.55;
  white-space: pre-line;
  word-break: break-word;
  color: var(--text-primary);
}

/* Sticky Bottom Action Bar in Modal */
.modal-action-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-card);
  border-top: 1px solid var(--border-strong);
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .modal-action-bar {
    gap: 6px;
    padding: 9px 8px calc(9px + env(safe-area-inset-bottom, 0px));
  }

  .action-bar-btn {
    padding: 6px 3px;
    font-size: 10.5px;
  }

  .action-text {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .action-icon {
    font-size: 15px;
  }
}

.action-bar-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 7px 6px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  transition: all 0.15s ease;
}

.action-bar-btn:hover {
  border-color: var(--accent-primary);
}

.action-bar-btn.action-primary {
  background: linear-gradient(135deg, #ff7a00, #ea580c);
  color: #ffffff;
  border-color: transparent;
}

.action-bar-btn.fav-active {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #0f172a;
  border-color: #f59e0b;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.38);
}

.action-icon {
  font-size: 16px;
}

.action-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 92%;
  max-width: 420px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.95);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow-lg);
  font-size: 13px;
  font-weight: 600;
  animation: toastIn 0.22s ease;
}

.toast.toast-success {
  border-left: 4px solid #10b981;
}

.toast.toast-error {
  border-left: 4px solid #ef4444;
}

.toast.toast-info {
  border-left: 4px solid #f59e0b;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Fullscreen Photo Lightbox with Zoom & Pan
   ========================================================================== */
.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(3, 7, 18, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  user-select: none;
  touch-action: none;
  animation: fadeIn 0.16s ease;
}

.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
  background: rgba(15, 23, 42, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  z-index: 10;
  flex-shrink: 0;
}

.lightbox-counter {
  font-size: 13px;
  font-weight: 800;
  color: #f8fafc;
  min-width: 56px;
}

.lightbox-zoom-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.lb-ctrl-btn {
  height: 34px;
  min-width: 36px;
  padding: 0 10px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 16px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.lb-ctrl-btn.lb-zoom-pct {
  font-size: 12px;
  min-width: 58px;
}

.lb-ctrl-btn:active,
.lb-close-btn:active {
  transform: scale(0.94);
}

.lb-close-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #fecaca;
  font-size: 12.5px;
  font-weight: 800;
}

.lightbox-stage {
  position: relative;
  flex: 1;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  cursor: grab;
}

.lightbox-stage.is-dragging {
  cursor: grabbing;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.08s ease-out;
  will-change: transform;
  pointer-events: none;
}

.lightbox-stage.is-dragging .lightbox-img {
  transition: none;
}

.lb-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 8;
}

.lb-nav-btn.prev {
  left: 12px;
}

.lb-nav-btn.next {
  right: 12px;
}

.lightbox-footer {
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(15, 23, 42, 0.9);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
  z-index: 10;
}

.lightbox-hint {
  text-align: center;
  font-size: 11.5px;
  color: #94a3b8;
  font-weight: 600;
}

.lightbox-thumbs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  justify-content: center;
  padding-bottom: 2px;
}
