/* ==========================================================================
   Nuggits — design.css
   Shared design tokens + chrome + card / reaction components.
   Hand-written, mobile-first. Lifts into wwwroot/css verbatim.
   ========================================================================== */

/* ---- Font: Nunito (friendly rounded sans) with system fallback ---------- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,400;0,600;0,700;0,800;0,900&display=swap');

/* ==========================================================================
   1. TOKENS
   ========================================================================== */
:root {
  /* --- Nuggit gold / amber accent ramp ---
     Spelling note: this app always spells it "nuggit" (with an i), never "nugget" — including
     these custom-property identifiers. Keep new palette/accent tokens on the --nuggit-* prefix. */
  --nuggit-50:  #fdf6e3;
  --nuggit-100: #fbecc2;
  --nuggit-200: #f7d987;
  --nuggit-300: #f2c34d;
  --nuggit-400: #eaa817;   /* primary accent */
  --nuggit-500: #d18f0a;
  --nuggit-600: #a86e08;
  --nuggit-700: #7c5108;

  /* --- Warm neutral base --- */
  --bg:          #fbf8f3;  /* app background */
  --surface:     #ffffff;  /* cards, bars */
  --surface-2:   #f4efe6;  /* insets, chips */
  --border:      #e7ded0;
  --border-soft: #f0e9dc;

  /* --- Warm ink --- */
  --ink:         #2c261c;
  --ink-soft:    #6b6152;
  --ink-faint:   #9a8f7d;

  /* --- Feedback --- */
  --success:     #3f9d5a;
  --success-bg:  #e6f4ea;
  --danger:      #cf5a3c;
  --danger-bg:   #fbeae4;

  /* --- Per-media-type accent hues (badges + poster tints) --- */
  --movies:       #6c5ce7;  --movies-bg:      #ece9fc;
  --tv:           #1f9e94;  --tv-bg:          #e0f3f1;
  --books:        #c25a2b;  --books-bg:       #f8e9df;
  --boardgames:   #4a8f3c;  --boardgames-bg:  #e7f2e2;

  /* --- Radii (generous, rounded) --- */
  --r-sm:  8px;
  --r-md:  14px;
  --r-lg:  20px;
  --r-xl:  28px;
  --r-pill: 999px;

  /* --- Spacing scale --- */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;

  /* --- Type scale --- */
  --fs-xs:  12px;
  --fs-sm:  14px;
  --fs-md:  16px;
  --fs-lg:  19px;
  --fs-xl:  24px;
  --fs-2xl: 30px;
  --fs-3xl: 38px;

  /* --- Elevation --- */
  --shadow-sm: 0 1px 2px rgba(44, 38, 28, .06);
  --shadow-md: 0 4px 14px rgba(44, 38, 28, .09);
  --shadow-lg: 0 12px 34px rgba(44, 38, 28, .16);

  /* --- Layout --- */
  --nav-h: 64px;
  --tabbar-h: 68px;
  --maxw: 1120px;

  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto,
          'Helvetica Neue', Arial, sans-serif;
}

/* ==========================================================================
   2. RESET / BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: var(--fs-lg); font-weight: 800; }

a { color: var(--nuggit-600); text-decoration: none; }
a:hover { color: var(--nuggit-700); text-decoration: underline; }

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

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ==========================================================================
   3. APP LAYOUT
   ========================================================================== */
.app {
  min-height: 100vh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}

.page {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: var(--sp-4) var(--sp-4) var(--sp-7);
}

.page__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.page__title { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.02em; }
.page__sub { color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 600; }

/* Site-wide footer inside the scrolling page content. .app already reserves bottom padding for
   the fixed mobile tab bar, so this clears it without extra safe-area handling. */
.app-footer {
  margin-top: var(--sp-7);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--ink-soft);
  font-size: var(--fs-xs);
}
.app-footer a { color: var(--ink-soft); text-decoration: none; font-weight: 600; }
.app-footer a:hover { text-decoration: underline; }
.app-footer__sep { margin: 0 var(--sp-2); }

/* Desktop-only / mobile-only helpers */
.only-desktop { display: none; }
@media (min-width: 768px) {
  .only-desktop { display: revert; }
  .only-mobile { display: none !important; }
}

/* ==========================================================================
   4. TOP NAV (desktop ≥768px)
   ========================================================================== */
