/* T43 店铺利润 · 页面样式。前缀 sp-，只用公共框架主题变量，不覆盖 .btn/.chip/.panel 等公共类。 */
#sp-root { min-width: 0; max-width: 100%; padding: 8px; color: var(--text); }
#sp-root h1 { font-size: 24px; margin: 4px 0; }
#sp-root h3 { font-size: 14px; margin: 16px 0 8px; }
#sp-root button:disabled { opacity: .5; cursor: not-allowed; }
#sp-root input, #sp-root select, .sp-dialog input, .sp-dialog select { box-sizing: border-box; width: 100%; min-width: 0; padding: 8px; border: 1px solid var(--border); border-radius: 6px; color: var(--text); background: var(--bg-elev2); font: inherit; }
#sp-root input[type=checkbox] { width: auto; }
.sp-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.sp-shopbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.sp-shopbar label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); min-width: 180px; }
.sp-silver { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.sp-silver[data-missing="1"] { padding: 10px 14px; border: 1px solid var(--danger); border-radius: 10px; color: var(--danger); }
.sp-warn { padding: 10px 14px; margin-bottom: 12px; border: 1px solid var(--warning, var(--accent)); border-radius: 10px; background: var(--accent-soft); font-size: 13px; line-height: 1.7; }
.sp-warn .btn { margin-left: 8px; padding: 3px 8px; }
.sp-filter { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: end; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); }
.sp-filter label, .sp-form label, .sp-trial label, .sp-inline label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.sp-filter .sp-check { flex-direction: row; align-items: center; gap: 6px; }
.sp-status { color: var(--text-2); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; margin: 10px 0; }
.sp-notice { padding: 12px; border: 1px dashed var(--border); border-radius: 10px; color: var(--text-2); }
.sp-main { display: block; min-width: 0; }
.sp-scroll { max-width: 100%; overflow: auto; border: 1px solid var(--border); border-radius: 10px; }
.sp-scroll table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.sp-scroll th, .sp-scroll td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-soft, var(--border)); vertical-align: top; }
.sp-scroll th { color: var(--text-2); background: var(--bg-elev); position: sticky; top: 0; }
.sp-scroll td small { display: block; color: var(--text-3); font-size: 11px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.sp-list .sp-scroll { max-height: 70vh; }
.sp-list tr[data-row] { cursor: pointer; }
.sp-list tr[data-row]:hover, .sp-list tr[data-row]:focus { background: var(--bg-hover); outline: none; }
.sp-list tr.is-selected { background: var(--accent-soft); }
.sp-neg { color: var(--danger); }
.sp-empty { padding: 32px; text-align: center; color: var(--text-2); }
.sp-pager { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 12px; }
.sp-detail { position: fixed; top: var(--topbar-h, 52px); right: 0; bottom: 0; z-index: 40; box-sizing: border-box; width: min(400px, 100vw); display: flex; flex-direction: column; background: var(--bg-elev); color: var(--text); border-left: 1px solid var(--border); box-shadow: -8px 0 24px #0003; outline: none; }
.sp-detail[hidden] { display: none; }
.sp-drawer-head { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
#sp-detail-heading { flex: 1; min-width: 0; }
.sp-drawer-head > .btn { flex: 0 0 auto; }
.sp-drawer-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 12px 16px 20px; }
#sp-drawer-status { flex: 0 0 auto; margin: 0; padding: 8px 16px; font-size: 12px; color: var(--text-2); }
.sp-detail-head h2 { font-size: 17px; margin: 0 0 6px; overflow-wrap: anywhere; }
.sp-detail-head p { font-size: 12px; line-height: 1.6; margin: 6px 0 0; }
.sp-thumb-button { display: inline-flex; align-items: center; justify-content: center; padding: 2px; min-width: 44px; min-height: 44px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-elev); color: var(--text-2); cursor: zoom-in; }
.sp-thumb-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sp-thumb { display: block; width: 36px; height: 36px; object-fit: contain; }
.sp-thumb-missing { display: inline-block; max-width: 90px; color: var(--text-3); font-size: 11px; white-space: normal; }
.sp-detail-head > .sp-thumb-button { float: left; margin: 0 10px 8px 0; }
.sp-detail-head::after { content: ''; display: block; clear: both; }
.sp-detail-group { margin: 12px 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
#sp-root .sp-detail-group h3 { margin: 0 0 8px; color: var(--text-2); font-size: 13px; }
.sp-detail-group dl { margin: 0; }
.sp-detail-group dl > div { display: grid; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-soft, var(--border)); font-size: 12px; }
.sp-detail-group dl > div:last-child { border-bottom: 0; }
.sp-detail-group dt { color: var(--text-2); overflow-wrap: anywhere; }
.sp-detail-group dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.sp-detail-group dd small { display: block; color: var(--text-3); }
.sp-calculation-notes { margin: 12px 0; font-size: 12px; }
.sp-calculation-notes summary { cursor: pointer; color: var(--text-2); }
.sp-image-dialog { width: min(900px, calc(100vw - 32px)); }
.sp-image-full { display: block; width: 100%; max-height: 75vh; object-fit: contain; margin-top: 12px; }
.sp-code { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.sp-code code { font-family: var(--mono, monospace); font-size: 13px; color: var(--text); padding: 2px 6px; border-radius: 4px; background: var(--bg-elev2); user-select: all; }
.sp-code .btn { padding: 3px 8px; }
.sp-result { margin: 12px 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.sp-result.is-neg { border-color: var(--danger); }
.sp-result-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.sp-result dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin: 10px 0; }
.sp-result dt { font-size: 11px; color: var(--text-2); }
.sp-result dd { margin: 2px 0 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sp-result.is-neg dd:first-of-type { color: var(--danger); }
.sp-note { font-size: 11px; color: var(--text-3); line-height: 1.6; margin: 4px 0; }
.sp-issues { margin: 6px 0 0; padding-left: 18px; font-size: 12px; color: var(--danger); line-height: 1.6; }
.sp-lines { width: 100%; border-collapse: collapse; font-size: 12px; }
.sp-lines th, .sp-lines td { padding: 5px 4px; border-bottom: 1px solid var(--border-soft, var(--border)); text-align: left; font-weight: normal; }
.sp-lines th { color: var(--text-2); width: 42%; }
.sp-lines td { font-variant-numeric: tabular-nums; }
.sp-lines small { display: block; color: var(--text-3); font-size: 11px; }
.sp-trial { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--border); }
.sp-trial h3, .sp-trial-actions, #sp-trial-out { grid-column: 1 / -1; }
.sp-trial h3 small { font-weight: normal; color: var(--text-3); font-size: 11px; }
.sp-trial-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#sp-trial-out .sp-result { border-style: dashed; }
.sp-override { margin-top: 14px; font-size: 12px; }
.sp-override summary { cursor: pointer; color: var(--text-2); }
.sp-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.sp-form .sp-note, .sp-form button { grid-column: 1 / -1; justify-self: start; }
.sp-form[hidden] { display: none; }
#sp-root .sp-form input[readonly], .sp-dialog .sp-form input[readonly] { background: transparent; border-color: transparent; padding-left: 0; font-weight: 600; color: var(--text); }
.sp-inline { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.sp-inline small { color: var(--text-3); }
.sp-dialog { box-sizing: border-box; width: min(900px, calc(100vw - 24px)); max-height: calc(100vh - 32px); overflow: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--bg-elev); color: var(--text); padding: 18px; }
.sp-dialog::backdrop { background: #0009; }
.sp-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.sp-dialog-head h2 { margin: 0; font-size: 18px; }
.sp-dialog table { margin: 0; }
.sp-dialog td small { display: block; color: var(--text-3); }
@media (max-width: 600px) { #sp-root { padding: 0; } .sp-shopbar label { min-width: 0; flex: 1 1 100%; } .sp-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); } .sp-trial { grid-template-columns: minmax(0, 1fr); } .sp-result dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sp-missing { color: var(--danger); font-weight: 600; }
.sp-missing small { display: inline; margin-left: 4px; font-weight: 400; color: var(--danger); }
/* I1 店铺品类扣点：品类树按层级缩进，数值右对齐（R08），长路径换行不挤出操作列（R07） */
.sp-tree-wrap { max-height: 46vh; }
.sp-dialog .sp-tree th.num, .sp-dialog .sp-tree td.num, .sp-dialog .sp-cm-history th.num, .sp-dialog .sp-cm-history td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sp-dialog .sp-tree td.sp-path { padding-left: calc(10px + var(--lvl, 0) * 16px); white-space: normal; min-width: 160px; overflow-wrap: anywhere; }
.sp-dialog td.sp-src { white-space: normal; min-width: 160px; max-width: 320px; overflow-wrap: anywhere; }
.sp-dialog .sp-tree td.sp-path small, .sp-dialog td.sp-src small { max-width: none; white-space: normal; }
.sp-dialog .sp-cm-history tr.is-retired td { color: var(--text-3); }
.sp-dialog .sp-check { flex-direction: row; align-items: center; gap: 6px; align-self: end; min-height: 36px; }
.sp-dialog .sp-check input { width: auto; }
.sp-form .sp-form-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.sp-dialog .sp-inline label { min-width: 160px; flex: 1 1 160px; }
.sp-lines small[data-sp-commission] { overflow-wrap: anywhere; }
/* I1 双成本：百盛分支与常规并列；列表新增列数值右对齐、缺失原因换行，不撑破表格 */
.sp-bs { margin-top: 16px; padding-top: 8px; border-top: 1px dashed var(--border); }
.sp-bs h3 { margin: 4px 0 8px; font-size: 14px; }
.sp-bs .sp-lines td, .sp-bs .sp-lines small { overflow-wrap: anywhere; }
.sp-product-weight { font-size:12px; font-weight:normal; color:var(--text-3); overflow-wrap:anywhere; }
.sp-detail-alert { margin:12px 0; padding:10px 12px; border:1px solid var(--border); border-left:3px solid var(--danger); border-radius:10px; background:var(--bg-elev); }
.sp-detail-alert small { display:block; color:var(--text-3); }
.sp-shared-prices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 16px; }
.sp-detail-group .sp-shared-prices > div { display:block; border:0; padding:0; }
.sp-detail-group .sp-shared-prices dd { margin:3px 0 0; }
.sp-detail-fees,.sp-other-fields,.sp-calculation-notes,.sp-trial-shell { margin:12px 0; padding:12px; border:1px solid var(--border); border-radius:10px; background:var(--bg-elev); }
.sp-detail-fees summary,.sp-other-fields summary,.sp-calculation-notes summary,.sp-trial-shell summary { cursor:pointer; }
.sp-detail-fees .sp-lines th { width:auto; }
.sp-detail-fees .sp-lines td { text-align:right; overflow-wrap:anywhere; }
.sp-fee-group th { padding-top:12px; color:var(--text); }
.sp-formulas { margin:12px 0; display:grid; gap:12px; }
.sp-formulas dt { color:var(--text); font-weight:600; }
.sp-formulas dd { margin:3px 0 0; overflow-wrap:anywhere; }
.sp-cfg-rate-modes { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0; }
.sp-dialog .sp-cfg-tax-table { min-width:0; table-layout:fixed; width:100%; }
.sp-dialog .sp-cfg-tax-table :is(th,td) { white-space:normal; overflow-wrap:anywhere; }
#sp-table td[data-col^="bs"] { text-align: right; font-variant-numeric: tabular-nums; }
#sp-table td[data-col^="bs"] .sp-missing small { display: block; margin: 2px 0 0; text-align: right; overflow-wrap: anywhere; }

/* I4：店铺与大分类快捷筛选同组；原“大分类”下拉保留在筛选表单内（供 FormData 取值），不再单独展示。 */
.sp-majorbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 12px; }
.sp-majorbar-shop { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); min-width: 180px; }
.sp-major-group { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-major-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--text-1); font-weight: 600; }
.sp-major-hidden { display: none; }
/* I4 整改2/3：原 .sp-major-hidden 被后面更高优先级的 `.sp-filter > label:not(.sp-check)`（C12）覆盖为 display:flex，
   导致旧大分类下拉与三类快捷按钮同时出现；select 仍保留在 #sp-filter 内供 FormData 取值，只提升隐藏规则优先级。 */
