/* InkWoof v2: marcas (seletor nos compositores, lista, cadastro, leitura de arquivos).
   Mesmo vocabulário da direção de arte: superfícies --iw-surface-*, acento cobalto, tinta só no foco. */

/* ======================================================================
   Seletor "Marca: @x" (compositor da Home e do painel do agente)
   ====================================================================== */
.brand-picker { position: relative; display: inline-flex; min-width: 0; }
.brand-picker > summary { list-style: none; }
.brand-picker > summary::-webkit-details-marker { display: none; }
.brand-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; max-width: 100%; padding: 0 8px 0 10px; border-radius: 9px; cursor: pointer; flex: 0 1 auto; min-width: 0;
  font-size: 12.5px; font-weight: 500; color: var(--iw-text-2); background: transparent; box-shadow: inset 0 0 0 1px var(--iw-line-2); white-space: nowrap;
  transition: background var(--iw-dur-fast), box-shadow var(--iw-dur-fast), color var(--iw-dur-fast);
}
.brand-chip { position: relative; }
.brand-chip::after { content: ""; position: absolute; inset: -2px; }
.brand-chip:hover, .brand-picker[open] > .brand-chip { background: var(--iw-surface-3); color: var(--iw-text-1); }
.brand-picker[open] > .brand-chip { box-shadow: inset 0 0 0 1.5px var(--iw-accent-text); }
.brand-chip-label { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.brand-chip-label b { color: var(--iw-text-1); font-weight: 600; }
.brand-chip > svg { width: 14px; height: 14px; flex: none; color: var(--iw-text-3); transition: transform var(--iw-dur-fast); }
.brand-picker[open] > .brand-chip > svg { transform: rotate(180deg); }
.brand-picker.is-empty > .brand-chip { color: var(--iw-accent-text); box-shadow: inset 0 0 0 1px var(--iw-accent-line); background: var(--iw-accent-soft); }
.hero .brand-chip { height: 38px; border-radius: 10px; }
.brand-dots { display: inline-flex; align-items: center; flex: none; }
.brand-dots i { width: 12px; height: 12px; border-radius: 50%; margin-left: -4px; box-shadow: 0 0 0 1.5px var(--iw-surface-2); background: var(--iw-surface-5); }
.brand-dots i:first-child { margin-left: 0; }
.brand-dots.is-empty i { background: none; box-shadow: inset 0 0 0 1.5px var(--iw-line-3); }
.brand-chip-dots:empty { display: none; }
.brand-popover {
  position: absolute; z-index: var(--iw-z-popover); left: 0; bottom: calc(100% + 8px); width: min(320px, calc(100vw - 32px)); padding: 8px; border-radius: 16px;
  background: var(--iw-surface-2); box-shadow: var(--iw-shadow-3); animation: iw-pop-in var(--iw-dur-base) var(--iw-ease-out) both; transform-origin: 0 100%;
}
.brand-popover-title { margin: 6px 8px 8px; font-size: 11.5px; font-weight: 600; letter-spacing: var(--iw-ls-caps); text-transform: uppercase; color: var(--iw-text-3); }
.brand-options { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--iw-surface-5) transparent; }
.brand-option { display: grid; grid-template-columns: auto 1fr auto 18px; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border-radius: 10px; text-align: left; color: var(--iw-text-1); }
.brand-option:hover, .brand-option:focus-visible { background: var(--iw-surface-3); }
.brand-option[aria-selected="true"] { background: var(--iw-accent-soft); }
.brand-option-copy { display: grid; min-width: 0; }
.brand-option-copy b { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-option-copy small { font-size: 12px; color: var(--iw-text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-option .brand-dots i { width: 14px; height: 14px; box-shadow: 0 0 0 2px var(--iw-surface-2); }
.brand-option-check { opacity: 0; color: var(--iw-accent-text); }
.brand-option-check svg { width: 16px; height: 16px; }
.brand-option[aria-selected="true"] .brand-option-check { opacity: 1; }
.brand-empty-note { margin: 4px 8px 8px; font-size: 13px; line-height: 19px; color: var(--iw-text-3); }
.brand-popover-actions { display: grid; gap: 2px; margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--iw-line-1); }
.brand-popover-actions button { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 10px; font-size: 13px; color: var(--iw-text-1); text-align: left; }
.brand-popover-actions button:hover { background: var(--iw-surface-3); }
.brand-popover-actions svg { width: 16px; height: 16px; color: var(--iw-text-3); }
@media (max-width: 700px) { .brand-popover { position: fixed; left: 12px; right: 12px; bottom: 84px; width: auto; } }

/* ======================================================================
   Lista de marcas
   ====================================================================== */
.brands-root { width: 100%; }
.brands-header { align-items: flex-end; }
.brands-header-actions { display: flex; gap: 8px; }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 20px; margin-top: 20px; }
.brand-card {
  position: relative; display: flex; flex-direction: column; border-radius: 20px; overflow: hidden; background: var(--iw-surface-2);
  box-shadow: inset 0 0 0 1px var(--iw-line-1), inset 0 1px 0 var(--iw-highlight), 0 18px 40px -26px rgba(0, 0, 0, .8);
  animation: iw-att-in var(--iw-dur-base) var(--iw-ease-spring) both; animation-delay: calc(var(--n, 0) * var(--iw-stagger-list));
  transition: transform var(--iw-dur-fast) var(--iw-ease-spring), box-shadow var(--iw-dur-fast);
}
.brand-card:hover { transform: translateY(calc(var(--iw-move) * -3px)); box-shadow: inset 0 0 0 1px var(--iw-line-3), 0 22px 44px -24px rgba(0, 0, 0, .9); }
.brand-swatch-strip { display: flex; height: 56px; background: var(--iw-surface-4); }
.brand-swatch-strip i { flex: 1; }
.brand-swatch-strip.is-empty { background: repeating-linear-gradient(135deg, var(--iw-surface-3) 0 10px, var(--iw-surface-2) 10px 20px); }
.brand-card-body { display: grid; gap: 14px; padding: 16px 18px 14px; flex: 1; }
.brand-card-body > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.brand-card-id { display: flex; align-items: flex-start; gap: 12px; min-width: 0; margin-top: -34px; }
.brand-avatar { position: relative; width: 52px; height: 52px; flex: none; display: grid; place-items: center; border-radius: 50%; overflow: hidden; font: 700 20px/1 var(--iw-font-display); color: var(--iw-text-1); background: var(--iw-surface-4); box-shadow: 0 0 0 3px var(--iw-surface-2), inset 0 0 0 1px var(--iw-line-3); }
.brand-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand-card-id > div { min-width: 0; padding-top: 38px; }
.brand-card h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-handle { margin: 2px 0 0; font-size: 13px; color: var(--iw-accent-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-handle span { color: var(--iw-text-3); }
.brand-card-body > header .chip { margin-top: 4px; }
.brand-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.brand-facts dt { font-size: 11.5px; color: var(--iw-text-3); margin-bottom: 2px; }
.brand-facts dd { margin: 0; font-size: 13px; color: var(--iw-text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-card-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--iw-text-3); }
.brand-card-meta .brand-dots i { width: 14px; height: 14px; }
.brand-card-actions { display: flex; align-items: center; gap: 8px; padding: 0 18px 16px; flex-wrap: wrap; }
.brand-card-actions .brand-archive { margin-left: auto; color: var(--iw-text-3); }
.brand-card-actions .brand-archive:hover { color: var(--iw-danger); background: var(--iw-danger-soft); }
.brand-card-skeleton { min-height: 230px; background: linear-gradient(100deg, var(--iw-surface-2) 30%, var(--iw-surface-3) 50%, var(--iw-surface-2) 70%); background-size: 300% 100%; animation: iw-shimmer var(--iw-dur-shimmer) linear infinite; animation-play-state: var(--iw-loop-state); }
@keyframes iw-shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.brands-empty { grid-column: 1 / -1; display: grid; justify-items: center; text-align: center; gap: 12px; padding: 48px 20px 56px; border-radius: 24px; background: radial-gradient(60% 80% at 50% 0%, rgba(61, 92, 255, .12), transparent 70%), var(--iw-surface-2); box-shadow: inset 0 0 0 1px var(--iw-line-1); }
.brands-empty img { width: 120px; height: 120px; object-fit: contain; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .5)); }
.brands-empty h2 { font-family: var(--iw-font-display); font-size: var(--iw-fs-d4); line-height: var(--iw-lh-d4); letter-spacing: var(--iw-ls-d4); font-weight: var(--iw-fw-display); }
.brands-empty p { max-width: 52ch; font-size: 14.5px; line-height: 22px; color: var(--iw-text-2); margin: 0; }
.brands-empty-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ======================================================================
   Cadastro da marca
   ====================================================================== */
.brand-editor { display: block; padding-bottom: 24px; }
.brand-editor-head { padding-bottom: 8px; }
.brand-back { margin: 0 0 6px -6px; min-height: 36px; padding: 0 8px; color: var(--iw-text-2); }
.brand-back svg { width: 16px; height: 16px; }
.brand-editor-loading { padding: 40px 0; color: var(--iw-text-3); text-align: center; }
.brand-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; margin-top: 16px; }
.brand-editor-main { display: grid; gap: 18px; min-width: 0; }
.brand-editor-side { position: sticky; top: 16px; }
.form-card { position: relative; padding: 22px; border-radius: 20px; background: var(--iw-surface-2); box-shadow: inset 0 0 0 1px var(--iw-line-1), inset 0 1px 0 var(--iw-highlight); display: grid; gap: 14px; }
.form-section-title { display: flex; align-items: flex-start; gap: 12px; }
.form-section-title > span:first-child { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; color: var(--iw-accent-text); background: var(--iw-accent-soft); box-shadow: inset 0 0 0 1px var(--iw-accent-line); }
.form-section-title > span:first-child svg { width: 18px; height: 18px; }
.form-section-title h2 { font-size: 17px; font-weight: 650; letter-spacing: -.01em; margin: 0; }
.form-section-title p { margin: 2px 0 0; font-size: 13px; line-height: 19px; color: var(--iw-text-3); }
.form-section-title .button { margin-left: auto; flex: none; }
.brand-editor .field { display: grid; gap: 6px; margin: 0; }
.brand-editor .field > span { font-size: 12.5px; font-weight: 600; color: var(--iw-text-2); }
.brand-editor .field > small { font-size: 12px; color: var(--iw-text-3); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.brand-more { border-radius: 12px; }
.brand-more > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--iw-accent-text); list-style: none; }
.brand-more > summary::-webkit-details-marker { display: none; }
.brand-more > summary svg { width: 16px; height: 16px; transition: transform var(--iw-dur-fast); }
.brand-more[open] > summary svg { transform: rotate(180deg); }
.brand-more > .field-grid, .brand-more > .field { margin-top: 10px; }

