:root {
  --bg: #f4f6f8;
  --panel: #fff;
  --line: #d7dde5;
  --text: #1f2937;
  --muted: #667085;
  --nav: #17202c;
  --nav2: #253142;
  --teal: #0f766e;
  --blue: #2563eb;
  --green: #15803d;
  --amber: #b45309;
  --red: #b42318;
  --soft: #f8fafc;
  --side-color-size: 104px;
  --panel-head-height: 58px;
  --right-panel-width: 480px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.btn {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 11px;
}
.btn.primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { background: #fff; border-color: #fecaca; color: #b42318; }
.btn.danger:hover { background: #fef2f2; border-color: #fca5a5; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
}
.nav {
  background: var(--nav);
  color: #d9e2ee;
  padding: 18px 14px;
}
.brand {
  font-size: 18px;
  font-weight: 700;
  margin: 2px 4px 10px;
}
.phase {
  margin: 0 4px 18px;
  padding: 8px;
  border: 1px solid #465569;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.5;
}
.nav-list { display: grid; gap: 4px; margin-bottom: 16px; }
.nav-list button {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--nav2);
  color: #fff;
  text-align: left;
  padding: 0 12px;
}
.root-box {
  border: 1px solid #465569;
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}
.root-box span { display: block; color: #cbd5e1; margin-bottom: 5px; }
.root-box strong { color: #fff; font-weight: 600; }

main {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
header {
  min-height: 72px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1 { margin: 0; font-size: 20px; }
header p { margin: 5px 0 0; color: var(--muted); }
.header-actions { display: flex; align-items: center; gap: 8px; }

.workspace {
  min-height: 0;
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--right-panel-width);
  gap: 14px;
}
.left-panel, .right-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.left-panel { padding: 0; }
.right-panel { display: grid; grid-template-rows: auto minmax(0, 1fr); position: relative; }
.right-head {
  min-height: var(--panel-head-height);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.right-body {
  padding: 14px;
  min-height: 0;
  overflow: auto;
  position: relative;
}

.brand-row {
  min-height: var(--panel-head-height);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.brand-tabs {
  min-width: 0;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}
.brand-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.brand-tab {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 14px;
}
.brand-tab.active {
  background: #ecfdf5;
  border-color: #8fc9c0;
  color: var(--teal);
  font-weight: 700;
}
.library-section {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.library-section:last-child { border-bottom: 0; }
.material-section { background: #fbfdff; }
.folder-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 14px 14px 0;
  margin-bottom: 10px;
}
.folder-toolbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.muted { color: var(--muted); font-size: 12px; line-height: 1.5; }
.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin: 0 14px 14px;
}
.folder-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 104px;
  padding: 14px 16px;
  cursor: pointer;
  display: grid;
  align-content: start;
  gap: 10px;
}
.folder-block.active, .folder-block:hover {
  border-color: var(--teal);
  background: #ecfdf5;
}
.product-model-block.has-front-thumb {
  grid-template-columns: minmax(0, 1fr) 60px;
  align-items: center;
  gap: 10px;
}
.model-card-main {
  min-width: 0;
  display: grid;
  gap: 10px;
}
.model-front-thumb {
  width: 60px;
  height: 80px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  overflow: hidden;
  justify-self: end;
}
.model-front-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.material-section .folder-block.active,
.material-section .folder-block:hover {
  border-color: var(--blue);
  background: #eff6ff;
}
.folder-title {
  font-weight: 700;
  font-size: 16px;
}
.folder-meta {
  color: var(--muted);
  font-size: 12px;
}
.color-list, .stage-counts {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.color-pill, .count-pill {
  border: 1px solid #d7dde5;
  border-radius: 999px;
  background: #f8fafc;
  padding: 3px 8px;
  font-size: 12px;
  color: #475569;
}
.color-pill { cursor: pointer; }
.color-pill.transparent-complete {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}
.color-pill.transparent-incomplete {
  border-color: #fecaca;
  background: #fee2e2;
  color: #991b1b;
}
.color-pill.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, .18) inset;
  font-weight: 700;
}

.side-title {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
  word-break: break-all;
}
.side-color-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--side-color-size));
  gap: 8px;
  align-items: start;
}
.side-color-block {
  width: var(--side-color-size);
  height: var(--side-color-size);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  text-align: left;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.side-color-block:hover, .side-color-block.active {
  border-color: var(--teal);
  background: #ecfdf5;
  color: var(--teal);
  font-weight: 700;
}
.side-color-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-color-delete {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  color: rgba(31,41,55,.72);
  display: grid;
  place-items: center;
  font-size: 15px;
  line-height: 1;
  opacity: 0;
  box-shadow: 0 1px 4px rgba(15,23,42,.16);
}
.side-color-block:hover .side-color-delete,
.side-color-block:focus-visible .side-color-delete {
  opacity: 1;
}
.side-color-delete:hover {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}
.add-color-block .side-color-delete { display: none; }
.add-color-block {
  border-color: var(--teal);
  background: #fff;
  color: var(--teal);
  font-weight: 700;
}
.add-color-block:hover {
  border-color: var(--teal);
  background: #ecfdf5;
  color: var(--teal);
}
.side-color-block small {
  display: block;
  color: var(--muted);
  margin-top: 3px;
  font-weight: 400;
}
.empty {
  min-height: 180px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
}
.side-model-actions { margin-top: 12px; }
.empty-action {
  min-height: 180px;
}
.empty-upload-btn {
  width: var(--side-color-size);
  height: var(--side-color-size);
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: #fff;
  color: var(--teal);
  font-size: 16px;
  font-weight: 700;
}
.empty-upload-btn:hover,
.empty-process-btn:hover {
  background: #ecfdf5;
}
.empty-process-btn {
  min-width: var(--side-color-size);
  height: 42px;
  border: 1px solid var(--teal);
  border-radius: 6px;
  background: #fff;
  color: var(--teal);
  padding: 0 18px;
  font-size: 16px;
  font-weight: 700;
}
.preprocess-empty {
  gap: 8px;
}
.empty-message {
  color: #475569;
  font-weight: 600;
}
.empty-help {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.side-processing {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  place-items: center;
  background: rgba(248, 250, 252, .78);
  pointer-events: auto;
}
.side-processing-box {
  max-width: min(320px, calc(100% - 36px));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(15, 23, 42, .18);
  color: #0f172a;
  font-weight: 700;
  line-height: 1.6;
  padding: 16px 18px;
  text-align: center;
}

.square-add-color {
  width: var(--side-color-size);
  height: var(--side-color-size);
  padding: 0;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 32px;
  line-height: 1;
}

.side-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.side-tab {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #334155;
}
.side-tab.active {
  border-color: var(--teal);
  background: #ecfdf5;
  color: var(--teal);
  font-weight: 700;
}
.stage-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
}
.stage-actions .btn { height: 34px; }
.generator-model-search {
  width: 190px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 13px;
  padding: 0 10px;
  outline: none;
}
.generator-model-search:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(20, 184, 166, .14);
}
.thumb-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-items: start;
  margin-bottom: 12px;
}
.file-thumb {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  min-width: 0;
  padding: 0;
  text-align: left;
  position: relative;
}
.file-thumb.active, .file-thumb:hover {
  border-color: var(--teal);
  background: #ecfdf5;
}
.file-thumb.process-selected {
  border-color: #16a34a;
  background: #f0fdf4;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, .18);
}
.thumb-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255,255,255,.85);
  border-radius: 50%;
  background: rgba(255,255,255,.72);
  color: rgba(31,41,55,.72);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(15,23,42,.18);
}
.thumb-delete:hover {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}
.file-thumb img {
  width: 100%;
  height: auto;
  display: block;
  background: #eef2f7;
}
.angle-badge {
  width: 100%;
  height: 28px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.angle-badge.unset {
  color: #94a3b8;
  font-weight: 500;
}
.angle-badge:hover {
  background: #ecfdf5;
  color: var(--teal);
}
.thumb-name {
  width: 100%;
  height: 28px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: #475569;
  font-size: 12px;
  line-height: 28px;
  padding: 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-thumb.process-selected .thumb-name,
.file-thumb.process-selected .angle-badge {
  border-top-color: #bbf7d0;
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
}
.large-preview {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}
.large-preview img {
  width: 100%;
  height: auto;
  display: block;
  background: #eef2f7;
}
.preview-meta {
  border-top: 1px solid var(--line);
  padding: 9px 11px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}
.transparent-standard {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  color: #0f766e;
  font-weight: 700;
  word-break: normal;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .42);
  display: grid;
  place-items: center;
  z-index: 90;
}
.modal {
  width: min(860px, calc(100vw - 32px));
  background: #fff;
  border-radius: 8px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 60px rgba(15, 23, 42, .28);
  overflow: hidden;
}
.modal.transparent-review-modal {
  width: fit-content;
  max-width: calc(100vw - 32px);
}
.modal.transparent-review-modal .modal-body {
  padding: 12px;
  overflow-x: auto;
}
.modal-head, .modal-foot {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.modal-foot {
  border-top: 1px solid var(--line);
  border-bottom: 0;
  justify-content: flex-end;
}
.modal-body {
  padding: 16px;
  line-height: 1.7;
}
.notice-modal-text {
  color: #334155;
  line-height: 1.8;
  white-space: normal;
}
.angle-batch-help {
  color: #475569;
  font-size: 13px;
  line-height: 1.6;
  margin-bottom: 12px;
}
.angle-batch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.angle-set-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}
.angle-set-preview {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  background: #eef2f7;
  overflow: hidden;
}
.angle-set-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.angle-set-info {
  display: grid;
  gap: 7px;
  padding: 8px;
  background: #fff;
}
.angle-set-name {
  color: #475569;
  font-size: 12px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.angle-set-info select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 5px 7px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-size: 13px;
  color: #344054;
  font-weight: 600;
}
.field input, .field select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  min-width: 0;
}

.create-model-form {
  display: grid;
  gap: 14px;
}
.create-model-top {
  align-items: end;
}
.color-entry-panel {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}
.color-entry-head {
  padding: 10px 12px;
  border-bottom: 1px solid #dbe4ef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #fff;
}
.color-entry-head strong {
  color: #1e293b;
  font-size: 14px;
}
.color-entry-head span {
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
}
.color-entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
}
.color-entry {
  min-width: 0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
}
.color-entry-index {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #eef2f7;
  color: #475569;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
}
.color-entry input {
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
  min-width: 0;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: grid;
  gap: 8px;
}
.toast-item {
  background: #111827;
  color: #fff;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,.2);
  max-width: 360px;
}

