.cost-page { overflow-wrap: anywhere; }
.cost-page main { overflow: visible; }
.cost-page [hidden] { display: none !important; }
.cost-page .cost-skip { position: absolute; top: -12rem; left: 1rem; z-index: 10; background: var(--brown); color: white; padding: 1rem; border-radius: .5rem; }
.cost-page .cost-skip:focus { top: 1rem; }
.cost-page :is(a,button,input,select,section[tabindex]):focus-visible { outline: 3px solid #315a26; outline-offset: 4px; }
.cost-page .site-header { flex-wrap: wrap; gap: 1rem; }
.cost-page .nav-links { flex-wrap: wrap; gap: 1rem; }
.cost-page .nav-links a { min-height: 44px; display: inline-flex; align-items: center; }
.cost-intro,.cost-panel,.cost-app-bridge { width: min(100% - 3rem, 68rem); margin-inline: auto; }
.cost-intro { padding-block: 3.5rem 2rem; }
.cost-intro h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); line-height: 1.02; max-width: 17ch; }
.cost-lead { font-size: 1.25rem; max-width: 56rem; }
.cost-hint { color: #654a39; font-size: .95rem; }
.cost-panel { background: var(--paper); border: 1px solid var(--line); border-radius: 1.5rem; padding: clamp(1rem, 4vw, 2.5rem); }
.cost-panel h2,.cost-app-bridge h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.1; letter-spacing: -.03em; }
.cost-page label { display: grid; gap: .4rem; font-weight: 750; min-width: 0; }
.cost-page input,.cost-page select { min-width: 0; width: 100%; min-height: 48px; border: 1px solid #9f8870; border-radius: .65rem; padding: .7rem; font: inherit; color: var(--brown); background: white; }
.cost-page input[aria-invalid=true],.cost-page select[aria-invalid=true] { border: 2px solid #a12b22; }
.cost-page button { font: inherit; font-weight: 750; min-height: 48px; border: 1px solid #9f8870; border-radius: .7rem; padding: .7rem 1rem; background: #fff3df; color: var(--brown); cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
.cost-page button:disabled { cursor: not-allowed; opacity: .6; }
.cost-basics { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,14rem),1fr)); gap: 1rem; margin-top: 1.5rem; }
.cost-rows { display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.cost-row { min-width: 0; padding: 1.25rem; margin: 0; border: 1px solid #d7c3a9; border-radius: 1rem; background: #fff9ef; }
.cost-row legend { font-weight: 850; padding-inline: .5rem; }
.cost-name { margin-bottom: 1rem; }
.cost-row-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap: 1rem; }
.cost-remove { margin-top: 1rem; }
.cost-edit-actions,.cost-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-block: 1.25rem; }
.cost-page .cost-actions>* { max-width: 100%; }
.cost-page .cost-actions a:not(.button) { display: inline-flex; min-height: 48px; align-items: center; }
.cost-status:empty { display: none; }
.cost-status { border-left: 3px solid #7b592b; padding-left: 1rem; }
.cost-error { border: 2px solid #a12b22; border-radius: .75rem; padding: 1rem; background: #fff1ed; color: #7c2019; }
.cost-results { margin-top: 2rem; border-top: 2px solid var(--line); padding-top: 2rem; }
.cost-totals { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap: 1rem; }
.cost-totals>div { min-width: 0; border: 1px solid #d6c19e; padding: 1rem; border-radius: 1rem; background: #fff0c9; }
.cost-totals dt { font-weight: 700; }
.cost-totals dd { margin: .5rem 0 0; font-size: 1.65rem; line-height: 1.25; font-weight: 850; }
.cost-summary { font-size: 1rem; color: #654a39; }
.cost-breakdown { display: grid; gap: 1rem; list-style: none; padding: 0; }
.cost-breakdown li { padding: 1rem; border: 1px solid var(--line); border-radius: .75rem; }
.cost-breakdown h3 { margin-bottom: 1rem; font-size: 1.15rem; }
.cost-breakdown dl { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: .5rem 1rem; margin: 0; }
.cost-breakdown dd { margin: 0; font-weight: 750; text-align: right; }
.cost-method { border-top: 1px solid var(--line); margin-top: 2rem; padding-top: 1.5rem; }
.cost-method p { max-width: 60rem; }
.cost-app-bridge { display: grid; grid-template-columns: minmax(0,1fr) minmax(12rem,18rem); gap: 3rem; align-items: center; padding-block: 4rem; }
.cost-app-bridge figure { margin: 0; }
.cost-app-bridge img { width: 100%; height: auto; object-fit: contain; border-radius: 1.25rem; border: 1px solid var(--line); }
.cost-app-bridge figcaption { font-size: .9rem; margin-top: .75rem; color: #654a39; }
@media (max-width: 55rem) {
  .cost-app-bridge { grid-template-columns: minmax(0,1fr); gap: 2rem; }
  .cost-app-bridge figure { width: min(100%,18rem); justify-self: center; }
}
@media (max-width: 38rem) {
  .cost-intro,.cost-panel,.cost-app-bridge { width: calc(100% - 2rem); }
  .cost-page .site-header { padding-inline: 1rem; }
  .cost-row { padding: .9rem; }
  .cost-edit-actions,.cost-actions { align-items: stretch; flex-direction: column; }
  .cost-edit-actions>* { width: 100%; }
  .cost-page .site-footer { padding-inline: 1rem; }
}
