/* =============================================================================
   WhoKeepsCallingMe.uk — Main Stylesheet
   Aesthetic: Editorial utility — newspaper clarity meets modern web
   Fonts: DM Sans (body) + DM Mono (numbers) + Playfair Display (brand)
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=DM+Mono:wght@400;500&family=Playfair+Display:wght@700;900&display=swap');

/* ---------------------------------------------------------------------------
   CSS Custom Properties
   --------------------------------------------------------------------------- */
:root {
  /* Brand */
  --brand-red:       #C8102E;
  --brand-red-dark:  #9E0D24;
  --brand-red-light: #F5E6E9;
  --brand-red-mid:   #E8405A;

  /* Neutral scale */
  --ink-900:   #0F0F0F;
  --ink-800:   #1C1C1C;
  --ink-700:   #2E2E2E;
  --ink-600:   #4A4A4A;
  --ink-500:   #6B6B6B;
  --ink-400:   #8C8C8C;
  --ink-300:   #B0B0B0;
  --ink-200:   #D4D4D4;
  --ink-150:   #E4E4E4;
  --ink-100:   #F0F0F0;
  --ink-50:    #F7F7F7;
  --white:     #FFFFFF;

  /* Semantic */
  --danger-bg:     #FEF2F2;
  --danger-border: #FECACA;
  --danger-text:   #991B1B;
  --danger-mid:    #EF4444;

  --warning-bg:     #FFFBEB;
  --warning-border: #FDE68A;
  --warning-text:   #92400E;

  --success-bg:     #F0FDF4;
  --success-border: #BBF7D0;
  --success-text:   #166534;
  --success-mid:    #22C55E;

  --info-bg:     #EFF6FF;
  --info-border: #BFDBFE;
  --info-text:   #1E40AF;

  /* Typography */
  --font-body:    'DM Sans', system-ui, sans-serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;
  --font-display: 'Playfair Display', Georgia, serif;

  /* Spacing */
  --gap-xs:  4px;
  --gap-sm:  8px;
  --gap-md:  16px;
  --gap-lg:  24px;
  --gap-xl:  40px;
  --gap-2xl: 64px;

  /* Layout */
  --container-max:  1160px;
  --sidebar-width:  300px;
  --content-width:  800px;
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  12px;
  --radius-xl:  20px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  --shadow-lg:  0 12px 32px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);

  /* Transitions */
  --transition: 150ms ease;
}

/* ---------------------------------------------------------------------------
   Reset & Base
   --------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--ink-800);
  background: var(--ink-50);
  -webkit-font-smoothing: antialiased;
  width: 100%;
  overflow-x: hidden;
  min-width: 0;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-red); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---------------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--gap-lg);
}

.page-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--gap-xl);
  align-items: start;
  padding: var(--gap-xl) 0;
}

.page-layout--full {
  grid-template-columns: 1fr;
}

@media (max-width: 900px) {
  .page-layout {
    grid-template-columns: 1fr;
  }
  .sidebar { display: none; }
}

/* ---------------------------------------------------------------------------
   Header
   --------------------------------------------------------------------------- */
.site-header {
  background: var(--white);
  border-bottom: 2px solid var(--ink-900);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--gap-lg);
  height: 64px;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--ink-900);
  white-space: nowrap;
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
}

.site-logo span {
  color: var(--brand-red);
}

.site-logo:hover { text-decoration: none; }

.header-search {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--ink-800);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.header-search:focus-within {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.12);
}

.header-search input {
  flex: 1;
  border: none;
  outline: none;
  padding: 0 var(--gap-md);
  height: 40px;
  font-size: 0.9375rem;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  color: var(--ink-800);
  background: transparent;
}

.header-search input::placeholder {
  font-family: var(--font-body);
  letter-spacing: 0;
  color: var(--ink-400);
  font-size: 0.875rem;
}

.header-search button {
  background: var(--ink-900);
  color: var(--white);
  border: none;
  padding: 0 var(--gap-lg);
  height: 40px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: background var(--transition);
  white-space: nowrap;
}

