:root {
  --bg: #050505;
  --bg-deep: #010101;
  --surface: rgba(11, 11, 11, 0.88);
  --surface-strong: rgba(15, 15, 15, 0.96);
  --surface-soft: rgba(20, 20, 20, 0.7);
  --card-hover: rgba(26, 26, 26, 0.96);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.18);
  --t1: #f6f6f6;
  --t2: #d7d7d7;
  --t3: #989898;
  --t4: #5d5d5d;
  --blue: #b9c2cd;
  --green: #ffffff;
  --red: #d97878;
  --amber: #c9ac7a;
  --cyan: #ececec;
  --rose: #8f8f8f;
  --shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, sans-serif;
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 255, 255, 0.08), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.04), transparent 24%),
    linear-gradient(180deg, #090909 0%, #050505 46%, #020202 100%);
  color: var(--t1);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

body.auth-page {
  overflow-x: hidden;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Manrope", sans-serif;
  letter-spacing: -0.02em;
}

button,
select,
input,
textarea {
  font: inherit;
}

.hidden { display: none !important; }
.mono { font-family: "IBM Plex Mono", ui-monospace, monospace; }
.muted { color: var(--t3); }
.overflow-x { overflow-x: auto; }
.data-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.data-scroll::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
.data-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}
.r { text-align: right; }
.pl { padding-left: 20px !important; }
.pr { padding-right: 20px !important; }

.app-shell {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.ambient,
.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.ambient {
  filter: blur(28px);
  opacity: 0.55;
}

.ambient-one {
  background: radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.1), transparent 24%);
  animation: drift-a 18s ease-in-out infinite alternate;
}

.ambient-two {
  background: radial-gradient(circle at 84% 16%, rgba(130, 130, 130, 0.14), transparent 24%);
  animation: drift-b 20s ease-in-out infinite alternate;
}

.grid-overlay {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.46), transparent 86%);
  opacity: 0.22;
}

#app {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 28px;
  background: rgba(5, 5, 5, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(22px);
}

.brand-lockup,
.header-right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.brand-lockup {
  gap: 14px;
}

.brand-lockup > div:last-child {
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: var(--t1);
  background: linear-gradient(180deg, rgba(20, 20, 20, 0.94), rgba(8, 8, 8, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 30px rgba(0, 0, 0, 0.28);
}

.header-logo {
  width: 22px;
  height: 22px;
}

.eyebrow {
  color: var(--t2);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.18em;
  font-weight: 700;
}

.header-title {
  margin-top: 4px;
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 700;
}

.header-right {
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.header-session {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px max(28px, env(safe-area-inset-right)) 28px max(28px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero-grid,
.grid-2,
.grid-tasks,
.overview-grid {
  display: grid;
  gap: 18px;
}

.hero-grid {
  grid-template-columns: 1.3fr 0.9fr;
}

.overview-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.grid-tasks {
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
}

.card,
.metric-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 30%),
    linear-gradient(180deg, rgba(17, 17, 17, 0.98), rgba(8, 8, 8, 0.96));
  box-shadow: var(--shadow);
}

.card {
  padding: 22px;
}

.card::before,
.metric-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.04), transparent 34%);
  pointer-events: none;
}

.card::after,
.metric-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.02), transparent 38%, transparent 64%, rgba(255, 255, 255, 0.012));
  pointer-events: none;
}

.card.no-pad {
  padding: 0;
}

.card-hero {
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(145deg, rgba(17, 17, 17, 0.98), rgba(5, 5, 5, 0.96));
}

.hero-title {
  max-width: 12ch;
  margin-top: 10px;
  font-size: clamp(2rem, 4vw, 3.6rem);
  line-height: 0.98;
  font-weight: 700;
}

