/* ==========================================================================
   ACH Calculator — isolated styles
   --------------------------------------------------------------------------
   Conflict rules this file follows, so it can drop into the live store safely:

   1. Every class is prefixed `ach-`, so no store class name can ever match
      one of ours (and ours can never match the store's).
   2. Every rule is scoped under `.ach-calculator`, so nothing here can style
      anything outside the calculator block.
   3. The reset below (`all: revert`) strips inherited theme styling off every
      element inside the block, so the store's global rules for button/input/
      h1/p/a don't bleed in. It's a one-way firewall, not a global reset — it
      touches only elements inside `.ach-calculator`.
   4. Custom properties are declared on `.ach-calculator`, not `:root`, so
      they can't collide with the theme's variables.
   ========================================================================== */

/* --- 1. Style firewall: neutralize inherited theme CSS inside the block --- */
.ach-calculator,
.ach-calculator *,
.ach-calculator *::before,
.ach-calculator *::after{
  all: revert;          /* drop the theme's author styles back to browser defaults */
  box-sizing: border-box;
}

/* --- 2. Block root --- */
.ach-calculator{
  --ach-bg:#F5F7F6;
  --ach-surface:#FFFFFF;
  --ach-ink:#1B2B2A;
  --ach-ink-soft:#4B5D5A;
  --ach-line:#DCE4E1;
  --ach-teal:#2F6F6B;
  --ach-teal-dark:#1F4F4C;
  --ach-teal-tint:#E7F0EF;
  --ach-amber:#C9722A;
  --ach-amber-tint:#FBEEE1;

  display:block;
  max-width:880px;
  margin:0 auto;
  padding:48px 24px 80px;
  background:var(--ach-bg);
  color:var(--ach-ink);
  font-family:'IBM Plex Sans',sans-serif;
  font-size:16px;
  line-height:1.55;
  text-align:left;
}

/* --- 3. Typography --- */
.ach-calculator .ach-h1,
.ach-calculator .ach-h2,
.ach-calculator .ach-h3{
  font-family:'Space Grotesk',sans-serif;
  margin:0;
  color:var(--ach-teal-dark);
}
.ach-calculator .ach-h1{font-size:34px;font-weight:700;letter-spacing:-0.01em;}
.ach-calculator .ach-h2{font-size:22px;font-weight:700;margin-bottom:8px;}
.ach-calculator .ach-h3{font-size:16.5px;font-weight:600;margin-top:22px;margin-bottom:6px;}

.ach-calculator .ach-eyebrow{
  font-family:'IBM Plex Mono',monospace;
  font-size:12px;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--ach-teal);
  font-weight:600;
  margin-bottom:10px;
}
.ach-calculator .ach-sub{
  color:var(--ach-ink-soft);
  font-size:16px;
  max-width:60ch;
  margin:12px 0 0;
}
.ach-calculator .ach-strong{font-weight:700;}

/* --- 4. Mode toggle --- */
.ach-calculator .ach-toggle{
  display:flex;
  gap:2px;
  background:var(--ach-line);
  border-radius:10px;
  padding:3px;
  margin:32px 0 24px;
  max-width:460px;
}
.ach-calculator .ach-toggle-btn{
  flex:1;
  border:none;
  background:transparent;
  padding:11px 14px;
  margin:0;
  font-family:'IBM Plex Sans',sans-serif;
  font-weight:600;
  font-size:14px;
  line-height:1.4;
  color:var(--ach-ink-soft);
  border-radius:8px;
  cursor:pointer;
  text-transform:none;
  letter-spacing:normal;
  width:auto;
  height:auto;
  min-height:0;
  transition:background .15s ease, color .15s ease;
}
.ach-calculator .ach-toggle-btn.ach-is-active{
  background:var(--ach-surface);
  color:var(--ach-teal-dark);
  box-shadow:0 1px 2px rgba(27,43,42,.12);
}

/* --- 5. Calculator card --- */
.ach-calculator .ach-card{
  background:var(--ach-surface);
  border:1px solid var(--ach-line);
  border-radius:16px;
  padding:32px;
}
.ach-calculator .ach-panel.ach-is-hidden{display:none;}

.ach-calculator .ach-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:20px;
}

