/* =========================================================
 *  M-Pesa Custom Styles
 *  Design source: Next.js website port
 *  Brand blue: #2986CC  (rgb 41 134 204)
 * ========================================================= */

/* ── Design tokens ──────────────────────────────────────── */
:root {
  --color-background:         255 255 255;
  --color-foreground:         15 23 42;
  --color-muted:              248 250 252;
  --color-muted-foreground:   100 116 139;
  --color-border:             226 232 240;
  --color-input:              255 255 255;
  --color-primary:            41 134 204;
  --color-primary-foreground: 248 250 252;
  --color-secondary:          241 245 249;
  --color-accent:             241 245 249;
  --color-destructive:        239 68 68;
  --color-ring:               41 134 204;
}

html.dark {
  --color-background:         2 6 23;
  --color-foreground:         248 250 252;
  --color-muted:              15 23 42;
  --color-muted-foreground:   148 163 184;
  --color-border:             30 41 59;
  --color-input:              15 23 42;
  --color-primary:            41 134 204;
  --color-primary-foreground: 15 23 42;
  --color-secondary:          30 41 59;
  --color-accent:             30 41 59;
  --color-destructive:        220 38 38;
  --color-ring:               41 134 204;
}

/* ── Base ───────────────────────────────────────────────── */
body {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  background-color: rgb(var(--color-background));
  color: rgb(var(--color-foreground));
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ── Typography ─────────────────────────────────────────── */
h1 {
  font-size: calc(1rem + 1vw);
  font-weight: 700;
  color: rgb(var(--color-foreground));
  letter-spacing: -0.025em;
}
h2, h2 > a {
  font-size: calc(1rem + .5vw);
  font-weight: 700;
  color: rgb(var(--color-foreground));
  letter-spacing: -0.025em;
  margin-bottom: 0.75rem;
  margin-top: 1.5rem;
}
h3, h3 > a {
  font-size: calc(1rem + .15vw);
  font-weight: 700;
  color: rgb(var(--color-foreground));
}
h1, h2, h3, h4, h5, h6 { font-weight: 700; }
p {
  color: rgb(var(--color-foreground));
  padding-bottom: 1rem;
  margin-bottom: 0;
}
a { color: rgb(var(--color-primary)); font-weight: 500; }

/* ── Tables ─────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  line-height: 1.6;
  background-color: rgb(var(--color-background));
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
html.dark table { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
table thead {
  background: linear-gradient(135deg, rgb(var(--color-primary)), rgb(41 134 204 / 0.8));
  color: rgb(var(--color-primary-foreground));
}
table thead th {
  padding: 1rem 1.25rem;
  font-weight: 600;
  text-align: left;
  font-size: 0.8rem;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  border: none;
  position: relative;
}
table tbody tr {
  transition: all 0.2s ease;
  border-bottom: 1px solid rgb(var(--color-border));
}
table tbody tr:hover {
  background-color: rgba(var(--color-muted), 0.5);
  transform: translateY(-1px);
}
table tbody tr:last-child { border-bottom: none; }
table tbody td {
  padding: 0.5rem 0.625rem;
  color: rgb(var(--color-foreground));
  border: none;
  vertical-align: middle;
}
table tbody tr:nth-child(even)  { background-color: rgba(248,250,252,0.3); }
table tbody tr:nth-child(odd)   { background-color: rgb(var(--color-background)); }
html.dark table tbody tr:nth-child(even) { background-color: rgba(15,23,42,0.3); }

/* ── Lists ──────────────────────────────────────────────── */
ol, ul {
  list-style: inherit;
  margin-block-start: 1em;
  margin-block-end: 1em;
  padding-inline-start: 40px;
}
ol { list-style: decimal; }
ul { list-style: disc; }
ol > li, ul > li { color: rgb(var(--color-foreground)); }

/* ── Inputs ─────────────────────────────────────────────── */
label {
  display: block;
  font-size: 1rem;
  font-weight: 500;
  color: rgb(var(--color-foreground));
}
select,
input[type="number"],
input[type="text"],
input[type="email"] {
  display: block;
  width: 100%;
  border-radius: 6px;
  padding: 0.375rem 0.75rem;
  font-size: 1rem;
  background-color: rgb(var(--color-input));
  color: rgb(var(--color-foreground));
  border: 1px solid rgb(var(--color-border));
  transition: all 0.2s;
}
select:focus, input:focus {
  outline: 2px solid rgb(var(--color-ring));
  outline-offset: -2px;
}

/* ── Navbar ─────────────────────────────────────────────── */
.site-nav {
  border-bottom: 1px solid rgb(var(--color-border));
  background-color: rgb(var(--color-muted));
  transition: background-color 0.3s ease, border-color 0.3s ease;
}
.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem 0 2rem;
}
.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}
.nav-logo { flex-shrink: 0; margin-right: auto; }
.nav-logo a { display: flex; align-items: center; text-decoration: none; }
.nav-right {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1.5rem;
  padding-left: 1.5rem;
  border-left: 1px solid rgb(var(--color-border));
}
.site-nav .nav-link-item {
  color: rgb(var(--color-muted-foreground));
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav .nav-link-item:hover { color: rgb(var(--color-foreground)); }
.icon-btn,
.site-nav .icon-btn {
  color: rgb(var(--color-muted-foreground));
  background: none;
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.icon-btn:hover,
.site-nav .icon-btn:hover {
  color: rgb(var(--color-foreground));
  background-color: rgb(var(--color-accent));
}

/* ── Hero ───────────────────────────────────────────────── */
#hero-section { position: relative; overflow: hidden; }
.hero-gradient {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: linear-gradient(rgb(41,134,204) 0%, rgba(41,134,204,0) 100%);
  opacity: 0.20;
}
.hero-shape  { position: absolute; z-index: 0; pointer-events: none; }
.hero-content { position: relative; z-index: 1; }
.hero-wrapper { padding: 0 1rem; }
.hero-inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 5rem 0 2rem;
  text-align: center;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  color: rgb(var(--color-foreground));
}
.hero-desc {
  margin-top: 1.5rem;
  font-size: 1.125rem;
  max-width: 48rem;
  margin-left: auto;
  margin-right: auto;
  color: rgb(var(--color-muted-foreground));
  padding-bottom: 0;
}

/* ── Main container ─────────────────────────────────────── */
.main-container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

/* ── Calculator ─────────────────────────────────────────── */
.calc-panel {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  background-color: rgb(var(--color-muted));
  border: 1px solid rgb(var(--color-border));
}
.calc-logo-wrap { margin-bottom: 2rem; }
.calc-field { margin-bottom: 0.5rem; }
.calc-field label { margin-bottom: 0.25rem; }
.calc-field input { margin-top: 0.25rem; }
.calc-hint {
  font-size: 0.75rem;
  padding-bottom: 0;
  color: rgb(var(--color-muted-foreground));
  margin-bottom: 0.5rem;
}
.calc-submit-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1.25rem 0;
}
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  background-color: rgb(var(--color-primary));
  color: rgb(var(--color-primary-foreground));
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary:hover { opacity: 0.8; }
.calc-results-wrap { padding: 0 0.75rem; }
.calc-results-box {
  border-radius: 12px;
  padding: 0.5rem;
  background-color: rgb(var(--color-background));
  border: 1px solid rgb(var(--color-border));
}
.fee-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgb(var(--color-border));
}
.fee-row:last-child { border-bottom: none; }
.fee-row .fee-label {
  flex: 0 0 66.666%;
  border-right: 1px solid rgb(var(--color-border));
  padding: 0.5rem 0;
  font-size: 1rem;
  color: rgb(var(--color-foreground));
  line-height: 1.25;
}
.fee-row .fee-value {
  flex: 0 0 33.333%;
  padding: 0.5rem 0.75rem;
  font-weight: 700;
  font-size: 1.1rem;
  color: rgb(var(--color-foreground));
}

