/* ============================================================
   ARCHITECTURAL SURFACES — TRADE PORTAL
   Brand tokens aligned with the marketing website
   (architecturalsurfaces.com.au). The website is the source
   of truth for visual identity. The portal is its quieter,
   members-only sibling — same fonts, same spacing, forest
   replacing burgundy as the lead accent.

   See Branding/Design Tokens/tokens.css and patterns.md for
   the full system documentation.
   ============================================================ */

@font-face {
  font-family: 'Sinclaire';
  src: url('/fonts/Sinclaire-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Sinclaire';
  src: url('/fonts/Sinclaire-Bold.otf') format('opentype');
  font-weight: 700;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Verlag';
  src: url('/fonts/Verlag-Light.ttf') format('truetype');
  font-weight: 300;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'Coterie';
  src: url('/fonts/Coterie-Regular.otf') format('opentype');
  font-weight: 400;
  font-style: normal;
  font-display: block;
}

:root {
  /* ============================================================
     BRAND PALETTE (matches website tokens.css exactly)
     ============================================================ */
  --burgundy:    #401a0d;   /* primary — public website */
  --forest:      #273125;   /* primary — members portal (this file) */
  --rose:        #a68b85;   /* muted dusty rose */
  --bronze:      #8c6927;   /* warm metallic accent */
  --stone:       #bfbdb8;   /* neutral greige */
  --mint:        #5e8c6e;   /* soft sage accent */
  --pure-white:  #ffffff;

  /* ============================================================
     SURFACE & TEXT NEUTRALS
     ============================================================ */
  --bone:        #f4f1ec;   /* primary surface — page background */
  --paper:       #ebe6df;   /* secondary surface */
  --linen:       #e2dcd2;   /* tertiary surface, dividers */
  --mineral:     #1f1510;   /* deep burgundy-black — body text */
  --ink:         #140a06;   /* deepest — headings */
  --slate:       #6b6862;   /* secondary text */
  --whisper:     #a39e95;   /* fine print, labels */

  /* ============================================================
     SEMANTIC ALIASES (kept for compatibility with old class names)
     ============================================================ */
  --sage:        var(--mint);          /* sage now points at the brand mint */
  --sage-deep:   var(--forest);        /* portal: forest is the deep accent (not burgundy) */
  --sage-pale:   #d4dcd6;              /* pale forest wash */
  --travertine:  #c4a987;
  --marble:      #e8e3dc;
  --terracotta:  var(--bronze);

  /* ============================================================
     PORTAL ACCENT
     The portal leads with forest (where the website leads with
     burgundy). Override here so links, hover, focus rings all
     resolve to the portal's accent without touching component CSS.
     ============================================================ */
  --accent:       var(--forest);
  --accent-deep:  #1a201a;
  --accent-soft:  var(--mint);

  /* ============================================================
     LEGACY PORTAL TOKENS — re-pointed at brand-aligned values
     so every existing var(--color-*) reference keeps working,
     but now resolves to the brand palette.
     ============================================================ */
  --color-primary:     var(--forest);             /* was #273125 — same value, now brand-named */
  --color-primary-dk:  var(--accent-deep);        /* was #1d2620 */
  --color-accent:      var(--mint);               /* was #6B8F77 — now exact brand mint */
  --color-accent-lt:   #C4D5CA;                   /* portal-specific tint, no website equivalent */
  --color-burgundy:    var(--burgundy);           /* was #401a0d — exact website match */
  --color-dusty-pink:  var(--rose);               /* was #C4977F — now brand rose */
  --color-mustard:     var(--bronze);             /* was #C49A3C — now brand bronze */

  --color-bg:          var(--bone);               /* was #F7F6F3 → brand bone */
  --color-surface:     var(--pure-white);         /* unchanged — white panels still appropriate */
  --color-border:      var(--linen);              /* was #E0DDD8 → brand linen */
  --color-text:        var(--ink);                /* was #1A1A1A → brand ink */
  --color-text-muted:  var(--slate);              /* was undefined (fallback #888) — now defined */
  --color-muted:       var(--slate);              /* was #7A7670 → brand slate */
  --color-danger:      #C0392B;                   /* portal-specific error colour */

  /* ============================================================
     TYPOGRAPHY
     Sinclaire for headings (serif). Verlag for body and UI (sans).
     The previous setup mistakenly used Sinclaire for both — body
     text was rendering as serif everywhere. This fix is the
     biggest single visual change in this migration.
     ============================================================ */
  --font-serif:    'Sinclaire', 'Cormorant Garamond', 'Fraunces', Georgia, serif;
  --font-sans:     'Verlag', 'Inter Tight', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display:  'Coterie', 'Sinclaire', Georgia, serif;

  /* Aliases matching the website's variable names */
  --serif:    var(--font-serif);
  --sans:     var(--font-sans);
  --display:  var(--font-display);

  /* ============================================================
     SPACING (matches website's doubling scale)
     ============================================================ */
  --space-xs:   0.5rem;     /*   8px */
  --space-s:    1rem;       /*  16px */
  --space-m:    2rem;       /*  32px */
  --space-l:    4rem;       /*  64px */
  --space-xl:   8rem;       /* 128px */
  --space-2xl:  12rem;      /* 192px */

  /* ============================================================
     RADIUS (existing portal scale + missing tokens added)
     ============================================================ */
  --radius:      4px;       /* default — buttons, inputs, cards */
  --radius-sm:   2px;       /* fine details, was undefined */
  --radius-md:   8px;       /* mid-sized elements, was undefined */
  --radius-lg:   12px;      /* panels, modals (was 8px — bumped to match website) */

  /* ============================================================
     SHADOWS (matches website's dual-layer style)
     ============================================================ */
  --shadow:     0 1px 2px rgba(28, 31, 26, 0.06),
                0 8px 30px -8px rgba(28, 31, 26, 0.12);
  --shadow-lg:  0 4px 12px rgba(28, 31, 26, 0.08),
                0 20px 60px -20px rgba(28, 31, 26, 0.15);

  /* ============================================================
     LAYOUT
     ============================================================ */
  --max-width:  1440px;
  --pad-x:      clamp(1.25rem, 4vw, 3rem);
  --navbar-height: 64px;

  /* ============================================================
     MOTION (curves taken from the website for shared feel)
     ============================================================ */
  --ease-out:     cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out:  cubic-bezier(0.65, 0, 0.35, 1);
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 17px;
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
a.featured-panel:hover { text-decoration: none; }
img { max-width: 100%; display: block; }
textarea, input, select, button { font-family: inherit; }

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  background: var(--color-primary);
  color: white;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.nav-inner {
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo:hover { text-decoration: none; }

.nav-logo-mark {
  height: 38px;
  width: auto;
  display: block;
  flex-shrink: 0;
  filter: brightness(0) invert(1);
}

.nav-logo-rule {
  display: block;
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}

.nav-logo-wordmark {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 0.82rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1;
  white-space: nowrap;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1.5px solid var(--color-accent);
  color: var(--color-accent);
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  border-radius: 2px;
  flex-shrink: 0;
}

.logo-mark--lg {
  width: 56px;
  height: 56px;
  font-size: 1.1rem;
  margin: 0 auto;
}

.logo-text {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.nav-logo-img {
  height: 38px;
  width: auto;
  display: block;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color 0.2s;
}

.nav-link:hover { color: white; text-decoration: none; }
.nav-link--admin { color: var(--color-accent); }

.nav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255,255,255,0.2);
}

.nav-user-name {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-user-name:hover {
  color: white;
  text-decoration: none;
}

/* ============================================================
   BUTTONS — aligned with the marketing website
   Pill-shaped, generous padding, weight 500 type with subtle
   letter-spacing, ease-out hover translations. Mixed case (NOT
   uppercase). Mirrors the website's button system 1:1.
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  border-radius: 100px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: transform 0.3s var(--ease-out),
              background 0.3s var(--ease-out),
              color 0.3s var(--ease-out),
              border-color 0.3s var(--ease-out);
}

.btn:hover { text-decoration: none; }

.btn svg { transition: transform 0.3s var(--ease-out); }
.btn:hover svg { transform: translateX(3px); }

/* Primary — forest fill, bone text. Lift slightly on hover. */
.btn--primary {
  background: var(--forest);
  color: var(--bone);
  border-color: var(--forest);
}
.btn--primary:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: var(--bone);
  transform: translateY(-1px);
}

/* Outline — transparent on light, fills forest on hover */
.btn--outline {
  background: transparent;
  color: var(--forest);
  border-color: currentColor;
}
.btn--outline:hover {
  background: var(--forest);
  color: var(--bone);
  border-color: var(--forest);
}

/* Ghost — secondary action on LIGHT surfaces. Bordered, ink text. */
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: currentColor;
}
.btn--ghost:hover {
  background: var(--ink);
  color: var(--bone);
  border-color: var(--ink);
}

/* Ghost-light — for use on DARK surfaces (footer, dark sections) */
.btn--ghost-light {
  background: transparent;
  color: var(--bone);
  border-color: rgba(244, 241, 236, 0.4);
}
.btn--ghost-light:hover {
  background: var(--bone);
  color: var(--ink);
  border-color: var(--bone);
}

/* Light — bone fill on DARK surfaces */
.btn--light {
  background: var(--bone);
  color: var(--ink);
  border-color: var(--bone);
}
.btn--light:hover {
  background: transparent;
  color: var(--bone);
  border-color: var(--bone);
}

/* Danger */
.btn--danger {
  background: var(--color-danger);
  color: var(--pure-white);
  border-color: var(--color-danger);
}
.btn--danger:hover {
  background: #a52d22;
  border-color: #a52d22;
  color: var(--pure-white);
  transform: translateY(-1px);
}

/* Modifiers */
.btn--full { width: 100%; justify-content: center; }

.btn--sm {
  padding: 0.65rem 1.15rem;
  font-size: 0.825rem;
  gap: 0.45rem;
}

.btn--xs {
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  gap: 0.35rem;
}

/* Icon-only — circular, transparent, slate icon brightens to forest */
.btn--icon {
  padding: 0.5rem;
  background: transparent;
  border-color: transparent;
  color: var(--color-muted);
  border-radius: 100px;
}
.btn--icon:hover {
  color: var(--color-primary);
  background: rgba(0, 0, 0, 0.04);
}

/* Legacy single-dash variant — text-only chrome for the navbar.
   Kept distinct from .btn--ghost (which is now bordered). */
.btn-ghost {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  transition: color 0.2s ease;
}
.btn-ghost:hover { color: var(--pure-white); }

.btn-group {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* ============================================================
   FORMS
   ============================================================ */
.form-input {
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: 'Verlag', sans-serif;
  font-weight: 300;
  letter-spacing: 0.04em;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.form-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: 'Verlag', sans-serif;
  font-weight: 300;
  letter-spacing: 0.04em;
  background: var(--color-surface);
  color: var(--color-text);
  transition: border-color 0.2s;
  width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--color-muted);
  margin-top: 0.25rem;
}

.form-hint--error {
  color: var(--burgundy, #8B2120);
  font-weight: 500;
}

.filter-input {
  padding: 0.6rem 0.8rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  width: 100%;
  background: var(--color-surface);
}
.filter-input:focus { outline: none; border-color: var(--color-primary); }

.file-upload-label {
  display: block;
  padding: 1.5rem;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-lg);
  text-align: center;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}
.file-upload-label:hover { border-color: var(--color-accent); }
.file-upload-label input[type="file"] { display: none; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  margin-bottom: 1rem;
  border-left: 3px solid;
}
.alert--error   { background: #fdf0ef; color: #8B2120; border-color: #C0392B; }
.alert--success { background: #eef7f2; color: #1E5C36; border-color: #27AE60; }
.alert--info    { background: #eef3f8; color: #1A3A5C; border-color: #2980B9; }

/* ============================================================
   AUTH PAGES
   ============================================================ */

/* Auth pages — forest full-bleed, no navbar, white logo above white card */
.page-auth .navbar { display: none; }
.page-auth,
.page-auth .auth-page {
  background: var(--forest);
  min-height: 100vh;
}
@media (max-width: 600px) {
  body.page-auth {
    height: 100dvh;
    min-height: unset;
    overflow: hidden;
  }
}
.page-auth .auth-page {
  flex-direction: column;
  gap: 2rem;
}
.page-auth .auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
}
.page-auth .auth-brand-logo {
  height: 96px;
  width: auto;
  max-width: none;
  filter: brightness(0) invert(1);
  flex-shrink: 0;
}
.page-auth .auth-logo-rule {
  display: block;
  width: 1px;
  height: 52px;
  background: rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}
.page-auth .auth-trade-portal {
  font-family: var(--font-sans);
  font-weight: 300;
  font-size: 1.5rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(244, 241, 236, 0.9);
  margin-top: 0;
  line-height: 1;
  white-space: nowrap;
}

@media (max-width: 600px) {
  .page-auth .auth-page {
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    padding: 0 1rem 1.25rem;
    height: 100dvh;
    min-height: unset;
    overflow: hidden;
  }
  .page-auth .auth-logo {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    margin: 0;
    padding: 0;
  }
  .page-auth .auth-logo-rule {
    display: none;
  }
  .page-auth .auth-card {
    padding: 1.75rem;
    flex-shrink: 0;
  }
}

/* Auth-page inputs: 1rem (16px) floor — prevents iOS from auto-zooming on focus */
.page-auth .form-input {
  font-size: 1rem;
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px);
  padding: 2rem 1rem;
}

.auth-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-card--wide { max-width: 560px; }

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-brand-logo {
  max-width: 180px;
  width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.auth-trade-portal {
  font-family: var(--font-serif);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-muted);
  margin-top: 0.75rem;
}

.auth-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin-top: 0.75rem;
  color: var(--color-primary);
}

.auth-subtitle {
  font-size: 0.8rem;
  color: var(--color-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 0.25rem;
}

.auth-form { display: flex; flex-direction: column; gap: 1rem; }

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--color-muted);
}

/* ============================================================
   PRODUCT CATALOGUE
   ============================================================ */
.catalogue-page { padding: 0; }

.catalogue-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}

.catalogue-sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 2rem 1.5rem;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  align-self: start;
}

.sidebar-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-muted);
  margin-bottom: 1.25rem;
}

.filter-group { margin-bottom: 1.25rem; }
.filter-group label {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  margin-bottom: 0.4rem;
}

/* Collapsible filter group */
.filter-group--collapsible {
  border-top: 1px solid var(--color-border, #e5e0d8);
  padding-top: 1rem;
  margin-bottom: 0;
  padding-bottom: 1rem;
}

.filter-group__toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  font-family: inherit;
  transition: color 0.15s;
}

.filter-group__toggle:hover {
  color: var(--color-text);
}

