/* Pacote por nicho e catálogo genérico (P1). Escopado em .cx para não alcançar as outras telas;
   veio do protótipo docs/pivo-nucleo-generico/prototipo/styles.css, com os tokens do design-system. */
.cx .icon { width: 20px; height: 20px; flex: none; }
.cx .page { max-width: 1180px; margin: 0 auto; padding: 28px 28px 120px; }
.cx .page.narrow { max-width: 720px; }
.cx .page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 22px; }
.cx .page-head h1 { margin: 2px 0 6px; font: 600 clamp(26px, 3.2vw, 36px)/1.1 var(--font-display); letter-spacing: -.03em; }
.cx .page-head h1:focus { outline: none; }
.cx .eyebrow, .cx .label { margin: 0; color: var(--ink-muted); font: 500 11px/1.6 var(--font-utility); letter-spacing: .09em; text-transform: uppercase; }
.cx .lede { max-width: 720px; margin: 0; color: var(--ink-soft); }
.cx .hint { margin: 6px 0 0; color: var(--ink-muted); font-size: 13.5px; }
.cx .note { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--accent-line); border-radius: 10px; background: var(--accent-soft); font-size: 14px; }
.cx .head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cx a.button[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.cx .chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--brand-cream); color: var(--ink); font-size: 12.5px; }
.cx .chip .icon { width: 15px; height: 15px; }
.cx .stepper { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 22px; padding: 0; list-style: none; font-size: 14px; color: var(--ink-muted); }
.cx .stepper li { display: flex; align-items: center; gap: 8px; }
.cx .step-n { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; background: var(--cn-surface); font: 500 12px/1 var(--font-utility); }
.cx .stepper .is-current { color: var(--ink); font-weight: 600; }
.cx .stepper .is-current .step-n { border-color: var(--brand-teal); background: var(--brand-teal); color: var(--cn-on-brand); }
.cx .stepper .is-done .step-n { border-color: var(--accent-line); background: var(--brand-lime-soft); color: var(--brand-teal); }
.cx .wizard-form { display: grid; gap: 18px; }
.cx .wizard-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.cx fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.cx legend { margin-bottom: 10px; font-weight: 600; }
.cx .choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cx .choice-card { position: relative; display: grid; align-content: start; gap: 8px; min-height: 230px; padding: 20px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--cn-surface); cursor: pointer; transition: border-color .16s, box-shadow .16s; }
.cx .choice-card input { position: absolute; top: 18px; right: 18px; width: 20px; height: 20px; }
.cx .choice-card:hover { border-color: var(--cn-success-border); }
.cx .choice-card:has(input:checked) { border-color: var(--brand-teal); box-shadow: 0 0 0 3px var(--brand-lime-soft); }
.cx .choice-card:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.cx .choice-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--brand-cream); color: var(--brand-teal); }
.cx .choice-icon .icon { width: 24px; height: 24px; }
.cx .choice-card strong { font: 600 21px/1.2 var(--font-display); letter-spacing: -.02em; }
.cx .choice-card > span:not(.chip):not(.choice-icon) { color: var(--ink-soft); font-size: 14.5px; }
.cx .choice-card .chip { justify-self: start; margin-top: auto; }
.cx .profile-list, .cx .tone { display: grid; gap: 10px; }
.cx .profile-option, .cx .tone-option, .cx .check { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--cn-surface); cursor: pointer; }
.cx .profile-option:has(input:checked), .cx .tone-option:has(input:checked) { border-color: var(--brand-teal); background: var(--cn-surface-muted); }
.cx .profile-option input, .cx .tone-option input, .cx .check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.cx .profile-option span, .cx .tone-option span, .cx .check span { display: grid; gap: 2px; }
.cx .profile-option span span, .cx .tone-option span span, .cx .check span span { color: var(--ink-soft); font-size: 14px; }
.cx .tone { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cx .tone legend { grid-column: 1 / -1; }
.cx .ready-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cx .ready { padding: 18px 20px; }
.cx .ready.wide { grid-column: 1 / -1; }
.cx .ready h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 600 17px/1.3 var(--font-display); }
.cx .ready h2 .icon { color: var(--brand-teal-soft); }
.cx .ready.notice { border-color: var(--cn-warning-border); background: var(--warning-soft); }
.cx .agent-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.cx .agent-list li { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; background: var(--surface-soft); }
.cx .agent-list li.off { opacity: .72; }
.cx .agent-list span:last-child { color: var(--ink-soft); font-size: 14px; }
.cx .agent-state { justify-self: start; padding: 1px 8px; border-radius: 999px; background: var(--cn-surface); border: 1px solid var(--line); font: 500 11px/1.6 var(--font-utility); text-transform: uppercase; letter-spacing: .05em; }
.cx .agent-list .on .agent-state { border-color: var(--accent-line); background: var(--brand-lime-soft); }
.cx .mini-funnel { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; counter-reset: s; }
.cx .mini-funnel li { padding: 6px 12px; border-radius: 8px; background: var(--brand-cream); font-size: 14px; }
.cx .mini-funnel li:not(:last-child)::after { content: " →"; color: var(--ink-muted); }
.cx .mini-funnel .won { background: var(--brand-lime-soft); font-weight: 600; }
.cx .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; list-style: none; }
.cx .tags li { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 13.5px; }
.cx .bubbles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 12px; }
.cx .bubble-card { margin: 0; padding: 14px; border-radius: 12px; background: var(--cn-bg-subtle); }
.cx .bubble-card figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; margin-bottom: 10px; font-size: 14px; }
.cx .bubble { position: relative; margin: 0; padding: 10px 12px 8px; border-radius: 10px 10px 10px 2px; background: var(--cn-surface); font-size: 14.5px; line-height: 1.45; box-shadow: 0 1px 1px #143f3214; }
.cx .bubble mark { padding: 0 2px; border-radius: 3px; background: var(--brand-lime-soft); color: inherit; }
.cx .bubble small { display: block; margin-top: 8px; color: var(--ink-muted); font-size: 12.5px; }
.cx .bubble.incoming { max-width: 420px; border-radius: 10px 10px 2px 10px; margin-left: auto; background: var(--cn-selection); }
.cx .facts { display: grid; gap: 10px; margin: 0; }
.cx .facts div { display: grid; gap: 2px; }
.cx .facts dt { color: var(--ink-muted); font-size: 13px; }
.cx .facts dd { margin: 0; }
.cx .form-grid { display: grid; gap: 16px; }
.cx .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx .field { display: grid; gap: 6px; min-width: 0; }
.cx .field.full { grid-column: 1 / -1; }
.cx .field label, .cx .field > legend { font-weight: 600; font-size: 14.5px; }
.cx .field input, .cx .field select, .cx .field textarea { width: 100%; }
.cx .field-error { margin: 0; color: var(--danger); font-size: 13.5px; font-weight: 500; }
.cx .greeting-preview { padding: 16px; background: var(--cn-bg-subtle); }
.cx .toast { position: fixed; left: 50%; bottom: 24px; z-index: 60; max-width: min(560px, calc(100vw - 32px)); padding: 12px 18px; border-radius: 10px; background: var(--brand-teal-deep); color: var(--cn-on-brand); box-shadow: var(--shadow-float); transform: translateX(-50%); font-size: 14.5px; }
.cx .toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.cx .search { position: relative; flex: 1 1 280px; }
.cx .search .icon { position: absolute; left: 12px; top: 12px; color: var(--ink-muted); }
.cx .search input { width: 100%; padding-left: 40px !important; }
.cx .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cn-surface); }
.cx table { width: 100%; border-collapse: collapse; }
.cx th, .cx td { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; font-size: 14.5px; }
.cx thead th { position: sticky; top: 0; background: var(--surface-soft); color: var(--ink-soft); font: 500 11px/1.4 var(--font-utility); letter-spacing: .07em; text-transform: uppercase; white-space: nowrap; }
.cx tbody tr:last-child > * { border-bottom: 0; }
.cx .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx td small { color: var(--ink-muted); }
.cx .product-cell { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; }
.cx .product-cell:hover strong { text-decoration: underline; }
.cx .product-cell span { display: grid; }
.cx .product-cell img, .cx .thumb-empty, .cx .product-cards img { width: 44px; height: 44px; flex: none; border-radius: 8px; object-fit: cover; }
.cx .thumb-empty { display: grid; place-items: center; background: var(--brand-cream); color: var(--ink-muted); }
.cx .promo { color: var(--cn-success); font-weight: 600; }
.cx s { color: var(--ink-muted); font-size: 13px; }
.cx .warn { color: var(--warning); font-weight: 500; }
.cx .badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--cn-surface); font-size: 12.5px; white-space: nowrap; }
.cx .badge .icon { width: 14px; height: 14px; }
.cx .s-ativo { border-color: var(--accent-line); background: var(--brand-lime-soft); }
.cx .s-rascunho { background: var(--warning-soft); border-color: var(--cn-warning-border); }
.cx .s-arquivado { color: var(--ink-muted); }
.cx .badge.new { background: var(--brand-lime-soft); border-color: var(--accent-line); font-size: 11px; }
.cx .badge.good { background: var(--brand-lime-soft); border-color: var(--accent-line); }
.cx .badge.bad { white-space: normal; background: var(--danger-soft); border-color: var(--cn-danger-border); color: var(--danger); }
.cx .product-cards { display: none; margin: 0; padding: 0; list-style: none; }
.cx .state-box { display: flex; gap: 16px; padding: 28px; border: 1px dashed var(--cn-sage-300); border-radius: 14px; background: var(--cn-surface); }
.cx .state-box > .icon { width: 30px; height: 30px; color: var(--brand-teal-soft); }
.cx .state-box h2 { margin: 0 0 6px; font: 600 20px/1.25 var(--font-display); }
.cx .state-box p { margin: 0 0 14px; color: var(--ink-soft); }
.cx .state-box.error { border-style: solid; border-color: var(--cn-danger-border); background: var(--danger-soft); }
.cx .state-box.error > .icon { color: var(--danger); }
.cx .empty-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cx .skeleton-list { display: grid; gap: 10px; }
.cx .skeleton-row { height: 64px; border-radius: 10px; background: linear-gradient(90deg, var(--cn-bg-subtle), var(--cn-surface-muted), var(--cn-bg-subtle)); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.cx .back { display: inline-block; margin-bottom: 10px; color: var(--ink-soft); font-size: 14px; }
.cx .status-select { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.cx .product-form { display: grid; gap: 16px; }
.cx .block { padding: 20px; overflow: visible; }
.cx .block h2 { margin: 0 0 4px; font: 600 18px/1.3 var(--font-display); }
.cx .block-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 20px; margin-bottom: 14px; }
.cx .block-head .hint { margin: 0; }
.cx .count { margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--brand-cream); font: 500 12px/1.6 var(--font-utility); }
.cx .lock-tag { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--ink-muted); font: 500 11px/1 var(--font-utility); text-transform: none; letter-spacing: 0; }
.cx .lock-tag .icon { width: 13px; height: 13px; }
.cx .options { display: grid; gap: 12px; justify-items: start; }
.cx .option-row { display: grid; grid-template-columns: minmax(140px, 220px) minmax(0, 1fr) auto; align-items: end; gap: 12px; width: 100%; }
.cx .bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; }
.cx .bulk input { width: 120px; }
.cx .variants input:not([type="checkbox"]) { width: 100%; min-width: 92px; min-height: 40px !important; padding: 7px 10px !important; }
.cx .variants th[scope="row"] { font-weight: 600; white-space: nowrap; }
.cx .variants tr.inactive th, .cx .variants tr.inactive td { opacity: .55; }
.cx .variants .field-error { display: block; margin-top: 4px; font-size: 12.5px; }
.cx .stock-cell { display: grid; gap: 4px; }
.cx .mini-check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 12.5px; white-space: nowrap; }
.cx .switch { width: 22px; height: 22px; }
.cx .promo-window { margin-top: 16px; }
.cx .photos { display: flex; flex-wrap: wrap; gap: 14px; margin: 0; padding: 0; list-style: none; }
.cx .photos li { display: grid; gap: 6px; width: 150px; }
.cx .photos img { width: 150px; height: 150px; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.cx .photos select { min-height: 36px !important; padding: 4px 8px !important; font-size: 13px; width: 100%; }
.cx .photos .button { min-height: 36px; padding: 4px 8px; font-size: 13px; }
.cx .upload { display: grid; place-items: center; align-content: center; gap: 6px; width: 150px; height: 150px; border: 1.5px dashed var(--cn-sage-300); border-radius: 10px; color: var(--ink-soft); cursor: pointer; font-size: 14px; }
.cx .upload:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.cx .save-bar { position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; background: #fffffff2; box-shadow: var(--shadow-float); }
.cx .save-bar span { margin-right: auto; color: var(--ink-soft); font-size: 14px; }
.cx .error-summary { margin-bottom: 16px; padding: 14px 18px; border: 1px solid var(--cn-danger-border); border-radius: 12px; background: var(--danger-soft); }
.cx .error-summary h2 { margin: 0 0 6px; color: var(--danger); font: 600 16px/1.3 var(--font-display); }
.cx .error-summary ul { margin: 0; padding-left: 18px; }
.cx .error-summary a { color: var(--danger); }
.cx .dropzone { display: grid; justify-items: center; gap: 12px; padding: 36px 20px; text-align: center; }
.cx .dropzone p { max-width: 560px; margin: 0; color: var(--ink-soft); }
.cx .drop-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--brand-cream); color: var(--brand-teal); }
.cx .drop-icon.ok { background: var(--brand-lime-soft); }
.cx .drop-icon .icon { width: 28px; height: 28px; }
.cx .mapping { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 16px 0; }
.cx .req { color: var(--ink-muted); font: 500 10.5px/1 var(--font-utility); text-transform: uppercase; }
.cx .import-summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.cx .stat { display: grid; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--cn-surface); }
.cx .stat strong { font: 600 28px/1.1 var(--font-display); }
.cx .stat span { color: var(--ink-soft); font-size: 14px; }
.cx .stat.ok { border-color: var(--accent-line); background: var(--cn-surface-muted); }
.cx .stat.bad { border-color: var(--cn-danger-border); background: var(--cn-surface); }
.cx .row-bad { background: var(--cn-surface); }
.cx .result { display: grid; justify-items: center; gap: 10px; padding: 36px 20px; text-align: center; }
.cx .result h2 { font-size: 22px; }
@media (max-width: 900px) {
.cx .page { padding: 20px 16px 120px; }
.cx .choice-grid, .cx .ready-grid, .cx .tone, .cx .form-grid.two, .cx .import-summary { grid-template-columns: minmax(0, 1fr); }
.cx .choice-card { min-height: 0; }
.cx .table-wrap:has(.products) { display: none; }
.cx .product-cards { display: grid; gap: 10px; }
.cx .product-cards a { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--cn-surface); color: var(--ink); text-decoration: none; }
.cx .product-cards a > span:nth-child(2) { display: grid; flex: 1; min-width: 0; }
.cx .product-cards small { color: var(--ink-soft); }
.cx .option-row { grid-template-columns: minmax(0, 1fr); }
.cx .variants thead { display: none; }
.cx .variants, .cx .variants tbody, .cx .variants tr, .cx .variants td, .cx .variants th { display: block; width: 100%; }
.cx .variants tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.cx .variants th[scope="row"], .cx .variants td { padding: 4px 0; border: 0; }
.cx .variants td { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 8px; }
.cx .variants td::before { content: attr(data-label); color: var(--ink-soft); font-size: 13px; }
.cx .table-wrap:has(.variants) { overflow: visible; }
.cx .bulk input { width: calc(50% - 4px); }
.cx .wizard-actions .button { flex: 1; }
/* A barra de busca vira coluna no celular: a busca não pode herdar a base de 280 px como altura. */
.cx .toolbar .search { flex: 0 0 auto; }
.cx .toolbar select { width: 100%; }
.cx .note .button { flex: none; white-space: nowrap; }
}
@media (max-width: 520px) {
.cx .state-box { flex-direction: column; padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
.cx .skeleton-row { animation: none; }
}
.cx .bubble-card figcaption { flex-wrap: nowrap; align-items: flex-start; }
.cx .bubble-card figcaption .chip { flex: none; }
.cx .ready.wide .facts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cx .facts dd { font-size: 14.5px; }
@media (max-width: 900px) {
.cx .ready.wide .facts { grid-template-columns: minmax(0, 1fr); }
}

/* Campo travado pela origem ou acesso de leitura: visível, mas claramente fora de edição. */
.cx input:disabled, .cx select:disabled, .cx textarea:disabled { background: var(--surface-soft); color: var(--ink-soft); cursor: not-allowed; }
.cx .note .empty-actions { margin-top: 10px; }
/* pcp.css define .form-grid com colunas fixas do PCP; aqui a grade é a do formulário. */
.cx .form-grid { grid-template-columns: minmax(0, 1fr); }
.cx .form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cx .field label, .cx .field > legend { color: var(--ink); font-size: 14.5px; }
@media (max-width: 900px) { .cx .form-grid.two { grid-template-columns: minmax(0, 1fr); } }
.cx .field input[type="radio"], .cx .field input[type="checkbox"] { width: 20px; height: 20px; flex: none; }

/* ================================================================ Produtos · Painel P2 (docs/painel/p2/DESENHO.md §4)
   Grade com foto primeiro (sem cartão com sombra igual: a foto é a superfície), "o agente mostra N de M" com a barra de
   proporção em lime (a ousadia da tela), busca grande, filtros em chips com o logo da origem, lista densa no desktop,
   detalhe em folha ou painel e a barra em massa. Só tokens --cn-*; só transform e opacity animam. O editor e a
   importação continuam com as regras de cima. */
[data-commerce-catalog] .pd { width: 100%; max-width: 1400px; margin-inline: auto; padding: var(--cn-space-4) 0 calc(var(--cn-space-16) + 64px); color: var(--cn-text); font-family: var(--cn-font-body); }

/* ---------------------------------------------------------------- cabeçalho e a resposta da tela */
.pd-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--cn-space-3) var(--cn-space-4); margin-bottom: var(--cn-space-5); }
.pd-head__title { display: flex; align-items: center; gap: var(--cn-space-2); min-width: 0; }
.pd-head h1 { margin: 0; color: var(--cn-text); font: var(--cn-weight-bold) var(--cn-text-app-title) / var(--cn-leading-title) var(--cn-font-display); letter-spacing: -0.01em; }
.pd-head h1:focus { outline: none; }
.pd-head__actions { display: flex; align-items: center; gap: var(--cn-space-2); }
.pd-head__actions .cn-btn { min-height: var(--cn-touch); }
.pd-agent { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--cn-space-2); max-width: 520px; margin: 0; }
.pd-agent__text { color: var(--cn-text-muted); font: var(--cn-weight-semibold) var(--cn-text-app-body) / 1.2 var(--cn-font-body); }
.pd-agent .cn-number { color: var(--cn-text); font: var(--cn-weight-extrabold) var(--cn-text-app-number) / 1 var(--cn-font-display); font-variant-numeric: tabular-nums; }
.pd-agent__bar { position: relative; display: block; height: 8px; overflow: hidden; border-radius: var(--cn-radius-pill); background: var(--cn-surface-sunken); }
.pd-agent__bar i { position: absolute; inset: 0; border-radius: inherit; background: var(--cn-action); box-shadow: inset -2px 0 0 var(--cn-action-border); transform: scaleX(var(--r, 0)); transform-origin: left center; transition: transform var(--cn-motion-moment-duration) var(--cn-motion-moment-ease); }

