
:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #5b6472;
  --line: #d8e0ea;
  --brand: #1d4ed8;
  --brand-dark: #153eaa;
  --accent: #f97316;
  --success: #16a34a;
  --soft: #eaf1ff;
  --warning: #fff7ed;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius: 22px;
  --calc-scale: 1;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  padding: 0 !important;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.skip-link { position:absolute; left:-999px; top:auto; width:1px; height:1px; overflow:hidden; }
.skip-link:focus { left:16px; top:16px; width:auto; height:auto; z-index:2000; padding:10px 14px; background:#fff; border:2px solid var(--brand); border-radius:10px; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.15rem;
  font-weight: 850;
  color: var(--text);
}
.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #111827);
  color: #fff;
  box-shadow: 0 8px 18px rgba(29, 78, 216, 0.25);
}
.nav-links { display: flex; gap: 18px; align-items: center; font-size: 0.95rem; font-weight: 650; }
.button, button.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--brand);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.22);
  font: inherit;
}
.button:hover { background: var(--brand-dark); text-decoration: none; }
.button.secondary { background: #fff; color: var(--brand); border: 1px solid var(--line); box-shadow: none; }
.button.secondary:hover { background: var(--soft); }
.button.ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); box-shadow: none; }
.button.tiny { padding: 8px 12px; font-size: .9rem; }
.hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 28px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 32px;
  align-items: center;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--brand);
  font-weight: 850;
  font-size: 0.9rem;
}
h1 { margin: 18px 0 14px; font-size: clamp(2.15rem, 5vw, 4.6rem); line-height: 1.05; letter-spacing: -0.05em; }
.lead { margin: 0 0 24px; color: var(--muted); font-size: 1.15rem; max-width: 760px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.trust-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 26px; max-width: 760px; }
.mini-card { background: rgba(255, 255, 255, 0.78); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.mini-card strong { display: block; font-size: 1.02rem; }
.mini-card span { color: var(--muted); font-size: 0.9rem; }
.hero-preview { background: radial-gradient(circle at 30% 20%, #e0edff, #ffffff 50%, #f9fafb); border: 1px solid var(--line); border-radius: 30px; padding: 26px; box-shadow: var(--shadow); }
.preview-card { border-radius: 24px; background: #111827; color: #fff; padding: 24px; min-height: 380px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; position: relative; }
.preview-card::after { content: ""; position: absolute; inset: auto -50px -80px auto; width: 240px; height: 240px; border-radius: 50%; background: rgba(59, 130, 246, 0.25); }
.mock-screen { background: #f8fafc; color: #111827; border: 4px solid #313b4d; border-radius: 14px; height: 155px; padding: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; position: relative; z-index: 1; }
.mock-keys { margin-top: 22px; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; position: relative; z-index: 1; }
.mock-keys span { height: 34px; border-radius: 8px; background: #f9fafb; }
.mock-keys span:nth-child(3n) { background: #3b82f6; }
.mock-keys span:nth-child(5n) { background: #22c55e; }
main, .page-wrap { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }
.calculator-section { margin: 22px 0 36px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.calc-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: #fbfdff; }
.calc-toolbar h2 { margin: 0; font-size: 1.15rem; letter-spacing: -0.02em; }
.zoom-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.zoom-controls button { min-width: 40px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); font-size: 0.95rem; font-weight: 850; cursor: pointer; padding: 0 10px; }
.zoom-controls button:hover { background: var(--soft); }
.zoom-label { min-width: 58px; text-align: center; font-weight: 850; }
.calculator-stage { min-height: calc(645px * var(--calc-scale)); padding: 20px 12px 28px; display: flex; justify-content: center; align-items: flex-start; overflow-x: auto; }
.calculator-shell { position: relative; display: inline-block; transform: scale(var(--calc-scale)); transform-origin: top center; isolation: isolate; }
#calculatorDiv { outline: none !important; margin-left: auto; margin-right: auto; }
.calculatorDiv { outline: none !important; margin-left: auto; margin-right: auto; }
/* Brand-light presentation: covers the small top-left manufacturer text on the faceplate.
   This does not edit or host the external calculator runtime; it only changes presentation in our wrapper. */
.calculator-shell.brand-light::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 11px;
  width: 104px;
  height: 15px;
  background: #080808;
  border-radius: 2px;
  z-index: 2147483647;
  pointer-events: none;
}
/* Stricter mode: add class brand-minimized to also cover the model text on the right. */
.calculator-shell.brand-minimized::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 11px;
  width: 100px;
  height: 15px;
  background: #080808;
  border-radius: 2px;
  z-index: 2147483647;
  pointer-events: none;
}
.notice { margin: 0; padding: 14px 18px; background: #fff7ed; border-top: 1px solid #fed7aa; color: #7c2d12; font-size: 0.92rem; }
.content-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 30px 0; }
.section-card, .article-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.section-card h2, .section-card h3, .article-card h2, .article-card h3 { margin-top: 0; letter-spacing: -0.03em; line-height: 1.15; }
.section-card p, .section-card li, .article-card p, .article-card li { color: var(--muted); }
.steps { counter-reset: steps; padding: 0; list-style: none; }
.steps li { counter-increment: steps; position: relative; padding-left: 48px; margin: 16px 0; }
.steps li::before { content: counter(steps); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 999px; display: grid; place-items: center; background: var(--soft); color: var(--brand); font-weight: 900; }
.feature-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 30px 0; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.feature .icon { font-size: 1.8rem; }
.feature h3 { margin: 10px 0 8px; }
.feature p { margin: 0; color: var(--muted); }
.keyword-hub { display:grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap:12px; margin:24px 0 32px; }
.keyword-pill { background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px; font-weight:800; color:var(--text); }
.keyword-pill span { display:block; color:var(--muted); font-size:.88rem; font-weight:600; margin-top:4px; }
.article-links { display:grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap:16px; margin:24px 0; }
.article-link { background:#fff; border:1px solid var(--line); border-radius:18px; padding:20px; color:var(--text); }
.article-link:hover { text-decoration:none; border-color:#93c5fd; box-shadow:0 10px 28px rgba(29,78,216,.10); }
.article-link strong { display:block; margin-bottom:6px; }
.article-link span { display:block; color:var(--muted); }
.table-wrap { overflow-x:auto; }
table { width:100%; border-collapse: collapse; margin: 16px 0; background:#fff; }
th, td { border:1px solid var(--line); padding:12px; text-align:left; vertical-align:top; }
th { background:#f8fafc; font-weight:850; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; margin: 12px 0; }
.faq summary { cursor: pointer; font-weight: 850; }
.faq p { color: var(--muted); }
.site-footer { margin-top: 36px; padding: 28px 0 40px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.94rem; }
.app-promo { background: linear-gradient(135deg, #111827, #1d4ed8); color:#fff; border-radius:var(--radius); padding:26px; margin:30px 0; display:grid; grid-template-columns:1fr auto; gap:18px; align-items:center; }
.app-promo p { color:#dbeafe; margin: 0 0 12px; }
.mobile-app-bar { display:none; }
.popup-mode .site-header, .popup-mode .hero, .popup-mode .calc-toolbar, .popup-mode .notice, .popup-mode .below-content, .popup-mode .site-footer { display: none !important; }
.popup-mode body { background: #fff; }
.popup-mode main { width: auto; margin: 0; }
.popup-mode .calculator-section { border: 0; box-shadow: none; margin: 0; border-radius: 0; }
.popup-mode .calculator-stage { min-height: 100vh; padding: 0; overflow: hidden; }
.popup-mode .calculator-shell { transform: scale(1); }
.app-mode body { background:#0b1220; overscroll-behavior: contain; }
.app-mode .site-header, .app-mode .hero, .app-mode .notice, .app-mode .below-content, .app-mode .site-footer { display:none !important; }
.app-mode main { width:100%; margin:0; }
.app-mode .calculator-section { margin:0; border:0; border-radius:0; box-shadow:none; height:100dvh; background:#0b1220; display:flex; flex-direction:column; }
.app-mode .calc-toolbar { min-height:58px; padding:10px 12px; background:#111827; color:#fff; border-bottom:1px solid rgba(255,255,255,.12); }
.app-mode .calc-toolbar h2 { font-size:1rem; }
.app-mode .calc-toolbar .button.secondary, .app-mode .zoom-controls button { background:rgba(255,255,255,.08); color:#fff; border-color:rgba(255,255,255,.18); }
.app-mode .zoom-label { color:#fff; }
.app-mode .calculator-stage { flex:1; min-height:0; height:calc(100dvh - 58px); padding:8px 0 calc(16px + var(--safe-bottom)); align-items:flex-start; overflow:auto; }
.app-mode .calculator-shell { transform-origin: top center; }
@media (display-mode: standalone) {
  .install-only { display:none !important; }
}
@media (max-width: 1020px) { .keyword-hub { grid-template-columns: repeat(2, minmax(0, 1fr)); } .article-links { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 34px; }
  .hero-preview { display: none; }
  .trust-row, .feature-list, .content-grid { grid-template-columns: 1fr; }
  .nav { min-height: 62px; }
  .nav-links { display: none; }
  .calculator-stage { padding-left: 0; padding-right: 0; }
}
@media (max-width: 640px) { .article-links, .keyword-hub { grid-template-columns: 1fr; } .app-promo { grid-template-columns:1fr; } }
@media (max-width: 540px) {
  .calc-toolbar { align-items: flex-start; flex-direction: column; }
  .zoom-controls { justify-content: flex-start; }
  .button { width: 100%; }
  .hero-actions { width: 100%; }
  h1 { font-size: 2.35rem; }
  .mobile-app-bar { display:flex; position:fixed; left:12px; right:12px; bottom:calc(12px + var(--safe-bottom)); z-index:1100; gap:8px; }
  .mobile-app-bar .button { flex:1; box-shadow:0 16px 32px rgba(15,23,42,.25); padding:12px 10px; }
  body.has-mobile-bar { padding-bottom:82px !important; }
}


/* Documentation system */
.docs-hero { width:min(1180px, calc(100% - 32px)); margin:0 auto; padding:44px 0 18px; }
.docs-hero h1 { max-width:900px; }
.docs-layout { display:grid; grid-template-columns:280px minmax(0,1fr); gap:24px; align-items:start; }
.docs-sidebar { position:sticky; top:84px; background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:18px; max-height:calc(100dvh - 110px); overflow:auto; }
.docs-sidebar h2 { margin:0 0 10px; font-size:1rem; letter-spacing:-.02em; }
.docs-sidebar a { display:block; color:var(--muted); padding:7px 0; border-bottom:1px solid #eef2f7; font-size:.95rem; }
.docs-sidebar a:hover { color:var(--brand); text-decoration:none; }
.docs-main { min-width:0; }
.docs-search { display:flex; gap:10px; margin:18px 0 24px; }
.docs-search input { width:100%; padding:14px 16px; border:1px solid var(--line); border-radius:16px; font:inherit; background:#fff; }
.docs-grid { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:16px; margin:24px 0 34px; }
.docs-card { background:#fff; border:1px solid var(--line); border-radius:18px; padding:20px; color:var(--text); display:flex; flex-direction:column; gap:8px; min-height:160px; }
.docs-card:hover { text-decoration:none; border-color:#93c5fd; box-shadow:0 12px 30px rgba(29,78,216,.10); }
.docs-card small { color:var(--brand); font-weight:850; text-transform:uppercase; letter-spacing:.06em; }
.docs-card strong { font-size:1.08rem; line-height:1.2; }
.docs-card span { color:var(--muted); }
.doc-article { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:30px; box-shadow:var(--shadow); }
.doc-article h1 { font-size:clamp(2rem, 4vw, 3.35rem); margin-top:0; }
.doc-article h2 { margin-top:34px; letter-spacing:-.03em; line-height:1.15; }
.doc-article h3 { margin-top:24px; letter-spacing:-.02em; }
.doc-article p, .doc-article li { color:var(--muted); }
.doc-article code { background:#f1f5f9; padding:2px 6px; border-radius:6px; color:#0f172a; }
.doc-intro { font-size:1.1rem; color:var(--muted); }
.doc-callout { border:1px solid #bfdbfe; background:#eff6ff; color:#1e3a8a; border-radius:18px; padding:18px; margin:22px 0; }
.doc-warning { border:1px solid #fed7aa; background:#fff7ed; color:#7c2d12; border-radius:18px; padding:18px; margin:22px 0; }
.doc-nav { display:flex; justify-content:space-between; gap:14px; margin:24px 0 0; }
.doc-nav a { flex:1; background:#fff; border:1px solid var(--line); border-radius:16px; padding:14px; }
.breadcrumb { color:var(--muted); font-size:.92rem; margin:0 0 18px; }
.breadcrumb a { color:var(--muted); }
.kbd { display:inline-block; min-width:28px; text-align:center; padding:3px 7px; border:1px solid #cbd5e1; border-bottom-width:3px; border-radius:7px; background:#fff; color:#0f172a; font-weight:850; font-size:.92em; }
.example-box { background:#0f172a; color:#e5e7eb; border-radius:18px; padding:18px; overflow:auto; margin:16px 0; }
.example-box code { background:transparent; color:#e5e7eb; padding:0; }
.checklist { list-style:none; padding-left:0; }
.checklist li { position:relative; padding-left:34px; margin:12px 0; }
.checklist li::before { content:'✓'; position:absolute; left:0; top:0; width:24px; height:24px; border-radius:50%; display:grid; place-items:center; background:#dcfce7; color:#166534; font-weight:900; }
.related-docs { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:12px; margin-top:20px; }
.related-docs a { background:#f8fafc; border:1px solid var(--line); border-radius:14px; padding:14px; color:var(--text); font-weight:800; }
.related-docs a:hover { text-decoration:none; background:#eff6ff; }
@media (max-width: 980px) { .docs-layout { grid-template-columns:1fr; } .docs-sidebar { position:static; max-height:none; } .docs-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 640px) { .docs-grid, .related-docs { grid-template-columns:1fr; } .doc-article { padding:22px; } .doc-nav { flex-direction:column; } }


/* Calculator network pages */
.network-hero { width:min(1180px, calc(100% - 32px)); margin:0 auto; padding:48px 0 22px; display:grid; grid-template-columns:1.1fr .9fr; gap:28px; align-items:center; }
.network-hero h1 { max-width:900px; }
.network-panel { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:24px; box-shadow:var(--shadow); }
.network-grid { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:16px; margin:26px 0; }
.network-card { background:#fff; border:1px solid var(--line); border-radius:18px; padding:22px; color:var(--text); display:flex; flex-direction:column; gap:8px; min-height:190px; }
.network-card:hover { text-decoration:none; border-color:#93c5fd; box-shadow:0 12px 30px rgba(29,78,216,.10); }
.network-card small { color:var(--brand); font-weight:900; text-transform:uppercase; letter-spacing:.06em; }
.network-card strong { font-size:1.2rem; line-height:1.18; }
.network-card span { color:var(--muted); }
.tool-box { background:#fff; border:1px solid var(--line); border-radius:var(--radius); padding:24px; box-shadow:var(--shadow); margin:24px 0; }
.tool-controls { display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:14px; }
.tool-controls label { display:flex; flex-direction:column; gap:6px; color:#334155; font-weight:800; }
.tool-controls input, .tool-controls select, .tool-controls textarea, .calc-input { width:100%; border:1px solid var(--line); border-radius:12px; padding:12px 14px; font:inherit; background:#fff; }
.calc-output { background:#0f172a; color:#e5e7eb; border-radius:16px; padding:16px; margin-top:14px; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; min-height:54px; white-space:pre-wrap; overflow:auto; }
.calc-keypad { display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:8px; margin:14px 0; }
.calc-keypad button { border:1px solid var(--line); background:#fff; border-radius:10px; padding:12px 8px; font-weight:850; cursor:pointer; }
.calc-keypad button:hover { background:var(--soft); }
.calc-keypad .op { background:#eff6ff; color:#1d4ed8; }
.calc-keypad .danger { background:#fff7ed; color:#9a3412; }
.policy-note { font-size:.92rem; color:var(--muted); }
.source-list { background:#f8fafc; border:1px solid var(--line); border-radius:16px; padding:18px; margin:18px 0; }
.source-list li { margin:8px 0; }
@media (max-width: 940px) { .network-hero { grid-template-columns:1fr; } .network-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
@media (max-width: 640px) { .network-grid, .tool-controls { grid-template-columns:1fr; } .calc-keypad { grid-template-columns:repeat(4,minmax(0,1fr)); } }


/* Dedicated calculator page */
.calculator-page-body { background:#eef3f9; }
.calculator-page-header {
  width:min(1180px, calc(100% - 24px));
  margin:16px auto 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.calculator-page-main {
  width:min(1180px, calc(100% - 24px));
  margin:12px auto 28px;
}
.standalone-calculator { margin-top:0; }
.standalone-calculator .calc-toolbar h1 {
  margin:0;
  font-size:1.15rem;
  line-height:1.25;
  letter-spacing:-0.02em;
}
.calculator-entry-card { margin: 22px 0 36px; }
.calculator-entry-card .lead { font-size:1rem; margin-bottom:18px; }
@media (max-width: 540px) {
  .calculator-page-header { margin-top:10px; }
  .calculator-page-header .button { width:auto; }
  .standalone-calculator .calc-toolbar h1 { font-size:1.05rem; }
}
