/* ─── FONTS ─────────────────────────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600&family=DM+Mono:wght@400;500&display=swap');

/* ─── VARIABLES ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #F6F5F0;
  --surface: #FFFFFF;
  --surface-2: #F0EFE9;
  --border: #E2E0D8;
  --border-strong: #C8C6BC;
  --text: #1A1917;
  --text-2: #6B6963;
  --text-3: #9B9992;
  --accent: #1A6B4A;
  --accent-light: #E8F4EE;
  --accent-dark: #145538;
  --brand-blue: #0052CC;
  --brand-blue-light: #E8F0FF;
  --orange: #C85A1A;
  --orange-light: #FDF0E8;
  --blue: #1A4FA0;
  --blue-light: #EAF0FA;
  --red: #B83232;
  --red-light: #FAEAEA;
  --yellow: #B07800;
  --yellow-light: #FFF7E0;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 16px rgba(0,0,0,0.07), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.1);
  --radius: 14px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --font: 'DM Sans', sans-serif;
  --mono: 'DM Mono', monospace;
  --transition: 0.15s ease;
}

/* ─── RESET ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: var(--font); cursor: pointer; border: none; background: none; }
input, select { font-family: var(--font); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── LAYOUT ─────────────────────────────────────────────────────────────────── */
.page {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 80px;
  background: linear-gradient(180deg, #fafafa 0%, var(--bg) 200px);
  min-height: 100vh;
  position: relative;
}

/* Subtle grain overlay for premium texture */
.page::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  opacity: 0.015;
  pointer-events: none;
  z-index: -1;
}

/* ─── TIP BAR ───────────────────────────────────────────────────────────────── */
.tip-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  margin-bottom: 16px;
  background: var(--accent-light);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-2);
  flex-wrap: wrap;
}
.tip-bar-emoji { font-size: 16px; flex-shrink: 0; }
.tip-bar-text { flex: 1; min-width: 120px; }
.tip-bar-upi {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.tip-bar-upi-id { white-space: nowrap; }
.tip-bar-copy {
  color: var(--accent);
  display: flex;
  align-items: center;
  padding: 2px;
  transition: opacity var(--transition);
}
.tip-bar-copy:hover { opacity: 0.7; }

/* ─── HEADER ─────────────────────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 20px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 28px;
}
.header-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-title .logo-dot {
  width: 10px; height: 10px;
  background: var(--accent);
  border-radius: 50%;
  display: inline-block;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

#lang-btn {
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border-strong);
  color: var(--text-2);
  background: var(--surface);
  transition: all var(--transition);
}
#lang-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ─── CARD ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

/* ─── SEARCH ─────────────────────────────────────────────────────────────────── */
.search-wrap { position: relative; margin-bottom: 16px; }
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  transition: border-color var(--transition);
}
.search-input-wrap:focus-within {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26, 107, 74, 0.15);
}
.search-icon { 
  color: var(--text-3); 
  flex-shrink: 0; 
  transition: color 0.2s;
}
.search-input-wrap:hover .search-icon { color: var(--accent); }
#search-input {
  flex: 1; border: none; background: none;
  font-size: 14px; color: var(--text);
  outline: none;
}
#search-input::placeholder { color: var(--text-3); }

#search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 100;
  overflow: hidden;
  display: none;
}
.search-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: var(--surface-2); }
.si-name { font-size: 13px; font-weight: 500; color: var(--text); }
.si-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.si-cat { font-size: 11px; color: var(--text-3); }
.si-rate {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--mono);
}
.rate-0 { background: var(--surface-2); color: var(--text-3); }
.rate-5 { background: var(--blue-light); color: var(--blue); }
.rate-18 { background: var(--accent-light); color: var(--accent); }
.rate-40 { background: var(--red-light); color: var(--red); }

/* ─── SLAB PILLS ─────────────────────────────────────────────────────────────── */
.slab-label {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-bottom: 8px;
  display: block;
}
.slab-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.slab-pill {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  background: var(--surface-2);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--mono);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
.slab-pill:hover { 
  border-color: var(--border-strong); 
  color: var(--text); 
  background: var(--surface);
}
.slab-pill.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,107,74,0.35);
  transform: scale(1.03);
}
.slab-pill[data-rate="40"].selected {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 4px 12px rgba(184,50,50,0.35);
}
.slab-pill[data-rate="0"].selected {
  background: var(--text-2);
  border-color: var(--text-2);
}
.slab-icon {
  font-size: 16px;
  line-height: 1;
}

