/* SIM Only Sale. Colours are tokens so light and dark mode stay in step. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #eef1f4;
  --text: #111827;
  --muted: #4b5563;
  --border: #d9dee5;
  --primary: #0f766e;
  --primary-hover: #115e59;
  --on-primary: #ffffff;
  --accent: #b45309;
  --accent-bg: #fef3c7;
  --badge-bg: #ccfbf1;
  --badge-text: #134e4a;
  --focus: #2563eb;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(17 24 39 / 6%), 0 2px 8px rgb(17 24 39 / 4%);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1120;
    --surface: #151d2e;
    --surface-2: #1e293b;
    --text: #f1f5f9;
    --muted: #a7b2c3;
    --border: #2c3a50;
    --primary: #2dd4bf;
    --primary-hover: #5eead4;
    --on-primary: #042f2e;
    --accent: #fbbf24;
    --accent-bg: #3a2a07;
    --badge-bg: #134e4a;
    --badge-text: #ccfbf1;
    --focus: #93c5fd;
    --shadow: none;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--primary); text-underline-offset: 2px; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: 1.35rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; z-index: 40; display: inline-flex; align-items: center; min-height: 44px; background: var(--surface); padding: 0 14px; border-radius: 8px; }

.sample-banner {
  background: var(--accent-bg);
  color: var(--text);
  border-bottom: 2px solid var(--accent);
  padding: 10px 16px;
  text-align: center;
  font-size: .95rem;
}

.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;
}

/* Header: stays at the top while scrolling. --header-h keeps sticky
   filters and #anchor jumps clear of it. */
:root { --header-h: 116px; }
@media (min-width: 1100px) { :root { --header-h: 72px; } }
html { scroll-padding-top: calc(var(--header-h) + 8px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner {
  display: grid; align-items: center; gap: 8px 12px;
  grid-template-columns: 1fr auto auto;
  grid-template-areas: "logo chat cta" "nav nav nav";
  padding-top: 10px; padding-bottom: 8px;
}
.logo { grid-area: logo; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 900; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--text); text-decoration: none; }
/* "SALE" as a yellow sticker, so the name reads as a logo, not a menu link.
   Fixed colours: dark on yellow is 10:1 in every theme and mode. */
.logo-tag {
  display: inline-block; padding: 3px 7px 2px; border-radius: 6px;
  background: #fbbf24; color: #111827;
  font-size: .78rem; font-weight: 900; letter-spacing: .08em; line-height: 1.2; text-transform: uppercase;
  transform: rotate(-4deg);
}
.logo:hover { color: var(--text); }
.logo-mark { width: 28px; height: 28px; color: var(--primary); }
.logo-chip { fill: var(--surface); }
.main-nav { grid-area: nav; display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 8px; text-decoration: none; color: var(--muted); font-weight: 600; }
.main-nav a:hover { background: var(--surface-2); color: var(--text); }
.main-nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }
.main-nav a { white-space: nowrap; }
/* Computers: a thin line between the logo and the menu. */
@media (min-width: 1100px) {
  .main-nav { border-left: 1px solid var(--border); padding-left: 8px; }
}
/* Narrow computer screens: slimmer menu links so everything fits on one line. */
@media (min-width: 1100px) and (max-width: 1219px) {
  .main-nav a { padding: 0 8px; }
}
/* Phones: the menu stays on one line and scrolls sideways, so the fixed
   header keeps its height (--header-h). */
