:root {
  --shell: #f7f4ee;
  --card: #fffdf9;
  --ink: #1c1a17;
  --muted: #6d6a63;
  --accent: #d46a3a;
  --accent-dark: #b45a31;
  --border: #e7e2d8;
  --green: #2e7d4f;
  --header-bg: #f7f4ee;
  --header-text: #1c1a17;
  --footer-bg: #f1ede3;
  --footer-text: #1c1a17;
  --font-heading: "Space Grotesk", "Segoe UI", sans-serif;
  --font-body: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--shell);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

main, header, footer { position: relative; z-index: 2; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-dark); }

/* ---------- Nav ---------- */
header {
  border-bottom: 1px solid var(--border);
  background: var(--header-bg);
  color: var(--header-text);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.header-static { position: static; }
header.header-borderless { border-bottom: 0; }

.header-custom { max-width: 76rem; margin: 0 auto; padding: 0 1.5rem 0.7rem; font-size: 0.8rem; color: var(--muted); }

.nav.nav-compact { padding-top: 0.55rem; padding-bottom: 0.55rem; }
.nav.nav-spacious { padding-top: 1.35rem; padding-bottom: 1.35rem; }

.nav {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--header-text);
}

.brand:hover { color: var(--header-text); }

.brand .logo {
  display: grid;
  place-items: center;
  line-height: 0;
  transition: transform 0.2s ease;
}

.brand .logo img { display: block; }

.brand:hover .logo { transform: rotate(-4deg) scale(1.04); }

.brand-name { white-space: nowrap; }
.brand-name em {
  font-style: normal;
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
}

.nav-links a:hover { color: var(--header-text); }
.nav-links a.active { color: var(--accent-dark); font-weight: 700; }

.nav-cta {
  background: var(--accent);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  transition: all 0.18s ease;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--accent) 45%, transparent);
}

.nav-cta:hover { color: #fff; background: var(--accent-dark); transform: translateY(-1px); }

.nav-cta-outline {
  background: transparent;
  color: var(--accent-dark);
  border: 1.5px solid var(--accent);
  box-shadow: none;
}

.nav-cta-outline:hover { background: var(--accent); color: #fff; }

.nav-cta-ghost {
  background: transparent;
  color: var(--accent-dark);
  box-shadow: none;
}

.nav-cta-ghost:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-dark); transform: none; }

.nav-actions { display: flex; align-items: center; gap: 0.5rem; flex: none; }

.dropdown { position: relative; }

/* invisible hover bridge so the pointer can cross the gap without closing the menu */
.dropdown::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -0.35rem;
  right: -0.35rem;
  height: 1rem;
}

.drop-btn {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.dropdown:hover .drop-btn, .drop-btn:focus { color: var(--header-text); }

.drop-menu {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.5rem;
  min-width: 220px;
  box-shadow: 0 16px 40px -16px rgba(28, 26, 23, 0.25);
  display: none;
  flex-direction: column;
}

.dropdown:hover .drop-menu, .dropdown:focus-within .drop-menu { display: flex; }

.drop-menu a { padding: 0.55rem 0.75rem; border-radius: 10px; font-size: 0.88rem; color: var(--ink); }
.drop-menu a:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); color: var(--accent-dark); }

@media (max-width: 900px) {
  .nav-links { display: none; }
}

@media (max-width: 460px) {
  .nav { padding: 0.9rem 1rem; }
  .nav-cta { font-size: 0.74rem; padding: 0.5rem 0.7rem; }
}

@media (max-width: 380px) {
  .brand-name { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  max-width: 56rem;
  margin: 0 auto;
  padding: 5rem 1.5rem 3rem;
  text-align: center;
}

.hero h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 2.25rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-variation-settings: "opsz" 144;
  text-wrap: balance;
  max-width: 22ch;
  margin: 0 auto;
}

.hero .tagline {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 500;
  font-size: 1.125rem;
  color: var(--accent);
  margin-top: 1.25rem;
}

.hero .description {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.7;
  max-width: 36rem;
  margin: 1rem auto 0;
}

.hero .description a { color: var(--accent-dark); text-decoration: underline; }

.hero-compact { padding: 3.5rem 1.5rem 2rem; }
.hero-compact h1 { font-size: 1.9rem; }

