/* =========================================================
   GLOBAL BASE STYLES
   ========================================================= */
   * { box-sizing: border-box; }

   body {
     margin: 0;
     font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
     background: #f4f6f9;
     color: #333;
   }
   
   h1, h2, h3, h4, h5, h6 { color: #2c3e50; margin: .5em 0; }
   p { color: #555; line-height: 1.6; margin-bottom: 1em; }
   
   .container {
     max-width: 820px;
     background: #fff;
     margin: 20px auto;
     padding: 20px;
     border-radius: 8px;
     box-shadow: 0 2px 12px rgba(0,0,0,.06);
   }
   
   label { display: block; margin: .5em 0 .2em; font-weight: 600; }
   
   input[type=text], input[type=number] {
     width: 100%; padding: .55em .6em; font-size: 1em; margin-bottom: 1em;
     border: 1px solid #c9cdd2; border-radius: 6px; background: #fff;
   }
   /* Styled select (opt-in via .select class) */
   .select {
     appearance: none;
     -webkit-appearance: none;
     -moz-appearance: none;
     background: #f9fafb url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E") no-repeat right 10px center;
     border: 1px solid #d1d5db;
     border-radius: 10px;
     padding: .55em .9em;
     padding-right: 36px;
     font-size: 1em;
   }
   input[type=number]::-webkit-outer-spin-button,
   input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
   
   button {
     background: #2c3e50; color: #fff; border: none;
     padding: .55em 1.1em; font-size: 1em; border-radius: 6px; cursor: pointer;
   }
   button:hover { background: #1f2d3a; }
   button:active { background: #16222c; }
   button + button { margin-left: .5em; }
   
.result { margin-top: 1em; font-weight: 700; font-size: 1.1em; color: #2c3e50; }
ul.calc-list { list-style: none; padding: 0; }
ul.calc-list li { margin: .5em 0; }

/* Related calculators */
.qc-related {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  background: #f3f4f6;
}
.qc-related__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  color: #111827;
}
.qc-related__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
@media (min-width: 700px) {
  .qc-related__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.qc-related__list a {
  display: block;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 10px;
  text-decoration: none;
  color: #111827;
  background: #fff;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.qc-related__list a:hover {
  border-color: rgba(0,0,0,0.2);
  background: #f3f4f6;
}
.qc-related__list a:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

   @media (max-width:560px) {
     .container { margin: 12px; padding: 16px; }
   }
   
   /* Ensure [hidden] works properly */
   [hidden] { display: none !important; }
   
   /* =========================================================
      HEADER
      ========================================================= */
   .header {
     position: sticky; top: 0; z-index: 50;
     background: #2f3e4b; color: #fff;
     display: grid; grid-template-columns: 1fr auto 1fr;
     align-items: center; padding: 12px 16px;
   }
   
   .header-brand {
     justify-self: center;
     display: flex; align-items: center; gap: 0.25rem;
     color: #fff; text-decoration: none;
   }
   
   .header-title-wrap { display: flex; flex-direction: column; line-height: 1.2; }
   .header-title { font-size: 2rem; font-weight: 700; }
   .header-subtitle { font-size: 1rem; font-weight: 400; opacity: 0.85; text-decoration: none; }
   
   .header-logo { height: 3em; width: auto; }
   
   /* Do not underline the brand link */
   .header .header-brand,
   .header .header-brand:hover,
   .header .header-brand:visited,
   .header .header-brand.active { text-decoration: none; }
   
   /* ===========================
   NAV / Drawer + Backdrop
   =========================== */

    .nav-btn {
      justify-self: end;
      font-size: 1.5rem;
      line-height: 1;
      background: transparent;
      color: #fff;
      border: 0;
      cursor: pointer;
      padding: 6px 8px;
    }
   
   /* lock scroll when drawer open */
    .nav-no-scroll { overflow: hidden; }

    /* backdrop */
    .nav-backdrop{
    position: fixed; inset: 0;
    background: rgba(17,24,39,.55); /* slate-900/55 */
    opacity: 0; pointer-events: none;
    transition: opacity .2s ease;
    z-index: 999; /* below drawer */
    }
    .nav-backdrop.open{ opacity:1; pointer-events:auto; }

    /* drawer container that was #nav-panel */
    #nav-panel{
    position: fixed; top: 0; right: 0;
    height: 100dvh;
    width: min(300px, 35vw);
    background: #f8fafc;            /* slate-50 */
    box-shadow: -8px 0 24px rgba(0,0,0,.18);
    transform: translateX(100%);
    transition: transform .22s ease;
    z-index: 1000;                   /* above backdrop */
    display: flex; flex-direction: column;
    border-left: 1px solid rgba(15,23,42,.08);
    border-top-left-radius: 10px; border-bottom-left-radius: 10px;
    }
    #nav-panel.open{ transform: translateX(0); }

    .nav-inner{ display:flex; flex-direction:column; gap:12px; height:100%; padding:16px; }

    /* top row: search + X */
    .nav-top{ display:flex; gap:10px; align-items:center; }
    /* Keep your existing search input styling */
    #nav-search {
        flex: 1;
        height: 40px;
        padding: 0 12px;
        border: 1px solid rgba(15,23,42,.15);
        border-radius: 8px;
        outline: none;
        background: #fff;
        color: #0f172a;
    }
    
    /* Correct placement: hide browser’s built-in clear (x) */
    #nav-search::-webkit-search-cancel-button {
        -webkit-appearance: none;
        appearance: none;
        display: none;
    }
    
    #nav-search::-ms-clear {
        display: none;   /* old Edge/IE */
    }
    
    #nav-search::-ms-reveal {
        display: none;   /* old Edge */
    }
  
    #nav-search:focus{ border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.18); }

    #nav-close {
        background: none;
        border: none;
        font-size: 1.5rem;   /* makes the × bigger */
        font-weight: bold;
        color: #333;         /* adjust to match your theme */
        cursor: pointer;
      
        position: absolute;
        top: 12px;           /* vertical alignment */
        right: 12px;         /* spacing from edge */
        line-height: 1;      /* remove weird text spacing */
      }

    /* categories accordion */
    .nav-cats{ overflow:auto; padding-top:6px; }
    .nav-acc{ border-radius:10px; background:#ffffff; border:1px solid rgba(15,23,42,.12); margin-bottom:10px; }
    .nav-acc-btn{
    display:flex; align-items:center; justify-content:space-between;
    padding:12px 14px; cursor:pointer; list-style:none; font-weight:600; color:#0f172a;
    }
    .nav-acc-btn::-webkit-details-marker{ display:none; }
    .nav-acc-btn svg{ width:18px; height:18px; stroke:#334155; fill:none; stroke-width:2; transition:transform .18s; }
    .nav-acc[open] .nav-acc-btn svg{ transform:rotate(180deg); }

    .nav-acc-list{ margin:0; padding: 4px 10px 10px 10px; list-style:none; }
    .nav-acc-list li a{
    display:block; padding:10px 10px; border-radius:8px;
    color:#0f172a; text-decoration:none;
    }
    .nav-acc-list li a:hover{ background:#eef2ff; color:#1d4ed8; }

    /* search results list */
    .nav-results{ overflow:auto; }
    .nav-results ul{ list-style:none; margin:0; padding:0; }
    .nav-results li a{
    display:block; padding:12px 14px; margin-bottom:8px;
    background:#ffffff; border:1px solid rgba(15,23,42,.12);
    border-radius:10px; color:#0f172a; text-decoration:none;
    }
    .nav-results li a:hover{ background:#eef2ff; border-color:#c7d2fe; color:#1d4ed8; }
    .nav-results .empty{ color:#64748b; padding:10px 2px; }

    /* hamburger button alignment already in header styles;
    ensure it sits on the right and above backdrop */
    .nav-btn{ z-index: 1001; }

    /* small screens: drawer uses full width */
    @media (max-width: 640px){
    #nav-panel{ width: 100vw; border-radius: 0; }
    }

   
   /* =========================================================
      FOOTER
      ========================================================= */
   footer {
     background: #2c3e50; color: #fff;
     text-align: center; padding: 8px 10px;
     font-size: .9em;
   }
   footer a {
     color: inherit;
     text-decoration: none;
   }
   