.topnav { display: none; }

@media (min-width: 768px) {
  .topnav {
    display: block;
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--border);
  }
  .topnav__inner {
    max-width: var(--maxw);
    margin: 0 auto;
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: var(--sp-5);
    padding: 0 var(--sp-4);
  }
  .topnav__links {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    margin-left: var(--sp-3);
  }
  .topnav__link {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    padding: 10px 14px;
    border-radius: var(--r-pill);
    font-weight: 700;
    font-size: var(--fs-sm);
    color: var(--ink-soft);
  }
  .topnav__link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
  .topnav__link .nav-ico { font-size: 18px; }
  .topnav__link[aria-current="page"] {
    background: var(--nuggit-100);
    color: var(--nuggit-700);
  }
  .topnav__spacer { flex: 1; }
  .topnav__right { display: flex; align-items: center; gap: var(--sp-3); }
}

/* Brand */
.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-weight: 900;
  font-size: var(--fs-lg);
  letter-spacing: -.02em;
  color: var(--ink);
}
.brand:hover { text-decoration: none; color: var(--ink); }
.brand__mark {
  position: relative;
  width: 36px; height: 34px;
  flex: none;
  clip-path: polygon(22% 14%, 40% 8%, 62% 9%, 82% 16%, 92% 33%, 91% 55%, 85% 76%, 67% 90%, 43% 92%, 23% 85%, 10% 67%, 7% 40%);
  background:
    radial-gradient(38% 28% at 33% 26%, rgba(255,255,255,.95), rgba(255,255,255,0) 60%),
    radial-gradient(26% 20% at 60% 42%, rgba(255,255,255,.6), rgba(255,255,255,0) 62%),
    radial-gradient(120% 75% at 50% 118%, #4a2f06 0 28%, rgba(74,47,6,0) 60%),
    linear-gradient(#fbecc2 0%, #f2c34d 34%, #d18f0a 60%, #9a6a0c 80%, #6e4a08 100%);
  filter: drop-shadow(0 2px 3px rgba(110, 74, 8, .4));
}
.brand__mark::after {
  content: "";
  position: absolute;
  top: 15%; left: 28%;
  width: 26%; height: 28%;
  background:
    radial-gradient(closest-side, rgba(255,255,255,.9), rgba(255,255,255,0) 70%),
    linear-gradient(rgba(255,255,255,.98), rgba(255,255,255,.98)) center / 100% 7% no-repeat,
    linear-gradient(rgba(255,255,255,.98), rgba(255,255,255,.98)) center / 7% 100% no-repeat;
}

/* Nav badge (pending recs count) */
.nav-badge {
  min-width: 20px; height: 20px;
  padding: 0 6px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
}

/* Avatar */
.avatar {
  width: 38px; height: 38px;
  border-radius: var(--r-pill);
  background: linear-gradient(140deg, var(--nuggit-200), var(--nuggit-400));
  display: grid; place-items: center;
  font-weight: 800;
  color: var(--nuggit-700);
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
  flex: none;
}
.avatar--sm { width: 30px; height: 30px; font-size: 13px; }
.avatar--lg { width: 52px; height: 52px; font-size: 20px; }
/* An image avatar fills the circle instead of showing the gradient + initials. */
img.avatar { object-fit: cover; padding: 0; }

/* ==========================================================================
   5. BOTTOM TAB BAR (mobile <768px)
   ========================================================================== */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 50;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 22px rgba(44, 38, 28, .07);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
}
@media (min-width: 768px) { .tabbar { display: none; } }

.tab {
  position: relative;
  height: 100%;
  min-height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-faint);
}
.tab .nav-ico { font-size: 22px; line-height: 1; }
.tab[aria-current="page"] { color: var(--nuggit-600); }
.tab[aria-current="page"] .nav-ico { transform: translateY(-1px); }

/* per-tab badge */
.tab__badge {
  position: absolute;
  top: 8px;
  left: calc(50% + 6px);
  min-width: 18px; height: 18px;
  padding: 0 5px;
  display: inline-grid; place-items: center;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  border: 2px solid var(--surface);
}