/* ---------------------------------------------------------------- busca, filtros e o jeito de ver */
.pd-tools { display: flex; flex-direction: column; gap: var(--cn-space-3); margin-bottom: var(--cn-space-4); }
.pd-search { display: flex; align-items: center; gap: var(--cn-space-3); min-height: 52px; padding: 0 var(--cn-space-5); border-radius: var(--cn-radius-pill); background: var(--cn-surface); box-shadow: var(--cn-shadow-depth-1); color: var(--cn-text-muted); }
.pd-search:focus-within { box-shadow: var(--cn-shadow-depth-1), 0 0 0 3px var(--cn-focus); }
.cx .pd-search input[data-pd-q] { flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: var(--cn-text); font: var(--cn-weight-medium) var(--cn-text-app-body) / 1 var(--cn-font-body); outline: none; appearance: none; -webkit-appearance: none; }
.pd-chips { position: relative; flex-wrap: nowrap; overflow-x: auto; padding: 2px; margin: -2px; scrollbar-width: none; }
.pd-chips::-webkit-scrollbar { display: none; }
.pd-chip { flex: none; min-height: var(--cn-touch); white-space: nowrap; }
.pd-chip .pd-origin { width: 22px; height: 22px; box-shadow: none; }
.pd-view { display: flex; align-items: center; gap: var(--cn-space-2); }
.pd-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--cn-surface-sunken); }
.pd-seg [role="radio"] { position: relative; z-index: 0; isolation: isolate; display: inline-flex; align-items: center; gap: 6px; min-height: var(--cn-touch); padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--cn-text-muted); font: var(--cn-weight-semibold) var(--cn-text-md) / 1 var(--cn-font-body); cursor: pointer; }
.pd-seg [aria-checked="true"] { background: var(--cn-surface); box-shadow: var(--cn-shadow-depth-1); color: var(--cn-text); }
.pd-seg.cn-slide [aria-checked="true"] { background: transparent; box-shadow: none; }
.pd-seg.cn-slide [aria-checked="true"]::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: 7px; background: var(--cn-surface); box-shadow: var(--cn-shadow-depth-1); }
.pd-seg [role="radio"]:focus-visible, .pd-density:focus-visible { outline: 3px solid var(--cn-focus); outline-offset: 2px; }
.pd-density[aria-pressed="true"] { background: var(--cn-brand-soft); color: var(--cn-text-brand); }