.filter-group__chevron {
  flex-shrink: 0;
  transform: rotate(-90deg);
  transition: transform 0.2s ease;
  opacity: 0.5;
}

.filter-group__toggle[aria-expanded="true"] .filter-group__chevron {
  transform: rotate(0deg);
  opacity: 0.8;
}

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

.sidebar-search-label {
  font-size: 0.85rem !important;
  font-weight: 700 !important;
  color: var(--color-primary) !important;
  letter-spacing: 0.06em !important;
}

/* Category filter list */
.cat-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cat-item {
  display: flex;
  flex-direction: column;
}
.cat-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.cat-btn:hover { background: var(--color-border); }
.cat-btn--active {
  background: var(--color-primary);
  color: white;
}
.cat-btn--active:hover { background: var(--color-primary); }
.cat-arrow {
  font-size: 0.7rem;
  opacity: 0.6;
}
@keyframes subcat-bounce-in {
  0%   { transform: scaleY(0); opacity: 0; }
  55%  { transform: scaleY(1.06); opacity: 1; }
  75%  { transform: scaleY(0.97); }
  90%  { transform: scaleY(1.02); }
  100% { transform: scaleY(1); }
}

.subcat-list {
  display: none;
  flex-direction: column;
  gap: 1px;
  padding-left: 0.75rem;
  margin-bottom: 2px;
  transform-origin: top;
}

.subcat-list--open {
  display: flex;
  animation: subcat-bounce-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.subcat-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.35rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--color-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.subcat-btn:hover { background: var(--color-border); color: var(--color-text); }
.subcat-btn--active {
  color: var(--color-primary);
  font-weight: 500;
}


.catalogue-main { padding: 2rem 2.5rem; }

.catalogue-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 2rem;
  position: sticky;
  top: 64px;
  z-index: 10;
  background: var(--color-bg);
  padding-top: 1.5rem;
  padding-bottom: 0.75rem;
}

.catalogue-header::after {
  content: '';
  position: absolute;
  top: 100%;
  left: -2.5rem;
  right: -2.5rem;
  height: 3.5rem;
  background: linear-gradient(to bottom, var(--color-bg), transparent);
  pointer-events: none;
}

.page-title {
  font-family: var(--font-serif, serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--ink, #1a1a1a);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.catalogue-count {
  font-size: 0.8rem;
  color: var(--color-muted);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.product-grid--sm {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
}

.product-card {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--forest, #273125);
  border-radius: 4px;
  overflow: hidden;
  transition: transform 0.4s var(--ease-out, ease), box-shadow 0.4s var(--ease-out, ease);
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
}

.product-card__frame {
  display: block;
  position: absolute;
  inset: 0;
  text-decoration: none;
  color: inherit;
}

.product-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-card__placeholder {
  position: absolute;
  inset: 0;
  bottom: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(140deg, var(--forest, #273125) 0%, var(--mint, #5e8c6e) 100%);
  color: rgba(255,255,255,0.45);
  font-size: 0.72rem;
  font-family: var(--font-sans, sans-serif);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.product-card__strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(26,32,26,0.96);
  border-top: 1px solid rgba(242,241,236,0.08);
}

.product-card__strip::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 8rem;
  height: 50%;
  background: linear-gradient(to right, transparent, rgba(26,32,26,0.96) 55%);
  pointer-events: none;
  z-index: 1;
}

.product-card__strip-name {
  font-family: var(--font-serif, serif);
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--bone, #f4f1ec);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  line-height: 1.35;
  margin: 0;
  min-height: calc(0.88rem * 1.35 * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__strip-meta {
  display: none;
}

/* ============================================================
   PRODUCT DETAIL
   ============================================================ */
.detail-page { padding: 1.5rem var(--pad-x) 2.5rem; max-width: 1600px; margin: 0 auto; }

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 3rem;
  margin-bottom: 2.5rem;
  align-items: start;
}

/* Full-page two-col: text left, sticky image right */
.detail-page-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 3.5rem;
  align-items: start;
  margin-bottom: 2.5rem;
}
.detail-page-grid .detail-gallery {
  position: sticky;
  top: 80px;
}
.detail-left {
  min-width: 0;
}
/* Allow the product name to wrap gracefully — 2 lines max, column width does the constraining */
.detail-page-title {
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.1;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Info column is a flex stack so the description fills the room and the spec
   box settles against the bottom (aligned to the image via main.js). Only the
   description may flex-shrink so the spec box keeps its full height and the
   header/pills never clip when the copy is long. */
.detail-info {
  display: flex;
  flex-direction: column;
}
.detail-info > .breadcrumb,
.detail-info > .detail-header,
.detail-info > .detail-pills { flex-shrink: 0; }

.gallery-zoom-wrap {
  position: relative;
  cursor: zoom-in;
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.gallery-main img {
  width: 100%;
  aspect-ratio: 1;
  max-height: calc(100vh - 13rem);
  object-fit: cover;
  border-radius: var(--radius-lg);
  display: block;
}
.gallery-magnify {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.88);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  color: var(--color-primary);
  box-shadow: 0 1px 6px rgba(0,0,0,0.18);
}
.gallery-zoom-wrap:hover .gallery-magnify { opacity: 1; }

/* ── Lightbox ── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.88);
  cursor: zoom-out;
}
.lightbox__box {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  max-width: 90vw;
  max-height: 92vh;
}
.lightbox__close {
  position: absolute;
  top: -2.75rem;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  opacity: 0.8;
  transition: opacity 0.15s;
}
.lightbox__close:hover { opacity: 1; }
.lightbox__img {
  max-width: 88vw;
  max-height: 76vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  display: block;
}
.lightbox__thumbs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.lightbox__thumb {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s;
}
.lightbox__thumb--active,
.lightbox__thumb:hover { border-color: #fff; opacity: 1; }

.gallery-placeholder {
  aspect-ratio: 1;
  background: var(--color-accent-lt);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
}

.gallery-placeholder img {
  width: 45%;
  height: 45%;
  object-fit: contain;
  opacity: 0.6;
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.gallery-thumb {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius);
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.7;
  transition: all 0.2s;
}
.gallery-thumb--active,
.gallery-thumb:hover {
  border-color: var(--color-primary);
  opacity: 1;
}

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}
.breadcrumb a { color: var(--color-muted); }
.breadcrumb a:hover { color: var(--color-primary); }

.detail-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.detail-title {
  font-family: var(--font-sans);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--color-primary);
  line-height: 1.2;
}

.detail-product-details {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-top: 0.4rem;
  line-height: 1.5;
}


.detail-code {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

/* Description fills the space between the pills and the spec box, fading out
   with a "Read more" affordance when the copy runs past the available room. */
.detail-description {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  overflow: hidden;
  color: var(--color-text);
  font-size: 1.125rem;
  line-height: 1.75;
  margin-bottom: 1.5rem;
}
.detail-description__body > p { margin: 0 0 1.1rem; }
.detail-description__body > p:last-child { margin-bottom: 0; }
.detail-description__fade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5rem;
  background: linear-gradient(to bottom, transparent, var(--bone) 88%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.detail-description__more {
  position: absolute;
  right: 0;
  bottom: 0;
  padding: 0.4rem 0 0.1rem 2rem;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--forest);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
}
.detail-description__more:hover { text-decoration: underline; }
.detail-description.is-clamped .detail-description__fade,
.detail-description.is-clamped .detail-description__more {
  opacity: 1;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .detail-description__fade { transition: none; }
}

.detail-meta { margin-bottom: 2rem; display: flex; flex-direction: column; gap: 0.75rem; }

.meta-item { display: flex; gap: 1rem; align-items: flex-start; }
.meta-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  width: 140px;
  min-width: 140px;
  flex-shrink: 0;
  text-align: right;
  padding-top: 0.1rem;
}
.meta-value { font-size: 0.9rem; }

/* Specifications block — supplier specs shown as a labelled list */
.detail-specs-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 0.75rem;
}
.detail-specs .meta-value { font-variant-numeric: tabular-nums; }

.tag-list { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag {
  padding: 0.2rem 0.6rem;
  background: var(--color-accent-lt);
  color: var(--color-primary);
  border-radius: 20px;
  font-size: 0.75rem;
  text-decoration: none;
}
.tag:hover { background: var(--color-accent); color: white; text-decoration: none; }

/* Download button sits below the spec box, level with the gallery thumbnails
   (which are offset 0.75rem under the main image). */
.detail-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.75rem; }

/* Add-to-project CTA (replaces the heart icon, top-right of the title). It is a
   filled primary button wearing the .fav-btn behaviour classes, so re-assert the
   bone text/icon over the bare-heart .fav-btn colour rules in every state. */
.detail-add-btn {
  margin-left: auto;
  align-self: flex-start;
  white-space: nowrap;
}
.detail-add-btn.fav-btn,
.detail-add-btn.fav-btn--active { color: var(--bone); }
.detail-add-btn.fav-btn:hover {
  color: var(--bone);
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  transform: translateY(-1px);
}
.detail-add-btn.fav-btn svg,
.detail-add-btn.fav-btn--active svg { fill: none; stroke: var(--bone); }

/* Info pills — price · unit of sale · availability, colour-coded under the
   product name. Tints are mixed from brand tokens (no raw hex). */
.detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.4rem 0 1.25rem;
}
.info-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--mineral);
  line-height: 1.3;
}
.info-pill--price {
  background: color-mix(in srgb, var(--forest) 16%, var(--bone));
  border-color: color-mix(in srgb, var(--forest) 34%, var(--bone));
}
.info-pill--unit {
  background: color-mix(in srgb, var(--bronze) 22%, var(--bone));
  border-color: color-mix(in srgb, var(--bronze) 42%, var(--bone));
}
.info-pill--avail {
  background: color-mix(in srgb, var(--rose) 30%, var(--bone));
  border-color: color-mix(in srgb, var(--rose) 52%, var(--bone));
}

/* Tonal forest panel — the product's specifications, in two columns */
.detail-specbox {
  background: var(--sage-pale);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  margin-top: auto;
  margin-bottom: 0;
  flex-shrink: 0;
}
.detail-specbox .detail-specs-title { margin: 0 0 1.1rem; }
.detail-specgrid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem 2.5rem;
}
/* When a product carries many details, widen to three columns so the box keeps
   its height instead of growing taller. Falls back to one column on phones via
   the max-width:600px rule below. */
.detail-specgrid--3col {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  column-gap: 1.75rem;
}
.specrow { display: flex; flex-direction: column; gap: 0.15rem; }
.speclabel {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
  color: var(--slate);
}
.specvalue {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--mineral);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 600px) {
  .detail-specgrid { grid-template-columns: 1fr; }
}

/* Full-description modal — a quiet floating window for the complete copy. */
body.modal-open { overflow: hidden; }

.desc-modal[hidden] { display: none !important; }
.desc-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(18, 26, 20, 0.5);
  backdrop-filter: blur(3px);
}
.desc-modal__card {
  position: relative;
  background: var(--bone);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(20, 10, 6, 0.22);
  padding: 2.5rem;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
}
.desc-modal__close {
  position: absolute;
  top: 1rem;
  right: 1.1rem;
  border: none;
  background: none;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--slate);
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s var(--ease-out);
}
.desc-modal__close:hover { color: var(--forest); }
.desc-modal__title {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 400;
  color: var(--color-primary);
  line-height: 1.2;
  margin: 0 2rem 1.25rem 0;
}
.desc-modal__body {
  color: var(--color-text);
  font-size: 1.125rem;
  line-height: 1.75;
}
.desc-modal__body > p { margin: 0 0 1.1rem; }
.desc-modal__body > p:last-child { margin-bottom: 0; }

.related-section { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.section-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 400;
  margin-bottom: 1.5rem;
  color: var(--color-primary);
}

/* ============================================================
   FAVOURITES BUTTON
   ============================================================ */
.fav-btn { color: var(--color-muted); transition: color 0.2s, transform 0.15s; }
.fav-btn:hover { color: var(--color-burgundy); transform: scale(1.1); }
.fav-btn--active { color: var(--color-burgundy); }
.fav-btn--active svg { fill: var(--color-burgundy); }

/* ============================================================
   ADMIN
   ============================================================ */
.admin-page { padding: 0; background: var(--bone); }

.admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - 64px);
}

.admin-sidebar {
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 2rem 1rem;
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
}

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

.admin-nav__link {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.2s var(--ease-out);
}
.admin-nav__link:hover { background: var(--paper); text-decoration: none; }
.admin-nav__divider { border: none; border-top: 1px solid var(--color-border); margin: 0.5rem 0; }

.admin-main { padding: 2.5rem; }

.admin-title {
  font-family: var(--font-serif, serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--ink, #1a1a1a);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.admin-card {
  background: var(--pure-white);
  border-radius: var(--radius);
  border: 1px solid var(--linen);
  box-shadow: 0 1px 2px rgba(20, 10, 6, 0.04), 0 4px 16px -4px rgba(20, 10, 6, 0.06);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-card__title {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--whisper);
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--linen);
}

.admin-card__title--toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--linen);
  padding: 0 0 0.75rem;
  margin-bottom: 0;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--whisper);
}

.admin-card__title--toggle .toggle-chevron {
  transition: transform 0.2s var(--ease-out);
  flex-shrink: 0;
  opacity: 0.5;
}

.admin-card__title--toggle[aria-expanded="true"] .toggle-chevron {
  transform: rotate(180deg);
}

.admin-card__title--toggle + * {
  padding-top: 1rem;
}

.form-optional {
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--color-muted);
  opacity: 0.7;
}

.invite-gen-grid {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
}

.invite-gen-row {
  display: flex;
  gap: 1rem;
}

.invite-gen-row .form-group {
  flex: 1;
}

/* ── Admin form fields — underlined editorial style (portal design system) ── */
/* Auth pages are the one exception (keep boxed). All other admin inputs:
   transparent bg, no box, bottom border only, focus in forest.              */
.admin-page .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
.admin-page .form-group select,
.admin-page .form-group textarea {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(20, 10, 6, 0.2);
  border-radius: 0;
  padding: 0.6rem 0;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--ink);
  transition: border-color 0.2s var(--ease-out);
  box-shadow: none;
}

.admin-page .form-group input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):focus,
.admin-page .form-group select:focus,
.admin-page .form-group textarea:focus {
  outline: none;
  border-bottom-color: var(--forest);
  box-shadow: none;
}

.admin-page .form-group label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--whisper);
}

/* ── Admin dashboard — new layout ───────────────────────────────────────────── */

.admin-dash-wrap {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.5rem var(--pad-x) 2.5rem;
  overflow-x: hidden;
}