/* ── Feature cards ──────────────────────────────────────── */
.feature-card {
  height: 142px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  border-radius: 10px;
  padding: 1rem;
  background-color: rgb(var(--color-background));
  border: 1px solid rgb(var(--color-border));
  transition: all 0.2s;
  display: block;
  text-decoration: none;
}
.feature-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.feature-card .tab-shape { position: absolute; top: 0; right: 0; z-index: -1; }
.feature-card-inner { display: flex; align-items: center; }
.feature-card-icon {
  margin-right: 1.25rem;
  height: 5rem;
  width: 5rem;
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
}
.feature-card-icon img { height: 100%; width: 100%; object-fit: cover; }
.feature-card-title {
  margin-bottom: 0.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(var(--color-foreground));
}
.feature-card-desc {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--color-muted-foreground));
  padding-bottom: 0;
  margin: 0;
}

/* ── Checklist (home card 3) ────────────────────────────── */
.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.checklist a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: rgb(var(--color-foreground));
  font-size: 0.95rem;
}
.checklist svg { flex-shrink: 0; color: rgb(var(--color-primary)); }

/* ── Landing links ──────────────────────────────────────── */
.landing-links {
  border-radius: 8px;
  margin-bottom: 2rem;
  padding: 1rem;
  background-color: rgb(var(--color-muted));
  border: 1px solid rgb(var(--color-border));
}
.landing-header {
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  color: rgb(var(--color-foreground));
  margin-bottom: 1rem;
}
.landing-link-item {
  display: block;
  padding: 0.25rem 0 0.25rem 0.5rem;
  border-left: 2px solid transparent;
  font-size: 0.875rem;
  line-height: 1.6;
  color: rgb(var(--color-muted-foreground));
  text-decoration: none;
  transition: all 0.2s;
}
.landing-link-item:hover {
  border-left-color: rgb(var(--color-primary));
  color: rgb(var(--color-foreground));
}

