/* ============================================================
   ShaSWi Design System — shaswi.css
   Drop-in replacement stylesheet. Link this from every page.
   ============================================================ */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;600&display=swap');

/* ---------- Tokens ---------- */
:root {
  /* Palette */
  --c-bg:         #0d1117;   /* deep ink background */
  --c-surface:    #161b22;   /* card / nav surface */
  --c-surface2:   #1c2128;   /* elevated surface */
  --c-border:     #30363d;   /* subtle divider */
  --c-border2:    #21262d;   /* hairline */

  --c-primary:    #3b82f6;   /* ShaSWi blue — electric, confident */
  --c-primary-h:  #60a5fa;   /* hover */
  --c-primary-dim:#1d3557;   /* tinted backgrounds */
  --c-accent:     #f59e0b;   /* amber — warmth, Nepal flag gold */
  --c-accent-dim: #451a03;

  --c-text:       #e6edf3;   /* primary text */
  --c-text-2:     #8b949e;   /* secondary / muted */
  --c-text-3:     #484f58;   /* placeholder */

  --c-success:    #22c55e;
  --c-danger:     #ef4444;

  /* Typography */
  --f-sans:  'Plus Jakarta Sans', system-ui, sans-serif;
  --f-mono:  'JetBrains Mono', 'Fira Code', monospace;

  /* Scale */
  --fs-xs:   0.72rem;
  --fs-sm:   0.85rem;
  --fs-base: 1rem;
  --fs-md:   1.1rem;
  --fs-lg:   1.3rem;
  --fs-xl:   1.65rem;
  --fs-2xl:  2.2rem;
  --fs-3xl:  3rem;

  /* Spacing */
  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
  --sp-8: 32px; --sp-10: 40px; --sp-12: 48px; --sp-16: 64px;

  /* Radii */
  --r-sm: 6px; --r-md: 10px; --r-lg: 16px; --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.6);
  --shadow-blue: 0 0 0 3px rgba(59,130,246,.35);

  /* Layout */
  --max-w: 1160px;
  --nav-h: 64px;

  /* ── Unified Breakpoint Tokens ──
     Use these consistently instead of ad-hoc px values.
     bp-sm  = small phones      (≤ 480px)
     bp-md  = large phones      (≤ 768px)
     bp-lg  = tablets/landscape (≤ 960px)
  */
  --bp-sm: 480px;
  --bp-md: 768px;
  --bp-lg: 960px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  background: var(--c-bg);
  color: var(--c-text);
  min-height: 100vh;
}
img, video, svg { display: block; max-width: 100%; }
a { color: var(--c-primary-h); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; border: none; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ============================================================
   NAV
   ============================================================ */
.sw-nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(13,17,23,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border2);
  display: flex; align-items: center;
}
.sw-nav__inner {
  width: 100%; max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--sp-6);
  display: flex; align-items: center; gap: var(--sp-6);
}
.sw-nav__logo {
  display: flex; align-items: center; gap: var(--sp-3);
  font-size: var(--fs-lg); font-weight: 800; color: var(--c-text);
  white-space: nowrap; flex-shrink: 0;
  text-decoration: none;
}
.sw-nav__logo img { height: 32px; width: auto; }
.sw-nav__logo:hover { text-decoration: none; color: var(--c-primary-h); }

.sw-nav__links {
  display: flex; align-items: center; gap: var(--sp-1);
  margin-left: auto;
}
.sw-nav__links a {
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm); font-weight: 600;
  color: var(--c-text-2);
  transition: color .15s, background .15s;
  text-decoration: none;
}
.sw-nav__links a:hover,
.sw-nav__links a.active {
  color: var(--c-text);
  background: var(--c-surface2);
}

