#modal.modal-brand { width: min(1120px, calc(100vw - 32px)); max-width: none; max-height: 90dvh; padding: 24px; }
.modal-brand .dialog-heading { position: sticky; top: -24px; padding: 16px 0; background: white; z-index: 2; }
#brandWorkspace { min-width: 0; }
#brandWorkspace .brand-intro { margin-bottom: 14px; color: var(--muted); }
.brand-tabs, .brand-inline-actions, .brand-footer, .brand-report-toolbar > div:last-child { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.brand-tabs { padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.brand-config, .brand-notice { border-radius: 8px; padding: 12px 14px; background: var(--tint); margin: 12px 0 16px; }
.brand-config span { margin-left: 10px; color: var(--muted); }
.brand-config p { margin: 6px 0 0; }
.brand-config-warning { background: #fff4dc; color: #79521c; }
.brand-selection { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; margin: 18px 0; }
.brand-selection > section { min-width: 0; }
.brand-selection h3, .brand-report-toolbar h3 { font-size: 17px; }
.brand-search { display: flex; gap: 8px; margin: 12px 0; }
.brand-search input { flex: 1; min-width: 0; }
#brandWorkspace input:not([type="checkbox"]), #brandWorkspace select, #brandWorkspace textarea { width: 100%; min-width: 0; font-size: 16px; }
#brandWorkspace input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 18px; accent-color: var(--accent); margin: 3px 0; }
.brand-candidate { display: flex; align-items: flex-start; gap: 12px; min-height: 68px; padding: 13px 8px; border-bottom: 1px solid var(--line); cursor: pointer; }
.brand-candidate:hover { background: var(--tint); }
.brand-candidate strong { font-size: 16px; display: block; }
.brand-candidate span { min-width: 0; overflow-wrap: anywhere; }
.brand-candidate small, .brand-history small, .brand-report summary small, .brand-sources small { display: block; color: var(--muted); font-size: 12px; }
.brand-selected-title { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.brand-selected-title h3 { margin: 0; }
.brand-profile, .brand-report { border: 1px solid var(--line); border-radius: 10px; margin: 12px 0; background: white; overflow: hidden; }
.brand-profile > summary, .brand-report > summary { display: flex; justify-content: space-between; align-items: center; padding: 14px; gap: 12px; cursor: pointer; min-height: 52px; overflow-wrap: anywhere; }
.brand-profile > summary::before, .brand-report > summary::before { content: "▸"; color: var(--accent); }
.brand-profile[open] > summary::before, .brand-report[open] > summary::before { content: "▾"; }
.brand-profile > summary > span, .brand-report > summary > span:first-of-type { flex: 1; min-width: 0; font-weight: 650; }
.brand-profile summary small { font-size: 11px; font-weight: 400; color: var(--muted); flex-shrink: 0; }
.brand-profile-fields, .brand-report-content { padding: 0 16px 16px; }
#brandWorkspace .field { margin-bottom: 14px; }
#brandWorkspace .field label { display: block; margin-bottom: 6px; }
.brand-refresh { display: flex; gap: 10px; align-items: center; min-height: 44px; margin-top: 12px; cursor: pointer; }
.brand-history { display: flex; gap: 16px; justify-content: space-between; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.brand-history > div { min-width: 0; overflow-wrap: anywhere; }
.brand-history > button { flex-shrink: 0; }
.brand-history p { margin: 8px 0 0; }
.brand-report-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.brand-report-toolbar p { margin: 6px 0 0; }
.brand-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0 12px; }
.brand-comparison article { padding: 14px; border: 1px solid var(--line); border-radius: 8px; min-width: 0; overflow-wrap: anywhere; }
.brand-comparison strong { display: block; font-size: 16px; margin-bottom: 7px; }
.brand-comparison p { margin: 10px 0 0; }
.brand-report-summary { font-size: 16px; padding: 16px; background: var(--tint); border-radius: 8px; white-space: pre-wrap; }
.brand-report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.brand-report-section { min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.brand-report-section h4, .brand-decision h4 { margin: 0 0 8px; font-size: 15px; }
.brand-report-section p:last-child { margin-bottom: 0; }
.brand-report-section ul { margin: 8px 0 0; padding-left: 20px; }
.brand-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.brand-decision-print { display: none; }
.brand-report blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); white-space: pre-wrap; }
.brand-sources { padding-left: 22px; }
.brand-sources li { margin-bottom: 14px; }
.brand-decision { padding: 18px; border-radius: 8px; background: var(--bg); margin-top: 20px; }
.brand-decision p { font-size: 13px; }
.brand-decision-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.brand-decision-actions button { flex-shrink: 0; }
.brand-decision-actions .brand-decision-status { margin: 0; min-width: 0; overflow-wrap: anywhere; }
#brandWorkspace .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 720px) {
  #modal.modal-brand { width: calc(100vw - 16px); max-height: 94dvh; padding: 16px; }
  .modal-brand .dialog-heading { top: -16px; padding: 12px 0; }
  .brand-selection, .brand-report-grid, .brand-comparison { grid-template-columns: minmax(0, 1fr); }
  .brand-selection { gap: 20px; }
  .brand-report-toolbar, .brand-history { align-items: flex-start; flex-direction: column; }
  .brand-profile summary small { max-width: 90px; white-space: normal; }
  #brandWorkspace .pagination { flex-wrap: wrap; gap: 10px; }
  .brand-report-content, .brand-profile-fields { padding: 0 12px 12px; }
  .brand-report > summary { flex-wrap: wrap; }
}
@media print {
  body.brand-print > *:not(#modal) { display: none !important; }
  body.brand-print #modal { position: static; display: block; width: 100%; max-height: none; margin: 0; padding: 0; overflow: visible; border: 0; }
  body.brand-print #modal::backdrop { background: transparent; }
  body.brand-print .dialog-heading { position: static; }
  body.brand-print .dialog-heading button, body.brand-print .brand-tabs, body.brand-print .brand-report-toolbar button, body.brand-print .brand-decision, body.brand-print #brandNotice { display: none !important; }
  body.brand-print .brand-report > .brand-report-content { display: block !important; }
  body.brand-print .brand-report { overflow: visible; break-inside: auto; }
  body.brand-print .brand-report-grid { grid-template-columns: 1fr; }
  body.brand-print .brand-decision-print { display: block; }
  body.brand-print .pagination { display: none !important; }
  body.brand-print a { color: inherit; text-decoration: underline; }
}