.header-search button:hover {
  background: var(--brand-red);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  margin-left: auto;
  flex-shrink: 0;
}

.header-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-600);
  text-decoration: none;
  transition: color var(--transition);
}

.header-nav a:hover { color: var(--ink-900); text-decoration: none; }

.btn-login {
  background: transparent;
  border: 1.5px solid var(--ink-300);
  border-radius: var(--radius-md);
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-700) !important;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition) !important;
}

.btn-login:hover {
  border-color: var(--ink-700) !important;
  color: var(--ink-900) !important;
}

.btn-register {
  background: var(--ink-900);
  border: 1.5px solid var(--ink-900);
  border-radius: var(--radius-md);
  padding: 6px 16px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--white) !important;
  cursor: pointer;
  transition: background var(--transition) !important;
}

.btn-register:hover {
  background: var(--brand-red) !important;
  border-color: var(--brand-red) !important;
  text-decoration: none !important;
}

/* ---------------------------------------------------------------------------
   Ad Banner — Leaderboard (728×90)
   --------------------------------------------------------------------------- */
.ad-leaderboard {
  background: var(--ink-100);
  border-top: 1px solid var(--ink-150);
  border-bottom: 1px solid var(--ink-150);
  padding: var(--gap-sm) 0;
}

.ad-leaderboard__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 90px;
}

.ad-leaderboard__inner ins,
.ad-placeholder {
  display: block;
}

.ad-placeholder {
  background: var(--ink-150);
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-400);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------------------
   Breadcrumb
   --------------------------------------------------------------------------- */
.breadcrumb {
  padding: var(--gap-md) 0 0;
  font-size: 0.8125rem;
  color: var(--ink-400);
  display: flex;
  align-items: center;
  gap: var(--gap-xs);
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--ink-500); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand-red); }
.breadcrumb__sep { color: var(--ink-300); }

/* ---------------------------------------------------------------------------
   Number Hero Card
   --------------------------------------------------------------------------- */
.number-hero {
  background: var(--white);
  border: 1.5px solid var(--ink-900);
  border-radius: var(--radius-xl);
  padding: var(--gap-xl);
  margin-bottom: var(--gap-lg);
  position: relative;
  overflow: hidden;
}

.number-hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--brand-red);
}

.number-hero--safe::before   { background: var(--success-mid); }
.number-hero--warn::before   { background: #F59E0B; }
.number-hero--danger::before { background: var(--brand-red); }

.number-hero__number {
  font-family: var(--font-mono);
  font-size: 2.5rem;
  font-weight: 500;
  color: var(--ink-900);
  letter-spacing: 0.04em;
  line-height: 1.1;
  margin-bottom: var(--gap-sm);
}

.number-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  margin-bottom: var(--gap-lg);
  align-items: center;
}

/* ---------------------------------------------------------------------------
   Badges
   --------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge--danger  { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid var(--danger-border); }
.badge--warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.badge--success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.badge--info    { background: var(--info-bg);    color: var(--info-text);    border: 1px solid var(--info-border); }
.badge--neutral { background: var(--ink-100);    color: var(--ink-600);      border: 1px solid var(--ink-200); }
.badge--verified {
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
  font-size: 0.8125rem;
  padding: 4px 12px;
}

/* ---------------------------------------------------------------------------
   Spam Score Stats Row
   --------------------------------------------------------------------------- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--gap-md);
  margin-bottom: var(--gap-lg);
}

.stat-box {
  background: var(--ink-50);
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-lg);
  padding: var(--gap-md) var(--gap-lg);
  text-align: center;
}

.stat-box__number {
  font-family: var(--font-mono);
  font-size: 1.875rem;
  font-weight: 500;
  line-height: 1;
  margin-bottom: 4px;
  color: var(--ink-900);
}

.stat-box__number--danger  { color: var(--brand-red); }
.stat-box__number--warning { color: #D97706; }
.stat-box__number--safe    { color: #16A34A; }

.stat-box__label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--ink-500);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------------------------------------------------------------------------
   Spam Bar
   --------------------------------------------------------------------------- */
