/* Base */
body{
      font-family: var(--font-sans); font-size: var(--fs-base);
      background:var(--bg); margin:0; padding:0.75rem; color:var(--text);
      -webkit-text-size-adjust:100%;
    }
    
/* Global link styling */
a{ color: var(--accent); text-decoration:none; }
a:hover{ color: var(--accent-dark); text-decoration:none; }
a:visited{ color: var(--accent); }
h1{ text-align:center; margin:0 0 0.6rem; font-size:1.6rem; }
    .container{ max-width:980px; margin:0 auto; }

    .tabs{
      display:flex;
      gap:0.5rem;
      background:#ffffff;
      padding:0.4rem;
      border-radius:12px;
      box-shadow: 0 6px 14px rgba(0,0,0,0.06);
      position: sticky;
      top: calc(var(--topbar-h, 56px) + env(safe-area-inset-top));
      z-index: 10;
      overflow-x:auto;
      -webkit-overflow-scrolling: touch;
    }
    .tab-btn{
      flex:0 0 auto;
      border:0;
      border-radius:10px;
      padding:var(--pad-nav-y) var(--pad-nav-x);
      font-size: var(--fs-nav);
      background:transparent;
      color: var(--text);
      cursor:pointer;
      white-space:nowrap;
      font: inherit;
      -webkit-tap-highlight-color: transparent;
    }
    .tab-btn[aria-selected="true"]{
      background:white;
      box-shadow: 0 6px 14px rgba(0,0,0,0.08);
      font-weight:600;
    }

    .card{
      background:white; border-radius:12px;
      padding:0.85rem 1rem 1.1rem;
      box-shadow:0 10px 25px rgba(0,0,0,0.08);
      margin-top:0.6rem;
    }
    h2{ font-size:1.35rem; margin:0 0 0.5rem; }
    .small{ font-size:0.92rem; color:#333; }
    .hint{ font-size:0.85rem; color:#555; margin-top:0.25rem; }

    fieldset{ border:1px solid #ddd; border-radius:10px; padding:0.75rem; margin:0 0 1rem; }
    legend{ font-weight:600; padding:0 0.5rem; }
    label{ display:block; font-size:0.95rem; margin-top:0.35rem; }

    input, select, button.action{
      width:100%;
      padding:0.5rem;
      margin-top:0.2rem;
      border-radius:10px;
      border:1px solid #ccc;
      font-size:1rem;
      box-sizing:border-box;
    }

    .grid{ display:grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap:0.45rem; }
    .actions{ display:grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap:0.45rem; margin-top:0.45rem; }
    button.action{
      background:#A6F5E6; color:white; border:none; cursor:pointer;
      -webkit-tap-highlight-color: transparent;
    }
    button.secondary{ background:#999; }

    .checkbox{ display:flex; align-items:center; gap:0.5rem; margin-top:0.5rem; }
    .checkbox input{ width:auto; margin:0; }

    .result{ margin-top:1rem; padding:1rem; background:#f0f4ff; border-radius:10px; }
    .warning{ color:#a33; font-size:0.9rem; margin-top:0.5rem; }

    .panel[hidden]{ display:none !important; }

    footer{ margin-top:2rem; font-size:0.8rem; color:#555; text-align:center; }

    @media (max-width:430px){
      h1{ font-size:1.3rem; }
      h2{ font-size:1.15rem; }
      .actions{ grid-template-columns:1fr; }
      .grid{ grid-template-columns:1fr; }
          }
  
  /* Template picker illustration panel */
  .tpl-row { display:flex; gap:0.75rem; align-items:flex-start; flex-wrap:wrap; }
  .tpl-controls { flex: 1 1 260px; min-width: 240px; }
  .tpl-illus { flex: 0 0 190px; border:1px solid rgba(0,0,0,0.12); border-radius:12px; padding:0.6rem; background: rgba(0,0,0,0.03); }
  .tpl-illus svg { width:100%; height:auto; display:block; }
  .tpl-illus .cap { margin-top:0.35rem; font-size:0.85rem; line-height:1.25; color: rgba(0,0,0,0.72); }
  .tpl-illus .cap strong { color: rgba(0,0,0,0.9); }

  .header{ display:flex; align-items:center; justify-content:center; gap:0.75rem; margin:0 0 1rem; }
  .header h1{ margin:0; }
  .lang-btn{height:36px;display:inline-flex;align-items:center;justify-content:center;padding:0 0.7rem;border-radius:12px;border:1px solid #ddd;background:#fff;color:#111;font-size:0.9rem;line-height:1;white-space:nowrap;text-decoration:none;cursor:pointer;font-weight:600;} 
  .lang-btn:active{ transform: translateY(1px);} 

    .tabs-wrap{ display:block; }
    .mobile-tabs{ display:none; margin:0 0 0.6rem; }
    .mobile-tabs select{
      width:100%;
      padding:0.65rem 0.8rem;
      border-radius:12px;
      border:1px solid #cfd6e6;
      font-size:1rem;
      background:white;
    }
    @media (max-width: 640px){
      .tabs{ display:none; }
      .mobile-tabs{ display:block; }
      body{ padding:0.8rem; }
    }

  
  .header{ justify-content:space-between; }

  /* === Settings (cog) dropdown === */
  .header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:0.75rem;
    margin:0 0 1rem;
  }
  .header h1{
    flex:1;
    text-align:center;
    margin:0;
    text-transform:uppercase;
    letter-spacing:0.06em;
  }
  .header-spacer{ width:36px; height:36px; }

  .settings{ position:relative; display:flex; align-items:center; }
  .settings-btn{
    width:36px;
    height:36px;
    padding:0;
    border-radius:12px;
    border:1px solid rgba(255,255,255,0.18);
    background-color:#43615B !important;
    color:#fff !important;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .settings-btn svg{ width:18px; height:18px; stroke:currentColor; fill:none; stroke-width:1.8; }
  .settings-btn:active{ transform: translateY(1px); }

  .settings-menu[hidden]{ display:none !important; }

  .settings-menu{
  z-index: 5000;

  z-index: 1100;

    position:absolute;
    right:0;
    top: calc(36px + 10px);
    min-width: 190px;
    background:#fff;
    border:1px solid rgba(0,0,0,0.10);
    border-radius:14px;
    padding:0.45rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    z-index: 3000;
    display:flex;
    flex-direction:column;
    gap:0.4rem;
  }
  .settings-title{
    font-size:0.78rem;
    color:#475569;
    padding:0.2rem 0.6rem 0.1rem;
    text-align:center;
    width:100%;
  }
  .settings-menu{
    align-items:stretch;
  }
  .settings-menu button,
  .settings-menu a{
    width:100%;
    justify-content:center;
    text-align:center;
    font-size:0.82rem;
    height:34px;
    padding:0 0.65rem;
    box-sizing:border-box;
  }

  .header-controls{display:flex;justify-content:center;align-items:center;gap:0.6rem;flex-wrap:wrap;}
  .units-switch-header{height:36px;display:inline-flex;align-items:center;justify-content:center;gap:0.4rem;font-size:0.9rem;background:#fff;border:1px solid #ddd;padding:0 0.7rem;border-radius:12px;line-height:1;white-space:nowrap;cursor:pointer;}
  .units-switch-header input{margin:0;}

  
  .lang-btn, .hdr-btn, .gh-link{height:36px;display:inline-flex;align-items:center;justify-content:center;padding:0 0.7rem;border-radius:12px;border:1px solid #ddd;background:#fff;color:#111;font-size:0.9rem;line-height:1;white-space:nowrap;text-decoration:none;cursor:pointer;}
  .lang-btn:hover, .hdr-btn:hover, .gh-link:hover{filter:brightness(0.98);}
  .lang-btn:active, .hdr-btn:active{transform:translateY(1px);}
  .gh-link{gap:0.35rem;}
.app-footer{ margin-top:1rem; padding:0.6rem 0.75rem; font-family:system-ui,-apple-system,sans-serif; font-size:12px; color:#333; border-top:1px solid #e6e6e6; }
  .invalid-input{ border:2px solid #c62828 !important; outline:none; }
  .constraint-hint{ display:block; font-size:12px; color:#666; margin-top:0.2rem; }
  .constraint-hint.invalid{ color:#c62828; }



    /* Header controls unified pill look */
    .header-controls{display:flex;align-items:center;gap:10px;
      display:flex;
      gap:0.5rem;
      flex-wrap:wrap;
      justify-content:center;
      align-items:center;
    }
    .units-switch-header,
    .lang-btn,
    .gh-link,
    .hdr-btn{height:36px;display:inline-flex;align-items:center;justify-content:center;padding:0 0.7rem;border-radius:12px;border:1px solid #ddd;background:#fff;color:#111;font-size:0.9rem;line-height:1;white-space:nowrap;cursor:pointer;}
    .units-switch-header{ white-space:nowrap; }
    .units-switch-header input{ margin:0; }
    .lang-btn{ box-shadow:none; }
    .lang-btn:hover, .gh-link:hover, .hdr-btn:hover, .units-switch-header:hover{
      border-color:#94a3b8;
    }

    /* About modal (no popup blockers) */
    #about-overlay{
      display:none;
      position:fixed;
      inset:0;
      background:rgba(0,0,0,0.45);
      z-index:9999;
      padding:1rem;
      box-sizing:border-box;
      justify-content:center;
      align-items:center;
    }
    #about-overlay[aria-hidden="false"]{ display:flex; }
    #about-modal{
      background:#fff;
      color:#111;
      max-width:900px;
      width:min(900px, 100%);
      max-height:85vh;
      overflow:auto;
      border-radius:16px;
      padding:1rem 1.2rem;
      box-shadow:0 10px 30px rgba(0,0,0,0.25);
    }
    #about-modal h2{ margin:0 0 0.25rem 0; }
    #about-modal h3{ margin:1rem 0 0.4rem 0; }
    #about-close{
      position:sticky;
      top:0;
      float:right;
      margin-left:0.75rem;
    }
    #about-modal .muted{ color:#475569; font-size:0.95rem; }
    #about-modal ul{ margin:0.25rem 0 0.75rem 1.25rem; }
    #about-modal p{ margin:0.5rem 0; }


/* === Header control alignment & responsiveness === */
.header-controls,
.header-controls * {
  box-sizing: border-box;
}

.header-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap; /* allow wrap on small screens */
}

.header-controls .pill,
.header-controls button,
.header-controls select,
.header-controls label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  line-height: 1;
  padding: 0 12px;
  white-space: nowrap;
}

/* Ensure checkbox label doesn't sit lower */
.header-controls label input {
  margin-right: 6px;
}

/* === Primary action buttons colour fix === */
button.action,
button.print {
  background-color: #A6F5E6 !important;
  color: #000 !important;
}

/* Hover state */
button.action:hover,
button.print:hover {
  background-color: #92e9d9 !important;
}


/* === Units toggle button (matches header pills) === */
#units-toggle{
  min-width: 92px;
}


/* === Unified button style update === */
button,
button.action,
button.print,
.hdr-btn {
  background-color: #43615B !important;
  color: #ffffff !important;
}

button:hover,
button.action:hover,
button.print:hover,
.hdr-btn:hover {
  background-color: #36514C !important;
}


/* === v2.5 UI polish === */

/* Menu background */
tabs{ background:#fff !important; }

/* Make all primary action buttons less intrusive (match Poison ring feel) */
button.action{
  width:auto !important;            /* no full-width buttons */
  padding:0.45rem 0.75rem !important;
  border-radius:12px !important;
  border:1px solid rgba(255,255,255,0.18) !important;
  font-size:0.92rem !important;
}

/* Apply same sizing to print/reset style buttons */
button.print, button.ghost, button.secondary{
  padding:0.45rem 0.75rem !important;
  border-radius:12px !important;
  font-size:0.92rem !important;
}

/* Ensure button colours stay as requested */
button, button.action, button.print, .hdr-btn, .gh-link{
  background-color:#43615B !important;
  color:#fff !important;
}

/* GitHub link should look like the other header controls */
.gh-link{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  height:36px !important;
  padding:0 0.7rem !important;
  border-radius:12px !important;
  border:1px solid rgba(255,255,255,0.18) !important;
  text-decoration:none !important;
}

/* Hover feedback */
button:hover, button.action:hover, button.print:hover, .hdr-btn:hover, .gh-link:hover{
  background-color:#36514C !important;
}



/* === Force consistent action button sizing in Flowers/Cats/Poison ring === */
#flowers button.action, #cats button.action, #poison button.action,
#flowers button.print, #cats button.print, #poison button.print,
#fl-calcBtn, #cat-calcBtn, #pr-calcBtn, #fl-printBtn, #cat-printBtn, #pr-printBtn {
  padding: 0.45rem 0.75rem !important;
  font-size: 0.92rem !important;
  height: auto !important;
  min-height: 34px !important;
}


/* === Consistent panel width (Pendant & Decorative) === */
#panel-pendant, #panel-decorative{
  width: 100%;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
}

/* === Page background image (non-intrusive) === */
body {
  background-image: url("../assets/bg.png") !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}
/* Ensure app stays readable on top of background */
.app, #app, .container, main {
  background: rgba(255,255,255,0.96) !important;
  backdrop-filter: blur(2px);
}





.cog-icon {
  width: 22px;
  height: 22px;
  display: block;
  image-rendering: auto;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.settings-btn:hover .cog-icon {
  transform: rotate(90deg);
  filter: brightness(1.1);
}

.settings-btn:active .cog-icon {
  transform: rotate(135deg) scale(0.95);
}


.flag-icon{
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}


.settings-divider{
  height: 1px;
  width: 100%;
  background: rgba(255,255,255,0.10);
  margin: 10px 0;
}

.settings-section{
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.settings-section-title{
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.8;
}

.lang-grid{
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  justify-items: center;
}

.lang-flag{
  width: 44px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.lang-flag:hover{
  transform: translateY(-1px);
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.18);
}

.lang-flag:active{
  transform: translateY(0px) scale(0.98);
}

.lang-flag.is-active{
  border-color: rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.14);
}


.lang-text{font-size:12px;font-weight:700;letter-spacing:0.06em;}

  /* Disabled form controls (Phase 1 Sacred Geometry UX) */
  input:disabled, select:disabled, button:disabled{
    opacity: 0.55;
    cursor: not-allowed;
  }


/* License modal (same styling as About) */
#license-overlay{
  display:none;
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.45);
  z-index:9999;
  padding:1rem;
  box-sizing:border-box;
  justify-content:center;
  align-items:center;
}
#license-overlay[aria-hidden="false"]{ display:flex; }
#license-modal{
  background:#fff;
  color:#111;
  max-width:900px;
  width:min(900px, 100%);
  max-height:85vh;
  overflow:auto;
  border-radius:16px;
  padding:1rem 1.2rem;
  box-shadow:0 10px 30px rgba(0,0,0,0.25);
}
#license-modal h2{ margin:0 0 0.25rem 0; }
#license-modal h3{ margin:1rem 0 0.4rem 0; }
#license-close{
  position:sticky;
  top:0;
  float:right;
  margin-left:0.75rem;
}


/* === Print fixes: hide footer/version text on labels === */
@media print {
  footer,
  #footer,
  .footer,
  .app-footer,
  .version,
  .unit-footer {
    display: none !important;
  }
}


/* === HARD PRINT FIX: prevent extra footer page === */
@media print {
  footer,
  #footer,
  #unitFooter,
  .unit-footer,
  .app-footer,
  .version,
  body > :not(#print-root):not(#label-root) {
    display: none !important;
  }

  body {
    margin: 0 !important;
  }

  html, body {
    height: auto !important;
    overflow: hidden !important;
  }
}


/* Stone Shapes */
.tool-row{ display:flex; gap:0.7rem; align-items:center; margin-bottom:0.9rem; flex-wrap:wrap; }
.tool-row .select{ min-width: 220px; }

.stone-layout{ display:flex; gap:1rem; align-items:stretch; }
.stone-grid{
  flex: 1 1 380px;
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap:0.75rem;
}
.stone-card{
  border:1px solid rgba(0,0,0,0.10);
  border-radius:14px;
  padding:0.7rem 0.7rem 0.6rem;
  background:#fff;
  cursor:pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
  user-select:none;
}
.stone-card:hover{ transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.16); }
.stone-card[aria-selected="true"]{ outline:2px solid rgba(62, 102, 92, 0.65); outline-offset:2px; }
.stone-card .stone-name{ font-weight:700; margin-top:0.4rem; }
.stone-card .stone-meta{ font-size:0.9rem; color: rgba(0,0,0,0.65); }
.stone-icon{ width:100%; max-width:140px; margin:0 auto; display:block; }

.stone-detail{
  flex: 0 0 min(420px, 40%);
  border:1px solid rgba(0,0,0,0.10);
  border-radius:16px;
  padding:0.9rem;
  background: rgba(255,255,255,0.92);
}
.stone-detail h3{ margin-top:0.1rem; }
.stone-detail .kv{ display:grid; grid-template-columns: 160px 1fr; gap:0.4rem 0.8rem; margin:0.8rem 0; }
.stone-detail .kv div{ font-size:0.95rem; }
.stone-detail .kv .k{ color: rgba(0,0,0,0.65); }
.stone-detail .actions{ display:flex; gap:0.6rem; flex-wrap:wrap; margin-top:0.9rem; }
@media (max-width: 900px){
  .stone-layout{ flex-direction:column; }
  .stone-detail{ flex:1 1 auto; width:100%; }
}


/* Stone detail minis */
.stone-detail .mini-wrap{ display:flex; gap:0.8rem; align-items:flex-start; margin:0.8rem 0 0.3rem; flex-wrap:wrap; }
.stone-detail .stone-mini{
  width: 140px;
  border:1px dashed rgba(0,0,0,0.18);
  border-radius:14px;
  padding:0.45rem;
  background:#fff;
}
.stone-detail .stone-mini .cap{ font-size:0.85rem; color: rgba(0,0,0,0.62); margin-top:0.35rem; text-align:center; }
.stone-detail .stone-mini svg{ width:100%; height:auto; display:block; }


/* Stone shape bench helpers (prongs + seat) */
.stone-helper{
  margin-top: 0.85rem;
  padding: 0.85rem;
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: 12px;
  background: rgba(255,255,255,0.65);
}
.stone-helper h4{
  margin: 0 0 0.6rem 0;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}
.stone-helper .row{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}
@media (max-width: 980px){
  .stone-helper .row{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stone-helper label{
  display:block;
  font-size: 0.78rem;
  color: rgba(0,0,0,0.72);
  margin: 0 0 0.25rem 0;
}
.stone-helper input, .stone-helper select{
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.9);
}
.stone-helper .mini-note{
  font-size: 0.72rem;
  color: rgba(0,0,0,0.55);
  margin-top: 0.25rem;
}
.stone-helper .seg{
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  flex-wrap: wrap;
}
.stone-helper .seg button{
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.14);
  background: rgba(255,255,255,0.9);
  cursor: pointer;
}
.stone-helper .seg button[aria-pressed="true"]{
  background: rgba(0,0,0,0.08);
}
.stone-helper .out{
  margin-top: 0.65rem;
  padding: 0.65rem;
  border-radius: 12px;
  border: 1px dashed rgba(0,0,0,0.16);
  background: rgba(255,255,255,0.6);
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.25rem;
}


/* Stones -> bezel handoff */
.bezel-mode-cta{
  margin-top:0.6rem;
  display:flex;
  gap:0.5rem;
  align-items:center;
  flex-wrap:wrap;
}
.bezel-mode-cta button{
  padding:0.5rem 0.75rem;
  border-radius:12px;
  border:1px solid rgba(0,0,0,0.18);
  background:#fff;
  cursor:pointer;
}
.bezel-mode-cta .note{
  font-size:0.9rem;
  color: rgba(0,0,0,0.65);
}

/* Stones workflow: hide internal subtool selector */
#bezel-tool-select, label[for="bezel-tool-select"]{ display:none !important; }
/* hide any legacy send/open buttons in stones helper */
#sh-to-bezel, #sh-open-bezel, #sh-cta{ display:none !important; }


/* ===== ULTRA DENSE LAYOUT OVERRIDES ===== */

.card {
  padding: 0.6rem !important;
  margin-bottom: 0.6rem !important;
}

.grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)) !important;
  gap: 0.4rem !important;
}

