/* AlatMY – Native Mobile Super-App PWA + Desktop App Shell */

:root {
  --bg: #f2f4f8;
  --bg-elevated: #ffffff;
  --bg-subtle: #eaf0f7;
  --card: #ffffff;
  --text: #0b1220;
  --text-2: #334155;
  --muted: #64748b;
  --border: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.14);

  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: rgba(29, 78, 216, 0.1);
  --gold: #f59e0b;
  --ok: #059669;
  --warn: #d97706;
  --bad: #dc2626;

  --glass: rgba(255, 255, 255, 0.9);
  --sidebar-w: 252px;
  --topbar-h: 56px;
  --tabbar-h: 64px;

  --radius: 18px;
  --radius-sm: 12px;
  --shadow-xs: 0 1px 2px rgba(11, 18, 32, 0.04);
  --shadow-sm: 0 2px 10px -2px rgba(11, 18, 32, 0.06), 0 1px 2px rgba(11, 18, 32, 0.04);
  --shadow-md: 0 14px 32px -10px rgba(11, 18, 32, 0.12), 0 4px 12px -4px rgba(11, 18, 32, 0.06);
  --shadow-lg: 0 24px 54px -14px rgba(11, 18, 32, 0.28);
  --ring: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] {
  --bg: #070b14;
  --bg-elevated: #111827;
  --bg-subtle: #1a2336;
  --card: #111827;
  --text: #f1f5f9;
  --text-2: #cbd5e1;
  --muted: #8b9bb4;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.15);
  --glass: rgba(13, 19, 33, 0.9);

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 16px 36px -10px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 28px 60px -12px rgba(0, 0, 0, 0.78);
  --ring: 0 0 0 3px rgba(96, 165, 250, 0.26);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overscroll-behavior-y: none; }
body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  padding-left: var(--sidebar-w);
}
@media (max-width: 1024px) {
  body { padding-left: 0; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); }
  body.is-tool { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 74px); }
}

a { color: var(--accent); text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent-hover); }
.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; width: 100%; }
@media (max-width: 640px) { .container { padding: 0 14px; } }
.mob-only { display: none; }
@media (max-width: 1024px) { .mob-only { display: inline-flex; } }

/* ── Desktop App Sidebar ── */
.app-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w);
  background: var(--bg-elevated); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 60;
  padding: 16px 12px 14px; overflow-y: auto;
}
@media (max-width: 1024px) { .app-sidebar { display: none; } }
.sb-brand {
  display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px;
  color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: -0.025em;
}
.sb-brand:hover { color: var(--text); }
.sb-brand span { color: var(--accent); }
.logo-mark {
  width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, #0b1f66, #2563eb);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.32);
}
.sb-search {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 9px 11px; margin-bottom: 14px;
  background: var(--bg); color: var(--muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font: inherit; font-size: .86rem; cursor: pointer; text-align: left;
}
.sb-search:hover { border-color: var(--border-strong); color: var(--text); }
.sb-search kbd { margin-left: auto; font: inherit; font-size: .72rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--bg-subtle); color: var(--muted); }
.sb-sec { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 10px 10px 6px; }
.sb-nav { display: flex; flex-direction: column; gap: 2px; }
.sb-link {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
  color: var(--text-2); font-size: .88rem; font-weight: 500;
}
.sb-link:hover { background: var(--bg-subtle); color: var(--text); }
.sb-link.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.sb-link .sb-ic { width: 20px; text-align: center; font-size: 1rem; flex-shrink: 0; }
.sb-link .sb-cnt { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--muted); background: var(--bg-subtle); padding: 1px 7px; border-radius: 999px; }
.sb-link.active .sb-cnt { background: rgba(37, 99, 235, 0.16); color: var(--accent); }
.sb-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 8px; }