/* Center floating capture (mobile) */
.tab--capture { overflow: visible; }
.capture-fab {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  width: 58px; height: 58px;
  border-radius: var(--r-pill);
  background: linear-gradient(140deg, var(--nuggit-300), var(--nuggit-500));
  color: #fff;
  display: grid; place-items: center;
  font-size: 30px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(210, 143, 10, .45);
  border: 4px solid var(--surface);
}
.capture-fab:active { transform: translateX(-50%) scale(.94); }
.tab--capture .tab__label { margin-top: 30px; }

/* ==========================================================================
   6. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: var(--fs-sm);
  line-height: 1;
  border: 1.5px solid transparent;
  transition: transform .06s ease, background .15s ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn--primary { background: var(--nuggit-400); color: #3a2a05; box-shadow: var(--shadow-sm); }
.btn--primary:hover { background: var(--nuggit-300); text-decoration: none; }

.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-2); text-decoration: none; }

.btn--soft { background: var(--nuggit-100); color: var(--nuggit-700); }
.btn--soft:hover { background: var(--nuggit-200); text-decoration: none; }

.btn--success { background: var(--success); color: #fff; }
.btn--success:hover { background: #368a4f; text-decoration: none; }

.btn--quiet { background: transparent; color: var(--ink-soft); min-height: 40px; padding: 8px 12px; }
.btn--quiet:hover { background: var(--surface-2); text-decoration: none; }

.btn--sm { min-height: 38px; padding: 8px 14px; font-size: var(--fs-xs); }
.btn--block { width: 100%; }

/* icon-only round button */
.iconbtn {
  width: 44px; height: 44px;
  border-radius: var(--r-pill);
  display: grid; place-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-size: 18px;
}
.iconbtn:hover { background: var(--surface-2); }

/* ==========================================================================
   7. FILTER CHIPS + STATUS TABS
   ========================================================================== */

/* Status tabs (Want · In Progress · Done) */
.statustabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  width: 100%;
}
@media (min-width: 640px) { .statustabs { width: auto; } }

