@layer layout {
  .records-main { padding: 32px 0 48px; }
  .records-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
  .record-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 22px 0 16px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
  .platform-lanes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
}

@layer components {
  nav a.active { color: var(--blue); font-weight: 700; }
  .records-heading small, .platform-section > header small { color: var(--blue); font: 700 9px/1 "Bricolage Grotesque", sans-serif; letter-spacing: .14em; }
  .records-heading h1 { margin-top: 9px; font: 700 34px/1 "Bricolage Grotesque", "Noto Sans SC", sans-serif; }
  .records-heading p { margin-top: 10px; color: var(--muted); font-size: 12px; }
  .records-heading button { border: 1px solid var(--blue); background: var(--blue); color: white; padding: 11px 17px; cursor: pointer; font-weight: 700; }
  .records-heading button.loading { opacity: .55; pointer-events: none; }
  .record-metrics article { min-height: 96px; padding: 16px 18px; background: var(--surface); }
  .record-metrics span, .record-metrics small { display: block; color: var(--muted); font-size: 10px; }
  .record-metrics strong { display: block; margin: 10px 0 8px; font: 700 26px/1 "Bricolage Grotesque", sans-serif; }
  .platform-section, .record-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
  .platform-section { padding: 18px; }
  .platform-section > header { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
  .platform-section h2 { margin-top: 7px; font-size: 15px; }
  .platform-section > header > span { color: var(--muted); font-size: 10px; }
  .platform-lanes article { padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); }
  .platform-lanes article.running { border-color: #b9d0ff; background: var(--blue-soft); }
  .platform-lanes header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
  .platform-lanes header span { font-size: 11px; font-weight: 700; }
  .platform-lanes header b { color: var(--muted); font-size: 8px; }
  .platform-lanes article.running header b { color: var(--blue); }
  .platform-lanes strong { display: block; margin: 14px 0 10px; font: 700 22px/1 "Bricolage Grotesque", sans-serif; }
  .platform-lanes strong small { color: var(--muted); font-size: 11px; }
  .platform-lanes article > div { height: 3px; overflow: hidden; background: var(--line); }
  .platform-lanes article > div i { display: block; height: 100%; background: var(--blue); transition: width .25s; }
  .platform-lanes p { margin-top: 9px; color: var(--muted); font-size: 9px; }
  .lane-empty { grid-column: 1 / -1; padding: 24px; color: var(--muted); text-align: center; }
  .record-panel { margin-top: 16px; overflow: hidden; }
  .record-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .platform-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
  .platform-tabs button { border: 1px solid var(--line); background: var(--surface); padding: 7px 11px; color: var(--muted); cursor: pointer; font-size: 10px; }
  .platform-tabs button.selected { border-color: var(--blue); background: var(--blue-soft); color: var(--blue); font-weight: 700; }
  .record-filter-group { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
  .record-toolbar label { color: var(--muted); font-size: 10px; }
  .record-toolbar select { margin-left: 8px; border: 1px solid var(--line); background: white; padding: 7px 9px; }
  .record-table-wrap { overflow-x: auto; }
  .record-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .record-table th { padding: 11px 13px; background: var(--surface-soft); color: var(--muted); text-align: left; font-size: 10px; font-weight: 600; }
  .record-table td { padding: 13px; border-top: 1px solid var(--line); font-size: 11px; vertical-align: middle; }
  .record-table th:nth-child(1) { width: 148px; }
  .record-table th:nth-child(2) { width: 180px; }
  .record-table th:nth-child(3) { width: 100px; }
  .record-table th:nth-child(4) { width: 90px; }
  .record-table th:nth-child(5) { width: 84px; }
  .record-table th:nth-child(6) { width: 70px; }
  .record-table th:nth-child(7) { width: 90px; }
  .record-table td time { color: var(--muted); white-space: nowrap; }
  .record-table td > b, .record-table td > small { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .record-table td > small { margin-top: 4px; color: var(--muted); font-size: 9px; }
  .record-status { display: inline-block; padding: 4px 7px; border-radius: 999px; background: var(--green-soft); color: var(--green); font-size: 8px; font-weight: 700; }
  .record-status.partial { background: var(--orange-soft); color: var(--orange); }
  .record-status.failed { background: #fff0f0; color: var(--red); }
  .record-status.skipped { background: var(--surface-soft); color: var(--muted); }
  .duration { font-family: "Bricolage Grotesque", sans-serif; }
  .record-message { display: block; overflow: hidden; color: var(--red); white-space: nowrap; text-overflow: ellipsis; }
  .record-message.empty { color: var(--muted); }
  .record-loading { height: 180px; color: var(--muted); text-align: center; }
  .record-pagination { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; }
  .record-pagination > div { display: flex; align-items: center; gap: 10px; }
  .record-pagination button { border: 1px solid var(--line-strong); background: white; padding: 7px 11px; cursor: pointer; }
  .record-pagination button:disabled { opacity: .35; cursor: default; }
}

@layer responsive {
  @media (max-width: 900px) {
    .platform-lanes { grid-template-columns: repeat(2, 1fr); }
    .record-metrics { grid-template-columns: repeat(2, 1fr); }
  }
  @media (max-width: 540px) {
    .records-main { padding-top: 24px; }
    .records-heading { align-items: start; }
    .records-heading h1 { font-size: 30px; }
    .records-heading p { max-width: 230px; line-height: 1.7; }
    .record-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
    .record-filter-group { width: 100%; justify-content: space-between; }
    .record-metrics article { min-height: 92px; padding: 14px; }
    .platform-lanes { grid-template-columns: 1fr; }
    .record-toolbar { align-items: start; flex-direction: column; }
    .record-pagination { align-items: start; flex-direction: column; gap: 12px; }
  }
}
