:root {
  --bg: #f1f3ef;
  --paper: #fffefb;
  --paper-soft: #f8f9f5;
  --ink: #17201d;
  --ink-soft: #5c6863;
  --line: #d9ded9;
  --line-strong: #b6bfba;
  --jade: #087f68;
  --jade-dark: #056854;
  --jade-soft: #dff2ec;
  --ticket: #f2cc4d;
  --ticket-soft: #fff5c7;
  --red: #bd3f32;
  --shadow: 0 10px 30px rgba(23, 32, 29, 0.08);
  --radius: 6px;
  --sidebar: 88px;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; min-width: 320px; background: var(--bg); color: var(--ink); font-family: "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1.5; letter-spacing: 0; }
button, input, textarea { font: inherit; letter-spacing: 0; }
button { color: inherit; }
button, label.file-button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid rgba(8, 127, 104, .28); outline-offset: 2px; }
::selection { background: var(--ticket); color: var(--ink); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #adb8b2; border: 3px solid var(--bg); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

.auth-screen { min-height: 100vh; padding: 28px 16px; display: grid; place-items: center; background: var(--bg); }
.auth-screen[hidden] { display: none; }
.auth-panel { width: min(430px, 100%); overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.auth-brand { min-height: 82px; padding: 16px 20px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); background: var(--ink); color: #fff; }
.auth-brand .brand-mark { flex: 0 0 auto; }
.auth-brand strong, .auth-brand small { display: block; }
.auth-brand strong { font-size: 16px; }
.auth-brand small { color: var(--line-strong); font-size: 12px; }
.auth-heading { padding: 24px 20px 14px; }
.auth-heading h1 { font-size: 20px; }
.auth-heading p { margin: 6px 0 0; color: var(--ink-soft); }
.auth-mode { margin: 0 20px 18px; display: grid; grid-template-columns: repeat(2, 1fr); border-bottom: 1px solid var(--line); }
.auth-mode button { min-height: 42px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--ink-soft); }
.auth-mode button.is-active { border-color: var(--jade); color: var(--ink); font-weight: 700; }
.auth-form { padding: 0 20px 22px; display: grid; gap: 14px; }
.password-field { position: relative; display: block; }
.password-field input { padding-right: 48px; }
.password-toggle { position: absolute; right: 2px; top: 2px; width: 38px; height: 37px; display: grid; place-items: center; border: 0; background: transparent; color: var(--ink-soft); }
.password-toggle:hover { color: var(--ink); }
.password-toggle svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-hint { margin: -2px 0 0; color: var(--ink-soft); font-size: 12px; }
.auth-error { margin: -4px 0; }
.auth-submit { margin-top: 2px; }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--sidebar); padding: 18px 10px; display: flex; flex-direction: column; align-items: center; background: #17201d; color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.brand-mark { width: 42px; height: 42px; display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 3px; padding: 8px; background: var(--ticket); border-radius: 5px; }
.brand-mark span { display: block; background: var(--ink); }
.brand-mark span:nth-child(1) { height: 12px; }.brand-mark span:nth-child(2) { height: 24px; }.brand-mark span:nth-child(3) { height: 17px; }
.brand-copy { display: none; }
.nav-list { width: 100%; margin-top: 34px; display: grid; gap: 8px; }
.nav-item { min-height: 58px; width: 100%; border: 0; border-radius: 5px; display: grid; place-items: center; gap: 3px; color: #aeb8b3; background: transparent; transition: background .18s ease, color .18s ease; }
.nav-item { touch-action: manipulation; -webkit-tap-highlight-color: rgba(242,204,77,.28); }
.nav-item:hover { background: #26322e; color: #fff; }
.nav-item.is-active { background: #fff; color: var(--ink); }
.nav-item svg, .button svg, .icon-button svg, .dashed-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item span { font-size: 11px; }
.sidebar-foot { margin-top: auto; width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 12px 6px; color: #aeb8b3; }
.sidebar-foot > span:last-child { display: none; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #54d8a7; box-shadow: 0 0 0 4px rgba(84,216,167,.14); }

.main-area { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { height: 74px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; background: rgba(241, 243, 239, .94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 15; backdrop-filter: blur(10px); }
.crumb { margin: 0 0 2px; color: var(--ink-soft); font-size: 11px; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 20px; line-height: 1.2; }
h2 { margin-bottom: 4px; font-size: 16px; line-height: 1.3; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.account-name { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 5px 8px; background: var(--ticket-soft); font-size: 12px; font-weight: 700; }
.save-state { color: var(--ink-soft); display: flex; align-items: center; gap: 7px; font-size: 12px; }
.save-state span { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); }

.button { min-height: 40px; padding: 0 14px; border: 1px solid transparent; border-radius: 5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 650; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--jade); color: white; box-shadow: 0 5px 16px rgba(8,127,104,.2); }
.button-primary:hover { background: var(--jade-dark); }
.button-primary:disabled { background: #91aaa2; box-shadow: none; cursor: wait; transform: none; }
.button-secondary { background: var(--ticket); color: var(--ink); border-color: #d8b438; }
.button-secondary:hover { background: #f6d663; }
.button-quiet { background: var(--paper); border-color: var(--line-strong); }
.button-quiet:hover { border-color: var(--ink); }
.full { width: 100%; }
.icon-button { width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); display: grid; place-items: center; transition: border-color .18s ease, background .18s ease; }
.icon-button:hover { border-color: var(--ink); background: #fff; }
.icon-button.small { width: 34px; height: 34px; }

.view { display: none; padding: 16px 20px 30px; }
.view.is-active { display: block; animation: reveal .22s cubic-bezier(.22,1,.36,1); }
@keyframes reveal { from { opacity: .4; clip-path: inset(0 0 8% 0); } to { opacity: 1; clip-path: inset(0); } }
.workflow-strip { min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--ink-soft); }
.workflow-step { display: flex; align-items: center; gap: 7px; white-space: nowrap; font-size: 12px; }
.workflow-step b { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 11px; }
.workflow-step.is-done { color: var(--jade); }.workflow-step.is-done b { background: var(--jade); border-color: var(--jade); color: #fff; }
.workflow-step.is-current { color: var(--ink); font-weight: 700; }.workflow-step.is-current b { border-color: var(--ink); }
.workflow-line { width: 42px; height: 1px; background: var(--line-strong); }

.workbench-grid { display: grid; grid-template-columns: 220px minmax(420px, 1fr) 300px; gap: 14px; align-items: start; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 2px 0 rgba(23,32,29,.02); }
.panel-heading { min-height: 66px; padding: 15px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-heading.compact { min-height: 62px; }
.panel-heading p { margin-bottom: 0; color: var(--ink-soft); font-size: 12px; }
.panel-heading h2 { margin-bottom: 1px; }
.queue-panel { overflow: hidden; }
.queue-filter { display: grid; grid-template-columns: repeat(3, 1fr); padding: 10px 12px 0; border-bottom: 1px solid var(--line); }
.queue-filter button { border: 0; border-bottom: 2px solid transparent; padding: 8px 0; background: transparent; color: var(--ink-soft); font-size: 12px; }
.queue-filter button.is-active { color: var(--ink); border-color: var(--jade); font-weight: 700; }
.queue-list { max-height: 532px; overflow: auto; }
.queue-item { width: 100%; padding: 13px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; display: grid; grid-template-columns: 42px 1fr; gap: 10px; text-align: left; transition: background .16s ease; }
.queue-item:hover { background: var(--paper-soft); }
.queue-item.is-active { background: var(--jade-soft); }
.queue-thumb { width: 42px; height: 42px; border-radius: 4px; background: #e9c955; color: var(--ink); display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.queue-item:nth-child(2) .queue-thumb { background: #9fcac2; }.queue-item:nth-child(3) .queue-thumb { background: #d0b8de; }
.queue-copy { min-width: 0; }
.queue-copy strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.queue-meta { margin-top: 5px; display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--ink-soft); font-size: 10px; }
.queue-status { padding: 2px 5px; border-radius: 3px; background: #edf0ed; }.queue-status.done { color: var(--jade-dark); background: var(--jade-soft); }
.dashed-button { width: calc(100% - 24px); margin: 12px; min-height: 44px; border: 1px dashed var(--line-strong); border-radius: 5px; background: transparent; color: var(--ink-soft); display: flex; align-items: center; justify-content: center; gap: 7px; }
.dashed-button:hover { border-color: var(--jade); color: var(--jade-dark); background: var(--jade-soft); }

.editor-panel { overflow: hidden; }
.editor-heading { align-items: flex-start; }
.sheet-label { margin: 0 0 5px; color: var(--jade-dark); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.form-grid { padding: 16px; display: grid; grid-template-columns: 1fr; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > span, .field-label { font-size: 12px; font-weight: 700; }
.field small { color: var(--ink-soft); font-size: 11px; }
.field input, .field textarea { width: 100%; border: 1px solid var(--line-strong); border-radius: 4px; background: #fff; color: var(--ink); padding: 10px 11px; resize: vertical; transition: border-color .16s ease, box-shadow .16s ease; }
.field input { height: 41px; }
.field input:hover, .field textarea:hover { border-color: #8c9993; }
.field input:focus, .field textarea:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(8,127,104,.1); outline: none; }
.field input::placeholder, .field textarea::placeholder { color: #88928d; }
.tone-row { padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--paper-soft); border-block: 1px solid var(--line); }
.tone-row small { display: block; color: var(--ink-soft); font-size: 10px; }
.segmented { display: flex; padding: 3px; background: #e9ede9; border-radius: 5px; }
.segmented button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 3px; background: transparent; color: var(--ink-soft); font-size: 12px; }
.segmented button.is-active { background: var(--paper); color: var(--ink); box-shadow: 0 2px 8px rgba(23,32,29,.08); font-weight: 700; }
.result-section { padding: 16px; background: #fbfcf8; }
.result-heading { margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.result-badge { padding: 4px 7px; background: var(--ticket); border-radius: 3px; font-size: 11px; font-weight: 800; }
.model-label { margin-left: 8px; color: var(--ink-soft); font-size: 11px; }
.result-actions { display: flex; gap: 8px; align-items: center; }
.text-button { border: 0; background: transparent; color: var(--jade-dark); font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.output-field { margin-top: 12px; }
.output-field input, .output-field textarea { background: var(--paper); }
.highlight-list { display: flex; flex-wrap: wrap; gap: 7px; }
.highlight-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--jade-soft); border-radius: 4px; color: #075d4e; font-size: 12px; }
.highlight-chip::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--jade); }

.preview-column { display: grid; gap: 14px; }
.preview-panel { padding-bottom: 14px; overflow: hidden; }
.live-label { color: var(--jade-dark); font-size: 11px; display: flex; align-items: center; gap: 5px; }.live-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--jade); }
.phone-preview { width: calc(100% - 28px); margin: 14px; overflow: hidden; border: 1px solid #9ca8a2; border-radius: 8px; background: #fff; box-shadow: 0 12px 26px rgba(23,32,29,.12); }
.phone-status { height: 25px; padding: 0 10px; display: flex; align-items: center; justify-content: space-between; background: #fafafa; font-size: 8px; font-weight: 700; }
.preview-image { position: relative; aspect-ratio: 1; overflow: hidden; background: #e7c955; }
.preview-image > img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: cover; }
.sample-cover { position: absolute; inset: 0; padding: 26px 22px; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(145deg, #f1d75d 0 58%, #19342d 58% 100%); }
.sample-cover::before { content: ""; position: absolute; top: 22px; right: 24px; width: 72px; height: 96px; border: 8px solid var(--paper); box-shadow: -14px 14px 0 #0f7e68; transform: rotate(6deg); }
.sample-cover span { width: max-content; padding: 3px 6px; background: var(--ink); color: var(--paper); font-size: 9px; }
.sample-cover strong { position: relative; margin-top: 8px; width: 72%; padding: 6px 7px; background: var(--paper); color: var(--ink); font-size: 21px; line-height: 1.1; }
.sample-cover small { position: relative; width: max-content; margin-top: 4px; padding: 3px 6px; background: var(--jade); color: #fff; font-size: 9px; }
.image-index { position: absolute; right: 9px; bottom: 9px; z-index: 2; padding: 3px 7px; border-radius: 10px; background: rgba(23,32,29,.78); color: #fff; font-size: 8px; }
.listing-copy { padding: 11px; }
.listing-price { color: #e95822; font-size: 12px; }.listing-price strong { font-size: 22px; }.listing-price span { margin-left: 6px; padding: 2px 4px; background: #fff0e9; border-radius: 2px; font-size: 8px; }
.listing-copy h3 { margin: 5px 0; font-size: 12px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.listing-copy > p { margin-bottom: 9px; color: var(--ink-soft); font-size: 9px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.seller-row { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 6px; padding-top: 9px; border-top: 1px solid #eee; }
.seller-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--ticket); display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.seller-row strong, .seller-row small { display: block; font-size: 8px; }.seller-row small { color: #89918e; }.seller-row button { min-height: 27px; padding: 0 9px; border: 0; border-radius: 4px; background: #ffe347; font-size: 9px; font-weight: 700; }
.preview-panel > .button { width: calc(100% - 28px); margin-inline: 14px; }
.compliance-panel { padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.check-heading { display: flex; justify-content: space-between; align-items: center; }.check-heading h2 { font-size: 14px; }.check-heading span { color: var(--ink-soft); font-size: 11px; }
.compliance-panel ul { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.compliance-panel li { display: flex; align-items: center; gap: 8px; color: var(--ink-soft); font-size: 11px; }
.compliance-panel li span { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; }
.compliance-panel li.pass span { color: var(--jade-dark); background: var(--jade-soft); }.compliance-panel li.warn span { color: #725900; background: var(--ticket-soft); }

.section-intro { min-height: 100px; padding: 8px 4px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.section-intro h2 { margin-bottom: 6px; font-size: 24px; }.section-intro p:last-child { margin-bottom: 0; color: var(--ink-soft); }
.file-button input { display: none; }

.product-library { min-height: calc(100vh - 120px); }
.product-library-head { min-height: 92px; padding: 8px 2px 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.product-library-head h2 { margin-bottom: 5px; font-size: 24px; }
.product-library-head p { margin-bottom: 0; color: var(--ink-soft); }
.product-library-actions { display: flex; align-items: center; gap: 10px; }
.product-search { width: 240px; height: 40px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--paper); }
.product-search:focus-within { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(8,127,104,.1); }
.product-search svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--ink-soft); stroke-width: 1.8; stroke-linecap: round; }
.product-search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.product-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; align-items: start; }
.product-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; background: var(--paper); text-align: left; box-shadow: 0 2px 0 rgba(23,32,29,.02); transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease; }
.product-card:hover { border-color: var(--line-strong); box-shadow: 0 8px 22px rgba(23,32,29,.09); transform: translateY(-2px); }
.product-card:active { transform: translateY(0); }
.product-card-cover { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: #e5e8e3; }
.product-card-cover img { width: 100%; height: 100%; display: block; object-fit: cover; }
.product-card-placeholder { position: absolute; inset: 0; display: grid; place-items: center; background: var(--paper-soft); color: #8b9690; }
.product-card-placeholder svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.product-card-index { position: absolute; top: 9px; left: 9px; padding: 3px 6px; border-radius: 3px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 800; }
.product-card-copy { min-height: 82px; padding: 12px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.product-card-copy strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.45; overflow-wrap: anywhere; }
.product-card-copy small { color: var(--ink-soft); font-size: 11px; }
.product-empty { grid-column: 1 / -1; min-height: 360px; display: grid; place-items: center; border: 1px dashed var(--line-strong); border-radius: 6px; background: rgba(255,254,251,.55); text-align: center; }
.product-empty svg { width: 40px; height: 40px; margin-bottom: 10px; fill: none; stroke: var(--jade); stroke-width: 1.5; }
.product-empty p { margin: 4px 0 16px; color: var(--ink-soft); }
.product-pagination { min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.page-button { min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.page-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.page-button:hover:not(:disabled) { border-color: var(--jade); }
.page-button.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.page-button:disabled { opacity: .42; cursor: not-allowed; }
.product-page-count { margin-left: 6px; color: var(--ink-soft); font-size: 11px; }

.product-editor[hidden], .product-library[hidden] { display: none; }
.product-editor-shell { width: min(920px, 100%); margin: 0 auto; }
.product-editor-toolbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.product-save-state { display: flex; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 12px; }
.product-save-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--jade); }
.product-save-state.is-saving i { background: var(--ticket); }
.product-save-state.is-error { color: var(--red); }
.product-save-state.is-error i { background: var(--red); }
.product-notebook { overflow: hidden; border: 1px solid var(--line); border-radius: 6px 6px 0 0; background: var(--paper); }
.product-gallery-section, .product-notebook-head, .product-copy-section { padding: 22px; border-bottom: 1px solid var(--line); }
.product-section-heading { min-height: 42px; margin-bottom: 14px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.product-section-heading h3 { margin: 0 0 3px; font-size: 16px; }
.product-section-heading p { margin: 0; color: var(--ink-soft); font-size: 12px; }
.product-section-heading > span { flex: 0 0 auto; padding: 5px 7px; background: var(--ticket-soft); color: #5a490a; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.product-image-gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.product-gallery-item, .product-image-add { position: relative; aspect-ratio: 1; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: #e6e9e5; }
.product-gallery-item img { width: 100%; height: 100%; display: block; object-fit: cover; }
.product-cover-badge { position: absolute; left: 6px; top: 6px; padding: 3px 6px; background: var(--ticket); color: var(--ink); font-size: 12px; font-weight: 800; box-shadow: 0 1px 2px rgba(23,32,29,.16); }
.product-image-remove { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(23,32,29,.88); color: #fff; box-shadow: 0 2px 6px rgba(23,32,29,.2); }
.product-image-remove:hover { background: var(--red); }
.product-image-remove svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.product-image-add { display: grid; place-items: center; border-style: dashed; border-color: var(--line-strong); background: var(--paper-soft); color: var(--ink-soft); cursor: pointer; }
.product-image-add:hover { border-color: var(--jade); color: var(--jade-dark); background: var(--jade-soft); }
.product-image-add input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.product-image-add > span { padding: 8px; display: grid; place-items: center; gap: 4px; text-align: center; }
.product-image-add svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.product-image-add strong { font-size: 12px; }
.product-image-add small { font-size: 12px; }
.product-notebook-head { background: var(--paper); }
.product-notebook-head .field > span { font-size: 12px; }
.product-notebook-head input { height: 48px; font-size: 16px; font-weight: 700; }
.product-notebook-head p { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; }
.product-copy-section { background: var(--paper-soft); }
.product-text-sections { display: grid; gap: 14px; }
.product-text-section { overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--paper); }
.product-text-toolbar { min-height: 44px; padding: 5px 8px 5px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.product-text-toolbar strong { font-size: 12px; }
.product-text-actions { display: flex; gap: 5px; }
.product-text-actions .icon-button { width: 32px; height: 32px; }
.product-text-actions .icon-button:disabled { opacity: .35; cursor: not-allowed; }
.product-text-field { padding: 12px; }
.product-text-field textarea { min-height: 128px; }
.product-add-text { width: 100%; margin-top: 14px; background: var(--paper); }
.pan-link-section { padding: 22px; border-top: 4px solid var(--ticket); background: var(--paper); }
.pan-link-section h3 { margin-bottom: 3px; font-size: 16px; }
.pan-link-section > div > p { margin-bottom: 16px; color: var(--ink-soft); font-size: 12px; }
.pan-link-section textarea { min-height: 96px; }
.product-editor-footer { min-height: 78px; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; background: var(--paper); }
.text-button.destructive { color: var(--red); }
.image-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; }
.canvas-stage { min-height: 660px; padding: 34px; display: grid; place-items: center; position: relative; background: #dfe3df; border: 1px solid #cdd3ce; border-radius: var(--radius); overflow: hidden; }
.canvas-stage::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(45deg, rgba(255,255,255,.3) 25%, transparent 25%), linear-gradient(-45deg, rgba(255,255,255,.3) 25%, transparent 25%), linear-gradient(45deg, transparent 75%, rgba(255,255,255,.3) 75%), linear-gradient(-45deg, transparent 75%, rgba(255,255,255,.3) 75%); background-size: 24px 24px; background-position: 0 0, 0 12px, 12px -12px, -12px 0; opacity: .4; }
#imageCanvas { position: relative; z-index: 1; width: min(72vh, 100%); max-width: 700px; aspect-ratio: 1; background: #fff; box-shadow: var(--shadow); }
.canvas-meta { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; justify-content: space-between; color: #4c5954; font-size: 11px; }
.image-controls { overflow: hidden; }
.image-controls > .field, .range-field, .transform-row, .image-controls > .button { margin: 14px 16px 0; }
.preset-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 14px 16px 0; }
.preset { min-height: 38px; border: 1px solid var(--line); border-radius: 4px; background: var(--paper-soft); }.preset.is-active { color: #fff; background: var(--ink); border-color: var(--ink); }
.range-field { display: grid; gap: 7px; }.range-field span { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; }.range-field output { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--jade); }
.transform-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.image-controls > .button { width: calc(100% - 32px); margin-bottom: 16px; }

.history-table { overflow: hidden; }
.table-head, .history-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1.3fr; gap: 16px; align-items: center; min-height: 52px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.table-head { min-height: 42px; background: var(--paper-soft); color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.history-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.history-row span { color: var(--ink-soft); font-size: 12px; }
.empty-state { padding: 56px 20px; text-align: center; color: var(--ink-soft); }

.settings-layout { display: grid; grid-template-columns: minmax(440px, 700px) 320px; gap: 20px; align-items: start; }
.settings-form { overflow: hidden; }.settings-form > .field { margin: 16px; }.settings-form > .field + .field { margin-top: 0; }
.mode-list { display: grid; padding: 8px 16px 16px; }
.mode-option { position: relative; min-height: 76px; padding: 14px 12px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.mode-option:last-child { border-bottom: 0; }
.mode-option input { position: absolute; opacity: 0; }
.mode-radio { width: 18px; height: 18px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; }
.mode-radio::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.mode-option input:checked + .mode-radio { border-color: var(--jade); }
.mode-option input:checked + .mode-radio::after { background: var(--jade); }
.mode-option input:focus-visible + .mode-radio { outline: 3px solid rgba(8, 127, 104, .24); outline-offset: 2px; }
.mode-option strong, .mode-option small { display: block; }
.mode-option small { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }
.mode-option > b { padding: 3px 6px; border-radius: 3px; background: var(--ticket); font-size: 10px; }
.api-settings { padding: 2px 0 1px; border-top: 1px solid var(--line); background: var(--paper-soft); }
.api-settings > .field { margin: 14px 16px; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }.switch input { position: absolute; opacity: 0; }.switch span { width: 38px; height: 22px; padding: 3px; border-radius: 11px; background: #b9c1bd; transition: background .18s ease; }.switch span::after { content: ""; display: block; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .18s ease; }.switch input:checked + span { background: var(--jade); }.switch input:checked + span::after { transform: translateX(16px); }
.form-actions { min-height: 68px; padding: 14px 16px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }.form-actions > span { color: var(--ink-soft); font-size: 12px; }.form-actions i { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--ticket); }
.settings-guide { padding: 18px; background: var(--paper); box-shadow: inset 0 4px 0 var(--ticket), var(--shadow); }.settings-guide ol { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 16px; }.settings-guide li { display: grid; grid-template-columns: 26px 1fr; gap: 9px; align-items: start; }.settings-guide li span { width: 26px; height: 26px; display: grid; place-items: center; background: var(--ticket); font-weight: 800; }.settings-guide > p { margin-bottom: 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 12px; }.security-note { padding: 7px 9px; background: var(--jade-soft); color: var(--jade-dark); border-radius: 4px; font-size: 12px; font-weight: 700; }

dialog { width: min(560px, calc(100vw - 28px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: 7px; box-shadow: 0 30px 80px rgba(23,32,29,.3); color: var(--ink); overflow: auto; } dialog::backdrop { background: rgba(23,32,29,.55); backdrop-filter: blur(2px); } dialog form > .field { margin: 16px 18px 4px; }.dialog-heading { padding: 18px; display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); }.dialog-heading p { margin-bottom: 0; color: var(--ink-soft); font-size: 12px; }.dialog-actions { padding: 14px 18px; display: flex; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); }
.field-hint { display: block; margin: 0 18px 12px; color: var(--ink-soft); font-size: 11px; }
.handoff-dialog { width: min(680px, calc(100vw - 28px)); }
.handoff-body { padding: 16px 18px 4px; }
.handoff-steps { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.handoff-steps li { min-width: 0; display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 7px; color: var(--ink-soft); font-size: 11px; }
.handoff-steps li span { width: 24px; height: 24px; border: 1px solid var(--line-strong); border-radius: 50%; display: grid; place-items: center; font-weight: 800; }
.handoff-steps li.is-current { color: var(--jade-dark); }
.handoff-steps li.is-current span { border-color: var(--jade); background: var(--jade); color: #fff; }
.handoff-note { margin-bottom: 14px; padding: 11px 12px; background: var(--ticket-soft); color: #5a490a; border-radius: 4px; }
.handoff-note p { margin: 3px 0 0; font-size: 11px; }
.handoff-body > .field { margin: 12px 0; }
.handoff-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-error { min-height: 20px; margin: 4px 0 8px; color: var(--red); font-size: 12px; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 50; max-width: 360px; padding: 12px 15px; border-radius: 5px; background: var(--ink); color: #fff; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .2s ease, transform .2s ease; }.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (min-width: 1380px) {
  :root { --sidebar: 188px; }
  .sidebar { padding-inline: 14px; align-items: stretch; }
  .brand { padding-inline: 8px; }.brand-copy { display: grid; }.brand-copy strong { font-size: 14px; }.brand-copy small { color: #8f9c96; font-size: 8px; }
  .nav-item { min-height: 48px; padding: 0 12px; grid-template-columns: 22px 1fr; justify-items: start; gap: 11px; }.nav-item span { font-size: 13px; }
  .sidebar-foot { justify-content: flex-start; }.sidebar-foot > span:last-child { display: grid; }.sidebar-foot strong, .sidebar-foot small { display: block; font-size: 10px; }
  .workbench-grid { grid-template-columns: 238px minmax(520px, 1fr) 320px; }
}

@media (max-width: 1120px) {
  .workbench-grid { grid-template-columns: 210px minmax(0, 1fr); }
  .preview-column { grid-column: 1 / -1; grid-template-columns: 320px 1fr; }
  .compliance-panel { align-self: start; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  :root { --sidebar: 0px; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .sidebar { inset: auto 0 0 0; width: 100%; height: calc(70px + env(safe-area-inset-bottom)); padding: 6px 10px max(6px, env(safe-area-inset-bottom)); flex-direction: row; align-items: flex-start; background: #17201d; }
  .brand, .sidebar-foot { display: none; }.nav-list { margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }.nav-item { position: relative; z-index: 1; min-height: 58px; pointer-events: auto; }.nav-item:active { background: var(--ticket); color: var(--ink); }.nav-item svg { width: 19px; height: 19px; }
  .main-area { margin-left: 0; }.topbar { height: 66px; padding: 0 14px; }.crumb, .save-state, #helpBtn, .account-name { display: none; }.top-actions .button { padding: 0 10px; font-size: 12px; }
  .view { padding: 10px 10px 20px; }.workflow-strip { justify-content: flex-start; gap: 4px; padding: 4px 2px 12px; }.workflow-line { width: 8px; flex: 0 0 8px; }.workflow-step { gap: 4px; font-size: 11px; }
  .workbench-grid { grid-template-columns: 1fr; }.queue-panel { order: 2; }.editor-panel { order: 1; }.preview-column { order: 3; grid-column: auto; grid-template-columns: 1fr; }
  .queue-list { max-height: 270px; }.editor-heading { flex-direction: column; }.editor-heading .button { width: 100%; }.tone-row { align-items: flex-start; flex-direction: column; }.segmented { width: 100%; }.segmented button { flex: 1; padding-inline: 5px; }
  .section-intro { align-items: flex-start; flex-direction: column; }.section-intro .button { width: 100%; }.image-workspace, .settings-layout { grid-template-columns: 1fr; }.canvas-stage { min-height: 390px; padding: 24px; }.canvas-meta { display: none; }
  .table-head { display: none; }.history-row { grid-template-columns: 1fr auto; padding: 12px 14px; }.history-row span:nth-child(3), .history-row span:nth-child(4) { font-size: 10px; }
  .settings-layout { display: flex; flex-direction: column; }.settings-form, .settings-guide { width: 100%; }.form-actions { align-items: stretch; flex-direction: column; }.form-actions .button { width: 100%; }
  .handoff-steps { grid-template-columns: 1fr; }.handoff-actions { grid-template-columns: 1fr; }.dialog-actions { flex-direction: column-reverse; }.dialog-actions .button { width: 100%; }
  .toast { left: 12px; right: 12px; bottom: 80px; max-width: none; }
  .product-library-head { align-items: stretch; flex-direction: column; }.product-library-actions { align-items: stretch; flex-direction: column; }.product-search { width: 100%; }.product-library-actions .button { width: 100%; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }.product-card-copy { min-height: 76px; padding: 10px; }.product-card-copy strong { font-size: 12px; }.product-card-copy small { font-size: 10px; }
  .product-editor-toolbar { align-items: stretch; flex-direction: column; padding: 8px 0 12px; }.product-editor-toolbar .button { width: 100%; }.product-save-state { justify-content: center; }
  .product-gallery-section, .product-notebook-head, .product-copy-section, .pan-link-section { padding: 14px; }.product-notebook-head input { font-size: 16px; }.product-image-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }.product-image-add small { display: none; }.product-text-field { padding: 10px; }.product-editor-footer { align-items: stretch; flex-direction: column-reverse; }.product-editor-footer .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
