/* ==========================================================================
   Pinterest design system — deal discovery edition
   Tokens transcribed 1:1 from DESIGN.md (Pinterest-design-analysis, alpha).
   Pin Sans is proprietary: Inter (body) + Manrope (display) are the
   documented open-source substitutes. Icons: Remix Icon font, never emoji.
   ========================================================================== */

:root {
  /* Brand & accent */
  --primary: #e60023;
  --on-primary: #ffffff;
  --primary-pressed: #cc001f;
  /* Text */
  --ink: #000000;
  --ink-soft: #211922;
  --body: #33332e;
  --charcoal: #262622;
  --mute: #62625b;
  --ash: #91918c;
  --stone: #c8c8c1;
  /* Surfaces */
  --canvas: #ffffff;
  --surface-soft: #fbfbf9;
  --surface-card: #f6f6f3;
  --surface-elevated: #ffffff;
  --secondary-bg: #e5e5e0;
  --secondary-pressed: #c8c8c1;
  --surface-dark: #262622;
  --on-dark: #ffffff;
  --on-dark-mute: rgba(255, 255, 255, 0.7);
  /* Lines */
  --hairline: #dadad3;
  --hairline-soft: #e5e5e0;
  /* Semantic */
  --error: #9e0a0a;
  --error-deep: #cc001f;
  --success-deep: #103c25;
  --success-pale: #c7f0da;
  --focus-outer: #435ee5;
  --focus-inner: #ffffff;
  /* Shape */
  --rounded-md: 16px;
  --rounded-lg: 32px;
  --rounded-full: 9999px;
  /* Spacing */
  --sp-xxs: 4px;
  --sp-xs: 6px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-xxl: 32px;
  --sp-section: 64px;
  /* Type */
  --font-body: "Inter", -apple-system, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Manrope", "Inter", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--body);
  background: var(--canvas);
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

/* Signature double-ring focus signal (text-input-focused token) */
:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px var(--focus-outer);
}

/* ==========================================================================
   Typography scale (design.md, Pin Sans -> Inter/Manrope)
   ========================================================================== */
.display-xl {
  font-family: var(--font-display);
  font-size: 70px; font-weight: 600; line-height: 1.1; letter-spacing: -1.2px;
  color: var(--ink);
}
.display-lg {
  font-family: var(--font-display);
  font-size: 44px; font-weight: 700; line-height: 1.15; letter-spacing: -0.8px;
  color: var(--ink);
}
.heading-xl {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 700; line-height: 1.2; letter-spacing: -1.2px;
  color: var(--ink);
}
.heading-lg { font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--ink); }
.heading-md { font-size: 18px; font-weight: 600; line-height: 1.3; color: var(--ink); }
.body-strong { font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink); }
.body-sm { font-size: 14px; font-weight: 400; line-height: 1.4; }
.body-sm-strong { font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--ink); }
.caption-md { font-size: 12px; font-weight: 500; line-height: 1.5; }
.caption-sm { font-size: 12px; font-weight: 400; line-height: 1.4; }
.link-inline { color: var(--ink-soft); font-size: 16px; font-weight: 600; line-height: 1.4; text-decoration: none; }
.link-inline:hover { text-decoration: underline; }