@media (min-width: 640px) {
  .hero { padding: 7rem 1.5rem 4rem; }
  .hero h1 { font-size: 3rem; }
  .hero .tagline { font-size: 1.25rem; margin-top: 1.5rem; }
  .hero .description { font-size: 1.0625rem; margin-top: 1.25rem; }
  .hero-compact h1 { font-size: 2.25rem; }
}

/* ---------- Home hero ---------- */
.home-top {
  background:
    radial-gradient(55rem 34rem at 6% 0%, rgba(245, 225, 201, 0.72), transparent 62%),
    radial-gradient(48rem 32rem at 96% 88%, rgba(209, 233, 217, 0.6), transparent 62%),
    #fdf9f3;
}

.hero-home {
  max-width: 56rem;
  margin: 0 auto;
  padding: 4.25rem 1.5rem 2.5rem;
  text-align: center;
}

.hero-home h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(2.5rem, 5.4vw, 3.9rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  max-width: 20ch;
  margin: 0 auto;
  text-wrap: balance;
}

.hero-home .tagline {
  font-family: var(--font-body);
  font-style: normal;
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 40rem;
  margin: 1.15rem auto 0;
}

.hero-home .description {
  max-width: 40rem;
  margin: 1rem auto 0;
  text-align: center;
}

.home-top #calculator { padding-top: 0.5rem; padding-bottom: 4rem; }

@media (max-width: 520px) {
  .hero-home { padding: 3rem 1.25rem 2rem; }
  .hero-home h1 { font-size: clamp(2.25rem, 9vw, 2.9rem); }
  .hero-home .tagline { font-size: 1rem; }
}

/* ---------- Search ---------- */
.hero-search { max-width: 34rem; margin: 2rem auto 0; }

.searchbar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 0.5rem 0.5rem 1.1rem;
  box-shadow: 0 12px 32px -16px rgba(28, 26, 23, 0.25);
  transition: box-shadow 0.2s ease;
}

.searchbar:focus-within { box-shadow: 0 16px 40px -16px rgba(212, 106, 58, 0.35); }

.searchbar svg { color: var(--muted); flex-shrink: 0; }

.searchbar input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  min-width: 0;
}

.searchbar button {
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.3rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.searchbar button:hover { background: var(--accent-dark); }

.suggest {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 48px -16px rgba(28, 26, 23, 0.3);
  overflow: hidden;
  z-index: 20;
  text-align: left;
}

.suggest a {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 1.1rem;
  font-size: 0.92rem;
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}

.suggest a:last-child { border-bottom: none; }
.suggest a:hover { background: #faf7f0; color: var(--accent-dark); }

.suggest .s-type { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); flex-shrink: 0; }
.suggest .s-extra { color: var(--muted); font-size: 0.8rem; }

/* ---------- Sections ---------- */
section { padding: 3.5rem 1.5rem; }

.section-head {
  text-align: center;
  max-width: 42rem;
  margin: 0 auto 2.5rem;
}

.section-head h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.75rem;
  letter-spacing: -0.015em;
}

.section-head p {
  color: var(--muted);
  margin-top: 0.75rem;
  line-height: 1.65;
  font-size: 0.95rem;
}

.group-h {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.3rem;
  max-width: 62rem;
  margin: 2.5rem auto 1rem;
}

.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }

/* ---------- Cards & grids ---------- */
.cards {
  max-width: 62rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}

.card-link { display: block; }
.card-link:hover { color: var(--ink); }

.card {
  height: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.4rem;
  transition: all 0.18s ease;
}

.card-link:hover .card {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px -14px rgba(28, 26, 23, 0.25);
  border-color: #d8d2c5;
}

.card h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.45rem;
  color: var(--ink);
}

.card p { color: var(--muted); font-size: 0.88rem; line-height: 1.55; }

.card-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(212, 106, 58, 0.1);
  display: grid;
  place-items: center;
  margin-bottom: 0.8rem;
}

.style-icon svg { transition: transform 0.2s ease; }
.card-link:hover .style-icon svg { transform: scale(1.12) rotate(-5deg); }