/* ---------------------------------------------------------------- origem (logo oficial ou ícone) */
.pd-origin { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: var(--cn-radius-sm); background: var(--cn-surface); box-shadow: var(--cn-shadow-depth-1); color: var(--cn-text-muted); }
.pd-origin img { width: 20px; height: 20px; object-fit: contain; }
.pd-origin--md { width: 36px; height: 36px; }
.pd-origin--md img { width: 26px; height: 26px; }

/* ---------------------------------------------------------------- grade com foto */
.pd-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--cn-space-4) var(--cn-space-3); margin: 0; padding: 0; list-style: none; }
.pd-card { position: relative; display: flex; flex-direction: column; gap: var(--cn-space-1-5); min-width: 0; }
.pd-card__open { display: flex; flex-direction: column; gap: var(--cn-space-1-5); padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; transition: transform var(--cn-motion-press-duration) var(--cn-motion-daily-ease); }
.pd-card__open:active { transform: scale(0.98); }
.pd-card__open:focus-visible { outline: 3px solid var(--cn-focus); outline-offset: 3px; border-radius: var(--cn-radius-lg); }
.pd-photo { position: relative; display: grid; place-items: center; aspect-ratio: 1 / 1; width: 100%; overflow: hidden; border-radius: var(--cn-radius-lg); background: var(--cn-surface-muted); }
.pd-photo img { width: 100%; height: 100%; object-fit: cover; }
.pd-photo.is-empty .cn-avatar { width: 64px; height: 64px; font-size: 28px; }
.pd-photo--sm { width: 44px; height: 44px; flex: none; border-radius: var(--cn-radius-sm); }
.pd-photo--sm.is-empty .cn-avatar { width: 32px; height: 32px; font-size: 14px; }
.pd-card__name { display: -webkit-box; overflow: hidden; color: var(--cn-text); font: var(--cn-weight-semibold) var(--cn-text-app-body) / 1.3 var(--cn-font-body); -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.pd-card__price { color: var(--cn-text); font: var(--cn-weight-extrabold) var(--cn-text-app-body) / 1.1 var(--cn-font-display); font-variant-numeric: tabular-nums; }
.pd-card__price.is-promo, .pd-num.is-promo, .pd-detail__now.is-promo { color: var(--cn-success); }
.pd-card__origin { position: absolute; top: var(--cn-space-2); left: var(--cn-space-2); pointer-events: none; }
/* Rodapé: chips e interruptor na mesma linha com 8 px de folga; sem espaço para o chip mais largo, o interruptor desce. */
.pd-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cn-space-1) var(--cn-space-2); min-height: var(--cn-touch); }
.pd-card__meta { display: flex; flex: 1 0 0; flex-wrap: wrap; align-items: center; gap: var(--cn-space-1) var(--cn-space-2); min-width: min-content; }
.pd-card__foot .pd-switch { flex: none; margin-left: auto; }
.pd-card__vars { color: var(--cn-text-muted); font: var(--cn-weight-semibold) var(--cn-text-sm) / 1.2 var(--cn-font-body); }
.pd-card.is-hidden-agent .pd-photo img { filter: grayscale(1); opacity: 0.55; }
.pd-card.is-hidden-agent .pd-photo.is-empty .cn-avatar { opacity: 0.55; }
.pd-card.is-selected .pd-photo { outline: 3px solid var(--cn-brand); outline-offset: 2px; }
.pd-card.is-current .pd-photo { box-shadow: 0 0 0 3px var(--cn-action-border); }
.pd-card .pd-check { position: absolute; top: 2px; right: 2px; }
.pd-grid.is-compact { gap: var(--cn-space-3) var(--cn-space-2); }