.admin-dash-head {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.admin-dash-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.admin-dash-nav::-webkit-scrollbar {
  display: none;
}

.admin-dash-nav__link {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.38rem 0.85rem;
  border: 1px solid rgba(39, 49, 37, 0.2);
  border-radius: 4px;
  background: transparent;
  color: var(--slate, #4a4540);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.admin-dash-nav__link:hover {
  border-color: var(--forest, #273125);
  color: var(--forest, #273125);
  text-decoration: none;
}

.admin-dash-nav__link--active {
  background: var(--forest, #273125);
  border-color: var(--forest, #273125);
  color: var(--bone, #f4f1ec);
}

.admin-dash-nav__link--active:hover {
  background: var(--forest, #273125);
  color: var(--bone, #f4f1ec);
}

.admin-dash-nav__link--subtle {
  color: var(--color-muted);
  border-color: transparent;
}

.admin-dash-nav__sep {
  display: block;
  width: 1px;
  height: 1.2rem;
  background: var(--color-border);
  margin: 0 0.15rem;
}

.admin-dash-body {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  align-items: start;
}

.admin-dash-stats {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: sticky;
  top: calc(64px + 1rem);
}

.admin-dash-stat {
  background: var(--pure-white);
  border: 1px solid var(--linen);
  border-left: 3px solid var(--forest);
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-dash-stat__value {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--forest);
  line-height: 1;
}

.admin-dash-stat__label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  color: var(--whisper);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

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

/* legacy grid still used by other admin pages */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--pure-white);
  border: 1px solid var(--linen);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(20, 10, 6, 0.04);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-value {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 300;
  color: var(--forest);
}

.stat-label { font-family: var(--font-sans); font-size: 0.68rem; color: var(--whisper); text-transform: uppercase; letter-spacing: 0.12em; }

.admin-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.admin-table th {
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-muted);
  padding: 0.75rem 1rem;
  border-bottom: 2px solid var(--color-border);
}
.admin-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-border);
  vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row--muted td { opacity: 0.5; }

/* Admin product list — clickable name + multi-select bulk actions */
.product-name-link { color: inherit; text-decoration: none; }
.product-name-link:hover strong,
.product-name-link:focus-visible strong { color: var(--forest); text-decoration: underline; }
.product-name-link.text-muted strong { color: var(--color-muted); }

.admin-table .col-select { width: 1%; white-space: nowrap; text-align: center; vertical-align: middle; }
.bulk-check { width: 16px; height: 16px; accent-color: var(--forest); cursor: pointer; }

.bulk-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--sage-pale);
  border: 1px solid var(--color-border);
  border-radius: 4px;
}
.bulk-bar[hidden] { display: none; }
.bulk-bar__count { font-size: 0.85rem; font-weight: 600; color: var(--color-primary); white-space: nowrap; }
.bulk-bar__actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.bulk-bar__cat { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.bulk-select {
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--bone);
  color: var(--color-text);
  outline: none;
}
.bulk-select:focus { border-color: var(--forest); }
.bulk-bar__clear {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--slate);
  text-decoration: underline;
}
.bulk-bar__clear:hover { color: var(--forest); }

/* Product code field — equal split with the supplier select */
.product-form .form-group--code { flex: 1; }

/* ── Collection manager panel (product edit page — bottom) ───────────────── */
.collection-grid {
  display: flex;
  flex-direction: column;
}
.collection-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border);
}
.collection-card:last-child { border-bottom: none; }
.collection-card--excluded { opacity: 0.45; }
.collection-card__thumb {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 3px;
  overflow: hidden;
}
.collection-card__thumb img { width: 100%; height: 100%; object-fit: cover; }
.collection-card__thumb-empty { width: 100%; height: 100%; background: var(--sage-pale); }
.collection-card__meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
a.collection-card__name,
span.collection-card__name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
a.collection-card__name:hover { color: var(--forest); text-decoration: underline; }
.collection-card__name--current { color: var(--color-muted); }
.collection-card__code { font-size: 0.75rem; color: var(--color-muted); }
.collection-card__status { flex-shrink: 0; }
.collection-card__action { flex-shrink: 0; }
.collection-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
}
.collection-badge--on     { background: color-mix(in srgb, var(--forest) 12%, transparent); color: var(--forest); }
.collection-badge--hidden { background: color-mix(in srgb, var(--slate) 15%, transparent); color: var(--slate); }
.collection-badge--off    { background: color-mix(in srgb, var(--slate) 10%, transparent); color: var(--slate); }
.collection-badge--current{ background: color-mix(in srgb, var(--forest) 8%, transparent);  color: var(--forest); }

/* Admin products page — larger product name */
.admin-page--products .product-name-link strong { font-size: 1rem; }
.table-link { color: inherit; text-decoration: none; }
.table-link:hover { text-decoration: underline; opacity: 0.75; }
.table-cell-wrap { word-break: break-all; }

/* Members search bar */
.members-search-wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.members-search-field {
  position: relative;
  width: 100%;
}

.members-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-muted);
  pointer-events: none;
}

.members-search-input {
  width: 100%;
  padding: 0.6rem 1rem 0.6rem 2.4rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md, 8px);
  font-size: 0.875rem;
  font-family: var(--font-sans);
  background: var(--color-surface, #fff);
  color: var(--ink);
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.members-search-input:focus {
  outline: none;
  border-color: var(--forest);
}

.members-search-count {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin: 0;
  white-space: nowrap;
}

.members-no-results {
  font-size: 0.9rem;
  color: var(--color-muted);
  padding: 2rem 0;
  text-align: center;
}

/* ── Member manage page ──────────────────────────────────────────────────────── */
.manage-section-label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate);
  margin: 0 0 0.85rem;
}
.manage-field label {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--slate);
  display: block;
  margin-bottom: 0.3rem;
}
.manage-field input,
.manage-field select {
  width: 100%;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--linen);
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--pure-white, #fff);
  box-sizing: border-box;
  transition: border-color 0.15s var(--ease-out);
}
.manage-field input:focus,
.manage-field select:focus {
  outline: none;
  border-color: var(--forest);
}
.manage-co-team {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--linen);
  border-radius: var(--radius);
  overflow: hidden;
}
.manage-co-team .manage-field {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--linen);
}
.manage-co-team .manage-field:last-child {
  border-bottom: none;
}
.manage-co-team .manage-field input,
.manage-co-team .manage-field select {
  border: none;
  border-radius: 0;
  padding: 0.25rem 0;
  background: transparent;
  font-size: 0.9rem;
}
.manage-co-team .manage-field input:focus,
.manage-co-team .manage-field select:focus {
  outline: none;
  border-color: transparent;
  box-shadow: none;
}

/* ── Access level popover ── */
.access-popover {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 200;
  background: var(--bone);
  border: 1px solid var(--linen);
  border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  min-width: 190px;
  padding: 0.3rem;
}
.access-popover[hidden] { display: none; }
.access-popover__opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  background: none;
  border: none;
  border-radius: 3px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  letter-spacing: 0.01em;
}
.access-popover__opt:hover {
  background: rgba(0,0,0,0.04);
}
.access-popover__opt--active {
  color: var(--forest);
  font-weight: 600;
}

/* ── Company cards (member admin) ────────────────────────────────────────────── */
.company-card {
  background: var(--pure-white, #fff);
  border: 1px solid var(--linen);
  border-left: 3px solid var(--forest);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  transition: box-shadow 0.3s var(--ease-out);
}
.company-card:hover {
  box-shadow: 0 4px 18px -4px rgba(0, 0, 0, 0.07);
}
.company-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem 0.85rem 1.1rem;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s var(--ease-out);
}
.company-card__head:hover {
  background: var(--bone);
}
.company-card__head[aria-expanded="true"] {
  border-bottom: 1px solid var(--linen);
}
.company-card__head[aria-expanded="true"] .toggle-chevron {
  transform: rotate(180deg);
}
.toggle-chevron {
  flex-shrink: 0;
  color: var(--slate);
  transition: transform 0.22s var(--ease-out);
}
.company-card__name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 0.1rem;
}
.company-card__meta {
  font-family: var(--font-sans);
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--slate);
  margin: 0;
}
.company-card__head-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.company-card__body {
  padding: 0.9rem 1.25rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.company-card__body[hidden] {
  display: none;
}
.company-card__head:not([aria-expanded="true"]) .js-co-add {
  display: none;
}
.input--readonly {
  background: var(--bone);
  color: var(--slate);
  cursor: default;
  opacity: 0.85;
}
.company-team__label {
  font-family: var(--font-sans);
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--slate);
  margin: 0 0 0.45rem;
}
.company-team__members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ── Member chips ─────────────────────────────────────────────────────────────── */
.member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: var(--bone);
  border: 1px solid var(--linen);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.18s var(--ease-out), border-color 0.18s var(--ease-out);
}
a.member-chip:hover {
  background: var(--forest);
  border-color: var(--forest);
  color: white;
}
a.member-chip:hover .member-chip__dot {
  background: rgba(255, 255, 255, 0.6);
}
a.member-chip:hover .member-chip__badge {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border-color: transparent;
}
.member-chip__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--forest);
  flex-shrink: 0;
  transition: background 0.18s var(--ease-out);
}
.member-chip__name {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: inherit;
}
.member-chip__badge {
  font-family: var(--font-sans);
  font-size: 0.63rem;
  font-weight: 600;
  background: var(--bone);
  color: var(--forest);
  border: 1px solid var(--linen);
  padding: 0.05rem 0.35rem;
  border-radius: 100px;
}
/* Pending / invited member chip */
.member-chip--pending {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.65rem 0.4rem 0.6rem;
  background: var(--bone);
  border-style: dashed;
  border-color: var(--linen);
}
.member-chip--pending .member-chip__dot {
  background: #d97706;
}
.member-chip__status-text {
  font-family: var(--font-sans);
  font-size: 0.63rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #d97706;
}
.member-chip__pending-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
  padding-left: 0.5rem;
}

/* ── Team cards ──────────────────────────────────────────────────────────────── */
.team-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.team-card {
  background: var(--pure-white);
  border: 1px solid var(--linen);
  border-radius: var(--radius);
  overflow: hidden;
}

.team-card--open {
  border-color: var(--forest, #273125);
}

.team-card__summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
}

.team-card__info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.team-card__name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink, #1a1a1a);
}

.team-card__count {
  font-size: 0.78rem;
  color: var(--color-muted);
}

.team-card__edit-btn {
  flex-shrink: 0;
}

.team-card__detail {
  display: none;
  border-top: 1px solid var(--color-border);
  padding: 1rem;
  flex-direction: column;
  gap: 1rem;
}

.team-card--open .team-card__detail {
  display: flex;
}

.team-card__section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-muted);
  margin: 0 0 0.5rem;
}

.team-card__section { }

.team-card__empty {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin: 0;
}

.team-card__members {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.team-card__member-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bone, #f4f1ec);
  border-radius: 99px;
  padding: 0.2rem 0.5rem 0.2rem 0.75rem;
  font-size: 0.82rem;
  color: var(--ink, #1a1a1a);
}

.team-card__chip-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0 0 2px;
  transition: color 0.15s;
}

.team-card__chip-remove:hover {
  color: var(--color-danger, #c0392b);
}

.team-card__add-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.team-card__select {
  flex: 1;
  min-width: 160px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 4px);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--color-surface, #fff);
}

.team-card__name-input {
  flex: 1;
  min-width: 160px;
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius, 4px);
  font-size: 0.85rem;
  font-family: inherit;
  background: var(--color-surface, #fff);
  color: var(--ink);
  transition: border-color 0.15s;
}

.team-card__name-input:focus {
  outline: none;
  border-color: var(--forest);
}

.team-card__footer {
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border);
}

/* Card transform — each row becomes a stacked card on small screens */
@media (max-width: 600px) {
  .admin-table--cards thead { display: none; }

  .admin-table--cards tbody tr {
    display: block;
    background: var(--pure-white);
    border: 1px solid var(--linen);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    overflow: hidden;
    cursor: pointer;
  }

  .admin-table--cards tbody tr:last-child { margin-bottom: 0; }

  /* Summary row — always visible */
  .td-name-summary {
    display: block !important;
    padding: 0.75rem 1rem !important;
    border-bottom: none !important;
  }

  .td-name-summary::before { display: none !important; }

  .card-summary {
    display: flex;
    align-items: center;
    gap: 0.6rem;
  }

  .card-summary__main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
  }

  .card-summary__company {
    font-size: 0.75rem;
    color: var(--color-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card-summary__status { flex-shrink: 0; }

  .card-chevron {
    flex-shrink: 0;
    color: var(--color-muted);
    transition: transform 0.2s ease;
  }

  /* Detail rows — hidden by default */
  .admin-table--cards .td--detail {
    display: none;
  }

  /* Expanded state */
  .admin-table--cards tr.is-open .td--detail {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 1rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
  }

  .admin-table--cards tr.is-open .td-name-summary {
    border-bottom: 1px solid var(--color-border) !important;
  }

  .admin-table--cards tr.is-open .card-chevron {
    transform: rotate(180deg);
  }

  .admin-table--cards td::before {
    content: attr(data-label);
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-muted);
    min-width: 5rem;
  }

  .admin-table--cards .td-actions {
    display: none;
  }

  .admin-table--cards tr.is-open .td-actions {
    display: block !important;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--color-border);
  }

  .admin-table--cards .td-actions::before { display: none !important; }

  .admin-table--cards .td-actions .btn-group {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .admin-table--cards .btn--sm {
    flex: 1;
    justify-content: center;
    min-width: 0;
  }
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.badge--green  { background: #e8f5ee; color: #1E5C36; }
.badge--yellow { background: #fef9e7; color: #7D6608; }
.badge--blue   { background: #e8f0fe; color: #1a56c4; }
.badge--grey   { background: #f0f0f0; color: #555; }
.badge--red    { background: #fdf0ef; color: #8B2120; }
.badge--orange { background: #fff1e6; color: #b84d00; }

/* ── Categories management ── */
/* ── Category accordion ─────────────────────────────────────────────────────── */
.cat-accordion__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cat-accordion__head .admin-card__title--toggle {
  flex: 1;
  width: auto;
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cat-toggle__name {
  flex: 1;
  text-align: left;
}

.cat-toggle__count {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  color: var(--stone);
  font-weight: 400;
  text-transform: uppercase;
  white-space: nowrap;
  margin-right: 0.25rem;
}

.cat-accordion__body {
  padding-top: 1rem;
  margin-top: 0.75rem;
  border-top: 1px solid var(--linen);
}

/* ── Settings page section accordions ──────────────────────────────────────── */
.settings-accordion__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  gap: 0.75rem;
  margin-bottom: 0;
}
.settings-accordion__head:hover .settings-accordion__title { color: var(--forest); }
.settings-accordion__head-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.settings-accordion__head-row .settings-accordion__head { flex: 1; }
.settings-accordion__title {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  border-bottom: none !important;
  transition: color 0.2s var(--ease-out);
}
.settings-accordion__head .toggle-chevron {
  flex-shrink: 0;
  transition: transform 0.25s var(--ease-out);
}
.settings-accordion__head[aria-expanded="false"] .toggle-chevron {
  transform: rotate(-90deg);
}
.settings-accordion__body {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--linen);
}
.settings-accordion__body[hidden] { display: none; }

.cat-modal__sub-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.cat-modal__sub-row input { flex: 1; }
.cat-modal__sub-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--slate);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0 0.25rem;
  flex-shrink: 0;
  transition: color 0.15s var(--ease-out);
}
.cat-modal__sub-remove:hover { color: var(--color-danger); }

/* keep old class working for any pages still using it */
.cat-manage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}
.subcat-manage-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.subcat-manage-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
}
.subcat-manage-item .btn--xs {
  padding: 0.1rem 0.45rem;
  font-size: 0.8rem;
  line-height: 1.2;
}

.xero-status { margin-bottom: 1rem; font-size: 0.9rem; }
.xero-status--connected { color: #1E5C36; }
.xero-status--disconnected { color: var(--color-muted); }

.invite-code {
  font-family: monospace;
  font-size: 0.85rem;
  background: var(--color-bg);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius);
}

.copy-btn { margin-left: 0.5rem; }

.image-grid { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.image-thumb-wrap { position: relative; }
.image-thumb {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}
.image-delete-btn {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  background: var(--color-danger);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.75rem;
}

.image-primary-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: var(--color-primary);
  color: white;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 5px;
  border-radius: 3px;
  pointer-events: none;
}

.inline-form .form-row { align-items: flex-end; }

/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-muted);
}
.empty-state p { margin-bottom: 1.5rem; font-size: 1rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.6);
  padding: 1.5rem 2rem;
  margin-top: auto;
}
.footer-inner { max-width: 1300px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0; }
.footer-brand { font-family: var(--font-serif); color: rgba(255,255,255,0.9); font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; margin: 0; line-height: 1.3; }
.footer-copy { font-size: 0.7rem; margin: 0; line-height: 1.3; }