#sp-root #sp-filter > label.sp-major-hidden { display: none !important; }

/* I4：列设置工具栏与弹窗；拖动/键盘调整整列顺序的视觉反馈。 */
#sp-table th[data-col] { cursor: grab; }
#sp-table .sp-col-dragging { opacity: .55; }
#sp-table .sp-col-drop-before { box-shadow: inset 4px 0 var(--text-1); }
#sp-table .sp-col-drop-after { box-shadow: inset -4px 0 var(--text-1); }
.sp-col-choice { display: flex; align-items: center; gap: 8px; min-height: 36px; cursor: pointer; }
.sp-col-choice input { width: 18px; height: 18px; }
.sp-col-group { margin: 0 0 12px; padding: 8px 12px 4px; border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.sp-col-group legend { padding: 0 6px; font-size: 13px; color: var(--text-2); }
.sp-col-group-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0 16px; }
.sp-col-actions { display: flex; gap: 12px; margin-top: 8px; }
@media (max-width: 600px) { .sp-majorbar { flex-direction: column; align-items: stretch; } .sp-majorbar-shop { min-width: 0; } }
.sp-dialog .sp-tree td, .sp-dialog .sp-cm-history td { vertical-align: middle; }

/* C12（UI规范 v1.3 R21）：筛选标签与取值同行、按内容定宽，不等宽撑满；长值省略（title 可查看）、窄屏换行。
   候选搜索下拉、显隐与排序（R19/R20）依赖 MOS 提供 J15 公共组件接入，见 C12 自测记录。 */
