/* Gigxie — shared components */

/* The UA's [hidden] rule is display:none at zero specificity, so any class that
   sets display (flex/grid/block) beats it and renders "hidden" elements at full
   size. One global guard instead of one patch per component. */
[hidden] { display: none !important; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding-inline: 24px;
  border-radius: var(--r-btn);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease), box-shadow var(--ease);
}
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Hover states are gated on :not(:disabled) — an in-flight button must not light
   up under the cursor as if it were still takeable. */
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:not(:disabled):hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:not(:disabled):hover { border-color: var(--brand); color: var(--brand); }
.btn-accent { background: var(--accent); color: var(--ink); }
.btn-accent:not(:disabled):hover { background: var(--accent-dark); color: var(--ink); }
.btn-sm { height: 36px; padding-inline: 16px; font-size: 14px; }
.btn-lg { height: 52px; padding-inline: 30px; font-size: 16px; }
.btn-block { width: 100%; }
/* in-flight buttons (auth submit, "Start selling") — visibly not takeable */
.btn:disabled { opacity: .6; cursor: progress; }
.btn > .btn-spinner { margin-right: 0; } /* .btn already supplies the 8px gap */

/* ============ Gig card ============ */
.gig-card {
  display: flex;
  flex-direction: column;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--ease), transform var(--ease), border-color var(--ease);
}
.gig-card:hover,
.gig-card:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.gig-thumb { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-soft); }
.gig-thumb svg { width: 100%; height: 100%; }
.gig-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 16px 16px; flex: 1; }
.gig-seller { display: flex; align-items: center; gap: 8px; }
.gig-seller-name { font-size: 14px; font-weight: 600; color: var(--ink); }
.gig-title {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 44px;   /* two 15px/1.45 lines, rounded onto the 4px grid */
}
a.gig-title-link { color: inherit; }
a.gig-title-link:hover .gig-title { color: var(--brand); }
a.gig-title-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.gig-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.gig-price { font-size: 13px; color: var(--muted); }
.gig-price strong { font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--ink); margin-left: 4px; }

.gig-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gig-delivery {
  font-size: 12px;
  font-weight: 600;
  color: var(--body);
  background: var(--bg-soft);
  border-radius: var(--r-pill);
  padding: 4px 8px;
  white-space: nowrap;
}

/* ============ Stars ============ */
.stars { display: inline-flex; align-items: center; gap: 5px; }
.stars svg { width: 15px; height: 15px; fill: var(--star); flex: none; }
.stars-score { font-size: 14px; font-weight: 700; color: var(--ink); }
.stars-count { font-size: 14px; color: var(--muted); }
/* Five-glyph row (starRowHTML) — empty stars keep the shape, drop the fill */
.star-row { display: inline-flex; align-items: center; gap: 2px; }
.star-row svg { width: 15px; height: 15px; fill: var(--star); flex: none; }
.star-row svg.is-empty { fill: #D8D8E4; }
.star-row-lg svg { width: 20px; height: 20px; }

/* ============ Avatar ============ */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  flex: none;
  user-select: none;
}
.avatar-xs { width: 20px; height: 20px; font-size: 9px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar-xl { width: 96px; height: 96px; font-size: 32px; }

/* ============ Badges ============ */
.badge-level {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  background: var(--brand-tint);
  color: var(--brand-dark);
  white-space: nowrap;
}
.badge-level--top { background: #FFF4E0; color: #8A5200; }
/* Paid placement, disclosed. Deliberately readable rather than decorative — a label a
   buyer has to hunt for is not a disclosure. Rendered by gigCardHTML from the API's own
   `promoted` flag; see routes/gigs.js. */
.badge-promoted {
  display: inline-flex;
  align-self: flex-start;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  background: #F1F1F6;
  color: #4A4A63;
}
.badge-accent {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 700;
  background: var(--accent);
  color: var(--ink);
}

/* ============ Category cards ============ */
.cat-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  transition: box-shadow var(--ease), transform var(--ease), border-color var(--ease);
}
.cat-card:hover, .cat-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: transparent;
}
.cat-card:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--brand-wash);
  color: var(--brand);
  margin-bottom: 8px;
  transition: background var(--ease), color var(--ease);
}
.cat-card:hover .cat-icon { background: var(--brand); color: #fff; }
.cat-icon svg { width: 24px; height: 24px; }
.cat-card h3 { font-size: 20px; }
.cat-card p { font-size: 14px; color: var(--body); line-height: 1.55; }

/* Demo build: links with no destination announce + toast instead of jumping nowhere */
a[aria-disabled="true"] { cursor: default; }

/* ============ Chips ============ */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip:not(.chip-save)[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-save {
  border: 0;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--muted);
  background: transparent;
  transition: color var(--ease), transform var(--ease);
}
.chip-save:hover { color: var(--danger); background: transparent; }
.chip-save.is-saved { color: var(--danger); font-weight: 600; }
.chip-save:active { transform: scale(.94); }

/* ============ Tabs ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tab {
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--ease), border-color var(--ease);
}
.tab:hover { color: var(--ink); }
.tab:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.tab[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); }

/* ============ Accordion (details/summary) ============ */
.accordion { border-top: 1px solid var(--line); }
.accordion details { border-bottom: 1px solid var(--line); }
.accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  transition: color var(--ease);
}
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after {
  content: "";
  flex: none;
  width: 10px; height: 10px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform var(--ease);
  margin-right: 4px;
}
.accordion details[open] summary::after { transform: rotate(225deg); }
.accordion summary:hover { color: var(--brand); }
.accordion summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.accordion .accordion-body { padding: 0 4px 20px; max-width: 70ch; }
/* Body opens on the same 200ms clock as the chevron (progressive: no-op where unsupported) */
.accordion details::details-content {
  block-size: 0;
  overflow: hidden;
  transition: block-size var(--ease), content-visibility var(--ease) allow-discrete;
  interpolate-size: allow-keywords;
}
.accordion details[open]::details-content { block-size: auto; }

