/* =========================================================
   Survey Calculator Hub
   ========================================================= */
.calculator-page { padding-top: 80px; }

.calculator-hero {
  padding: 90px 0 55px;
  background: var(--bg-light);
  text-align: center;
}

.calculator-hero .section-label {
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .8rem;
}

.calculator-hero h1 { margin: 10px auto 15px; max-width: 800px; }
.calculator-hero p { max-width: 700px; margin: 0 auto; color: var(--text-muted); }

.calculator-grid-section { padding: 70px 0 90px; }

/* Each category is a separate, full-width section. */
.calculator-categories {
  display: flex;
  flex-direction: column;
  gap: 58px;
}

.calculator-category { width: 100%; }

.calculator-category-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 22px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border);
}

.calculator-category-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(249,115,22,.1);
  font-size: 23px;
}

.calculator-category-heading h2 {
  margin: 0 0 3px;
  font-size: 1.35rem;
}

.calculator-category-heading p {
  margin: 0;
  color: var(--text-muted);
  font-size: .9rem;
}

.calculator-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  align-items: stretch;
}

.calculator-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 220px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-white);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.calculator-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.calculator-card-icon {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(249,115,22,.12);
  color: var(--primary);
  margin-bottom: 20px;
}

.calculator-card h2 { font-size: 1.25rem; margin: 0 0 8px; }
.calculator-card p { color: var(--text-muted); font-size: .92rem; margin: 0 0 20px; }

.calculator-card-link {
  margin-top: auto;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.calculator-card-link span { transition: transform var(--transition-fast); }
.calculator-card:hover .calculator-card-link span { transform: translateX(4px); }

/* Featured professional-fee calculator */
.fee-calculator-card {
  border-color: rgba(249,115,22,.38);
  background: linear-gradient(180deg, var(--bg-white), rgba(249,115,22,.035));
}

.fee-calculator-card .calculator-card-icon { background: var(--primary); color: #fff; }

/* Floating calculator button, retained for pages that use it. */
.calculator-float {
  position: fixed;
  top: 105px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.calculator-float-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.22);
  transition: transform .25s ease, box-shadow .25s ease;
}

.calculator-float-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.calculator-float-text {
  order: -1;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--bg-white);
  color: var(--text-dark);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 5px 20px rgba(0,0,0,.14);
  opacity: 0;
  visibility: hidden;
  transform: translateX(8px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease;
  border: 1px solid var(--border);
}

.calculator-float:hover .calculator-float-text,
.calculator-float:focus-visible .calculator-float-text { opacity: 1; visibility: visible; transform: translateX(0); }
.calculator-float:hover .calculator-float-icon,
.calculator-float:focus-visible .calculator-float-icon { transform: scale(1.08); box-shadow: 0 10px 28px rgba(0,0,0,.28); }
html.theme-dark .calculator-float-icon { color: #fff; }

/* Services → Fee Estimator */
.fee-estimator-promo { padding-top: 10px; padding-bottom: 70px; }

.fee-estimator-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 38px 44px;
  border: 1px solid rgba(249,115,22,.25);
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(249,115,22,.08), var(--bg-white));
  box-shadow: var(--shadow-md);
}

.fee-estimator-content { max-width: 820px; }
.fee-estimator-content .section-label { margin-bottom: 7px; }
.fee-estimator-content h2 { margin-bottom: 10px; font-size: clamp(1.5rem, 3vw, 2.15rem); }
.fee-estimator-content p { margin-bottom: 20px; color: var(--text-muted); max-width: 700px; }
.fee-estimator-content .btn span { margin-left: 7px; transition: transform var(--transition-fast); }
.fee-estimator-content .btn:hover span { transform: translateX(4px); }

.fee-estimator-icon {
  width: 92px;
  height: 92px;
  flex: 0 0 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 24px;
  background: var(--primary);
  color: #fff;
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(249,115,22,.22);
}

@media (max-width: 1000px) {
  .calculator-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .calculator-page { padding-top: 70px; }
  .calculator-hero { padding: 65px 0 40px; }
  .calculator-grid-section { padding: 45px 0 65px; }
  .calculator-categories { gap: 42px; }
  .calculator-category-heading { gap: 12px; }
  .calculator-category-icon { width: 42px; height: 42px; flex-basis: 42px; font-size: 20px; }
  .calculator-category-heading h2 { font-size: 1.15rem; }
  .calculator-grid { grid-template-columns: 1fr; gap: 16px; }
  .calculator-card { min-height: 190px; padding: 22px; }
  .calculator-float { top: 88px; right: 16px; }
  .calculator-float-icon { width: 54px; height: 54px; }
  .calculator-float-icon svg { width: 28px; height: 28px; }
  .calculator-float-text { display: none; }
  .fee-estimator-banner { padding: 28px 24px; align-items: flex-start; }
  .fee-estimator-icon { width: 64px; height: 64px; flex-basis: 64px; border-radius: 18px; font-size: 1.8rem; }
}