@media (max-width: 1120px) {
  .app { grid-template-columns: 190px minmax(0, 1fr); }
  .workspace { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .nav { display: none; }
  header { align-items: flex-start; flex-direction: column; }
  .workspace { padding: 10px; }
  .folder-toolbar, .right-head { align-items: flex-start; flex-direction: column; }
  .right-head .stage-actions,
  .generator-model-search { width: 100%; }
  .brand-row { grid-template-columns: 1fr; height: auto; }
  .brand-actions { justify-content: flex-end; }
  .form-grid { grid-template-columns: 1fr; }
  .color-entry-head { align-items: flex-start; flex-direction: column; }
  .color-entry-head span { white-space: normal; }
  .color-entry-grid { grid-template-columns: 1fr; }
  .angle-batch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.generator-workspace {
  grid-template-columns: minmax(0, 1fr) var(--right-panel-width);
}
.generator-toolbar {
  min-height: var(--panel-head-height);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.generator-toolbar-content {
  min-width: 0;
  width: 100%;
}
.generator-toolbar-heading {
  display: block;
  font-size: 15px;
}
.generator-tool-switcher {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.generator-tool-switcher .generator-tool-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.generator-tool-switcher .generator-tool-card {
  min-height: 62px;
}
.template-category-switch-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.template-category-switch-card {
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #fff 0%, #fbfefd 100%);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.template-category-switch-card:hover,
.template-category-switch-card.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}
.template-category-switch-card strong {
  color: #0f172a;
  font-size: 15px;
}
.template-category-switch-card span {
  min-width: 26px;
  height: 24px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
}
.template-category-switch-card.active span {
  background: #ccfbf1;
  color: #0f766e;
}
.generator-record-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px);
  align-items: center;
  gap: 12px;
}
.generator-record-search-input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
}
.generator-body {
  padding: 14px;
  display: grid;
  gap: 14px;
}
.generator-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.generator-type {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 4px;
  text-align: left;
}
.generator-type.active {
  border-color: var(--teal);
  background: #ecfdf5;
  color: var(--teal);
}
.generator-type:disabled {
  cursor: not-allowed;
  color: #94a3b8;
  background: #f8fafc;
}
.generator-type span {
  font-size: 12px;
  color: var(--muted);
}
.generator-form {
  display: grid;
  gap: 12px;
}
.generator-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.generator-source-preview {
  min-height: 260px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.generator-source-preview img {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
  display: block;
}
.generator-actions {
  display: flex;
  justify-content: flex-end;
}
.generator-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
}
.generated-preview {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.generated-preview img {
  max-width: 100%;
  max-height: 560px;
  object-fit: contain;
  display: block;
}
.generated-meta {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  color: #475569;
  word-break: break-all;
}
.generated-meta strong {
  color: #0f172a;
}
@media (max-width: 980px) {
  .generator-workspace { grid-template-columns: 1fr; }
  .generator-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .generator-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .generator-type-grid, .generator-fields { grid-template-columns: 1fr; }
}


.generator-record-notice {
  margin-bottom: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}
.generator-record-notice.stale {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}
.generator-record-notice span {
  font-size: 12px;
  line-height: 1.5;
}
.source-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
.source-compare > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 8px;
}
.source-compare strong {
  font-size: 12px;
  color: #334155;
}
.source-compare img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 6px;
}
@media (max-width: 620px) {
  .source-compare { grid-template-columns: 1fr; }
}


/* Product generation operator workspace */
.generator-workspace {
  grid-template-columns: minmax(0, 1fr) var(--right-panel-width);
}
.generator-body {
  align-content: start;
  gap: 14px;
}
.generator-demand {
  display: grid;
  gap: 12px;
}
.generator-demand-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}
.generator-source-preview {
  min-height: 360px;
  background: #f8fafc;
}
.generator-source-preview img {
  max-height: 360px;
}
.generator-controls {
  display: grid;
  align-content: start;
  gap: 12px;
}
.generator-controls .generator-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.generator-demand-status {
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1e3a8a;
  border-radius: 8px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}
.generator-demand-status span {
  font-size: 12px;
  line-height: 1.45;
}
.generator-demand-status.ready {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.generator-demand-status.stale,
.generator-demand-status.missing {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}
.generator-demand-status.new {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #334155;
}
.generator-output {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.generator-output-head {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.generator-output-head > strong {
  min-width: 0;
}
.generator-output .generated-preview {
  min-height: 330px;
}
.generator-output .generated-preview img {
  max-height: 460px;
}
.generator-records-body {
  display: grid;
  align-content: start;
  gap: 12px;
}
.generator-record-filters {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.generator-record-filters button {
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  padding: 9px 6px;
  cursor: pointer;
  font-size: 12px;
  color: #475569;
}
.generator-record-filters button:last-child {
  border-right: 0;
}
.generator-record-filters button.active {
  background: #0f766e;
  color: #fff;
}
.generator-record-summary {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.generator-record-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 8px;
  background: #fff;
  display: grid;
  gap: 2px;
}
.generator-record-summary strong {
  font-size: 18px;
  color: #0f172a;
}
.generator-record-summary span {
  font-size: 12px;
  color: var(--muted);
}
.generator-record-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.generator-record-item {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.generator-record-item:hover,
.generator-record-item.active {
  border-color: var(--teal);
  background: #f0fdfa;
}
.record-thumb {
  width: 58px;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
}
.record-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.record-info {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 4px;
}
.record-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.record-info strong,
.record-info span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.record-info span {
  color: var(--muted);
  font-size: 12px;
}
.record-info .record-batch-materials {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  white-space: normal;
  line-height: 1.35;
  max-height: 32px;
  overflow: hidden;
  overflow-wrap: anywhere;
}
.record-badge {
  min-width: 0;
  border-radius: 999px;
  padding: 3px 7px;
  font-size: 12px;
  color: #334155;
  background: #e2e8f0;
}
.record-badge.ready {
  display: none;
}
.record-badge.stale,
.record-badge.missing {
  color: #fff;
  background: #dc2626;
}
.generator-record-empty {
  min-height: 220px;
  display: grid;
  place-items: center;
}
@media (max-width: 1180px) {
  .generator-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .generator-demand-grid { grid-template-columns: 1fr; }
  .generator-controls .generator-fields { grid-template-columns: 1fr; }
}


/* Product generation dashboard framework */
.generator-main-panel {
  min-width: 0;
}
.generator-workspace.generator-home-active .generator-main-panel {
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
.generator-workspace.generator-home-active .generator-body {
  padding: 0;
}
.generator-workspace.generator-home-active .generator-dashboard,
.generator-workspace.generator-home-active .generator-home {
  gap: 14px;
}
.generator-dashboard {
  display: grid;
  gap: 10px;
}
.generator-home {
  display: grid;
  gap: 10px;
}
.generator-home-section,
.generator-tool-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
}
.generator-section-head,
.generator-tool-panel-head {
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.generator-section-head strong,
.generator-tool-panel-head strong,
.generator-section-title {
  color: #0f172a;
}
.generator-section-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
}
.generator-tool-panel-head span {
  border-radius: 999px;
  padding: 4px 9px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 12px;
}
.generator-tool-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.generator-tool-card {
  --tool-accent: #0f766e;
  --tool-accent-2: #64748b;
  --tool-fill: #dff7f1;
  --tool-fill-2: #f1fbf8;
  --tool-bg: #f7fffc;
  --tool-border: #d6ebe6;
  --tool-glow: rgba(15, 118, 110, .10);
  min-height: 64px;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, #fff 0%, #fbfefd 100%);
  border-radius: 8px;
  padding: 10px 9px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}
.generator-tool-card:hover,
.generator-tool-card.active {
  border-color: var(--tool-accent);
  background: linear-gradient(135deg, #fff 0%, var(--tool-bg) 100%);
  box-shadow: 0 8px 22px rgba(15, 23, 42, .04);
}
.generator-tool-card.pending-tool {
  --tool-accent: #64748b;
  --tool-accent-2: #94a3b8;
  --tool-fill: #f1f5f9;
  --tool-fill-2: #f8fafc;
  --tool-bg: #f8fafc;
  --tool-border: #e2e8f0;
}
.generator-tool-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.generator-tool-icon {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--tool-border);
  border-radius: 10px;
  background: linear-gradient(145deg, #fff 0%, var(--tool-bg) 100%);
  color: var(--tool-accent);
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 7px 18px var(--tool-glow);
}
.generator-tool-card:hover .generator-tool-icon,
.generator-tool-card.active .generator-tool-icon {
  border-color: #9dd9cf;
  background: linear-gradient(145deg, #fff 0%, #ecfdf5 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .95), 0 9px 22px var(--tool-glow);
}
.generator-template-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.generator-template-grid.single {
  grid-template-columns: minmax(0, 1fr);
}
.generator-template-card {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 13px 14px;
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
}
.generator-template-card:hover,
.generator-template-card.active {
  border-color: #0f766e;
  background: #f0fdfa;
}
.generator-template-card strong {
  color: #0f172a;
}
.generator-template-card span,
.generator-template-card em {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  font-style: normal;
}
.generator-home-template-columns {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.generator-home-template-column {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.generator-home-template-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.generator-home-template-head strong {
  color: #0f172a;
  font-size: 13px;
}
.generator-home-template-head span {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}
.generator-home-template-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.generator-home-template-card,
.generator-home-template-empty {
  min-width: 0;
  min-height: 58px;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: left;
  cursor: pointer;
}
.generator-home-template-card:hover,
.generator-home-template-empty:hover {
  border-color: #0f766e;
  background: #f0fdfa;
}
.generator-home-template-card strong,
.generator-home-template-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.generator-home-template-card strong {
  color: #0f172a;
  font-size: 12px;
}
.generator-home-template-card span,
.generator-home-template-empty {
  color: var(--muted);
  font-size: 12px;
}
.generator-home-template-empty {
  place-items: center;
  text-align: center;
}
.template-library-home {
  display: grid;
  gap: 12px;
}
.template-home-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
}
.template-home-row.single {
  grid-template-columns: minmax(0, 1fr);
}
.template-home-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}
.template-home-group-head strong {
  color: #0f172a;
  font-size: 16px;
}
.template-home-group-head span {
  color: var(--muted);
  font-size: 12px;
}
.template-home-more-btn {
  border: 1px solid #c8d5dc;
  border-radius: 6px;
  background: #fff;
  color: #0f766e;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}
.template-home-more-btn:hover {
  border-color: #0f766e;
  background: #eefaf7;
}
.template-home-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  align-content: start;
  gap: 8px;
}
.template-library-home.category-page .template-home-card-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.template-home-card-list.slot-grouped,
.template-library-home.category-page .template-home-card-list.slot-grouped {
  grid-template-columns: minmax(0, 1fr);
}
.template-home-slot-group {
  min-width: 0;
  display: grid;
  gap: 8px;
}
.template-home-slot-card-grid {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  align-items: start;
  gap: 8px;
}
.template-library-home.category-page .template-home-slot-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.template-home-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding-top: 2px;
}
.template-home-pager button {
  border: 1px solid #c8d5dc;
  border-radius: 6px;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 10px;
  cursor: pointer;
}
.template-home-pager button:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.template-home-pager span {
  color: var(--muted);
  font-size: 12px;
}
.template-home-card,
.template-home-empty {
  min-width: 0;
  min-height: 174px;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  position: relative;
}
.template-home-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  width: 24px;
  height: 24px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #64748b;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.template-home-delete:hover {
  border-color: #ef4444;
  color: #dc2626;
  background: #fff1f2;
}
.template-home-card:hover,
.template-home-card.active,
.template-home-empty:hover {
  border-color: #0f766e;
  background: #f0fdfa;
}
.template-home-card strong {
  display: block;
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-home-multi-outline {
  position: absolute;
  pointer-events: none;
}
.template-home-multi-outline-item {
  position: absolute;
  width: 62%;
  height: 62%;
  object-fit: contain;
  opacity: .6;
  mix-blend-mode: multiply;
  transform: translate(-50%, -50%);
}
.template-home-multi-outline-item.item-1 {
  left: 19%;
  top: 19%;
  z-index: 21;
}
.template-home-multi-outline-item.item-2 {
  left: 39.67%;
  top: 39.67%;
  z-index: 22;
}
.template-home-multi-outline-item.item-3 {
  left: 60.33%;
  top: 60.33%;
  z-index: 23;
}
.template-home-multi-outline-item.item-4 {
  left: 81%;
  top: 81%;
  z-index: 24;
}
.template-home-random-grid {
  position: absolute;
  inset: 8%;
  display: grid;
  grid-template-columns: repeat(var(--random-grid), minmax(0, 1fr));
  grid-template-rows: repeat(var(--random-grid), minmax(0, 1fr));
  gap: 2px;
  z-index: 10;
  pointer-events: none;
}
.template-home-random-grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: .72;
}
.template-home-random-grid .template-home-random-base {
  opacity: 1;
  object-fit: cover;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: 3;
}
.template-home-random-grid.has-banner {
  inset: 0;
  display: block;
}
.template-home-random-product {
  z-index: 10;
}
.template-home-random-grid.has-banner .template-home-random-product {
  position: absolute;
}
.template-home-random-banner {
  position: absolute;
  left: 0;
  width: 100%;
  height: 10%;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: 3;
  pointer-events: none;
}
.template-home-empty {
  color: var(--muted);
  font-size: 12px;
}
.template-home-preview {
  min-height: 0;
  display: grid;
  align-items: start;
  justify-items: stretch;
  overflow: hidden;
}
.template-home-preview-canvas {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  align-self: start;
  justify-self: stretch;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, .12) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, .12) 1px, transparent 1px),
    #fff;
  background-size: 18px 18px;
  overflow: hidden;
}
.template-home-preview-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
.template-home-preview-base.slot {
  object-fit: contain;
  background: #fff;
}
.template-home-blank-text {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 12px;
}
.template-home-slot-label {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #0f766e;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  padding: 3px 8px;
}
.template-home-slot-group-title {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  padding: 4px 2px 0;
}
.template-home-product-frame {
  position: absolute;
  border: 1px dashed #0f766e;
  background: rgba(20, 184, 166, .07);
  box-shadow: 0 0 0 1px rgba(15, 118, 110, .12);
  pointer-events: none;
}
.template-home-product-outline {
  position: absolute;
  object-fit: contain;
  opacity: .6;
  mix-blend-mode: multiply;
  pointer-events: none;
}
.template-outline-filter {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.template-home-empty {
  place-items: center;
  text-align: center;
  border-style: dashed;
}
.generator-workspace.generator-template-page-active .generator-records-main-section {
  display: none;
}
.generator-template-side {
  display: grid;
  gap: 12px;
}
.template-display-panel,
.template-edit-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.template-panel-head {
  display: grid;
  gap: 3px;
}
.template-panel-head strong {
  color: #0f172a;
  font-size: 14px;
}
.template-panel-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.template-category-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}
.template-category-tabs button {
  min-width: 74px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}
.template-category-tabs button.active {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #0f766e;
}
.template-category-tabs strong {
  font-size: 12px;
  white-space: nowrap;
}
.template-category-tabs span {
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
}
.template-category-tabs button.active span {
  background: #ccfbf1;
  color: #0f766e;
}
.template-display-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}
.template-column-empty {
  grid-column: 1 / -1;
  min-height: 72px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #94a3b8;
  display: grid;
  place-items: center;
  text-align: center;
  font-size: 12px;
  line-height: 1.45;
  padding: 10px;
}
.template-display-card {
  width: 100%;
  min-height: 86px;
  position: relative;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  text-align: left;
  cursor: pointer;
}
.template-display-card.has-base {
  grid-template-columns: minmax(0, 1fr) 54px;
}
.template-display-info {
  min-width: 0;
  display: grid;
  grid-template-rows: minmax(18px, auto) 18px auto;
  gap: 4px;
}
.template-display-card strong,
.template-display-card span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.template-display-card strong {
  color: #0f172a;
  font-size: 13px;
}
.template-display-card span {
  color: var(--muted);
  font-size: 12px;
}
.template-display-card em {
  justify-self: start;
  align-self: end;
  border-radius: 999px;
  background: #e2e8f0;
  color: #475569;
  padding: 3px 7px;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}
.template-display-base {
  width: 54px;
  height: 68px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  object-fit: cover;
}
.template-delete-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  width: 22px;
  height: 22px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff;
  color: #b42318;
  font-size: 15px;
  line-height: 18px;
  cursor: pointer;
}
.template-display-card.active {
  border-color: #0f766e;
  background: #f0fdfa;
}
.template-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.template-name-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.template-name-row.random {
  grid-template-columns: minmax(0, 1fr);
}
.template-upload-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.template-upload-row .btn {
  width: 100%;
}
.template-name-field input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 0 9px;
  font: inherit;
  font-weight: 400;
}
.template-type-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.template-type-options {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 0;
}
.template-type-options button {
  min-width: 58px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0 7px;
}
.template-type-options button.active {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #0f766e;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .14);
}