/* seleção (quem administra) */
.pd-check { position: relative; display: inline-grid; place-items: center; width: var(--cn-touch); height: var(--cn-touch); flex: none; cursor: pointer; }
.pd-check input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pd-check__box { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; background: var(--cn-surface); box-shadow: inset 0 0 0 2px var(--cn-border-strong), var(--cn-shadow-depth-1); color: transparent; transition: transform var(--cn-motion-press-duration) var(--cn-motion-daily-ease); }
.pd-check input:checked ~ .pd-check__box { background: var(--cn-brand); box-shadow: none; color: var(--cn-surface); }
.pd-check input:focus-visible ~ .pd-check__box { outline: 3px solid var(--cn-focus); outline-offset: 2px; }
.pd-check input:active ~ .pd-check__box { transform: scale(0.9); }

/* ---------------------------------------------------------------- interruptor "o agente mostra" (mola só no transform) */
.pd-switch { display: inline-flex; align-items: center; gap: var(--cn-space-2); min-width: var(--cn-touch); min-height: var(--cn-touch); padding: 0; border: 0; background: transparent; color: var(--cn-text); font: var(--cn-weight-semibold) var(--cn-text-md) / 1 var(--cn-font-body); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.pd-switch__track { position: relative; display: block; width: 48px; height: 28px; flex: none; border-radius: var(--cn-radius-pill); background: var(--cn-border-strong); }
.pd-switch__track::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--cn-brand); opacity: 0; transition: opacity var(--cn-motion-daily-duration) var(--cn-motion-daily-ease); }
.pd-switch__thumb { position: absolute; top: 3px; left: 3px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--cn-surface); box-shadow: var(--cn-shadow-depth-1); color: var(--cn-text-muted); transition: transform var(--cn-motion-spring-duration) var(--cn-motion-spring-ease); }
.pd-switch[aria-checked="true"] .pd-switch__track::before { opacity: 1; }
.pd-switch[aria-checked="true"] .pd-switch__thumb { transform: translateX(20px); color: var(--cn-text-brand); }
.pd-switch:focus-visible { outline: 3px solid var(--cn-focus); outline-offset: 2px; border-radius: var(--cn-radius-pill); }
.pd-switch:disabled { cursor: not-allowed; }
.pd-switch:disabled .pd-switch__track { opacity: 0.45; }
.pd-switch[aria-busy="true"] { cursor: progress; }
.pd-switch--big .pd-switch__label { white-space: nowrap; }

