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

:root {
  --green: #087a55;
  --green-hover: #066443;
  --green-soft: #eaf6f3;
  --ink: #172621;
  --muted: #697581;
  --line: #dce2e8;
  --line-strong: #c8d0d8;
  --surface: #ffffff;
  --surface-alt: #f5f7f8;
  --background: #eef1f3;
  --sidebar: #172621;
  --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 { position: relative; min-height: 100vh; display: grid; place-items: center; overflow: hidden; padding: 24px; background: #e8edeb; }
.login-view::before { content: ''; position: absolute; right: -18vw; top: -48vw; width: 82vw; height: 82vw; border: 1px solid rgba(75, 197, 216, 0.2); border-radius: 50%; box-shadow: inset 0 0 0 34px rgba(8, 122, 85, 0.025); }
.login-view::after { content: ''; position: absolute; left: -16vw; bottom: -34vw; width: 62vw; height: 62vw; border: 1px solid rgba(8, 122, 85, 0.12); border-radius: 50%; }
.login-card { position: relative; z-index: 1; width: min(400px, 100%); padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 18px 54px rgba(23, 38, 33, 0.11); }
.login-brand, .side-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.login-brand { margin-bottom: 26px; }
.brand-wordmark { display: grid; width: 164px; height: 49px; flex: 0 0 auto; place-items: center; overflow: hidden; color: #fff; }
.brand-wordmark img { display: block; width: 164px; height: 49px; object-fit: contain; }
.brand-wordmark img[hidden] { display: none; }
.brand-wordmark-fallback { display: grid; width: 100%; height: 100%; box-sizing: border-box; place-items: center start; padding-left: 4px; color: var(--green); font-family: Bahnschrift, "Arial Narrow", sans-serif; font-size: 28px; font-weight: 650; line-height: 1; letter-spacing: -0.04em; }
.brand-wordmark-fallback[hidden] { display: none; }
.brand-wordmark--dark .brand-wordmark-fallback { color: #fff; }
.brand-descriptor { margin-top: 0; 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: 76px; padding: 0 6px 18px; border-bottom: 1px solid rgba(255, 255, 255, 0.12); }
.side-brand .brand-wordmark { width: 158px; height: 47px; }
.side-brand .brand-wordmark img { width: 158px; height: 47px; }
.side-brand .brand-descriptor { color: rgba(255, 255, 255, 0.56); }
nav { display: grid; gap: 14px; margin-top: 16px; }
.nav-section { display: grid; gap: 3px; }
.nav-section-title { padding: 0 12px 4px; color: rgba(255, 255, 255, 0.36); font-size: 10px; font-weight: 700; letter-spacing: 0.12em; }
nav button { min-height: 40px; display: flex; align-items: center; gap: 10px; border-radius: 6px; background: transparent; color: rgba(255, 255, 255, 0.7); padding: 9px 12px; text-align: left; }
nav button svg { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
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 { position: relative; min-height: 122px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 17px; }
.metric::before { content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 3px; background: linear-gradient(90deg, var(--green), #4bc5d8); }
.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 150px 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; }
.product-result-line { justify-content: space-between; gap: 12px; }
.product-pagination { display: inline-flex; align-items: center; gap: 7px; }
.product-pagination button { min-height: 28px; padding: 4px 8px; font-size: 11px; }
.product-pagination b { min-width: 50px; color: var(--ink); text-align: center; }
.product-batch-bar { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid #cbded4; border-radius: var(--radius); background: #f5faf7; margin-bottom: 10px; padding: 8px 10px; }
.product-batch-selection, .product-batch-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.product-batch-selection span { color: var(--muted); font-size: 12px; }
.product-batch-bar button { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.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 { position: sticky; z-index: 2; top: 0; 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; }
tbody tr.is-selected { background: #f0f8f3; }
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; }
.product-parameter-section { position: relative; }
.product-parameter-section::before { content: ''; position: absolute; top: 0; bottom: 18px; left: -18px; width: 3px; border-radius: 3px; background: var(--green); }
.parameter-grid { border: 1px solid #d9e5df; border-radius: 7px; background: #f6faf8; padding: 13px; }
.btn.compact { min-height: 30px; padding: 5px 8px; }
.batch-stock-tools { display: grid; grid-template-columns: minmax(210px, 1fr) auto minmax(180px, .8fr); align-items: end; gap: 9px; margin-bottom: 12px; border: 1px solid #d7e2dd; border-radius: 7px; background: #f4f8f6; padding: 12px; }
.batch-stock-tools label, .batch-stock-note { color: #3f4b56; font-size: 12px; font-weight: 650; }
.batch-stock-tools input { margin-top: 5px; }
.batch-stock-tools span { align-self: center; color: var(--muted); font-size: 10px; line-height: 1.5; }
.batch-stock-table table { min-width: 680px; }
.batch-stock-table td:nth-child(2) strong, .batch-stock-table td:nth-child(2) small { display: block; }
.batch-stock-table td:nth-child(2) small { margin-top: 3px; color: var(--muted); font-size: 10px; }
.batch-stock-table input[type="checkbox"] { width: 16px; min-height: 16px; height: 16px; accent-color: var(--green); }
.batch-stock-table input[type="number"] { min-width: 120px; }
.batch-stock-note { display: grid; gap: 5px; margin-top: 14px; }

.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; }
.fulfillment-section { min-width: 0; overflow: hidden; }
.fulfillment-head { min-width: 0; min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.fulfillment-head > div:first-child { min-width: 0; }
.fulfillment-head h4, .fulfillment-form-head h5, .fulfillment-subhead h5 { margin: 0; }
.fulfillment-head span, .fulfillment-form-head span { color: var(--muted); font-size: 11px; }
.fulfillment-summary { flex: 0 0 auto; display: flex; align-items: center; gap: 14px; color: var(--muted); font-size: 11px; }
.fulfillment-summary span { white-space: nowrap; }
.fulfillment-summary strong { color: var(--ink); font-size: 15px; }
.fulfillment-create-form { min-width: 0; margin-top: 14px; border: 1px solid #c9ddd1; border-radius: 6px; background: #f7faf8; overflow: hidden; }
.fulfillment-form-head { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #dce8e1; padding: 10px 12px; }
.fulfillment-form-head > div { display: grid; gap: 2px; }
.fulfillment-mode-switch { min-width: 0; border: 0; margin: 0; padding: 10px 12px 0; }
.fulfillment-mode-switch > div { width: min(100%, 480px); min-height: 40px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; }
.fulfillment-mode-switch button { min-width: 0; min-height: 40px; border: 0; border-right: 1px solid var(--line); border-radius: 0; background: var(--surface); color: var(--muted); padding: 7px; white-space: normal; }
.fulfillment-mode-switch button:last-child { border-right: 0; }
.fulfillment-mode-switch button.active { background: var(--green); color: #fff; font-weight: 700; }
.fulfillment-line-editor { min-width: 0; display: grid; margin-top: 10px; border-top: 1px solid #dce8e1; border-bottom: 1px solid #dce8e1; background: var(--surface); }
.fulfillment-line-editor > div { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 118px 112px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 9px 12px; }
.fulfillment-line-editor > div:last-child { border-bottom: 0; }
.fulfillment-line-editor label { min-width: 0; display: grid; gap: 3px; color: var(--muted); font-size: 10px; }
.fulfillment-line-editor input { width: 100%; min-width: 0; height: 34px; }
.line-product { min-width: 0; display: flex; align-items: center; gap: 9px; }
.line-product > img, .line-product > .image-placeholder { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 4px; object-fit: cover; }
.line-product > span:last-child { min-width: 0; display: grid; gap: 2px; }
.line-product strong, .line-product small { overflow-wrap: anywhere; }
.line-product small, .line-balance small { color: var(--muted); font-size: 10px; }
.line-balance { display: grid; gap: 3px; }
.fulfillment-mode-fields { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px; }
.fulfillment-mode-fields.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fulfillment-mode-fields.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fulfillment-mode-fields label { min-width: 0; }
.fulfillment-mode-fields input, .fulfillment-mode-fields select { width: 100%; min-width: 0; }
.fulfillment-submit-row { min-width: 0; min-height: 54px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid #dce8e1; padding: 9px 12px; }
.fulfillment-submit-row .form-error { min-width: 0; margin-right: auto; overflow-wrap: anywhere; }
.fulfillment-subhead { min-height: 47px; display: flex; align-items: end; border-bottom: 1px solid var(--line); padding: 14px 0 8px; }
.fulfillment-state { min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--muted); padding: 12px; text-align: center; }
.fulfillment-state.compact { min-height: 48px; }
.fulfillment-state.error { min-height: 70px; display: grid; align-content: center; gap: 3px; border-left: 3px solid #b7791f; background: #fffaf0; color: #8a5a13; text-align: left; }
.fulfillment-state.error span { overflow-wrap: anywhere; font-size: 11px; }
.fulfillment-packages { min-width: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 10px; padding-top: 10px; }
.fulfillment-package { min-width: 0; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); overflow: hidden; }
.fulfillment-package > header { min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 9px; border-bottom: 1px solid var(--line); background: var(--surface-alt); padding: 9px 11px; }
.fulfillment-package > header > div { min-width: 0; display: grid; gap: 2px; }
.fulfillment-package > header strong { overflow-wrap: anywhere; font-size: 12px; }
.package-index { color: var(--muted); font-size: 10px; }
.package-status { flex: 0 0 auto; border: 1px solid #c8d4ce; border-radius: 4px; background: #fff; color: var(--muted); padding: 4px 6px; font-size: 10px; }
.package-status.status-in_transit, .package-status.status-ready_for_pickup { border-color: #ddbd7d; background: #fff9e9; color: #8a5a13; }
.package-status.status-delivered { border-color: #a9d5ba; background: #eef9f2; color: #246b43; }
.package-status.status-exception, .package-status.status-canceled { border-color: #e3b5ba; background: #fff3f4; color: #a33b46; }
.package-body { min-width: 0; display: grid; gap: 10px; padding: 11px; }
.package-meta { min-width: 0; display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 5px 9px; margin: 0; }
.package-meta dt { color: var(--muted); font-size: 10px; }
.package-meta dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 11px; }
.package-lines { min-width: 0; display: grid; border-top: 1px dashed var(--line); border-bottom: 1px dashed var(--line); padding: 6px 0; }
.package-lines > span { min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 3px 0; overflow-wrap: anywhere; font-size: 11px; }
.package-lines small { flex: 0 0 auto; color: var(--muted); }
.integration-grid { min-width: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.integration-state { min-width: 0; min-height: 42px; display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-alt); color: var(--muted); padding: 6px 8px; font-size: 10px; }
.integration-state > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; overflow-wrap: anywhere; }
.integration-state > span:nth-child(2) strong { font-size: 10px; }
.integration-state > span:nth-child(2) small { color: inherit; font-size: 9px; line-height: 1.35; }
.integration-state .link-btn { flex: 0 0 auto; margin-left: auto; font-size: 10px; }
.integration-dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #9ba8a1; }
.integration-state[data-status="pending"] .integration-dot, .integration-state[data-status="retry_wait"] .integration-dot { background: #c58a24; }
.integration-state[data-status="succeeded"] .integration-dot { background: #2f8254; }
.integration-state[data-status="dead"] { border-color: #e3b5ba; background: #fff5f5; color: #a33b46; }
.integration-state[data-status="dead"] .integration-dot { background: #bd4550; }
.pickup-confirm-form { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 7px; border-top: 1px solid var(--line); padding-top: 9px; }
.pickup-confirm-form label { min-width: 0; }
.pickup-confirm-form input { width: 100%; min-width: 0; }
.pickup-confirm-form .form-error { grid-column: 1 / -1; }
.fulfillment-directory-state { min-width: 0; min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-left: 3px solid #b7791f; background: #fffaf0; color: #8a5a13; padding: 9px 12px; }
.fulfillment-directory-state span { min-width: 0; overflow-wrap: anywhere; font-size: 11px; }
.fulfillment-directory-state .link-btn { flex: 0 0 auto; }
.fulfillment-timeline { min-width: 0; display: grid; padding-top: 8px; }
.fulfillment-timeline > div { min-width: 0; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 8px; }
.fulfillment-timeline > div:not(:last-child) .timeline-marker::after { content: ''; position: absolute; top: 9px; left: 3px; width: 1px; height: calc(100% + 19px); background: var(--line); }
.timeline-marker { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-top: 5px; }
.fulfillment-timeline p { min-width: 0; display: grid; gap: 2px; margin: 0; padding-bottom: 13px; }
.fulfillment-timeline strong { overflow-wrap: anywhere; font-size: 11px; }
.fulfillment-timeline small { color: var(--muted); overflow-wrap: anywhere; font-size: 10px; }

/* 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; }
.category-decoration-scope { position: relative; min-height: 92px; display: grid; grid-template-columns: minmax(280px, 1fr) minmax(260px, 380px); align-items: center; gap: 24px; overflow: hidden; border: 1px solid #244c62; border-radius: var(--radius); background: linear-gradient(112deg, #12394d 0%, #174e62 62%, #1b5c69 100%); color: #fff; padding: 17px 20px; margin-bottom: 12px; }
.category-decoration-scope::after { content: ''; position: absolute; right: 32%; top: -62px; width: 180px; height: 180px; border: 1px solid rgba(255, 206, 79, .25); border-radius: 50%; box-shadow: inset 0 0 0 24px rgba(255, 255, 255, .025); pointer-events: none; }
.category-decoration-identity { min-width: 0; display: grid; gap: 2px; }
.category-decoration-identity > span { color: #ffcf5a; font-family: Consolas, monospace; font-size: 9px; font-weight: 700; letter-spacing: 2px; }
.category-decoration-identity > strong { font-size: 23px; letter-spacing: .5px; }
.category-decoration-identity > small { color: rgba(255,255,255,.72); font-size: 11px; }
.category-decoration-scope > label { position: relative; z-index: 1; color: rgba(255,255,255,.78); font-size: 11px; font-weight: 650; }
.category-decoration-scope select { margin-top: 6px; border-color: rgba(255,255,255,.26); background: #fff; color: var(--ink); }
.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-image-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }

/* VPS material library */
body.media-picker-open { overflow: hidden; }
.media-command { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; padding: 25px 28px; border: 1px solid #b9c9cc; border-radius: 8px; color: #fff; background: linear-gradient(118deg, #102d35 0%, #174652 62%, #1d5963 100%); box-shadow: 0 12px 28px rgba(11, 42, 49, .12); overflow: hidden; position: relative; }
.media-command::after { content: ""; position: absolute; width: 260px; height: 260px; border: 1px solid rgba(255,255,255,.1); transform: rotate(32deg); right: -115px; top: -130px; }
.media-command > * { position: relative; z-index: 1; }
.media-command h3 { margin: 3px 0 7px; font: 700 28px/1.1 var(--font-display); letter-spacing: .02em; }
.media-command p { margin: 0; max-width: 680px; color: #c8dce0; }
.media-eyebrow, .media-picker-dialog header span { display: block; color: #80c5ca; font: 700 10px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .18em; }
.media-command-actions { display: flex; gap: 9px; flex: 0 0 auto; }
.media-command-actions .btn { border-color: rgba(255,255,255,.34); background: rgba(255,255,255,.08); color: #fff; }
.media-command-actions .primary { background: #d7a633; border-color: #d7a633; color: #172c35; }
.media-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 8px; margin-top: 13px; background: var(--surface); }
.media-metrics > div { min-width: 0; padding: 16px 19px; border-right: 1px solid var(--line); }
.media-metrics > div:last-child { border-right: 0; }
.media-metrics span, .media-metrics small { display: block; color: var(--muted); }
.media-metrics strong { display: block; margin: 4px 0 2px; color: var(--ink); font: 700 23px/1.15 var(--font-display); overflow: hidden; text-overflow: ellipsis; }
.media-notice { margin-top: 12px; padding: 10px 13px; border: 1px solid #c8d8d9; border-radius: 6px; color: var(--green); background: #f2f8f7; }
.media-upload-progress { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-bottom: 1px solid #d3dfe0; background: #f2f8f7; color: #245861; }
.media-upload-progress span { width: 8px; height: 8px; border-radius: 50%; background: #d6a436; box-shadow: 0 0 0 5px rgba(214,164,54,.15); animation: media-pulse 1.2s ease-in-out infinite; }
@keyframes media-pulse { 50% { box-shadow: 0 0 0 8px rgba(214,164,54,0); } }
.media-workbench { display: grid; grid-template-columns: 176px minmax(0, 1fr) 270px; min-height: 570px; margin-top: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; }
.media-kinds { padding: 20px 14px; border-right: 1px solid var(--line); background: #f5f8f8; }
.media-kinds h4 { margin: 0 8px 11px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.media-kind { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; margin: 3px 0; padding: 0 10px; border: 1px solid transparent; border-radius: 5px; color: #526970; background: transparent; text-align: left; cursor: pointer; }
.media-kind strong { min-width: 28px; padding: 2px 6px; border-radius: 9px; color: #6b7e83; background: #e7eeee; font-size: 11px; text-align: center; }
.media-kind.active { border-color: #b9ced0; color: #184f57; background: #fff; box-shadow: 0 3px 9px rgba(17,58,65,.06); }
.media-kind.active strong { color: #fff; background: #23636b; }
.media-cold-label { margin: 26px 4px 0; padding: 13px 11px; border-left: 3px solid #d2a13a; color: #4d696f; background: #eaf1f1; }
.media-cold-label span, .media-cold-label small { display: block; font-size: 10px; }
.media-cold-label strong { display: block; margin: 4px 0; color: #1d565e; font: 700 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; }
.media-browser { min-width: 0; padding: 17px; }
.media-toolbar { display: flex; gap: 8px; }
.media-toolbar input { flex: 1; min-width: 100px; }
.media-filter-panel, .media-picker-filters { padding: 13px; border: 1px solid #d0dcde; border-radius: 7px; background: #f6f9f9; }
.media-filter-fields { display: grid; grid-template-columns: repeat(4, minmax(112px, 1fr)); gap: 9px; }
.media-filter-fields label { display: grid; gap: 4px; min-width: 0; }
.media-filter-fields label > span { color: #60767b; font-size: 10px; }
.media-filter-fields select { width: 100%; min-width: 0; height: 34px; padding: 0 28px 0 9px; font-size: 11px; background-color: #fff; }
.media-filter-search { display: flex; gap: 7px; margin-top: 10px; }
.media-filter-search input { flex: 1; min-width: 100px; }
.media-result-line { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 1px 10px; color: var(--muted); font-size: 12px; }
.media-result-line strong { color: var(--ink); }
.media-batch-bar, .media-picker-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; padding: 8px 9px; border: 1px solid #d5dfe1; border-radius: 6px; background: #f9fbfb; }
.media-batch-bar > div, .media-picker-tools > div { display: flex; flex-wrap: wrap; gap: 6px; }
.media-batch-bar button, .media-picker-tools button { min-height: 32px; padding: 6px 10px; font-size: 11px; }
.media-grid, .media-picker-grid { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); grid-auto-rows: max-content; gap: 11px; align-content: start; }
.media-card { display: block; min-width: 0; padding: 0; border: 1px solid #cfdbdd; border-radius: 6px; color: inherit; background: #fff; overflow: hidden; text-align: left; cursor: pointer; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
.media-card:hover { border-color: #83aeb3; transform: translateY(-1px); box-shadow: 0 7px 16px rgba(22,66,74,.09); }
.media-card.selected { border-color: #24636b; box-shadow: 0 0 0 2px rgba(36,99,107,.16); }
.media-card.active:not(.selected) { border-color: #83aeb3; }
.media-card-preview { display: block; position: relative; height: clamp(108px, 13vw, 158px); background: #e9eff0; overflow: hidden; }
.media-card-preview img, .media-card-preview video { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: cover; }
.media-card-fallback { position: absolute; inset: 0; display: grid; place-items: center; color: #72898e; font-size: 11px; }
.media-card-preview i { position: absolute; top: 7px; left: 7px; padding: 3px 5px; border-radius: 3px; color: #fff; background: rgba(16,45,53,.78); font: 700 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .09em; font-style: normal; }
.media-card-preview .media-check { position: absolute; z-index: 2; right: 8px; top: 8px; width: 23px; height: 23px; display: grid; place-items: center; border: 2px solid #fff; border-radius: 4px; color: transparent; background: rgba(255,255,255,.8); box-shadow: 0 0 0 1px rgba(25,66,74,.35); }
.media-card.selected .media-check { color: #fff; background: #24636b; }
.media-card-copy { display: block; min-width: 0; padding: 9px 10px 10px; }
.media-card-copy strong, .media-card-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card-copy strong { color: #20383e; font-size: 12px; }
.media-card-copy small { margin-top: 4px; color: #788b90; font-size: 10px; }
.media-empty { grid-column: 1 / -1; min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 1px dashed #c8d6d8; border-radius: 7px; color: var(--muted); background: #fafcfc; }
.media-inspector { min-width: 0; padding: 17px; border-left: 1px solid var(--line); background: #f8fafa; }
.media-inspector-preview { aspect-ratio: 1 / .8; border: 1px solid #ccd9da; border-radius: 6px; background: #e9eff0; overflow: hidden; }
.media-inspector-preview img, .media-inspector-preview video { display: block; width: 100%; height: 100%; object-fit: contain; }
.media-asset-kind { display: inline-block; margin-top: 14px; padding: 3px 7px; border-radius: 3px; color: #28606a; background: #e1eded; font-size: 10px; }
.media-inspector h4 { margin: 7px 0 13px; overflow-wrap: anywhere; }
.media-inspector dl { display: grid; grid-template-columns: 72px 1fr; gap: 8px; margin: 0; font-size: 11px; }
.media-inspector dt { color: var(--muted); }.media-inspector dd { margin: 0; color: #2b454b; }
.media-url { margin-top: 16px; padding: 9px; border: 1px solid #d4dfe0; border-radius: 5px; background: #fff; }
.media-url span { display: block; color: var(--muted); font-size: 10px; }
.media-url code { display: block; margin-top: 5px; overflow: hidden; color: #245a62; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.media-inspector-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }
.media-inspector-empty { min-height: 360px; display: grid; place-items: center; color: var(--muted); }
.media-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 7px; margin-top: 13px; color: var(--muted); font-size: 11px; }
.media-pagination button { min-height: 32px; padding: 6px 10px; }
.media-picker { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 24px; background: rgba(10,27,32,.7); backdrop-filter: blur(4px); }
.media-picker.hidden { display: none; }
.media-picker-dialog { display: flex; flex-direction: column; width: min(1080px, 96vw); height: min(760px, 92vh); border: 1px solid #9eb5b8; border-radius: 8px; background: #f7f9f9; box-shadow: 0 30px 80px rgba(2,18,22,.34); overflow: hidden; }
.media-picker-dialog > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 18px 21px; color: #fff; background: #153b44; }
.media-picker-dialog header h3 { margin: 3px 0; color: #fff; }.media-picker-dialog header p { margin: 0; color: #bcd2d5; font-size: 12px; }
.media-picker-dialog header .icon-btn { border-color: rgba(255,255,255,.25); color: #fff; background: rgba(255,255,255,.06); }
.media-picker-filters { margin: 12px 16px 8px; padding: 10px; }
.media-picker-filters .media-filter-fields { grid-template-columns: repeat(6, minmax(105px, 1fr)); }
.media-picker-filters .media-filter-search { margin-top: 8px; }
.media-picker-tools { margin: 0 16px 8px; }
.media-picker-grid { flex: 1; grid-template-columns: repeat(5, minmax(130px, 1fr)); padding: 16px; overflow-y: auto; }
.media-picker-dialog > footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 13px 17px; border-top: 1px solid var(--line); background: #fff; }
.media-picker-dialog > footer > div { display: flex; gap: 8px; }
.media-picker-dialog > footer .media-picker-selection { align-items: center; gap: 14px; }
.media-picker-selection .media-pagination { margin: 0; }
.field-with-button { display: flex; gap: 8px; align-items: stretch; }.field-with-button input { flex: 1; }
@media (max-width: 1180px) { .media-workbench { grid-template-columns: 150px minmax(0, 1fr); }.media-inspector { display: none; }.media-filter-fields { grid-template-columns: repeat(3, minmax(112px, 1fr)); }.media-grid { grid-template-columns: repeat(3, minmax(120px, 1fr)); }.media-picker-filters .media-filter-fields { grid-template-columns: repeat(3, minmax(105px, 1fr)); }.media-picker-grid { grid-template-columns: repeat(4, minmax(120px, 1fr)); } }
@media (max-width: 760px) { .media-command { align-items: flex-start; flex-direction: column; padding: 20px; }.media-command-actions { width: 100%; }.media-command-actions > * { flex: 1; }.media-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }.media-metrics > div:nth-child(2) { border-right: 0; }.media-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }.media-workbench { display: block; }.media-kinds { display: flex; gap: 6px; padding: 10px; border: 0; border-bottom: 1px solid var(--line); }.media-kinds h4, .media-cold-label { display: none; }.media-kind { width: auto; flex: 1; margin: 0; }.media-browser { padding: 11px; }.media-filter-fields, .media-picker-filters .media-filter-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }.media-filter-search { flex-wrap: wrap; }.media-filter-search input { flex-basis: 100%; }.media-result-line span { display: block; }.media-batch-bar, .media-picker-tools { align-items: stretch; flex-direction: column; }.media-batch-bar > button, .media-picker-tools > button { width: 100%; }.media-grid { grid-template-columns: repeat(2, minmax(110px, 1fr)); }.media-card-preview { height: 112px; }.media-pagination { justify-content: space-between; }.media-picker { padding: 0; }.media-picker-dialog { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; }.media-picker-filters { margin: 9px; max-height: 276px; overflow-y: auto; }.media-picker-tools { margin: 0 9px 7px; }.media-picker-grid { min-height: 0; grid-template-columns: repeat(2, minmax(110px, 1fr)); padding: 9px; }.media-picker-dialog > footer { align-items: stretch; flex-direction: column; padding: 9px 12px; }.media-picker-dialog > footer .media-picker-selection { justify-content: space-between; }.media-picker-dialog > footer > div:last-child { justify-content: flex-end; }.media-picker-selection .media-pagination span { display: none; }.field-with-button { align-items: stretch; flex-direction: column; } }
.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); }

/* Unified mini-program rich text workbench */
.mini-html-workbench { overflow: hidden; border: 1px solid #cfdad5; border-radius: 8px; background: #f7f9f8; }
.mini-html-head { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #29493f; background: #142b25; color: #fff; padding: 16px 18px; }
.mini-html-head h5 { margin-top: 3px; font-size: 18px; letter-spacing: .2px; }
.mini-html-head p { margin-top: 4px; color: #b9cac4; font-size: 11px; }
.mini-html-eyebrow { color: #72c3a4; font: 700 9px/1.2 Consolas, monospace; letter-spacing: 1.6px; }
.mini-html-badges { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.mini-html-badges span { border: 1px solid #42685a; border-radius: 999px; background: #1d3b32; color: #c8ddd5; padding: 5px 9px; font-size: 10px; white-space: nowrap; }
.mini-html-toolbar { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--line); background: #edf2ef; padding: 8px 10px; }
.mini-html-tabs { display: inline-flex; overflow: hidden; border: 1px solid #b8c8c0; border-radius: 6px; background: #fff; }
.mini-html-tabs button { min-height: 34px; background: transparent; color: #5c6963; padding: 6px 12px; font-size: 11px; }
.mini-html-tabs button + button { border-left: 1px solid #d7dfdb; }
.mini-html-tabs button.active { background: var(--green); color: #fff; font-weight: 700; }
.mini-html-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.mini-html-file-button { position: relative; overflow: hidden; cursor: pointer; }
.mini-html-file-button input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.mini-html-layout { min-height: 610px; display: grid; grid-template-columns: minmax(390px, 1.2fr) minmax(310px, .8fr); }
.mini-html-edit-pane, .mini-html-preview-pane { min-width: 0; display: flex; flex-direction: column; }
.mini-html-edit-pane { border-right: 1px solid var(--line); background: #fff; }
.mini-html-preview-pane { background: #e8edeb; }
.mini-html-pane-title { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); background: #fafcfb; padding: 10px 13px; }
.mini-html-pane-title > div:first-child { min-width: 0; }
.mini-html-pane-title strong, .mini-html-pane-title span { display: block; }
.mini-html-pane-title strong { color: #263a32; font-size: 12px; }
.mini-html-pane-title span, .mini-html-pane-title small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.mini-html-pane-title small { max-width: 52%; text-align: right; line-height: 1.45; }
.mini-html-edit-body { min-height: 0; display: flex; flex: 1; flex-direction: column; padding: 12px; }
.mini-html-formatbar { min-height: 40px; display: flex; align-items: center; flex-wrap: wrap; gap: 5px; border: 1px solid var(--line); border-radius: 6px 6px 0 0; background: #eef3f0; padding: 6px; }
.format-group { display: inline-flex; align-items: center; gap: 2px; border-right: 1px solid #cbd7d1; padding-right: 5px; }
.format-group:last-child { border-right: 0; }
.mini-html-formatbar select { width: auto; min-height: 30px; border-color: #c8d4cf; background: #fff; padding: 3px 25px 3px 7px; font-size: 11px; }
.mini-html-formatbar button { min-width: 32px; min-height: 28px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #344a40; padding: 3px 7px; font-size: 11px; }
.mini-html-formatbar button:hover, .mini-html-formatbar button:focus-visible { border-color: #b8c9c1; background: #fff; }
.format-color { position: relative; width: 30px; height: 28px; display: grid; place-items: center; overflow: hidden; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #253b33; font-weight: 750; cursor: pointer; }
.format-color:hover { border-color: #b8c9c1; background: #fff; }
.format-color span { border-bottom: 3px solid #172c35; line-height: 18px; }
.format-color.highlight span { border-bottom-color: #f0c95a; background: #fff0b8; }
.format-color input { position: absolute; inset: auto 0 0; width: 100%; min-height: 5px; height: 5px; border: 0; opacity: .01; padding: 0; cursor: pointer; }
.mini-html-visual, .mini-html-source { width: 100%; min-height: 470px; flex: 1; overflow: auto; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 6px 6px; background: #fff; }
.mini-html-visual { color: #24313b; font-size: 14px; line-height: 1.7; outline: none; }
.mini-html-visual:focus { border-color: #6aa78d; box-shadow: inset 0 0 0 1px #6aa78d; }
.mini-html-visual img, .mini-html-preview-content img { max-width: 100%; height: auto; }
.mini-html-visual td, .mini-html-visual th { position: relative; }
.mini-html-visual .mini-table-cell-active { outline: 2px solid #37a875; outline-offset: -2px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.7); }
.mini-table-context-menu { position: fixed; z-index: 320; width: min(248px, calc(100vw - 16px)); max-height: calc(100vh - 16px); overflow: auto; border: 1px solid #345248; border-radius: 8px; background: #13231e; color: #e7f0ec; box-shadow: 0 18px 42px rgba(6,18,13,.32), 0 2px 8px rgba(6,18,13,.2); }
.mini-table-context-menu header { border-bottom: 1px solid #365047; background: #172b24; padding: 11px 13px; }
.mini-table-context-menu header span { display: block; color: #70c49c; font: 750 8px/1 Consolas, monospace; letter-spacing: 1.5px; }
.mini-table-context-menu header strong { display: block; margin-top: 6px; color: #fff; font-size: 12px; }
.mini-table-context-menu header small { display: block; margin-top: 3px; color: #89a097; font-size: 9px; }
.mini-table-context-menu section { padding: 7px 6px; }
.mini-table-context-menu section + section { border-top: 1px solid #30483f; }
.mini-table-context-menu section > span { display: block; color: #6f8a80; padding: 2px 8px 5px; font: 700 8px/1 Consolas, monospace; letter-spacing: 1.2px; }
.mini-table-context-menu button { width: 100%; min-height: 35px; display: grid; grid-template-columns: 29px minmax(0,1fr) auto; align-items: center; gap: 7px; border-radius: 4px; background: transparent; color: #dce8e3; padding: 5px 8px; text-align: left; font-size: 11px; }
.mini-table-context-menu button:hover, .mini-table-context-menu button:focus-visible { background: #234138; color: #fff; outline: none; }
.mini-table-context-menu button b { color: #79c9a4; font: 750 10px/1 Consolas, monospace; text-align: center; }
.mini-table-context-menu button small { color: #9baea7; font-size: 8px; text-align: right; }
.mini-table-context-menu button.danger { color: #ffcfbf; }.mini-table-context-menu button.danger b { color: #ee9579; }
.mini-table-context-menu button.danger:hover, .mini-table-context-menu button.danger:focus-visible { background: #432a23; }
.mini-table-context-menu button:disabled { color: #60756c; cursor: not-allowed; }.mini-table-context-menu button:disabled b { color: #526b61; }.mini-table-context-menu button:disabled:hover { background: transparent; }
.mini-html-source { resize: none; padding: 13px; font: 12px/1.65 Consolas, 'Courier New', monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.mini-html-help { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.55; }
.mini-html-preview-stage { min-height: 0; flex: 1; overflow: auto; padding: 16px; }
.mini-html-device { overflow: hidden; border: 1px solid #bac7c1; border-radius: 18px; background: #fff; box-shadow: 0 16px 38px rgba(21, 45, 37, .15); transition: width .18s ease; }
.mini-html-preview-stage.phone .mini-html-device { width: min(100%, 360px); margin: 0 auto; }
.mini-html-preview-stage.desktop .mini-html-device { width: 100%; border-radius: 8px; }
.mini-html-device-bar { height: 38px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #e0e6e3; background: #f8faf9; color: #5a6962; padding: 0 14px; font-size: 10px; }
.mini-html-device-bar i { width: 46px; height: 5px; border-radius: 99px; background: #c8d3ce; }
.mini-html-preview-content { min-height: 540px; overflow: hidden; background: #fff; color: #24313b; overflow-wrap: anywhere; }
.mini-html-preview-content > * { max-width: 100%; box-sizing: border-box; }
.mini-html-preview-content table { max-width: 100%; border-collapse: collapse; }
.mini-html-empty { min-height: 260px; display: grid; place-items: center; background: #f4f7f5; color: #7a8781; padding: 24px; text-align: center; }
.detail-import-preview .mini-html-preview-content { width: min(100%, 330px); min-height: 350px; margin: 0 auto; }

@media (max-width: 1080px) {
  .mini-html-layout { grid-template-columns: 1fr; }
  .mini-html-edit-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .mini-html-preview-stage.phone .mini-html-device { width: min(100%, 390px); }
}

@media (max-width: 760px) {
  .category-decoration-scope { grid-template-columns: 1fr; gap: 12px; }
  .mini-html-head, .mini-html-toolbar { align-items: stretch; flex-direction: column; }
  .mini-html-badges, .mini-html-actions { justify-content: flex-start; }
  .mini-html-tabs { width: 100%; }
  .mini-html-tabs button { flex: 1; }
  .mini-html-actions .btn, .mini-html-actions .ghost { flex: 1; }
  .mini-html-pane-title { align-items: flex-start; flex-direction: column; }
  .mini-html-pane-title small { max-width: none; text-align: left; }
  .mini-html-visual, .mini-html-source { min-height: 390px; }
  .mini-html-preview-stage { padding: 8px; }
}

/* 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; }
.ai-listing-kicker { display: block; margin-bottom: 3px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: .16em; }
.ai-listing-rail { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); background: #eef4f1; }
.ai-listing-rail > div { position: relative; min-width: 0; min-height: 74px; display: flex; align-items: center; gap: 10px; border-right: 1px solid #cfddd6; padding: 12px 14px; }
.ai-listing-rail > div:last-child { border-right: 0; }
.ai-listing-rail > div:not(:last-child)::after { content: ''; position: absolute; z-index: 1; right: -5px; width: 9px; height: 9px; border-top: 1px solid #9db7ab; border-right: 1px solid #9db7ab; background: #eef4f1; transform: rotate(45deg); }
.ai-listing-rail b { width: 26px; height: 26px; flex: 0 0 26px; display: grid; place-items: center; border: 1px solid #91aa9e; border-radius: 50%; color: var(--green); font-size: 9px; }
.ai-listing-rail span, .ai-listing-rail strong, .ai-listing-rail small { min-width: 0; display: block; }
.ai-listing-rail strong { color: #2d4037; font-size: 11px; }
.ai-listing-rail small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.ai-web-intake { min-height: 82px; display: grid; grid-template-columns: 170px minmax(220px, 1fr) auto; align-items: center; gap: 10px 12px; border-bottom: 1px solid #b8cfc4; background: linear-gradient(90deg, #e8f2ed 0, #f8fbf9 58%, #fff 100%); padding: 12px 14px; }
.ai-web-intake-mark { min-width: 0; display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 8px; }
.ai-web-intake-mark span { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid #81a895; border-radius: 50%; color: var(--green); font: 800 9px/1 Consolas, monospace; letter-spacing: .08em; }
.ai-web-intake-mark b { color: #2c4338; font-size: 12px; }
.ai-web-intake label { min-width: 0; }
.ai-web-intake input { width: 100%; background: rgba(255, 255, 255, .92); }
.ai-web-intake button { white-space: nowrap; }
.ai-web-intake > small { grid-column: 2 / -1; margin-top: -7px; color: var(--muted); font-size: 9px; }
.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; }
.ai-listing-controls { display: grid; grid-template-columns: minmax(0, 1fr) 285px; border-bottom: 1px solid var(--line); }
.ai-listing-brief { min-width: 0; display: grid; grid-template-columns: 210px minmax(0, 1fr); align-items: center; gap: 12px; border-right: 1px solid var(--line); padding: 12px 14px; }
.ai-listing-brief span, .ai-listing-brief strong, .ai-listing-brief small { display: block; }
.ai-listing-brief strong { color: var(--ink); font-size: 11px; }
.ai-listing-brief small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.ai-listing-brief textarea { min-height: 62px; resize: vertical; font-size: 11px; line-height: 1.55; }
.ai-listing-toggle { min-width: 0; display: flex; align-items: center; gap: 10px; background: #f4f8f6; padding: 12px 14px; cursor: pointer; }
.ai-listing-toggle.disabled { opacity: .68; cursor: not-allowed; }
.ai-listing-toggle input { width: 34px; height: 18px; min-height: 0; flex: 0 0 34px; accent-color: var(--green); }
.ai-listing-toggle span, .ai-listing-toggle strong, .ai-listing-toggle small { min-width: 0; display: block; }
.ai-listing-toggle strong { color: var(--green); font-size: 11px; }
.ai-listing-toggle small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.ai-evidence-lock { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #ead6aa; background: #fffaf0; color: #6f5830; padding: 8px 14px; font-size: 10px; line-height: 1.55; }
.ai-evidence-lock strong { flex: 0 0 auto; border: 1px solid #c49b4e; border-radius: 3px; padding: 2px 5px; color: #8b6219; font-size: 9px; letter-spacing: .08em; }
.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-tools { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); background: #fbfcfc; }
.import-job-tools label { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.import-job-tools input, .import-job-check input { accent-color: var(--green); }
.import-job-tools .import-clear-jobs { min-height: 28px; padding: 4px 8px; color: #b42318; font-size: 10px; }
.import-job-notice { padding: 7px 10px; border-bottom: 1px solid #b8e2d2; background: var(--green-soft); color: var(--green); font-size: 10px; }
.import-job-entry { display: grid; grid-template-columns: 34px minmax(0, 1fr); border-bottom: 1px solid var(--line); background: transparent; }
.import-job-entry.active { background: #f0f8f3; box-shadow: inset 3px 0 0 var(--green); }
.import-job-check { display: flex; align-items: center; justify-content: center; cursor: pointer; }
.import-job-check:has(input:disabled) { cursor: not-allowed; opacity: .42; }
.import-job-row { width: 100%; min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 7px; border: 0; background: transparent; color: var(--ink); padding: 9px 10px 9px 0; text-align: left; }
.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-selection-bar { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid #d5e2db; border-radius: 6px; background: #f6faf8; margin: 10px 0; padding: 7px 9px; }
.import-selection-bar > div { display: flex; flex-wrap: wrap; gap: 6px; }
.import-selection-bar button { min-height: 32px; padding: 5px 9px; font-size: 11px; }
.import-selection-bar span { color: var(--muted); font-size: 11px; }
.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-thumb { position: relative; width: 42px; height: 42px; display: grid; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); background: var(--surface-alt); }
.import-product-thumb img { width: 100%; height: 100%; object-fit: cover; }.import-product-thumb b { padding: 3px; font-size: 8px; text-align: center; }
.import-product-thumb em { position: absolute; right: 2px; bottom: 2px; padding: 1px 3px; border-radius: 2px; color: #fff; background: rgba(15,48,55,.78); font-size: 8px; font-style: normal; }
.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-review-images { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--line); }.import-review-images > div:last-child { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.import-review-images figure { margin: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-alt); }.import-review-images img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }.import-review-images figcaption { padding: 5px; color: var(--muted); font-size: 9px; text-align: center; }
.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; }
.ai-review-manifest { border: 1px solid #bfd3c8; border-top: 3px solid var(--green); background: #f7faf8; }
.ai-review-manifest-head { min-height: 54px; display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid #d6e2dc; padding: 9px 11px; }
.ai-review-manifest-head span:first-child, .ai-review-manifest-head b, .ai-review-manifest-head small { display: block; }
.ai-review-manifest-head b { color: var(--green); font-size: 12px; }
.ai-review-manifest-head small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.ai-review-facts { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #d6e2dc; }
.ai-review-facts > div { min-width: 0; min-height: 78px; display: grid; align-content: center; gap: 3px; border-right: 1px solid #d6e2dc; padding: 9px; }
.ai-review-facts > div:last-child { border-right: 0; }
.ai-review-facts small, .ai-review-facts strong, .ai-review-facts span { display: block; overflow-wrap: anywhere; }
.ai-review-facts small { color: var(--muted); font-size: 8px; text-transform: uppercase; letter-spacing: .06em; }
.ai-review-facts strong { color: var(--ink); font-size: 11px; }
.ai-review-facts span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.ai-detail-preview-wrap { width: min(100%, 350px); margin: 12px auto; border: 1px solid #cad5d0; border-radius: 16px 16px 4px 4px; background: #e8eeeb; padding: 9px; box-shadow: 0 8px 18px rgba(24, 45, 35, .08); }
.ai-detail-preview-label { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px 7px; }
.ai-detail-preview-label strong { color: #30423a; font-size: 10px; }
.ai-detail-preview-label span { color: var(--muted); font-size: 8px; }
.ai-detail-preview-wrap .detail-preview-content { min-height: 260px; max-height: 420px; overflow-y: auto; }
.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; }
  .fulfillment-packages { 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 { display: flex; gap: 4px; margin: 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  nav::-webkit-scrollbar { display: none; }
  .nav-section { display: contents; }
  .nav-section-title { display: none; }
  nav button { min-width: 82px; min-height: 42px; flex: 0 0 auto; justify-content: center; gap: 6px; padding: 8px 9px; text-align: center; }
  nav button svg { width: 15px; height: 15px; flex-basis: 15px; }
  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; }
  .product-batch-bar { align-items: stretch; flex-direction: column; }
  .product-batch-selection, .product-batch-actions { width: 100%; }
  .product-batch-actions button { flex: 1; }
  .product-result-line { align-items: flex-start; flex-direction: column; padding: 7px 3px; }
  .import-selection-bar { align-items: stretch; flex-direction: column; }
  .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; }
  .fulfillment-mode-fields.two, .fulfillment-mode-fields.three { grid-template-columns: 1fr; }
  .fulfillment-line-editor > div { grid-template-columns: minmax(0, 1fr) 104px; gap: 8px; }
  .fulfillment-line-editor .line-product { grid-column: 1 / -1; }
  .fulfillment-summary { gap: 9px; }
}

@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; }
  .ai-listing-rail { grid-template-columns: 1fr 1fr; }
  .ai-listing-rail > div:nth-child(2) { border-right: 0; }
  .ai-listing-rail > div:nth-child(-n+2) { border-bottom: 1px solid #cfddd6; }
  .ai-listing-rail > div:nth-child(2)::after { display: none; }
  .ai-web-intake { grid-template-columns: 1fr; }
  .ai-web-intake-mark { grid-template-columns: 32px minmax(0, 1fr); }
  .ai-web-intake-mark span { width: 32px; height: 32px; }
  .ai-web-intake > small { grid-column: auto; margin-top: -3px; }
  .ai-listing-controls, .import-source-grid, .import-main-layout { grid-template-columns: 1fr; }
  .ai-listing-brief { grid-template-columns: 1fr; border-right: 0; border-bottom: 1px solid var(--line); }
  .ai-evidence-lock { align-items: flex-start; }
  .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; }
  .ai-review-facts { grid-template-columns: 1fr; }
  .ai-review-facts > div { min-height: 62px; border-right: 0; border-bottom: 1px solid #d6e2dc; }
  .ai-review-facts > div:last-child { border-bottom: 0; }
  .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 { min-width: 78px; font-size: 12px; padding-inline: 8px; }
  .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; }
  .fulfillment-head { align-items: stretch; flex-direction: column; }
  .fulfillment-summary { width: 100%; justify-content: space-between; }
  .fulfillment-form-head { align-items: stretch; flex-direction: column; }
  .fulfillment-mode-switch > div { grid-template-columns: 1fr; }
  .fulfillment-mode-switch button { border-right: 0; border-bottom: 1px solid var(--line); }
  .fulfillment-mode-switch button:last-child { border-bottom: 0; }
  .fulfillment-line-editor > div { grid-template-columns: minmax(0, 1fr) 92px; }
  .fulfillment-submit-row { align-items: stretch; flex-direction: column; }
  .fulfillment-submit-row .primary { width: 100%; }
  .integration-grid { grid-template-columns: 1fr; }
  .pickup-confirm-form { grid-template-columns: 1fr; }
  .pickup-confirm-form .btn, .pickup-confirm-form .form-error { grid-column: 1; }
}

/* Detail system refinement: quiet industrial hierarchy, with a phone-first canvas. */
.detail-preview-content,
.mini-html-preview-content {
  font-family: Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #203932;
  word-break: break-word;
}
.detail-preview-content { border: 1px solid #d6e3dd; box-shadow: 0 16px 32px rgba(19, 55, 43, .12); }
.detail-preview-content > * { max-width: 100%; box-sizing: border-box; }
.detail-preview-section-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 1px solid #dce8e2; padding: 2px 0 8px; }
.detail-preview-section-label span { color: #168b65; font: 800 9px/1.2 Consolas, monospace; letter-spacing: 1.6px; }
.detail-preview-section-label strong { color: #173c30; font-size: 13px; }
.detail-preview-content .detail-preview-rich { padding: 22px 18px 18px; background: #fff; color: #2a4038; font-size: 14px; line-height: 1.78; }
.detail-preview-rich h1, .detail-preview-rich h2, .detail-preview-rich h3, .detail-preview-rich h4 { color: #173c30; line-height: 1.35; }
.detail-preview-rich h1 { margin-bottom: 13px; font-size: 22px; }
.detail-preview-rich h2 { margin: 18px 0 9px; font-size: 18px; }
.detail-preview-rich h3, .detail-preview-rich h4 { margin: 15px 0 7px; font-size: 15px; }
.detail-preview-rich a { color: #087a55; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.detail-preview-content .detail-preview-media { margin: 0; border-bottom: 1px solid #edf2ef; background: #fff; }
.detail-preview-content .detail-preview-media img { background: #fff; }
.detail-preview-content figcaption { border-top: 1px solid #edf2ef; color: #667a72; padding: 8px 14px 12px; font-size: 10px; line-height: 1.5; }
.detail-preview-gallery { display: grid; gap: 0; background: #edf3f0; }
.detail-preview-table { margin: 0; background: #f7faf8; padding: 16px 14px 17px; }
.detail-preview-table table { width: 100%; table-layout: fixed; border-collapse: collapse; }
.detail-preview-table th, .detail-preview-table td { min-width: 0; overflow-wrap: anywhere; word-break: break-word; padding: 9px 10px; border: 1px solid #d7e3dd; text-align: left; font-size: 11px; line-height: 1.5; }
.detail-preview-table th { background: #eaf3ef; color: #174d3f; font-weight: 750; }
.detail-preview-table td { background: #fff; color: #344d44; }
.detail-preview-banner { border-bottom: 1px solid rgba(255,255,255,.18); padding: 30px 20px 27px; }
.detail-preview-banner small { color: rgba(255,255,255,.76); font: 750 9px/1.3 Consolas, monospace; letter-spacing: 1.4px; }
.detail-preview-banner strong { margin-top: 8px; font-size: 22px; letter-spacing: -.01em; }
.detail-preview-banner p { margin-top: 9px; font-size: 12px; line-height: 1.7; }
.detail-preview-badges { border-bottom: 1px solid #edf2ef; background: #fff; padding: 14px 14px 7px; }
.detail-preview-badges > span { border-radius: 5px; padding: 6px 9px; font-size: 10px; }
.detail-preview-icon { width: 18px; height: 18px; border: 1px solid rgba(8,122,85,.18); border-radius: 4px; background: #e8f4ef; color: #087a55; font-size: 9px; }
.detail-preview-callout { margin: 14px; border: 1px solid #bfdbfe; border-left-width: 4px; border-radius: 7px; padding: 14px 15px; }
.detail-preview-callout strong { font-size: 12px; }
.detail-preview-callout p { font-size: 11px; line-height: 1.65; }
.detail-preview-features { background: #fff; padding: 17px 14px 10px; }
.detail-preview-feature { width: 100%; display: flex; margin: 0 0 9px; border: 1px solid #dce7e2; border-left: 3px solid #087a55; border-radius: 7px; background: #f8fbf9; padding: 12px; }
.detail-preview-feature:last-child { margin-bottom: 0; }
.detail-preview-feature > div { border-top: 0; padding-top: 0; }
.detail-preview-feature strong { color: #1c4b3e; font-size: 12px; line-height: 1.4; }
.detail-preview-feature p { margin-top: 4px; color: #64766e; font-size: 10px; line-height: 1.6; }

.mini-html-workbench { border: 1px solid #c9dad2; border-radius: 12px; background: #f4f8f6; box-shadow: 0 18px 45px rgba(18, 50, 39, .11); }
.mini-html-head { min-height: 94px; border-bottom: 1px solid #244f40; background: linear-gradient(135deg, #0e2520 0%, #123f32 68%, #1b5a46 100%); padding: 18px 20px; }
.mini-html-head h5 { color: #fff; font-size: 19px; letter-spacing: .1px; }
.mini-html-head p { color: #b7cdc4; font-size: 11px; line-height: 1.55; }
.mini-html-eyebrow { color: #83d6b5; letter-spacing: 1.8px; }
.mini-html-badges { gap: 7px; }
.mini-html-badges span { border: 1px solid #477865; border-radius: 5px; background: rgba(35, 89, 70, .64); color: #d1e8df; padding: 6px 9px; font: 700 9px/1 Consolas, monospace; letter-spacing: .15px; }
.mini-html-toolbar { min-height: 58px; border-bottom: 1px solid #d5e1dc; background: #f3f8f5; padding: 9px 11px; }
.mini-html-tabs { border-color: #b8cec3; border-radius: 7px; }
.mini-html-tabs button { min-height: 36px; padding-inline: 13px; font-size: 11px; }
.mini-html-tabs button.active { background: #087a55; }
.mini-html-actions { min-width: 0; }
.mini-html-actions .btn, .mini-html-actions .ghost { min-height: 36px; border-color: #c5d5cd; font-size: 11px; }
.mini-html-actions .danger-text { color: #a53a42; }
.mini-html-layout { min-height: 660px; grid-template-columns: minmax(390px, 1.08fr) minmax(330px, .92fr); }
.mini-html-edit-pane { border-right-color: #d5e1dc; }
.mini-html-preview-pane { background: linear-gradient(180deg, #eef5f2 0%, #e4ece8 100%); }
.mini-html-pane-title { min-height: 64px; border-bottom-color: #dbe5e0; background: rgba(255,255,255,.72); padding: 11px 15px; }
.mini-html-pane-title strong { color: #1d4034; font-size: 12px; }
.mini-html-pane-title span { color: #6a7d75; font: 10px/1.3 Consolas, monospace; }
.mini-html-pane-title small { color: #687c73; font-size: 10px; }
.mini-html-edit-body { padding: 14px; }
.mini-html-formatbar { border-color: #d5e1dc; border-radius: 8px 8px 0 0; background: #edf4f0; padding: 7px; }
.mini-html-formatbar select { min-height: 31px; border-color: #c7d7cf; border-radius: 5px; }
.mini-html-formatbar button { color: #23483a; }
.mini-html-visual, .mini-html-source { border-color: #d5e1dc; background: #fbfdfc; }
.mini-html-visual { min-height: 490px; color: #263d35; padding: 15px; font-size: 14px; line-height: 1.75; }
.mini-html-visual:focus { border-color: #4ca77e; box-shadow: inset 0 0 0 1px #4ca77e; }
.mini-html-visual img { display: block; max-width: 100%; height: auto; }
.mini-html-source { min-height: 490px; border-top: 1px solid #d5e1dc; border-radius: 7px; background: #122a23; color: #d7eee4; padding: 15px; font-size: 12px; line-height: 1.7; }
.mini-html-help { color: #6b7e76; font-size: 10px; }
.mini-html-preview-stage { padding: 20px; }
.mini-html-device { border: 1px solid #bacdc4; border-radius: 17px; box-shadow: 0 18px 40px rgba(19, 57, 44, .16); }
.mini-html-preview-stage.phone .mini-html-device { width: min(100%, 375px); }
.mini-html-preview-stage.desktop .mini-html-device { border-radius: 10px; }
.mini-html-device-bar { height: 42px; border-bottom-color: #dce8e2; background: #f8fbf9; color: #4f6a60; padding: 0 15px; font: 10px/1 Consolas, monospace; }
.mini-html-device-bar i { background: #b8cbc1; }
.mini-html-preview-content { min-height: 600px; background: #fff; color: #203932; }
.mini-html-preview-content table { width: 100%; table-layout: fixed; }
.mini-html-preview-content td, .mini-html-preview-content th { overflow-wrap: anywhere; word-break: break-word; }
.mini-html-preview-content h1, .mini-html-preview-content h2, .mini-html-preview-content h3, .mini-html-preview-content h4 { color: #173c30; line-height: 1.35; }
.mini-html-preview-content h1 { margin: 0 0 13px; font-size: 22px; }
.mini-html-preview-content h2 { margin: 18px 0 9px; font-size: 18px; }
.mini-html-preview-content h3, .mini-html-preview-content h4 { margin: 15px 0 7px; font-size: 15px; }
.mini-html-preview-content p, .mini-html-preview-content ul, .mini-html-preview-content ol { margin-bottom: 9px; }
.mini-html-preview-content a { color: #087a55; }
.mini-html-empty { min-height: 300px; background: #f3f8f5; color: #6f8279; }

@media (max-width: 1080px) {
  .mini-html-layout { grid-template-columns: 1fr; }
  .mini-html-edit-pane { border-right: 0; border-bottom: 1px solid #d5e1dc; }
  .mini-html-preview-stage.phone .mini-html-device { width: min(100%, 390px); }
}
@media (max-width: 760px) {
  .mini-html-workbench { border-radius: 9px; }
  .mini-html-head, .mini-html-toolbar { align-items: stretch; flex-direction: column; }
  .mini-html-head { padding: 16px; }
  .mini-html-badges, .mini-html-actions { justify-content: flex-start; }
  .mini-html-actions > .btn, .mini-html-actions > .ghost, .mini-html-actions > .mini-html-file-button { min-width: 0; flex: 1 1 140px; }
  .mini-html-pane-title { align-items: flex-start; flex-direction: column; }
  .mini-html-pane-title small { max-width: none; text-align: left; }
  .mini-html-edit-body { padding: 10px; }
  .mini-html-visual, .mini-html-source { min-height: 400px; }
  .mini-html-preview-stage { padding: 10px; }
  .mini-html-preview-stage.phone .mini-html-device { width: min(100%, 375px); }
}

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

/* Invoice review and service settings */
.invoice-toolbar { grid-template-columns: minmax(240px, 1fr) 170px auto auto; }
.invoice-workspace { min-height: 610px; display: grid; grid-template-columns: minmax(330px, 0.85fr) minmax(430px, 1.15fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.invoice-queue { min-width: 0; max-height: calc(100vh - 220px); overflow: auto; border-right: 1px solid var(--line); }
.invoice-row { width: 100%; min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); background: var(--surface); color: var(--ink); padding: 13px 15px; text-align: left; }
.invoice-row:hover { background: var(--surface-alt); }
.invoice-row.active { background: #edf6f2; box-shadow: inset 3px 0 0 var(--green); }
.invoice-row-main { min-width: 0; }
.invoice-row-main strong, .invoice-row-main small, .invoice-row-side strong, .invoice-row-side small { display: block; }
.invoice-row-main strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invoice-row-main small { margin-top: 5px; overflow-wrap: anywhere; color: var(--muted); font-size: 12px; }
.invoice-row-side { flex: 0 0 auto; text-align: right; }
.invoice-row-side strong { margin-top: 5px; font-size: 13px; }
.invoice-row-side small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.invoice-empty { min-height: 260px; display: grid; place-items: center; color: var(--muted); padding: 24px; text-align: center; }
.invoice-inspector { min-width: 0; max-height: calc(100vh - 220px); display: flex; flex-direction: column; overflow: auto; }
.invoice-detail-placeholder { min-height: 100%; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); padding: 30px; text-align: center; }
.invoice-detail-placeholder strong { color: var(--ink); font-size: 15px; }
.invoice-detail-head { min-height: 94px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); padding: 16px 18px; }
.invoice-detail-head > div { min-width: 0; }
.invoice-detail-head > div > span { color: var(--green); font-size: 11px; font-weight: 700; }
.invoice-detail-head h3 { margin-top: 3px; overflow-wrap: anywhere; font-size: 17px; }
.invoice-detail-head p { margin-top: 3px; color: var(--muted); font-size: 11px; }
.invoice-detail-body { display: grid; gap: 18px; padding: 18px; }
.invoice-detail-body section { min-width: 0; }
.invoice-detail-body h4 { margin-bottom: 9px; color: #35413b; font-size: 13px; }
.invoice-detail-grid { display: grid; grid-template-columns: 110px minmax(0, 1fr); border-top: 1px solid var(--line); }
.invoice-detail-grid dt, .invoice-detail-grid dd { min-width: 0; border-bottom: 1px solid var(--line); padding: 8px 6px; overflow-wrap: anywhere; font-size: 12px; }
.invoice-detail-grid dt { color: var(--muted); }
.invoice-detail-grid dd { color: var(--ink); }
.invoice-rejection { display: grid; gap: 4px; border-left: 3px solid var(--danger); background: var(--danger-soft); color: var(--danger); padding: 10px 12px; overflow-wrap: anywhere; font-size: 12px; }
.invoice-document-meta { display: grid; gap: 3px; border-left: 3px solid var(--green); background: var(--green-soft); padding: 10px 12px; overflow-wrap: anywhere; }
.invoice-document-meta span, .invoice-document-meta small { color: var(--muted); font-size: 11px; }
.invoice-document-meta small { word-break: break-all; }
.invoice-timeline { display: grid; gap: 0; }
.invoice-timeline > div { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 8px; min-height: 48px; }
.invoice-timeline > div > span { position: relative; width: 9px; height: 9px; margin-top: 5px; border: 2px solid var(--green); border-radius: 50%; background: var(--surface); }
.invoice-timeline > div:not(:last-child) > span::after { content: ''; position: absolute; top: 8px; left: 2px; width: 1px; height: 39px; background: var(--line-strong); }
.invoice-timeline p strong, .invoice-timeline p em, .invoice-timeline p small { display: block; }
.invoice-timeline p strong { font-size: 12px; }
.invoice-timeline p em { margin-top: 2px; color: var(--danger); font-size: 11px; font-style: normal; }
.invoice-timeline p small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.invoice-detail-actions { margin-top: auto; border-top: 1px solid var(--line); background: #fafbfb; padding: 14px 18px; }
.invoice-command-bar { display: flex; justify-content: flex-end; gap: 8px; }
.invoice-issue-flow { display: grid; grid-template-columns: minmax(210px, 1fr) minmax(250px, 1fr) auto; align-items: end; gap: 10px; }
.invoice-file-field, #invoice-issue-form label, .invoice-reject-form label { display: grid; gap: 5px; color: #3f4b56; font-size: 12px; font-weight: 650; }
.invoice-file-field small { min-height: 16px; overflow-wrap: anywhere; color: var(--muted); font-size: 10px; font-weight: 400; }
#invoice-issue-form { min-width: 0; display: grid; grid-template-columns: minmax(130px, 1fr) auto; align-items: end; gap: 8px; }
.invoice-reject-form { display: grid; gap: 9px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.invoice-reject-form > div { display: flex; justify-content: flex-end; gap: 8px; }
.invoice-terminal-note { color: var(--muted); text-align: right; font-size: 12px; }
.service-settings-layout { display: grid; grid-template-columns: minmax(420px, 760px) minmax(220px, 300px); align-items: start; gap: 14px; }
.service-settings-form-wrap { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.service-saved-at { color: var(--muted); font-size: 11px; text-align: right; }
.service-settings-form { display: grid; gap: 16px; padding: 18px; }
.service-settings-form > label:not(.service-toggle-row) { display: grid; gap: 6px; color: #3f4b56; font-size: 12px; font-weight: 650; }
.service-settings-form label small { color: var(--muted); font-size: 10px; font-weight: 400; }
.service-toggle-row { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.service-toggle-row span { min-width: 0; }
.service-toggle-row strong, .service-toggle-row small { display: block; }
.service-toggle-row small { margin-top: 3px; }
.service-toggle-row input { position: relative; width: 44px; min-height: 24px; height: 24px; flex: 0 0 44px; appearance: none; border: 0; border-radius: 12px; background: #bac3ca; padding: 0; transition: background 0.18s ease; }
.service-toggle-row input::before { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform 0.18s ease; }
.service-toggle-row input:checked { background: var(--green); }
.service-toggle-row input:checked::before { transform: translateX(20px); }
.service-channel-preview { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; border-left: 3px solid var(--green); background: var(--green-soft); padding: 10px 12px; font-size: 11px; }
.service-channel-preview strong { width: 100%; color: var(--green); }
.service-channel-preview span { color: #41534a; }
.service-settings-actions { display: flex; justify-content: flex-end; }
.service-settings-note { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px; }
.service-settings-note strong { font-size: 13px; }
.service-settings-note p { margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.ai-settings-shell { display: grid; gap: 14px; }
.ai-model-hero { position: relative; min-height: 188px; display: grid; grid-template-columns: minmax(330px, 1fr) minmax(210px, 290px) minmax(180px, 230px); align-items: center; gap: 28px; overflow: hidden; border: 1px solid #1d4437; border-radius: var(--radius); background: #102a23; color: #fff; padding: 25px 28px; }
.ai-model-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, rgba(96, 205, 144, .1), transparent 42%), repeating-linear-gradient(90deg, transparent 0 47px, rgba(255,255,255,.025) 48px), repeating-linear-gradient(0deg, transparent 0 47px, rgba(255,255,255,.025) 48px); }
.ai-model-hero-copy, .ai-engine-core, .ai-bus-state { position: relative; z-index: 1; }
.ai-model-hero-copy > span { color: #78c99b; font: 750 9px/1 Consolas, monospace; letter-spacing: 1.8px; }
.ai-model-hero-copy h2 { margin-top: 9px; font-size: clamp(23px, 2.8vw, 34px); line-height: 1.12; letter-spacing: -.035em; }
.ai-model-hero-copy p { max-width: 590px; margin-top: 10px; color: rgba(255,255,255,.66); font-size: 12px; line-height: 1.75; }
.ai-engine-core { min-height: 110px; display: grid; align-content: center; border: 1px solid rgba(116, 208, 156, .28); border-left: 3px solid #d49a34; background: rgba(255,255,255,.035); padding: 17px 19px; box-shadow: inset 0 0 26px rgba(79,191,124,.04); }
.ai-engine-core.active { border-left-color: #66ca8d; box-shadow: inset 0 0 28px rgba(79,191,124,.09), 0 0 24px rgba(79,191,124,.06); }
.ai-engine-core span, .ai-engine-core small { color: #75a88f; font: 700 8px/1.3 Consolas, monospace; letter-spacing: 1.25px; }
.ai-engine-core strong { overflow-wrap: anywhere; margin: 9px 0; color: #fff; font: 750 18px/1.2 Consolas, monospace; }
.ai-engine-core small { color: #e2b664; }
.ai-bus-state { display: flex; align-items: center; gap: 11px; }
.ai-bus-state i { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #d49a34; box-shadow: 0 0 0 5px rgba(212,154,52,.12); }
.ai-bus-state strong, .ai-bus-state small { display: block; }.ai-bus-state strong { font-size: 12px; }.ai-bus-state small { max-width: 180px; margin-top: 4px; color: rgba(255,255,255,.5); font-size: 9px; line-height: 1.5; }
.ai-settings-layout { display: grid; grid-template-columns: minmax(540px, 1fr) minmax(250px, 310px); align-items: start; gap: 14px; }
.ai-settings-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ai-settings-card .section-head { border-bottom: 1px solid var(--line); background: linear-gradient(120deg, #f8fbf9, #edf5f1); }
.ai-provider-mark { display: inline-block; margin-bottom: 4px; color: var(--green); font: 750 9px/1 Consolas, monospace; letter-spacing: 1.7px; }
.ai-config-state { flex: 0 0 auto; border: 1px solid #cdd7d2; border-radius: 999px; background: #fff; color: var(--muted); padding: 6px 10px; font-size: 10px; font-weight: 700; }
.ai-config-state.active { border-color: #9cc9b6; background: var(--green-soft); color: var(--green); }
.ai-settings-form { display: grid; gap: 16px; padding: 18px; }
.ai-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.ai-form-grid label { min-width: 0; display: grid; gap: 5px; color: #3f4b56; font-size: 12px; font-weight: 650; }
.ai-form-grid label small { color: var(--muted); font-size: 10px; font-weight: 400; line-height: 1.5; }
.ai-model-picker { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
.ai-model-picker .btn { white-space: nowrap; }
.ai-key-field { position: relative; }
.ai-key-field input { padding-right: 110px; }
.ai-key-field > span { position: absolute; top: 50%; right: 9px; color: var(--green); font-size: 10px; font-weight: 700; transform: translateY(-50%); }
.ai-clear-key { display: inline-flex; align-items: center; gap: 7px; color: var(--danger); font-size: 11px; }
.ai-clear-key input { width: 15px; min-height: 15px; height: 15px; margin: 0; accent-color: var(--danger); }
.ai-test-status { min-height: 58px; display: flex; align-items: center; gap: 10px; border: 1px solid #dbe3df; border-radius: 7px; background: #f8faf9; padding: 10px 12px; }
.ai-test-status > span { width: 9px; height: 9px; flex: 0 0 auto; border-radius: 50%; background: #9aa7a1; box-shadow: 0 0 0 4px #e7ece9; }
.ai-test-status.success > span { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.ai-test-status.failed > span { background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.ai-test-status strong, .ai-test-status small { display: block; }
.ai-test-status strong { font-size: 12px; }
.ai-test-status small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.ai-settings-actions { display: flex; justify-content: flex-end; gap: 8px; }
.ai-route-panel { overflow: hidden; border: 1px solid var(--line); border-top: 3px solid #1d4437; border-radius: var(--radius); background: var(--surface); }
.ai-route-head { padding: 16px; border-bottom: 1px solid var(--line); background: #f7faf8; }
.ai-route-head span, .ai-safety-note span { display: block; color: #73a991; font: 750 9px/1 Consolas, monospace; letter-spacing: 1.3px; }
.ai-route-head strong, .ai-route-head p { display: block; }.ai-route-head strong { margin-top: 7px; font-size: 14px; }.ai-route-head p { margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.ai-route-map { display: grid; padding: 5px 16px 9px; }
.ai-route-node { position: relative; display: flex; align-items: center; gap: 10px; min-height: 53px; border-bottom: 1px solid #edf1ef; }
.ai-route-node:last-child { border-bottom: 0; }
.ai-route-node i { width: 8px; height: 8px; flex: 0 0 auto; border: 2px solid #66ad87; border-radius: 50%; background: #fff; box-shadow: 0 0 0 4px #edf7f1; }
.ai-route-node:not(:last-child)::after { content: ''; position: absolute; left: 3px; top: 34px; width: 1px; height: 32px; background: #cde1d6; }
.ai-route-node strong, .ai-route-node small { display: block; }.ai-route-node strong { color: #273a32; font-size: 11px; }.ai-route-node small { margin-top: 3px; color: var(--muted); font-size: 9px; }
.ai-safety-note { margin: 0 12px 12px; border-left: 3px solid #d49a34; background: #fff8eb; padding: 12px; }
.ai-safety-note span { color: #b77719; }.ai-safety-note strong { display: block; margin-top: 7px; font-size: 11px; }.ai-safety-note p { margin-top: 4px; color: #75664c; font-size: 9px; line-height: 1.6; }

/* AI operations command center */
.ai-ops-shell { display: grid; gap: 14px; }
.ai-ops-hero { position: relative; min-height: 214px; display: grid; grid-template-columns: minmax(350px, 1fr) 190px minmax(200px, 260px); align-items: center; gap: 26px; overflow: hidden; border: 1px solid #1f4236; border-radius: var(--radius); background: #132b24; color: #fff; padding: 26px 28px; }
.ai-ops-hero::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, rgba(82, 187, 126, .08), transparent 40%), repeating-linear-gradient(90deg, transparent 0 44px, rgba(255,255,255,.025) 45px), repeating-linear-gradient(0deg, transparent 0 44px, rgba(255,255,255,.025) 45px); }
.ai-ops-hero-copy, .ai-ops-radar, .ai-ops-command { position: relative; z-index: 1; }
.ai-ops-hero-copy > span, .ai-ops-pane-head > div > span, .ai-ops-domain-head > div > span, .ai-ops-report-lead > span { display: block; color: #77c99b; font: 750 9px/1 Consolas, monospace; letter-spacing: 1.6px; }
.ai-ops-hero-copy h2 { margin-top: 9px; font-size: clamp(26px, 3vw, 38px); line-height: 1.1; letter-spacing: -.03em; }
.ai-ops-hero-copy > p { max-width: 610px; margin-top: 11px; color: rgba(255, 255, 255, .68); font-size: 13px; line-height: 1.75; }
.ai-ops-privacy { display: flex; align-items: center; gap: 7px; margin-top: 22px; color: rgba(255, 255, 255, .52); font-size: 10px; }
.ai-ops-privacy i { width: 7px; height: 7px; border-radius: 50%; background: #65ca8c; box-shadow: 0 0 0 4px rgba(101, 202, 140, .1); }
.ai-ops-radar { width: 166px; height: 166px; display: grid; place-items: center; justify-self: center; border: 1px solid rgba(103, 202, 145, .3); border-radius: 50%; }
.ai-ops-radar::before, .ai-ops-radar::after, .ai-ops-radar > i { content: ''; position: absolute; border: 1px solid rgba(103, 202, 145, .22); border-radius: 50%; }
.ai-ops-radar::before { inset: 24px; }.ai-ops-radar::after { inset: 48px; }
.ai-ops-radar > i:nth-child(1) { width: 1px; height: 100%; border: 0; border-left: 1px solid rgba(103, 202, 145, .2); border-radius: 0; }
.ai-ops-radar > i:nth-child(2) { width: 100%; height: 1px; border: 0; border-top: 1px solid rgba(103, 202, 145, .2); border-radius: 0; }
.ai-ops-radar > i:nth-child(3) { inset: 0; border: 0; border-radius: 50%; background: conic-gradient(from -30deg, rgba(113, 219, 156, .28), transparent 17%, transparent 100%); animation: aiOpsSweep 7s linear infinite; }
.ai-ops-radar > b { position: absolute; top: 29px; right: 33px; width: 7px; height: 7px; border-radius: 50%; background: #ffd37a; box-shadow: 0 0 0 5px rgba(255, 211, 122, .12); }
.ai-ops-radar > span { position: relative; z-index: 2; width: 62px; height: 62px; display: grid; place-content: center; border-radius: 50%; background: #173a2d; text-align: center; box-shadow: 0 0 0 1px rgba(103, 202, 145, .36), 0 0 26px rgba(79, 191, 124, .14); }
.ai-ops-radar strong, .ai-ops-radar small { display: block; }.ai-ops-radar strong { font-size: 22px; line-height: 1; }.ai-ops-radar small { margin-top: 4px; color: #88bca2; font-size: 8px; }
@keyframes aiOpsSweep { to { transform: rotate(360deg); } }
.ai-ops-command { display: grid; gap: 8px; justify-self: stretch; }
.ai-ops-command label { display: grid; gap: 5px; color: rgba(255,255,255,.54); font-size: 10px; }
.ai-ops-command select { border-color: rgba(255,255,255,.16); background: #19382e; color: #fff; }
.ai-ops-command .ghost { border-color: rgba(255,255,255,.16); background: rgba(255,255,255,.04); color: #fff; }
.ai-ops-command .ghost:hover { background: rgba(255,255,255,.08); }
.ai-ops-config-alert { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border: 1px solid #e4c98d; border-left: 4px solid #d4911e; border-radius: var(--radius); background: #fff9eb; padding: 10px 13px; }
.ai-ops-config-alert strong, .ai-ops-config-alert span { display: block; }.ai-ops-config-alert strong { font-size: 12px; }.ai-ops-config-alert span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.ai-ops-metrics { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 10px; }
.ai-ops-metric { min-height: 112px; border: 1px solid var(--line); border-top: 3px solid var(--green); border-radius: var(--radius); background: var(--surface); padding: 15px; }
.ai-ops-metric.warning { border-top-color: #d18a13; }.ai-ops-metric.danger { border-top-color: var(--danger); }
.ai-ops-metric > span, .ai-ops-metric > small { display: block; color: var(--muted); font-size: 11px; }
.ai-ops-metric > strong { display: block; margin-top: 7px; font-size: 25px; line-height: 1.15; }.ai-ops-metric > strong small { color: var(--muted); font-size: 11px; }
.ai-ops-metric > small { margin-top: 7px; }.ai-ops-trend { font-weight: 700; }.ai-ops-trend.up { color: var(--green); }.ai-ops-trend.down { color: var(--danger); }.ai-ops-trend.flat { color: var(--muted); }
.ai-ops-workbench { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, .75fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.ai-ops-analysis-pane, .ai-ops-queue-pane { min-width: 0; }.ai-ops-queue-pane { border-left: 1px solid var(--line); background: #fbfcfc; }
.ai-ops-pane-head { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); padding: 13px 16px; }
.ai-ops-pane-head h3 { margin-top: 4px; font-size: 15px; }.ai-ops-pane-head p { margin-top: 2px; color: var(--muted); font-size: 10px; }
.ai-ops-scope { display: flex; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.ai-ops-scope button { min-height: 31px; border-right: 1px solid var(--line); background: #fff; color: var(--muted); padding: 5px 9px; font-size: 10px; }.ai-ops-scope button:last-child { border-right: 0; }.ai-ops-scope button.active { background: var(--green); color: #fff; }
.ai-ops-empty-report { min-height: 365px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); padding: 28px; text-align: center; }
.ai-ops-empty-report > span { width: 52px; height: 52px; display: grid; place-content: center; border: 1px solid #b9d8ca; border-radius: 50%; background: var(--green-soft); color: var(--green); font: 750 12px/1 Consolas, monospace; }
.ai-ops-empty-report strong { margin-top: 13px; color: var(--ink); font-size: 14px; }.ai-ops-empty-report p { max-width: 420px; margin-top: 6px; font-size: 11px; line-height: 1.7; }
.ai-ops-report { display: grid; grid-template-columns: 140px minmax(0, 1fr); }
.ai-ops-report-score { display: grid; place-content: center; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f3f8f5; padding: 18px; text-align: center; }
.ai-ops-report-score > span, .ai-ops-report-score > small { color: var(--muted); font-size: 9px; }.ai-ops-report-score > strong { margin: 4px 0; color: var(--green); font-size: 38px; line-height: 1; }
.ai-ops-report-lead { border-bottom: 1px solid var(--line); padding: 18px; }.ai-ops-report-lead p { margin-top: 8px; font-size: 13px; line-height: 1.75; }
.ai-ops-domain-summaries, .ai-ops-priority-list, .ai-ops-caveats { grid-column: 1 / -1; }
.ai-ops-domain-summaries { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.ai-ops-domain-summaries article { min-width: 0; border-right: 1px solid var(--line); padding: 13px; }.ai-ops-domain-summaries article:last-child { border-right: 0; }
.ai-ops-domain-summaries article > div > span { color: var(--green); font-size: 9px; font-weight: 750; }.ai-ops-domain-summaries strong, .ai-ops-domain-summaries p, .ai-ops-domain-summaries small { display: block; }
.ai-ops-domain-summaries strong { margin-top: 3px; font-size: 11px; }.ai-ops-domain-summaries p { margin-top: 7px; font-size: 10px; line-height: 1.55; }.ai-ops-domain-summaries small { margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.ai-ops-priority { min-height: 94px; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); padding: 12px 14px; }.ai-ops-priority:last-child { border-bottom: 0; }
.ai-ops-priority-rank { color: #9aa69f; font: 750 16px/1 Consolas, monospace; }.ai-ops-priority.critical .ai-ops-priority-rank { color: var(--danger); }.ai-ops-priority.opportunity .ai-ops-priority-rank { color: var(--green); }
.ai-ops-priority-body > div > span { display: block; color: var(--muted); font-size: 9px; }.ai-ops-priority-body strong { display: block; margin-top: 2px; font-size: 12px; }.ai-ops-priority-body p { margin-top: 5px; font-size: 10px; line-height: 1.5; }.ai-ops-priority-body small, .ai-ops-priority-body em { display: block; margin-top: 4px; font-size: 9px; font-style: normal; }.ai-ops-priority-body small { color: var(--muted); }.ai-ops-priority-body em { color: var(--green); }
.ai-ops-caveats { padding: 11px 14px; color: var(--muted); font-size: 10px; }.ai-ops-caveats summary { cursor: pointer; }.ai-ops-caveats ul { display: grid; gap: 4px; margin: 7px 0 0 18px; }
.ai-ops-action-list { display: grid; }
.ai-ops-action { min-height: 83px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding: 10px 12px; }.ai-ops-action:last-child { border-bottom: 0; }
.ai-ops-action-index { color: #95a19b; font: 750 10px/1 Consolas, monospace; }.ai-ops-action.critical .ai-ops-action-index { color: var(--danger); }
.ai-ops-action small, .ai-ops-action strong, .ai-ops-action p { display: block; }.ai-ops-action small { color: var(--muted); font-size: 8px; }.ai-ops-action strong { margin-top: 3px; font-size: 11px; }.ai-ops-action p { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.ai-ops-domains { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ai-ops-domain-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.ai-ops-domain-head { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); padding: 13px 15px; }.ai-ops-domain-head h3 { margin-top: 4px; font-size: 14px; }.ai-ops-domain-head > strong { font-size: 24px; }.ai-ops-domain-head > strong small { color: var(--muted); font-size: 9px; }
.ai-ops-domain-kpis { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); background: #fafbfb; }.ai-ops-domain-kpis span { min-width: 0; border-right: 1px solid var(--line); color: var(--muted); padding: 10px 7px; font-size: 8px; text-align: center; }.ai-ops-domain-kpis span:last-child { border-right: 0; }.ai-ops-domain-kpis strong { display: block; color: var(--ink); font-size: 15px; }
.ai-ops-signal-list { min-height: 215px; }.ai-ops-signal-list article { min-height: 54px; display: grid; grid-template-columns: 7px minmax(0, 1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); padding: 8px 11px; }.ai-ops-signal-list article:last-child { border-bottom: 0; }.ai-ops-signal-list i { width: 7px; height: 7px; border-radius: 50%; background: #d69b39; }.ai-ops-signal-list i.critical { background: var(--danger); }.ai-ops-signal-list strong, .ai-ops-signal-list small { display: block; }.ai-ops-signal-list strong { font-size: 10px; }.ai-ops-signal-list small { margin-top: 2px; color: var(--muted); font-size: 8px; }
.ai-ops-domain-card > .link-btn { margin: 4px 9px 9px; font-size: 10px; }
.ai-ops-category-bars { min-height: 215px; display: grid; align-content: start; gap: 14px; padding: 14px; }.ai-ops-category-bars > div { display: grid; grid-template-columns: 72px minmax(50px, 1fr) 70px; align-items: center; gap: 8px; font-size: 9px; }.ai-ops-category-bars > div > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.ai-ops-category-bars > div > i { height: 5px; overflow: hidden; border-radius: 3px; background: #e5ebe8; }.ai-ops-category-bars > div > i b { display: block; height: 100%; background: var(--green); }.ai-ops-category-bars > div > strong { text-align: right; }
.ai-ops-bottom { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(290px, .7fr); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.ai-ops-history { border-left: 1px solid var(--line); }.ai-ops-experiments > div:last-child { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }.ai-ops-experiments article { min-height: 116px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 13px; }.ai-ops-experiments article > span { color: var(--green); font-size: 9px; font-weight: 700; }.ai-ops-experiments article strong, .ai-ops-experiments article p, .ai-ops-experiments article small { display: block; }.ai-ops-experiments article strong { margin-top: 4px; font-size: 11px; }.ai-ops-experiments article p { margin-top: 6px; font-size: 10px; line-height: 1.55; }.ai-ops-experiments article small { margin-top: 6px; color: var(--muted); font-size: 9px; line-height: 1.45; }
.ai-ops-history-list { display: grid; }.ai-ops-history-list button { min-height: 58px; display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); background: #fff; color: var(--ink); padding: 9px 12px; text-align: left; }.ai-ops-history-list button:hover, .ai-ops-history-list button.active { background: #f1f7f4; }.ai-ops-history-list button > span { width: 7px; height: 7px; border-radius: 50%; background: #9aa5a0; }.ai-ops-history-list button > span.completed { background: var(--green); }.ai-ops-history-list button > span.failed { background: var(--danger); }.ai-ops-history-list strong, .ai-ops-history-list small { display: block; }.ai-ops-history-list strong { font-size: 10px; }.ai-ops-history-list small { margin-top: 2px; color: var(--muted); font-size: 8px; }.ai-ops-history-list em { color: var(--muted); font-size: 8px; font-style: normal; }
.ai-ops-inline-empty { min-height: 96px; display: grid; place-content: center; color: var(--muted); padding: 18px; font-size: 10px; text-align: center; }

@media (max-width: 1180px) {
  .ai-ops-hero { grid-template-columns: minmax(330px, 1fr) 150px minmax(190px, 230px); gap: 18px; }
  .ai-ops-radar { width: 140px; height: 140px; }
  .ai-ops-workbench { grid-template-columns: minmax(0, 1.4fr) minmax(280px, .7fr); }
}
@media (max-width: 960px) {
  .ai-ops-hero { grid-template-columns: minmax(0, 1fr) minmax(200px, 250px); }.ai-ops-radar { display: none; }
  .ai-ops-metrics { grid-template-columns: repeat(2, 1fr); }.ai-ops-workbench, .ai-ops-bottom { grid-template-columns: 1fr; }
  .ai-ops-queue-pane, .ai-ops-history { border-top: 1px solid var(--line); border-left: 0; }.ai-ops-domains { grid-template-columns: 1fr 1fr; }.ai-ops-domain-card.operations { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .ai-ops-hero { grid-template-columns: 1fr; padding: 20px; }.ai-ops-command { grid-template-columns: 1fr 1fr; }.ai-ops-command label { grid-column: 1 / -1; }
  .ai-ops-pane-head { align-items: flex-start; flex-direction: column; }.ai-ops-scope { width: 100%; overflow-x: auto; }.ai-ops-scope button { flex: 1 0 auto; }
  .ai-ops-report { grid-template-columns: 1fr; }.ai-ops-report-score { border-right: 0; }.ai-ops-domain-summaries { grid-template-columns: 1fr; }.ai-ops-domain-summaries article { border-right: 0; border-bottom: 1px solid var(--line); }
  .ai-ops-domains { grid-template-columns: 1fr; }.ai-ops-domain-card.operations { grid-column: auto; }
}
@media (max-width: 420px) {
  .ai-ops-metrics { grid-template-columns: 1fr 1fr; }.ai-ops-metric { min-width: 0; padding: 12px; }.ai-ops-metric > strong { font-size: 20px; }
  .ai-ops-priority, .ai-ops-action { grid-template-columns: 28px minmax(0, 1fr); }.ai-ops-priority > .btn, .ai-ops-action > .btn { grid-column: 2; justify-self: start; }
  .ai-ops-experiments > div:last-child { grid-template-columns: 1fr; }.ai-ops-config-alert { align-items: stretch; flex-direction: column; }
}

@media (max-width: 1080px) {
  .invoice-workspace { grid-template-columns: minmax(290px, 0.75fr) minmax(390px, 1.25fr); }
  .invoice-issue-flow { grid-template-columns: 1fr; }
  #invoice-issue-form { grid-template-columns: 1fr auto; }
}

@media (max-width: 820px) {
  .invoice-workspace { min-height: 0; grid-template-columns: 1fr; overflow: visible; }
  .invoice-queue { max-height: 360px; border-right: 0; border-bottom: 1px solid var(--line); }
  .invoice-inspector { max-height: none; min-height: 430px; }
  .service-settings-layout { grid-template-columns: 1fr; }
  .ai-model-hero { grid-template-columns: 1fr; gap: 16px; }
  .ai-bus-state small { max-width: none; }
  .ai-settings-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .invoice-toolbar { grid-template-columns: 1fr 1fr; }
  .invoice-toolbar input { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  .invoice-toolbar { grid-template-columns: 1fr; }
  .invoice-toolbar input { grid-column: auto; }
  .invoice-row { align-items: flex-start; }
  .invoice-detail-head { align-items: flex-start; }
  .invoice-detail-grid { grid-template-columns: 88px minmax(0, 1fr); }
  .invoice-command-bar, .invoice-reject-form > div { align-items: stretch; flex-direction: column; }
  #invoice-issue-form { grid-template-columns: 1fr; }
  .service-settings-form-wrap .section-head { align-items: flex-start; flex-direction: column; }
  .service-saved-at { text-align: left; }
  .ai-form-grid { grid-template-columns: 1fr; }
  .ai-form-grid .span-2 { grid-column: auto; }
  .ai-model-hero { padding: 21px 18px; }
  .ai-settings-actions { align-items: stretch; flex-direction: column; }
  .ai-model-picker { grid-template-columns: 1fr; }
}