.template-custom-text-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px 92px;
  gap: 8px;
  align-items: center;
}
.template-custom-text-row label,
.template-color-field {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.template-color-field {
  position: relative;
}
.template-custom-text-row input,
.template-custom-text-row select {
  min-width: 0;
  width: 100%;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 0 8px;
  font: inherit;
  font-weight: 400;
}
.template-color-swatch {
  width: 42px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  cursor: pointer;
}
.template-color-swatch span,
.template-color-popover button span,
.template-color-more span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 6px;
  border: 1px solid rgba(15, 23, 42, .16);
  background: var(--template-picker-color, #111827);
}
.template-color-popover {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  z-index: 140;
  width: 174px;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .16);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.template-color-popover[hidden] {
  display: none;
}
.template-color-popover button {
  width: 34px;
  height: 30px;
  border: 1px solid #dbe4ea;
  border-radius: 7px;
  background: #fff;
  padding: 3px;
  cursor: pointer;
}
.template-color-popover button:hover {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .12);
}
.template-color-more {
  grid-column: span 4;
  width: auto !important;
  display: grid;
  grid-template-columns: 24px 1fr;
  align-items: center;
  gap: 7px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.template-color-more span {
  height: 20px;
  background: linear-gradient(90deg, #ef4444, #f59e0b, #22c55e, #06b6d4, #6366f1, #ec4899);
}
.template-color-more em {
  font-style: normal;
  text-align: left;
}
#templateCustomColorNative {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.template-preview-canvas,
.template-home-preview-canvas,
.single-white-template-canvas {
  container-type: inline-size;
}
.template-random-custom-text {
  position: absolute;
  left: var(--template-custom-x, 50%);
  top: var(--template-custom-y, 8%);
  z-index: 90;
  color: var(--template-custom-color, #111827);
  font-size: calc(var(--template-custom-size, 88) * 0.233px);
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(255,255,255,.9), 0 2px 5px rgba(15,23,42,.20);
  transform: translate(-50%, -50%) skewX(var(--template-custom-skew, 0deg));
  transform-origin: center center;
  pointer-events: none;
}
.template-random-custom-text > span {
  color: inherit !important;
  font-family: inherit !important;
  font-size: inherit !important;
  font-weight: inherit !important;
  line-height: inherit !important;
  letter-spacing: inherit !important;
  white-space: inherit !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
@supports (font-size: 1cqw) {
  .template-random-custom-text {
    font-size: calc(var(--template-custom-size, 88) / 1500 * 100cqw);
  }
}
.template-random-custom-text.editable {
  z-index: 100;
  cursor: move;
  pointer-events: auto;
  padding: 2px 8px;
  border: 1px dashed rgba(15, 118, 110, .55);
  border-radius: 6px;
  touch-action: none;
}
.template-random-custom-text.editable.dragging {
  background: rgba(240, 253, 250, .72);
}
.template-random-custom-text.editable i,
.template-random-custom-text.editable em {
  position: absolute;
  width: 13px;
  height: 13px;
  border: 2px solid #0f766e;
  border-radius: 999px;
  background: #fff;
}
.template-random-custom-text.editable i {
  right: -7px;
  bottom: -7px;
  cursor: nwse-resize;
}
.template-random-custom-text.editable em {
  right: -7px;
  top: -20px;
  cursor: ew-resize;
}
.template-random-custom-text.editable em::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 8px;
  background: rgba(15, 118, 110, .65);
}

.template-preview-title {
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.template-preview-workbench {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.template-preview-workbench.random {
  grid-template-columns: 104px minmax(0, 1fr);
}
.template-random-layout-picker {
  display: grid;
  gap: 8px;
}
.template-random-layout-picker button {
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px;
  cursor: pointer;
  text-align: left;
}
.template-random-layout-picker button.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .18);
}
.template-random-layout-picker strong {
  font-size: 15px;
  line-height: 1;
}
.template-random-layout-picker span {
  color: #64748b;
  font-size: 11px;
}
.template-product-picker {
  display: grid;
  gap: 8px;
}
.template-product-thumb {
  width: 72px;
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  display: grid;
  grid-template-rows: 46px auto;
  gap: 4px;
  cursor: pointer;
}
.template-product-thumb.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, .18);
}
.template-product-thumb.missing,
.template-product-thumb:disabled {
  cursor: not-allowed;
  opacity: .62;
}
.template-product-thumb img {
  width: 100%;
  height: 46px;
  object-fit: contain;
}
.template-product-thumb em {
  border-radius: 6px;
  background: #f1f5f9;
  color: #94a3b8;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-style: normal;
}
.template-product-thumb span {
  min-width: 0;
  color: #475569;
  font-size: 10px;
  line-height: 1.18;
  text-align: center;
  word-break: break-all;
}
.template-preview-canvas {
  position: relative;
  width: min(100%, 350px);
  aspect-ratio: 3 / 4;
  justify-self: center;
  border: 1px solid #94a3b8;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, .12) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, .12) 1px, transparent 1px),
    #fff;
  background-size: 30px 30px;
  color: #64748b;
  overflow: hidden;
  user-select: none;
}
.template-base-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.template-preview-canvas b {
  position: absolute;
  left: 10px;
  bottom: 8px;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}
.template-preview-canvas.random {
  background-size: 25px 25px;
}
.template-random-preview-grid {
  position: absolute;
  inset: 5.5%;
  display: grid;
  grid-template-columns: repeat(var(--random-grid), minmax(0, 1fr));
  grid-template-rows: repeat(var(--random-grid), minmax(0, 1fr));
  gap: clamp(2px, 1.2%, 8px);
  z-index: 10;
}
.template-random-preview-grid.has-banner {
  inset: 0;
  display: block;
  gap: 0;
}
.template-random-product-cell {
  z-index: 10;
}
.template-random-preview-grid.has-banner .template-random-product-cell {
  position: absolute;
}
.template-random-banner-image {
  position: absolute;
  left: 0;
  width: 100%;
  height: 10%;
  object-fit: contain;
  object-position: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  z-index: 3;
  cursor: move;
  touch-action: none;
}
.template-random-banner-image.dragging {
  opacity: .86;
}
.template-preview-canvas.random .template-random-preview-grid.has-banner {
  pointer-events: none;
}
.template-preview-canvas.random .template-random-banner-image[data-random-banner-overlay] {
  pointer-events: auto;
}
.template-random-preview-grid img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(15, 23, 42, .16));
}
.template-random-preview-grid .template-random-base-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: transparent;
  border: 0;
  border-radius: 0;
  cursor: move;
  touch-action: none;
  z-index: 3;
  box-shadow: none;
  filter: none;
}
.template-random-preview-grid .template-random-base-image.dragging {
  opacity: .86;
  box-shadow: none;
}
.template-product-box {
  position: absolute;
  min-width: 10px;
  min-height: 10px;
  border: 1px dashed #0f766e;
  background: rgba(20, 184, 166, .08);
  display: grid;
  place-items: center;
  cursor: move;
  touch-action: none;
  box-shadow: 0 0 0 1px rgba(15, 118, 110, .14);
}
.template-product-box.dragging {
  border-style: solid;
  background: rgba(20, 184, 166, .14);
}
.template-product-box span {
  border-radius: 999px;
  background: #fff;
  color: #0f766e;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
  white-space: nowrap;
}
.template-preview-product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  display: block;
}
.template-box-resize {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 13px;
  height: 13px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #0f766e;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .22);
  cursor: nwse-resize;
}
.template-type-field {
  margin-top: -2px;
}
.template-param-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.template-param-field {
  display: grid;
  gap: 5px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.template-param-field input,
.template-param-field select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  padding: 0 9px;
  font: inherit;
  font-weight: 400;
}
.template-save-btn {
  width: 100%;
  justify-content: center;
}
.generator-tool-icon svg {
  width: 24px;
  height: 24px;
  overflow: visible;
}
.generator-tool-icon .icon-fill,
.generator-tool-icon .icon-shadow,
.generator-tool-icon .icon-soft,
.generator-tool-icon .icon-stroke,
.generator-tool-icon .icon-stroke-secondary {
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.generator-tool-icon .icon-shadow {
  fill: var(--tool-fill-2);
  opacity: .78;
  stroke: none;
  transform: translate(1px, 1px);
}
.generator-tool-icon .icon-fill {
  fill: var(--tool-fill);
  stroke: var(--tool-accent);
  stroke-width: 1.45;
}
.generator-tool-icon .icon-soft {
  fill: none;
  stroke: #d8eee8;
  stroke-width: 3.6;
  opacity: .92;
}
.generator-tool-icon .icon-soft-fill {
  fill: var(--tool-fill-2);
  stroke: var(--tool-accent);
  stroke-width: 1.1;
  stroke-linejoin: round;
}
.generator-tool-icon .icon-stroke {
  fill: none;
  stroke: var(--tool-accent);
  stroke-width: 1.55;
}
.generator-tool-icon .icon-stroke-secondary {
  fill: none;
  stroke: var(--tool-accent-2);
  stroke-width: 1.55;
}
.generator-tool-icon .icon-dot,
.generator-tool-icon .icon-dot-card {
  fill: var(--tool-accent);
}
.generator-tool-icon .icon-dot-secondary {
  fill: var(--tool-accent-2);
}
.generator-tool-icon .icon-white {
  fill: #fff;
  stroke: var(--tool-accent);
  stroke-width: .8;
  stroke-linejoin: round;
}
.generator-tool-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
}
.template-manage-preview-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, .12) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, .12) 1px, transparent 1px),
    #fff;
  background-size: 20px 20px;
  overflow: hidden;
  display: grid;
  place-items: center;
}
.template-manage-preview-canvas img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.template-manage-preview-canvas.slot img {
  object-fit: contain;
}
.template-manage-preview-canvas span {
  color: #94a3b8;
  font-size: 13px;
}
.template-manage-preview-canvas em {
  position: absolute;
  right: 10px;
  bottom: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  color: #0f766e;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 4px 9px;
}
.template-manage-note {
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}
.generator-tool-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #64748b;
  font-size: 11px;
  font-style: normal;
}
.generator-tool-card.pending-tool em {
  color: #b45309;
}
.generator-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.generator-kpi-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  display: grid;
  gap: 3px;
}
.generator-kpi-grid strong {
  font-size: 22px;
  color: #0f172a;
}
.generator-kpi-grid span {
  color: var(--muted);
  font-size: 12px;
}
.generator-resource-list,
.generator-update-list {
  display: grid;
  gap: 8px;
}
.generator-resource-row,
.generator-update-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  display: grid;
  gap: 5px;
  text-align: left;
}
.generator-resource-row strong,
.generator-update-row strong,
.generator-resource-row span,
.generator-update-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.generator-resource-row span,
.generator-update-row span {
  color: var(--muted);
  font-size: 12px;
}
.generator-update-row {
  border-color: #fed7aa;
  background: #fff7ed;
  cursor: pointer;
}
.generator-update-row:hover {
  border-color: #fb923c;
}
.generator-flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.generator-flow span {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 8px;
  background: #f8fafc;
  color: #334155;
  text-align: center;
  font-size: 12px;
  white-space: nowrap;
}
.generator-home-empty {
  min-height: 82px;
  display: grid;
  place-items: center;
}
.generator-home-empty.compact {
  min-height: 46px;
}
.generator-placeholder-grid,
.detail-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.generator-placeholder-grid > div,
.detail-template-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  display: grid;
  gap: 6px;
  text-align: left;
}
.detail-template-card {
  cursor: pointer;
}
.detail-template-card.active,
.detail-template-card:hover {
  border-color: var(--teal);
  background: #f0fdfa;
}
.generator-placeholder-grid span,
.detail-template-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.generator-output.hidden {
  display: none;
}
.generator-tool-panel .generator-demand-grid {
  grid-template-columns: 260px minmax(0, 1fr);
}
.generator-tool-panel .generator-source-preview {
  min-height: 320px;
}
.generator-tool-panel .generator-source-preview img {
  max-height: 320px;
}
@media (max-width: 1180px) {
  .generator-tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .generator-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .generator-home-template-columns,
  .template-category-switch-grid,
  .template-home-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .generator-tool-grid,
  .generator-placeholder-grid,
  .detail-template-grid,
  .generator-flow,
  .generator-home-template-columns,
  .generator-tool-panel .generator-demand-grid { grid-template-columns: 1fr; }
  .generator-home-template-list,
  .template-category-switch-grid,
  .template-home-row,
  .template-home-card-list,
  .template-home-slot-card-grid,
  .template-display-list { grid-template-columns: 1fr; }
}


