/* ============================================================
   UKTaxTools.net — Shared Stylesheet
   British Red, White & Blue Theme
   ============================================================ */

:root {
  --navy:        #012169;
  --navy-dark:   #00154F;
  --navy-light:  #1A3A7A;
  --red:         #CF142B;
  --red-dark:    #A50F22;
  --white:       #FFFFFF;
  --off-white:   #F4F6FB;
  --light-blue:  #E8EDF7;
  --mid-blue:    #4A6FA5;
  --border:      #D0D7E8;
  --text-dark:   #0D1B3E;
  --text-mid:    #3D4F6E;
  --text-light:  #6B7A99;
  --success:     #1A7F4B;
  --success-bg:  #D4F0E4;
  --warning-bg:  #FFF8E1;
  --warning:     #856404;
  --font:        -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --radius:      8px;
  --shadow:      0 2px 12px rgba(1,33,105,0.10);
  --shadow-hover:0 6px 24px rgba(1,33,105,0.18);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  overflow-x: clip;
}
body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--text-dark);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: clip;
}
a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--red); }
img { max-width: 100%; display: block; }
ul { list-style: none; }

/* ---- Layout ---- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================================
   HEADER & NAV
   ============================================================ */
header {
  background: var(--navy);
  border-bottom: 4px solid var(--red);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.logo a {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  text-decoration: none;
}
.logo a:hover { color: #C8D8FF; }
.logo-icon { font-size: 1.5rem; line-height: 1; }
.logo-text span { color: var(--red); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links > li > a {
  color: rgba(255,255,255,0.88);
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-links > li > a:hover {
  background: rgba(255,255,255,0.12);
  color: var(--white);
}

/* Dropdown */
.dropdown { position: relative; }
.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% - 2px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--red);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow-hover);
  min-width: 260px;
  z-index: 200;
}
.dropdown:hover .dropdown-menu,
.dropdown-menu:hover { display: block; }
.dropdown-menu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  color: var(--text-dark);
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.dropdown-menu li:last-child a { border-bottom: none; }
.dropdown-menu li a:hover {
  background: var(--light-blue);
  color: var(--navy);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,0.4);
  color: var(--white);
  font-size: 1.3rem;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* ============================================================
   HERO SECTION (Homepage)
   ============================================================ */
.hero {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 50%, var(--navy-light) 100%);
  color: var(--white);
  padding: 70px 20px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(255,255,255,0.03) 60px, rgba(255,255,255,0.03) 61px),
    repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(255,255,255,0.03) 60px, rgba(255,255,255,0.03) 61px);
}
.hero-content { position: relative; z-index: 1; }
.hero-flag { font-size: 3rem; margin-bottom: 16px; }
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}
.hero h1 span { color: #FFD700; }
.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.88;
  max-width: 600px;
  margin: 0 auto 28px;
}
.hero-badges {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.badge {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  color: var(--white);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Red divider stripe */
.stripe {
  height: 5px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--red) 50%, var(--navy) 100%);
}

/* ============================================================
   TOOL CARDS GRID (Homepage)
   ============================================================ */
.tools-section {
  padding: 56px 20px;
}
.section-title {
  text-align: center;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}
.section-subtitle {
  text-align: center;
  color: var(--text-mid);
  margin-bottom: 40px;
  font-size: 1rem;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  max-width: 1100px;
  margin: 0 auto;
}

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s, border-top-color 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-top-color: var(--red);
  color: inherit;
}
.card-flag { font-size: 1.8rem; margin-bottom: 10px; }
.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.card-desc {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.5;
}
.card-link {
  display: inline-block;
  margin-top: 14px;
  color: var(--red);
  font-size: 0.88rem;
  font-weight: 600;
}
.tool-card:hover .card-link { text-decoration: underline; }

