* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --bg: #fbfcff;
  --text: #111827;
  --muted: #64748b;
  --soft: #f8faff;
  --line: #e3e8f3;
  --line-strong: #d3dbea;
  --purple: #7c3aed;
  --blue: #3b82f6;
  --teal: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow-sm: 0 12px 34px rgba(31, 41, 55, 0.08);
  --gradient: linear-gradient(135deg, #7c3aed 0%, #6d5dfc 48%, #3b82f6 100%);
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(59, 130, 246, 0.14), transparent 28%),
    radial-gradient(circle at 10% 8%, rgba(124, 58, 237, 0.1), transparent 24%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 26px 28px 32px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 48px;
}

.nav-logo {
  display: inline-flex;
  border-radius: 14px;
}

.nav-logo:hover,
.nav-pill:hover,
.repo-link:hover {
  text-decoration: none;
}

.nav-logo img {
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(124, 58, 237, 0.18);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.nav-links a {
  color: var(--text);
}

.nav-pill,
.repo-link {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 13px;
  background: #fff;
}

.nav-pill {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
}

.nav-action {
  min-height: 32px;
  border-color: #bbf7d0;
  border-radius: 999px;
  padding: 4px 13px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 14px;
  font-weight: 800;
}

.nav-action:hover:not(:disabled) {
  border-color: #86efac;
  box-shadow: 0 12px 26px rgba(16, 185, 129, 0.12);
}

.nav-menu {
  position: relative;
}

.nav-menu summary {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 6px;
  list-style: none;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 13px;
  background: #fff;
  color: var(--text);
}

.nav-menu summary::-webkit-details-marker {
  display: none;
}

.nav-menu summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.nav-menu[open] summary::after {
  transform: translateY(2px) rotate(225deg);
}

.nav-menu-list {
  position: absolute;
  right: 0;
  z-index: 10;
  display: grid;
  min-width: 132px;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.nav-menu-list a {
  border-radius: 6px;
  padding: 8px 10px;
  white-space: nowrap;
}

.nav-menu-list a:hover {
  background: var(--soft);
  text-decoration: none;
}

.content-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, 0.42);
}

.content-dialog[hidden] {
  display: none;
}

.content-dialog-panel {
  width: min(940px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.28);
}

.content-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.dialog-close {
  width: 34px;
  min-height: 34px;
  border-radius: 999px;
  padding: 0;
  background: #f8fafc;
  color: #475569;
  font-size: 22px;
  line-height: 1;
}

.content-dialog-panel img {
  display: block;
  width: 100%;
  height: auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 34px;
  align-items: center;
  padding: 42px 10px 52px;
}

.hero-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(36px, 6vw, 54px);
  line-height: 1.06;
  font-weight: 850;
  letter-spacing: 0;
}

.hero-copy h1 span {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 0;
  color: #334155;
  font-size: clamp(18px, 2vw, 22px);
}

.hero-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  margin-top: 44px;
}

.feature-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--purple);
  font-size: 13px;
  font-weight: 800;
}

.feature-item strong,
.feature-item small {
  display: block;
}

.feature-item strong {
  font-size: 15px;
  font-weight: 800;
}

.feature-item small {
  color: var(--muted);
  font-size: 12px;
}

.hero-art {
  position: relative;
  min-height: 300px;
  display: grid;
  place-items: center;
}

.hero-art::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 230px;
  border-radius: 42px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(59, 130, 246, 0.12));
  transform: translate(24px, -16px);
}

.hero-art::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 180px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.1);
  transform: translate(44px, 28px);
}

.hero-logo-mark {
  position: absolute;
  z-index: 4;
  top: -28px;
  right: 18px;
  width: 110px;
  height: 110px;
  border-radius: 30px;
  box-shadow: 0 22px 55px rgba(59, 130, 246, 0.18);
}

.art-window {
  position: relative;
  z-index: 1;
  width: 220px;
  height: 210px;
  border-radius: 10px;
  padding: 42px 28px 28px;
  background: #1f2937;
  box-shadow: 0 28px 56px rgba(15, 23, 42, 0.22);
  transform: translate(-8px, 22px);
}

.art-window span {
  position: absolute;
  top: 18px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
}

.art-window span:nth-child(1) {
  left: 18px;
  background: #fb7185;
}

.art-window span:nth-child(2) {
  left: 34px;
  background: #60a5fa;
}

.art-window span:nth-child(3) {
  left: 50px;
  background: #34d399;
}

.art-line {
  height: 8px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.22);
}

.art-line.long {
  width: 100%;
}

.art-line.short {
  width: 52%;
}

.art-file {
  position: absolute;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 108px;
  height: 128px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: var(--shadow-sm);
}

.json-file {
  left: 28px;
  bottom: -2px;
  color: var(--purple);
}

