/* Responsive layout for the public Time Observatory. */
@media screen and (max-width: 48rem) {
  .hero h1,
  .observatory :is(h2, h3, h4, .pill, .metric strong, .meta-note),
  .mission-strip,
  .source-readout,
  [data-source-identifier],
  .traffic-retained,
  .contact-card,
  #contact-title,
  .station-details dt,
  .metric :is(p, small, button),
  .stats-row :is(span, strong),
  .source-key :is(dt, dd),
  .stratum-chain li {
    overflow-wrap: anywhere;
  }

  .site-nav > a,
  .observatory :is([role="tabpanel"], .chart-container, .section-head > *, .station-heading > *),
  .source-controls label,
  #fleet-slots > div,
  .traffic-retained > div > *,
  .dow-filters label,
  .dow-heat-controls > * {
    min-width: 0;
  }

  .time-display .button,
  .site-nav nav a,
  .text-button,
  .section-head > .button,
  #observatory-tabs button {
    max-inline-size: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  #observatory-tabs {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.25rem), 1fr));
  }

  .section-head > :is(.button, .text-button) {
    flex-shrink: 1;
    text-align: start;
  }

  #hardware, #compare-hardware {
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  .history-toolbar :is(label, select),
  .source-controls :is(label, select),
  .dow-filters :is(label, select) {
    max-inline-size: 100%;
  }

  .source-graphs {
    grid-template-columns: minmax(0, 1fr);
  }

  .source-lanes {
    grid-template-columns: minmax(0, 54%) minmax(0, 1fr);
  }

  /* Lane labels share the 30px track pitch of the source timeline. */
  .lane-labels li {
    display: block;
    overflow: hidden;
    line-height: 30px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .dow-heat-controls,
  .dow-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  }

  .dow-heat-controls :is(input, select),
  .dow-filters select {
    min-inline-size: 0;
    inline-size: 100%;
  }

  .dow-heat-date-nav button {
    flex: 1 1 0;
    overflow-wrap: anywhere;
  }

  .dow-heat-legend li {
    min-inline-size: 0;
    overflow-wrap: anywhere;
  }

  .dow-heat-scroll,
  .table-scroll,
  .dow-operator-table {
    min-inline-size: 0;
    max-inline-size: 100%;
  }
}

@media screen and (max-width: 30rem) {
  .clock-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    justify-items: center;
  }

  .clock-panel > :is(.panel-top, .clock-face, .clock-time, .clock-date, .clock-caveat) {
    grid-area: auto;
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  .clock-panel .clock-face {
    inline-size: min(8.25rem, 100%);
  }

  .clock-panel .clock-time {
    font-size: clamp(1.35rem, 6vw, 2.15rem);
  }

  .clock-date {
    overflow-wrap: anywhere;
  }

  #fleet-slots {
    grid-template-columns: minmax(0, 1fr);
  }

  .traffic-retained > div {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .stratum-chain {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 6rem), 1fr));
  }

  .history-toolbar .select-label,
  .chart-controls .select-label,
  .source-controls label {
    width: 100%;
  }

  .history-toolbar select,
  .chart-controls select,
  .source-controls select {
    width: 100%;
  }
}