.actions {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
  gap: 0.4rem !important;
}

label {
  font-size: 0.85rem !important;
}

input, select {
  padding: 0.25rem 0.35rem !important;
  font-size: 0.85rem !important;
}

h2, h3 {
  margin: 0.4rem 0 !important;
}



/* ===== EXTRA COMPACT HEADER & DESCRIPTION TEXT ===== */

h1, h2, h3 {
  margin-bottom: 0.25rem !important;
}

.section-description,
.template-description,
.card p,
p.description {
  font-size: 0.75rem !important;
  margin-top: 0.15rem !important;
  margin-bottom: 0.35rem !important;
  line-height: 1.2 !important;
  opacity: 0.8;
}

/* Decorative header tightening */
#decorative h2 + p,
#decorative .card > p:first-of-type {
  font-size: 0.75rem !important;
  margin-top: 0.1rem !important;
  margin-bottom: 0.3rem !important;
}



/* ===== GLOBAL COMPACT DESCRIPTIONS (FIX muted paragraphs) ===== */
p.muted, .muted {
  font-size: 0.72rem !important;
  line-height: 1.15 !important;
  margin-top: 0.10rem !important;
  margin-bottom: 0.25rem !important;
}

h2 + p, h3 + p, h4 + p {
  margin-top: 0.10rem !important;
  margin-bottom: 0.25rem !important;
}