/* ==========================================================================
   Buttons (button-primary / secondary / tertiary / icon-circular / disabled)
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 6px 14px;
  border: 0; border-radius: var(--rounded-md);
  background: var(--primary); color: var(--on-primary);
  font-size: 14px; font-weight: 700; line-height: 1;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--primary); filter: brightness(0.96); }
.btn:active { background: var(--primary-pressed); }
.btn[disabled] { background: var(--surface-card); color: var(--ash); cursor: not-allowed; }

.btn-secondary { background: var(--secondary-bg); color: var(--ink); }
.btn-secondary:hover { background: var(--secondary-bg); filter: brightness(0.96); }
.btn-secondary:active { background: var(--secondary-pressed); }

.btn-tertiary { background: transparent; color: var(--ink); }
.btn-tertiary:hover { background: var(--surface-card); }

.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--hairline); }
.btn-ghost:hover { background: var(--surface-card); }

.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: var(--rounded-full);
  background: var(--surface-card); color: var(--ink);
  font-size: 20px;
}
.btn-icon:hover { background: var(--secondary-bg); }

/* Small overlay pill on photography (pin-overlay-pill) */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: var(--rounded-full);
  background: var(--canvas); color: var(--ink);
  font-size: 12px; font-weight: 700; line-height: 1;
}
.pill-on-dark { background: rgba(0, 0, 0, 0.72); color: #fff; }
.pill-success { background: var(--success-pale); color: var(--success-deep); }

/* ==========================================================================
   Primary nav (primary-nav token): white, 64px, hairline rule on inner pages
   ========================================================================== */
.primary-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--canvas); color: var(--ink);
  border-bottom: 1px solid var(--hairline);
}
.primary-nav.is-home { border-bottom: 0; }
.nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  height: 64px; display: flex; align-items: center; gap: 12px;
}
.brandmark {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--primary); text-decoration: none; flex-shrink: 0;
  font-size: 20px; font-weight: 700; letter-spacing: -0.5px;
}
.brandmark i { font-size: 30px; line-height: 1; }
.nav-links { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.nav-links a {
  padding: 10px 14px; border-radius: var(--rounded-full);
  font-size: 16px; font-weight: 600; line-height: 1.4; color: var(--ink);
  text-decoration: none; white-space: nowrap;
}
.nav-links a:hover { background: var(--surface-card); }
.nav-links a.is-active { background: var(--ink); color: var(--on-dark); }

/* search-bar token: cream pill, 48px; focused -> white + ash border */
.searchbar { flex: 1; display: flex; justify-content: center; min-width: 0; }
.searchbar form {
  position: relative; width: 100%; max-width: 480px;
}
.searchbar input[type="search"] {
  width: 100%; height: 48px; padding: 11px 15px 11px 44px;
  border: 0; border-radius: var(--rounded-full);
  background: var(--surface-card); color: var(--ink);
  font-size: 16px; font-family: inherit;
}
.searchbar input[type="search"]::placeholder { color: var(--ash); }
.searchbar input[type="search"]:focus {
  outline: none; background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--ash);
}
.searchbar .search-ico {
  position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
  color: var(--mute); font-size: 19px; pointer-events: none;
}
.nav-cta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto; }
.nav-login { font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none; padding: 10px 12px; border-radius: var(--rounded-md); }
.nav-login:hover { background: var(--surface-card); }

.nav-toggle { display: none; }

/* Mobile search overlay */
.search-overlay {
  display: none; position: fixed; inset: 0; z-index: 80;
  background: var(--canvas); padding: 12px 16px;
}
.search-overlay.open { display: block; }
.search-overlay form { position: relative; }
.search-overlay .btn-icon { position: absolute; right: 4px; top: 4px; }

/* ==========================================================================
   Hero (surface-soft wash, display-xl 70px) + feature cards
   ========================================================================== */
.hero {
  background: var(--surface-soft);
  padding: 72px 24px 64px;
  text-align: center;
}
.hero-inner { max-width: 880px; margin: 0 auto; }
.hero .display-xl { margin-bottom: 16px; }
.hero .display-xl .accent { color: var(--primary); }
.hero p.lead { font-size: 18px; color: var(--charcoal); max-width: 620px; margin: 0 auto 28px; }
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-actions .btn { min-height: 48px; padding: 8px 22px; font-size: 15px; }

/* feature-card / feature-card-soft: alternating editorial rows */
.feature-row {
  max-width: 1280px; margin: 0 auto; padding: var(--sp-section) 24px 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center;
}
.feature-row.flip > .feature-copy { order: 2; }
.feature-card, .feature-card-soft {
  border-radius: var(--rounded-md); padding: 32px;
  background: var(--canvas);
}
.feature-card-soft { background: var(--surface-card); }
.feature-media img {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover;
  border-radius: var(--rounded-md); background: var(--surface-card);
}
.feature-copy .heading-xl { margin-bottom: 12px; }
.feature-copy p { color: var(--charcoal); margin-bottom: 24px; }