/* ── Top App Bar ── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  background: var(--glass);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 10px; height: 100%; }
.mob-brand { display: none; align-items: center; gap: 8px; color: var(--text); font-weight: 800; font-size: 1.05rem; letter-spacing: -0.02em; }
.mob-brand em { font-style: normal; color: var(--accent); }
.mob-greet { display: none; font-size: .78rem; color: var(--muted); font-weight: 600; }
.mob-back {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-subtle); color: var(--text); flex-shrink: 0;
}
.topbar-title {
  font-size: .96rem; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.cmd-trigger {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px; padding: 0 12px; border-radius: 10px;
  background: var(--bg-subtle); color: var(--muted);
  border: 1px solid var(--border); font: inherit; font-size: .85rem; cursor: pointer;
}
.cmd-trigger:hover { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.cmd-trigger kbd { font: inherit; font-size: .72rem; font-weight: 700; padding: 1px 6px; border-radius: 5px; background: var(--card); border: 1px solid var(--border); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  background: var(--bg-subtle); color: var(--text-2);
  border: 1px solid var(--border); border-radius: 50%;
  cursor: pointer; transition: transform .12s, background .15s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn:hover { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.icon-btn.starred { color: var(--gold); background: rgba(245, 158, 11, 0.16); border-color: rgba(245, 158, 11, 0.35); }
.icon-btn svg { width: 17px; height: 17px; }
.install-pill {
  display: inline-flex; align-items: center; gap: 5px;
  height: 34px; padding: 0 12px; border-radius: 999px;
  background: var(--accent); color: #fff; border: 0;
  font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer;
}

/* Native Mobile Top Bar: Blue Super-App Header on Home, Clean iOS Bar on Tool Pages */
@media (max-width: 1024px) {
  .mob-brand, .mob-back { display: inline-flex; }
  .cmd-trigger { display: none; }
  body.is-home .site-header {
    background: #0d2266; border-bottom: 0;
    backdrop-filter: none; -webkit-backdrop-filter: none;
  }
  body.is-home .mob-brand { color: #fff; }
  body.is-home .mob-brand em { color: #fde047; }
  body.is-home .mob-greet { display: inline; color: rgba(255, 255, 255, 0.72); margin-left: 2px; }
  body.is-home .site-header .icon-btn { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.16); color: #fff; }
  body.is-home .site-header .install-pill { background: #fbbf24; color: #0b1220; }
}

/* ── Mobile Native Bottom Tab Bar ── */
.app-tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--glass);
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid var(--border);
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 1024px) { .app-tabbar { display: grid; } }
.tab-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: none; border: 0; color: var(--muted); font: inherit;
  font-size: .68rem; font-weight: 700; cursor: pointer; text-decoration: none;
  border-radius: 12px; transition: color .12s, transform .1s;
}
.tab-item:active { transform: scale(0.92); }
.tab-item svg { width: 22px; height: 22px; }
.tab-item.active { color: var(--accent); }

/* ── Mobile Floating Live Result Dock (on Calculator Pages) ── */
.result-dock {
  display: none;
}
@media (max-width: 860px) {
  .result-dock {
    position: fixed; left: 12px; right: 12px;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 10px);
    z-index: 65;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 14px; border-radius: 16px;
    background: #0d1d4f; color: #fff;
    box-shadow: 0 12px 30px -6px rgba(9, 19, 46, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.14);
    transition: transform .22s ease, opacity .22s ease;
  }
  [data-theme="dark"] .result-dock { background: #1d4ed8; }
  .result-dock.in-view, .result-dock.empty { transform: translateY(130%); opacity: 0; pointer-events: none; }
  .rd-text { min-width: 0; }
  .rd-lbl { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: rgba(255, 255, 255, 0.72); font-weight: 700; }
  .rd-val { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .rd-btn {
    flex-shrink: 0; border: 0; border-radius: 999px;
    padding: 8px 14px; font: inherit; font-size: .78rem; font-weight: 700;
    background: rgba(255, 255, 255, 0.18); color: #fff; cursor: pointer;
  }
}

/* ── Native Slide-Up Bottom Sheet ── */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(7, 11, 20, 0); display: flex; align-items: flex-end; justify-content: center;
  transition: background .2s ease;
}
.sheet-backdrop.open { background: rgba(7, 11, 20, 0.52); backdrop-filter: blur(4px); }
.sheet {
  width: 100%; max-width: 560px; max-height: 78dvh;
  background: var(--bg-elevated); border-radius: 24px 24px 0 0;
  padding: 10px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform .24s cubic-bezier(.22, 1, .36, 1);
}
.sheet-backdrop.open .sheet { transform: translateY(0); }
.sheet-handle { width: 40px; height: 4px; border-radius: 999px; background: var(--border-strong); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.sheet-head h3 { margin: 0; font-size: 1.02rem; font-weight: 800; }
.sheet-body { overflow-y: auto; }
.sheet-cats { display: flex; flex-direction: column; gap: 6px; }
.sheet-cat {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-radius: 14px; background: var(--bg); color: var(--text); font-weight: 600; font-size: .92rem;
}
.sheet-cat:active { background: var(--accent-soft); }
.sc-ic { font-size: 1.2rem; }
.sc-cnt { margin-left: auto; font-size: .8rem; color: var(--muted); font-weight: 600; }
.app-icon-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; padding: 6px 0; }
.app-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--text); }
.app-tile .ic {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  font-size: 1.55rem; background: var(--cat-bg, var(--accent-soft)); border: 1px solid var(--cat-bd, transparent);
}
.at-lbl { font-size: .74rem; font-weight: 600; line-height: 1.2; color: var(--text-2); }

