/* ============================================================
   Koura — plain CSS.
   No Tailwind, no preprocessor. Edit this file directly and the
   dev watcher copies it to priv/static/assets/css/app.css.

   Tokens live in :root; everything below is small, semantic, and
   reusable. If a one-off needs styling, prefer adding a class
   here over inlining a style.
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-elev-2: #f3f5f8;
  --border: #e1e4ea;
  --border-strong: #c5cad3;
  --text: #1c2230;
  --text-muted: #5a6478;
  --text-faint: #8b94a5;
  --link: #2c5fcb;
  --primary: #2c5fcb;
  --primary-text: #ffffff;
  --primary-hover: #224dab;
  --danger: #c0354a;
  --danger-bg: #fbe9ec;
  --success: #2e7c5a;
  --success-bg: #e6f4ec;
  --warn: #8a5300;
  --warn-bg: #fcefd6;
  --warn-border: #e8c98a;
  --info: #2c5fcb;
  --info-bg: #e7eefb;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  --gap: 1rem;
  --gap-sm: 0.5rem;
  --gap-lg: 1.5rem;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
}

/* Reset / base ------------------------------------------------ */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 { margin: 0 0 0.5rem; font-weight: 600; line-height: 1.25; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.75rem; }

hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }

/* LiveView wrappers don't generate layout boxes */
[data-phx-session], [data-phx-teleported-src] { display: contents; }

/* Layout ------------------------------------------------------ */

.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 1rem 1.25rem 4rem;
}

.app-nav {
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
}

.app-nav-inner {
  max-width: 920px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.app-nav .nav-brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

.app-nav .nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.app-nav .nav-links a {
  color: var(--text);
  font-size: 0.9rem;
}

.app-nav .nav-links .nav-email {
  color: var(--text-faint);
  font-size: 0.85rem;
}

/* Generic stacks */
.stack > * + * { margin-top: var(--gap); }
.stack-sm > * + * { margin-top: var(--gap-sm); }
.stack-lg > * + * { margin-top: var(--gap-lg); }

.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap);
  align-items: center;
}

.row-tight { display: flex; gap: var(--gap-sm); flex-wrap: wrap; align-items: center; }

.row-between {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--gap);
  flex-wrap: wrap;
}

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.small { font-size: 0.85rem; }
.mono  { font-family: var(--mono); }

/* Quiet link — looks like body text, hover hints it's clickable.
   Used for low-emphasis triggers like "check now" next to a timestamp. */
.link-quiet {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: var(--text-faint);
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.link-quiet:hover { text-decoration-color: currentColor; }

/* Strip native button chrome — used together with `.link-quiet` on
   classic-mode submit buttons that should look like inline links. */
.button-as-link {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.button-as-link[disabled] { opacity: 0.6; cursor: progress; }

/* Header (page) ----------------------------------------------- */

.page-header {
  margin-bottom: 1.5rem;
}
.page-header h1 { margin-bottom: 0.25rem; }
.page-header .subtitle { color: var(--text-muted); font-size: 0.9rem; }

/* Buttons ----------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.1s, border-color 0.1s;
}
.btn:hover { background: var(--bg-elev-2); text-decoration: none; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--primary-text);
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-elev); }

.btn-sm { padding: 0.3rem 0.6rem; font-size: 0.82rem; }

/* Square icon-only buttons (edit / delete on list rows). */
.btn-icon {
  line-height: 1;
  padding: 0.35rem 0.5rem;
  font-size: 0.95rem;
}
.btn-icon.btn-sm { padding: 0.3rem 0.45rem; }

/* Cards ------------------------------------------------------- */

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

/* Listings: search-on-top + left filter sidebar + results main.
   The filter <form> is display:contents so its two children (the top
   search bar and the sidebar) drop into the grid alongside the results. */
.listings-layout {
  /* Break out of the 920px page container so the results area is wide
     enough for 3–4 cards next to the filter sidebar. */
  width: min(1320px, 95vw);
  margin-left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-areas:
    "search search"
    "filters main";
  column-gap: 1.75rem;
  row-gap: 1rem;
  align-items: start;
}

.listings-filter-form {
  display: contents;
}

/* Search bar reads as a single field spanning the top. */
.lg-search {
  grid-area: search;
}

.lg-search input {
  font-size: 1.05rem;
  padding: 0.7rem 0.9rem;
}

/* Sidebar: no box — flush sections separated by hairlines. Sticky, and
   scrolls on its own when taller than the viewport so the lower filters
   stay reachable. */
.lg-filters {
  grid-area: filters;
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.5rem;
}

.lg-main {
  grid-area: main;
  min-width: 0;
  transition: opacity 0.15s ease;
}

.lg-main.is-loading {
  opacity: 0.45;
  pointer-events: none;
}

.filter-section {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border);
}

.filter-section:first-child {
  padding-top: 0;
}

.filter-section:last-child {
  border-bottom: none;
}

.filter-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.filter-heading {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.filter-clear {
  font-size: 0.78rem;
  color: var(--link);
}

.filter-advanced {
  margin-top: 0.5rem;
}

.filter-advanced > summary {
  margin-bottom: 0.4rem;
}

/* Category tree: collapsible roots, hoverable rows, custom caret. */
.category-tree {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.category-group > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.4rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
}

.category-group > summary:hover {
  background: var(--bg-elev-2);
}

.category-group > summary::-webkit-details-marker {
  display: none;
}

.category-group > summary::before {
  content: "▸";
  color: var(--text-faint);
  font-size: 0.7rem;
  transition: transform 0.12s ease;
}

.category-group[open] > summary::before {
  transform: rotate(90deg);
}

.category-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.28rem 0.4rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
}

.category-row:hover {
  background: var(--bg-elev-2);
}

.category-row span,
.category-group > summary span {
  font-size: 0.9rem;
}

.category-child {
  padding-left: 1.9rem;
}

.category-child span {
  color: var(--text-muted);
}

/* Bigger, easier-to-hit checkboxes. */
.category-tree input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
  flex: none;
}

