*,
*::before,
*::after {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  line-height: 1.5;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans CJK JP", sans-serif;
  color: #1a1a1a;
  background: #f4f4f5;
}

a {
  color: #0b57d0;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: #fff;
  border-bottom: 1px solid #d8d8dc;
  padding: 0.75rem 1rem;
}

.site-header-after {
  border-bottom: 0;
  border-top: 1px solid #d8d8dc;
  margin-bottom: 1rem;
}

.overview-hero h2 {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
}

.overview-hero .section-hint {
  margin: 0 0 0.75rem;
  color: #555;
}

.site-header-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.site-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.site-nav {
  display: block;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  display: inline-block;
  margin-right: 1rem;
}

.site-nav-sub {
  margin-top: 0.35rem;
  font-size: 0.85rem;
}

.site-nav a.is-active {
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: underline;
}

.bench-summary {
  margin: 1rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid #e8e8ec;
}

.site-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
  border-top: 1px solid #e0e0e4;
  font-size: 0.8rem;
  color: #555;
}

.view-switch {
  margin-bottom: 0.35rem;
}

.view-switch-label {
  display: inline-block;
  min-width: 4.5rem;
  color: #666;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.view-switch a {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.2rem 0.45rem;
  border: 1px solid #d0d0d8;
  border-radius: 3px;
}

.view-switch a.is-active {
  background: #eef2f8;
  border-color: #9fb4d4;
  color: #1a1a1a;
  font-weight: 600;
  text-decoration: none;
}

.view-switch-state {
  margin-top: 0.35rem;
  color: #777;
}

.bench-overall {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
}

.bench-suite-ver {
  color: #666;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.bench-cat-scores dt {
  display: inline-block;
  width: 12rem;
  color: #555;
}

.bench-cat-scores dd {
  display: inline;
  margin: 0;
  font-weight: 600;
}

.bench-cat-scores dd:after {
  content: "";
  display: block;
}

.bench-stage {
  width: 320px;
  height: 240px;
  overflow: hidden;
  border: 1px solid #d8d8dc;
  background: #fff;
  margin-top: 1rem;
}

/* The stage during a run: wide enough to actually watch the work happen. */
.bench-stage-live {
  width: auto;
  max-width: 560px;
  height: 220px;
  margin: 0.5rem 0 0.35rem;
  border: 2px solid #3366cc;
}