/* Operator image workbench layout overrides */
.generator-workspace {
  grid-template-columns: minmax(0, 1fr) var(--right-panel-width);
}
.generator-main-panel,
.generator-side-panel {
  min-width: 0;
}
.generator-records-main-section {
  margin-top: 0;
}
.generator-records-main-section .generator-record-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.generator-workspace.generator-records-page-active {
  grid-template-columns: minmax(0, 1fr) var(--right-panel-width);
}
.generator-workspace.generator-records-page-active .generator-dashboard {
  display: none;
}
.generator-workspace.generator-records-page-active .generator-records-main-section {
  border: 0;
  background: transparent;
  padding: 0;
}
.generator-workspace.generator-records-page-active .generator-records-main-section > .generator-section-head {
  display: none;
}
.generator-records-main-section.generator-records-standalone .generator-record-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.generator-record-list-paged .generator-record-pagination {
  grid-column: 1 / -1;
}
.generator-record-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.generator-record-pagination div {
  display: flex;
  gap: 8px;
}
.generator-record-detail {
  display: grid;
  gap: 12px;
}
.generator-record-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.generator-record-detail-meta > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 10px;
  display: grid;
  gap: 3px;
}
.generator-record-detail-meta strong {
  font-size: 12px;
  color: var(--muted);
}
.generator-record-detail-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #0f172a;
  font-size: 13px;
}
.generator-record-thumbs-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.generator-record-thumb-scroll {
  flex: 0 0 22px;
  width: 22px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}