/* Importar por arquivos */
.brand-import-card {
  position: relative; display: grid; grid-template-columns: 112px 1fr; gap: 22px; align-items: center; padding: 22px; border-radius: 22px; overflow: hidden; isolation: isolate;
  background: radial-gradient(70% 120% at 0% 0%, rgba(61, 92, 255, .18), transparent 70%), radial-gradient(50% 100% at 100% 100%, rgba(62, 224, 197, .10), transparent 70%), var(--iw-surface-2);
  box-shadow: inset 0 0 0 1px var(--iw-accent-line), inset 0 1px 0 var(--iw-highlight);
}
.import-art img { width: 112px; height: 112px; object-fit: contain; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .5)); }
.import-copy h2 { font-size: 18px; font-weight: 650; margin: 0 0 6px; }
.import-copy p { margin: 0 0 14px; font-size: 14px; line-height: 21px; color: var(--iw-text-2); max-width: 62ch; }
.import-copy p b { color: var(--iw-text-1); }
.import-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.import-or { font-size: 12.5px; color: var(--iw-text-3); }
.import-url { display: inline-flex; gap: 8px; flex: 1 1 260px; min-width: 0; }
.import-url input { flex: 1; min-width: 0; }
.import-keep { margin-top: 12px; font-size: 13px; color: var(--iw-text-2); }
.property-check { display: inline-flex; align-items: center; gap: 10px; min-height: 36px; cursor: pointer; }
.property-check input { width: 18px; height: 18px; flex: none; }
.import-status { grid-column: 1 / -1; min-height: 0; font-size: 13px; }
.import-status:empty { display: none; }
.import-status .is-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--iw-success); }
.import-status .is-ok svg { width: 16px; height: 16px; }
.import-status .is-error { color: var(--iw-danger); }
.import-status .is-working { display: inline-flex; align-items: center; gap: 10px; color: var(--iw-text-2); }
.import-status .typing b { display: inline-block; width: 5px; height: 5px; margin: 0 2px; border-radius: 50%; background: var(--iw-accent-text); animation: iw-breath 900ms ease-in-out infinite alternate; animation-play-state: var(--iw-loop-state); }
.import-status .typing b:nth-child(2) { animation-delay: .15s; }
.import-status .typing b:nth-child(3) { animation-delay: .3s; }
.import-drop { display: none; position: absolute; inset: 0; z-index: 3; place-items: center; border-radius: inherit; background: color-mix(in oklab, var(--iw-surface-2) 88%, transparent); backdrop-filter: blur(4px); box-shadow: inset 0 0 0 2px var(--iw-accent-text); }
.import-drop span { display: inline-flex; align-items: center; gap: 10px; color: var(--iw-accent-text); font-size: 15px; }
.is-dragging > .import-drop { display: grid; }
.brand-import-card.is-reading { opacity: .85; }