.sp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.sp-filter > label:not(.sp-check) { flex-direction: row; align-items: center; gap: 6px; white-space: nowrap; }
.sp-filter :is(input:not([type=checkbox]), select) { width: 150px; max-width: 100%; min-width: 0; text-overflow: ellipsis; }
@media (max-width: 600px) { .sp-filter { grid-template-columns: none; } .sp-filter > label:not(.sp-check) { white-space: normal; } }

/* I4 补充：列表标题（“商品列表”）与真实条数/分类信息、字段设置/保存列设置共用同一工具栏；空间不足按组换行。
   #sp-col-status 保持原 id，位置移入该工具栏，字段设置弹窗内的 #sp-col-dialog-status 同步显示同一状态文本。 */
.sp-list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 10px 12px; border: 1px solid var(--border); border-bottom: 0; border-radius: 10px 10px 0 0; background: var(--bg-elev); }
.sp-list-head h2 { margin: 0; font-size: 16px; white-space: nowrap; }
.sp-list-meta { font-size: 12px; color: var(--text-2); padding: 2px 8px; border-radius: 5px; background: var(--bg-elev2); white-space: nowrap; }
.sp-list-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto; }
.sp-list-actions .sp-status { margin: 0; }
.sp-list .sp-scroll { border-radius: 0 0 10px 10px; border-top: 0; }
@media (max-width: 600px) { .sp-list-head { border-radius: 10px; } .sp-list-actions { margin-left: 0; } .sp-list .sp-scroll { border-top: 1px solid var(--border); border-radius: 10px; } }

/* I4 补充（本轮整改）：#sp-table 主表改为数据库 .t63-table 排版逻辑——原生 table 列轨道、完整低强调行列网格、
   10px 14px 单元格留白与 13px 文字、表头背景区分、隔行轻区分、数字右对齐、粘性表头正确层级、表内横向滚动。
   取代并关闭 I3 的短竖线装饰（相邻列只做 1px 竖线），避免同一张表出现两套网格；弹窗/明细/规则样板不受影响。 */
#sp-table table { border-collapse: separate; border-spacing: 0; width: max-content; min-width: 100%; font-size: 13px; white-space: nowrap; }
#sp-table table th, #sp-table table td { box-sizing: border-box; padding: 10px 14px; border-right: 1px solid var(--border-soft, var(--border)); border-bottom: 1px solid var(--border-soft, var(--border)); text-align: left; vertical-align: top; background: var(--bg-elev); }
#sp-table table th:last-child, #sp-table table td:last-child { border-right: 0; }
#sp-table table th { position: sticky; top: 0; z-index: 2; background: var(--bg-elev2); color: var(--text-2); user-select: none; }
#sp-table table tbody tr:nth-child(even) td { background: var(--bg-elev2); }
#sp-table table tbody tr:hover td { background: var(--bg-hover); }
#sp-table table tbody tr.is-selected td { background: var(--accent-soft); }
#sp-table table td[data-col="weight"], #sp-table table td[data-col="bareCost"], #sp-table table td[data-col="listPrice"],
#sp-table table td[data-col="deal"], #sp-table table td[data-col="marginProfit"], #sp-table table td[data-col="marginRate"] { text-align: right; font-variant-numeric: tabular-nums; }

/* I5：“规则与店铺”统一两页签（店铺扣点／通用规则）。弹窗固定高度，外层不滚动；左侧店铺列表与右侧内容各自独立滚动，
   不叠加整弹窗/品类表第三层滚动；底部固定取消/保存修改，三选一未保存保护覆盖整个弹窗（.sp-cfg-blocked 时右侧与左侧不可交互）。 */
