/* RTL-aware: this file uses logical properties (margin-inline-*, inset-inline-*, border-*-*-radius,
   text-align: start/end, …) everywhere layout is directional, so the whole app mirrors correctly
   under <html dir="rtl"> (see LocaleRegistry's RTL_CODES and DirMethod) without a parallel RTL
   stylesheet. A handful of rules that can't be expressed logically (mirrored glyphs/arrows) carry
   an explicit `[dir="rtl"]` override instead — search this file for `[dir="rtl"]` to find them.
   Purely symmetric/centering rules (centered flex, `inset: 0`, `translateX(-50%)` centering, etc.)
   are left as physical values since they read the same in either direction. */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1c1c1a;
  --text-muted: #6b6b66;
  --border: #e3e3de;
  --primary: #0d6e5f;
  --primary-hover: #0a5a4e;
  --accent: #f2b705;
  --danger: #c0392b;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.07);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1rem;
}
/* Admin pages opt into a wider shell (base.page wide=true) — the listings table needs
   room for its columns + the actions row without overflowing/clipping. */
.container-wide { max-width: min(1500px, 96vw); }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 60px;
}

.brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.brand span { color: var(--primary); }
.brand:hover { text-decoration: none; }

.nav-links { display: flex; gap: 1rem; flex: 1; }
.nav-links a { color: var(--text); font-weight: 500; }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.lang-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
.lang-btn:first-child { border-start-start-radius: 6px; border-end-start-radius: 6px; }
.lang-btn:last-child { border-start-end-radius: 6px; border-end-end-radius: 6px; }
.lang-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Header language picker — a native <details> dropdown so it scales to 20+ languages without
   JS (CSP forbids inline scripts). app.js adds a small progressive-enhancement close-on-outside-
   click/Escape handler, but the disclosure itself works with zero JS. */
.lang-switch { position: relative; margin: 0; }
.lang-switch summary.lang-current {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  user-select: none;
}
.lang-switch summary.lang-current::-webkit-details-marker { display: none; }
.lang-switch summary.lang-current::after { content: "\25BE"; font-size: 0.7em; }
.lang-switch[open] summary.lang-current { background: var(--bg); }

.lang-menu {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 4px);
  min-width: 160px;
  max-height: 320px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.25rem;
  z-index: 200;
}
.lang-option {
  display: block;
  text-align: start;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
}
.lang-option:hover { background: var(--bg); text-decoration: none; }
.lang-option.active { background: var(--primary); color: #fff; }

/* Buttons */
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  padding: 0.5rem 1rem;
  box-sizing: border-box;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-lg { font-size: 1.05rem; padding: 0.7rem 1.5rem; }

/* Hero */
.hero {
  text-align: center;
  padding: 4rem 1rem 4.5rem;
}
.hero h1 { font-size: 2.4rem; letter-spacing: -0.02em; margin: 0 0 0.75rem; }
.hero p { color: var(--text-muted); font-size: 1.15rem; margin: 0 0 2rem; }
.hero-actions { display: flex; justify-content: center; gap: 0.75rem; flex-wrap: wrap; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem;
}

/* Forms — global base style for every text-like control, app-wide */
select,
textarea,
input:not([type]),
input[type="text"], input[type="search"], input[type="number"],
input[type="tel"], input[type="email"], input[type="password"], input[type="url"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
  font-family: inherit;
  line-height: 1.3;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
}
select:focus, textarea:focus,
input:not([type]):focus,
input[type="text"]:focus, input[type="search"]:focus, input[type="number"]:focus,
input[type="tel"]:focus, input[type="email"]:focus, input[type="password"]:focus, input[type="url"]:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}

.form-field { margin-bottom: 1rem; }
.form-field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
}
.field-error { color: var(--danger); font-size: 0.85rem; margin-top: 0.25rem; }
.form-error { color: var(--danger); margin-bottom: 1rem; }
.form-disabled { opacity: 0.55; }

/* Marks a name input on the /admin/services language tabs that has no translation yet for the
   selected language (falling back to the placeholder shown in the default language) — a subtle,
   theme-neutral nudge rather than an error state. */
.untranslated { background: #fdf6e3; border-left: 3px solid #d9a441; }

/* Submit progress — indeterminate bar shown while a form (e.g. an import save that
   downloads photos) is in flight; the submit button is disabled to block re-clicks. */
.btn:disabled { opacity: 0.6; cursor: default; }
.form-progress { display: none; height: 4px; margin-top: 0.75rem; background: var(--border); border-radius: 2px; overflow: hidden; }
.is-submitting .form-progress { display: block; }
.form-progress span { display: block; height: 100%; width: 40%; background: var(--primary); border-radius: 2px; animation: form-progress-slide 1.1s ease-in-out infinite; }
@keyframes form-progress-slide { 0% { margin-inline-start: -40%; } 100% { margin-inline-start: 100%; } }

/* Listing cards */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.listing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.listing-card:hover { box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1); }
.card-link { color: inherit; display: block; }
.card-link:hover { text-decoration: none; }
.card-thumb {
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #e8e8e2, #d8d8d0);
  background-size: cover;
  background-position: center;
}
.card-body { padding: 0.75rem 0.9rem 0.9rem; }
.card-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-price { font-weight: 700; font-size: 1.05rem; }
.per-month { font-weight: 400; font-size: 0.85em; color: var(--text-muted); }
.card-meta { color: var(--text-muted); font-size: 0.85rem; margin: 0.25rem 0 0.5rem; }
.card-badges { display: flex; gap: 0.35rem; }

