/* Klaim: one stylesheet for the static site and the app. */
:root {
  --paper: #f5f3ec;
  --card: #ffffff;
  --ink: #12201a;
  --muted: #5a6a62;
  --faint: #8a978f;
  --line: #e2ded2;
  --accent: #0b6e4f;
  --accent-ink: #ffffff;
  --accent-soft: #dcefe5;
  --accent-deep: #084c37;
  --warn: #a5560a;
  --warn-soft: #fbefd9;
  --danger: #b42318;
  --danger-soft: #fde7e4;
  --track: #ebe8de;
  --shadow: 0 1px 2px rgba(18, 32, 26, 0.06), 0 6px 24px rgba(18, 32, 26, 0.06);
  --radius: 16px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0d1512;
    --card: #141e19;
    --ink: #e6eee9;
    --muted: #9aaba2;
    --faint: #6f8077;
    --line: #23322b;
    --accent: #37b487;
    --accent-ink: #06130d;
    --accent-soft: #163628;
    --accent-deep: #7fd8b2;
    --warn: #f0b264;
    --warn-soft: #33260f;
    --danger: #ff8a7a;
    --danger-soft: #3a1a16;
    --track: #22302a;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 28px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  overflow-x: clip;
}
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; }

/* ---------- shared bits ---------- */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 720px; margin: 0 auto; padding: 0 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent;
  font: 600 16px/1 var(--font); text-decoration: none; cursor: pointer;
  background: var(--accent); color: var(--accent-ink);
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:hover { background: var(--accent-deep); }
@media (prefers-color-scheme: dark) { .btn:hover { background: #4cc99a; } }
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--card); }
.btn.soft { background: var(--accent-soft); color: var(--accent-deep); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 600; background: var(--accent-soft); color: var(--accent-deep);
}
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.muted { background: var(--track); color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.bar { height: 8px; border-radius: 99px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width 0.4s ease; }
.bar.full > i { background: var(--accent-deep); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 20px; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.logo svg { width: 28px; height: 28px; }

/* ---------- static site ---------- */
.site-head { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--paper) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.site-nav { display: flex; align-items: center; gap: 18px; font-size: 15px; }
.site-nav a { color: var(--ink); text-decoration: none; }
.site-nav a:hover { color: var(--accent); }
.lang-switch { display: flex; gap: 4px; font-size: 13px; }
.lang-switch a { padding: 3px 8px; border-radius: 99px; color: var(--muted); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--paper); }
@media (max-width: 640px) { .site-nav .hide-sm { display: none; } }
.btn, .lang-switch a, .chip { white-space: nowrap; }
@media (max-width: 420px) {
  .site-nav { gap: 8px; }
  .site-head .btn.small { padding: 0 12px; font-size: 13.5px; min-height: 36px; }
  .lang-switch a { padding: 3px 6px; }
  .site-head .logo { font-size: 18px; }
}
.calc-mini { display: none; }
@media (max-width: 860px) {
  .calc-mini { display: flex; position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; justify-content: space-between; gap: 12px; padding: 12px 16px; border-radius: 16px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font-size: 14px; text-decoration: none; }
  .calc-mini strong { font-size: 17px; }
  .has-mini { padding-bottom: 90px; }
}

.hero { padding: 56px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; gap: 32px; } .hero { padding-top: 32px; } }
.hero h1 { font-size: clamp(34px, 6vw, 56px); font-weight: 800; letter-spacing: -0.035em; margin-bottom: 16px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: clamp(17px, 2.2vw, 20px); color: var(--muted); max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 14px; }
.countdown { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; }

.demo { padding: 18px; }
.demo-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.demo-big { font-size: 30px; font-weight: 800; letter-spacing: -0.03em; }
.demo-row { padding: 12px 0; border-top: 1px solid var(--line); }
.demo-row .r1 { display: flex; justify-content: space-between; font-size: 14.5px; margin-bottom: 6px; gap: 10px; }

.section { padding: 48px 0; }
.section h2 { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid3, .grid2 { grid-template-columns: 1fr; } }
.feature { padding: 22px; }
.feature h3 { font-size: 18px; margin-bottom: 6px; }
.feature p { color: var(--muted); margin: 0; font-size: 15px; }
.num { width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-deep); display: grid; place-items: center; font-weight: 800; margin-bottom: 12px; }