section > p, .card > p {
  margin-top: 0.10rem !important;
  margin-bottom: 0.25rem !important;
  line-height: 1.15 !important;
}


/* ===== UI CONSISTENCY: COMPACT TYPOGRAPHY + BUTTONS ===== */
body { font-size: 0.92rem !important; }

/* tighten general form text slightly */
label { font-size: 0.82rem !important; }

/* Make action areas fit 3 buttons without wasting space */
.actions{
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)) !important;
  gap: 0.35rem !important;
  margin-top: 0.25rem !important;
}

/* Unified compact button style */
button, .action, .ghost, .print, button.secondary, .action.secondary{
  width: 100% !important;            /* fill grid cell, but grid is now denser */
  padding: 0.28rem 0.45rem !important;
  margin-top: 0 !important;
  border-radius: 8px !important;
  border: 1px solid #c9c9c9 !important;
  font-size: 0.82rem !important;
  line-height: 1.05 !important;
  letter-spacing: 0.02em !important;
  box-sizing: border-box !important;
}

/* keep existing "print" color cue but with same geometry */
.print{
  border-color: #b7d6cf !important;
}

/* reduce oversized full-width action rules from earlier blocks */
button.action{ padding: 0.28rem 0.45rem !important; font-size: 0.82rem !important; border-radius:8px !important; }

/* Optional: make long labels wrap neatly */
button { white-space: normal !important; }


/* ===== FIX: do NOT force 100% width on navigation/header buttons ===== */
button { width: auto !important; }

/* Keep form/action buttons compact and full-width only inside action grids */
.actions button,
.card .actions button,
button.action, .action,
button.ghost, .ghost,
button.print, .print,
button.secondary, .secondary,
.action.secondary {
  width: 100% !important;
}

/* Explicitly protect tab/header buttons */
.tab-btn, .hdr-btn, .settings-btn, .lang-flag {
  width: auto !important;
  display: inline-flex !important;
}


/* ===== REMOVE FULL-WIDTH ACTION BUTTONS ===== */

