* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--p-ink); background: var(--p-paper); font: 400 16px/1.55 var(--p-body); }
a { color: var(--p-blue-link); text-underline-offset: .2em; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
:focus-visible { outline: 3px solid var(--p-blue-link); outline-offset: 4px; }
.skip { position: absolute; left: 1rem; top: -5rem; background: var(--p-surface); z-index: 10; padding: .7rem; }
.skip:focus { top: .5rem; }
.mast, main, footer { width: min(1120px, calc(100% - 4rem)); margin-inline: auto; }
.mast { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 80px; border-bottom: 1px solid var(--p-line); }
.brand img { display: block; width: 118px; height: auto; }
.mast nav { display: flex; align-items: center; gap: clamp(.5rem, 2.4vw, 1.8rem); }
.mast nav a, .theme-toggle, footer { font-size: .85rem; font-weight: 570; }
.mast nav a { min-height: 44px; display: inline-flex; align-items: center; color: var(--p-ink); text-decoration: none; }
.mast nav a:hover { text-decoration: underline; }
.theme-toggle { background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 99px; padding: .5rem .8rem; min-height: 44px; color: var(--p-ink); }
.intro { padding: clamp(2rem, 4.6vw, 4.25rem) 0 clamp(1.6rem, 3.4vw, 2.85rem); }
.eyebrow, .estimate-kicker { font: 700 .72rem/1.4 var(--p-body); letter-spacing: .11em; text-transform: uppercase; }
.eyebrow { margin: 0 0 .55rem; color: var(--p-blue-link); }
h1, h2, legend { font-family: var(--p-heading); font-weight: 400; }
h1 { max-width: 100%; font-size: clamp(2.4rem, 6.2vw, 5.1rem); line-height: 1.02; letter-spacing: -.045em; margin: 0; }
.intro > p:last-child { margin: .7rem 0 0; color: var(--p-muted); font-size: clamp(1rem, 1.5vw, 1.15rem); }
.workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(1.25rem, 4.5vw, 4.5rem); align-items: start; }
#estimate-form, .agreement { border: 1px solid var(--p-line); border-radius: 12px; background: var(--p-surface); padding: clamp(1.25rem, 2.8vw, 2.3rem); }
fieldset { border: 0; padding: 0; margin: 0; min-inline-size: 0; }
fieldset + fieldset:not([hidden]), #project { margin-top: 1.8rem; }
legend, .agreement h2 { padding: 0; margin: 0 0 1rem; font-size: clamp(1.4rem, 2.1vw, 1.8rem); line-height: 1.17; letter-spacing: -.025em; }
.path-options, .field-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .75rem; }
label { display: block; margin: 0 0 .35rem; font-size: .9rem; font-weight: 650; }
.path { display: flex; gap: .6rem; align-items: flex-start; border: 1px solid var(--p-line); padding: .92rem; border-radius: 8px; cursor: pointer; margin: 0; }
.path:has(:checked) { border-color: var(--p-blue-link); box-shadow: inset 0 0 0 1px var(--p-blue-link); background: color-mix(in srgb,var(--p-blue) 5%,var(--p-surface)); }
.path:has(:focus-visible) { outline: 3px solid var(--p-blue-link); outline-offset: 4px; }
.path input { accent-color: var(--p-blue); inline-size: 1.1rem; block-size: 1.1rem; margin: .18rem 0 0; flex: none; }
.path strong, .path small { display: block; }
.path strong { font-size: 1rem; }
.path small { color: var(--p-muted); line-height: 1.35; margin-top: .18rem; font-size: .79rem; font-weight: 450; }
input:not([type=radio]), select { width: 100%; min-width: 0; border: 1px solid var(--p-line); border-radius: 6px; min-height: 48px; background: var(--p-surface); color: var(--p-ink); padding: .6rem .8rem; }
input::placeholder { color: var(--p-muted); opacity: .8; }
select + label, .field-grid + label { margin-top: .95rem; }
.unit-field { border: 1px solid var(--p-line); display: flex; align-items: center; border-radius: 6px; padding-inline-end: .8rem; }
.unit-field input { border: 0; padding-right: .3rem; }
.unit-field:focus-within { outline: 3px solid var(--p-blue-link); outline-offset: 2px; }
.unit-field input:focus { outline: 0; }
.unit-field > span, .hint { color: var(--p-muted); }
.unit-field > span { font-size: .85rem; }
.money { padding: 0 0 0 .8rem; }
.money input { padding-inline: .45rem .8rem; }
.hint { font-size: .8rem; line-height: 1.45; margin: .45rem 0 0; }
.primary, .secondary { display: inline-flex; justify-content: center; align-items: center; gap: 1rem; font-weight: 650; border-radius: 6px; padding: .75rem 1.1rem; min-height: 48px; line-height: 1.3; }
.primary { background: var(--p-blue); color: white; border: 1px solid var(--p-blue); margin-top: 1.45rem; }
.primary:hover { background: #0746c4; }
.secondary { background: var(--p-surface); color: var(--p-blue-link); border: 1px solid var(--p-blue-link); }
.secondary:hover { background: var(--p-paper); }
.notice { margin-top: 1.25rem; border-left: 3px solid var(--p-blue); padding: .6rem 1rem; }
.notice p { margin: .3rem 0 0; }
.link-button { background: none; border: 0; padding: .4rem 0; min-height: 44px; color: var(--p-blue-link); font-weight: 650; text-decoration: underline; text-underline-offset: .2em; }
.estimate { padding: clamp(1.5rem, 3vw, 2.6rem); background: #0746c4; color: #fff; border-radius: 12px; }
.estimate-kicker { display: flex; align-items: center; gap: .55rem; color: #fff; }
.marker { display: inline-block; width: .6rem; height: .6rem; background: var(--p-lime); }
.estimate h2 { font-size: clamp(1.5rem, 2.6vw, 2.3rem); line-height: 1.1; letter-spacing: -.025em; margin: 2rem 0 .2rem; }
.estimate h2:focus { outline: 0; }
.estimate h2:focus-visible { outline: 2px solid var(--p-lime); outline-offset: 5px; }
.result-value { font: 400 clamp(2.8rem, 6.8vw, 5.8rem)/1.14 var(--p-heading); letter-spacing: -.055em; overflow-wrap: anywhere; color: var(--p-lime); }
.result-value span { font-size: .58em; }
.estimate p { margin: .65rem 0 0; max-width: 44ch; }
.estimate .estimate-note, .summary { border-top: 1px solid #ffffff66; margin-top: 1.5rem; padding-top: 1rem; }
.estimate .estimate-note { font-size: .85rem; color: #f0f4ff; }
.summary dl { margin: 0; }
.summary dl > div { display: flex; justify-content: space-between; gap: 1rem; padding: .16rem 0; font-size: .86rem; }
.summary dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.agreement { margin-top: .85rem; }
.agreement h2 { margin-bottom: .65rem; }
.agreement form > p { color: var(--p-muted); font-size: .9rem; }
#sign-status:empty { margin: 0; }
.print-action { margin-top: .4rem; }
footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; padding: 1.3rem 0 2rem; margin-top: clamp(2rem, 5vw, 4rem); border-top: 1px solid var(--p-line); color: var(--p-muted); }
@media (max-width: 760px) {
  .mast, main, footer { width: calc(100% - 2rem); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .mast { min-height: 68px; }
  .brand img { width: 96px; }
}
@media (max-width: 475px) {
  .mast nav { gap: .7rem; }
  .mast nav a, .theme-toggle { font-size: .77rem; }
  .mast nav a:first-child { display: none; }
  .path-options { grid-template-columns: 1fr; gap: .55rem; }
  .path { padding: .7rem .85rem; }
  .primary, .secondary { width: 100%; }
}
@media (max-width: 365px) { .field-grid { grid-template-columns: 1fr; } }
@media print {
  :root, :root[data-theme] { color-scheme: light; --p-paper: white; --p-ink: black; --p-muted: #333; }
  .mast, main, footer { width: 100%; }
  .mast nav, .intro p:last-child, #estimate-form, .agreement, .print-action, footer a { display: none !important; }
  .workspace { display: block; }
  .estimate { border: 1px solid #555; background: white; color: black; break-inside: avoid; }
  .estimate .estimate-note, .estimate-kicker, .result-value { color: black; }
  .summary, .estimate .estimate-note { border-color: #999; }
  .intro { padding: 1.25rem 0; }
}
.downloads { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem 1.1rem; padding-bottom: 1.2rem; margin-bottom: 1.15rem; border-bottom: 1px solid var(--p-line); }
.downloads .primary { margin: 0; }
#download-status:empty, #availability:empty { display: none; }
#download-status { color: var(--p-muted); }
dialog { width: min(96vw, 1060px); max-height: 94dvh; padding: 1rem; background: var(--p-surface); color: var(--p-ink); border: 1px solid var(--p-line); border-radius: 12px; }
dialog::backdrop { background: rgb(12 18 26 / .72); }
dialog header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
dialog h2 { margin: 0; font-size: clamp(1.25rem, 3vw, 1.9rem); }
dialog button { min-height: 44px; padding: .4rem .8rem; color: var(--p-ink); background: var(--p-surface); border: 1px solid var(--p-line); border-radius: 6px; }
dialog a { display: inline-flex; align-items: center; min-height: 44px; }
dialog iframe { display: block; width: 100%; height: min(70dvh, 800px); border: 1px solid var(--p-line); background: white; }
@media print { dialog { display: none !important; } }