/* Sugestões da leitura */
.brand-suggestions { display: grid; gap: 16px; padding: 20px 22px; border-radius: 20px; background: linear-gradient(180deg, var(--iw-warning-soft), transparent 70%), var(--iw-surface-2); box-shadow: inset 0 0 0 1px rgba(245, 194, 94, .28); }
.brand-suggestions[hidden] { display: none; }
.brand-suggestions > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand-suggestions h2 { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 650; margin: 0 0 4px; }
.brand-suggestions h2 svg { color: var(--iw-warning); width: 18px; height: 18px; }
.brand-suggestions header p { margin: 0; font-size: 13px; line-height: 19px; color: var(--iw-text-2); max-width: 64ch; }
.suggestions-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.suggest-group { display: grid; gap: 10px; }
.suggest-group h3 { font-size: 12px; font-weight: 600; letter-spacing: var(--iw-ls-caps); text-transform: uppercase; color: var(--iw-text-3); margin: 0; }
.suggest-colors { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; }
.suggest-colors label { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 10px; border-radius: 12px; cursor: pointer; background: var(--iw-surface-3); box-shadow: inset 0 0 0 1px var(--iw-line-2); }
.suggest-colors label:has(input:checked) { box-shadow: inset 0 0 0 1.5px var(--iw-accent-text); background: var(--iw-accent-soft); }
.suggest-colors i { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
.suggest-colors b { font: 600 12.5px/1 var(--iw-font-mono); }
.suggest-colors small { font-size: 11px; color: var(--iw-text-3); }
.suggest-fonts { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.suggest-fonts li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.suggest-fonts li > span { display: inline-flex; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.suggest-fonts small { color: var(--iw-text-3); font-size: 12px; }
.suggest-summary { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 20px; color: var(--iw-text-1); background: var(--iw-surface-3); }
.suggest-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-action { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500; color: var(--iw-text-1); background: var(--iw-surface-3); box-shadow: inset 0 0 0 1px var(--iw-line-2); }
.chip-action:hover { background: var(--iw-surface-4); box-shadow: inset 0 0 0 1px var(--iw-accent-line); }
.suggest-limits { font-size: 13px; color: var(--iw-text-2); }
.suggest-limits summary { cursor: pointer; font-weight: 600; color: var(--iw-warning); min-height: 32px; display: flex; align-items: center; }
.suggest-limits ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* Paleta */
.palette-rows { display: grid; gap: 8px; }
.palette-row { display: grid; grid-template-columns: 44px 112px minmax(0, 1fr) 128px minmax(0, 1.2fr) auto 40px; align-items: center; gap: 8px; padding: 8px; border-radius: 14px; background: var(--iw-surface-1); box-shadow: inset 0 0 0 1px var(--iw-line-1); }
.palette-row.is-suggested { box-shadow: inset 0 0 0 1px rgba(245, 194, 94, .4); }
.palette-row :where(input:not([type="color"]), select) { min-height: 40px; }
.swatch-pick { position: relative; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; cursor: pointer; background: repeating-conic-gradient(var(--iw-surface-4) 0 25%, var(--iw-surface-3) 0 50%) 0 0 / 12px 12px; box-shadow: inset 0 0 0 1px var(--iw-line-3); }
.swatch-pick i { position: absolute; inset: 0; display: block; }
.swatch-pick input[type="color"] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; opacity: 0; cursor: pointer; padding: 0; }
.swatch-pick:focus-within { outline: 2px solid var(--iw-focus); outline-offset: 2px; }
.palette-hex { font-family: var(--iw-font-mono) !important; text-transform: uppercase; }
.palette-hex.is-invalid { box-shadow: inset 0 0 0 1.5px var(--iw-danger) !important; }
.palette-flag { height: 24px; }
.palette-empty { margin: 0; padding: 14px; border-radius: 12px; border: 1.5px dashed var(--iw-line-2); text-align: center; font-size: 13px; color: var(--iw-text-3); }
.palette-empty[hidden] { display: none; }
.palette-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.palette-paste { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--iw-surface-1); box-shadow: inset 0 0 0 1px var(--iw-line-1); }
.palette-paste[hidden] { display: none; }

/* Imagens de estilo e fotos */
.style-grid, .photo-grid { display: grid; gap: 10px; }
.style-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
.photo-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.style-tile, .photo-tile { position: relative; margin: 0; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--iw-surface-3); box-shadow: var(--iw-shadow-thumb); animation: iw-att-in var(--iw-dur-base) var(--iw-ease-spring) both; animation-delay: calc(var(--n, 0) * var(--iw-stagger-list)); }
.photo-tile { aspect-ratio: 4 / 5; border-radius: 16px; }
.style-tile img, .photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.style-ph, .photo-ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--iw-text-3); }
.style-ph svg, .photo-ph svg { width: 26px; height: 26px; }
.style-index { position: absolute; left: 8px; top: 8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; font: 650 11.5px/22px var(--iw-font-mono); text-align: center; color: #fff; background: rgba(8, 9, 13, .72); backdrop-filter: blur(6px); }
.style-remove { position: absolute; right: 8px; top: 8px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; color: #fff; background: rgba(8, 9, 13, .72); backdrop-filter: blur(6px); opacity: 0; transition: opacity var(--iw-dur-fast), background var(--iw-dur-fast); }
.style-remove svg { width: 16px; height: 16px; }
.style-tile:hover .style-remove, .photo-tile:hover .style-remove, .style-remove:focus-visible { opacity: 1; }
@media (hover: none) { .style-remove { opacity: 1; } }
.style-remove:hover { background: var(--iw-danger); }
.style-state { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 9, 13, .45); }
.style-state i { width: 26px; height: 26px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: iw-spin .8s linear infinite; animation-play-state: var(--iw-loop-state); }
@keyframes iw-spin { to { transform: rotate(360deg); } }
.style-error { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 4px 8px; border-radius: 8px; font-size: 12px; text-align: center; color: #fff; background: var(--iw-danger); }
.style-add, .photo-add { display: grid; place-content: center; justify-items: center; gap: 6px; aspect-ratio: 1; border-radius: 14px; border: 1.5px dashed var(--iw-line-3); background: none; color: var(--iw-text-2); font-size: 12.5px; transition: border-color var(--iw-dur-fast), color var(--iw-dur-fast), background var(--iw-dur-fast); }
.photo-add { aspect-ratio: 4 / 5; border-radius: 16px; font-size: 13px; }
.style-add:hover, .photo-add:hover { border-color: var(--iw-accent-text); color: var(--iw-accent-text); background: var(--iw-accent-soft); }
.style-add svg, .photo-add svg { width: 22px; height: 22px; }
.style-hint { margin: 0; font-size: 12.5px; color: var(--iw-text-3); }
.photo-helper { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 20px; color: var(--iw-text-1); background: var(--iw-accent-soft); box-shadow: inset 0 0 0 1px var(--iw-accent-line); }
.photo-helper svg { color: var(--iw-accent-text); flex: none; margin-top: 2px; }
.photo-count { margin-left: auto; font: 600 11.5px/22px var(--iw-font-mono); color: var(--iw-text-3); }
.form-card.is-paste-target { box-shadow: inset 0 0 0 1.5px var(--iw-accent-line), inset 0 1px 0 var(--iw-highlight); }
.brand-images, .brand-photos { overflow: hidden; }

/* Prévia lateral */
.brand-preview { border-radius: 20px; overflow: hidden; background: var(--iw-surface-2); box-shadow: inset 0 0 0 1px var(--iw-line-1), inset 0 1px 0 var(--iw-highlight), 0 20px 40px -28px rgba(0, 0, 0, .8); }
.preview-strip { display: flex; height: 72px; background: var(--iw-surface-4); }
.preview-strip i { flex: 1; }
.preview-strip.is-empty { background: repeating-linear-gradient(135deg, var(--iw-surface-3) 0 10px, var(--iw-surface-2) 10px 20px); }
.preview-body { display: grid; gap: 12px; padding: 18px; }
.preview-body h2 { font-family: var(--iw-font-display); font-size: 22px; line-height: 26px; letter-spacing: -.02em; font-weight: var(--iw-fw-display); margin: 0; overflow-wrap: anywhere; }
.preview-handle { margin: -6px 0 0; font-size: 13px; color: var(--iw-accent-text); }
.is-placeholder { color: var(--iw-text-3); }
.preview-palette { list-style: none; display: grid; gap: 6px; margin: 0; padding: 0; }
.preview-palette li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--iw-text-2); }
.preview-palette i { width: 16px; height: 16px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.preview-palette small { margin-left: auto; color: var(--iw-text-3); }
.preview-note { margin: 0; font-size: 13px; color: var(--iw-text-3); }
.preview-fonts { display: grid; gap: 6px; margin: 0; }
.preview-fonts div { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.preview-fonts dt { color: var(--iw-text-3); }
.preview-fonts dd { margin: 0; color: var(--iw-text-1); font-weight: 500; text-align: right; overflow-wrap: anywhere; }
.preview-images, .preview-photos { display: flex; gap: 6px; }
.preview-images img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; box-shadow: var(--iw-shadow-thumb); }
.preview-photos img { width: 44px; height: 44px; object-fit: cover; border-radius: 50%; margin-left: -10px; box-shadow: 0 0 0 2.5px var(--iw-surface-2); }
.preview-photos img:first-child { margin-left: 0; }
.preview-signature { margin: 0; padding-top: 10px; border-top: 1px solid var(--iw-line-1); font-size: 12.5px; color: var(--iw-text-3); }

/* Leitura guardada (evidências) */
.brand-report { display: grid; gap: 12px; }
.brand-import-report > nav { display: flex; gap: 4px; padding: 4px; width: fit-content; border-radius: 12px; background: var(--iw-surface-1); box-shadow: inset 0 0 0 1px var(--iw-line-1); }
.brand-import-report > nav button { min-height: 36px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--iw-text-3); }
.brand-import-report > nav button[aria-selected="true"] { background: var(--iw-surface-4); color: var(--iw-text-1); }
.brand-report-page { margin-top: 12px; display: grid; gap: 14px; font-size: 13.5px; line-height: 20px; color: var(--iw-text-2); }
.brand-report-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.brand-report-grid h3, .brand-positioning h3, .brand-ideas h3 { font-size: 13px; font-weight: 650; color: var(--iw-text-1); margin: 0 0 8px; }
.brand-color-list, .brand-font-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.brand-color-list li { display: flex; align-items: center; gap: 10px; }
.brand-color-list i { width: 22px; height: 22px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2); }
.brand-color-list b { font: 600 12.5px/1 var(--iw-font-mono); color: var(--iw-text-1); }
.brand-confidence, .brand-color-list small { font-size: 11.5px; color: var(--iw-text-3); margin-left: 8px; }
.brand-evidence-details { margin-top: 6px; }
.brand-evidence-details summary { cursor: pointer; font-size: 12.5px; color: var(--iw-accent-text); min-height: 28px; display: flex; align-items: center; }
.brand-evidence-details > * + * { margin-top: 6px; }
.brand-source a, .brand-evidence a, .brand-ideas a, .brand-positioning a { color: var(--iw-accent-text); text-underline-offset: 3px; }
.brand-evidence { padding: 10px 12px; border-radius: 12px; background: var(--iw-surface-1); }
.brand-ideas article { padding: 12px 14px; border-radius: 14px; background: var(--iw-surface-1); box-shadow: inset 0 0 0 1px var(--iw-line-1); margin-top: 8px; }
.brand-ideas article > span { font-size: 11.5px; color: var(--iw-text-3); }
.brand-ideas h4 { margin: 2px 0 4px; font-size: 14px; color: var(--iw-text-1); }
.brand-limitations { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--iw-warning-soft); font-size: 13px; color: var(--iw-text-2); }
.brand-limitations summary { color: var(--iw-warning); font-weight: 600; }
.brand-report-empty { margin: 0; color: var(--iw-text-3); }
.brand-report blockquote { margin: 8px 0 0; padding: 8px 12px; border-left: 2px solid var(--iw-accent-line); color: var(--iw-text-2); }

