* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --bg: #fdf7e6;
  --text: #4a3f29;
  --muted: #9a8a67;
  --soft: #fdf8ea;
  --surface: #fffdf6;
  --line: #efe2c0;
  --line-strong: #e6d4a4;
  --amber: #e2a92e;
  --amber-deep: #b8821a;
  --honey: #f6c453;
  --teal: #5fa86a;
  --warning: #d98a1c;
  --danger: #d4584a;
  --shadow-sm: 0 14px 34px rgba(150, 110, 30, 0.12);
  --gradient: linear-gradient(135deg, #f7cf63 0%, #eab308 48%, #d98e04 100%);
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background:
    radial-gradient(circle at 82% 18%, rgba(246, 196, 83, 0.28), transparent 30%),
    radial-gradient(circle at 10% 8%, rgba(234, 179, 8, 0.16), transparent 26%),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--amber-deep);
  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: 16px;
}

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

.nav-logo img {
  border-radius: 16px;
  box-shadow: 0 14px 34px rgba(224, 168, 46, 0.26);
}

.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: var(--surface);
}

.nav-pill {
  min-height: 40px;
  gap: 7px;
  padding: 6px 20px;
  border-color: transparent;
  background: var(--gradient);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 12px 26px rgba(224, 168, 46, 0.34);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.nav-pill::before {
  content: "";
  width: 17px;
  height: 17px;
  background: #fff;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z'/%3E%3C/svg%3E") center/contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9.78 18.65l.28-4.23 7.68-6.92c.34-.31-.07-.46-.52-.19L7.74 13.3 3.64 12c-.88-.25-.89-.86.2-1.3l15.97-6.16c.73-.33 1.43.18 1.15 1.3l-2.72 12.81c-.19.91-.74 1.13-1.5.71L12.6 16.3l-1.99 1.93c-.23.23-.42.42-.83.42z'/%3E%3C/svg%3E") center/contain no-repeat;
}

.nav-pill:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px rgba(224, 168, 46, 0.44);
}

.nav-pill:nth-of-type(2) {
  background: linear-gradient(135deg, #f6a96b 0%, #e08a1e 100%);
  box-shadow: 0 12px 26px rgba(224, 138, 30, 0.34);
}

.nav-pill:nth-of-type(2):hover {
  box-shadow: 0 16px 32px rgba(224, 138, 30, 0.44);
}

.nav-action {
  min-height: 32px;
  border-color: #c7e0a8;
  border-radius: 999px;
  padding: 4px 13px;
  background: #f3f9e8;
  color: #5a7e34;
  font-size: 14px;
  font-weight: 800;
}

.nav-action:hover:not(:disabled) {
  border-color: #a9d27e;
  box-shadow: 0 12px 26px rgba(120, 160, 60, 0.16);
}

.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: var(--surface);
  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: 12px;
  padding: 6px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.nav-menu-list a {
  border-radius: 8px;
  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(74, 63, 41, 0.42);
}

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

.content-dialog-panel {
  width: min(940px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 26px 70px rgba(120, 90, 30, 0.3);
}

.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: var(--soft);
  color: #8a7a57;
  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: #6b5d3c;
  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: #fdf0cc;
  color: var(--amber-deep);
  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(246, 196, 83, 0.32), rgba(234, 179, 8, 0.2));
  transform: translate(24px, -16px);
}

.hero-art::after {
  content: "";
  position: absolute;
  width: 280px;
  height: 180px;
  border-radius: 999px;
  background: rgba(247, 207, 99, 0.28);
  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(224, 168, 46, 0.28);
}

.art-window {
  position: relative;
  z-index: 1;
  width: 220px;
  height: 210px;
  border-radius: 14px;
  padding: 42px 28px 28px;
  background: #443a26;
  box-shadow: 0 28px 56px rgba(90, 70, 25, 0.28);
  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: #f6a96b;
}

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

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

