/* Compact spacing with readable labels and full-size keyboard/touch controls. */
@media screen {
  html { scroll-behavior: auto; scroll-padding-top: 20px; }
  body { font-size: 16px; line-height: 1.5; }
  .wrap { width: min(1120px, calc(100% - 48px)); }
  .site-header { min-height: 64px; height: auto; padding-block: 10px; width: min(1200px, calc(100% - 48px)); }
  .site-header nav { gap: 24px; font-size: 14px; }
  .site-header nav a, .header-note, .site-footer a { display: inline-flex; align-items: center; min-height: 44px; }
  .site-header nav .active:after { bottom: -10px; }
  .brand { font-size: 22px; min-height: 44px; }
  .hero { display: block; padding-block: 22px 20px; }
  .hero h1 { font-size: 36px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -1px; }
  .hero-copy { font-size: 16px; line-height: 1.5; max-width: 780px; }
  .workspace { gap: 16px; border: 0; border-radius: 0; background: transparent; box-shadow: none; overflow: visible; align-items: start; }
  .input-panel { border: 1px solid #bccbd7; border-radius: 8px; background: white; padding: 20px; }
  .panel-heading { margin-bottom: 16px; }
  .panel-heading h2, .result-heading h2 { font-size: 20px; line-height: 1.3; }
  .step-tag { font-size: 13px; width: 26px; height: 26px; flex-shrink: 0; }
  .unit-panel { padding-bottom: 14px; margin-bottom: 14px; }
  .unit-toggle { gap: 10px; }
  .unit-toggle legend, .shape-picker legend, .field label, .allowance-row label { font-size: 15px; line-height: 1.4; }
  .unit-toggle legend, .shape-picker legend { margin-bottom: 7px; }
  .unit-toggle span { height: auto; min-height: 60px; padding: 9px 12px; border-color: #8095a6; }
  .unit-toggle input:checked+span { padding: 8px 11px; }
  .unit-toggle span strong { font-size: 16px; padding-right: 16px; }
  .unit-toggle span small { font-size: 13px; line-height: 1.4; margin-top: 1px; max-width: none; }
  .unit-panel .input-hint, .input-hint, .hint-inline { font-size: 13px; line-height: 1.45; }
  .input-hint, .unit-panel .input-hint { margin-top: 7px; }
  .shape-picker { gap: 8px; margin-bottom: 14px; }
  .shape-picker label > span { min-height: 48px; height: auto; padding: 9px 7px; flex-direction: row; gap: 7px; font-size: 14px; line-height: 1.3; border-color: #8095a6; }
  .shape-picker svg { width: 26px; height: 22px; flex-shrink: 0; }
  .dimension-grid { gap: 12px; }
  .field label { margin-bottom: 5px; }
  input[type=number], select { height: 44px; font-size: 17px; padding-block: 8px; border-color: #8095a6; }
  select { font-size: 16px; }
  input::placeholder { font-size: 15px; color: #526171; }
  .input-wrap > span { font-size: 14px; }
  .compact input { font-size: 17px; }
  .allowance-row { margin-top: 14px; }
  .allowance-hint { margin-top: 3px; }
  .bag-row { margin-top: 14px; }
  .bag-row .field + .field { margin-top: 10px; }
  .cost-options { margin-top: 14px; }
  .cost-options summary { font-size: 15px; min-height: 48px; padding-block: 12px; }
  .optional { font-size: 12px; letter-spacing: 0; }
  .cost-fields > p { font-size: 14px; }
  .form-bottom { gap: 12px; padding-top: 12px; flex-wrap: wrap; }
  .form-bottom > span { font-size: 13px; flex: 1 1 180px; }
  .form-actions { display: flex; gap: 10px; align-items: center; }
  .text-button { min-height: 44px; min-width: 52px; font-size: 14px; padding-inline: 5px; }
  .estimate-button { min-height: 44px; padding: 9px 16px; border: 1px solid #215b91; border-radius: 5px; background: #215b91; color: white; font-weight: 700; font-size: 15px; }
  .estimate-button:hover { background: #17446f; }
  .result-panel { position: sticky; top: 16px; align-self: start; padding: 22px; border: 1px solid #142d43; border-radius: 8px; }
  .result-heading { margin-bottom: 20px; flex-wrap: wrap; }
  .live-badge { font-size: 11px; }
  .total-label { font-size: 13px; line-height: 1.5; letter-spacing: .3px; gap: 6px; flex-wrap: wrap; }
  .total-label > span { font-size: 11px; letter-spacing: .2px; padding: 3px 6px; }
  .volume-main { gap: 10px; margin-top: 8px; }
  .volume-main output { font-size: 58px; }
  .volume-main > span { font-size: 18px; }
  .secondary-volume { font-size: 15px; margin: 5px 0 16px; }
  .bag-result { padding: 12px 15px; gap: 12px; }
  .bag-result output { font-size: 34px; }
  .bag-result div > span { font-size: 18px; }
  .bag-result small { font-size: 14px; line-height: 1.5; }
  .breakdown { margin-top: 16px; padding-top: 12px; gap: 8px; }
  .breakdown > div, .cost-result > div { font-size: 14px; }
  .calculation-details { margin-top: 12px; border-top: 1px solid #526c80; border-bottom: 1px solid #526c80; }
  .calculation-details summary { min-height: 44px; padding-block: 11px; color: #e2edf7; font-size: 14px; font-weight: 600; cursor: pointer; }
  .calculation-details .pour-drawing { height: 140px; margin: 0; }
  .calculation-formula { font-size: 13px; line-height: 1.5; margin: 0 0 12px; padding: 10px; }
  .cost-result { margin-top: 14px; padding-top: 12px; }
  .cost-result h3 { font-size: 16px; }
  .cost-result strong { font-size: 18px; }
  .cost-result p { font-size: 13px; }
  .result-actions { margin-top: 16px; }
  .result-actions button { min-height: 44px; font-size: 15px; }
  .result-disclaimer { font-size: 13px; line-height: 1.5; margin: 12px 0 0; }
  .action-status { font-size: 14px; }
  #error-state { padding-top: 10px; min-height: 140px; }
  #error-message { font-size: 16px; }
  :focus-visible { outline: 3px solid #215b91; outline-offset: 3px; }
  .unit-toggle input:focus-visible + span, .shape-picker input:focus-visible + span { outline: 3px solid #215b91; outline-offset: 3px; }
  .result-panel :focus-visible { outline: 3px solid #b8dcff; outline-offset: 4px; }
  .trust-strip { padding-block: 14px; font-size: 13px; gap: 10px 25px; flex-wrap: wrap; }
  .eyebrow, .guide-number, .example-math > span { font-size: 12px; }
  .guide-section { padding-top: 32px; }
  .section-intro { margin-bottom: 18px; }
  .section-intro > p, .guide-cards p, .reference-copy > p, .example-section p, .faq-section > div > p, .faq-list p { font-size: 15px; line-height: 1.6; }
  .guide-cards article { padding: 20px; }
  .guide-cards .small-copy, .table-shell > p, .method-section .small-copy { font-size: 13px; }
  .formula { font-size: 13px; }
  .reference-section { padding-block: 32px; gap: 32px; }
  .arrow-link { font-size: 14px; }
  .table-shell table { font-size: 15px; }
  .table-shell thead th { font-size: 12px; padding: 10px; }
  .table-shell tbody td, .table-shell tbody th { padding: 10px; }
  .highlight-row th > span { display: none; }
  .example-section { margin-block: 28px; padding: 24px; gap: 28px; }
  .primary-button { min-height: 44px; font-size: 14px; }
  .example-math { padding: 20px; }
  .example-math > div { font-size: 14px; }
  .faq-section { padding-block: 20px 30px; }
  .faq-list summary { font-size: 16px; min-height: 48px; padding-block: 14px; }
  .method-section { padding-block: 22px; }
  .method-section p { font-size: 14px; line-height: 1.65; }
  .site-footer { padding-block: 16px; gap: 16px; }
  .site-footer > div { font-size: 14px; gap: 16px; flex-wrap: wrap; }
  .privacy-content { padding-block: 32px; }
}
@media screen and (max-width: 1000px) {
  .header-note { display: none; }
}
@media screen and (max-height: 740px) {
  .result-panel { position: static; }
}
@media screen and (max-width: 760px) {
  .wrap, .site-header { width: calc(100% - 28px); }
  .site-header { min-height: 60px; padding-block: 7px; gap: 8px; }
  .site-header nav { font-size: 14px; }
  .brand { font-size: 20px; gap: 7px; }
  .brand svg { width: 26px; height: 26px; }
  .hero { padding-block: 18px 16px; }
  .hero h1 { font-size: 32px; }
  .workspace { gap: 14px; }
  .input-panel, .result-panel { padding: 18px; }
  .result-panel { position: static; }
  .shape-picker label > span { flex-direction: column; gap: 4px; padding: 8px 4px; }
  .shape-picker svg { display: none; }
  .section-intro h2, .reference-copy h2, .example-section h2, .faq-section h2 { font-size: 25px; }
  .trust-strip { gap: 8px 18px; }
  .site-footer { gap: 5px; }
}
@media screen and (max-width: 390px) {
  .brand { font-size: 18px; }
  .hero h1 { font-size: 30px; }
  .input-panel, .result-panel { padding: 15px; }
  .unit-toggle span { padding-inline: 9px; }
  .unit-toggle input:checked + span { padding-inline: 8px; }
  .unit-toggle span small { font-size: 12px; }
  .panel-heading h2, .result-heading h2 { font-size: 18px; }
  .volume-main output { font-size: 52px; }
  .volume-main > span { font-size: 16px; }
  .form-bottom > span { flex-basis: 100%; }
  .form-actions { width: 100%; justify-content: space-between; }
}
@media (forced-colors: active) {
  .unit-toggle input:checked + span, .shape-picker input:checked + span { border: 3px solid Highlight; }
  .estimate-button, .result-actions button { border: 1px solid ButtonText; }
}
@media print {
  .form-actions, .estimate-button, .calculation-details { display: none !important; }
}
