:root {
  color-scheme: light;
  --ink: #17213d;
  --ink-soft: #263252;
  --muted: #687087;
  --paper: #fffdf8;
  --canvas: #f5f1e8;
  --line: #dcd7cc;
  --blue: #335cff;
  --blue-dark: #2241c7;
  --blue-soft: #edf0ff;
  --coral: #ff6d4d;
  --coral-soft: #fff0ea;
  --green: #168263;
  --green-soft: #e8f6f1;
  --amber: #976010;
  --amber-soft: #fff3d9;
  --red: #bb3f38;
  --red-soft: #fff0ec;
  --shadow: 0 22px 70px rgba(23, 33, 61, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 8%, rgba(255, 109, 77, .10), transparent 25rem),
    radial-gradient(circle at 94% 25%, rgba(51, 92, 255, .10), transparent 28rem),
    var(--canvas);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .32;
  background-image: radial-gradient(rgba(23, 33, 61, .22) .7px, transparent .7px);
  background-size: 18px 18px;
  pointer-events: none;
}

button, input { font: inherit; }
button, a, label { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(51, 92, 255, .34);
  outline-offset: 3px;
}

.topbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 13px clamp(20px, 5vw, 72px);
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 248, .90);
  border-bottom: 1px solid rgba(220, 215, 204, .82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  width: 50px;
  height: 38px;
  display: block;
  position: relative;
  border-radius: 6px 11px 11px 6px;
  background: var(--blue);
  transform: rotate(-3deg);
  box-shadow: 4px 5px 0 var(--coral);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -10px;
  top: 9px;
  width: 20px;
  height: 20px;
  background: var(--blue);
  border-radius: 3px;
  transform: rotate(45deg);
}

.brand-hole {
  width: 7px;
  height: 7px;
  position: absolute;
  z-index: 1;
  right: -5px;
  top: 15px;
  border-radius: 50%;
  background: var(--paper);
}

.brand-line,
.brand-line::after {
  content: "";
  width: 21px;
  height: 3px;
  position: absolute;
  left: 10px;
  top: 13px;
  border-radius: 2px;
  background: #fff;
}

.brand-line::after { left: 0; top: 8px; width: 15px; }
.brand-name strong { display: block; font-size: .98rem; line-height: 1.02; letter-spacing: -.03em; }
.brand-name strong:last-child { color: var(--blue); }