/* hero-cta-strip: dark band with red CTA */
.cta-strip {
  margin-top: var(--sp-section);
  background: var(--surface-dark); color: var(--on-dark);
  padding: 48px 32px; border-radius: 0;
}
.cta-strip-inner {
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.cta-strip .heading-xl { color: var(--on-dark); }
.cta-strip p { color: var(--on-dark-mute); margin-top: 8px; }

/* ==========================================================================
   Category tiles (category-tile token)
   ========================================================================== */
.section { max-width: 1280px; margin: 0 auto; padding: var(--sp-section) 24px 0; }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.section-head .link-inline { font-size: 14px; white-space: nowrap; }
.cat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}
.category-tile {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface-card); color: var(--ink);
  border-radius: var(--rounded-md); padding: 16px;
  text-decoration: none; font-size: 16px; font-weight: 600; line-height: 1.4;
}
.category-tile:hover { background: var(--secondary-bg); }
.category-tile .cat-ico {
  width: 56px; height: 56px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--rounded-md); background: var(--canvas);
  font-size: 26px; color: var(--ink);
}
.category-tile .cat-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--rounded-md); }
.category-tile small { display: block; font-size: 12px; font-weight: 400; color: var(--mute); }

/* ==========================================================================
   Masonry pin grid (the load-bearing visual element)
   Column-based, 8px gutters, natural aspect ratios preserved.
   ========================================================================== */