.price-card { padding: 26px; display: flex; flex-direction: column; gap: 10px; }
.price-card .amt { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.price-card ul { padding-left: 0; list-style: none; margin: 6px 0 14px; }
.price-card li { padding: 6px 0 6px 28px; position: relative; font-size: 15px; }
.price-card li::before { content: ""; position: absolute; left: 4px; top: 13px; width: 12px; height: 7px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
.price-card.featured { border: 2px solid var(--accent); }

.faq details { border-top: 1px solid var(--line); padding: 16px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; font-weight: 400; color: var(--muted); }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

.article { padding: 32px 0 56px; }
.article h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; letter-spacing: -0.03em; }
.article h2 { font-size: 23px; margin-top: 34px; }
.article h3 { font-size: 18px; margin-top: 22px; }
.article ul, .article ol { padding-left: 22px; }
.article li { margin: 5px 0; }
.article table { width: 100%; border-collapse: collapse; margin: 14px 0 22px; font-size: 15px; }
.article th, .article td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.article th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.article td.r, .article th.r { text-align: right; white-space: nowrap; }
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.callout { padding: 16px 18px; border-radius: 14px; background: var(--accent-soft); color: var(--ink); margin: 18px 0; }
.callout.warn { background: var(--warn-soft); }
.cta-box { padding: 24px; margin: 32px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cta-box h3 { margin: 0 0 4px; font-size: 20px; }
.updated { font-size: 13.5px; color: var(--faint); }

.site-foot { border-top: 1px solid var(--line); padding: 32px 0 40px; font-size: 14px; color: var(--muted); }
.site-foot .cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-foot a { color: var(--muted); }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- calculator ---------- */
.calc { padding: 22px; }
.calc .field { margin-bottom: 14px; }
.calc-out { padding: 20px; background: var(--ink); color: var(--paper); border-radius: var(--radius); }
.calc-out .big { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.calc-out .row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid rgba(255,255,255,0.12); font-size: 15px; gap: 10px; }
@media (prefers-color-scheme: dark) { .calc-out { background: #1d2b25; color: var(--ink); } .calc-out .row { border-color: var(--line); } }
.calc-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (max-width: 560px) { .calc-grid { grid-template-columns: 1fr; } }

/* ---------- forms (shared) ---------- */
.field { display: block; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: 500 16px/1.3 var(--font);
}
textarea.input { min-height: 80px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.money { position: relative; }
.money::before { content: "RM"; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; font-size: 15px; pointer-events: none; }
.money .input { padding-left: 46px; }
.check { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; cursor: pointer; font-size: 15px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 15px; }
.stepper .ctl { display: flex; align-items: center; gap: 10px; flex: none; }
.stepper button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 18px; cursor: pointer; }
.err { color: var(--danger); font-size: 14px; margin-top: 8px; }

/* ---------- app ---------- */
.app { max-width: 560px; margin: 0 auto; padding: 0 16px 120px; min-height: 100vh; }
.app-head { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 10px; }
.icon-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.deadline { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-weight: 600; font-size: 14.5px; margin-bottom: 12px; }
.deadline svg { width: 18px; height: 18px; flex: none; }
.totals { padding: 18px; margin-bottom: 14px; }
.totals .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.totals .label { font-size: 13px; color: var(--muted); font-weight: 600; }
.totals .value { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.totals .value.green { color: var(--accent); }
.nudge { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin: 22px 2px 10px; }
.list-head h2 { font-size: 17px; margin: 0; }
.relief { width: 100%; text-align: left; padding: 14px 16px; margin-bottom: 10px; cursor: pointer; display: block; font: inherit; color: inherit; }
.relief:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.relief .r1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.relief .name { font-weight: 700; font-size: 15.5px; }
.relief .amt { font-weight: 700; font-size: 14.5px; white-space: nowrap; }
.relief .r2 { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-top: 7px; gap: 8px; }
.relief.used .name::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 8px; vertical-align: middle; }
.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--paper) 70%, transparent); z-index: 20; }
.dock .inner { max-width: 560px; margin: 0 auto; display: flex; gap: 10px; }
.dock .btn { flex: 1; box-shadow: var(--shadow); }
.banner { padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; font-size: 14.5px; display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.banner.ok { background: var(--accent-soft); color: var(--accent-deep); }
.banner.info { background: var(--card); border: 1px solid var(--line); }
.banner.bad { background: var(--danger-soft); color: var(--danger); }

/* sheets */
.backdrop { position: fixed; inset: 0; background: rgba(8, 14, 11, 0.45); z-index: 40; animation: fade 0.18s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92vh; overflow-y: auto;
  background: var(--paper); border-radius: 22px 22px 0 0; padding: 8px 18px calc(24px + env(safe-area-inset-bottom));
  max-width: 600px; margin: 0 auto; animation: rise 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet .grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 6px auto 10px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.sheet-head h2 { font-size: 20px; margin: 0; }
.stack > * + * { margin-top: 14px; }
.receipt-box { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; background: var(--card); }
.receipt-box img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.receipt-box .doc { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 8px; background: var(--track); font-weight: 700; font-size: 12px; color: var(--muted); }
.claim-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; font: inherit; color: inherit; }
.claim-row .t { font-weight: 600; font-size: 15px; }
.claim-row .s { font-size: 13px; color: var(--muted); }
.menu-list button, .menu-list a { display: flex; width: 100%; align-items: center; justify-content: space-between; padding: 15px 4px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); font: 600 16px var(--font); text-decoration: none; cursor: pointer; text-align: left; }
.menu-list .danger { color: var(--danger); }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--paper); padding: 11px 18px; border-radius: 99px; font-size: 14.5px; font-weight: 600; box-shadow: var(--shadow); animation: fade 0.2s ease; max-width: calc(100vw - 32px); text-align: center; }
.auth { max-width: 420px; margin: 0 auto; padding: 32px 20px 48px; }
.auth h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.03em; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: 600 14px var(--font); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.sum-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.sum-table td { padding: 10px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sum-table td.r { text-align: right; font-weight: 700; white-space: nowrap; }
.sum-table tr.tot td { font-weight: 800; border-bottom: 2px solid var(--ink); }
.locked { position: relative; }
.locked .blur { filter: blur(5px); pointer-events: none; user-select: none; }
.locked .over { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; display: inline-block; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(40px); opacity: 0.4; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

@media print {
  body { background: #fff; color: #000; }
  .no-print, .dock, .app-head, .backdrop { display: none !important; }
  .card { box-shadow: none; border-color: #ccc; background: #fff; }
  .app { padding-bottom: 0; }
}