/* Scotland card highlight */
.tool-card.scotland { border-top-color: #005EB8; }
.tool-card.scotland:hover { border-top-color: #003F7F; }

/* ============================================================
   CALCULATOR PAGES
   ============================================================ */
.page-hero {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  color: var(--white);
  padding: 14px 20px 12px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.page-hero .flag { font-size: 2.5rem; margin-bottom: 10px; }

/* ---- Flag Images ---- */
.flag-img {
  width: 44px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  flex-shrink: 0;
}
.hero-flag-img {
  width: 80px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.35);
  margin: 0 auto 18px;
  display: block;
}
.card-flag-img {
  width: 48px;
  height: auto;
  border-radius: 3px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.22);
  margin-bottom: 10px;
}
.flag-inline {
  width: 28px;
  height: auto;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.page-hero-text { text-align: left; }
.page-hero h1 {
  font-size: clamp(1.1rem, 2.5vw, 1.5rem);
  font-weight: 800;
  margin: 0 0 2px 0;
  line-height: 1.2;
}
.page-hero p {
  opacity: 0.82;
  font-size: 0.85rem;
  margin: 0;
}

.calc-section {
  max-width: 780px;
  margin: 18px auto;
  padding: 0 20px 60px;
}

.calc-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.calc-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--light-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Form elements */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
}
.form-group .hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 4px;
}

input[type="number"],
input[type="text"],
select,
textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 6px;
  font-size: 0.97rem;
  font-family: var(--font);
  color: var(--text-dark);
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}
input[type="number"]:focus,
input[type="text"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(1,33,105,0.12);
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23012169' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Input with prefix/suffix */
.input-group {
  position: relative;
  display: flex;
  align-items: center;
}
.input-prefix,
.input-suffix {
  background: var(--light-blue);
  border: 1.5px solid var(--border);
  padding: 10px 12px;
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}
.input-prefix { border-right: none; border-radius: 6px 0 0 6px; }
.input-suffix { border-left: none; border-radius: 0 6px 6px 0; }
.input-group input {
  border-radius: 0;
  flex: 1;
}
.input-group input:first-child { border-radius: 6px 0 0 6px; }
.input-group input:last-child  { border-radius: 0 6px 6px 0; }

/* Radio & Checkbox groups */
.radio-group, .check-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.radio-option, .check-option {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.radio-option input, .check-option input { cursor: pointer; accent-color: var(--navy); width: 16px; height: 16px; }
.radio-option span, .check-option span { font-size: 0.92rem; color: var(--text-dark); }

/* Button */
.btn-calc {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.3px;
  margin-top: 8px;
}
.btn-calc:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-calc:active { transform: translateY(0); }

.btn-secondary {
  display: inline-block;
  padding: 10px 20px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-secondary:hover { background: var(--navy-light); }

.btn-outline {
  display: inline-block;
  padding: 10px 20px;
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-outline:hover { background: var(--navy); color: var(--white); }

/* Results */
.results-box {
  display: none;
  background: var(--light-blue);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 20px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.results-box.visible { display: block; }
.results-box h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}
.result-row:last-child { border-bottom: none; }
.result-row .label { color: var(--text-mid); }
.result-row .value { font-weight: 600; color: var(--text-dark); }
.result-row.total {
  font-size: 1.05rem;
  font-weight: 700;
  padding-top: 12px;
  margin-top: 4px;
  border-top: 2px solid var(--navy);
  border-bottom: none;
}
.result-row.total .label { color: var(--navy); }
.result-row.total .value { color: var(--red); font-size: 1.2rem; }
.result-row.highlight .value { color: var(--success); }
.result-row.saving .value { color: var(--success); }

/* Big number display */
.big-result {
  text-align: center;
  padding: 16px 0 8px;
}
.big-result .amount {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.big-result .sub-label {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-top: 4px;
}

/* Info box */
.info-box {
  background: var(--warning-bg);
  border: 1px solid #FFE082;
  border-left: 4px solid #F59E0B;
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 0.88rem;
  color: var(--warning);
  margin-top: 20px;
  line-height: 1.55;
}
.info-box strong { display: block; margin-bottom: 4px; }

/* Tax year badge */
.tax-year-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

/* Breakdown table */
.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  margin-top: 10px;
  min-width: 340px;
}
.breakdown-table th {
  text-align: left;
  padding: 8px 12px;
  background: var(--navy);
  color: var(--white);
  font-weight: 600;
  font-size: 0.85rem;
}
.breakdown-table th:last-child { text-align: right; }
.breakdown-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-dark);
}
.breakdown-table td:last-child { text-align: right; font-weight: 600; }
.breakdown-table tr:last-child td { border-bottom: none; font-weight: 700; background: var(--light-blue); }
.breakdown-table tr:nth-child(even) td { background: var(--off-white); }
.breakdown-table tr:last-child td { background: var(--light-blue); }

/* ============================================================
   HOMEPAGE ABOUT STRIP
   ============================================================ */
.about-strip {
  background: var(--navy);
  color: var(--white);
  padding: 50px 20px;
  text-align: center;
}
.about-strip h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 14px; }
.about-strip p { opacity: 0.85; max-width: 600px; margin: 0 auto; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 36px auto 0;
}
.feature-item { text-align: center; }
.feature-icon { font-size: 2rem; margin-bottom: 10px; }
.feature-title { font-weight: 700; font-size: 1rem; margin-bottom: 6px; }
.feature-desc { font-size: 0.88rem; opacity: 0.8; }

/* ============================================================
   FOOTER
   ============================================================ */
footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,0.75);
  padding: 48px 20px 24px;
  border-top: 4px solid var(--red);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  max-width: 1100px;
  margin: 0 auto 32px;
}
.footer-brand .logo-text {
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 10px;
}
.footer-brand p { font-size: 0.88rem; line-height: 1.6; }
.footer-col h4 {
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
  color: rgba(255,255,255,0.7);
  font-size: 0.88rem;
  transition: color 0.2s;
}
.footer-col ul li a:hover { color: var(--white); }
.footer-bottom {
  max-width: 1100px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.82rem;
}
.footer-bottom a { color: rgba(255,255,255,0.6); }
.footer-bottom a:hover { color: var(--white); }