/* ============================================================
   ADMIN PRODUCT TABLE HELPERS
   ============================================================ */

/* Page title + action buttons header row */
.admin-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Category shown under name on mobile only — hidden on desktop */
.table-mobile-cat {
  display: none;
  font-size: 0.7rem;
  color: var(--color-muted);
  margin-top: 0.15rem;
}

/* Columns hidden on mobile, shown on desktop */
.col-desktop-only { }

/* Code shown beneath the product name */
.product-code-sub {
  font-size: 0.72rem;
  color: var(--color-muted);
  margin-top: 0.2rem;
  letter-spacing: 0.03em;
}

/* Stacked Edit / Visible / Star actions column */
.product-actions-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}

.product-actions-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Horizontally scrollable table wrapper */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ============================================================
   TEXT HELPERS
   ============================================================ */
.text-muted { color: var(--color-muted); font-size: 0.9rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .catalogue-layout { grid-template-columns: 1fr; }
  .catalogue-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--color-border); }
  .detail-layout { grid-template-columns: 1fr; gap: 2rem; }
  .detail-page-grid { grid-template-columns: 1fr; gap: 2rem; }
  .detail-page-grid .detail-gallery { position: static; }
  .detail-page-title { max-width: none; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; height: auto; border-right: none; border-bottom: 1px solid var(--color-border); }
  .admin-dash-body { grid-template-columns: 1fr; }
  .admin-dash-stats { position: static; flex-direction: row; flex-wrap: wrap; }
  .admin-dash-stat { flex: 1 1 140px; }
}

@media (max-width: 600px) {
  /* ── Header: logo on top, links wrap below ── */
  .nav-inner {
    flex-direction: column;
    height: auto;
    padding: 0.75rem 1rem 0.6rem;
    gap: 0.5rem;
    align-items: center;
  }

  .nav-logo {
    justify-content: center;
  }

  .nav-logo-img {
    height: 44px;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem 1rem;
    width: 100%;
  }

  .nav-user {
    padding-left: 0;
    border-left: none;
    padding-top: 0.4rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    gap: 0.75rem;
    width: 100%;
    justify-content: center;
  }

  /* ── Footer: stack vertically, centred ── */
  .footer-inner {
    flex-direction: column;
    text-align: center;
    gap: 0.25rem;
  }

  /* ── Other existing rules ── */
  .logo-text { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .form-row { flex-direction: column; }

  /* ── Admin dash wrap: reduce horizontal padding on phones ── */
  .admin-dash-wrap {
    padding: 1.25rem 1rem;
  }

  /* ── Admin nav: compact pills so all items fit iPhone width ── */
  .admin-dash-nav {
    gap: 0.1rem;
  }
  .admin-dash-nav__link {
    padding: 0.38rem 0.65rem;
    font-size: 0.78rem;
  }
  .admin-dash-nav__sep {
    margin: 0 0.2rem;
  }

  /* ── Selections / project pages ── */
  .selections-main {
    padding: 1.25rem 1rem;
  }
  .catalogue-main {
    padding: 1.25rem 1rem;
  }
  .catalogue-header::after {
    left: -1rem;
    right: -1rem;
  }
  .archive-cards {
    grid-template-columns: 1fr;
  }
  .project-detail-topbar {
    flex-wrap: wrap;
  }

  /* ── Analytics: tighter panel padding, full-width stat cards ── */
  .analytics-panel {
    padding: 1rem;
  }
  .an-stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .an-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
  }

  /* ── Admin sidebar → compact horizontal scroll bar ── */
  .admin-sidebar {
    padding: 0.5rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    position: static;
    height: auto;
    overflow-y: visible;
  }

  .admin-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }

  .admin-nav::-webkit-scrollbar { display: none; }

  .admin-nav__link {
    white-space: nowrap;
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-bg);
  }

  .admin-nav__divider { display: none; }

  /* ── Admin main content ── */
  .admin-main {
    padding: 1.25rem 1rem;
  }

  .admin-title {
    font-size: 1.35rem;
    margin-bottom: 1rem;
  }

  .admin-card {
    padding: 1rem;
    overflow-x: auto;
  }

  /* ── Stats: 2-column grid on small screens ── */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .stat-value {
    font-size: 1.8rem;
  }

  /* ── Button groups wrap on mobile ── */
  .btn-group {
    flex-wrap: wrap;
  }

  /* ── Analytics page ── */
  .an-page {
    padding: 1.25rem 1rem 3rem;
  }

  .analytics-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .analytics-panel {
    min-width: 0;
    overflow: hidden;
  }

  .an-rank-name {
    white-space: normal;
    word-break: break-word;
  }

  .analytics-panel {
    padding: 1rem;
  }

  /* ── Admin product actions: already column, shrink gap on tiny screens ── */
  .product-actions-col {
    gap: 0.25rem;
  }

  /* ── Admin products page: header buttons go full width ── */
  .admin-page-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .admin-page-header__actions {
    width: 100%;
  }

  /* ── Admin products table: no horizontal scroll, collapse category column ── */
  .col-desktop-only {
    display: none;
  }

  .table-mobile-cat {
    display: block;
  }

  #product-table {
    table-layout: fixed;
    width: 100%;
  }

  #product-table th:nth-child(1),
  #product-table td:nth-child(1) {
    width: 44px;
  }

  #product-table th:nth-child(4),
  #product-table td:nth-child(4) {
    width: 104px;
  }
}


/* ============================================================
   EMPTY STATE
   ============================================================ */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--color-text-muted, #888);
}

.empty-state__icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: .4;
}

.empty-state__title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: .5rem;
  color: var(--color-text, #222);
}

.empty-state__body {
  font-size: .9rem;
  margin-bottom: 1.5rem;
}

.empty-state__chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.chip {
  display: inline-block;
  padding: .35rem .8rem;
  border-radius: 999px;
  background: transparent;
  border: 1px solid var(--color-border, #e2dcd2);
  font-size: .8rem;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  box-shadow: none;
  -webkit-appearance: none;
  appearance: none;
}

.chip:hover {
  background: var(--color-primary, #273125);
  border-color: var(--color-primary, #273125);
  color: #fff;
}


/* ============================================================
   PRODUCT GRID FADE-IN
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

#product-grid .product-card {
  animation: fadeIn .2s ease both;
}


/* ============================================================
   ADMIN: VISIBILITY BADGE
   ============================================================ */
.visibility-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .6rem;
  border-radius: 999px;
}

.visibility-badge--on {
  background: #e6f4ea;
  color: #2d7a3e;
}

.visibility-badge--off {
  background: #fce8e6;
  color: #c0392b;
}

.visibility-badge--btn {
  border: none;
  cursor: pointer;
  transition: filter .15s, transform .1s;
}

.visibility-badge--btn:hover {
  filter: brightness(.92);
}

.visibility-badge--btn:active {
  transform: scale(.96);
}

.star-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: .1rem .2rem;
  transition: transform .15s, color .15s;
}

.star-toggle--on {
  color: #f5a623;
}

.star-toggle--off {
  color: #ccc;
}

.star-toggle:hover {
  transform: scale(1.2);
}

.star-toggle:active {
  transform: scale(1.05);
}

.row--hidden {
  opacity: .55;
}


/* ============================================================
   ADMIN: PRODUCT THUMBNAIL
   ============================================================ */
.admin-product-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  margin-right: .5rem;
  vertical-align: middle;
}

.admin-product-thumb--empty {
  background: var(--color-accent-lt);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.admin-product-thumb--empty img {
  width: 65%;
  height: 65%;
  object-fit: contain;
  opacity: 0.6;
}


/* ============================================================
   ADMIN: COMPACT TABLE
   ============================================================ */
.admin-table--compact th,
.admin-table--compact td {
  padding: .5rem .75rem;
  font-size: .85rem;
}


/* ============================================================
   ANALYTICS DASHBOARD
   ============================================================ */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius-md, 8px);
  padding: 1.5rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  text-align: center;
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary, #273125);
  line-height: 1;
  margin-bottom: .35rem;
}

.stat-card__label {
  font-size: .8rem;
  color: var(--color-text-muted, #888);
  text-transform: uppercase;
  letter-spacing: .05em;
}

.analytics-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  min-width: 0;
}

@media (max-width: 900px) {
  .analytics-columns {
    grid-template-columns: 1fr;
  }
}