.sp-dialog[open]:has(.sp-cfg) { overflow: hidden; box-sizing: border-box; width: min(1320px, calc(100vw - 32px)); max-width: calc(100vw - 32px); height: min(780px, calc(100vh - 32px)); display: flex; flex-direction: column; }
.sp-dialog:not([open]) { display: none; }
.sp-dialog:has(.sp-cfg) .sp-dialog-head { flex: 0 0 auto; }
.sp-dialog:has(.sp-cfg) #sp-dialog-body { display: flex; flex: 1; min-height: 0; overflow: hidden; container-type: inline-size; }
.sp-dialog:has(.sp-cfg) #sp-dialog-status { flex: 0 0 auto; margin: 0; }
.sp-cfg { display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: 1; position: relative; }
.sp-cfg-tabs { display: flex; gap: 6px; margin-bottom: 10px; flex: 0 0 auto; }
.sp-cfg-tabs [role="tab"] { padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-elev2); color: var(--text-2); cursor: pointer; }
.sp-cfg-tabs [role="tab"][aria-selected="true"] { background: var(--accent-soft); color: var(--text); font-weight: 600; border-color: var(--text-1); }
.sp-cfg-body { flex: 1; min-height: 0; overflow: hidden; }
.sp-cfg-blocked .sp-cfg-body, .sp-cfg-blocked .sp-cfg-footer { pointer-events: none; }
.sp-cfg-shop { display: flex; gap: 16px; height: 100%; min-height: 0; }
.sp-cfg-left { flex: 0 0 220px; display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.sp-cfg-search { padding: 8px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--text-2); flex: 0 0 auto; }
.sp-cfg-shoplist-wrap { flex: 1; min-height: 0; overflow: auto; }
.sp-cfg-shoplist { list-style: none; margin: 0; padding: 0; }
.sp-cfg-shoplist li[hidden] { display: none; }
.sp-cfg-shopitem { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--border-soft, var(--border)); background: transparent; color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.sp-cfg-shopitem:hover, .sp-cfg-shopitem:focus-visible { background: var(--bg-hover); }
.sp-cfg-shopitem.is-active { background: var(--accent-soft); font-weight: 600; }
.sp-cfg-shopname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sp-cfg-shoprate { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-cfg-right { flex: 1; min-width: 0; display: flex; gap: 14px; min-height: 0; }
.sp-cfg-right-main { flex: 1; min-width: 0; min-height: 0; overflow: auto; }
.sp-cfg-summary { padding: 10px 12px; margin-bottom: 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); }
.sp-cfg-summary h3 { margin: 0 0 6px; font-size: 15px; }
.sp-cfg-cat-tools { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; margin: 10px 0; }
.sp-cfg-cat-tools label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); min-width: 160px; }
.sp-cfg-sku-tools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-cfg-sku-tools label { min-width: 0; }
.sp-cfg-sku-tools input, .sp-cfg-sku-tools select { width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; }
.sp-cfg-sku-search { grid-column: 1 / -1; }
.sp-cfg-filter-actions { display: flex; justify-content: flex-end; margin: 4px 0 8px; }
.sp-cfg-commission-table { table-layout: fixed; }
.sp-dialog .sp-cfg-commission-table td.sp-src { min-width: 0; max-width: none; }
.sp-dialog .sp-cfg-commission-table :is(th,td) { white-space: normal; overflow-wrap: anywhere; }
.sp-cfg-commission-table .sp-cfg-node { display: flex; align-items: flex-start; gap: 4px; padding-left: calc(var(--lvl, 0) * 10px); }
.sp-cfg-node > span { min-width: 0; }
.sp-cfg-node small { display: block; white-space: normal; overflow-wrap: anywhere; color: var(--text-2); }
.sp-cfg-node .sp-cfg-expand { flex: 0 0 24px; min-width: 24px; min-height: 28px; padding: 2px; }
.sp-cfg-major { background: var(--bg-elev2); }
.sp-cfg-sku strong { user-select: text; }
@container (max-width: 720px) { .sp-cfg-commission-table :is(th,td) { padding: 7px 5px; } .sp-cfg-commission-table .sp-cfg-node { padding-left: calc(var(--lvl, 0) * 5px); } }
.sp-cfg-cattable, .sp-cfg-general table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sp-cfg-cattable th, .sp-cfg-cattable td, .sp-cfg-general table th, .sp-cfg-general table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border-soft, var(--border)); vertical-align: top; }
.sp-cfg-cattable th, .sp-cfg-general table th { position: sticky; top: 0; z-index: 1; background: var(--bg-elev); color: var(--text-2); }
.sp-cfg-cattable th { white-space: nowrap; }
.sp-cfg-cattable { min-width: 610px; }
.sp-cfg-cattable td:last-child { min-width: 60px; }
.sp-cfg-cattable th.num, .sp-cfg-cattable td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sp-cfg-cattable td.sp-path { padding-left: calc(10px + var(--lvl, 0) * 16px); white-space: normal; min-width: 160px; overflow-wrap: anywhere; }
.sp-cfg-cattable td.sp-src { white-space: normal; min-width: 160px; max-width: 320px; overflow-wrap: anywhere; }
.sp-cfg-cattable td.sp-path small, .sp-cfg-cattable td.sp-src small { max-width: none; white-space: normal; }
.sp-cfg-history { margin-top: 12px; }
.sp-cfg-history summary { cursor: pointer; color: var(--text-2); font-size: 13px; margin-bottom: 6px; }
.sp-cfg-history table { width: 100%; border-collapse: collapse; font-size: 12px; }
.sp-cfg-history th, .sp-cfg-history td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border-soft, var(--border)); vertical-align: middle; }
.sp-cfg-history th.num, .sp-cfg-history td.num { text-align: right; font-variant-numeric: tabular-nums; }
.sp-cfg-history tr.is-retired td { color: var(--text-3); }
.sp-cfg-formula summary { cursor: pointer; color: var(--text-2); margin-bottom: 8px; }
.sp-cfg-edit { box-sizing: border-box; flex: 0 0 300px; min-width: 0; max-width: 300px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); overflow: auto; max-height: 100%; }
.sp-cfg-body > .sp-cfg-right { height: 100%; }
.sp-cfg-edit [aria-invalid=true] { border-color: var(--danger); }
.sp-cfg-edit #sp-cfg-edit-error { color: var(--danger); }
.sp-cfg-edit .sp-check { display: flex; flex-direction: row; align-items: center; }
.sp-cfg [hidden] { display: none !important; }
.sp-cfg :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@container (max-width: 1100px) {
  .sp-cfg-right.has-edit .sp-cfg-right-main { display: none; }
  .sp-cfg-right.has-edit .sp-cfg-edit { flex: 1; max-width: none; }
}
.sp-cfg-edit h3 { margin: 0 0 8px; font-size: 14px; }
.sp-cfg-edit .sp-form { grid-template-columns: 1fr; }
.sp-cfg-footer { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding-top: 10px; margin-top: 10px; border-top: 1px solid var(--border); }
.sp-cfg-footer .sp-status { margin: 0; }
.sp-cfg-guard { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: color-mix(in srgb, var(--bg) 85%, transparent); border-radius: 10px; z-index: 5; text-align: center; padding: 16px; }
.sp-cfg-guard-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
@media (max-width: 760px) {
  .sp-cfg-shop { flex-direction: column; }
  .sp-cfg-left { flex: 0 0 160px; }
  .sp-cfg-right { flex-direction: column; }
  .sp-cfg-edit { flex: 0 0 auto; max-width: none; }
  .sp-cfg-right.has-edit .sp-cfg-right-main { display: none; }
}

