html,
body {
  min-height: 100%;
  overflow-y: auto;
}

body {
  margin: 0;
  background: #edf2f7;
  color: #102033;
  font-family: Inter, Roboto, "Segoe UI", Arial, sans-serif;
}

.jtd-html-app,
.jtd-html-app * {
  box-sizing: border-box;
}

.jtd-html-app {
  position: relative;
  min-height: 100vh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 8% 8%, rgba(0, 117, 255, 0.16), transparent 34%),
    radial-gradient(circle at 92% 18%, rgba(12, 191, 141, 0.12), transparent 30%),
    linear-gradient(135deg, #f8fbff 0%, #eef4f9 48%, #f9fbfc 100%);
  color: #102033;
}

.jtd-page-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(16, 32, 51, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 32, 51, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}

.jtd-workspace {
  position: relative;
  width: min(1180px, calc(100vw - 48px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 28px 0 54px;
}

.jtd-hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  gap: 22px;
  min-height: 216px;
  padding: 28px;
  overflow: hidden;
  border: 1px solid rgba(16, 32, 51, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.82)),
    linear-gradient(135deg, #005fbd, #00a881);
  box-shadow: 0 24px 80px rgba(20, 41, 77, 0.16);
}

.jtd-hero-panel::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -160px;
  width: 420px;
  height: 420px;
  border: 1px solid rgba(0, 95, 189, 0.16);
  transform: rotate(22deg);
}

.jtd-brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
}

.jtd-logo {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: #fff;
  background: #005fbd;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(0, 95, 189, 0.26);
}

.jtd-brand h1 {
  margin: 0;
  font-size: 31px;
  line-height: 1.05;
  letter-spacing: 0;
  color: #07192f;
}

.jtd-brand p {
  margin: 7px 0 0;
  color: #516174;
  font-size: 15px;
}

.jtd-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  align-items: flex-start;
}

.jtd-hero-actions a,
.jtd-hero-actions button,
.jtd-news {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid rgba(16, 32, 51, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: #135da8;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.jtd-hero-actions button {
  cursor: pointer;
  font-family: inherit;
}

#jtd-paypal-top {
  border-color: rgba(255, 210, 90, 0.70);
  background: #ffd25a;
  color: #211700;
}

.jtd-hero-copy {
  position: relative;
  z-index: 1;
  align-self: start;
  max-width: 650px;
  margin-top: 22px;
}

.jtd-hero-copy span {
  display: inline-flex;
  margin-bottom: 9px;
  color: #007f66;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.jtd-hero-copy h2 {
  margin: 0;
  max-width: 600px;
  color: #07192f;
  font-size: 38px;
  line-height: 1.06;
  line-height: 1.04;
  letter-spacing: 0;
}

.jtd-hero-copy p {
  margin: 14px 0 0;
  max-width: 620px;
  color: #45566c;
  font-size: 16px;
  line-height: 1.55;
}

.jtd-mini-stats {
  position: relative;
  z-index: 1;
  align-self: end;
  display: grid;
  gap: 10px;
}

.jtd-mini-stats div {
  padding: 10px 14px;
  border: 1px solid rgba(16, 32, 51, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.70);
}

.jtd-mini-stats b {
  display: block;
  color: #07192f;
  font-size: 20px;
}

.jtd-mini-stats span {
  display: block;
  margin-top: 2px;
  color: #617086;
  font-size: 13px;
}

.jtd-editor-card {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(16, 32, 51, 0.10);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(20, 41, 77, 0.13);
}

.jtd-editor-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 15px 18px;
  border-bottom: 1px solid rgba(16, 32, 51, 0.08);
  background: #fbfcfe;
}

.jtd-editor-top strong,
.jtd-card-title span {
  display: block;
  color: #13243a;
  font-size: 15px;
}

.jtd-editor-top span,
.jtd-card-title small {
  display: block;
  margin-top: 3px;
  color: #738094;
  font-size: 12px;
}

.jtd-editor-tools {
  display: flex;
  gap: 8px;
}