/* ---------------------------------------------------------------- lista densa (desktop) */
.pd-table-wrap { overflow-x: auto; border-radius: var(--cn-radius-lg); background: var(--cn-surface); box-shadow: var(--cn-shadow-depth-1); }
.cx .pd-table th { position: static; padding: var(--cn-space-2) var(--cn-space-3); border-bottom: 1px solid var(--cn-border-subtle); background: transparent; color: var(--cn-text-muted); font: var(--cn-weight-semibold) 0.8125rem / 1.2 var(--cn-font-body); letter-spacing: 0; text-transform: none; white-space: nowrap; }
.cx .pd-table td { height: 60px; padding: var(--cn-space-1-5) var(--cn-space-3); border-bottom: 1px solid var(--cn-border-subtle); color: var(--cn-text); font: var(--cn-weight-medium) var(--cn-text-md) / 1.3 var(--cn-font-body); }
.cx .pd-table .pd-col-check { width: 52px; padding-inline: var(--cn-space-1); }
.cx .pd-table .pd-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx .pd-table .pd-col-cat { color: var(--cn-text-muted); }
.cx .pd-table .pd-col-agent { width: 1%; }
.pd-tr:hover { background: var(--cn-surface-muted); }
.pd-tr.is-cursor, .pd-tr.is-current { background: var(--cn-brand-soft); }
.pd-tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--cn-action-border); }
.pd-tr.is-hidden-agent .pd-photo img { filter: grayscale(1); opacity: 0.55; }
.pd-name { display: inline-flex; align-items: center; gap: var(--cn-space-3); max-width: 100%; min-height: var(--cn-touch); padding: 0; border: 0; background: transparent; color: var(--cn-text); font: var(--cn-weight-semibold) var(--cn-text-app-body-desktop) / 1.2 var(--cn-font-body); text-align: left; cursor: pointer; }
.pd-name span[data-pd-name] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-name:hover span[data-pd-name] { text-decoration: underline; text-underline-offset: 3px; }
.pd-name:focus-visible { outline: 3px solid var(--cn-focus); outline-offset: 2px; border-radius: var(--cn-radius-sm); }

