/* MeroKalam.com official nepal-vat-bill-calculator styles. Unauthorized copying or republication is not permitted. */
/* ═══════════════════════════════════════════════════
   VAT & Bill Calculator — tool-specific CSS only
   Base tokens, nav, footer, accordion, share-bar
   handled by main.css + mk-shared.css
═══════════════════════════════════════════════════ */

/* Warm cream body override (mk-shared sets cold blue-grey) */
body { background: linear-gradient(160deg, #faf8f4 0%, #f3efe8 100%) !important; min-height: 100vh; }

/* Page container */
.page { max-width: 1100px !important; padding-top: 0 !important; }

/* Header */
.header {
  text-align: center; margin-bottom: .75rem; padding: 1.1rem 1rem .6rem;
  background: linear-gradient(180deg, rgba(255,255,255,.72) 0%, transparent 100%);
  border-bottom: 1px solid rgba(37,99,235,.08);
  margin-left: -1rem; margin-right: -1rem; padding-left: 2rem; padding-right: 2rem;
}
.header h1 {
  font-size: clamp(1.75rem, 5vw, 2.6rem); font-weight: 800; letter-spacing: -.025em; line-height: 1.1;
  background: linear-gradient(135deg, #2563eb 0%, #0891b2 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: .5rem;
}
.header p { font-size: .93rem; color: #64748b; width: 100%; max-width: none; margin: 0; line-height: 1.65; text-align: left; }
.ne { font-family: 'Noto Sans Devanagari', sans-serif; }

/* ── VAT Mode bar (the central toggle) ── */
.vat-mode-bar {
  display: grid; grid-template-columns: 1fr 1fr;
  background: #e8e2d8; gap: 2px;
  border: 1.5px solid #e8e2d8; border-radius: .85rem; overflow: hidden;
  margin-bottom: 1.25rem;
}
.vm-btn {
  padding: .75rem .9rem; border: none; font-family: inherit; cursor: pointer;
  background: #f8fafc; color: #374151; text-align: center; transition: background .15s, color .15s;
}
.vm-btn .vm-title { font-size: .8rem; font-weight: 700; display: block; letter-spacing: -.01em; }
.vm-btn .vm-sub { font-size: .68rem; color: #94a3b8; display: block; margin-top: 2px; line-height: 1.4; }
.vm-btn.on.excl { background: #fdf1f0; }
.vm-btn.on.excl .vm-title { color: #c0392b; }
.vm-btn.on.incl { background: #e8f5ee; }
.vm-btn.on.incl .vm-title { color: #0f7b3e; }
.vm-btn:not(.on):hover { background: #e2e8f0; }

/* ── Calc grid ── */
.calc-grid {
  display: grid; grid-template-columns: minmax(0,1.15fr) minmax(0,1fr);
  gap: 1.25rem; align-items: start; margin-bottom: 1.75rem;
}
@media(max-width:820px) { .calc-grid { grid-template-columns: 1fr; } }
.input-col { display: flex; flex-direction: column; gap: 1rem; }

/* ── Items table ── */
.col-labels {
  display: grid; grid-template-columns: 1fr 58px 90px 26px;
  gap: 5px; font-size: .65rem; font-weight: 700; letter-spacing: .09em;
  text-transform: uppercase; color: #94a3b8; margin-bottom: .5rem;
}
.item-row { display: grid; grid-template-columns: 1fr 58px 90px 26px; gap: 5px; align-items: center; }
@media(max-width:440px) {
  .col-labels, .item-row { grid-template-columns: 1fr 50px 78px 24px; gap: 3px; }
}
.items-list { display: flex; flex-direction: column; gap: 5px; margin-bottom: .75rem; min-height: 4px; }

/* Compact item inputs */
.item-inp {
  width: 100%; background: #f8fafc; border: 1.5px solid #e8e2d8; border-radius: .5rem;
  color: #1e293b; font-family: 'JetBrains Mono', monospace; font-size: .78rem;
  padding: .42rem .5rem; outline: none; transition: border-color .2s, box-shadow .2s;
  -moz-appearance: textfield;
}
.item-inp::-webkit-outer-spin-button, .item-inp::-webkit-inner-spin-button { -webkit-appearance: none; }
.item-inp:focus { border-color: #2563eb; box-shadow: 0 0 0 2px rgba(37,99,235,.1); background: #fff; }
.item-inp::placeholder { color: #cbd5e1; }
.item-inp.name { font-family: inherit; font-size: .82rem; }

.btn-rem {
  width: 24px; height: 32px; background: none; border: 1.5px solid #e8e2d8;
  border-radius: .45rem; color: #94a3b8; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 14px; transition: all .15s; flex-shrink: 0;
}
.btn-rem:hover { background: #fdf1f0; border-color: #fca5a5; color: #c0392b; }

.btn-add-item {
  width: 100%; padding: .55rem; background: none; border: 1.5px dashed #d4cec4;
  border-radius: .65rem; color: #94a3b8; font-family: inherit; font-size: .8rem;
  font-weight: 700; cursor: pointer; transition: all .2s;
  display: flex; align-items: center; justify-content: center; gap: .4rem;
}
.btn-add-item:hover { border-color: #2563eb; color: #2563eb; background: rgba(37,99,235,.03); }

/* ── Subtotal strip ── */
.subtotal-strip {
  display: flex; justify-content: space-between; align-items: center;
  background: #fffdf8; border: 1px solid #e8e0d0; border-radius: .75rem;
  padding: .7rem 1rem;
}
.strip-lbl { font-size: .82rem; font-weight: 600; color: #64748b; }
.strip-val {
  font-family: 'JetBrains Mono', monospace; font-weight: 700; color: #2563eb;
  font-size: .95rem; -webkit-text-fill-color: #2563eb !important;
}

/* ── Toggle switch ── */
.tog-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem 0; border-bottom: 1px solid #f1f5f9;
}
.tog-row:last-child { border-bottom: none; padding-bottom: 0; }
.tog-row:first-child { padding-top: 0; }
.tog-lbl { font-size: .82rem; font-weight: 600; color: #374151; }
.tog-lbl .tog-sub { display: block; font-size: .7rem; font-weight: 400; color: #94a3b8; margin-top: 1px; }
.tog-lbl .tog-rate { color: #2563eb; font-weight: 700; }
.tog { position: relative; width: 38px; height: 20px; flex-shrink: 0; }
.tog input { opacity: 0; width: 0; height: 0; }
.tog-sl { position: absolute; inset: 0; background: #e2e8f0; border-radius: 20px; cursor: pointer; transition: all .2s; }
.tog-sl::before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: all .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.tog input:checked + .tog-sl { background: #2563eb; }
.tog input:checked + .tog-sl::before { transform: translateX(18px); }

/* ── Adj grid ── */
.adj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .75rem; }
@media(max-width:380px) { .adj-grid { grid-template-columns: 1fr; } }
.adj-lbl { font-size: .65rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: #94a3b8; margin-bottom: .35rem; display: block; }
.inp-sfx-wrap { position: relative; }
.inp-sfx-wrap input { padding-right: 2.1rem; }
.inp-sfx { position: absolute; right: .6rem; top: 50%; transform: translateY(-50%); font-size: .78rem; color: #94a3b8; pointer-events: none; }

/* Discount mode toggle */
.disc-mode { display: flex; gap: 4px; }
.dm-btn {
  padding: .38rem .6rem; background: #f8fafc; border: 1.5px solid #e8e2d8;
  border-radius: .45rem; color: #64748b; font-family: 'JetBrains Mono', monospace;
  font-size: .72rem; font-weight: 700; cursor: pointer; transition: all .15s;
}
.dm-btn.on { background: #eff6ff; border-color: #2563eb; color: #2563eb; }

/* Quick discount presets */
.qd-presets { display: flex; gap: 5px; flex-wrap: wrap; margin-top: .6rem; }
.qd-btn {
  padding: .22rem .55rem; background: #f8fafc; border: 1px solid #e8e2d8;
  border-radius: 99px; color: #64748b; font-family: 'JetBrains Mono', monospace;
  font-size: .7rem; font-weight: 700; cursor: pointer; transition: all .15s;
}
.qd-btn:hover { border-color: #2563eb; color: #2563eb; }
.qd-btn.on { background: rgba(37,99,235,.07); border-color: #2563eb; color: #2563eb; }

/* ── Bill split ── */
.split-row { display: flex; align-items: center; gap: 1rem; }
.split-ctr { display: flex; align-items: center; border: 1.5px solid #e8e2d8; border-radius: .6rem; overflow: hidden; }
.split-btn {
  width: 32px; height: 34px; background: #faf8f4; border: none; color: #374151;
  font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s; flex-shrink: 0;
}
.split-btn:hover { background: #e8e2d8; }
.split-num {
  min-width: 38px; text-align: center; font-size: 1.05rem; font-weight: 700; color: #2563eb;
  font-family: 'JetBrains Mono', monospace; border-left: 1px solid #e8e2d8; border-right: 1px solid #e8e2d8;
  height: 34px; display: flex; align-items: center; justify-content: center; padding: 0 .45rem;
  -webkit-text-fill-color: #2563eb !important;
}
.split-meta { flex: 1; }
.split-meta-lbl { font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; }
.split-meta-sub { font-size: .7rem; color: #64748b; margin-top: 2px; }
.split-each-amt { font-family: 'JetBrains Mono', monospace; font-weight: 700; font-size: 1rem; color: #0f7b3e; -webkit-text-fill-color: #0f7b3e !important; white-space: nowrap; }

/* ── Receipt paper ── */
.receipt-col { position: sticky; top: 1.25rem; }
@media(max-width:820px) { .receipt-col { position: static; } .receipt-col.collapsed { display: none; } }

#receiptEl {
  background: #faf6ee; border-radius: 6px 6px 0 0; overflow: hidden;
  font-family: 'JetBrains Mono', monospace;
  box-shadow: 0 8px 32px rgba(100,70,20,.18), 0 2px 8px rgba(0,0,0,.08);
  border: 1px solid #e8dcc8; border-bottom: none;
}
.r-inner { padding: 1.1rem 1.1rem .75rem; }
.r-head { text-align: center; padding-bottom: .8rem; border-bottom: 1.5px dashed #d4cec4; margin-bottom: .8rem; }
.shop-name-inp {
  font-family: 'Fraunces', Georgia, serif; font-size: 1.05rem; font-weight: 700;
  color: #1a1510; letter-spacing: .03em; text-align: center; background: none; border: none; outline: none;
  border-bottom: 1.5px dashed transparent; transition: border-color .2s;
  width: 100%; display: block; margin: 0 auto; cursor: text; padding: .25rem 0;
}
.shop-name-inp:focus { border-bottom-color: #aaa; }
.shop-name-inp::placeholder { color: #b0a898; font-style: italic; font-weight: 400; }
.shop-tag-inp {
  font-size: .7rem; color: #999; text-align: center; background: none; border: none; outline: none;
  border-bottom: 1px dashed transparent; transition: border-color .2s; width: 100%;
  font-family: 'JetBrains Mono', monospace; margin-top: 3px; display: block;
}
.shop-tag-inp:focus { border-bottom-color: #ccc; color: #666; }
.shop-tag-inp::placeholder { color: #ddd; }
.r-date { font-size: .65rem; color: #aaa; margin-top: 4px; }
.r-vbadge {
  display: inline-flex; align-items: center; gap: 3px; font-size: .62rem; font-weight: 700;
  letter-spacing: .07em; padding: 2px 8px; border-radius: 99px; text-transform: uppercase;
  margin-top: 5px; -webkit-text-fill-color: currentColor !important;
}
.r-vbadge.excl { background: rgba(192,57,43,.1); color: #c0392b; border: 1px solid rgba(192,57,43,.2); }
.r-vbadge.incl { background: rgba(15,123,62,.1); color: #0f7b3e; border: 1px solid rgba(15,123,62,.2); }

.r-items { margin-bottom: .4rem; }
.r-item { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; font-size: .7rem; padding: 2px 0; color: #333; }
.r-item .ri-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.r-item .ri-qty  { color: #999; flex-shrink: 0; font-size: .65rem; }
.r-item .ri-price { flex-shrink: 0; font-weight: 600; }
.r-divider { border: none; border-top: 1px dashed #d4cec4; margin: .6rem 0; }
.r-lines { font-size: .7rem; }
.r-line { display: flex; justify-content: space-between; padding: 2px 0; color: #555; }
.r-line.disc { color: #c0392b; }
.r-line.svc  { color: #444; }
.r-line.tax  { color: #333; font-weight: 600; }
.r-line.vat-incl { color: #888; font-size: .65rem; font-style: italic; }
.r-total { display: flex; justify-content: space-between; align-items: baseline; padding: .6rem 0 .45rem; border-top: 2px solid #333; margin-top: .45rem; }
.rt-lbl { font-size: .82rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: #1a1510; }
.rt-amt { font-family: 'Fraunces', Georgia, serif; font-size: 1.55rem; font-weight: 900; color: #1a1510; line-height: 1; }
@keyframes numPop { 0%,100%{transform:scale(1)} 50%{transform:scale(1.04)} }
.pop { animation: numPop .2s ease; }

.r-split { background: #f3ece0; border-radius: 4px; padding: .55rem .7rem; margin-top: .6rem; display: none; }
.r-split.show { display: block; }
.rs-lbl { font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; color: #888; margin-bottom: .35rem; }
.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.rs-person { background: #fff; border-radius: 3px; padding: 4px 6px; text-align: center; }
.rs-pnum { font-size: .62rem; color: #999; letter-spacing: .08em; text-transform: uppercase; }
.rs-pamt { font-size: .85rem; font-weight: 700; color: #1a1510; font-family: 'Fraunces', Georgia, serif; }
.r-foot { text-align: center; padding-top: .65rem; border-top: 1px dashed #d4cec4; margin-top: .65rem; }
.rf-thanks { font-size: .65rem; color: #aaa; letter-spacing: .1em; text-transform: uppercase; }
.rf-brand { font-size: .62rem; color: #ccc; margin-top: 2px; display: block; }
.r-zigzag {
  height: 12px;
  background: linear-gradient(135deg, #faf6ee 33.33%, transparent 33.33%) 0 0,
              linear-gradient(225deg, #faf6ee 33.33%, transparent 33.33%) 0 0;
  background-size: 12px 12px; background-color: #e8dcc8;
  border: 1px solid #e8dcc8; border-top: none;
}

/* ── Receipt actions ── */
.receipt-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: .5rem; margin-top: .6rem; }
.btn-act {
  padding: .62rem .5rem; border-radius: .6rem; font-family: inherit; font-size: .75rem;
  font-weight: 700; letter-spacing: .04em; cursor: pointer; transition: all .15s;
  display: flex; align-items: center; justify-content: center; gap: .35rem;
}
.btn-act-reset { background: #f8fafc; color: #64748b; border: 1.5px solid #e8e2d8; }
.btn-act-reset:hover { background: #e8e2d8; color: #374151; }
.btn-act-copy { background: #f8fafc; color: #374151; border: 1.5px solid #e8e2d8; }
.btn-act-copy:hover { border-color: #374151; }
.btn-act-copy.ok { background: #e8f5ee; color: #0f7b3e !important; border-color: #0f7b3e; -webkit-text-fill-color: #0f7b3e !important; }
.btn-act-save { background: linear-gradient(135deg, #2563eb, #0891b2); color: #fff; border: none; box-shadow: 0 2px 8px rgba(37,99,235,.25); }
.btn-act-save:hover { transform: translateY(-1px); box-shadow: 0 4px 14px rgba(37,99,235,.35); }
.btn-act-save.saving { opacity: .7; pointer-events: none; }

/* Mobile receipt toggle */
.mob-toggle {
  display: none; width: 100%; padding: .8rem 1rem;
  background: linear-gradient(135deg, #2563eb, #0891b2); color: #fff;
  border: none; border-radius: .75rem; font-family: inherit; font-size: .82rem;
  font-weight: 700; cursor: pointer; margin-bottom: 1rem;
  align-items: center; justify-content: space-between;
}
.mob-toggle .mob-total { font-size: 1.05rem; font-family: 'JetBrains Mono', monospace; font-weight: 700; }
@media(max-width:820px) { .mob-toggle { display: flex; } }

/* ═══ Article / SEO section ═══ */
.divider { border: none; border-top: 1.5px solid #e8e2d8; margin: 2rem 0 1.5rem; }
.article { line-height: 1.8; color: #374151; }
.article h2 { font-size: 1.3rem; font-weight: 800; color: #1e293b; margin: 1.75rem 0 .65rem; line-height: 1.3; }
.article h2:first-child { margin-top: 0; }
.article h3 { font-size: 1rem; font-weight: 700; color: #1e293b; margin: 1.25rem 0 .4rem; }
.article p { margin-bottom: .9rem; font-size: .93rem; }
.article ul, .article ol { padding-left: 1.4rem; margin-bottom: .9rem; }
.article li { font-size: .93rem; margin-bottom: .35rem; }
.article strong { color: #1e293b; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px,1fr)); gap: .75rem; margin: 1.25rem 0; }
.stat-grid .stat-box { background: #fffdf8; border: 1px solid #e8e0d0; border-radius: .85rem; padding: .9rem; text-align: center; box-shadow: 0 1px 4px rgba(120,90,40,.06); }
.stat-grid .sn { font-family: 'JetBrains Mono', monospace; font-size: 1.45rem; font-weight: 800; color: #2563eb; line-height: 1.1; -webkit-text-fill-color: #2563eb !important; display: block; }
.stat-grid .sl { font-size: .72rem; color: #64748b; margin-top: .2rem; line-height: 1.4; display: block; }

.art-chart { margin: 1.25rem 0; background: #fffdf8; border: 1px solid #e8e0d0; border-radius: .85rem; padding: 1rem 1.1rem; }
.art-chart-title { font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #64748b; margin-bottom: .85rem; }
.chart-bar-group { margin-bottom: .65rem; }
.chart-bar-label { font-size: .8rem; font-weight: 600; color: #374151; display: flex; justify-content: space-between; margin-bottom: .2rem; }
.chart-bar-label .val { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: #2563eb; }
.chart-track { background: #e8e2d8; border-radius: 99px; height: 10px; overflow: hidden; }
.chart-fill { height: 100%; border-radius: 99px; background: #2563eb; }
.chart-fill.green { background: #0f7b3e; }
.chart-fill.red   { background: #c0392b; }
.chart-fill.amber { background: #d97706; }
.chart-fill.slate { background: #94a3b8; }

.callout-box { border-radius: .75rem; padding: .85rem 1.1rem; margin: 1rem 0; font-size: .88rem; display: flex; gap: .6rem; align-items: flex-start; }
.callout-box.info    { background: #eff6ff; border-left: 3px solid #2563eb; color: #1e40af; }
.callout-box.success { background: #f0fdf4; border-left: 3px solid #16a34a; color: #14532d; }
.callout-box.warn    { background: #fffbeb; border-left: 3px solid #d97706; color: #78350f; }
.callout-box p { margin: 0; color: inherit !important; font-size: .88rem; line-height: 1.7 !important; }
.callout-box strong { color: inherit !important; }
.callout-icon { font-size: 1.1rem; flex-shrink: 0; }

.tbl-scroll { overflow-x: auto; border: 1px solid #e8e2d8; border-radius: .75rem; margin: .75rem 0; -webkit-overflow-scrolling: touch; }
.example-table { width: 100%; border-collapse: collapse; font-size: .83rem; }
.example-table th { background: #faf7f2; padding: .42rem .75rem; text-align: left; font-weight: 700; font-size: .68rem; letter-spacing: .07em; text-transform: uppercase; color: #64748b; border-bottom: 2px solid #e8e2d8; }
.example-table td { padding: .38rem .75rem; border-bottom: 1px solid #f5f0e8; color: #374151; font-family: 'JetBrains Mono', monospace; font-size: .81rem; -webkit-text-fill-color: currentColor !important; }
.example-table td:first-child { font-family: inherit; font-weight: 600; color: #1e293b; }
.example-table tr:last-child td { border-bottom: none; }
.example-table .section-row td { background: #faf7f2; font-family: inherit; font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: #64748b; padding: .32rem .75rem; }
.example-table .total-row td { border-top: 2px solid #e8e2d8; font-weight: 800; color: #1e293b; background: #fff; }
.example-table .neg td:last-child { color: #c0392b; }
.example-table .pos td:last-child { color: #0f7b3e; }

.section-label { font-size: .65rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; margin-bottom: .65rem; }
.related h2 { font-size: 1.1rem; font-weight: 700; color: #1e293b; margin-bottom: .75rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px,1fr)); gap: .65rem; }
.rel-link { display: block; padding: .65rem 1rem; background: #fffdf8; border: 1px solid #e8e0d0; border-radius: .75rem; font-size: .82rem; font-weight: 600; color: #374151; text-decoration: none; transition: all .15s; }
.rel-link:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