/* Mobile hamburger */
.sw-nav__burger {
  display: none;
  flex-direction: column; gap: 5px;
  margin-left: auto; padding: var(--sp-2);
  background: none; border: none;
}
.sw-nav__burger span {
  display: block; width: 22px; height: 2px;
  background: var(--c-text-2); border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

/* Quick Apps strip */
.sw-quickbar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border2);
  overflow-x: auto; scrollbar-width: none;
}
.sw-quickbar::-webkit-scrollbar { display: none; }
.sw-quickbar__inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 var(--sp-6);
  display: flex; align-items: center; gap: var(--sp-2);
  height: 42px; white-space: nowrap;
}
.sw-quickbar__label {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--c-text-3); flex-shrink: 0;
  padding-right: var(--sp-3);
  border-right: 1px solid var(--c-border);
}
.sw-quickbar a {
  font-size: var(--fs-xs); font-weight: 600;
  color: var(--c-text-2);
  padding: 4px 10px;
  border-radius: var(--r-full);
  border: 1px solid transparent;
  transition: all .15s;
  text-decoration: none;
  flex-shrink: 0;
}
.sw-quickbar a:hover {
  color: var(--c-primary-h);
  border-color: var(--c-primary);
  background: rgba(59,130,246,.08);
}

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.sw-container {
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-6);
}
.sw-section { padding: var(--sp-16) 0; }
.sw-section--sm { padding: var(--sp-10) 0; }

.sw-eyebrow {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--c-primary);
  margin-bottom: var(--sp-4);
}
.sw-eyebrow::before {
  content: ''; display: block;
  width: 16px; height: 2px; background: var(--c-primary);
  border-radius: 2px;
}

h1.sw-title {
  font-size: clamp(var(--fs-2xl), 5vw, var(--fs-3xl));
  font-weight: 800; line-height: 1.15;
  letter-spacing: -.02em; color: var(--c-text);
}
h2.sw-h2 {
  font-size: clamp(var(--fs-xl), 3vw, var(--fs-2xl));
  font-weight: 700; letter-spacing: -.01em; color: var(--c-text);
}
h3.sw-h3 {
  font-size: var(--fs-lg); font-weight: 700; color: var(--c-text);
}
p.sw-lead {
  font-size: var(--fs-md); color: var(--c-text-2); max-width: 580px;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.sw-btn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 10px 22px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm); font-weight: 700;
  transition: all .15s; cursor: pointer; text-decoration: none;
  white-space: nowrap;
}
.sw-btn--primary {
  background: var(--c-primary); color: #fff;
  border: 1px solid var(--c-primary);
}
.sw-btn--primary:hover {
  background: var(--c-primary-h); border-color: var(--c-primary-h);
  text-decoration: none; color: #fff;
  box-shadow: 0 0 0 4px rgba(59,130,246,.2);
}
.sw-btn--secondary {
  background: var(--c-surface2); color: var(--c-text);
  border: 1px solid var(--c-border);
}
.sw-btn--secondary:hover {
  background: var(--c-surface); border-color: var(--c-text-2);
  text-decoration: none; color: var(--c-text);
}
.sw-btn--ghost {
  background: transparent; color: var(--c-primary-h);
  border: 1px solid var(--c-primary);
}
.sw-btn--ghost:hover {
  background: rgba(59,130,246,.1);
  text-decoration: none; color: var(--c-primary-h);
}
.sw-btn--accent {
  background: var(--c-accent); color: #000;
  border: 1px solid var(--c-accent);
}
.sw-btn--accent:hover {
  background: #fbbf24; text-decoration: none; color: #000;
}
.sw-btn--sm { padding: 7px 16px; font-size: var(--fs-xs); }
.sw-btn--lg { padding: 13px 30px; font-size: var(--fs-md); }

/* ============================================================
   CARDS
   ============================================================ */
.sw-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border2);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.sw-card:hover {
  border-color: var(--c-border);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.sw-card__icon {
  width: 44px; height: 44px; border-radius: var(--r-md);
  background: var(--c-primary-dim);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: var(--sp-4);
  flex-shrink: 0;
}
.sw-card__title { font-size: var(--fs-md); font-weight: 700; margin-bottom: var(--sp-2); }
.sw-card__desc { font-size: var(--fs-sm); color: var(--c-text-2); line-height: 1.55; }
.sw-card__link {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-sm); font-weight: 600; color: var(--c-primary-h);
  margin-top: var(--sp-4); text-decoration: none;
}
.sw-card__link:hover { text-decoration: underline; }

