:root {
  --bg: #070b12;
  --bg-elevated: #0f172a;
  --bg-elevated-soft: #111827;
  --border-subtle: rgba(148, 163, 184, 0.3);
  --accent: #0ea5e9;
  --accent-soft: rgba(56, 189, 248, 0.15);
  --accent-strong: #38bdf8;
  --danger: #f97373;
  --text: #e5e7eb;
  --text-muted: #9ca3af;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.7);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-pill: 999px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #1f2937 0, #020617 45%, #000 100%);
  color: var(--text);
  overflow-x: hidden;
  overflow-y: auto;
  max-width: 100%;
}

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

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  max-width: 100%;
  overflow-x: hidden;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 20px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  backdrop-filter: blur(18px);
  background: linear-gradient(
    to right,
    rgba(15, 23, 42, 0.9),
    rgba(15, 23, 42, 0.7)
  );
}

.auth-panel {
  position: absolute;
  top: 10px;
  right: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-right: 6px;
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  width: min(100%, 860px);
}

.header-search {
  width: min(100%, 620px);
}

.header-search input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(2, 6, 23, 0.95);
  color: var(--text);
  font-size: 0.9rem;
}

.header-search input::placeholder {
  color: rgba(148, 163, 184, 0.78);
}

.brand-title {
  font-weight: 650;
  letter-spacing: 0.03em;
  font-size: 1.3rem;
}

.brand-subtitle {
  display: block;
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.region-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.property-type-tabs {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.property-type-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.84rem;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease-out;
}

.property-type-tab.active {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
  border: 1px solid rgba(34, 197, 94, 0.6);
}

.property-type-tab:not(.active):hover {
  color: #f8fafc;
  background: rgba(30, 41, 59, 0.8);
}

.region-tab {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease-out;
  white-space: nowrap;
}

.region-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b1120;
  box-shadow: 0 10px 22px rgba(56, 189, 248, 0.4);
}

.region-tab:not(.active):hover {
  color: #e5e7eb;
  background: rgba(30, 64, 175, 0.4);
}

.district-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.5);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}
.district-tabs::-webkit-scrollbar {
  height: 6px;
}
.district-tabs::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 3px;
}

.district-tab {
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s ease-out;
  white-space: nowrap;
}

.district-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b1120;
  box-shadow: 0 10px 22px rgba(56, 189, 248, 0.4);
}

.district-tab:not(.active):hover {
  color: #e5e7eb;
  background: rgba(30, 64, 175, 0.4);
}

.header-district-filter {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
  width: 100%;
  justify-content: center;
}

.header-district-filter .toolbar-select {
  max-width: 200px;
}

.btn {
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  padding: 7px 16px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease-out;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b1120;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.45);
}

.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 35px rgba(56, 189, 248, 0.55);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.5);
}

.btn.ghost:hover {
  background: rgba(30, 64, 175, 0.35);
  border-color: rgba(191, 219, 254, 0.8);
}

.btn.small {
  padding: 5px 12px;
  font-size: 0.8rem;
}

.hidden {
  display: none !important;
}

.app-main {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  padding: 18px 20px 32px;
}

.sidebar {
  background: linear-gradient(180deg, #020617, #020617 38%, #020617 100%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 16px 16px 18px;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 80px;
  align-self: flex-start;
}

.sidebar-section + .sidebar-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed rgba(148, 163, 184, 0.35);
}

.sidebar h2 {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #e5e7eb;
  margin: 0 0 10px;
}

.sidebar input[type="text"] {
  width: 100%;
  padding: 8px 11px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: #020617;
  color: var(--text);
  font-size: 0.9rem;
}

.sidebar input[type="text"]::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.legend-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.legend-list li + li {
  margin-top: 4px;
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.9);
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px dashed rgba(148, 163, 184, 0.4);
}