.card-icon.brand-icon { background: transparent; }
.card-icon.pizza-icon svg,
.card-icon.brand-icon svg { transition: transform 0.2s ease; }
.card-link:hover .card-icon.pizza-icon svg { transform: scale(1.14) rotate(-5deg); }
.card-link:hover .card-icon.brand-icon svg { transform: scale(1.1); }

.city-logo {
  position: relative;
  overflow: hidden;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 0.8rem;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, hsl(var(--h) 30% 42%), hsl(calc(var(--h) + 20) 34% 30%));
  box-shadow: 0 5px 12px -6px hsl(var(--h) 30% 25% / 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.city-logo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
  padding: 3px;
}

.city-logo img.city-emblem {
  background: transparent;
  padding: 0;
}

.card-link:hover .city-logo {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 16px -6px hsl(var(--h) 40% 30% / 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.card-meta { font-size: 0.82rem !important; margin-top: 0.3rem; }
.card-meta strong { color: var(--ink); }

.card-more {
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--accent-dark);
  border-style: dashed;
  min-height: 100%;
}

.state-grid {
  max-width: 62rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.state-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.32rem 0.85rem 0.32rem 0.32rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.15s ease;
}

.state-flag {
  position: relative;
  width: 28px;
  height: 20px;
  flex: none;
  border-radius: 5px;
  overflow: hidden;
  background: #f0e9db;
  box-shadow: 0 1px 3px rgba(28, 26, 23, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.state-flag img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.state-flag .state-abbrev {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--accent-dark);
}

.state-name { font-size: 0.85rem; }

.state-chip:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -6px rgba(28, 26, 23, 0.2); color: var(--accent-dark); }

.link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1.5rem;
}

.pill {
  display: inline-block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--ink);
  transition: all 0.15s ease;
}

a.pill:hover { color: var(--accent-dark); border-color: var(--accent); transform: translateY(-1px); }

.pill-danger { color: #b3261e; background: none; }
.pill-danger:hover { color: #8f1d17; border-color: #b3261e; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 999px;
  padding: 0.16rem 0.55rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}

.badge.estimated { background: rgba(212, 106, 58, 0.12); color: var(--accent-dark); }
.badge.verified { background: rgba(46, 125, 79, 0.12); color: var(--green); }

/* ---------- Detail pages ---------- */
.breadcrumbs {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.1rem 1.5rem 0;
}

.breadcrumbs ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent-dark); }
.breadcrumbs .sep { color: #c9c3b6; }

.detail-hero {
  max-width: 56rem;
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
  text-align: center;
}

.detail-hero h1 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 2.1rem;
  line-height: 1.08;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.detail-hero .lead {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
  max-width: 36rem;
  margin: 0.9rem auto 0;
}

.detail-body {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 860px) {
  .detail-body { grid-template-columns: 1fr; }
}

.detail-main {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.05), 0 16px 40px -24px rgba(28, 26, 23, 0.2);
}

.prose .big { font-size: 1.05rem; line-height: 1.7; margin-bottom: 1.5rem; }
.prose h2 {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.3rem;
  margin: 2rem 0 0.6rem;
}
.prose p { color: var(--muted); line-height: 1.7; font-size: 0.95rem; margin-bottom: 0.75rem; }
.prose a { color: var(--accent-dark); }
.prose ul { margin: 0 0 1rem 1.2rem; display: grid; gap: 0.45rem; }
.prose li { color: var(--muted); line-height: 1.6; font-size: 0.95rem; }
.prose em { color: var(--ink); }

.info-prose { max-width: 46rem; margin: 0 auto; }
.home-prose { max-width: 46rem; margin: 0 auto; }
.info-prose .btn.info-btn { display: inline-block; margin-top: 0.4rem; }

.detail-aside { position: sticky; top: 90px; display: grid; gap: 1rem; }

.aside-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.4rem;
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.05), 0 12px 30px -20px rgba(28, 26, 23, 0.25);
}

.aside-card h4 { font-family: var(--font-heading); font-weight: 600; font-size: 1.05rem; margin-bottom: 0.5rem; }
.aside-card p { font-size: 0.88rem; line-height: 1.55; }

.stat-big {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 2rem;
  color: var(--accent-dark);
  margin: 0.3rem 0;
}

