@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  color-scheme: dark;
  --bg: #0a1220;
  --bg-elevated: #101a2b;
  --bg-elevated-2: #152033;
  --surface: rgba(14, 21, 36, 0.9);
  --surface-strong: #121b2d;
  --border: rgba(203, 213, 225, 0.11);
  --border-strong: rgba(148, 163, 184, 0.18);
  --text: #eef4fb;
  --muted: #97a6ba;
  --muted-strong: #c1ccda;
  --accent: #5eead4;
  --accent-2: #7dd3fc;
  --accent-3: #93c5fd;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --neutral: #94a3b8;
  --shadow: 0 30px 80px rgba(2, 6, 23, 0.5);
  --shadow-soft: 0 12px 40px rgba(2, 6, 23, 0.28);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --line: 1px solid var(--border);
  --topbar-h: 84px;
  --sidebar-w: 288px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
}

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

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 10% 12%, rgba(94, 234, 212, 0.08), transparent 28%),
    radial-gradient(circle at 90% 18%, rgba(125, 211, 252, 0.08), transparent 28%),
    linear-gradient(180deg, #08101c 0%, #0a1220 100%);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Manrope', system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(94, 234, 212, 0.08), transparent 24%),
    radial-gradient(circle at 88% 12%, rgba(125, 211, 252, 0.08), transparent 24%),
    linear-gradient(180deg, #08101c, #0a1220 42%, #09111d 100%);
}

body.nav-open {
  overflow: hidden;
}

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

button {
  cursor: pointer;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid rgba(94, 234, 212, 0.9);
  outline-offset: 2px;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  padding-top: var(--topbar-h);
  overflow: clip;
}

.bg-orb {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.55;
  pointer-events: none;
}

.orb-a {
  top: -56px;
  right: 8%;
  width: 240px;
  height: 240px;
  background: rgba(94, 234, 212, 0.14);
}

.orb-b {
  left: -90px;
  bottom: 14%;
  width: 320px;
  height: 320px;
  background: rgba(125, 211, 252, 0.1);
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 95%);
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-4);
  height: var(--topbar-h);
  padding: 0 var(--space-6);
  background: rgba(7, 14, 25, 0.82);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 8px 40px rgba(2, 6, 23, 0.22);
}

.topbar__title-group {
  min-width: 0;
}

.topbar__title-group h1 {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.topbar__title-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
}

.breadcrumb {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 0.86rem;
}

.eyebrow {
  margin: 0 0 var(--space-1);
  color: rgba(94, 234, 212, 0.85);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.topbar__status,
.sidebar__summary,
.settings-card,
.composer-review,
.card {
  border: var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.topbar__status {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.02);
}

.status-dot--connected {
  background: var(--good);
}

.status-dot--connecting {
  background: var(--neutral);
  animation: pulse 1.4s ease-in-out infinite;
}

.status-dot--disconnected {
  background: var(--bad);
}

.status-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.topbar__actions {
  display: flex;
  gap: var(--space-2);
}

.layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: var(--space-5);
  width: min(1500px, calc(100vw - 32px));
  margin: 0 auto;
  padding: var(--space-5) 0 var(--space-10);
}

.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + var(--space-5));
  align-self: start;
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: var(--line);
  border-radius: var(--radius-xl);
  background: rgba(13, 20, 33, 0.9);
  box-shadow: var(--shadow-soft);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.95), rgba(125, 211, 252, 0.9));
  color: #05111a;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.brand-title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.82rem;
}

.sidebar__nav {
  display: grid;
  gap: 6px;
}

.nav-item,
.drawer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted-strong);
  background: transparent;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    color 160ms ease;
}

.nav-item:hover,
.drawer-item:hover,
.button:hover,
.tab:hover,
.toggle:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.nav-item.is-active,
.drawer-item.is-active,
.tab.is-active {
  color: var(--text);
  background: rgba(94, 234, 212, 0.08);
  border-color: rgba(94, 234, 212, 0.2);
}

.nav-item__count {
  min-width: 30px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
  font-size: 0.76rem;
  text-align: center;
}