/* ---------------------------------------------------------------- detalhe (painel no desktop, folha no celular) */
.pd-detail { display: flex; flex-direction: column; gap: var(--cn-space-4); }
.pd-detail__top { position: relative; }
.pd-detail__photo { display: grid; place-items: center; aspect-ratio: 4 / 3; width: 100%; overflow: hidden; border-radius: var(--cn-radius-lg); background: var(--cn-surface-muted); }
.pd-detail__photo img { width: 100%; height: 100%; object-fit: contain; }
.pd-detail__close { position: absolute; top: var(--cn-space-2); right: var(--cn-space-2); background: var(--cn-surface); box-shadow: var(--cn-shadow-depth-1); }
.pd-thumbs { display: flex; gap: var(--cn-space-2); margin: 0; padding: 0; list-style: none; overflow-x: auto; }
.pd-thumbs img { width: 56px; height: 56px; border-radius: var(--cn-radius-sm); object-fit: cover; }
.pd-estudio { align-self: flex-start; min-height: var(--cn-touch); }
.pd-detail__title { margin: 0; color: var(--cn-text); font: var(--cn-weight-bold) var(--cn-text-2xl) / 1.2 var(--cn-font-display); overflow-wrap: anywhere; }
.pd-detail__title:focus { outline: none; }
.pd-detail__price { display: flex; flex-wrap: wrap; align-items: center; gap: var(--cn-space-2) var(--cn-space-3); margin: 0; }
.pd-detail__now { font: var(--cn-weight-extrabold) var(--cn-text-app-number) / 1 var(--cn-font-display); font-variant-numeric: tabular-nums; }
.cx .pd-detail__was, .pd-detail__was { color: var(--cn-text-muted); font: var(--cn-weight-semibold) var(--cn-text-md) / 1 var(--cn-font-body); font-variant-numeric: tabular-nums; }
.pd-detail__agent { padding: var(--cn-space-1) var(--cn-space-3); border-radius: var(--cn-radius-md); background: var(--cn-surface-muted); }
.pd-sec { display: flex; flex-direction: column; gap: var(--cn-space-2); }
.pd-sec__h { margin: 0; color: var(--cn-text-muted); font: var(--cn-weight-semibold) var(--cn-text-sm) / 1.2 var(--cn-font-body); }
.pd-stock { display: flex; flex-wrap: wrap; gap: var(--cn-space-2); margin: 0; padding: 0; list-style: none; }
.pd-stock__item { display: inline-flex; align-items: center; gap: var(--cn-space-2); min-height: 36px; padding: 0 12px; border-radius: var(--cn-radius-pill); background: var(--cn-surface-muted); color: var(--cn-text); font: var(--cn-weight-semibold) var(--cn-text-md) / 1 var(--cn-font-body); font-variant-numeric: tabular-nums; }
.pd-stock__item.is-low { background: var(--cn-warning-bg); color: var(--cn-warning); }
.pd-stock__item.is-zero { background: var(--cn-danger-bg); color: var(--cn-danger); }
.pd-stock__item strong { font-weight: var(--cn-weight-extrabold); }
.pd-detail__src { display: flex; align-items: center; gap: var(--cn-space-3); margin: 0; color: var(--cn-text-muted); font: var(--cn-weight-semibold) var(--cn-text-md) / 1.3 var(--cn-font-body); }
/* O que o agente diz: o balão de saída do WhatsApp. */
.pd-says { align-self: flex-end; max-width: 92%; margin: 0; padding: var(--cn-space-2) var(--cn-space-3) var(--cn-space-3); border-radius: 12px 2px 12px 12px; background: var(--cn-wa-outgoing); color: var(--cn-wa-text); box-shadow: var(--cn-shadow-depth-1); font: var(--cn-weight-medium) var(--cn-text-md) / 1.45 var(--cn-font-body); }
.pd-error-line { margin: 0; padding: 10px 12px; border-radius: var(--cn-radius-sm); background: var(--cn-danger-bg); color: var(--cn-danger); font-size: var(--cn-text-sm); }
.pd-detail__foot { margin: 0; }
.pd-detail__foot .cn-btn { min-height: var(--cn-touch); }
.pd-muted { margin: 0; color: var(--cn-text-muted); }
.pd-sheet { color: var(--cn-text); font-family: var(--cn-font-body); }
.pd-sheet__body { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--cn-space-4) var(--cn-space-4) calc(var(--cn-space-6) + env(safe-area-inset-bottom)); }
@media (min-width: 600px) { .pd-sheet__body { padding: var(--cn-space-6); } }
::view-transition-group(pd-photo), ::view-transition-group(pd-name) { animation-duration: var(--cn-motion-moment-duration); animation-timing-function: var(--cn-motion-moment-ease); }