.jtd-editor-tools button,
.jtd-btn-muted,
.jtd-options-card label,
.jtd-donate-row button {
  border: 1px solid rgba(16, 32, 51, 0.10);
  border-radius: 8px;
  background: #fff;
  color: #203248;
  font: inherit;
}

.jtd-editor-tools button {
  height: 34px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
}

#jtd-json {
  display: block;
  width: 100%;
  min-height: 350px;
  resize: vertical;
  padding: 22px;
  border: 0;
  outline: 0;
  color: #172033;
  background: #ffffff;
  font-family: "Cascadia Mono", Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.62;
}

.jtd-command-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.jtd-command-row button {
  height: 44px;
  padding: 0 18px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.jtd-command-row button,
.jtd-donate-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.jtd-btn-primary {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #005fbd, #008c72);
  color: #fff;
  box-shadow: 0 14px 28px rgba(0, 95, 189, 0.26);
}

.jtd-btn-muted {
  box-shadow: 0 10px 22px rgba(20, 41, 77, 0.08);
}

.jtd-news {
  margin-left: auto;
  height: 44px;
  padding: 0 16px;
}

.jtd-lower-grid {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.jtd-options-card,
.jtd-partners-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid rgba(16, 32, 51, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 50px rgba(20, 41, 77, 0.10);
}

.jtd-options-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.jtd-options-card .jtd-card-title {
  grid-column: 1 / -1;
}

.jtd-options-card label {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  padding: 0 10px;
  color: #203248;
  font-size: 13px;
  cursor: pointer;
}

.jtd-options-card input {
  accent-color: #007f66;
}

.jtd-donate-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.jtd-donate-row button {
  height: 40px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 800;
}

#jtd-paypal {
  border: 0;
  background: #ffd25a;
  color: #211700;
}

#jtd-brl {
  border: 0;
  background: #ff9f1c;
  color: #241000;
}

.jtd-partners {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.jtd-partners a {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 8px;
  background: #f4f7fa;
  color: #213148;
  font-size: 18px;
  font-weight: 900;
  text-decoration: none;
}

.jtd-partners a:nth-child(2) {
  color: #0b8f49;
}

.jtd-partners a:nth-child(3) {
  color: #1d2d68;
}

.jtd-footer-html {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 4px 0;
  color: #7a8798;
  font-size: 12px;
}

.jtd-footer-html a {
  color: #7a8798;
  text-decoration: none;
}

.jtd-loading {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  background: rgba(248, 251, 255, 0.72);
  backdrop-filter: blur(8px);
}

.jtd-html-app.is-loading .jtd-loading {
  display: grid;
}

.jtd-loading span {
  width: 42px;
  height: 42px;
  border: 4px solid rgba(0, 95, 189, 0.18);
  border-top-color: #005fbd;
  border-radius: 50%;
  animation: jtd-spin 0.9s linear infinite;
}

.jtd-loading b {
  display: block;
  margin-top: 14px;
  color: #102033;
}

@keyframes jtd-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 920px) {
  .jtd-workspace {
    width: calc(100vw - 24px);
    padding-top: 14px;
  }

  .jtd-hero-panel,
  .jtd-lower-grid {
    grid-template-columns: 1fr;
  }

  .jtd-hero-copy h2 {
    font-size: 34px;
  }

  .jtd-command-row {
    flex-wrap: wrap;
  }

  .jtd-news {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 620px) {
  .jtd-hero-panel {
    padding: 20px;
  }

  .jtd-brand,
  .jtd-hero-actions,
  .jtd-editor-top,
  .jtd-footer-html {
    align-items: flex-start;
    flex-direction: column;
  }

  .jtd-hero-copy h2 {
    font-size: 29px;
  }

  #jtd-json {
    min-height: 300px;
    font-size: 13px;
  }

  .jtd-command-row button,
  .jtd-news {
    width: 100%;
  }

  .jtd-options-card {
    grid-template-columns: 1fr;
  }
}
