@import url('/calculator-base.css');

.site-header { position: relative; z-index: 20; background: #fff; }
.page-intro { width: min(75%, 1050px); max-width: none; margin: 0 auto; padding: clamp(1.35rem, 3vw, 2.5rem) 0 2.5rem; background: transparent; }
.breadcrumb { align-items: center; margin: 0 0 1.3rem; font-size: .78rem; }
.breadcrumb a { display: inline-flex; align-items: center; gap: .35rem; color: var(--blue); text-decoration: none; }
.breadcrumb a svg { width: .9rem; height: .9rem; }
.page-intro h1 { max-width: none; margin-bottom: .55rem; font-size: clamp(2.55rem, 5.2vw, 4.8rem); }
.page-intro > p:last-child { max-width: 880px; color: #426474; font-size: 1.03rem; line-height: 1.62; }
.page-intro strong { color: var(--navy); }

.calculator-shell, .results-section { width: min(75%, 1050px); max-width: none; margin-right: auto; margin-left: auto; padding: 0; }
.calculator-shell { margin-top: 0; }
.calculator-head { align-items: center; padding: 1.35rem 1.5rem; border: 1px solid var(--line); border-radius: 13px 13px 0 0; background: var(--navy); }
.calculator-head .eyebrow { color: #7ce4dc; }
.calculator-head h2 { font-size: clamp(1.3rem, 2vw, 1.65rem); }
.calculator-head > p { max-width: 410px; color: #d4ebec; font-size: .81rem; line-height: 1.55; }
.calculator-layout { grid-template-columns: minmax(0, 1fr); border-color: var(--line); border-radius: 0 0 13px 13px; }
.calculator-form { padding: 1.5rem; }
fieldset + fieldset { margin-top: 1.55rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
fieldset legend { display: flex; align-items: center; margin-bottom: 1.05rem; line-height: 1.25; }
fieldset legend span { flex: 0 0 25px; margin-right: .55rem; background: var(--blue); }
.field-grid { gap: 1rem; }
.field label { font-size: .82rem; }
.calculator-form :is(input, select) { min-height: 43px; border: 1px solid #c7d7dc; color: var(--ink); background: #fff; font-size: .86rem; }
.calculator-form select { padding-right: 2.5rem; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%230b3150' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .9rem center; background-size: .8rem; }
.calculator-form :is(input, select):focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); outline: none; }
.calculator-form .compound :is(input, select):focus { box-shadow: none; }
.unit-display { min-height: 43px; border-color: #c7d7dc; background: #eef5f6; }
.helper { font-size: .71rem; }
.optional-label { color: #6c8590; font-size: .69rem; font-weight: 500; }
.custom-id-field { padding: .9rem; border: 1px solid #d3e2e5; border-radius: 9px; background: #f6fbfb; }
.input-error { margin-top: 1rem; }
.form-actions { margin-top: 1.5rem; }
.primary-button { background: var(--blue); }
.primary-button:hover { background: #008d84; }

.results-section { margin-top: 3.25rem; }
.print-report { display: none; }
.results-card { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.result-header { align-items: flex-start; padding: 1.35rem 1.5rem 1rem; }
.result-header h2 { font-size: clamp(1.3rem, 2vw, 1.65rem); }
.result-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.copy-button { display: inline-flex; align-items: center; justify-content: center; gap: .43rem; min-height: 2.4rem; padding: .5rem .75rem; border: 1px solid #bcd9d7; border-radius: 7px; color: #008e84; background: #fff; font: 600 .72rem/1 Poppins, sans-serif; }
.copy-button:hover { border-color: var(--blue); color: #fff; background: var(--blue); }
.copy-button.secondary { color: #008e84; background: #fff; }
.copy-button svg { width: .95rem; height: .95rem; flex: 0 0 .95rem; }
.primary-result { margin-top: 0; padding: 1.45rem 1.5rem; border-radius: 0; background: var(--navy); }
.primary-result p { font-size: clamp(2.15rem, 5vw, 3.65rem); }
.pressure-status { width: fit-content; max-width: 100%; margin-top: .9rem; padding: .43rem .68rem; border: 1px solid transparent; border-radius: 6px; color: #eaf9f7; background: rgba(255,255,255,.11); font-size: .72rem; font-weight: 600; }
.pressure-status.pass { border-color: rgba(126, 232, 209, .65); color: #d8fff4; background: rgba(4, 122, 93, .42); }
.pressure-status.fail { border-color: rgba(255, 206, 117, .65); color: #fff0ce; background: rgba(167, 90, 17, .38); }
.pressure-metrics { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .75rem; padding: 1.2rem 1.5rem; border: 0; border-radius: 0; background: #fff; }
.pressure-metrics article { min-height: 6.5rem; padding: .85rem; border: 1px solid #dbe8eb; border-radius: 8px; background: #fbfdfd; }
.pressure-metrics article:first-child { border-bottom: 3px solid #00a69b; }
.pressure-metrics article:nth-child(2) { border-bottom: 3px solid #5a8192; }
.pressure-metrics article:nth-child(3) { border-bottom: 3px solid #e4942a; }
.pressure-metrics article:nth-child(4) { border-bottom: 3px solid #447384; }
.pressure-metrics article:nth-child(5) { border-bottom: 3px solid #806eb5; }
.result-note { margin: 0 1.5rem 1rem; }
.math-details { margin: 0 1.5rem 1.5rem; }
.math-details p + p { margin-top: .7rem; }

.page-body-layout { display: grid; grid-template-columns: minmax(0, 1fr) 245px; grid-template-areas: 'content sidebar'; gap: 3.5rem; align-items: start; width: min(75%, 1050px); margin: 4rem auto 0; padding-bottom: 5rem; }
.page-content { display: flex; flex-direction: column; grid-area: content; min-width: 0; }
.page-content .content-section { width: auto; max-width: none; margin: 0; padding: 0; }
.page-content .content-section + .content-section { margin-top: 2.65rem; }
.page-sidebar { position: sticky; top: 1.5rem; grid-area: sidebar; }
.page-sidebar .page-toc { width: auto; margin: 0; padding: 1.15rem; border: 1px solid var(--blue); border-radius: 12px; color: #fff; background: var(--blue); }
.toc-intro { padding: .05rem 0 0; }
.page-toc-label { margin: 0 0 .28rem; color: #fff; font-size: .88rem; font-weight: 700; letter-spacing: -.02em; text-transform: none; }
.toc-intro > p:last-child { margin: 0 0 .9rem; color: #e3fffc; font-size: .68rem; line-height: 1.5; }
.page-toc ol { display: grid; gap: .5rem; margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.page-toc li { min-width: 0; padding: 0; counter-increment: toc; }
.page-toc a { display: flex; align-items: center; gap: .6rem; min-height: 2.7rem; padding: .55rem .7rem; border: 0; border-radius: 8px; color: #fff; background: rgba(255,255,255,.1); font-size: .72rem; font-weight: 400; line-height: 1.35; text-decoration: none; }
.page-toc a::before { content: counter(toc, decimal-leading-zero); display: inline-grid; width: 1.75rem; height: 1.75rem; flex: 0 0 1.75rem; place-items: center; border-radius: 50%; color: #008e84; background: #fff; font-size: .59rem; font-weight: 700; letter-spacing: .04em; }
.page-toc a:hover { color: #fff; background: rgba(255,255,255,.2); text-decoration: none; }
.content-section h2 { margin: 0 0 1rem; color: var(--navy); font-size: clamp(1.6rem, 3vw, 2.35rem); line-height: 1.2; letter-spacing: -.04em; }
.content-section > p:not(.eyebrow), .content-section li { color: #4a6979; font-size: .91rem; line-height: 1.7; }
.step-grid { display: grid; grid-template-columns: 1fr; gap: 2.25rem; }
.step-grid article { display: grid; grid-template-columns: 2.15rem minmax(0, 1fr); column-gap: .8rem; align-items: start; padding: 0; border: 0; background: transparent; }
.step-grid article > span, .example-calculation span { display: inline-grid; grid-row: span 2; width: 2.15rem; height: 2.15rem; place-items: center; margin: 0; border-radius: 50%; color: var(--blue); background: #e8f8f6; font-size: .68rem; font-weight: 700; letter-spacing: .08em; }
.step-grid article > span { grid-row: auto; }
.step-visual { width: min(100%, 560px); margin: .6rem 0 .8rem; overflow: hidden; border: 1px solid #dbe8eb; border-radius: 8px; background: #f8fbfb; aspect-ratio: 1.6 / 1; }
.step-visual img { display: block; width: 100%; height: 100%; object-fit: cover; }
.step-copy { min-width: 0; }
.step-grid h3 { margin: .1rem 0 .4rem; color: var(--navy); font-size: .96rem; }
.step-grid p { margin: 0; color: #567281; font-size: .82rem; line-height: 1.6; }
.boundary-section .table-wrap { margin-top: 1.25rem; }
.boundary-section tbody tr:first-child { background: #f0fbf9; }
.boundary-section td strong { color: var(--navy); }
.section-followup { margin-top: 1.2rem !important; padding: .85rem 1rem; border-left: 3px solid var(--blue); background: #f0fbfa; }
.section-followup a { color: #007d75; font-weight: 700; }
.example-calculation { display: grid; gap: 1.4rem; margin: 1.35rem 0; padding: 0; list-style: none; border: 0; }
.example-calculation li { display: grid; grid-template-columns: 2.15rem minmax(0, 1fr); gap: .8rem; align-items: start; padding: 0; border: 0; background: transparent; }
.example-calculation span { margin: 0; }
.example-calculation p { margin: .25rem 0 0; font-size: .91rem; line-height: 1.65; }
.limits-section { padding: 0; border: 0; border-radius: 0; background: transparent; }
.limits-section > p:not(.eyebrow) { max-width: none; }
.calculation-basis h3 { margin: 1.35rem 0 .55rem; color: var(--navy); font-size: 1rem; }
.formula-box { margin-top: 1.2rem; padding: 1.05rem 1.15rem; border-left: 3px solid var(--blue); background: #f0fbfa; }
.formula-box h3 { margin-top: 0; }
.formula-box p { margin: .55rem 0 0; color: #486977; font-size: .82rem; line-height: 1.65; }
.formula-box code { display: inline-block; white-space: nowrap; }
.basis-table { margin-top: .8rem; }
.basis-table table { min-width: 580px; }
.basis-note, .basis-boundary { margin-top: 1rem !important; color: #526f7e !important; font-size: .82rem !important; }
.basis-boundary { padding: .85rem 1rem; border-left: 3px solid var(--blue); background: #f0fbfa; }
.faqs .faq-grid { grid-template-columns: 1fr; gap: .8rem; }
.faqs details { background: #fff; }

@media (max-width: 900px) {
  .page-body-layout { grid-template-columns: 1fr; grid-template-areas: 'sidebar' 'content'; gap: 2.4rem; width: min(75%, 1050px); }
  .page-sidebar { position: static; }
  .pressure-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .page-intro { width: auto; margin: 0; padding: 1.4rem .9rem 2.2rem; }
  .page-intro h1 { font-size: 2.5rem; }
  .calculator-shell, .results-section, .page-body-layout { width: auto; margin-right: .7rem; margin-left: .7rem; }
  .calculator-shell { margin-top: 0; }
  .calculator-head { display: block; padding: 1.15rem; }
  .calculator-head > p { margin-top: .55rem; text-align: left; }
  .calculator-form { padding: 1.1rem; }
  .field-grid { grid-template-columns: 1fr; }
  .step-grid article { grid-template-columns: 2.15rem minmax(0, 1fr); align-items: start; }
  .step-visual { width: 100%; margin: .6rem 0 .8rem; }
  .step-copy { grid-column: 2; }
  .pressure-metrics { grid-template-columns: 1fr; padding: .9rem; }
  .result-header { padding: 1.15rem 1.15rem .9rem; }
  .result-actions { margin-top: .8rem; }
  .copy-button { min-width: 2.5rem; padding: .6rem; }
  .copy-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .primary-result { padding: 1.2rem 1.15rem; }
  .result-note, .math-details { margin-right: .9rem; margin-left: .9rem; }
  .math-details { margin-bottom: .9rem; }
  .page-body-layout { margin-top: 2.4rem; padding-bottom: 3rem; }
  .page-content .content-section + .content-section { margin-top: 2.25rem; }
  .table-wrap table { min-width: 600px; }
}

@media print {
  @page { margin: 16mm; }
  body { color: #000; background: #fff; font-size: 10pt; }
  .site-header, .page-intro, .calculator-shell, .page-body-layout, .site-footer { display: none !important; }
  main, .results-section, .results-card { display: block !important; width: 100% !important; margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
  .results-section[hidden] { display: none !important; }
  .print-report { display: block; margin-bottom: 1.25rem; }
  .print-report-header { display: flex; justify-content: space-between; padding-bottom: .45rem; border-bottom: 1px solid #80949a; color: #17384c; }
  .print-report-header p { margin: 0; font-weight: 700; }
  .print-report-title { margin: .7rem 0 1rem; color: #0b3150; font-size: 22pt; font-weight: 700; }
  .print-input-summary { padding: .85rem 1rem; border: 1px solid #b9cbd0; border-radius: 7px; }
  .print-input-summary h2 { margin: 0 0 .45rem; color: #0b3150; font-size: 12pt; }
  .print-input-summary dl { display: grid; grid-template-columns: 1fr 1fr; gap: .38rem 1rem; margin: 0; }
  .print-input-summary div { display: grid; grid-template-columns: 45% 1fr; gap: .35rem; }
  .print-input-summary dt { color: #526a74; font-weight: 600; }
  .print-input-summary dd { margin: 0; }
  .result-header { padding: 0 0 .7rem; }
  .result-header .eyebrow, .copy-button, .math-details, .result-note { display: none !important; }
  .primary-result { padding: 1rem; color: #000; background: #eef6f5 !important; border: 1px solid #b9d8d3; }
  .primary-result :is(p, .result-label, .result-summary, .pressure-status) { color: #000 !important; }
  .pressure-status { padding: 0; background: transparent !important; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); border: 1px solid #b9cbd0; }
  .pressure-metrics { padding: .85rem 0; }
  .metric-grid article { min-height: 0; border-bottom: 1px solid #b9cbd0; }
}
