/* CalC shared styles: colours, glass background, header, footer and content pages */
  :root {
    --paper: #f6f4ee;
    --card: #ffffff;
    --ink: #1c2420;
    --muted: #5d6963;
    --line: #dfdbd0;
    --track: #e6e2d6;
    --green: #0f5c4a;
    --green-light: #35b392;
    --green-soft: #e3f0ec;
    --amber: #9a6b00;
    --amber-soft: #fbf1d6;
    --red: #a8332a;
    --red-soft: #f9e4e1;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --field: #ffffff;
    --field-2: #faf9f5;
    --header: #0f5c4a;
    --chart-ink: #1c2420;
    --chart-muted: #5d6963;
    --chart-axis: #dfdbd0;
    --chart-area: #e3f0ec;
    --chart-balance: #0f5c4a;
    --chart-returns: #b77900;
    --chart-withdrawn: #5b6b8c;
    --blob-a: rgba(53,179,146,0.45);
    --blob-b: rgba(226,176,74,0.32);
    --blob-c: rgba(15,92,74,0.38);
    --blob-d: rgba(111,211,184,0.40);
    --base-1: #eaf3ef;
    --base-2: #f4efe3;
    --header-glass: rgba(11,61,50,0.82);
    --glass-card: rgba(255,255,255,0.52);
  }
  body.dark {
    color-scheme: dark;
    --paper: #0d1412;
    --card: #151e1b;
    --ink: #e6eee9;
    --muted: #97a8a0;
    --line: #2a3632;
    --track: #2a3632;
    --green: #2fae88;
    --green-light: #6fd3b8;
    --green-soft: rgba(63,191,152,0.15);
    --amber: #e6b552;
    --amber-soft: rgba(226,176,74,0.14);
    --red: #f08a80;
    --red-soft: rgba(239,122,111,0.14);
    --field: #1b2622;
    --field-2: #202c28;
    --header: #0a100e;
    --chart-ink: #e6eee9;
    --chart-muted: #97a8a0;
    --chart-axis: #2f3c37;
    --chart-area: rgba(63,191,152,0.14);
    --chart-balance: #45c9a0;
    --chart-returns: #e6b552;
    --chart-withdrawn: #9fb0d0;
    --blob-a: rgba(31,158,131,0.35);
    --blob-b: rgba(226,176,74,0.16);
    --blob-c: rgba(15,120,95,0.40);
    --blob-d: rgba(111,211,184,0.14);
    --base-1: #07100d;
    --base-2: #0d1714;
    --header-glass: rgba(6,12,10,0.65);
    --glass-card: rgba(16,26,23,0.55);
  }
  * { box-sizing: border-box; }
  body { margin: 0; transition: background-color 0.3s ease, color 0.3s ease; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
  header.site { background: var(--header); color: #fff; padding: 8px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .wrap { max-width: 1120px; margin: 0 auto; width: 100%; padding-left: 16px; padding-right: 16px; }
  h1, h2 { font-family: var(--sans); font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
  body.glass {
    background:
      radial-gradient(ellipse at 8% 18%, var(--blob-a), transparent 44%),
      radial-gradient(ellipse at 92% 8%, var(--blob-b), transparent 40%),
      radial-gradient(ellipse at 75% 92%, var(--blob-c), transparent 50%),
      radial-gradient(ellipse at 28% 95%, var(--blob-d), transparent 42%),
      linear-gradient(160deg, var(--base-1), var(--base-2));
    background-attachment: fixed;
  }
  body.glass header.site { background: var(--header-glass); }
  body.glass .card {
    background: var(--glass-card);
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.95), inset 0 -1px 0 rgba(255,255,255,0.35), 0 12px 32px rgba(15,60,48,0.13);
  }
  body.glass.dark .card { border-color: rgba(255,255,255,0.10);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), inset 0 -1px 0 rgba(255,255,255,0.03), 0 14px 36px rgba(0,0,0,0.45); }
  /* =================== LIGHT / DARK SWITCH =================== */
  .theme-toggle { position: relative; flex: none; width: 62px; height: 30px; padding: 0; border-radius: 99px; cursor: pointer;
    border: 1px solid rgba(255,255,255,0.35); background: rgba(255,255,255,0.16);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.25); transition: background 0.3s ease, border-color 0.3s ease; }
  .theme-toggle svg { position: absolute; top: 50%; width: 14px; height: 14px; transform: translateY(-50%); fill: none; stroke: rgba(255,255,255,0.85); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .theme-toggle .sun { left: 8px; }
  .theme-toggle .moon { right: 8px; }
  .theme-toggle .knob { position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #ffffff, #e9efe9 70%);
    box-shadow: inset 1px 1px 1px #fff, 0 2px 6px rgba(0,0,0,0.35);
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.3s ease; }
  .theme-toggle .knob::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: #f3c14b; box-shadow: 0 0 8px rgba(243,193,75,0.9); transition: all 0.3s ease; }
  body.dark .theme-toggle { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }
  body.dark .theme-toggle .knob { transform: translateX(32px); background: radial-gradient(circle at 35% 30%, #3a4a45, #1b2622 70%); box-shadow: inset 1px 1px 1px rgba(255,255,255,0.25), 0 2px 6px rgba(0,0,0,0.5); }
  body.dark .theme-toggle .knob::after { inset: 5px; background: transparent; box-shadow: inset -5px -3px 0 0 #dfe8e4; }
  .theme-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }


  /* =================== SITE HEADER AND FOOTER =================== */
  header.site .brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.12rem; letter-spacing: -0.01em; }
  .brand svg { width: 28px; height: 28px; flex: none; border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,0.28), 0 2px 6px rgba(0,0,0,0.22); }
  .brand b { font-weight: 800; color: #f3d98b; }
  .hdr-right { display: flex; align-items: center; gap: 12px; }
  .nav-link { color: rgba(255,255,255,0.9); text-decoration: none; font-size: 0.88rem; font-weight: 600; padding: 6px 10px; border-radius: 8px; transition: background 0.2s ease; }
  .nav-link:hover { background: rgba(255,255,255,0.12); }
  @media (max-width: 520px) { .nav-link { display: none; } }
  .site-foot { margin-top: 28px; border-top: 1px solid var(--line); padding: 24px 0 30px; color: var(--muted); font-size: 0.86rem; }
  body.glass .site-foot { border-top-color: rgba(255,255,255,0.55); }
  body.glass.dark .site-foot { border-top-color: rgba(255,255,255,0.08); }
  .foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
  .site-foot .brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1rem; }
  .site-foot .brand svg { width: 24px; height: 24px; box-shadow: none; }
  .site-foot .brand b { color: #b88a25; }
  body.dark .site-foot .brand b { color: #f3d98b; }
  .site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
  .site-foot nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
  .site-foot nav a:hover { color: var(--green); }
  .site-foot p { width: 100%; margin: 2px 0 0; font-size: 0.8rem; }
  .related { margin-top: 36px; }
  .related h2 { margin-bottom: 12px; }
  .rel-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .rel-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 14px; text-decoration: none; color: var(--ink);
    background: var(--glass-card); border: 1px solid rgba(255,255,255,0.8); box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 8px 22px rgba(15,60,48,0.08);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease; }
  body.dark .rel-card { border-color: rgba(255,255,255,0.10); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 10px 26px rgba(0,0,0,0.35); }
  .rel-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(15,60,48,0.16); }
  .rel-name { font-weight: 800; font-size: 1.02rem; }
  .rel-text { color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
  .rel-go { margin-top: 6px; font-weight: 800; color: var(--green); font-size: 0.88rem; }

  /* =================== CONTENT PAGES =================== */
  .page { min-height: 70vh; }
  .content { padding-top: 34px; padding-bottom: 20px; }
  .content h1 { font-size: 2.1rem; color: var(--green); margin: 0 0 8px; }
  .content h2 { font-size: 1.3rem; margin: 30px 0 8px; }
  .content p, .content li { line-height: 1.65; max-width: 46em; }
  .content a { color: var(--green); font-weight: 600; }
  .lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 18px; max-width: 42em; }
  .doc { background: var(--glass-card); border: 1px solid rgba(255,255,255,0.8); border-radius: 16px; padding: 26px 30px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 12px 30px rgba(15,60,48,0.10); }
  body.dark .doc { border-color: rgba(255,255,255,0.10); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 14px 34px rgba(0,0,0,0.4); }
  .doc > :first-child { margin-top: 0; }
  .doc .meta { color: var(--muted); font-size: 0.88rem; margin-bottom: 4px; }
  @media (max-width: 600px) { .doc { padding: 20px 18px; } .content h1 { font-size: 1.7rem; } }

  /* Home page */
  .hero { padding: 26px 0 8px; }
  .hero h1 { font-size: 2.6rem; line-height: 1.1; max-width: 16em; }
  .hero .lead { font-size: 1.1rem; }
  @media (max-width: 600px) { .hero h1 { font-size: 2rem; } }
  .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; padding: 0; list-style: none; }
  .chips li { display: inline-flex; align-items: center; gap: 7px; font-size: 0.84rem; font-weight: 600; padding: 6px 12px; border-radius: 99px; background: var(--glass-card); border: 1px solid rgba(255,255,255,0.8); color: var(--ink); }
  body.dark .chips li { border-color: rgba(255,255,255,0.12); }
  .chips li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
  .tools { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 22px; }
  .tool { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: 18px; text-decoration: none; color: var(--ink);
    background: var(--glass-card); border: 1px solid rgba(255,255,255,0.8); box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 10px 26px rgba(15,60,48,0.10);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease; }
  body.dark .tool { border-color: rgba(255,255,255,0.10); box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 12px 30px rgba(0,0,0,0.4); }
  a.tool:hover { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(15,60,48,0.18); }
  body.dark a.tool:hover { box-shadow: 0 18px 38px rgba(0,0,0,0.55); }
  .tool .t-art { height: 86px; border-radius: 12px; margin-bottom: 8px; overflow: hidden; background: color-mix(in srgb, var(--green-soft) 80%, transparent); }
  .tool .t-art svg { width: 100%; height: 100%; display: block; }
  .tool h3 { margin: 0; font-size: 1.12rem; font-weight: 800; }
  .tool p { margin: 0; color: var(--muted); font-size: 0.92rem; line-height: 1.5; }
  .tool .go { margin-top: auto; padding-top: 10px; font-weight: 800; color: var(--green); font-size: 0.92rem; }
  .tool.soon { opacity: 0.72; }
  .tool .badge { position: absolute; z-index: 1; top: 14px; right: 14px; font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; padding: 4px 10px; border-radius: 99px; color: var(--green); background: var(--card); border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
  .tool.live .badge { color: #fff; background: var(--green); }
  body.dark .tool.live .badge { color: #07110e; }
  .why { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-top: 14px; }
  @media (max-width: 760px) { .why { grid-template-columns: 1fr; } }
  .why div { padding: 18px; border-radius: 14px; background: var(--glass-card); border: 1px solid rgba(255,255,255,0.8); }
  body.dark .why div { border-color: rgba(255,255,255,0.10); }
  .why b { display: block; margin-bottom: 4px; }
  .why span { color: var(--muted); font-size: 0.92rem; line-height: 1.55; }

  /* Contact */
  .mail { display: inline-flex; align-items: center; gap: 10px; margin: 6px 0 4px; padding: 12px 18px; border-radius: 12px; font-size: 1.1rem; font-weight: 800; text-decoration: none;
    color: #fff !important; background: linear-gradient(135deg, var(--green-light), var(--green)); box-shadow: 0 8px 20px color-mix(in srgb, var(--green) 35%, transparent); }
  body.dark .mail { color: #07110e !important; }
  .mail svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

  /* 404 */
  .nf { text-align: center; padding: 60px 0 30px; }
  .nf .big { font-size: 5rem; font-weight: 900; line-height: 1; color: var(--green); letter-spacing: -0.04em; }
  .nf p { margin: 10px auto; }
  .btn { display: inline-block; margin: 8px 6px; padding: 10px 18px; border-radius: 99px; font-weight: 800; text-decoration: none; color: #fff !important; background: var(--green); }
  body.dark .btn { color: #07110e !important; }
  .btn.ghost { color: var(--ink) !important; background: var(--glass-card); border: 1px solid var(--line); }

  @media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
