/* Fiona Marketplace V2 — international property advisory UI.
   One shell serves desktop (sidebar) and mobile (bottom navigation). */

:root {
  --navy: #0b1f3a;
  --navy-deep: #06142a;
  --navy-soft: #1b3557;
  --ivory: #f7f3ec;
  --ivory-raised: #fffdf9;
  --sea: #4a7a9b;
  --sea-deep: #2f5c7a;
  --sand: #e6d8c3;
  --sand-soft: #f1e7d7;
  --brass: #a98545;
  --text: #0b1f3a;
  --muted: #5d6e84;
  --line: #e0d6c6;
  --line-strong: #cbbda6;
  --ok: #1d6b4c;
  --ok-bg: #e7f3ec;
  --warn: #8a5a13;
  --warn-bg: #fbf1de;
  --err: #962f2f;
  --err-bg: #fbeaea;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 10px rgba(11, 31, 58, 0.06);
  --shadow: 0 18px 42px rgba(11, 31, 58, 0.10);

  --display: "Cormorant Garamond", "Sarabun", Georgia, serif;
  --body: "Figtree", "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;

  --header-h: 64px;
  --tabbar-h: 68px;
  --sidebar-w: 248px;
  --max: 1240px;
  --tap: 48px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ivory);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

:focus-visible {
  outline: 3px solid var(--sea);
  outline-offset: 2px;
  border-radius: 6px;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0 0 0.5rem;
}
h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h3 { font-size: 1.12rem; }
p { margin: 0 0 0.85rem; }

.muted { color: var(--muted); }
.small { font-size: 0.86rem; }
.kicker {
  font-family: var(--body);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 0.5rem;
}
.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;
}
.skip-link {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 60;
  background: var(--navy); color: #fff; padding: 0.7rem 1rem; border-radius: 0 0 10px 10px;
}
.skip-link:focus { top: 0; }

.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }

/* ---------- shell ---------- */

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(247, 243, 236, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 0.75rem;
}
.brand { display: flex; align-items: center; gap: 0.55rem; min-width: 0; margin-right: auto; }
.brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; }
.brand-word {
  font-family: var(--display);
  font-size: 1.12rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; white-space: nowrap;
}
.brand-word span { color: var(--brass); }