/* ── Command Palette / Mobile Full-Screen Search ── */
.cmd-backdrop {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(7, 11, 20, 0.56); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: min(10vh, 80px) 16px 16px;
}
.cmd-dialog {
  width: 100%; max-width: 560px; background: var(--bg-elevated);
  border: 1px solid var(--border-strong); border-radius: 20px;
  box-shadow: var(--shadow-lg); overflow: hidden;
}
@media (max-width: 640px) {
  .cmd-backdrop { padding: 0; background: var(--bg-elevated); }
  .cmd-dialog { max-width: none; height: 100dvh; border-radius: 0; border: 0; display: flex; flex-direction: column; }
  .cmd-list { max-height: none; flex: 1; }
}
.cmd-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cmd-head input { flex: 1; border: 0; background: transparent; color: var(--text); font-size: 16px; font-family: inherit; outline: none; margin: 0; padding: 0; }
.cmd-head input:focus { box-shadow: none; }
.cmd-list { max-height: 58vh; overflow-y: auto; padding: 8px; }
.cmd-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 13px; color: var(--text); }
.cmd-item:hover, .cmd-item.sel { background: var(--accent-soft); color: var(--text); }
.cmd-item .ci-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--cat-bg, var(--bg-subtle)); font-size: 1.2rem; flex-shrink: 0; }
.cmd-item .ci-name { font-weight: 700; font-size: .92rem; }
.cmd-item .ci-sub { font-size: .78rem; color: var(--muted); }
.cmd-item .ci-cat { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--muted); }

/* ── Homepage Hero (Desktop Dashboard + Mobile Super-App Curved Header) ── */
.dash-hero {
  margin: 20px 0 22px; padding: 26px; border-radius: 22px; position: relative; overflow: hidden;
  background:
    radial-gradient(65% 90% at 95% 10%, rgba(245, 158, 11, 0.24), transparent 58%),
    radial-gradient(60% 80% at 10% 100%, rgba(59, 130, 246, 0.34), transparent 60%),
    linear-gradient(155deg, #0d2266 0%, #163799 65%, #0e246c 100%);
  color: #fff; box-shadow: var(--shadow-md);
}
.dash-hero-top { margin-bottom: 10px; }
.hero-pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.13); border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: .76rem; font-weight: 700; color: #e2e8f0;
}
.hero-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #fbbf24; box-shadow: 0 0 8px #fbbf24; }
.dash-hero h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; }
.dash-hero h1 em { font-style: normal; background: linear-gradient(90deg, #fde047, #f59e0b); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dash-hero p { margin: 0 0 18px; color: #dbeafe; font-size: .95rem; max-width: 600px; }
.search-wrap { position: relative; max-width: 560px; }
.search-wrap svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: #64748b; pointer-events: none; }
.search-wrap kbd { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); padding: 3px 8px; border-radius: 6px; font-size: .72rem; font-weight: 700; color: #64748b; background: #f1f5f9; border: 1px solid #e2e8f0; pointer-events: none; }
.search {
  width: 100%; padding: 13px 44px; border-radius: 14px;
  border: 0; background: #fff; color: #0b1220; font-size: 16px; font-family: inherit;
  box-shadow: 0 10px 26px -8px rgba(0, 0, 0, 0.35);
}
.search::placeholder { color: #94a3b8; }
.search:focus { outline: none; box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.42); }
.quick-links { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 14px; }
.quick-links a {
  color: #fff; font-size: .78rem; font-weight: 600; padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.16);
}
.quick-links a:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }

/* Mobile Super-App Curved Hero (full-bleed like TnG eWallet / Grab!) */
@media (max-width: 768px) {
  .dash-hero {
    margin: 0 -14px 16px; border-radius: 0 0 26px 26px;
    padding: 8px 16px 20px; box-shadow: 0 10px 24px -10px rgba(13, 34, 102, 0.4);
  }
  .dash-hero-top, .dash-hero p, .search-wrap kbd { display: none; }
  .dash-hero h1 { font-size: 1.25rem; margin-bottom: 12px; }
  .search { padding: 12px 16px 12px 42px; border-radius: 999px; font-size: 15px; }
  .quick-links { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 12px -16px 0; padding: 0 16px; }
  .quick-links::-webkit-scrollbar { display: none; }
  .quick-links a { flex-shrink: 0; }
}

/* Section headers */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin: 16px 0 10px; }
.sec-head h2 { margin: 0; font-size: .98rem; font-weight: 800; letter-spacing: -0.02em; }