/* Disclaimer */
.disclaimer {
  background: var(--off-white);
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  max-width: 900px;
  margin: 32px auto 0;
  border-radius: var(--radius);
}

/* ============================================================
   BLOG / ABOUT PAGES
   ============================================================ */
.page-content {
  max-width: 780px;
  margin: 48px auto;
  padding: 0 20px 60px;
}
.page-content h2 {
  font-size: 1.3rem;
  color: var(--navy);
  margin: 28px 0 10px;
}
.page-content p {
  color: var(--text-mid);
  margin-bottom: 14px;
  line-height: 1.7;
}
.page-content ul {
  list-style: disc;
  padding-left: 20px;
  color: var(--text-mid);
  margin-bottom: 14px;
}
.page-content ul li { margin-bottom: 6px; }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 32px;
}
.blog-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.blog-card:hover { box-shadow: var(--shadow-hover); }
.blog-card .tag {
  display: inline-block;
  background: var(--light-blue);
  color: var(--navy);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.blog-card h3 { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.blog-card p { font-size: 0.88rem; color: var(--text-mid); }
.blog-card .date { font-size: 0.8rem; color: var(--text-light); margin-top: 12px; }

/* ============================================================
   INVOICE GENERATOR SPECIFIC
   ============================================================ */
.invoice-preview {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-size: 0.9rem;
}
.invoice-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}
.invoice-company { font-weight: 700; font-size: 1.1rem; color: #111; }
.invoice-label {
  font-size: 1.8rem;
  font-weight: 800;
  color: #111;
  text-align: right;
  letter-spacing: 2px;
}
.invoice-meta { font-size: 0.85rem; color: #444; }
.invoice-meta strong { color: #111; }
.invoice-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}
.invoice-party h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 6px;
}
.invoice-items-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
.invoice-items-table th {
  background: #f2f2f2;
  color: #111;
  padding: 8px 12px;
  text-align: left;
  font-size: 0.85rem;
  border-bottom: 2px solid #ccc;
}
.invoice-items-table th:last-child { text-align: right; }
.invoice-items-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #e5e5e5;
  font-size: 0.88rem;
  color: #222;
}
.invoice-items-table td:last-child { text-align: right; }
.invoice-totals { max-width: 260px; margin-left: auto; }
.invoice-total-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid #e5e5e5;
  color: #333;
}
.invoice-total-row.grand {
  font-size: 1.1rem;
  font-weight: 800;
  color: #111;
  border-bottom: none;
  border-top: 2px solid #111;
  padding-top: 8px;
}

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 6px 20px;
  font-size: 0.82rem;
  color: var(--text-light);
}
.breadcrumb a { color: var(--mid-blue); }
.breadcrumb a:hover { color: var(--navy); }
.breadcrumb span { margin: 0 6px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--navy-dark);
    padding: 12px 0;
    z-index: 999;
    border-top: 3px solid var(--red);
  }
  .nav-links.open { display: flex; }
  .nav-links > li { width: 100%; }
  .nav-links > li > a { border-radius: 0; padding: 12px 20px; }
  .dropdown-menu {
    position: static;
    display: none;
    background: rgba(255,255,255,0.07);
    border: none;
    box-shadow: none;
    padding-left: 16px;
  }
  .dropdown.open .dropdown-menu { display: block; }
  .dropdown-menu li a { color: rgba(255,255,255,0.8); border-bottom-color: rgba(255,255,255,0.1); }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .calc-card { padding: 16px 12px; }
  .results-box { padding: 16px 12px; }
  .invoice-parties { grid-template-columns: 1fr; }
  .tools-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 48px 16px 40px; }
  .page-hero { padding: 10px 14px; gap: 10px; }
  .page-hero h1 { font-size: 1rem; }
  .flag-img { width: 34px; }
  .hero h1 { font-size: 1.6rem; }

  /* Tables: hide Taxable Amount column (col 3) — Band, Rate, Tax still visible */
  .breakdown-table th:nth-child(3),
  .breakdown-table td:nth-child(3) { display: none; }

  /* Tighter table cells on mobile */
  .breakdown-table th,
  .breakdown-table td { padding: 7px 8px; font-size: 0.82rem; }

  /* Remove min-width so table fits without scrolling */
  .breakdown-table { min-width: unset; }
}

