:root { --ink:#0a0a0a; --muted:#6b6b6b; --line:#e6e6e6; --bg:#fafafa; --card:#fff; --field:#fff; --red:#e10600; --red-soft:#fff1f0; --head:#0a0a0a; --head-ink:#fff; }
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ink:#f5f5f5; --muted:#a3a3a3; --line:#262626; --bg:#000; --card:#0d0d0d; --field:#000; --red:#ff2a1f; --red-soft:#1f0605; --head:#0d0d0d; } }
  :root[data-theme="dark"] { --ink:#f5f5f5; --muted:#a3a3a3; --line:#262626; --bg:#000; --card:#0d0d0d; --field:#000; --red:#ff2a1f; --red-soft:#1f0605; --head:#0d0d0d; }
  * { box-sizing:border-box; }
  body { margin:0; font:15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; color:var(--ink); background:var(--bg); }
  .top { background:var(--head); color:var(--head-ink); border-bottom:3px solid var(--red); }
  .top-in { max-width:1120px; margin:0 auto; padding:14px 16px; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
  .logo { display:flex; align-items:center; text-decoration:none; }
  .logo img { height:44px; width:auto; display:block; }
  /* Animated logo: the bolt pops in and zaps every few seconds; the wordmark slides in once. CSS only. */
  .logo-icon { transform-origin:50% 60%; animation:qme-pop .6s cubic-bezier(.34,1.56,.64,1) both, qme-zap 5s ease-in-out 1.2s infinite; }
  .logo-text { animation:qme-slide .7s ease-out .15s both; }
  .logo:hover .logo-icon, .logo:focus-visible .logo-icon { animation:qme-shake .45s ease-in-out; }
  @keyframes qme-pop { from { opacity:0; transform:scale(.4) rotate(-12deg); } to { opacity:1; transform:none; } }
  @keyframes qme-slide { from { opacity:0; transform:translateX(-14px); } to { opacity:1; transform:none; } }
  @keyframes qme-zap { 0%, 88%, 100% { filter:none; transform:none; } 90% { filter:brightness(1.6) drop-shadow(0 0 8px #ff2a1f); transform:scale(1.08); } 92% { filter:none; transform:none; } 94% { filter:brightness(1.4) drop-shadow(0 0 6px #ff2a1f); transform:scale(1.04); } }
  @keyframes qme-shake { 0%, 100% { transform:none; } 25% { transform:rotate(-10deg) scale(1.08); } 75% { transform:rotate(8deg) scale(1.08); } }
  @media (prefers-reduced-motion: reduce) { .logo-icon, .logo-text, .logo:hover .logo-icon { animation:none; } }
  .by { font-size:13px; color:#fff; font-weight:600; text-decoration:none; border-bottom:2px solid var(--red); }
  main { max-width:1120px; margin:0 auto; padding:28px 16px 64px; }
  .print-head { display:none; } .print-head img { max-height:48px; }
  h1 { font-size:30px; line-height:1.15; margin:0 0 6px; letter-spacing:-.6px; } h1 span { color:var(--red); }
  h2 { font-size:17px; margin:0 0 12px; letter-spacing:-.2px; }
  .sub { color:var(--muted); margin:0 0 24px; max-width:680px; }
  .card { background:var(--card); border:1px solid var(--line); border-radius:12px; padding:18px; margin-bottom:16px; }
  .grid { display:grid; gap:12px; grid-template-columns:repeat(auto-fit, minmax(170px, 1fr)); }
  label { display:block; font-size:12px; color:var(--muted); margin-bottom:4px; font-weight:500; }
  input, select { width:100%; padding:8px 10px; border:1px solid var(--line); border-radius:8px; font:inherit; background:var(--field); color:var(--ink); }
  input:focus, select:focus { outline:2px solid var(--red); outline-offset:-1px; border-color:var(--red); }
  input[type=number] { text-align:right; font-variant-numeric:tabular-nums; }
  td input { min-width:92px; }
  .tabs { display:flex; gap:6px; flex-wrap:wrap; margin-bottom:14px; }
  .tabs button, .btn { border:1px solid var(--line); background:var(--card); color:var(--ink); padding:8px 14px; border-radius:8px; font:inherit; font-weight:600; cursor:pointer; }
  .tabs button.on { background:var(--ink); color:var(--bg); border-color:var(--ink); }
  .btn.primary { background:var(--red); border-color:var(--red); color:#fff; }
  .meter { border:1px solid var(--line); border-radius:10px; padding:14px; margin-bottom:12px; }
  .meter-head { display:flex; gap:8px; align-items:end; margin-bottom:10px; flex-wrap:wrap; }
  .meter-head > div { flex:1; min-width:150px; }
  table { width:100%; border-collapse:collapse; font-size:14px; }
  th, td { padding:7px 8px; border-bottom:1px solid var(--line); text-align:right; font-variant-numeric:tabular-nums; }
  th:first-child, td:first-child { text-align:left; }
  th { font-size:12px; color:var(--muted); font-weight:600; }
  tr.best td { background:var(--red-soft); font-weight:700; }
  .scroll { overflow-x:auto; }
  .result { display:flex; gap:8px 18px; flex-wrap:wrap; margin-top:10px; font-size:14px; }
  .save { color:var(--ink); font-weight:700; } .loss { color:var(--red); font-weight:700; }
  .tag { background:var(--red); color:#fff; border-radius:4px; padding:0 6px; font-size:11px; font-weight:700; margin-left:4px; }
  .note { font-size:12px; color:var(--muted); }
  .actions { display:flex; gap:8px; flex-wrap:wrap; }
  .cta { background:var(--head); color:#fff; border:none; border-left:4px solid var(--red); }
  .cta p { color:#d4d4d4; margin:0 0 12px; } .cta .btn { text-decoration:none; display:inline-block; }
  .switch { display:inline-flex; background:var(--card); border:1px solid var(--line); border-radius:999px; padding:4px; margin:0 0 20px; }
  .switch button { border:0; background:none; color:var(--ink); font:inherit; font-weight:600; padding:8px 16px; border-radius:999px; cursor:pointer; }
  .switch button.on { background:var(--red); color:#fff; }
  .step { display:inline-grid; place-items:center; width:26px; height:26px; border-radius:50%; background:var(--red); color:#fff; font-size:13px; margin-right:8px; }
  .hint { font-size:13px; color:var(--muted); margin:-6px 0 14px; }
  body.simple .pro { display:none !important; }
  footer { max-width:1120px; margin:0 auto; padding:0 16px 32px; } a { color:var(--red); }
  @media print { .no-print, .tabs, .actions, .cta, .top, footer { display:none !important; } .print-head { display:flex !important; justify-content:space-between; align-items:center; margin-bottom:16px; } body { background:#fff; color:#000; } .card { border:none; } }
  .mt { margin-top:12px; }
  .faq details { border-top:1px solid var(--line); padding:10px 0; }
  .faq summary { cursor:pointer; font-weight:600; }
  .faq p { margin:8px 0 0; color:var(--muted); }
  .ad-slot { margin:0 auto 16px; max-width:1120px; min-height:100px; text-align:center; }
  .ad-slot[hidden] { display:none; }
  .legal { max-width:760px; } .legal h2 { margin-top:24px; }
  .nav { display:flex; gap:18px; } .nav a { color:#fff; font-weight:600; text-decoration:none; font-size:14px; } .nav a:hover { color:var(--red); }
  .site-foot { max-width:1120px; margin:0 auto; padding:24px 16px 40px; border-top:1px solid var(--line); display:flex; gap:16px; align-items:center; flex-wrap:wrap; justify-content:space-between; }
  .site-foot .cx { display:inline-flex; align-items:center; gap:10px; background:#000; padding:6px 12px; border-radius:10px; color:#bdbdbd; text-decoration:none; font-size:12px; }
  .site-foot .cx img { height:34px; width:auto; display:block; }
  .site-foot .note { margin:0; }
  .post { max-width:760px; } .post h1 { font-size:32px; } .post h2 { font-size:21px; margin:28px 0 8px; }
  .post p, .post li { line-height:1.7; } .lead { font-size:18px; color:var(--muted); }
  .kicker { color:var(--red); font-weight:700; font-size:13px; text-transform:uppercase; letter-spacing:.4px; margin:0 0 6px; display:block; }
  .byline { color:var(--muted); font-size:14px; border-left:3px solid var(--red); padding-left:10px; }
  .crumbs { font-size:13px; color:var(--muted); margin-bottom:14px; } .crumbs a { color:var(--muted); }
  .callout { background:var(--red-soft); border-left:4px solid var(--red); padding:12px 14px; border-radius:8px; margin:16px 0; }
  .formula { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:12px; overflow-x:auto; font-size:13px; }
  .sources { margin-top:36px; border-top:1px solid var(--line); padding-top:8px; font-size:14px; } .sources li { margin:4px 0; }
  sup a { text-decoration:none; font-weight:700; }
  q { font-style:italic; }
  .post-list { display:grid; gap:14px; } .post-card { display:block; color:var(--ink); text-decoration:none; } .post-card:hover { border-color:var(--red); }
  .post-card h2 { margin:6px 0; font-size:19px; } .post-card p { color:var(--muted); margin:0 0 8px; } .more { color:var(--red); font-weight:700; }
  .post .btn { text-decoration:none; display:inline-block; margin-top:8px; }
  @media (max-width:560px) { .nav { gap:12px; } .nav a { font-size:13px; } .logo img { height:36px; } .post h1 { font-size:26px; } }
  .table-wrap { overflow-x:auto; margin:12px 0; } .post table { border-collapse:collapse; width:100%; font-size:15px; }
  .post th, .post td { border:1px solid var(--line); padding:8px 10px; text-align:left; } .post thead th { background:var(--head); color:var(--head-ink); }
  blockquote.callout { margin:20px 0; } blockquote.callout p { margin:0 0 6px; font-size:17px; } blockquote.callout p:last-child { font-size:14px; margin:0; }