.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.5rem;
  border-radius: 99px;
}
.badge-sale { background: #e3f2ee; color: var(--primary); }
.badge-rent { background: #fdf3d7; color: #8a6d00; }
.badge-service { background: #e7e3fb; color: #5433c9; }
.badge-sold, .badge-deleted { background: #f4dedb; color: var(--danger); }
.badge-active { background: #e3f2ee; color: var(--primary); }
.badge-outdated { background: #f4dedb; color: var(--danger); }
.badge-pending { background: #fdf3d7; color: #8a6d00; }
.badge-rejected { background: #f4dedb; color: var(--danger); }

/* Browse layout — map stacked full-width above the results, both always visible */
.browse-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 1.25rem;
}
.browse-results { min-width: 0; }

/* Filter bar */
.filter-bar {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.75rem;
  margin-bottom: 1rem;
  align-items: center;
}
.filter-q { flex: 1 1 100%; padding: 0.6rem 0.75rem; font-size: 1.05rem; }
.filter-price { width: 110px; }
.filter-city { flex: 1; min-width: 110px; }
.price-range { display: flex; gap: 0.4rem; align-items: center; }
/* Both inputs AND selects (e.g. the two YEAR_RANGE dropdowns) must shrink to share the cell, or a
   select's intrinsic min width overflows the grid column and overlaps the next field. */
.price-range input, .price-range select { flex: 1; width: auto; min-width: 0; }
/* Single-input attribute filters (RANGE_MIN/RANGE_MAX) that carry a unit (e.g. Mileage "km") put
   the input and its `.attr-unit` on one inline row instead of the unit wrapping onto its own line
   inside the column-flex `.filter-field` — otherwise that field grows taller than its plain-select
   siblings and drifts out of row alignment. */
.input-unit { display: flex; align-items: center; gap: 0.3rem; }
.input-unit input { flex: 1; width: auto; min-width: 0; }
.sort-control { display: inline-flex; align-items: center; gap: 0.4rem; }
.sort-label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }

/* Browse search — language-stable layout (see listings.ftl): search-row holds category, the `q`
   input, Search and Clear pinned together on one line regardless of translated label widths, so
   they never drift across the app's 20 locales the way they did under plain flex-wrap. filter-grid
   then aligns every other control (price/city/type-when-real-estate/attrs/sort) on fixed-width
   grid tracks instead of letting each one's width follow its own translated text. Scoped to
   `.browse-search`/`.search-row`/`.filter-grid` so the shared `.filter-bar`/`.filter-q`/`.sort-control`
   rules (reused by the admin filter bars) are untouched. */
.browse-search { display: flex; flex-direction: column; gap: 0.6rem; width: 100%; }
.search-row { display: flex; gap: 0.5rem; align-items: center; }
.search-row .suggest-wrap { flex: 1; }
.search-row .filter-q { width: 100%; }
.search-row > .btn { flex: 0 0 auto; }
.search-row > select { flex: 0 0 auto; }
.filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 0.5rem;
  align-items: start;
}
.filter-grid .filter-city { width: 100%; }
/* One labeled control per grid cell (#4): label stacked above its input/select, sharing the
   muted look of `.sort-label`. */
.filter-field { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.filter-field label { font-size: 0.85rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }
.filter-field .suggest-wrap { width: 100%; }
/* Two-control fields (a From/To range or the two Year dropdowns) span two grid columns so both
   controls fit comfortably instead of overflowing one 170px track. Capped to a single column when
   the grid itself is only one column wide (very narrow screens). */
.filter-field-wide { grid-column: span 2; }
@media (max-width: 360px) { .filter-field-wide { grid-column: auto; } }
/* `#attr-filters` (per-category attribute filters, swapped via HTMX on category change) is grouped
   into its own full-width sub-grid rather than left as `display: contents` (which used to scatter
   each attribute across the outer `.filter-grid` row). A subtle top border/gap sets it apart as its
   own section; `:empty` hides that border for the "all categories" view where it renders nothing. */
.attr-filters {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.5rem;
  align-items: start;
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: 0.2rem;
}
.attr-filters:empty { display: none; }

/* Type-ahead dropdowns anchored under the `q`/city inputs (see search-suggestions.ftl + app.js). */
.suggest-wrap { position: relative; }
.suggest-menu {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  z-index: 150;
  margin-top: 0.25rem;
  max-height: 16rem;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.suggest-menu:empty { display: none; }
.suggest-item {
  display: block;
  width: 100%;
  border: none;
  background: none;
  font: inherit;
  color: var(--text);
  text-align: start;
  padding-block: 0.45rem;
  padding-inline: 0.75rem;
  cursor: pointer;
}
.suggest-item:hover, .suggest-item:focus { background: var(--bg); outline: none; }

/* Home */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  margin: 0 0 2.5rem;
}
.category-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  font-weight: 600;
  color: var(--text);
}
.category-tile:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.home-latest h2 { margin-bottom: 1rem; }

/* Detail */
.detail { max-width: 760px; margin: 1.5rem auto; }
.detail-gallery { min-height: 120px; border-radius: 8px; background: linear-gradient(135deg, #e8e8e2, #d8d8d0); margin-bottom: 1.25rem; }
.detail-head h1 { margin: 0.5rem 0; font-size: 1.6rem; }
.detail-price { font-size: 1.5rem; font-weight: 800; }
.detail-meta { color: var(--text-muted); margin: 0.5rem 0 1rem; }
.detail-desc { white-space: pre-line; border-top: 1px solid var(--border); padding-top: 1rem; }
.owner-actions { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1rem; display: flex; gap: 0.5rem; }

/* Listing form */
.form-card { max-width: 640px; margin: 1.5rem auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-field .label, .form-field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.3rem; }
.radio { display: inline-flex !important; align-items: center; gap: 0.35rem; margin-inline-end: 1.25rem; font-weight: 400 !important; }
.radio input { width: auto; }
.flash {
  background: #e3f2ee;
  color: var(--primary);
  border: 1px solid #bcded5;
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  margin-bottom: 1rem;
}

/* Messaging */
.inbox { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 1rem; }
.inbox-item { display: flex; justify-content: space-between; align-items: center; color: var(--text); }
.inbox-item:hover { text-decoration: none; border-color: var(--primary); }
.inbox-main { display: flex; flex-direction: column; gap: 0.15rem; }
.inbox-listing { font-weight: 700; }
.inbox-party { color: var(--text-muted); font-size: 0.9rem; }
.inbox-side { display: flex; align-items: center; gap: 0.6rem; }
.inbox-date { color: var(--text-muted); font-size: 0.85rem; }
.unread-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
}

.conversation { max-width: 680px; margin: 1.5rem auto; }
.conversation-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.conversation-head a { font-weight: 700; }
.message-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 420px;
  overflow-y: auto;
  padding: 0.5rem 0.25rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.message { max-width: 75%; align-self: flex-start; }
.message.own { align-self: flex-end; }
.message-body {
  background: var(--bg);
  border: 1px solid var(--border);
  /* Speech-bubble "tail" on the start-bottom corner (visually bottom-left in LTR, bottom-right
     in RTL) — logical corners so it stays on the correct side under either direction. */
  border-start-start-radius: 12px;
  border-start-end-radius: 12px;
  border-end-end-radius: 12px;
  border-end-start-radius: 4px;
  padding: 0.5rem 0.8rem;
  white-space: pre-line;
}
.message.own .message-body {
  background: #e3f2ee;
  border-color: #bcded5;
  /* Own messages sit at the inline-end side (see .message.own below); tail mirrors to the
     end-bottom corner. */
  border-start-start-radius: 12px;
  border-start-end-radius: 12px;
  border-end-start-radius: 12px;
  border-end-end-radius: 4px;
}
.message-time { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }
.message.own .message-time { text-align: end; }
.message-form { display: flex; gap: 0.5rem; margin-top: 0.9rem; align-items: flex-end; }
.message-form textarea { flex: 1; resize: vertical; }

.contact-form {
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
  padding-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.contact-form label { font-weight: 700; }
.contact-form .btn { align-self: flex-start; }
.contact-login-hint { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1rem; }

/* Favorites */
.listing-card { position: relative; }
.card-fav { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 10; }
.fav-form { display: inline; margin: 0; }
.fav-btn {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, transform 0.1s;
}
.fav-btn:hover { transform: scale(1.1); }
.fav-btn.active { color: #d6336c; }

/* Comparison (cookie-based, no login required) */
.card-compare { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 10; }
.compare-form { display: inline; margin: 0; }
.compare-btn {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  line-height: 1.4;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
}
.compare-btn:hover { border-color: var(--primary); color: var(--primary); }
.compare-btn.active { color: var(--primary); border-color: var(--primary); font-weight: 600; }
.detail-compare { margin-top: 1rem; }
.detail-compare .compare-btn { padding: 0.4rem 0.8rem; font-size: 0.9rem; }

.compare-bar {
  position: sticky;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.6rem 1rem;
  margin: 1rem 0;
  z-index: 90;
}
.compare-bar-empty { display: none; }
.compare-bar-count { font-weight: 600; flex: 1; }
.compare-bar-clear {
  background: none;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.2rem 0.4rem;
}
.compare-bar-clear:hover { color: var(--danger); }

.compare-table-wrap { overflow-x: auto; margin-top: 1rem; }
.compare-table { border-collapse: collapse; width: 100%; }
.compare-table th, .compare-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0.9rem;
  text-align: start;
  white-space: nowrap;
}
.compare-table td:first-child, .compare-table th:first-child {
  position: sticky;
  inset-inline-start: 0;
  background: var(--surface);
  font-weight: 600;
  color: var(--text-muted);
  white-space: normal;
}
.compare-table tbody tr:nth-child(even) { background: var(--bg); }
.compare-table tbody tr:nth-child(even) td:first-child { background: var(--bg); }
.compare-col-thumb {
  width: 140px;
  height: 100px;
  border-radius: 6px;
  background: linear-gradient(135deg, #e8e8e2, #d8d8d0) center/cover no-repeat;
  margin-bottom: 0.4rem;
}
.compare-col-title { display: block; font-weight: 700; margin-bottom: 0.4rem; }
.compare-clear-all { margin-top: 1rem; }

.detail-title-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.seller-box {
  border-top: 1px solid var(--border);
  margin-top: 1.25rem;
  padding-top: 1rem;
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}
.seller-box a { font-weight: 700; }
.profile-head h1 { margin-bottom: 0.25rem; }

/* Category-specific attributes & phone reveal */
.spec-table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.spec-table tr:nth-child(odd) { background: var(--bg); }
.spec-table td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); }
.spec-table td:first-child { color: var(--text-muted); width: 40%; }
.attr-unit { color: var(--text-muted); font-size: 0.85em; margin-inline-start: 0.3rem; }
.attribute-fields {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.attribute-fields legend { font-weight: 700; padding: 0 0.4rem; grid-column: 1 / -1; }
.attr-input-row { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.9rem; }
.checkbox-label input { width: auto; }
.service-note { font-style: italic; }
.phone-box { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1rem; }
.phone-number { font-size: 1.3rem; font-weight: 700; }

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

/* Maps & geocoding */
.location-section { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.location-section legend { font-weight: 700; padding: 0 0.4rem; }
.location-map { height: 320px; border-radius: 8px; margin-bottom: 0.5rem; z-index: 0; }
.geo-search-row { display: flex; gap: 0.5rem; }
.geo-search-row input { flex: 1; }
.geo-results { display: flex; flex-direction: column; gap: 2px; margin-top: 0.4rem; }
.geo-result {
  text-align: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.geo-result:hover { border-color: var(--primary); }

.browse-map {
  position: relative;
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
}
.browse-map #map-canvas { width: 100%; height: 400px; z-index: 0; }
.search-area-btn {
  display: none;
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}
.search-area-btn.visible { display: block; }

/* Marker cluster popups (see leaflet.markercluster vendored assets) */
.marker-pop { display: flex; gap: 0.6rem; align-items: center; color: var(--text); min-width: 170px; }
.marker-pop:hover { text-decoration: none; }
.marker-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 6px;
  flex: none;
  background: linear-gradient(135deg, #e8e8e2, #d8d8d0);
}
.marker-pop-body { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.85rem; min-width: 0; }
.marker-pop-body strong { font-size: 0.95rem; }
.marker-pop-body span {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

.detail-map { height: 280px; border-radius: 8px; margin-top: 1.25rem; z-index: 0; }

/* Image uploader & gallery */
.uploader h2 { margin-top: 0; font-size: 1.1rem; }
.uploader-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-bottom: 1rem; }
.uploader-item { display: flex; flex-direction: column; gap: 0.3rem; align-items: center; }
.uploader-item img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.uploader-form { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.hint { color: var(--text-muted); font-size: 0.85rem; }
.btn-sm { font-size: 0.8rem; padding: 0.25rem 0.6rem; }

.gallery { margin-bottom: 1.25rem; }
.gallery-main { width: 100%; max-height: 480px; object-fit: contain; border-radius: 8px; background: #eceae4; cursor: zoom-in; }
.gallery-thumbs { display: flex; gap: 0.5rem; margin-top: 0.5rem; flex-wrap: wrap; }
.gallery-thumbs img { height: 64px; width: 86px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: zoom-in; }

/* Import listing from URL */
.import-card { text-align: start; }
.badge-experimental { display: inline-block; vertical-align: middle; font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.03em; color: #9a7d2e; background: #faf5e6; border: 1px solid #ece1c2; border-radius: 999px; padding: 0.1em 0.5em; }
.import-experimental { margin-top: 1rem; font-style: italic; }
.import-entry-card { max-width: 640px; margin: 1.5rem auto 0; padding: 0.9rem 1.1rem; display: flex; justify-content: flex-end; }
.import-advanced { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.import-advanced summary { cursor: pointer; font-weight: 600; }
.import-advanced textarea { width: 100%; font-family: monospace; font-size: 0.8rem; }
.advanced-url-row { display: flex; gap: 0.5rem; }
.advanced-url-row input { flex: 1; min-width: 0; }
.advanced-url-row .btn { white-space: nowrap; flex: none; }
.import-banner { background: #fdf3d9; color: #8a6d00; border-color: #f0dfa0; }
.me-post-actions { display: flex; gap: 0.6rem; margin: 0.75rem 0 1.25rem; }
.import-photos { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; margin-bottom: 1.25rem; }
.import-photos legend { font-weight: 600; padding: 0 0.3rem; }
.import-photos-grid { display: flex; flex-wrap: wrap; gap: 0.9rem; }
.import-photo-item { display: flex; flex-direction: column; gap: 0.3rem; align-items: center; font-weight: 400; }
.import-photo-item img { width: 120px; height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: #eceae4; }
.import-photo-item .checkbox-label { font-weight: 400; font-size: 0.85rem; }

/* Advanced import — animated 4-step guide */
.import-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 1rem; margin: 1rem 0; }

.import-step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.85rem 0.9rem 1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.ig-demo { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #ffffff; border: 1px solid var(--border); }
.ig-demo svg { display: block; width: 100%; height: 100%; }

.ig-stephead { display: flex; align-items: center; gap: 0.5rem; margin: 0.8rem 0 0.28rem; }
.ig-num { flex: none; width: 1.5rem; height: 1.5rem; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 0.82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ig-title { font-weight: 650; font-size: 0.98rem; letter-spacing: -0.01em; }
.ig-once { margin-left: auto; font-size: 0.58rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: #8a6d00; background: #fdf3d9; border: 1px solid #f0dfa0; padding: 0.1rem 0.4rem; border-radius: 999px; white-space: nowrap; }
.ig-cap { color: var(--text-muted); font-size: 0.88rem; margin: 0.1rem 0 0; }

/* shared SVG ink, scoped to the guide */
.import-steps .ig-chrome { fill: #eeeeeb; }
.import-steps .ig-screen { fill: #ffffff; }
.import-steps .ig-stroke { fill: none; stroke: var(--border); stroke-width: 2; }
.import-steps .ig-dot { fill: #c9c9c3; }
.import-steps .ig-chip { fill: var(--surface); stroke: var(--primary); stroke-width: 1.3; }
.import-steps .ig-btn { fill: var(--primary); }
.import-steps .ig-btntx { fill: #fff; }
.import-steps .ig-muted { fill: var(--text-muted); }
.import-steps .ig-ink { fill: var(--text); }
.import-steps .ig-soft { fill: #c9c9c3; }
.import-steps .ig-cursor path { fill: var(--text); stroke: var(--surface); stroke-width: 1.2; stroke-linejoin: round; }
.import-steps .ig-ring { fill: none; stroke: var(--primary); stroke-width: 2.5; }
.import-steps .ig-toast { fill: var(--primary); }
.import-steps .ig-toasttx { fill: #fff; font-weight: 700; }

/* STEP 1: drag to bookmarks bar */
.import-step.s1 .ig-drop { stroke: var(--primary); stroke-width: 1.5; stroke-dasharray: 4 3; fill: none; opacity: 0.5; }
.import-step.s1 .ig-ghost { opacity: 0; animation: ig-g1-move 7s ease-in-out infinite; }
.import-step.s1 .ig-landed { opacity: 0; animation: ig-g1-land 7s ease-in-out infinite; }
.import-step.s1 .ig-cursor { animation: ig-g1-cursor 7s ease-in-out infinite; }
@keyframes ig-g1-move { 0%, 8% { transform: translate(0, 0); opacity: 0; } 14% { opacity: 1; } 50% { transform: translate(-40px, -92px); opacity: 1; } 58%, 100% { transform: translate(-40px, -92px); opacity: 0; } }
@keyframes ig-g1-land { 0%, 53% { opacity: 0; } 60% { opacity: 1; } 100% { opacity: 1; } }
@keyframes ig-g1-cursor { 0%, 8% { transform: translate(98px, 120px); } 14% { transform: translate(72px, 116px); } 50%, 58% { transform: translate(30px, 24px); } 70% { transform: translate(42px, 40px); } 100% { transform: translate(98px, 120px); } }

/* STEP 2: open your listing */
.import-step.s2 .ig-url { opacity: 0; animation: ig-o2-url 6s ease-in-out infinite; }
.import-step.s2 .ig-prog { transform: scaleX(0); transform-origin: left; animation: ig-o2-prog 6s ease-in-out infinite; }
.import-step.s2 .ig-page { opacity: 0; animation: ig-o2-page 6s ease-in-out infinite; }
@keyframes ig-o2-url { 0%, 10% { opacity: 0; } 22% { opacity: 1; } 92% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ig-o2-prog { 0%, 24% { transform: scaleX(0); opacity: 1; } 44% { transform: scaleX(1); opacity: 1; } 52% { opacity: 0; } 100% { opacity: 0; transform: scaleX(1); } }
@keyframes ig-o2-page { 0%, 44% { opacity: 0; } 60% { opacity: 1; } 92% { opacity: 1; } 100% { opacity: 0; } }

/* STEP 3: click bookmark -> copied */
.import-step.s3 .ig-cursor { animation: ig-c3-cursor 6s ease-in-out infinite; }
.import-step.s3 .ig-ring { opacity: 0; animation: ig-c3-ring 6s ease-in-out infinite; }
.import-step.s3 .ig-toastg { opacity: 0; animation: ig-c3-toast 6s ease-in-out infinite; }
@keyframes ig-c3-cursor { 0% { transform: translate(150px, 120px); } 28% { transform: translate(44px, 34px); } 42%, 100% { transform: translate(44px, 34px); } }
@keyframes ig-c3-ring { 0%, 32% { opacity: 0; transform: scale(0.3); transform-origin: 38px 33px; } 36% { opacity: 0.9; transform: scale(0.5); transform-origin: 38px 33px; } 48% { opacity: 0; transform: scale(1.4); transform-origin: 38px 33px; } 100% { opacity: 0; } }
@keyframes ig-c3-toast { 0%, 42% { opacity: 0; transform: translateY(-4px); } 52% { opacity: 1; transform: translateY(0); } 86% { opacity: 1; transform: translateY(0); } 96%, 100% { opacity: 0; transform: translateY(-3px); } }

/* STEP 4: paste + import */
.import-step.s4 .ig-pline { transform: scaleX(0); transform-origin: left; fill: var(--text-muted); }
.import-step.s4 .ig-pl1 { animation: ig-p4-line 6s ease-in-out infinite; animation-delay: 0.2s; }
.import-step.s4 .ig-pl2 { animation: ig-p4-line 6s ease-in-out infinite; animation-delay: 0.5s; }
.import-step.s4 .ig-pl3 { animation: ig-p4-line 6s ease-in-out infinite; animation-delay: 0.8s; }
.import-step.s4 .ig-pl4 { animation: ig-p4-line 6s ease-in-out infinite; animation-delay: 1.1s; }
.import-step.s4 .ig-cursor { animation: ig-p4-cursor 6s ease-in-out infinite; }
.import-step.s4 .ig-gobtn { animation: ig-p4-btn 6s ease-in-out infinite; transform-origin: center; }
.import-step.s4 .ig-ring { opacity: 0; animation: ig-p4-ring 6s ease-in-out infinite; }
.import-step.s4 .ig-check { opacity: 0; animation: ig-p4-check 6s ease-in-out infinite; }
@keyframes ig-p4-line { 0%, 6% { transform: scaleX(0); } 30% { transform: scaleX(1); } 92% { transform: scaleX(1); } 100% { transform: scaleX(0); } }
@keyframes ig-p4-cursor { 0%, 42% { transform: translate(150px, 58px); } 60% { transform: translate(120px, 108px); } 74%, 100% { transform: translate(120px, 108px); } }
@keyframes ig-p4-btn { 0%, 60% { transform: scale(1); } 66% { transform: scale(0.94); } 74%, 100% { transform: scale(1); } }
@keyframes ig-p4-ring { 0%, 60% { opacity: 0; transform: scale(0.4); transform-origin: 120px 108px; } 66% { opacity: 0.9; transform: scale(0.6); transform-origin: 120px 108px; } 78% { opacity: 0; transform: scale(1.5); transform-origin: 120px 108px; } 100% { opacity: 0; } }
@keyframes ig-p4-check { 0%, 74% { opacity: 0; } 82% { opacity: 1; } 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .import-steps * { animation: none !important; }
  .import-step.s1 .ig-ghost { transform: translate(-40px, -92px) !important; opacity: 1 !important; }
  .import-step.s1 .ig-landed { opacity: 1 !important; }
  .import-step.s2 .ig-url, .import-step.s2 .ig-page { opacity: 1 !important; }
  .import-step.s2 .ig-prog { opacity: 0 !important; }
  .import-step.s3 .ig-toastg { opacity: 1 !important; }
  .import-step.s4 .ig-pline { transform: scaleX(1) !important; }
  .import-step.s4 .ig-check { opacity: 1 !important; }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Lightbox (progressive-enhancement overlay for the gallery) */
body.lightbox-open { overflow: hidden; }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(0, 0, 0, 0.7); }
.lightbox-close {
  top: 16px;
  inset-inline-end: 16px;
  width: 44px;
  height: 44px;
  font-size: 1.6rem;
}
.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2rem;
}
.lightbox-prev { inset-inline-start: 16px; }
.lightbox-next { inset-inline-end: 16px; }
/* The ‹ / › glyphs (set via textContent in app.js) point left/right physically — mirror them so
   "prev"/"next" still point the correct visual direction once the buttons swap sides under RTL. */
[dir="rtl"] .lightbox-prev,
[dir="rtl"] .lightbox-next { transform: translateY(-50%) scaleX(-1); }
.lightbox-prev[hidden],
.lightbox-next[hidden] { display: none; }
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(0, 0, 0, 0.45);
  padding: 0.2rem 0.7rem;
  border-radius: 99px;
}

@media (max-width: 640px) {
  .lightbox-prev,
  .lightbox-next { width: 42px; height: 42px; font-size: 1.5rem; }
  .lightbox-close { width: 38px; height: 38px; font-size: 1.4rem; }
}

/* My account */
.me-greeting { color: var(--text-muted); margin-top: -0.5rem; }

/* My listings */
.my-listings { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.my-listing { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.my-listing-thumb { width: 72px; height: 54px; object-fit: cover; border-radius: 6px; flex: none; }
.my-listing-thumb-empty { background: linear-gradient(135deg, #e8e8e2, #d8d8d0); display: inline-block; }
.my-listing-body { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 0.3rem; }
.my-listing-main { display: flex; align-items: center; gap: 0.6rem; }
.my-listing-title { font-weight: 600; }
.my-listing-price { font-weight: 700; }
.my-listing-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.my-listing-actions .inline-form { display: flex; margin: 0; }
.extend-form { gap: 0.3rem; }
.extend-form select { padding: 0.2rem 0.4rem; }

.listing-progress {
  width: 100%;
  max-width: 260px;
  height: 6px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}
.listing-progress-bar { height: 100%; background: var(--primary); border-radius: 99px; }
.listing-time-left { color: var(--text-muted); font-size: 0.8rem; margin: 0; }
.listing-status-note { color: var(--text-muted); font-size: 0.85rem; margin: 0.25rem 0; }
.listing-neverexpires { color: var(--primary); font-weight: 600; }

/* Pagination */
.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.5rem 0; }
.page-info { color: var(--text-muted); }
/* &larr;/&rarr; point left/right physically — mirror the glyph under RTL so prev/next still
   point the correct visual direction (the surrounding label text is unaffected). */
.pagination-arrow { display: inline-block; }
[dir="rtl"] .pagination-arrow { transform: scaleX(-1); }
.empty { color: var(--text-muted); text-align: center; padding: 2rem 0; }

@media (max-width: 720px) {
  .form-row { grid-template-columns: 1fr; }
}

/* Browse: shrink the map on narrow viewports */
@media (max-width: 820px) {
  .browse-map #map-canvas { height: 300px; }
}

/* Auth */
.auth-card { max-width: 420px; margin: 2.5rem auto; }
.sso-buttons { display: flex; flex-direction: row; gap: 0.75rem; }
.btn-sso {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  height: 44px;
  padding: 0 0.75rem;
  white-space: nowrap;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}
.sso-icon { flex: none; display: block; }
.btn-sso-google { background: #fff; border: 1px solid #dadce0; color: #3c4043; }
.btn-sso-google:hover { background: #f8f9fa; box-shadow: 0 1px 2px rgba(60, 64, 67, 0.15); }
.btn-sso-facebook { background: #1877f2; border: none; color: #fff; }
.btn-sso-facebook:hover { background: #166fe5; }
.sso-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 1.1rem 0;
}
.sso-divider::before, .sso-divider::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
.auth-card h1 { margin-top: 0; font-size: 1.5rem; }
.inline-form { display: inline; margin: 0; }
.nav-user { color: var(--text); font-weight: 600; }
.verify-code-input { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer-copyright { color: var(--text-muted); font-size: 0.82rem; margin: 0.4rem 0 0; }
.footer-copyright a { color: inherit; text-decoration: underline; }

/* Moderator/admin console */
/* Keeps a wide (many-column) admin table from overflowing its grid column and
   becoming wider than the filter bar above it — it scrolls within this wrapper instead. */
.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th, .admin-table td {
  padding: 0.5rem 0.6rem;
  text-align: start;
  vertical-align: middle;
  font-size: 0.9rem;
}
.admin-table thead th { border-bottom: 1px solid var(--border); color: var(--text-muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; }
/* Each listing is its own <tbody> (a data row + a right-aligned actions row underneath).
   Uniform background — listings are set apart by a divider with breathing room, not zebra striping. */
.admin-table tbody tr:first-child td { padding-top: 0.75rem; }
.admin-actions-row > td { padding-top: 0; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
/* Truncate the two free-text columns to one line so every data row keeps a uniform
   (thumbnail-driven) height instead of growing when a title/email wraps. */
.admin-col-title, .admin-col-owner { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-col-title a { display: block; overflow: hidden; text-overflow: ellipsis; }
.admin-table .my-listing-thumb { width: 56px; height: 42px; }
.admin-row-actions { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.admin-row-actions .inline-form { display: flex; margin: 0; }
.admin-row-actions select { padding: 0.2rem 0.3rem; }

.lifespans-config th, .lifespans-config td { text-align: center; }
.lifespans-config th:first-child, .lifespans-config td:first-child { text-align: start; }
.lifespans-config select { padding: 0.2rem 0.3rem; }

.bulk-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin: 1rem 0 0;
  box-shadow: var(--shadow);
}
.bulk-count { color: var(--text-muted); font-size: 0.85rem; }

.role-badge { text-transform: capitalize; }
.role-user { background: var(--bg); color: var(--text-muted); }
.role-moderator { background: #fdf3d7; color: #8a6d00; }
.role-admin { background: #e3f2ee; color: var(--primary); }

/* Report listing (user-facing) */
.report-section { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1rem; }
.report-toggle { cursor: pointer; display: inline-block; }
.report-toggle::-webkit-details-marker { display: none; }
.report-toggle::marker { content: ""; }
.report-box[open] .report-toggle { margin-bottom: 0.6rem; }
.report-form { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 0.75rem; max-width: 480px; }
.report-form label { font-weight: 600; font-size: 0.9rem; }
.report-form select, .report-form textarea { width: 100%; }
.report-login-hint, .report-own-hint { margin-top: 1rem; }

/* Nav pending-reports badge */
.badge-count {
  background: var(--danger);
  color: #fff;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.5rem;
  margin-inline-start: 0.15rem;
}

/* Admin reports queue */
.admin-reports .reason-details summary { cursor: pointer; }
.admin-reports .reason-details p { margin: 0.35rem 0 0; color: var(--text-muted); max-width: 360px; white-space: pre-line; }
.report-status-pending { background: #fdf3d7; color: #8a6d00; }
.report-status-rejected { background: var(--bg); color: var(--text-muted); }
.report-status-upheld { background: #f4dedb; color: var(--danger); }
.ai-verdict { border-radius: 99px; padding: 0.1rem 0.5rem; font-size: 0.8rem; font-weight: 600; }
.ai-verdict-valid { background: #f4dedb; color: var(--danger); }
.ai-verdict-invalid { background: #e3f2ee; color: var(--primary); }
.ai-verdict-unsure { background: var(--bg); color: var(--text-muted); }
.ai-confidence { color: var(--text-muted); font-size: 0.8rem; margin-inline-start: 0.2rem; }
.ai-note { color: var(--text-muted); font-size: 0.8rem; margin-top: 0.2rem; max-width: 320px; }

@media (max-width: 640px) {
  .hero h1 { font-size: 1.7rem; }
  .nav { flex-wrap: wrap; gap: 0.75rem; padding: 0.5rem 1rem; }
  .nav-links { order: 3; flex-basis: 100%; }
  .admin-table { display: block; overflow-x: auto; }
}

/* Admin sidebar layout */
.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1rem;
}

.admin-sidebar {
  position: sticky;
  top: 76px;
}

.admin-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.admin-sidebar-nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
}

.admin-sidebar-nav a:hover {
  background: var(--bg);
}

.admin-sidebar-nav a.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.admin-content {
  min-width: 0;
}

@media (max-width: 820px) {
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; }
  .admin-sidebar-nav { display: flex; flex-wrap: wrap; gap: 0.4rem; }
}

/* Service bookings / reservations (Phase 2) */
.booking-settings .checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.booking-hours { border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem 1rem; margin: 1rem 0; }
.booking-hours legend { font-weight: 600; padding: 0 0.4rem; }
.booking-hours-row { align-items: center; gap: 0.6rem; margin-top: 0.4rem; }
.booking-weekday { min-width: 100px; font-size: 0.9rem; }
.booking-hours-sep { color: var(--text-muted); }

.booking-widget { border-top: 1px solid var(--border); margin-top: 1.25rem; padding-top: 1rem; }
.booking-widget .form-field { margin-bottom: 0.75rem; }
.booking-login-hint { margin-top: 1rem; }

.slot-grid { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0; }
.slot-btn {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.7rem;
  cursor: pointer;
  font-size: 0.9rem;
}
.slot-btn input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.slot-btn:has(input:checked) { background: var(--primary); color: #fff; border-color: var(--primary); }

.reservation-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.reservation-card { display: flex; flex-direction: column; gap: 0.4rem; }
.reservation-main { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.reservation-meta { display: flex; flex-direction: column; gap: 0.15rem; color: var(--text-muted); font-size: 0.9rem; }
.reservation-note { margin: 0.2rem 0 0; }
.reservation-actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

.booking-status-pending { background: #fdf3d7; color: #8a6d00; }
.booking-status-approved { background: #e3f2ee; color: var(--primary); }
.booking-status-rejected, .booking-status-cancelled { background: var(--bg); color: var(--text-muted); }

/* Nav "My activity" — second banner row of fast-access buttons */
.nav-activity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  border-top: 1px solid var(--border);
}
.nav-activity-label {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-inline-end: 0.25rem;
}