/* ── Disclaimer ─────────────────────────────────────────── */
.disclaimer {
  text-align: center;
  padding-top: 0.75rem;
  color: rgb(var(--color-foreground));
}
.disclaimer p { font-size: 0.875rem; padding-bottom: 0; }

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb-list { display: flex; list-style: none; padding: 0; margin: 0; }
.breadcrumb-list li::after { content: "/"; padding: 0 5px; }
.breadcrumb-list li:last-child::after { content: none; }
.breadcrumb-list li {
  display: flex;
  align-items: center;
  font-size: 0.875rem;
}
.breadcrumb-list a { color: rgb(var(--color-primary)); text-decoration: none; }
.breadcrumb-list .bc-current { color: rgb(var(--color-muted-foreground)); }

/* ── Page header bar (page_list) ────────────────────────── */
.page-header-bar {
  background-color: rgb(var(--color-muted));
  border-bottom: 1px solid rgb(var(--color-border));
  padding: 1.25rem 0;
}
.page-header-container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 2.5rem;
}
.page-header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  justify-content: space-between;
}
.page-title-text {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
  color: rgb(var(--color-foreground));
}
.page-count-text {
  font-size: 0.875rem;
  color: rgb(var(--color-muted-foreground));
  margin: 0.25rem 0 0;
  padding: 0;
}

/* ── Search wrap ────────────────────────────────────────── */
.search-wrap {
  position: relative;
  min-width: 280px;
  flex: 1;
  max-width: 400px;
}
.search-wrap input {
  padding-left: 2.25rem;
  padding-right: 2.25rem;
}
.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgb(var(--color-muted-foreground));
  pointer-events: none;
  display: flex;
  align-items: center;
}
.search-spinner-icon {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* ── Results container ──────────────────────────────────── */
.results-container {
  max-width: 1220px;
  margin: 0 auto;
  padding: 1.5rem 2.5rem;
}

/* ── Page cards (page_results) ──────────────────────────── */
.page-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.875rem;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid rgb(var(--color-border));
  background-color: rgb(var(--color-background));
  transition: all 0.2s;
}
.page-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.page-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.35;
  color: rgb(var(--color-primary));
}
.page-card-desc {
  font-size: 0.8125rem;
  color: rgb(var(--color-muted-foreground));
  flex-grow: 1;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}