/* ---------------------------------------------------------------- em massa: sobe de baixo (superfície escura) */
.pd-bulk { position: fixed; left: 0; right: 0; bottom: calc(var(--cn-space-4) + env(safe-area-inset-bottom)); z-index: var(--cn-z-sticky); display: flex; flex-wrap: wrap; align-items: center; gap: var(--cn-space-2); width: min(620px, calc(100vw - 32px)); margin-inline: auto; padding: var(--cn-space-2) var(--cn-space-2) var(--cn-space-2) var(--cn-space-5); border-radius: var(--cn-radius-xl); background: var(--cn-surface-inverse); color: var(--cn-text-inverse); box-shadow: var(--cn-shadow-depth-3); }
.pd-bulk__n { flex: 1 1 auto; font: var(--cn-weight-bold) var(--cn-text-md) / 1 var(--cn-font-body); font-variant-numeric: tabular-nums; }
.pd-bulk .cn-btn { min-height: var(--cn-touch); }
.pd-bulk__clear.cn-btn { color: var(--cn-text-inverse); }
.pd-bulk__progress { flex: 1 1 160px; }
.pd-bulk__progress .cn-progress__fill { transform: scaleX(var(--r, 0)); transition: transform var(--cn-motion-daily-duration) var(--cn-motion-daily-ease); }
@media (max-width: 1023px) { body.is-owner-package .pd-bulk { bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* promoção em massa: uma pergunta */
.pd-promo { display: flex; flex-direction: column; }
.pd-promo__head { display: flex; align-items: center; gap: var(--cn-space-3); padding: var(--cn-space-5) var(--cn-space-5) var(--cn-space-3); }
.pd-promo__title { flex: 1; margin: 0; font: var(--cn-weight-bold) var(--cn-text-2xl) / 1.2 var(--cn-font-display); }
.pd-promo__title:focus { outline: none; }
.pd-promo__body { display: flex; flex-direction: column; gap: var(--cn-space-3); padding: 0 var(--cn-space-5) var(--cn-space-4); }
.pd-promo__opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--cn-space-2); }
.pd-promo__opt { flex-direction: column; justify-content: center; gap: 2px; text-align: center; }
.pd-promo__opt[aria-checked="true"] { background: var(--cn-brand-soft); }
.pd-promo__opt[aria-checked="true"]::after { opacity: 1; }
.pd-promo__opt:focus-visible { outline: 3px solid var(--cn-focus); outline-offset: 2px; }
.pd-promo__pct { font: var(--cn-weight-extrabold) var(--cn-text-xl) / 1 var(--cn-font-display); font-variant-numeric: tabular-nums; }
.pd-promo__foot { display: flex; justify-content: flex-end; padding: var(--cn-space-3) var(--cn-space-5) calc(var(--cn-space-4) + env(safe-area-inset-bottom)); border-top: 1px solid var(--cn-border-subtle); }
.pd-promo__foot .cn-btn { min-height: var(--cn-touch); }