.bench-run-head {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.bench-run-name {
  margin: 0 0 0.5rem;
  color: #444;
}

.bench-run-meta {
  margin: 0.35rem 0 0;
  color: #555;
  font-size: 0.9rem;
}

.bench-beat {
  color: #d0d0d8;
  font-size: 0.8rem;
}

.bench-beat.is-on {
  color: #3366cc;
}

.bench-hint {
  margin: 0 0 0.5rem;
  color: #666;
  font-size: 0.8rem;
  max-width: 560px;
}

.bench-ticker {
  max-width: 560px;
  font-size: 0.8rem;
  color: #555;
  border-top: 1px solid #e8e8ec;
  padding-top: 0.35rem;
}

.bench-ticker-row {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.5;
}

.bench-ticker-row:first-child {
  color: #1a1a1a;
  font-weight: 600;
}

.bench-dim {
  color: #888;
}

.bench-up {
  color: #1b6b2f;
}

.bench-down {
  color: #b00020;
}

tr.is-skipped td {
  color: #888;
}

.bench-extra {
  font-size: 0.75rem;
  color: #555;
  font-weight: 400;
  margin-top: 0.2rem;
}

.mode-list label {
  display: block;
  margin: 0.25rem 0;
}

.compare-panes textarea {
  width: 100%;
  min-height: 10rem;
  margin-bottom: 0.75rem;
}

.summary-bar {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #eef3fb;
  border: 1px solid #c8d8f0;
  font-size: 0.875rem;
}

.summary-bar span {
  margin-right: 1rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

section {
  margin-bottom: 1.5rem;
  background: #fff;
  border: 1px solid #d8d8dc;
  padding: 1rem;
}

section h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  border-bottom: 1px solid #e8e8ec;
  padding-bottom: 0.35rem;
}

section h3 {
  margin: 1rem 0 0.5rem;
  font-size: 0.95rem;
}

dl.data-list {
  margin: 0;
}

dl.data-list dt {
  font-weight: 600;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #555;
}

dl.data-list dd {
  margin: 0.15rem 0 0;
  font-family: ui-monospace, "Cascadia Code", "Source Code Pro", Menlo, monospace;
  font-size: 0.85rem;
  word-break: break-all;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

table.data-table th,
table.data-table td {
  border: 1px solid #e0e0e4;
  padding: 0.35rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

table.data-table th {
  background: #f0f0f4;
  font-weight: 600;
}

.status-ok {
  color: #0a6b2e;
}

.status-fail {
  color: #b00020;
}

.status-warn {
  color: #8a5a00;
}

.status-info {
  color: #555;
}

.overview-hero {
  background: #fff;
  border: 1px solid #d8d8dc;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

.ua-primary {
  margin-bottom: 1rem;
}

.ua-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.15rem;
}

.ua-browser {
  color: #1a1a1a;
}

.ua-version {
  color: #555;
  font-weight: 500;
}

.ua-on {
  font-size: 1.05rem;
  font-weight: 500;
  color: #555;
  margin-bottom: 0.6rem;
}

.ua-engine-line {
  margin-bottom: 0.75rem;
}

.ua-string {
  font-family: ui-monospace, monospace;
  font-size: 0.8rem;
  color: #444;
  word-break: break-all;
  line-height: 1.4;
  padding: 0.5rem 0.65rem;
  background: #f4f4f6;
  border: 1px solid #e0e0e4;
}

.notables {
  display: block;
  margin: 1rem 0;
}

.notable {
  border: 1px solid #e0e0e4;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.5rem;
  background: #fafafa;
}

.notable-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #666;
  margin-bottom: 0.15rem;
}

.notable-value {
  font-weight: 600;
  font-size: 0.95rem;
}

.notable-detail {
  font-size: 0.8rem;
  color: #555;
  margin-top: 0.15rem;
  word-break: break-word;
}

.notable-yes {
  border-left: 4px solid #2e7d32;
}

.notable-no {
  border-left: 4px solid #c62828;
}

.notable-warn {
  border-left: 4px solid #e65100;
}

.notable-neutral {
  border-left: 4px solid #90a4ae;
}

.inference-secondary {
  padding: 0.75rem 0;
  border-top: 1px solid #e8e8ec;
  border-bottom: 1px solid #e8e8ec;
  margin-bottom: 1rem;
}

.inference-row {
  font-size: 1.05rem;
}

.inference-label {
  color: #666;
  margin-right: 0.5rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.inference-value {
  font-weight: 600;
}

.inference-sub {
  font-size: 0.85rem;
  color: #555;
  margin-top: 0.35rem;
}

.pill {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-right: 0.35rem;
  margin-bottom: 0.25rem;
  border: 1px solid #c8d0dc;
  background: #eef2f8;
  color: #334;
}

.pill-ua {
  background: #e8eef8;
}

.highlights {
  display: block;
  margin-bottom: 1rem;
}

.highlight-card {
  border: 1px solid #e0e0e4;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.highlight-card p {
  margin: 0.25rem 0 0;
  color: #444;
}

.highlight-unusual {
  border-color: #e8a030;
  background: #fff8eb;
}

.highlight-unusual strong {
  color: #8a5500;
}

.highlight-warning {
  border-color: #e07070;
  background: #fff0f0;
}

.highlight-note {
  border-color: #b8c8e0;
  background: #f4f8ff;
}

.mismatch-summary {
  display: block;
  margin-bottom: 1rem;
}

.mismatch-box {
  border: 1px solid #e0e0e4;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #fafafa;
}

.mismatch-box h3 {
  margin: 0 0 0.25rem;
  font-size: 0.95rem;
}

.mismatch-count {
  font-weight: 700;
}

.mismatch-missing {
  border-left: 4px solid #c62828;
}

.mismatch-ahead {
  border-left: 4px solid #e65100;
}

.mismatch-desc {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: #666;
}

.mismatch-list {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.85rem;
  columns: 2;
  column-gap: 1.5rem;
}

.mismatch-list li {
  margin-bottom: 0.2rem;
  break-inside: avoid;
}

.mismatch-list li.empty {
  list-style: none;
  margin-left: -1.1rem;
  color: #888;
}

.mismatch-list li.more {
  color: #666;
  font-style: italic;
}

.section-hint {
  font-size: 0.85rem;
  color: #666;
  margin: -0.25rem 0 0.75rem;
}

.feature-controls {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

.feature-controls label {
  margin-right: 1rem;
}

.feature-controls input[type="text"] {
  width: 4rem;
  margin-left: 0.25rem;
}

.feature-controls button {
  margin-left: 0.5rem;
}

.feature-filter {
  margin-left: 0.5rem;
}

.feature-table-wrap {
  overflow-x: auto;
}

.feature-table tbody tr.feat-row-missing {
  background: #fdecea;
}

.feature-table tbody tr.feat-row-ahead {
  background: #fff3e0;
}

.feature-table tbody tr.feat-row-extra {
  background: #e8f4fd;
}

.feature-table tbody tr.feat-row-ok {
  background: #fff;
}

.feature-table tbody tr.feat-row-neutral {
  background: #f8f8fa;
}

.detail-section {
  margin-bottom: 0.75rem;
  background: #fff;
  border: 1px solid #d8d8dc;
  padding: 0 1rem 0.75rem;
}

.detail-section summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.75rem 0;
  list-style-position: outside;
}

.detail-section[open] summary {
  border-bottom: 1px solid #e8e8ec;
  margin-bottom: 0.75rem;
}

.toolbar {
  margin-bottom: 1rem;
}

button,
.btn {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  border: 1px solid #b8b8c0;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
  border-radius: 3px;
}

button:hover,
.btn:hover {
  background: #f0f0f4;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

.css-grid {
  display: block;
}

.css-cell {
  border: 1px solid #e0e0e4;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  background: #fafafa;
}

.css-sample {
  min-height: 2.5rem;
  margin-bottom: 0.35rem;
}

.media-grid {
  display: block;
}

.media-item {
  border: 1px solid #e0e0e4;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  background: #fafafa;
}

.media-item img,
.media-item video,
.media-item audio {
  max-width: 100%;
  display: block;
  margin-top: 0.5rem;
}

.bench-controls {
  margin-bottom: 1rem;
}

.bench-controls label {
  margin-left: 0.75rem;
  font-size: 0.875rem;
}

.bench-controls input[type="number"] {
  width: 4.5rem;
  margin-left: 0.25rem;
}

.bench-progress {
  height: 0.5rem;
  background: #e8e8ec;
  border: 1px solid #d0d0d8;
  margin-bottom: 0.5rem;
  overflow: hidden;
}

.bench-progress-bar {
  height: 100%;
  width: 0;
  background: #3366cc;
  transition: width 0.15s ease;
}

.bench-results table {
  margin-top: 1rem;
}

.bench-score {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

#bench-category-scores {
  margin-bottom: 1rem;
}

.noscript-notice {
  padding: 0.75rem;
  background: #fff3cd;
  border: 1px solid #e8c060;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}

.json-output {
  width: 100%;
  min-height: 8rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  padding: 0.5rem;
  border: 1px solid #d8d8dc;
  background: #f8f8fa;
}

.hidden {
  display: none;
}

@supports (display: grid) {
  .notables {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.5rem;
    margin: 1rem 0;
  }

  .notable {
    margin-bottom: 0;
  }

  .mismatch-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.75rem;
  }

  .mismatch-box {
    margin-bottom: 0;
  }

  .highlights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0.5rem;
  }

  .highlight-card {
    margin-bottom: 0;
  }

  .css-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
  }

  .css-cell {
    margin-bottom: 0;
  }

  .media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
  }

  .media-item {
    margin-bottom: 0;
  }
}

@supports (display: flex) {
  .site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .site-nav li {
    display: block;
    margin-right: 0;
  }
}
