/* JomSemak v3 (PHP & MySQL) — Brand-New World-Class Light-Mode-Only Design System
   Zero sidebar squeeze, zero horizontal overflow, fluid 360px–1920px responsiveness, CLS-safe Ad Slots, Print-ready */

:root {
  --bg: #f6f8fc;
  --surface: #ffffff;
  --surface-2: #f0f4fa;
  --text: #0b1220;
  --text-2: #334155;
  --muted: #64748b;
  --border: #e5eaf2;
  --border-strong: #cbd5e1;

  --navy: #0b1a54;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff4ff;
  --gold: #f59e0b;
  --gold-bright: #fbbf24;
  --ok: #059669;
  --ok-soft: #ecfdf5;
  --warn: #d97706;
  --bad: #dc2626;

  --nav-h: 64px;
  --tabbar-h: 62px;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-xs: 0 1px 2px rgba(11, 18, 32, 0.04);
  --shadow-sm: 0 4px 16px -4px rgba(11, 18, 32, 0.07), 0 1px 3px rgba(11, 18, 32, 0.04);
  --shadow-md: 0 16px 36px -12px rgba(11, 18, 32, 0.12), 0 4px 12px -4px rgba(11, 18, 32, 0.05);
  --shadow-lg: 0 28px 60px -14px rgba(11, 18, 32, 0.24);
  --ring: 0 0 0 3px rgba(29, 78, 216, 0.18);
}

*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: clip;
}
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.58;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
}
main { flex: 1; }

/* Rock-solid Modal / Drawer Background Scroll Lock (Desktop Wheel + iOS Safari) */
html.modal-open, body.modal-open { overflow: hidden !important; overscroll-behavior: none; }
body.modal-open { position: fixed; left: 0; right: 0; width: 100%; touch-action: none; }
.modal-scroll { overscroll-behavior: contain; touch-action: pan-y; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent); text-decoration: none; transition: color .15s ease; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; }
svg { flex-shrink: 0; }
code {
  background: var(--surface-2); color: var(--text);
  padding: 2px 6px; border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86em;
}

.wrap, .container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 640px) {
  .wrap, .container { padding: 0 16px; }
  body { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 14px); }
  body.is-tool { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 78px); }
}

/* ── Sticky Top Navigation Bar ── */
.navbar {
  position: sticky; top: 0; z-index: 60;
  height: var(--nav-h);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; gap: 20px; height: 100%;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 800; font-size: 1.2rem; letter-spacing: -0.03em;
  flex-shrink: 0;
}
.brand:hover { color: var(--text); }
.brand em { font-style: normal; color: var(--accent); }
.brand-ic {
  width: 34px; height: 34px; border-radius: 10px; overflow: hidden;
  box-shadow: 0 4px 12px rgba(11, 26, 84, 0.2); flex-shrink: 0; display: block;
}
.brand-ic img { width: 100%; height: 100%; object-fit: cover; display: block; }

.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--text-2); font-size: .88rem; font-weight: 600;
  background: transparent; border: 0; font-family: inherit; cursor: pointer;
  transition: background .14s, color .14s;
}
.nav-link:hover, .nav-link.active { background: var(--surface-2); color: var(--accent); }

/* Desktop Categories Mega Dropdown */
.nav-drop { position: relative; }
.nav-mega {
  position: absolute; top: calc(100% + 10px); left: 0;
  width: 560px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: var(--shadow-lg);
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
  z-index: 80;
}
.nav-drop:hover .nav-mega, .nav-drop.open .nav-mega { opacity: 1; visibility: visible; transform: translateY(0); }
.mega-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px;
  border-radius: 12px; color: var(--text); transition: background .12s;
}
.mega-item:hover { background: var(--accent-soft); color: var(--accent); }
.mega-ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.15rem;
  background: var(--cat-bg, var(--surface-2));
}
.mega-name { font-size: .86rem; font-weight: 700; display: block; line-height: 1.25; }
.mega-cnt { font-size: .74rem; color: var(--muted); }

