/* ============================================================
   POOLXCHANGE
   Colours taken directly from the logo:
     navy   #002148   (POOL wordmark, badge ring, deep wave)
     blue   #0087EE   (XCHANGE wordmark - the primary action colour)
     sky    #02A8F7   (the X in the badge)
     aqua   #46CFFD   (light wave)
   Clean, minimal, lots of white. Mobile first.
   ============================================================ */

:root {
  --navy:      #002148;
  --navy-700:  #0A3164;
  --navy-500:  #2C4E76;
  --blue:      #0087EE;
  --blue-600:  #0071CC;
  --sky:       #02A8F7;
  --aqua:      #46CFFD;
  --aqua-50:   #EDF8FE;
  --blue-50:   #F1F8FE;

  --ink:       #10233A;
  --ink-2:     #4A5C71;
  --ink-3:     #7A8899;
  --line:      #E4EAF0;
  --line-soft: #EFF3F7;
  --bg:        #FFFFFF;
  --bg-soft:   #F7FAFC;

  --urgent:    #E5641E;
  --urgent-bg: #FDF1EA;
  --good:      #0E8F63;
  --good-bg:   #E9F6F1;
  --warn-bg:   #FDF6E3;
  --warn-ink:  #8A6A12;
  --danger:    #C63D3D;
  --danger-bg: #FCEDED;

  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --shadow-soft: 0 1px 2px rgba(0, 33, 72, .05);
  --shadow-pop:  0 6px 24px rgba(0, 33, 72, .10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 62px;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--blue-600); text-decoration: none; }