@media (max-width: 520px) {
  .fee-estimator-banner { display: block; }
  .fee-estimator-icon { display: none; }
  .fee-estimator-content .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .calculator-card, .calculator-float-icon { transition: none; }
}


.gis-featured-card { border-color: rgba(249,115,22,.45); background: linear-gradient(180deg, var(--bg-white), rgba(249,115,22,.055)); }
.gis-featured-card .calculator-card-icon { background: var(--primary); color: #fff; }

/* Featured tools */
.gis-featured-card { border-color:rgba(249,115,22,.45); background:linear-gradient(180deg,var(--bg-white),rgba(249,115,22,.055)); }
.gis-featured-card .calculator-card-icon { background:var(--primary); color:#fff; }

/* Shared calculator tool page */
.calculator-hero{padding:76px 0 52px;text-align:left;background:linear-gradient(180deg,var(--bg-light),var(--bg-white));}
.calculator-hero .container{max-width:1000px;}
.calculator-hero h1{font-size:clamp(2.2rem,5vw,3.4rem);letter-spacing:-.035em;}
.calculator-grid-section{padding:56px 0 86px;}
.calculator-categories{gap:48px;}
.calculator-category-heading{border-bottom:0;padding:0 0 6px;}
.calculator-card{min-height:205px;padding:22px;box-shadow:0 6px 20px rgba(15,23,42,.06);transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;}
.calculator-card:hover{transform:translateY(-4px);box-shadow:0 14px 32px rgba(15,23,42,.10);}
.calculator-card:focus-visible{outline:3px solid rgba(249,115,22,.35);outline-offset:3px;}
.calculator-card-icon{width:48px;height:48px;border-radius:12px;}
.calculator-card h2{font-size:1.05rem;line-height:1.35;margin-top:14px;}
.calculator-card p{font-size:.87rem;line-height:1.65;}
.calculator-card-link{padding-top:12px;font-weight:800;}
.calculator-card h2,.calculator-card p{overflow-wrap:anywhere;}
.calculator-tool-page{padding-top:78px;}
.calculator-tool-hero{padding:58px 0 44px;text-align:left;}
.calculator-tool-hero .container{max-width:980px;}
.calculator-tool-hero h1{font-size:clamp(2rem,4.5vw,3rem);letter-spacing:-.03em;}
.calculator-tool-hero p{margin:0;max-width:760px;line-height:1.7;}
.calculator-back{margin-bottom:20px;font-size:.9rem;}
.tool-icon{margin:0 0 16px;width:54px;height:54px;border-radius:14px;}
.calculator-tool-content{padding:48px 0 84px;}
.bearing-panel{box-shadow:0 8px 24px rgba(15,23,42,.06);}
.input-card{box-shadow:none;}
.result-box{border-color:rgba(249,115,22,.2);}

@media (max-width:1000px){.calculator-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media (max-width:700px){
 .calculator-page{padding-top:70px}.calculator-hero{padding:65px 0 40px}.calculator-grid-section{padding:42px 0 62px}.calculator-categories{gap:42px}.calculator-category-heading{gap:12px}.calculator-category-icon{width:42px;height:42px;flex-basis:42px;font-size:20px}.calculator-category-heading h2{font-size:1.15rem}.calculator-grid{grid-template-columns:minmax(0,1fr);gap:16px}.calculator-card{min-height:0;padding:22px}.calculator-float{top:88px;right:16px}.calculator-float-icon{width:54px;height:54px}.calculator-float-icon svg{width:28px;height:28px}.calculator-float-text{display:none}.fee-estimator-banner{padding:28px 24px;align-items:flex-start}.fee-estimator-icon{width:64px;height:64px;flex-basis:64px;border-radius:18px;font-size:1.8rem}.calculator-tool-page{padding-top:70px}.calculator-tool-hero{padding:48px 0 34px}.calculator-tool-content{padding:34px 0 60px}.action-row .btn{width:100%;}}
@media (max-width:520px){.fee-estimator-banner{display:block}.fee-estimator-icon{display:none}.fee-estimator-content .btn{width:100%;}}
@media (prefers-reduced-motion:reduce){.calculator-card,.calculator-float-icon{transition:none;}}
html.theme-dark .calculator-card,html.theme-dark .bearing-panel,html.theme-dark .input-card,html.theme-dark .result-box{box-shadow:0 8px 24px rgba(0,0,0,.18);}
