* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green: #087a46;
  --green-hover: #06663a;
  --green-soft: #eaf6ef;
  --ink: #17202a;
  --muted: #697581;
  --line: #dce2e8;
  --line-strong: #c8d0d8;
  --surface: #ffffff;
  --surface-alt: #f5f7f8;
  --background: #eef1f3;
  --sidebar: #16251e;
  --danger: #ba2d38;
  --danger-soft: #fff0f1;
  --warning: #a35a00;
  --warning-soft: #fff4df;
  --focus: #126cbd;
  --radius: 8px;
  --shadow: 0 8px 24px rgba(27, 39, 50, 0.08);
}

body {
  min-height: 100vh;
  background: var(--background);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

body.modal-open { overflow: hidden; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { border: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
.hidden { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

input, select, textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 10px;
  outline: 0;
}

textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 3px solid rgba(18, 108, 189, 0.22);
  outline-offset: 1px;
  border-color: var(--focus);
}

.primary, .ghost, .btn, .link-btn, .icon-btn {
  min-height: 38px;
  border-radius: 6px;
  padding: 8px 14px;
  white-space: nowrap;
}

.primary { background: var(--green); color: #fff; font-weight: 700; }
.primary:hover { background: var(--green-hover); }
.ghost { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.ghost:hover, .btn:hover { border-color: var(--line-strong); background: var(--surface-alt); }
.btn { border: 1px solid var(--line); background: var(--surface); color: var(--green); font-size: 13px; font-weight: 650; }
.btn.danger { color: var(--danger); border-color: #edc4c8; }
.link-btn { min-height: auto; padding: 4px; background: transparent; color: var(--green); font-weight: 700; }
.icon-btn { width: 38px; padding: 0; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 22px; line-height: 1; }
.danger-text { color: var(--danger); }
.text-warn { color: var(--warning); }

.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #e8edeb; }
.login-card { width: min(400px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.login-brand, .side-brand { display: flex; align-items: center; gap: 12px; }
.login-brand { margin-bottom: 26px; }
.brand-mark { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border-radius: 7px; background: var(--green); color: #fff; font-size: 18px; font-weight: 800; }
.login-brand h1 { font-size: 21px; line-height: 1.25; }
.login-brand p, .side-brand span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.login-card label { display: block; margin-top: 14px; font-size: 13px; font-weight: 650; }
.login-card label input { margin-top: 6px; }
.full { width: 100%; margin-top: 20px; }
.hint { margin-top: 12px; color: var(--muted); font-size: 12px; }
.form-error { margin-top: 12px; border: 1px solid #efc4c8; border-radius: 6px; background: var(--danger-soft); color: var(--danger); padding: 9px 11px; font-size: 13px; }

.admin-shell { min-height: 100vh; display: flex; }
.sidebar { position: sticky; top: 0; width: 218px; height: 100vh; flex: 0 0 218px; background: var(--sidebar); color: #fff; padding: 20px 14px; }
.side-brand { min-height: 58px; padding: 0 6px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.side-brand strong { display: block; font-size: 15px; }
.side-brand span { display: block; color: rgba(255, 255, 255, 0.56); }
nav { display: grid; gap: 4px; margin-top: 16px; }
nav button { min-height: 42px; border-radius: 6px; background: transparent; color: rgba(255, 255, 255, 0.7); padding: 10px 13px; text-align: left; }
nav button:hover, nav button.active { background: rgba(255, 255, 255, 0.1); color: #fff; }
nav button.active { box-shadow: inset 3px 0 0 #52bb7e; }

.workspace { width: calc(100% - 218px); min-width: 0; padding: 22px 24px 36px; }
.topbar { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.topbar h2 { font-size: 22px; line-height: 1.25; }
.topbar p { margin-top: 3px; color: var(--muted); font-size: 13px; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.session-user { max-width: 180px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.panel { min-width: 0; }

.state-view { min-height: 220px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); padding: 28px; text-align: center; }
.state-view.error { flex-direction: column; color: var(--danger); }
.spinner { width: 18px; height: 18px; border: 2px solid #cfd7dd; border-top-color: var(--green); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.metric { min-height: 122px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 17px; }
.metric span { display: block; color: var(--muted); font-size: 13px; }
.metric strong { display: block; margin-top: 8px; font-size: 27px; line-height: 1.15; }
.metric small { display: block; margin-top: 8px; color: var(--muted); font-size: 12px; }
.two-column { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.data-section { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.section-head, .section-toolbar { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 16px; }
.section-head h3 { font-size: 15px; }
.section-head p, .section-toolbar span { margin-top: 2px; color: var(--muted); font-size: 12px; }
.section-toolbar { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 12px; }
.section-toolbar > div { display: grid; }
.compact-list { display: grid; }
.compact-row { width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); padding: 11px 16px; text-align: left; }
.compact-row:last-child { border-bottom: 0; }
.compact-row:hover { background: var(--surface-alt); }
.compact-row strong, .compact-row small { display: block; }
.compact-row small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.row-end { display: flex; flex: 0 0 auto; align-items: flex-end; gap: 5px; text-align: right; }
.compact-row .row-end { flex-direction: column; }

.toolbar { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px; }
.product-toolbar { grid-template-columns: minmax(210px, 1fr) 190px 130px auto auto; }
.order-toolbar { grid-template-columns: repeat(6, minmax(110px, 1fr)); }
.order-toolbar input:first-child { grid-column: span 2; }
.result-line { min-height: 35px; display: flex; align-items: center; color: var(--muted); font-size: 12px; padding: 0 3px; }
.table-wrap { max-width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; min-width: 860px; border-collapse: collapse; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 12px; text-align: left; vertical-align: middle; font-size: 13px; }
th { background: var(--surface-alt); color: #52606c; font-weight: 700; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfa; }
td.wide { max-width: 310px; }
.cell-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.product-cell, .category-name, .order-item { display: flex; align-items: center; gap: 10px; }
.product-cell { min-width: 230px; }
.product-cell img, .product-cell .image-placeholder, .order-item img, .order-item .image-placeholder { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 5px; object-fit: cover; background: var(--surface-alt); }
.product-cell .image-placeholder, .order-item .image-placeholder { display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.product-cell strong, .product-cell small, .category-name strong, .category-name small, .order-item strong, .order-item small { display: block; }
.product-cell small, .category-name small, .order-item small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.actions { white-space: nowrap; }
.actions .btn { min-height: 32px; padding: 6px 9px; margin: 2px 3px 2px 0; }
.pill { display: inline-flex; min-height: 25px; align-items: center; border-radius: 999px; background: #edf0f2; color: #53606b; padding: 3px 8px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pill.ok { background: var(--green-soft); color: var(--green); }
.pill.warn { background: var(--warning-soft); color: var(--warning); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.empty-state { padding: 28px 16px; color: var(--muted); text-align: center; }

.category-list { display: grid; gap: 10px; }
.category-group { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.category-root, .category-child { min-height: 66px; display: grid; grid-template-columns: minmax(230px, 1fr) minmax(240px, auto) auto; align-items: center; gap: 16px; padding: 10px 14px; }
.category-root { background: #fafbfb; }
.category-child { min-height: 58px; grid-template-columns: 24px minmax(210px, 1fr) minmax(180px, auto) auto; border-top: 1px solid var(--line); padding-left: 20px; }
.category-name img, .category-placeholder { width: 42px; height: 42px; flex: 0 0 42px; border-radius: 5px; object-fit: cover; }
.category-placeholder { display: grid; place-items: center; background: #e6ebe8; color: var(--muted); font-size: 11px; }
.category-meta { display: flex; align-items: center; justify-content: flex-end; gap: 12px; color: var(--muted); font-size: 12px; }
.category-empty { border-top: 1px solid var(--line); color: var(--muted); padding: 13px 58px; font-size: 12px; }
.branch { color: var(--line-strong); }

.modal { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; background: rgba(16, 24, 31, 0.54); padding: 20px; }
.modal-box { width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 22px 60px rgba(8, 18, 26, 0.25); }
.modal-box.modal-large { width: min(760px, 100%); }
.modal-box.modal-wide { width: min(1180px, 100%); }
.modal-box > form, .modal-box > div:first-child:not(.modal-head) { min-height: 0; display: flex; flex: 1; flex-direction: column; }
.modal-head { min-height: 70px; display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 14px 18px; }
.modal-head h3 { font-size: 18px; }
.modal-head p { margin-top: 2px; color: var(--muted); font-size: 12px; }
.modal-body { overflow: auto; padding: 18px; }
.modal-actions { min-height: 64px; display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #fafbfb; padding: 12px 18px; }

.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: 1fr 1fr; }
.form-grid label { min-width: 0; color: #3f4b56; font-size: 12px; font-weight: 650; }
.form-grid label input, .form-grid label select, .form-grid label textarea { margin-top: 5px; font-weight: 400; }
.span-2 { grid-column: span 2; }
.form-section { padding: 4px 0 22px; }
.form-section + .form-section { border-top: 1px solid var(--line); padding-top: 20px; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.section-title h4, .detail-section h4, .ship-form h4 { font-size: 14px; }
.section-title span, .option-footer span { color: var(--muted); font-size: 12px; }
.section-title > div span { display: block; margin-top: 2px; }
.image-editor { display: grid; gap: 10px; }
.image-list { display: flex; min-height: 0; flex-wrap: wrap; gap: 8px; }
.image-item { position: relative; width: 82px; height: 82px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.image-item img { width: 100%; height: 100%; object-fit: cover; }
.image-item button { position: absolute; top: 3px; right: 3px; width: 24px; height: 24px; border-radius: 50%; background: rgba(24, 31, 38, 0.78); color: #fff; font-size: 17px; line-height: 1; }
.image-actions { display: grid; grid-template-columns: auto minmax(200px, 1fr) auto; gap: 8px; }
.option-editor { display: grid; gap: 8px; }
.option-row { display: grid; grid-template-columns: minmax(150px, 0.35fr) minmax(260px, 1fr) 38px; align-items: end; gap: 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-alt); padding: 10px; }
.option-row label { color: var(--muted); font-size: 12px; }
.option-row input { margin-top: 4px; }
.option-footer { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.inline-note { border: 1px dashed var(--line-strong); border-radius: 6px; color: var(--muted); padding: 12px; }
.sku-table table { min-width: 1080px; }
.sku-table td { min-width: 125px; padding: 8px; }
.sku-table td:first-child { min-width: 130px; }
.sku-table input, .sku-table select { min-width: 110px; }
.money-input { position: relative; }
.money-input span { position: absolute; left: 9px; top: 50%; color: var(--muted); transform: translateY(-50%); }
.money-input input { padding-left: 25px; }
.inventory-readonly { display: block; font-weight: 700; white-space: nowrap; }
.inventory-readonly small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; font-weight: 400; }
.inventory-readonly .btn { min-height: 30px; margin-top: 6px; padding: 5px 8px; }

.inventory-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border: 1px solid var(--line); border-radius: 6px; background: var(--line); overflow: hidden; margin-bottom: 16px; }
.inventory-summary span { background: var(--surface-alt); color: var(--muted); padding: 12px; text-align: center; }
.inventory-summary strong { display: block; margin-top: 4px; color: var(--ink); font-size: 20px; }
.detail-bar { display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 15px; }
.detail-bar small { margin-left: auto; color: var(--muted); }
.detail-section { padding: 16px 0; border-bottom: 1px solid var(--line); }
.detail-section:last-child { border-bottom: 0; }
.detail-section h4 { margin-bottom: 10px; }
.order-items { display: grid; gap: 8px; }
.order-item { min-height: 60px; background: var(--surface-alt); border-radius: 6px; padding: 7px; }
.order-item > span:nth-child(2) { min-width: 0; flex: 1; }
.order-item .row-end { flex-direction: column; }
.detail-grid { display: grid; grid-template-columns: 90px 1fr; gap: 8px 12px; }
.detail-grid dt { color: var(--muted); }
.detail-grid dd { overflow-wrap: anywhere; }
.timeline { display: grid; gap: 7px; }
.timeline > div { display: flex; gap: 9px; }
.timeline > div > span { width: 8px; height: 8px; flex: 0 0 8px; margin-top: 6px; border-radius: 50%; background: var(--green); }
.timeline strong, .timeline small { display: block; }
.timeline small { color: var(--muted); font-size: 11px; }
.ship-form { margin-top: 16px; border: 1px solid #c9ddd1; border-radius: 6px; background: #f5faf7; padding: 14px; }
.ship-form h4 { margin-bottom: 11px; }
.ship-form > .primary { margin-top: 12px; }

/* Homepage decoration workspace */
.home-editor-toolbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 12px 14px; margin-bottom: 12px; }
.home-version-state, .home-editor-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.home-version-state span { min-height: 30px; display: inline-flex; align-items: center; gap: 5px; border-right: 1px solid var(--line); color: var(--muted); padding-right: 12px; font-size: 12px; }
.home-version-state span:last-child { border-right: 0; }
.home-version-state strong { color: var(--ink); font-size: 14px; }
.home-editor-actions { justify-content: flex-end; }
.home-editor-status { max-width: 270px; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.home-editor-status.ok { color: var(--green); }
.home-editor-status.error { color: var(--danger); }
.home-editor-layout { display: grid; grid-template-columns: minmax(250px, 0.85fr) minmax(330px, 1.15fr) minmax(270px, 0.85fr); align-items: start; gap: 12px; }
.home-block-pane, .home-property-pane, .home-preview-pane { min-width: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.home-pane-head { min-height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 12px 14px; }
.home-pane-head h3, .home-history-head h3 { font-size: 15px; }
.home-pane-head span, .home-history-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.home-add-control { min-width: 0; display: grid; grid-template-columns: minmax(95px, 1fr) auto; gap: 6px; }
.home-add-control select { min-width: 0; }
.home-block-list { display: grid; max-height: calc(100vh - 218px); overflow: auto; }
.home-block-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; border-bottom: 1px solid var(--line); background: var(--surface); }
.home-block-row:last-child { border-bottom: 0; }
.home-block-row.active { background: #f1f8f4; box-shadow: inset 3px 0 0 var(--green); }
.home-block-row.disabled { background: var(--surface-alt); opacity: 0.7; }
.home-block-main { min-width: 0; min-height: 64px; display: flex; align-items: center; gap: 8px; overflow: hidden; background: transparent; color: var(--ink); padding: 9px 8px 9px 12px; text-align: left; }
.home-block-main > span:last-child { min-width: 0; }
.home-block-main strong, .home-block-main small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-block-main small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.drag-mark { flex: 0 0 auto; color: #a2acb5; font-size: 18px; cursor: grab; }
.home-block-tools, .home-item-tools { display: flex; align-items: center; gap: 3px; padding-right: 8px; }
.home-block-tools .icon-btn, .home-item-tools .icon-btn { width: 30px; min-height: 30px; height: 30px; border-color: transparent; background: transparent; font-size: 17px; }
.home-block-tools .icon-btn:hover, .home-item-tools .icon-btn:hover { border-color: var(--line); background: var(--surface); }
.home-property-body { max-height: calc(100vh - 218px); overflow: auto; padding: 14px; }
.home-property-body > label, .home-form-section > label, .home-repeat-item > label { display: block; color: #3f4b56; font-size: 12px; font-weight: 650; }
.home-property-body label input, .home-property-body label select, .home-property-body label textarea { margin-top: 5px; font-weight: 400; }
.home-property-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.home-block-kind { display: inline-flex; align-items: center; min-height: 28px; border-radius: 5px; background: var(--green-soft); color: var(--green); padding: 4px 8px; font-size: 12px; font-weight: 700; }
.toggle-line { min-height: 30px; display: inline-flex !important; align-items: center; gap: 7px; }
.toggle-line input { width: 16px; min-height: 16px; height: 16px; margin: 0 !important; accent-color: var(--green); }
.home-form-section { display: grid; gap: 13px; margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.home-form-head, .home-repeat-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.home-form-head h4 { font-size: 14px; }
.home-form-head span, .field-help { display: block; color: var(--muted); font-size: 11px; font-weight: 400; }
.home-field-grid, .home-link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.home-repeat-list { display: grid; gap: 10px; }
.home-repeat-item { min-width: 0; display: grid; gap: 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-alt); padding: 11px; }
.home-repeat-title strong { font-size: 12px; }
.home-image-field { min-width: 0; display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: start; gap: 10px; }
.home-image-field.compact { grid-template-columns: 64px minmax(0, 1fr); }
.home-image-field > img, .home-image-field > span { width: 100px; height: 82px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; background: #e9edef; color: var(--muted); object-fit: cover; font-size: 11px; }
.home-image-field.compact > img, .home-image-field.compact > span { width: 64px; height: 64px; }
.home-image-field > div { min-width: 0; display: grid; gap: 7px; }
.upload-label { position: relative; width: max-content; min-height: 32px; display: inline-flex !important; align-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--green) !important; padding: 6px 9px; cursor: pointer; }
.upload-label input { position: absolute; width: 1px; height: 1px; min-height: 0 !important; opacity: 0; pointer-events: none; }
.home-product-select { min-height: 190px; }
.home-empty-editor { min-height: 250px; display: grid; align-content: center; justify-items: center; gap: 5px; color: var(--muted); text-align: center; }
.home-empty-editor strong { color: var(--ink); }
.phone-frame { width: min(100% - 28px, 335px); aspect-ratio: 375 / 812; display: flex; flex-direction: column; overflow: hidden; border: 8px solid #20262b; border-radius: 24px; background: #f3f5f5; box-shadow: 0 12px 28px rgba(20, 30, 38, 0.16); margin: 18px auto; }
.phone-top { min-height: 42px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; background: #087a46; color: #fff; padding: 0 13px; }
.phone-top b { font-size: 12px; }
.phone-top span { width: 42px; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.24); }
.phone-top i { width: 24px; height: 7px; justify-self: end; border: 1px solid rgba(255, 255, 255, 0.55); border-radius: 6px; }
.phone-body { min-height: 0; flex: 1; overflow-y: auto; background: #f3f5f5; padding-bottom: 12px; }
.phone-loading { min-height: 180px; display: grid; place-items: center; color: var(--muted); padding: 20px; text-align: center; }
.phone-hero { position: relative; display: block; aspect-ratio: 2 / 1; overflow: hidden; background: #dce4e0; }
.phone-hero img { width: 100%; height: 100%; object-fit: cover; }
.phone-hero strong { position: absolute; left: 12px; bottom: 10px; max-width: calc(100% - 24px); overflow: hidden; color: #fff; font-size: 13px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55); text-overflow: ellipsis; white-space: nowrap; }
.phone-notice { min-height: 38px; display: flex; align-items: center; gap: 8px; background: #fff8e8; color: #845800; padding: 8px 10px; }
.phone-notice b { flex: 0 0 auto; border-radius: 4px; background: #e98b00; color: #fff; padding: 2px 5px; font-size: 9px; }
.phone-notice span { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.phone-shortcuts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; background: #fff; padding: 12px 9px; }
.phone-shortcuts div { min-width: 0; display: grid; justify-items: center; gap: 5px; }
.phone-shortcuts img, .phone-shortcuts div > span { width: 38px; height: 38px; border-radius: 7px; background: #edf1ef; object-fit: cover; }
.phone-shortcuts small { width: 100%; overflow: hidden; font-size: 9px; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.phone-brand { min-height: 100px; display: grid; grid-template-columns: minmax(0, 1fr) 112px; align-items: center; gap: 8px; background: #fff; border-top: 7px solid #f3f5f5; padding: 12px; }
.phone-brand strong, .phone-brand small { display: block; }
.phone-brand strong { font-size: 14px; }
.phone-brand small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.phone-brand img { width: 112px; height: 74px; object-fit: cover; }
.phone-section { border-top: 7px solid #f3f5f5; background: #fff; padding: 11px; }
.phone-section header strong, .phone-section header small { display: block; }
.phone-section header strong { font-size: 13px; }
.phone-section header small { color: var(--muted); font-size: 9px; }
.phone-products { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.phone-products.compact { grid-template-columns: 1fr; }
.phone-product { min-width: 0; display: grid; grid-template-columns: 1fr; gap: 3px; border: 1px solid #e5e9e7; border-radius: 5px; padding: 6px; }
.phone-products.compact .phone-product { grid-template-columns: 54px minmax(0, 1fr) auto; align-items: center; }
.phone-product img, .phone-image-empty { width: 100%; aspect-ratio: 1; display: grid; place-items: center; background: #edf1ef; color: var(--muted); object-fit: cover; font-size: 9px; }
.phone-products.compact .phone-product img, .phone-products.compact .phone-image-empty { width: 54px; height: 54px; }
.phone-product strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.phone-product small { color: #b32b2b; font-size: 10px; font-weight: 700; }
.home-history-band { margin-top: 12px; border-top: 3px solid var(--green); background: var(--surface); }
.home-history-head { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 12px 14px; }
.home-history-list { display: grid; }
.home-history-list > div { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 10px 14px; }
.home-history-list > div:last-child { border-bottom: 0; }
.home-history-list strong, .home-history-list small { display: block; }
.home-history-list small { margin-top: 2px; color: var(--muted); font-size: 11px; }

/* Product detail visual editor */
.product-detail-form-section { padding-bottom: 4px; }
.detail-compat-warning { border: 1px solid #efcf9b; border-radius: 6px; background: var(--warning-soft); color: var(--warning); padding: 9px 11px; margin-bottom: 10px; font-size: 12px; }
.detail-add-toolbar { min-height: 54px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; border: 1px solid var(--line); border-radius: 6px 6px 0 0; background: var(--surface-alt); padding: 8px; }
.detail-add-toolbar .btn { background: var(--surface); }
.detail-editor-layout { min-height: 560px; display: grid; grid-template-columns: minmax(205px, 0.72fr) minmax(330px, 1.25fr) minmax(270px, 0.9fr); align-items: stretch; border: 1px solid var(--line); border-top: 0; }
.detail-block-pane, .detail-property-pane, .detail-preview-pane { min-width: 0; display: flex; flex-direction: column; background: var(--surface); }
.detail-property-pane, .detail-preview-pane { border-left: 1px solid var(--line); }
.detail-pane-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 10px 12px; }
.detail-pane-head h5 { font-size: 13px; }
.detail-pane-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.detail-block-list, .detail-property-body { min-height: 0; flex: 1; overflow: auto; }
.detail-block-list { max-height: 620px; }
.detail-block-row { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; border-bottom: 1px solid var(--line); }
.detail-block-row.active { background: #f0f8f3; box-shadow: inset 3px 0 0 var(--green); }
.detail-block-select { min-width: 0; min-height: 61px; display: flex; align-items: center; gap: 8px; overflow: hidden; background: transparent; color: var(--ink); padding: 8px 6px 8px 10px; text-align: left; }
.detail-block-select > span:first-child { width: 24px; height: 24px; flex: 0 0 24px; display: grid; place-items: center; border-radius: 4px; background: #e7ece9; color: var(--muted); font-size: 11px; }
.detail-block-select > span:last-child { min-width: 0; }
.detail-block-select strong, .detail-block-select small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-block-select small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.detail-block-tools { display: grid; grid-template-columns: 28px 28px; align-content: center; gap: 2px; padding-right: 6px; }
.detail-block-tools .icon-btn { width: 28px; min-height: 27px; height: 27px; border-color: transparent; background: transparent; font-size: 15px; }
.detail-block-tools .icon-btn:hover { border-color: var(--line); background: var(--surface); }
.detail-property-body { max-height: 620px; display: grid; align-content: start; gap: 12px; padding: 12px; }
.detail-property-body label { min-width: 0; color: #3f4b56; font-size: 12px; font-weight: 650; }
.detail-property-body label input { margin-top: 5px; font-weight: 400; }
.detail-empty { min-height: 190px; display: grid; place-items: center; color: var(--muted); padding: 18px; text-align: center; }
.detail-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.detail-image-fields { min-width: 0; display: grid; grid-template-columns: 94px minmax(0, 1fr); gap: 10px; }
.detail-image-thumb { width: 94px; height: 82px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-alt); color: var(--muted); font-size: 11px; }
.detail-image-thumb img { width: 100%; height: 100%; object-fit: cover; }
.detail-image-fields > div:last-child { min-width: 0; display: grid; gap: 7px; }
.detail-upload-label { position: relative; width: max-content; min-height: 31px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--green) !important; padding: 5px 9px; cursor: pointer; }
.detail-upload-label input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; pointer-events: none; }
.detail-property-head, .detail-repeat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.detail-property-head span { color: var(--muted); font-size: 11px; }
.detail-gallery-editor, .detail-table-editor { display: grid; gap: 10px; }
.detail-gallery-item { display: grid; gap: 9px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.detail-gallery-item:last-child { border-bottom: 0; }
.detail-repeat-head strong { font-size: 12px; }
.detail-repeat-head .icon-btn { width: 30px; min-height: 30px; height: 30px; }
.detail-table-row { min-width: 0; display: grid; grid-template-columns: 25px minmax(90px, 0.7fr) minmax(130px, 1.3fr) 32px; align-items: center; gap: 6px; }
.detail-table-row > span { color: var(--muted); font-size: 11px; text-align: center; }
.detail-table-row .icon-btn { width: 32px; min-height: 34px; height: 34px; }
.detail-quill-wrap { min-width: 0; }
.detail-quill-wrap .ql-toolbar.ql-snow { border-color: var(--line); border-radius: 5px 5px 0 0; }
.detail-quill-wrap .ql-container.ql-snow { min-height: 330px; border-color: var(--line); border-radius: 0 0 5px 5px; font-family: inherit; }
.detail-quill-wrap .ql-editor { min-height: 330px; overflow-wrap: anywhere; font-size: 14px; line-height: 1.7; }
.detail-preview-modes { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.detail-preview-modes button { min-height: 30px; background: var(--surface); color: var(--muted); padding: 4px 8px; font-size: 11px; }
.detail-preview-modes button + button { border-left: 1px solid var(--line); }
.detail-preview-modes button.active { background: var(--green); color: #fff; }
.detail-preview-stage { min-height: 0; flex: 1; overflow: auto; background: #e9edeb; padding: 14px; }
.detail-preview-stage.phone .detail-preview-content { width: min(100%, 310px); min-height: 520px; margin: 0 auto; }
.detail-preview-stage.desktop .detail-preview-content { width: 100%; min-height: 420px; }
.detail-preview-content { overflow: hidden; background: #fff; box-shadow: 0 8px 20px rgba(25, 36, 31, 0.1); overflow-wrap: anywhere; }
.detail-preview-content > * { margin: 0; }
.detail-preview-content .detail-preview-rich { padding: 14px; color: #414a45; font-size: 13px; line-height: 1.75; }
.detail-preview-content .detail-preview-rich h1, .detail-preview-content .detail-preview-rich h2, .detail-preview-content .detail-preview-rich h3 { margin: 0 0 8px; line-height: 1.3; }
.detail-preview-content .detail-preview-rich p, .detail-preview-content .detail-preview-rich ul, .detail-preview-content .detail-preview-rich ol { margin: 0 0 9px; }
.detail-preview-content figure { margin: 0; }
.detail-preview-content figure img { display: block; width: 100%; height: auto; object-fit: contain; }
.detail-preview-content figcaption { color: var(--muted); padding: 7px 12px 12px; font-size: 11px; text-align: center; }
.detail-preview-gallery { display: grid; gap: 1px; }
.detail-preview-table { max-width: 100%; overflow-x: auto; padding: 12px; }
.detail-preview-table table { min-width: 100%; }
.detail-preview-table td { min-width: 90px; padding: 8px; border: 1px solid var(--line); font-size: 11px; }
.detail-preview-content hr { border: 0; border-top: 1px solid var(--line); margin: 12px 14px; }
.detail-preview-empty { min-height: 90px; display: grid; place-items: center; background: var(--surface-alt); color: var(--muted); padding: 14px; text-align: center; }
.detail-markdown-button { margin-left: auto; border-color: #a9caba; background: #edf6f2 !important; }
.detail-editor-tabs { display: flex; min-height: 36px; border: 1px solid var(--line); border-radius: 5px 5px 0 0; overflow: hidden; }
.detail-editor-tabs button { flex: 1; background: var(--surface); color: var(--muted); }
.detail-editor-tabs button + button { border-left: 1px solid var(--line); }
.detail-editor-tabs button.active { background: #edf6f2; color: #25634f; font-weight: 700; }
.detail-source-editor { width: 100%; min-height: 366px; resize: vertical; border-radius: 0 0 5px 5px; padding: 12px; font: 12px/1.6 Consolas, monospace; overflow-wrap: anywhere; }
.detail-source-warning { border-left: 3px solid #9a620e; background: var(--warning-soft); color: var(--warning); padding: 8px 10px; overflow-wrap: anywhere; font-size: 11px; }
.detail-field-help { color: var(--muted); overflow-wrap: anywhere; font-size: 10px; line-height: 1.5; }
.detail-structured-fields, .detail-repeat-editor { min-width: 0; display: grid; gap: 11px; }
.detail-structured-fields label, .detail-repeat-card label { display: grid; gap: 5px; }
.detail-structured-fields textarea, .detail-repeat-card textarea { min-height: 82px; }
.detail-repeat-card { min-width: 0; display: grid; gap: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-alt); padding: 10px; }
.detail-segment-field { min-width: 0; border: 0; padding: 0; }
.detail-segment-field legend { margin-bottom: 5px; color: #3f4b56; font-size: 12px; font-weight: 650; }
.detail-segmented { min-height: 40px; display: flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.detail-segmented button { min-width: 0; flex: 1; background: var(--surface); color: var(--muted); padding: 6px; font-size: 11px; }
.detail-segmented button + button { border-left: 1px solid var(--line); }
.detail-segmented button.active { background: var(--green-soft); color: var(--green); font-weight: 700; }
.detail-preview-banner { padding: 28px 20px; overflow-wrap: anywhere; }
.detail-preview-banner.align-center { text-align: center; }
.detail-preview-banner small, .detail-preview-banner strong, .detail-preview-banner p { display: block; margin: 0; }
.detail-preview-banner small { min-height: 16px; color: rgba(255, 255, 255, 0.76); font-size: 10px; font-weight: 700; }
.detail-preview-banner strong { margin-top: 5px; font-size: 20px; line-height: 1.3; }
.detail-preview-banner p { margin-top: 8px; color: rgba(255, 255, 255, 0.86); font-size: 12px; line-height: 1.65; }
.detail-preview-badges { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 14px; }
.detail-preview-badges > span { max-width: 100%; display: inline-flex; align-items: center; gap: 5px; border: 1px solid #cbd5e1; border-radius: 4px; background: #f1f5f9; color: #334155; padding: 5px 8px; overflow-wrap: anywhere; font-size: 10px; }
.detail-preview-badges > span.tone-success { border-color: #a7f3d0; background: #ecfdf5; color: #166534; }
.detail-preview-badges > span.tone-warning { border-color: #fde68a; background: #fffbeb; color: #92400e; }
.detail-preview-icon { width: 17px; height: 17px; flex: 0 0 17px; display: inline-grid; place-items: center; border-radius: 3px; background: rgba(0, 0, 0, 0.08); font-size: 10px; }
.detail-preview-callout { display: flex; align-items: flex-start; gap: 9px; border-left: 4px solid #60a5fa; background: #eff6ff; color: #1e3a5f; padding: 13px 14px; overflow-wrap: anywhere; }
.detail-preview-callout.tone-success { border-color: #4ade80; background: #ecfdf5; color: #14532d; }
.detail-preview-callout.tone-warning { border-color: #f59e0b; background: #fffbeb; color: #78350f; }
.detail-preview-callout > div { min-width: 0; }
.detail-preview-callout strong, .detail-preview-callout p { display: block; margin: 0; }
.detail-preview-callout strong { margin-bottom: 4px; font-size: 12px; }
.detail-preview-callout p { font-size: 11px; line-height: 1.6; }
.detail-preview-features { max-width: 100%; overflow: hidden; padding: 7px; }
.detail-preview-feature { width: 50%; display: inline-flex; box-sizing: border-box; vertical-align: top; gap: 8px; padding: 6px; overflow-wrap: anywhere; }
.detail-preview-feature > div { min-width: 0; flex: 1; border-top: 2px solid #b9c8c1; padding-top: 8px; }
.detail-preview-feature strong, .detail-preview-feature p { display: block; margin: 0; }
.detail-preview-feature strong { color: #283831; font-size: 11px; }
.detail-preview-feature p { margin-top: 4px; color: #67736d; font-size: 10px; line-height: 1.55; }
.detail-preview-rich blockquote { margin: 10px 0; border-left: 3px solid #4c806c; background: #f2f7f5; padding: 9px 11px; }
.detail-preview-rich pre { max-width: 100%; overflow-x: auto; background: #f2f4f3; padding: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-preview-rich code { font-family: Consolas, monospace; }
.detail-import-overlay { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; background: rgba(15, 23, 42, 0.48); padding: 20px; }
.detail-import-dialog { width: min(860px, 100%); max-height: min(760px, calc(100vh - 40px)); display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: 0 22px 60px rgba(8, 18, 26, 0.28); }
.detail-import-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 12px 16px; }
.detail-import-head h4 { font-size: 16px; }
.detail-import-head p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.detail-import-body { min-height: 0; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(270px, 0.95fr); flex: 1; overflow: auto; }
.detail-import-source, .detail-import-result, .detail-import-placeholder { min-width: 0; padding: 15px; }
.detail-import-source { border-right: 1px solid var(--line); }
.detail-import-source > label { display: grid; gap: 6px; color: #3f4b56; font-size: 12px; font-weight: 650; }
.detail-import-source textarea { min-height: 330px; font: 12px/1.6 Consolas, monospace; }
.detail-import-source-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.detail-import-source-actions > span { margin-right: auto; color: var(--muted); font-size: 10px; }
.detail-import-error { margin-top: 9px; overflow-wrap: anywhere; }
.detail-import-result { background: #f1f3f2; }
.detail-import-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.detail-import-summary strong { color: var(--green); font-size: 15px; }
.detail-import-summary span, .detail-import-ok { color: var(--muted); font-size: 10px; }
.detail-import-warnings { max-height: 90px; overflow: auto; margin: 0 0 10px; color: var(--warning); padding-left: 17px; overflow-wrap: anywhere; font-size: 10px; }
.detail-import-preview { max-height: 440px; overflow: auto; padding: 10px; background: #e5e9e7; }
.detail-import-preview .detail-preview-content { width: min(100%, 310px); min-height: 350px; margin: 0 auto; }
.detail-import-placeholder { display: grid; place-items: center; color: var(--muted); text-align: center; line-height: 1.6; }
.detail-import-actions { min-height: 66px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); background: #fafbfb; padding: 10px 16px; }
.detail-import-actions > fieldset { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 10px; border: 0; margin-right: auto; padding: 0; }
.detail-import-actions legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
.detail-import-actions label { display: inline-flex; align-items: center; gap: 5px; color: #4b5852; font-size: 11px; }
.detail-import-actions input { width: 15px; min-height: 15px; height: 15px; margin: 0; accent-color: var(--green); }

/* Catalog import and review */
.import-source-band { border-top: 3px solid var(--green); background: var(--surface); }
.import-source-head, .import-workspace-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 12px 14px; }
.import-source-head h3, .import-workspace-head h3 { font-size: 16px; }
.import-source-head p, .import-workspace-head p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.import-source-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.import-source-option { position: relative; min-width: 0; min-height: 108px; display: grid; align-content: center; gap: 5px; border-right: 1px solid var(--line); padding: 16px; cursor: pointer; }
.import-source-option:last-child { border-right: 0; }
.import-source-option:hover, .import-source-option:focus-within { background: #f0f8f3; box-shadow: inset 0 -2px 0 var(--green); }
.import-source-option strong { color: var(--green); font-size: 13px; }
.import-source-option span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.import-source-option input { position: absolute; width: 1px; height: 1px; min-height: 0; opacity: 0; }
.import-queue-empty, .import-empty { min-height: 52px; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.import-queue-head { display: grid; gap: 7px; padding: 12px 14px 8px; }
.import-queue-head > div { display: flex; justify-content: space-between; gap: 12px; }
.import-queue-head progress { width: 100%; height: 7px; accent-color: var(--green); }
.import-file-list { max-height: 210px; overflow: auto; border-top: 1px solid var(--line); }
.import-file-list > div { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 7px 14px; }
.import-file-list span:first-child { min-width: 0; }
.import-file-list strong, .import-file-list small { display: block; overflow-wrap: anywhere; }
.import-file-list strong { font-size: 12px; }
.import-file-list small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.import-queue-actions { min-height: 54px; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 7px; padding: 9px 14px; }
.import-main-layout { min-height: 580px; display: grid; grid-template-columns: 245px minmax(0, 1fr); gap: 12px; margin-top: 12px; }
.import-job-list, .import-job-workspace, .import-workspace-empty { min-width: 0; background: var(--surface); border: 1px solid var(--line); }
.import-pane-head { min-height: 57px; display: flex; align-items: center; border-bottom: 1px solid var(--line); padding: 10px 12px; }
.import-pane-head h4 { font-size: 13px; }
.import-pane-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.import-job-list > div:last-child { max-height: 640px; overflow-y: auto; }
.import-job-row { width: 100%; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 7px; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); padding: 9px 10px; text-align: left; }
.import-job-row.active { background: #f0f8f3; box-shadow: inset 3px 0 0 var(--green); }
.import-job-row > span:first-child { min-width: 0; }
.import-job-row strong, .import-job-row small { display: block; }
.import-job-row small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.import-workspace-empty { display: grid; align-content: center; justify-items: center; gap: 5px; color: var(--muted); text-align: center; }
.import-workspace-empty strong { color: var(--ink); }
.import-command-bar { display: flex; flex-wrap: wrap; gap: 6px; }
.import-job-summary { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.import-job-summary > div { min-height: 70px; display: grid; align-content: center; gap: 3px; border-right: 1px solid var(--line); padding: 10px 14px; }
.import-job-summary > div:last-child { border-right: 0; }
.import-job-summary span { color: var(--muted); font-size: 10px; }
.import-job-summary strong { font-size: 20px; }
.import-filter-bar { min-height: 54px; display: flex; align-items: center; flex-wrap: wrap; gap: 7px; background: var(--surface-alt); border-bottom: 1px solid var(--line); padding: 9px 12px; }
.import-filter-bar select { width: auto; min-width: 130px; }
.import-filter-bar label { min-height: 34px; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; }
.import-filter-bar input[type="checkbox"], .import-review-table input[type="checkbox"] { width: 15px; height: 15px; min-height: 0; }
.import-review-table { max-width: 100%; overflow-x: auto; }
.import-review-table table { min-width: 1030px; }
.import-review-table th:first-child, .import-review-table td:first-child { width: 40px; text-align: center; }
.import-review-table tr.has-error { background: #fff8f8; }
.import-product-cell { min-width: 190px; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 8px; }
.import-product-cell .image-placeholder { width: 42px; height: 42px; }
.import-product-cell strong, .import-product-cell small { display: block; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import-product-cell small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.import-source-key { display: block; max-width: 150px; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.import-warning { max-width: 190px; color: var(--warning); font-size: 10px; }
.import-apply-summary { min-height: 54px; display: flex; align-items: center; flex-wrap: wrap; gap: 15px; border-top: 1px solid var(--line); background: var(--surface-alt); padding: 10px 13px; color: var(--muted); font-size: 11px; }
.import-apply-summary b { color: var(--ink); font-size: 13px; }
.import-apply-bar { min-height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding: 10px 13px; }
.import-apply-bar > span { margin-right: auto; color: var(--muted); font-size: 11px; }
.import-review-drawer { position: fixed; z-index: 170; top: 0; right: 0; width: min(620px, 92vw); height: 100vh; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); box-shadow: -14px 0 36px rgba(18, 33, 27, 0.2); }
.import-drawer-head { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); padding: 12px 16px; }
.import-drawer-head h4 { font-size: 15px; }
.import-drawer-head span { display: block; max-width: 480px; margin-top: 2px; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; }
.import-review-drawer form { min-height: 0; flex: 1; display: flex; flex-direction: column; }
.import-drawer-body { min-height: 0; flex: 1; overflow-y: auto; display: grid; align-content: start; gap: 13px; padding: 15px; }
.import-drawer-body > label { display: grid; gap: 5px; color: #3f4b56; font-size: 11px; font-weight: 650; }
.import-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.import-review-field { min-width: 0; display: grid; gap: 5px; }
.import-review-field > span, .import-review-title label, .import-review-switches label { display: flex; align-items: center; gap: 5px; color: #3f4b56; font-size: 11px; font-weight: 650; }
.import-review-field input[type="checkbox"], .import-review-title input, .import-review-switches input { width: 15px; height: 15px; min-height: 0; }
.import-review-variants { border-top: 1px solid var(--line); padding-top: 12px; }
.import-review-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.import-variant-row { display: grid; grid-template-columns: 1fr 1fr 100px 90px; align-items: end; gap: 6px; border-bottom: 1px dashed var(--line); padding: 7px 0; }
.import-variant-row label { display: grid; gap: 3px; color: var(--muted); font-size: 9px; }
.import-review-switches { display: flex; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 11px 0; }
.import-drawer-body details { border: 1px solid var(--line); padding: 9px; }
.import-drawer-body summary { color: var(--green); cursor: pointer; font-size: 11px; font-weight: 700; }
.import-drawer-body pre { max-height: 260px; overflow: auto; margin: 9px 0 0; background: #f4f6f5; padding: 9px; font-size: 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.import-drawer-actions { min-height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; border-top: 1px solid var(--line); padding: 10px 15px; }
.selection-summary { min-height: 44px; display: flex; align-items: center; background: var(--surface-alt); border-left: 3px solid var(--green); padding: 9px 12px; }
.ai-field-selector { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; border: 1px solid var(--line); margin-top: 12px; padding: 12px; }
.ai-field-selector legend { padding: 0 5px; color: var(--ink); font-weight: 700; }
.ai-field-selector label { min-height: 34px; display: flex; align-items: center; gap: 6px; }
.ai-field-selector input { width: 16px; height: 16px; min-height: 0; }
.notice-box { margin-top: 12px; border: 1px solid #efcf9b; background: var(--warning-soft); color: var(--warning); padding: 9px 11px; font-size: 11px; }
.import-category-impact { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); }
.import-category-impact span { min-height: 54px; display: grid; place-items: center; gap: 2px; border-right: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.import-category-impact span:last-child { border-right: 0; }
.import-category-impact b { color: var(--ink); font-size: 16px; }
.category-name > input[type="checkbox"] { width: 16px; height: 16px; min-height: 0; flex: 0 0 16px; }
.home-ai-proposals { border: 1px solid #c6dbce; border-top: 3px solid var(--green); background: var(--surface); margin-bottom: 12px; }
.home-ai-head, .home-ai-actions { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 13px; }
.home-ai-head { border-bottom: 1px solid var(--line); }
.home-ai-head h3 { font-size: 14px; }
.home-ai-head span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.home-ai-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.home-ai-list label { min-height: 64px; display: flex; align-items: center; gap: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 9px 11px; }
.home-ai-list input { width: 16px; height: 16px; min-height: 0; }
.home-ai-list strong, .home-ai-list small { display: block; }
.home-ai-list small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.home-ai-actions { justify-content: flex-end; }

.toast { position: fixed; z-index: 200; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 32px)); border: 1px solid #bad8c6; border-radius: 6px; background: #f0faf4; color: var(--green); box-shadow: var(--shadow); padding: 11px 14px; }
.toast.error { border-color: #edc4c8; background: var(--danger-soft); color: var(--danger); }

@media (max-width: 1250px) {
  .order-toolbar { grid-template-columns: repeat(4, minmax(130px, 1fr)); }
  .order-toolbar input:first-child { grid-column: span 2; }
}

@media (max-width: 1180px) {
  .home-editor-layout { grid-template-columns: minmax(245px, 0.75fr) minmax(0, 1.25fr); }
  .home-preview-pane { grid-column: 1 / -1; }
  .phone-frame { width: min(100% - 40px, 350px); }
}

@media (max-width: 960px) {
  .metrics { grid-template-columns: repeat(2, minmax(140px, 1fr)); }
  .two-column { grid-template-columns: 1fr; }
  .product-toolbar { grid-template-columns: minmax(200px, 1fr) 160px 120px; }
  .product-toolbar button { grid-column: auto; }
  .category-root { grid-template-columns: minmax(210px, 1fr) auto; }
  .category-root .actions { grid-column: 1 / -1; }
  .category-child { grid-template-columns: 20px minmax(190px, 1fr) auto; }
  .category-child .actions { grid-column: 2 / -1; }
  .detail-editor-layout { grid-template-columns: minmax(210px, 0.75fr) minmax(0, 1.25fr); }
  .detail-preview-pane { grid-column: 1 / -1; border-top: 1px solid var(--line); border-left: 0; }
  .detail-preview-stage.phone .detail-preview-content { width: min(100%, 340px); }
  .import-main-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .import-variant-row { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .detail-editor-layout { grid-template-columns: 1fr; }
  .detail-property-pane, .detail-preview-pane { grid-column: auto; border-top: 1px solid var(--line); border-left: 0; }
  .detail-block-list, .detail-property-body { max-height: none; }
}

@media (max-width: 760px) {
  .detail-preview-feature { width: 100%; }
  .detail-import-overlay { padding: 8px; }
  .detail-import-dialog { max-height: calc(100vh - 16px); }
  .detail-import-body { grid-template-columns: 1fr; }
  .detail-import-source { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-import-source textarea { min-height: 220px; }
  .detail-import-placeholder { min-height: 160px; }
  .detail-import-actions { align-items: stretch; flex-wrap: wrap; }
  .detail-import-actions > fieldset { width: 100%; }
}

@media (max-width: 720px) {
  .admin-shell { display: block; }
  .sidebar { position: sticky; z-index: 30; top: 0; width: 100%; height: auto; padding: 8px 10px; box-shadow: 0 2px 10px rgba(20, 35, 28, 0.2); }
  .side-brand { display: none; }
  nav { grid-template-columns: repeat(6, minmax(50px, 1fr)); gap: 3px; margin: 0; }
  nav button { min-height: 40px; padding: 8px 5px; text-align: center; }
  nav button.active { box-shadow: inset 0 -3px 0 #52bb7e; }
  .workspace { width: 100%; padding: 14px 12px 28px; }
  .topbar { min-height: 54px; margin-bottom: 10px; }
  .topbar h2 { font-size: 19px; }
  .topbar p, .session-user { display: none; }
  .top-actions { gap: 5px; }
  .top-actions button { min-height: 34px; padding: 6px 9px; }
  .metrics { gap: 8px; }
  .metric { min-height: 108px; padding: 13px; }
  .metric strong { font-size: 23px; }
  .toolbar, .product-toolbar, .order-toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar input:first-child { grid-column: 1 / -1; }
  .product-toolbar select { min-width: 0; }
  .section-toolbar { align-items: flex-start; }
  .category-root, .category-child { display: flex; flex-wrap: wrap; gap: 8px 12px; }
  .category-name { min-width: 200px; flex: 1; }
  .category-meta { justify-content: flex-start; }
  .category-root .actions, .category-child .actions { width: 100%; }
  .category-child { padding-left: 14px; }
  .branch { display: none; }
  .modal { place-items: end center; padding: 0; }
  .modal-box, .modal-box.modal-large, .modal-box.modal-wide { width: 100%; max-height: 94vh; border-radius: 8px 8px 0 0; border-bottom: 0; }
  .modal-head { min-height: 62px; padding: 11px 14px; }
  .modal-body { padding: 14px; }
  .modal-actions { min-height: 58px; padding: 10px 14px; }
  .form-grid.two { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .image-actions { grid-template-columns: 1fr auto; }
  .image-actions > .btn:first-of-type { grid-column: 1 / -1; }
  .option-row { grid-template-columns: 1fr 38px; }
  .option-values { grid-column: 1; }
  .option-row .icon-btn { grid-row: 1 / span 2; grid-column: 2; align-self: center; }
  .section-title { align-items: flex-start; }
  .option-footer { align-items: flex-start; flex-direction: column; }
  .detail-bar { flex-wrap: wrap; }
  .detail-bar small { width: 100%; margin: 0; }
}

@media (max-width: 760px) {
  .home-editor-toolbar { align-items: stretch; flex-direction: column; }
  .home-version-state, .home-editor-actions { justify-content: flex-start; }
  .home-editor-status { width: 100%; max-width: none; }
  .home-editor-layout { grid-template-columns: 1fr; }
  .home-preview-pane { grid-column: auto; }
  .home-block-list, .home-property-body { max-height: none; }
  .import-source-grid, .import-main-layout { grid-template-columns: 1fr; }
  .import-source-option { min-height: 82px; border-right: 0; border-bottom: 1px solid var(--line); }
  .import-job-list > div:last-child { max-height: 210px; }
  .import-workspace-empty { min-height: 220px; }
  .import-review-drawer { width: 100vw; }
  .import-field-grid { grid-template-columns: 1fr; }
  .home-ai-list { grid-template-columns: 1fr; }
  .home-ai-list label { border-right: 0; }
}

@media (max-width: 420px) {
  .login-view { padding: 14px; }
  .login-card { padding: 24px 20px; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .metric { min-width: 0; }
  .metric small { line-height: 1.35; }
  .compact-row { align-items: flex-start; flex-direction: column; }
  .compact-row .row-end { width: 100%; align-items: center; flex-direction: row; justify-content: space-between; }
  .toolbar, .product-toolbar, .order-toolbar { grid-template-columns: 1fr; }
  .toolbar input:first-child { grid-column: auto; }
  .product-toolbar button, .order-toolbar button { width: 100%; }
  .section-toolbar { align-items: stretch; flex-direction: column; }
  .section-toolbar button { width: 100%; }
  .category-name { min-width: 0; width: 100%; }
  .category-meta { width: 100%; flex-wrap: wrap; }
  .modal-actions button { flex: 1; }
  .image-actions { grid-template-columns: 1fr; }
  .image-actions > .btn:first-of-type { grid-column: auto; }
  .inventory-summary { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 76px 1fr; }
  .home-pane-head { align-items: stretch; flex-direction: column; }
  .home-add-control { width: 100%; }
  .home-block-row { grid-template-columns: 1fr; }
  .home-block-tools { justify-content: flex-end; border-top: 1px dashed var(--line); padding: 3px 8px; }
  .home-field-grid, .home-link-grid { grid-template-columns: 1fr; }
  .home-image-field, .home-image-field.compact { grid-template-columns: 64px minmax(0, 1fr); }
  .home-image-field > img, .home-image-field > span { width: 64px; height: 64px; }
  .home-history-list > div { align-items: stretch; flex-direction: column; }
  .home-history-list .btn { width: 100%; }
  .detail-add-toolbar { display: grid; grid-template-columns: 1fr 1fr; }
  .detail-add-toolbar .btn { min-width: 0; }
  .detail-block-row { grid-template-columns: 1fr; }
  .detail-block-tools { display: flex; justify-content: flex-end; border-top: 1px dashed var(--line); padding: 3px 7px; }
  .detail-field-grid { grid-template-columns: 1fr; }
  .detail-image-fields { grid-template-columns: 68px minmax(0, 1fr); }
  .detail-image-thumb { width: 68px; height: 68px; }
  .detail-table-row { grid-template-columns: 25px minmax(0, 1fr) 32px; }
  .detail-table-row input:nth-of-type(2) { grid-column: 2; }
  .detail-table-row .icon-btn { grid-column: 3; grid-row: 1 / span 2; }
  nav button { font-size: 11px; padding-inline: 2px; }
  .import-source-head, .import-workspace-head { align-items: stretch; flex-direction: column; }
  .import-command-bar, .import-command-bar .btn { width: 100%; }
  .import-job-summary { grid-template-columns: 1fr 1fr; }
  .import-job-summary > div:nth-child(2) { border-right: 0; }
  .import-filter-bar { align-items: stretch; display: grid; grid-template-columns: 1fr 1fr; }
  .import-filter-bar select { min-width: 0; width: 100%; }
  .import-filter-bar label { grid-column: 1 / -1; }
  .import-apply-bar { align-items: stretch; flex-direction: column; }
  .import-apply-bar .primary, .import-apply-bar .btn { width: 100%; }
  .import-queue-actions { align-items: stretch; flex-direction: column; }
  .import-queue-actions button { width: 100%; }
  .import-variant-row { grid-template-columns: 1fr; }
  .ai-field-selector { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