.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-search {
  display: inline-flex; align-items: center; gap: 8px;
  height: 38px; padding: 0 13px; border-radius: 11px;
  background: var(--surface-2); color: var(--muted);
  border: 1px solid var(--border); font: inherit; font-size: .85rem; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.nav-search:hover { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.nav-search kbd {
  font: inherit; font-size: .72rem; font-weight: 700;
  padding: 2px 6px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted);
}
.lang-switch {
  display: inline-flex; align-items: center; padding: 3px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px;
}
.lang-switch a {
  padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 800;
  color: var(--muted); line-height: 1.2;
}
.lang-switch a.active { background: var(--surface); color: var(--accent); box-shadow: var(--shadow-xs); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--surface-2); color: var(--text-2);
  border: 1px solid var(--border); cursor: pointer;
  transition: background .14s, color .14s, transform .1s;
}
.icon-btn:hover { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn.starred { color: var(--gold); background: #fffbeb; border-color: #fde68a; }
.mob-menu-btn { display: none; }

@media (max-width: 960px) {
  .nav-links, .nav-search .ns-lbl, .nav-search kbd { display: none; }
  .nav-search { padding: 0 10px; }
  .mob-menu-btn { display: inline-flex; }
}
@media (max-width: 640px) {
  .navbar { height: 58px; }
  .brand { font-size: 1.1rem; gap: 8px; }
  .brand-ic { width: 30px; height: 30px; border-radius: 9px; }
}

/* ── Live Malaysian Rates Ticker Bar ── */
.ticker-strip {
  background: var(--navy);
  color: #e2e8f0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: .78rem;
}
.ticker-inner {
  display: flex; align-items: center; gap: 18px;
  padding: 9px 24px; max-width: 1180px; margin: 0 auto;
  overflow-x: auto; scrollbar-width: none; white-space: nowrap;
}
.ticker-inner::-webkit-scrollbar { display: none; }
.tk-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 800; color: var(--gold-bright); letter-spacing: .03em; text-transform: uppercase; font-size: .7rem;
}
.tk-dot { width: 7px; height: 7px; border-radius: 50%; background: #34d399; box-shadow: 0 0 8px #34d399; }
.tk-item { color: #cbd5e1; display: inline-flex; align-items: center; gap: 6px; }
.tk-item b { color: #ffffff; font-weight: 700; font-variant-numeric: tabular-nums; }
.tk-item:hover { color: #ffffff; }
@media (max-width: 640px) { .ticker-inner { padding: 8px 16px; gap: 14px; } }

/* ── Homepage Hero ── */
.hero {
  margin: 24px 0 22px;
  padding: 36px 34px;
  border-radius: 24px;
  position: relative; overflow: hidden;
  background:
    radial-gradient(60% 90% at 95% 5%, rgba(251, 191, 36, 0.22), transparent 55%),
    radial-gradient(55% 80% at 5% 100%, rgba(59, 130, 246, 0.34), transparent 60%),
    linear-gradient(145deg, #0b1a54 0%, #1639a3 60%, #0d2266 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}
.hero-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 13px; border-radius: 999px; margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.13); border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: .77rem; font-weight: 700; color: #e2e8f0;
}
.hero-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold-bright); }
.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3.6vw, 2.45rem);
  font-weight: 800; letter-spacing: -0.03em; line-height: 1.15;
  max-width: 760px;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, #fde047, #f59e0b);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { margin: 0 0 22px; color: #dbeafe; font-size: .98rem; max-width: 660px; line-height: 1.55; }
.hero-search { position: relative; max-width: 600px; }
.hero-search svg {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 19px; height: 19px; color: #64748b; pointer-events: none;
}
.hero-search input {
  width: 100%; padding: 15px 52px 15px 46px;
  border-radius: 15px; border: 0; background: #fff; color: var(--text);
  font-size: 16px; font-family: inherit;
  box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.35);
}
.hero-search input::placeholder { color: #94a3b8; }
.hero-search input:focus { outline: none; box-shadow: 0 0 0 4px rgba(147, 197, 253, 0.45); }
.hero-search kbd {
  position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
  padding: 3px 8px; border-radius: 6px; font-size: .74rem; font-weight: 700;
  color: #64748b; background: #f1f5f9; border: 1px solid #e2e8f0; pointer-events: none;
}
.quick-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.quick-pills a {
  display: inline-flex; align-items: center; gap: 6px;
  color: #fff; font-size: .8rem; font-weight: 600;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.18);
  transition: background .14s;
}
.quick-pills a:hover { background: rgba(255, 255, 255, 0.25); color: #fff; }

@media (max-width: 640px) {
  .hero { margin: 14px 0 18px; padding: 22px 18px; border-radius: 20px; }
  .hero h1 { font-size: 1.42rem; }
  .hero-sub { font-size: .88rem; margin-bottom: 16px; }
  .hero-search kbd { display: none; }
  .hero-search input { padding: 13px 16px 13px 42px; font-size: 15px; border-radius: 13px; }
  .quick-pills { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 14px -18px 0; padding: 0 18px; }
  .quick-pills::-webkit-scrollbar { display: none; }
  .quick-pills a { flex-shrink: 0; }
}

/* ── Category Chips ── */
.chips {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px;
  padding: 2px 0 4px;
}
@media (max-width: 640px) {
  .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 6px; }
  .chips::-webkit-scrollbar { display: none; }
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  padding: 8px 14px; border-radius: 999px; cursor: pointer;
  font-size: .83rem; font-weight: 700; font-family: inherit;
  box-shadow: var(--shadow-xs); transition: all .14s ease;
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip .cnt {
  font-size: .7rem; padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); 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; }

/* ── 8 Silo Category Tints ── */
[data-cat="daily-rates"]        { --cat-bg: #fef3c7; --cat-bd: #fde68a; }
[data-cat="hr-payroll"]         { --cat-bg: #d1fae5; --cat-bd: #a7f3d0; }
[data-cat="tax-business"]       { --cat-bg: #e0e7ff; --cat-bd: #c7d2fe; }
[data-cat="loans-property"]     { --cat-bg: #dbeafe; --cat-bd: #bfdbfe; }
[data-cat="islamic"]            { --cat-bg: #ccfbf1; --cat-bd: #99f6e4; }
[data-cat="vehicles-bills"]     { --cat-bg: #ffedd5; --cat-bd: #fed7aa; }
[data-cat="personal-education"] { --cat-bg: #ffe4e6; --cat-bd: #fecdd3; }
[data-cat="utilities"]          { --cat-bg: #f3e8ff; --cat-bd: #e9d5ff; }

/* ── Tool Grid (3-col Desktop → 2-col Tablet → Clean 2-col Mobile) ── */
.sec-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 26px 0 14px;
}
.sec-head h2 { margin: 0; font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em; }
.sec-link { font-size: .84rem; font-weight: 700; color: var(--accent); }

.tool-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0 0 28px;
}
@media (max-width: 980px) { .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .tool-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }

.tool-card {
  display: flex; align-items: flex-start; gap: 13px; min-width: 0;
  background: var(--surface); 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(29, 78, 216, 0.35); color: var(--text);
}
.tool-card .ic {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.4rem; 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 h3 {
  margin: 0 0 2px; font-size: .94rem; font-weight: 700; letter-spacing: -0.015em;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  line-height: 1.3;
}
.tool-card .arrow { color: var(--muted); opacity: 0; transition: opacity .15s, transform .15s; font-size: .92rem; }
.tool-card:hover .arrow { opacity: 1; transform: translateX(2px); color: var(--accent); }
.tool-card small { color: var(--accent); display: block; font-size: .74rem; font-weight: 600; margin-bottom: 4px; }
.tool-card p { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; }

@media (max-width: 640px) {
  .tool-card { flex-direction: column; gap: 9px; padding: 13px; border-radius: 15px; }
  .tool-card .ic { width: 40px; height: 40px; border-radius: 11px; font-size: 1.25rem; }
  .tool-card h3 { font-size: .86rem; }
  .tool-card .arrow, .tool-card p { display: none; }
  .tool-card small { margin-bottom: 0; font-size: .72rem; line-height: 1.3; color: var(--muted); }
}

/* ── Blog Grid & Article Typography ── */
.blog-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px; margin-bottom: 28px;
}
@media (max-width: 720px) { .blog-grid { grid-template-columns: 1fr; } }
.blog-card {
  display: flex; flex-direction: column; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; color: var(--text);
  box-shadow: var(--shadow-xs); transition: transform .15s, box-shadow .15s, border-color .15s;
}
.blog-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(29, 78, 216, 0.35); color: var(--text); }
.blog-meta { display: flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 700; color: var(--muted); }
.blog-pill { background: var(--accent-soft); color: var(--accent); padding: 2px 9px; border-radius: 999px; }
.blog-card h3 { margin: 0; font-size: 1.02rem; font-weight: 800; line-height: 1.35; letter-spacing: -0.015em; }
.blog-card p { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.55; }
.blog-more { margin-top: auto; padding-top: 6px; font-size: .82rem; font-weight: 700; color: var(--accent); }

.article-body { max-width: 780px; }
.article-body h2 { font-size: 1.22rem; font-weight: 800; margin: 24px 0 10px; letter-spacing: -0.02em; color: var(--text); }
.article-body h3 { font-size: 1.02rem; font-weight: 700; margin: 18px 0 8px; color: var(--text); }
.article-body p, .article-body li { font-size: .95rem; line-height: 1.72; color: var(--text-2); }
.article-body ul, .article-body ol { padding-left: 22px; margin: 10px 0 16px; }
.article-body li { margin-bottom: 6px; }

/* ── Tool Page Header & Spacious 2-Column Calculator Grid ── */
.page-head { padding: 24px 0 18px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: .8rem; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head-title { display: flex; align-items: center; gap: 14px; min-width: 0; }
.head-icon {
  width: 52px; height: 52px; border-radius: 15px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.6rem;
  background: var(--cat-bg, var(--accent-soft)); border: 1px solid var(--cat-bd, var(--border));
}
.page-head h1 { margin: 0; font-size: clamp(1.35rem, 3vw, 1.9rem); font-weight: 800; letter-spacing: -0.028em; line-height: 1.2; }
.page-head .bm { display: block; color: var(--muted); font-weight: 500; font-size: .88rem; margin-top: 3px; }
.lead { color: var(--muted); margin: 10px 0 0; font-size: .95rem; max-width: 760px; }

@media (max-width: 640px) {
  .page-head { padding: 14px 0 14px; margin-bottom: 14px; }
  .head-icon { width: 44px; height: 44px; border-radius: 13px; font-size: 1.35rem; }
  .page-head h1 { font-size: 1.24rem; }
  .lead { font-size: .86rem; }
}

/* Spacious Calculator Grid (zero sidebar squeeze!) */
.grid2 {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 22px;
  align-items: start;
  margin: 0 0 22px;
}
@media (max-width: 900px) { .grid2 { grid-template-columns: minmax(0, 1fr); gap: 16px; } }

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

/* ── Forms & Inputs (Zero iOS Zoom, Zero Select Arrow Bug) ── */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--text-2); margin: 0 0 14px; min-width: 0; }
label .hint { font-weight: 400; color: var(--muted); font-size: .76rem; margin-left: 4px; }
input[type=number], input[type=text], input[type=email], input[type=date], input[type=password], input[type=tel], input[type=search]:not(.hero-search-inp):not(#cmdInput), input[type=file], textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--bg); color: var(--text);
  font-size: 16px; font-family: inherit; line-height: 1.35;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
input[type=file] { padding: 9px 11px; cursor: pointer; font-size: .88rem; }
input[type=file]::file-selector-button {
  border: 0; border-radius: 8px; padding: 7px 12px; margin-right: 10px;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer;
}
select {
  display: block; width: 100%; margin-top: 6px; padding: 11px 38px 11px 13px;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  background-color: var(--bg); color: var(--text);
  font-size: 16px; font-family: inherit; line-height: 1.35;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 16px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
select::picker-icon { display: none; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: var(--ring); background-color: var(--surface);
}
input[readonly] { background: var(--surface-2); font-weight: 700; color: var(--accent); }
textarea { min-height: 140px; 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: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 540px) { .row, .row3 { grid-template-columns: minmax(0, 1fr); gap: 0; } }

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

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

.tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 16px;
  background: var(--surface-2); 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(--surface); color: var(--text); box-shadow: var(--shadow-xs); }
.hidden { display: none !important; }

/* ── Result Card, Tables & Visual Bars ── */
.result { position: sticky; top: calc(var(--nav-h) + 18px); border-top: 3px solid var(--accent); box-shadow: var(--shadow-md); }
@media (max-width: 900px) { .result { position: static; } }
.big-label { color: var(--muted); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.big {
  font-size: clamp(1.85rem, 4vw, 2.45rem); 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;
}

table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
th { padding: 10px 8px; border-bottom: 2px solid var(--border); text-align: left; font-size: .73rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
td { padding: 10px 8px; border-bottom: 1px solid var(--border); text-align: left; color: var(--text-2); vertical-align: middle; }
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; }
.table-wrap, .scroll {
  display: block; width: 100%; max-width: 100%;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  background:
    linear-gradient(to right, #fff 24%, rgba(255,255,255,0)) left center,
    linear-gradient(to left, #fff 24%, rgba(255,255,255,0)) right center,
    radial-gradient(farthest-side at 0 50%, rgba(15,23,42,.11), rgba(0,0,0,0)) left center,
    radial-gradient(farthest-side at 100% 50%, rgba(15,23,42,.11), rgba(0,0,0,0)) right center;
  background-repeat: no-repeat;
  background-size: 28px 100%, 28px 100%, 10px 100%, 10px 100%;
  background-attachment: local, local, scroll, scroll;
}
.scroll { max-height: 420px; overflow-y: auto; }
.table-wrap table.is-multi, .scroll table.is-multi { min-width: 520px; }
.table-wrap table.adm-table { min-width: 620px; }
.table-wrap th, .scroll th { white-space: nowrap; }
table.is-kv td:first-child { overflow-wrap: break-word; padding-right: 10px; }
table.is-kv td:last-child { white-space: nowrap; }
@media (max-width: 640px) {
  table { font-size: .83rem; }
  th, td { padding: 8px 6px; }
  table.is-kv td:last-child { white-space: normal; word-break: break-word; min-width: 96px; }
  .table-wrap table.is-multi th, .table-wrap table.is-multi td,
  .scroll table.is-multi th, .scroll table.is-multi td { padding: 8px 10px; }
}
.note { font-size: .82rem; color: var(--muted); line-height: 1.55; }
.alert { background: #fffbeb; color: var(--text-2); border: 1px solid #fde68a; border-left: 4px solid var(--gold); padding: 12px 14px; border-radius: 12px; font-size: .85rem; margin: 12px 0; }
.alert-ok { background: var(--ok-soft); border-color: #a7f3d0; border-left-color: var(--ok); color: #065f46; }
.alert-bad { background: #fef2f2; border-color: #fecaca; border-left-color: var(--bad); color: #991b1b; }
.bar { height: 9px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin: 6px 0 14px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--accent), #60a5fa); border-radius: 999px; transition: width .25s ease; }
.sbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; gap: 2px; margin: 4px 0 10px; background: var(--surface-2); }
.sbar > div { height: 100%; transition: width .25s ease; }
.sbar-leg { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--muted); margin-bottom: 14px; }
.sbar-leg span { display: inline-flex; align-items: center; gap: 5px; }
.sbar-leg i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.sbar-leg b { color: var(--text); }
.res-actions { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ── CLS-Safe Ad Slots (Managed from Admin CMS) ── */
.ad-slot {
  margin: 18px 0; padding: 10px 12px 12px;
  background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: 14px; text-align: center; overflow: hidden;
}
.ad-lbl { display: block; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #94a3b8; margin-bottom: 6px; }
.ad-inner { display: flex; align-items: center; justify-content: center; width: 100%; overflow: hidden; }

/* ── E-E-A-T Trust Bar, AEO Quick-Answer Box, Guides & FAQs ── */
.trust-meta {
  display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center;
  font-size: .78rem; color: var(--muted); padding: 0 0 12px;
  border-bottom: 1px solid var(--border); margin: 0 0 16px;
}
.trust-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--ok-soft); color: #047857;
  font-weight: 700; padding: 2px 10px; border-radius: 999px;
}
.aeo-box {
  background: linear-gradient(180deg, #f8faff 0%, #eff4ff 100%);
  border: 1px solid #dbeafe; border-left: 4px solid var(--accent);
  border-radius: 14px; padding: 15px 18px; margin-bottom: 18px;
}
.aeo-kicker { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); margin-bottom: 5px; }
.aeo-box p { margin: 0; color: var(--text-2); font-size: .9rem; line-height: 1.62; }

.info h2 { font-size: 1.08rem; margin: 18px 0 10px; }
.info h3 { font-size: .94rem; text-transform: none; letter-spacing: 0; color: var(--text); margin: 16px 0 6px; }
.info p, .info li { color: var(--text-2); font-size: .9rem; line-height: 1.68; overflow-wrap: break-word; }
.info ul, .info ol { padding-left: 20px; margin: 8px 0 14px; }
.info li { margin-bottom: 6px; }

.faq-list { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.faq-item { border: 1px solid var(--border); border-radius: 13px; background: var(--bg); overflow: hidden; }
.faq-item[open] { border-color: #bfdbfe; background: var(--surface); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: .9rem; 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.2rem; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.faq-item[open] summary::after { content: "−"; }
.faq-item .faq-a { padding: 10px 16px 14px; color: var(--text-2); font-size: .88rem; line-height: 1.65; border-top: 1px solid var(--border); }
.faq-item .faq-a p { margin: 0; }

/* ── Features Strip ── */
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 8px 0 26px; }
@media (max-width: 768px) { .features { grid-template-columns: 1fr; } }
.feat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-xs); }
.feat-card .f-ic { width: 38px; height: 38px; border-radius: 11px; margin-bottom: 10px; display: grid; place-items: center; font-size: 1.15rem; background: var(--accent-soft); }
.feat-card h2 { margin: 0 0 5px; font-size: .96rem; font-weight: 800; }
.feat-card p { margin: 0; color: var(--muted); font-size: .85rem; line-height: 1.5; }

/* ── Mobile Bottom Tab Bar & Live Floating Result Bar ── */
.mob-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: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  grid-template-columns: repeat(4, 1fr);
}
@media (max-width: 640px) { .mob-tabbar { display: grid; } }
.tab-btn {
  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;
}
.tab-btn svg { width: 21px; height: 21px; }
.tab-btn.active { color: var(--accent); }

.result-dock { display: none; }
@media (max-width: 900px) {
  .result-dock {
    position: fixed; left: 14px; right: 14px;
    bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 75;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 15px; border-radius: 16px;
    background: var(--navy); color: #fff;
    box-shadow: 0 12px 28px -6px rgba(11, 26, 84, 0.45);
    transition: transform .16s ease, opacity .16s ease;
  }
  .result-dock.in-view, .result-dock.empty { transform: translateY(180%); 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.75); font-weight: 700; }
  .rd-val { font-size: 1.18rem; font-weight: 800; 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; }
}
@media (min-width: 641px) and (max-width: 900px) {
  .result-dock { bottom: 16px; max-width: 520px; margin: 0 auto; }
}

/* ── Search Command Palette & Mobile Category Drawer ── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(11, 18, 32, 0.52); backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: min(10vh, 72px) 16px 16px;
}
.modal-dialog {
  width: 100%; max-width: 580px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 20px;
  box-shadow: var(--shadow-lg); overflow: hidden;
  display: flex; flex-direction: column; max-height: 78dvh;
}
@media (max-width: 640px) {
  .modal-backdrop.sheet-mode { align-items: flex-end; padding: 0; }
  .modal-backdrop.sheet-mode .modal-dialog { max-width: none; border-radius: 22px 22px 0 0; max-height: 84dvh; padding-bottom: env(safe-area-inset-bottom, 0px); }
}
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 1rem; font-weight: 800; flex: 1; }
.modal-head input {
  flex: 1; border: 0; background: transparent; color: var(--text);
  font-size: 16px; font-family: inherit; outline: none; margin: 0; padding: 0;
}
.modal-head input:focus { box-shadow: none; }
.modal-body { overflow-y: auto; padding: 10px; }
.cmd-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 12px; color: var(--text);
}
.cmd-item:hover, .cmd-item.sel { background: var(--accent-soft); color: var(--text); }
.cmd-ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; background: var(--cat-bg, var(--surface-2)); }
.cmd-name { font-weight: 700; font-size: .9rem; }
.cmd-sub { font-size: .76rem; color: var(--muted); }
.cmd-cat { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; }

/* ── Footer ── */
.site-footer {
  background: var(--surface); border-top: 1px solid var(--border);
  margin-top: 44px; padding: 36px 0 26px; font-size: .85rem; color: var(--muted);
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 0.9fr; gap: 28px; align-items: start;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 18px; } }
.site-footer h4 { margin: 0 0 10px; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text); font-weight: 800; }
.footer-list { display: flex; flex-direction: column; gap: 7px; }
.footer-list a { color: var(--muted); font-weight: 500; }
.footer-list a:hover { color: var(--accent); }
.footer-bottom {
  margin-top: 26px; padding-top: 16px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: .78rem;
}
.flagline { height: 3px; background: linear-gradient(90deg, #dc2626 0 25%, #e2e8f0 25% 50%, #1d4ed8 50% 75%, #f59e0b 75% 100%); }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 10px 20px; border-radius: 999px;
  z-index: 140; font-size: .85rem; font-weight: 600; box-shadow: var(--shadow-lg);
}
@media (max-width: 640px) { .toast { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 18px); } }

@media print {
  body { padding: 0 !important; background: #fff !important; color: #000 !important; }
  .navbar, .ticker-strip, .mob-tabbar, .result-dock, .site-footer, .flagline, .ad-slot, .related, .btns, .modal-backdrop, .toast { display: none !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd; }
}


/* ── PWA Install Button & iOS A2HS Guide ── */
.pwa-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid rgba(29, 78, 216, 0.25);
  background: var(--accent-soft); color: var(--accent);
  font: 700 .8rem/1 var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .12s;
}
.pwa-btn:hover { background: #dbeafe; border-color: var(--accent); transform: translateY(-1px); }
@media (max-width: 520px) { .pwa-btn span { display: none; } .pwa-btn { padding: 0 9px; } }
.ios-steps { list-style: none; padding: 0; margin: 14px 0 6px; display: grid; gap: 10px; }
.ios-steps li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: 12px; background: var(--bg);
  border: 1px solid var(--border); font-size: .9rem; line-height: 1.5;
}
.ios-steps b { color: var(--navy); }
.lang-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700;
  background: #f1f5f9; color: #334155; border: 1px solid #cbd5e1;
}


/* ── Google Discover Editorial Hero, 16:9 Blog Cards & E-E-A-T Author Box ── */
.blog-hero {
  margin: 0 0 20px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  aspect-ratio: 16 / 9; max-height: 480px; width: 100%; background: var(--surface-2);
}
.blog-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-thumb {
  margin: -20px -20px 8px; overflow: hidden; aspect-ratio: 16 / 9;
  border-bottom: 1px solid var(--border); background: var(--surface-2);
  border-radius: var(--radius) var(--radius) 0 0;
}
.blog-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.blog-card:hover .blog-thumb img { transform: scale(1.03); }
.article-body img { max-width: 100%; height: auto; border-radius: 12px; margin: 14px 0; }
.author-box {
  display: flex; align-items: flex-start; gap: 14px;
  margin-top: 28px; padding: 18px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--border);
}
.author-av { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.author-av img { width: 100%; height: 100%; display: block; }
.author-name { font-weight: 800; font-size: .95rem; color: var(--navy); }
.author-role { font-size: .78rem; font-weight: 600; color: var(--accent); margin-top: 1px; }