/* ============================================================
   TOOL PANEL (used on calculator / converter pages)
   ============================================================ */
.sw-panel {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
}
.sw-panel__title {
  font-size: var(--fs-lg); font-weight: 700;
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--c-border2);
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.sw-label {
  display: block; font-size: var(--fs-sm); font-weight: 600;
  color: var(--c-text-2); margin-bottom: var(--sp-2);
}
.sw-input, .sw-select, .sw-textarea {
  width: 100%;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  padding: 10px 14px;
  color: var(--c-text);
  font-size: var(--fs-base); font-family: var(--f-sans);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.sw-input:focus, .sw-select:focus, .sw-textarea:focus {
  border-color: var(--c-primary);
  box-shadow: var(--shadow-blue);
}
.sw-input::placeholder { color: var(--c-text-3); }
.sw-select option { background: var(--c-surface); }
.sw-form-row { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.sw-form-group { flex: 1; min-width: 200px; margin-bottom: var(--sp-5); }
.sw-input-group {
  display: flex; align-items: center;
  background: var(--c-bg); border: 1px solid var(--c-border);
  border-radius: var(--r-md); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.sw-input-group:focus-within {
  border-color: var(--c-primary); box-shadow: var(--shadow-blue);
}
.sw-input-group__pre,
.sw-input-group__post {
  padding: 10px 12px; background: var(--c-surface2);
  color: var(--c-text-2); font-size: var(--fs-sm); font-weight: 600;
  white-space: nowrap;
}
.sw-input-group input {
  flex: 1; border: none; background: transparent;
  padding: 10px 12px; color: var(--c-text);
  font-size: var(--fs-base); font-family: var(--f-sans);
  outline: none;
}

/* Checkbox / Toggle */
.sw-toggle { display: flex; align-items: center; gap: var(--sp-3); cursor: pointer; }
.sw-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.sw-toggle__track {
  width: 40px; height: 22px; background: var(--c-border);
  border-radius: var(--r-full); position: relative; flex-shrink: 0;
  transition: background .2s;
}
.sw-toggle input:checked ~ .sw-toggle__track { background: var(--c-primary); }
.sw-toggle__track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; background: #fff;
  border-radius: 50%; transition: transform .2s;
}
.sw-toggle input:checked ~ .sw-toggle__track::after { transform: translateX(18px); }
.sw-toggle__label { font-size: var(--fs-sm); font-weight: 600; color: var(--c-text-2); }

/* ============================================================
   RESULT DISPLAY
   ============================================================ */
.sw-result {
  background: var(--c-primary-dim);
  border: 1px solid rgba(59,130,246,.3);
  border-radius: var(--r-md);
  padding: var(--sp-5) var(--sp-6);
}
.sw-result__label { font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--c-primary-h); margin-bottom: var(--sp-2); }
.sw-result__value { font-size: var(--fs-xl); font-weight: 800; color: var(--c-text); font-family: var(--f-mono); }
.sw-result__sub { font-size: var(--fs-sm); color: var(--c-text-2); margin-top: 4px; }

/* Stat cards row */
.sw-stats { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.sw-stat {
  flex: 1; min-width: 140px;
  background: var(--c-surface2);
  border: 1px solid var(--c-border2);
  border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5);
}
.sw-stat__label { font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-3); text-transform: uppercase; letter-spacing: .06em; }
.sw-stat__value { font-size: var(--fs-xl); font-weight: 800; color: var(--c-text); font-family: var(--f-mono); margin: 4px 0 2px; }
.sw-stat__sub { font-size: var(--fs-xs); color: var(--c-text-2); }

/* ============================================================
   TABLE
   ============================================================ */