.spam-bar {
  margin-bottom: var(--gap-lg);
}

.spam-bar__labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--ink-400);
  margin-bottom: 6px;
  font-weight: 500;
}

.spam-bar__track {
  height: 8px;
  background: var(--ink-150);
  border-radius: 100px;
  overflow: hidden;
}

.spam-bar__fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, #22C55E 0%, #F59E0B 50%, #EF4444 80%, #C8102E 100%);
  background-size: 100% 100%;
}

/* ---------------------------------------------------------------------------
   Action Buttons
   --------------------------------------------------------------------------- */
.action-row {
  display: flex;
  gap: var(--gap-sm);
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: 1.5px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1;
}

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

.btn--primary {
  background: var(--brand-red);
  color: var(--white);
  border-color: var(--brand-red);
}
.btn--primary:hover {
  background: var(--brand-red-dark);
  border-color: var(--brand-red-dark);
  color: var(--white);
}

.btn--secondary {
  background: var(--white);
  color: var(--ink-700);
  border-color: var(--ink-300);
}
.btn--secondary:hover {
  border-color: var(--ink-700);
  color: var(--ink-900);
  background: var(--ink-50);
}

.btn--dark {
  background: var(--ink-900);
  color: var(--white);
  border-color: var(--ink-900);
}
.btn--dark:hover {
  background: var(--ink-700);
  border-color: var(--ink-700);
  color: var(--white);
}

.btn--sm {
  padding: 6px 14px;
  font-size: 0.8125rem;
}

.btn--block { width: 100%; justify-content: center; }

/* ---------------------------------------------------------------------------
   Verified Business Banner
   --------------------------------------------------------------------------- */
.verified-banner {
  background: var(--success-bg);
  border: 1.5px solid var(--success-border);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  margin-bottom: var(--gap-lg);
  display: flex;
  gap: var(--gap-md);
  align-items: flex-start;
}

.verified-banner__icon {
  width: 40px;
  height: 40px;
  background: var(--success-mid);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--white);
  font-size: 1.125rem;
}

.verified-banner__title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--success-text);
  margin-bottom: 2px;
}

.verified-banner__body {
  font-size: 0.875rem;
  color: #166534;
  line-height: 1.55;
}

/* ---------------------------------------------------------------------------
   Category Breakdown
   --------------------------------------------------------------------------- */
.category-breakdown {
  background: var(--white);
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  margin-bottom: var(--gap-lg);
}

.category-breakdown__title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-500);
  margin-bottom: var(--gap-md);
}

.category-row {
  display: flex;
  align-items: center;
  gap: var(--gap-md);
  margin-bottom: var(--gap-sm);
}

.category-row:last-child { margin-bottom: 0; }

.category-row__label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ink-700);
  width: 90px;
  flex-shrink: 0;
  text-transform: capitalize;
}

.category-row__bar {
  flex: 1;
  height: 6px;
  background: var(--ink-100);
  border-radius: 100px;
  overflow: hidden;
}

.category-row__fill {
  height: 100%;
  border-radius: 100px;
  background: var(--brand-red);
  transition: width 0.5s ease;
}

