/* Core design system for ReceiveSMS (lightweight, no build step) */
:root {
  --brand: #2858ff;
  --brand-600: #2b6cb0;
  --brand-700: #234e91;
  --bg: #0b1020;
  --text: #0b1220;
  --muted: #64748b;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e5e7eb;
  --ring: rgba(40, 88, 255, 0.15);
  --ok: #16a34a;
  --warn: #f59e0b;
  --err: #ef4444;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 8px 20px rgba(2,6,23,.08);
}

/* Reset-ish */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial, sans-serif;
  color: var(--text); background: #fff;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Accessibility helpers */
.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; }
.skip-link { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { left: 16px; top: 16px; width: auto; height: auto; padding: 10px 14px; background: #0b1324; color: #fff; border-radius: 10px; z-index: 1000; text-decoration: none; }

/* Layout */
.container { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.stack { display: grid; gap: 16px; }
.stack-lg { display: grid; gap: 28px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 30; background: rgba(255,255,255,.8); backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--border); }
.site-header .bar { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.brand { font-weight: 700; letter-spacing: -0.02em; color: var(--text); display: flex; gap: 10px; align-items: center; }
.brand .brand-logo { height: clamp(24px, 2.4vw, 32px); width: auto; display: block; }
.brand .brand-text { font-weight: 800; color: #0b1324; }
.nav { display: flex; gap: 14px; align-items: center; }
.nav a { color: #0b1324; font-weight: 500; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { background: var(--surface-2); text-decoration: none; }

/* Dropdown menus */
.nav .menu { position: relative; }
.nav .menu .menu-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #0b1324; font-weight: 500; font-size: 1rem; cursor: pointer; }
.nav .menu .menu-toggle:hover { background: var(--surface-2); }
.nav .menu .menu-toggle:focus-visible { outline: 2px solid transparent; box-shadow: 0 0 0 3px var(--ring); }
.nav .menu .chevron { width: 16px; height: 16px; }
.nav .menu .menu-list { position: absolute; left: 0; top: calc(100% + 6px); min-width: 240px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 40; }
.nav .menu.open .menu-list { display: block; }
.nav .menu .menu-list a { display: block; padding: 8px 10px; border-radius: 8px; color: #0b1324; font-weight: 500; }
.nav .menu .menu-list a:hover { background: var(--surface-2); text-decoration: none; }

@media (max-width: 820px) {
  .site-header.is-open #primary-nav { display: grid; gap: 8px; padding: 10px 0; }
  .nav { flex-direction: column; align-items: flex-start; gap: 6px; }
  .nav .menu .menu-list { position: static; display: none; width: 100%; box-shadow: none; border: 1px dashed var(--border); margin-top: 6px; }
  .nav .menu.open .menu-list { display: block; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  /* Full-bleed section inside a centered container */
  left: 50%; right: 50%;
  margin-left: -50vw; margin-right: -50vw;
  width: 100vw;
  /* Base linear gradient ensures full-bleed, continuous color left-to-right */
  background-image:
    linear-gradient(90deg, rgba(40,88,255,.06), rgba(34,197,94,.05)),
    radial-gradient(1200px 520px at -10% -20%, rgba(40,88,255,.12), transparent),
    radial-gradient(1000px 460px at 110% -10%, rgba(34,197,94,.10), transparent);
  border-bottom: 1px solid var(--border);
}
.hero .inner { padding: 24px 0 16px; }
.eyebrow { display:inline-flex; align-items:center; gap:8px; color:#0b1324; background: #eef2ff; border:1px solid #e0e7ff; padding:4px 10px; border-radius:999px; font-size:12px; font-weight:600; letter-spacing:.02em }
.hero h1 { margin: 12px 0 8px; font-size: clamp(26px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.02em; }
.lead { color: #0f172a; max-width: 65ch; }
.hero-cta { display:flex; gap:10px; margin-top: 12px; }

/* Prose (article content) */
.prose { max-width: none; }
.prose h2 { font-size: clamp(20px, 3vw, 28px); line-height:1.2; margin: 0 0 10px; }
.prose h3 { font-size: clamp(17px, 2.4vw, 22px); line-height:1.3; margin: 18px 0 6px; }
.prose p { margin: 8px 0; color: #0f172a; }
.prose ul { padding-left: 18px; margin: 8px 0; }
.prose li { margin: 4px 0; }

/* Buttons */
.btn { display: inline-flex; gap: 8px; align-items: center; justify-content: center; padding: 10px 14px; border-radius: 10px; border: 1px solid transparent; font-weight: 600; cursor: pointer; text-decoration: none !important; }
.btn-sm { padding: 6px 10px; border-radius: 8px; font-size: 14px; }
.btn-primary { background: var(--brand); color: white; box-shadow: var(--shadow); }
.btn-primary:hover { background: #184af6; }
.btn-ghost { background: white; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }

/* Cards & grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.grid-2 { display:grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.bars { display:grid; gap:8px; }
/* Right-aligned, consistent bar column */
.bar { display:grid; align-items:center; gap:8px; grid-template-columns: minmax(0, 1fr) min(320px, 50%) 44px; }
.bar .bar-track { width: 100%; height:10px; border-radius:999px; background:#f1f5f9; border:1px solid var(--border); overflow:hidden; }
.bar .bar-fill { height:100%; background: linear-gradient(90deg, #60a5fa, #1d4ed8); }
.bar .bar-fill.warn { background: linear-gradient(90deg, #f59e0b, #b45309); }
.bar .bar-fill.err { background: linear-gradient(90deg, #ef4444, #991b1b); }
.bar .bar-fill.ok { background: linear-gradient(90deg, #34d399, #059669); }
.bar .bar-label { max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Category-specific bar colors (IDs 1..12) */
.bar .bar-fill.cat-8 { background: linear-gradient(90deg, #ef4444, #991b1b); } /* scam */
.bar .bar-fill.cat-10 { background: linear-gradient(90deg, #f59e0b, #b45309); } /* spam */
.bar .bar-fill.cat-11 { background: linear-gradient(90deg, #fb923c, #9a3412); } /* telemarketing */
.bar .bar-fill.cat-9 { background: linear-gradient(90deg, #6366f1, #4338ca); } /* debt collector */
.bar .bar-fill.cat-5 { background: linear-gradient(90deg, #fca5a5, #ef4444); } /* harassment */
.bar .bar-fill.cat-6 { background: linear-gradient(90deg, #fde68a, #f59e0b); } /* advertising */
.bar .bar-fill.cat-7 { background: linear-gradient(90deg, #a78bfa, #7c3aed); } /* survey */
.bar .bar-fill.cat-3 { background: linear-gradient(90deg, #34d399, #059669); } /* safe */
.bar .bar-fill.cat-1 { background: linear-gradient(90deg, #60a5fa, #1d4ed8); } /* financial */
.bar .bar-fill.cat-12 { background: linear-gradient(90deg, #93c5fd, #2563eb); } /* customer service */
.bar .bar-fill.cat-4,
.bar .bar-fill.cat-2 { background: linear-gradient(90deg, #cbd5e1, #94a3b8); } /* unknown/other */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); }
.card:hover { transform: none; transition: none; }
.card-link { display:block; color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.pill { display:inline-flex; align-items:center; gap:6px; padding: 4px 8px; border-radius: 999px; border:1px solid var(--border); background: var(--surface-2); font-size: 12px; font-weight: 600; color: #0b1324; }
.kpis { display:grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.kpi { padding: 10px 12px; border:1px dashed var(--border); border-radius: 12px; background: #fff; }

/* Sections */
.section { padding: 28px 0; }
.section h2 { font-size: clamp(20px, 2.6vw, 28px); margin: 0 0 6px; letter-spacing: -0.01em; }
.section p { margin: 0 0 8px; }

/* Footer */
.site-footer { margin-top: 40px; border-top: 1px solid var(--border); background: #fff; }
.site-footer .inner { padding: 18px 0; color: var(--muted); }

/* Flags */
.flag { width: 22px; height: 22px; display:inline-grid; place-items:center; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 14px; }
.row { display:flex; gap:10px; align-items:center; }
.row > span:first-child { font-size: 18px; }

/* Message list */
.sms { white-space: pre-wrap; word-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
.sms .code { background: #f8fafc; border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; font-weight: 700; }
.copy-btn { margin-top: 8px; }
.stars { color: #f5a623; }

/* Pagination */
.pagination { display:flex; gap:10px; align-items:center; margin-top: 16px; }
.pagination a, .pagination span { border:1px solid var(--border); padding:6px 10px; border-radius:10px; text-decoration:none; color:#0b1324; background: #fff; }
.pagination a:hover { background: var(--surface-2); }

/* Utilities */
.hidden { display:none; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 16px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 16px; }
.center { text-align:center; }
.seo-box { margin-top: 14px; }

/* Mini callout (subtle, integrated hint) */
.mini-callout { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 12px; box-shadow: none; margin-top: 14px; }
.mini-callout .icon { color: #64748b; }

/* Tables */
.table-responsive { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.table thead th { text-align: left; font-weight: 700; color: #0b1324; background: var(--surface-2); border-bottom: 1px solid var(--border); padding: 10px 14px; }
.table tbody td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tbody tr:hover { background: #fafafa; }
.table tbody tr:nth-child(even) { background: #fcfcfd; }
.table .nowrap { white-space: nowrap; }
.table .small { font-size: 12px; }
.table .comment-snippet { max-width: 72ch; }
.table.table-ratings .col-number { width: 34%; min-width: 220px; }
.table.table-ratings .col-comment { width: auto; }
.table.table-ratings .col-date { width: 120px; text-align: right; color: #0b1324; }

/* Grid lines variant */
.table-grid thead th + th { border-left: 1px solid var(--border); }
.table-grid tbody td + td { border-left: 1px solid var(--border); }
.table thead th { text-transform: uppercase; letter-spacing: .02em; font-size: 12px; }
.table-sticky thead th { position: sticky; top: 0; z-index: 2; }

@media (max-width: 680px) {
  .table.table-ratings .col-date { text-align: left; }
}

/* Country header */
.country-hero { display:flex; gap:14px; align-items:center; margin-bottom: 12px; }
.country-hero .flag-wrap { display:grid; place-items:center; }

/* Number cell */
.numcell { display:flex; flex-direction: column; gap: 6px; }
.numline { display:flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.phone-link { font-weight: 700; color: #0b1324; letter-spacing: 0.02em; }
.meta { display:flex; gap: 8px; align-items: center; color: var(--muted); }
.rating-badge { display:inline-flex; align-items:center; gap:6px; padding: 2px 6px; border-radius: 8px; border:1px solid var(--border); background: #fff7ed; color: #9a3412; font-size: 12px; font-weight: 800; }
.dot { width: 8px; height: 8px; border-radius: 999px; background: #cbd5e1; display:inline-block; }
.dot--scam { background: #ef4444; }
.dot--spam { background: #f59e0b; }
.dot--telemarketing { background: #fb923c; }
.dot--debt-collector { background: #6366f1; }
.dot--unknown { background: #94a3b8; }

/* Icons */
.icon { width: 16px; height: 16px; display:inline-block; vertical-align: middle; color: #64748b; }
.icon + .phone { margin-left: 4px; }
.icon--scam, .icon--fraud, .icon--caution, .icon--annoying { color: #ef4444; }
.icon--spam { color: #f59e0b; }
.icon--telemarketing, .icon--marketing, .icon--robocall, .icon--advertising, .icon--survey, .icon--market-research { color: #fb923c; }
.icon--debt-collector, .icon--collector { color: #6366f1; }
.icon--customer-service, .icon--service, .icon--company { color: #3b82f6; }
.icon--silent-call { color: #94a3b8; }
.icon--unknown, .icon--other, .icon--unbekannt, .icon--default { color: #94a3b8; }

/* Tags (caller type) */
.tag { display:inline-flex; align-items:center; gap:6px; padding: 4px 8px; border-radius: 999px; border:1px solid var(--border); background: var(--surface-2); font-size: 12px; font-weight: 700; color: #0b1324; }
.tag--scam, .tag--fraud, .tag--betruger, .tag--betruger, .tag--betrugerisch { background: #fee2e2; border-color: #fecaca; color: #991b1b; }
.tag--spam { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.tag--telemarketing, .tag--marketing, .tag--robocall, .tag--market-research { background: #fff7ed; border-color: #fed7aa; color: #9a3412; }
.tag--debt-collector, .tag--collector { background: #e0e7ff; border-color: #c7d2fe; color: #3730a3; }
.tag--caution, .tag--annoying { background: #fef9c3; border-color: #fde68a; color: #854d0e; }
.tag--unknown, .tag--unbekannt, .tag--other { background: #f1f5f9; border-color: #e2e8f0; color: #0f172a; }

/* Clamp long comments */
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* Table card */
.table-card { border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); background: #fff; }
.table-header { display:flex; align-items:center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.table-title { font-weight: 700; color: #0b1324; }
.table-actions { display:flex; align-items:center; gap: 8px; }
.table-subheader { padding: 6px 14px; border-bottom: 1px solid var(--border); }

/* Chips */
.chips { display:flex; gap: 6px; flex-wrap: wrap; }
.chip { display:inline-flex; align-items:center; gap:6px; padding: 6px 10px; border:1px solid var(--border); border-radius: 999px; background: #fff; color:#0b1324; font-weight: 600; font-size: 12px; text-decoration: none; }
.chip:hover { background: var(--surface-2); }
.chip--active { background: #eef2ff; border-color: #e0e7ff; }
.chip--scam { border-color: #fecaca; background: #fee2e2; }
.chip--spam { border-color: #fde68a; background: #fef3c7; }
.chip--telemarketing { border-color: #fed7aa; background: #fff7ed; }
.chip--debt-collector { border-color: #c7d2fe; background: #e0e7ff; }
.chip--unknown { border-color: #e2e8f0; background: #f1f5f9; }
/* Click-to-copy affordances */
.copyable, .chip[data-code] { cursor: pointer; }
.copy-toast { margin-left: 6px; font-size: 12px; color: var(--muted); opacity: 0; transition: opacity .15s ease; }
.copy-toast.show { opacity: 1; }

/* View toggle */
.view-toggle .toggle { display:inline-flex; align-items:center; gap:6px; padding: 6px 10px; border:1px solid var(--border); border-radius: 10px; color:#0b1324; text-decoration:none; background:#fff; font-weight:600; }
.view-toggle .toggle.is-active { background:#eef2ff; border-color:#e0e7ff; }

/* Entry cards */
.entry-list { display: grid; gap: 12px; padding: 10px 12px; }
.entry-card { border:1px solid var(--border); border-left-width: 6px; border-radius: 12px; background:#fff; box-shadow: var(--shadow); }
.entry-card .entry-head { display:flex; align-items:center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px dashed var(--border); }
.entry-card .entry-left { display:flex; gap: 8px; align-items:center; flex-wrap: wrap; }
.entry-card .entry-right { display:flex; gap: 10px; align-items:center; }
.entry-card .entry-body { padding: 10px 12px; }
/* Rating label under shield */
.rating-label { margin-top: 6px; font-weight: 700; color: var(--text); }

/* Breadcrumbs */
.breadcrumbs { display:flex; align-items:center; gap:8px; margin:8px 0; font-size: 14px; color: var(--muted); }
.breadcrumbs__link { color: var(--muted); font-weight:600; text-decoration:none; }
.breadcrumbs__link:hover { text-decoration: underline; }
.breadcrumbs__sep { color: #94a3b8; }
.breadcrumbs__current { color: var(--muted); font-weight: 600; }

/* Headings */
h1 { margin: 8px 0 10px; font-size: clamp(22px, 4.5vw, 28px); line-height: 1.2; letter-spacing: -0.01em; }
/* Centered title for messages page */
.messages-title { text-align: center; }

.entry-card.type--scam { border-left-color: #ef4444; }
.entry-card.type--spam { border-left-color: #f59e0b; }
.entry-card.type--telemarketing { border-left-color: #fb923c; }
.entry-card.type--debt-collector { border-left-color: #6366f1; }
.entry-card.type--unknown { border-left-color: #94a3b8; }
.entry-card.type--default { border-left-color: #cbd5e1; }

/* A11y helpers */
.visually-hidden { position:absolute !important; clip: rect(1px, 1px, 1px, 1px); padding:0 !important; border:0 !important; height:1px !important; width:1px !important; overflow:hidden; }

@media (min-width: 900px) {
  .hero .inner { padding: 64px 0 36px; }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  /* Stack 2-col grids to single column */
  .grid-2 { grid-template-columns: 1fr; }
  /* Add side breathing room to cards to match entry-list look */
  .card { margin-left: 12px; margin-right: 12px; }
  /* Match headings to card inset */
  h1, h2, h3 { margin-left: 12px; margin-right: 12px; }
  /* Breadcrumbs inset aligns with cards and smaller size */
  .breadcrumbs { margin-left: 12px; margin-right: 12px; font-size: 12px; }
  /* Summary fields stack label above value for readability */
  .summary-card .summary-fields .row { flex-direction: column; align-items: flex-start; gap: 2px; margin-bottom: 6px; }
  .summary-card .summary-fields .row strong { font-size: 12px; color: var(--muted); }
  .summary-card .summary-fields .row a { display: inline-block; }

  /* Bars: put label + count on first row, bar track on second row spanning */
  .bar { grid-template-columns: minmax(0, 1fr) auto; }
  .bar .bar-track { grid-column: 1 / -1; }
  .bar .bar-label { max-width: 100%; }

  /* Entry cards: stack header elements */
  .entry-card .entry-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .entry-card .entry-right { width: 100%; justify-content: flex-start; flex-wrap: wrap; gap: 6px; }
}

@media (max-width: 820px) {
  /* Header mobile nav */
  .nav-toggle { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: #fff; color: #0b1324; font-weight: 600; cursor: pointer; }
  .nav-toggle svg { width: 18px; height: 18px; }
  .site-header .bar { position: relative; }
  .site-header .nav { position: absolute; top: 100%; right: 18px; left: 18px; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); padding: 8px; display: none; flex-direction: column; gap: 4px; }
  .site-header.is-open .nav { display: flex; }
  /* Slightly more breathing room for brand and toggle */
  .site-header .container { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 480px) {
  /* Tighter padding on very small screens */
  .container { padding: 0 18px; }
  /* Optionally hide breadcrumbs on very small screens */
  .breadcrumbs { display: none; }
}

/* Number summary header (no card look, centered) */
.number-summary { display: flex; flex-direction: column; align-items: center; margin: 20px 0 22px; }
.summary-row { display:flex; align-items:center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; }
.summary-left { display:flex; align-items:center; gap: 10px; }
.summary-meta { display:flex; flex-direction: column; gap: 2px; }
.summary-number { display:flex; align-items:center; gap: 10px; flex-wrap: wrap; }
/* Larger flag and number for emphasis */
.number-summary .flag { width: 40px; height: 40px; }
.summary-number strong { font-size: clamp(28px, 6vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
/* Copy button: icon-only, no border, no hover background */
.summary-number .btn-copy { padding: 6px; border-color: transparent; background: transparent; box-shadow: none; }
.summary-number .btn-copy:hover { background: transparent; }
.summary-number .btn-copy .icon { width: 22px; height: 22px; }
.summary-actions { display:flex; align-items:center; gap: 8px; }
.summary-actions .more-link { white-space: nowrap; }
.summary-stats { display:flex; align-items:center; justify-content: center; gap: 12px; flex-wrap: wrap; color: var(--muted); padding: 0 6px; }
.summary-last { margin-top: 6px; color: var(--muted); }
.stat { display:inline-flex; align-items:center; gap: 6px; }
.icon { width: 16px; height: 16px; }
.number-summary .spinner, .messages-toolbar .spinner, .spinner { display:none; }

@media (max-width: 820px) {
  .number-summary { margin-left: 0; margin-right: 0; }
  .summary-row { padding: 8px 0; }
}

/* Messages toolbar just above the list */
.messages-toolbar { margin: 14px 0 8px; display: grid; gap: 8px; }
.messages-toolbar .center { display:flex; justify-content:center; }
.messages-toolbar .right { display:flex; justify-content:flex-end; font-size: 12px; color: var(--muted); padding: 0 6px; }

/* More numbers CTA below list */
.more-numbers-actions { display:flex; justify-content:center; margin: 10px 0 14px; }

/* Notice / callout */
.notice { border: 1px solid var(--border); border-radius: 12px; background: #eef2ff; padding: 12px 14px; box-shadow: var(--shadow); }
.notice .title { font-weight: 700; color: #0b1324; }
.notice p { margin: 6px 0; }
.notice .actions { margin-top: 8px; display:flex; gap:8px; }