.statustab {
  flex: 1;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.statustab[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.statustab .count { color: var(--ink-faint); font-weight: 700; }
.statustab[aria-current="page"] .count { color: var(--nuggit-600); }

/* Media-type filter chips — stack-scroll on mobile, wrap on desktop */
.chips {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  padding: 2px;
  margin: 0 -2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 640px) { .chips { flex-wrap: wrap; overflow: visible; } }

.chip {
  flex: none;
  min-height: 40px;
  padding: 8px 15px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1.5px solid var(--border);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] {
  background: var(--nuggit-100);
  border-color: var(--nuggit-300);
  color: var(--nuggit-700);
}
.chip__dot { width: 9px; height: 9px; border-radius: var(--r-pill); flex: none; }

/* ==========================================================================
   8. MEDIA-TYPE BADGE + POSTER PLACEHOLDERS
   ========================================================================== */
.mtype {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 800;
  letter-spacing: .01em;
}
.mtype--movies      { background: var(--movies-bg);      color: var(--movies); }
.mtype--tv          { background: var(--tv-bg);          color: var(--tv); }
.mtype--books       { background: var(--books-bg);       color: var(--books); }
.mtype--boardgames  { background: var(--boardgames-bg);  color: var(--boardgames); }

/* Poster — 2:3 aspect. Striped placeholder background per media type.
   (Placeholder background is the only permitted inline style; here we set
   per-type default tints so most posters render without inline styles.) */
.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,.10) 0 10px,
      rgba(0,0,0,.03) 10px 20px),
    var(--surface-2);
  display: flex;
  align-items: flex-end;
  color: #fff;
}
.poster--movies     { background: repeating-linear-gradient(135deg, rgba(255,255,255,.10) 0 10px, rgba(0,0,0,.05) 10px 20px), linear-gradient(160deg, #8577f0, #5646c9); }
.poster--tv         { background: repeating-linear-gradient(135deg, rgba(255,255,255,.10) 0 10px, rgba(0,0,0,.05) 10px 20px), linear-gradient(160deg, #3bb6ab, #158178); }
.poster--books      { background: repeating-linear-gradient(135deg, rgba(255,255,255,.10) 0 10px, rgba(0,0,0,.05) 10px 20px), linear-gradient(160deg, #d97a4b, #a8481f); }
.poster--boardgames { background: repeating-linear-gradient(135deg, rgba(255,255,255,.10) 0 10px, rgba(0,0,0,.05) 10px 20px), linear-gradient(160deg, #63a854, #3c7a30); }

.poster > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
}
.poster__badge, .poster__cap, .poster__glyph { z-index: 2; }

.poster__glyph {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  font-size: 34px;
  opacity: .85;
}
.poster__badge { position: absolute; top: 8px; left: 8px; }
.poster__cap {
  width: 100%;
  padding: 22px 10px 9px;
  font-size: var(--fs-xs);
  font-weight: 800;
  line-height: 1.2;
  background: linear-gradient(to top, rgba(0,0,0,.42), transparent);
  text-shadow: 0 1px 3px rgba(0,0,0,.4);
}

/* ==========================================================================
   9. CARDS + CARD GRID
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: 1fr;      /* one column on mobile */
  gap: var(--sp-4);
}
@media (min-width: 480px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .grid { grid-template-columns: repeat(3, 1fr); gap: var(--sp-5); } }
@media (min-width: 1000px){ .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}
.card:hover { box-shadow: var(--shadow-md); }

/* Mobile: card is a horizontal row (poster left, body right) for scan-ability;
   desktop grid switches to vertical cover-forward cards. */
.card__poster { width: 92px; flex: none; }
.card__layout { display: flex; gap: var(--sp-3); }
.card__body { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; flex: 1; }

@media (min-width: 480px) {
  .card__layout { flex-direction: column; }
  .card__poster { width: 100%; }
}

.card__title {
  font-size: var(--fs-md);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
}
.card__title a { color: var(--ink); }
.card__title a:hover { color: var(--nuggit-700); }
.card__meta { font-size: var(--fs-xs); color: var(--ink-soft); font-weight: 600; }

/* status pill on a card */
.statuspill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-weight: 800;
  align-self: flex-start;
}
.statuspill--want       { background: var(--nuggit-100); color: var(--nuggit-700); }
.statuspill--progress   { background: var(--tv-bg);      color: var(--tv); }
.statuspill--done       { background: var(--success-bg); color: var(--success); }

/* status selector (segmented, on detail/cards) */
.statusseg {
  display: inline-flex;
  background: var(--surface-2);
  border-radius: var(--r-pill);
  padding: 4px;
  gap: 4px;
}
.statusseg button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--r-pill);
  font-weight: 800;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
}
.statusseg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ==========================================================================
   10. REACTION ROW  (🤩 Love · 🙂 Liked · 😐 Meh · 🤮 Blech)
   Multiple may be selected. Selected state conveyed by ring + fill, not
   color alone.
   ========================================================================== */
.reactions {
  display: flex;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.reaction {
  min-width: 44px;
  min-height: 44px;
  padding: 0 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 2px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 19px;
  line-height: 1;
  transition: transform .08s ease, background .15s ease;
}
.reaction .reaction__name {
  font-size: var(--fs-xs);
  font-weight: 800;
  color: var(--ink-soft);
}
.reaction:hover { background: var(--nuggit-50); transform: translateY(-1px); }
.reaction:active { transform: scale(.94); }

/* Selected: filled + ring + inset check so state ≠ color only */
.reaction[aria-pressed="true"] {
  background: var(--nuggit-100);
  border-color: var(--nuggit-400);
  box-shadow: inset 0 0 0 1px var(--nuggit-300);
}
.reaction[aria-pressed="true"] .reaction__name { color: var(--nuggit-700); }
.reaction[aria-pressed="true"]::after {
  content: "✓";
  font-size: 11px;
  font-weight: 900;
  color: var(--nuggit-600);
  margin-left: 2px;
}

/* compact reaction row (cards) hides labels to save space */
.reactions--compact .reaction { min-width: 44px; padding: 0; }
.reactions--compact .reaction__name { display: none; }

/* summary of others' reactions */
.reaction-summary {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  font-weight: 600;
}

/* ==========================================================================
   11. SEARCH
   ========================================================================== */
.searchbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 8px 8px 16px;
  box-shadow: var(--shadow-sm);
}
.searchbar:focus-within { border-color: var(--nuggit-400); }
.searchbar input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font: inherit;
  font-weight: 600;
  min-height: 36px;
  color: var(--ink);
}
.searchbar input::placeholder { color: var(--ink-faint); }

.divider {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin: var(--sp-5) 0 var(--sp-4);
  color: var(--ink-soft);
  font-size: var(--fs-sm);
  font-weight: 800;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* search result row */
.result {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.result__poster { width: 56px; flex: none; }
.result__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.result__actions { display: flex; gap: var(--sp-2); flex: none; flex-wrap: wrap; justify-content: flex-end; }
.result__provider { font-size: var(--fs-xs); color: var(--ink-faint); font-weight: 600; }

.stack { display: flex; flex-direction: column; gap: var(--sp-3); }

/* ==========================================================================
   12. EMPTY STATE
   ========================================================================== */
.empty {
  text-align: center;
  max-width: 460px;
  margin: var(--sp-7) auto;
  padding: var(--sp-5);
}
.empty__art {
  position: relative;
  width: 138px; height: 130px;
  margin: 0 auto var(--sp-5);
  clip-path: polygon(22% 14%, 40% 8%, 62% 9%, 82% 16%, 92% 33%, 91% 55%, 85% 76%, 67% 90%, 43% 92%, 23% 85%, 10% 67%, 7% 40%);
  background:
    radial-gradient(38% 28% at 33% 26%, rgba(255,255,255,.95), rgba(255,255,255,0) 60%),
    radial-gradient(26% 20% at 60% 42%, rgba(255,255,255,.6), rgba(255,255,255,0) 62%),
    radial-gradient(120% 75% at 50% 118%, #4a2f06 0 28%, rgba(74,47,6,0) 60%),
    linear-gradient(#fbecc2 0%, #f2c34d 34%, #d18f0a 60%, #9a6a0c 80%, #6e4a08 100%);
  filter: drop-shadow(0 8px 16px rgba(110, 74, 8, .35));
  transform: rotate(-4deg);
}
.empty__art::after {
  content: "";
  position: absolute;
  top: 16%; left: 30%;
  width: 26%; height: 28%;
  background:
    radial-gradient(closest-side, rgba(255,255,255,.9), rgba(255,255,255,0) 70%),
    linear-gradient(rgba(255,255,255,.98), rgba(255,255,255,.98)) center / 100% 7% no-repeat,
    linear-gradient(rgba(255,255,255,.98), rgba(255,255,255,.98)) center / 7% 100% no-repeat;
}
.empty__title { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.02em; margin-bottom: var(--sp-3); }
.empty__body { color: var(--ink-soft); font-size: var(--fs-md); font-weight: 600; margin-bottom: var(--sp-5); }
.empty__hints {
  display: flex; gap: var(--sp-2); justify-content: center; flex-wrap: wrap;
  margin-top: var(--sp-5);
}
.empty__hint {
  padding: 8px 13px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-soft);
}

/* ==========================================================================
   13. SLIDE-OVER (Capture panel)
   ========================================================================== */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(44, 38, 28, .38);
  backdrop-filter: blur(1px);
}
.slideover {
  position: fixed;
  z-index: 61;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  /* mobile: bottom sheet */
  left: 0; right: 0; bottom: 0;
  max-height: 90vh;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
}
@media (min-width: 768px) {
  .slideover {
    /* desktop: right rail */
    top: 0; right: 0; bottom: 0; left: auto;
    width: 440px;
    max-height: none;
    border-radius: var(--r-xl) 0 0 var(--r-xl);
  }
}
.slideover__head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.slideover__title { font-weight: 900; font-size: var(--fs-lg); flex: 1; }
.slideover__grab {
  position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
  width: 40px; height: 5px; border-radius: var(--r-pill); background: var(--border);
}
@media (min-width: 768px) { .slideover__grab { display: none; } }
.slideover__body { flex: 1; overflow-y: auto; padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.slideover__foot { padding: var(--sp-3) var(--sp-4) calc(var(--sp-4) + env(safe-area-inset-bottom,0px)); border-top: 1px solid var(--border); }

/* chat bubbles */
.msg { max-width: 84%; padding: 11px 15px; border-radius: var(--r-lg); font-size: var(--fs-sm); font-weight: 600; line-height: 1.4; }
.msg--bot { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-bottom-left-radius: 6px; }
.msg--me  { align-self: flex-end; background: var(--nuggit-400); color: #3a2a05; border-bottom-right-radius: 6px; }
.msg--sys { align-self: center; font-size: var(--fs-xs); color: var(--ink-faint); font-weight: 700; background: none; }

/* backstage strip (admin + ?debug=true only) — Roger's working notes */
.capture-backstage {
  align-self: stretch;
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--ink-faint);
}
.capture-backstage summary { cursor: pointer; font-weight: 700; }
.capture-backstage pre { margin: var(--sp-2) 0 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; }

/* candidate mini-card inside capture */
.candidate {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2);
  box-shadow: var(--shadow-sm);
}
.candidate__poster { width: 44px; flex: none; }
.candidate__body { flex: 1; min-width: 0; }

/* disambiguation options */
.disambig { display: flex; flex-direction: column; gap: var(--sp-2); }
.disambig__opt .poster { border-radius: 5px; }
.disambig__opt {
  text-align: left;
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-md);
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-weight: 700;
  font-size: var(--fs-sm);
}
.disambig__opt:hover { border-color: var(--nuggit-400); background: var(--nuggit-50); }

/* composer input */
.composer {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-2);
  background: var(--surface-2);
  border-radius: var(--r-xl);
  padding: 6px 6px 6px 16px;
}
.composer textarea {
  flex: 1;
  border: none;
  background: none;
  outline: none;
  resize: none;
  font: inherit;
  font-weight: 600;
  min-height: 40px;
  max-height: 120px;
  padding: 9px 0;
  color: var(--ink);
}
.composer__send {
  width: 44px; height: 44px; flex: none;
  border-radius: var(--r-pill);
  background: var(--nuggit-400);
  color: #3a2a05;
  display: grid; place-items: center;
  font-size: 18px;
}

/* ==========================================================================
   14. DETAIL PAGE
   ========================================================================== */
.detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--sp-5);
}
@media (min-width: 768px) {
  .detail { grid-template-columns: 260px 1fr; align-items: start; }
}
.detail__poster { max-width: 220px; }
@media (min-width: 768px) { .detail__poster { max-width: none; } }
.detail__head { display: flex; flex-direction: column; gap: var(--sp-3); }
.detail__titlerow { display: flex; align-items: flex-start; gap: var(--sp-3); flex-wrap: wrap; }
.detail__title { font-size: var(--fs-2xl); font-weight: 900; letter-spacing: -.02em; }

