:root {
  --bg: #0c1117;
  --panel: rgba(12, 17, 23, 0.74);
  --panel-strong: rgba(16, 24, 32, 0.92);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f3ee;
  --muted: #b8c0c9;
  --accent: #ff8d5d;
  --accent-soft: rgba(255, 141, 93, 0.14);
  --teal: #5fd0bf;
  --warn: #ffbd66;
  --shadow: 0 32px 80px rgba(0, 0, 0, 0.3);
  --radius-xl: 32px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
}

html {
  background:
    radial-gradient(circle at top left, rgba(95, 208, 191, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(255, 141, 93, 0.24), transparent 32%),
    linear-gradient(180deg, #0c1117 0%, #111925 48%, #0e141b 100%);
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1380px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 28px;
  min-height: 48vh;
  padding: 44px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.04), transparent 40%),
    linear-gradient(180deg, rgba(255, 141, 93, 0.08), rgba(95, 208, 191, 0.05)),
    rgba(8, 12, 17, 0.76);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -8% -26% auto;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 141, 93, 0.35), transparent 65%);
  filter: blur(10px);
  pointer-events: none;
}

.eyebrow,
.kicker {
  margin: 0 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--teal);
}

.hero h1,
.panel h2,
.section-head h2 {
  margin: 0;
  font-family: "Optima", "Avenir Next", sans-serif;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.hero h1 {
  max-width: 8ch;
  font-size: clamp(3rem, 7vw, 5.6rem);
  line-height: 0.95;
}

.lede {
  max-width: 42rem;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.hero-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.hero-meta div,
.status-item,
.summary-band,
.config-card,
.panel,
.tool-row,
.check-item {
  backdrop-filter: blur(12px);
}

.hero-meta div {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}

.hero-meta span,
.status-item span,
.identity-grid span,
.config-meta span,
.config-head span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 6px;
}

.hero-meta strong,
.status-item strong,
.identity-grid strong,
.config-head strong {
  font-weight: 600;
  word-break: break-word;
}

.hero-panel {
  position: relative;
  display: flex;
  align-items: end;
  justify-content: center;
  min-height: 280px;
}

.pulse-orb {
  position: absolute;
  inset: 18px 12% 28px;
  border-radius: 36px;
  background:
    radial-gradient(circle at 30% 30%, rgba(95, 208, 191, 0.56), transparent 30%),
    radial-gradient(circle at 72% 38%, rgba(255, 141, 93, 0.62), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.01));
  filter: saturate(130%);
  animation: drift 9s ease-in-out infinite alternate;
}

.status-stack {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(100%, 280px);
}

.status-item,
.panel,
.config-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

.status-item {
  padding: 16px 18px;
  border-radius: 18px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
  gap: 22px;
  margin-top: 22px;
}

.workspace-main {
  display: grid;
  gap: 22px;
}

.workspace-side {
  display: grid;
  gap: 22px;
  align-content: start;
}