.topbar-meta { display: flex; align-items: center; gap: 10px; }
.license-button {
  padding: 8px 12px;
  border: 1px solid var(--blue);
  border-radius: 999px;
  color: var(--blue);
  background: transparent;
  font-size: .78rem;
  font-weight: 900;
  cursor: pointer;
  transition: color .16s ease, background .16s ease;
}
.license-button:hover { color: #fff; background: var(--blue); }
.license-button.active { color: #0f684f; background: var(--green-soft); border-color: #85ccb5; }
.free-badge,
.privacy {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 800;
}

.free-badge { color: #9d3b27; background: var(--coral-soft); border: 1px solid #ffd1c4; }
.privacy { color: #0f684f; background: var(--green-soft); border: 1px solid #bfe5d8; }
.privacy > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px rgba(22, 130, 99, .12); }

.workspace { width: min(1180px, calc(100% - 36px)); margin: 0 auto; }

.hero {
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(350px, .92fr);
  align-items: center;
  gap: clamp(34px, 7vw, 90px);
  padding: clamp(64px, 9vw, 118px) 0 86px;
}

.intro { max-width: 680px; }
.eyebrow { margin: 0 0 13px; color: var(--blue); font-size: .73rem; font-weight: 900; letter-spacing: .15em; }
.eyebrow > span { width: 24px; height: 3px; display: inline-block; margin: 0 7px 2px 0; border-radius: 2px; background: var(--coral); }
.intro h1 { margin: 0; font-size: clamp(3.1rem, 6.6vw, 6.3rem); line-height: .88; letter-spacing: -.07em; }
.intro h1 em { color: var(--blue); font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.intro > p:not(.eyebrow) { max-width: 590px; margin: 28px 0 0; color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.18rem); }

.hero-points { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.hero-points span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 253, 248, .76); font-size: .83rem; font-weight: 800; }
.hero-points b { color: var(--coral); font-size: .72rem; }

.hero-visual { min-height: 460px; display: grid; place-items: center; position: relative; }
.hero-visual::before { content: ""; width: 360px; height: 360px; position: absolute; border-radius: 50%; background: var(--blue); opacity: .09; }
.hero-visual::after { content: ""; width: 76%; height: 54%; position: absolute; z-index: -1; border: 2px dashed rgba(51, 92, 255, .28); border-radius: 50%; transform: rotate(-12deg); }

.label-preview {
  width: min(330px, 78vw);
  min-height: 420px;
  padding: 28px;
  position: relative;
  z-index: 2;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 7px;
  box-shadow: 15px 17px 0 var(--ink), 27px 29px 0 var(--coral);
  transform: rotate(3deg);
}

.label-preview::before,
.label-preview::after { content: ""; position: absolute; left: -8px; right: -8px; height: 12px; background: radial-gradient(circle, var(--canvas) 4px, transparent 4.5px) 0 0 / 18px 12px repeat-x; }
.label-preview::before { top: -7px; }
.label-preview::after { bottom: -7px; }
.label-preview-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 15px; border-bottom: 3px solid var(--ink); }
.label-preview-head span { padding: 5px 8px; color: #fff; background: var(--ink); font-size: .7rem; font-weight: 900; letter-spacing: .16em; }
.label-preview-head strong { font-size: 1.1rem; letter-spacing: -.04em; }
.label-address { min-height: 120px; display: flex; flex-direction: column; justify-content: center; border-bottom: 1px solid var(--ink); }
.label-address small { color: var(--muted); font-size: .62rem; font-weight: 900; letter-spacing: .15em; }
.label-address strong { margin-top: 7px; font-size: 1.2rem; }
.label-address span { color: var(--muted); font-size: .78rem; }
.label-route { display: flex; align-items: center; gap: 9px; padding: 18px 0; font-size: .63rem; letter-spacing: .1em; }
.label-route i { flex: 1; height: 1px; position: relative; background: var(--ink); }
.label-route i::after { content: ""; position: absolute; right: 0; top: -3px; border-left: 5px solid var(--ink); border-block: 3.5px solid transparent; }
.label-barcode { height: 78px; background: repeating-linear-gradient(90deg, var(--ink) 0 2px, transparent 2px 5px, var(--ink) 5px 9px, transparent 9px 12px); }
.label-code { margin-top: 9px; text-align: center; font-family: ui-monospace, monospace; font-size: .68rem; font-weight: 800; letter-spacing: .08em; }
.visual-stamp { width: 100px; height: 100px; display: grid; place-items: center; position: absolute; right: 0; top: 30px; z-index: 3; border: 3px solid var(--coral); border-radius: 50%; color: var(--coral); background: var(--canvas); font-size: .7rem; font-weight: 900; line-height: 1.15; letter-spacing: .08em; text-align: center; transform: rotate(10deg); }

.tool-section {
  margin-bottom: 22px;
  padding: clamp(26px, 5vw, 48px);
  border-radius: 30px;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 28px 80px rgba(23, 33, 61, .18);
}

.tool-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.tool-heading .eyebrow { color: #aebeff; }
.tool-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1; letter-spacing: -.055em; }
.tool-heading > p { margin: 0; color: #b9c0d0; text-align: right; font-size: .92rem; }
.marketplace-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}
.marketplace-selector legend { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
.marketplace-option {
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 16px;
  color: #d7dbea;
  background: rgba(255, 255, 255, .06);
  cursor: pointer;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.marketplace-option:hover { transform: translateY(-2px); border-color: rgba(255, 255, 255, .4); }
.marketplace-option:has(input:checked) { color: var(--ink); background: #fff; border-color: #fff; }
.marketplace-option input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.marketplace-option > span:last-child { min-width: 0; }
.marketplace-option strong,
.marketplace-option small { display: block; }
.marketplace-option strong { font-size: .92rem; }
.marketplace-option small { margin-top: 2px; color: #aeb6ca; font-size: .72rem; }
.marketplace-option:has(input:checked) small { color: var(--muted); }
.marketplace-symbol { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 11px; color: #fff; font-size: .72rem; font-weight: 950; }
.shopee-option .marketplace-symbol { background: #ee4d2d; }
.mercado-livre-option .marketplace-symbol { color: #26304f; background: #ffe600; }
.upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.upload-grid.single { grid-template-columns: minmax(0, 1fr); }
.upload-grid.single .upload-card { max-width: 720px; width: 100%; justify-self: center; }

.upload-card { min-width: 0; padding: 22px; border: 1px solid rgba(255,255,255,.13); border-radius: 20px; background: var(--paper); color: var(--ink); }
.card-heading { min-height: 72px; display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 13px; }
.card-index { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--coral); font-size: .72rem; font-weight: 900; }
.card-heading h2 { margin: 0; font-size: 1.1rem; letter-spacing: -.025em; }
.card-heading p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.file-state { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: .67rem; font-weight: 900; }
.file-state.ready { color: #0f684f; background: var(--green-soft); border-color: #bfe5d8; }

.dropzone {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #c7c2b7;
  border-radius: 15px;
  background: #f9f6ef;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.dropzone:hover,
.dropzone.dragging { border-color: var(--blue); background: var(--blue-soft); transform: translateY(-3px); }
.dropzone input { position: absolute; inline-size: 1px; block-size: 1px; opacity: 0; }
.dropzone strong { margin-top: 12px; font-size: .95rem; }
.dropzone small { margin-top: 2px; color: var(--muted); font-size: .78rem; }
.upload-icon { width: 56px; height: 47px; display: grid; place-items: center; position: relative; border-radius: 6px 11px 11px 6px; color: #fff; background: var(--blue); transform: rotate(-3deg); }
.upload-icon::after { content: ""; width: 16px; height: 16px; position: absolute; right: -7px; border-radius: 3px; background: inherit; transform: rotate(45deg); }
.upload-icon b { position: relative; z-index: 1; font-size: .65rem; letter-spacing: .05em; }
.upload-icon.sheet { background: var(--green); transform: rotate(3deg); }
.file-summary { margin-top: 12px; padding: 11px 13px; overflow-wrap: anywhere; border-radius: 10px; color: #0f684f; background: var(--green-soft); font-size: .8rem; }
.file-summary strong { display: block; }

.result-panel,
.preview-panel { margin-top: 22px; padding: clamp(22px, 4vw, 38px); border: 1px solid var(--line); border-radius: 26px; background: var(--paper); box-shadow: var(--shadow); }
.result-header,
.preview-heading,
.actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.result-header h2,
.preview-heading h2 { margin: 0; font-size: clamp(1.7rem, 3vw, 2.2rem); letter-spacing: -.045em; }
.metrics { display: flex; gap: 8px; }
.metrics div { min-width: 90px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: #f8f5ee; text-align: center; }
.metrics strong, .metrics span { display: block; }
.metrics strong { color: var(--blue); font-size: 1.45rem; line-height: 1; }
.metrics span { margin-top: 5px; color: var(--muted); font-size: .7rem; }
.notice { margin-top: 24px; padding: 13px 15px; border-left: 4px solid var(--green); border-radius: 8px; color: #0f684f; background: var(--green-soft); font-size: .86rem; }
.notice.warning { color: #754806; background: var(--amber-soft); border-left-color: #d89220; }
.notice.error { color: var(--red); background: var(--red-soft); border-left-color: var(--red); }

.table-wrap { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); background: #f4f1e9; font-size: .71rem; letter-spacing: .07em; text-transform: uppercase; }
td { font-size: .86rem; }
tbody tr:last-child td { border-bottom: 0; }
.item-list { margin: 0; padding-left: 1.2rem; }
.item-list li + li { margin-top: 5px; }
.status-pill { display: inline-flex; padding: 4px 8px; border-radius: 999px; font-size: .7rem; font-weight: 900; }
.status-pill.ok { color: #0f684f; background: var(--green-soft); }
.status-pill.missing { color: var(--red); background: var(--red-soft); }
.actions { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--line); }
.format-note strong, .format-note span { display: block; }
.format-note span { margin-top: 3px; color: var(--muted); font-size: .83rem; }
.format-note .usage-note { color: var(--blue); font-weight: 900; }
.format-note .usage-note.exhausted { color: var(--red); }

.primary-button,
.download-button { padding: 13px 19px; border: 0; border-radius: 11px; color: #fff; background: var(--blue); box-shadow: 0 8px 18px rgba(51, 92, 255, .22); text-decoration: none; font-weight: 900; cursor: pointer; transition: transform .16s ease, background .16s ease; }
.primary-button:hover, .download-button:hover { background: var(--blue-dark); transform: translateY(-2px); }
.primary-button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.primary-button.generating:disabled { cursor: wait; }
.preview-heading { margin-bottom: 18px; }
#pdf-preview { width: 100%; height: min(76vh, 760px); border: 1px solid var(--line); border-radius: 14px; background: #efede7; }

.footer { min-height: 150px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; margin-top: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.footer-brand { color: var(--ink); font-size: 1rem; font-weight: 900; text-decoration: none; }
.footer p { margin: 0; text-align: center; }
.footer > span { text-align: right; }
.toast { max-width: min(390px, calc(100% - 44px)); position: fixed; right: 22px; bottom: 22px; z-index: 30; padding: 13px 16px; border-radius: 11px; color: #fff; background: var(--ink); box-shadow: var(--shadow); font-size: .86rem; }

.license-modal,
.limit-modal { margin: auto; border: 0; color: var(--ink); background: var(--paper); box-shadow: 0 30px 100px rgba(10, 17, 38, .38); text-align: center; }
.license-modal::backdrop,
.limit-modal::backdrop { background: rgba(14, 21, 42, .80); backdrop-filter: blur(6px); }

.license-modal {
  width: min(620px, calc(100% - 32px));
  padding: clamp(28px, 5vw, 48px);
  border-radius: 26px;
}
.modal-close { width: 38px; height: 38px; display: grid; place-items: center; position: absolute; right: 16px; top: 16px; border: 0; border-radius: 50%; color: var(--muted); background: #f0ede6; font-size: 1.55rem; line-height: 1; cursor: pointer; }
.modal-close:hover { color: var(--ink); background: #e4e0d7; }
.license-modal-icon { width: 82px; height: 82px; display: grid; place-items: center; margin: 0 auto 22px; border-radius: 50%; background: var(--blue-soft); }
.license-modal-icon span { width: 30px; height: 30px; position: relative; border: 7px solid var(--blue); border-radius: 50%; }
.license-modal-icon span::before { content: ""; width: 31px; height: 8px; position: absolute; left: 18px; top: 4px; border-radius: 0 5px 5px 0; background: var(--blue); }
.license-modal-icon span::after { content: ""; width: 7px; height: 13px; position: absolute; left: 37px; top: 4px; border-left: 6px solid var(--blue); border-right: 6px solid var(--blue); }
.license-modal .eyebrow { margin-bottom: 10px; }
.license-modal h2 { margin: 0; font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.05; letter-spacing: -.05em; }
.license-modal > p:not(.eyebrow) { max-width: 500px; margin: 17px auto 24px; color: var(--muted); font-size: .96rem; }
.license-form { display: grid; gap: 10px; text-align: left; }
.license-form label { font-size: .78rem; font-weight: 900; }
.license-form textarea { width: 100%; resize: vertical; min-height: 116px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: #f8f5ee; font: .78rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; }
.license-form textarea:focus { border-color: var(--blue); background: #fff; }
.license-form .primary-button { justify-self: stretch; margin-top: 4px; }
.license-error { margin: 0; padding: 9px 11px; border-radius: 8px; color: var(--red); background: var(--red-soft); font-size: .8rem; }
.license-active-panel { margin: 22px 0; padding: 18px; border: 1px solid #9fd8c5; border-radius: 14px; color: #0f684f; background: var(--green-soft); }
.license-active-panel > span { display: block; font-size: .67rem; font-weight: 900; letter-spacing: .13em; }
.license-active-panel > strong { display: block; margin-top: 5px; color: var(--ink); font-size: 1.25rem; }
.license-active-panel p { margin: 4px 0 0; font-size: .85rem; }
.text-button { padding: 10px 14px; border: 0; color: var(--blue); background: transparent; font-weight: 900; cursor: pointer; }
.text-button:hover { text-decoration: underline; }
.text-button.danger { margin-top: 12px; color: var(--red); font-size: .8rem; }
.modal-actions { display: flex; align-items: center; justify-content: center; gap: 8px; }

.limit-modal { width: min(610px, calc(100% - 32px)); margin: auto; padding: clamp(30px, 6vw, 54px); border: 0; border-radius: 26px; color: var(--ink); background: var(--paper); box-shadow: 0 30px 100px rgba(10, 17, 38, .38); text-align: center; }
.limit-modal-icon { width: 94px; height: 78px; display: grid; place-items: center; position: relative; margin: 0 auto 26px; border-radius: 7px 14px 14px 7px; color: #fff; background: var(--coral); font-size: 1.4rem; font-weight: 900; transform: rotate(-3deg); }
.limit-modal-icon::after { content: ""; width: 26px; height: 26px; position: absolute; right: -10px; border-radius: 4px; background: var(--coral); transform: rotate(45deg); }
.limit-modal .eyebrow { margin-bottom: 12px; color: var(--coral); }
.limit-modal h2 { margin: 0; font-size: clamp(1.9rem, 5vw, 2.8rem); line-height: 1.02; letter-spacing: -.05em; }
.limit-modal p:not(.eyebrow) { max-width: 480px; margin: 20px auto 28px; color: var(--muted); font-size: 1.04rem; }
.limit-modal p strong { color: var(--ink); }
.limit-modal .primary-button { min-width: 180px; }

@media (max-width: 940px) {
  .hero { grid-template-columns: 1fr; padding-top: 74px; text-align: center; }
  .intro { max-width: 760px; margin: 0 auto; }
  .intro > p:not(.eyebrow) { margin-inline: auto; }
  .hero-points { justify-content: center; }
  .hero-visual { min-height: 500px; }
  .visual-stamp { right: calc(50% - 225px); }
}

@media (max-width: 760px) {
  .topbar { position: static; padding-inline: 18px; }
  .topbar-meta { display: flex; }
  .topbar-meta .free-badge,
  .topbar-meta .privacy { display: none; }
  .workspace { width: min(100% - 24px, 1180px); }
  .hero { min-height: auto; gap: 28px; padding: 54px 0 64px; }
  .intro h1 { font-size: clamp(2.8rem, 14vw, 4.7rem); }
  .hero-visual { min-height: 440px; }
  .visual-stamp { width: 86px; height: 86px; right: 2px; top: 12px; font-size: .62rem; }
  .label-preview { min-height: 390px; padding: 24px; box-shadow: 10px 12px 0 var(--ink), 18px 20px 0 var(--coral); }
  .tool-section { padding: 24px 16px; border-radius: 22px; }
  .tool-heading { align-items: start; flex-direction: column; }
  .tool-heading > p { text-align: left; }
  .marketplace-selector { grid-template-columns: 1fr; }
  .upload-grid { grid-template-columns: 1fr; }
  .card-heading { grid-template-columns: auto 1fr; }
  .file-state { grid-column: 2; justify-self: start; }
  .result-header, .preview-heading, .actions { align-items: stretch; flex-direction: column; }
  .metrics { width: 100%; }
  .metrics div { flex: 1; min-width: 0; padding-inline: 8px; }
  .primary-button, .download-button { width: 100%; text-align: center; }
  .footer { grid-template-columns: 1fr; gap: 8px; padding: 34px 0; text-align: center; }
  .footer p, .footer > span { text-align: center; }
  .limit-modal .primary-button { width: 100%; }
  .modal-actions { align-items: stretch; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