.section { margin-top: var(--sp-5); }
.section__label {
  font-size: var(--fs-xs);
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: var(--sp-3);
}

.metalist { display: flex; flex-direction: column; gap: 6px; }
.metalist__row { display: flex; gap: var(--sp-3); font-size: var(--fs-sm); }
.metalist__k { width: 100px; flex: none; color: var(--ink-faint); font-weight: 700; }
.metalist__v { font-weight: 600; }

.attribution {
  font-size: var(--fs-xs);
  color: var(--ink-faint);
  font-weight: 600;
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 10px 12px;
}

.notes {
  width: 100%;
  min-height: 92px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font: inherit;
  font-weight: 600;
  background: var(--surface);
  resize: vertical;
  color: var(--ink);
}
.notes:focus { outline: none; border-color: var(--nuggit-400); }

/* Recommend compose dialog (M10) */
.recommend-dialog { display: flex; flex-direction: column; gap: var(--sp-4); min-width: min(420px, 80vw); }
.recommend-dialog__nuggit { font-size: var(--fs-sm); color: var(--ink-soft); }
.recommend-dialog__nuggit strong { color: var(--ink); font-weight: 800; }
.recommend-dialog__or { text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--ink-soft); }
.recommend-dialog__hint { font-size: var(--fs-xs); color: var(--ink-soft); margin-top: 4px; }
.recommend-dialog__actions { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-2); }
.field { display: flex; flex-direction: column; gap: 6px; }
.input, .select {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font: inherit;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
}
.input:focus, .select:focus { outline: none; border-color: var(--nuggit-400); }