.sw-table-wrap { overflow-x: auto; border-radius: var(--r-md); border: 1px solid var(--c-border2); }
.sw-table {
  width: 100%; border-collapse: collapse;
  font-size: var(--fs-sm);
}
.sw-table th {
  background: var(--c-surface2); color: var(--c-text-2);
  padding: 10px 14px; text-align: left;
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}
.sw-table td {
  padding: 10px 14px; border-bottom: 1px solid var(--c-border2);
  color: var(--c-text); vertical-align: middle;
  font-family: var(--f-mono); font-size: var(--fs-xs);
}
.sw-table tr:last-child td { border-bottom: none; }
.sw-table tr:hover td { background: rgba(255,255,255,.025); }

/* ============================================================
   BADGE / TAG
   ============================================================ */
.sw-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 700;
}
.sw-badge--blue  { background: rgba(59,130,246,.15); color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.sw-badge--amber { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.sw-badge--green { background: rgba(34,197,94,.15);  color: #4ade80; border: 1px solid rgba(34,197,94,.3); }
.sw-badge--gray  { background: rgba(139,148,158,.1); color: #8b949e; border: 1px solid rgba(139,148,158,.2); }

/* ============================================================
   FAQ ACCORDION
   ============================================================ */
.sw-faq { border: 1px solid var(--c-border2); border-radius: var(--r-lg); overflow: hidden; }
.sw-faq__item { border-bottom: 1px solid var(--c-border2); }
.sw-faq__item:last-child { border-bottom: none; }
.sw-faq__q {
  width: 100%; text-align: left; padding: var(--sp-5) var(--sp-6);
  background: var(--c-surface); color: var(--c-text);
  font-size: var(--fs-base); font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-4); border: none; cursor: pointer;
  transition: background .15s;
}
.sw-faq__q:hover { background: var(--c-surface2); }
.sw-faq__arrow {
  flex-shrink: 0; font-size: 1rem; color: var(--c-text-3);
  transition: transform .25s; user-select: none;
}
.sw-faq__item.open .sw-faq__arrow { transform: rotate(180deg); }
.sw-faq__a {
  max-height: 0; overflow: hidden;
  background: var(--c-surface2);
  transition: max-height .3s ease, padding .3s;
  padding: 0 var(--sp-6);
  font-size: var(--fs-sm); color: var(--c-text-2); line-height: 1.65;
}
.sw-faq__item.open .sw-faq__a { max-height: 500px; padding: var(--sp-5) var(--sp-6); }

/* ============================================================
   FOOTER
   ============================================================ */
.sw-footer {
  background: var(--c-surface);
  border-top: 1px solid var(--c-border2);
  margin-top: var(--sp-16);
}
.sw-footer__main {
  max-width: var(--max-w); margin: 0 auto; padding: var(--sp-12) var(--sp-6);
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--sp-8);
}
.sw-footer__brand-name {
  font-size: var(--fs-lg); font-weight: 800; color: var(--c-text);
  display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3);
}
.sw-footer__brand-name img { height: 28px; }
.sw-footer__tagline { font-size: var(--fs-sm); color: var(--c-text-2); max-width: 260px; line-height: 1.6; }
.sw-footer__sponsor { font-size: var(--fs-xs); color: var(--c-text-3); margin-top: var(--sp-4); }
.sw-footer__col h4 {
  font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--c-text-3); margin-bottom: var(--sp-4);
}
.sw-footer__col a {
  display: block; font-size: var(--fs-sm); color: var(--c-text-2);
  padding: 4px 0; text-decoration: none; transition: color .15s;
}
.sw-footer__col a:hover { color: var(--c-text); }
.sw-footer__bottom {
  border-top: 1px solid var(--c-border2);
  max-width: var(--max-w); margin: 0 auto;
  padding: var(--sp-5) var(--sp-6);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--sp-4);
  font-size: var(--fs-xs); color: var(--c-text-3);
}

/* ============================================================
   HERO GRADIENT GLOW (signature element)
   ============================================================ */
.sw-glow {
  position: absolute; border-radius: 50%;
  filter: blur(80px); pointer-events: none; z-index: 0;
}
.sw-glow--blue {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(59,130,246,.18) 0%, transparent 70%);
}
.sw-glow--amber {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,.12) 0%, transparent 70%);
}