.generator-record-thumb-scroll:hover:not(:disabled) {
  border-color: var(--teal);
  color: var(--teal);
}
.generator-record-thumb-scroll:disabled {
  opacity: .32;
  cursor: default;
}
.generator-record-thumbs {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
  scroll-behavior: auto;
}
.generator-record-thumbs button {
  flex: 0 0 calc((100% - 24px) / 5);
  min-width: 54px;
  scroll-snap-align: none;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 3px;
  display: grid;
  place-items: center;
  cursor: pointer;
  overflow: hidden;
}
.generator-record-thumbs button.active {
  border-color: var(--teal);
  box-shadow: 0 0 0 2px rgba(13, 148, 136, .16);
}
.generator-record-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.generator-record-main-preview {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.generator-record-main-preview img {
  max-width: 100%;
  max-height: 520px;
  object-fit: contain;
  display: block;
}
.generator-record-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#generatorResultActions a.btn {
  text-decoration: none;
}
#generatorResultActions .record-package-download {
  display: inline-grid;
  place-items: center;
  text-align: center;
  background: #16a34a;
  border-color: #16a34a;
  color: #fff;
}
#generatorResultActions .record-package-download:hover {
  background: #15803d;
  border-color: #15803d;
}
.generated-meta.compact {
  margin-top: 0;
  font-size: 12px;
}
.generator-side-body {
  display: grid;
  align-content: start;
  gap: 12px;
}
.generator-side-empty {
  min-height: 360px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: #334155;
  padding: 20px;
}
.generator-side-empty span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.generator-side-empty.hidden {
  display: none;
}
.generator-side-panel .generator-output {
  border-top: 0;
  padding-top: 0;
}
.generator-side-panel .generator-output-head {
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.generator-side-workbench {
  display: grid;
  gap: 12px;
}
.generator-side-workbench .generator-source-preview {
  min-height: 300px;
}
.generator-side-workbench .generator-source-preview img {
  max-height: 300px;
}
.generator-side-workbench .generator-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.generator-result-block {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.generator-side-panel .generated-preview {
  min-height: 300px;
}
.generator-side-panel .generated-preview img {
  max-height: 440px;
}
.generator-side-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
  display: grid;
  gap: 8px;
}
.generator-side-block span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.workbench-task-list {
  display: grid;
  gap: 10px;
}
.workbench-task-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  display: grid;
  gap: 8px;
  cursor: default;
}
.workbench-task-item strong {
  color: #0f172a;
  font-size: 14px;
  line-height: 1.4;
}
.workbench-task-item span,
.workbench-task-item p,
.workbench-task-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}
.workbench-task-item p {
  margin: 0;
  padding-top: 2px;
}
.workbench-task-top,
.workbench-task-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.workbench-task-type,
.workbench-task-role,
.workbench-task-foot em {
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
}
.workbench-task-type {
  background: #f1f5f9;
  color: #475569;
}
.workbench-task-role.designer {
  background: #ecfeff;
  color: #0e7490;
}
.workbench-task-role.operator {
  background: #fef3c7;
  color: #92400e;
}
.workbench-task-foot em.pending {
  background: #fee2e2;
  color: #b91c1c;
}
.workbench-task-foot em.doing {
  background: #dbeafe;
  color: #1d4ed8;
}
.workbench-task-foot em.review {
  background: #fef3c7;
  color: #92400e;
}
.workbench-task-foot em.done {
  background: #dcfce7;
  color: #15803d;
}
.generator-placeholder-grid.side,
.detail-template-grid.side {
  grid-template-columns: 1fr;
}
.generator-records-main-section .record-thumb {
  width: 64px;
}
.generator-records-main-section .generator-record-item {
  grid-template-columns: 64px minmax(0, 1fr);
}
@media (max-width: 1180px) {
  .generator-workspace,
  .generator-workspace.generator-records-page-active { grid-template-columns: 1fr; }
  .generator-records-main-section .generator-record-list,
  .generator-records-main-section.generator-records-standalone .generator-record-list { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .generator-workspace { grid-template-columns: 1fr; }
  .generator-side-workbench .generator-fields { grid-template-columns: 1fr; }
}



/* Brand-level resource overview */
.generator-brand-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 10px;
}
.generator-brand-card {
  --brand-accent: #0f766e;
  --brand-accent-2: #14b8a6;
  --brand-bg: #f0fdfa;
  --brand-border: #ccfbf1;
  --brand-glow: rgba(15, 118, 110, .12);
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(145deg, #fff 0%, #f8fafc 100%);
  padding: 13px 14px 12px;
  display: grid;
  align-content: start;
  gap: 9px;
  text-align: left;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.generator-brand-card[data-resource-brand="ELEWEAR"] {
  --brand-accent: #064e3b;
  --brand-accent-2: #0f766e;
  --brand-bg: #ecfdf5;
  --brand-border: #a7f3d0;
  --brand-glow: rgba(6, 78, 59, .16);
}
.generator-brand-card[data-resource-brand="LIVOBO"] {
  --brand-accent: #e45f12;
  --brand-accent-2: #f59e0b;
  --brand-bg: #fff7ed;
  --brand-border: #fed7aa;
  --brand-glow: rgba(228, 95, 18, .16);
}
.generator-brand-card[data-resource-brand="MUSWEAR"] {
  --brand-accent: #1d4ed8;
  --brand-accent-2: #2563eb;
  --brand-bg: #eff6ff;
  --brand-border: #bfdbfe;
  --brand-glow: rgba(29, 78, 216, .15);
}
.generator-brand-card[data-resource-brand="TKKEO"] {
  --brand-accent: #1f2937;
  --brand-accent-2: #64748b;
  --brand-bg: #f8fafc;
  --brand-border: #cbd5e1;
  --brand-glow: rgba(31, 41, 55, .13);
}
.generator-brand-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--brand-accent), var(--brand-accent-2));
  opacity: .82;
}
.generator-brand-card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -30px;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: var(--brand-bg);
  opacity: .8;
}
.generator-brand-card:hover,
.generator-brand-card.active {
  border-color: var(--brand-accent);
  background: linear-gradient(145deg, #fff 0%, var(--brand-bg) 100%);
  box-shadow: 0 9px 24px var(--brand-glow);
}
.generator-brand-card-head {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.generator-brand-card strong {
  min-width: 0;
  color: #0f172a;
  font-size: 16px;
  line-height: 1.2;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.generator-brand-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 10px;
  color: #475569;
  font-size: 12px;
  line-height: 1.25;
  position: relative;
  z-index: 1;
}
.generator-brand-stats span {
  white-space: nowrap;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  padding: 4px 8px;
}
.generator-brand-card b {
  color: #0f172a;
  font-size: 14px;
}
.generator-brand-alert {
  flex: 0 0 auto;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff1f2;
  color: #dc2626;
  font-size: 11px;
  line-height: 1.2;
  padding: 3px 7px;
  position: relative;
  z-index: 1;
  white-space: nowrap;
}
.generator-brand-alert b,
.danger-text {
  color: #dc2626;
  font-size: 12px;
}
.generator-brand-model-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.generator-model-card {
  margin: 0;
}
.generator-side-panel .generator-brand-model-grid .product-model-block.has-front-thumb {
  grid-template-columns: minmax(0, 1fr) 60px;
}
.generator-completed-color {
  appearance: none;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.25;
  cursor: pointer;
}
.generator-model-card.is-clickable {
  cursor: pointer;
}
.generator-model-card.is-clickable:hover {
  border-color: #14b8a6;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, .12) inset;
}
.generator-model-card .color-pill.transparent-incomplete {
  cursor: not-allowed;
  opacity: .86;
}
.generator-completed-color:hover {
  border-color: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .16) inset;
}
.transparent-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 10px;
}
.transparent-preview-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  overflow: hidden;
}
.transparent-preview-item img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  display: block;
  background: #fff;
}
.transparent-preview-item span {
  display: block;
  padding: 7px 8px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: #475569;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transparent-review-workbench {
  display: grid;
  grid-template-columns: 92px max-content 280px;
  gap: 12px;
  min-height: 560px;
  align-items: stretch;
  justify-content: center;
}
.transparent-review-thumbs {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: 620px;
  overflow-y: auto;
  padding-right: 4px;
}
.transparent-review-thumb {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 5px;
  display: grid;
  gap: 4px;
}
.transparent-review-thumb.active {
  border-color: #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .14);
}
.transparent-review-thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 6px;
}
.transparent-review-thumb span {
  color: #475569;
  font-size: 12px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.transparent-review-preview {
  min-width: 0;
  width: fit-content;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
}
.transparent-review-preview-frame {
  max-width: 100%;
  max-height: 620px;
  background: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  display: block;
  position: relative;
  overflow: hidden;
}
.transparent-review-preview-frame img {
  position: absolute;
  display: block;
  object-fit: contain;
}
.transparent-review-color-switcher {
  display: grid;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f1f5f9;
}
.transparent-review-color-switcher > strong {
  color: #64748b;
  font-size: 12px;
}
.transparent-review-color-switcher > div {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.transparent-review-color-switcher button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  padding: 4px 9px;
  font-size: 12px;
}
.transparent-review-color-switcher button.active {
  border-color: #0f766e;
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 700;
}
.transparent-review-info {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  align-content: start;
  gap: 12px;
}
.transparent-review-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.transparent-review-meta div {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  display: grid;
  gap: 3px;
}
.transparent-review-meta div.full {
  grid-column: 1 / -1;
}
.transparent-review-actions {
  display: grid;
  gap: 8px;
}
.transparent-review-meta strong {
  color: #64748b;
  font-size: 12px;
}
.transparent-review-meta span {
  color: #0f172a;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.transparent-review-request {
  display: grid;
  gap: 8px;
}
.transparent-review-request label {
  color: #475569;
  font-size: 13px;
}
.transparent-review-request textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  line-height: 1.5;
}
@media (max-width: 980px) {
  .transparent-review-workbench { grid-template-columns: 78px minmax(0, 1fr); }
  .transparent-review-info { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .transparent-review-workbench { grid-template-columns: 1fr; }
  .transparent-review-thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); max-height: none; overflow: visible; }
}


/* Single pack maker */
.single-white-search-input {
  width: 190px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  outline: none;
  background: #fff;
}
.single-white-maker {
  display: grid;
  gap: 12px;
}
.single-white-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  min-width: 0;
}
.single-white-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.single-white-block-head strong {
  font-size: 14px;
}
.single-white-block-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
}


.single-white-multi-toggle.active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
  font-weight: 700;
}
.single-white-result-grid.multi-select .single-white-result-card {
  cursor: pointer;
}
.single-white-result-card.selected {
  border-color: #14b8a6;
  background: #f0fdfa;
}
.single-white-result-card.all-selected {
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, .14);
}
.single-white-color-list .color-pill.selected {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #0f766e;
  font-weight: 700;
}

.single-white-brand-tabs {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow-x: auto;
  padding-bottom: 1px;
}
.single-white-brand-tabs button {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  padding: 0 10px;
  white-space: nowrap;
  font-size: 12px;
}
.single-white-brand-tabs button.active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #0f766e;
  font-weight: 700;
}

.single-white-results-block {
  padding: 8px;
}
.single-white-results-scroll {
  max-height: 540px;
  overflow-y: auto;
  padding-right: 4px;
}
.single-white-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.single-white-result-card {
  min-height: 82px;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px;
  display: grid;
  align-content: start;
  gap: 8px;
}
.single-white-result-card.active {
  border-color: #0f766e;
  background: #f0fdfa;
}
.single-white-result-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.single-white-result-title strong,
.single-white-result-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.single-white-result-title span {
  color: var(--muted);
  font-size: 12px;
}
.single-white-color-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.single-white-color-list .color-pill.active {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #0f766e;
}
.single-white-angle-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.single-white-angle-thumb {
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 6px;
  display: grid;
  gap: 5px;
  cursor: default;
}
.single-white-angle-thumb img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
}
.single-white-angle-thumb span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #334155;
  font-size: 12px;
  text-align: center;
}
.single-white-template-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}
.single-white-preview-frame {
  height: 360px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.single-white-preview-frame img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
}
.single-white-generated-note {
  margin-top: 8px;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #166534;
  font-size: 13px;
}
.single-white-generated-note.stale {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}
.single-white-footer {
  display: flex;
  justify-content: flex-end;
}
.single-white-empty {
  min-height: 78px;
}
@media (max-width: 980px) {
  .single-white-result-grid { grid-template-columns: 1fr; }
  .single-white-search-input { width: 100%; }
}