/* Category Chips */
.chips { display: flex; gap: 8px; margin: 14px 0 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--card); color: var(--text-2);
  padding: 7px 13px; border-radius: 999px; cursor: pointer;
  font-size: .82rem; font-weight: 700; font-family: inherit;
  box-shadow: var(--shadow-xs); transition: all .14s;
}
.chip .cnt { font-size: .7rem; padding: 1px 6px; border-radius: 999px; background: var(--bg-subtle); color: var(--muted); }
.chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.active .cnt { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* ── Tool Grid: Desktop Cards → Mobile 4-Column Super-App Squircle Launcher! ── */
.tool-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 14px; margin: 0 0 28px;
}
.tool-card {
  position: relative; display: flex; align-items: flex-start; gap: 14px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; color: var(--text);
  box-shadow: var(--shadow-xs);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tool-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(37, 99, 235, 0.35); color: var(--text); }
.tool-card:active { transform: scale(0.96); }
.tool-card .ic {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.45rem; line-height: 1;
  background: var(--cat-bg, var(--accent-soft));
  border: 1px solid var(--cat-bd, transparent);
}
.tool-card .tc-body { min-width: 0; flex: 1; }
.tool-card .app-lbl { display: none; }
.tool-card h3 { margin: 0 0 2px; font-size: .95rem; font-weight: 700; letter-spacing: -0.015em; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.tool-card .arrow { color: var(--muted); opacity: 0; transition: opacity .15s, transform .15s; font-size: .95rem; }
.tool-card:hover .arrow { opacity: 1; transform: translateX(2px); color: var(--accent); }
.tool-card small { color: var(--accent); display: block; font-size: .76rem; font-weight: 600; margin-bottom: 4px; }
.tool-card p { margin: 0; color: var(--muted); font-size: .83rem; line-height: 1.45; }

/* Mobile: 4-Column Squircle App Icon Launcher inside a clean elevated surface card! */
@media (max-width: 640px) {
  .tool-list {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px 8px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 18px 10px;
    box-shadow: var(--shadow-xs);
    margin-bottom: 20px;
  }
  .tool-card {
    flex-direction: column; align-items: center; text-align: center;
    gap: 7px; padding: 4px 2px; border: 0; background: transparent; box-shadow: none;
  }
  .tool-card:hover { transform: none; box-shadow: none; }
  .tool-card .ic {
    width: 54px; height: 54px; border-radius: 17px; font-size: 1.55rem;
    box-shadow: 0 3px 10px -3px rgba(15, 23, 42, 0.12);
  }
  .tool-card .tc-body { display: none; }
  .tool-card .app-lbl {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: .72rem; font-weight: 600; line-height: 1.2; color: var(--text-2);
  }
}

/* Category icon tints (applies to cards, squircles, search icons & page icons) */
[data-cat="Finance"] { --cat-bg: rgba(16, 185, 129, 0.14); --cat-bd: rgba(16, 185, 129, 0.24); }
[data-cat="Loans & Property"] { --cat-bg: rgba(37, 99, 235, 0.13); --cat-bd: rgba(37, 99, 235, 0.24); }
[data-cat="Vehicles & Travel"] { --cat-bg: rgba(249, 115, 22, 0.14); --cat-bd: rgba(249, 115, 22, 0.24); }
[data-cat="Islamic"] { --cat-bg: rgba(13, 148, 136, 0.14); --cat-bd: rgba(13, 148, 136, 0.24); }
[data-cat="Daily Life"] { --cat-bg: rgba(245, 158, 11, 0.15); --cat-bd: rgba(245, 158, 11, 0.26); }
[data-cat="Personal"] { --cat-bg: rgba(244, 63, 94, 0.13); --cat-bd: rgba(244, 63, 94, 0.24); }
[data-cat="Generators"] { --cat-bg: rgba(168, 85, 247, 0.14); --cat-bd: rgba(168, 85, 247, 0.24); }
[data-cat="Converters"] { --cat-bg: rgba(6, 182, 212, 0.14); --cat-bd: rgba(6, 182, 212, 0.24); }

/* Feature strip */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 8px 0 24px; }
@media (max-width: 768px) { .features { grid-template-columns: 1fr; } }
.feat-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-xs); }
.feat-card .f-ic { width: 36px; height: 36px; border-radius: 10px; margin-bottom: 8px; display: grid; place-items: center; font-size: 1.1rem; background: var(--accent-soft); }
.feat-card h2 { margin: 0 0 4px; font-size: .94rem; font-weight: 700; }
.feat-card p { margin: 0; color: var(--muted); font-size: .84rem; }