/* Reset any previous forced 100% widths */
.actions button,
.card .actions button,
button.action, .action,
button.ghost, .ghost,
button.print, .print,
button.secondary, .secondary,
.action.secondary {
  width: auto !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

/* Make action button groups sit nicely next to each other */
.actions{
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.4rem !important;
}

/* Keep buttons compact */
button, .action, .ghost, .print, .secondary {
  padding: 0.25rem 0.55rem !important;
  font-size: 0.8rem !important;
}


/* ===== CAD-STYLE ULTRA COMPACT BUTTONS ===== */

.actions{
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.25rem !important;
  margin-top: 0.15rem !important;
}

/* Ultra tight button geometry */
button, .action, .ghost, .print, .secondary {
  padding: 0.18rem 0.45rem !important;
  font-size: 0.72rem !important;
  line-height: 1 !important;
  border-radius: 5px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  border-width: 1px !important;
}



/* ===== CAD BUTTONS: APPLY TO LEGACY BUTTON ROWS ===== */
.btnrow, .btn-row{
  display:flex !important;
  flex-wrap:wrap;
  gap:0.25rem !important;
  margin-top:0.15rem !important;
}

.btnrow button, .btn-row button{
  padding:0.18rem 0.45rem !important;
  font-size:0.72rem !important;
  line-height:1 !important;
  border-radius:5px !important;
  letter-spacing:0.04em !important;
  text-transform:uppercase !important;
}

/* Some areas use generic .btn / .btn-primary */
.btn, .btn-primary, .btn.primary{
  padding:0.18rem 0.45rem !important;
  font-size:0.72rem !important;
  line-height:1 !important;
  border-radius:5px !important;
  letter-spacing:0.04em !important;
  text-transform:uppercase !important;
}


/* ===== CAD BUTTONS V3 (cache-bust 1771420720) ===== */

/* Protect navigation/header buttons */
.tab-btn, .hdr-btn, .settings-btn, .lang-flag {
  width:auto !important;
  text-transform:none !important;
  letter-spacing:0 !important;
}

/* Apply CAD style to all tool buttons inside cards/sections (covers Cats/Flowers/Rosette/Sunburst/Piercing/Border/Starpoly/Celtic/Bangles/Pendant) */
.card button:not(.tab-btn):not(.hdr-btn):not(.settings-btn):not(.lang-flag),
section button:not(.tab-btn):not(.hdr-btn):not(.settings-btn):not(.lang-flag),
.btnrow button, .btn-row button,
button.btn, .btn button,
.btn-primary, .btn.primary {
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  padding:0.18rem 0.45rem !important;
  font-size:0.72rem !important;
  line-height:1 !important;
  border-radius:5px !important;
  letter-spacing:0.04em !important;
  text-transform:uppercase !important;
}

/* Ensure button rows are compact everywhere */
.btnrow, .btn-row, .actions {
  display:flex !important;
  flex-wrap:wrap !important;
  gap:0.25rem !important;
  margin-top:0.15rem !important;
}


/* ===== CAD BUTTONS: COVER .row CONTAINERS (e.g., Flowers) ===== */
.row{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:0.25rem !important;
  margin-top:0.15rem !important;
}
.row > button{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  padding:0.18rem 0.45rem !important;
  font-size:0.72rem !important;
  line-height:1 !important;
  border-radius:5px !important;
  letter-spacing:0.04em !important;
  text-transform:uppercase !important;
}

/* ===== DO NOT APPLY CAD BUTTON OVERRIDES TO STONE TILES ===== */
.stone-card{
  padding:0.7rem 0.7rem 0.6rem !important;
  border-radius:14px !important;
  text-transform:none !important;
  letter-spacing:0 !important;
  font-size:1rem !important;
}
.stone-card .stone-name{ font-weight:700 !important; margin-top:0.4rem !important; }
.stone-card .stone-meta{ font-size:0.9rem !important; color: rgba(0,0,0,0.65) !important; }


/* ===== BRAND LOGO IN HEADER ===== */
h1.brand{ margin:0; }
.brand-logo{
  display:block;
  max-width: 560px;
  width: min(70vw, 560px);
  height: auto;
}

/* ===== CAD BUTTONS: SAFELY SCOPE (do NOT touch stone tiles) ===== */
.card button:not(.tab-btn):not(.hdr-btn):not(.settings-btn):not(.lang-flag):not(.stone-card),
section button:not(.tab-btn):not(.hdr-btn):not(.settings-btn):not(.lang-flag):not(.stone-card),
.btnrow button:not(.stone-card), .btn-row button:not(.stone-card),
button.btn:not(.stone-card), .btn button:not(.stone-card),
.btn-primary:not(.stone-card), .btn.primary:not(.stone-card){
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  padding:0.18rem 0.45rem !important;
  font-size:0.72rem !important;
  line-height:1 !important;
  border-radius:5px !important;
  letter-spacing:0.04em !important;
  text-transform:uppercase !important;
}

/* Apply compact button-row layout to legacy wrappers */
.btnrow, .btn-row, .actions{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:0.25rem !important;
  margin-top:0.15rem !important;
}

/* Flowers uses .row; scope to cards BUT exclude stone-helper rows */
.card .row:not(.seg):not(.mini-wrap):not(.stone-helper .row){
  display:flex !important;
  flex-wrap:wrap !important;
  gap:0.25rem !important;
  margin-top:0.15rem !important;
}
.card .row > button:not(.stone-card){
  padding:0.18rem 0.45rem !important;
  font-size:0.72rem !important;
  border-radius:5px !important;
  letter-spacing:0.04em !important;
  text-transform:uppercase !important;
}

/* ===== RESTORE STONE TILES (keep them as cards, not CAD buttons) ===== */
button.stone-card{
  display:block !important;
  width:100% !important;
  text-align:left !important;
  padding:0.7rem 0.7rem 0.6rem !important;
  border-radius:14px !important;
  text-transform:none !important;
  letter-spacing:0 !important;
  line-height:1.15 !important;
  background:#fff !important;
}
button.stone-card *{
  text-transform:none !important;
  letter-spacing:0 !important;
}
button.stone-card .stone-name{ font-size:0.95rem !important; font-weight:700 !important; margin-top:0.4rem !important; }
button.stone-card .stone-meta{ font-size:0.82rem !important; color: rgba(0,0,0,0.65) !important; }



/* ===== HEADER: CENTER BRAND LOGO ===== */
.header{
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
}
.header-spacer{ display:none !important; }
.settings{ position:absolute !important; right:0.5rem !important; top:0.35rem !important; }
h1.brand{ margin:0 !important; padding:0 !important; }
.brand-logo{
  display:block;
  width:min(72vw, 620px);
  height:auto;
}

/* ===== FIX FLOWERS (and similar): card-level .row as tight button row ===== */
.card > .row{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:0.25rem !important;
  margin-top:0.15rem !important;
  align-items:center !important;
}
.card > .row > button{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  padding:0.18rem 0.45rem !important;
  font-size:0.72rem !important;
  line-height:1 !important;
  border-radius:5px !important;
  letter-spacing:0.04em !important;
  text-transform:uppercase !important;
}

/* ===== FIX STONES: hard-define stone tiles so CAD rules can't distort them ===== */
button.stone-card{
  display:flex !important;
  flex-direction:column !important;
  align-items:center !important;
  text-align:center !important;
  width:100% !important;
  padding:0.7rem 0.6rem 0.6rem !important;
  border-radius:14px !important;
  background:#fff !important;
  border:1px solid rgba(0,0,0,0.10) !important;
  cursor:pointer !important;
  text-transform:none !important;
  letter-spacing:0 !important;
  line-height:1.15 !important;
}
button.stone-card svg{ width:100% !important; max-width:140px !important; height:auto !important; display:block !important; margin:0 auto !important; }
button.stone-card .stone-name{ margin-top:0.35rem !important; font-weight:700 !important; font-size:0.92rem !important; }
button.stone-card .stone-meta{ font-size:0.82rem !important; color: rgba(0,0,0,0.65) !important; }



/* ===== HEADER V5: centered brand at top ===== */
.header{
  position: sticky;
  top: 0;
  z-index: 50;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding: 0.35rem 0.6rem !important;
}
.header-spacer{ display:none !important; }
h1.brand{ margin:0 !important; padding:0 !important; }
.brand-svg{ display:block; height:72px; width:auto; max-width:min(96vw, 980px); }
.settings{
  position:absolute !important;
  right:0.5rem !important;
  top:0.5rem !important;
}

/* ===== STONES V5: restore tile look & prevent selection height jump ===== */
.stone-grid{ gap:0.65rem !important; }
button.stone-card{
  background: rgba(62, 102, 92, 0.92) !important;
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
  border-radius: 10px !important;
  padding: 0.45rem 0.5rem !important;
  height: 104px !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
  align-items:center !important;
  gap: 0.22rem !important;
  text-transform:none !important;
  letter-spacing:0 !important;
  box-shadow: none !important;
}
button.stone-card svg{
  width: 86px !important;
  height: 34px !important;
  max-width:none !important;
  margin: 0 auto !important;
}
button.stone-card .stone-name{
  font-size: 0.78rem !important;
  font-weight: 700 !important;
  margin: 0 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase !important;
  color:#fff !important;
}
button.stone-card .stone-meta{
  font-size: 0.72rem !important;
  margin: 0 !important;
  color: rgba(255,255,255,0.85) !important;
}
.stone-card[aria-selected="true"]{
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.28) inset, 0 0 0 2px rgba(62,102,92,0.45) !important;
}
.stone-card:hover{
  transform: none !important;
  border-color: rgba(255,255,255,0.28) !important;
}

