:root {
  --emerald: #0b2219;
  --emerald-2: #123626;
  --gold: #d4af37;
  --ink: #17211c;
  --muted: #55625b;
  --line: #dfe5e1;
  --soft: #f4f7f5;
  --accent: #0f6b46;
  --accent-dark: #0a4f33;
  --warn-bg: #fff8e1;
  --warn-line: #e7c65a;
  --bad: #b3261e;
  --radius: 10px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Kannada", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
  line-height: 1.6;
  font-size: 17px;
}
a { color: var(--accent); }
a:hover { color: var(--accent-dark); }
.skip { position: absolute; left: -999px; top: 0; background: #fff; padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

.site-header { background: var(--emerald); color: #fff; border-bottom: 3px solid var(--gold); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; }
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.15rem; letter-spacing: .2px; }
.brand span { color: var(--gold); }
.langs { display: flex; gap: 6px; align-items: center; font-size: .9rem; }
.langs .lbl { color: #c9d6cf; margin-right: 4px; }
.langs a, .langs strong { padding: 4px 10px; border-radius: 999px; border: 1px solid #36594a; color: #fff; text-decoration: none; }
.langs strong { background: var(--gold); color: var(--emerald); border-color: var(--gold); }
.langs a:hover { border-color: var(--gold); }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 16px; }
main { padding: 20px 0 40px; }
.crumbs { font-size: .88rem; color: var(--muted); margin: 6px 0 4px; }
.crumbs a { color: var(--muted); }
h1 { font-size: 1.85rem; line-height: 1.25; margin: 8px 0 8px; color: var(--emerald); }
h2 { font-size: 1.3rem; margin: 30px 0 10px; color: var(--emerald); }
h3 { font-size: 1.05rem; margin: 18px 0 6px; }
.lead { font-size: 1.08rem; color: var(--muted); margin: 0 0 16px; }
.free-note { display: inline-block; background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .88rem; color: var(--muted); margin-bottom: 12px; }

.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.tool { margin: 14px 0 6px; }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: 4px; }
.hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=number], input[type=date], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #b9c6bf; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus, button:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid #9ad6b8; outline-offset: 1px; }
button, .btn {
  font: inherit; font-weight: 600; cursor: pointer; border: 1px solid var(--accent); background: var(--accent); color: #fff;
  padding: 10px 16px; border-radius: 8px; text-decoration: none; display: inline-block;
}
button:hover, .btn:hover { background: var(--accent-dark); color: #fff; }
button.secondary { background: #fff; color: var(--accent); }
button.secondary:hover { background: var(--soft); color: var(--accent-dark); }
button.small { padding: 6px 10px; font-size: .88rem; }
button:disabled { opacity: .5; cursor: not-allowed; }

table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: middle; }
th { font-size: .85rem; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; position: relative; }
td input, td select { padding: 7px 8px; }

.result { background: var(--soft); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; margin-top: 14px; }
.result .big { font-size: 1.7rem; font-weight: 700; color: var(--emerald); line-height: 1.2; }
.result .sub { color: var(--muted); font-size: .92rem; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-top: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.stat b { display: block; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .82rem; color: var(--muted); }
.error { color: var(--bad); font-weight: 600; margin-top: 8px; }
.msg { margin-top: 10px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { background: #fff; color: var(--accent); }
.tabs button[aria-pressed=true] { background: var(--accent); color: #fff; }

.notice { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: var(--radius); padding: 10px 14px; font-size: .92rem; margin: 18px 0; }
.formula { background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92rem; overflow-x: auto; }
details { border-bottom: 1px solid var(--line); padding: 10px 0; }
summary { cursor: pointer; font-weight: 600; }
details p { margin: 8px 0 0; }
.cta { margin: 34px 0 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--soft); }
.cta .btn { margin-top: 6px; }
.tool-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tool-cards a.card { text-decoration: none; color: inherit; display: block; }
.tool-cards a.card:hover { border-color: var(--accent); }
.tool-cards h3 { margin: 0 0 4px; color: var(--emerald); }
.tool-cards p { margin: 0; color: var(--muted); font-size: .92rem; }
.related { display: flex; gap: 10px; flex-wrap: wrap; padding: 0; list-style: none; }
.related a { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; text-decoration: none; }
.meta { color: var(--muted); font-size: .88rem; margin-top: 24px; }
.sources li { font-size: .92rem; }

.site-footer { background: var(--emerald); color: #c9d6cf; padding: 22px 0; font-size: .92rem; }
.site-footer a { color: #fff; }
.site-footer .links { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }

.preview-box { border: 1px dashed #9db3a8; border-radius: 8px; padding: 10px; text-align: center; background: repeating-conic-gradient(#f4f7f5 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.preview-box img { max-width: 100%; height: auto; display: inline-block; }

/* Invoice / print */
.invoice-sheet { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; background: #fff; }
@media print {
  .site-header, .site-footer, .no-print, .crumbs, .cta, .notice, details, .meta, .related, h2.hide-print { display: none !important; }
  body { font-size: 12pt; }
  .card, .invoice-sheet { border: none; box-shadow: none; padding: 0; }
  main { padding: 0; }
}
@media (max-width: 520px) {
  h1 { font-size: 1.55rem; }
  body { font-size: 16px; }
  .card { padding: 14px; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.bar { height: 12px; border-radius: 6px; background: #e6c76a; overflow: hidden; margin: 12px 0 4px; border: 1px solid var(--line); }
.bar span { display: block; height: 100%; background: var(--accent); }
tr.hl td { background: #f6edc8; font-weight: 600; }
select { width: 100%; }
p.ok { background: #e6f4ec; border: 1px solid #9ad6b8; border-radius: var(--radius); padding: 8px 12px; font-size: .92rem; }
a.btn { display: inline-block; text-decoration: none; }
/* Wide input tables (food cost, stock average): let the table scroll sideways instead of squeezing the fields. */
#rows input[type=text] { min-width: 84px; }
#rows td:first-child input { min-width: 130px; }
#rows select { min-width: 76px; }
#rows td.lc { white-space: nowrap; }
/* GST invoice maker */
.inv { font-size: .86rem; color: #000; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.inv h3 { margin: 0 0 8px; text-align: center; letter-spacing: .04em; text-transform: uppercase; font-size: 1.15rem; }
.inv .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
.inv .box { border: 1px solid #9aa; padding: 8px 10px; min-height: 60px; }
.inv .box b.t { display: block; font-size: .72rem; text-transform: uppercase; color: #444; margin-bottom: 2px; }
.inv table { font-size: .78rem; width: 100%; border-collapse: collapse; }
.inv th, .inv td { border: 1px solid #9aa; padding: 4px 5px; vertical-align: top; }
.inv th { background: #eef3f0; }
.inv .tot { margin-left: auto; width: 100%; max-width: 330px; margin-top: 8px; }
.inv .tot td { border: 1px solid #9aa; }
.inv .words { margin: 8px 0; font-weight: 600; }
.inv .sign { margin-top: 28px; text-align: right; }
@media (max-width: 520px) { .inv .cols { grid-template-columns: 1fr; } }
@media print {
  body.print-invoice main > *:not(.tool) { display: none !important; }
  body.print-invoice .tool > *:not(#invoicePrint) { display: none !important; }
  .inv { border: none; padding: 0; font-size: 10pt; }
  .inv table { font-size: 9pt; }
  @page { margin: 12mm; }
}

/* ===== Visual refresh: app-like calculator cards (v2) ===== */
:root { --emerald-3: #1b5a40; --shadow: 0 6px 24px rgba(11,34,25,.10); --shadow-sm: 0 2px 8px rgba(11,34,25,.07); }
body { background: #f6f8f7; }
main { padding-top: 14px; }
.site-header { background: linear-gradient(135deg, #0b2219, #123626 60%, #1b5a40); box-shadow: 0 2px 12px rgba(11,34,25,.25); }
.site-nav { display: flex; gap: 4px; align-items: center; margin-left: 18px; flex: 1; }
.site-nav a { color: #d7e4dc; text-decoration: none; padding: 6px 12px; border-radius: 999px; font-size: .95rem; font-weight: 600; }
.site-nav a:hover, .site-nav a[aria-current] { background: rgba(255,255,255,.12); color: #fff; }

/* Tool card */
.card.tool { position: relative; padding: 24px 22px 22px; border: 1px solid #d3ddd7; border-radius: 16px; box-shadow: var(--shadow); background: #fff; overflow: hidden; }
.card.tool::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, var(--accent), var(--gold)); }
.card.tool label { font-size: .88rem; color: #2c3b33; letter-spacing: .01em; margin-bottom: 6px; }
.card.tool .grid { gap: 16px 18px; }
.card.tool input[type=text], .card.tool input[type=number], .card.tool input[type=date], .card.tool select, .card.tool textarea {
  padding: 12px 14px; border: 1.5px solid #c5d2ca; border-radius: 12px; background: #fbfdfc; font-size: 1.05rem; font-weight: 600; color: var(--emerald);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.card.tool input:hover, .card.tool select:hover { border-color: #8fb3a1; }
.card.tool input:focus, .card.tool select:focus, .card.tool textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(15,107,70,.15); background: #fff; }
.card.tool select { cursor: pointer; }
.card.tool button { border-radius: 12px; padding: 11px 18px; background: linear-gradient(180deg, #138457, #0f6b46); border-color: #0d5e3d; box-shadow: 0 2px 6px rgba(15,107,70,.25); transition: transform .08s, box-shadow .15s; }
.card.tool button:hover { transform: translateY(-1px); box-shadow: 0 5px 12px rgba(15,107,70,.28); }
.card.tool button.secondary { background: #fff; color: var(--accent); box-shadow: none; border: 1.5px solid #b5cfc2; }
.card.tool button.secondary:hover { background: var(--soft); }

/* Segmented tabs */
.card.tool .tabs { display: inline-flex; background: #eaf0ed; padding: 4px; border-radius: 14px; gap: 4px; margin-bottom: 18px; }
.card.tool .tabs button { background: transparent; color: #3d5247; border: 0; box-shadow: none; padding: 9px 16px; border-radius: 10px; }
.card.tool .tabs button:hover { background: rgba(255,255,255,.7); transform: none; box-shadow: none; }
.card.tool .tabs button[aria-pressed=true] { background: #fff; color: var(--accent-dark); box-shadow: 0 1px 4px rgba(11,34,25,.18); }

/* Sliders */
.range-wrap { margin-top: 8px; }
input[type=range].slider { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) var(--p, 0%), #dbe6e0 var(--p, 0%)); padding: 0; border: 0; box-shadow: none; cursor: pointer; }
input[type=range].slider::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
input[type=range].slider::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.25); }
input[type=range].slider:focus { outline: none; box-shadow: 0 0 0 4px rgba(15,107,70,.15); border: 0; }

/* Result panel: any output box that shows a headline number becomes a dark "answer card" */
.card.tool .result, .card.tool [aria-live]:has(> .big) {
  background: linear-gradient(135deg, #0b2219 0%, #134430 70%, #1b5a40 100%); color: #fff; border: 0; border-radius: 16px; padding: 20px 20px 18px; margin-top: 20px; box-shadow: 0 8px 22px rgba(11,34,25,.28);
}
.card.tool .result:empty { display: none; }
.card.tool .result .big, .card.tool [aria-live] > .big { color: var(--gold); font-size: 2.2rem; letter-spacing: -.01em; }
.card.tool .result .sub, .card.tool [aria-live]:has(> .big) .sub { color: #b9cfc3; }
.card.tool .result .stats { margin-top: 14px; }
.card.tool .result .stat, .card.tool [aria-live]:has(> .big) .stat { background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.16); border-top: 3px solid var(--gold); border-radius: 12px; padding: 10px 12px; }
.card.tool .result .stat b, .card.tool [aria-live]:has(> .big) .stat b { color: #fff; font-size: 1.15rem; }
.card.tool .result .stat span, .card.tool [aria-live]:has(> .big) .stat span { color: #b9cfc3; }
.card.tool .result .msg, .card.tool [aria-live]:has(> .big) .msg { color: #e1ede6; }
.card.tool .result a, .card.tool [aria-live]:has(> .big) a { color: #f3dc8a; }
.card.tool .result .bar { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.2); }
.card.tool .result .bar span { background: var(--gold); }
.card.tool .result .error { color: #ffb4ab; }
.card.tool .result table th { color: #b9cfc3; } .card.tool .result table td { border-color: rgba(255,255,255,.15); }

/* Tables inside tools */
.card.tool table { font-size: .95rem; }
.card.tool thead th { background: #eef3f0; color: #3d5247; position: sticky; top: 0; }
.card.tool tbody tr:nth-child(even) td { background: #f8fbf9; }

/* Home hero + tool cards with icons */
.hero { background: linear-gradient(135deg, #0b2219 0%, #134430 65%, #1b5a40 100%); color: #fff; border-radius: 20px; padding: 28px 26px; margin: 8px 0 8px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, rgba(212,175,55,.35), transparent 70%); }
.hero h1 { color: #fff; margin: 0 0 8px; font-size: 2rem; }
.hero .lead { color: #c9ddd2; margin: 0 0 16px; }
.hero .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.hero .chips span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 999px; padding: 5px 12px; font-size: .88rem; }
.tool-cards a.card { border-radius: 14px; padding: 16px; box-shadow: var(--shadow-sm); transition: transform .12s, box-shadow .12s, border-color .12s; display: flex; gap: 12px; align-items: flex-start; }
.tool-cards a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.tool-cards .ico { flex: 0 0 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #e6f4ec, #f6edc8); display: grid; place-items: center; font-size: 1.4rem; }
.tool-cards h3 { font-size: 1.02rem; }
@media (max-width: 520px) { .site-nav { margin-left: 0; order: 3; width: 100%; } .hero { padding: 22px 18px; } .hero h1 { font-size: 1.6rem; } .card.tool { padding: 20px 14px 16px; } .card.tool .result .big, .card.tool [aria-live] > .big { font-size: 1.8rem; } }

/* Guides */
.gsearch { width: 100%; padding: 13px 16px; border-radius: 12px; border: 0; font: inherit; font-size: 1.02rem; background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.chips-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.chip { background: #fff; color: var(--accent-dark); border: 1.5px solid #b5cfc2; border-radius: 999px; padding: 7px 14px; font-weight: 600; cursor: pointer; font: inherit; font-size: .92rem; }
.chip:hover { background: var(--soft); color: var(--accent-dark); }
.chip[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.catname { color: var(--muted); font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 2px; }
.article { max-width: 720px; }
.article h1 { font-size: 2rem; }
.article p, .article li { font-size: 1.04rem; }
.article h2 { margin-top: 34px; }
.byline { color: var(--muted); font-size: .9rem; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.toc { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 18px; margin: 16px 0; }
.toc ol { margin: 6px 0 0; padding-left: 20px; } .toc li { font-size: .96rem; }
.toolbox { margin: 26px 0; background: linear-gradient(135deg, #e6f4ec, #f6edc8); border: 0; }
.article table { background: #fff; border: 1px solid var(--line); border-radius: 8px; margin: 12px 0; }
.article .callout { border-left: 4px solid var(--gold); background: #fffaf0; padding: 10px 14px; border-radius: 8px; margin: 14px 0; }
.chk { display: flex; align-items: center; gap: 10px; font-weight: 600; cursor: pointer; margin: 0; }
.chk input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); flex: 0 0 auto; }
.card.tool .row.swap { align-items: end; }

/* Share bar */
.sharebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 14px 0 4px; padding: 10px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.sharebar .sharelead { font-size: .88rem; color: var(--muted); font-weight: 600; margin-right: 4px; }
.sharebar button.small, .sharebar a.small { padding: 7px 12px; font-size: .88rem; border-radius: 999px; }
.sharebar a.wa { background: #1fa855; border-color: #1a8f48; color: #fff; text-decoration: none; }
.sharebar a.wa:hover { background: #178a45; }
.sharebar .sharemsg { font-size: .88rem; color: var(--accent-dark); font-weight: 600; }
@media print { .sharebar { display: none !important; } }