.category-row__fill--spam   { background: #DC2626; }
.category-row__fill--scam   { background: #7C3AED; }
.category-row__fill--sales  { background: #D97706; }
.category-row__fill--silent { background: #6B7280; }
.category-row__fill--debt   { background: #0891B2; }
.category-row__fill--legit  { background: #16A34A; }

.category-row__count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-500);
  font-family: var(--font-mono);
  width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------------------
   Reports Feed
   --------------------------------------------------------------------------- */
.reports-section__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--gap-md);
}

.section-title {
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-500);
}

.report-card {
  background: var(--white);
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  margin-bottom: var(--gap-sm);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.report-card:hover {
  border-color: var(--ink-300);
  box-shadow: var(--shadow-sm);
}

.report-card__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--gap-sm);
  gap: var(--gap-sm);
}

.report-card__category {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.cat--spam   { background: #FEF2F2; color: #991B1B; }
.cat--scam   { background: #F5F3FF; color: #5B21B6; }
.cat--sales  { background: #FFFBEB; color: #92400E; }
.cat--silent { background: var(--ink-100); color: var(--ink-600); }
.cat--debt   { background: #EFF6FF; color: #1E40AF; }
.cat--legit  { background: #F0FDF4; color: #166534; }
.cat--survey { background: #FDF4FF; color: #6B21A8; }
.cat--unknown { background: var(--ink-100); color: var(--ink-500); }

.report-card__meta {
  font-size: 0.75rem;
  color: var(--ink-400);
  white-space: nowrap;
}

.report-card__text {
  font-size: 0.9375rem;
  color: var(--ink-700);
  line-height: 1.6;
  margin-bottom: var(--gap-sm);
}

.report-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--ink-400);
}

.vote-btn {
  background: none;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--ink-500);
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.vote-btn:hover {
  border-color: var(--success-mid);
  color: var(--success-text);
  background: var(--success-bg);
}

/* Empty state */
.reports-empty {
  background: var(--white);
  border: 1.5px dashed var(--ink-200);
  border-radius: var(--radius-lg);
  padding: var(--gap-xl);
  text-align: center;
  color: var(--ink-500);
}

.reports-empty__icon {
  font-size: 2.5rem;
  margin-bottom: var(--gap-md);
  opacity: 0.4;
}

.reports-empty__title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: var(--gap-sm);
}

.reports-empty__text {
  font-size: 0.875rem;
  line-height: 1.6;
  max-width: 360px;
  margin: 0 auto var(--gap-lg);
}

/* ---------------------------------------------------------------------------
   Sidebar
   --------------------------------------------------------------------------- */
.sidebar__widget {
  background: var(--white);
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  margin-bottom: var(--gap-lg);
}

.sidebar__widget-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-400);
  margin-bottom: var(--gap-md);
  padding-bottom: var(--gap-sm);
  border-bottom: 1px solid var(--ink-100);
}

.sidebar__claim-box {
  background: linear-gradient(135deg, var(--ink-900) 0%, var(--ink-700) 100%);
  border-radius: var(--radius-lg);
  padding: var(--gap-lg);
  margin-bottom: var(--gap-lg);
  color: var(--white);
}

.sidebar__claim-box h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  margin-bottom: var(--gap-sm);
}

.sidebar__claim-box p {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.75);
  line-height: 1.55;
  margin-bottom: var(--gap-md);
}

/* Ad slots — sidebar */
.ad-sidebar {
  background: var(--ink-100);
  border: 1px dashed var(--ink-300);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--gap-lg);
  min-height: 250px;
  color: var(--ink-400);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-direction: column;
  gap: 6px;
}

.top-numbers-list { padding: 0; }
.top-numbers-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--ink-100);
  font-size: 0.875rem;
}

.top-numbers-list li:last-child { border-bottom: none; }
.top-numbers-list a {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-700);
  text-decoration: none;
}
.top-numbers-list a:hover { color: var(--brand-red); }
.top-numbers-list .report-count {
  font-size: 0.75rem;
  color: var(--ink-400);
  font-family: var(--font-mono);
}

/* ---------------------------------------------------------------------------
   Homepage Hero
   --------------------------------------------------------------------------- */
.hero {
  background: var(--ink-900);
  color: var(--white);
  padding: var(--gap-2xl) 0;
  position: relative;
  overflow: hidden;
  width: 100%;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 40px,
    rgba(255,255,255,0.015) 40px,
    rgba(255,255,255,0.015) 41px
  );
  pointer-events: none;
}

.hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-red-mid);
  margin-bottom: var(--gap-md);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: var(--gap-lg);
  max-width: 640px;
}