/* ============================================================
   RESPONSIVE — TABLET  (≤ 960px)
   ============================================================ */
@media (max-width: 960px) {
  .sw-container { padding: 0 var(--sp-5); }
  .sw-section   { padding: var(--sp-12) 0; }
  .sw-section--sm { padding: var(--sp-8) 0; }
}

/* ============================================================
   RESPONSIVE — MOBILE  (≤ 768px)
   ============================================================ */
@media (min-width: 769px) {
  /* Explicitly enforce desktop nav — prevents any cascade issues */
  .sw-nav__links {
    display: flex !important;
    position: static !important;
    flex-direction: row !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
  }
  .sw-nav__burger { display: none !important; }
  .sw-quickbar    { display: block !important; }
}

@media (max-width: 768px) {
  /* Nav */
  .sw-nav__links {
    display: none; position: absolute; top: var(--nav-h); left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--c-surface); border-bottom: 1px solid var(--c-border);
    padding: var(--sp-4); z-index: 99;
  }
  .sw-nav__links.open { display: flex; }
  .sw-nav__burger     { display: flex; }

  /* Footer */
  .sw-footer__main { grid-template-columns: 1fr 1fr; }

  /* Panels */
  .sw-panel { padding: var(--sp-5); }

  /* Stats stack vertically on mobile */
  .sw-stats { flex-direction: column; }

  /* Reduce hero padding on mobile */
  .sw-section { padding: var(--sp-10) 0; }

  /* Form rows become single-column */
  .sw-form-row { flex-direction: column; }
  .sw-form-group { min-width: unset; }

  /* FAQ button padding tighter */
  .sw-faq__q { padding: var(--sp-4) var(--sp-4); font-size: var(--fs-sm); }
  .sw-faq__a { padding: 0 var(--sp-4); }
  .sw-faq__item.open .sw-faq__a { padding: var(--sp-4); }

  /* Table scroll hint */
  .sw-table-wrap { -webkit-overflow-scrolling: touch; }
}

/* ============================================================
   RESPONSIVE — SMALL PHONES  (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  /* Footer single column */
  .sw-footer__main { grid-template-columns: 1fr; }
  .sw-footer__bottom { flex-direction: column; text-align: center; gap: var(--sp-2); }

  /* Container tighter padding */
  .sw-container { padding: 0 var(--sp-4); }

  /* Typography scale down slightly */
  h1.sw-title { font-size: var(--fs-2xl); }
  h2.sw-h2    { font-size: var(--fs-xl); }
  p.sw-lead   { font-size: var(--fs-base); }

  /* Buttons go full-width in stacked layouts */
  .sw-btn--lg { width: 100%; justify-content: center; }

  /* Quickbar label hidden on very small screens */
  .sw-quickbar__label { display: none; }

  /* Stat cards always stack */
  .sw-stats { flex-direction: column; }
  .sw-stat  { min-width: unset; }

  /* Eyebrow strip shorter */
  .sw-eyebrow::before { width: 10px; }

  /* Panel padding tight */
  .sw-panel { padding: var(--sp-4); }
}

/* ============================================================
   PRINT STYLESHEET
   ============================================================ */