/* J43: 商品利润列表原区域拖拽排序操作，规则弹窗布局保持。 */
#sp-root .sp-list-actions [hidden]{display:none!important}#sp-root .sp-column-handle{display:inline-flex;align-items:center;justify-content:center;min-width:28px;min-height:28px;margin-right:6px;cursor:grab;touch-action:none}#sp-root .sp-column-handle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

#sp-root .sp-col-choice input[type="checkbox"]{box-sizing:border-box;flex:0 0 18px;width:18px;min-width:18px;max-width:18px;height:18px;min-height:18px;padding:0;margin:0}

/* I2: short separators follow shared native table columns. */
#sp-root .sp-scroll th,#sp-root .sp-scroll td{position:relative}#sp-root .sp-scroll th{position:sticky}#sp-root .sp-scroll th:not(:last-child)::after,#sp-root .sp-scroll td:not(:last-child)::after{content:"";position:absolute;right:0;top:27%;bottom:27%;width:1px;background:var(--border)}

/* I8: N结果表同款紧凑布局；不改变原400px覆盖抽屉。 */
#sp-table table { width: max-content; min-width: 100%; font-size: 12px; }
#sp-table th, #sp-table td { padding: 6px 10px; white-space: nowrap; vertical-align: middle; }
#sp-table th { background: var(--bg); font-weight: 600; }
#sp-table .sp-unit { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); margin-top: 3px; }
#sp-table .sp-numeric { text-align: right; font-variant-numeric: tabular-nums; }
#sp-table [data-sp-price] { cursor: text; }
#sp-table [data-sp-price]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
#sp-table [data-sp-price] input { width: 100px; padding: 4px 6px; }
#sp-table [data-sp-price] small { white-space: normal; max-width: 180px; }
#sp-table th[data-col=weight], #sp-table th[data-col=totalLabor], #sp-table th:has(.sp-unit) { text-align: right; }
#sp-link-preview-rows { max-height: 40vh; margin-top: 12px; }

/* J94: shared H-style categorized drawer cards. */
.sp-detail-group { margin: 0 0 12px; padding: 10px 14px; border-radius: 12px; background: var(--bg-elev2); }
.sp-detail-group dl > div { grid-template-columns: minmax(84px,38%) minmax(0,1fr); padding: 6px 0; font-size: 13px; }
#sp-col-choices legend label, .t63-group legend label { display: inline-flex; align-items: center; gap: 6px; }
#sp-col-choices [data-j94-group] { width: auto; }

.sp-missing-entry{display:block;width:100%;border:0;padding:0;background:transparent;text-align:inherit;font:inherit;cursor:pointer;color:inherit}.sp-missing-entry:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.sp-detail-target{border-color:var(--accent)}

/* I9: compact presentation is local to Amber; original fields/preferences stay intact. */
html[data-ui="amber"] #sp-table table { min-width: 0; width: max-content; max-width: none; }
html[data-ui="amber"] #sp-table table th,
html[data-ui="amber"] #sp-table table td { padding: 8px; vertical-align: middle; }
html[data-ui="amber"] #sp-table [data-col="image"] { width: 60px; min-width: 60px; text-align: center; }
html[data-ui="amber"] #sp-table [data-col="position"] { min-width: 76px; }
html[data-ui="amber"] #sp-table [data-col="code"],
html[data-ui="amber"] #sp-table [data-col="linkId"],
html[data-ui="amber"] #sp-table [data-col="skuId"] { max-width: 180px; white-space: normal; overflow-wrap: anywhere; }
html[data-ui="amber"] #sp-table [data-col="shortName"] { min-width: 200px; max-width: 280px; white-space: normal; overflow-wrap: anywhere; }
html[data-ui="amber"] #sp-root .sp-table-settings { position: relative; }
html[data-ui="amber"] #sp-root .sp-table-settings > summary { list-style: none; cursor: pointer; }
html[data-ui="amber"] #sp-root .sp-table-settings > summary::-webkit-details-marker { display: none; }
html[data-ui="amber"] #sp-root .sp-table-settings > summary::after { content: ' ▾'; }
html[data-ui="amber"] #sp-root .sp-settings-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 12; min-width: 230px; max-width: calc(100vw - 40px); padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); box-shadow: 0 8px 24px #0002; }
html[data-ui="amber"] #sp-root .sp-settings-menu > .btn { display: block; width: 100%; text-align: left; margin: 2px 0; }
html[data-ui="amber"] #sp-root #sp-col-edit-tools { display: flex; flex-wrap: wrap; gap: 8px; }
html[data-ui="amber"] #sp-root #sp-col-edit-tools:empty { display: none; }
html[data-ui="amber"] #sp-root .sp-list-actions { gap: 8px; }
html[data-ui="amber"] #sp-root #sp-col-status { flex-basis: 100%; overflow-wrap: anywhere; }
html[data-ui="amber"] #sp-root #sp-col-status:empty { display: none; }
html[data-ui="amber"] #sp-root .sp-list-actions > .sp-sync-status { flex-basis: 100%; margin: 0; white-space: normal; overflow-wrap: anywhere; }
html[data-ui="amber"] #sp-root .sp-settings-menu .wb-layout-sync { display: block; }
html[data-ui="amber"] #sp-root .sp-settings-menu .wb-layout-sync-menu { position: static; display: flex; flex-direction: column; min-width: 0; box-shadow: none; border: 0; padding: 4px 0; }
html[data-ui="amber"] #sp-root .sp-settings-menu .wb-layout-sync details:not([open]) > .wb-layout-sync-menu { display: none; }

