.category-commander{margin-top:14px}
.category-head{align-items:flex-start}
.category-subtitle{margin:5px 0 0;color:var(--muted);font-size:11px;line-height:1.5}
.category-tools{display:flex;flex-direction:column;align-items:flex-end;gap:9px;min-width:min(100%,650px)}
.level-tabs{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:5px}
.level-tabs button{
  border:1px solid var(--line);background:#fff;color:#666;border-radius:999px;padding:7px 9px;font-size:9px;font-weight:800
}
.level-tabs button:hover{border-color:var(--line-strong);color:#111}
.level-tabs button.active{background:#111;color:#fff;border-color:#111}
.category-tools .search-input{width:250px}

.category-summary{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-bottom:14px}
.category-stat{border:1px solid var(--line);border-radius:13px;padding:11px 12px;background:var(--surface-2)}
.category-stat small{display:block;color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.06em;font-weight:800}
.category-stat strong{display:block;font-size:18px;letter-spacing:-.035em;margin-top:4px}
.category-stat span{display:block;color:var(--muted);font-size:9px;margin-top:3px}

.category-layout{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(250px,.55fr);gap:14px}
.category-table-wrap{overflow:auto;border:1px solid var(--line);border-radius:13px;max-height:560px}
.category-table{width:100%;border-collapse:collapse;min-width:850px}
.category-table th,.category-table td{padding:10px 11px;border-bottom:1px solid var(--line);white-space:nowrap;text-align:right}
.category-table th:nth-child(2),.category-table td:nth-child(2){text-align:left}
.category-table th{position:sticky;top:0;z-index:2;background:#fafafa;color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.06em}
.category-table td{font-size:10px}
.category-table tbody tr{transition:.14s ease}
.category-table tbody tr:hover{background:#fbfbfc}
.category-table tbody tr.product-row{cursor:pointer}
.category-rank{display:inline-grid;place-items:center;min-width:23px;height:23px;border-radius:8px;background:#111;color:#fff;font-size:9px;font-weight:850}
.category-name{display:flex;align-items:center;gap:8px;min-width:200px}
.category-name-main{display:flex;flex-direction:column;gap:2px;overflow:hidden}
.category-name-main strong{overflow:hidden;text-overflow:ellipsis;max-width:320px}
.category-name-main small{font-size:8px;color:var(--muted)}
.rank-move{font-weight:800;font-size:9px}
.rank-move.up{color:var(--success)}
.rank-move.down{color:var(--danger)}
.rank-move.flat{color:var(--muted)}
.share-pill{display:inline-block;padding:4px 6px;background:var(--surface-3);border-radius:999px;font-size:8px;font-weight:750}

.category-side{display:flex;flex-direction:column;gap:12px}
.category-side-card{border:1px solid var(--line);border-radius:14px;padding:13px;background:var(--surface-2)}
.category-side-card h3{font-size:14px;margin:4px 0 12px;letter-spacing:-.025em}
.pareto-summary{font-size:11px;color:var(--muted);line-height:1.45;margin-bottom:11px}
.pareto-summary strong{color:var(--ink)}
.pareto-bars{display:flex;flex-direction:column;gap:9px}
.pareto-row{display:grid;grid-template-columns:42px 1fr 48px;align-items:center;gap:7px;font-size:9px}
.pareto-track{height:7px;background:#e8e8eb;border-radius:999px;overflow:hidden}
.pareto-track span{display:block;height:100%;background:var(--accent);border-radius:999px}
.pareto-value{text-align:right;font-weight:800}
.movers-list{display:flex;flex-direction:column;gap:7px}
.mover{display:grid;grid-template-columns:1fr auto;gap:7px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}
.mover:last-child{border-bottom:0}
.mover-name{display:flex;flex-direction:column;gap:2px;overflow:hidden}
.mover-name strong{font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mover-name span{font-size:8px;color:var(--muted)}
.mover-delta{font-size:9px;font-weight:850}

.product-drawer{
  position:fixed;top:0;right:0;height:100vh;width:min(560px,95vw);background:#fff;z-index:95;
  padding:22px;box-shadow:-20px 0 55px rgba(0,0,0,.18);transform:translateX(105%);transition:transform .22s ease;overflow:auto
}
.product-drawer.open{transform:translateX(0)}
.product-drawer-head{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;padding-bottom:16px;border-bottom:1px solid var(--line)}
.product-drawer-head h2{font-size:24px;letter-spacing:-.04em;margin:5px 0 4px}
.product-drawer-head p{margin:0;color:var(--muted);font-size:10px}
.product-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:16px 0}
.product-card{border:1px solid var(--line);border-radius:13px;padding:12px}
.product-card small{display:block;color:var(--muted);font-size:8px;text-transform:uppercase;letter-spacing:.06em;font-weight:800}
.product-card strong{display:block;font-size:17px;letter-spacing:-.035em;margin-top:5px}
.product-card span{display:block;font-size:8px;color:var(--muted);margin-top:4px}
.product-section{border-top:1px solid var(--line);padding-top:14px;margin-top:14px}
.product-section h3{font-size:13px;margin:0 0 10px}
.product-facts{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.product-fact{display:flex;justify-content:space-between;gap:10px;padding:8px 10px;background:var(--surface-2);border-radius:9px;font-size:9px}
.product-fact span{color:var(--muted)}
.product-store-list{display:flex;flex-direction:column;gap:7px}
.product-store{display:grid;grid-template-columns:1fr auto auto;gap:8px;padding:9px 10px;border:1px solid var(--line);border-radius:10px;font-size:9px}
.product-store strong{font-size:9px}
.product-store span{color:var(--muted)}
.product-note{padding:10px 12px;border-radius:10px;background:var(--warning-soft);color:var(--warning);font-size:9px;line-height:1.45;margin-top:12px}

@media(max-width:1100px){
  .category-layout{grid-template-columns:1fr}
  .category-side{display:grid;grid-template-columns:1fr 1fr}
}
@media(max-width:860px){
  .category-head{align-items:stretch}
  .category-tools{align-items:stretch;min-width:0;width:100%}
  .level-tabs{justify-content:flex-start;overflow:auto;flex-wrap:nowrap;padding-bottom:2px}
  .level-tabs button{flex:0 0 auto}
  .category-tools .search-input{width:100%}
  .category-summary{grid-template-columns:1fr 1fr}
  .category-side{grid-template-columns:1fr}
  .product-grid,.product-facts{grid-template-columns:1fr}
}
@media(max-width:520px){
  .category-summary{grid-template-columns:1fr 1fr}
  .category-stat strong{font-size:15px}
}