.topnav { display: none; gap: 1.4rem; margin-right: auto; }
.topnav a { font-size: 0.93rem; font-weight: 500; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.topnav a[aria-current="page"] { border-bottom-color: var(--brass); }

.topbar-actions { display: flex; align-items: center; gap: 0.4rem; }
.langswitch { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.langswitch a {
  min-width: 42px; min-height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; color: var(--muted);
}
.langswitch a[aria-current="true"] { background: var(--navy); color: #fff; }

.layout { flex: 1; display: flex; width: 100%; }
.sidebar { display: none; }
.content { flex: 1; min-width: 0; padding-bottom: calc(var(--tabbar-h) + 1.5rem); }

.banner {
  background: var(--navy);
  color: #efe6d6;
  font-size: 0.78rem;
  text-align: center;
  padding: 0.4rem 1rem;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  min-height: var(--tap); padding: 0.6rem 1.25rem;
  border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 0.95rem; cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-soft); }
.btn-secondary { background: var(--sea); color: #fff; }
.btn-secondary:hover { background: var(--sea-deep); }
.btn-ghost { background: var(--ivory-raised); border-color: var(--line-strong); color: var(--navy); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-quiet { background: transparent; border-color: transparent; color: var(--muted); padding-inline: 0.6rem; }
.btn-quiet:hover { color: var(--navy); }
.btn-block { width: 100%; }
.btn-sm { min-height: 44px; padding: 0.35rem 0.9rem; font-size: 0.86rem; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---------- forms ---------- */

.field { display: grid; gap: 0.3rem; margin-bottom: 0.9rem; min-width: 0; }
.field > span, .field > label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"],
input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%; min-height: var(--tap);
  padding: 0.55rem 0.8rem;
  background: var(--ivory-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--sea); }
.check {
  display: flex; gap: 0.65rem; align-items: flex-start;
  padding: 0.75rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--ivory-raised); margin-bottom: 0.9rem;
}
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; }
.check span { font-size: 0.88rem; }
.form { max-width: 34rem; }
.form-grid { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .form-grid { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }

/* ---------- notices ---------- */

.notice {
  padding: 0.8rem 1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--sand-soft);
  font-size: 0.9rem; margin-bottom: 1rem;
}
.notice-ok { background: var(--ok-bg); border-color: #bcdfcb; color: var(--ok); }
.notice-warn { background: var(--warn-bg); border-color: #e8d2a4; color: var(--warn); }
.notice-err { background: var(--err-bg); border-color: #edc4c4; color: var(--err); }

/* ---------- hero ---------- */

.hero { position: relative; color: #fff; isolation: isolate; }
.hero-media { position: absolute; inset: 0; z-index: -2; display: block; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(90deg, rgba(6, 20, 42, 0.86) 0%, rgba(6, 20, 42, 0.62) 55%, rgba(6, 20, 42, 0.42) 100%),
    linear-gradient(180deg, rgba(6, 20, 42, 0.30) 0%, rgba(6, 20, 42, 0.10) 40%, rgba(6, 20, 42, 0.55) 100%);
}
.hero-inner { padding: 1.9rem 0 2rem; max-width: 34rem; }
.hero h1 { color: #fff; margin-bottom: 0.6rem; }
.hero-sub { color: #e2dacb; font-size: 0.94rem; margin-bottom: 1.1rem; }
.btn-clear { background: transparent; border-color: rgba(255, 255, 255, 0.6); color: #fff; }
.btn-clear:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }

/* ---------- category-first discovery ---------- */

.discover { background: var(--navy-deep); color: #fff; padding: 1.4rem 0 1.6rem; }
.discover-head { text-align: center; margin-bottom: 0.9rem; }
.discover-head h2 { color: #fff; font-size: clamp(1.5rem, 4vw, 2.2rem); margin-bottom: 0.3rem; }
.discover-sub {
  color: var(--sand); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; margin: 0;
}
.discover-form { margin: 0; scroll-padding-bottom: 6rem; }

.cat-grid {
  border: 0; margin: 0; padding: 0;
  display: grid; gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cat-card {
  position: relative; display: block; cursor: pointer;
  border-radius: var(--radius); overflow: hidden;
  background: var(--navy);
  border: 2px solid transparent;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.cat-card:hover { transform: translateY(-2px); }
.cat-input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }

.cat-photo { display: block; aspect-ratio: 16 / 9; }
.cat-photo img { width: 100%; height: 100%; object-fit: cover; }

/* The label sits on the photo, so the gradient guarantees contrast. */
.cat-body {
  position: absolute; inset: auto 0 0 0;
  padding: 2.4rem 0.75rem 0.6rem;
  background: linear-gradient(180deg, rgba(6, 20, 42, 0) 0%, rgba(6, 20, 42, 0.78) 55%, rgba(6, 20, 42, 0.94) 100%);
  display: flex; flex-direction: column; gap: 0.15rem;
}
.cat-label { display: flex; align-items: center; gap: 0.45rem; min-height: 28px; color: #fff; }
.cat-icon { width: 20px; height: 20px; flex: none; color: var(--sand); }
.cat-name { flex: 1; min-width: 0; font-weight: 700; font-size: 0.95rem; line-height: 1.25; }
.cat-go { color: var(--sand); font-size: 1rem; }
.cat-note { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255, 255, 255, 0.62); }

.cat-card:has(.cat-input:checked) { border-color: var(--brass); }
.cat-card:has(.cat-input:checked) .cat-go { transform: translateX(2px); }
.cat-card:has(.cat-input:focus-visible) { outline: 3px solid #fff; outline-offset: 2px; }

.discover-secondary { margin: 0.6rem 0 0.5rem; text-align: center; }
.link-arrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  min-height: var(--tap); padding: 0 0.6rem;
  color: var(--sand); font-weight: 600; letter-spacing: 0.04em;
}
.link-arrow:hover { color: #fff; }

.discover-bar {
  position: sticky; bottom: calc(var(--tabbar-h) + 0.6rem); z-index: 16;
  display: grid; gap: 0.5rem;
  padding: 0.7rem; border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.97); backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.discover-q { margin: 0; }
.discover-q input { background: #fff; }
.btn-brass { background: var(--brass); color: #fff; }
.btn-brass:hover { background: #8d6d34; }
.discover-hint { margin: 0.7rem 0 0; color: rgba(255, 255, 255, 0.72); font-size: 0.8rem; text-align: center; }

/* ---------- results header and filters ---------- */

.results-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin: 1.2rem 0 0.9rem;
}
.results-head h1 { margin-bottom: 0.2rem; }

.filters {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--ivory-raised); margin-bottom: 1.4rem;
}
.filters > summary {
  min-height: var(--tap); padding: 0.75rem 1rem;
  display: flex; align-items: center; cursor: pointer;
  font-weight: 600; list-style: none;
}
.filters > summary::-webkit-details-marker { display: none; }
.filters > summary::after { content: "+"; margin-left: auto; color: var(--brass); font-size: 1.2rem; }
.filters[open] > summary { border-bottom: 1px solid var(--line); }
.filters[open] > summary::after { content: "–"; }
.filters-form { padding: 1rem; }
.filters-grid { display: grid; gap: 0 0.9rem; }
.filters-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ---------- listing cards ---------- */

.section { padding: 2.4rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }

.cards { display: grid; gap: 1.1rem; }

.listing-card {
  display: flex; flex-direction: column;
  background: var(--ivory-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden; min-width: 0;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.listing-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.listing-media {
  position: relative; aspect-ratio: 16 / 10; background: var(--navy);
}
.listing-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.listing-media .placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(140deg, var(--navy) 0%, var(--sea-deep) 60%, var(--sea) 100%);
  display: flex; align-items: flex-end; padding: 0.9rem; color: rgba(255,255,255,0.75);
  font-family: var(--display); font-size: 1rem;
}
.listing-flags { position: absolute; top: 0.6rem; left: 0.6rem; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.listing-body { padding: 0.95rem 1.05rem 1.1rem; display: flex; flex-direction: column; gap: 0.3rem; flex: 1; }
.listing-body h3 { margin: 0; font-size: 1.15rem; }
.listing-price { font-family: var(--body); font-weight: 700; font-size: 1.05rem; }
.listing-meta { font-size: 0.86rem; color: var(--muted); }
.listing-actions { display: flex; gap: 0.5rem; margin-top: auto; padding-top: 0.75rem; }
.listing-actions .btn { flex: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.6rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--sand); color: var(--navy);
}
.chip-dark { background: rgba(6, 20, 42, 0.82); color: #fff; }
.chip-demo { background: var(--brass); color: #fff; }
.chip-ok { background: var(--ok-bg); color: var(--ok); }
.chip-warn { background: var(--warn-bg); color: var(--warn); }
.chip-err { background: var(--err-bg); color: var(--err); }
.chip-quiet { background: var(--ivory); color: var(--muted); border: 1px solid var(--line); }

.empty {
  padding: 2.5rem 1.25rem; text-align: center;
  border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--muted);
}

/* ---------- gallery ---------- */

.gallery {
  display: flex; gap: 0.6rem; overflow-x: auto;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius); background: var(--navy);
  scrollbar-width: none;
}
.gallery::-webkit-scrollbar { display: none; }
.gallery figure { flex: 0 0 100%; margin: 0; scroll-snap-align: center; aspect-ratio: 16 / 10; }
.gallery img { width: 100%; height: 100%; object-fit: cover; object-position: center 62%; }
.gallery .placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(140deg, var(--navy) 0%, var(--sea-deep) 60%, var(--sea) 100%);
}
.gallery-dots { display: flex; gap: 0.35rem; justify-content: center; padding: 0.7rem 0 0; }
.gallery-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.gallery-dots span[data-active="true"] { background: var(--navy); }

/* ---------- detail ---------- */

.detail { display: grid; gap: 1.5rem; }
.factgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin: 1.1rem 0; }
.fact {
  background: var(--ivory-raised); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 0.7rem 0.8rem;
}
.fact dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.fact dd { margin: 0.15rem 0 0; font-weight: 600; overflow-wrap: anywhere; }

.panel {
  background: var(--ivory-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem;
}
.panel + .panel { margin-top: 1rem; }
.panel h2 { font-size: 1.2rem; }

.sticky-actions {
  position: sticky; bottom: calc(var(--tabbar-h) + 0.5rem); z-index: 15;
  display: flex; gap: 0.6rem; padding: 0.7rem;
  background: rgba(255, 253, 249, 0.96); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-top: 1.2rem;
}
.sticky-actions .btn { flex: 1; }
.sticky-actions form { flex: 1; display: flex; }
.sticky-actions form .btn { width: 100%; }

/* ---------- lists / tables ---------- */

.rowlist { display: grid; gap: 0.7rem; }
.rowitem {
  display: flex; gap: 0.9rem; align-items: center;
  background: var(--ivory-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 0.8rem 0.9rem; min-width: 0;
}
.rowitem .thumb { width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; flex: none; background: var(--navy); }
.rowitem .thumb img, .rowitem .thumb .placeholder { width: 100%; height: 100%; object-fit: cover; }
.rowitem .thumb .placeholder { background: linear-gradient(140deg, var(--navy), var(--sea)); }
.rowitem .grow { flex: 1; min-width: 0; }
.rowitem h3 { margin: 0; font-size: 1rem; }
.rowitem .listing-meta { overflow-wrap: anywhere; }
.rowitem-actions { display: flex; gap: 0.4rem; flex: none; flex-wrap: wrap; justify-content: flex-end; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }

.steps { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; font-size: 0.78rem; color: var(--muted); }
.steps b { font-weight: 700; color: var(--navy); }

/* ---------- bottom navigation (mobile) ---------- */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around;
  background: rgba(255, 253, 249, 0.97);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; min-height: var(--tabbar-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 0.68rem; font-weight: 600; color: var(--muted); padding: 0.4rem 0.2rem;
}
.tabbar a svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; }
.tabbar a[aria-current="page"] { color: var(--navy); }
.tabbar a[aria-current="page"] svg { stroke: var(--brass); }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem;
  color: var(--muted); font-size: 0.85rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-bottom: 0.7rem; }

/* ---------- breakpoints ---------- */

@media (max-width: 767px) {
  /* Fingers need a bigger target than a mouse pointer. */
  .btn-sm { min-height: var(--tap); }
}

@media (max-width: 390px) {
  :root { --header-h: 58px; --tabbar-h: 62px; }
  .wrap { width: min(100% - 1.5rem, var(--max)); }
  .discover { padding: 1.8rem 0 2rem; }
  .listing-actions { flex-direction: column; }
  .cat-grid { gap: 0.5rem; }
  .cat-body { padding: 2rem 0.6rem 0.5rem; }
  .cat-name { font-size: 0.86rem; }
  .hero-inner { padding: 1.5rem 0 1.6rem; }
  .hero-sub { font-size: 0.88rem; margin-bottom: 0.9rem; }
  .rowitem { flex-wrap: wrap; }
  .rowitem-actions { width: 100%; justify-content: flex-start; }
  .factgrid { gap: 0.6rem; }
}

/* Small handsets: the brand shortens so the header never wraps. */
@media (max-width: 380px) {
  .brand img { width: 26px; height: 26px; }
  .brand-word { font-size: 0.95rem; }
  .brand-word span { display: none; }
  .langswitch a { min-width: 34px; }
  .btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }
  .topbar-inner { gap: 0.4rem; }
}

@media (min-width: 768px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
  .cat-photo { aspect-ratio: 16 / 9; }
  .cat-name { font-size: 1.1rem; }
  .cat-body { padding: 3rem 1rem 0.85rem; }
  .hero-inner { padding: 3.6rem 0 3.8rem; max-width: 40rem; }
  .hero-sub { font-size: 1rem; margin-bottom: 1.4rem; }
  .cat-name { font-size: 1.05rem; }
  .filters-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .discover-bar {
    position: static; grid-template-columns: minmax(0, 1fr) auto;
    align-items: center; max-width: 42rem; margin: 1.2rem auto 0;
  }
  .factgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .topnav { display: flex; }
  .detail { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
  .detail .detail-aside { position: sticky; top: calc(var(--header-h) + 1rem); }
  .sticky-actions { position: static; box-shadow: none; }
}

@media (min-width: 1100px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .discover { padding: 3rem 0 3.2rem; }
  .discover-head { margin-bottom: 1.6rem; }
  .discover-sub { font-size: 0.78rem; letter-spacing: 0.22em; }
  .filters-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabbar { display: none; }
  .content { padding-bottom: 0; }
  .sticky-actions { bottom: 1rem; }

  .layout.has-sidebar .sidebar {
    display: block; flex: none; width: var(--sidebar-w);
    border-right: 1px solid var(--line);
    padding: 1.5rem 0.9rem;
    position: sticky; top: var(--header-h); align-self: flex-start;
    max-height: calc(100vh - var(--header-h)); overflow-y: auto;
  }
  .sidebar a {
    display: flex; align-items: center; gap: 0.65rem;
    min-height: var(--tap); padding: 0.5rem 0.85rem; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 0.93rem; color: var(--muted);
  }
  .sidebar a svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.7; }
  .sidebar a:hover { background: var(--sand-soft); color: var(--navy); }
  .sidebar a[aria-current="page"] { background: var(--navy); color: #fff; }
  .sidebar a[aria-current="page"] svg { stroke: var(--sand); }
  .sidebar h2 { font-family: var(--body); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); padding: 0 0.85rem; margin-bottom: 0.4rem; }
  .layout.has-sidebar .content { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

/* ---------- long-form content ---------- */

.prose { max-width: 44rem; }
.prose .lede { font-size: 1.05rem; color: var(--muted); margin-bottom: 1.6rem; }
.prose h2 { margin-top: 2rem; font-size: 1.4rem; }
.prose h3 { margin-top: 1.4rem; font-size: 1.1rem; }
.prose p, .prose li { line-height: 1.7; }
.prose ul, .prose ol { margin: 0 0 1rem; padding-left: 1.2rem; list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.4rem; }
.prose a { color: var(--sea-deep); text-decoration: underline; text-underline-offset: 3px; }
.prose table { margin-bottom: 1.2rem; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose blockquote {
  margin: 1.2rem 0; padding: 0.8rem 1rem;
  border-left: 3px solid var(--brass); background: var(--sand-soft);
}

/* ---- operations screens: dashboard, review queue, deals ---- */

.statgrid {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.2rem 0;
}
.stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  text-decoration: none;
  color: inherit;
}
a.stat:hover, a.stat:focus-visible { border-color: var(--navy); }
.stat-n { font-size: 1.9rem; font-weight: 700; line-height: 1; color: var(--navy); }
.stat-l { font-size: 0.82rem; color: var(--muted); }

/* Horizontal filter chips that stay reachable by keyboard. */
.tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  margin: 0.8rem 0 1.2rem;
  -webkit-overflow-scrolling: touch;
}
.tabs a {
  flex: 0 0 auto;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--muted);
  white-space: nowrap;
}
.tabs a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: #fff; }

.stack { display: grid; gap: 0.4rem; }
.field.full { grid-column: 1 / -1; }

@media (min-width: 768px) {
  .statgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