/* Barra de ações do cadastro */
.iw-page-main:has(.brand-editor) { padding-bottom: 12px; }
.brand-editor-bar {
  position: sticky; bottom: 12px; z-index: 6; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 20px; padding: 12px 16px; border-radius: 18px;
  background: var(--iw-glass-bg-strong); backdrop-filter: var(--iw-glass-blur); box-shadow: var(--iw-shadow-2), inset 0 0 0 1px var(--iw-line-2);
}
.brand-editor-bar p { margin: 0 auto 0 0; font-size: 13px; color: var(--iw-text-3); min-width: 0; }
.brand-editor-bar p.is-error { color: var(--iw-danger); }
.brand-editor-bar[data-dirty="true"] p:empty::before { content: "Alterações ainda não salvas"; color: var(--iw-warning); }
.brand-default-check { font-size: 13px; color: var(--iw-text-2); }

@media (max-width: 1100px) {
  .brand-editor-grid { grid-template-columns: minmax(0, 1fr); }
  .brand-editor-side { position: static; order: -1; }
}
@media (max-width: 860px) {
  .palette-row { grid-template-columns: 44px minmax(0, 1fr) 40px; }
  .palette-row .palette-name, .palette-row .palette-role, .palette-row .palette-use { grid-column: 1 / -1; }
  .palette-row [data-palette-remove] { grid-row: 1; grid-column: 3; }
  .field-grid { grid-template-columns: 1fr; }
  .brand-import-card { grid-template-columns: 1fr; }
  .import-art { display: none; }
}
@media (max-width: 700px) {
  .brand-grid { grid-template-columns: 1fr; }
  .form-card { padding: 16px; border-radius: 18px; }
  .brand-editor-bar { bottom: 84px; }
  .brand-editor-bar .button { flex: 1; }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .brand-card, .style-tile, .photo-tile { animation: none; } }