@media print {
  /* Hide navigation chrome */
  .sw-nav, .sw-quickbar, .sw-footer,
  .sw-btn, button, .receipt-actions,
  .sn-toolbar, .sn-note__actions,
  .sw-faq__arrow { display: none !important; }

  body { background: #fff !important; color: #000 !important; font-size: 11pt; }

  /* Expand panels for print */
  .sw-panel, .sw-card, .conv-card, .tri-card {
    background: #fff !important; border: 1px solid #ccc !important;
    box-shadow: none !important; break-inside: avoid;
  }

  /* Tables print cleanly */
  .sw-table th { background: #f0f0f0 !important; color: #000 !important; }
  .sw-table td { color: #000 !important; }
  .sw-table-wrap { overflow: visible !important; }

  /* Receipt prints white */
  .receipt-preview { box-shadow: none !important; max-width: 100% !important; }

  /* Ensure links show their href */
  a[href]::after { content: ' (' attr(href) ')'; font-size: 9pt; color: #555; }
  a[href^="#"]::after,
  a[href^="javascript"]::after { content: ''; }

  /* Page breaks */
  h1, h2, h3 { break-after: avoid; }
  img { max-width: 100% !important; }

  /* Show full FAQ answers in print */
  .sw-faq__a { max-height: none !important; padding: var(--sp-4) var(--sp-5) !important; }
}

/* ============================================================
   LIGHT MODE  (prefers-color-scheme: light)
   ============================================================ */
@media (prefers-color-scheme: light) {
  :root {
    --c-bg:       #f6f8fa;
    --c-surface:  #ffffff;
    --c-surface2: #f0f2f5;
    --c-border:   #d0d7de;
    --c-border2:  #e1e4e8;

    --c-primary:    #1d6ff2;
    --c-primary-h:  #1558cc;
    --c-primary-dim:#dbeafe;

    --c-accent:     #d97706;
    --c-accent-dim: #fef3c7;

    --c-text:   #1f2328;
    --c-text-2: #57606a;
    --c-text-3: #8c959f;

    --c-success: #1a7f37;
    --c-danger:  #cf222e;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.12);
    --shadow-md:  0 4px 16px rgba(0,0,0,.1);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.12);
    --shadow-blue: 0 0 0 3px rgba(29,111,242,.25);
  }

  /* Nav glass effect in light mode */
  .sw-nav { background: rgba(246,248,250,.92); }

  /* Table header */
  .sw-table th { background: var(--c-surface2); color: var(--c-text-2); }
  .sw-table tr:hover td { background: rgba(0,0,0,.02); }

  /* Input backgrounds */
  .sw-input, .sw-select, .sw-textarea,
  .unit-input, .typing-ta {
    background: #fff;
    color: var(--c-text);
  }
  .sw-input-group { background: #fff; }
  .sw-input-group__pre,
  .sw-input-group__post { background: var(--c-surface2); color: var(--c-text-2); }

  /* Swap/action buttons */
  .swap-btn { background: var(--c-surface2); color: var(--c-text-2); }

  /* Result cards */
  .sw-result { background: var(--c-primary-dim); }
  .sw-stat   { background: var(--c-surface2); }

  /* FAQ */
  .sw-faq__q { background: var(--c-surface); color: var(--c-text); }
  .sw-faq__q:hover { background: var(--c-surface2); }
  .sw-faq__a { background: var(--c-surface2); }

  /* Cards hover */
  .sw-card:hover { border-color: var(--c-primary); }

  /* Area / Unit converter chips */
  .unit-chip { background: var(--c-surface2); }
  .all-units-grid .unit-chip { background: var(--c-surface2); border-color: var(--c-border); }

  /* Receipt preview (already white bg — keep it) */
  .receipt-preview { box-shadow: 0 4px 20px rgba(0,0,0,.15); }

  /* Sticky notes board */
  .sn-board { background: #eef1f5; }
  .sn-toolbar { background: var(--c-surface); border-color: var(--c-border); }
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */
.sw-flex        { display: flex; }
.sw-flex-center { display: flex; align-items: center; justify-content: center; }
.sw-gap-2       { gap: var(--sp-2); }
.sw-gap-4       { gap: var(--sp-4); }
.sw-gap-6       { gap: var(--sp-6); }
.sw-grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-5); }
.sw-grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-5); }
.sw-grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--sp-4); }
.sw-mt-4  { margin-top: var(--sp-4); }
.sw-mt-6  { margin-top: var(--sp-6); }
.sw-mt-8  { margin-top: var(--sp-8); }
.sw-mb-4  { margin-bottom: var(--sp-4); }
.sw-mb-6  { margin-bottom: var(--sp-6); }
.sw-text-center { text-align: center; }
.sw-text-muted  { color: var(--c-text-2); }
.sw-mono        { font-family: var(--f-mono); }
.sw-sr-only     { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0; }

/* ============================================================
   SHARED NAV JS (hamburger toggle) — inline convenience
   ============================================================ */