/* ── Tool Pages ── */
.page-head { padding: 22px 0 16px; margin-bottom: 18px; border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-bottom: 10px; font-weight: 500; }
.crumbs a { color: var(--muted); }
.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-title { display: flex; align-items: center; gap: 13px; }
.head-icon { width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; display: grid; place-items: center; font-size: 1.55rem; background: var(--cat-bg, var(--accent-soft)); border: 1px solid var(--cat-bd, var(--border)); }
.page-head h1 { margin: 0; font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.2; }
.page-head .bm { display: block; color: var(--muted); font-weight: 500; font-size: .88rem; margin-top: 2px; }
.lead { color: var(--muted); margin: 8px 0 0; font-size: .92rem; max-width: 680px; }

/* Compact App Header on Mobile Tool Pages (no desktop breadcrumbs or redundant buttons) */
@media (max-width: 640px) {
  .page-head { padding: 14px 0 12px; margin-bottom: 14px; border-bottom: 0; }
  .crumbs, .page-head .share { display: none; }
  .head-icon { width: 42px; height: 42px; border-radius: 13px; font-size: 1.35rem; }
  .page-head h1 { font-size: 1.2rem; }
  .page-head .bm { font-size: .8rem; }
  .lead { font-size: .84rem; margin-top: 6px; }
}

