:root {
  --bg: #0a0f14;
  --bg-soft: #121a21;
  --panel: rgba(17, 24, 31, 0.82);
  --panel-strong: rgba(11, 16, 22, 0.96);
  --line: rgba(195, 224, 255, 0.1);
  --text: #ecf6ff;
  --muted: #8ea0b3;
  --orange: #ff8a3d;
  --green: #63d38b;
  --red: #ff6666;
  --blue: #54b6ff;
  --yellow: #f4ce57;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(255, 138, 61, 0.18), transparent 28%),
    radial-gradient(circle at 85% 15%, rgba(84, 182, 255, 0.14), transparent 24%),
    linear-gradient(160deg, #06090d 0%, #0c1117 42%, #101922 100%);
}

.page-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
  opacity: 0.45;
}

.page-glow-a {
  top: -80px;
  left: -40px;
  width: 280px;
  height: 280px;
  background: rgba(255, 138, 61, 0.42);
}

.page-glow-b {
  right: -40px;
  bottom: 40px;
  width: 320px;
  height: 320px;
  background: rgba(84, 182, 255, 0.28);
}

.app-shell {
  position: relative;
  width: min(1360px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.panel {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero-card,
.workspace-grid,
.stats-grid,
.bottom-grid {
  display: grid;
  gap: 16px;
}

.hero-card {
  grid-template-columns: 1.4fr 0.9fr;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--orange);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 12px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2,
h3 {
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.94;
  max-width: 10ch;
}

.hero-text,
.section-head p,
.hint,
label span,
.key-cell small {
  color: var(--muted);
}

.hero-text {
  max-width: 62ch;
  margin-top: 14px;
  font-size: 17px;
  line-height: 1.55;
}

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

.token-box {
  align-content: center;
}

.token-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 16px;
}

.stat-card {
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -36px auto;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  opacity: 0.24;
}

.accent-orange::after { background: var(--orange); }
.accent-green::after { background: var(--green); }
.accent-red::after { background: var(--red); }
.accent-blue::after { background: var(--blue); }

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 42px;
}

.workspace-grid {
  grid-template-columns: 1fr 1.1fr;
  margin-bottom: 16px;
}

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

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

.section-head {
  margin-bottom: 14px;
}

.section-head.row,
.result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: var(--panel-strong);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

input:focus,
textarea:focus {
  border-color: rgba(84, 182, 255, 0.52);
  box-shadow: 0 0 0 4px rgba(84, 182, 255, 0.12);
  transform: translateY(-1px);
}

button {
  border: 0;
  border-radius: 999px;
  padding: 13px 18px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  transition: transform 150ms ease, opacity 150ms ease, box-shadow 150ms ease;
}

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

.primary {
  background: linear-gradient(135deg, #ff8a3d 0%, #f4ce57 100%);
  color: #17110a;
  box-shadow: 0 16px 34px rgba(255, 138, 61, 0.25);
}

.wide {
  width: 100%;
}

.danger {
  background: linear-gradient(135deg, #ff8b7f 0%, #d5354b 100%);
}

.ghost,
.copy-btn {
  background: rgba(255, 255, 255, 0.06);
}

.inline-form {
  display: grid;
  grid-template-columns: 1.2fr 0.5fr auto;
  gap: 10px;
}

#check-form {
  grid-template-columns: 1fr auto;
}

.result-card {
  margin-top: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  background: rgba(5, 9, 12, 0.64);
  padding: 16px;
}

#result-box {
  margin: 12px 0 0;
  min-height: 168px;
  max-height: 260px;
  overflow: auto;
  color: #d9ecff;
}

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

.connection-card {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.empty-state,
.empty-row {
  color: var(--muted);
  text-align: center;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.key-cell {
  display: grid;
  gap: 4px;
}

.badge {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.badge.active {
  background: rgba(99, 211, 139, 0.16);
  color: var(--green);
}

.badge.warning {
  background: rgba(244, 206, 87, 0.16);
  color: var(--yellow);
}

.badge.expired,
.badge.revoked {
  background: rgba(255, 102, 102, 0.16);
  color: var(--red);
}

@media (max-width: 1080px) {
  .hero-card,
  .workspace-grid,
  .stats-grid,
  .bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 16px, 100%);
    padding: 16px 0 24px;
  }

  .panel {
    padding: 18px;
    border-radius: 20px;
  }

  .inline-form,
  #check-form,
  .token-row {
    grid-template-columns: 1fr;
  }

  th,
  td {
    min-width: 140px;
  }
}