.panel {
  padding: 24px;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.panel-head,
.section-head,
.config-head,
.config-meta,
.actions,
.clear-form {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.panel h2,
.section-head h2 {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

.flash,
.timestamp,
.section-note {
  max-width: 26rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.token-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.token-form label {
  display: grid;
  gap: 10px;
}

.token-form span {
  color: var(--muted);
  font-size: 0.9rem;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  padding: 15px 16px;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}

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

input:focus,
textarea:focus {
  outline: none;
  border-color: rgba(95, 208, 191, 0.65);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}

.actions {
  justify-content: flex-start;
  margin-top: 10px;
}

.primary,
.secondary,
.copy-button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  transition: transform 180ms ease, opacity 180ms ease, background 180ms ease;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary {
  color: #111;
  background: linear-gradient(135deg, #ffb58f, var(--accent));
}

.secondary,
.copy-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.primary:hover,
.secondary:hover,
.copy-button:hover {
  transform: translateY(-1px);
}

.summary-band {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  margin-top: 18px;
  border-radius: 18px;
}

.summary-band.ok {
  background: linear-gradient(135deg, rgba(95, 208, 191, 0.16), rgba(95, 208, 191, 0.05));
}

.summary-band.warn {
  background: linear-gradient(135deg, rgba(255, 189, 102, 0.16), rgba(255, 141, 93, 0.05));
}

.result-block {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
}

.result-block-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.result-block-kicker {
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-scroll {
  margin-top: 14px;
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
}

.result-scroll-token {
  max-height: 18rem;
}

.result-scroll-checks {
  max-height: 28rem;
}

.result-scroll-identity {
  max-height: 14rem;
}

.result-scroll::-webkit-scrollbar {
  width: 10px;
}

.result-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
}

.result-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 141, 93, 0.28);
  border-radius: 999px;
}

.result-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 141, 93, 0.4);
}

.empty-state {
  margin-top: 18px;
  color: var(--muted);
  line-height: 1.7;
}

.check-list,
.tool-list,
.config-grid {
  display: grid;
  gap: 14px;
}

.check-list,
.tool-list {
  margin-top: 18px;
}

.tools-panel {
  display: grid;
  min-height: 0;
}

.tools-scroll {
  max-height: min(68vh, 880px);
  overflow: auto;
  overscroll-behavior: contain;
  padding-right: 8px;
}

.tools-scroll::-webkit-scrollbar {
  width: 10px;
}

.tools-scroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 999px;
}

.tools-scroll::-webkit-scrollbar-thumb {
  background: rgba(95, 208, 191, 0.28);
  border-radius: 999px;
}

.tools-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(95, 208, 191, 0.42);
}

.check-item,
.tool-row {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.025);
}

.tool-detail-block {
  margin-top: 14px;
}

.tool-detail-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tool-detail-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.tool-detail-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.tool-detail-item strong {
  font-size: 0.92rem;
}

.tool-detail-item span,
.tool-detail-note,
.tool-detail-empty,
.tool-detail-item p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.6;
}

.tool-detail-item p {
  margin: 0;
}

.check-item div,
.tool-row header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.check-item p,
.tool-row p,
.config-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.check-item code {
  display: block;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.24);
  color: #dfe8ef;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.85rem;
}

.check-item.pass {
  border-color: rgba(95, 208, 191, 0.24);
}

.check-item.fail {
  border-color: rgba(255, 141, 93, 0.24);
}

.identity-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.result-identity-grid {
  margin-top: 0;
}

.identity-grid > div {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.account-grid {
  margin-top: 18px;
}

.signin-state {
  margin-top: 18px;
}

.mini-tags,
.scope-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mini-tags span,
.scope-lines span {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.82rem;
}

.config-zone {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.config-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
}

.config-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.015);
}

.config-head a {
  color: var(--teal);
  text-decoration: none;
}

.config-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
}

pre {
  margin: 0;
  padding: 16px;
  border-radius: 18px;
  overflow: auto;
  background: rgba(4, 8, 12, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

pre code {
  font-family: "SFMono-Regular", "Menlo", monospace;
  font-size: 0.84rem;
  line-height: 1.6;
  color: #f9d9c8;
}

.copy-button {
  justify-self: start;
}

.reveal {
  animation: reveal 680ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes drift {
  from {
    transform: scale(0.96) translateY(0);
  }
  to {
    transform: scale(1.02) translateY(-6px);
  }
}

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

  .tools-scroll {
    max-height: 34rem;
  }

  .result-scroll-token {
    max-height: 16rem;
  }

  .result-scroll-checks {
    max-height: 24rem;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1380px);
    padding-top: 12px;
  }

  .hero,
  .panel,
  .config-zone {
    padding: 20px;
    border-radius: 24px;
  }

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

  .result-block-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-scroll {
    padding-right: 4px;
  }

  .result-scroll-token,
  .result-scroll-checks,
  .result-scroll-identity {
    max-height: 14rem;
  }

  .tools-scroll {
    max-height: 22rem;
    padding-right: 4px;
  }

  .check-item div,
  .tool-row header,
  .panel-head,
  .section-head,
  .config-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