.hero__title span { color: var(--brand-red-mid); }

.hero__subtitle {
  font-size: 1.0625rem;
  color: rgba(255,255,255,0.65);
  max-width: 520px;
  line-height: 1.65;
  margin-bottom: var(--gap-xl);
}

.hero-search {
  display: flex;
  max-width: 540px;
  border: 2px solid rgba(255,255,255,0.2);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(255,255,255,0.06);
  transition: border-color var(--transition);
}

.hero-search:focus-within {
  border-color: var(--brand-red-mid);
}

.hero-search input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 0 var(--gap-lg);
  height: 54px;
  font-size: 1.0625rem;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  color: var(--white);
}

.hero-search input::placeholder {
  font-family: var(--font-body);
  color: rgba(255,255,255,0.35);
  letter-spacing: 0;
  font-size: 0.9375rem;
}

.hero-search button {
  background: var(--brand-red);
  border: none;
  color: var(--white);
  padding: 0 var(--gap-xl);
  font-size: 0.9375rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition);
  letter-spacing: 0.03em;
}

.hero-search button:hover { background: var(--brand-red-dark); }

.hero__stats {
  display: flex;
  gap: var(--gap-xl);
  margin-top: var(--gap-xl);
  padding-top: var(--gap-xl);
  border-top: 1px solid rgba(255,255,255,0.1);
}

.hero__stat-num {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--white);
}

.hero__stat-label {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.5);
  margin-top: 2px;
}

/* ---------------------------------------------------------------------------
   Homepage feature sections
   --------------------------------------------------------------------------- */
.home-sections {
  padding: var(--gap-xl) 0;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--gap-lg);
  margin-bottom: var(--gap-xl);
}

.home-card {
  background: var(--white);
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-xl);
  padding: var(--gap-xl);
}

.home-card__icon {
  width: 44px;
  height: 44px;
  background: var(--brand-red-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-red);
  font-size: 1.25rem;
  margin-bottom: var(--gap-lg);
}

.home-card__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: var(--gap-sm);
}

.home-card__text {
  font-size: 0.875rem;
  color: var(--ink-600);
  line-height: 1.65;
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */
.site-footer {
  background: var(--ink-900);
  color: rgba(255,255,255,0.6);
  padding: var(--gap-xl) 0;
  margin-top: var(--gap-2xl);
  font-size: 0.875rem;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--gap-xl);
  margin-bottom: var(--gap-xl);
}

.site-footer__brand .site-logo {
  color: var(--white);
  display: block;
  margin-bottom: var(--gap-md);
}

.site-footer__tagline {
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.65;
  max-width: 260px;
}

.site-footer__heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: rgba(255,255,255,0.4);
  margin-bottom: var(--gap-md);
}

.site-footer__links { list-style: none; }
.site-footer__links li { margin-bottom: 8px; }
.site-footer__links a {
  color: rgba(255,255,255,0.6);
  text-decoration: none;
  transition: color var(--transition);
}
.site-footer__links a:hover { color: var(--white); }

.site-footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: var(--gap-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: rgba(255,255,255,0.35);
  flex-wrap: wrap;
  gap: var(--gap-md);
}

/* ---------------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------------- */
.form-card {
  background: var(--white);
  border: 1px solid var(--ink-150);
  border-radius: var(--radius-xl);
  padding: var(--gap-xl);
  max-width: 640px;
}

.form-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ink-900);
  margin-bottom: var(--gap-xs);
}

.form-subtitle {
  font-size: 0.9375rem;
  color: var(--ink-500);
  margin-bottom: var(--gap-xl);
}

.form-group {
  margin-bottom: var(--gap-lg);
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink-700);
  margin-bottom: 6px;
}

.form-label span {
  color: var(--brand-red);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  color: var(--ink-800);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
  appearance: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(200, 16, 46, 0.1);
}

.form-input--mono {
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  font-size: 1rem;
}

