:root {
        --bg: #f6f7f5;
        --surface: #ffffff;
        --surface-2: #eef1ee;
        --ink: #17211b;
        --ink-soft: #4c5a51;
        --line: #dde3dd;
        --accent: #0e7a5f;
        --accent-ink: #ffffff;
        --accent-soft: #e2f2ec;
        --amber: #b45309;
        --amber-soft: #fdf0dd;
        --sky: #0369a1;
        --sky-soft: #e0f0fa;
        --danger: #b3261e;
        --ok: #0e7a5f;
        --radius: 14px;
        --shadow: 0 1px 2px rgba(23,33,27,.06), 0 8px 24px -12px rgba(23,33,27,.18);
      }
      @media (prefers-color-scheme: dark) {
        :root {
          --bg: #10140f;
          --surface: #1a201a;
          --surface-2: #232a23;
          --ink: #e8efe9;
          --ink-soft: #a7b5ab;
          --line: #2e382e;
          --accent: #2fbf94;
          --accent-ink: #0b1512;
          --accent-soft: #173a30;
          --amber: #f0b45a;
          --amber-soft: #3a2c14;
          --sky: #5db9ec;
          --sky-soft: #16303f;
          --danger: #ff8a80;
          --ok: #2fbf94;
          --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
        }
      }
      * { box-sizing: border-box; }
      html { scroll-behavior: smooth; }
      body {
        margin: 0;
        background: var(--bg);
        color: var(--ink);
        font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
        line-height: 1.55;
        -webkit-font-smoothing: antialiased;
      }
      .wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px 72px; }

      header.hero { padding: 40px 0 8px; }
      header.hero h1 {
        font-size: clamp(30px, 6vw, 44px);
        font-weight: 800;
        letter-spacing: -0.02em;
        margin: 0 0 10px;
        line-height: 1.12;
      }
      header.hero h1 .hl { color: var(--accent); }
      header.hero p { margin: 0; color: var(--ink-soft); font-size: 17px; max-width: 620px; }
      .hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
      .hero-meta span {
        font-size: 13px; font-weight: 600; color: var(--ink-soft);
        background: var(--surface); border: 1px solid var(--line);
        padding: 5px 12px; border-radius: 999px;
      }

      section.cat { margin-top: 38px; scroll-margin-top: 84px; }
      .cat-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
      .cat-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
      .cat-head .tag {
        font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
        padding: 3px 10px; border-radius: 999px;
      }
      .tag-img { background: var(--accent-soft); color: var(--accent); }
      .tag-txt { background: var(--amber-soft); color: var(--amber); }
      .tag-cry { background: var(--sky-soft); color: var(--sky); }
      .cat-head p { width: 100%; margin: 2px 0 0; color: var(--ink-soft); font-size: 15px; }

      .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
      @media (max-width: 760px) { .grid { grid-template-columns: 1fr; } }

      .card {
        background: var(--surface);
        border: 1px solid var(--line);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 22px;
        min-width: 0;
      }
      .card.wide { grid-column: 1 / -1; }
      .card h3 { margin: 0 0 4px; font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
      .card h3 svg { flex: none; color: var(--accent); }
      .card .desc { margin: 0 0 16px; color: var(--ink-soft); font-size: 14px; }

      label.flabel { display: block; font-size: 13px; font-weight: 700; margin: 14px 0 6px; color: var(--ink-soft); }
      label.flabel:first-of-type { margin-top: 0; }
      input[type="text"], input[type="number"], input[type="url"], select, textarea {
        width: 100%; padding: 11px 13px;
        border: 1.5px solid var(--line); border-radius: 10px;
        background: var(--surface); color: var(--ink);
        font: inherit; font-size: 15px;
      }
      textarea { resize: vertical; min-height: 110px; }
      input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
      input[type="range"] { width: 100%; accent-color: var(--accent); }

      .btn {
        display: inline-flex; align-items: center; justify-content: center; gap: 8px;
        background: var(--accent); color: var(--accent-ink);
        border: none; border-radius: 10px;
        font: inherit; font-weight: 700; font-size: 15px;
        padding: 11px 20px; cursor: pointer; text-decoration: none;
      }
      .btn:hover { filter: brightness(1.07); }
      .btn:disabled { opacity: .45; cursor: not-allowed; }
      .btn.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
      .btn.small { padding: 8px 14px; font-size: 13.5px; }
      .btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

      .drop {
        border: 2px dashed var(--line); border-radius: 12px;
        padding: 26px 16px; text-align: center; cursor: pointer;
        color: var(--ink-soft); font-size: 14.5px; transition: border-color .15s, background .15s;
      }
      .drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
      .drop strong { color: var(--ink); display: block; font-size: 15.5px; margin-bottom: 2px; }
      .drop input { display: none; }

      .preview { margin-top: 14px; text-align: center; }
      .preview img { max-width: 100%; max-height: 240px; border-radius: 10px; border: 1px solid var(--line); }

      .statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
      .stat {
        background: var(--surface-2); border-radius: 10px; padding: 10px 14px;
      }
      .stat .k { font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
      .stat .v { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
      .stat .v.good { color: var(--ok); }

      .mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
      .result-box {
        margin-top: 14px; background: var(--surface-2); border-radius: 10px;
        padding: 14px 16px; font-size: 15px; word-break: break-word;
      }
      .result-box .big { font-size: 22px; font-weight: 800; }
      .pos { color: var(--ok); font-weight: 800; }
      .neg { color: var(--danger); font-weight: 800; }

      .checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 10px; }
      .checks label { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; font-weight: 600; cursor: pointer; }
      .checks input { width: 17px; height: 17px; accent-color: var(--accent); }

      .meter { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
      .meter > div { height: 100%; width: 0; border-radius: 99px; transition: width .25s; }

      .rowflex { display: flex; gap: 10px; }
      .rowflex > * { flex: 1; min-width: 0; }
      .swapbtn { flex: none !important; align-self: flex-end; margin-bottom: 2px; }

      table.rates { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14.5px; }
      table.rates th { text-align: left; color: var(--ink-soft); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 8px 10px; border-bottom: 2px solid var(--line); }
      table.rates td { padding: 9px 10px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
      table.rates td:last-child, table.rates th:last-child { text-align: right; }
      .note { font-size: 13px; color: var(--ink-soft); margin-top: 12px; }
      .err { color: var(--danger); font-size: 14px; margin-top: 10px; font-weight: 600; }
      .hidden { display: none !important; }

      footer { margin-top: 56px; border-top: 1px solid var(--line); padding-top: 20px; color: var(--ink-soft); font-size: 13.5px; }
      .foot-main { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; }
      .foot-logo { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; text-decoration: none; color: var(--ink); white-space: nowrap; }
      .foot-logo span { color: var(--accent); }
      .foot-tag { margin: 0; }
      .foot-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 14px; }
      .foot-nav a { color: var(--ink); font-weight: 600; text-decoration: none; }
      .foot-nav a:hover { color: var(--accent); }
      .foot-note { margin: 10px 0 0; max-width: 72ch; }
      .foot-copy { margin: 16px 0 0; }
      #qrCanvas { max-width: 100%; height: auto; border-radius: 10px; }
    
      /* ---- site header & menu bar ---- */
      .site-header {
        position: sticky; top: 0; z-index: 30;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
        box-shadow: 0 1px 2px rgba(23,33,27,.05);
      }
      .header-inner {
        max-width: 1080px; margin: 0 auto; padding: 0 18px;
        display: flex; align-items: center; gap: 16px; min-height: 60px;
      }
      .logo {
        font-size: 23px; font-weight: 800; letter-spacing: -0.02em;
        text-decoration: none; color: var(--ink); white-space: nowrap;
      }
      .logo span { color: var(--accent); }
      .menu-btn {
        display: none; margin-left: auto;
        background: var(--surface-2); border: 1px solid var(--line);
        color: var(--ink); font: inherit; font-weight: 700; font-size: 15px;
        padding: 8px 14px; border-radius: 10px; cursor: pointer;
      }
      .mainnav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
      .mainnav > a, .nav-group {
        display: block; padding: 10px 13px; border-radius: 10px;
        font-weight: 700; font-size: 15px; color: var(--ink);
        text-decoration: none; cursor: pointer; white-space: nowrap;
      }
      .mainnav > a:hover, .nav-group:hover { background: var(--surface-2); }
      .mainnav a.active { color: var(--accent); background: var(--accent-soft); }
      .has-sub { position: relative; }
      .has-sub .sub {
        display: none; position: absolute; top: 100%; left: 0; min-width: 230px;
        background: var(--surface); border: 1px solid var(--line);
        border-radius: 12px; box-shadow: var(--shadow); padding: 6px;
      }
      .has-sub:hover .sub, .has-sub:focus-within .sub { display: block; }
      .has-sub .sub a {
        display: block; padding: 9px 12px; border-radius: 8px;
        text-decoration: none; color: var(--ink);
        font-size: 14.5px; font-weight: 600;
      }
      .has-sub .sub a:hover { background: var(--surface-2); }
      .has-sub .sub a.active { color: var(--accent); background: var(--accent-soft); }
      .nav-group::after { content: " \25be"; font-size: 11px; color: var(--ink-soft); }
      @media (max-width: 860px) {
        .menu-btn { display: inline-flex; }
        .mainnav {
          display: none; position: absolute; top: 100%; left: 0; right: 0;
          background: var(--surface); border-bottom: 1px solid var(--line);
          box-shadow: var(--shadow);
          flex-direction: column; align-items: stretch;
          padding: 8px 18px 16px; gap: 0;
        }
        .mainnav.open { display: flex; }
        .mainnav > a, .nav-group { padding: 11px 4px; }
        .has-sub .sub {
          display: block; position: static; border: none; box-shadow: none;
          padding: 0 0 6px 14px; min-width: 0;
        }
        .has-sub .sub a { padding: 8px 10px; }
        .nav-group {
          color: var(--ink-soft); font-size: 13px;
          text-transform: uppercase; letter-spacing: .04em;
        }
        .nav-group::after { content: ""; }
      }

      /* ---- single tool page ---- */
      .backlink {
        display: inline-block; margin: 22px 0 0;
        color: var(--accent); font-weight: 700; font-size: 14.5px; text-decoration: none;
      }
      .page-intro { margin: 10px 0 22px; color: var(--ink-soft); font-size: 16px; max-width: 640px; }
      .tool-single .card { max-width: 780px; margin: 0 auto; }
      .related { margin-top: 40px; }
      .related h2 { font-size: 18px; font-weight: 800; margin: 0 0 12px; }
      .related-links { display: flex; flex-wrap: wrap; gap: 8px; }
      .related-links a {
        text-decoration: none; color: var(--ink); font-weight: 700; font-size: 14px;
        padding: 9px 15px; border-radius: 999px;
        background: var(--surface); border: 1px solid var(--line);
      }
      .related-links a:hover { border-color: var(--accent); color: var(--accent); }