a:hover { color: var(--blue); text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.22; margin: 0 0 .5em; color: var(--navy); letter-spacing: -.015em; font-weight: 700; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p  { margin: 0 0 1em; }

.container { width: 100%; max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 660px; }
.mid { max-width: 880px; }

.muted { color: var(--ink-3); }
.small { font-size: .875rem; }
.tiny  { font-size: .78rem; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace; font-size: .95em; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 28px; } .mt-4 { margin-top: 44px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 28px; }
.hide { display: none !important; }

.eyebrow {
  display: block; font-size: .72rem; font-weight: 700; letter-spacing: .16em;
  text-transform: uppercase; color: var(--blue); margin-bottom: 10px;
}

/* ------------------------------------------------------------ header */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-bar { display: flex; align-items: center; gap: 14px; height: var(--header-h); }

.logo { display: flex; align-items: center; flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo img { height: 30px; width: auto; }

.header-search { flex: 1; min-width: 0; display: none; }
.header-search form { display: flex; align-items: center; gap: 0; }
.header-search input {
  flex: 1; min-width: 0; height: 38px; font-size: .92rem; font-family: inherit; color: var(--ink);
  border: 1px solid var(--line); border-right: 0; border-radius: var(--r) 0 0 var(--r);
  padding: 0 14px; background: var(--bg-soft);
}
.header-search input:focus { outline: none; background: #fff; border-color: var(--blue); }
.header-search button {
  height: 38px; border: 1px solid var(--blue); border-radius: 0 var(--r) var(--r) 0; padding: 0 16px;
  background: var(--blue); color: #fff; font-weight: 600; font-size: .9rem; cursor: pointer; font-family: inherit;
}
.header-search button:hover { background: var(--blue-600); border-color: var(--blue-600); }

.header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.nav-toggle {
  display: inline-grid; place-items: center; width: 38px; height: 38px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r); cursor: pointer;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ''; display: block; width: 17px; height: 1.5px; background: var(--navy); border-radius: 2px; position: relative;
}
.nav-toggle span::before { position: absolute; top: -5.5px; }
.nav-toggle span::after  { position: absolute; top: 5.5px; }

.main-nav { display: none; background: #fff; border-bottom: 1px solid var(--line); }
.main-nav.open { display: block; }
.main-nav ul { list-style: none; margin: 0; padding: 6px 0 10px; }
.main-nav a { display: block; padding: 10px 20px; color: var(--ink-2); font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav a.active { color: var(--navy); background: var(--bg-soft); text-decoration: none; }
.main-nav .nav-urgent { color: var(--urgent); }
.main-nav .nav-divider { height: 1px; background: var(--line); margin: 8px 20px; }

.badge-count {
  display: inline-block; min-width: 17px; padding: 0 5px; margin-left: 6px;
  background: var(--blue); color: #fff; border-radius: 9px;
  font-size: .68rem; font-weight: 700; text-align: center; line-height: 17px;
}

@media (min-width: 900px) {
  .header-search { display: block; max-width: 420px; }
  .nav-toggle { display: none; }
  .logo img { height: 34px; }
  .main-nav { display: block !important; border-bottom: 1px solid var(--line); }
  .main-nav .container { display: flex; align-items: center; }
  .main-nav ul { display: flex; gap: 2px; padding: 0; }
  .main-nav a { padding: 12px 13px; font-size: .9rem; border-bottom: 2px solid transparent; white-space: nowrap; }
  .main-nav a:hover, .main-nav a.active { background: transparent; border-bottom-color: var(--blue); }
  .main-nav .nav-divider, .main-nav .mobile-only { display: none; }
}

/* --------------------------------------------------- account menu */
.account-menu { position: relative; }
.account-menu summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 5px 10px 5px 5px; border: 1px solid var(--line); border-radius: 999px;
  background: #fff; user-select: none;
}
.account-menu summary::-webkit-details-marker { display: none; }
.account-menu summary:hover { border-color: #C9D8E6; }
.account-menu[open] summary { border-color: var(--blue); }
.account-menu .avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff;
  display: grid; place-items: center; font-size: .82rem; font-weight: 700; flex-shrink: 0;
}
.account-menu .who { font-size: .88rem; font-weight: 600; color: var(--navy); display: none; }
.account-menu .caret {
  width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid var(--ink-3); margin-left: 2px;
}
.account-menu[open] .caret { transform: rotate(180deg); }

.account-menu::after {
  content: ''; position: absolute; right: 0; top: 100%; width: 100%; height: 10px;
  display: none;
}
.account-menu[open]::after { display: block; }   /* bridges the gap on hover */
.account-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 80;
  min-width: 232px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-pop); padding: 6px;
}
.account-id { padding: 10px 12px 12px; border-bottom: 1px solid var(--line-soft); margin-bottom: 6px; }
.account-id strong { display: block; color: var(--navy); font-size: .92rem; }
.account-id span { display: block; color: var(--ink-3); font-size: .78rem; word-break: break-all; }
.account-dropdown a, .account-dropdown button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  padding: 9px 12px; border-radius: var(--r-sm); border: 0; background: none;
  font-family: inherit; font-size: .89rem; font-weight: 500; color: var(--ink-2);
  text-align: left; cursor: pointer; text-decoration: none;
}
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--bg-soft); color: var(--navy); text-decoration: none; }
.account-dropdown a.is-admin { color: var(--blue-600); font-weight: 600; }
.account-sep { height: 1px; background: var(--line-soft); margin: 6px 0; }

.nav-logout {
  display: block; width: 100%; text-align: left; padding: 10px 20px; border: 0; background: none;
  font-family: inherit; font-size: .95rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
}
.nav-logout:hover { background: var(--bg-soft); color: var(--navy); }

.hide-sm { display: none; }
@media (min-width: 560px) { .hide-sm { display: inline-flex; } }
@media (min-width: 700px) { .account-menu .who { display: inline; } }