/* ─── AMOUNT + TOGGLES ───────────────────────────────────────────────────────── */
.amount-section {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin: 16px 0;
}
.amount-wrap {
  flex: 1;
  position: relative;
}
.amount-prefix {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 500;
  color: var(--text-3);
  pointer-events: none;
}
#amount-input {
  width: 100%;
  padding: 12px 14px 12px 28px;
  font-size: 22px;
  font-weight: 600;
  font-family: var(--mono);
  color: var(--text);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition);
}
#amount-input:focus { 
  border-color: var(--accent); 
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(26, 107, 74, 0.15);
  outline: none;
}
#amount-input::placeholder { color: var(--text-3); font-size: 16px; font-weight: 400; }

/* .toggles { display: flex; flex-direction: column; gap: 6px; } */

.toggle-group {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.mode-btn, .tx-btn {
  flex: 1;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-3);
  text-align: center;
  transition: all var(--transition);
  white-space: nowrap;
}
.mode-btn.active {
  background: var(--accent);
  color: #fff;
}
/* .tx-btn.active {
  background: var(--blue);
  color: #fff;
} */

/* ─── RESULT ─────────────────────────────────────────────────────────────────── */
.no-result {
  text-align: center;
  color: var(--text-3);
  font-size: 14px;
  padding: 20px 0;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.result-row:last-child { border-bottom: none; }
.result-row.highlight {
  padding: 12px 0 14px;
  border-bottom: 1.5px solid var(--border);
  margin-bottom: 8px;
}
.result-row.total-row { border-top: 1.5px solid var(--border); margin-top: 4px; padding-top: 10px; }
.rl { font-size: 13px; color: var(--text-2); }
.rv { font-size: 15px; font-weight: 600; color: var(--text); font-family: var(--mono); }
.rv.big { 
  font-size: clamp(32px, 6vw, 48px); 
  color: var(--accent);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

/* count-up animation for result value */
@keyframes countUp {
  from { opacity: 0.6; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.result-row.highlight .rv.big {
  animation: countUp 0.4s ease-out both;
}

/* bar */
.bar-vis { margin: 12px 0; }
.bar-track-vis {
  display: flex;
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
  background: var(--surface-2);
}
.bar-base { background: var(--blue); transition: width 0.3s ease; }
.bar-gst { background: var(--accent); transition: width 0.3s ease; }
.bar-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-3);
  flex-wrap: wrap;
}
.bar-labels span { display: flex; align-items: center; gap: 4px; }
.dot { width: 7px; height: 7px; border-radius: 2px; flex-shrink: 0; }
.dot-base { background: var(--blue); }
.dot-gst { background: var(--accent); }

.breakdown { margin-top: 4px; }

/* action row */
.action-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.act-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  color: var(--text-2);
  background: var(--surface-2);
  transition: all var(--transition);
}
.act-btn:hover { 
  border-color: var(--border-strong); 
  color: var(--text); 
  transform: translateY(-1px);
}
.act-btn:active { transform: scale(0.97); }
.act-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.act-btn.primary:hover { 
  background: var(--accent-dark); 
  border-color: var(--accent-dark);
}
.act-btn.primary:active { background: #0f3d2a; }
.act-btn.copied {
  background: #059669 !important;
  border-color: #059669 !important;
}

/* ─── INVOICE ─────────────────────────────────────────────────────────────────── */
.invoice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.invoice-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.invoice-desc {
  font-size: 12px;
  color: var(--text-3);
  margin-top: 1px;
}
#toggle-invoice {
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  transition: all var(--transition);
}
#toggle-invoice:hover { background: var(--surface-2); color: var(--text); }

.new-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--red);
  background: var(--red-light);
  padding: 3px 6px;
  border-radius: 4px;
  opacity: 0.9;
}