/* I9 r2: independent field tracks; resize widths apply equally to header and body. */
html[data-ui="amber"] #sp-table table { table-layout: fixed; }
html[data-ui="amber"] #sp-table table [data-col] { width: auto; min-width: 0; max-width: none; white-space: normal; overflow-wrap: anywhere; }
html[data-ui="amber"] #sp-table table th { padding-right: 16px; }
html[data-ui="amber"] #sp-table table .sp-missing-entry { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
html[data-ui="amber"] #sp-table table td small { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
html[data-ui="amber"] #sp-table .sp-column-resize { position: absolute; inset: 0 -1px 0 auto; z-index: 3; width: 8px; cursor: col-resize; touch-action: none; border-right: 2px solid var(--border); }
html[data-ui="amber"] #sp-table .sp-column-resize:hover,
html[data-ui="amber"] #sp-table .sp-column-resize:focus-visible { background: var(--accent-soft); border-right-color: var(--accent); outline: 2px solid var(--accent); outline-offset: -2px; }
html[data-ui="amber"] #sp-root.sp-resizing,
html[data-ui="amber"] #sp-root.sp-resizing * { cursor: col-resize !important; user-select: none; }
html[data-ui="amber"] #sp-root.sp-resizing .sp-column-resize:focus { border-right-color: var(--accent); }
html[data-ui="amber"] #sp-root .sp-column-result { width: min(460px, calc(100vw - 32px)); }
html[data-ui="amber"] #sp-root .sp-column-result p { margin: 16px 0; overflow-wrap: anywhere; }