.stat-big small { font-family: var(--font-body); font-size: 0.9rem; color: var(--muted); }

.btn {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 12px;
  padding: 0.7rem 1rem;
  margin-top: 0.75rem;
  transition: all 0.18s ease;
  box-shadow: 0 4px 14px -4px rgba(212, 106, 58, 0.5);
}

.btn:hover { color: #fff; background: var(--accent-dark); transform: translateY(-1px); }

.btn-ghost { background: transparent; color: var(--accent-dark); border: 1px solid var(--border); box-shadow: none; }
.btn-ghost:hover { background: #faf7f0; color: var(--accent-dark); }

/* ---------- Tables ---------- */
.spec-table {
  display: grid;
  gap: 0.5rem;
  margin: 1.5rem 0;
}

.spec {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  background: #faf7f0;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.9rem;
}

.spec span { color: var(--muted); font-weight: 600; font-size: 0.82rem; }
@media (max-width: 560px) { .spec { grid-template-columns: 1fr; gap: 0.2rem; } }

.table-wrap {
  max-width: 46rem;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  overflow-x: auto;
  box-shadow: 0 1px 2px rgba(28, 26, 23, 0.05), 0 16px 40px -24px rgba(28, 26, 23, 0.2);
}

.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

.data-table thead th {
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: #faf7f0;
}

.data-table tbody td {
  padding: 0.85rem 1.2rem;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  vertical-align: top;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table td strong { font-family: var(--font-heading); font-size: 1.05rem; }

/* ---------- Calculator ---------- */
.calc-card {
  max-width: 40rem;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #f1e2d4;
  border-radius: 18px;
  padding: 2rem 2.25rem 2.25rem;
  box-shadow: 0 1px 2px rgba(90, 55, 25, 0.05), 0 28px 64px -34px rgba(90, 55, 25, 0.4);
}

.calc-card h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.5rem;
  letter-spacing: -0.01em;
  margin-bottom: 0.3rem;
}

.detail-main .state-calc {
  margin: 2.75rem 0 0;
  max-width: 100%;
}

.calc-note { color: var(--muted); font-size: 0.82rem; margin-bottom: 1.6rem; }

.field { margin-bottom: 1.4rem; }

.field > .label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.55rem;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(5.4rem, 1fr));
  gap: 0.55rem;
}

.segmented button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.12rem;
  min-height: 3.4rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  padding: 0.65rem 0.55rem;
  border-radius: 10px;
  border: 1px solid #ecdfd1;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.18s ease;
}

.segmented button:hover {
  border-color: #d9c4b0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(28, 26, 23, 0.18);
}

.segmented button:active { transform: scale(0.97); }

.segmented button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 5px 16px -4px rgba(212, 106, 58, 0.45);
}

.seg-sub { font-size: 0.78rem; font-weight: 500; color: var(--muted); }
.segmented button.active .seg-sub { color: rgba(255, 255, 255, 0.82); }

.sub-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.35rem 0 0.55rem;
}

.chips {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
}

.chip { display: flex; min-width: 0; }

.chip input { position: absolute; opacity: 0; pointer-events: none; }

.chip span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  padding: 0.72rem 0.85rem;
  border-radius: 10px;
  border: 1px solid #ecdfd1;
  background: #fff;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.chip span:hover {
  border-color: #d9c4b0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(28, 26, 23, 0.15);
}

.chip span em { font-style: normal; color: var(--muted); font-size: 0.78rem; margin-left: auto; }

.chip input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 5px 16px -4px rgba(212, 106, 58, 0.45);
  animation: pop 0.3s ease;
}