.page-card-footer {
  margin-top: 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tag-featured {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  background-color: rgb(var(--color-primary));
  color: rgb(var(--color-primary-foreground));
  font-weight: 600;
}
.tag-calculator {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  border: 1px solid rgb(var(--color-border));
  color: rgb(var(--color-muted-foreground));
  font-weight: 500;
}
.tag-date {
  margin-left: auto;
  font-size: 0.75rem;
  color: rgb(var(--color-muted-foreground));
}

/* ── Empty state ────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 0; }
.btn-clear {
  display: inline-block;
  margin-top: 0.75rem;
  padding: 0.375rem 1rem;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 600;
  background-color: rgb(var(--color-primary));
  color: rgb(var(--color-primary-foreground));
  text-decoration: none;
}

/* ── Pagination ─────────────────────────────────────────── */
.pagination-wrap {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}
.page-btn {
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid rgb(var(--color-border));
  color: rgb(var(--color-foreground));
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.15s;
}
.page-btn:hover { background-color: rgb(var(--color-muted)); color: rgb(var(--color-foreground)); }
.page-btn-arrow { padding: 0.375rem 0.625rem; }
.page-btn-active {
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  background-color: rgb(var(--color-primary));
  color: rgb(var(--color-primary-foreground));
  font-size: 0.875rem;
  font-weight: 600;
}

/* ── Content detail header ──────────────────────────────── */
.content-header {
  padding: 1rem 2.5rem 0.5rem;
  max-width: 1220px;
  margin: 0 auto;
}
.content-calculator {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0.5rem 2.5rem 1.5rem;
}
.content-title {
  font-weight: 700;
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
  color: rgb(var(--color-foreground));
}
.content-dates {
  font-size: 0.875rem;
  color: rgb(var(--color-muted-foreground));
}
.content-byline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid rgb(var(--color-border));
}
.byline-card {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  padding: 0.35rem 0.55rem 0.35rem 0.35rem;
  border-radius: 0.6rem;
  transition: background 0.15s;
}
.byline-card:hover {
  background: rgb(var(--color-muted));
  color: inherit;
  text-decoration: none;
}
.byline-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: rgb(var(--color-primary)/.15);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgb(var(--color-border));
}
.byline-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.byline-initials {
  font-size: 0.85rem;
  font-weight: 700;
  color: rgb(var(--color-primary));
  line-height: 1;
}
.byline-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.byline-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgb(var(--color-muted-foreground));
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}
.byline-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: rgb(var(--color-foreground));
  line-height: 1.2;
}
.byline-divider {
  width: 1px;
  height: 36px;
  background: rgb(var(--color-border));
  flex-shrink: 0;
}

/* ── Content layout (two-column) ───────────────────────── */
.content-layout {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 2rem;
  max-width: 1220px;
  margin: 0 auto;
  padding: 1rem 2.5rem 2rem;
}
.content-main {
  min-width: 0;
  flex: 1;
  align-self: start;
}
.content-body {
  background-color: rgb(var(--color-background));
  border-radius: 8px;
}

/* ── Sidebar TOC ────────────────────────────────────────── */
.content-aside { flex: none; width: 300px; }
.page-nav-container { position: sticky; top: 80px; }
.page-nav { margin-bottom: 3rem; }
.page-nav h4 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  padding: 0;
  color: rgb(var(--color-foreground));
  margin-bottom: 0.75rem;
}
ul.page-nav {
  list-style: none;
  padding-top: 0;
  padding-left: 0.5rem;
  border-left: 1.5px solid rgb(var(--color-border));
}
ul.page-nav li a {
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgb(var(--color-muted-foreground));
  text-decoration: none;
  display: block;
  padding: 0.2rem 0 0.2rem 0.5rem;
  border-left: 2px solid transparent;
  margin-left: -0.6rem;
  transition: all 0.15s;
}
ul.page-nav li a:hover,
ul.page-nav li a.active {
  color: rgb(var(--color-foreground));
  border-left-color: rgb(var(--color-primary));
}

