:root {
  color-scheme: light dark;
  --bg: #f7f7fb;
  --text: #111114;
  --muted: #6d6876;
  --panel: rgba(255, 255, 255, .62);
  --panel-strong: rgba(255, 255, 255, .82);
  --line: rgba(23, 23, 28, .1);
  --accent: #111114;
  --accent-text: #ffffff;
  --danger: #d92d20;
  --ok: #149654;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 8% 6%, rgba(255, 150, 202, .55) 0, transparent 30%),
    radial-gradient(circle at 84% 8%, rgba(133, 222, 255, .58) 0, transparent 28%),
    radial-gradient(circle at 60% 92%, rgba(170, 255, 190, .48) 0, transparent 34%),
    var(--bg);
  color: var(--text);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 13px 14px;
  background: var(--panel-strong);
  color: var(--text);
  outline: none;
}

textarea {
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  line-height: 1.45;
}

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

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 60px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 22px;
  align-items: end;
  margin-bottom: 22px;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.brand-row img {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(39, 44, 63, .18);
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 800;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(48px, 8vw, 92px);
  line-height: .9;
}

h2 {
  font-size: 22px;
}

.lead {
  margin: 18px 0 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.42;
}

.panel,
.status-card {
  border: 1px solid rgba(255, 255, 255, .64);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(51, 55, 73, .14);
  backdrop-filter: blur(28px) saturate(1.25);
}

.panel {
  padding: 22px;
}

.status-card {
  min-height: 156px;
  padding: 22px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 7px rgba(217, 45, 32, .12);
}

.status-card.connected .status-dot {
  background: var(--ok);
  box-shadow: 0 0 0 7px rgba(20, 150, 84, .14);
}

.status-card small,
.note {
  color: var(--muted);
  line-height: 1.4;
}

.credentials-panel {
  display: grid;
  gap: 16px;
  margin-bottom: 22px;
}

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

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.apple-button {
  background: #000;
  color: #fff;
}

.apple-button span {
  margin-right: 8px;
  font-size: 19px;
  line-height: 1;
}

.secondary-button,
.ghost-button {
  background: rgba(255,255,255,.58);
  color: var(--text);
  border: 1px solid var(--line);
}

.ghost-button {
  min-height: 38px;
  padding: 0 14px;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(360px, .65fr);
  gap: 22px;
}

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

.action-grid button {
  border-radius: 18px;
  background: var(--panel-strong);
  color: var(--text);
  border: 1px solid var(--line);
  justify-content: start;
}

.output-panel {
  margin-top: 22px;
}

.pill {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border-radius: 999px;
  padding: 0 12px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

pre {
  overflow: auto;
  margin: 0;
  min-height: 220px;
  border-radius: 22px;
  padding: 18px;
  background: rgba(17, 17, 20, .92);
  color: #f7f7fb;
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

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

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101014;
    --text: #f7f7fb;
    --muted: #c2becb;
    --panel: rgba(26, 26, 32, .64);
    --panel-strong: rgba(255, 255, 255, .08);
    --line: rgba(255, 255, 255, .13);
    --accent: #f7f7fb;
    --accent-text: #111114;
  }

  body {
    background:
      radial-gradient(circle at 8% 6%, rgba(118, 34, 77, .64) 0, transparent 30%),
      radial-gradient(circle at 84% 8%, rgba(28, 98, 118, .62) 0, transparent 28%),
      radial-gradient(circle at 60% 92%, rgba(42, 95, 54, .56) 0, transparent 34%),
      var(--bg);
  }

  .panel,
  .status-card {
    border-color: rgba(255, 255, 255, .13);
    box-shadow: 0 24px 80px rgba(0, 0, 0, .34);
  }

  input,
  textarea,
  .secondary-button,
  .ghost-button {
    background: rgba(255, 255, 255, .08);
  }

  .apple-button {
    background: #f7f7fb;
    color: #111114;
  }
}
