/**
 * Narrow layout: no cards.
 *
 * On a phone the card look costs three nested paddings (main → section →
 * card) before any text, and one card per row wastes the whole viewport.
 * Here every panel is flat: full-bleed hairlines, exactly one level of
 * horizontal padding, and label/value on a single line. Status that the
 * card border used to carry is moved into the value colour.
 *
 * Loaded only for the narrow layout, after app.css.
 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.layout-narrow,
html.layout-narrow body {
  overflow-x: hidden;
  max-width: 100%;
}

/* One horizontal padding level for the whole page. */
html.layout-narrow main {
  padding: 0;
}

html.layout-narrow .site-header {
  padding: 0.5rem 0.75rem;
}

html.layout-narrow .site-header-after {
  margin-bottom: 0.5rem;
}

html.layout-narrow section,
html.layout-narrow .overview-hero,
html.layout-narrow .detail-section {
  margin-bottom: 0.5rem;
  padding: 0.6rem 0.75rem;
  border-left: 0;
  border-right: 0;
}

html.layout-narrow .detail-section {
  padding-top: 0;
  padding-bottom: 0.5rem;
}

html.layout-narrow .site-title {
  font-size: 1.05rem;
  margin-bottom: 0.35rem;
}

/* Both nav rows wrap into one compact block. */
html.layout-narrow .site-nav-sub {
  margin-top: 0.1rem;
}

html.layout-narrow .site-nav a {
  display: inline-block;
  padding: 0.35rem 0.5rem 0.35rem 0;
  line-height: 1.4;
}

html.layout-narrow button,
html.layout-narrow .btn {
  min-height: 40px;
  padding: 0.5rem 0.8rem;
}

html.layout-narrow .ua-title {
  font-size: 1.4rem;
}

html.layout-narrow .ua-on {
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
}

html.layout-narrow .ua-string {
  font-size: 0.7rem;
  padding: 0.4rem 0.45rem;
  line-height: 1.35;
}

/* Notables: flat rows, label left, value right. */
html.layout-narrow .notables {
  display: block;
  margin: 0.6rem 0 0;
}

html.layout-narrow .notable {
  margin: 0;
  padding: 0.4rem 0;
  border: 0;
  border-bottom: 1px solid #ececf0;
  background: none;
}

html.layout-narrow .notable-label {
  margin: 0;
  font-size: 0.66rem;
}

html.layout-narrow .notable-value {
  font-size: 0.9rem;
}

html.layout-narrow .notable-detail {
  margin: 0.1rem 0 0;
  font-size: 0.72rem;
}

/* The card border used to encode status; keep it in the text instead. */
html.layout-narrow .notable-no .notable-value {
  color: #b00020;
}

html.layout-narrow .notable-warn .notable-value {
  color: #8a5a00;
}

html.layout-narrow .mismatch-summary,
html.layout-narrow .highlights,
html.layout-narrow .css-grid,
html.layout-narrow .media-grid {
  display: block;
}

html.layout-narrow .mismatch-box,
html.layout-narrow .css-cell,
html.layout-narrow .media-item {
  margin: 0;
  padding: 0.5rem 0;
  border: 0;
  border-bottom: 1px solid #ececf0;
  background: none;
}

html.layout-narrow .mismatch-box h3 {
  font-size: 0.85rem;
}

html.layout-narrow .mismatch-desc {
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
}

/* Highlights keep a colour bar: the level is the whole point of the card. */
html.layout-narrow .highlight-card {
  margin: 0 0 0.4rem;
  padding: 0.4rem 0 0.4rem 0.5rem;
  border-width: 0 0 0 3px;
  background: none;
}

html.layout-narrow .mismatch-list {
  columns: 1;
  -webkit-columns: 1;
}

html.layout-narrow table.data-table,
html.layout-narrow .feature-table-wrap,
html.layout-narrow .bench-results,
html.layout-narrow #bench-details,
html.layout-narrow #bench-history {
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

html.layout-narrow .feature-controls label {
  display: block;
  margin: 0 0 0.5rem;
}

html.layout-narrow .bench-overall {
  font-size: 2.4rem;
}

html.layout-narrow .bench-cat-scores dt {
  width: 9rem;
}

html.layout-narrow .bench-stage,
html.layout-narrow .bench-ticker,
html.layout-narrow .bench-hint {
  max-width: 100%;
}

html.layout-narrow .bench-stage-live {
  height: 170px;
}

html.layout-narrow .json-output {
  min-height: 5rem;
  font-size: 0.7rem;
}

html.layout-narrow .site-footer {
  padding: 0.75rem;
}

@supports (display: flex) {
  html.layout-narrow #site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0 0.75rem;
  }

  html.layout-narrow .site-nav {
    gap: 0 0.75rem;
  }

  /* Settings-list rhythm: label on the left, value flush right. */
  html.layout-narrow .notable {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0 0.5rem;
  }

  html.layout-narrow .notable-label {
    flex: 0 0 6.5rem;
  }

  html.layout-narrow .notable-value {
    flex: 1 1 auto;
    text-align: right;
  }

  html.layout-narrow .notable-detail {
    flex: 1 0 100%;
    text-align: right;
  }
}
