:root {
  color-scheme: light;
  --ink: #243244;
  --muted: #667085;
  --paper: #fffdf4;
  --shell: #fff7d6;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(36, 50, 68, 0.12);
  --shadow: 0 22px 58px rgba(36, 50, 68, 0.16);
  --accent: #2388ff;
  --accent-dark: #1268c4;
  --coral: #fb5151;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: #fff7d6;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

body {
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
  text-decoration: none;
}

.hero {
  position: relative;
  display: grid;
  align-content: space-between;
  min-height: 92svh;
  isolation: isolate;
  overflow: hidden;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) 72px max(18px, env(safe-area-inset-left));
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(255, 247, 214, 0.98) 0%, rgba(255, 247, 214, 0.9) 29%, rgba(255, 247, 214, 0.32) 58%, rgba(255, 247, 214, 0.1) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 247, 214, 0.78));
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 62% center;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1160px, 100%);
  margin: 0 auto;
}

.nav-brand,
.nav-actions {
  display: flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 14px 34px rgba(36, 50, 68, 0.12);
  backdrop-filter: blur(16px);
}

.nav-brand {
  gap: 10px;
  min-height: 54px;
  padding: 7px 14px 7px 7px;
  border-radius: 8px;
  font-weight: 900;
}

.nav-brand img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(36, 50, 68, 0.16);
}

.nav-actions {
  min-height: 48px;
  gap: 4px;
  padding: 4px;
  border-radius: 8px;
}

.nav-actions a {
  padding: 10px 16px;
  border-radius: 7px;
  color: var(--muted);
  font-weight: 800;
}

.nav-actions a:hover {
  background: #fff;
  color: var(--ink);
}

.hero-copy {
  width: min(620px, 100%);
  margin: clamp(76px, 13vh, 150px) auto 0;
  transform: translateX(calc((min(1160px, 100vw) - 100vw) / 2));
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent-dark);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 11em;
  margin: 0;
  color: #1f2b3b;
  font-size: clamp(3.1rem, 8.2vw, 6.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-subtitle {
  max-width: 35rem;
  margin: 24px 0 0;
  color: #4a5568;
  font-size: clamp(1.05rem, 2vw, 1.34rem);
  line-height: 1.62;
  font-weight: 650;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-cta,
.secondary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  border-radius: 8px;
  padding: 0 22px;
  border: 0;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(36, 50, 68, 0.18);
}

.primary-cta {
  background: linear-gradient(135deg, var(--ink), #0f1723);
  color: #fff;
}

.secondary-cta {
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.trust-row span {
  border: 1px solid rgba(36, 50, 68, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 9px 13px;
  color: #475467;
  font-size: 0.9rem;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.value-strip,
.pricing-band {
  width: min(1160px, calc(100% - 32px));
  margin: -34px auto 0;
  position: relative;
  z-index: 3;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.value-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  overflow: hidden;
}

.value-strip article {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.66);
}

.value-strip strong {
  font-size: 1.08rem;
}

.value-strip span,
.pricing-band p {
  color: var(--muted);
  line-height: 1.6;
}

.pricing-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 22px;
  padding: 26px;
}

.pricing-band h2 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.2rem);
  letter-spacing: 0;
}

.pricing-band p {
  max-width: 46rem;
  margin: 8px 0 0;
}

.pricing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
}

.compact {
  min-height: 54px;
  box-shadow: none;
}

.app-shell {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
  min-height: 100svh;
  margin-top: 26px;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 225, 86, 0.45), transparent 18rem),
    radial-gradient(circle at 88% 12%, rgba(96, 195, 255, 0.38), transparent 16rem),
    linear-gradient(135deg, #fff7d6 0%, #e8f7ff 48%, #fff2f2 100%);
}

.topbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
}

.brand,
.turn-card,
.actions,
.tool-panel,
.canvas-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  min-height: 66px;
  border-radius: 8px;
  padding: 9px 13px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid var(--line);
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

h2,
p {
  margin: 0;
}

.brand h2 {
  font-size: clamp(1.15rem, 2.1vw, 1.55rem);
  line-height: 1.1;
  letter-spacing: 0;
}

.brand p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.95rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.turn-card,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 66px;
  border-radius: 8px;
  padding: 8px;
}

.turn-card span {
  min-width: 4.5em;
  color: var(--ink);
  font-weight: 900;
  text-align: center;
}

.icon-button,
.tool-button,
.stamp-button {
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: #f5f8fc;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.icon-button {
  width: 48px;
  height: 48px;
}

.icon-button svg,
.tool-button svg,
.stamp-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stamp-button svg {
  fill: currentColor;
  stroke-width: 1.7;
}

.icon-button:hover,
.tool-button:hover,
.stamp-button:hover,
.primary-cta:hover,
.secondary-cta:hover {
  transform: translateY(-1px);
}

.icon-button:hover,
.tool-button:hover,
.stamp-button:hover {
  background: #eaf3ff;
}

.icon-button:focus-visible,
.tool-button:focus-visible,
.stamp-button:focus-visible,
.swatch:focus-visible,
.primary-cta:focus-visible,
.secondary-cta:focus-visible,
.nav-actions a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15, 114, 216, 0.36);
  outline-offset: 2px;
}