/* ============ Breadcrumbs ============ */
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 14px; }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--brand); }
.breadcrumbs li { display: flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before { content: "/"; color: var(--line); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 500; }
/* On a narrow screen the current-page crumb wraps to two lines and leaves its
   "/" separator stranded beside them — truncate it instead. */
@media (max-width: 640px) {
  .breadcrumbs li { min-width: 0; }
  .breadcrumbs [aria-current="page"] { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 16px);
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease), transform var(--ease);
  z-index: 300;
  max-width: min(90vw, 480px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ============ Skip link ============ */
.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 400;
  padding: 12px 20px;
  border-radius: var(--r-btn);
  background: var(--ink);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: top var(--ease);
}
.skip-link:focus { top: 16px; color: #fff; }

/* ---- Reserved space for the injected header and category strip ----
   shared.js builds both on DOMContentLoaded and swaps them in for these placeholders.
   Until it does, the slots are empty divs of zero height, so on a cold load the entire
   page steps down by the header's 73px (and by another 49.4px on home and browse) the
   instant the script runs — measured at 0.58 CLS on index.html and 0.43 on browse.html.
   Giving the slots the height their replacement will occupy makes the swap invisible.
   These four numbers are not free-standing: 73 = .header-inner's 72px + .site-header's
   1px border, 65 = the same at the 900px breakpoint, 49.4 = .cat-strip a's 12+12px
   padding + 2px border + a 22.4px line box (14px x the 1.6 body line-height) + 1px on
   .cat-strip. Change either side and change the other. */
#header-slot { height: 73px; }
#catstrip-slot { height: 49.4px; }
@media (max-width: 900px) { #header-slot { height: 65px; } }

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid transparent;
  transition: border-color var(--ease), box-shadow var(--ease);
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: 0 1px 3px rgba(14,14,26,.05); }
.header-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo {
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1;
  flex: none;
  transition: color var(--ease);
}
/* inherits a:hover (--brand-dark) — the old override to --ink left the header and
   footer logo with no hover feedback at all */
.logo .logo-dot { color: var(--brand); }

.header-search { flex: 1; display: flex; max-width: 560px; min-width: 0; }
.header-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: var(--r-input) 0 0 var(--r-input);
  background: var(--bg);
  color: var(--ink);
  transition: border-color var(--ease);
}
.header-search input::placeholder { color: var(--muted); }
.header-search input:hover { border-color: #CFCFE0; }
.header-search input:focus { outline: none; border-color: var(--brand); }
.header-search input:focus-visible { outline: none; }
.header-search button {
  width: 48px;
  height: 44px;
  border-radius: 0 var(--r-input) var(--r-input) 0;
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--ease);
}
.header-search button:hover { background: var(--brand); }
.header-search button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.header-search button svg { width: 18px; height: 18px; }

.header-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: none; }
.header-nav > a:not(.btn) {
  padding: 8px 12px;
  border-radius: var(--r-btn);
  font-size: 15px;
  font-weight: 600;
  color: var(--body);
  transition: color var(--ease), background var(--ease);
}
.header-nav > a:not(.btn):hover { color: var(--brand); background: var(--brand-tint); }
.header-nav > a:not(.btn):focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.hamburger {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-btn);
  color: var(--ink);
  flex: none;
  transition: background var(--ease);
}
.hamburger:hover { background: var(--bg-soft); }
.hamburger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hamburger svg { width: 24px; height: 24px; }

