:root {
  --ink: #1d1a1c;
  --muted: #817b7c;
  --paper: #f7f5f2;
  --panel: #fffefd;
  --line: #e5e1dc;
  --accent: #a13b58;
  --accent-deep: #69233a;
  --plum: #301d2a;
  --stage: #e9e4df;
  --serif: "Playfair Display", Georgia, serif;
  --sans: "DM Sans", Arial, sans-serif;
  --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-family: var(--sans); }
button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto; padding: 28px 0 48px; }
.topbar { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 700; letter-spacing: -.025em; }
.brand-mark { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; background: var(--plum); color: #fff; font: 500 10px/1 var(--serif); letter-spacing: .08em; }
.topbar-detail { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .79rem; }
.status-dot { display: block; width: 7px; height: 7px; background: #69a47e; border-radius: 50%; box-shadow: 0 0 0 3px #e6f1e8; }

.intro { display: flex; justify-content: space-between; align-items: end; gap: 32px; padding: 52px 0 35px; }
.eyebrow, .section-kicker { color: var(--accent); font: 500 .66rem/1.2 var(--mono); letter-spacing: .12em; margin: 0 0 11px; }
.intro h1 { font: 500 clamp(2.1rem, 4.25vw, 4rem)/1.02 var(--serif); letter-spacing: -.052em; margin: 0; max-width: 650px; }
.intro-copy { color: #686264; font-size: .98rem; line-height: 1.58; max-width: 315px; margin: 0 0 3px; }

.workspace { display: grid; grid-template-columns: minmax(340px, .79fr) minmax(480px, 1.21fr); min-height: 650px; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--panel); box-shadow: 0 15px 55px rgba(43, 31, 35, .055); }
.control-panel { display: flex; flex-direction: column; border-right: 1px solid var(--line); background: #fffefd; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; margin: 24px 24px 7px; padding: 4px; background: #f1eeea; border-radius: 8px; }
.mode-button { border: 0; border-radius: 5px; padding: 10px 8px; background: transparent; color: #777071; font-size: .81rem; font-weight: 600; transition: .2s ease; }
.mode-button.is-active { background: #fff; color: var(--ink); box-shadow: 0 2px 7px rgba(29, 26, 28, .08); }
.control-view { flex: 1; }
.control-view.hidden { display: none; }
.hidden { display: none !important; }
.panel-section { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.section-heading.compact { align-items: center; }
.section-heading h2, .preview-header h2, .bulk-intro h2 { margin: 0; font-size: 1rem; letter-spacing: -.025em; }
.section-heading .section-kicker { margin-bottom: 7px; }
.catalog-count { margin-top: 3px; color: #8e8789; font: .65rem var(--mono); white-space: nowrap; }
.search-field { display: flex; align-items: center; gap: 9px; margin-top: 18px; padding: 0 12px; border: 1px solid #ddd8d3; border-radius: 7px; background: #fff; transition: .2s ease; }
.search-field:focus-within { border-color: #b87789; box-shadow: 0 0 0 3px rgba(161, 59, 88, .10); }
.search-field svg { width: 17px; height: 17px; fill: none; stroke: #867e80; stroke-width: 1.7; }
.search-field input { width: 100%; height: 42px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: .88rem; }
.search-field input::placeholder, textarea::placeholder { color: #aaa3a4; }
.search-results { min-height: 40px; max-height: 355px; margin-top: 9px; padding-right: 5px; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #c9bfc0 transparent; scrollbar-width: thin; }
.search-results::-webkit-scrollbar { width: 7px; }
.search-results::-webkit-scrollbar-thumb { border-radius: 10px; background: #c9bfc0; }
.result-row { display: grid; grid-template-columns: 1fr auto; align-items: center; width: 100%; padding: 10px 9px; border: 1px solid transparent; border-radius: 6px; color: var(--ink); text-align: left; background: transparent; transition: .16s ease; }
.result-row:hover, .result-row.is-selected { background: #f8f3f4; border-color: #f0dee3; }
.result-name { display: block; font-size: .84rem; font-weight: 600; }
.result-reference { display: block; margin-top: 3px; color: #8d8587; font-size: .62rem; font-weight: 400; line-height: 1.2; }
.result-size { color: #827b7d; font: .66rem var(--mono); }
.bulk-result-row { cursor: default; grid-template-columns: minmax(0, 1fr) auto; }
.bulk-result-row.is-queued { border-color: #e9c9d1; background: #fff8fa; }
.quantity-control { display: inline-grid; grid-template-columns: 28px minmax(28px, auto) 28px; align-items: center; overflow: hidden; border: 1px solid #ded7d3; border-radius: 6px; background: #fff; }
.quantity-control button { display: grid; place-items: center; width: 28px; height: 28px; border: 0; color: var(--accent-deep); background: transparent; font-size: 1rem; line-height: 1; }
.quantity-control button:hover { background: #f8eef1; }
.quantity-control output { min-width: 28px; color: #4f484a; font: .68rem var(--mono); text-align: center; }
.catalog-hint { margin: 8px 2px 0; color: #948c8d; font-size: .66rem; }
.no-result { padding: 9px 3px 2px; color: var(--muted); font-size: .78rem; line-height: 1.45; }
.create-label { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; border: 0; padding: 7px 0; color: var(--accent-deep); background: transparent; font-size: .75rem; font-weight: 700; }
.create-label svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
.text-button { border: 0; padding: 6px 0; color: #8c8586; background: none; font-size: .72rem; text-decoration: underline; text-underline-offset: 3px; }
.detail-actions { display: flex; align-items: center; gap: 14px; }
.detail-actions #saveToCatalogButton { color: var(--accent-deep); font-weight: 700; }
.field-label { display: block; margin: 17px 0 8px; color: #5d5758; font-size: .73rem; font-weight: 600; }
.text-field, textarea { width: 100%; border: 1px solid #ddd8d3; border-radius: 7px; color: var(--ink); outline: 0; background: #fff; transition: .2s ease; }
.text-field { height: 43px; padding: 0 12px; font-size: .9rem; }
textarea { display: block; padding: 11px 12px; resize: vertical; min-height: 142px; font-size: .85rem; line-height: 1.55; }
.text-field:focus, textarea:focus { border-color: #b87789; box-shadow: 0 0 0 3px rgba(161, 59, 88, .10); }
.field-note { color: #948c8d; margin: 8px 0 0; font-size: .69rem; }
.more-options { margin-top: 18px; border-top: 1px solid #eee8e2; }
.more-options summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0 2px; color: var(--accent-deep); cursor: pointer; font-size: .75rem; font-weight: 700; list-style: none; }
.more-options summary::-webkit-details-marker { display: none; }
.more-options summary::after { order: -1; width: 7px; height: 7px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; content: ""; transform: rotate(45deg) translateY(-2px); transition: transform .18s ease; }
.more-options[open] summary::after { transform: rotate(225deg) translate(-1px, -1px); }
.more-options summary small { margin-left: auto; color: #948c8d; font-size: .63rem; font-weight: 400; }
.more-options-grid { padding: 6px 0 3px; }
.more-options-grid .field-label { margin-top: 13px; }
.text-adjustments { margin-top: 18px; padding-top: 13px; border-top: 1px solid #eee8e2; }
.adjustments-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: #5d5758; font-size: .73rem; }
.adjustments-heading small { color: #948c8d; font-size: .63rem; font-weight: 400; text-align: right; }
#textAdjustmentRows { display: grid; gap: 6px; margin-top: 10px; }
.adjustment-row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(4, 25px); align-items: center; gap: 3px; }
.adjustment-row span { overflow: hidden; color: #6b6465; font-size: .67rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.adjustment-row button { display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid #e1dbd7; border-radius: 5px; color: var(--accent-deep); background: #fff; font-size: .78rem; line-height: 1; }
.adjustment-row button:hover { border-color: #d8a8b5; background: #fff8fa; }
.reset-adjustments { margin-top: 9px; }
.template-section { padding-bottom: 25px; }
.size-options { display: grid; gap: 12px; margin-top: 17px; }
.size-option { display: grid; grid-template-columns: minmax(0, 1fr) auto 15px; column-gap: 12px; align-items: center; padding: 10px 11px; border: 1px solid #e2ddd8; border-radius: 7px; background: #fff; transition: .18s ease; cursor: pointer; }
.size-option:has(input:focus-visible) { outline: 3px solid rgba(161, 59, 88, .2); outline-offset: 2px; }
.size-option.is-selected { border-color: #d8a8b5; background: #fffbfc; }
.size-option input { position: absolute; opacity: 0; pointer-events: none; }
.size-option span { display: contents; }
.size-option strong { font-size: .79rem; }
.size-option small { color: #8e8789; font: .65rem var(--mono); white-space: nowrap; }
.size-option i { display: block; width: 15px; height: 15px; border: 1px solid #b8afb0; border-radius: 50%; }
.size-option.is-selected i { border: 4px solid var(--accent); }
.bulk-intro { padding-top: 28px; }
.bulk-intro h2 { font: 500 1.5rem/1.05 var(--serif); letter-spacing: -.035em; }
.bulk-intro > p:last-child { color: #777071; max-width: 310px; margin: 10px 0 0; font-size: .81rem; line-height: 1.5; }
.queue-section { padding-bottom: 20px; }
.queue-list { display: grid; gap: 7px; margin-top: 16px; }
.queue-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid #ece5e0; border-radius: 6px; background: #fff; }
.queue-item span { display: grid; gap: 2px; min-width: 0; }
.queue-item strong { overflow: hidden; font-size: .76rem; text-overflow: ellipsis; white-space: nowrap; }
.queue-item small { color: #8d8587; font: .62rem var(--mono); }
.queue-remove { border: 0; padding: 4px; color: #a13b58; background: transparent; font-size: .66rem; text-decoration: underline; text-underline-offset: 3px; }
.queue-empty { margin: 0; padding: 7px 0; color: #948c8d; font-size: .71rem; }
.export-area { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: auto; padding: 19px 24px; background: #f7f4f1; }
.export-info { display: grid; gap: 2px; }
.export-info span { font: 500 .66rem var(--mono); }
.export-info small { color: #8a8385; font-size: .66rem; }
.download-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 43px; padding: 0 15px; border: 0; border-radius: 7px; background: var(--plum); color: #fff; font-size: .78rem; font-weight: 700; letter-spacing: .005em; transition: .2s ease; box-shadow: 0 3px 8px rgba(48, 29, 42, .16); }
.download-button:hover { background: #502e43; transform: translateY(-1px); }
.download-button:active { transform: translateY(0); }
.download-button:disabled { cursor: not-allowed; opacity: .48; transform: none; }
.download-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bulk-download-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bulk-download-actions .download-button { padding: 0 12px; white-space: nowrap; }

.preview-area { display: flex; flex-direction: column; min-width: 0; background: #fbfaf8; }
.preview-header { display: flex; align-items: center; justify-content: space-between; padding: 29px 35px 21px; }
.preview-header .section-kicker { margin-bottom: 7px; }
.precision-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e5dfd9; border-radius: 100px; padding: 6px 9px; color: #777071; background: #fffefd; font: .63rem var(--mono); }
.precision-chip span { width: 6px; height: 6px; border-radius: 50%; background: #a13b58; }
.preview-stage { position: relative; display: grid; flex: 1; place-items: center; min-height: 530px; margin: 0 24px; overflow: hidden; border-radius: 13px; background-color: var(--stage); background-image: linear-gradient(45deg, rgba(255,255,255,.28) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.28) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.28) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.28) 75%); background-size: 34px 34px; background-position: 0 0, 0 17px, 17px -17px, -17px 0; }
.label-card { position: relative; width: min(65%, 405px); aspect-ratio: 65 / 50; overflow: hidden; background: #fff; box-shadow: 0 23px 30px rgba(68, 55, 45, .21), 0 3px 6px rgba(68, 55, 45, .13); transition: aspect-ratio .25s ease, width .25s ease; container-type: inline-size; }
.label-card.size-100 { width: min(71%, 435px); aspect-ratio: 70 / 60; }
.template-artwork { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; }
.template-field { position: absolute; z-index: 1; display: none; place-items: center; overflow: hidden; background: #fff; color: #0a0a0a; font-family: Arial, Helvetica, sans-serif; line-height: 1; text-align: center; pointer-events: none; }
.template-field.is-replaced { display: grid; }
.template-field { overflow: visible; }
.template-field span { display: block; max-width: 100%; overflow: hidden; transform: rotate(180deg) translateY(var(--field-offset-y, 0px)) scale(var(--field-font-scale, 1)); white-space: nowrap; }
.field-title { top: 79%; left: 33.3%; width: 66.6%; height: 12%; font-size: 8.1cqw; font-weight: 700; letter-spacing: -.02em; }
.field-title.is-long { font-size: 6.3cqw; }.field-title.is-extra-long { font-size: 4.9cqw; }
.field-inspired { top: 70%; left: 33.3%; width: 66.6%; height: 7.5%; font-size: 3.4cqw; font-weight: 400; letter-spacing: .01em; }
.field-product { top: 51%; left: 33.3%; width: 66.6%; height: 10%; font-size: 4.9cqw; font-weight: 700; letter-spacing: -.015em; }
.field-notes { top: 36%; left: 33.3%; width: 66.6%; height: 10%; font-size: 3.4cqw; font-weight: 400; letter-spacing: .01em; }
.field-compliance { top: 22.3%; left: 33.3%; width: 66.6%; height: 5.7%; font-size: 3.2cqw; font-weight: 700; letter-spacing: -.01em; }
.field-crafted { top: 16.7%; left: 33.3%; width: 66.6%; height: 5.7%; font-size: 3.2cqw; font-weight: 700; letter-spacing: -.01em; }
.field-footer { top: .5%; left: 33.3%; width: 66.6%; height: 6%; font-size: 3.1cqw; font-weight: 400; letter-spacing: .005em; }
.measurement { position: absolute; color: #918a85; font: .6rem var(--mono); letter-spacing: .03em; }
.top-measurement { display: flex; align-items: center; justify-content: center; top: calc(50% - min(65%, 405px) * .385 - 26px); width: min(65%, 405px); border-top: 1px solid #aaa39d; }
.top-measurement::before, .top-measurement::after { position: absolute; top: -4px; width: 1px; height: 7px; content: ""; background: #aaa39d; }
.top-measurement::before { left: 0; }.top-measurement::after { right: 0; }.top-measurement span { transform: translateY(-18px); }
.side-measurement { display: flex; align-items: center; justify-content: center; left: calc(50% - min(65%, 405px) * .325 - 31px); height: calc(min(65%, 405px) * .77); border-left: 1px solid #aaa39d; }
.side-measurement::before, .side-measurement::after { position: absolute; left: -4px; width: 7px; height: 1px; content: ""; background: #aaa39d; }
.side-measurement::before { top: 0; }.side-measurement::after { bottom: 0; }.side-measurement span { transform: rotate(-90deg) translateX(50%); }
.stage-caption { position: absolute; bottom: 17px; margin: 0; color: #837c77; font-size: .66rem; }
.preview-notes { display: flex; gap: 20px; flex-wrap: wrap; padding: 16px 35px 24px; color: #777071; font-size: .68rem; }
.preview-notes span { display: inline-flex; align-items: center; gap: 7px; }.preview-notes i { width: 5px; height: 5px; border-radius: 50%; background: #bd6e83; }
.toast { position: fixed; z-index: 5; bottom: 22px; left: 50%; padding: 11px 15px; border-radius: 8px; color: #fff; background: var(--plum); font-size: .8rem; box-shadow: 0 8px 25px rgba(30, 17, 26, .25); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: .22s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .workspace { grid-template-columns: 1fr; }.control-panel { border-right: 0; border-bottom: 1px solid var(--line); }.preview-stage { min-height: 490px; }.export-area { margin-top: 0; }
}
@media (max-width: 620px) {
  .app-shell { width: min(100% - 24px, 1440px); padding-top: 16px; }.topbar { padding-bottom: 16px; }.topbar-detail { display: none; }.intro { display: block; padding: 35px 0 25px; }.intro h1 { font-size: 2.3rem; }.intro-copy { margin-top: 17px; }.workspace { border-radius: 12px; }.panel-section, .export-area { padding-left: 17px; padding-right: 17px; }.mode-switch { margin-left: 17px; margin-right: 17px; }.preview-header { padding: 22px 17px 18px; }.preview-stage { min-height: 395px; margin: 0 13px; }.label-card { width: 73%; }.label-card.size-100 { width: 79%; }.measurement { display: none; }.preview-notes { padding: 14px 17px 19px; gap: 12px; }.stage-caption { font-size: .58rem; }.export-area { align-items: stretch; flex-direction: column; }.download-button { width: 100%; }.bulk-download-actions { grid-template-columns: 1fr; }.label-footer { letter-spacing: .015em; }
}
