/* fieldloom.io/tools — free HVAC calculators. Builds on /styles.css. */
.tools-page {
  --tool-text: #1e293b; --tool-sub: #475569; --tool-bg: #f4f7fb;
  --tool-navy: #07111f; --tool-radius: 22px;
  color: var(--tool-text); background: var(--tool-bg);
}

/* ---------- Hero: dark, like the home page ---------- */
.tools-hero {
  position: relative; overflow: hidden; padding: 84px 0 118px; color: #fff;
  background:
    radial-gradient(circle at 12% 20%, rgba(6, 182, 212, .32), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(124, 58, 237, .40), transparent 30%),
    radial-gradient(circle at 70% 90%, rgba(245, 158, 11, .18), transparent 25%),
    linear-gradient(135deg, #06111f 0%, #0d1b3d 55%, #160b34 100%);
}
.tools-hero-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 42px 42px; mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .9), transparent);
}
.tools-hero .container { position: relative; }
.tools-hero h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.05; letter-spacing: -0.04em; margin-bottom: 16px; max-width: 820px; }
.tools-hero .subtitle { font-size: 19px; line-height: 1.6; max-width: 680px; color: rgba(255, 255, 255, .86); }
.tools-eyebrow, .tools-crumbs {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 18px; padding: 7px 14px; border-radius: 999px;
  font-size: 14px; font-weight: 800; color: rgba(255, 255, 255, .9);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .16);
}
.tools-eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: 13px; }
.tools-crumbs a { color: #67e8f9; }
.tools-proof { list-style: none; display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 24px; font-size: 15px; font-weight: 800; color: rgba(255, 255, 255, .9); }
.tools-proof li:before { content: "✓ "; color: #67e8f9; }

/* Content sits on a light panel that overlaps the hero */
.tools-main { padding: 0 0 80px; margin-top: -72px; position: relative; }
.tool-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 0 32px; align-items: start; }
.tool-layout > .tool-card, .tool-layout > .tool-body { grid-column: 1; }
.tool-layout > .tool-cta { grid-column: 2; grid-row: 1 / span 2; }

/* ---------- Icons ---------- */
.tool-icon {
  flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .06);
}
.tool-icon svg { width: 26px; height: 26px; }
.tool-icon.small { width: 40px; height: 40px; border-radius: 12px; }
.tool-icon.small svg { width: 21px; height: 21px; }
.accent-cyan { color: #0e7490; background: linear-gradient(135deg, #cffafe, #e0f2fe); }
.accent-blue { color: #1d4ed8; background: linear-gradient(135deg, #dbeafe, #e0e7ff); }
.accent-violet { color: #6d28d9; background: linear-gradient(135deg, #ede9fe, #fae8ff); }
.accent-amber { color: #b45309; background: linear-gradient(135deg, #fef3c7, #ffedd5); }
.accent-rose { color: #be123c; background: linear-gradient(135deg, #ffe4e6, #ffedd5); }

/* ---------- Calculator card ---------- */
.tool-card {
  background: #fff; border-radius: var(--tool-radius); padding: 28px;
  box-shadow: 0 30px 70px rgba(2, 8, 23, .16); border: 1px solid rgba(15, 23, 42, .06);
}
.tool-card-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.tool-card-head div b { display: block; font-size: 19px; color: #0f172a; letter-spacing: -.01em; }
.tool-card-head div span { display: block; font-size: 14px; color: var(--tool-sub); font-weight: 600; }
.tool-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tool-field label { display: block; font-size: 14px; font-weight: 800; margin-bottom: 7px; color: #1e293b; }
.tool-field .unit { font-weight: 700; color: #2563eb; }
.tool-field input, .tool-field select {
  width: 100%; height: 56px; border: 1.5px solid #cbd5e1; border-radius: 14px; padding: 0 16px;
  background: #f8fafc; color: #0f172a; font: inherit; font-size: 19px; font-weight: 800;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.tool-field input::placeholder { color: #94a3b8; font-weight: 600; }
.tool-field input:hover, .tool-field select:hover { border-color: #94a3b8; }
.tool-field input:focus, .tool-field select:focus {
  outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(37, 99, 235, .16); background: #fff;
}
.tool-field .help { display: block; margin-top: 6px; font-size: 13px; color: var(--tool-sub); }

/* ---------- Results ---------- */
.tool-output { margin-top: 24px; display: grid; gap: 14px; }
.tool-empty {
  padding: 22px; border-radius: 16px; text-align: center; font-weight: 700; color: var(--tool-sub);
  background: repeating-linear-gradient(135deg, #f8fafc, #f8fafc 10px, #f1f5f9 10px, #f1f5f9 20px); border: 1.5px dashed #cbd5e1;
}
.tool-result-item {
  padding: 20px 22px; border-radius: 18px; background: #f8fafc; border: 1.5px solid #e2e8f0;
  border-left-width: 6px; border-left-color: var(--blue); animation: tool-in .25s ease;
}
.tool-result-item.is-pass { background: #f0fdf4; border-color: #bbf7d0; border-left-color: #16a34a; }
.tool-result-item.is-fail { background: #fef2f2; border-color: #fecaca; border-left-color: #dc2626; }
.tool-result-item.is-error { background: #fff7ed; border-color: #fed7aa; border-left-color: #ea580c; }
@keyframes tool-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tool-error { color: #9a3412; font-weight: 700; }
.tool-result-label { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--tool-sub); }
.tool-result-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 4px 0 8px; }
.tool-result-value { font-size: 52px; font-weight: 900; letter-spacing: -.04em; line-height: 1.05; color: #0f172a; font-variant-numeric: tabular-nums; }
.tool-result-value small { font-size: 22px; font-weight: 800; margin-left: 4px; color: var(--tool-sub); letter-spacing: 0; }
.tool-pill { padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 900; }
.tool-pill.pass { background: #16a34a; color: #fff; }
.tool-pill.fail { background: #dc2626; color: #fff; }
.tool-pill.pass:before { content: "✓ "; }
.tool-pill.fail:before { content: "! "; }
.tool-result-line { font-size: 15px; color: #334155; font-weight: 600; }
.tool-hint { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(15, 23, 42, .08); font-size: 15px; color: var(--tool-text); }

/* ---------- App call-to-action ---------- */
.tool-cta {
  position: sticky; top: 96px; padding: 28px; border-radius: var(--tool-radius); color: #fff; overflow: hidden;
  background: radial-gradient(circle at 15% 0%, rgba(6, 182, 212, .35), transparent 45%), radial-gradient(circle at 100% 100%, rgba(124, 58, 237, .45), transparent 45%), linear-gradient(160deg, #07111f, #14204a);
  box-shadow: 0 30px 70px rgba(2, 8, 23, .22);
}
.tool-cta h2 { font-size: 25px; line-height: 1.15; letter-spacing: -.025em; margin-bottom: 10px; }
.tool-cta p { font-size: 15px; color: rgba(255, 255, 255, .88); margin-bottom: 16px; }
.tool-cta ul { list-style: none; display: grid; gap: 10px; margin-bottom: 22px; font-size: 15px; font-weight: 700; }
.tool-cta li { padding-left: 26px; position: relative; }
.tool-cta li:before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; background: rgba(103, 232, 249, .2); color: #67e8f9; }
.tool-cta .btn { width: 100%; min-height: 52px; }
.tool-cta .fine { margin: 12px 0 0; font-size: 13px; color: rgba(255, 255, 255, .75); text-align: center; }

/* ---------- Explainer content ---------- */
.tool-body { margin-top: 28px; }
.tool-article {
  background: #fff; border-radius: var(--tool-radius); padding: 8px 36px 36px; border: 1px solid rgba(15, 23, 42, .06);
  box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}
.tool-article h2 {
  display: flex; align-items: center; gap: 12px; font-size: 26px; letter-spacing: -.025em; margin: 36px 0 14px; color: #0f172a;
}
.tool-article h2:before { content: ""; flex: none; width: 6px; height: 26px; border-radius: 3px; background: linear-gradient(180deg, var(--cyan), var(--blue), var(--violet)); }
.tool-article h3 { font-size: 19px; margin: 24px 0 8px; letter-spacing: -.01em; }
.tool-article p, .tool-article li { font-size: 17px; line-height: 1.75; color: var(--tool-text); }
.tool-article p + p { margin-top: 12px; }
.tool-article a:not(.tool-link) { color: var(--blue); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(37, 99, 235, .3); text-underline-offset: 3px; }
.tool-article b { color: #0f172a; }
.tool-article ul { padding-left: 22px; display: grid; gap: 6px; }

.tool-formula {
  margin: 16px 0 20px; padding: 18px 22px; border-radius: 16px; color: #fff;
  background: linear-gradient(135deg, #0f1d3d, #1e1b4b); font-size: 18px; font-weight: 800; line-height: 1.5;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
.tool-formula:before { content: "Formula"; display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #67e8f9; margin-bottom: 4px; }

.tool-steps { list-style: none; counter-reset: step; display: grid; gap: 12px; padding: 0; margin: 14px 0; }
.tool-steps li { counter-increment: step; position: relative; padding-left: 46px; min-height: 32px; }
.tool-steps li:before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 10px;
  display: grid; place-items: center; font-size: 15px; font-weight: 900; color: #1d4ed8; background: #dbeafe;
}

.tool-example { margin: 20px 0; padding: 20px 22px; border-radius: 16px; background: #fffbeb; border: 1.5px solid #fde68a; }
.tool-example-tag { display: inline-block; margin-bottom: 6px; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; color: #b45309; }

.tool-table { width: 100%; border-collapse: separate; border-spacing: 0; margin: 14px 0; font-size: 16px; border: 1px solid #e2e8f0; border-radius: 14px; overflow: hidden; }
.tool-table th, .tool-table td { text-align: left; padding: 12px 16px; }
.tool-table th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--tool-sub); background: #f1f5f9; }
.tool-table td { border-top: 1px solid #e2e8f0; font-weight: 600; }
.tool-table td:last-child { font-weight: 900; color: #1d4ed8; }
.tool-note {
  margin-top: 14px; padding: 12px 16px; border-radius: 12px; background: #f1f5f9;
  font-size: 15px !important; line-height: 1.6 !important; color: #334155 !important;
}
.site-footer .tool-note { background: none; padding: 0; color: rgba(255, 255, 255, .7) !important; }

/* ---------- P/T chart tables ---------- */
.pt-table-wrap {
  margin-top: 28px; padding: 24px 28px; background: #fff; border-radius: var(--tool-radius);
  border: 1px solid rgba(15, 23, 42, .06); box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}
.pt-table-wrap h3 { font-size: 20px; letter-spacing: -.02em; margin-bottom: 14px; }
.pt-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; align-items: start; }
.pt-grid table { width: 100%; border-collapse: collapse; font-size: 15px; font-variant-numeric: tabular-nums; }
.pt-grid th, .pt-grid td { padding: 7px 12px; text-align: right; }
.pt-grid th { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #fff; background: #0f1d3d; }
.pt-grid th:first-child { border-radius: 10px 0 0 10px; }
.pt-grid th:last-child { border-radius: 0 10px 10px 0; }
.pt-grid td:first-child { font-weight: 800; color: #0f172a; }
.pt-grid td:last-child { color: #334155; }
.pt-grid tbody tr:nth-child(even) td { background: #f8fafc; }
.pt-grid tr.is-near td { background: #fef3c7 !important; color: #92400e; font-weight: 900; }

/* ---------- FAQ ---------- */
.tool-faq { margin-top: 12px; display: grid; gap: 10px; }
.tool-faq details { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px; padding: 16px 20px; transition: background .15s; }
.tool-faq details[open] { background: #fff; box-shadow: 0 10px 24px rgba(15, 23, 42, .06); }
.tool-faq summary { cursor: pointer; font-weight: 800; font-size: 17px; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.tool-faq summary::-webkit-details-marker { display: none; }
.tool-faq summary:after { content: "+"; flex: none; color: var(--blue); font-size: 22px; line-height: 1; }
.tool-faq details[open] summary:after { content: "−"; }
.tool-faq details p { margin-top: 10px; }

/* ---------- Tool cards (index and related) ---------- */
.tool-related { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); gap: 12px; margin-top: 14px; }
.tools-index { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: 16px; }
.tool-link {
  display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 18px; background: #fff;
  border: 1px solid #e2e8f0; box-shadow: 0 6px 18px rgba(15, 23, 42, .05); transition: transform .15s, border-color .15s, box-shadow .15s;
}
.tool-link:hover, .tool-link:focus-visible { transform: translateY(-3px); border-color: #93c5fd; box-shadow: 0 18px 36px rgba(37, 99, 235, .14); }
.tool-link .tool-icon { margin-bottom: 10px; }
.tool-link b { display: block; font-size: 17px; line-height: 1.3; color: #0f172a; }
.tool-link span:not(.tool-icon) { display: block; font-size: 15px; line-height: 1.5; color: var(--tool-sub); }
.tool-link em { margin-top: auto; padding-top: 12px; font-style: normal; font-size: 14px; font-weight: 900; color: var(--blue); }

/* Index page sections */
.tools-section {
  background: #fff; border-radius: var(--tool-radius); padding: 26px 28px 30px; margin-bottom: 22px;
  border: 1px solid rgba(15, 23, 42, .06); box-shadow: 0 10px 30px rgba(15, 23, 42, .05);
}
.tools-section:first-child { box-shadow: 0 30px 70px rgba(2, 8, 23, .16); }
.tools-section-title { display: flex; align-items: center; gap: 12px; font-size: 24px; letter-spacing: -.025em; margin: 0 0 18px; }
.tools-section-title:before { content: ""; width: 6px; height: 24px; border-radius: 3px; background: linear-gradient(180deg, var(--cyan), var(--blue), var(--violet)); }
.tools-section-title small { font-size: 15px; font-weight: 600; letter-spacing: 0; color: var(--tool-sub); }

@media (max-width: 980px) {
  .tool-layout { grid-template-columns: 1fr; }
  .tool-layout > .tool-cta { grid-column: 1; grid-row: auto; position: static; margin-top: 22px; }
  .pt-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .tools-hero { padding: 56px 0 96px; }
  .tools-main { margin-top: -64px; }
  .tool-card, .tools-section { padding: 20px; }
  .tool-article { padding: 4px 20px 24px; }
  .pt-table-wrap { padding: 18px; }
  .tool-fields { grid-template-columns: 1fr; }
  .pt-grid { grid-template-columns: 1fr; }
  .tool-result-value { font-size: 42px; }
  .tools-proof { gap: 6px 16px; font-size: 14px; }
}