.content {
  background: radial-gradient(circle at top left, #1e293b 0, #020617 40%);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.38);
  padding: 18px 18px 20px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.content-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.content-header h1 {
  font-size: 1.1rem;
  margin: 0;
}

.content-title-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.muted {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar-label {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.toolbar-select {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #020617;
  color: var(--text);
  font-size: 0.8rem;
}

.property-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.property-group {
  border-radius: 14px;
  padding: 10px 10px 8px;
  background: radial-gradient(circle at top left, #020617 0, #020617 55%);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.subdistrict-heading {
  font-size: 0.9rem;
  margin: 0 0 6px;
  color: #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.subdistrict-heading span {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.property-sublist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 4px;
}

.property-card {
  position: relative;
  border-radius: var(--radius-md);
  padding: 12px 12px 11px;
  background: radial-gradient(
    circle at top,
    rgba(15, 118, 110, 0.7),
    rgba(15, 23, 42, 0.9) 35%
  );
  border: 1px solid rgba(148, 163, 184, 0.55);
  cursor: pointer;
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out,
    border-color 0.18s ease-out, background 0.18s ease-out;
}

.property-card:hover {
  transform: translateY(-2px) translateZ(0);
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.85);
}

.property-name-zh {
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 2px;
}

.property-name-en {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.property-district {
  font-size: 0.76rem;
  color: rgba(191, 219, 254, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.property-type-badge {
  display: inline-flex;
  margin-top: 6px;
  font-size: 0.7rem;
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  color: #d1fae5;
  background: rgba(15, 23, 42, 0.7);
}

.rating-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.rating-score {
  font-weight: 600;
}

.rating-score span {
  font-size: 1.1rem;
}

.score-face {
  margin-left: 6px;
}

.rating-score .max {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.rating-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  gap: 4px;
  border: 1px solid rgba(148, 163, 184, 0.8);
  color: #e5e7eb;
}

.badge-accent {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.7);
}

.no-results {
  text-align: center;
  padding: 40px 0 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}


.drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
}

.drawer-panel {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(460px, 100%);
  background: radial-gradient(circle at top, #0f172a 0, #020617 55%);
  border-left: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: -20px 0 45px rgba(15, 23, 42, 0.9);
  padding: 0 18px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.drawer-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  flex-shrink: 0;
  background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
  padding: env(safe-area-inset-top, 0px) 54px 12px 18px;
  margin: 0 -18px 0 -18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

#drawer-header-inner .drawer-title {
  margin-top: 0;
  margin-bottom: 0;
}

.drawer-close {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  right: 8px;
  border: none;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text-muted);
  font-size: 2rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  z-index: 20;
  border-radius: 6px;
}

.drawer-close:hover {
  color: #e5e7eb;
  background: rgba(30, 64, 175, 0.5);
}

.drawer-title {
  margin-top: 0;
  margin-bottom: 6px;
}

.drawer-subtitle {
  color: var(--text-muted);
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.drawer-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(148, 163, 184, 0.4);
}

.drawer-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.drawer-section-heading h3 {
  margin: 0;
  flex: 1;
}

.collapse-toggle {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  flex-shrink: 0;
}

.collapse-toggle:hover {
  color: var(--accent-strong);
  background: rgba(56, 189, 248, 0.15);
}

.rating-form-body.collapsed {
  display: none;
}

.drawer-section h3 {
  font-size: 0.9rem;
  margin: 0 0 8px;
}

.metric-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-top: 4px;
}

.metric-label {
  color: var(--text-muted);
}

.metric-value {
  color: #86efac;
}

.your-rating-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(129, 140, 248, 0.9);
  background: rgba(79, 70, 229, 0.15);
  font-size: 0.75rem;
  color: #e5e7eb;
}

.daily-limit-pill {
  display: inline-flex;
  padding: 4px 9px;
  margin-bottom: 8px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  border: 1px solid rgba(56, 189, 248, 0.7);
  background: rgba(14, 165, 233, 0.12);
  color: #bae6fd;
}


.rating-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.aspect-block {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  padding: 8px;
  background: rgba(2, 6, 23, 0.65);
}

.aspect-block + .aspect-block {
  margin-top: 2px;
}

.aspect-block-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.aspect-block-heading strong {
  font-size: 0.84rem;
}

.aspect-block-average {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.main-category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.main-category-label {
  color: #e2e8f0;
  font-weight: 550;
}

.subcategory-toggle {
  margin-top: 8px;
  border: 1px dashed rgba(148, 163, 184, 0.55);
  background: rgba(15, 23, 42, 0.7);
  color: #bfdbfe;
  border-radius: 8px;
  padding: 6px 9px;
  width: 100%;
  text-align: left;
  font-size: 0.78rem;
  cursor: pointer;
}

.subcategory-toggle:hover {
  border-color: rgba(191, 219, 254, 0.8);
}

.subcategory-hint {
  margin: 6px 0 0;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.subcategory-container {
  margin-top: 2px;
}

.subcategory-container.collapsed {
  display: none;
}

.subcategory-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.subcategory-label {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.rating-faces {
  display: inline-flex;
  gap: 5px;
}

.rating-face-option {
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(2, 6, 23, 0.85);
  border-radius: 8px;
  font-size: 1.05rem;
  width: 34px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s ease-out, border-color 0.15s ease-out,
    box-shadow 0.15s ease-out;
}

.rating-face-option:hover {
  transform: translateY(-1px);
  border-color: rgba(191, 219, 254, 0.9);
}

.rating-face-option.selected {
  border-color: rgba(16, 185, 129, 0.9);
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.7) inset;
}

.rating-comment {
  width: 100%;
  min-height: 70px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #020617;
  color: var(--text);
  font-size: 0.85rem;
  padding: 8px 9px;
  resize: vertical;
}

.rating-comment::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.image-upload-field {
  margin-top: 2px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.image-upload-field label {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.image-upload-field input[type="file"] {
  border: 1px dashed rgba(148, 163, 184, 0.55);
  border-radius: 8px;
  padding: 6px;
  background: rgba(2, 6, 23, 0.7);
  color: var(--text);
}

.comment-image-preview {
  max-width: 100%;
  max-height: 180px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.form-footer .hint {
  margin: 0;
  border: none;
  background: transparent;
  padding: 0;
}

.form-footer .btn {
  margin-left: auto;
}

.alert {
  font-size: 0.8rem;
  padding: 6px 8px;
  border-radius: 9px;
  margin-top: 6px;
}

.alert-warning {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fef9c3;
}

.ratings-list {
  margin-top: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.rating-item {
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.95);
  padding: 8px 9px;
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.rating-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.rating-item-user {
  font-weight: 500;
}

.rating-item-date {
  color: var(--text-muted);
}

.rating-item-aspects {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.rating-item-aspect {
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: var(--radius-pill);
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.rating-item-comment {
  color: var(--text-muted);
}

.rating-item-subline {
  color: var(--text-muted);
  font-size: 0.74rem;
  margin-bottom: 4px;
}

.rating-item-image {
  margin-top: 6px;
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.5);
}


.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
}

.modal-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 92vw);
  background: radial-gradient(circle at top, #1e293b 0, #020617 55%);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  padding: 18px 18px 16px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.95);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}

.modal-title {
  margin-top: 4px;
  margin-bottom: 6px;
}

.modal-subtitle {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.social-auth-wrap {
  border: 1px dashed rgba(148, 163, 184, 0.45);
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 10px;
}

.social-auth-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.social-btn {
  font-size: 0.8rem;
}

.auth-divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: 8px 0 10px;
}

.form-field {
  margin-bottom: 10px;
}

.form-field label {
  display: block;
  font-size: 0.8rem;
  margin-bottom: 4px;
  color: var(--text-muted);
}

.form-field input[type="text"],
.form-field input[type="email"],
.form-field input[type="password"] {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: #020617;
  color: var(--text);
  font-size: 0.9rem;
}

.form-field input::placeholder {
  color: rgba(148, 163, 184, 0.75);
}

.form-error {
  font-size: 0.8rem;
  color: #fecaca;
  margin-top: 4px;
}

.auth-verification-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 10px;
}

.auth-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.switch-auth {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.switch-auth button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 0.8rem;
}

.app-footer {
  padding: 0 20px 26px;
}

.ad-section {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.95), rgba(15, 23, 42, 0.9));
  padding: 16px;
}

.ad-section h3 {
  margin: 0 0 6px;
  font-size: 0.95rem;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  background: rgba(22, 163, 74, 0.92);
  border: 1px solid rgba(134, 239, 172, 0.9);
  color: #f0fdf4;
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: 0 14px 35px rgba(15, 23, 42, 0.75);
  font-size: 0.84rem;
}

.scroll-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 55;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #0b1120;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(56, 189, 248, 0.4);
  transition: transform 0.18s ease-out, opacity 0.2s ease-out, box-shadow 0.18s ease-out;
}

.scroll-to-top:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(56, 189, 248, 0.5);
}

.scroll-to-top:not(.hidden) {
  opacity: 1;
  visibility: visible;
}


@media (max-width: 900px) {
  .app-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    order: 2;
  }

  .content {
    order: 1;
  }
}

@media (max-width: 640px) {
  html, body {
    width: 100%;
    overflow-x: hidden;
  }

  .app-main {
    padding: 18px 12px 32px;
    min-width: 0;
  }

  .auth-panel {
    position: static;
    align-self: flex-end;
    margin-bottom: 8px;
  }

  .header-center {
    align-items: flex-start;
    width: 100%;
  }

  .region-tabs {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .district-tabs {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .property-type-tabs {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .content {
    padding: 14px;
  }

  .content-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .toolbar {
    width: 100%;
    justify-content: flex-start;
    row-gap: 6px;
  }

  .toolbar-group {
    flex: 1;
    justify-content: space-between;
  }

  .toolbar-select {
    width: 60%;
  }

  .drawer-panel {
    width: 100%;
  }

  .app-shell,
  .app-main,
  .content,
  .sidebar {
    min-width: 0;
  }

  .property-list,
  .property-sublist {
    min-width: 0;
  }

  img,
  .comment-image-preview,
  .rating-item-image {
    max-width: 100%;
  }

  /* Prevent iOS zoom on input focus and reduce viewport shift from keyboard */
  input,
  textarea,
  .header-search input,
  .sidebar input[type="text"],
  .rating-comment,
  .form-field input[type="text"],
  .form-field input[type="email"],
  .form-field input[type="password"] {
    font-size: 16px;
  }
}