.sidebar__summary {
  padding: var(--space-4);
}

.sidebar__summary-label {
  margin-bottom: var(--space-1);
  color: var(--muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.sidebar__summary p {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: rgba(3, 7, 18, 0.62);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 180ms ease;
}

.mobile-drawer {
  position: fixed;
  z-index: 46;
  top: calc(var(--topbar-h) + 12px);
  right: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - var(--topbar-h) - 24px);
  overflow: auto;
  padding: var(--space-4);
  border: var(--line);
  border-radius: var(--radius-xl);
  background: rgba(11, 18, 31, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  transform: translateX(calc(100% + 18px));
  opacity: 0;
  pointer-events: none;
  transition:
    transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1),
    opacity 160ms ease;
}

body.nav-open .mobile-drawer,
body.nav-open .mobile-drawer-backdrop {
  opacity: 1;
}

body.nav-open .mobile-drawer {
  transform: translateX(0);
  pointer-events: auto;
}

body.nav-open .mobile-drawer-backdrop {
  pointer-events: auto;
}

.mobile-drawer__header,
.section__header,
.panel__head,
.dialog__header,
.dialog__footer,
.run-detail__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.mobile-drawer__eyebrow {
  color: rgba(94, 234, 212, 0.8);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.mobile-drawer__title,
.section h2,
.panel h3,
.dialog h2,
.run-detail__header h3 {
  margin: 0;
  letter-spacing: -0.03em;
}

.mobile-drawer__status {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: var(--space-4) 0;
  color: var(--muted-strong);
}

.mobile-drawer__nav {
  display: grid;
  gap: 8px;
}

.content {
  display: grid;
  gap: var(--space-5);
  min-width: 0;
}

.section {
  padding: var(--space-5);
}

.section-anchor {
  scroll-margin-top: calc(var(--topbar-h) + var(--space-5));
}

.section__header {
  margin-bottom: var(--space-5);
}

.section__header--split {
  align-items: flex-end;
}

.section__lead,
.muted,
.field small,
.state-note {
  color: var(--muted);
  line-height: 1.5;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-4);
}

.kpi-card {
  padding: var(--space-4);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17, 26, 42, 0.95), rgba(14, 21, 36, 0.96));
}

.kpi-card__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.kpi-card__value {
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  letter-spacing: -0.04em;
}

.kpi-card__note {
  margin-top: var(--space-2);
  color: var(--muted);
  font-size: 0.9rem;
}

.section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.panel {
  min-width: 0;
  padding: var(--space-4);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 18px;
  background: rgba(11, 17, 29, 0.75);
}

.panel--detail {
  background: linear-gradient(180deg, rgba(15, 23, 39, 0.96), rgba(11, 17, 29, 0.82));
}

.panel__meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.stack {
  display: grid;
  gap: var(--space-3);
}

.stack--compact {
  gap: var(--space-2);
}

.card-list {
  display: none;
  gap: var(--space-3);
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 18px;
  background: rgba(8, 13, 22, 0.46);
}

.data-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
  text-align: left;
  vertical-align: top;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(13, 20, 33, 0.96);
  color: var(--muted-strong);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.data-table tbody tr:hover {
  background: rgba(94, 234, 212, 0.04);
}

.row-title {
  font-weight: 700;
}

.row-subtitle,
.mono,
.code {
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.86rem;
}

.mono-wrap {
  max-width: 560px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.badge--good,
.badge.good {
  color: #c8fce9;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.24);
}

.badge--warn,
.badge.warn {
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
  border-color: rgba(251, 191, 36, 0.2);
}

.badge--bad,
.badge.bad {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.2);
}

.badge--neutral {
  color: #dbe4f0;
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.2);
}

.button,
.icon-button,
.toggle,
.tab {
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    opacity 160ms ease,
    transform 160ms ease;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  font-weight: 700;
}

.button--compact {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.92rem;
}

.button--primary {
  background: linear-gradient(135deg, rgba(94, 234, 212, 0.96), rgba(125, 211, 252, 0.9));
  color: #07131f;
}

.button--secondary {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.18);
}