/* ============================================================
   GOOGLE ADSENSE AD UNITS
   ============================================================ */
.ad-unit {
  max-width: 780px;
  margin: 0 auto 24px;
  padding: 0 20px;
  text-align: center;
}
.ad-unit-full {
  background: var(--off-white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px;
  margin: 0 0 24px 0;
  text-align: center;
}
.ad-label {
  font-size: 0.7rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
  display: block;
}
/* Hide ad units in print */
@media print { .ad-unit, .ad-unit-full { display: none !important; } }

/* ============================================================
   PRINT STYLES (Invoice)
   ============================================================ */
@media print {
  header, footer, .btn-calc, .btn-secondary, .btn-outline,
  .breadcrumb, .calc-card:not(.invoice-preview), nav, .info-box { display: none !important; }
  body { background: white; }
  .invoice-preview { box-shadow: none; border: none; }
}

/* ========== FAQ SECTION ========== */
.faq-section {
  max-width: 900px;
  margin: 0 auto 2rem auto;
  padding: 0 1rem;
}
.faq-section h2 {
  font-size: 1.4rem;
  color: var(--navy);
  margin-bottom: 1.2rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--red);
}
.faq-item {
  background: #fff;
  border: 1px solid #D0D7E8;
  border-radius: 8px;
  padding: 1.1rem 1.3rem;
  margin-bottom: 0.8rem;
}
.faq-q {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 0.5rem 0;
}
.faq-a {
  font-size: 0.88rem;
  color: #3A4A6B;
  line-height: 1.6;
  margin: 0;
}

/* ========== BLOG POST PAGES ========== */
.blog-post-wrap {
  max-width: 780px;
  margin: 24px auto;
  padding: 0 20px 40px;
}
.blog-post-meta {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.blog-post-body h2 {
  font-size: 1.2rem;
  color: var(--navy);
  margin: 2rem 0 0.6rem;
  padding-top: 0.5rem;
}
.blog-post-body p {
  color: var(--text);
  line-height: 1.75;
  margin-bottom: 1rem;
}
.blog-post-body ul {
  margin: 0.5rem 0 1rem 1.4rem;
  color: var(--text);
  line-height: 1.75;
}
.blog-post-body li { margin-bottom: 0.35rem; }
.blog-post-body a { color: var(--mid-blue); }
.blog-post-body a:hover { color: var(--navy); }
.blog-post-body .breakdown-table { margin: 1rem 0 1.5rem; }

/* Related calculators panel */
.related-calcs {
  background: #EEF2FF;
  border: 1px solid #C8D0EC;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 24px;
}
.related-calcs h3 {
  font-size: 0.95rem;
  color: var(--navy);
  margin: 0 0 12px;
  font-weight: 700;
}
.related-calc-link {
  display: block;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 8px;
  color: var(--navy);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}
.related-calc-link:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* Blog card as link */
.blog-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.15s;
}
.blog-card-link:hover {
  box-shadow: 0 6px 24px rgba(1,33,105,0.15);
  transform: translateY(-2px);
}
.blog-card-link h3 { color: var(--navy); }