.form-textarea { resize: vertical; min-height: 100px; }

.form-hint {
  font-size: 0.8125rem;
  color: var(--ink-400);
  margin-top: 5px;
  line-height: 1.5;
}

/* Radio / checkbox category picker */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--gap-sm);
}

.category-option {
  cursor: pointer;
}

.category-option input { display: none; }

.category-option__label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-600);
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
}

.category-option input:checked + .category-option__label {
  border-color: var(--brand-red);
  background: var(--brand-red-light);
  color: var(--brand-red-dark);
}

.category-option__label:hover {
  border-color: var(--ink-400);
}

/* ---------------------------------------------------------------------------
   Auth pages
   --------------------------------------------------------------------------- */
.auth-wrap {
  min-height: calc(100vh - 64px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gap-xl) var(--gap-lg);
}

.auth-card {
  background: var(--white);
  border: 1.5px solid var(--ink-200);
  border-radius: var(--radius-xl);
  padding: var(--gap-xl) var(--gap-2xl);
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
}

.auth-card__logo {
  text-align: center;
  margin-bottom: var(--gap-xl);
}

.auth-card__title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--gap-xs);
}

.auth-card__subtitle {
  text-align: center;
  font-size: 0.875rem;
  color: var(--ink-500);
  margin-bottom: var(--gap-xl);
}

/* ---------------------------------------------------------------------------
   Alerts / Flash messages
   --------------------------------------------------------------------------- */
.alert {
  padding: var(--gap-md) var(--gap-lg);
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  margin-bottom: var(--gap-md);
  display: flex;
  align-items: flex-start;
  gap: var(--gap-md);
}

.alert--success { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.alert--danger  { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid var(--danger-border); }
.alert--warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.alert--info    { background: var(--info-bg);    color: var(--info-text);    border: 1px solid var(--info-border); }

/* ---------------------------------------------------------------------------
   Pagination
   --------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--gap-sm);
  padding: var(--gap-lg) 0;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-600);
  cursor: pointer;
  background: var(--white);
  text-decoration: none;
  transition: all var(--transition);
  padding: 0 10px;
}

.page-btn:hover { border-color: var(--ink-400); color: var(--ink-900); text-decoration: none; }
.page-btn--active {
  background: var(--ink-900);
  border-color: var(--ink-900);
  color: var(--white);
}

/* ---------------------------------------------------------------------------
   Utility classes
   --------------------------------------------------------------------------- */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
.text-center { text-align: center; }
.text-muted  { color: var(--ink-500); }
.text-mono   { font-family: var(--font-mono); }
.mt-sm { margin-top: var(--gap-sm); }
.mt-md { margin-top: var(--gap-md); }
.mt-lg { margin-top: var(--gap-lg); }
.mb-md { margin-bottom: var(--gap-md); }
.mb-lg { margin-bottom: var(--gap-lg); }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-sm { gap: var(--gap-sm); }
.gap-md { gap: var(--gap-md); }


/* ---------------------------------------------------------------------------
   Mobile menu button + dropdown
   --------------------------------------------------------------------------- */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 28px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  margin-left: var(--gap-sm);
}

.mobile-menu-btn span {
  display: block;
  height: 2px;
  background: var(--ink-800);
  border-radius: 2px;
  transition: all var(--transition);
}

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border-bottom: 2px solid var(--ink-900);
  z-index: 999;
  box-shadow: var(--shadow-md);
  display: none;
}

.mobile-menu.is-open {
  display: block;
}

/* On desktop, never show mobile menu even if JS adds is-open */
@media (min-width: 769px) {
  .mobile-menu { display: none !important; }
}

.mobile-menu__inner {
  display: flex;
  flex-direction: column;
  padding: var(--gap-md) 0;
}

.mobile-menu__link {
  display: block;
  padding: 12px var(--gap-lg);
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink-700);
  text-decoration: none;
  border-bottom: 1px solid var(--ink-100);
  transition: background var(--transition), color var(--transition);
}