/* --- 6. Fields --- */
.ach-calculator .ach-field{margin-bottom:6px;}
.ach-calculator .ach-label{
  display:block;
  font-family:'IBM Plex Sans',sans-serif;
  font-size:13px;
  font-weight:600;
  color:var(--ach-ink-soft);
  margin-bottom:6px;
  text-transform:none;
  letter-spacing:normal;
}
.ach-calculator .ach-mini-label{
  display:block;
  font-family:'IBM Plex Sans',sans-serif;
  font-size:11px;
  font-weight:600;
  color:var(--ach-ink-soft);
  margin-bottom:5px;
  text-transform:none;
  letter-spacing:normal;
}
.ach-calculator .ach-input-row{position:relative;}
.ach-calculator .ach-input{
  -webkit-appearance:none;
  appearance:none;
  display:block;
  width:100%;
  height:auto;
  margin:0;
  font-family:'IBM Plex Mono',monospace;
  font-size:17px;
  font-weight:500;
  line-height:1.4;
  color:var(--ach-ink);
  background:var(--ach-bg);
  border:1.5px solid var(--ach-line);
  border-radius:9px;
  padding:11px 44px 11px 13px;
  outline:none;
  box-shadow:none;
  transition:border-color .15s ease;
}
.ach-calculator .ach-input:focus{
  border-color:var(--ach-teal);
  box-shadow:none;
  outline:none;
}
.ach-calculator .ach-unit{
  position:absolute;
  right:13px;
  top:50%;
  transform:translateY(-50%);
  font-family:'IBM Plex Mono',monospace;
  font-size:12px;
  color:var(--ach-ink-soft);
  pointer-events:none;
}
.ach-calculator .ach-hint{
  font-size:12.5px;
  color:var(--ach-ink-soft);
  margin-top:6px;
}
.ach-calculator .ach-note-star{
  color:var(--ach-amber);
  font-weight:700;
  margin-left:1px;
}

/* --- 7. Delivered-CFM warning inside the card --- */
.ach-calculator .ach-important-note{
  grid-column:1 / -1;
  display:flex;
  gap:10px;
  background:var(--ach-amber-tint);
  border:1px solid #EAD2B8;
  border-left:3px solid var(--ach-amber);
  border-radius:9px;
  padding:12px 14px;
  font-size:13px;
  color:#5C3B1A;
  margin-top:2px;
}
.ach-calculator .ach-important-note .ach-note-star{font-size:15px;line-height:1.4;}
.ach-calculator .ach-important-note .ach-link{
  color:var(--ach-amber);
  font-weight:600;
  text-decoration:none;
}
.ach-calculator .ach-important-note .ach-link:hover{text-decoration:underline;}

/* --- 8. L × W × H helper --- */
.ach-calculator .ach-helper-toggle{
  display:block;
  color:var(--ach-teal);
  font-weight:600;
  text-decoration:none;
  cursor:pointer;
  margin-top:4px;
}
.ach-calculator .ach-helper-toggle:hover{text-decoration:underline;}
.ach-calculator .ach-helper-box{
  margin-top:12px;
  padding:16px;
  background:var(--ach-bg);
  border:1px dashed var(--ach-line);
  border-radius:10px;
}
.ach-calculator .ach-helper-box.ach-is-hidden{display:none;}
.ach-calculator .ach-helper-grid{
  display:grid;
  grid-template-columns:1fr 1fr 1fr;
  gap:12px;
}
.ach-calculator .ach-helper-note{
  font-size:12px;
  color:var(--ach-ink-soft);
  margin-top:10px;
}

/* --- 9. Result panel --- */
.ach-calculator .ach-result{
  margin-top:28px;
  background:var(--ach-teal-tint);
  border:1px solid #C9DEDB;
  border-radius:12px;
  padding:22px 24px;
}
.ach-calculator .ach-result-label{
  font-family:'IBM Plex Mono',monospace;
  font-size:12px;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--ach-teal-dark);
  font-weight:600;
}
.ach-calculator .ach-result-value{
  font-family:'Space Grotesk',sans-serif;
  font-size:40px;
  font-weight:700;
  color:var(--ach-teal-dark);
  margin-top:4px;
  line-height:1.1;
}
.ach-calculator .ach-result-unit{
  font-size:18px;
  font-weight:600;
  color:var(--ach-ink-soft);
}
.ach-calculator .ach-formula-trace{
  margin-top:12px;
  font-family:'IBM Plex Mono',monospace;
  font-size:13.5px;
  color:var(--ach-ink-soft);
  padding-top:12px;
  border-top:1px dashed #C9DEDB;
}

