/* Match the proportions of the approved desktop composition. */
@media (min-width: 1631px) {
  body { background: #f6f8f7; }
  body > .site-header,
  body > .hero,
  body > main,
  body > .site-footer { max-width: 1680px; margin-inline: auto; }
  body > main { background: #fff; }
}

@media (min-width: 1401px) {
  .site-header { height: 70px; }
  .hero { height: 285px; min-height: 285px; }
  .hero .hero-copy { padding-top: 35px; }
  .card-grid { padding: 19px 20px 18px; }
  .card,
  .input-card,
  .result-card,
  .viz-card { height: 526px; min-height: 0; }
  .input-card .card-body,
  .result-card .card-body,
  .viz-card .viz-body { height: calc(100% - 58px); min-height: 0; }
  .viz-card .viz-svg { transform: translateY(-4px); }
  .result-card .tile b { min-height: 24px; }
  .result-card .result-notes { min-height: 176px; margin-top: 13px; }
  .result-card .result-notes ul { font-size: 15px; line-height: 1.45; }

  .input-card.has-feedback { height: auto; min-height: 526px; overflow: visible; }
  .input-card.has-feedback .card-body { height: auto; min-height: 466px; }
  .result-card.manual-open { height: auto; min-height: 640px; }
  .result-card.manual-open .card-body { height: auto; min-height: 580px; }
}

@media (min-width: 1200px) and (max-width: 1600px) {
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .site-header { height: auto; min-height: 112px; flex-wrap: wrap; padding: 8px 25px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .site-header .brand { min-width: max-content; flex-shrink: 0; height: 50px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .site-header nav { order: 3; width: 100%; height: 44px; padding: 0; border: 0; gap: 28px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .site-header nav a { height: 42px; font-size: 17px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .header-actions { gap: 14px; }
}

@media (min-width: 901px) and (max-width: 1400px) {
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .hero { height: auto; min-height: 289px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .hero-photo { height: 100%; object-fit: cover; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .hero-copy { padding-bottom: 22px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .feature-row { flex-wrap: wrap; max-width: 900px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .card { height: auto; min-height: 560px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .card-head { height: auto; min-height: 58px; padding-block: 8px; line-height: 1.2; white-space: normal; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .input-card .card-body { height: auto; min-height: 0; padding-bottom: 20px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .input-card .mount { height: auto; min-height: 69px; padding-block: 6px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .input-card .input-actions { position: static; margin-top: 20px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .result-card .card-body { height: calc(100% - 58px); min-height: 474px; padding-bottom: 100px; }
}

@media (min-width: 901px) and (max-width: 1199px) {
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .viz-card { height: 550px; min-height: 550px; }
}

/* Three cards remain readable when desktop display scaling narrows the CSS viewport. */
@media (min-width: 1401px) and (max-width: 1600px) {
  .input-card,
  .result-card,
  .viz-card { height: clamp(526px, calc(860px - 21vw), 560px); }
  .input-card .mount-row { margin-left: 0; gap: 8px; }
  .input-card .mount { padding: 4px 8px; gap: 7px; font-size: 14px; }
  .input-card .mount>img:not(.selected-check) { width: 32px; height: 32px; }
  .input-card .mount small { font-size: 12px; }
}

/* Align the 1672×941 composition with the approved mockup's card edges. */
@media (min-width: 1601px) {
  .site-header { height: 73px; }
  .hero { height: 289px; min-height: 289px; }
  .card-grid { padding: 21px 20px 19px 23px; }
  .card,
  .input-card,
  .result-card,
  .viz-card { height: auto; min-height: 540px; }
  .input-card.has-feedback .card-body { min-height: 0; padding-bottom: 18px; }
}

@media (min-width: 1001px) and (max-width: 1400px) {
  .input-card,
  .result-card,
  .viz-card { height: 560px; min-height: 560px; }
  .input-card .card-body,
  .result-card .card-body,
  .viz-card .viz-body { height: calc(100% - 58px); min-height: 0; }
  .input-card .card-body { padding-bottom: 80px; }
  .input-card .mount-row { margin-left: 0; gap: 6px; grid-template-columns: 1fr 1fr; }
  .input-card .mount { height: 70px; min-height: 70px; padding: 4px 5px; gap: 5px; font-size: clamp(12px, 1vw, 14px); line-height: 1.18; }
  .input-card .mount>img:not(.selected-check) { width: 28px; height: 28px; }
  .input-card .mount small { font-size: clamp(11px, .9vw, 13px); }
  .input-card .allowance-row select { font-size: 13px; padding: 0 6px; }
  .input-card .input-actions { position: absolute; left: 20px; right: 20px; bottom: 18px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 10px; margin-top: 0; }
  .input-card .input-actions button { font-size: clamp(17px, 1.5vw, 21px); gap: 8px; }
  .result-card .card-body { padding-bottom: 90px; }
  .result-card .result-actions { left: 20px; right: 20px; gap: 10px; }
  .result-card .result-actions button { font-size: clamp(16px, 1.35vw, 19px); gap: 6px; }
  .result-card .result-actions img { width: 22px; height: 22px; }
  .result-card .result-notes h3 { font-size: clamp(14px, 1.25vw, 17px); }

  .input-card.has-feedback { height: auto; min-height: 560px; overflow: visible; }
  .input-card.has-feedback .card-body { height: auto; min-height: 502px; }
  .result-card.manual-open { height: auto; min-height: 640px; }
  .result-card.manual-open .card-body { height: auto; min-height: 580px; }
}

@media (min-width: 1200px) and (max-width: 1400px) {
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .input-card .input-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}

/* Two narrow tablet columns force long locale labels into character wraps. */
@media (min-width: 681px) and (max-width: 900px) {
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .viz-card { grid-column: auto; }
  .input-card .mount { padding-inline: 12px; gap: 10px; font-size: 14px; }
  .input-card .mount>span { overflow-wrap: normal; }
}

/* Long translated labels need natural vertical space while Korean keeps the approved mockup geometry. */
@media (min-width: 1401px) {
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .site-header { padding-left: 30px; padding-right: 25px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .site-header .brand { min-width: max-content; flex-shrink: 0; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .site-header nav { gap: 20px; padding-left: 20px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .header-actions { gap: 14px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .hero { height: auto; min-height: 285px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .hero-photo { height: 100%; object-fit: cover; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .hero-copy { padding-bottom: 24px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .feature-row { flex-wrap: wrap; max-width: 900px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .card { height: auto; min-height: 532px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .card-head { height: auto; min-height: 58px; padding-block: 8px; line-height: 1.2; font-size: 22px; white-space: normal; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .input-card .card-body { height: auto; min-height: 0; padding-bottom: 20px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .input-card .mount { height: auto; min-height: 69px; padding-block: 6px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .input-card .input-actions { position: static; margin-top: 20px; }
  html:not([lang="ko"]):not([lang="ja"]):not([lang="ar"]) .result-card .card-body { height: calc(100% - 58px); min-height: 474px; padding-bottom: 100px; }
}