/* ── Related content ────────────────────────────────────── */
.related-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgb(var(--color-border));
}
.related-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: rgb(var(--color-foreground));
  margin-bottom: 1rem;
}
.related-list { display: flex; flex-direction: column;}
.related-link {
  display: block;
  padding: 0.25rem 0 0.25rem 0.5rem;
  border-left: 2px solid transparent;
  font-size: 0.875rem;
  line-height: 1.4;
  color: rgb(var(--color-muted-foreground));
  text-decoration: none;
  transition: all 0.2s;
}
.related-link:hover {
  border-left-color: rgb(var(--color-primary));
  color: rgb(var(--color-foreground));
}

/* ── Footer ─────────────────────────────────────────────── */
.site-footer {
  padding: 1.5rem 0;
  background-color: rgb(var(--color-muted));
  border-top: 1px solid rgb(var(--color-border));
  color: rgb(var(--color-foreground));
  transition: background-color 0.3s ease;
}
.site-footer a {
  color: rgb(var(--color-muted-foreground));
  font-weight: 400;
  text-decoration: none;
}
.site-footer a:hover { color: rgb(var(--color-foreground)); }
.footer-inner { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}
.footer-copy {
  text-align: center;
  font-size: 0.875rem;
  color: rgb(var(--color-muted-foreground));
  padding-bottom: 0;
  margin: 0;
}

/* ── HTMX spinner ───────────────────────────────────────── */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }

/* ── Search overlay ─────────────────────────────────────── */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background-color: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.search-box {
  background-color: rgb(var(--color-background));
  border: 1px solid rgb(var(--color-border));
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  padding: 1.25rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.search-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.search-overlay-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 0;
  color: rgb(var(--color-foreground));
}
.search-input-wrap { position: relative; }
.search-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 1rem;
  border-radius: 8px;
  background-color: rgb(var(--color-input));
  color: rgb(var(--color-foreground));
  border: 1px solid rgb(var(--color-border));
}
.search-input:focus { outline: 2px solid rgb(var(--color-ring)); }
.search-suggestion {
  display: inline-block;
  font-size: 0.875rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin: 0.25rem;
  background-color: rgb(var(--color-muted));
  border: 1px solid rgb(var(--color-border));
  color: rgb(var(--color-muted-foreground));
  text-decoration: none;
  cursor: pointer;
}
.search-suggestion:hover { color: rgb(var(--color-foreground)); }