/* Single pack main workspace */
.generator-workspace.single-white-active .generator-records-main-section {
  display: none;
}
.single-white-add-row {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.single-white-main-workspace {
  display: grid;
  gap: 12px;
}
.single-white-main-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  min-width: 0;
}
.single-white-material-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.single-white-material-card {
  min-width: 0;
  position: relative;
  cursor: pointer;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  text-align: left;
}
.single-white-material-card.draggable {
  cursor: grab;
}
.single-white-material-card.draggable:active,
.single-white-material-card.dragging {
  cursor: grabbing;
}
.single-white-material-card.dragging {
  opacity: .55;
}
.single-white-material-card.drag-over {
  border-color: #0f766e;
  box-shadow: inset 0 0 0 2px rgba(15, 118, 110, .20);
}
.single-white-material-card.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .10);
}
.single-white-material-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  background: #fff;
  color: #b42318;
  line-height: 18px;
  opacity: 0;
  pointer-events: auto;
  transition: opacity .12s ease;
}
.single-white-material-card:hover .single-white-material-remove {
  opacity: 1;
}
.single-white-material-card img {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: #fff;
  object-fit: contain;
}
.single-white-material-card span {
  min-width: 0;
  display: grid;
  gap: 3px;
  color: #334155;
  font-size: 12px;
}
.single-white-material-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}
.single-white-material-card strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: #0f172a;
}
.single-white-compose-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}
.single-white-compose-controls {
  display: grid;
  gap: 12px;
  align-content: start;
}
.single-white-template-panel {
  display: grid;
  gap: 8px;
}
.single-white-template-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.single-white-template-panel > label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.single-white-aspect-panel {
  display: grid;
  gap: 8px;
}
.single-white-aspect-panel > label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.single-white-aspect-panel > span {
  color: #64748b;
  font-size: 12px;
}
.single-white-aspect-options {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.single-white-template-panel-head label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.single-white-upload-preview {
  display: grid;
  gap: 5px;
}
.single-white-upload-preview input {
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 0 9px;
  font: inherit;
  font-size: 13px;
}
.single-white-upload-preview span {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}
.random-pack-upload-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.random-pack-resource-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 8px;
}
.random-pack-resource-row label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.random-pack-tool-settings,
.random-pack-size-panel {
  display: grid;
  gap: 8px;
}
.random-pack-tool-settings .template-random-layout-picker {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.random-pack-resource-picker {
  display: grid;
  gap: 12px;
}
.random-pack-resource-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.random-pack-resource-filter button {
  border: 1px solid #cbd5e1;
  background: #fff;
  border-radius: 7px;
  padding: 6px 10px;
  cursor: pointer;
}
.random-pack-resource-filter button.active {
  border-color: #0f766e;
  color: #0f766e;
  background: #ecfdf5;
  font-weight: 700;
}
.random-pack-resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 4px;
}
.random-pack-resource-card {
  min-width: 0;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: pointer;
}
.random-pack-resource-card:hover {
  border-color: #0f766e;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}
.random-pack-resource-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: #f8fafc;
  border-radius: 6px;
}
.random-pack-resource-card strong {
  min-width: 0;
  color: #0f172a;
  font-size: 13px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.random-pack-resource-card span {
  color: #64748b;
  font-size: 12px;
}
.single-white-template-choice-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-height: 132px;
  overflow-y: auto;
  padding-right: 4px;
}
.single-white-template-choice {
  min-width: 0;
  min-height: 62px;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  background: #fff;
  padding: 8px 6px;
  display: grid;
  align-content: center;
  gap: 4px;
  text-align: center;
  cursor: pointer;
}
.single-white-template-choice:hover,
.single-white-template-choice.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .10);
}
.single-white-template-choice strong,
.single-white-template-choice span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.single-white-template-choice strong {
  color: #0f172a;
  font-size: 13px;
}
.single-white-template-choice span {
  color: #64748b;
  font-size: 11px;
}
.random-pack-template-choice-list {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 122px;
  max-height: 390px;
  gap: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-gutter: stable;
  align-items: start;
  box-sizing: border-box;
}
.random-template-preview-choice {
  min-width: 0;
  width: 100%;
  height: 122px;
  min-height: 122px;
  max-height: 122px;
  padding: 6px;
  align-content: start;
  grid-template-rows: 16px minmax(0, 1fr);
  gap: 5px;
  text-align: left;
  overflow: hidden;
  box-sizing: border-box;
}
.random-template-preview-choice strong {
  width: 100%;
  min-width: 0;
  height: 16px;
  font-size: 12px;
  line-height: 16px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.random-template-choice-preview {
  width: 100%;
  min-width: 0;
  height: 89px;
  min-height: 0;
  aspect-ratio: auto;
  border: 1px solid #dbe4ea;
  border-radius: 7px;
  overflow: hidden;
  background: #fff;
  display: grid;
  place-items: center;
  box-sizing: border-box;
}
.random-template-choice-preview > .random-template-choice-canvas {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 3 / 4;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: #fff;
  background-size: auto;
  overflow: hidden;
}
.random-template-choice-canvas.random-pack-template-canvas {
  background: #fff;
  background-size: auto;
  overflow: hidden;
}
.random-template-choice-stage {
  z-index: 10;
}
.random-template-choice-stage.has-banner {
  inset: 0;
  display: block;
}
.random-template-choice-canvas .template-random-banner-image,
.random-template-choice-canvas .template-random-base-image {
  pointer-events: none;
  cursor: default;
}
.random-pack-custom-text-panel {
  display: grid;
  gap: 8px;
}
.random-pack-custom-text-panel > label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.random-pack-custom-text-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.random-pack-custom-text-row input {
  height: 36px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  padding: 0 10px;
  font: inherit;
  font-size: 13px;
}
.random-pack-custom-text-row span {
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
}
.multi-pack-layout-panel {
  display: grid;
  gap: 8px;
}
.multi-pack-layout-panel > label {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.multi-pack-layout-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.multi-pack-sort-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.multi-pack-layout-choice {
  min-width: 0;
  min-height: 96px;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  text-align: center;
  cursor: pointer;
}
.multi-pack-layout-choice:hover,
.multi-pack-layout-choice.active {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .10);
}
.multi-pack-layout-choice strong,
.multi-pack-layout-choice > span {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-pack-layout-choice strong {
  color: #0f172a;
  font-size: 13px;
}
.multi-pack-layout-choice > span {
  color: #64748b;
  font-size: 11px;
}
.multi-pack-layout-icon {
  width: 54px;
  height: 30px;
  position: relative;
  display: block;
}
.multi-pack-layout-icon span {
  position: absolute;
  width: 15px;
  height: 22px;
  border: 1px solid #0f766e;
  border-radius: 5px;
  background: #ccfbf1;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}
.layout-side-by-side span:nth-child(1) { left: 0; top: 4px; }
.layout-side-by-side span:nth-child(2) { left: 13px; top: 4px; }
.layout-side-by-side span:nth-child(3) { left: 26px; top: 4px; }
.layout-side-by-side span:nth-child(4) { left: 39px; top: 4px; }
.layout-staggered span:nth-child(1) { left: 5px; top: 7px; }
.layout-staggered span:nth-child(2) { left: 18px; top: 2px; }
.layout-staggered span:nth-child(3) { left: 31px; top: 7px; }
.layout-staggered span:nth-child(4) { left: 24px; top: 12px; }
.layout-hero span:nth-child(1) { left: 19px; top: 0; width: 18px; height: 28px; }
.layout-hero span:nth-child(2) { left: 5px; top: 8px; }
.layout-hero span:nth-child(3) { left: 36px; top: 8px; }
.layout-hero span:nth-child(4) { left: 25px; top: 10px; }
.layout-fan span:nth-child(1) { left: 7px; top: 7px; transform: rotate(-16deg); }
.layout-fan span:nth-child(2) { left: 19px; top: 3px; transform: rotate(-5deg); }
.layout-fan span:nth-child(3) { left: 31px; top: 5px; transform: rotate(10deg); }
.layout-fan span:nth-child(4) { left: 24px; top: 9px; transform: rotate(20deg); }
.layout-grid span:nth-child(1) { left: 11px; top: 1px; width: 13px; height: 13px; }
.layout-grid span:nth-child(2) { left: 29px; top: 1px; width: 13px; height: 13px; }
.layout-grid span:nth-child(3) { left: 11px; top: 16px; width: 13px; height: 13px; }
.layout-grid span:nth-child(4) { left: 29px; top: 16px; width: 13px; height: 13px; }
.layout-diagonal span:nth-child(1) { left: 5px; top: 0; }
.layout-diagonal span:nth-child(2) { left: 17px; top: 5px; }
.layout-diagonal span:nth-child(3) { left: 29px; top: 10px; }
.layout-diagonal span:nth-child(4) { left: 38px; top: 7px; }
.multi-pack-sort-choice .multi-pack-layout-icon {
  width: 54px;
  height: 32px;
}
.multi-pack-sort-choice .multi-pack-layout-icon span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border-color: #0f766e;
  background: #0f766e;
  box-shadow: none;
}
.multi-pack-sort-choice .multi-pack-layout-icon::before,
.multi-pack-sort-choice .multi-pack-layout-icon::after {
  content: "";
  position: absolute;
  height: 2px;
  border-radius: 999px;
  background: rgba(15, 118, 110, .48);
  transform-origin: left center;
}
.sort-random::before { left: 11px; top: 10px; width: 32px; transform: rotate(22deg); }
.sort-random::after { left: 11px; top: 23px; width: 32px; transform: rotate(-22deg); }
.sort-random span:nth-child(1) { left: 6px; top: 4px; }
.sort-random span:nth-child(2) { left: 39px; top: 3px; }
.sort-random span:nth-child(3) { left: 8px; top: 21px; }
.sort-random span:nth-child(4) { left: 38px; top: 20px; }
.sort-manual-sync::before { left: 8px; top: 16px; width: 38px; }
.sort-manual-sync span:nth-child(1) { left: 5px; top: 12px; }
.sort-manual-sync span:nth-child(2) { left: 18px; top: 12px; }
.sort-manual-sync span:nth-child(3) { left: 31px; top: 12px; }
.sort-manual-sync span:nth-child(4) { left: 44px; top: 12px; }
.sort-manual-angle::before { left: 9px; top: 9px; width: 34px; }
.sort-manual-angle::after { left: 9px; top: 23px; width: 34px; }
.sort-manual-angle span:nth-child(1) { left: 5px; top: 5px; }
.sort-manual-angle span:nth-child(2) { left: 41px; top: 5px; }
.sort-manual-angle span:nth-child(3) { left: 23px; top: 19px; }
.sort-manual-angle span:nth-child(4) { left: 41px; top: 19px; }
.single-white-generate-result {
  border: 1px solid #b7eadf;
  border-radius: 8px;
  background: #f0fdfa;
  color: #0f766e;
  padding: 10px;
  display: grid;
  gap: 8px;
}
.single-white-generate-result.generating {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}
.single-white-generate-result.generating strong {
  color: #1d4ed8;
}
.single-white-generate-result strong {
  color: #0f766e;
  font-size: 13px;
}
.single-white-generate-result span {
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}
.single-white-generate-result div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.single-white-preview-head {
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.single-white-edit-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.single-white-main-angle-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}
.single-white-main-angle-tabs button {
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  padding: 0 9px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.single-white-main-angle-tabs button.active {
  border-color: #0f766e;
  background: #ccfbf1;
  color: #0f766e;
  font-weight: 700;
}
.single-white-rotate-inline {
  min-width: 220px;
  display: grid;
  grid-template-columns: auto minmax(100px, 1fr) 34px;
  align-items: center;
  gap: 8px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.single-white-rotate-inline input {
  width: 100%;
}
.single-white-rotate-inline span {
  color: #0f766e;
  text-align: right;
}
.single-white-main-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  overflow: visible;
}
.multi-pack-main-preview {
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.single-white-main-preview img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #fff;
}

.single-white-template-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}
.single-white-edit-canvas {
  background:
    linear-gradient(90deg, rgba(148, 163, 184, .10) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, .10) 1px, transparent 1px),
    #fff;
  background-size: 30px 30px;
}
.single-white-template-base {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
.single-white-template-product {
  position: absolute;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.single-white-edit-product {
  cursor: move;
  border: 1px dashed #0f766e;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, .10);
  transform-origin: center center;
  touch-action: none;
}
.single-white-edit-product.dragging {
  border-style: solid;
  background: rgba(240, 253, 250, .22);
}
.single-white-edit-product i {
  position: absolute;
  right: -7px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  border: 2px solid #0f766e;
  border-radius: 999px;
  background: #fff;
  cursor: nwse-resize;
  z-index: 3;
}
.single-white-template-product img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.single-white-editor-panel {
  display: grid;
  gap: 10px;
  border: 1px solid #dbe4ea;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}
.single-white-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.single-white-editor-head strong {
  color: #0f172a;
  font-size: 14px;
}
.single-white-editor-mode,
.single-white-editor-hint {
  color: #64748b;
  font-size: 12px;
  line-height: 1.4;
}
.single-white-range-field {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.single-white-range-field input {
  width: 100%;
}
.single-white-number-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.single-white-number-grid label {
  display: grid;
  gap: 4px;
  color: #334155;
  font-size: 12px;
  font-weight: 700;
}
.single-white-number-grid input {
  min-width: 0;
  height: 34px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  padding: 0 8px;
  font: inherit;
  font-size: 13px;
}
.multi-pack-editor-panel .single-white-number-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.multi-pack-main-preview,
.multi-pack-template-product {
  position: relative;
  display: block;
  overflow: hidden;
  background: #fff;
}
.multi-pack-template-product {
  background: transparent;
}
.multi-pack-preview-stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.multi-pack-preview-item {
  position: absolute;
  display: grid;
  place-items: center;
  transform-origin: center center;
}
.multi-pack-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border: 0;
  border-radius: 0;
  background: transparent;
  filter: drop-shadow(0 8px 10px rgba(15, 23, 42, .14));
}
.multi-pack-main-preview .single-white-main-empty,
.multi-pack-template-product .single-white-main-empty {
  position: absolute;
  inset: 0;
  min-height: 0;
  display: grid;
  place-items: center;
}
.random-pack-template-canvas {
  background:
    linear-gradient(90deg, rgba(148, 163, 184, .12) 1px, transparent 1px),
    linear-gradient(rgba(148, 163, 184, .12) 1px, transparent 1px),
    #fff;
  background-size: 25px 25px;
}
.random-pack-preview-stage { z-index: 10; }
.random-pack-preview-stage .template-random-base-image[data-random-base-overlay] {
  z-index: 30;
  pointer-events: auto;
}
.random-pack-preview-stage .template-random-base-image[data-random-base-overlay].dragging {
  opacity: .86;
}
.random-pack-preview-stage.has-banner {
  inset: 0;
  display: block;
}
.random-pack-product-cell {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  z-index: 10;
}
.random-pack-preview-stage.has-banner .random-pack-product-cell { position: absolute; }
.random-pack-product-cell img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border: 0;
  background: transparent;
  transform: scale(var(--random-product-scale, 1));
  transform-origin: center center;
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, .14));
}
.random-pack-product-cell.empty-slot {
  border: 1px dashed rgba(148, 163, 184, .5);
  background: rgba(248, 250, 252, .7);
}
.random-pack-banner {
  pointer-events: none;
  cursor: default;
}
.random-pack-banner[data-random-banner-overlay] {
  pointer-events: auto;
  cursor: move;
  z-index: 30;
}
.random-pack-note {
  margin-top: 10px;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
}
.single-white-main-empty {
  min-height: 110px;
}
@media (max-width: 1180px) {
  .single-white-compose-grid { grid-template-columns: 1fr; }
}


.nav-group { display: grid; gap: 4px; }
.nav-sub-list {
  display: grid;
  gap: 3px;
  padding: 2px 0 6px 14px;
}
.nav-sub-list button {
  height: 32px;
  background: #1f2a39;
  color: #cbd5e1;
  font-size: 13px;
}
.nav-list button.active,
.nav-sub-list button.active {
  background: #0f766e;
  color: #fff;
}

.home-main-panel,
.management-main-panel {
  padding: 14px;
  display: grid;
  gap: 14px;
  align-content: start;
}
.home-section,
.management-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.home-section-head,
.management-section-head {
  min-height: 50px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.home-section-head h2,
.management-section-head h2 {
  margin: 0;
  font-size: 16px;
}
.home-summary-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.home-summary-card {
  min-height: 108px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  align-content: space-between;
  background: #f8fafc;
}
.home-summary-card span,
.home-summary-card em {
  color: var(--muted);
  font-style: normal;
}
.home-summary-card strong {
  font-size: 30px;
  line-height: 1.1;
}
.home-action-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.home-action,
.permission-strip-card,
.role-card,
.project-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  padding: 12px;
  color: var(--text);
}
.home-action {
  min-height: 104px;
  display: grid;
  gap: 8px;
  align-content: start;
}
.home-action:hover,
.permission-strip-card:hover,
.role-card:hover,
.role-card.active,
.project-card:hover,
.project-card.active {
  border-color: var(--teal);
  box-shadow: 0 8px 18px rgba(15, 118, 110, .10);
}
.home-action strong,
.permission-strip-card strong,
.role-card strong,
.project-card strong {
  font-size: 15px;
}
.home-action span,
.permission-strip-card span,
.role-card span,
.role-card em,
.project-card span,
.project-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.45;
}
.home-permission-strip,
.role-grid,
.project-grid {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.permission-strip-card,
.role-card,
.project-card {
  min-height: 112px;
  display: grid;
  gap: 7px;
}
.role-card.active,
.project-card.active {
  background: #f0fdfa;
}
.home-focus-list {
  padding: 14px;
  display: grid;
  gap: 10px;
}
.home-focus-list > div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 6px;
}
.home-focus-list span {
  color: var(--muted);
}
.user-table-wrap {
  overflow: auto;
}
.user-table {
  width: 100%;
  border-collapse: collapse;
}
.user-table th,
.user-table td {
  height: 46px;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}