#invoice-section { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
#invoice-section.open { display: block; }

.inv-header-row {
  display: grid;
  grid-template-columns: 3fr 50px 80px 60px 24px;
  gap: 6px;
  margin-bottom: 6px;
}
.inv-header-row span {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.inv-header-row span:last-child {
  display: none;  /* hide remove-button header label */
}
.inv-row {
  display: grid;
  grid-template-columns: 3fr 50px 80px 60px 24px;
  gap: 6px;
  margin-bottom: 2px;
  align-items: center;
}
.inv-input {
  padding: 7px 10px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  outline: none;
  width: 100%;
  transition: border-color var(--transition);
}
.inv-input:focus { border-color: var(--accent); background: var(--surface); }
.inv-rate { text-align: right; }
.inv-total {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
  text-align: right;
}
.inv-remove {
  font-size: 13px;
  color: var(--text-3);
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}
 .inv-remove:hover { color: var(--red); }

 /* Print-only subtotal column (hidden on screen) */
 .inv-total-print { display: none; }
 .inv-header-subtotal { display: none; }

 .inv-row-subtotal {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 2px 0 6px;
  font-size: 12px;
  color: var(--text-2);
  margin-left: 2px;
}
.inv-row-subtotal .inv-total {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.inv-totals {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1.5px solid var(--border);
}
.inv-total-row {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 13px;
  color: var(--text-2);
}
.inv-total-row.grand {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 4px;
  padding-top: 10px;
}

#add-invoice-row {
  margin-top: 10px;
  width: 100%;
  padding: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  border: 1.5px dashed var(--accent);
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  transition: all var(--transition);
}
#add-invoice-row:hover { background: #d4ede1; }

/* ─── SEO CONTENT ────────────────────────────────────────────────────────────── */
.seo-section {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1.5px solid var(--border);
}
.seo-section h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.seo-section h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 20px 0 8px;
}
.seo-section p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: 12px;
}
.slab-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 20px;
  font-size: 13px;
}
.slab-table th {
  background: var(--surface-2);
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1.5px solid var(--border);
}
.slab-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-2);
}
.slab-table tr:last-child td { border-bottom: none; }
.slab-table tr:hover td { background: var(--surface-2); }

/* ─── TOAST ──────────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 20px;
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── FOOTER ─────────────────────────────────────────────────────────────────── */
.site-footer {
  margin-top: 48px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

/* ─── STICKY CTA (MOBILE) ─────────────────────────────────────────────────────── */
.sticky-cta {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1.5px solid var(--border);
  padding: 10px 16px;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 1000;
  display: none;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}
.sticky-cta.visible {
  display: block;
  transform: translateY(0);
}
.sticky-copy-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.sticky-copy-btn:hover { background: var(--accent-dark); }
.sticky-copy-btn:active { transform: scale(0.98); }

@media (max-width: 768px) {
  .sticky-cta.visible { display: block; }
}

/* ─── RESPONSIVE ─────────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
  .page { padding: 0 12px 60px; }
  .header { padding: 16px 0 16px; margin-bottom: 20px; }
  .header-title { font-size: 18px; }
  #amount-input { font-size: 18px; }
  .rv.big { font-size: 24px; }
  .amount-section { flex-direction: column; }
  .toggle-group { flex: 1; }
  .inv-header-row, .inv-row {
    grid-template-columns: 2.5fr 45px 70px 55px 22px;
    gap: 5px;
  }
  .slab-pills { gap: 5px; }
  .slab-pill { padding: 5px 12px; font-size: 12px; min-height: 40px; }
  
}
  .slab-pills { gap: 5px; }
  .slab-pill { padding: 5px 12px; font-size: 12px; min-height: 40px; }



@media (max-width: 380px) {
  .inv-header-row, .inv-row {
    grid-template-columns: 3fr 35px 55px 40px 18px;
    gap: 4px;
  }
  .inv-input {
    padding: 4px 6px;
    font-size: 12px;
  }
  .inv-total {
    font-size: 12px;
  }
}


/* ─── ANIMATIONS ─────────────────────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card { animation: fadeIn 0.3s ease both; }
.card:nth-child(2) { animation-delay: 0.05s; }
.card:nth-child(3) { animation-delay: 0.1s; }

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

@keyframes countUp {
  from { opacity: 0.6; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.seo-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.seo-summary:hover { background: var(--surface-2); }
.seo-summary::after {
  content: '+';
  font-size: 18px;
  font-weight: 400;
  color: var(--text-3);
  transition: transform 0.2s;
}
.seo-details[open] .seo-summary::after {
  content: '−';
  transform: rotate(180deg);
}
.seo-section {
  padding: 0 20px 20px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

/* ─── ADSENSE SLOTS ──────────────────────────────────────────────────────────── */
.ad-slot {
  width: 100%;
  min-height: 90px;
  background: var(--surface-2);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-3);
  font-size: 11px;
  margin: 8px 0;
}