/* I9 2026-11-25: desktop Amber page hierarchy; mobile and saved column layouts stay intact. */
html[data-ui="amber"] #sp-root.sp-compact { padding: 8px; font-size: 14px; }
html[data-ui="amber"] #sp-root.sp-compact [hidden] { display: none !important; }
html[data-ui="amber"] .sp-compact .sp-head { align-items: center; gap: 12px 20px; margin-bottom: 12px; }
html[data-ui="amber"] .sp-compact .sp-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; min-width: 0; }
html[data-ui="amber"] #sp-root.sp-compact h1 { font-size: 22px; line-height: 1.4; margin: 0; }
html[data-ui="amber"] .sp-compact .sp-shopbar { align-items: center; }
html[data-ui="amber"] .sp-compact .sp-shopbar label { flex-direction: row; align-items: center; font-size: 13px; min-width: 0; gap: 8px; }
html[data-ui="amber"] .sp-compact #sp-date { width: 154px; }
html[data-ui="amber"] .sp-compact .sp-rule-summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 8px; max-width: 100%; border: 1px solid var(--warning, var(--accent)); border-radius: 10px; background: var(--accent-soft); font-size: 13px; }
html[data-ui="amber"] .sp-compact .sp-rule-summary strong { padding: 0 4px; }
html[data-ui="amber"] .sp-compact .sp-rule-summary .btn { margin: 0; padding: 6px 12px; }
html[data-ui="amber"] .sp-compact .sp-majorbar { align-items: center; gap: 10px 16px; margin: 0 0 12px; }
html[data-ui="amber"] .sp-compact .sp-majorbar-shop { flex-direction: row; align-items: center; gap: 10px; min-width: 0; font-size: 14px; }
html[data-ui="amber"] .sp-compact #sp-shop { width: 200px; max-width: 100%; }
html[data-ui="amber"] .sp-compact .sp-meta { display: flex; flex: 1 1 240px; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px; min-width: 0; }
html[data-ui="amber"] .sp-compact .sp-meta > p { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
html[data-ui="amber"] .sp-compact .sp-meta .j22-update-status[data-sp-current="true"]::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--success, #34844a); }
html[data-ui="amber"] .sp-compact #sp-silver[data-missing="1"] { max-width: 560px; padding: 8px 12px; }
html[data-ui="amber"] .sp-compact #sp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 12px; margin-bottom: 12px; }
html[data-ui="amber"] .sp-compact #sp-filter > label { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; min-width: 0; }
html[data-ui="amber"] .sp-compact #sp-filter input:not([type="checkbox"]) { width: 138px; }
html[data-ui="amber"] .sp-compact #sp-filter input[name="standardWeight"] { width: 130px; }
html[data-ui="amber"] .sp-compact #sp-filter select { width: 104px; }
html[data-ui="amber"] .sp-compact #sp-filter .btn { flex: 0 0 auto; }
html[data-ui="amber"] .sp-compact #sp-filter-edit-tools:empty,
html[data-ui="amber"] .sp-compact #sp-warning-error:empty { display: none; }
html[data-ui="amber"] .sp-compact #sp-warn-refresh { margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--warning, var(--accent)); border-radius: 8px; background: var(--accent-soft); font-size: 14px; }
html[data-ui="amber"] .sp-compact #sp-warn-refresh .btn { margin-left: 8px; }
html[data-ui="amber"] .sp-compact #sp-status { margin: 0 0 10px; font-size: 14px; }
html[data-ui="amber"] .sp-compact .sp-list-head { align-items: center; gap: 8px; padding: 10px 12px; }
html[data-ui="amber"] .sp-compact .sp-list-head h2 { margin: 0; font-size: 18px; }
html[data-ui="amber"] .sp-compact .sp-list-meta { padding: 0; background: transparent; font-size: 13px; white-space: normal; }
html[data-ui="amber"] .sp-compact .sp-counts { display: flex; flex-wrap: wrap; gap: 6px; }
html[data-ui="amber"] .sp-compact .sp-counts .chip { white-space: nowrap; }
html[data-ui="amber"] .sp-compact .sp-list-actions { flex-wrap: wrap; align-items: center; min-width: 0; }
html[data-ui="amber"] .sp-compact [data-h30-inventory] { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
html[data-ui="amber"] .sp-compact [data-h30-inventory] > span { max-width: 240px; font-size: 13px; overflow-wrap: anywhere; }
html[data-ui="amber"] .sp-compact .sp-info { position: relative; }
html[data-ui="amber"] .sp-compact .sp-info > summary { list-style: none; cursor: pointer; font-size: 13px; padding: 6px 10px; }
html[data-ui="amber"] .sp-compact .sp-info > summary::-webkit-details-marker { display: none; }
html[data-ui="amber"] .sp-compact .sp-info-body { position: fixed; inset: 20% auto auto 50%; transform: translateX(-50%); z-index: 20; width: min(520px, calc(100vw - 48px)); max-height: 50vh; overflow: auto; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); box-shadow: 0 8px 24px #0002; font-size: 14px; overflow-wrap: anywhere; }
html[data-ui="amber"] .sp-compact .sp-info-body p { margin: 0 0 10px; line-height: 1.6; }
html[data-ui="amber"] .sp-compact .sp-info-body p:last-child { margin-bottom: 0; }
html[data-ui="amber"] .sp-compact .sp-filter-layout-slot { border-top: 1px solid var(--border); padding-top: 8px; }
html[data-ui="amber"] .sp-compact .sp-filter-layout-slot > strong { display: block; margin-bottom: 6px; font-size: 13px; }
html[data-ui="amber"] .sp-compact .sp-filter-layout-slot .wb-filter-tools { margin: 0; padding: 0; }
html[data-ui="amber"] .sp-compact .sp-settings-menu .wb-layout-sync-menu { position: static; box-shadow: none; }
@media (max-width: 1100px) {
  html[data-ui="amber"] .sp-compact .sp-list-actions { margin-left: 0; }
  html[data-ui="amber"] #sp-root.sp-compact .sp-settings-menu { position: fixed; inset: 20% 16px auto; width: auto; min-width: 0; max-width: none; max-height: 65vh; overflow: auto; }
}
@media (max-width: 700px) {
  html[data-ui="amber"] .sp-compact .sp-meta { justify-content: flex-start; flex-basis: 100%; }
  html[data-ui="amber"] .sp-compact .sp-shopbar { width: 100%; }
  html[data-ui="amber"] .sp-compact .sp-shopbar label { flex-wrap: wrap; }
  html[data-ui="amber"] .sp-compact #sp-filter > label { flex: 1 1 210px; justify-content: space-between; }
  html[data-ui="amber"] .sp-compact #sp-filter .sp-check { flex: 0 1 auto; }
  html[data-ui="amber"] .sp-compact .sp-info-body { inset: 20% 16px auto; width: auto; transform: none; }
}

/* R46: complete content and a full-table resize guide. */
#sp-root .sp-position-legacy { display: none !important; }
html[data-ui="amber"] #sp-root.sp-compact .sp-facet-field { display: flex; align-items: center; gap: 6px; }
html[data-ui="amber"] #sp-root.sp-compact .sp-facet-field[hidden] { display: none !important; }
html[data-ui="amber"] #sp-root.sp-compact .sp-facet-field > .wb-choice { display: none !important; }
html[data-ui="amber"] #sp-root.sp-compact .sp-facet-field > [hidden] { display: none !important; }
html[data-ui="amber"] #sp-root.sp-compact .sp-facet-trigger { width: 112px; min-width: 0; padding: 7px 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 13px; }
html[data-ui="amber"] #sp-root.sp-compact .sp-facet-trigger.is-selected { border-color: var(--accent); background: var(--accent-soft); }
html[data-ui="amber"] #sp-root .sp-facet-popup { position: fixed; z-index: 80; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; padding: 12px; max-height: min(560px, calc(100vh - 16px)); border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); color: var(--fg); box-shadow: 0 12px 36px #0003; }
html[data-ui="amber"] #sp-root .sp-facet-popup > input { flex: 0 0 auto; width: 100%; min-width: 0; box-sizing: border-box; }
html[data-ui="amber"] #sp-root .sp-facet-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }
html[data-ui="amber"] #sp-root .sp-facet-options { overflow: auto; min-height: 0; max-height: 360px; }
html[data-ui="amber"] #sp-root .sp-facet-choice { display: flex; align-items: center; gap: 9px; padding: 9px 8px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
html[data-ui="amber"] #sp-root .sp-facet-choice input { width: 16px; height: 16px; flex: 0 0 auto; }
html[data-ui="amber"] #sp-root .sp-facet-choice span { min-width: 0; flex: 1; }
html[data-ui="amber"] #sp-root .sp-facet-choice small { margin-left: auto; font-variant-numeric: tabular-nums; }
html[data-ui="amber"] #sp-root .sp-facet-choice:is(:hover,.is-selected) { background: var(--accent-soft); }
html[data-ui="amber"] #sp-root .sp-facet-choice:focus-within { outline: 2px solid var(--accent); outline-offset: -2px; }
html[data-ui="amber"] #sp-root .sp-facet-group { font-weight: 650; border-bottom: 1px solid var(--border); }
html[data-ui="amber"] #sp-root .sp-facet-popup > small { font-size: 12px; line-height: 1.5; }
html[data-ui="amber"] #sp-root .sp-facet-error { color: var(--danger); }
html[data-ui="amber"] #sp-root .sp-scroll :is(th,td,td small) { white-space: normal; overflow-wrap: anywhere; text-overflow: clip; }
html[data-ui="amber"] #sp-root .sp-scroll td small { overflow: visible; max-height: none; }
html[data-ui="amber"] #sp-table { position: relative; }
html[data-ui="amber"] #sp-table .sp-resize-guide { position: absolute; top: 0; width: 2px; background: var(--accent); z-index: 12; pointer-events: none; }
html[data-ui="amber"] #sp-table [data-sp-price] input { box-sizing: border-box; width: 100%; min-width: 0; }

/* I9 2026-11-26: responsive filter card and one flowing list toolbar. */
html[data-ui="amber"] #sp-root.sp-compact .sp-head { margin-bottom: 12px; }
html[data-ui="amber"] #sp-root.sp-compact .sp-statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 16px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-elev); }
html[data-ui="amber"] #sp-root.sp-compact .sp-rule-summary { padding: 0; border: 0; background: transparent; }
html[data-ui="amber"] #sp-root.sp-compact .sp-rule-summary strong { padding: 6px 10px; border-radius: 6px; background: var(--accent-soft); color: var(--text); }
html[data-ui="amber"] #sp-root.sp-compact .sp-rule-summary .btn { padding: 6px 8px; background: transparent; box-shadow: none; }
html[data-ui="amber"] #sp-root.sp-compact .sp-filter-card { min-width: 0; padding: 12px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--bg-elev); }
html[data-ui="amber"] #sp-root.sp-compact .sp-filter-card .sp-majorbar { margin: 0 0 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
html[data-ui="amber"] #sp-root.sp-compact #sp-filter { padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; gap: 8px 12px; }
html[data-ui="amber"] #sp-root.sp-compact #sp-filter > label,
html[data-ui="amber"] #sp-root.sp-compact #sp-filter .sp-facet-field { flex: 0 1 auto; flex-wrap: nowrap; justify-content: flex-start; max-width: 100%; font-size: 14px; }
html[data-ui="amber"] #sp-root.sp-compact #sp-filter > label > span,
html[data-ui="amber"] #sp-root.sp-compact #sp-filter .sp-facet-field > span { flex: 0 0 auto; }
html[data-ui="amber"] #sp-root.sp-compact #sp-filter .sp-facet-field > button { width: auto; min-width: 100px; max-width: 180px; }
html[data-ui="amber"] #sp-root.sp-compact #sp-filter input[name="q"] { width: 180px; }
html[data-ui="amber"] #sp-root.sp-compact .sp-major-group { gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
html[data-ui="amber"] #sp-root.sp-compact .sp-major-btn { border: 0; border-radius: 0; box-shadow: none; }
html[data-ui="amber"] #sp-root.sp-compact .sp-major-btn + .sp-major-btn { border-left: 1px solid var(--border); }
html[data-ui="amber"] #sp-root.sp-compact .sp-list-head { gap: 8px; padding: 10px 12px; }
html[data-ui="amber"] #sp-root.sp-compact .sp-list-actions { display: contents; }
html[data-ui="amber"] #sp-root.sp-compact .sp-list-head > *,
html[data-ui="amber"] #sp-root.sp-compact .sp-list-actions > * { max-width: 100%; min-width: 0; }
html[data-ui="amber"] #sp-root.sp-compact .sp-list-meta { white-space: normal; overflow-wrap: anywhere; }
html[data-ui="amber"] #sp-root.sp-compact .sp-list-head .btn { padding: 7px 10px; font-size: 14px; white-space: nowrap; }
html[data-ui="amber"] #sp-root.sp-compact .sp-list-head .chip { padding: 4px 8px; font-size: 13px; }
html[data-ui="amber"] #sp-root.sp-compact .sp-info > summary { font-size: 13px; }
html[data-ui="amber"] #sp-root.sp-compact .sp-list-actions > [data-sp="links"] { margin-left: auto; }
html[data-ui="amber"] #sp-root.sp-compact [data-h30-inventory] { gap: 6px; }
html[data-ui="amber"] #sp-root.sp-compact [data-h30-inventory] > span { max-width: 240px; font-size: 13px; }
html[data-ui="amber"] #sp-root.sp-compact [data-h30-inventory] > span[data-sp-ready="true"] { white-space: nowrap; }
html[data-ui="amber"] #sp-root.sp-compact [data-h30-inventory] > span[data-sp-ready="true"]::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: var(--success, #34844a); }
html[data-ui="amber"] #sp-root.sp-compact [data-h30-inventory] > span:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
html[data-ui="amber"] #sp-root.sp-compact .sp-list-actions > .sp-sync-status { flex-basis: 100%; white-space: normal; }
html[data-ui="amber"] #sp-root.sp-compact .sp-scroll { border-top-left-radius: 0; border-top-right-radius: 0; }
@media (max-width: 700px) {
  html[data-ui="amber"] #sp-root.sp-compact .sp-list-actions > [data-sp="links"] { margin-left: 0; }
  html[data-ui="amber"] #sp-root.sp-compact .sp-info-body { position: static; width: auto; max-width: 100%; max-height: 50vh; transform: none; margin-top: 8px; }
  html[data-ui="amber"] #sp-root.sp-compact .sp-info[open] { flex-basis: 100%; }
}

html[data-ui="amber"] #sp-root.sp-compact .sp-major-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent, #fff); font-weight: 600; }

/* Keyboard users can read the same full inventory source shown by hover. */
html[data-ui="amber"] #sp-root.sp-compact [data-h30-inventory] > span[data-sp-ready="true"]:focus::after { content: attr(title); display: block; max-width: 240px; margin-top: 4px; padding: 4px 6px; border: 1px solid var(--border); border-radius: 4px; background: var(--bg-elev); color: var(--text); white-space: normal; overflow-wrap: anywhere; }