.masonry { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px 16px; }
@media (min-width: 768px) { .masonry { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .masonry { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1440px) { .masonry { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1920px) { .masonry { grid-template-columns: repeat(6, 1fr); } }

/* Editorial pin-card: clean image on top, quiet text below.
   Hierarchy: image -> discount -> title -> price -> meta. */
.pin { margin-bottom: 0; }
.pin-media { position: relative; display: block; border-radius: var(--rounded-md); overflow: hidden; background: var(--surface-card); }
.pin-media img { display: block; width: 100%; height: auto; }
/* Uniform card images: every card the same size, like a shop shelf */
.pin .pin-media img { aspect-ratio: 1 / 1; object-fit: cover; }
.pin-media::after {
  content: ""; position: absolute; inset: 0; border-radius: var(--rounded-md);
  background: rgba(0, 0, 0, 0); transition: background 0.15s ease; pointer-events: none;
}
.pin:hover .pin-media::after { background: rgba(0, 0, 0, 0.08); }
/* Only the discount pill floats on the image (top-left); sample badge top-right */
.pin-media .pill { position: absolute; }
.pin-media .pill.off { top: 8px; left: 8px; background: var(--primary); color: #fff; }
.pin-media .pill.sample { top: 8px; right: 8px; }
/* Text block below the image: title, price, quiet meta */
.pin-body { padding: 10px 2px 0; }
.pin-title {
  display: block; color: var(--ink); text-decoration: none;
  font-size: 14px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pin-title:hover { text-decoration: underline; }
.pin-price { margin-top: 4px; font-size: 15px; font-weight: 700; color: var(--ink); }
.pin-price s { margin-left: 6px; font-size: 13px; font-weight: 400; color: var(--mute); }
.pin-meta { margin-top: 3px; font-size: 12px; color: var(--mute); }

/* ==========================================================================
   Filter chips (filter-chip / filter-chip-active)
   ========================================================================== */
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 20px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border: 0; border-radius: var(--rounded-full);
  background: var(--surface-card); color: var(--ink);
  font-size: 14px; font-weight: 700; line-height: 1; text-decoration: none;
}
.filter-chip:hover { background: var(--secondary-bg); }
.filter-chip.is-active { background: var(--ink); color: var(--on-dark); }
.filter-chip i { font-size: 16px; }

/* ==========================================================================
   Deal detail (pin-detail composition)
   ========================================================================== */
.deal-detail {
  max-width: 1100px; margin: 0 auto; padding: 32px 24px 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start;
}
.pin-card-large {
  background: var(--surface-card); border-radius: var(--rounded-lg);
  overflow: hidden; position: relative;
}
.pin-card-large img { width: 100%; height: auto; }
/* Detail-page overlay pills (discount top-left, sample badge top-right) */
.pin-card-large .pin-pills { position: absolute; inset: 0; pointer-events: none; }
.pin-card-large .pin-pills .pill { position: absolute; }
.pin-card-large .pin-pills .pill.off { top: 12px; left: 12px; background: var(--primary); color: #fff; }
.pin-card-large .pin-pills .pill.sample { top: 12px; right: 12px; }
.deal-info .heading-lg { margin-bottom: 12px; }
.price-row { display: flex; align-items: baseline; gap: 12px; margin: 16px 0; flex-wrap: wrap; }
.price-now { font-size: 32px; font-weight: 700; color: var(--ink); letter-spacing: -0.5px; }
.price-was { font-size: 18px; color: var(--ash); text-decoration: line-through; }
.deal-info .btn { min-height: 48px; padding: 8px 28px; font-size: 15px; margin: 8px 0 20px; }
.deal-facts { list-style: none; border-top: 1px solid var(--hairline); }
.deal-facts li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--hairline-soft);
  font-size: 14px; color: var(--charcoal);
}
.deal-facts i { font-size: 18px; color: var(--mute); }
/* Deal fact sheet: plain-HTML fact table for shoppers and AI retrieval */
.deal-factsheet { margin-top: 20px; border-top: 1px solid var(--hairline); padding-top: 16px; }
.deal-factsheet h2 { font-size: 18px; font-weight: 600; margin-bottom: 4px; color: var(--ink); }
.facts-table { margin: 0; }
.facts-table > div {
  display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
  padding: 10px 0; border-bottom: 1px solid var(--hairline-soft); font-size: 14px;
}
.facts-table > div:last-child { border-bottom: 0; }
.facts-table dt { color: var(--mute); flex-shrink: 0; }
.facts-table dd { margin: 0; font-weight: 600; color: var(--ink); text-align: right; }
/* Expired deal banner + pill */
.expired-banner {
  max-width: 1100px; margin: 16px auto 0; padding: 14px 18px;
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface-card); border: 1px solid var(--hairline);
  border-radius: var(--rounded-md); font-size: 14px; color: var(--charcoal);
}
.expired-banner i { font-size: 20px; color: var(--primary); flex-shrink: 0; margin-top: 1px; }
.expired-banner strong { display: block; font-size: 15px; color: var(--ink); margin-bottom: 2px; }
.pin-card-large .pin-pills .pill-expired { top: 12px; left: 12px; background: var(--ink); color: #fff; }
.deal-desc { margin-top: 24px; }
.deal-desc h2 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--ink); }
.disclosure {
  margin-top: 24px; padding: 16px; border-radius: var(--rounded-md);
  background: var(--surface-card); color: var(--mute); font-size: 12px; line-height: 1.5;
}
.crumbs { max-width: 1100px; margin: 0 auto; padding: 20px 24px 0; font-size: 14px; color: var(--mute); }
.crumbs a { color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* ==========================================================================
   Pagination, empty states, misc
   ========================================================================== */
.pagination { display: flex; gap: 8px; justify-content: center; padding: 32px 0 8px; flex-wrap: wrap; }
.pagination a {
  min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--rounded-full); background: var(--surface-card); color: var(--ink);
  font-size: 14px; font-weight: 700; text-decoration: none; padding: 0 12px;
}
.pagination a:hover { background: var(--secondary-bg); }
.pagination a.current { background: var(--ink); color: var(--on-dark); }

.empty {
  text-align: center; color: var(--mute); padding: 48px 24px;
  background: var(--surface-soft); border-radius: var(--rounded-md);
  max-width: 640px; margin: 24px auto;
}
.empty i { font-size: 40px; display: block; margin-bottom: 12px; color: var(--stone); }

.result-count { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 16px; }
.page-head { max-width: 1280px; margin: 0 auto; padding: 40px 24px 0; }
.page-head .display-lg { margin-bottom: 8px; }
.page-head p { color: var(--mute); }

/* ==========================================================================
   Footer (footer-section token)
   ========================================================================== */
.site-footer {
  margin-top: var(--sp-section);
  background: var(--canvas); color: var(--mute);
  border-top: 1px solid var(--hairline);
  padding: 32px 24px; font-size: 14px;
}
.footer-inner { max-width: 1280px; margin: 0 auto; }
.footer-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px;
  padding-bottom: 32px;
}
.footer-grid h4 { font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 12px; }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--mute); text-decoration: none; font-size: 14px; }
.footer-grid a:hover { text-decoration: underline; color: var(--ink); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-top: 24px; border-top: 1px solid var(--hairline-soft);
  font-size: 12px;
}
.footer-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--primary); font-weight: 700; font-size: 14px; }
.footer-brand i { font-size: 22px; }
.footer-disc { max-width: 640px; color: var(--mute); font-size: 12px; line-height: 1.5; margin-top: 12px; }

