  /* Google Sans — subset: Latin, Latin Extended (Romanian), Cyrillic */
  @font-face{font-family:"Google Sans"; src:url("/fonts/GoogleSans-Regular.woff2") format("woff2");  font-weight:400; font-style:normal; font-display:swap;}
  @font-face{font-family:"Google Sans"; src:url("/fonts/GoogleSans-Medium.woff2") format("woff2");   font-weight:500; font-style:normal; font-display:swap;}
  @font-face{font-family:"Google Sans"; src:url("/fonts/GoogleSans-SemiBold.woff2") format("woff2"); font-weight:600; font-style:normal; font-display:swap;}
  @font-face{font-family:"Google Sans"; src:url("/fonts/GoogleSans-Bold.woff2") format("woff2");     font-weight:700; font-style:normal; font-display:swap;}

  /* Design tokens — shared visual system (light is the base, dark overrides) */
  :root{
    --font-sans:"Google Sans", -apple-system, "Segoe UI", system-ui, sans-serif;

    --space-1:4px; --space-2:8px; --space-3:12px; --space-4:16px; --space-5:20px;
    --space-6:24px; --space-8:32px; --space-10:40px; --space-12:48px;
    --radius-sm:8px; --radius-md:12px; --radius-lg:16px; --radius-pill:9999px;

    --cream:#F7F8F9; --ink-900:#252422; --ink-800:#403D39; --warm-gray:#CCC5B9;

    --surface-page:#F7F8F9; --surface-card:#FFFFFF; --surface-card-hover:#EEF0F2;
    --surface-sunken:#EEF0F2; --surface-container-highest:#E4E7EA;
    --border:#E1E4E8; --border-strong:#CBD0D6;
    --text-primary:#252422; --text-secondary:#3D4148; --text-muted:#5D626A;
    --ok:#2B6B42; --ok-bg:#E4F2E8; --ok-border:#B9DCC5;
    --text-on-accent:#FFFCF2;
    --accent:#EB5E28; --accent-text:#BF4318; --accent-hover:#D14E1C; --accent-bg:#FBE7DC;
    --on-accent-container:#8A3212; --accent-border:#F0997B;
    --shadow-sm:0 2px 8px rgba(37,36,34,0.06);

    /* Material colours for the mix chart — drawn from the anchor palette */
    --mat-cement:#EB5E28;  --mat-cement-on:#FFFCF2;
    --mat-water:#CCC5B9;   --mat-water-on:#252422;
    --mat-sand:#F0997B;    --mat-sand-on:#252422;
    --mat-gravel:#403D39;  --mat-gravel-on:#FFFCF2;
  }
  :root[data-theme="dark"]{
    --surface-page:#16181B; --surface-card:#1F2226; --surface-card-hover:#292D32;
    --surface-sunken:#1B1D20; --surface-container-highest:#33373D;
    --border:#30343A; --border-strong:#4A4F57;
    --text-primary:#F4F5F6; --text-secondary:#C3C8CF; --text-muted:#9AA0A8;
    --ok:#A9DCBB; --ok-bg:#1F3A29; --ok-border:#2F5A40;
    --accent:#F17845; --accent-text:#F17845; --accent-hover:#F68F63; --accent-bg:#3E2317;
    --on-accent-container:#FFD9C2; --accent-border:#C96A3C;
    --shadow-sm:0 2px 8px rgba(0,0,0,0.30);

    --mat-cement:#F17845;  --mat-cement-on:#252422;
    --mat-water:#8B8578;   --mat-water-on:#252422;
    --mat-sand:#C96A3C;    --mat-sand-on:#FFFCF2;
    --mat-gravel:#CCC5B9;  --mat-gravel-on:#252422;
  }

  *{box-sizing:border-box; -webkit-tap-highlight-color:transparent; min-width:0;}
  [hidden]{display:none !important;} /* component display rules (flex, inline-flex) must not un-hide hidden elements */
  html,body{margin:0; padding:0; max-width:100%; overflow-x:hidden;}
  html{-webkit-text-size-adjust:100%;}
  body{
    background:var(--surface-page); color:var(--text-primary);
    font-family:var(--font-sans); font-size:15px; line-height:22px;
    min-height:100vh; padding:var(--space-4) var(--space-4) var(--space-12);
    transition:background-color .15s ease, color .15s ease;
  }
  @media(min-width:600px){ body{padding:var(--space-10) var(--space-6) 64px;} }
  .wrap{max-width:960px; margin:0 auto;}


  /* ---------- Header (shared chrome) ---------- */
  .topbar{display:flex; justify-content:space-between; align-items:center; gap:var(--space-3); margin-bottom:var(--space-6);}
  .brand{display:inline-flex; align-items:center; gap:var(--space-2); color:var(--text-primary); text-decoration:none; font-size:18px; line-height:24px; font-weight:600; border-radius:var(--radius-sm);}
  .brand .logo{width:32px; height:32px;}
  .brand.solo{gap:var(--space-3); font-size:inherit;}
  .topbar-actions{display:flex; align-items:center; gap:var(--space-2);}
  .brand.solo .title-logo{width:40px; height:40px; flex:0 0 auto;}
  .brand:focus-visible, .crumb a:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}

  /* Logo — one single-colour mark, painted in the accent color unless told otherwise.
     Override per tool with `iconColor` in the registry, or on an accent-colored surface with .on-accent. */
  .logo{
    display:block; flex:0 0 auto; width:40px; height:40px;
    background-color:var(--logo-color, var(--accent));
    -webkit-mask:var(--logo) center / contain no-repeat; mask:var(--logo) center / contain no-repeat;
  }
  .on-accent .logo{--logo-color:var(--text-on-accent);}

  /* Menu button (opens the drawer) */
  .menu-btn{
    position:relative; width:44px; height:44px; padding:0; flex:0 0 auto; cursor:pointer;
    display:inline-flex; align-items:center; justify-content:center;
    background:var(--surface-card); border:1px solid var(--border-strong); border-radius:var(--radius-pill); color:var(--text-primary);
    transition:background-color .15s ease;
  }
  .menu-btn:hover{background:var(--surface-card-hover);}
  .menu-btn:focus-visible, .icon-btn:focus-visible, .nav-item:focus-visible, .switch-row:focus-visible, .banner a:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
  .menu-btn svg, .icon-btn svg, .nav-item svg{width:22px; height:22px; flex:0 0 auto; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round;}
  .menu-btn .dot{position:absolute; top:8px; right:8px; width:11px; height:11px; border-radius:50%; background:var(--accent); border:2px solid var(--surface-card);}

  /* Off-screen drawer (slides in from the right) */
  .scrim{
    position:fixed; inset:0; z-index:40; background:rgba(37,36,34,.45); opacity:0; visibility:hidden;
    transition:opacity .25s ease, visibility 0s linear .25s;
  }
  .scrim.open{opacity:1; visibility:visible; transition:opacity .25s ease, visibility 0s;}
  .drawer{
    position:fixed; top:0; right:0; bottom:0; z-index:50; width:min(88vw, 360px);
    display:flex; flex-direction:column; background:var(--surface-page); border-left:1px solid var(--border);
    box-shadow:-8px 0 32px rgba(37,36,34,.18);
    transform:translateX(100%); visibility:hidden; transition:transform .25s ease, visibility 0s linear .25s;
  }
  .drawer.open{transform:none; visibility:visible; transition:transform .25s ease, visibility 0s;}
  html.drawer-open, html.drawer-open body{overflow:hidden;}
  @media(prefers-reduced-motion:reduce){ .scrim, .drawer{transition:none !important;} }

  .drawer-head{display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); padding:var(--space-4) var(--space-4) var(--space-2) var(--space-6);}
  .drawer-head h2{margin:0; font-size:18px; line-height:24px; font-weight:600;}
  .icon-btn{width:44px; height:44px; padding:0; display:inline-flex; align-items:center; justify-content:center; background:transparent; border:none; border-radius:var(--radius-pill); color:var(--text-secondary); cursor:pointer;}
  .icon-btn:hover{background:var(--surface-card-hover);}
  .drawer-body{flex:1 1 auto; overflow-y:auto; padding:0 var(--space-4) var(--space-4); -webkit-overflow-scrolling:touch;}
  .drawer-section{margin-top:var(--space-6);}
  .drawer-section h3{margin:0 0 var(--space-2) var(--space-3); font-size:12px; line-height:16px; font-weight:500; letter-spacing:.02em; color:var(--text-secondary);}
  .drawer-field{padding:0 var(--space-3); margin-bottom:var(--space-4);}
  .drawer-field .field-label{font-size:13px; line-height:18px; font-weight:500; color:var(--text-primary); margin-bottom:6px;}
  .drawer .seg{display:flex; width:100%;}
  .drawer .seg button{flex:1 1 0; min-width:0; padding:0 var(--space-2); gap:6px; white-space:nowrap;}
  .drawer-hint{margin:2px var(--space-3) var(--space-3); font-size:13px; line-height:18px; color:var(--text-secondary);}
  .drawer-foot{padding:var(--space-3) var(--space-6) var(--space-4); border-top:1px solid var(--border); font-size:13px; line-height:18px; color:var(--text-muted);}

  .nav-item{
    display:flex; align-items:center; gap:var(--space-3); width:100%; min-height:48px; padding:0 var(--space-3);
    background:transparent; border:none; border-radius:var(--radius-sm); color:var(--text-primary);
    font-family:inherit; font-size:15px; line-height:22px; font-weight:500; text-align:left; text-decoration:none; cursor:pointer;
    transition:background-color .15s ease;
  }
  .nav-item:hover{background:var(--surface-card-hover);}
  .nav-item svg{color:var(--text-secondary);}
  .nav-item .count{
    margin-left:auto; min-width:22px; height:22px; padding:0 7px; border-radius:var(--radius-pill);
    background:var(--accent); color:var(--text-on-accent); font-size:12px; line-height:22px; font-weight:600; text-align:center;
  }

  /* Switch row: the whole row is the button */
  .switch-row{
    display:flex; align-items:center; justify-content:space-between; gap:var(--space-3); width:100%; min-height:48px; padding:0 var(--space-3);
    background:transparent; border:none; border-radius:var(--radius-sm); color:var(--text-primary);
    font-family:inherit; font-size:15px; line-height:22px; font-weight:500; text-align:left; cursor:pointer;
  }
  .switch-row:hover:not(:disabled){background:var(--surface-card-hover);}
  .switch-row:disabled{cursor:not-allowed; color:var(--text-muted);}
  .switch-track{position:relative; flex:0 0 auto; width:44px; height:26px; border-radius:var(--radius-pill); background:var(--surface-sunken); border:1px solid var(--border-strong); transition:background-color .15s ease, border-color .15s ease;}
  .switch-track::after{content:""; position:absolute; top:2px; left:2px; width:20px; height:20px; border-radius:50%; background:var(--text-muted); transition:transform .15s ease, background-color .15s ease;}
  .switch-row[aria-checked="true"] .switch-track{background:var(--accent-bg); border-color:var(--accent-border);}
  .switch-row[aria-checked="true"] .switch-track::after{transform:translateX(18px); background:var(--accent);}
  .switch-row:disabled .switch-track{opacity:.5;}

  /* Announcement banner (new releases) */
  .banner{
    display:flex; align-items:center; gap:var(--space-3); margin-bottom:var(--space-4); padding:var(--space-2) var(--space-2) var(--space-2) var(--space-4);
    background:var(--accent-bg); color:var(--on-accent-container); border:1px solid var(--accent-border); border-radius:var(--radius-md);
    font-size:14px; line-height:20px; font-weight:500;
  }
  .banner .banner-text{flex:1 1 auto;}
  .banner a{color:inherit; font-weight:600; white-space:nowrap; border-radius:4px;}
  .banner .icon-btn{width:36px; height:36px; color:inherit;}
  .banner .icon-btn svg{width:18px; height:18px;}

  /* Version pill (links to the release notes) */
  .ver{
    align-self:flex-start; display:inline-flex; align-items:center; gap:6px; min-height:28px; padding:4px 12px;
    border:1px solid var(--border-strong); border-radius:var(--radius-pill); background:var(--surface-card);
    color:var(--text-secondary); font-size:12px; line-height:16px; font-weight:500; letter-spacing:.02em; text-decoration:none; white-space:nowrap;
  }
  .ver:hover{background:var(--surface-card-hover);}
  .ver:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
  .ver .pip{width:8px; height:8px; border-radius:50%; background:var(--accent);}

  .page-head{display:flex; flex-direction:column; gap:var(--space-2); margin-bottom:var(--space-6);}
  .crumb{display:flex; align-items:center; flex-wrap:wrap; gap:var(--space-2); font-size:13px; line-height:18px; color:var(--text-secondary);}
  .crumb a{color:var(--accent-text); text-decoration:none; font-weight:500; border-radius:4px;}
  .crumb a:hover{text-decoration:underline;}
  .title-row{display:flex; align-items:center; gap:var(--space-3);}
  .title-logo{width:40px; height:40px; flex:0 0 auto;}
  h1{margin:0; font-size:28px; line-height:34px; font-weight:600; color:var(--text-primary);}
  .sub{color:var(--text-secondary); font-size:15px; line-height:22px; max-width:60ch; margin:0;}

  /* Segmented pills for theme + language (accent tint marks the active option) */
  .seg{display:inline-flex; background:var(--surface-card); border:1px solid var(--border-strong); border-radius:var(--radius-pill); padding:4px; gap:4px;}
  .seg button{
    background:transparent; border:none; color:var(--text-secondary); font-family:inherit;
    font-size:13px; line-height:16px; font-weight:500; letter-spacing:.02em;
    min-width:44px; min-height:44px; padding:0 12px; border-radius:var(--radius-pill);
    cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
    transition:background-color .15s ease, color .15s ease;
  }
  .seg button:hover{background:var(--surface-card-hover);}
  .seg button.active{background:var(--accent-bg); color:var(--on-accent-container); font-weight:600;}
  .seg svg{width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.75; stroke-linecap:round; stroke-linejoin:round;}
  .seg button:focus-visible, .tab:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}

  .panel{
    background:var(--surface-card); border:1px solid var(--border); border-radius:var(--radius-md);
    padding:var(--space-4); box-shadow:var(--shadow-sm);
    transition:background-color .15s ease, border-color .15s ease;
  }
  @media(min-width:600px){ .panel{padding:var(--space-5);} }
  .panel-head{display:flex; justify-content:space-between; align-items:center; gap:var(--space-3); margin-bottom:var(--space-4);}
  .panel-title{margin:0; font-size:18px; line-height:24px; font-weight:600;}

  /* ---------- Form ---------- */
  label{display:block; font-size:12px; line-height:16px; font-weight:500; letter-spacing:.02em; color:var(--text-secondary); margin:var(--space-4) 0 6px;}
  .field-first{margin-top:0;}

  select, input[type=number]{
    width:100%; background:var(--surface-sunken); border:1px solid var(--border-strong);
    color:var(--text-primary); font-family:inherit; font-size:16px; line-height:22px;
    padding:10px 12px; border-radius:var(--radius-sm); outline:none; min-height:44px;
    -webkit-appearance:none; appearance:none; font-variant-numeric:tabular-nums;
    transition:border-color .15s ease, box-shadow .15s ease;
  }
  select{
    padding-right:40px; cursor:pointer;
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B8578' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>");
    background-repeat:no-repeat; background-position:right 12px center; background-size:18px;
  }
  select:focus, input[type=number]:focus{border:1.5px solid var(--accent); padding:9.5px 11.5px; box-shadow:0 0 0 3px var(--accent-bg);}
  select:focus{padding-right:39.5px;}

  .row2{display:grid; grid-template-columns:1fr 1fr; gap:var(--space-3);}
  .row3{display:grid; grid-template-columns:1fr 1fr 1fr; gap:var(--space-2);}
  @media(max-width:380px){
    .row3{grid-template-columns:1fr 1fr; grid-template-areas:"a b" "c c";}
    .row3 > div:nth-child(1){grid-area:a;}
    .row3 > div:nth-child(2){grid-area:b;}
    .row3 > div:nth-child(3){grid-area:c;}
  }

  /* Tabs — shape of the element (views of the same input) */
  .tabs{display:flex; border-bottom:1px solid var(--border);}
  .tab{
    flex:1 1 0; background:none; border:none; border-bottom:2px solid transparent; margin-bottom:-1px;
    color:var(--text-muted); font-family:inherit; font-size:14px; line-height:18px; font-weight:500;
    padding:var(--space-3) var(--space-1); min-height:48px; cursor:pointer; text-align:center;
    transition:color .15s ease, border-color .15s ease;
  }
  .sr-only{position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0;}
  .tab:hover{color:var(--text-secondary);}
  .tab.active{color:var(--accent-text); border-bottom-color:var(--accent); font-weight:600;}
  .tabs-label{margin-bottom:var(--space-2);}
  .tab-body{margin-top:var(--space-4);}
  .tab-body label:first-child, .tab-body .row3 label, .tab-body .row2 label{margin-top:0;}

  .hint{font-size:13px; line-height:18px; color:var(--text-secondary); margin-top:var(--space-4);}

  .badge{
    display:inline-flex; align-items:center; border:1px solid var(--border-strong); color:var(--text-primary);
    padding:4px 12px; border-radius:var(--radius-pill); font-size:12px; line-height:16px; font-weight:500;
    letter-spacing:.02em; white-space:nowrap; background:var(--surface-card);
  }
  .badge.new{background:var(--accent-bg); border-color:var(--accent-border); color:var(--on-accent-container); font-weight:600;}

  /* Filter chips (selector page, changelog page) */
  .filters{
    display:flex; gap:var(--space-2); margin:var(--space-6) calc(var(--space-4) * -1) var(--space-4);
    padding:0 var(--space-4) var(--space-1); overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch;
  }
  .filters::-webkit-scrollbar{display:none;}
  @media(min-width:600px){ .filters{margin-left:0; margin-right:0; padding-left:0; padding-right:0; flex-wrap:wrap; overflow:visible;} }
  .chip{
    flex:0 0 auto; background:var(--surface-card); border:1px solid var(--border-strong); color:var(--text-secondary);
    font-family:inherit; font-size:14px; line-height:20px; font-weight:500; min-height:40px; padding:0 var(--space-4);
    border-radius:var(--radius-pill); cursor:pointer; white-space:nowrap;
    transition:background-color .15s ease, border-color .15s ease, color .15s ease;
  }
  .chip:hover{background:var(--surface-card-hover);}
  .chip:focus-visible{outline:2px solid var(--accent); outline-offset:2px;}
  .chip[aria-pressed="true"]{background:var(--accent-bg); border-color:var(--accent-border); color:var(--on-accent-container); font-weight:600;}

  .stats{display:grid; grid-template-columns:1fr 1fr; gap:var(--space-3); margin-bottom:var(--space-5);}
  .stat{background:var(--surface-sunken); border-radius:var(--radius-md); padding:var(--space-4); display:flex; flex-direction:column; gap:var(--space-1);}
  .stat .label{font-size:12px; line-height:16px; font-weight:500; letter-spacing:.02em; color:var(--text-secondary);}
  .stat .val{font-size:28px; line-height:32px; font-weight:600; color:var(--text-primary); font-variant-numeric:tabular-nums; overflow-wrap:anywhere;}
  @media(max-width:359px){ .stats{grid-template-columns:1fr;} }

  .note{margin-top:var(--space-5); font-size:13px; line-height:19px; color:var(--text-secondary); background:var(--surface-sunken); border-radius:var(--radius-sm); padding:var(--space-3) var(--space-4);}

  .drawer.news{width:min(92vw, 440px);}
  .news-item{padding:var(--space-4) 0; border-bottom:1px solid var(--border);}
  .news-item:last-child{border-bottom:0;}
  .news-head{display:flex; flex-wrap:wrap; align-items:center; gap:var(--space-2) var(--space-3);}
  .news-date{margin-left:auto; font-size:13px; line-height:18px; color:var(--text-muted);}
  .news-notes{margin:var(--space-3) 0 0; padding-left:20px; color:var(--text-secondary); font-size:14px; line-height:20px;}
  .news-notes li{margin:0 0 6px;}
  .news-notes li::marker{color:var(--accent);}
  footer .foot-desc{max-width:60ch; margin:0 auto var(--space-2);}
  footer{text-align:center; color:var(--text-muted); font-size:13px; line-height:18px; margin-top:var(--space-8); padding:0 var(--space-2);}
