:root {
  color: #172033;
  background: #eef1f7;
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  font-synthesis: none;
}

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

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(
      circle at 10% 0%,
      rgba(108, 92, 231, 0.09),
      transparent 28rem
    ),
    #eef1f7;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

.demo-controls {
  position: relative;
  z-index: 10;
  padding: 22px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid #dce1ea;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 30px rgba(32, 43, 68, 0.08);
}

.demo-copy {
  display: grid;
  grid-template-columns: minmax(130px, 0.45fr) minmax(280px, 1.5fr) auto;
  align-items: center;
  gap: 24px;
  max-width: 1480px;
  margin: 0 auto 18px;
}

.demo-copy > a {
  display: flex;
  align-items: center;
  min-height: 32px;
  color: #5746d5;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.demo-copy h2 {
  margin: 2px 0 4px;
  color: #172033;
  font-size: clamp(20px, 2.2vw, 30px);
  letter-spacing: -0.035em;
}

.demo-copy p {
  max-width: 720px;
  margin: 0;
  color: #667085;
  font-size: 14px;
  line-height: 1.5;
}

.eyebrow {
  margin: 0;
  color: #7b8498;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bulk-actions {
  display: flex;
  gap: 8px;
}

.bulk-actions button {
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #d6dae3;
  border-radius: 9px;
  color: #35405a;
  background: #fff;
  font-size: 13px;
  font-weight: 750;
}

.bulk-actions .primary-action {
  border-color: #6455dc;
  color: #fff;
  background: #6455dc;
}

.scenario-groups {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 8px;
  max-width: 1480px;
  margin: 0 auto;
}

.scenario-group {
  min-width: 0;
  padding: 10px;
  border: 1px solid #dce1ea;
  border-radius: 12px;
  background: #f8f9fc;
}

.contract-group {
  border-color: #d8d2fb;
  background: #f8f7ff;
}

.scenario-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 8px;
}

.scenario-heading strong {
  color: #35405a;
  font-size: 12px;
}

.scenario-heading span {
  color: #8a93a6;
  font-size: 10px;
}

.bug-toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  gap: 8px;
}

.bug-toggle {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 9px;
  min-height: 72px;
  padding: 10px;
  border: 1px solid #dce1ea;
  border-radius: 10px;
  color: #35405a;
  background: #f8f9fc;
  text-align: left;
}

.bug-toggle:hover {
  border-color: #aaa2ec;
}

.bug-toggle.active {
  border-color: #e7a099;
  background: #fff5f3;
}

.bug-toggle strong,
.bug-toggle small {
  display: block;
}

.bug-toggle strong {
  margin: 1px 0 3px;
  font-size: 12px;
}

.bug-toggle em {
  margin-left: 3px;
  color: #8a93a6;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.bug-toggle small {
  color: #7b8498;
  font-size: 10px;
  line-height: 1.35;
}

.toggle-state {
  min-width: 42px;
  padding: 3px 5px;
  border-radius: 999px;
  color: #28745d;
  background: #dff5eb;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: uppercase;
}

.active .toggle-state {
  color: #a83b31;
  background: #ffe1dc;
}

.runtime-error {
  max-width: 1480px;
  margin: 12px auto 0;
  color: #b42318;
  font-size: 13px;
}

.demo-app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 780px;
  background: #f5f6fa;
}

.sidebar {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 26px 18px;
  color: #d4d8e5;
  background: #171a28;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin: 0 8px 30px;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #8b7cf4, #5746d5);
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #aeb5c8;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.nav-link.selected {
  color: #fff;
  background: #292d42;
}

.sidebar-help {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding: 14px;
  border: 1px solid #34394e;
  border-radius: 12px;
  font-size: 12px;
}

.sidebar-help span {
  color: #8e97ad;
  line-height: 1.4;
}

.demo-app main {
  min-width: 0;
  padding: 28px clamp(22px, 4vw, 54px) 70px;
}

.topbar,
.intro,
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.topbar {
  min-height: 64px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e2e5ec;
}

.workspace-name {
  max-width: 620px;
  margin: 5px 0 0;
  font-size: clamp(17px, 2vw, 22px);
  letter-spacing: -0.025em;
}

.bug-truncation .workspace-name {
  width: 176px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  min-width: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid #dce1ea;
  border-radius: 9px;
  color: #786ce0;
  background: #fff;
  font-size: 11px;
}

.bug-touch-target .icon-button {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border-radius: 5px;
  font-size: 7px;
}

.bug-experimental-control .icon-button {
  opacity: 0;
}

.avatar {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 50%;
  color: #493aad;
  background: #ded9ff;
  font-size: 11px;
  font-weight: 850;
}

.intro {
  padding: 34px 0 24px;
}

.intro h2,
.panel-heading h2 {
  margin: 5px 0;
  color: #172033;
  letter-spacing: -0.035em;
}

.intro h2 {
  font-size: clamp(27px, 3.2vw, 42px);
}