.button--ghost {
  background: rgba(148, 163, 184, 0.06);
  border-color: rgba(148, 163, 184, 0.12);
}

.button--danger {
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.2);
  color: #fecdd3;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(148, 163, 184, 0.06);
}

.icon-button__bars {
  display: grid;
  gap: 4px;
  width: 18px;
}

.icon-button__bars span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.filters--compact {
  margin-bottom: 0;
}

.field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.field--inline {
  min-width: 180px;
}

.field--compact {
  min-width: 160px;
}

.field span {
  color: var(--muted-strong);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 14px;
  background: rgba(8, 13, 22, 0.6);
  color: var(--text);
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.field input::placeholder,
.field textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(94, 234, 212, 0.4);
  background: rgba(8, 13, 22, 0.82);
  box-shadow: 0 0 0 4px rgba(94, 234, 212, 0.08);
  outline: none;
}

.field--textarea textarea {
  min-height: 210px;
  resize: vertical;
}

.field small {
  display: block;
  font-size: 0.8rem;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(8, 13, 22, 0.46);
}

.switch input {
  width: 18px;
  height: 18px;
}

.toggle {
  min-width: 118px;
  min-height: 42px;
  padding: 0 16px;
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(148, 163, 184, 0.08);
  font-weight: 800;
}

.toggle[aria-pressed='true'] {
  color: #cdfcf1;
  background: rgba(52, 211, 153, 0.12);
  border-color: rgba(52, 211, 153, 0.18);
}

.toggle[aria-pressed='false'] {
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.12);
  border-color: rgba(251, 113, 133, 0.2);
}

.state-note {
  min-height: 24px;
  margin-bottom: var(--space-3);
  font-size: 0.92rem;
}

.composer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr);
  gap: var(--space-4);
}

.card--surface {
  padding: var(--space-4);
  background: linear-gradient(180deg, rgba(15, 22, 35, 0.96), rgba(11, 17, 29, 0.86));
}