/* ==========================================================================
   Modal (modal-card token) + scrim
   ========================================================================== */
.scrim {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0, 0, 0, 0.5);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.modal-card {
  background: var(--canvas); color: var(--ink);
  border-radius: var(--rounded-lg); padding: 32px;
  width: 100%; max-width: 480px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.25);
}
.modal-card .heading-lg { margin-bottom: 8px; text-align: center; }
.modal-card .sub { text-align: center; color: var(--charcoal); margin-bottom: 24px; }

/* ==========================================================================
   Forms (text-input token)
   ========================================================================== */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.text-input, input[type="text"], input[type="search"], input[type="url"],
input[type="number"], input[type="date"], input[type="password"], input[type="email"],
textarea, select {
  width: 100%; min-height: 44px; padding: 11px 15px;
  border: 1px solid var(--ash); border-radius: var(--rounded-md);
  background: var(--canvas); color: var(--ink);
  font-size: 16px; font-family: inherit;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.4; }
.text-input:focus, input:focus, textarea:focus, select:focus {
  outline: none;
  border: 2px solid var(--ink);
  box-shadow: 0 0 0 4px var(--focus-outer);
  padding: 10px 14px; /* compensate for the thicker border */
}
.field .hint { font-size: 12px; color: var(--mute); margin-top: 4px; }
.field .error-text { font-size: 12px; color: var(--error); margin-top: 4px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }

/* Alerts */
.alert {
  border-radius: var(--rounded-md); padding: 12px 16px; margin-bottom: 16px;
  font-size: 14px; font-weight: 500;
}
.alert-ok { background: var(--success-pale); color: var(--success-deep); }
.alert-err { background: #fde8e8; color: var(--error); }

/* ==========================================================================
   Admin chrome (design-system restyle of the existing panel)
   ========================================================================== */
.admin-body { background: var(--surface-soft); min-height: 100vh; }
.admin-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--canvas); border-bottom: 1px solid var(--hairline);
}
.admin-nav-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px; height: 64px;
  display: flex; align-items: center; gap: 6px;
}
.admin-nav .brandmark { font-size: 17px; margin-right: 12px; }
.admin-nav .brandmark i { font-size: 24px; }
.admin-nav a.nav-link {
  padding: 10px 14px; border-radius: var(--rounded-full);
  font-size: 14px; font-weight: 700; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.admin-nav a.nav-link:hover { background: var(--surface-card); }
.admin-nav a.nav-link.is-active { background: var(--ink); color: var(--on-dark); }
.admin-nav .spacer { flex: 1; }
.mode-badge {
  font-size: 12px; font-weight: 700; padding: 6px 12px;
  border-radius: var(--rounded-full); background: var(--surface-card); color: var(--ink);
}
.admin-wrap { max-width: 1280px; margin: 0 auto; padding: 32px 24px 64px; }
.admin-wrap > h1 { font-size: 28px; font-weight: 700; letter-spacing: -1.2px; margin-bottom: 24px; color: var(--ink); font-family: var(--font-display); }

.admin-card {
  background: var(--canvas); border-radius: var(--rounded-md);
  padding: 32px; margin-bottom: 24px; border: 1px solid var(--hairline-soft);
}
.admin-card h2 { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 16px; }
.admin-card .muted { color: var(--mute); font-size: 14px; margin-bottom: 16px; }

.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--canvas); border: 1px solid var(--hairline-soft);
  border-radius: var(--rounded-md); padding: 24px;
}
.stat .num { font-size: 32px; font-weight: 700; color: var(--ink); letter-spacing: -0.8px; font-family: var(--font-display); }
.stat .lbl { font-size: 12px; font-weight: 500; color: var(--mute); margin-top: 4px; }

.table-scroll { overflow-x: auto; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.admin-table th {
  text-align: left; font-size: 12px; font-weight: 700; color: var(--ink);
  padding: 12px; border-bottom: 1px solid var(--hairline); white-space: nowrap;
}
.admin-table td { padding: 12px; border-bottom: 1px solid var(--hairline-soft); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: 0; }
.thumb { width: 48px; height: 48px; object-fit: cover; border-radius: var(--rounded-md); background: var(--surface-card); }
.row-actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.row-actions a { color: var(--ink-soft); font-weight: 600; font-size: 13px; text-decoration: none; }
.row-actions a:hover { text-decoration: underline; }
.link-danger { background: none; border: 0; color: var(--error); font-weight: 600; font-size: 13px; padding: 0; }
.link-danger:hover { text-decoration: underline; }

.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--surface-soft);
}
.login-card { max-width: 440px; }
.login-brand { display: flex; justify-content: center; margin-bottom: 20px; }