.mobile-menu__link:hover {
  background: var(--ink-50);
  color: var(--ink-900);
  text-decoration: none;
}

.mobile-menu__link--cta {
  background: var(--brand-red);
  color: var(--white) !important;
  margin: var(--gap-md) var(--gap-lg);
  border-radius: var(--radius-md);
  border-bottom: none;
  text-align: center;
  font-weight: 600;
}

.mobile-menu__link--cta:hover {
  background: var(--brand-red-dark) !important;
}

/* Site header needs position:relative for mobile menu positioning */
.site-header {
  position: relative;
}

@media (max-width: 768px) {
  .mobile-menu-btn { display: flex; }
}

/* ---------------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .site-header__inner { gap: var(--gap-sm); }
  .header-nav { display: none; }
  .number-hero__number { font-size: 1.75rem; }
  .stats-row { grid-template-columns: repeat(3, 1fr); gap: var(--gap-sm); }
  .stat-box { padding: var(--gap-sm) var(--gap-md); }
  .stat-box__number { font-size: 1.25rem; }
  .hero { padding: var(--gap-xl) 0; }
  .hero__stats { gap: var(--gap-lg); flex-wrap: wrap; }
  .site-footer__grid { grid-template-columns: 1fr 1fr; gap: var(--gap-lg); }
  .action-row .btn { font-size: 0.8125rem; padding: 8px 14px; }
}

@media (max-width: 480px) {
  .container { padding: 0 var(--gap-md); }
  .number-hero { padding: var(--gap-lg); }
  .hero-search {
    flex-direction: column;
    border-radius: var(--radius-md);
    max-width: 100%;
    width: 100%;
  }
  .hero-search input {
    height: 52px;
    width: 100%;
    font-size: 1rem;
    padding: 0 var(--gap-md);
  }
  .hero-search button {
    height: 48px;
    width: 100%;
    font-size: 1rem;
    padding: 0;
  }
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row .stat-box:nth-child(3) { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------------------
   Mobile layout fixes — prevent overflow, ensure full width
   --------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Prevent any element from causing horizontal scroll */
  .site-header,
  .site-header__inner,
  .mobile-menu,
  .hero,
  .home-sections,
  .container,
  main,
  footer {
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* Header inner: logo + search only, no overflow */
  .site-header__inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: var(--gap-sm);
    align-items: center;
    height: 56px;
    padding: 0 var(--gap-md);
    overflow: hidden;
  }

  .site-logo {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
  }

  .header-search {
    min-width: 0;
    max-width: 100%;
  }

  .header-search input {
    min-width: 0;
    width: 100%;
  }

  /* Hero full width */
  .hero {
    width: 100%;
    box-sizing: border-box;
  }

  .hero-search {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }
}

/* Home page bottom grid — collapse to single column on mobile */
@media (max-width: 768px) {
  .home-bottom-grid {
    grid-template-columns: 1fr !important;
  }
  .home-bottom-grid > *:nth-child(2) {
    display: none; /* hide sidebar on mobile */
  }
}

/* Number table — prevent wrapping in cells */
.text-mono, [style*="font-mono"] {
  word-break: keep-all;
  white-space: nowrap;
}

/* ============================================================
   CRITICAL MOBILE FIXES
   ============================================================ */

/* Force single column on ALL grid layouts on mobile */
@media (max-width: 768px) {
  /* Override any inline grid styles */
  [style*="grid-template-columns: 1fr var(--sidebar"],
  [style*="grid-template-columns:1fr var(--sidebar"],
  .home-bottom-grid {
    display: block !important;
  }

  /* Hide sidebar elements on mobile */
  [style*="grid-template-columns"] > *:nth-child(2),
  .home-bottom-grid > aside,
  .home-bottom-grid > *:last-child {
    display: none !important;
  }

  /* Prevent phone numbers wrapping */
  td, th {
    word-break: keep-all !important;
    white-space: nowrap !important;
  }

  /* Make table scroll horizontally if needed */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
