:root {
  --ink: #121417;
  --muted: #5b626d;
  --line: #d8dee8;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --mint: #7fdbca;
  --coral: #ff725e;
  --gold: #f7d267;
  --blue: #4d73ff;
  --shadow: 0 20px 70px rgba(18, 20, 23, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(127, 219, 202, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(77, 115, 255, 0.08) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 48px);
  background: rgba(251, 250, 247, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topnav a {
  color: var(--ink);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.92rem;
}

.topnav a:hover {
  background: #fff;
}

main {
  width: min(1440px, 100%);
  margin: 0 auto;
  padding: clamp(18px, 4vw, 48px);
}

.notice {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  box-shadow: 4px 4px 0 var(--ink);
}

.notice.success {
  background: #dff8ef;
}

.notice.warning {
  background: #fff0c5;
}

.order-success {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 260px);
  gap: 18px;
  align-items: center;
  margin: 0 0 18px;
  padding: clamp(16px, 3vw, 24px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.order-success img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background:
    linear-gradient(45deg, rgba(18, 20, 23, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(18, 20, 23, 0.04) 25%, transparent 25%),
    #fff;
  background-size: 22px 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hidden {
  display: none !important;
}

.shop-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(330px, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: stretch;
}

.builder-panel,
.preview-panel,
.order-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.builder-panel,
.order-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(18px, 2vw, 26px);
}

.preview-panel {
  display: flex;
  min-height: 660px;
  flex-direction: column;
  gap: 18px;
  padding: clamp(18px, 2vw, 26px);
  background:
    linear-gradient(135deg, rgba(255, 114, 94, 0.14), transparent 36%),
    linear-gradient(225deg, rgba(127, 219, 202, 0.24), transparent 44%),
    #fff;
}

.panel-heading {
  display: grid;
  gap: 8px;
}

.panel-heading.compact {
  gap: 6px;
}

.eyebrow {
  margin: 0;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 14ch;
  font-size: clamp(2rem, 2.7vw, 3.15rem);
  line-height: 1.02;
}

h2 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.08;
}

p {
  color: var(--muted);
  line-height: 1.55;
}

label,
.field-block {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid #bfc7d4;
  border-radius: 8px;
  outline: none;
}

input,
select {
  min-height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(77, 115, 255, 0.16);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sample-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-button,
.primary-button,
.icon-button {
  border: 1px solid var(--ink);
  border-radius: 8px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.chip-button {
  min-height: 38px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

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

.primary-button {
  min-height: 48px;
  padding: 0 16px;
  color: #fff;
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--coral);
  font-weight: 900;
}

.primary-button.wide {
  width: 100%;
}

.form-actions {
  display: grid;
  gap: 10px;
}

.status {
  min-height: 22px;
  color: var(--muted);
  font-size: 0.9rem;
}

.preview-header,
.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.source-pill {
  flex: 0 0 auto;
  padding: 7px 10px;
  background: var(--gold);
  border: 1px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
}

.sticker-stage {
  display: grid;
  min-height: 0;
  flex: 1;
  place-items: center;
  overflow: hidden;
  background:
    linear-gradient(45deg, rgba(18, 20, 23, 0.04) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(18, 20, 23, 0.04) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(18, 20, 23, 0.04) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(18, 20, 23, 0.04) 75%);
  background-color: #fff;
  background-position:
    0 0,
    0 14px,
    14px -14px,
    -14px 0;
  background-size: 28px 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sticker-stage img {
  display: block;
  width: min(88%, 560px);
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 20px 24px rgba(18, 20, 23, 0.18));
}

.prompt-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.prompt-card strong {
  font-size: 0.9rem;
}

.prompt-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  font-size: 0.9rem;
}

.pack-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.pack-list legend {
  margin-bottom: 8px;
  font-size: 0.92rem;
  font-weight: 900;
}

.pack-option {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.pack-option.active {
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--mint);
}

.pack-option input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--ink);
}

.pack-option span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pack-option strong,
.pack-option small {
  overflow-wrap: anywhere;
}

.pack-option small {
  color: var(--muted);
  font-weight: 700;
}

.pack-option b {
  font-size: 1.05rem;
}

.order-total {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  align-items: baseline;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.order-total strong {
  font-size: 1.9rem;
}

.order-total small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 28px 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer a,
.policy-panel a {
  color: var(--ink);
  font-weight: 800;
}

.policy-page {
  display: grid;
  min-height: calc(100vh - 92px);
  place-items: start center;
}

.policy-panel {
  display: grid;
  width: min(820px, 100%);
  gap: 18px;
  padding: clamp(22px, 4vw, 42px);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.policy-panel h1 {
  max-width: 100%;
}

.policy-panel h2 {
  margin-top: 8px;
  font-size: 1.25rem;
}

.setup-dialog {
  width: min(520px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  box-shadow: 10px 10px 0 var(--ink);
}

.setup-dialog::backdrop {
  background: rgba(18, 20, 23, 0.42);
}

.icon-button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

@media (max-width: 1180px) {
  .shop-shell {
    grid-template-columns: 1fr 1fr;
  }

  .order-panel {
    grid-column: 1 / -1;
  }

}

@media (max-width: 760px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    width: 100%;
    justify-content: space-between;
  }

  main {
    padding: 16px;
  }

  .shop-shell,
  .order-success,
  .field-grid {
    grid-template-columns: 1fr;
  }

  h1 {
    max-width: 100%;
    font-size: 2.45rem;
  }

  .preview-panel {
    min-height: 520px;
  }

  .sticker-stage {
    min-height: 340px;
  }
}

@media (max-width: 420px) {
  .topnav {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .brand {
    align-items: flex-start;
  }

  h1 {
    font-size: 2.1rem;
  }

  .builder-panel,
  .preview-panel,
  .order-panel {
    padding: 16px;
  }
}