/* ===== FLOWERS V5: force CAD buttons in its row ===== */
#decor-flowers .row{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:0.25rem !important;
  align-items:center !important;
  margin-top:0.15rem !important;
}
#decor-flowers .row > button{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  padding:0.18rem 0.45rem !important;
  font-size:0.72rem !important;
  line-height:1 !important;
  border-radius:5px !important;
  letter-spacing:0.04em !important;
  text-transform:uppercase !important;
}


/* ===== HEADER V6: simple centered text logo ===== */
.header{
  position: sticky;
  top: 0;
  z-index: 50;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  padding: 0.25rem 0.6rem !important;
}
h1.brand-text{
  font-family: Georgia, "Times New Roman", serif !important;
  font-size: 1.6rem !important;
  letter-spacing: 0.22em !important;
  text-transform: uppercase !important;
  margin: 0.1rem 0 !important;
  color: rgba(0,0,0,0.78) !important;
}

/* ===== FLOWERS V6: force identical CAD style for ALL buttons in Flowers ===== */
#decor-flowers button{
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  width:auto !important;
  padding:0.18rem 0.45rem !important;
  font-size:0.72rem !important;
  line-height:1 !important;
  border-radius:5px !important;
  letter-spacing:0.04em !important;
  text-transform:uppercase !important;
}
#decor-flowers .actions, #decor-flowers .row, #decor-flowers .btnrow, #decor-flowers .btn-row{
  display:flex !important;
  flex-wrap:wrap !important;
  gap:0.25rem !important;
  margin-top:0.15rem !important;
  align-items:center !important;
}

/* ===== STONES V6: remove white gaps by coloring grid background + tightening gap ===== */
.stone-grid{
  gap:0.38rem !important;
  padding:0.38rem !important;
  background: rgba(62, 102, 92, 0.92) !important;
  border-radius: 12px !important;
}
button.stone-card{
  border-radius: 9px !important;
  border: 1px solid rgba(255,255,255,0.18) !important;
}


/* ===== STONES V7: reduce visible gaps without painting the whole grid ===== */
.stone-grid{
  gap: 0.38rem !important;
  padding: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  align-content: start !important;
  align-items: start !important;
}

button.stone-card{
  margin: 0 !important;
}

.stone-card[aria-selected="true"]{
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.28) inset !important;
}

/* ===== FLOWERS V7: force identical button height/geometry ===== */
#decor-flowers button{
  height: 28px !important;
  white-space: nowrap !important;
}


/* ===== V8: Uniform action button height (CALCULATE / PRINT LABEL / RESET) ===== */
.actions button,
.btnrow button,
.btn-row button,
.row > button{
  height: 28px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  line-height: 28px !important;   /* ensures identical visual height */
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
}


/* ===== V9: Flowers action buttons use same class as RESET ===== */
#decor-flowers .ghost{
  padding:0.18rem 0.45rem !important;
  font-size:0.72rem !important;
  line-height:1 !important;
  border-radius:5px !important;
  text-transform:uppercase !important;
  letter-spacing:0.04em !important;
}


/* ===== V11: Use image logo (transparent) same footprint as text logo ===== */
.header{
  display:flex !important;
  justify-content:center !important;
  align-items:center !important;
}
.brand-logo{
  display:block;
  height: 58px;          /* close to previous text header height */
  width: auto;
  max-width: min(92vw, 720px);
}

/* ===== V11: Remove Flowers RESET button (hide to avoid JS null issues) ===== */
#fl-resetBtn{ display:none !important; }


/* ===== V12: Center logo perfectly in header ===== */
.header{
  position: relative !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}
h1.brand{
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin: 0 !important;
}
.brand-logo{
  margin: 0 auto !important;
}

/* keep settings at top-right without affecting centering */
.settings{
  position: absolute !important;
  right: 0.5rem !important;
  top: 0.5rem !important;
}

/* Safety: ensure Flowers reset is gone */
#fl-resetBtn{ display:none !important; }


/* === SEO / multi-page nav additions (v13+) === */
:root{
  --topbar-h: 64px;
  --accent: #1FA67A;
  --accent-dark: #168A64;
  --text: #1f2430;
  --muted: #5d6777;
  --bg: #f3f5f7;
  --card: #ffffff;
  --border: rgba(31,36,48,0.10);

  --font-sans: system-ui,-apple-system,"Segoe UI",Roboto,Arial,"Noto Sans","Liberation Sans",sans-serif;
  --fs-base: 16px;
  --fs-nav: 14px;
  --pad-nav-y: 0.55rem;
  --pad-nav-x: 0.85rem;
  --radius: 12px;
}


.topbar{
  position:sticky;
  top:0;
  z-index:1002;
  background:transparent;
  padding-top: env(safe-area-inset-top);
}

.main-nav{
  display:flex;
  align-items:center;
  gap:0.5rem;
  background:var(--card);
  padding:0.45rem;
  border-radius:var(--radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.06);
  border: 1px solid var(--border);
}
.nav-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:var(--pad-nav-y) var(--pad-nav-x);
  border-radius:10px;
  text-decoration:none;
  border:0;
  background:transparent;
  color: var(--text);
  cursor:pointer;
  font: inherit;
  font-size: var(--fs-nav);
  line-height:1;
  white-space:nowrap;
  -webkit-tap-highlight-color: transparent;
}

.nav-link:hover{ filter: brightness(0.98); }
.nav-link.is-active{
  background: #ffffff;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08);
  color: var(--accent-dark);
}
.nav-link.is-active:hover{ filter:none; }

.brand{ flex: 0 0 auto; text-align:center; }
.brand-link{ display:inline-flex; align-items:center; justify-content:center; text-decoration:none; }
.brand-logo{ width: 44px; height: 44px; border-radius: 12px; }

.settings{ flex:1; justify-content:flex-end; }
.help-btn{ font-weight:600; }
.help-btn:active{ transform: translateY(1px); }

.help-menu{ min-width: 230px; }
.link-btn{ text-decoration:none; display:block; text-align:left; }

.hero{ overflow:hidden; }
.hero-grid{ display:grid; grid-template-columns: 1.2fr 0.8fr; gap:1rem; align-items:start; }
.hero-title{ font-size:clamp(1.12rem, 1.9vw, 1.32rem); margin:0 0 0.35rem; white-space:nowrap; }
.hero-lead{ margin:0.25rem 0 0.6rem; line-height:1.45; }
.hero-box{
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(0,0,0,0.02);
  border-radius: 14px;
  padding: 0.8rem;
}
.hero-kicker{ font-weight:800; letter-spacing:0.03em; text-transform:uppercase; font-size:0.82rem; color: rgba(0,0,0,0.70); }
.hero-list{ margin:0.55rem 0 0; padding-left: 1.05rem; }
.hero-list li{ margin:0.28rem 0; }

.hero-cta{ display:flex; gap:0.5rem; flex-wrap:wrap; margin-top:0.6rem; }
a.action{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:0.6rem 0.85rem;
  border-radius:12px;
  border:1px solid rgba(0,0,0,0.12);
  background:#fff;
  color: var(--text);
  text-decoration:none;
  font-weight:700;
}
a.action.primary{
  background-color:#43615B;
  color:#fff;
  border-color: rgba(0,0,0,0.06);
}
a.action:active{ transform: translateY(1px); }