.chip input:checked + span em { color: rgba(255, 255, 255, 0.82); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 560px) {
  .chips { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.slices-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

.slices-row input[type="number"] {
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  width: 6.5rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid #ecdfd1;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  text-align: center;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.slices-row input[type="number"]:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.slices-hint { font-size: 0.82rem; color: var(--muted); }

.input {
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.input { resize: vertical; }

.select {
  font-family: inherit;
  font-size: 0.95rem;
  width: 100%;
  padding: 0.85rem 0.9rem;
  border: 1px solid #ecdfd1;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  appearance: auto;
}

.calc-btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
  margin-top: 0.5rem;
  box-shadow: 0 6px 18px -6px rgba(212, 106, 58, 0.5);
}

.calc-btn:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -6px rgba(212, 106, 58, 0.55);
}

.calc-btn:active { transform: scale(0.98); }

.results {
  margin-top: 2rem;
  border-top: 1px dashed var(--border);
  padding-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.results:empty { display: none; }

.stat {
  background: #faf7f0;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(28, 26, 23, 0.18);
}

.stat .stat-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.stat .stat-value {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
}

.stat .stat-value small { font-family: var(--font-body); font-size: 0.85rem; font-weight: 500; color: var(--muted); }

.stat.macros { grid-column: span 2; }

.stat.macros .macro-row { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 0.4rem; font-size: 0.92rem; }
.stat.macros .macro-row strong { font-weight: 700; }
.stat.macros .macro-row span { color: var(--muted); }

.results-note { grid-column: span 2; font-size: 0.78rem; color: var(--muted); line-height: 1.5; }

.results > * { animation: fadeUp 0.45s ease backwards; }
.results > *:nth-child(1) { animation-delay: 0s; }
.results > *:nth-child(2) { animation-delay: 0.06s; }
.results > *:nth-child(3) { animation-delay: 0.12s; }
.results > *:nth-child(4) { animation-delay: 0.18s; }
.results > *:nth-child(5) { animation-delay: 0.24s; }
.results > *:nth-child(6) { animation-delay: 0.3s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.07); }
  100% { transform: scale(1); }
}

@media (max-width: 520px) {
  .calc-card { padding: 1.5rem 1.25rem; }
  .results { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .stat .stat-value { font-size: 1.3rem; }
}

/* ---------- Finder ---------- */
.filter-row {
  max-width: 46rem;
  margin: 0 auto 2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.filter-btn {
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.18s ease;
}

.filter-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px -4px rgba(28, 26, 23, 0.18); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 5px 16px -4px rgba(212, 106, 58, 0.45); }

.finder-item.hidden { display: none; }

/* ---------- Comparison table ---------- */
.cmp-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 1.5rem; }
.cmp-table th, .cmp-table td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); text-align: left; }
.cmp-table thead th { background: #faf7f0; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cmp-table td:first-child { color: var(--muted); font-weight: 600; }
.cmp-table th:not(:first-child), .cmp-table td:not(:first-child) { font-variant-numeric: tabular-nums; }

/* ---------- FAQ ---------- */
.faq-section { background: rgba(255, 253, 249, 0.55); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }

.faq { max-width: 44rem; margin: 0 auto; display: grid; gap: 0.8rem; }

.faq details {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.05rem 1.3rem;
}

.faq summary {
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  font-family: var(--font-heading);
  font-size: 1.3rem;
  color: var(--accent);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}

.faq details[open] summary::after { transform: rotate(45deg); }

.faq details p { color: var(--muted); font-size: 0.9rem; line-height: 1.65; margin-top: 0.75rem; }

/* ---------- Alerts ---------- */
.alert {
  background: rgba(179, 38, 30, 0.08);
  border: 1px solid rgba(179, 38, 30, 0.3);
  color: #8f1d17;
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.ok {
  background: rgba(46, 125, 79, 0.08);
  border: 1px solid rgba(46, 125, 79, 0.3);
  color: var(--green);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* ---------- Footer ---------- */
footer {
  background: var(--footer-bg);
  color: var(--footer-text);
  border-top: 1px solid var(--border);
  padding: 3.5rem 1.5rem 2rem;
}

footer .brand, footer .brand:hover { color: var(--footer-text); }

.footer-inner {
  max-width: 72rem;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr repeat(var(--footer-cols, 4), 1fr);
  gap: 1.5rem;
}

.footer-inner.footer-solo { grid-template-columns: 1fr; }

.footer-custom { max-width: 72rem; margin: 2rem auto 0; font-size: 0.85rem; line-height: 1.7; }

.footer-brand p { color: inherit; opacity: 0.72; font-size: 0.88rem; line-height: 1.65; margin-top: 0.9rem; max-width: 18rem; }
.footer-brand .footer-domain { margin-top: 0.5rem; }
.footer-brand .footer-domain a { color: var(--accent); font-weight: 700; }
.footer-bottom a { color: var(--accent); }

.footer-col h5 {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: inherit;
  opacity: 0.62;
  margin-bottom: 0.9rem;
}

.footer-col a { display: block; font-size: 0.88rem; color: inherit; padding: 0.3rem 0; opacity: 0.8; }
.footer-col a:hover { opacity: 1; color: var(--accent); }

.footer-bottom {
  max-width: 72rem;
  margin: 2.5rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  font-size: 0.8rem;
  color: inherit;
  opacity: 0.7;
}

@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: auto; }
}

/* ---------- Restaurant city branches ---------- */
.branches { margin-top: 2.75rem; }
.branch-search {
  background: rgba(212, 106, 58, 0.06);
  border: 1px solid rgba(212, 106, 58, 0.18);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1.25rem;
}
.branch-search label { display: block; font-weight: 700; font-size: 0.85rem; margin-bottom: 0.45rem; }
.branch-search-row { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.branch-search-row input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 0.62rem 0.8rem;
  border: 1px solid #d8cfbf;
  border-radius: 10px;
  background: #fff;
  font: inherit;
  color: inherit;
}
.branch-search-row input:focus { outline: 2px solid rgba(212, 106, 58, 0.45); outline-offset: 1px; }
.branch-search-row .btn { margin-top: 0; padding: 0.6rem 1.1rem; }
.branches-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.branch-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.branch-head { display: flex; align-items: center; gap: 0.65rem; }
.branch-head .city-logo { width: 38px; height: 38px; flex: 0 0 38px; font-size: 0.6rem; }
.branch-title h4 { margin: 0; font-size: 1rem; }
.branch-state { margin: 0.1rem 0 0; font-size: 0.78rem; color: var(--muted); }
.branch-meta { margin: 0; font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
.branch-actions { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; margin-top: auto; }
.branch-actions .btn { margin-top: 0; padding: 0.45rem 0.9rem; font-size: 0.82rem; box-shadow: none; }
.branch-link { font-size: 0.8rem; font-weight: 600; color: var(--accent-dark); text-decoration: none; }
.branch-link:hover { text-decoration: underline; }
.branch-map { margin-top: 0.25rem; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); }
.branch-map iframe { display: block; width: 100%; height: 230px; border: 0; }

/* Cookie / advertising consent */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  padding: 0.9rem clamp(1rem, 4vw, 3rem) calc(0.9rem + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 30px rgba(28, 26, 23, 0.12);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: space-between;
}
.cookie-banner p {
  margin: 0;
  max-width: 62ch;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--muted);
}
.cookie-banner p strong { color: var(--ink); }
.cookie-banner p a { color: var(--accent-dark); }
.cookie-banner-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.cookie-banner-actions .btn { margin-top: 0; }
.footer-cookie {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
}
.footer-cookie:hover { color: var(--accent-dark); }
@media (max-width: 620px) {
  .cookie-banner { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
  .cookie-banner-actions { width: 100%; }
  .cookie-banner-actions .btn { flex: 1 1 auto; }
}

/* Editorial trust blocks, sources and methodology */
.content-meta {
  margin-top: 2.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 0.5rem;
}
.content-meta p { margin: 0; }
.content-updated {
  font-size: 0.82rem;
  color: var(--muted);
  margin: 1rem 0 0;
}
.content-updated strong { color: var(--ink); }
.content-review { font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.content-sources { margin-top: 0.75rem; }
.content-sources h2 {
  font-family: var(--font-head);
  font-size: 1.05rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.content-sources ul { margin: 0 0 0.5rem 1.1rem; display: grid; gap: 0.35rem; }
.content-sources li { font-size: 0.88rem; color: var(--muted); line-height: 1.55; }
.content-sources a { color: var(--accent-dark); }
.formula {
  font-family: var(--font-head);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.9rem;
  font-size: 0.95rem;
  color: var(--ink);
  display: inline-block;
}

/* ---------- Responsive data tables ---------- */
@media (max-width: 640px) {
  .data-table,
  .cmp-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .data-table thead th,
  .data-table tbody td {
    padding: 0.6rem 0.75rem;
    white-space: nowrap;
  }
}