/* ------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: var(--r); border: 1px solid transparent;
  font-family: inherit; font-size: .94rem; font-weight: 600; line-height: 1.15;
  cursor: pointer; text-decoration: none; transition: background .14s, border-color .14s, color .14s;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); color: #fff; }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-700); color: #fff; }
.btn-urgent { background: var(--urgent); color: #fff; }
.btn-urgent:hover { background: #CF5716; color: #fff; }
.btn-outline { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--navy); }
.btn-danger { background: #fff; color: var(--danger); border-color: #F0CFCF; }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: 7px 13px; font-size: .84rem; }
.btn-lg { padding: 14px 26px; font-size: 1rem; }
.btn-block { width: 100%; }

/* ------------------------------------------------------------ tags */
.tag {
  display: inline-block; padding: 3px 9px; border-radius: 4px;
  font-size: .67rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
}
.tag-sale     { background: var(--blue-50); color: var(--blue-600); }
.tag-wanted   { background: var(--bg-soft); color: var(--navy-500); border: 1px solid var(--line); }
.tag-trade    { background: var(--aqua-50); color: #0A6E96; }
.tag-free     { background: var(--good-bg); color: var(--good); }
.tag-urgent   { background: var(--urgent-bg); color: var(--urgent); }
.tag-status   { background: var(--bg-soft); color: var(--ink-2); }
.tag-sold     { background: var(--navy); color: #fff; }
.tag-pending  { background: var(--warn-bg); color: var(--warn-ink); }
.tag-verified { background: var(--navy); color: #fff; }
.tag-founding { background: var(--aqua-50); color: var(--navy); }
.tag-featured { background: #fff; color: var(--navy); border: 1px solid var(--line); }

/* ------------------------------------------------------------ flashes */
.flash {
  padding: 12px 16px; border-radius: var(--r); margin: 18px 0;
  font-weight: 500; font-size: .92rem; border: 1px solid;
}
.flash-success { background: var(--good-bg); color: #0A6B4A; border-color: #C7E7DA; }
.flash-error   { background: var(--danger-bg); color: #A33333; border-color: #F0CFCF; }
.flash-info    { background: var(--blue-50); color: #0A5E96; border-color: #CDE6F8; }

.errors {
  background: var(--danger-bg); border: 1px solid #F0CFCF; color: #A33333;
  border-radius: var(--r); padding: 14px 18px 14px 34px; margin: 0 0 22px;
}
.errors li { margin: 3px 0; font-size: .9rem; }

.notice-bar {
  background: var(--warn-bg); border-bottom: 1px solid #F0E2BC; color: var(--warn-ink);
  font-size: .88rem; padding: 10px 0;
}
.notice-bar a { color: var(--warn-ink); text-decoration: underline; }

/* ------------------------------------------------------------ hero */
.hero { background: var(--bg); padding: 44px 0 8px; }
.hero h1 { font-size: 2rem; margin-bottom: 12px; letter-spacing: -.03em; }
.hero .sub { color: var(--ink-2); font-size: 1.05rem; max-width: 44ch; margin-bottom: 26px; }

.hero-search {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px;
  box-shadow: var(--shadow-soft);
}
.hero-search .row { display: flex; flex-direction: column; gap: 8px; }
.hero-search input, .hero-search select {
  width: 100%; height: 46px; border: 1px solid var(--line); border-radius: var(--r);
  padding: 0 14px; font-size: 1rem; font-family: inherit; color: var(--ink); background: #fff;
}
.hero-search input:focus, .hero-search select:focus { outline: none; border-color: var(--blue); }
.hero-search .btn { height: 46px; }
.hero-hint { color: var(--ink-3); font-size: .84rem; margin: 12px 2px 0; }
.hero-hint a { color: var(--blue-600); }

.hero-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 20px; }

@media (min-width: 760px) {
  .hero { padding: 68px 0 12px; }
  .hero h1 { font-size: 2.9rem; }
  .hero .sub { font-size: 1.12rem; }
  .hero-search .row { flex-direction: row; }
  .hero-search .row input.q { flex: 2.2; }
  .hero-search .row select, .hero-search .row input.zip { flex: 1; }
  .hero-search .btn { flex-shrink: 0; padding-left: 26px; padding-right: 26px; }
  .hero-actions { grid-template-columns: repeat(3, auto); justify-content: start; }
}

/* wave rule, echoing the logo mark */
.wave-rule { display: block; width: 100%; height: 34px; margin-top: 26px; }

/* ------------------------------------------------------------ stat row */
.statrow { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 22px 0; }
.statrow ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.statrow .n { font-size: 1.55rem; font-weight: 700; color: var(--navy); display: block; line-height: 1.1; letter-spacing: -.02em; }
.statrow .l { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
@media (min-width: 700px) { .statrow ul { grid-template-columns: repeat(4, 1fr); } }

/* ------------------------------------------------------------ sections */
.section { padding: 48px 0; }
.section-soft { background: var(--bg-soft); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-head h2 { margin: 0; }
.section-head a { font-size: .88rem; font-weight: 600; white-space: nowrap; }

/* ------------------------------------------------------------ cards */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.card-pad { padding: 24px; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 700px)  { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.grid-3 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.grid-2 { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }

/* listing card */
.listing-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; display: flex; flex-direction: column; position: relative;
  transition: border-color .14s, box-shadow .14s;
}
.listing-card:hover { border-color: #C9D8E6; box-shadow: var(--shadow-pop); }
.listing-card a.cover { display: block; color: inherit; text-decoration: none; }
.listing-card a.cover:hover { text-decoration: none; }
.lc-photo {
  position: relative; aspect-ratio: 4 / 3; background: var(--bg-soft);
  display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line-soft);
}
.lc-photo img { width: 100%; height: 100%; object-fit: cover; }
.lc-photo .noimg { color: #B6C6D4; font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.lc-badges {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 6px; flex-wrap: wrap;
  pointer-events: none;
}
.lc-badges .tag { box-shadow: 0 1px 2px rgba(0,33,72,.10); }
.lc-body { padding: 14px 14px 16px; flex: 1; display: flex; flex-direction: column; }
.lc-title {
  font-weight: 600; font-size: .95rem; line-height: 1.35; color: var(--navy); margin: 0 0 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lc-meta { font-size: .78rem; color: var(--ink-3); margin-bottom: 10px; line-height: 1.5; }
.lc-meta .pn { color: var(--ink-2); font-weight: 600; }
.lc-foot { margin-top: auto; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.lc-price { font-weight: 700; color: var(--navy); font-size: 1.05rem; letter-spacing: -.02em; }
.lc-price.free { color: var(--good); }
.lc-price.wanted { color: var(--ink-2); font-size: .9rem; font-weight: 600; }
.lc-dist { font-size: .74rem; color: var(--ink-3); text-align: right; }
.lc-sold-overlay {
  position: absolute; inset: 0; background: rgba(0,33,72,.55); display: grid; place-items: center;
  color: #fff; font-weight: 700; letter-spacing: .12em; font-size: .8rem; text-transform: uppercase;
}

/* category tiles */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 700px)  { .cat-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: repeat(6, 1fr); } }
.cat-tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 12px; text-align: center; color: var(--navy); text-decoration: none;
  transition: border-color .14s, background .14s;
}
.cat-tile:hover { border-color: var(--blue); background: var(--blue-50); text-decoration: none; }
.cat-tile .ico { font-size: 1.35rem; line-height: 1; display: block; margin-bottom: 8px; color: var(--blue); }
.cat-tile .nm { font-weight: 600; font-size: .84rem; line-height: 1.3; display: block; }
.cat-tile .ct { font-size: .72rem; color: var(--ink-3); }

/* urgent strip */
.urgent-banner {
  background: var(--urgent-bg); border: 1px solid #F6DCC9; border-radius: var(--r-lg); padding: 20px 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.urgent-banner h2 { color: #A34A15; margin: 0 0 4px; font-size: 1.12rem; }
.urgent-banner p { margin: 0; color: #8A5B33; font-size: .92rem; }
@media (min-width: 760px) { .urgent-banner { flex-direction: row; align-items: center; justify-content: space-between; } }

/* ------------------------------------------------------------ marketplace */
.market-layout { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 960px) { .market-layout { grid-template-columns: 250px 1fr; } }

.filters { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line-soft); }
.filters-head h3 { margin: 0; font-size: .92rem; }
.filters-body { padding: 6px 18px 20px; }
.filters.collapsed .filters-body { display: none; }
@media (min-width: 960px) { .filters.collapsed .filters-body { display: block; } .filters-toggle { display: none; } }

.field { margin: 16px 0; }
.field label, .field-label {
  display: block; font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px;
}
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=tel],
.field input[type=number], .field input[type=search], .field select, .field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 11px 13px;
  font-size: .95rem; font-family: inherit; color: var(--ink); background: #fff;
}
.field textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,135,238,.12); }
.field input[type=file] { width: 100%; font-size: .9rem; }
.field .hint { font-size: .8rem; color: var(--ink-3); margin-top: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 10px 0; font-size: .92rem; }
.check input { margin-top: 3px; flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--blue); }
.check label { font-weight: 500 !important; color: var(--ink-2) !important; margin: 0 !important; font-size: .92rem !important; }
.required { color: var(--danger); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: .84rem; font-weight: 600; text-decoration: none; cursor: pointer;
}
.chip:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; }

.results-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.results-head .count { font-size: .92rem; color: var(--ink-2); }
.sort-select { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 11px; font-family: inherit; font-size: .86rem; background: #fff; color: var(--ink); }

.empty {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 48px 24px; text-align: center; color: var(--ink-3);
}
.empty h3 { color: var(--navy); }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pagination a, .pagination span {
  padding: 9px 14px; border-radius: var(--r); border: 1px solid var(--line); background: #fff;
  font-size: .88rem; font-weight: 600; color: var(--ink-2); text-decoration: none;
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.pagination .current { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ------------------------------------------------------------ listing detail */
.detail-layout { display: grid; grid-template-columns: 1fr; gap: 26px; align-items: start; }
@media (min-width: 960px) { .detail-layout { grid-template-columns: minmax(0,1.5fr) minmax(0,1fr); } }

.gallery { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.gallery-main { aspect-ratio: 4 / 3; background: var(--bg-soft); display: grid; place-items: center; }
.gallery-main img { width: 100%; height: 100%; object-fit: contain; background: var(--navy); }
.gallery-main .noimg { color: #B6C6D4; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; font-size: .78rem; }
.gallery-thumbs { display: flex; gap: 8px; padding: 10px; overflow-x: auto; }
.gallery-thumbs button {
  border: 1.5px solid transparent; border-radius: var(--r-sm); padding: 0; background: none; cursor: pointer;
  width: 70px; height: 54px; flex-shrink: 0; overflow: hidden;
}
.gallery-thumbs button.active { border-color: var(--blue); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.spec-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.spec-table th { width: 42%; color: var(--ink-3); font-weight: 500; font-size: .88rem; }
.spec-table td { color: var(--ink); font-weight: 500; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.copy-btn {
  border: 1px solid var(--line); background: #fff; border-radius: var(--r-sm); cursor: pointer;
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 7px; margin-left: 8px; color: var(--ink-3); font-family: inherit;
}
.copy-btn:hover { border-color: var(--blue); color: var(--blue); }

.price-block { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 6px 0 16px; }
.price-big { font-size: 1.9rem; font-weight: 700; color: var(--navy); line-height: 1; letter-spacing: -.03em; }
.price-big.free { color: var(--good); }

.seller-box { display: flex; gap: 14px; align-items: center; }
.seller-logo {
  width: 46px; height: 46px; border-radius: var(--r); background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 1.05rem; flex-shrink: 0; overflow: hidden;
}
.seller-logo img { width: 100%; height: 100%; object-fit: cover; }

.sticky-side { position: sticky; top: calc(var(--header-h) + 14px); }

/* ------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); }
table.data { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 620px; }
table.data th, table.data td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.data th { background: var(--bg-soft); font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr:hover td { background: #FCFDFE; }
table.data .actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ------------------------------------------------------------ account */
.page-head { border-bottom: 1px solid var(--line); padding: 32px 0 26px; }
.page-head h1 { margin: 0 0 6px; font-size: 1.6rem; }
.page-head p { margin: 0; color: var(--ink-3); }

.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tabs a {
  padding: 12px 14px; font-size: .9rem; font-weight: 600; color: var(--ink-3);
  border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none;
}
.tabs a:hover { color: var(--navy); text-decoration: none; }
.tabs a.active { color: var(--blue); border-bottom-color: var(--blue); }

.stat-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 760px) { .stat-cards { grid-template-columns: repeat(4, 1fr); } }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px; }
.stat-card .n { font-size: 1.6rem; font-weight: 700; color: var(--navy); line-height: 1.1; letter-spacing: -.02em; }
.stat-card .l { font-size: .74rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); font-weight: 600; }

/* messages */
.convo-list { display: flex; flex-direction: column; gap: 10px; }
.convo {
  display: flex; gap: 14px; padding: 16px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--r); text-decoration: none; color: inherit; align-items: center;
}
.convo:hover { border-color: var(--blue); text-decoration: none; }
.convo.unread { border-left: 3px solid var(--blue); }
.convo-thumb { width: 50px; height: 50px; border-radius: var(--r-sm); object-fit: cover; background: var(--bg-soft); flex-shrink: 0; }
.convo-main { min-width: 0; flex: 1; }
.convo-main .who { font-weight: 600; color: var(--navy); font-size: .94rem; }
.convo-main .sub { font-size: .82rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thread { display: flex; flex-direction: column; gap: 12px; margin: 24px 0; }
.msg { max-width: 80%; padding: 12px 15px; border-radius: var(--r-lg); font-size: .93rem; line-height: 1.5; }
.msg .when { display: block; font-size: .72rem; opacity: .68; margin-top: 6px; }
.msg-them { background: var(--bg-soft); border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg-me { background: var(--navy); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }

.photo-strip { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0 0; }
.photo-strip figure { margin: 0; position: relative; width: 100px; }
.photo-strip img { width: 100px; height: 78px; object-fit: cover; border-radius: var(--r-sm); border: 1px solid var(--line); }
.photo-strip button { margin-top: 6px; width: 100%; }

/* steps */
.steps { counter-reset: step; display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { }
.step::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--blue-50); color: var(--blue); font-weight: 700; font-size: .9rem; margin-bottom: 14px;
}
.step h3 { margin-bottom: 8px; }
.step p { margin: 0; font-size: .93rem; color: var(--ink-2); }

.prose { max-width: 720px; }
.prose h2 { margin-top: 36px; font-size: 1.2rem; }
.prose h3 { margin-top: 24px; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 7px 0; }
.prose .lede { font-size: 1.1rem; color: var(--ink-2); }
.prose table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: .92rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.prose th { background: var(--bg-soft); }

/* ------------------------------------------------------------ footer */
.site-footer { background: var(--navy); color: #A9BDD2; margin-top: 60px; padding: 48px 0 26px; font-size: .9rem; }
.site-footer h4 { color: #fff; font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 14px; font-weight: 600; }
.site-footer a { color: #A9BDD2; }
.site-footer a:hover { color: #fff; }
.footer-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-logo img.mark { height: 34px; width: auto; }
.footer-logo img.word { height: 17px; width: auto; }
/* minmax(0, ...) rather than a bare 1fr: a grid item defaults to a minimum of
   its own min-content, so the subscribe form was refusing to shrink and pushing
   the whole footer 42px past the right edge of a phone screen. */
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 30px; }
@media (min-width: 560px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 860px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr minmax(0, 1.4fr); } }
.footer-grid nav { min-width: 0; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 8px 0; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.12); margin-top: 34px; padding-top: 20px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; font-size: .8rem; color: #7E96AF;
}
.subscribe-form { display: flex; gap: 8px; margin-top: 12px; }
.subscribe-form input {
  flex: 1; min-width: 0; height: 40px; border: 1px solid rgba(255,255,255,.2); background: rgba(255,255,255,.07);
  border-radius: var(--r); padding: 0 13px; color: #fff; font-family: inherit; font-size: .9rem;
}
.subscribe-form input::placeholder { color: #7E96AF; }
.subscribe-form input:focus { outline: none; border-color: var(--sky); }

/* ------------------------------------------------------------ mobile bar */
.mobile-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 70;
  background: rgba(255,255,255,.97); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line); display: flex;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
.mobile-bar a {
  flex: 1; text-align: center; padding: 5px 2px; font-size: .67rem; font-weight: 600;
  color: var(--ink-3); text-decoration: none;
}
.mobile-bar a .ico { display: block; font-size: 1.1rem; line-height: 1.3; }
.mobile-bar a.active { color: var(--blue); }
body { padding-bottom: 62px; }
@media (min-width: 900px) { .mobile-bar { display: none; } body { padding-bottom: 0; } }

/* ------------------------------------------------------------ admin */
.admin-header { background: var(--navy); color: #fff; }
.admin-header .container { display: flex; align-items: center; gap: 16px; height: 58px; }
.admin-header a { color: #A9BDD2; font-weight: 500; font-size: .88rem; }
.admin-header a:hover { color: #fff; }
.admin-header .brand { display: flex; align-items: center; gap: 10px; margin-right: auto; color: #fff; font-weight: 600; font-size: .95rem; }
.admin-header .brand img { height: 26px; width: auto; }
.admin-nav { background: var(--navy-700); }
.admin-nav .container { display: flex; gap: 2px; overflow-x: auto; }
.admin-nav a {
  padding: 12px 15px; color: #C2D4E5; font-weight: 600; font-size: .86rem; white-space: nowrap;
  border-bottom: 2px solid transparent; text-decoration: none;
}
.admin-nav a.active, .admin-nav a:hover { color: #fff; border-bottom-color: var(--sky); text-decoration: none; }
.admin-body { padding: 32px 0 70px; }

details.mod summary { cursor: pointer; font-weight: 600; font-size: .88rem; color: var(--blue-600); }
details.mod[open] summary { margin-bottom: 12px; }

.inline-form { display: inline; }
.divider { height: 1px; background: var(--line); margin: 26px 0; border: 0; }

@media print { .site-header, .main-nav, .mobile-bar, .site-footer { display: none !important; } }


/* ------------------------------------------------------------- skip link */
/* Off-screen until focused, then it drops into the top-left corner. Lets a
   keyboard user jump the header and search box straight to the page content. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 200;
  padding: 11px 18px;
  border-radius: 0 0 var(--r) var(--r);
  background: var(--navy);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  transition: top 140ms ease;
}
.skip-link:focus { top: 0; outline: 3px solid var(--aqua); outline-offset: 2px; }

/* --------------------------------------------- very narrow phones (<=380px) */
/* On an iPhone SE the logo, the Apply button and the menu button together were
   46px wider than the screen, so every page scrolled sideways. Tightening the
   logo and the button padding gets it back inside without dropping anything a
   visitor needs. */
@media (max-width: 380px) {
  .header-bar { gap: 8px; }
  .logo img { height: 24px; }
  .header-actions { gap: 6px; }
  .header-actions .btn-sm { padding: 8px 11px; font-size: .8rem; }
}

/* ------------------------------------------- Ask Another Pool Pro (Q&A) */
.qa-list { display: grid; gap: 14px; margin-top: 14px; }
.qa-item {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 18px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px;
}
.qa-count {
  text-align: center; align-self: start; padding: 10px 6px; border-radius: 10px;
  background: var(--bg-soft); line-height: 1.15;
}
.qa-count strong { display: block; font-size: 1.35rem; }
.qa-count span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
/* An unanswered question is the one a member can actually help with, so it is
   flagged rather than hidden. */
.qa-count.is-empty { background: var(--warn-bg); color: var(--warn-ink); }
.qa-title { font-size: 1.12rem; margin: 0 0 6px; }
.qa-excerpt { margin: 0 0 8px; color: var(--ink-2); }
.qa-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 0; }
.qa-question h1 { margin-top: 0; }
.qa-answer { margin-top: 12px; }
.qa-answer.is-best { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.qa-best-flag { color: var(--good); margin: 0 0 8px; }
@media (max-width: 560px) {
  .qa-item { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .qa-count { display: inline-flex; gap: 6px; align-items: baseline; padding: 5px 10px; }
  .qa-count strong { display: inline; font-size: 1rem; }
}
