* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  font-family: Inter, "Segoe UI", -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  --bg: #f7f9fc;
  --surface: #ffffff;
  --surface-soft: #f2f7fb;
  --text: #111827;
  --muted: #64748b;
  --line: #dbe5ef;
  --line-strong: #c5d4e4;
  --blue: #2563eb;
  --green: #059669;
  --cyan: #0891b2;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 16px 38px rgba(15, 23, 42, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 249, 252, 0.94)),
    repeating-linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0 1px, transparent 1px 64px),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 24px 28px 34px;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 850;
}

.brand:hover,
.nav-chip:hover {
  text-decoration: none;
}

.brand img {
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.14);
}

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

.nav-chip,
.help-menu summary {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  font-weight: 750;
}

.nav-chip.highlight {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.nav-chip.success {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #047857;
}

.help-menu {
  position: relative;
}

.help-menu summary {
  list-style: none;
}

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

.help-menu-list {
  position: absolute;
  right: 0;
  top: 40px;
  z-index: 20;
  display: grid;
  gap: 2px;
  min-width: 136px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.help-menu-list a {
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  white-space: nowrap;
}

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

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(310px, 0.85fr);
  gap: 34px;
  align-items: center;
  padding: 42px 4px 44px;
}

.eyebrow {
  width: fit-content;
  margin: 0 0 12px;
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  padding: 3px 10px;
  background: #ecfdf5;
  color: #047857;
  font-size: 13px;
  font-weight: 800;
}

.hero h1 {
  margin: 0 0 14px;
  font-size: 54px;
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0;
}

.hero h1 span {
  color: var(--cyan);
}

.subtitle {
  margin: 0;
  color: #334155;
  font-size: 21px;
}

.privacy {
  margin: 10px 0 0;
  color: var(--muted);
}

.feature-list {
  display: grid;
  gap: 14px;
  width: min(360px, 100%);
  margin-left: auto;
}

.feature-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 14px;
  font-weight: 900;
}

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

.feature-item strong {
  font-weight: 850;
}

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

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

.panel,
.promo-card,
.info-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.panel {
  padding: 30px 32px;
}

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

.panel-head h2,
.promo-card h2,
.info-block h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: 0;
}

.panel-head p,
.promo-card p,
.info-block p {
  margin: 8px 0 0;
  color: var(--muted);
}

.primary-link,
.primary-button,
.secondary-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 8px 14px;
  font-weight: 800;
  white-space: nowrap;
}

.primary-link,
.primary-button {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
}

.primary-link:hover {
  color: #fff;
  text-decoration: none;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: #1f2937;
}

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

.login-note {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fffbeb;
  color: #78350f;
}

.textarea-label {
  display: block;
  margin: 18px 0 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 850;
}

textarea {
  display: block;
  width: 100%;
  min-height: 230px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 14px;
  background: #fbfdff;
  color: #0f172a;
  line-height: 1.55;
  outline: none;
}

textarea:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

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

.button-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

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

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

.badge-idle {
  background: #eef2f7;
  color: #475569;
}

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

.badge-warn {
  background: #fef3c7;
  color: #92400e;
}

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

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

.status-line.ok {
  color: var(--green);
}

.status-line.warn {
  color: var(--amber);
}

.status-line.error {
  color: var(--red);
}

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

.detail-row {
  min-width: 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.detail-row span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-row strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 800;
}

.mono,
code,
pre {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.json-preview {
  min-height: 250px;
  max-height: 520px;
  overflow: auto;
  margin: 18px 0 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 16px;
  background: #0f172a;
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.warning {
  margin: 10px 0 0;
  color: #9a3412;
  font-size: 13px;
}

.placement {
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.placement h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

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

.path-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.path-list span {
  color: var(--muted);
  font-weight: 800;
}

.path-list code {
  overflow-wrap: anywhere;
  border-radius: 6px;
  padding: 6px 8px;
  background: #eef2f7;
  color: #0f172a;
  font-size: 13px;
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.promo-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
}

.promo-card span {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.promo-card h2 {
  margin-top: 8px;
  font-size: 20px;
}

.promo-card a {
  margin-top: 16px;
  font-weight: 850;
}

.info-block {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 26px;
  margin-top: 22px;
  padding: 28px 32px;
}

.footer {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 26px 0 0;
  color: var(--muted);
  font-size: 13px;
}

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

.modal[hidden] {
  display: none;
}

.modal-panel {
  width: min(560px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 26px 70px rgba(15, 23, 42, 0.26);
}

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

.modal-head h2 {
  margin: 0;
  font-size: 20px;
}

.icon-button {
  width: 34px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8fafc;
  color: #475569;
  font-size: 22px;
  line-height: 1;
}

.qr-area {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 26px;
  background: #f8fafc;
}

.qr-card {
  width: min(300px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  background: #fff;
  text-align: center;
}

.qr-mark {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 168px;
  height: 168px;
  margin: 0 auto 18px;
  border: 10px solid #0f172a;
  padding: 8px;
  background: #fff;
}

.qr-mark span {
  background: #0f172a;
}

.qr-mark span:nth-child(2),
.qr-mark span:nth-child(5),
.qr-mark span:nth-child(8),
.qr-mark span:nth-child(11),
.qr-mark span:nth-child(13) {
  background: #fff;
}

.qr-card p {
  margin: 0;
  color: var(--muted);
}

.qr-card strong {
  display: block;
  font-size: 24px;
}

@media (max-width: 900px) {
  .page-shell {
    padding: 18px 16px 28px;
  }

  .topbar,
  .panel-head,
  .input-footer,
  .result-head,
  .status-wrap {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .hero h1 {
    font-size: 40px;
  }

  .subtitle {
    font-size: 18px;
  }

  .feature-list {
    margin-left: 0;
  }

  .panel {
    padding: 22px 18px;
  }

  .details,
  .promo-grid,
  .info-block {
    grid-template-columns: 1fr;
  }

  .path-list div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 520px) {
  .brand span {
    display: none;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero h1 {
    font-size: 36px;
  }

  .primary-link,
  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .button-row {
    width: 100%;
  }

  .qr-area {
    min-height: 300px;
  }
}
