:root {
  --tg-bg: #eef3f8;
  --tg-card: #ffffff;
  --tg-text: #17212b;
  --tg-muted: #6f8398;
  --tg-accent: #229ed9;
  --tg-accent-strong: #1c84b9;
  --line: rgba(21, 54, 89, 0.12);
  --shadow: 0 14px 36px rgba(14, 52, 90, 0.13);
  --danger-bg: #fff1f4;
  --danger-line: #ffcfd9;
  --danger-text: #8b1d39;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--tg-text);
  background:
    radial-gradient(1100px 420px at 15% -8%, rgba(34, 158, 217, 0.22), transparent 62%),
    radial-gradient(900px 360px at 95% -6%, rgba(68, 164, 232, 0.2), transparent 58%),
    linear-gradient(180deg, #f4f8fc 0%, var(--tg-bg) 72%, #edf3f9 100%);
}

.app {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 14px 32px;
}

.hero {
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.9));
  box-shadow: var(--shadow);
  padding: 14px;
}

.hero__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hero__bottom {
  margin-top: 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hero__desc {
  margin: 0;
  color: var(--tg-muted);
  line-height: 1.45;
  font-size: 13px;
}

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

.logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(165deg, #27a4df 0%, #1f89bf 100%);
}

.title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: var(--tg-muted);
}

.pill {
  flex-shrink: 0;
  border: 1px solid rgba(34, 158, 217, 0.2);
  background: rgba(34, 158, 217, 0.12);
  color: var(--tg-accent-strong);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
}

.chip {
  border-radius: 999px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  color: var(--tg-muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.chip--accent {
  border-color: rgba(34, 158, 217, 0.24);
  background: rgba(34, 158, 217, 0.12);
  color: var(--tg-accent-strong);
}

.seg {
  margin-top: 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.7);
  padding: 4px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.seg__btn {
  appearance: none;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--tg-muted);
  font-size: 14px;
  font-weight: 700;
  padding: 9px 8px;
  cursor: pointer;
}

.seg__btn.is-active {
  background: linear-gradient(170deg, #2ea9e4, #178ac5);
  color: #fff;
}

.panel {
  margin-top: 12px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(16, 61, 102, 0.09);
  padding: 14px;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel h2 {
  margin: 0;
  font-size: 17px;
}

.muted {
  margin: 10px 0 0;
  color: var(--tg-muted);
  font-size: 13px;
  line-height: 1.45;
}

.meta-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.meta {
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.76);
  padding: 10px;
}

.label {
  color: var(--tg-muted);
  font-size: 12px;
}

.value {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.kv {
  margin-top: 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.77);
  padding: 10px;
}

.pre {
  margin: 7px 0 10px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: 12px;
  color: #2a4764;
}

.stack {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 11px 12px;
  background: linear-gradient(170deg, #2ea9e4, #178ac5);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn.secondary {
  background: rgba(34, 158, 217, 0.12);
  border: 1px solid rgba(34, 158, 217, 0.24);
  color: var(--tg-accent-strong);
}

.btn.tiny {
  font-size: 12px;
  padding: 7px 9px;
  border-radius: 10px;
}

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

.actions .btn {
  flex: 1;
}

.proto-list {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.proto {
  border-radius: 12px;
  border: 1px solid rgba(26, 77, 122, 0.12);
  background: rgba(248, 252, 255, 0.9);
  padding: 10px;
}

.proto__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.proto__title {
  font-size: 13px;
  font-weight: 700;
  color: #1e456c;
}

.err {
  border-radius: 12px;
  border: 1px solid var(--danger-line);
  background: var(--danger-bg);
  color: var(--danger-text);
  padding: 10px;
  font-size: 13px;
  line-height: 1.42;
  white-space: pre-wrap;
}

.hidden {
  display: none !important;
}

@media (max-width: 460px) {
  .hero__bottom {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .actions {
    flex-direction: column;
  }

  .actions .btn {
    width: 100%;
  }
}