.prose h1.page-title{ margin:0 0 0.25rem; font-size:1.55rem; }
.prose h2{ margin-top:1.1rem; }
.prose .toc{
  display:flex;
  flex-wrap:wrap;
  gap:0.4rem;
  margin:0.75rem 0 0.9rem;
}
.prose .toc a{
  display:inline-flex;
  padding:0.38rem 0.55rem;
  border-radius: 999px;
  border:1px solid rgba(0,0,0,0.12);
  background:#fff;
  text-decoration:none;
  color: var(--text);
  font-weight:600;
  font-size:0.9rem;
}

.h3{ margin:0 0 0.35rem; font-size:1.05rem; }
.steps{ padding-left: 1.25rem; }
.footer{
  margin: 0.9rem 0 0.3rem;
  text-align:center;
  color: rgba(0,0,0,0.60);
  font-size: 0.92rem;
}

@media (max-width: 820px){
  .hero-grid{ grid-template-columns: 1fr; }
  :root{ --topbar-h: 64px; }
}
@media (max-width: 640px){
  .main-nav{ gap:0.15rem; }
    .brand-logo{ width:40px; height:40px; }
}


.nav-help{
  position:relative;
  margin-left:auto;
  z-index:1003;
}
.nav-btn{ border:0; }


.nav-help{ margin-left:auto; position:relative; }

/* Brand */
.brand{
  flex:0 0 auto;
  margin:0;
}
.brand-link{
  display:inline-flex;
  align-items:baseline;
  gap:0.45rem;
  text-decoration:none;
  padding: 0.15rem 0.35rem;
}
.brand-mark{
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-shadow: 0 2px 8px rgba(0,0,0,0.12);
  font-size: 1.15rem;
}
.brand-name{
  font-weight: 700;
  color: var(--text);
  font-size: 1.0rem;
}

/* Tight stacking between main menu and calculator tabs */
.tabs-wrap{ margin-top: 0.35rem; }
.page-stack-tight .tabs-wrap{ margin-top: 0.15rem; }

.nav-items{ display:flex; align-items:center; gap:0.5rem; margin-left:0.25rem; flex:1; }
.nav-items .nav-link{ }

/* Help dropdown */
.settings-section{ padding:0.4rem 0.45rem; }
.settings-label{ font-size: 0.78rem; color: var(--muted); font-weight:700; letter-spacing:0.02em; text-transform:uppercase; margin-bottom:0.35rem; }
.settings-sep{ height:1px; background: var(--border); margin:0.25rem 0.35rem; }
.mini-btn{ padding: 0.45rem 0.7rem; border-radius: 10px; background: rgba(46,125,50,0.08); color: var(--accent-dark); }
.mini-btn:hover{ background: rgba(46,125,50,0.12); }
.lang-row{ display:flex; flex-wrap:wrap; gap:0.35rem; }
.lang-flag{
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  font-size: 0.82rem;
  cursor:pointer;
  font-family: var(--font-sans);
}
.lang-flag.is-active{
  border-color: rgba(46,125,50,0.45);
  background: rgba(46,125,50,0.08);
  color: var(--accent-dark);
  font-weight:700;
}


/* === Classic business UI refinements (v19) === */

/* Typography consistency */
p, li { font-size: 1rem; line-height: 1.55; }
p { margin: 0 0 0.8rem; color: var(--text); }
.muted { color: var(--muted); font-size: 0.95rem; }
.small, .hint { font-size: 0.95rem; }

/* Main menu alignment (match calculator tabs) */
.topbar { z-index: 2000; }
.main-nav { width: 100%; justify-content: flex-start; }
.brand { margin: 0; text-align: left; }
.nav-items { display: flex; align-items: center; gap: 0.5rem; margin-left: 0.75rem; }
.nav-help { margin-left: auto; position: relative; }
.settings-menu { z-index: 9999; }

/* Tight stack between main menu and calculator tabs */
.tabs-wrap { margin-top: 0.15rem; }
.page-stack-tight .tabs-wrap { margin-top: 0; }

/* Link look (no blue, no underline anywhere) */
a, a:visited { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: none; }

/* Contact form (classic business) */
.contact-form { max-width: 640px; }
.contact-form .field-label { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.25rem; display:block; }
.contact-form input, 
.contact-form textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(31,36,48,0.18);
  background: #fff;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.03);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(46,125,50,0.55);
  box-shadow: 0 0 0 3px rgba(46,125,50,0.15);
}
.contact-form .grid2 { display:grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
@media (max-width: 720px){ .contact-form .grid2{ grid-template-columns: 1fr; } }

.contact-form .actions { display:flex; align-items:center; gap: 0.75rem; margin-top: 0.85rem; }
.contact-form .action {
  width: auto;
  padding: 0.7rem 1.1rem;
  border-radius: 10px;
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(46,125,50,0.25);
}
.contact-form .action:hover { filter: brightness(0.98); }
.contact-form .action:active { transform: translateY(1px); }
.hp { position:absolute; left:-9999px; width:1px; height:1px; overflow:hidden; }


/* ===== v20 Classic UI fixes ===== */
*, *::before, *::after { box-sizing: border-box; }

html, body { overflow-x: hidden; }

.topbar { background: transparent; overflow: visible; }
.main-nav { width: 100%; box-sizing: border-box; justify-content: flex-start; overflow: visible; }
.nav-items { flex: 0 1 auto; }
.nav-help { margin-left: auto; }

/* Ensure dropdown is clickable & above calculator tabs */
.settings-menu { z-index: 9999 !important; }
.tabs, .mobile-tabs { position: relative; z-index: 1; }

/* Typography normalization */
body { font-size: var(--fs-base); line-height: 1.55; }
main.container p,
main.container li,
main.container a,
main.container label,
main.container input,
main.container textarea,
main.container button { font-size: 1rem; }

main.container p {
  display: block !important;
  position: static !important;
  margin: 0.65rem 0 !important;
  color: var(--text);
  line-height: 1.6;
}

/* Muted helper text */
.muted, .subtle, .help-note {
  font-size: 0.92rem;
  color: var(--muted);
}

/* Links: green, no underline everywhere */
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: none; }
a:visited { color: var(--accent); }

/* Align header with page content on wide screens */
@media (min-width: 900px){
  .container { padding-left: 0; padding-right: 0; }
}


/* Header brand left aligned */
.brand { text-align: left !important; }


/* ===== V21 Overrides: alignment, dropdown, typography consistency ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: hidden; }

body{
  font-family: var(--font-sans) !important;
  font-size: var(--fs-base) !important;
}

/* Ensure header aligns with page content and never overflows */
.topbar{ z-index: 2000 !important; }
.topbar .container{ max-width: 980px; margin: 0 auto; }
.main-nav{
  width: 100%;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: nowrap;
  overflow: visible;
}
.brand{ margin: 0; text-align: left !important; }
.brand-link{ justify-content: flex-start !important; }