/* ==========================================================================
   Responsive (breakpoints from design.md)
   ========================================================================== */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .nav-toggle { display: inline-flex; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-row { grid-template-columns: 1fr; gap: 24px; }
  .feature-row.flip > .feature-copy { order: 0; }
  .deal-detail { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  .searchbar { display: none; }
  .nav-search-btn { display: inline-flex !important; }
  .display-xl { font-size: 44px; }
  .display-lg { font-size: 36px; }
  .hero { padding: 48px 20px 40px; }
  .section, .feature-row { padding-left: 16px; padding-right: 16px; }
  .section { padding-top: 48px; }
  .feature-row { padding-top: 48px; }
  .nav-inner { padding: 0 16px; }
  .cta-strip-inner { flex-direction: column; align-items: flex-start; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .masonry { columns: 2; column-gap: 6px; }
  .pin { margin-bottom: 14px; }
  .display-xl { font-size: 36px; }
  .cat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .category-tile { padding: 12px; gap: 10px; }
  .category-tile .cat-ico { width: 44px; height: 44px; font-size: 20px; }
  .footer-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .admin-card { padding: 20px; }
  .nav-login { display: none; }
}
/* Mobile drawer */
.drawer-scrim {
  position: fixed; inset: 0; z-index: 70; background: rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; z-index: 75;
  width: 300px; background: var(--canvas); padding: 16px;
  transform: translateX(-105%); transition: transform 0.22s ease;
  overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer a.drawer-link {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--rounded-md);
  font-size: 16px; font-weight: 600; color: var(--ink); text-decoration: none;
}
.drawer a.drawer-link:hover { background: var(--surface-card); }
.drawer a.drawer-link i { font-size: 20px; color: var(--mute); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }

.nav-search-btn { display: none; }

/* Utility */
.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;
}
code.inline {
  font-family: ui-monospace, monospace; font-size: 13px;
  background: var(--surface-card); padding: 2px 8px; border-radius: 8px;
}

/* Legacy form-row (admin forms) mapped onto the design system */
.form-row { margin-bottom: 16px; }
.form-row > label { display: block; font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.login-box { max-width: 440px; margin: 0 auto; }

/* ---- Mobile overflow + navbar rhythm fixes (2026-10-02) ---- */
html, body { overflow-x: clip; } /* safety net: never allow sideways scroll; keeps sticky nav working */

@media (max-width: 768px) {
  .nav-inner { gap: 8px; }
  .brandmark { font-size: 18px; }
  .brandmark i { font-size: 26px; }
}
@media (max-width: 480px) {
  .nav-inner { padding: 0 12px; gap: 6px; }
  .brandmark { font-size: 17px; }
  .brandmark i { font-size: 24px; }
  .nav-toggle { width: 38px; height: 38px; font-size: 19px; }
  .nav-search-btn { width: 38px; height: 38px; font-size: 19px; }
  .nav-cta .btn { min-height: 38px; padding: 6px 12px; font-size: 12px; }
  .nav-cta { gap: 6px; }
}

/* ---- Search overlay fixes (2026-10-02): icon sat above the input because
   .search-ico positioning was scoped to .searchbar only ---- */
.search-overlay form { position: relative; max-width: 640px; margin: 24px auto 0; }
.search-overlay .search-ico {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--mute); font-size: 19px; pointer-events: none; z-index: 2;
}
.search-overlay input[type="search"] {
  height: 52px; border: 0; border-radius: var(--rounded-full);
  background: var(--surface-card); padding: 11px 60px 11px 46px;
  font-size: 17px;
}
.search-overlay input[type="search"]:focus {
  outline: none; border: 0; background: var(--canvas);
  box-shadow: inset 0 0 0 1px var(--ash);
  padding: 11px 60px 11px 46px;
}
.search-overlay .btn-icon {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
}