@media (max-width: 900px) {
  .hamburger { display: inline-flex; }
  .header-nav > a:not(.btn) { display: none; }
  .header-inner { gap: 12px; height: 64px; }
}
@media (max-width: 640px) {
  /* the drawer's copy of the search form is the only search on small screens */
  .header-search:not(.drawer-search) { display: none; }
  .header-inner { justify-content: space-between; }
  .header-nav { margin-left: 0; }
}

/* ============ Category strip ============ */
.cat-strip { background: var(--bg); border-bottom: 1px solid var(--line); }
.cat-strip-inner {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cat-strip-inner::-webkit-scrollbar { display: none; }
.cat-strip a {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--body);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--ease), border-color var(--ease);
}
.cat-strip a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.cat-strip a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--brand); }
.cat-strip a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

/* ============ Footer ============ */
.site-footer { background: var(--bg); border-top: 1px solid var(--line); padding: 64px 0 32px; }
.footer-cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}
@media (max-width: 1000px) { .footer-cols { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
.footer-cols h2 {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 16px;
  letter-spacing: 0;
}
.footer-cols ul { list-style: none; padding: 0; display: grid; gap: 12px; }
.footer-cols a { font-size: 14px; color: var(--body); }
.footer-cols a:hover { color: var(--brand); }
.footer-bottom {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.footer-bottom .copyright { font-size: 14px; color: var(--muted); }
.footer-social { display: flex; gap: 6px; margin-left: auto; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--body);
  transition: color var(--ease), background var(--ease);
}
.footer-social a:hover { color: var(--brand); background: var(--brand-tint); }
.footer-social svg { width: 18px; height: 18px; fill: currentColor; }
@media (max-width: 640px) {
  .footer-bottom { justify-content: center; text-align: center; }
  .footer-social { margin-left: 0; }
}

/* ============ Auth modal ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(14, 14, 26, .55);
  opacity: 0;
  pointer-events: none;
  /* visibility keeps the closed dialog's fields out of the tab order; delayed so the fade still plays */
  visibility: hidden;
  transition: opacity var(--ease), visibility 0s linear 200ms;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
  transition: opacity var(--ease), visibility 0s;
}
.modal {
  /* never wider than the phone it opens on: the overlay is a flex box, so a
     min-content floor would otherwise push the dialog past the viewport */
  width: min(420px, calc(100vw - 32px));
  min-width: 0;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: var(--bg);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-hover);
  transform: translateY(12px) scale(.98);
  transition: transform var(--ease);
}
.modal-overlay.open .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-head h2 { font-size: 24px; }
.modal-head p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.modal-x {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--muted);
  flex: none;
  transition: background var(--ease), color var(--ease);
}
.modal-x:hover { background: var(--bg-soft); color: var(--ink); }
.modal-x:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.modal-x svg { width: 18px; height: 18px; }
.modal .tabs { margin: 16px 0 20px; }
.modal .tab { flex: 1; text-align: center; }

.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field input, .field textarea, .field select {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-input);
  background: var(--bg);
  color: var(--ink);
  transition: border-color var(--ease);
  width: 100%;
}
.field textarea { height: auto; padding: 12px 14px; resize: vertical; }
.field input:hover, .field textarea:hover, .field select:hover { border-color: #CFCFE0; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.field input::placeholder, .field textarea::placeholder { color: var(--muted); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  margin: 18px 0;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.btn-social {
  width: 100%;
  justify-content: center;
  background: var(--bg);
  color: var(--ink);
  border-color: var(--line);
  margin-bottom: 10px;
}
.btn-social:hover { border-color: var(--ink); background: var(--bg-soft); color: var(--ink); }
.btn-social svg { width: 18px; height: 18px; flex: none; }
/* .btn (display:inline-flex) and .divider (display:flex) both outrank the [hidden]
   default, so hiding them from JS needs saying explicitly. */
.btn-social[hidden], .divider[hidden] { display: none; }
.modal-fineprint { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; }
.modal-fineprint a { color: var(--body); text-decoration: underline; }

/* ============ Mobile drawer ============ */
.drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(14, 14, 26, .5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease);
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 160;
  width: min(320px, 85vw);
  background: var(--bg);
  padding: 24px;
  overflow-y: auto;
  transform: translateX(-100%);
  /* visibility keeps the off-screen menu out of the tab order; delayed so the slide still plays */
  visibility: hidden;
  transition: transform 250ms ease, visibility 0s linear 250ms;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer.open {
  transform: none;
  visibility: visible;
  transition: transform 250ms ease, visibility 0s;
}
.drawer-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.drawer nav { display: flex; flex-direction: column; }
.drawer nav a {
  padding: 12px 10px;
  border-radius: var(--r-btn);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  transition: background var(--ease), color var(--ease);
}
.drawer nav a:hover { background: var(--brand-tint); color: var(--brand-dark); }
.drawer nav a:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.drawer .drawer-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 18px 10px 6px;
}
.drawer .btn { margin-top: 8px; }
/* .header-search is flex:1 for the header's row — the drawer is a column, so it
   would stretch to full height. */