/* ── Search suggestions dropdown ───────────────────────── */
.sug-wrap {
  margin-top: 0.75rem;
  border: 1px solid rgb(var(--color-border));
  border-radius: 0.625rem;
  overflow: hidden;
}
.sug-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgb(var(--color-muted-foreground));
  padding: 0.55rem 1rem;
  margin: 0;
  border-bottom: 1px solid rgb(var(--color-border));
  background-color: rgb(var(--color-muted) / 0.3);
}
.sug-list {
  list-style: none;
  margin: 0;
  padding: 0;
  padding-inline-start: 0;
}
.sug-list li + li {
  border-top: 1px solid rgb(var(--color-border) / 0.6);
}
.sug-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.7rem 1rem;
  text-decoration: none;
  color: rgb(var(--color-foreground));
  transition: background-color 0.12s;
}
.sug-item:hover {
  background-color: rgb(var(--color-muted));
}
.sug-item:hover .sug-title {
  color: rgb(var(--color-primary));
}
.sug-item:hover .sug-arrow {
  opacity: 1;
  transform: translateX(2px);
}
.sug-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-top: 0.15rem;
  color: rgb(var(--color-muted-foreground));
}
.sug-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.sug-title-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.sug-title {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  transition: color 0.12s;
}
.sug-desc {
  font-size: 0.78rem;
  color: rgb(var(--color-muted-foreground));
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sug-badges {
  display: flex;
  gap: 0.3rem;
  flex-shrink: 0;
}
.sug-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  white-space: nowrap;
}
.sug-badge--calc {
  background-color: rgb(16 185 129 / 0.12);
  color: rgb(16 185 129);
}
.sug-badge--guide {
  background-color: rgb(59 130 246 / 0.12);
  color: rgb(59 130 246);
}
.sug-badge--match {
  background-color: rgb(var(--color-accent) / 0.15);
  color: rgb(var(--color-accent-foreground, var(--color-foreground)));
}
.sug-mark {
  background-color: rgb(var(--color-primary) / 0.15);
  color: rgb(var(--color-primary));
  border-radius: 0.2rem;
  padding: 0 0.1rem;
  font-style: normal;
}
.sug-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  align-self: center;
  color: rgb(var(--color-muted-foreground));
  opacity: 0;
  transition: opacity 0.12s, transform 0.12s;
}
.sug-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  padding: 0.6rem 1rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: rgb(var(--color-primary));
  text-decoration: none;
  border-top: 1px solid rgb(var(--color-border));
  background-color: rgb(var(--color-muted) / 0.4);
  transition: background-color 0.12s;
}
.sug-footer:hover {
  background-color: rgb(var(--color-muted));
}
.sug-empty {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 2rem 1rem;
  color: rgb(var(--color-muted-foreground));
  text-align: center;
  border: 1px solid rgb(var(--color-border));
  border-radius: 0.625rem;
}
.sug-empty p {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 500;
  color: rgb(var(--color-foreground));
}
.sug-empty span {
  font-size: 0.8rem;
}
.sug-empty strong {
  color: rgb(var(--color-foreground));
}