.hero-copy {
  max-width: 58ch;
  margin-top: 18px;
  color: #cfcfcf;
  font-size: 15px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(18, 18, 18, 0.9);
  color: var(--t2);
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.hero-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-head,
.card-row,
.card-top,
.card-head,
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.panel-title,
.section-title {
  margin-top: 6px;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 700;
}

.panel-meta,
.timeline-range,
.feed-count {
  color: var(--t3);
  font-size: 11px;
}

.control-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  color: var(--t3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.field-control {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background:
    linear-gradient(180deg, rgba(22, 22, 22, 0.98), rgba(9, 9, 9, 0.98));
  color: var(--t1);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-control:focus {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
}

.field-control:-webkit-autofill,
.field-control:-webkit-autofill:hover,
.field-control:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--t1);
  box-shadow: 0 0 0 1000px rgba(10, 10, 10, 0.98) inset;
  transition: background-color 9999s ease-in-out 0s;
}

select.field-control {
  appearance: none;
  padding: 15px 52px 15px 16px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' stroke='%23d7d7d7' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.auth-input {
  padding: 15px 16px;
  cursor: text;
}

.auth-input::placeholder {
  color: var(--t4);
}

select.field-control option {
  background: #0a0a0a;
}

.hero-panel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hero-panel-stat {
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 15, 15, 0.92);
}

.hero-panel-stat strong {
  display: block;
  margin-top: 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
}

.hero-summary,
.section-copy,
.card-subtitle {
  color: #b0b0b0;
}

.auth-main {
  width: 100%;
  max-width: 1440px;
  min-height: calc(100vh - 108px);
  justify-content: center;
  align-items: center;
}

.auth-grid {
  width: min(100%, 480px);
}

.auth-card {
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 34%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 32%),
    linear-gradient(145deg, rgba(16, 16, 16, 0.98), rgba(6, 6, 6, 0.96));
}

.auth-title {
  max-width: 11ch;
  margin-top: 12px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 0.98;
  font-weight: 700;
}

.auth-copy {
  max-width: 42ch;
  margin-top: 18px;
  color: #cfcfcf;
  font-size: 15px;
}

.auth-form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

.auth-field {
  gap: 10px;
}

.password-row {
  position: relative;
}

.password-row .auth-input {
  padding-right: 88px;
}

.btn-inline {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(15, 15, 15, 0.94);
  color: var(--t2);
  padding: 8px 12px;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.btn-inline:hover,
.btn-inline:focus-visible {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--t1);
  outline: none;
}

.auth-error {
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 125, 134, 0.16);
  background: rgba(255, 125, 134, 0.08);
  color: #ffbec4;
  font-size: 13px;
}

.auth-footnote {
  margin-top: 18px;
  color: var(--t3);
  font-size: 12px;
  line-height: 1.6;
}

.metric-card {
  padding: 20px;
  min-height: 164px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.metric-card:hover,
.card:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
}