@media (max-width: 800px) {
  .listings-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "search"
      "filters"
      "main";
  }

  .lg-filters {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

/* Source-stats tiles */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.stat {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1rem;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.stat-sub {
  margin-top: 0.1rem;
}

.ok {
  color: var(--success);
}

.empty {
  background: var(--bg-elev);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
}

.banner {
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}
.banner-error { border-color: var(--danger); background: var(--danger-bg); }
.banner-info  { border-color: var(--info);   background: var(--info-bg); }

/* Forms ------------------------------------------------------- */

.form-row { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 1rem; }
.form-row > label { font-size: 0.85rem; color: var(--text-muted); }

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.5rem 0.65rem;
  font: inherit;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79, 125, 209, 0.25);
}
.form-input[aria-invalid="true"],
.form-input.has-error { border-color: var(--danger); }

.form-check {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  cursor: pointer;
}
.form-check input[type="checkbox"] { width: 1rem; height: 1rem; }

.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 0.25rem; }

/* Lists ------------------------------------------------------- */

.list { list-style: none; margin: 0; padding: 0; }
.list > li {
  padding: 0.8rem 0;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
}
.list > li:first-child { border-top: 0; }

.list-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
  background: var(--bg-elev-2);
}

.list-body { flex: 1; min-width: 0; }
.list-title { font-weight: 600; }
.list-meta {
  color: var(--text-muted);
  font-size: 0.82rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.2rem;
}

/* Keep the location and its drive time on one shared line so they never
   wrap apart from each other. */
.list-meta-location {
  flex-basis: 100%;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.6rem;
}

.list-row-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

/* Listing price ---------------------------------------------- */

.listing-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.15;
  white-space: nowrap;
}
.listing-price .price-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.listing-price .price-value {
  font-size: 1.2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.listing-price .price-sub {
  font-size: 0.75rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.listing-price.has-bid .price-value { color: var(--success); }
.listing-price.starting-only .price-value { color: var(--text); }
.listing-price.no-bid .price-value { color: var(--text-faint); font-weight: 600; }

/* The all-in (incl. VAT + premium) estimate — deliberately prominent so
   the real cost, not the bare bid, anchors the decision. */
.listing-price .price-allin {
  margin-top: 0.25rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 0.15rem 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.listing-price .price-allin-amount {
  font-size: 1.05rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.listing-price .price-allin-tag {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  opacity: 0.85;
}
.listing-price .price-exvat { margin-top: 0.1rem; }

/* Card grid + cards ------------------------------------------ */

.listing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.listing-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.listing-card-image {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  background: var(--bg-elev-2);
  overflow: hidden;
}
.listing-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.listing-card-image-placeholder {
  color: var(--text-faint);
  font-size: 0.85rem;
}

.listing-card-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  flex: 1;
}
.listing-card .listing-price { align-items: flex-start; }

.clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Listing body text keeps the line breaks the source authored. */
.listing-description { white-space: pre-line; }

/* Favourite heart -------------------------------------------- */

.fav-btn {
  appearance: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0 0.15rem;
  line-height: 1;
  font-size: 1.25rem;
  color: var(--text-faint);
  transition: color 0.12s ease, transform 0.12s ease;
}
.fav-btn:hover { color: var(--danger); transform: scale(1.12); }
.fav-btn.is-fav { color: var(--danger); }

/* Heart overlaid on a card's image. The wrapper is the positioned
   element so the htmx swap (which replaces only the button) keeps its
   place. */
.listing-card { position: relative; }
.fav-overlay {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: var(--bg-elev);
  border-radius: 999px;
  width: 1.9rem;
  height: 1.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.closing-soon { color: var(--danger); font-weight: 600; }

/* Recommendation: "in your interests" badge */
.badge-interest {
  background: var(--success-bg);
  color: var(--success);
  border-color: var(--success);
}

/* Segmented toggle ------------------------------------------- */

.segment {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.segment > button,
.segment > a {
  background: var(--bg-elev);
  border: 0;
  padding: 0.32rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
}
.segment > :not(:first-child) { border-left: 1px solid var(--border); }
.segment > button:hover,
.segment > a:hover { background: var(--bg-elev-2); }
.segment > button[aria-pressed="true"],
.segment > a[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-text);
}

/* Sort control (panel header) -------------------------------- */

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0;
}
.sort-control select {
  font: inherit;
  font-size: 0.82rem;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
}

/* Infinite scroll sentinel ------------------------------------ */

.scroll-sentinel {
  display: flex;
  justify-content: center;
  padding: 1.5rem 0;
}
.listing-grid > .scroll-sentinel { grid-column: 1 / -1; }
.list > li.scroll-sentinel { border-top: 0; }

/* Onboarding --------------------------------------------------- */

.onboarding { max-width: 760px; margin: 0 auto; }

.onboarding-steps {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  margin: 0 0 2rem;
  padding: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.onboarding-steps li { display: flex; align-items: center; gap: 0.45rem; }
.onboarding-steps .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  font-size: 0.8rem;
}
.onboarding-steps li[aria-current="step"] { color: var(--text); font-weight: 600; }
.onboarding-steps li[aria-current="step"] .step-number {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
}

.interest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.8rem;
}

.interest-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.1rem 0.8rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: center;
  transition: border-color 120ms ease, background 120ms ease;
}
.interest-card:hover { background: var(--bg-elev-2); }
.interest-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.interest-card:has(input:checked) {
  border-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-elev));
}
.interest-card .interest-emoji { font-size: 1.8rem; }
.interest-card .interest-name { font-size: 0.9rem; font-weight: 600; }