/* Settings (M10) */
.settings__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--r-lg); padding: var(--sp-4); margin-top: var(--sp-5);
}
.settings__label { font-weight: 800; }
.settings__hint { font-size: var(--fs-sm); color: var(--ink-soft); margin-top: 2px; }
.switch { display: inline-flex; align-items: center; gap: var(--sp-2); cursor: pointer; flex: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 44px; height: 26px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1.5px solid var(--border);
  position: relative; transition: background .15s ease, border-color .15s ease;
}
.switch__track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-sm);
  transition: transform .15s ease;
}
.switch input:checked + .switch__track { background: var(--nuggit-400); border-color: var(--nuggit-400); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--nuggit-400); outline-offset: 2px; }
.switch__label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-soft); }

/* "who recommended it" */
.recby {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--nuggit-50);
  border: 1px solid var(--nuggit-200);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
}
.recby__text { font-size: var(--fs-sm); font-weight: 600; }
.recby__text strong { font-weight: 800; }

/* ==========================================================================
   15. REC INBOX + FRIENDS  (list rows)
   ========================================================================== */
.subtabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-pill); }
.subtab {
  min-height: 40px; padding: 0 18px; border-radius: var(--r-pill);
  font-weight: 800; font-size: var(--fs-sm); color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
}
.subtab[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

.listrow {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.listrow__poster { width: 52px; flex: none; }
.listrow__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.listrow__actions { display: flex; gap: var(--sp-2); flex: none; }
@media (max-width: 479px) {
  .listrow { flex-wrap: wrap; }
  .listrow__actions { width: 100%; }
  .listrow__actions .btn { flex: 1; }
}

.note-quote {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink);
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 9px 12px;
  border-left: 3px solid var(--nuggit-300);
}
.sender { font-size: var(--fs-xs); color: var(--ink-soft); font-weight: 700; }

.status-tag {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--fs-xs); font-weight: 800;
  padding: 4px 10px; border-radius: var(--r-pill);
}
.status-tag--pending  { background: var(--surface-2); color: var(--ink-soft); }
.status-tag--accepted { background: var(--success-bg); color: var(--success); }
.status-tag--declined { background: var(--danger-bg);  color: var(--danger); }
.status-tag--completed { background: var(--nuggit-100); color: var(--nuggit-700); }