.danger {
  color: #c93d3d;
}

.workspace {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.tool-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  border-radius: 8px;
  padding: 12px 10px;
}

.tool-group {
  width: 100%;
}

.segmented,
.colors,
.stamps {
  display: grid;
  gap: 8px;
}

.tool-button,
.stamp-button {
  width: 56px;
  height: 50px;
  margin: 0 auto;
}

.tool-button.active,
.stamp-button.active {
  background: var(--ink);
  color: white;
  box-shadow: 0 9px 18px rgba(38, 51, 68, 0.22);
}

.colors {
  grid-template-columns: repeat(2, 1fr);
}

.swatch {
  width: 34px;
  height: 34px;
  margin: 0 auto;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.14), 0 3px 9px rgba(38, 51, 68, 0.16);
  cursor: pointer;
}

.swatch.active {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.sizes {
  display: grid;
  justify-items: center;
  gap: 8px;
}

#sizeSlider {
  width: 74px;
  accent-color: var(--accent);
  transform: rotate(-90deg);
  margin: 30px 0;
}

.size-preview {
  width: var(--preview-size, 16px);
  height: var(--preview-size, 16px);
  min-width: 8px;
  min-height: 8px;
  border-radius: 50%;
  background: var(--ink);
}

.canvas-card {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  padding: 10px;
}

.prompt-card {
  position: absolute;
  top: 22px;
  left: 22px;
  z-index: 2;
  display: grid;
  gap: 4px;
  width: min(360px, calc(100% - 44px));
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 16px 38px rgba(36, 50, 68, 0.14);
  backdrop-filter: blur(14px);
  padding: 13px 15px;
  pointer-events: none;
}

.prompt-card-label {
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.prompt-card strong {
  color: #1f2b3b;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.25;
  letter-spacing: 0;
}

.prompt-card small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 850;
}

.premium-status-card {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: center;
  gap: 10px;
  width: min(548px, calc(100% - 44px));
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 8px;
  background: rgba(31, 43, 59, 0.88);
  box-shadow: 0 20px 48px rgba(36, 50, 68, 0.2);
  backdrop-filter: blur(18px);
  padding: 10px;
  color: #ffffff;
}

.premium-status-card div {
  display: grid;
  gap: 3px;
  min-width: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 12px;
}

.premium-status-card span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.74rem;
  font-weight: 900;
}

.premium-status-card strong {
  overflow: hidden;
  color: #ffffff;
  font-size: 0.96rem;
  font-weight: 950;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.premium-status-card a {
  display: grid;
  place-items: center;
  min-height: 48px;
  border-radius: 7px;
  background: #ffe156;
  color: #1f2b3b;
  padding: 0 16px;
  font-size: 0.9rem;
  font-weight: 950;
  white-space: nowrap;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.premium-status-card a:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(255, 177, 47, 0.28);
}

.prompt-pop {
  animation: promptPop 520ms ease-out;
}

@keyframes promptPop {
  from {
    transform: translateY(-4px) scale(0.98);
    box-shadow: 0 0 0 rgba(35, 136, 255, 0);
  }

  42% {
    transform: translateY(0) scale(1.02);
    box-shadow: 0 18px 44px rgba(35, 136, 255, 0.2);
  }

  to {
    transform: translateY(0) scale(1);
    box-shadow: 0 16px 38px rgba(36, 50, 68, 0.14);
  }
}

#drawingCanvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 420px;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1px rgba(38, 51, 68, 0.08);
  cursor: crosshair;
  touch-action: none;
}

.confetti-layer {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--spark);
  animation: pop 780ms ease-out forwards;
}

@keyframes pop {
  from {
    opacity: 0.95;
    transform: translate(0, 0) scale(1);
  }

  to {
    opacity: 0;
    transform: translate(var(--dx), var(--dy)) scale(0.25);
  }
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 18px;
  padding: 28px 18px 34px;
  background: #fff7d6;
  color: #667085;
  font-size: 0.95rem;
  font-weight: 750;
}

.site-footer a:hover {
  color: var(--ink);
}

.simple-page {
  min-height: 100svh;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 225, 86, 0.45), transparent 20rem),
    radial-gradient(circle at 88% 12%, rgba(96, 195, 255, 0.38), transparent 18rem),
    linear-gradient(135deg, #fff7d6 0%, #e8f7ff 54%, #fff2f2 100%);
}

.simple-shell {
  width: min(920px, calc(100% - 32px));
  min-height: 100svh;
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 max(34px, env(safe-area-inset-bottom));
}

.simple-brand {
  width: max-content;
  margin-bottom: 30px;
}