/* Pickup list (used inside table cells) ---------------------- */

.pickup-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  font-size: 0.9rem;
}

/* Badges + flash --------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  background: var(--bg-elev-2);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  line-height: 1.4;
}
.badge-paused { color: var(--text-muted); }

/* Inline Phosphor icons — scale to font-size, inherit colour. */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.15em;
  flex-shrink: 0;
}

/* Watch lifecycle chips — the moving window made visible --------- */
.watch-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}
.stat {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.78rem;
  line-height: 1.5;
  background: var(--bg-elev-2);
  border: 1px solid var(--border);
  color: var(--text);
}
.stat .stat-label { color: var(--text-muted); }
.stat-new {
  background: var(--primary);
  border-color: transparent;
  color: var(--primary-text);
  font-weight: 600;
}
.stat-new .stat-label { color: rgba(255, 255, 255, 0.85); }
.stat-saved { background: var(--success-bg); border-color: transparent; color: var(--success); }
.stat-gone { color: var(--text-muted); opacity: 0.9; }

.cal-icon {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.95rem;
  text-decoration: none;
  opacity: 0.6;
}
.cal-icon:hover { opacity: 1; }

.flash-group {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 320px;
}

.flash {
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.flash-info  { border-color: var(--info);   background: var(--info-bg);   color: var(--text); }
.flash-error { border-color: var(--danger); background: var(--danger-bg); color: var(--text); }
.flash-title { font-weight: 600; margin-bottom: 0.15rem; }

[hidden] { display: none !important; }

/* Tables ------------------------------------------------------ */

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.92rem;
}

.table thead {
  background: var(--bg-elev-2);
}

.table th,
.table td {
  text-align: left;
  padding: 0.55rem 0.85rem;
  border-top: 1px solid var(--border);
  vertical-align: middle;
}

.table thead th {
  border-top: 0;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.table tbody tr:hover {
  background: var(--bg-elev-2);
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Disabled inputs ------------------------------------------- */
.form-input:disabled,
.form-select:disabled {
  background: var(--bg-elev-2);
  color: var(--text-faint);
  cursor: not-allowed;
}

/* LiveView loading states ------------------------------------ */

.phx-click-loading,
.phx-submit-loading,
.phx-change-loading {
  opacity: 0.7;
  transition: opacity 0.15s;
}

/* Detail-page gallery + lightbox ------------------------------ */

.gallery {
  display: flex;
  flex-direction: column;
  gap: var(--gap-sm);
}
.gallery-main {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--bg-elev-2);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: zoom-in;
}
.gallery-main img {
  display: block;
  width: 100%;
  max-height: 28rem;
  object-fit: contain;
}
.gallery-count {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  color: #fff;
  background: rgba(15, 23, 42, 0.7);
}
.gallery-thumbs {
  display: flex;
  gap: var(--gap-sm);
  overflow-x: auto;
  padding-bottom: 0.25rem;
}
.gallery-thumb {
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elev-2);
  overflow: hidden;
  cursor: pointer;
}
.gallery-thumb:hover {
  border-color: var(--border-strong);
}
.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 14, 24, 0.92);
}
.lightbox[hidden] {
  display: none;
}
body.lightbox-open {
  overflow: hidden;
}
.lightbox-img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: var(--radius);
}
.lightbox-close,
.lightbox-nav {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  cursor: pointer;
  line-height: 1;
  user-select: none;
}
.lightbox-close {
  top: 1rem;
  right: 1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  font-size: 1.5rem;
}
.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  font-size: 2rem;
}
.lightbox-prev {
  left: 1rem;
}
.lightbox-next {
  right: 1rem;
}
.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}
.lightbox-counter {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.85rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}