/* Friends */
.friend {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
}
.friend__body { flex: 1; min-width: 0; }
.friend__name { font-weight: 800; font-size: var(--fs-md); }
.friend__handle { font-size: var(--fs-xs); color: var(--ink-faint); font-weight: 600; }
.friend__actions { display: flex; gap: var(--sp-2); flex: none; }

.invite {
  background: linear-gradient(150deg, var(--nuggit-100), var(--nuggit-50));
  border: 1.5px dashed var(--nuggit-300);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  text-align: center;
}
.invite__title { font-weight: 900; font-size: var(--fs-lg); margin-bottom: var(--sp-2); }
.invite__body { color: var(--ink-soft); font-size: var(--fs-sm); font-weight: 600; margin-bottom: var(--sp-4); }

/* ==========================================================================
   16. UTILITIES
   ========================================================================== */
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.row { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.wrap-tools { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-5); }
@media (min-width: 640px) {
  .wrap-tools { flex-direction: row; align-items: center; justify-content: space-between; }
}
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.muted { color: var(--ink-soft); font-weight: 600; }
.grow { flex: 1; }
.count-badge { font-size: var(--fs-xs); font-weight: 800; color: var(--ink-faint); }

/* ==========================================================================
   17. APP ADDITIONS (Nuggits WebApp — beyond the shared design.css)
   Bespoke bits the static mockups didn't need: the account dropdown menu,
   an inline "couldn't reach a provider" notice, and a lightweight spinner.
   ========================================================================== */

/* Avatar account menu (top nav, desktop) */
.account { position: relative; }
.account-backdrop { position: fixed; inset: 0; z-index: 45; }
.account-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 46;
  min-width: 168px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  padding: var(--sp-1);
  display: flex;
  flex-direction: column;
}
.account-menu form { display: contents; }
.account-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  font-weight: 700;
  font-size: var(--fs-sm);
  color: var(--ink);
  background: none;
}
.account-menu__item:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }

/* Spinner (loading states) */
.spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--border);
  border-top-color: var(--nuggit-400);
  border-radius: var(--r-pill);
  animation: nuggits-spin 0.8s linear infinite;
}
.loading-block { display: flex; justify-content: center; padding: var(--sp-6); }
@keyframes nuggits-spin { to { transform: rotate(360deg); } }