@media (max-width: 599px) {
  .main-nav {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0;
    /* The fade hints that more links are a swipe away; the padding lets the
       last link scroll clear of it. */
    padding-right: 40px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { padding: 0 10px; flex-shrink: 0; }
}
.header-search { grid-area: search; display: none; }
.logo, .logo span { white-space: nowrap; }
.logo-mark { flex-shrink: 0; }
.header-chat { grid-area: chat; gap: 8px; white-space: nowrap; }
.header-chat[hidden] { display: none; }
.chat-icon { width: 20px; height: 20px; flex-shrink: 0; color: var(--primary); }
.header-cta { grid-area: cta; white-space: nowrap; }
.header-cta[aria-current="page"] { outline: 2px solid var(--primary); outline-offset: 2px; }
/* Phones: the chat button becomes an icon (screen readers still hear "Help chat"). */
@media (max-width: 559px) {
  .header-inner { column-gap: 8px; }
  .logo { gap: 5px; letter-spacing: -0.03em; }
  .logo-mark { width: 24px; height: 24px; }
  .logo-name { font-size: 1.02rem; }
  .logo-tag { font-size: .64rem; padding: 2px 5px 1px; letter-spacing: .05em; }
  .header-chat { min-width: 44px; padding: 0; }
  .chat-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .header-cta { padding: 0 14px; }
}
/* Wide screens: logo, menu, search, chat and "Find my plan" on one row. */
@media (min-width: 1100px) {
  .header-inner {
    grid-template-columns: auto auto 1fr auto auto;
    grid-template-areas: "logo nav search chat cta";
    padding-top: 12px; padding-bottom: 12px;
  }
  .main-nav { flex-wrap: nowrap; }
}
/* The search box needs room next to the menu; narrower screens use the
   menu's Search link instead. */
@media (min-width: 1220px) {
  /* The header may use more of a wide screen than the page, so the search box has room. */
  .site-header .header-inner { max-width: 1280px; }
  .header-search { display: flex; gap: 6px; justify-self: end; width: 100%; max-width: 320px; min-width: 0; }
  /* Without this the box's natural width squeezes the buttons next to it. */
  .header-search input { width: 0; }
  .nav-search-link { display: none !important; }
}
.header-search input, .search-row input, .chat-form input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0 12px;
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px;
}
::placeholder { color: var(--muted); opacity: 1; }

/* Breadcrumbs and Back / Home / Forward */
.page-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 20px; }
.breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; font-size: .95rem; }
.breadcrumbs li { display: inline-flex; align-items: center; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin: 0 8px; color: var(--muted); }
.breadcrumbs a { display: inline-flex; align-items: center; min-height: 44px; }
.breadcrumbs [aria-current="page"] { color: var(--text); font-weight: 600; }
.page-nav { display: flex; gap: 8px; }
.page-nav [hidden] { display: none; }
.page-nav .btn-secondary { min-height: 44px; padding: 0 14px; font-size: .95rem; gap: 6px; }

/* Floating back-to-top button */
.to-top {
  position: fixed; right: 16px; bottom: 16px; z-index: 15;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px;
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 999px;
  font-weight: 700; text-decoration: none; box-shadow: 0 2px 10px rgb(0 0 0 / 18%);
}
.to-top:hover { background: var(--surface-2); color: var(--text); }
.to-top[hidden] { display: none; }

/* Search page */
.search-page-form { max-width: 640px; display: grid; gap: 8px; margin-bottom: 16px; font-weight: 600; }
.search-row { display: flex; gap: 8px; }
.search-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; max-width: 760px; }
.search-results li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 18px; }
.search-results a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; font-size: 1.1rem; }
.search-results p { margin: 0; color: var(--muted); }