.drawer .drawer-search { flex: none; max-width: none; margin-bottom: 4px; }

/* ============ Carousel scaffolding ============ */
.carousel {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  /* overflow-x:auto forces overflow-y:auto — pad (and negative-margin back) so the
     card hover lift and its shadow aren't clipped by the scroll container */
  padding: 16px 0 44px;
  margin: -16px 0 -36px;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > * { scroll-snap-align: start; flex: 0 0 286px; }
.carousel-btns { display: flex; gap: 8px; }
.carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color var(--ease), color var(--ease), background var(--ease);
}
.carousel-btn:hover { border-color: var(--brand); color: var(--brand); }
.carousel-btn[disabled] { opacity: .4; cursor: default; border-color: var(--line); color: var(--muted); }
.carousel-btn[disabled]:hover { border-color: var(--line); color: var(--muted); }
.carousel-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.carousel-btn svg { width: 16px; height: 16px; }

/* Auth modal — real-session extras */
.field[hidden] { display: none; }
.btn-spinner {
  width: 15px;
  height: 15px;
  margin-right: 8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  display: inline-block;
  vertical-align: -2px;
  animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .btn-spinner { animation-duration: 2s; } }
.auth-error {
  display: flex;
  gap: 8px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--r-input);
  background: var(--danger-wash);
  color: #A3282C;
  font-size: 14px;
  line-height: 1.45;
}
.auth-error[hidden] { display: none; }

/* Password-strength hint + the forgot-password link. Same shape as .auth-error so the
   modal keeps its rhythm; the hint is advisory only — server/passwords.js is the rule. */
.auth-hint { margin: 6px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.auth-hint[hidden] { display: none; }
.auth-hint[data-level="weak"] { color: var(--danger-ink); }
.auth-hint[data-level="strong"] { color: var(--brand); }
.auth-note {
  margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r-input);
  background: var(--bg-soft); color: var(--body); font-size: 14px; line-height: 1.45;
}
.auth-note[hidden] { display: none; }
.auth-alt { margin: 12px 0 0; text-align: center; font-size: 13px; }
.auth-alt button {
  background: none; border: 0; padding: 0; font: inherit;
  color: var(--body); text-decoration: underline; cursor: pointer;
}
.auth-alt button:hover { color: var(--brand); }
.auth-alt[hidden] { display: none; }

/* Signed-in header slot */
.header-user { display: inline-flex; align-items: center; gap: 4px; }
.header-user a {
  padding: 8px 12px;
  border-radius: var(--r-btn);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  transition: color var(--ease), background var(--ease);
}
.header-user a:hover { color: var(--brand); background: var(--brand-tint); }
.header-user a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.header-user-name { padding-inline: 8px; font-size: 15px; font-weight: 600; color: var(--muted); }
.header-user { position: relative; }
.header-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  transition: border-color var(--ease), background var(--ease);
}
.header-user-btn:hover { border-color: var(--brand); background: var(--brand-tint); }
.header-user-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.header-user-btn .avatar { width: 32px; height: 32px; font-size: 13px; }
.header-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 60;
  min-width: 184px;
  padding: 6px;
  display: grid;
  gap: 2px;
  border-radius: var(--r-card);
  border: 1px solid var(--line);
  background: var(--bg);
  box-shadow: var(--shadow-hover);
}
.header-menu[hidden] { display: none; }
.header-menu a,
.header-menu button {
  display: block;
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--r-btn);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  text-align: left;
  transition: color var(--ease), background var(--ease);
}
.header-menu a:hover,
.header-menu button:hover { color: var(--brand); background: var(--brand-tint); }
.header-menu a:focus-visible,
.header-menu button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.header-menu [data-logout] { border-top: 1px solid var(--line); border-radius: 0 0 var(--r-btn) var(--r-btn); margin-top: 4px; padding-top: 11px; }
@media (max-width: 900px) {
  .header-user-name { display: none; }
}

/* ============ Empty state (browse grid, gig 404, seller 404) ============ */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 24px 88px;
}
.empty-state svg { width: 160px; height: 160px; margin: 0 auto 24px; }
/* h1 when the empty state replaces the page's own heading (gig/seller 404) */
.empty-state h1,
.empty-state h2 { font-size: 24px; margin-bottom: 8px; }   /* on the scale: h4 / --fs-h3 at ≤720px */
.empty-state p { color: var(--body); max-width: 46ch; margin: 0 auto 24px; }

/* display:inline-flex would otherwise beat the hidden attribute */
.badge-level[hidden] { display: none; }