/* ─── DARK MODE ─────────────────────────────────────────────────────────────── */
html.dark {
  --bg: #111110;
  --surface: #1A1A18;
  --surface-2: #242422;
  --border: #333330;
  --border-strong: #444440;
  --text: #E8E6E0;
  --text-2: #9B998E;
  --text-3: #6B6A62;
  --accent: #2BD48A;
  --accent-light: #1A3A2E;
  --accent-dark: #4AE8A0;
  --brand-blue: #4A9EFF;
  --brand-blue-light: #1A2E4A;
  --orange: #F07030;
  --orange-light: #3A2A1A;
  --blue: #6A9EFF;
  --blue-light: #1A2A4A;
  --red: #F06050;
  --red-light: #3A1A1A;
  --yellow: #E0A020;
  --yellow-light: #3A2A0A;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
  --shadow: 0 4px 16px rgba(0,0,0,0.4), 0 1px 4px rgba(0,0,0,0.3);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.5);
}
html.dark .page::before { opacity: 0.03; }
html.dark .slab-pill.selected { color: #111; }
html.dark .slab-pill[data-rate="40"].selected { color: #111; }
html.dark .slab-pill[data-rate="0"].selected { color: #fff; }
html.dark #amount-input { color-scheme: dark; }
html.dark select { color-scheme: dark; }

/* ─── PRINT STYLES ──────────────────────────────────────────────────────────── */
@media print {
  body.printing * { animation: none !important; transition: none !important; }
  body.printing .header { display: flex !important; border-bottom: 2px solid #000; margin-bottom: 16px; }
  body.printing .header-actions { display: none !important; } /* Hide dark mode + lang buttons when printing */
  body.printing .tip-bar,
  body.printing .search-wrap,
  body.printing .slab-section,
  body.printing .amount-section,
  /* body.printing .toggles, */
  body.printing #result-box,
  body.printing .action-row,
  body.printing .sticky-cta,
  body.printing .seo-details,
  body.printing .site-footer,
  body.printing #add-invoice-row,
  body.printing #toggle-invoice,
  body.printing .new-badge,
  body.printing .inv-remove,
  body.printing .print-invoice-btn,
  body.printing .toast,
  body.printing #tip-modal,
  body.printing .ad-slot,
  body.printing [class*="ad-"] { display: none !important; }

  body.printing .card {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
  }
  body.printing .page { max-width: 100%; padding: 0; background: #fff; }
  body.printing .page::before { display: none !important; }
  body.printing #invoice-section { display: block !important; }
   body.printing #main-calculator { max-width: 100%; }
   body.printing .inv-header-row {
     grid-template-columns: 2fr 60px 100px 70px 80px 28px;  /* 6-col: item | qty | rate | gst | subtotal | remove */
   }
    body.printing .inv-header-subtotal { display: block; text-align: right; }
   body.printing .inv-row {
     grid-template-columns: 2fr 60px 100px 70px 80px 28px;  /* 6-col: item | qty | rate | gst | subtotal | remove */
     break-inside: avoid;
     page-break-inside: avoid;
   }
   body.printing .inv-row-subtotal {
     display: none !important;  /* hide the separate subtotal line in print */
   }
   body.printing .inv-total-print {
     display: block;  /* show subtotal column in print */
     text-align: right;
     font-size: 13px;
     padding-right: 4px;
   }
   body.printing .inv-total { text-align: right; }
   body.printing .inv-input { border: none !important; background: none !important; padding: 4px 6px; }
   body.printing select.inv-gst { appearance: none; -webkit-appearance: none; padding: 4px 6px; }
   body.printing .inv-totals { border-top: 2px solid #000; }
   body.printing .inv-total-row.grand { border-top: 1px solid #000; font-size: 16px; }
   body.printing #invoice-footer { margin-top: 8px; }
   body, html { background: #fff !important; color: #000 !important; font-size: 12px; }
   @page { margin: 15mm 10mm; }
}

/* ─── LEGAL / INFO PAGES ─────────────────────────────────────────────────────── */
.legal-page {
  max-width: 680px;
  margin: 24px auto;
  padding: 0 16px 40px;
  font-size: 14px;
  line-height: 1.6;
}
.legal-page h1 {
  font-size: 20px;
  margin-bottom: 16px;
  line-height: 1.3;
  color: var(--text);
}
.legal-page h2 {
  font-size: 16px;
  margin: 24px 0 8px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}
.legal-page p {
  margin-bottom: 12px;
  color: var(--text-2);
}
.legal-page ul {
  margin: 8px 0 12px 20px;
  color: var(--text-2);
}
.legal-page li {
  margin-bottom: 4px;
}
.legal-page a {
  color: var(--accent);
  text-decoration: underline;
}
.legal-page a:hover {
  text-decoration: none;
}
.legal-page code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface-2);
  padding: 2px 4px;
  border-radius: 3px;
}
.legal-page .back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--accent);
  font-weight: 500;
}
.legal-page .back-link:hover {
  text-decoration: underline;
}
.legal-page .card {
  padding: 24px;
}


/* ─── TIP JAR MODAL ─────────────────────────────────────────────────────────── */
.tip-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.tip-modal-content {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px 24px;
  max-width: 360px;
  width: 90%;
  position: relative;
  text-align: center;
  box-shadow: var(--shadow);
  animation: fadeInUp 0.3s ease;
}
.tip-close {
  position: absolute;
  top: 12px;
  right: 16px;
  font-size: 24px;
  color: var(--text-3);
  padding: 4px;
  line-height: 1;
  transition: color var(--transition);
}
.tip-close:hover { color: var(--text); }
.tip-emoji { font-size: 48px; margin-bottom: 8px; }
.tip-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}
.tip-text {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.5;
  margin-bottom: 16px;
}
.tip-upi-detail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--surface-2);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
}
.tip-upi-label {
  font-size: 12px;
  color: var(--text-3);
}
.tip-upi-id {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  font-family: var(--mono);
}
.tip-copy-upi {
  color: var(--accent);
  padding: 4px;
  display: flex;
  align-items: center;
  transition: opacity var(--transition);
}
.tip-copy-upi:hover { opacity: 0.7; }
.tip-qr {
  width: 160px;
  height: 160px;
  margin: 0 auto 12px;
  background: var(--surface-2);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tip-qr-fallback {
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
  line-height: 1.4;
}
.tip-footer-text {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* ─── PRINT INVOICE BUTTON ──────────────────────────────────────────────────── */
.print-invoice-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  transition: all var(--transition);
}
.print-invoice-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

/* ─── GST DUE DATE COUNTDOWN ─────────────────────────────────────────────── */
.gst-due-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  margin: 0 16px 16px;
  background: var(--accent-light);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--accent-dark);
  line-height: 1.4;
}
.gst-due-banner .gst-due-icon { font-size: 16px; }
.gst-due-banner .gst-due-countdown {
  font-weight: 600;
  color: var(--accent);
}
.gst-due-banner .gst-due-target {
  color: var(--text-3);
  font-size: 12px;
}
/* Urgent state (within 7 days) */
.gst-due-banner.urgent {
  background: var(--red-light);
  border-color: var(--red);
  color: var(--red);
}
.gst-due-banner.urgent .gst-due-countdown { color: var(--red); }


/* ─── REMOVE NUMBER INPUT SPINNERS ─────────────────────────────────────────── */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield; /* Firefox */
  appearance: textfield;
}