/* Help chat */
.chat {
  /* --chat-top is set by chat.js to just below the header's real bottom edge. */
  position: fixed; z-index: 30; right: 12px; left: 12px;
  top: var(--chat-top, calc(var(--header-h) + 8px)); bottom: 12px;
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: 0 10px 40px rgb(0 0 0 / 30%);
  overflow: hidden;
}
.chat[hidden] { display: none; }
@media (min-width: 600px) {
  .chat { left: auto; width: 400px; bottom: auto; max-height: min(640px, calc(100vh - var(--chat-top, var(--header-h)) - 20px)); right: 20px; }
}
.chat-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; background: var(--primary); color: var(--on-primary); }
.chat-head h2 { font-size: 1.1rem; margin: 0; }
.chat-head p { margin: 0; font-size: .875rem; }
.chat-close { min-width: 44px; min-height: 44px; font-size: 1.6rem; line-height: 1; background: transparent; color: inherit; border: 0; border-radius: 8px; cursor: pointer; }
.chat-close:hover { background: rgb(0 0 0 / 12%); }
.chat-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; min-height: 160px; }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 14px; }
.msg p { margin: 0; white-space: pre-line; }
.msg-bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.msg-me { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; }
.msg-links, .msg-questions { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.msg-links a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; }
.chat-question {
  width: 100%; min-height: 44px; padding: 8px 12px; text-align: left; cursor: pointer;
  font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 10px;
}
.chat-question:hover { border-color: var(--primary); }
.chat-tools { display: flex; gap: 8px; padding: 0 14px 8px; }
.chat-tool { min-height: 44px; padding: 0 12px; font: inherit; font-size: .9rem; font-weight: 600; color: var(--primary); background: transparent; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.chat-tool:hover { background: var(--surface-2); }
.chat-form { display: flex; gap: 8px; padding: 10px 14px 14px; border-top: 1px solid var(--border); }
.chat-mic { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.chat-mic[hidden] { display: none; }
.chat-mic svg { width: 22px; height: 22px; }
.chat-mic.listening { background: var(--primary); color: var(--on-primary); }
.chat-send { padding: 0 16px; }
.chat-notice { margin: 0; padding: 0 14px 12px; font-size: .9rem; color: var(--text); }
.chat-notice[hidden] { display: none; }

/* Page heads */
main.wrap { padding-top: 32px; padding-bottom: 48px; }
.hero, .page-head { max-width: 760px; margin-bottom: 28px; }
.lead { font-size: 1.125rem; color: var(--muted); }
.hero-links { display: flex; flex-wrap: wrap; gap: 0 24px; }

/* Banners between the sections: "Going abroad?" on the home page, filled
   with the travel colour, and "Looking for a UK SIM?" on the travel page, a
   white box in the SIM-only colour. Colours come from src/themes.mjs
   (--travel*, --main*); both stay light in dark mode. */
.travel-banner, .sim-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  margin: 0 0 24px; padding: 18px 22px; border-radius: var(--radius);
}
.travel-banner { background: var(--travel); color: #ffffff; box-shadow: 0 6px 18px rgb(17 24 39 / 18%); }
.sim-banner { background: #ffffff; color: #111827; border: 2px solid var(--main); }
.travel-banner-icon, .sim-banner-icon { width: 44px; height: 44px; flex: none; }
.travel-banner-icon { fill: #ffffff; }
.sim-banner-icon { fill: var(--main); }
.travel-banner-text, .sim-banner-text { flex: 1 1 260px; }
.travel-banner p, .sim-banner p { margin: 0; }
.travel-banner-title, .sim-banner-title { font-weight: 800; font-size: 1.2rem; margin-bottom: 2px !important; }
.travel-banner-btn, .sim-banner-btn { flex: none; }
.travel-banner .btn { background: #ffffff; color: var(--travel-ink); }
.travel-banner .btn:hover { background: var(--travel-tint-2); color: var(--travel-ink); }
.travel-banner .btn:focus-visible { outline-color: #ffffff; }
.sim-banner .btn { background: var(--main); color: var(--on-main); }
.sim-banner .btn:hover { background: var(--main-hover); color: var(--on-main); }
@media (max-width: 599px) {
  .travel-banner, .sim-banner { padding: 12px 14px; gap: 10px; margin-bottom: 14px; }
  .travel-banner-icon, .sim-banner-icon { width: 30px; height: 30px; }
  .travel-banner-title, .sim-banner-title { font-size: 1.05rem; }
  .travel-banner-btn, .sim-banner-btn { width: 100%; }
}

/* The travel section (body.section-travel) has its own colour, so visitors
   see they've left the SIM-only deals: tinted page, a coloured title band,
   a coloured line under the header and the menu item filled in. */
.section-travel .site-header { box-shadow: inset 0 -4px 0 var(--travel); }
.section-travel .main-nav a[aria-current="page"] { background: var(--travel); color: #ffffff; }
.hero-travel { max-width: none; background: var(--travel); color: #ffffff; padding: 24px 28px; border-radius: var(--radius); }
.hero-travel h1 { display: flex; align-items: center; gap: 12px; }
.hero-travel .lead { color: #ffffff; margin: 0; max-width: 760px; }
.hero-icon { width: 1em; height: 1em; flex: none; fill: currentColor; }
@media (max-width: 599px) {
  .hero-travel { padding: 14px 16px; }
}
.hero-links a { font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }

/* Buttons */
.btn, .btn-secondary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 10px 18px; border-radius: 10px;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn { background: var(--primary); color: var(--on-primary); border: 0; }
.btn:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--surface-2); }

/* Deals layout */
.deals-layout { display: grid; gap: 24px; }
@media (min-width: 900px) {
  .deals-layout { grid-template-columns: 260px 1fr; align-items: start; }
  .filters { position: sticky; top: calc(var(--header-h) + 16px); }
}

.filters {
  display: grid; gap: 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
.filters[hidden] { display: none; }
/* Two columns on phones so the deals start higher up the page. */
@media (max-width: 899px) {
  .filters { grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px; }
  .filters-title, .filters fieldset, .filters button, .filters .wide, .filters .operator-group { grid-column: 1 / -1; }
}
.filters-title { font-size: 1.05rem; margin: 0; }

/* "Filters and sort": only on phones and tablets (filter-toggle.js). */
.filters-toggle { display: none; }
.filters-more { display: contents; }
@media (max-width: 899px) {
  .filters-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .filters-toggle { display: inline-flex; justify-content: space-between; width: 100%; }
  .filters-toggle::after { content: "\25BE"; margin-left: 8px; }
  .filters.is-open .filters-toggle::after { content: "\25B4"; }
  .filters-more { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; grid-column: 1 / -1; }
  .filters:not(.is-open) .filters-more { display: none; }
  .filters-more fieldset, .filters-more .wide { grid-column: 1 / -1; }
}

/* Network picker: one logo tile per network. */
.filters .brand-picker { display: block; min-width: 0; }
/* Let wide logo rows scroll instead of stretching the page. */
.deals-layout > *, .operator-group { min-width: 0; }
.filters .brand-hint { margin: 0 0 8px; font-size: .85rem; color: var(--muted); }

/* One-tap filter buttons (data amount, must-haves), always visible. */
.filters .chip-group { display: block; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.filters .chip { display: inline-block; position: relative; font-weight: 600; font-size: .9rem; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; cursor: pointer; white-space: nowrap;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; color: var(--text);
}
.chip span:hover { border-color: var(--primary); }
.chip input:checked + span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
/* Phones and tablets: the data buttons sit in one row that swipes sideways. */
@media (max-width: 899px) {
  .chips-scroll {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px 40px 2px 2px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }
  .chips-scroll::-webkit-scrollbar { display: none; }
  .chips-scroll .chip { flex: none; }
}
.brand-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.filters .brand-option { display: block; position: relative; font-weight: 600; font-size: .8rem; }
.brand-option input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.brand-choice {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-height: 44px; padding: 8px 4px; text-align: center; line-height: 1.2; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.brand-choice:hover { border-color: var(--primary); }
.brand-option input:checked + .brand-choice { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); background: var(--surface-2); }
.brand-option input:focus-visible + .brand-choice { outline: 3px solid var(--focus); outline-offset: 2px; }
.brand-all .brand-letter { font-size: .95rem; }

/* "Best deal": the first card in the list, for the visitor's own choices. */
.deal-best { position: relative; margin-top: 14px; border: 2px solid var(--primary); }
.best-label {
  position: absolute; top: -13px; left: 16px; margin: 0;
  padding: 2px 10px; border-radius: 999px; font-size: .8rem; line-height: 1.4;
  background: var(--primary); color: var(--on-primary);
}
.best-label span { font-weight: 800; margin-right: 4px; }
/* Phones and tablets: one row that swipes sideways, so the deals stay near the top. */
@media (max-width: 899px) {
  .brand-options {
    display: flex; overflow-x: auto; scrollbar-width: none; padding: 2px 40px 4px 2px;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  }
  .brand-options::-webkit-scrollbar { display: none; }
  .brand-option { flex: none; width: 88px; }
}
.filters label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.filters select, .calc-form input {
  font: inherit; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 9px 10px; min-height: 44px; width: 100%;
}
.filters fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.filters legend { font-weight: 600; font-size: .9rem; margin-bottom: 4px; padding: 0; }
.filters .check { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 500; font-size: 1rem; }
.filters .check input { width: 20px; height: 20px; accent-color: var(--primary); }

.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.results-head h2 { margin: 0; }
.results-head p { margin: 0; }

.deal-list { display: grid; gap: 14px; }
.empty { padding: 24px; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); }

/* Deal card */
.deal {
  display: grid; gap: 12px 20px;
  grid-template-areas: "head" "main" "terms" "facts" "foot";
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow);
}
@media (min-width: 720px) {
  .deal {
    grid-template-columns: 1.1fr 1.3fr 1fr;
    grid-template-areas: "head main foot" "terms facts foot";
    align-items: start;
  }
}
/* Travel eSIM card: where it works sits under the provider, the three
   figures share one row. */
@media (min-width: 720px) {
  .plan {
    grid-template-columns: 1fr 1.5fr 1fr;
    grid-template-areas: "head main foot" "terms main foot" "facts facts foot";
  }
  .plan .deal-main { gap: 20px; align-self: center; }
}
.deal-head { grid-area: head; display: flex; align-items: center; gap: 12px; }

/* Brand logos sit on a white tile in both modes: most logos are made for
   light backgrounds. Brands with a white logo get their own tile colour
   (logoBg in data/*.json, added to this file by the build). */
.brand-logo {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 64px; height: 40px; padding: 4px;
  background: #ffffff; border: 1px solid var(--border); border-radius: 8px;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }
.brand-letter { color: #111827; font-weight: 800; font-size: 1.1rem; line-height: 1; }
.brand-title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.brand-title .brand-logo { width: 80px; height: 50px; }
.network-card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.network-card-head h2 { margin: 0; }
.deal-main { grid-area: main; display: flex; gap: 24px; flex-wrap: wrap; }
.deal-terms { grid-area: terms; }
.deal-more { grid-area: facts; }
.deal-more > summary { display: none; }
/* Shown under the network name on bigger screens; inside "More info" on phones. */
.fact-host { display: none; }
.deal-foot { grid-area: foot; display: grid; gap: 6px; align-self: center; }
/* Block, so a long label ("Send credit with eSIM Hub") wraps as one line of text. */
.deal-foot .btn { display: block; text-align: center; }
.deal p { margin: 0; }
.deal-network { font-size: 1.15rem; margin: 0; }
.deal-network a { color: var(--text); text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
.deal-network a:hover { text-decoration: underline; }
.deal-host, .deal-total, .deal-checked { color: var(--muted); font-size: .875rem; }
.deal-ends { font-size: .875rem; font-weight: 700; color: var(--accent); }
.deal[hidden] { display: none !important; }
.deal-figure { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1.1; }
.deal-data, .deal-price { color: var(--muted); font-size: .875rem; }
.deal-data .deal-figure, .deal-price .deal-figure { color: var(--text); }
.deal-contract { font-weight: 600; }
.plan-countries { font-size: .875rem; margin: 2px 0 4px; }
/* Top-up cards: the network abroad, with its logo. */
.topup-operator { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-bottom: 4px !important; }
.topup-operator .brand-logo { width: 44px; height: 28px; padding: 3px; }
.topup-operator .brand-letter { font-size: .9rem; }
.plan-countries summary { cursor: pointer; color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; min-height: 44px; }
.plan-countries p { color: var(--muted); }
.badges { list-style: none; padding: 0; margin: 8px 0 0; display: flex; gap: 6px; flex-wrap: wrap; }
.badges li { background: var(--badge-bg); color: var(--badge-text); font-size: .875rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
/* Fixed colours, readable in every theme: dark green on pale green, dark amber on pale yellow. */
.badges li.badge-good { background: #dcfce7; color: #14532d; }
.badges li.badge-warn { background: #fef3c7; color: #92400e; }
.deal-calls { flex-basis: 100%; font-size: .95rem; font-weight: 700; color: var(--text); }
.deal-facts { margin: 0; display: grid; gap: 6px; font-size: .875rem; }
.deal-facts dt { font-weight: 700; display: inline; }
.deal-facts dt::after { content: ": "; }
.deal-facts dd { display: inline; margin: 0; color: var(--muted); }

/* FAQ */
.faq { margin-top: 48px; max-width: 760px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.faq summary { cursor: pointer; padding: 14px 16px; font-weight: 700; }
.faq details p { padding: 0 16px 14px; margin: 0; color: var(--muted); }

/* Networks */
.network-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.network-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.network-card h2 { font-size: 1.15rem; }
.network-card h2 a { display: inline-flex; align-items: center; min-height: 44px; }
.network-card p { margin: 0 0 4px; }
.tip { margin-top: 32px; max-width: 760px; background: var(--surface-2); border-radius: var(--radius); padding: 18px; }

/* Calculator */
.calc-layout { display: grid; gap: 24px; }
@media (min-width: 900px) { .calc-layout { grid-template-columns: 1fr 320px; align-items: start; } }
.calc-form { display: grid; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.calc-form label { display: grid; gap: 6px; font-weight: 600; }
.calc-input { display: flex; align-items: center; gap: 10px; font-weight: 400; color: var(--muted); }
.calc-form input { width: 7.5em; }
.calc-result { background: var(--surface); border: 2px solid var(--primary); border-radius: var(--radius); padding: 20px; text-align: center; }
.calc-result[hidden] { display: none; }
.calc-result p { margin: 0 0 6px; }
.calc-figure { font-size: 2.25rem; font-weight: 800; }
.calc-result .btn { margin: 10px 0; width: 100%; }

/* Text pages */
.prose { max-width: 720px; }
.prose h2 { margin-top: 1.5em; }
.draft-note { background: var(--accent-bg); border-left: 4px solid var(--accent); padding: 10px 14px; border-radius: 6px; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 28px 0; font-size: .9rem; }
.footer-inner p { margin: 0 0 10px; }
.site-footer nav { display: flex; gap: 0 20px; flex-wrap: wrap; margin-bottom: 10px; }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 44px; }
.site-footer .contact a { font-weight: 700; }

/* Phones: a small page title, then straight to the deals, two per row.
   Card details fold into "More info" (compact.js). */
@media (max-width: 599px) {
  main.wrap { padding-top: 16px; }
  .hero { margin-bottom: 14px; }
  .hero h1 { font-size: 1.5rem; margin: 0; }
  .hero .lead, .hero-links { display: none; }
  .deals-layout { gap: 14px; }
  .filters { padding: 12px; gap: 10px; }

  .deal-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .deal { display: flex; flex-direction: column; gap: 8px; padding: 12px; }
  .deal-best { margin-top: 0; }
  .best-label { position: static; align-self: flex-start; border-radius: 8px; font-size: .72rem; padding: 3px 8px; }
  .best-label span { display: block; }
  .deal-head { gap: 8px; }
  .deal-head .brand-logo { width: 48px; height: 32px; padding: 3px; }
  .deal-network a { min-height: 44px; }
  .results-head h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .deal-network { font-size: 1rem; }
  .deal-host, .deal-total, .deal-checked { font-size: .78rem; }
  .deal-main { flex-direction: row; flex-wrap: wrap; gap: 4px 14px; }
  .deal:not(.plan) .deal-host { display: none; }
  .deal-facts .fact-host { display: block; }
  .deal-checked { font-size: .7rem; }
  .deal-figure { font-size: 1.3rem; }
  .deal-data, .deal-price { font-size: .78rem; }
  .deal-contract { font-size: .875rem; }
  .badges { margin-top: 6px; gap: 4px; }
  .badges li { font-size: .72rem; padding: 1px 6px; }
  .deal-more > summary {
    display: flex; align-items: center; min-height: 44px; cursor: pointer;
    font-size: .85rem; font-weight: 700; color: var(--primary);
  }
  .deal-more .deal-facts { font-size: .78rem; }
  .plan-countries { font-size: .78rem; }
  .topup-operator { font-size: .78rem; gap: 6px; }
  .topup-operator .brand-logo { width: 36px; height: 24px; padding: 2px; }
  /* Buttons line up along the bottom of each row. */
  .deal-foot { margin-top: auto; align-self: stretch; }
  .deal-foot .btn { width: 100%; padding: 8px 10px; }
  .btn-at { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Contact form: a pop-up from any "Contact us" link (contact.js), and the
   /contact/ page. Input borders are #6b7280 (4.8:1 on white). */
.contact-dialog {
  width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 0;
  border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text);
  box-shadow: 0 20px 50px rgb(17 24 39 / 30%);
}
.contact-dialog::backdrop { background: rgb(17 24 39 / 55%); }
.contact-head {
  position: sticky; top: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 10px 8px 20px; background: var(--primary); color: var(--on-primary);
}
.contact-head h2 { margin: 0; font-size: 1.15rem; }
.contact-body { padding: 14px 20px 20px; }
.contact-form { display: grid; gap: 6px; }
.contact-form p { margin: 0; }
.contact-form > label { font-weight: 600; margin-top: 8px; }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid #6b7280; border-radius: 8px;
}
.contact-form textarea { resize: vertical; min-height: 120px; }
.contact-form fieldset { border: 0; padding: 0; margin: 10px 0 0; min-width: 0; }
.contact-form legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.contact-form .btn { margin-top: 10px; width: 100%; }
.contact-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-status { color: #b91c1c; font-weight: 600; }
.contact-status:empty { display: none; }
.contact-demo { background: #fef3c7; color: #111827; padding: 8px 12px; border-radius: 8px; }
.contact-thanks { display: grid; gap: 10px; padding: 6px 0; }
.contact-thanks p { margin: 0; }
.contact-thanks-title { font-size: 1.25rem; font-weight: 800; }
.contact-page .contact-form { max-width: 560px; margin: 16px 0 24px; }

/* Social tariffs (cheaper on benefits). Fixed greens, so the colours and
   contrast are the same in every theme and in dark mode. */
.social-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  margin: 0 0 20px; padding: 16px 20px; border-radius: 14px;
  background: #166534; color: #ffffff; box-shadow: 0 6px 18px rgb(17 24 39 / 18%);
}
.social-banner p { margin: 0; }
.social-banner-icon { width: 40px; height: 40px; flex: none; fill: #ffffff; }
.social-banner-text { flex: 1 1 260px; }
.social-banner-title { font-weight: 800; font-size: 1.2rem; margin-bottom: 2px !important; }
.social-banner-btn { flex: none; }
.social-banner .btn { background: #ffffff; color: #14532d; }
.social-banner .btn:hover { background: #dcfce7; color: #14532d; }
.social-banner .btn:focus-visible { outline-color: #ffffff; }
@media (max-width: 600px) {
  .social-banner { padding: 12px 14px; gap: 10px; margin-bottom: 14px; }
  .social-banner-icon { width: 28px; height: 28px; }
  .social-banner-title { font-size: 1.05rem; }
  .social-banner-btn { width: 100%; }
}
.hero-social { background: #f0fdf4; color: #14532d; border-radius: 14px; padding: 20px; border-top: 4px solid #166534; }
.hero-social h1, .hero-social .lead { color: #14532d; }
.social-steps { margin: 18px 0; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; }
.social-form { display: grid; gap: 14px; }
.social-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.social-form .chip { display: inline-block; position: relative; font-weight: 600; font-size: .95rem; }
.social-form legend, .jump-links { font-weight: 700; margin-bottom: 8px; }
.step-no {
  display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px;
  border-radius: 50%; background: #166534; color: #ffffff; font-size: .9rem;
}
.jump-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 0; }
.jump-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 2px solid #166534; color: #14532d; background: #ffffff; text-decoration: none; }
.jump-links a:hover { background: #dcfce7; }
.qualify-answer { margin: 0; padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.qualify-yes { background: #dcfce7; color: #14532d; }
.qualify-maybe { background: #fef3c7; color: #92400e; }
.qualify-no { background: #f3f4f6; color: #1f2937; }
.qualify-answer a { color: inherit; }
.social-results { margin-top: 26px; }
.social-card[hidden] { display: none; }
/* Phones: the social tariffs page has two lists, so keep their headings. */
@media (max-width: 600px) {
  .social-results .results-head h2 { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: normal; font-size: 1.15rem; }
}
.calc-warning { background: #fef3c7; color: #78350f; border-radius: 8px; padding: 8px 10px; font-size: 0.95em; }
.calc-warning[hidden], .calc-result [data-link][hidden] { display: none; }

/* Colour theme "Clean white", from src/themes.mjs (stays light in dark mode) */
:root { --primary: #111827; --primary-hover: #374151; --on-primary: #ffffff; --badge-bg: #f3f4f6; --badge-text: #111827; --focus: #2563eb; --bg: #ffffff; --surface: #ffffff; --surface-2: #f3f4f6; --border: #e2e6eb; color-scheme: light; }
@media (prefers-color-scheme: dark) { :root { --primary: #111827; --primary-hover: #374151; --on-primary: #ffffff; --badge-bg: #f3f4f6; --badge-text: #111827; --focus: #2563eb; --bg: #ffffff; --surface: #ffffff; --surface-2: #f3f4f6; --border: #e2e6eb; color-scheme: light; --text: #111827; --muted: #4b5563; --accent: #b45309; --accent-bg: #fef3c7; --shadow: 0 1px 2px rgb(17 24 39 / 6%), 0 2px 8px rgb(17 24 39 / 4%); } }

/* Travel section colour "Sunset orange", from src/themes.mjs */
:root { --travel: #c2410c; --travel-hover: #9a3412; --travel-tint: #fff7ed; --travel-tint-2: #ffedd5; --travel-line: #fdba74; --travel-ink: #7c2d12; --main: #111827; --main-hover: #374151; --on-main: #ffffff; }
body.section-travel { --primary: #c2410c; --primary-hover: #9a3412; --on-primary: #ffffff; --badge-bg: #ffedd5; --badge-text: #7c2d12; --bg: #fff7ed; --surface: #ffffff; --surface-2: #ffedd5; --border: #fdba74; --text: #111827; --muted: #4b5563; --accent: #b45309; --accent-bg: #fef3c7; --shadow: 0 1px 2px rgb(17 24 39 / 6%), 0 2px 8px rgb(17 24 39 / 4%); color-scheme: light; }

/* Logo tile colours, generated from data/*.json */
.brand-logo[data-brand="o2"] { background: #0019a5; border-color: #0019a5; }
.brand-logo[data-brand="4th-utility"] { background: #000000; border-color: #000000; }
.brand-logo[data-brand="fibrenest"] { background: #262261; border-color: #262261; }
.brand-logo[data-brand="highland-broadband"] { background: #871555; border-color: #871555; }
.brand-logo[data-brand="kcom"] { background: #151f6d; border-color: #151f6d; }
.brand-logo[data-brand="lightning-fibre"] { background: #160c3d; border-color: #160c3d; }
.brand-logo[data-brand="now"] { background: #000000; border-color: #000000; }
.brand-logo[data-brand="o2"] { background: #0019a5; border-color: #0019a5; }
.brand-logo[data-brand="truespeed"] { background: #371334; border-color: #371334; }
.brand-logo[data-brand="virgin-media"] { background: #ed0000; border-color: #ed0000; }