.user-table th {
  background: #f8fafc;
  color: var(--muted);
  font-weight: 600;
}
.user-table select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}
.status-toggle {
  height: 28px;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff;
  color: var(--red);
}
.status-toggle.enabled {
  border-color: #bbf7d0;
  color: var(--green);
  background: #f0fdf4;
}
.delete-record-toolbar {
  padding: 12px 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.delete-record-toolbar button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  padding: 0 12px;
  cursor: pointer;
}
.delete-record-toolbar button.active {
  border-color: var(--teal);
  background: #f0fdfa;
  color: #0f766e;
  font-weight: 700;
}
.delete-record-list {
  padding: 14px;
  display: grid;
  gap: 10px;
}
.delete-record-item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: #fff;
}
.delete-record-check {
  width: 24px;
  display: grid;
  place-items: center;
}
.delete-record-check input {
  width: 16px;
  height: 16px;
}
.delete-record-main {
  min-width: 0;
  display: grid;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 0;
  cursor: pointer;
}
.delete-record-main:hover strong {
  color: var(--teal);
}
.delete-record-main strong,
.delete-record-main span,
.delete-record-main em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delete-record-main span,
.delete-record-main em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}
.delete-record-detail {
  display: grid;
  gap: 8px;
}
.delete-record-detail > div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 4px;
}
.delete-record-detail strong,
.delete-record-detail-head {
  font-size: 13px;
  color: #334155;
}
.delete-record-detail span {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.delete-record-detail-head {
  margin-top: 14px;
  margin-bottom: 8px;
  font-weight: 700;
}
.delete-record-file-list {
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 6px;
}
.delete-record-file-list > div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}
.delete-record-file-thumb {
  width: 72px;
  aspect-ratio: 1;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.delete-record-file-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.delete-record-file-thumb span {
  max-width: 100%;
  padding: 0 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.delete-record-file-info {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.delete-record-file-list strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.delete-record-file-list span {
  color: var(--muted);
  font-size: 12px;
}
.permission-matrix {
  padding: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.permission-group {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.permission-group-title {
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-weight: 700;
}
.permission-list {
  padding: 10px;
  display: grid;
  gap: 6px;
}
.permission-item {
  min-height: 34px;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.permission-item.checked {
  background: #f0fdfa;
  border-color: #ccfbf1;
}
.permission-item.locked {
  color: var(--muted);
}
.role-detail-card {
  padding: 14px;
  display: grid;
  gap: 12px;
}
.role-detail-card > strong {
  font-size: 18px;
}
.role-detail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}
.role-detail-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.role-detail-stats > div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px;
  display: grid;
  gap: 6px;
}
.role-detail-stats span,
.role-detail-users span,
.role-lock-note {
  color: var(--muted);
}
.role-detail-users {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.role-detail-users span,
.role-lock-note {
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fafc;
}

@media (max-width: 1200px) {
  .home-summary-grid,
  .home-action-grid,
  .home-permission-strip,
  .role-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .permission-matrix {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .home-summary-grid,
  .home-action-grid,
  .home-permission-strip,
  .role-grid {
    grid-template-columns: 1fr;
  }
}


.user-header {
  min-width: 0;
}
#currentUserBadge {
  min-height: 32px;
  border: 1px solid #d7dde5;
  border-radius: 999px;
  padding: 6px 10px;
  background: #f8fafc;
  color: var(--text);
  white-space: nowrap;
}
.login-screen {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(15, 23, 42, .62);
  display: grid;
  place-items: center;
  padding: 18px;
}
.login-panel {
  width: min(420px, 100%);
  border-radius: 10px;
  background: #fff;
  border: 1px solid #d7dde5;
  box-shadow: 0 24px 80px rgba(15, 23, 42, .24);
  padding: 24px;
  display: grid;
  gap: 14px;
}
.login-brand {
  font-size: 24px;
  font-weight: 800;
}
.login-subtitle {
  color: var(--muted);
}
.login-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}
.login-panel input {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--text);
}
.login-panel.has-error input {
  border-color: #fca5a5;
  background: #fff7f7;
}
.login-error {
  min-height: 42px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  color: #b42318;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  font-weight: 700;
  line-height: 1.5;
}
.login-error::before {
  content: "!";
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  background: #dc2626;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex: 0 0 auto;
}
.login-error.hidden {
  display: none !important;
}
.login-panel.shake {
  animation: login-shake 0.22s ease-in-out;
}
@keyframes login-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}
.user-table th:nth-child(3),
.user-table td:nth-child(3),
.user-table th:nth-child(8),
.user-table td:nth-child(8) {
  min-width: 150px;
}
.user-table th:nth-child(9),
.user-table td:nth-child(9) {
  width: 82px;
  text-align: center;
}
.table-action-btn {
  min-height: 30px;
  padding: 0 10px;
}


.user-table tr.active td { background: #f0fdfa; }
.table-link { border: 0; background: transparent; color: var(--teal); font-weight: 700; padding: 0; }
.user-detail-form, .user-detail-section { padding: 14px; border-bottom: 1px solid #e2e8f0; display: grid; gap: 10px; }
.user-detail-head { display: grid; gap: 4px; }
.user-detail-head strong { font-size: 18px; }
.user-detail-head span, .user-detail-section .muted { color: var(--muted); }
.user-detail-form label { display: grid; gap: 5px; color: var(--muted); }
.user-detail-form input, .user-detail-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px; color: var(--text); background: #fff; }
.user-detail-form textarea { min-height: 70px; resize: vertical; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.brand-scope-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.brand-scope-grid label, .user-permission-row label { display: flex; align-items: center; gap: 6px; }
.user-permission-grid { display: grid; gap: 10px; }
.user-permission-group { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; }
.user-permission-group b { display: block; padding: 8px 10px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.user-permission-row { min-height: 36px; padding: 7px 10px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 8px; border-bottom: 1px solid #f1f5f9; }
.user-permission-row em { color: var(--muted); font-style: normal; font-size: 12px; }
.audit-log-list { padding: 12px; display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.audit-log-item { border: 1px solid #e2e8f0; border-radius: 8px; padding: 10px; display: grid; gap: 4px; background: #fff; }
.audit-log-item.failed { border-color: #fecaca; background: #fef2f2; }
.audit-log-item span, .audit-log-item em { color: var(--muted); font-style: normal; }
@media (max-width: 760px) {
  .user-permission-row { grid-template-columns: 1fr; }
  .brand-scope-grid { grid-template-columns: 1fr; }
}

.user-rule-note, .profile-modal-note { color: var(--muted); font-size: 13px; line-height: 1.5; padding: 8px 10px; border: 1px solid #e2e8f0; background: #f8fafc; border-radius: 8px; }
.profile-form-grid .field.full { grid-column: 1 / -1; }
.profile-form-grid input[disabled] { background: #f8fafc; color: var(--muted); }
.header-actions .hidden, .nav-list .hidden { display: none !important; }

.generator-record-danger-zone {
  border-top: 1px solid var(--line);
  padding-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.product-workspace {
  grid-template-columns: minmax(0, 1fr) 420px;
}
.product-toolbar {
  min-height: var(--panel-head-height);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.product-toolbar strong {
  font-size: 16px;
}
#productLibraryPanel {
  padding: 14px;
  display: grid;
  gap: 12px;
}
.product-library-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.product-brand-tabs {
  min-width: 0;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}
.product-library-summary > div {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 12px;
  display: grid;
  gap: 4px;
}
.product-library-summary strong {
  color: var(--teal);
  font-size: 22px;
}
.product-library-summary span {
  color: var(--muted);
  font-size: 12px;
}
.product-library-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.product-filter-chip {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  padding: 0 12px;
}
.product-filter-chip.active {
  border-color: var(--teal);
  background: #ecfdf5;
  color: var(--teal);
  font-weight: 700;
}
.product-library-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.product-library-card {
  min-width: 0;
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  display: grid;
  align-content: start;
  gap: 12px;
}
.product-library-card:hover,
.product-library-card.active {
  border-color: var(--teal);
  background: #ecfdf5;
}
.product-library-card-head,
.product-library-meta,
.product-detail-card {
  min-width: 0;
  display: grid;
  gap: 5px;
}
.product-library-card-head strong,
.product-library-card-head span,
.product-library-meta span,
.product-library-meta em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-library-card-head strong {
  color: #0f172a;
  font-size: 16px;
}
.product-library-card-head span,
.product-library-meta span,
.product-library-meta em,
.product-detail-card span,
.product-detail-card p {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.product-detail-card,
.product-order-card {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  margin-bottom: 12px;
}
.product-detail-card strong {
  font-size: 18px;
}
.product-detail-card p {
  margin: 4px 0 0;
  line-height: 1.6;
}
.product-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.product-order-head span {
  color: var(--muted);
  font-size: 12px;
}
.product-size-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.product-size-grid label {
  min-width: 0;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}
.product-size-grid span {
  color: #334155;
  font-weight: 700;
}
.product-size-grid input {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 8px;
}
.product-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.product-action-grid .primary {
  grid-column: 1 / -1;
}
.product-form-grid textarea {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  resize: vertical;
}
.product-create-panel {
  display: grid;
  gap: 14px;
}
.product-create-current-brand {
  min-height: 36px;
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #f8fafc;
  color: #475569;
  display: flex;
  align-items: center;
  padding: 0 12px;
}
.product-create-current-brand strong {
  color: #0f172a;
  margin-left: 4px;
}
.product-create-top-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.product-create-choice-block {
  min-width: 0;
  display: grid;
  gap: 8px;
}
.product-create-choice-block > span,
.product-create-size-title {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}
.product-create-segments,
.product-create-size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.product-create-segments button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #334155;
  padding: 0 14px;
}
.product-create-segments button.active,
#productBatchToggleBtn.active {
  border-color: var(--teal);
  background: #ecfdf5;
  color: var(--teal);
  font-weight: 700;
}
.product-create-size-panel {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 10px;
}
.product-create-size-options label {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.product-create-size-options label.checked {
  border-color: var(--teal);
  background: #ecfdf5;
  color: var(--teal);
  font-weight: 700;
}
.product-model-field {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  color: #334155;
  font-weight: 700;
}
.product-model-field input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  min-width: 0;
  font-weight: 400;
}
.product-create-showcase {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}
.product-create-showcase-head {
  min-height: 48px;
  border-bottom: 1px solid #dbe4ef;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}
.product-create-selected-strip {
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
}
.product-selected-title {
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}
.product-selected-list {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.product-selected-chip {
  min-height: 30px;
  border: 1px solid #b7d9d3;
  border-radius: 999px;
  background: #ecfdf5;
  color: #0f766e;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 220px;
}
.product-selected-chip.fixed {
  justify-self: start;
}
.product-selected-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-selected-chip b {
  font-size: 16px;
  line-height: 1;
}
.product-selected-empty {
  color: var(--muted);
  font-size: 12px;
}
.product-create-gallery {
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
}
.product-gallery-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  display: grid;
  gap: 6px;
  text-align: left;
}
.product-gallery-card:hover,
.product-gallery-card.active {
  border-color: var(--teal);
  background: #ecfdf5;
}
.product-gallery-card.disabled {
  opacity: .45;
}
.product-gallery-thumb {
  aspect-ratio: 3 / 4;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.product-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-gallery-thumb span {
  color: var(--muted);
  font-size: 12px;
}
.product-gallery-card strong,
.product-gallery-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-gallery-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}
.product-editor-left-head {
  min-height: 52px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 2px 12px;
}
.product-editor-left-head > div {
  min-width: 0;
  display: grid;
  gap: 4px;
}
.product-editor-left-head strong {
  color: #0f172a;
  font-size: 18px;
}
.product-editor-left-head span,
.product-editor-gallery-note {
  color: var(--muted);
  font-size: 12px;
}
.product-editor-gallery {
  display: grid;
  gap: 12px;
}
.product-editor-brand-tabs {
  padding-bottom: 2px;
}
.product-editor-model-grid {
  margin: 0;
}
.product-editor-model-card .color-pill.disabled {
  opacity: .45;
  cursor: not-allowed;
}
.product-gallery-model-group {
  border: 1px solid #dbe4ef;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}
.product-gallery-model-head {
  min-height: 42px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
}
.product-gallery-model-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-gallery-model-head span {
  color: var(--muted);
  font-size: 12px;
}
.product-gallery-color-grid {
  padding: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 10px;
}
.product-selected-visual {
  min-width: 0;
  border: 1px solid #b7d9d3;
  border-radius: 8px;
  background: #ecfdf5;
  color: #0f766e;
  padding: 6px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  text-align: left;
}
.product-selected-visual.fixed {
  width: 100%;
}
.product-selected-thumb {
  width: 42px;
  aspect-ratio: 3 / 4;
  border: 1px solid #b7d9d3;
  border-radius: 6px;
  background: #fff;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.product-selected-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-selected-thumb em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}
.product-selected-info {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.product-selected-info strong,
.product-selected-info em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-selected-info em {
  font-size: 12px;
  font-style: normal;
}
.product-selected-visual b {
  color: #64748b;
  font-size: 18px;
  line-height: 1;
}
.product-create-selected-strip.page {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}
.product-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (max-width: 1100px) {
  .product-workspace { grid-template-columns: 1fr; }
  .product-create-top-row { grid-template-columns: 1fr; }
}

.random-template-choice-preview > .random-template-choice-canvas.random-pack-template-canvas {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 3 / 4;
  border: 0;
  background: #fff;
  background-size: auto;
  overflow: hidden;
}