/* ── Mobile menu overlay ────────────────────────────────── */
.mobile-menu-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgb(var(--color-background));
  border-top: 1px solid rgb(var(--color-border));
  padding: 1.25rem;
}
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}
.mobile-menu-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgb(var(--color-foreground));
}
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ── Paybill Calculator Card ────────────────────────────── */
.paybill-card {
  background-color: rgb(var(--color-background));
  border: 1px solid rgb(var(--color-border));
  border-radius: 20px;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.08), 0 8px 10px -6px rgba(0,0,0,.05);
  overflow: hidden;
  max-width: 860px;
}
.paybill-card-body { padding: 1.5rem; }
.paybill-field-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(var(--color-foreground));
  margin-bottom: 0.5rem;
}
/* Amount input */
.paybill-input-wrap { position: relative; }
.paybill-amount-input {
  width: 100%;
  font-size: 1rem;
  font-weight: 700;
  color: rgb(var(--color-primary));
  background-color: rgb(var(--color-input));
  border: 2px solid rgb(var(--color-border));
  border-radius: 10px;
  padding: 0.65rem 4.5rem 0.65rem 1rem;
  outline: none;
  transition: border-color 0.15s;
  -moz-appearance: textfield;
}
.paybill-amount-input:focus { border-color: rgb(var(--color-primary)); }
.paybill-amount-input::-webkit-inner-spin-button,
.paybill-amount-input::-webkit-outer-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.paybill-input-unit {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  font-weight: 600;
  font-size: 0.9rem;
  color: rgb(var(--color-muted-foreground));
  pointer-events: none;
}
.paybill-minmax {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: rgb(var(--color-muted-foreground));
  margin-top: 0.375rem;
}
/* Tariff buttons */
.paybill-tariff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.tariff-btn { cursor: pointer; display: block; }
.tariff-label {
  display: block;
  text-align: center;
  padding: 0.65rem 0.5rem;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 2px solid rgb(var(--color-border));
  background-color: rgb(var(--color-background));
  color: rgb(var(--color-foreground));
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}
.tariff-btn input:checked + .tariff-label {
  background-color: rgb(var(--color-primary));
  color: #fff;
  border-color: transparent;
}
.paybill-tariff-desc {
  font-size: 0.8rem;
  text-align: center;
  color: rgb(var(--color-muted-foreground));
  margin-top: 0.5rem;
  margin-bottom: 0;
}
/* Results: breakdown section */
.paybill-breakdown-section {
  background-color: rgb(var(--color-muted));
  border-radius: 14px;
  padding: 1rem;
  margin-top: 1.5rem;
}
.paybill-breakdown-title {
  font-size: 1rem;
  font-weight: 700;
  color: rgb(var(--color-foreground));
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.875rem;
}
.paybill-charge-box {
  background-color: rgb(var(--color-background));
  border: 1px solid rgb(var(--color-border));
  border-radius: 10px;
  padding: 0.75rem;
}
.paybill-charge-label {
  font-size: 0.75rem;
  color: rgb(var(--color-muted-foreground));
  margin-bottom: 0.3rem;
}
.paybill-charge-amount {
  font-size: 1.25rem;
  font-weight: 700;
  color: rgb(var(--color-primary));
}
.paybill-total {
  background-color: rgb(var(--color-primary));
  border-radius: 10px;
  padding: 0.875rem 1rem;
  margin-top: 0.75rem;
}
.paybill-total-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,.9);
  margin-bottom: 0.25rem;
}
.paybill-total-amount {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}
/* Results: business receives */
.paybill-receives {
  background-color: rgb(var(--color-muted));
  border: 2px solid rgb(var(--color-border));
  border-radius: 14px;
  padding: 1rem;
  margin-top: 0.75rem;
}
.paybill-receives-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--color-foreground));
  margin-bottom: 0.25rem;
}
.paybill-receives-amount {
  font-size: 2rem;
  font-weight: 700;
  color: rgb(var(--color-primary));
  line-height: 1.1;
}
.paybill-receives-note {
  font-size: 0.75rem;
  color: rgb(var(--color-muted-foreground));
  margin-top: 0.25rem;
}
/* Results: note */
.paybill-note {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  background-color: rgb(var(--color-muted));
  border: 1px solid rgb(var(--color-border));
  border-radius: 10px;
  padding: 0.875rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: rgb(var(--color-foreground));
}
.paybill-note-icon {
  flex-shrink: 0;
  color: rgb(var(--color-primary));
  margin-top: 1px;
}
/* Card footer */
.paybill-card-footer {
  background-color: rgb(var(--color-muted));
  border-top: 1px solid rgb(var(--color-border));
  padding: 0.875rem 1.5rem;
  text-align: center;
  font-size: 0.78rem;
  color: rgb(var(--color-muted-foreground));
}
.paybill-card-footer p { margin: 0 0 0.25rem; }
.paybill-card-footer p:last-child { margin-bottom: 0; }
/* Error state */
.paybill-error {
  padding: 0.875rem;
  border-radius: 10px;
  background-color: rgb(var(--color-muted));
  border: 1px solid rgb(var(--color-border));
  color: rgb(var(--color-destructive));
  font-size: 0.875rem;
  margin-top: 1.5rem;
}

/* ── Responsive overrides ───────────────────────────────── */
@media (max-width: 576px) {
  .page-header-container { padding: 0 1rem; }
  .content-header        { padding: 1rem 1rem 0.5rem; }
  .content-calculator    { padding: 0.5rem 1rem 1rem; }
  .content-layout        { padding: 1rem 1rem 2rem; }
  .results-container     { padding: 1.5rem 1rem; }
  .nav-container         { padding: 0 1rem; }
  .hero-inner            { padding: 3rem 0 1.5rem; }
  .hero-title            { font-size: 1.75rem; }
}

@media (max-width: 767px) {
  .content-layout   { flex-direction: column; }
  .content-aside    { display: none !important; }
  .search-wrap      { min-width: 100%; max-width: 100%; }
  .page-header-inner { flex-direction: column; align-items: flex-start; }
}