.accent-cyan::after { background: linear-gradient(90deg, #ffffff, transparent 65%); }
.accent-teal::after { background: linear-gradient(90deg, #d8d8d8, transparent 65%); }
.accent-amber::after { background: linear-gradient(90deg, #a7a7a7, transparent 65%); }
.accent-rose::after { background: linear-gradient(90deg, #6d6d6d, transparent 65%); }

.metric-label,
.card-title {
  color: var(--t3);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.metric-value {
  margin-top: 18px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.95rem, 3vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
}

.metric-detail {
  margin-top: 12px;
  color: var(--t2);
  font-size: 13px;
}

#loadingSkeleton {
  display: grid;
  gap: 18px;
}

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

.skel {
  border-radius: var(--radius-lg);
  background: linear-gradient(90deg, rgba(14, 14, 14, 0.9) 30%, rgba(34, 34, 34, 0.96) 50%, rgba(14, 14, 14, 0.9) 70%);
  background-size: 200% 100%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  animation: skel 1.7s ease-in-out infinite;
}

.skel-wide { height: 146px; }
.skel-card { height: 224px; }
.skel-table { height: 340px; }

.card-row-lg {
  align-items: flex-end;
}

.progress-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.progress-pct {
  font-size: clamp(2rem, 4vw, 3.2rem);
  color: var(--t1);
}

.bar-track {
  margin-top: 22px;
  width: 100%;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(11, 11, 11, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #8b8b8b, #d7d7d7, #ffffff);
  box-shadow: 0 0 20px rgba(255, 255, 255, 0.16);
  transition: width 0.35s ease;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stat {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(11, 11, 11, 0.9);
}

.stat-num {
  display: block;
  font-size: 1.9rem;
  font-weight: 600;
  line-height: 1;
}

.stat-lbl {
  display: block;
  margin-top: 9px;
  color: var(--t3);
  font-size: 12px;
}

#countCompleted { color: var(--green); }
#countFailed { color: var(--red); }
#countTimeout { color: var(--amber); }
#countRunning { color: var(--blue); }

.section-head {
  margin-bottom: 18px;
}

.chart-card,
.card-heatmap {
  min-height: 0;
}

.chart-stage {
  position: relative;
  min-height: 320px;
  margin-top: 18px;
}

.chart-stage canvas {
  width: 100% !important;
  height: 100% !important;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 18px;
}

.chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.96), rgba(9, 9, 9, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 16px 30px rgba(0, 0, 0, 0.24);
  color: var(--t2);
  cursor: pointer;
}

.chart-legend__item:hover,
.chart-legend__item:focus-visible {
  border-color: rgba(255, 255, 255, 0.18);
  color: var(--t1);
  transform: translateY(-1px);
  outline: none;
}

.chart-legend__item.is-hidden {
  opacity: 0.45;
}

.chart-legend__swatch {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
}

.chart-legend__swatch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 3px;
  width: 7px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  filter: blur(0.4px);
}

.chart-legend__label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.card-heatmap {
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.desktop-table-view {
  display: block;
}

.table-shell {
  padding-bottom: 4px;
}

.ledger-table,
.scores-table {
  min-width: 720px;
}

th {
  padding: 15px 12px;
  color: var(--t3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

td {
  padding: 14px 12px;
  color: var(--t2);
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: middle;
}

tbody tr {
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.035);
}

td.empty {
  padding: 36px 16px;
  text-align: center;
  color: var(--t3);
}

.mobile-card-list {
  display: none;
  gap: 12px;
  padding: 0 20px 20px;
}

.card-body > .mobile-card-list {
  padding: 0;
}

.mobile-card {
  display: block;
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
  padding: 16px;
}

button.mobile-card {
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

button.mobile-card:hover,
button.mobile-card:focus-visible {
  border-color: rgba(255, 255, 255, 0.18);
  outline: none;
}

.mobile-card-head,
.mobile-card-tags {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mobile-card-tags {
  margin-top: 12px;
  flex-wrap: wrap;
}

.mobile-card-chevron {
  flex: 0 0 auto;
  color: var(--t3);
}

.mobile-metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.mobile-metric {
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}

.mobile-label {
  display: block;
  color: var(--t4);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.mobile-value {
  display: block;
  margin-top: 8px;
  color: var(--t1);
  font-size: 14px;
  font-weight: 700;
}

.score-mobile-summary {
  margin-top: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.score-mobile-total {
  font-size: 2rem;
  line-height: 1;
}

.score-dimension-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.score-dimension-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.score-dimension-label {
  color: var(--t2);
  font-size: 12px;
}

.score-dimension-value {
  min-width: 36px;
  padding: 5px 8px;
  border-radius: 999px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
}

.card-head {
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.card-head-rich {
  align-items: center;
}

.card-body {
  padding: 18px 20px;
}

.btn-sm,
.btn-icon,
.tab {
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: linear-gradient(135deg, #f8f8f8 0%, #d7d7d7 55%, #b8b8b8 100%);
  color: #050505;
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 30px rgba(255, 255, 255, 0.12);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 34px rgba(255, 255, 255, 0.16);
  filter: brightness(1.02);
  outline: none;
}

.auth-submit {
  width: 100%;
  margin-top: 4px;
}

.btn-sm {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 12, 12, 0.92);
  color: var(--t2);
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}

.btn-sm:hover,
.btn-sm:focus-visible {
  border-color: rgba(255, 255, 255, 0.24);
  color: var(--t1);
  transform: translateY(-1px);
}

.btn-icon {
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(10, 10, 10, 0.94);
  color: var(--t2);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.btn-icon:hover {
  color: var(--t1);
  border-color: rgba(255, 255, 255, 0.24);
}

.btn-sm:disabled,
.btn-icon:disabled,
.btn-inline:disabled,
.btn-primary:disabled {
  opacity: 0.64;
  cursor: wait;
  transform: none;
  box-shadow: none;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
  border: 1px solid transparent;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-green {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.16);
}

.badge-green .dot { background: var(--green); }

.badge-red {
  color: #ffbec4;
  background: rgba(255, 125, 134, 0.1);
  border-color: rgba(255, 125, 134, 0.16);
}

.badge-red .dot { background: var(--red); }

.badge-amber {
  color: #e7d0ab;
  background: rgba(201, 172, 122, 0.12);
  border-color: rgba(201, 172, 122, 0.16);
}

.badge-amber .dot { background: var(--amber); }

.badge-blue {
  color: #d9e0e8;
  background: rgba(185, 194, 205, 0.12);
  border-color: rgba(185, 194, 205, 0.16);
}

.badge-blue .dot { background: var(--blue); }

.badge-gray {
  color: var(--t3);
  background: rgba(96, 118, 139, 0.12);
  border-color: rgba(96, 118, 139, 0.16);
}

.badge-gray .dot { background: var(--t3); }

.agent-tag,
.winner-tag,
.file-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 12, 0.9);
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
}

.agent-tag {
  position: relative;
  color: var(--t2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.agent-tag::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(205, 205, 205, 0.82));
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 16px rgba(255, 255, 255, 0.08);
}

.agent-tag.agent-claude {
  color: #f7efe3;
  border-color: rgba(255, 245, 230, 0.16);
  background: linear-gradient(180deg, rgba(31, 28, 24, 0.96), rgba(16, 14, 12, 0.92));
}

.agent-tag.agent-claude::before {
  background: linear-gradient(180deg, #fffdf9 0%, #ecd8be 100%);
  box-shadow: 0 0 0 1px rgba(255, 248, 237, 0.24), 0 10px 18px rgba(255, 231, 191, 0.16);
}

.agent-tag.agent-codex {
  color: #d8eeff;
  border-color: rgba(147, 212, 255, 0.16);
  background: linear-gradient(180deg, rgba(17, 24, 31, 0.96), rgba(8, 12, 18, 0.92));
}

.agent-tag.agent-codex::before {
  background: linear-gradient(180deg, #d8efff 0%, #6897bf 100%);
  box-shadow: 0 0 0 1px rgba(191, 229, 255, 0.24), 0 10px 18px rgba(92, 165, 229, 0.18);
}

.agent-tag.agent-generic {
  color: var(--t2);
}

.task-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-main {
  color: var(--t1);
  font-size: 13px;
  font-weight: 600;
}

.task-sub {
  color: var(--t3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 54px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 12, 0.92);
  color: var(--t2);
  font-size: 12px;
  font-weight: 700;
}

.winner-tag {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  font-size: 11px;
  font-weight: 700;
}

.panel-feed {
  min-height: 180px;
  max-height: 420px;
}

.panel-feed-compact {
  max-height: 340px;
  font-size: 12px;
}

.event-stream {
  font-family: "Manrope", sans-serif;
}

.scroll-y {
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.scroll-y::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

.scroll-y::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.evt,
.act {
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
}

.evt {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  background: rgba(10, 10, 10, 0.88);
  line-height: 1.55;
}

.event-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.event-title-group,
.event-time-group,
.event-tags,
.event-block {
  display: grid;
  gap: 6px;
}

.event-title-group {
  min-width: 0;
}

.event-kind {
  color: var(--t4);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.event-time-group {
  justify-items: end;
  flex-shrink: 0;
}

.event-time {
  color: var(--t2);
  font-size: 11px;
}

.event-relative {
  color: var(--t4);
  font-size: 10px;
}

.event-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.event-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--t2);
  font-size: 11px;
  font-weight: 700;
}

.event-badge-level-info {
  color: var(--t2);
}

.event-badge-level-warn {
  color: #e7d0ab;
  background: rgba(201, 172, 122, 0.1);
  border-color: rgba(201, 172, 122, 0.14);
}

.event-badge-level-error {
  color: #ffbec4;
  background: rgba(255, 125, 134, 0.1);
  border-color: rgba(255, 125, 134, 0.16);
}

.event-summary {
  color: var(--t2);
  font-size: 13px;
}

.event-block-label {
  color: var(--t4);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
}

.event-kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 8px;
}

.event-kv-item {
  padding: 10px 11px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
}

.event-kv-label {
  color: var(--t4);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.event-kv-value {
  margin-top: 6px;
  color: var(--t1);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-word;
}

.event-pre,
.event-note {
  margin: 0;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
  color: var(--t2);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.event-note-error {
  border-color: rgba(255, 125, 134, 0.16);
  background: rgba(255, 125, 134, 0.08);
  color: #ffbec4;
}

.event-note-rich {
  white-space: normal;
  overflow: hidden;
}

.event-note-reasoning {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.028)),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}

.event-disclosure {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.025);
  overflow: hidden;
}

.event-disclosure summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.event-disclosure summary::-webkit-details-marker {
  display: none;
}

.event-disclosure-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.event-disclosure-title {
  color: var(--t1);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.event-disclosure-meta,
.event-disclosure-hint {
  color: var(--t4);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.event-disclosure[open] .event-disclosure-hint {
  color: var(--t3);
}

.event-disclosure-body {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
}

.event-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feed-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.event-kicker {
  color: var(--t1);
  font-size: 12px;
  font-weight: 700;
}

.task-pill {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.05);
  color: var(--t2);
  font-size: 11px;
  width: fit-content;
}

.feed-body {
  margin-top: 8px;
  color: var(--t2);
  word-break: break-word;
}

.feed-body-rich {
  white-space: normal;
}

.feed-hint {
  margin-top: 8px;
  color: var(--t4);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.md-prose {
  display: grid;
  gap: 12px;
}

.md-prose > * {
  min-width: 0;
}

.md-prose-compact,
.md-prose-activity {
  gap: 10px;
}

.md-prose-quote {
  gap: 10px;
}

.md-p {
  margin: 0;
  color: var(--t2);
  line-height: 1.7;
}

.md-heading {
  margin: 0;
  color: var(--t1);
  font-family: "Space Grotesk", "Manrope", sans-serif;
  line-height: 1.18;
}

.md-heading-1,
.md-heading-2 {
  font-size: 15px;
}

.md-heading-3,
.md-heading-4,
.md-heading-5,
.md-heading-6 {
  font-size: 13px;
}

.md-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--t2);
}

.md-list-item {
  line-height: 1.65;
}

.md-inline-code {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--t1);
  font-size: 11px;
  line-height: 1.45;
  vertical-align: baseline;
}

.md-strong {
  color: var(--t1);
  font-weight: 700;
}

.md-em {
  color: #f0f0f0;
  font-style: italic;
}

.md-link {
  color: var(--t1);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.32);
  text-underline-offset: 2px;
}

.md-link:hover,
.md-link:focus-visible {
  text-decoration-color: rgba(255, 255, 255, 0.6);
}

.md-link-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  color: var(--t1);
  font-size: 11px;
  line-height: 1.4;
  word-break: break-word;
}

.md-rule {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  margin: 2px 0;
}

.md-quote {
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid rgba(255, 255, 255, 0.16);
}

.md-code-block {
  display: grid;
  gap: 8px;
}

.md-code-label {
  color: var(--t4);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.md-pre {
  margin: 0;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 5, 5, 0.72);
  color: #f2f2f2;
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow: auto;
}

.evt-err {
  background: rgba(255, 125, 134, 0.08);
  border-color: rgba(255, 125, 134, 0.14);
}

.evt-warn {
  background: rgba(201, 172, 122, 0.1);
  border-color: rgba(201, 172, 122, 0.14);
}

.act {
  display: flex;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(10, 10, 10, 0.88);
}

.act-think {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.07);
}

.act-exec {
  background: rgba(210, 210, 210, 0.045);
  border-color: rgba(255, 255, 255, 0.08);
}

.act-patch,
.act-ok {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.08);
}

.act-fail {
  background: rgba(255, 125, 134, 0.08);
  border-color: rgba(255, 125, 134, 0.12);
}

.tl-row {
  display: grid;
  grid-template-columns: minmax(0, 148px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}

.tl-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.tl-label {
  color: var(--t3);
  font-size: 11px;
  text-align: left;
  overflow-wrap: anywhere;
}

.tl-value {
  color: var(--t3);
  font-size: 10px;
  flex: 0 0 auto;
}

.tl-track {
  position: relative;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.tl-bar {
  position: absolute;
  inset: 0 auto 0 0;
  min-width: 4px;
  border-radius: 999px;
}

.tl-bar.completed { background: linear-gradient(90deg, rgba(180, 180, 180, 0.6), var(--green)); }
.tl-bar.failed { background: linear-gradient(90deg, rgba(255, 125, 134, 0.4), var(--red)); }
.tl-bar.timeout { background: linear-gradient(90deg, rgba(201, 172, 122, 0.44), var(--amber)); }
.tl-bar.running { background: linear-gradient(90deg, rgba(122, 130, 138, 0.44), var(--blue)); }
.tl-bar.pending { background: rgba(255, 255, 255, 0.16); }

.tl-axis {
  display: grid;
  grid-template-columns: minmax(0, 148px) minmax(0, 1fr);
  gap: 12px;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.tl-axis .tl-spacer {
  width: auto;
}

.tl-axis .tl-marks {
  display: flex;
  justify-content: space-between;
  color: var(--t3);
  font-size: 10px;
}

.hm-table {
  width: 100%;
  min-width: 560px;
  border-collapse: separate;
  border-spacing: 5px;
}

.hm-table th {
  border: none;
  padding: 6px 8px;
  text-align: center;
}

.hm-table .hm-label {
  padding: 6px 8px;
  text-align: right;
  color: var(--t2);
  white-space: nowrap;
}

.hm-cell {
  min-width: 54px;
  text-align: center;
  padding: 7px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.cmp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.cmp-card {
  padding: 18px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(10, 10, 10, 0.9);
}

.cmp-card.lead {
  border-color: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.cmp-table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
}

.comparison-scroll {
  padding-bottom: 4px;
}

.cmp-table th,
.cmp-table td {
  padding: 11px 12px;
}

.cmp-table td {
  color: var(--t2);
}

.cmp-table tr:hover td {
  background: rgba(255, 255, 255, 0.035);
}

.delta-pos { color: var(--green); }
.delta-neg { color: var(--red); }
.delta-zero { color: var(--t3); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px max(26px, env(safe-area-inset-right)) 26px max(26px, env(safe-area-inset-left));
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(20px);
}

.modal {
  width: min(920px, 100%);
  max-height: min(90dvh, 960px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(6, 6, 6, 0.98));
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.58);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.98), rgba(11, 11, 11, 0.96));
}

.modal-title {
  margin-top: 6px;
  font-size: 1.1rem;
  word-break: break-word;
}

.modal-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 22px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(12, 12, 12, 0.96);
  scrollbar-width: none;
}

.modal-tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  margin-bottom: -1px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-bottom: none;
  border-top-left-radius: 14px;
  border-top-right-radius: 14px;
  background: transparent;
  color: var(--t3);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.tab:hover {
  color: var(--t2);
}

.tab.active {
  color: var(--t1);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(18, 18, 18, 0.9);
}

.modal-body {
  padding: 22px;
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sub-title {
  margin: 20px 0 10px;
  color: var(--t1);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.sub-title:first-child {
  margin-top: 0;
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.meta-item {
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 11, 11, 0.92);
}

.meta-label {
  color: var(--t3);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 700;
}

.meta-val {
  margin-top: 8px;
  font-size: 1.1rem;
  font-weight: 700;
}

.checks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 12px;
}

.check-pass {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.check-fail {
  background: rgba(255, 125, 134, 0.08);
  color: #ffbec4;
}

.score-bar-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.score-bar-label {
  color: var(--t3);
  font-size: 12px;
}

.score-bar-track {
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.score-bar-fill {
  height: 100%;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  min-width: 24px;
}

.score-bar-val {
  color: rgba(2, 8, 14, 0.9);
  font-size: 10px;
  font-weight: 800;
}

.modal-list {
  padding-left: 18px;
  color: var(--t2);
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.modal-note {
  margin-top: 8px;
  color: var(--t3);
  font-size: 13px;
  font-style: italic;
}

.modal-pre {
  border-radius: 18px;
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow: auto;
}

.response-preview {
  max-height: 380px;
  background: rgba(8, 20, 30, 0.82);
  border: 1px solid rgba(126, 157, 180, 0.1);
  color: var(--t2);
}

.stderr-preview {
  max-height: 280px;
  background: rgba(255, 125, 134, 0.08);
  border: 1px solid rgba(255, 125, 134, 0.14);
  color: #ffbec4;
}

pre {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
}

.fade-in { animation: fadeIn 0.24s ease; }

@media (max-width: 1180px) {
  .hero-grid,
  .grid-tasks,
  .overview-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 980px) {
  .hero-grid,
  .grid-2,
  .grid-tasks,
  .overview-grid,
  .stats-row,
  .skel-grid {
    grid-template-columns: 1fr;
  }

  .progress-side,
  .card-top,
  .section-head,
  .card-row,
  .card-head {
    align-items: flex-start;
  }

  .progress-side {
    text-align: left;
  }
}

@media (max-width: 760px) {
  .topbar,
  .header-right {
    align-items: flex-start;
  }

  .topbar {
    flex-direction: column;
    padding:
      max(18px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      16px
      max(16px, env(safe-area-inset-left));
  }

  .brand-lockup,
  .header-right,
  .header-session {
    width: 100%;
  }

  .header-right {
    justify-content: space-between;
    gap: 10px;
  }

  .header-session {
    justify-content: space-between;
  }

  main {
    gap: 18px;
    padding:
      20px
      max(16px, env(safe-area-inset-right))
      max(28px, calc(28px + env(safe-area-inset-bottom)))
      max(16px, env(safe-area-inset-left));
  }

  .card,
  .metric-card {
    border-radius: 22px;
  }

  .auth-card {
    padding: 24px;
  }

  .card {
    padding: 18px;
  }

  .card-hero,
  .auth-card {
    padding: 22px;
  }

  .metric-card {
    min-height: auto;
    padding: 18px;
  }

  .card-head,
  .card-body {
    padding: 18px;
  }

  .hero-copy,
  .metric-detail,
  .card-subtitle,
  .section-copy {
    font-size: 13px;
  }

  .hero-title {
    max-width: none;
  }

  .auth-title {
    max-width: none;
  }

  .hero-chip {
    padding: 8px 12px;
  }

  .panel-head,
  .card-top,
  .section-head,
  .card-row {
    flex-direction: column;
  }

  .hero-panel-grid {
    grid-template-columns: 1fr;
  }

  .card-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }

  .modal-tabs {
    overflow-x: auto;
    padding: 12px 18px 4px;
  }

  .event-header {
    flex-direction: column;
  }

  .event-time-group {
    justify-items: start;
  }

  .panel-feed {
    max-height: 320px;
  }

  .chart-stage {
    min-height: 240px;
    margin-top: 14px;
  }

  .chart-legend {
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 10px;
    margin-top: 14px;
    padding-bottom: 4px;
    overflow-x: auto;
  }

  .chart-legend__item {
    padding: 8px 12px;
  }

  .desktop-table-view {
    display: none;
  }

  .mobile-card-list {
    display: grid;
  }

  .tl-row,
  .tl-axis {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .tl-axis .tl-spacer {
    display: none;
  }

  .cmp-cards {
    grid-template-columns: 1fr;
  }

  .modal {
    width: 100%;
    height: min(94dvh, 960px);
    max-height: min(94dvh, 960px);
    max-width: none;
    border-radius: 28px 28px 0 0;
    border-bottom: none;
  }

  .modal-head {
    padding: 18px 18px 14px;
  }

  .modal-body {
    padding: 18px;
  }

  .auth-main {
    min-height: calc(100dvh - 96px);
    padding: 8px 0 24px;
  }
}

@media (max-width: 560px) {
  .topbar {
    gap: 14px;
    padding:
      max(14px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      14px
      max(12px, env(safe-area-inset-left));
  }

  main {
    gap: 16px;
    padding:
      16px
      max(12px, env(safe-area-inset-right))
      max(24px, calc(24px + env(safe-area-inset-bottom)))
      max(12px, env(safe-area-inset-left));
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .header-title {
    font-size: 1.05rem;
  }

  .card,
  .metric-card {
    border-radius: 20px;
  }

  .card,
  .metric-card,
  .card-head,
  .card-body {
    padding: 16px;
  }

  .card-hero,
  .auth-card {
    padding: 20px 16px;
  }

  .hero-title {
    font-size: clamp(1.72rem, 11vw, 2.4rem);
    line-height: 1.02;
  }

  .metric-value {
    font-size: 1.75rem;
  }

  .mobile-card {
    border-radius: 16px;
    padding: 14px;
  }

  .mobile-metric-grid {
    grid-template-columns: 1fr;
  }

  .chart-stage {
    min-height: 220px;
  }

  .chart-legend {
    gap: 8px;
  }

  .chart-legend__item {
    padding: 7px 10px;
  }

  .tab {
    padding: 10px 12px;
    font-size: 13px;
  }

  .modal-head {
    padding: 16px 14px 12px;
  }

  .modal-tabs {
    padding: 10px 14px 4px;
  }

  .modal-body {
    padding: 14px;
  }

  .meta-grid,
  .checks-grid,
  .event-kv-grid,
  .score-bar-row {
    grid-template-columns: 1fr;
  }

  .score-bar-row {
    gap: 6px;
  }

  .panel-feed {
    max-height: 280px;
  }

  .auth-title {
    font-size: clamp(1.7rem, 11vw, 2.2rem);
  }

  .password-row .auth-input {
    padding-right: 80px;
  }

  .btn-inline {
    right: 10px;
    padding: 7px 10px;
  }

  .response-preview {
    max-height: 300px;
  }
}

@keyframes skel {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes drift-a {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 16px, 0) scale(1.06); }
}

@keyframes drift-b {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-34px, 22px, 0) scale(1.04); }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
