:root {
  color-scheme: light;
  --bg-1: #f3f7ff;
  --bg-2: #eef6f0;
  --card: rgba(255, 255, 255, 0.9);
  --text: #172033;
  --muted: #5f6b84;
  --line: rgba(216, 222, 234, 0.95);
  --primary: #1976d2;
  --primary-strong: #125aa4;
  --primary-soft: rgba(25, 118, 210, 0.1);
  --shadow: 0 24px 70px rgba(24, 39, 75, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(25, 118, 210, 0.14), transparent 36%),
    radial-gradient(circle at bottom right, rgba(46, 125, 50, 0.12), transparent 34%),
    linear-gradient(180deg, var(--bg-1), var(--bg-2));
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.card {
  width: min(560px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.stack {
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.lead {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 1.02rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.spinner {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 16px 0 0 rgba(25, 118, 210, 0.45);
  animation: pulse 0.9s ease-in-out infinite;
}

#output {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(247, 250, 255, 0.92);
  color: #31415e;
  text-align: left;
  font-family: ui-monospace, SFMono-Regular, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.93rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

button {
  appearance: none;
  border: 0;
  border-radius: 4px;
  padding: 14px 26px;
  min-width: 132px;
  background: linear-gradient(180deg, var(--primary), var(--primary-strong));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(25, 118, 210, 0.18);
  transition: transform 0.15s ease, filter 0.15s ease, background-color 0.15s ease;
}

/* Mini probe control next to Proceed — not primary product UX */
button.btn-detour {
  min-width: 0;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--line);
  box-shadow: none;
}

button.btn-detour:hover:not(:disabled) {
  color: var(--text);
  border-color: #9aa8c0;
  background: rgba(255, 255, 255, 0.7);
  transform: none;
}

button.btn-detour:disabled {
  background: transparent;
  color: #a7b4c8;
  border-color: var(--line);
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:focus-visible {
  outline: 3px solid rgba(25, 118, 210, 0.25);
  outline-offset: 2px;
}

button:disabled {
  background: #a7b4c8;
  box-shadow: none;
  cursor: not-allowed;
}

.context-fields {
  display: none;
}

.consent-scopes {
  display: grid;
  gap: 10px;
}

.consent-scope {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(247, 250, 255, 0.92);
}

.consent-scope-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  font-weight: 700;
}

.consent-scope strong {
  display: block;
  line-height: 1.35;
}

.consent-scope p,
.consent-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.consent-note {
  margin: 0;
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

button.consent-deny {
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: none;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 640px) {
  .page {
    padding: 16px;
  }

  .card {
    padding: 24px;
  }

  .actions,
  .consent-actions,
  button {
    width: 100%;
  }

  .consent-actions {
    flex-direction: column-reverse;
  }
}