.nav-items{
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Keep Help always far right */
.nav-help{
  margin-left: auto !important;
  position: relative;
}

/* Dropdown must appear above calculator tabs */
.settings-menu{
  z-index: 10000 !important;
}

/* Calculator tabs must never overlap header */
.tabs{
  z-index: 20;
  top: calc(var(--topbar-h, 72px) + env(safe-area-inset-top) + 6px) !important;
}

/* Tighten spacing between header and tabs on /app/ */
body.is-calculator main.container{ padding-top: 0 !important; }
body.is-calculator .tabs{ margin-top: 0.25rem !important; }

/* Typography normalization */
main.container{
  font-size: 1rem;
  line-height: 1.55;
}
main.container p,
main.container li,
main.container label,
main.container input,
main.container textarea{
  font-size: 1rem !important;
  line-height: 1.55 !important;
}
main.container h1{ font-size: 1.6rem !important; line-height: 1.2; }
main.container h2{ font-size: 1.25rem !important; line-height: 1.25; }
main.container h3{ font-size: 1.08rem !important; line-height: 1.3; }

/* Link styling (business look) */
main.container a{
  color: var(--accent) !important;
  text-decoration: none !important;
}
main.container a:hover{
  color: var(--accent-dark) !important;
  text-decoration: none !important;
}


/* ===== V22 Fixes: brand centering bug, nav overflow, link/button consistency ===== */
html, body { overflow-x: hidden !important; }
*, *::before, *::after { box-sizing: border-box; }

.topbar .container{ max-width: 980px; margin: 0 auto; padding-left: 0; padding-right: 0; }

/* Ensure brand does NOT take full width (fixes nav pushed off-screen) */
.brand{
  width: auto !important;
  display: block !important;
  justify-content: flex-start !important;
  align-items: baseline !important;
  text-align: left !important;
}

/* Keep nav content inside the pill and aligned left */
.main-nav{
  width: 100% !important;
  justify-content: flex-start !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
}

/* Nav items should sit right after the brand, not pushed away */
.nav-items{
  flex: 0 1 auto !important;
  margin-left: 0.35rem !important;
}

/* Help at far right */
.nav-help{ margin-left: auto !important; }

/* Dropdown should work even without JS */
.settings-menu{ z-index: 9999 !important; }
.nav-help:hover .settings-menu,
.nav-help:focus-within .settings-menu{
  display: block !important;
}

/* Fix CTA button colors */
a.action{
  color: var(--text) !important;
  text-decoration: none !important;
}
a.action.primary{
  background: var(--accent) !important;
  color: #fff !important;
  border-color: rgba(0,0,0,0.06) !important;
}
a.action.primary:hover{ filter: brightness(0.96); }

/* Typography hard normalization (consistent paragraphs) */
main.container p,
main.container li,
main.container label{
  font-size: 1rem !important;
  line-height: 1.55 !important;
}



/* === Clean UI v3: prevent tab overlap + hover label contrast === */
.tabs-wrap{ position: static !important; }
.tabs{
  position: static !important;
  top: auto !important;
  margin: 0.35rem 0 0.75rem !important;
  box-shadow: none !important;
}
.tab-btn{
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.tab-btn:hover{
  color: #fff !important;
}
.tab-btn:hover:not([aria-selected="true"]){
  background: #1FA67A !important; /* menu green */
  border-color: #1FA67A !important;
}
/* selected already green; ensure text white */
.tab-btn[aria-selected="true"]{
  color: #fff !important;
}



/* === Forums embedding === */
.forum-frame-wrap{
  padding-top: 8px;
  padding-bottom: 8px;
}
.forum-frame{
  width: 100%;
  height: calc(100vh - 120px);
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}
/* Dropdown open state */
.dropdown.open .dropdown-menu{ display:block; }
/* Ensure dropdown sits above iframe */
.dropdown-menu{ position:absolute; z-index: 10000; }


/* === Fix Forums header width === */
.topbar .main-nav{
  max-width: 1100px;
  margin: 0 auto;
}


/* === Forums page iframe === */
.page-forums .forum-frame-wrap{ padding-top: 12px; padding-bottom: 12px; }
.page-forums .forum-frame{
  width: 100%;
  height: calc(100vh - 160px);
  border: 0;
  border-radius: 12px;
  background: #fff;
}
/* Keep dropdown above iframe */
.page-forums .nav-help{ position: relative; z-index: 10001; }
.page-forums .help-menu{ z-index: 10002; }


/* === Forums iframe sizing (v7) === */
.forum-frame-wrap{
  padding: 12px 0 !important;
}
.forum-frame{
  display: block !important;
  width: 100% !important;
  min-width: 100% !important;
  height: calc(100vh - 140px) !important; /* header + breathing room */
  min-height: 720px !important;
  border: 0 !important;
  border-radius: 12px !important;
  background: #fff !important;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08) !important;
}
@media (max-width: 800px){
  .forum-frame{ min-height: 560px !important; height: calc(100vh - 120px) !important; }
}


/* === Simplicity Green (phpBB) alignment === */
:root{
  --simp-green: #1fa67a;
  --simp-green-dark: #179068;
  --simp-green-light: #62c9a7;
  --simp-orange: #d06d3c;
  --simp-bg: #f4f4f4;
  --simp-panel: #ffffff;
  --simp-border: #dbdbdb;
  --simp-text: #141414;
  --simp-muted: #666666;
  --simp-radius: 3px;
  --simp-shadow: 1px 1px 3px rgba(0,0,0,0.10);
}

/* Typography + density */
body{
  font-family: "Droid Sans","Open Sans","Trebuchet MS",Verdana,Helvetica,Arial,sans-serif !important;
  color: var(--simp-text);
  background-color: var(--simp-bg);
  font-size: 14px;
  line-height: 1.45;
}

.container{
  max-width: 1100px;
}

h1,h2,h3{
  font-weight: 700;
  letter-spacing: 0;
}

/* Top header */
.topbar{
  background: transparent;
  padding: 10px 0;
}
.topbar .container{
  background: var(--simp-panel);
  border: 1px solid var(--simp-border);
  border-radius: 14px;
  box-shadow: var(--simp-shadow);
  padding: 10px 14px;
}

/* Nav links */
.nav-links .nav-link{
  color: var(--simp-green) !important;
  padding: 6px 10px;
  border-radius: var(--simp-radius);
}
.nav-links .nav-link:hover{
  background: #eaf7f2;
  color: var(--simp-green-dark) !important;
}
.nav-links .nav-link.active{
  background: #eaf7f2;
  border: 1px solid #bfe9db;
  color: var(--simp-green-dark) !important;
}

/* Help button */
.help-btn, .help button, .help .help-btn{
  background: var(--simp-green) !important;
  color: #fff !important;
  border: 1px solid var(--simp-green-dark) !important;
  border-radius: var(--simp-radius) !important;
  padding: 6px 10px !important;
}
.help-btn:hover, .help button:hover{
  background: var(--simp-green-dark) !important;
}

/* Dropdown */
.dropdown-menu{
  border: 1px solid var(--simp-border);
  border-radius: var(--simp-radius);
  box-shadow: var(--simp-shadow);
}
.dropdown-menu a{
  color: var(--simp-text);
}
.dropdown-menu a:hover{
  background: #eaf7f2;
  color: var(--simp-green-dark);
}

/* Calculator tabs - match phpBB green bar */
.tabs-wrap, .tabs{
  background: var(--simp-panel);
  border: 1px solid var(--simp-border);
  border-radius: 14px;
  box-shadow: var(--simp-shadow);
}
.tabs, .tabs-row{
  padding: 8px 10px;
  margin: 10px 0 6px 0;
}
.tab-btn, .tabs a, .tabs button{
  background: #3d5f57 !important; /* fallback if old classes */
  background: var(--simp-green) !important;
  border: 1px solid var(--simp-green-dark) !important;
  color: #fff !important;
  border-radius: var(--simp-radius) !important;
  padding: 4px 10px !important;
  font-weight: 700;
  font-size: 13px;
}
.tab-btn:hover, .tabs a:hover, .tabs button:hover{
  background: var(--simp-green-dark) !important;
  color: #fff !important;
}
.tab-btn.active, .tabs a.active, .tabs button.active{
  background: var(--simp-green-dark) !important;
  border-color: var(--simp-green-dark) !important;
}

/* Cards/sections */
section, .card, .panel, fieldset{
  border-radius: var(--simp-radius) !important;
}
fieldset{
  border: 1px solid var(--simp-border) !important;
}
legend{
  padding: 0 6px;
  font-weight: 700;
}

/* Inputs */
input[type="text"], input[type="number"], select, textarea{
  border-radius: var(--simp-radius) !important;
  border: 1px solid var(--simp-border) !important;
  padding: 7px 10px !important;
  font-size: 14px !important;
}
input:focus, select:focus, textarea:focus{
  outline: none !important;
  border-color: var(--simp-green) !important;
  box-shadow: 0 0 0 2px rgba(31,166,122,0.15);
}

/* Buttons - global */
button, .btn, .action, .ghost, .print{
  border-radius: var(--simp-radius) !important;
  font-weight: 700;
  padding: 7px 10px !important;
  font-size: 13px !important;
}
button.action, .action{
  background: var(--simp-green) !important;
  border: 1px solid var(--simp-green-dark) !important;
  color: #fff !important;
}
button.action:hover, .action:hover{
  background: var(--simp-green-dark) !important;
}
button.print, .print{
  background: var(--simp-green-light) !important;
  border: 1px solid #34ae86 !important;
  color: var(--simp-text) !important;
}
button.print:hover, .print:hover{
  background: #34ae86 !important;
  color: #fff !important;
}
button.ghost, .ghost, button.reset, .reset{
  background: #f8f8f8 !important;
  border: 1px solid var(--simp-border) !important;
  color: var(--simp-text) !important;
}
button.ghost:hover, .ghost:hover{
  background: #ededed !important;
}

/* Links */
a{ color: var(--simp-green); text-decoration: none; }
a:hover{ color: var(--simp-green-dark); text-decoration: underline; }

/* Forums iframe: keep same card feel */
.forum-frame{
  border-radius: 14px !important;
  border: 1px solid var(--simp-border) !important;
}

/* Reduce vertical whitespace */
main.container{ padding-top: 8px !important; }
section{ margin-bottom: 14px !important; padding: 12px !important; }


/* === Simplicity alignment touch-ups (override JS-injected legacy CSS) === */
/* Header pills / small buttons used inside calculators (e.g., Sacred Geometry) */
.header-controls .pill,
.header-controls button,
button.hdr-btn,
.hdr-btn,
.pill{
  background: var(--simp-green) !important;
  border: 1px solid var(--simp-green-dark) !important;
  color: #fff !important;
  border-radius: var(--simp-radius) !important;
}
.header-controls .pill:hover,
.header-controls button:hover,
button.hdr-btn:hover,
.hdr-btn:hover,
.pill:hover{
  background: var(--simp-green-dark) !important;
  color: #fff !important;
}

/* Units toggle */
#units-toggle{
  background: var(--simp-green) !important;
  border: 1px solid var(--simp-green-dark) !important;
  color: #fff !important;
}
#units-toggle:hover{ background: var(--simp-green-dark) !important; color:#fff !important; }

/* Language buttons in Help dropdown */
.lang-btn,
.lang-flag{
  background: var(--simp-green) !important;
  border: 1px solid var(--simp-green-dark) !important;
  color: #fff !important;
  border-radius: var(--simp-radius) !important;
}
.lang-btn:hover,
.lang-flag:hover{
  background: var(--simp-green-dark) !important;
  color: #fff !important;
}
.lang-flag.is-active{
  background: var(--simp-green-dark) !important;
  border-color: var(--simp-green-dark) !important;
  color: #fff !important;
}

        
/* === Logo integration === */
.site-logo{
  height: 48px;
  width: auto;
  display: block;
}


/* === Landing: Split hero + feature cards (v13) === */
.hero-card{
  background: #fff;
  border: 1px solid var(--simp-border);
  border-radius: 14px;
  box-shadow: var(--simp-shadow);
  padding: 22px 22px 18px;
  margin: 14px 0 18px;
}
.hero-split{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 28px;
}
.hero-left{ flex: 1; min-width: 320px; }
.hero-left h1{
  font-size: 36px;
  line-height: 1.12;
  margin: 0 0 10px;
  font-weight: 800;
  color: var(--simp-text);
}
.hero-sub{
  font-size: 16px;
  color: var(--simp-muted);
  margin: 0 0 16px;
  max-width: 52ch;
}
.hero-cta{ display:flex; gap: 10px; flex-wrap: wrap; align-items:center; }
.hero-btn{
  font-size: 14px !important;
  text-transform: none !important;
  background: var(--simp-green) !important;
  border: 1px solid var(--simp-green-dark) !important;
  color: #fff !important;
  padding: 10px 14px !important;
  border-radius: var(--simp-radius) !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  display:inline-flex;
  align-items:center;
}
.hero-btn:hover{ background: var(--simp-green-dark) !important; }

.hero-right{ flex: 1; display:flex; justify-content:flex-end; }
.hero-svg{
  width: min(460px, 100%);
  height: auto;
  border-radius: 12px;
  background: #fbfbfb;
  border: 1px solid #efefef;
}

.feature-grid{
  display:grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.feature{
  display:flex;
  gap: 10px;
  align-items:flex-start;
  padding: 10px 10px;
  border: 1px solid #e7e7e7;
  border-radius: var(--simp-radius);
  background: #fcfcfc;
}
.feature .dot{
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--simp-green);
  margin-top: 6px;
  flex: 0 0 auto;
}
.feature h3{
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 900;
  color: var(--simp-text);
  border: 0;
  padding: 0;
}
.feature p{
  margin: 0;
  font-size: 12.5px;
  color: var(--simp-muted);
}

@media (max-width: 980px){
  .hero-split{ flex-direction: column; align-items:flex-start; }
  .hero-right{ width: 100%; justify-content:center; }
  .feature-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .hero-left h1{ font-size: 28px; }
  .feature-grid{ grid-template-columns: 1fr; }
}

/* Screen-reader only text */
.sr-only{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0,0,0,0) !important;
  white-space:nowrap !important;
  border:0 !important;
}
.site-logo{ height: 44px; width:auto; display:block; }