.intro > div > p:last-child,
.quota-card > p {
  margin: 0;
  color: #7b8498;
  font-size: 13px;
}

.sync-action {
  position: relative;
  flex: 0 0 auto;
}

.sync-button {
  min-width: 142px;
  min-height: 42px;
  padding: 9px 15px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #6455dc;
  font-size: 13px;
  font-weight: 750;
}

.sync-blocker {
  display: none;
  position: absolute;
  inset: -5px;
  z-index: 2;
  place-items: center;
  border: 1px solid #dce1ea;
  border-radius: 10px;
  color: #59657c;
  background: rgba(255, 255, 255, 0.96);
  font-size: 12px;
  font-weight: 700;
}

.bug-covered .sync-blocker {
  display: grid;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card,
.panel {
  min-width: 0;
  border: 1px solid #e1e4eb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 22px rgba(33, 43, 66, 0.055);
}

.metric-card {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 132px;
  padding: 20px;
}

.deployment-status {
  max-width: 100%;
  margin-top: 8px;
  padding: 4px 6px;
  border: 1px solid #dbe3ec;
  border-radius: 5px;
  color: #52606d;
  font-size: 11px;
}

.deployment-status-value {
  display: block;
}

.bug-clipped-card .deployment-status {
  width: 150px;
  overflow: hidden;
}

.bug-clipped-card .deployment-status-value {
  width: 290px;
  white-space: nowrap;
}

.robustness-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.stress-action {
  border: 1px solid #c67a2f;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a4f12;
  font-weight: 700;
}

.stress-action:disabled {
  cursor: wait;
  opacity: 0.65;
}

.metric-card > span:first-child {
  color: #7b8498;
  font-size: 12px;
  font-weight: 650;
}

.metric-card strong {
  color: #172033;
  font-size: 25px;
  letter-spacing: -0.035em;
}

.metric-card small {
  color: #7b8498;
  font-size: 11px;
}

.positive {
  color: #258166 !important;
}

.negative {
  color: #bb4237 !important;
}

.goal-card {
  overflow: visible;
}

.goal-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #28745d;
  background: #dff5eb;
  font-size: 10px;
  font-weight: 800;
}

.bug-badge-overflow .goal-badge {
  right: -96px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.7fr);
  gap: 14px;
}

.panel {
  padding: 20px;
}

.panel-heading {
  margin-bottom: 18px;
}

.panel-heading h2 {
  font-size: 19px;
}

.panel-heading a {
  min-height: 30px;
  padding: 6px;
  color: #6455dc;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
}

.table-shell {
  max-width: 100%;
  overflow-x: auto;
}

.usage-table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
  color: #35405a;
  font-size: 12px;
  text-align: left;
}

.bug-overflow .table-shell {
  max-width: none;
  overflow: visible;
}

.bug-overflow .usage-table {
  width: calc(100vw + 180px);
}

.usage-table th,
.usage-table td {
  height: 46px;
  padding: 8px 12px;
  border-bottom: 1px solid #edf0f4;
  white-space: nowrap;
}

.usage-table th {
  color: #8a93a6;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.environment {
  display: inline-block;
  padding: 4px 7px;
  border-radius: 999px;
  color: #28745d;
  background: #e5f6ef;
  font-size: 10px;
  font-weight: 700;
}

.environment.neutral {
  color: #5f687c;
  background: #eef0f4;
}

.quota-card {
  overflow: hidden;
}

.quota-visual {
  position: relative;
  display: grid;
  min-height: 230px;
  place-items: center;
}

.quota-ring {
  display: grid;
  width: 142px;
  height: 142px;
  place-content: center;
  border: 17px solid #ddd8ff;
  border-top-color: #6455dc;
  border-right-color: #6455dc;
  border-radius: 50%;
  text-align: center;
  transform: rotate(18deg);
}

.quota-ring > * {
  transform: rotate(-18deg);
}

.quota-ring strong {
  font-size: 25px;
}

.quota-ring span {
  color: #8a93a6;
  font-size: 10px;
}

.quota-label,
.quota-badge {
  position: absolute;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 750;
}

.quota-label {
  left: 10px;
  bottom: 13px;
  color: #4d5870;
  background: #edf0f5;
}

.quota-badge {
  right: 10px;
  bottom: 13px;
  color: #493aad;
  background: #e6e2ff;
}

.bug-overlap .quota-label {
  left: calc(50% - 30px);
}

.bug-overlap .quota-badge {
  right: calc(50% - 38px);
}

@media (max-width: 1050px) {
  .scenario-groups {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .demo-copy {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .scenario-group .bug-toggles {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .bug-toggle {
    min-width: 180px;
    scroll-snap-align: start;
  }

  .demo-app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    display: none;
  }

  .demo-app main {
    padding: 22px 18px 60px;
  }

  .topbar,
  .intro {
    align-items: flex-start;
  }

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

@media (max-width: 480px) {
  .demo-controls {
    padding: 18px 14px;
  }

  .bulk-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .topbar {
    gap: 10px;
  }

  .intro {
    display: grid;
  }
}