.composer__section {
  padding: 0 0 var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.composer__section:last-of-type {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}

.composer__section-head {
  margin-bottom: var(--space-3);
}

.composer__section-head h3 {
  margin: 0 0 4px;
}

.composer__section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.composer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.composer__footer {
  display: flex;
  justify-content: flex-end;
}

.prompt-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.prompt-count {
  color: var(--muted);
  font-size: 0.84rem;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.cron-builder {
  display: grid;
  gap: var(--space-3);
}

.tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 14px;
  background: rgba(8, 13, 22, 0.42);
}

.tab {
  min-height: 34px;
  padding: 0 12px;
  border-color: transparent;
  color: var(--muted-strong);
  background: transparent;
  font-weight: 700;
}

.schedule-pane {
  display: grid;
  gap: var(--space-3);
}

.schedule-preview {
  padding: var(--space-3);
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(8, 13, 22, 0.44);
  color: var(--muted-strong);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.summary-stack {
  display: grid;
  gap: var(--space-3);
}

.summary-item {
  padding: var(--space-3);
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 14px;
  background: rgba(8, 13, 22, 0.42);
}

.summary-item__label {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.summary-item__value {
  margin-top: 6px;
  color: var(--text);
  line-height: 1.55;
}

.runs-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.08fr);
  gap: var(--space-4);
}

.run-list-item,
.activity-item,
.error-item,
.log-item,
.project-item,
.task-item,
.run-step {
  padding: var(--space-3);
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 16px;
  background: rgba(8, 13, 22, 0.44);
}

.run-list-item.is-selected {
  border-color: rgba(94, 234, 212, 0.2);
  background: rgba(94, 234, 212, 0.06);
}

.list-head,
.activity-title,
.error-title,
.log-title,
.project-title,
.run-title,
.run-step__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.list-title {
  font-weight: 800;
}

.list-meta,
.activity-meta,
.error-meta,
.log-meta,
.project-meta,
.run-meta,
.run-step__meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.list-body,
.activity-message,
.error-message,
.log-output,
.project-note,
.task-prompt,
.run-step__body {
  margin-top: 8px;
  line-height: 1.5;
  color: var(--text);
}

.run-detail__header {
  margin-bottom: var(--space-3);
}

.run-detail__actions {
  display: flex;
  gap: var(--space-2);
}

.detail-panel {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.detail-section {
  padding: var(--space-3);
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: 14px;
  background: rgba(8, 13, 22, 0.46);
}

.detail-section__title {
  margin: 0 0 10px;
  font-size: 0.82rem;
  color: var(--muted-strong);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.code-block {
  overflow: auto;
  margin: 0;
  padding: var(--space-3);
  border-radius: 12px;
  background: rgba(3, 7, 18, 0.7);
  color: #dde7f2;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.timeline {
  display: grid;
  gap: var(--space-3);
}

.timeline-item {
  position: relative;
  padding-left: 18px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
}

.timeline-item__title {
  font-weight: 800;
}

.timeline-item__meta {
  color: var(--muted);
  font-size: 0.84rem;
}

.timeline-item__body {
  margin-top: 6px;
  color: var(--text);
  line-height: 1.5;
}

.card-list__mobile {
  display: none;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
  color: var(--muted);
}

.pagination__controls {
  display: flex;
  gap: 8px;
}

.dialog {
  width: min(780px, calc(100vw - 24px));
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 24px;
  padding: 0;
  background: rgba(9, 14, 24, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgba(2, 6, 23, 0.64);
  backdrop-filter: blur(10px);
}

.dialog__panel {
  padding: var(--space-4);
}

.dialog__panel--compact {
  width: min(560px, calc(100vw - 24px));
}

.dialog__body {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}

.dialog__footer {
  align-items: center;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

.toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  padding: var(--space-3);
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(10, 15, 26, 0.96);
  box-shadow: var(--shadow-soft);
}

.toast--good {
  border-color: rgba(52, 211, 153, 0.22);
}

.toast--warn {
  border-color: rgba(251, 191, 36, 0.22);
}

.toast--bad {
  border-color: rgba(251, 113, 133, 0.22);
}

.toast__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: 8px;
}

.toast__title {
  font-weight: 800;
}

.toast__body {
  color: var(--muted-strong);
  line-height: 1.5;
}

.toast__close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1rem;
}

.empty-state,
.loading-state,
.error-state {
  display: grid;
  gap: 8px;
  padding: var(--space-4);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: 16px;
  background: rgba(8, 13, 22, 0.32);
}

.empty-state__title,
.error-state__title {
  margin: 0;
  font-weight: 800;
}

.empty-state__text,
.loading-state__text,
.error-state__text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  background: rgba(148, 163, 184, 0.08);
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: shimmer 1.4s infinite;
}

.loading-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--space-3);
}

.loading-card {
  height: 90px;
}

.loading-row {
  height: 56px;
}

.muted-code {
  font-family: 'IBM Plex Mono', monospace;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(0.88);
    opacity: 0.55;
  }
}

@keyframes shimmer {
  100% {
    transform: translateX(100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (max-width: 1280px) {
  .layout {
    grid-template-columns: 1fr;
    width: min(1200px, calc(100vw - 24px));
  }

  .sidebar {
    display: none;
  }

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

  .section-grid {
    grid-template-columns: 1fr;
  }

  .composer-grid,
  .runs-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 0 14px;
  }

  .topbar__actions {
    display: none;
  }

  .kpi-grid,
  .settings-grid,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .field--inline {
    min-width: 0;
    width: 100%;
  }

  .table-wrap {
    display: none;
  }

  .card-list {
    display: grid;
  }

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

@media (max-width: 700px) {
  .page-shell {
    padding-top: 76px;
  }

  :root {
    --topbar-h: 76px;
  }

  .topbar__status {
    padding: 10px 12px;
  }

  .topbar__title-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .breadcrumb {
    max-width: 100%;
  }

  .section {
    padding: 16px;
  }

  .composer__actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .composer__actions .button {
    width: 100%;
  }

  .mobile-drawer {
    display: block;
  }
}

@media (min-width: 901px) {
  .topbar__menu {
    display: none;
  }
}