.analytics-panel {
  background: var(--color-surface, #fff);
  border-radius: var(--radius-md, 8px);
  border: 1px solid var(--color-border, #e8e4df);
  padding: 1.25rem 1.5rem;
  min-width: 0;
  overflow: hidden;
}

.analytics-panel--wide {
  grid-column: 1 / -1;
}

.analytics-panel__title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-text, #222);
}

.analytics-panel__empty {
  font-size: .875rem;
  color: var(--color-text-muted, #888);
  text-align: center;
  padding: 1.5rem 0;
}

/* ── Analytics redesign ─────────────────────────────────────────────────────── */

.an-page {
  min-height: calc(100vh - var(--navbar-height, 64px));
  background: var(--color-bg, #f4f1ec);
  padding: 2.5rem 1.25rem 4rem;
}

.an-wrap {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.an-wrap .analytics-grid {
  margin-bottom: 0;
}

.an-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.an-title {
  font-family: var(--font-serif, serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--ink, #1a1a1a);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.an-subtitle {
  font-size: 0.85rem;
  color: var(--slate, #6b6b6b);
  margin: 0;
}

.an-period-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0;
}

.an-period-tab {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.38rem 0.85rem;
  border: 1px solid rgba(39, 49, 37, 0.2);
  border-radius: 4px;
  background: transparent;
  color: var(--slate, #4a4540);
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.an-period-tab:hover {
  border-color: var(--forest, #273125);
  color: var(--forest, #273125);
  text-decoration: none;
}

.an-period-tab--active {
  background: var(--forest, #273125);
  border-color: var(--forest, #273125);
  color: var(--bone, #f4f1ec);
}

.an-period-tab--active:hover {
  background: var(--forest, #273125);
  color: var(--bone, #f4f1ec);
}

.an-stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.stat-card__sub {
  font-size: 0.7rem;
  color: var(--slate, #6b6b6b);
  margin-top: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-card--muted {
  background: var(--bone, #f4f1ec);
  box-shadow: none;
  border: 1px solid var(--color-border, #e8e4df);
}

.stat-card--muted .stat-card__value {
  color: var(--slate, #6b6b6b);
}

/* Rank list (most viewed, most saved, searches) */
.an-rank-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.an-rank-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border, #e8e4df);
  font-size: 0.875rem;
}

.an-rank-item:last-child {
  border-bottom: none;
}

.an-rank-item--warn .an-rank-name {
  color: #9b3a1a;
}

.an-rank-item--warn .an-rank-num {
  background: #fdf0eb;
  color: #9b3a1a;
}

.an-rank-num {
  flex-shrink: 0;
  width: 1.4rem;
  height: 1.4rem;
  background: var(--bone, #f4f1ec);
  color: var(--slate, #6b6b6b);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

.an-rank-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.an-rank-name {
  color: var(--ink, #1a1a1a);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

a.an-rank-name:hover {
  color: var(--forest, #2d5016);
  text-decoration: underline;
}

.an-rank-meta {
  font-size: 0.73rem;
  color: var(--slate, #6b6b6b);
}

.an-rank-val {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink, #1a1a1a);
  min-width: 2rem;
  text-align: right;
}

.an-rank-date {
  flex-shrink: 0;
  font-size: 0.73rem;
  color: var(--slate, #6b6b6b);
  white-space: nowrap;
}

/* Category bars */
.an-cat-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.an-cat-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.an-cat-label {
  width: 180px;
  flex-shrink: 0;
  color: var(--ink, #1a1a1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.an-cat-track {
  flex: 1;
  height: 8px;
  background: var(--bone, #f4f1ec);
  border-radius: 4px;
  overflow: hidden;
}

.an-cat-fill {
  height: 100%;
  background: var(--forest, #2d5016);
  border-radius: 4px;
  min-width: 4px;
  transition: width 0.3s ease;
}

.an-cat-val {
  width: 2.5rem;
  text-align: right;
  font-weight: 600;
  color: var(--slate, #6b6b6b);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Trend bar chart */
.an-trend {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 120px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border, #e8e4df) transparent;
  padding-bottom: 1.5rem;
}

.an-trend-bar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 6px;
  max-width: 28px;
  height: 100%;
  cursor: default;
}

.an-trend-bar {
  width: 100%;
  background: var(--forest, #273125);
  border-radius: 2px 2px 0 0;
  min-height: 0;
  transition: opacity 0.15s;
}

.an-trend-bar-wrap:hover .an-trend-bar {
  opacity: 0.7;
}

.an-trend-label {
  font-size: 0.6rem;
  color: var(--slate, #6b6b6b);
  white-space: nowrap;
  margin-top: 0.3rem;
  text-align: center;
  position: absolute;
  bottom: 0;
}

.an-trend-bar-wrap {
  position: relative;
}

/* Panel count badge */
.an-panel-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bone, #f4f1ec);
  color: var(--slate, #6b6b6b);
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 10px;
  padding: 0.1rem 0.45rem;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Member card */
.an-member-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: #fff;
  border-radius: var(--radius-md, 8px);
  padding: 1.4rem 1.6rem;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.an-member-card__info {
  flex: 1;
  min-width: 0;
}

.an-member-card__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
  font-size: 0.85rem;
}

.an-member-card__email {
  color: var(--forest, #2d5016);
  text-decoration: none;
}

.an-member-card__email:hover {
  text-decoration: underline;
}

.an-member-card__sep {
  color: var(--slate, #6b6b6b);
}

.an-member-card__company {
  color: var(--slate, #6b6b6b);
}

/* Project list on member page */
.an-proj-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.an-proj-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--color-border, #e8e4df);
  font-size: 0.875rem;
}

.an-proj-row:last-child {
  border-bottom: none;
}

.an-proj-row__info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.an-proj-row__name {
  color: var(--ink, #1a1a1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.an-proj-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: #e8f0e4;
  color: var(--forest, #2d5016);
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.an-proj-badge--grey {
  background: #ebebeb;
  color: var(--slate, #6b6b6b);
}

.an-proj-row__count {
  flex-shrink: 0;
  font-size: 0.8rem;
  color: var(--slate, #6b6b6b);
}

/* ── Featured page ──────────────────────────────────────────────────────────── */

.featured-page {
  height: calc(100dvh - var(--navbar-height, 64px));
  min-height: unset;
  background: var(--color-primary);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.page-featured .navbar {
  box-shadow: none;
}

body.page-featured .footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.6rem 2rem;
}

/* ── Featured loading screen ───────────────────────────────────
   Covers the whole viewport (navbar included) on the post-login
   landing page while the panel imagery loads, then fades to reveal
   a complete grid — no images popping in one by one. */
.featured-loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-primary);
  opacity: 1;
  transition: opacity 0.7s var(--ease-out);
}

.featured-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.featured-loader__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  transform: translateY(-4%);
}

.featured-loader__eyebrow {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(244, 241, 236, 0.55);
  margin-bottom: 1.1rem;
}

.featured-loader__wordmark {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--bone);
  line-height: 1.1;
  margin-bottom: 2rem;
}

.featured-loader__track {
  position: relative;
  width: 180px;
  height: 2px;
  border-radius: 2px;
  background: rgba(244, 241, 236, 0.16);
  overflow: hidden;
}

.featured-loader__bar {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--mint);
  will-change: transform;
  animation: featured-loader-sweep 1.4s var(--ease-in-out) infinite;
}

@keyframes featured-loader-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .featured-loader { transition: none; }
  .featured-loader__bar { animation: none; transform: none; opacity: 0.6; }
}

.featured-header {
  position: sticky;
  top: 64px;
  z-index: 50;
  height: 0;
  overflow: visible;
  color: white;
}

.featured-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1.25rem 4rem 3rem;
  background: linear-gradient(
    to bottom,
    rgba(10, 22, 10, 0.72) 0%,
    rgba(10, 22, 10, 0.20) 70%,
    transparent 100%
  );
  pointer-events: none;
}

.featured-header-inner > * {
  pointer-events: auto;
}

.featured-header .btn--outline {
  border-color: rgba(255, 255, 255, 0.75);
  color: white;
  background: transparent;
}

.featured-header .btn--outline:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: white;
}

.featured-eyebrow {
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  margin: 0 0 0.4rem;
}

.featured-heading {
  font-family: 'Sinclaire', Georgia, serif;
  font-size: clamp(1.75rem, 3.5vw, 3rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  color: white;
  margin: 0;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  line-height: 1.1;
}

.featured-library-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.featured-grid {
  --navbar-h: var(--navbar-height, 64px);
  --cell: min(calc(100vw / 3), calc((100dvh - var(--navbar-h)) / 2));
  display: grid;
  grid-template-columns: repeat(3, var(--cell));
  grid-template-rows: repeat(2, var(--cell));
  width: calc(3 * var(--cell));
  height: calc(2 * var(--cell));
  flex-shrink: 0;
}

@media (min-width: 1400px) {
  .featured-grid {
    --cell: min(calc(100vw / 4), calc((100dvh - var(--navbar-height, 64px)) / 2));
    grid-template-columns: repeat(4, var(--cell));
    grid-template-rows: repeat(2, var(--cell));
    width: calc(4 * var(--cell));
    height: calc(2 * var(--cell));
  }
}

@media (min-width: 1920px) {
  .featured-grid {
    --cell: min(calc(100vw / 6), calc((100dvh - var(--navbar-height, 64px)) / 2));
    grid-template-columns: repeat(6, var(--cell));
    grid-template-rows: repeat(2, var(--cell));
    width: calc(6 * var(--cell));
    height: calc(2 * var(--cell));
  }
}

@media (max-width: 1919px) {
  .featured-panel:nth-child(n+7) { display: none; }
}

.featured-panel {
  position: relative;
  display: block;
  min-height: 0;
  overflow: hidden;
  text-decoration: none;
  cursor: pointer;
}

.featured-panel__bg-next {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  z-index: 1;
}

.featured-panel__bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.6s ease;
}

.featured-panel:hover .featured-panel__bg {
  transform: scale(1.03);
}

.featured-panel__bg--placeholder {
  background-color: var(--color-accent-lt, #f5f2ee);
  background-size: 30%;
  background-repeat: no-repeat;
  background-position: center;
}

.featured-panel__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(to top,  rgba(10,22,10,0.92) 0%, rgba(10,22,10,0.30) 45%, transparent 68%),
    linear-gradient(to bottom, rgba(10,22,10,0.20) 0%, transparent 30%);
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}

.featured-panel:hover .featured-panel__overlay {
  opacity: 1;
}

.featured-panel__content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 1.5rem 2rem;
  height: 100%;
  min-height: 0;
  color: #fff;
  gap: 0.35rem;
}

.featured-panel__category {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 1.4s ease-in-out, transform 1.4s ease-in-out;
}

.featured-panel:hover .featured-panel__category {
  opacity: 0.75;
  transform: translateY(0);
}

.featured-panel__num {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-family: 'Sinclaire', Georgia, serif;
  font-size: clamp(2.5rem, 4.5vw, 5rem);
  font-weight: 400;
  color: rgba(255, 255, 255, 0.07);
  letter-spacing: -0.04em;
  line-height: 1;
  pointer-events: none;
  z-index: 3;
  user-select: none;
}

.featured-panel__name {
  font-family: 'Sinclaire', Georgia, serif;
  font-size: clamp(0.8rem, 1.35vw, 1.35rem);
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin: 0;
  max-width: 22ch;
  opacity: 0;
  text-decoration: none;
  transform: translateY(8px);
  transition: opacity 1.4s ease-in-out 0.15s, transform 1.4s ease-in-out 0.15s;
}

.featured-panel:hover .featured-panel__name {
  opacity: 1;
  transform: translateY(0);
}

.featured-panel__details {
  font-size: 0.72rem;
  opacity: 0;
  margin: 0;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transform: translateY(8px);
  transition: opacity 1.4s ease-in-out 0.3s, transform 1.4s ease-in-out 0.3s;
}

.featured-panel:hover .featured-panel__details {
  opacity: 0.65;
  transform: translateY(0);
}

.featured-panel__cta {
  margin-top: 1rem;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255,255,255,0.45);
  padding-bottom: 3px;
  opacity: 0.55;
  transform: translateY(0);
  transition: opacity 0.3s, letter-spacing 0.3s;
}

.featured-panel:hover .featured-panel__cta {
  opacity: 1;
  letter-spacing: 0.15em;
}

.featured-footer {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0;
  background: none;
  border: none;
  padding: 0;
}

.featured-footer__label {
  display: none;
}

.featured-footer__btn {
  display: inline-block;
  padding: 0.6rem 1.25rem;
  border: 1px solid rgba(255,255,255,0.55);
  color: white;
  background: rgba(0,0,0,0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  transition: background 0.2s, border-color 0.2s;
}

.featured-footer__btn:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
}

.featured-empty {
  padding: 6rem 2rem;
  text-align: center;
  color: var(--color-text-muted, #888);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

@media (max-width: 700px) {
  body.page-featured {
    height: 100dvh;
    min-height: unset;
    overflow: hidden;
  }

  .featured-grid {
    --cell: min(calc(100vw / 2), calc((100dvh - var(--navbar-height, 64px)) / 3));
    grid-template-columns: repeat(2, var(--cell));
    grid-template-rows: repeat(3, var(--cell));
    width: calc(2 * var(--cell));
    height: calc(3 * var(--cell));
  }

  .featured-panel {
    min-height: unset;
  }

  .featured-panel__content {
    padding: 0.75rem 1rem;
    min-height: unset;
  }

  .featured-panel__name {
    font-size: 0.95rem;
  }

  .featured-panel__details {
    display: none;
  }

  .featured-footer {
    top: 0.75rem;
    right: 0.75rem;
  }

  body.page-featured .footer {
    display: none;
  }

  .product-grid--sm .product-card:nth-child(5) { display: none; }
}

/* ── Featured badge / btn-accent ────────────────────────────────────────────── */

.visibility-badge--featured {
  background: #fffbea;
  color: #7a5c00;
  border: 1px solid #e8d870;
}

.btn--accent {
  background: #fffbea;
  color: #7a5c00;
  border: 1px solid #e8d870;
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  transition: background 0.15s;
}

.btn--accent:hover {
  background: #fef3a0;
}

/* ── Toggle switch (product form) ───────────────────────────────────────────── */

.toggle-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
  font-weight: 400;
}

.toggle-checkbox {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  flex-shrink: 0;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-checkbox:checked + .toggle-switch {
  background: var(--color-primary, #273125);
}

.toggle-checkbox:checked + .toggle-switch::after {
  transform: translateX(20px);
}

.toggle-text {
  font-size: 0.9rem;
  color: var(--color-text, #222);
}

/* ── Project picker modal ────────────────────────────────────────────────────── */

.modal-open { overflow: hidden; }

/* Ensure hidden attribute is respected even when display is explicitly set */
.proj-modal[hidden],
.proj-modal__new-input[hidden] { display: none !important; }

.proj-modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 26, 20, 0.5);
  backdrop-filter: blur(3px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.proj-modal__card {
  background: #fff;
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  padding: 2rem;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.proj-modal__title {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--color-text, #222);
  margin: 0;
}

.proj-modal__sub {
  font-size: 0.85rem;
  color: var(--color-text-muted, #888);
  margin: -0.75rem 0 0;
}

.proj-modal__loading {
  font-size: 0.875rem;
  color: var(--color-text-muted, #888);
  padding: 0.5rem 0;
}

.proj-modal__list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-height: 240px;
  overflow-y: auto;
}

.proj-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: background 0.12s;
  border: 1px solid transparent;
}

.proj-item:hover {
  background: var(--color-accent-lt, #f5f2ee);
}

.proj-item--selected {
  background: var(--color-accent-lt, #f5f2ee);
  border-color: var(--color-primary, #273125);
}

.proj-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  min-width: 16px;
  border: 2px solid var(--color-border, #c8c4bf);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: border-color 0.12s, background 0.12s;
}

.proj-item input[type="checkbox"]:checked {
  background: var(--color-primary, #273125);
  border-color: var(--color-primary, #273125);
}

.proj-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.proj-item__name {
  flex: 1;
  font-size: 0.9rem;
  color: var(--color-text, #222);
}

.proj-item__count {
  font-size: 0.78rem;
  color: var(--color-text-muted, #888);
  background: var(--color-border, #e8e4df);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
}

.proj-item__owner {
  font-size: 0.76rem;
  color: var(--color-text-muted, #888);
  font-weight: 400;
}

.proj-modal__new {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.proj-modal__new-btn {
  background: none;
  border: none;
  color: var(--color-primary, #273125);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.proj-modal__new-btn:hover { opacity: 0.7; }

.proj-modal__new-input {
  display: flex;
  gap: 0.5rem;
}

.proj-modal__new-input input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--color-border, #e8e4df);
  border-radius: var(--radius-sm, 4px);
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
}

.proj-modal__new-input input:focus {
  border-color: var(--color-primary, #273125);
}

.proj-modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  padding-top: 0.25rem;
  border-top: 1px solid var(--color-border, #e8e4df);
}

/* ── Favourites page — project sections ─────────────────────────────────────── */

.fav-project-section {
  margin-bottom: 3rem;
}

.fav-project-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--color-border, #e8e4df);
  flex-wrap: wrap;
}

.fav-project-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.fav-project-title h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--color-text, #222);
}

.fav-project-count {
  font-size: 0.8rem;
  color: var(--color-text-muted, #888);
  background: var(--color-accent-lt, #f5f2ee);
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
}

/* ── Analyst — member projects page ─────────────────────────────────────────── */

/* ── Analyst page header ────────────────────────────────────────────────────── */

.analyst-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ── Analyst filter row (search + team + member) ────────────────────────────── */

.analyst-filter-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
}

.analyst-filter-search {
  flex: 1;
  min-width: 180px;
}

.analyst-filter-select {
  width: auto;
  min-width: 140px;
  flex-shrink: 0;
}

/* ── Analyst projects list card ─────────────────────────────────────────────── */

.analyst-recent-card {
  background: var(--pure-white, #fff);
  border: 1px solid var(--color-border, #e8e4df);
  border-radius: 10px;
  padding: 0 1.75rem;
  min-width: 0;
  overflow: hidden;
  margin-top: 0.5rem;
}

.analyst-create-card {
  background: var(--pure-white, #fff);
  border: 1px solid var(--color-border, #e8e4df);
  border-radius: 10px;
  padding: 1.75rem;
  min-width: 0;
  overflow: hidden;
}

.analyst-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate, #6b6b6b);
  margin: 0 0 1.25rem;
}

.analyst-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Create Project Modal ───────────────────────────────────────────────────── */

.cp-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.cp-modal[hidden] { display: none; }

.cp-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(2px);
}

.cp-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cp-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--color-border, #e8e4df);
}

.cp-modal__title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--ink, #1a1a1a);
}

.cp-modal__close {
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--slate, #6b6b6b);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
}
.cp-modal__close:hover { background: var(--bone, #f4f1ec); color: var(--ink); }

.cp-modal__body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  overflow-y: auto;
  max-height: 65dvh;
}

.cp-modal__footer {
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--color-border, #e8e4df);
  display: flex;
  justify-content: flex-end;
}

/* ── Reset action rows inside modal ────────────────────────────────────────── */

.reset-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border, #e8e4df);
}
.reset-action-row:last-child { border-bottom: none; }
.reset-action-row:first-child { padding-top: 0; }

.reset-action-info {
  flex: 1;
  min-width: 0;
}
.reset-action-info strong {
  display: block;
  font-size: 0.875rem;
  color: var(--ink, #1a1a1a);
  margin-bottom: 0.2rem;
}
.reset-action-info p {
  font-size: 0.8rem;
  color: var(--slate, #6b6b6b);
  margin: 0;
  line-height: 1.4;
}

.btn--danger-outline {
  background: none;
  border: 1px solid var(--color-danger, #c0392b);
  color: var(--color-danger, #c0392b);
  border-radius: var(--radius-pill, 99px);
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}
.btn--danger-outline:hover {
  background: var(--color-danger, #c0392b);
  color: #fff;
}

/* ── Member checkboxes inside modal ────────────────────────────────────────── */

.cp-members-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cp-team-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--slate, #6b6b6b);
  margin: 0 0 0.25rem;
}

.cp-member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--color-border, #e8e4df);
  border-radius: 8px;
  overflow: hidden;
}

.cp-member-item {
  border-bottom: 1px solid var(--color-border, #e8e4df);
}
.cp-member-item:last-child { border-bottom: none; }

.cp-member-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--ink, #1a1a1a);
  transition: background 0.12s;
}
.cp-member-label:hover { background: var(--bone, #f4f1ec); }

.cp-member-check {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary, #273125);
  flex-shrink: 0;
  cursor: pointer;
}

.analyst-projects-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.analyst-project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--color-border, #e8e4df);
}

.analyst-project-row:last-child {
  border-bottom: none;
}

.analyst-project-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.analyst-project-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink, #1a1a1a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.analyst-project-member {
  font-size: 0.78rem;
  color: var(--slate, #6b6b6b);
}

.analyst-project-count {
  font-size: 0.75rem;
  color: var(--slate, #6b6b6b);
  white-space: nowrap;
  flex-shrink: 0;
  background: var(--bone, #f4f1ec);
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
}

/* ── Analyst — member projects panel ────────────────────────────────────────── */

.mp-pill-divider {
  display: inline-block;
  width: 1px;
  height: 1.1rem;
  background: var(--color-border, #e8e4df);
  margin: 0 0.25rem;
  align-self: center;
  flex-shrink: 0;
}

.analyst-member-panel {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border, #e8e4df);
}

.analyst-member-panel-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.analyst-member-panel-title {
  font-family: var(--font-serif, serif);
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0;
  color: var(--ink, #1a1a1a);
}

.analyst-member-panel-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--slate);
  padding: 0 0.25rem;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.analyst-member-panel-close:hover { opacity: 1; }

.analyst-loading {
  font-size: 0.875rem;
  color: var(--slate, #6b6b6b);
  padding: 1rem 0;
}

.analyst-error {
  font-size: 0.875rem;
  color: var(--burgundy, #401a0d);
}

.analyst-empty {
  font-size: 0.875rem;
  color: var(--slate, #6b6b6b);
  margin: 0;
}

.analyst-empty-small {
  font-size: 0.8rem;
  color: var(--slate, #6b6b6b);
  margin: 0;
  padding: 0.25rem 0;
}

/* Project accordion cards */
.analyst-proj-card {
  border: 1px solid var(--color-border, #e8e4df);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: var(--pure-white, #fff);
}

.analyst-proj-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.analyst-proj-card__header:hover {
  background: var(--bone, #f4f1ec);
}

.analyst-proj-card__chevron {
  flex-shrink: 0;
  color: var(--slate, #6b6b6b);
  transition: transform 0.2s ease;
}

.analyst-proj-card__name {
  flex: 1;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink, #1a1a1a);
}

.analyst-proj-card__default {
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--mint, #5e8c6e);
  border: 1px solid var(--mint, #5e8c6e);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
}

.analyst-proj-card--archived {
  opacity: 0.65;
}

.analyst-proj-archive-row {
  padding: 0.75rem 1rem 0.5rem;
  border-top: 1px solid var(--color-border, #e5e0d8);
}

.analyst-proj-archive-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--slate, #6b6b6b);
  background: none;
  border: 1px solid var(--color-border, #e5e0d8);
  border-radius: 4px;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.analyst-proj-archive-btn:hover {
  background: var(--forest, #273125);
  color: #fff;
  border-color: var(--forest, #273125);
}

.analyst-proj-archive-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.analyst-proj-card__count {
  font-size: 0.75rem;
  color: var(--slate, #6b6b6b);
  background: var(--bone, #f4f1ec);
  border-radius: 99px;
  padding: 0.15rem 0.6rem;
  flex-shrink: 0;
}

.analyst-proj-card__body {
  padding: 1rem 1.1rem 1.1rem;
  border-top: 1px solid var(--color-border, #e8e4df);
}

/* Surface tiles grid */
.analyst-surf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.analyst-surf-tile {
  position: relative;
  background: var(--bone, #f4f1ec);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--color-border, #e8e4df);
}

.analyst-surf-tile__img-wrap {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.analyst-surf-tile__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.analyst-surf-tile__info {
  padding: 0.4rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.analyst-surf-tile__name {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--ink, #1a1a1a);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.analyst-surf-tile__code {
  font-size: 0.67rem;
  color: var(--slate, #6b6b6b);
}

.analyst-surf-tile__remove {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: var(--slate, #6b6b6b);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  padding: 0;
}

.analyst-surf-tile:hover .analyst-surf-tile__remove {
  opacity: 1;
}

.analyst-surf-tile__remove:hover {
  background: var(--burgundy, #401a0d);
  color: #fff;
}

/* Add surface search */
.analyst-add-area {
  padding-top: 0.75rem;
  border-top: 1px solid var(--color-border, #e8e4df);
}

.analyst-add-search-wrap {
  position: relative;
}

.analyst-search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--pure-white, #fff);
  border: 1px solid var(--color-border, #e8e4df);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  list-style: none;
  margin: 0;
  padding: 0.3rem 0;
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
}

.analyst-search-result-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
  font-size: 0.84rem;
  transition: background 0.1s;
}

.analyst-search-result-item:hover:not(.analyst-search-result-item--empty) {
  background: var(--bone, #f4f1ec);
}

.analyst-search-result-item--empty {
  color: var(--slate, #6b6b6b);
  cursor: default;
  font-size: 0.82rem;
}

.analyst-search-result-item--checked {
  background: var(--bone, #f4f1ec);
}

.analyst-result-check {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  cursor: pointer;
  accent-color: var(--forest, #2d5016);
}

.analyst-add-selected-btn {
  margin-top: 0.5rem;
  width: 100%;
}

.analyst-proj-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0 0.25rem;
  gap: 0.5rem;
}

.analyst-proj-actions .analyst-proj-archive-btn {
  margin-left: auto;
}

/* ── Add Surfaces Modal ─────────────────────────────────────────────────────── */
.add-surf-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 8vh;
}

.add-surf-modal[hidden] {
  display: none;
}

.add-surf-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.add-surf-modal__dialog {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  width: 100%;
  max-width: 560px;
  margin: 0 1rem;
  display: flex;
  flex-direction: column;
  max-height: 84vh;
}

.add-surf-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.4rem;
  border-bottom: 1px solid var(--color-border, #e8e4df);
  flex-shrink: 0;
}

.add-surf-modal__title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink, #1a1a1a);
}

.add-surf-modal__proj-name {
  font-weight: 400;
  color: var(--slate, #6b6b6b);
}

.add-surf-modal__proj-name:not(:empty)::before {
  content: ' — ';
}

.add-surf-modal__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--slate, #6b6b6b);
  cursor: pointer;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  transition: background 0.15s;
  flex-shrink: 0;
}

.add-surf-modal__close:hover {
  background: var(--bone, #f4f1ec);
  color: var(--ink, #1a1a1a);
}

.add-surf-modal__search-row {
  padding: 1.1rem 1.4rem 0.75rem;
  flex-shrink: 0;
}

.add-surf-modal__results {
  list-style: none;
  margin: 0 1.4rem;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  border: 1px solid var(--color-border, #e8e4df);
  border-radius: 6px;
}

.add-surf-modal__results:empty {
  display: none;
  margin: 0;
}

.add-surf-modal__footer {
  padding: 0.9rem 1.4rem;
  border-top: 1px solid var(--color-border, #e8e4df);
  flex-shrink: 0;
  margin-top: 0.75rem;
}

.add-surf-modal__footer .btn {
  width: 100%;
}

.analyst-result-name {
  flex: 1;
  color: var(--ink, #1a1a1a);
  font-weight: 500;
}

.analyst-result-code,
.analyst-result-cat {
  font-size: 0.74rem;
  color: var(--slate, #6b6b6b);
  background: var(--bone, #f4f1ec);
  border-radius: 99px;
  padding: 0.1rem 0.45rem;
  white-space: nowrap;
}

/* ── Member Projects — mobile ───────────────────────────────────────────────── */

@media (max-width: 600px) {
  .analyst-filter-row {
    gap: 0.5rem;
    margin-top: 1rem;
    flex-direction: column;
  }

  .analyst-filter-search,
  .analyst-filter-select {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  .analyst-recent-card {
    padding: 0 1rem;
  }

  .cp-modal {
    align-items: flex-end;
    padding: 0;
  }

  .cp-modal__dialog {
    border-radius: 14px 14px 0 0;
    max-height: 88dvh;
    max-width: 100%;
  }

  .analyst-proj-card__body {
    padding: 0.75rem 0.85rem 0.85rem;
  }

  /* Always show remove button on touch — no hover state */
  .analyst-surf-tile__remove {
    opacity: 1;
  }

  /* Add surfaces modal — bottom sheet */
  .add-surf-modal {
    align-items: flex-end;
    padding-top: 0;
  }

  .add-surf-modal__dialog {
    margin: 0;
    border-radius: 14px 14px 0 0;
    max-height: 88dvh;
    width: 100%;
  }
}

/* ── Selections — new project button ────────────────────────────────────────── */

.new-project-btn {
  margin-top: 0.75rem;
  margin-bottom: 2rem;
}

/* ── Selections — project card grid ─────────────────────────────────────────── */

/* selections-main intentionally has no max-width — fills the full catalogue width */

/* ── Selections page header (title + search + new project button) ──────────── */
.selections-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

.selections-header__controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.selections-search {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--ink, #140a06);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--whisper, #a39e95);
  padding: 0.35rem 0;
  width: 200px;
  outline: none;
  transition: border-color 0.2s ease;
}

.selections-search::placeholder { color: var(--whisper, #a39e95); }
.selections-search:focus { border-bottom-color: var(--forest, #273125); }

/* ── Selections section labels ───────────────────────────────────────────── */
.selections-section {
  margin-bottom: 2rem;
}

.selections-section-label {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-sans, sans-serif);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--whisper, #a39e95);
  margin: 0 0 1rem;
}

.selections-section-label svg {
  color: var(--mint, #5e8c6e);
  flex-shrink: 0;
}

/* Favourites section — constrain grid so a single card doesn't stretch full-width */
.moodboard-grid--favourites {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 380px));
  gap: 1.5rem;
  margin-bottom: 0;
}

/* ── Product card dual save buttons ──────────────────────────────────────── */
.product-card__save-btns {
  position: absolute;
  bottom: 0.65rem;
  right: 0.75rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.product-card__save-btns .btn--icon {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  width: auto;
  height: auto;
  color: rgba(255,255,255,0.6);
}

.product-card__save-btns .btn--icon:hover {
  background: none;
  color: var(--bone, #f4f1ec);
}

.product-card__save-btns .heart-btn--active,
.product-card__save-btns .heart-btn--active svg { color: var(--bone, #f4f1ec); }

.product-card__save-btns .folder-btn--active,
.product-card__save-btns .folder-btn--active svg { color: var(--mint, #5e8c6e); }

/* ── Selections page action pills (New project · Archived) ───────────────── */
.selections-action-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.selections-action-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.selections-archived-count {
  font-size: 0.65rem;
  line-height: 1;
  background: rgba(39, 49, 37, 0.12);
  color: inherit;
  border-radius: 10px;
  padding: 0.15rem 0.45rem;
}

.project-detail-topbar ~ .catalogue-header .page-title {
  font-family: var(--font-sans);
}

/* ── Moodboard page header ───────────────────────────────────────────────── */
.moodboard-page-eyebrow {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--whisper, #a39e95);
  margin: 0 0 0.35rem;
}

.moodboard-page-title {
  font-family: var(--font-serif, serif);
  font-size: 2rem;
  font-weight: 400;
  color: var(--ink, #1a1a1a);
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.moodboard-page-title em {
  font-style: italic;
  color: var(--mint, #5e8c6e);
}

/* ── Moodboard card grid ─────────────────────────────────────────────────── */
/* auto-fill with 320px min fills the full catalogue width — same approach as the product grid */
.moodboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

@media (max-width: 480px) {
  .moodboard-grid { grid-template-columns: 1fr; }
}

/* ── Moodboard card ──────────────────────────────────────────────────────── */
.moodboard-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--forest, #273125);
  border-radius: 4px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.moodboard-card--archived {
  opacity: 0.6;
}

/* Swatch collage zone fills card above the name strip */
.moodboard-card__swatch-zone {
  position: absolute;
  inset: 0;
  bottom: 68px;
  background: var(--forest, #273125);
  overflow: hidden;
}

/* Empty card gradient */
.moodboard-card__empty {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: linear-gradient(140deg, var(--forest, #273125) 0%, var(--mint, #5e8c6e) 100%);
  color: rgba(255,255,255,0.45);
  font-size: 0.75rem;
  font-family: var(--font-sans, sans-serif);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Stacked swatch deck ─────────────────────────────────────────────────────
   All swatches share the same anchor point (top:50%, left:50%) inside the
   swatch zone. Each is centred with translate(-50%,-50%) then given a unique
   resting rotation + micro-offset so the pile looks physical.
   On hover the deck scatters organically — top cards react fastest, bottom
   cards follow, revealing the layers beneath.
   --------------------------------------------------------------------------- */

.moodboard-swatch {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.45);
  border: 3px solid rgba(39,49,37,0.85);
}

.moodboard-swatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.85) saturate(0.82);
  transition: filter 0.5s ease;
}

/* Resting — already spread, matching the editorial scatter from the mockup */
.moodboard-swatch-1  { transform: translate(calc(-50% - 65px), calc(-50% + 48px))  rotate(-22deg); z-index:1;  box-shadow: 0 6px 20px rgba(0,0,0,0.5);  transition: transform 0.65s cubic-bezier(0.22,0.61,0.36,1), box-shadow 0.65s ease; }
.moodboard-swatch-2  { transform: translate(calc(-50% + 68px), calc(-50% - 40px))  rotate(20deg);  z-index:2;  box-shadow: 0 6px 20px rgba(0,0,0,0.5);  transition: transform 0.62s cubic-bezier(0.22,0.61,0.36,1), box-shadow 0.62s ease; }
.moodboard-swatch-3  { transform: translate(calc(-50% - 70px), calc(-50% - 32px))  rotate(-16deg); z-index:3;  box-shadow: 0 6px 20px rgba(0,0,0,0.5);  transition: transform 0.60s cubic-bezier(0.22,0.61,0.36,1), box-shadow 0.60s ease; }
.moodboard-swatch-4  { transform: translate(calc(-50% + 55px), calc(-50% + 50px))  rotate(18deg);  z-index:4;  box-shadow: 0 6px 20px rgba(0,0,0,0.5);  transition: transform 0.57s cubic-bezier(0.22,0.61,0.36,1), box-shadow 0.57s ease; }
.moodboard-swatch-5  { transform: translate(calc(-50% - 28px), calc(-50% - 58px))  rotate(-8deg);  z-index:5;  box-shadow: 0 6px 20px rgba(0,0,0,0.5);  transition: transform 0.55s cubic-bezier(0.25,0.65,0.38,1), box-shadow 0.55s ease; }
.moodboard-swatch-6  { transform: translate(calc(-50% + 24px), calc(-50% - 55px))  rotate(7deg);   z-index:6;  box-shadow: 0 6px 20px rgba(0,0,0,0.5);  transition: transform 0.52s cubic-bezier(0.25,0.65,0.38,1), box-shadow 0.52s ease; }
.moodboard-swatch-7  { transform: translate(calc(-50% + 72px), calc(-50% + 8px))   rotate(17deg);  z-index:7;  box-shadow: 0 6px 20px rgba(0,0,0,0.5);  transition: transform 0.48s cubic-bezier(0.28,0.68,0.40,1), box-shadow 0.48s ease; }
.moodboard-swatch-8  { transform: translate(calc(-50% - 62px), calc(-50% + 14px))  rotate(-19deg); z-index:8;  box-shadow: 0 6px 20px rgba(0,0,0,0.5);  transition: transform 0.45s cubic-bezier(0.28,0.68,0.40,1), box-shadow 0.45s ease; }
.moodboard-swatch-9  { transform: translate(calc(-50% + 8px),  calc(-50% + 62px))  rotate(10deg);  z-index:9;  box-shadow: 0 6px 20px rgba(0,0,0,0.5);  transition: transform 0.42s cubic-bezier(0.30,0.72,0.42,1), box-shadow 0.42s ease; }
.moodboard-swatch-10 { transform: translate(calc(-50% - 12px), calc(-50% + 28px))  rotate(-4deg);  z-index:10; box-shadow: 0 6px 20px rgba(0,0,0,0.5);  transition: transform 0.38s cubic-bezier(0.30,0.72,0.42,1), box-shadow 0.38s ease; }

/* Hover — push each swatch ~35% further from centre, revealing more of every surface */
.moodboard-card:hover .moodboard-swatch-1  { transform: translate(calc(-50% - 88px), calc(-50% + 65px))  rotate(-26deg); box-shadow: 0 14px 36px rgba(0,0,0,0.65); }
.moodboard-card:hover .moodboard-swatch-2  { transform: translate(calc(-50% + 92px), calc(-50% - 54px))  rotate(24deg);  box-shadow: 0 14px 36px rgba(0,0,0,0.65); }
.moodboard-card:hover .moodboard-swatch-3  { transform: translate(calc(-50% - 95px), calc(-50% - 43px))  rotate(-20deg); box-shadow: 0 14px 36px rgba(0,0,0,0.65); }
.moodboard-card:hover .moodboard-swatch-4  { transform: translate(calc(-50% + 74px), calc(-50% + 68px))  rotate(22deg);  box-shadow: 0 14px 36px rgba(0,0,0,0.65); }
.moodboard-card:hover .moodboard-swatch-5  { transform: translate(calc(-50% - 38px), calc(-50% - 78px))  rotate(-12deg); box-shadow: 0 14px 36px rgba(0,0,0,0.65); }
.moodboard-card:hover .moodboard-swatch-6  { transform: translate(calc(-50% + 32px), calc(-50% - 74px))  rotate(11deg);  box-shadow: 0 14px 36px rgba(0,0,0,0.65); }
.moodboard-card:hover .moodboard-swatch-7  { transform: translate(calc(-50% + 97px), calc(-50% + 11px))  rotate(21deg);  box-shadow: 0 14px 36px rgba(0,0,0,0.65); }
.moodboard-card:hover .moodboard-swatch-8  { transform: translate(calc(-50% - 84px), calc(-50% + 19px))  rotate(-23deg); box-shadow: 0 14px 36px rgba(0,0,0,0.65); }
.moodboard-card:hover .moodboard-swatch-9  { transform: translate(calc(-50% + 11px), calc(-50% + 84px))  rotate(14deg);  box-shadow: 0 14px 36px rgba(0,0,0,0.65); }
.moodboard-card:hover .moodboard-swatch-10 { transform: translate(calc(-50% - 16px), calc(-50% + 38px))  rotate(-6deg);  box-shadow: 0 14px 36px rgba(0,0,0,0.65); }

.moodboard-card:hover .moodboard-swatch img {
  filter: brightness(1) saturate(1);
}

@media (prefers-reduced-motion: reduce) {
  .moodboard-swatch { transition: none; }
  .moodboard-swatch img { transition: none; }
  .moodboard-card:hover .moodboard-swatch-1,
  .moodboard-card:hover .moodboard-swatch-2,
  .moodboard-card:hover .moodboard-swatch-3,
  .moodboard-card:hover .moodboard-swatch-4,
  .moodboard-card:hover .moodboard-swatch-5,
  .moodboard-card:hover .moodboard-swatch-6,
  .moodboard-card:hover .moodboard-swatch-7,
  .moodboard-card:hover .moodboard-swatch-8,
  .moodboard-card:hover .moodboard-swatch-9,
  .moodboard-card:hover .moodboard-swatch-10 { transform: translate(-50%,-50%); }
}

/* Name strip — darker forest shelf at the bottom */
.moodboard-card__name-strip {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 68px;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(26,32,26,0.96);
  border-top: 1px solid rgba(242,241,236,0.08);
}

.moodboard-card__name {
  font-family: var(--font-serif, serif);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--bone, #f4f1ec);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
  margin: 0 0 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.moodboard-card__meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-sans, sans-serif);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--whisper, #a39e95);
}

.moodboard-meta-dot {
  color: var(--mint, #5e8c6e);
  opacity: 0.5;
}

/* Analyst member-projects: card + Add Surface button wrapper */
.mp-card-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mp-add-surf-btn {
  width: 100%;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--forest);
  color: var(--forest);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.45rem 0.75rem;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}

.mp-add-surf-btn:hover {
  background: var(--forest);
  color: var(--bone);
}

.moodboard-meta-shared {
  color: var(--mint, #5e8c6e);
}

/* ── Share panel member list ─────────────────────────────────────────────── */
.share-member-list {
  max-height: 220px;
  overflow-y: auto;
  margin: 0 -1rem;
  padding: 0 1rem;
}

.share-member-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0;
  cursor: pointer;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.85rem;
}

.share-member-row:last-child { border-bottom: none; }

.share-member-row--all {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.55rem;
  margin-bottom: 0.2rem;
}

.share-member-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: var(--forest);
  cursor: pointer;
}

.share-member-info {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.share-member-name {
  color: var(--ink);
  line-height: 1.3;
}

.share-member-company {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.2;
}

.project-card__team-badge,
.project-card__shared-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border-radius: 99px;
  padding: 0.1rem 0.55rem;
  font-size: 0.74rem;
}

.project-card__team-badge {
  background: color-mix(in srgb, var(--forest, #273125) 12%, transparent);
  color: var(--forest, #273125);
}

.project-card__shared-badge {
  background: var(--bone, #f4f1ec);
  color: var(--slate, #6b6b6b);
}

/* Action buttons row — bottom-right corner, hidden until hover */
.project-card__actions-row {
  position: absolute;
  bottom: 0.55rem;
  right: 0.55rem;
  display: flex;
  gap: 0.35rem;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 2;
}

.project-card:hover .project-card__actions-row {
  opacity: 1;
}

/* Touch devices — always show action buttons since hover isn't available */
@media (hover: none) {
  .project-card__actions-row {
    opacity: 1;
  }
}

.project-card__action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: var(--slate, #6b6b6b);
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  transition: background 0.12s, color 0.12s;
  padding: 0;
}

.project-card__action-btn:hover {
  background: var(--forest, #273125);
  color: #fff;
}

.project-card__action-btn--danger:hover {
  background: var(--burgundy, #401a0d);
  color: #fff;
}

/* Archived project card */
.project-card--archived {
  opacity: 0.6;
}

.project-card--archived .project-card__name {
  color: var(--slate, #6b6b6b);
}

/* Archive section (collapsed) */
.archive-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border, #e5e0d8);
}

.archive-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--slate, #6b6b6b);
  letter-spacing: 0.01em;
  padding: 0;
  margin-bottom: 1rem;
  transition: color 0.15s;
}

.archive-toggle-btn:hover {
  color: var(--forest, #273125);
}

.archive-toggle-btn__chevron {
  transition: transform 0.2s;
  flex-shrink: 0;
}

.archive-toggle-btn--open .archive-toggle-btn__chevron {
  transform: rotate(180deg);
}

.archive-cards {
  /* grid layout comes from .moodboard-grid when that class is also applied */
  margin-top: 1rem;
}

/* ── Project detail page ─────────────────────────────────────────────────────── */

.project-detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.project-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--slate, #6b6b6b);
  text-decoration: none;
  letter-spacing: 0.01em;
  transition: color 0.15s;
}

.project-back-link:hover {
  color: var(--forest, #273125);
}

/* ── Project files section ───────────────────────────────────────────────────── */

.project-files-section {
  border-top: 1px solid var(--color-border, #e8e4df);
  padding-top: 2rem;
  margin-top: 1rem;
}

.project-files-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.project-files-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: var(--ink, #1a1a1a);
}

.project-files-upload-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.project-files-empty {
  font-size: 0.875rem;
  color: var(--slate, #6b6b6b);
  margin: 0;
}

.project-files-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-file-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--pure-white, #fff);
  border: 1px solid var(--color-border, #e8e4df);
  border-radius: 6px;
  padding: 0.6rem 0.85rem;
}

.project-file-link {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink, #1a1a1a);
  font-size: 0.875rem;
  min-width: 0;
}

.project-file-link:hover .project-file-name {
  text-decoration: underline;
  color: var(--forest, #273125);
}

.project-file-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-file-size {
  font-size: 0.75rem;
  color: var(--slate, #6b6b6b);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ── New project dialog ──────────────────────────────────────────────────────── */

#new-project-dialog {
  border: none;
  border-radius: 10px;
  padding: 0;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  background: var(--pure-white, #fff);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

#new-project-dialog::backdrop {
  background: rgba(0,0,0,0.4);
}

.new-project-dialog__inner {
  padding: 1.75rem 2rem;
}

.new-project-dialog__title {
  font-family: var(--font-serif, serif);
  font-size: 1.15rem;
  font-weight: 400;
  margin: 0 0 1.25rem;
  color: var(--ink, #1a1a1a);
}

.new-project-dialog__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.25rem;
}

/* ============================================================
   PRODUCT FORM — editorial restyle (admin product details)
   Scoped to .product-form / .product-form-page so the rest of
   the admin keeps its existing forms. Applies the brand's
   underlined-input pattern, whisper labels, serif section
   titles and generous whitespace. Tokens only — colours come
   from the :root palette (translucent borders via color-mix
   keep us on the --ink token rather than a raw rgba value).
   ============================================================ */

/* Eyebrow — brand primitive (eyebrow → title rhythm) */
.eyebrow {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--whisper, #a39e95);
  margin: 0 0 0.35rem;
}

/* Page header */
.product-form-page .admin-dash-head { align-items: flex-start; }
.product-form-page .admin-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 2.7rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink);
}
.product-form-page .admin-title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

/* Section cards */
.product-form .admin-card {
  background: var(--color-surface);
  border: 1px solid var(--linen);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: var(--space-m);
  margin-bottom: var(--space-m);
}
.product-form .admin-card .eyebrow { margin-bottom: 0.4rem; }
.product-form .admin-card__title {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--ink);
  margin: 0 0 var(--space-m);
  padding-bottom: var(--space-s);
  border-bottom: 1px solid var(--linen);
}

/* Field rows + groups */
.product-form .form-row {
  gap: var(--space-m);
  margin-bottom: var(--space-m);
}
.product-form .form-group { gap: 0.35rem; }
.product-form .admin-card > .form-row:last-child,
.product-form .admin-card > .form-group:last-child { margin-bottom: 0; }

/* Labels — whisper, wide-tracked (skip toggle labels) */
.product-form .form-group > label:not(.toggle-label) {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--whisper);
  margin-bottom: 0.15rem;
}

/* Underlined inputs — the brand signature (never boxed) */
.product-form .form-group input[type="text"],
.product-form .form-group input[type="number"],
.product-form .form-group select,
.product-form .form-group textarea {
  border: none;
  border-bottom: 1px solid var(--linen);
  border-bottom-color: color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: 0;
  background: transparent;
  padding: 0.7rem 0;
  font-family: var(--sans);
  font-size: 1.05rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--ink);
  transition: border-color 0.3s var(--ease-out);
}
.product-form .form-group input[type="text"]:focus,
.product-form .form-group input[type="number"]:focus,
.product-form .form-group select:focus,
.product-form .form-group textarea:focus {
  outline: none;
  border-bottom-color: var(--accent);
}
.product-form .form-group input::placeholder,
.product-form .form-group textarea::placeholder {
  color: var(--whisper);
  font-style: italic;
}

/* Selects — underlined with a quiet chevron, native arrow removed */
.product-form .form-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 1.6rem;
  /* stroke %236b6862 mirrors --slate; a data-URI SVG can't read CSS vars,
     so keep this in sync if --slate ever changes. */
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='14'%20height='14'%20viewBox='0%200%2014%2014'%20fill='none'%3E%3Cpath%20d='M3%205l4%204%204-4'%20stroke='%236b6862'%20stroke-width='1.5'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.1rem center;
  background-size: 13px;
}

/* Textarea */
.product-form .form-group textarea {
  min-height: 7.5rem;
  line-height: 1.6;
  resize: vertical;
}

/* Drop the number spinners for a cleaner editorial field */
.product-form .form-group input[type="number"]::-webkit-outer-spin-button,
.product-form .form-group input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.product-form .form-group input[type="number"] { -moz-appearance: textfield; }

/* Hints */
.product-form .form-hint {
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--slate);
  margin-top: 0.4rem;
  line-height: 1.5;
}

/* Specifications — paired label/value rows with a quiet remove control */
.product-form .specs-row {
  align-items: center;
  gap: var(--space-s);
  margin-bottom: var(--space-xs);
}
.product-form .specs-row .form-group { flex: 1; margin-bottom: 0; }
.product-form .specs-row .specs-remove {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--slate);
  cursor: pointer;
  border-radius: var(--radius);
  transition: color 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}
.product-form .specs-row .specs-remove:hover {
  color: var(--forest);
  background: color-mix(in srgb, var(--forest) 8%, transparent);
}
.product-form .specs-row .specs-remove:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--forest) 30%, transparent);
}
.product-form .specs-row .specs-remove svg { display: block; }

/* On phones the row stacks (label over value); group each spec so the pair and
   its Remove read as one unit, with a hairline between specs. */
@media (max-width: 600px) {
  .product-form .specs-row {
    align-items: stretch;
    gap: var(--space-xs);
    padding-bottom: var(--space-s);
    margin-bottom: var(--space-s);
    border-bottom: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  }
  .product-form #specs-rows .specs-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .product-form .specs-row .specs-remove { align-self: flex-end; }
}

/* File upload — subtle, on-brand drop zone */
.product-form .file-upload-label {
  border: 1px dashed var(--linen);
  border-color: color-mix(in srgb, var(--ink) 16%, transparent);
  border-radius: var(--radius);
  background: var(--bone);
  padding: var(--space-m);
  color: var(--slate);
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  transition: border-color 0.3s var(--ease-out),
              background 0.3s var(--ease-out),
              color 0.3s var(--ease-out);
}
.product-form .file-upload-label:hover {
  border-color: var(--accent);
  background: var(--paper);
  color: var(--ink);
}
/* Smaller upload label variant used inside resource slots */
.product-form .file-upload-label--sm {
  padding: var(--space-s) var(--space-m);
  font-size: 0.8rem;
}
/* Resource slots — one per file type inside the Resources admin-card */
.resource-slot {
  padding: var(--space-m) 0;
  border-bottom: 1px solid var(--color-border);
}
.resource-slot:first-of-type { padding-top: var(--space-s); }
.resource-slot:last-of-type  { border-bottom: none; padding-bottom: 0; }
.resource-slot__label {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--whisper);
  margin-bottom: var(--space-s);
}
/* Current-file row: spec card + remove button side-by-side */
.res-current {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.res-current[hidden] { display: none; }
/* PDF spec-sheet preview card — mirrors the image thumbnails: a document
   symbol with the filename beneath it. Used both for an existing spec sheet
   and for a freshly-selected file awaiting save. */
.spec-preview { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.spec-preview[hidden] { display: none; }
.spec-card {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: 96px;
  color: var(--forest);
  text-decoration: none;
}
a.spec-card:hover { text-decoration: none; }
.spec-card__doc {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--ease-out);
}
a.spec-card:hover .spec-card__doc { transform: translateY(-2px); }
.spec-card__doc svg { width: 56px; height: 67px; display: block; }
.spec-card__badge {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--forest);
  color: var(--bone);
  font-family: var(--sans);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 2px 5px;
  border-radius: 3px;
}
.spec-card__name {
  font-family: var(--sans);
  font-size: 0.75rem;
  line-height: 1.3;
  color: var(--slate);
  text-align: center;
  word-break: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
a.spec-card:hover .spec-card__name { color: var(--ink); }

/* Action bar */
.product-form .form-actions {
  margin-top: var(--space-m);
  padding-top: var(--space-m);
  border-top: 1px solid var(--linen);
}

/* ── Archive collection picker (product form modal) ─────────────────────────── */
.archive-modal__dialog { max-width: 520px; }

.archive-pick {
  list-style: none;
  margin: 0;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  overflow: hidden;
}
.archive-pick__item { border-bottom: 1px solid var(--color-border); }
.archive-pick__item:last-child { border-bottom: none; }

.archive-pick__label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  transition: background 0.15s var(--ease-out);
}
.archive-pick__label:hover { background: var(--bone); }

.archive-pick__check {
  width: 1.05rem;
  height: 1.05rem;
  accent-color: var(--forest);
  flex-shrink: 0;
}

.archive-pick__thumb {
  width: 40px;
  height: 50px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bone);
}
.archive-pick__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.archive-pick__thumb-empty {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, color-mix(in srgb, var(--forest) 14%, var(--bone)), var(--bone));
}

.archive-pick__meta { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.archive-pick__name {
  font-size: 0.9rem;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.archive-pick__code { font-size: 0.75rem; color: var(--slate); }

.archive-pick__flag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  border: 1px solid var(--color-border);
  border-radius: 99px;
  padding: 0.1rem 0.5rem;
  flex-shrink: 0;
}

/* Member/project links in the "Saved by members" table — no underline, forest hover */
.saved-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease-out);
}
.saved-link:hover { color: var(--accent); text-decoration: none; }

/* ============================================================
   GENERATE DETAILS MODAL
   Research progress → review/approve AI description, fields and
   scraped supplier images before they populate the product form.
   ============================================================ */
.gen-modal__dialog { max-width: 640px; }

/* Progress checklist */
.gen-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-s); }
.gen-step {
  display: flex; align-items: center; gap: var(--space-s);
  font-family: var(--font-sans); font-size: 0.9rem; color: var(--whisper);
}
.gen-step__dot {
  width: 16px; height: 16px; border-radius: 50%; flex: none; position: relative;
  border: 2px solid var(--color-border);
}
.gen-step[data-state="active"] { color: var(--ink); }
.gen-step[data-state="active"] .gen-step__dot {
  border-color: var(--forest); border-top-color: transparent;
  animation: gen-spin 0.7s linear infinite;
}
.gen-step[data-state="done"] { color: var(--ink); }
.gen-step[data-state="done"] .gen-step__dot { border-color: var(--forest); background: var(--forest); }
.gen-step[data-state="done"] .gen-step__dot::after {
  content: ""; position: absolute; left: 4px; top: 1px;
  width: 4px; height: 8px; border: solid var(--pure-white); border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
@keyframes gen-spin { to { transform: rotate(360deg); } }

/* Error banner */
.gen-error {
  font-family: var(--font-sans); font-size: 0.9rem; color: var(--color-danger);
  background: var(--bone); border-radius: var(--radius); padding: var(--space-s);
}

/* Review blocks */
.gen-block + .gen-block { margin-top: var(--space-s); }
.gen-block__head { display: flex; align-items: center; gap: var(--space-xs); cursor: pointer; margin-bottom: var(--space-xs); }
.gen-block__title {
  font-family: var(--font-sans); font-weight: 600; font-size: 0.85rem;
  letter-spacing: 0.02em; color: var(--ink); margin: 0 0 var(--space-xs);
}
.gen-block__head .gen-block__title { margin: 0; }

.gen-check { accent-color: var(--forest); width: 16px; height: 16px; flex: none; }

.gen-desc-text {
  width: 100%; font-family: var(--font-sans); font-size: 0.95rem; line-height: 1.5; color: var(--ink);
  border: 1px solid var(--color-border); border-radius: var(--radius); padding: 0.6rem 0.7rem; resize: vertical;
}
.gen-desc-text:focus { outline: none; border-color: var(--forest); }

/* Researched field rows */
.gen-fields { list-style: none; margin: 0; padding: 0; }
.gen-field { border-bottom: 1px solid var(--color-border); }
.gen-field:last-child { border-bottom: none; }
.gen-field__label { display: flex; align-items: baseline; gap: var(--space-xs); padding: 0.55rem 0; cursor: pointer; }
.gen-field__name {
  font-family: var(--font-sans); font-size: 0.85rem; font-weight: 600; color: var(--ink);
  flex: none; min-width: 8.5rem;
}
.gen-field__value { font-family: var(--font-sans); font-size: 0.85rem; color: var(--slate); word-break: break-word; flex: 1; }

/* Scraped image picker */
.gen-images {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: var(--space-xs); margin-top: var(--space-xs);
}
.gen-image {
  position: relative; aspect-ratio: 4 / 5; overflow: hidden; cursor: pointer;
  border-radius: var(--radius); background: var(--bone); border: 1px solid var(--color-border);
}
.gen-image img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.5; transition: opacity 0.2s var(--ease-out); }
.gen-image__check { position: absolute; opacity: 0; pointer-events: none; }
.gen-image__check:checked ~ img { opacity: 1; }
.gen-image__tick {
  position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 0.75rem;
  background: var(--pure-white); color: var(--forest); border: 1px solid var(--color-border);
  opacity: 0; transition: opacity 0.2s var(--ease-out);
}
.gen-image__check:checked ~ .gen-image__tick { opacity: 1; background: var(--forest); color: var(--pure-white); border-color: var(--forest); }
.gen-image:has(.gen-image__check:checked) { border-color: var(--forest); box-shadow: 0 0 0 1px var(--forest); }

/* Conflict flag — researched value differs from what the form already holds */
.gen-field--conflict { border-left: 2px solid var(--color-danger); padding-left: var(--space-xs); }
.gen-field__flag {
  display: block; font-family: var(--font-sans); font-size: 0.7rem; font-weight: 600;
  color: var(--color-danger); letter-spacing: 0.02em; padding: 0 0 0.5rem 0;
}

/* Editable technical-detail rows — keep/skip checkbox + label + value */
.gen-specs { list-style: none; margin: 0; padding: 0; }
.gen-spec {
  display: flex; align-items: center; gap: var(--space-xs);
  padding: 0.4rem 0; border-bottom: 1px solid var(--color-border);
}
.gen-spec:last-child { border-bottom: none; }
.gen-spec__label, .gen-spec__value {
  font-family: var(--font-sans); font-size: 0.85rem; color: var(--ink);
  border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 0.4rem 0.5rem; min-width: 0;
}
.gen-spec__label { flex: 0 0 9rem; }
.gen-spec__value { flex: 1; }
.gen-spec__label:focus, .gen-spec__value:focus { outline: none; border-color: var(--forest); }

/* Sortable image grid — drag to reorder; the first thumb is the hero */
.image-grid--sortable .image-thumb-wrap { cursor: grab; }
.image-grid--sortable .image-thumb-wrap.is-dragging { opacity: 0.4; cursor: grabbing; }
.image-grid--sortable .image-thumb-wrap:first-child .image-thumb { box-shadow: 0 0 0 2px var(--forest); }

@media (prefers-reduced-motion: reduce) {
  .gen-step[data-state="active"] .gen-step__dot { animation: none; }
  .gen-image img, .gen-image__tick { transition: none; }
  .spec-card__doc { transition: none; }
  a.spec-card:hover .spec-card__doc { transform: none; }
}

/* ── Surfaces page — inline filter bar ──────────────────────────────────── */

.surfaces-result-count {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--whisper, #a39e95);
  margin: 0 0 1.5rem;
}

.surfaces-result-in { margin-left: 0.4em; }
.surfaces-result-in strong { color: var(--forest, #273125); font-weight: 500; }

/* Inline filter bar — sits below the page header */
.inline-filter-bar {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* Category pill group — scrolls horizontally if pills overflow */
.inline-filter-bar__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  flex: 1;
  overflow: visible;
}

/* Override the old sidebar cat-btn rules inside the inline bar */
.inline-filter-bar__cats .cat-btn {
  width: auto;
  flex-shrink: 0;
  text-align: center;
  justify-content: center;
}

/* cat-item — horizontal: parent pill then subcats slide in beside it */
.cat-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
}

/* Category pill */
.cat-pill {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.38rem 0.85rem;
  border: 1px solid rgba(39, 49, 37, 0.2);
  border-radius: 4px;
  background: transparent;
  color: var(--slate, #4a4540);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.cat-pill:hover {
  border-color: var(--forest, #273125);
  color: var(--forest, #273125);
}

.cat-pill--active,
.cat-pill.cat-btn--active {
  background: var(--forest, #273125);
  border-color: var(--forest, #273125);
  color: var(--bone, #f4f1ec);
}

.cat-pill--active:hover,
.cat-pill.cat-btn--active:hover {
  background: var(--forest, #273125);
  color: var(--bone, #f4f1ec);
}

/* Subcategory pill row — slides in horizontally beside the parent pill */
.subpill-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  overflow: hidden;
  max-width: 0;
  opacity: 0;
  margin-left: 0;
  transition:
    max-width 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    opacity   0.22s ease,
    margin-left 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.subpill-row.subcat-list--open {
  max-width: 2000px;
  opacity: 1;
  margin-left: 0.4rem;
}

@media (prefers-reduced-motion: reduce) {
  .subpill-row { transition: none; }
}

.subcat-pill {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.7rem;
  border: 1px solid rgba(39, 49, 37, 0.15);
  border-radius: 4px;
  background: transparent;
  color: var(--whisper, #a39e95);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.subcat-pill:hover { color: var(--forest, #273125); border-color: var(--forest, #273125); }

.subcat-pill--active,
.subcat-pill.subcat-btn--active {
  color: var(--forest, #273125);
  border-color: var(--forest, #273125);
  font-weight: 500;
}

/* Divider between cats and price */
.inline-filter-bar__divider {
  width: 1px;
  height: 28px;
  background: rgba(39, 49, 37, 0.15);
  flex-shrink: 0;
  align-self: center;
}

/* Price select — underlined, no box */
.inline-price-select {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--slate, #4a4540);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--whisper, #a39e95);
  padding: 0.38rem 1.4rem 0.38rem 0;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23a39e95'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
  align-self: center;
  transition: border-color 0.2s;
}

.inline-price-select:focus { border-bottom-color: var(--forest, #273125); }

/* Clear button */
.inline-filter-bar__clear {
  font-family: var(--font-sans, sans-serif);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--mint, #5e8c6e);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.38rem 0;
  text-decoration: underline;
  align-self: center;
  white-space: nowrap;
  display: none;
}

.inline-filter-bar__clear:hover { color: var(--forest, #273125); }

/* Mobile — stack filter bar vertically */
@media (max-width: 640px) {
  .inline-filter-bar { flex-direction: column; }
  .inline-filter-bar__divider { width: 100%; height: 1px; }
}