.checkout-card,
.document-card {
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.checkout-card {
  display: grid;
  gap: 20px;
  max-width: 720px;
  padding: clamp(26px, 5vw, 48px);
}

.checkout-card h1,
.document-card h1 {
  margin: 0;
  color: #1f2b3b;
  font-size: clamp(2.25rem, 7vw, 4.7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.checkout-card p,
.document-card p {
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.72;
}

.feature-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.feature-list li {
  position: relative;
  padding-left: 28px;
  color: #344054;
  font-weight: 800;
}

.feature-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4ecb71;
  box-shadow: 0 0 0 4px rgba(78, 203, 113, 0.16);
}

.purchase-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.purchase-summary div {
  display: grid;
  gap: 6px;
  min-height: 132px;
  border: 1px solid rgba(36, 50, 68, 0.1);
  border-radius: 8px;
  background: rgba(255, 253, 244, 0.82);
  padding: 16px;
}

.purchase-summary strong {
  color: var(--accent-dark);
  font-size: 0.82rem;
  font-weight: 900;
}

.purchase-summary span {
  color: var(--ink);
  font-size: 1.14rem;
  font-weight: 900;
  line-height: 1.25;
}

.purchase-summary small {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.45;
}

.wide {
  width: 100%;
}

.fine-print {
  font-size: 0.88rem;
}

.fine-print code {
  border-radius: 6px;
  background: rgba(36, 50, 68, 0.08);
  padding: 2px 6px;
}

.subscription-terms {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(36, 50, 68, 0.1);
  border-radius: 8px;
  background: rgba(232, 247, 255, 0.58);
  padding: 16px;
}

.subscription-terms strong {
  color: var(--ink);
}

.subscription-terms p {
  margin: 0;
  font-size: 0.94rem;
}

.parent-gate {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(36, 50, 68, 0.42);
  backdrop-filter: blur(10px);
}

.parent-gate[hidden] {
  display: none;
}

.parent-gate-card {
  position: relative;
  display: grid;
  gap: 14px;
  width: min(430px, 100%);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 8px;
  background: #fffdf4;
  box-shadow: 0 26px 70px rgba(36, 50, 68, 0.28);
  padding: 26px;
}

.parent-gate-card h2 {
  margin: 0;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.parent-gate-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.parent-gate-card label {
  color: var(--ink);
  font-weight: 900;
}

.parent-gate-input {
  min-height: 48px;
  width: 100%;
  border: 1px solid rgba(36, 50, 68, 0.18);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 13px;
  font-weight: 850;
}

.parent-gate-error {
  min-height: 1.4em;
  color: #c13515 !important;
  font-size: 0.92rem;
  font-weight: 800;
}

.parent-gate-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(36, 50, 68, 0.08);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 900;
}

.document-shell {
  width: min(860px, calc(100% - 32px));
}

.document-card {
  padding: clamp(26px, 5vw, 46px);
}

.document-card h2 {
  margin: 30px 0 8px;
  font-size: 1.25rem;
}

@media (max-width: 920px) {
  .hero {
    min-height: 86svh;
  }

  .hero::after {
    background:
      linear-gradient(180deg, rgba(255, 247, 214, 0.98) 0%, rgba(255, 247, 214, 0.86) 52%, rgba(255, 247, 214, 0.28) 100%);
  }

  .hero-art {
    object-position: 68% bottom;
  }

  .hero-copy {
    margin-top: 56px;
    transform: none;
  }

  .hero h1 {
    max-width: 8.6em;
  }

  .value-strip {
    grid-template-columns: 1fr;
  }

  .pricing-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .pricing-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 820px) {
  .app-shell {
    gap: 10px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .actions {
    grid-column: 1 / -1;
    justify-content: space-between;
    min-height: 58px;
  }

  .turn-card {
    min-height: 58px;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(460px, 1fr);
  }

  .prompt-card {
    top: 16px;
    left: 16px;
    width: min(310px, calc(100% - 32px));
  }

  .premium-status-card {
    right: 16px;
    bottom: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(460px, calc(100% - 32px));
  }

  .premium-status-card a {
    grid-column: 1 / -1;
  }

  .tool-panel {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 8px;
  }

  .tool-group {
    width: auto;
  }

  .segmented,
  .stamps {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
  }

  .colors {
    grid-template-columns: repeat(8, max-content);
  }

  .tool-button,
  .stamp-button {
    width: 48px;
    height: 46px;
  }

  .sizes {
    grid-template-columns: 112px 42px;
    align-items: center;
  }

  #sizeSlider {
    width: 104px;
    transform: none;
    margin: 0;
  }
}

@media (max-width: 540px) {
  .hero {
    min-height: 88svh;
    padding-bottom: 44px;
  }

  .site-nav {
    align-items: stretch;
  }

  .nav-actions a {
    padding-inline: 11px;
  }

  .hero h1 {
    font-size: clamp(2.8rem, 14vw, 4.4rem);
  }

  .hero-subtitle {
    font-size: 1rem;
  }

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

  .purchase-summary {
    grid-template-columns: 1fr;
  }

  .brand {
    min-height: 58px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .brand p {
    max-width: 48vw;
    font-size: 0.85rem;
  }

  .icon-button {
    width: 44px;
    height: 44px;
  }

  .turn-card span {
    min-width: 3.5em;
  }

  .prompt-card {
    width: calc(100% - 32px);
  }

  .premium-status-card {
    grid-template-columns: 1fr;
  }

  .premium-status-card strong {
    white-space: normal;
  }
}