.grid2 { display: grid; grid-template-columns: 1.06fr 0.94fr; gap: 16px; align-items: start; margin: 0 0 20px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 20px; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
@media (max-width: 640px) { .card { padding: 16px; border-radius: 18px; } }
.card h2 { margin: 0 0 14px; font-size: 1.02rem; font-weight: 700; letter-spacing: -0.015em; }
.card h3 { margin: 16px 0 8px; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

/* ── Forms (16px inputs prevent iOS zoom!) ── */
label { display: block; font-size: .84rem; font-weight: 600; color: var(--text-2); margin: 0 0 13px; }
label .hint { font-weight: 400; color: var(--muted); font-size: .76rem; margin-left: 4px; }
input[type=number], input[type=text], input[type=date], input[type=password], input[type=file], select, textarea {
  display: block; width: 100%; margin-top: 6px; padding: 12px 13px;
  border: 1px solid var(--border-strong); border-radius: 13px;
  background: var(--bg); color: var(--text);
  font-size: 16px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: var(--card); }
input[readonly] { background: var(--bg-subtle); font-weight: 700; color: var(--accent); }
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
input[type=range] { accent-color: var(--accent); cursor: pointer; margin-top: 8px; width: 100%; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 480px) { .row, .row3 { grid-template-columns: 1fr; } }

.check {
  display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text); cursor: pointer;
  padding: 11px 13px; border-radius: 13px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 10px;
}
.check input { width: 19px; height: 19px; accent-color: var(--accent); margin: 0; cursor: pointer; flex-shrink: 0; }

/* Buttons & iOS Segmented Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  background: var(--accent); color: #fff; border: 1px solid transparent;
  border-radius: 12px; padding: 11px 16px;
  font-size: .88rem; font-weight: 700; font-family: inherit; cursor: pointer;
  transition: background .15s, transform .1s;
}
.btn:hover { background: var(--accent-hover); color: #fff; }
.btn:active { transform: scale(0.96); }
.btn.secondary { background: var(--bg-subtle); color: var(--text-2); border-color: var(--border); }
.btn.secondary:hover { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.share { margin: 0; }

.tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 16px;
  background: var(--bg-subtle); border-radius: 13px; border: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  flex: 1; white-space: nowrap; border: 0; background: transparent; color: var(--muted);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font-weight: 700; font-size: .84rem; font-family: inherit;
}
.tabs button.active { background: var(--card); color: var(--text); box-shadow: var(--shadow-xs); }
.hidden { display: none !important; }

/* Result Card */
.result { position: sticky; top: 72px; border-top: 3px solid var(--accent); box-shadow: var(--shadow-md); }
@media (max-width: 860px) { .result { position: static; } }
.big-label { color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.big {
  font-size: clamp(1.8rem, 4.5vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; color: var(--accent);
  margin: 4px 0 14px; word-break: break-word; line-height: 1.15; font-variant-numeric: tabular-nums;
}

/* Tables, Badges, Alerts */
table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
th { padding: 9px 6px; border-bottom: 2px solid var(--border); text-align: left; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td { padding: 9px 6px; border-bottom: 1px solid var(--border); text-align: left; color: var(--text-2); }
td:last-child, th:last-child { text-align: right; font-weight: 600; color: var(--text); }
tr:last-child td { border-bottom: 0; }
tr.total td { font-weight: 800; color: var(--text); border-top: 2px solid var(--border-strong); background: var(--bg); }
.neg { color: var(--bad) !important; }
.pos { color: var(--ok) !important; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; color: #fff; }
.scroll { max-height: 400px; overflow: auto; border-radius: var(--radius-sm); }
.note { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.alert { background: rgba(245, 158, 11, 0.1); color: var(--text-2); border: 1px solid rgba(245, 158, 11, 0.28); border-left: 4px solid var(--gold); padding: 12px 14px; border-radius: 12px; font-size: .84rem; margin: 12px 0; }
.bar { height: 9px; background: var(--bg-subtle); border-radius: 999px; overflow: hidden; margin: 6px 0 14px; border: 1px solid var(--border); }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), #60a5fa); border-radius: 999px; transition: width .25s ease; }

/* Pillar Guide & FAQ Accordion */
.info h2 { font-size: 1.02rem; margin-bottom: 10px; }
.info h3 { font-size: .92rem; text-transform: none; letter-spacing: 0; color: var(--text); margin: 14px 0 6px; }
.info p, .info li { color: var(--muted); font-size: .88rem; line-height: 1.6; }
.info ul { padding-left: 18px; margin: 8px 0; }
.info li { margin-bottom: 5px; }

.faq-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.faq-item { border: 1px solid var(--border); border-radius: 13px; background: var(--bg); overflow: hidden; }
.faq-item[open] { border-color: rgba(37, 99, 235, 0.35); background: var(--card); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 13px 14px; font-weight: 600; font-size: .88rem; color: var(--text);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.15rem; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-a { padding: 10px 14px 13px; color: var(--muted); font-size: .86rem; line-height: 1.6; border-top: 1px solid var(--border); }
.faq-item .faq-a p { margin: 0; }

/* Related & Footer */
.related { margin-top: 24px; }
.related h2 { font-size: 1.02rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 12px; }

.site-footer { background: var(--card); border-top: 1px solid var(--border); margin-top: 36px; padding: 28px 0 22px; font-size: .84rem; color: var(--muted); }
.site-footer .cols { display: grid; grid-template-columns: 1.3fr 1fr 1.3fr; gap: 22px; align-items: start; }
@media (max-width: 768px) {
  .site-footer { padding: 20px 0 16px; margin-top: 24px; }
  .site-footer .cols { grid-template-columns: 1fr; gap: 14px; }
}
.site-footer h4 { margin: 0 0 8px; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.footer-links a { color: var(--muted); font-weight: 500; }
.flagline { height: 3px; background: linear-gradient(90deg, #dc2626 0 25%, #e2e8f0 25% 50%, #1d4ed8 50% 75%, #f59e0b 75% 100%); opacity: .85; }

.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: #0b1220; color: #fff; padding: 10px 20px; border-radius: 999px;
  z-index: 130; font-size: .85rem; font-weight: 600; box-shadow: var(--shadow-lg);
}
[data-theme="dark"] .toast { background: #f8fafc; color: #0b1220; }

@media print {
  body { padding: 0 !important; background: #fff; color: #000; }
  .app-sidebar, .app-tabbar, .result-dock, .site-header, .site-footer, .flagline, .related, .btns, .share, .cmd-backdrop, .sheet-backdrop { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ddd; }
}