/* ---------------------------------------------------------------- vazio, erro, nada com o filtro e carregando */
.pd-empty, .pd-error, .pd-nomatch { max-width: 520px; }
.pd-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--cn-space-2); }
.pd-empty__actions .cn-btn { min-height: var(--cn-touch); }
.pd-examples { min-height: var(--cn-touch); }
.pd-link { display: inline-flex; align-items: center; gap: 6px; min-height: var(--cn-touch); color: var(--cn-text-brand); font-weight: var(--cn-weight-semibold); }
.pd-card--sk { gap: var(--cn-space-2); }
.pd-sk-photo { aspect-ratio: 1 / 1; height: auto; border-radius: var(--cn-radius-lg); }
.pd-sk-line { width: 80%; height: 14px; border-radius: var(--cn-radius-pill); }
.pd-sk-line--short { width: 45%; }

/* ---------------------------------------------------------------- larguras */
@media (max-width: 599px) {
  .pd-head__actions .cn-btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .pd-head__actions .cn-btn { width: var(--cn-touch); padding: 0; justify-content: center; }
}
@media (min-width: 600px) { .pd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .pd-tools { display: grid; grid-template-columns: minmax(0, 480px) minmax(0, 1fr) auto; align-items: center; column-gap: var(--cn-space-3); }
  .pd-search { grid-column: 1; grid-row: 1; }
  .pd-examples { grid-column: 2; grid-row: 1; justify-self: end; }
  .pd-view { grid-column: 3; grid-row: 1; }
  .pd-chips { grid-column: 1 / -1; grid-row: 2; min-width: 0; }
  .pd-grid { grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: var(--cn-space-5) var(--cn-space-4); }
  .pd-grid.is-compact { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .pd.has-panel .pd-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--cn-space-5); align-items: start; }
  .pd.has-panel .pd-col-cat { display: none; }
  .pd-panel { position: sticky; top: calc(var(--command, 64px) + var(--cn-space-3)); max-height: calc(100dvh - 120px); overflow-y: auto; padding: var(--cn-space-5); border: 0; box-shadow: var(--cn-shadow-depth-2); }
  .pd-bulk { bottom: var(--cn-space-6); }
}
@media (min-width: 1500px) { .pd.has-panel .pd-layout { grid-template-columns: minmax(0, 1fr) 400px; } }
@media (prefers-reduced-motion: reduce) {
  .pd-switch__thumb, .pd-switch__track::before, .pd-agent__bar i, .pd-card__open, .pd-check__box, .pd-bulk__progress .cn-progress__fill { transition: none; }
}
