:root {
  --ink: #121417;
  --muted: #5b616b;
  --line: #d8dde5;
  --paper: #f7f8fa;
  --panel: #ffffff;
  --good: #167a52;
  --warn: #a45d00;
  --bad: #b92f3b;
  --brand: #174c62;
  --focus: #e9f5f1;
  --shadow: 0 12px 30px rgba(18, 20, 23, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  background: #101820;
  color: #f7fbff;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 24px;
}

.mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, #54b58f, #e8d36f);
  display: grid;
  place-items: center;
  color: #101820;
  font-weight: 900;
}

.tagline {
  color: #c7d0d9;
  font-size: 14px;
  line-height: 1.45;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: #f7fbff;
  background: transparent;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav button.active {
  background: rgba(255, 255, 255, 0.12);
}

.icon {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.main {
  padding: 28px;
  overflow: auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

h1 {
  margin: 0 0 6px;
  font-size: 30px;
  line-height: 1.12;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 620px;
  line-height: 1.5;
}

.mode {
  display: inline-grid;
  grid-template-columns: repeat(3, minmax(72px, 1fr));
  background: #e4e9ef;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
  min-width: 292px;
}

.mode button {
  border: 0;
  border-radius: 6px;
  padding: 9px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  min-height: 40px;
}

.mode button.active {
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(18, 20, 23, 0.08);
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.7fr);
  gap: 20px;
}

.setup-wide {
  grid-column: 1 / -1;
}

.section {
  background: transparent;
  margin-bottom: 20px;
}

.command-center {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
  align-items: stretch;
}

.command-copy {
  background: #101820;
  color: #f7fbff;
  border-radius: 8px;
  padding: 18px;
  display: grid;
  align-content: center;
}

.command-copy h2 {
  margin: 6px 0 10px;
  font-size: 24px;
  line-height: 1.12;
}

.command-copy p {
  margin: 0;
  color: #c7d0d9;
  line-height: 1.5;
}

.eyebrow,
.lane-label {
  color: #5f8f7b;
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.lane {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  display: grid;
  gap: 12px;
  align-content: space-between;
  min-height: 198px;
}

.lane strong {
  display: block;
  margin: 6px 0;
  font-size: 17px;
  line-height: 1.2;
}

.lane p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.public-lane {
  border-color: #b9dcca;
}

.shield-lane {
  border-color: #f0d2a8;
}

.section h2,
.panel h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.metric,
.item,
.panel,
.phone {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 1px 0 rgba(18, 20, 23, 0.03);
}

.metric {
  padding: 16px;
  min-height: 92px;
}

.metric strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-bottom: 8px;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.list {
  display: grid;
  gap: 10px;
}

.item {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.item-title {
  font-weight: 700;
  margin-bottom: 4px;
}

.item-copy {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

.badge {
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  white-space: nowrap;
  background: #eef2f5;
  color: var(--muted);
}

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

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

.badge.bad {
  background: #ffe8eb;
  color: var(--bad);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 8px;
  padding: 9px 12px;
  min-height: 38px;
  cursor: pointer;
}

.btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: white;
}

.btn.danger {
  border-color: #f1c4ca;
  color: var(--bad);
  background: #fff7f8;
}

.rightcol {
  display: grid;
  gap: 20px;
  align-content: start;
}

.phone {
  padding: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.phone-screen {
  border: 1px solid #c9d0d8;
  border-radius: 24px;
  background: #0f171d;
  color: white;
  min-height: 480px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.screen-top {
  display: flex;
  justify-content: space-between;
  color: #aeb8c2;
  font-size: 13px;
}

.call-visual {
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.pulse {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: radial-gradient(circle at 35% 30%, #a8f0c6, #2b806f 52%, #174c62);
  display: grid;
  place-items: center;
  font-size: 34px;
  font-weight: 900;
}

.screen-title {
  font-size: 20px;
  font-weight: 800;
  margin: 0;
}

.screen-copy {
  color: #cfdae3;
  line-height: 1.45;
  margin: 0;
}

.screen-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.screen-card strong {
  display: block;
  margin-bottom: 6px;
}

.panel {
  padding: 16px;
}

.setup-assistant {
  display: grid;
  gap: 14px;
  padding: 14px;
  margin-bottom: 14px;
  border: 1px solid #b9dcca;
  border-radius: 8px;
  background: #f8fcfa;
}

.assistant-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.assistant-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
  line-height: 1.2;
}

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

.assistant-actions .btn {
  text-align: center;
  text-decoration: none;
}

.checklist {
  display: grid;
  gap: 8px;
}

.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 650;
}

.check-item input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.setup-stack {
  display: grid;
  gap: 12px;
}

.setup-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.step-num {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.copy-row.tight {
  max-width: 360px;
}

.code-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.code-pill {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fafb;
  color: var(--ink);
  padding: 9px 10px;
  min-height: 38px;
  cursor: pointer;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.code-pill:hover {
  border-color: #b8c2ce;
  background: #fff;
}

.hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: white;
  color: var(--ink);
}

textarea {
  min-height: 104px;
  resize: vertical;
}

.hidden {
  display: none;
}

.result {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  background: var(--focus);
  border: 1px solid #c9e8dc;
  color: #174c48;
  line-height: 1.45;
}

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 16px;
  }

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

  .nav button {
    justify-content: center;
    text-align: center;
  }

  .nav span:last-child {
    display: none;
  }

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

  .command-center,
  .lane-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .main {
    padding: 18px;
  }

  .topbar {
    display: grid;
  }

  .mode {
    width: 100%;
    min-width: 0;
  }

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

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

  .code-grid,
  .copy-row,
  .assistant-actions {
    grid-template-columns: 1fr;
  }

  .phone-screen {
    min-height: 430px;
  }
}