.auth-file {
  right: 10px;
  bottom: -16px;
  color: #0f766e;
}

.art-file strong {
  font-size: 20px;
  font-weight: 850;
}

.auth-file strong {
  font-size: 14px;
}

.art-file span {
  margin-top: 6px;
  font-weight: 800;
}

.auth-file span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #0fb9c5;
  color: #fff;
}

.art-arrow {
  position: absolute;
  z-index: 3;
  bottom: 56px;
  left: 46%;
  color: #5b6fea;
  font-size: 56px;
  font-weight: 300;
}

.workflow-card,
.result-card,
.info-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.workflow-card {
  padding: 34px 36px;
}

.step-heading {
  margin-bottom: 18px;
}

.step-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.session-link {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 3px 10px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 13px;
  font-weight: 750;
}

.session-link:hover {
  border-color: #93c5fd;
  text-decoration: none;
}

h2 {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  line-height: 1.25;
  font-weight: 850;
}

.step-heading p,
.result-header p,
.info-section p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.login-alert {
  display: grid;
  gap: 5px;
  margin-top: 12px;
  border: 1px solid #fbbf24;
  border-left-width: 4px;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fffbeb;
  color: #78350f;
}

.login-alert strong {
  font-size: 14px;
  font-weight: 850;
}

.login-alert a {
  color: #b45309;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.login-alert span {
  color: #92400e;
  font-size: 13px;
  line-height: 1.6;
}

textarea {
  display: block;
  width: 100%;
  min-height: 142px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 16px;
  background: rgba(248, 250, 252, 0.78);
  color: #1e293b;
  font: 14px/1.55 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

textarea:focus {
  outline: 3px solid rgba(124, 58, 237, 0.14);
  border-color: #a78bfa;
}

.input-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
}

.input-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.input-actions button {
  min-width: 150px;
}

.input-status-group {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  padding: 6px 12px;
  background: #eff6ff;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.08);
  text-align: right;
}

.input-footer a,
.status-line {
  font-size: 13px;
}

.status-line {
  margin: 0;
  color: #1e40af;
  font-weight: 650;
}

.status-line.ok {
  color: #047857;
}

.status-line.error {
  color: #b91c1c;
}

button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 16px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

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

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

button.primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 16px 34px rgba(124, 58, 237, 0.25);
}

button.secondary {
  background: #fff;
  color: #475569;
  border-color: var(--line);
}

button.secondary:hover:not(:disabled) {
  border-color: #c4b5fd;
  box-shadow: 0 12px 26px rgba(124, 58, 237, 0.12);
}

.result-card {
  margin-top: 14px;
  padding: 26px 36px 24px;
}

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

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

.details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--soft);
}

.label,
.value {
  display: block;
}

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

.value {
  margin-top: 3px;
  color: var(--text);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.value-code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.json-preview {
  min-height: 178px;
  max-height: 360px;
  margin: 0;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 18px;
  background: #fbfdff;
  color: #1e293b;
  font: 13px/1.65 ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.copy-line {
  min-height: 20px;
  margin-top: 10px;
}

.warning-line {
  margin: 4px 0 0;
  color: var(--warning);
  font-size: 13px;
}

.placement-guide {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 18px;
  margin-top: 18px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 16px;
  background: #eff6ff;
}

.placement-guide h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
  font-weight: 850;
}

.placement-guide p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.placement-guide code,
.path-row code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

.path-list {
  display: grid;
  gap: 8px;
}

.path-row {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.path-row span {
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 850;
}

.path-row code {
  min-width: 0;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  padding: 7px 9px;
  background: #ffffff;
  color: #1e293b;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.info-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px;
  margin-top: 20px;
  padding: 24px 28px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.badge-idle,
.badge-checking {
  background: #eff6ff;
  color: #2563eb;
}

.badge-ok {
  background: #dcfce7;
  color: #15803d;
}

.badge-error {
  background: #fee2e2;
  color: #b91c1c;
}

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

  .nav,
  .result-header,
  .footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    gap: 18px;
    flex-wrap: wrap;
  }

  .nav-menu-list {
    left: 0;
    right: auto;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 34px 0 34px;
  }

  .hero-art {
    min-height: 260px;
  }

  .feature-grid,
  .workflow-card,
  .details,
  .placement-guide,
  .info-section {
    grid-template-columns: 1fr;
  }

  .workflow-card {
    padding: 24px;
  }

  .result-card {
    padding: 24px;
  }
}

@media (max-width: 640px) {
  .input-footer,
  .input-status-group {
    align-items: flex-start;
    flex-direction: column;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .hero-copy h1 {
    font-size: 38px;
  }

  .hero-art {
    transform: scale(0.88);
    transform-origin: top center;
    margin-bottom: -28px;
  }

  .result-actions {
    width: 100%;
    justify-content: stretch;
  }

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

}