/* --- 10. Formula readout --- */
.ach-calculator .ach-formula-box{
  margin-top:36px;
  font-family:'IBM Plex Mono',monospace;
  background:var(--ach-ink);
  color:#EAF3F1;
  border-radius:12px;
  padding:22px 24px;
  font-size:14.5px;
}
.ach-calculator .ach-fname{
  display:block;
  color:#8FD1CB;
  font-weight:600;
  margin-bottom:8px;
}

/* --- 11. Explainer copy --- */
.ach-calculator .ach-explainer{margin-top:44px;}
.ach-calculator .ach-body{
  color:var(--ach-ink-soft);
  font-size:15.5px;
  max-width:68ch;
  margin:0 0 1em;
}

/* --- 12. Fan CFM vs delivered CFM diagram --- */
.ach-calculator .ach-flow-demo{
  display:flex;
  align-items:center;
  gap:0;
  margin:28px 0;
  background:var(--ach-surface);
  border:1px solid var(--ach-line);
  border-radius:14px;
  padding:26px 24px;
}
.ach-calculator .ach-flow-col{flex:1;text-align:center;}
.ach-calculator .ach-flow-cap{
  font-family:'IBM Plex Mono',monospace;
  font-size:11.5px;
  letter-spacing:.06em;
  text-transform:uppercase;
  color:var(--ach-ink-soft);
}
.ach-calculator .ach-flow-num{
  font-family:'Space Grotesk',sans-serif;
  font-weight:700;
  font-size:26px;
}
.ach-calculator .ach-flow-num--fan{color:var(--ach-ink-soft);}
.ach-calculator .ach-flow-num--delivered{color:var(--ach-teal-dark);}
.ach-calculator .ach-flow-bar-track{
  height:14px;
  background:#EEF2F1;
  border-radius:7px;
  overflow:hidden;
  margin:14px 0 10px;
}
.ach-calculator .ach-flow-bar{
  height:100%;
  border-radius:7px;
}
.ach-calculator .ach-flow-bar--fan{width:100%;background:#C9D2D0;}
.ach-calculator .ach-flow-bar--delivered{width:62.5%;background:var(--ach-teal);}
.ach-calculator .ach-flow-arrow{
  font-size:22px;
  color:var(--ach-ink-soft);
  padding:0 18px;
}
.ach-calculator .ach-flow-note{
  font-family:'IBM Plex Mono',monospace;
  font-size:11px;
  color:var(--ach-ink-soft);
  margin-top:2px;
}

/* --- 13. Callouts --- */
.ach-calculator .ach-callout{
  background:var(--ach-amber-tint);
  border:1px solid #EAD2B8;
  border-left:4px solid var(--ach-amber);
  border-radius:10px;
  padding:16px 20px;
  font-size:14.5px;
  color:#5C3B1A;
  margin-top:18px;
}
.ach-calculator .ach-callout .ach-strong{color:var(--ach-amber);}

.ach-calculator .ach-caution{
  font-size:13.5px;
  color:var(--ach-ink-soft);
  font-style:italic;
  margin:16px 0 0;
  max-width:68ch;
}
.ach-calculator .ach-caution + .ach-caution{margin-top:8px;}

/* --- 14. Footer --- */
.ach-calculator .ach-footer{
  margin-top:56px;
  padding-top:24px;
  border-top:1px solid var(--ach-line);
  font-size:14px;
  color:var(--ach-ink-soft);
}
.ach-calculator .ach-footer .ach-link{
  color:var(--ach-teal-dark);
  font-weight:600;
  text-decoration:none;
}
.ach-calculator .ach-footer .ach-link:hover{text-decoration:underline;}

/* --- 15. Responsive --- */
@media (max-width:600px){
  .ach-calculator{padding:32px 16px 56px;}
  .ach-calculator .ach-grid{grid-template-columns:1fr;}
  .ach-calculator .ach-card{padding:22px;}
  .ach-calculator .ach-flow-demo{flex-direction:column;gap:12px;}
  .ach-calculator .ach-flow-arrow{transform:rotate(90deg);padding:0;}
}