/* Hero without illustration */
.hero-split{ justify-content:flex-start; }
.hero-left{ max-width: 720px; }

/* v16 safety: hide accidental empty CTA buttons */
.hero-cta a:empty, .hero-cta button:empty, a.btn:empty, button.btn:empty { display:none !important; }


/* === Landing polish (v18) === */
.hero-card, .hero-split, .hero-left { text-align: left; }
.hero-left h1 { margin-left: 0; margin-right: 0; }

/* Keep subtitle on one line on desktop */
@media (min-width: 900px){
  .hero-sub{
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 72ch;
  }
}

.hero-card a.hero-btn:empty, .hero-card a.btn-primary:empty { display:none !important; }


/* === v20: Force landing hero heading left === */
.hero-card,
.hero-split,
.hero-left {
    text-align: left !important;
}

.hero-left h1 {
    text-align: left !important;
}


/* === v21: Make calculator tabs match main menu pills === */
.tabs{
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.06) !important;
}
.tabs .tab-btn{
  background: transparent !important;
  border: 0 !important;
  color: var(--text) !important;
  font-weight: 500 !important;
}
.tabs .tab-btn:hover{
  filter: brightness(0.98);
}
.tabs .tab-btn[aria-selected="true"]{
  background: #ffffff !important;
  box-shadow: 0 6px 14px rgba(0,0,0,0.08) !important;
  color: var(--accent-dark) !important;
  font-weight: 600 !important;
}


/* === v23: Embedded apps (forums/gallery) === */
.embed-wrap{
  width: 100%;
}
.embed-frame{
  width: 100%;
  min-height: 78vh;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}
@media (max-width: 800px){
  .embed-frame{ min-height: 82vh; border-radius: 12px; }
}


/* ============================================
   SANDA FINAL FIX – MENU + ALIGNMENT
   ============================================ */

/* MENU CONTAINER */
.tabs,
.tab-bar,
.category-tabs {
  position: sticky;
  top: 0;
  z-index: 999;
  background: #1a1410 !important;
  padding: 8px 20px 8px 28px !important;
  border-bottom: 1px solid #3d3028;
  box-shadow: none !important;
}

/* REMOVE WHITE BACKGROUND */
.tabs,
.tab-bar,
.category-tabs,
.tabs * {
  background: transparent !important;
}

/* MENU ITEMS */
.tabs button,
.tab-bar button,
.category-tabs button,
.tab-btn,
[role="tab"] {
  color: #a89880 !important;
  font-family: 'Outfit', sans-serif !important;
  font-size: 12px !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  padding: 6px 4px !important;
  margin-right: 16px !important;
  border: none !important;
  border-bottom: 1px solid transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

/* ACTIVE */
.tabs button[aria-selected="true"],
.tab-bar button[aria-selected="true"],
.category-tabs button[aria-selected="true"],
.tab-btn[aria-selected="true"],
[role="tab"][aria-selected="true"] {
  color: #c9a84c !important;
  border-bottom: 1px solid #c9a84c !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* HOVER */
.tabs button:hover,
.tab-bar button:hover,
.category-tabs button:hover,
.tab-btn:hover,
[role="tab"]:hover {
  color: #e8c96a !important;
  background: transparent !important;
}

/* REMOVE TOP GAP INSIDE APP */
body,
#root,
.app-container,
main,
.container {
  margin-top: 0 !important;
  padding-top: 0 !important;
}


/* REMOVE THIN LINE ABOVE TABS */
.topbar,
.main-nav {
  border-bottom: none !important;
  box-shadow: none !important;
}

/* OPTIONAL: TIGHTER SPACING */
.tabs {
  margin-top: -4px !important;
}