/* Inline "couldn't reach a provider" notice on live search (partial failure is normal) */
.provider-notice {
  font-size: var(--fs-xs);
  font-weight: 700;
  color: var(--ink-soft);
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: 8px 12px;
  margin-bottom: var(--sp-3);
}

/* Inline light empty (a tab/filter with no matches on a non-empty queue) */
.empty-inline {
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
  padding: var(--sp-6) var(--sp-4);
}

/* Inline error alert (page-load failures, alongside the toast) */
.alert-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-weight: 700;
  font-size: var(--fs-sm);
  margin-bottom: var(--sp-4);
}

/* ==========================================================================
   Invites page (M8) — issue and manage invitations from the avatar menu.
   ========================================================================== */
.invites-page { display: flex; flex-direction: column; gap: var(--sp-4); }

.invites__quota { font-size: var(--fs-sm); color: var(--ink-soft); font-weight: 600; }
.invites__quota strong { color: var(--ink); font-weight: 800; }

.invites__create { display: flex; flex-direction: column; gap: var(--sp-2); }
.invites__hint { font-size: var(--fs-xs); color: var(--ink-soft); font-weight: 600; }

.invite-link {
  background: var(--nuggit-50);
  border: 1px solid var(--nuggit-200);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  display: flex; flex-direction: column; gap: var(--sp-2);
}
.invite-link__label { font-size: var(--fs-sm); font-weight: 700; color: var(--nuggit-700); }
.invite-link__row { display: flex; gap: var(--sp-2); align-items: center; }
.invite-link__input {
  flex: 1; min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  font: inherit; font-weight: 600;
  padding: 8px 14px; min-height: 38px;
  color: var(--ink);
}

.invites__list { display: flex; flex-direction: column; gap: var(--sp-2); }
.invite__email { font-weight: 800; font-size: var(--fs-md); color: var(--ink); word-break: break-word; }
.invite__meta { font-size: var(--fs-xs); color: var(--ink-soft); font-weight: 600; }

/* ==========================================================================
   Friends & member profile (M9) — connections hub and per-member profile.
   ========================================================================== */
.friends-page { display: flex; flex-direction: column; gap: var(--sp-4); }
.friend__name a { color: var(--ink); text-decoration: none; }
.friend__name a:hover { text-decoration: underline; }

.profile-page { display: flex; flex-direction: column; gap: var(--sp-5); }
.profile__head { display: flex; gap: var(--sp-4); align-items: center; }
.profile__ident { min-width: 0; }
.profile__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* ==========================================================================
   Sharing & activity feed (M11) — per-item share toggle, feed cards.
   ========================================================================== */

/* Per-item visibility toggle (card + detail). State = icon + label + ring, never colour alone. */
.card__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  flex-wrap: wrap;
}
.sharetoggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 2px solid transparent;
  font-weight: 800;
  font-size: var(--fs-xs);
  color: var(--ink-soft);
  transition: transform .08s ease, background .15s ease;
}
.sharetoggle:hover { background: var(--nuggit-50); transform: translateY(-1px); }
.sharetoggle:active { transform: scale(.97); }
.sharetoggle__icon { font-size: 15px; line-height: 1; }
.sharetoggle--on {
  background: var(--nuggit-100);
  border-color: var(--nuggit-400);
  color: var(--nuggit-700);
  box-shadow: inset 0 0 0 1px var(--nuggit-300);
}
.sharetoggle--compact { min-width: 44px; }

/* Feed / shared-queue card — a connection's shared entry (read-only). */
.feed-page { display: flex; flex-direction: column; gap: var(--sp-4); }
.feeditem {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: var(--sp-3);
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: var(--sp-3);
}
.feeditem:hover { box-shadow: var(--shadow-md); }
.feeditem__poster { width: 72px; flex: none; }
.feeditem__body { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; flex: 1; }
.feeditem__who { display: flex; align-items: center; gap: var(--sp-2); }
.feeditem__whotext { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); min-width: 0; }
.feeditem__whotext strong { font-weight: 800; color: var(--ink); }
.feeditem__title { font-size: var(--fs-md); font-weight: 800; line-height: 1.2; letter-spacing: -.01em; }
.feeditem__title a { color: var(--ink); }
.feeditem__title a:hover { color: var(--nuggit-700); }
.feeditem__foot { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.reaction-summary span { font-size: 17px; line-height: 1; }
