:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-alt: #edf2f7;
  --text: #17202a;
  --muted: #667085;
  --line: #d9e1ea;
  --blue: #1f6feb;
  --blue-dark: #174ea6;
  --green: #217a4b;
  --red: #b42318;
  --amber: #9a6700;
  --shadow: 0 12px 30px rgba(25, 43, 70, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a {
  color: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar h1,
.panel h2,
.demo-copy h1 {
  margin: 0;
  line-height: 1.1;
}

.topbar h1 {
  font-size: clamp(24px, 3vw, 38px);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.top-actions,
.toolbar,
.call-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.client-switcher {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.client-switcher span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-switcher select {
  min-width: 210px;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 750;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: #9fb2c7;
  background: #f9fbff;
}

.button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.button.primary:hover {
  background: var(--blue-dark);
}

.button.secondary {
  background: var(--surface-alt);
}

.button.danger {
  color: var(--red);
}

.button.small {
  min-height: 34px;
  padding: 0 10px;
  font-size: 13px;
}

.layout {
  display: grid;
  gap: 18px;
  width: min(1380px, 100%);
  margin: 0 auto;
  padding: 22px clamp(16px, 3vw, 32px) 46px;
}

.toolbar,
.metrics,
.split,
.grid-two {
  width: 100%;
}

.toolbar {
  align-items: center;
}

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

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

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

.metric span,
.definition-list span,
th,
.muted {
  color: var(--muted);
}

.metric strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

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

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

.panel {
  min-width: 0;
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel h2 {
  font-size: 20px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e9f7ef;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.definition-list {
  display: grid;
  gap: 12px;
}

.definition-list div {
  display: grid;
  gap: 4px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.definition-list div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.code {
  overflow: auto;
  max-height: 340px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101828;
  color: #e7edf6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  font-size: 12px;
  text-transform: uppercase;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 800;
}

.badge.good {
  background: #e9f7ef;
  color: var(--green);
}

.badge.warn {
  background: #fff4d6;
  color: var(--amber);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  max-width: min(460px, calc(100vw - 36px));
  padding: 14px 16px;
  border-radius: 8px;
  background: #101828;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

.demo-body {
  min-height: 100vh;
  background:
    linear-gradient(rgba(11, 18, 32, 0.68), rgba(11, 18, 32, 0.45)),
    url("https://images.unsplash.com/photo-1556745757-8d76bdb6984b?auto=format&fit=crop&w=1800&q=80") center/cover fixed;
  color: #fff;
}

.demo-page {
  min-height: 100vh;
  display: grid;
  align-items: center;
  padding: clamp(18px, 4vw, 64px);
}

.demo-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 420px);
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
  width: min(1160px, 100%);
}

.demo-copy {
  max-width: 700px;
}

.demo-copy h1 {
  max-width: 680px;
  font-size: clamp(44px, 8vw, 84px);
}

.demo-copy p {
  max-width: 620px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  line-height: 1.7;
}

.phone-link {
  display: inline-flex;
  align-items: center;
  min-height: 54px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 22px;
  font-weight: 850;
  text-decoration: none;
}

.demo-panel {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(14, 24, 38, 0.76);
  backdrop-filter: blur(10px);
}

.demo-panel dl {
  display: grid;
  gap: 14px;
  margin: 0;
}

.demo-panel div {
  display: grid;
  gap: 4px;
}

.demo-panel dt {
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.demo-panel dd {
  overflow-wrap: anywhere;
  margin: 0;
  font-weight: 750;
}

@media (max-width: 940px) {
  .topbar,
  .split,
  .grid-two,
  .demo-hero {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

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

@media (max-width: 560px) {
  .metrics {
    grid-template-columns: 1fr;
  }

  .button,
  .phone-link {
    width: 100%;
  }

  .demo-copy h1 {
    font-size: 40px;
  }
}
