/* Mobile-first density pass for ReeferMetric.
   Keeps the commercial shell intact while making field entry faster on phones. */

html { scroll-padding-top: 58px; }

@media (max-width: 620px) {
  .site-header,
  main,
  footer,
  #reefermetric-app-nav {
    width: min(100% - 20px, 1080px);
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand brand"
      "runtime account";
    gap: 8px 10px;
    padding: 10px 0 9px;
  }

  .brand-kicker {
    margin-bottom: 3px;
    font-size: .54rem;
    letter-spacing: .14em;
  }

  .site-header h1 {
    font-size: clamp(1.75rem, 9vw, 2.05rem);
  }

  .runtime-status {
    align-self: center;
    flex-wrap: nowrap;
    overflow: hidden;
    min-width: 0;
  }

  .runtime-status strong {
    font-size: .7rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .runtime-status small { display: none; }

  .rm-header-account {
    justify-self: end;
    gap: 2px;
  }

  .rm-header-account button {
    min-height: 30px;
    padding: 0 7px;
    font-size: .68rem;
  }

  .rm-header-account-button { border-radius: 8px; }

  #reefermetric-app-nav {
    gap: 24px;
  }

  #reefermetric-app-nav button {
    min-height: 42px;
    font-size: .75rem;
  }

  main {
    padding-top: 12px;
    padding-bottom: calc(130px + env(safe-area-inset-bottom));
    gap: 13px;
  }

  .scope-banner {
    padding: 8px 10px;
  }

  .scope-banner strong { font-size: .59rem; }
  .scope-banner p {
    margin-top: 2px;
    font-size: .72rem;
    line-height: 1.34;
  }

  .cycle-panel,
  .input-panel,
  .record-panel,
  .saved-panel,
  .results-panel {
    padding: 12px;
    border-radius: 12px;
  }

  .section-heading {
    margin-bottom: 10px;
    gap: 8px;
  }

  .section-heading h2 {
    font-size: 1.18rem;
  }

  .eyebrow {
    margin-bottom: 2px;
    font-size: .59rem;
  }

  .proof-rule {
    padding: 5px 7px;
    font-size: .55rem;
  }

  .cycle-diagram {
    height: clamp(210px, 55vw, 250px);
    aspect-ratio: auto;
  }

  .pressure-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .pressure-grid > label:nth-child(3),
  .pressure-grid > label:nth-child(4) {
    grid-column: 1 / -1;
  }

  .input-grid label,
  .point-input {
    font-size: .76rem;
  }

  .input-grid label > small {
    font-size: .65rem;
    line-height: 1.3;
  }

  .input-wrap {
    min-height: 42px;
  }

  .input-wrap input {
    padding: 8px 10px;
    font-size: .94rem;
  }

  .input-wrap b {
    padding: 0 9px;
    font-size: .65rem;
  }

  .point-inputs {
    gap: 8px;
    margin-top: 11px;
  }

  .point-input {
    grid-template-columns: 32px minmax(0, 1fr) minmax(92px, 34%);
    gap: 8px;
    align-items: center;
    min-height: 58px;
    padding: 7px 8px;
  }

  .point-input .input-wrap {
    grid-column: 3;
    grid-row: 1;
    min-height: 40px;
  }

  .point-input > span:nth-child(2) {
    line-height: 1.2;
  }

  .point-badge {
    width: 30px;
    height: 30px;
    font-size: .82rem;
  }

  .derived-input {
    grid-template-columns: 32px minmax(0, 1fr);
    min-height: 54px;
    padding: 7px 8px;
  }

  .derived-input strong { font-size: .76rem; }
  .derived-input small {
    margin-top: 1px;
    font-size: .65rem;
    line-height: 1.25;
  }

  .actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
  }

  .actions button {
    min-height: 44px;
    padding-inline: 9px;
    font-size: .73rem;
    line-height: 1.15;
  }

  footer {
    padding-bottom: calc(120px + env(safe-area-inset-bottom));
  }
}