.art-line {
  height: 8px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: rgba(246, 224, 170, 0.28);
}

.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: 14px;
  background: var(--surface);
  border: 1px solid rgba(230, 212, 164, 0.9);
  box-shadow: var(--shadow-sm);
}

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

.auth-file {
  right: 10px;
  bottom: -16px;
  color: #4f8a3e;
}

.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: #6aa84f;
  color: #fff;
}

.art-arrow {
  position: absolute;
  z-index: 3;
  bottom: 56px;
  left: 46%;
  color: var(--amber);
  font-size: 56px;
  font-weight: 300;
}

.workflow-card,
.result-card,
.info-section,
.steps-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 246, 0.9);
  box-shadow: var(--shadow-sm);
}

.steps-card {
  margin-top: 14px;
  padding: 26px 36px 28px;
}

.steps-head h2 {
  margin: 0;
}

.steps-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.steps-list {
  counter-reset: step;
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.steps-list li {
  counter-increment: step;
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: var(--soft);
}

.steps-list li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-size: 14px;
  font-weight: 850;
  box-shadow: 0 6px 14px rgba(224, 168, 46, 0.32);
}

.steps-list strong {
  display: block;
  grid-column: 2;
  align-self: center;
  color: var(--text);
  font-size: 15px;
  font-weight: 850;
}

.steps-list span {
  display: block;
  grid-column: 2;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.steps-list code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  color: #7a5a12;
  background: #fdf0cc;
  border-radius: 6px;
  padding: 1px 5px;
}

.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 #f0dca0;
  border-radius: 999px;
  padding: 3px 10px;
  background: #fdf3d6;
  color: var(--amber-deep);
  font-size: 13px;
  font-weight: 750;
}

.session-link:hover {
  border-color: #eccd7e;
  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;
}

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

textarea:focus {
  outline: 3px solid rgba(234, 179, 8, 0.18);
  border-color: var(--honey);
}

.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 #f0dca0;
  border-radius: 999px;
  padding: 6px 12px;
  background: #fdf3d6;
  box-shadow: 0 10px 24px rgba(224, 168, 46, 0.12);
  text-align: right;
}

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

.status-line {
  margin: 0;
  color: var(--amber-deep);
  font-weight: 650;
}

.status-line.ok {
  color: #4f8a3e;
}

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

button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  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(224, 168, 46, 0.32);
}

button.secondary {
  background: var(--surface);
  color: #6b5d3c;
  border-color: var(--line);
}

button.secondary:hover:not(:disabled) {
  border-color: #ecd48f;
  box-shadow: 0 12px 26px rgba(224, 168, 46, 0.16);
}

.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: 12px;
  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: 12px;
  padding: 18px;
  background: #fffdf4;
  color: #4a3f29;
  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 #f0dca0;
  border-radius: 12px;
  padding: 16px;
  background: #fdf3d6;
}

.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: var(--amber-deep);
  font-size: 13px;
  font-weight: 850;
}

.path-row code {
  min-width: 0;
  border: 1px solid #f0dca0;
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--surface);
  color: #4a3f29;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.api-service-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  margin-top: 18px;
  border: 1px solid #f0dca0;
  border-radius: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #fff8de 0%, #fdf0cc 100%);
  color: var(--amber-deep);
  font-size: 16px;
  font-weight: 850;
  text-align: center;
  box-shadow: 0 12px 26px rgba(224, 168, 46, 0.14);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.api-service-link:hover {
  border-color: #eccd7e;
  box-shadow: 0 16px 34px rgba(224, 168, 46, 0.2);
  text-decoration: none;
  transform: translateY(-1px);
}

.api-service-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 28px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0;
}

.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: #fdf0cc;
  color: var(--amber-deep);
}

.badge-ok {
  background: #e7f3d6;
  color: #4f8a3e;
}

.badge-error {
  background: #fbe3dc;
  color: #b5402f;
}

@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;
  }

  .steps-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%;
  }

}
