.brief-panel {
  margin-bottom: 18px;
  background: linear-gradient(115deg, #fafdff 0%, #f2f8ffed 57%, #d4eaffd9 100%);
}
.brief-panel-heading, .brief-identity { display: flex; align-items: center; gap: 16px; }
.brief-panel-heading { justify-content: space-between; flex-wrap: wrap; }
.brief-panel-heading h2 { margin: 0; }
.credit-heading, .credit-grant-controls, .studio-credit-summary {
  display: flex; align-items: center; gap: .65rem; flex-wrap: wrap;
}
.credit-heading { justify-content: space-between; }
.credit-heading h2 { margin: 0; }
.credit-balance {
  display: inline-block; padding: .32rem .7rem; border: 1px solid #bed8f6; border-radius: 1rem;
  background: #eaf3ff; color: #194d88; font-size: .88rem; font-weight: 650; line-height: 1.4;
}
.studio-credit-summary { margin: .9rem 0 0; color: var(--ink-soft); font-size: .85rem; }
.credit-grant-controls input { width: 8rem; max-width: 100%; }
.credit-grant-controls .button, #refresh-design-credits { min-height: 44px; }
#credit-grant-status:empty { display: none; }
.brief-symbol {
  display: grid; place-items: center; flex: 0 0 46px; height: 46px; border-radius: 15px;
  background: var(--button-glass); color: #fff; border: 1px solid #0066ed;
  box-shadow: inset 0 1px 1px #ffffffa8, 0 5px 12px -6px #246cbc8c;
}
.brief-symbol svg { width: 25px; height: 25px; }
#design-brief-saved { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 16px; }
#design-brief-saved > h3 { margin: 0 0 10px; font-size: .9rem; }
#design-brief-list { display: grid; grid-template-columns: repeat(auto-fill,minmax(min(100%,245px),1fr)); gap: 8px; }
.brief-item {
  display: flex; align-items: center; gap: 12px; min-width: 0; text-align: left;
  padding: 9px; background: #ffffffc7; box-shadow: var(--shine);
  border: 1px solid #c8d9ec; border-radius: 13px; color: var(--ink);
}
.brief-item:hover { border-color: #78abde; }
.brief-item > img { flex: 0 0 43px; width: 43px; height: 43px; object-fit: cover; background: white; border-radius: 8px; }
.brief-item-info { flex: 1; min-width: 0; }
.brief-item-info strong, .brief-item-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brief-item-info small { margin-top: 3px; color: var(--muted); }
.brief-item > svg { flex: none; color: var(--blue-ink); }
dialog.brief-dialog { max-width: min(790px,calc(100vw - 24px)); }
.brief-workbench { margin-top: 18px; display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: clamp(16px,3vw,28px); }
.brief-preview { display: flex; flex-direction: column; margin: 0; min-width: 0; align-self: stretch; }
.brief-stage {
  flex: 1; display: grid; place-items: center; min-height: 244px; padding: 18px; border-radius: 18px; border: 1px solid #cbdff4;
  background: radial-gradient(ellipse at top left,#fafdff,#e5f1ff 65%,#d6e7fa);
}
#brief-frame {
  position: relative; width: min(100%,260px); aspect-ratio: 1;
  border-radius: 7px; overflow: hidden; background: #fff;
  box-shadow: 0 0 0 1px #aabdd1, 0 8px 20px -9px #36527368;
}
#brief-frame[data-ratio="4:5"] { aspect-ratio: 4/5; width: min(100%,230px); }
#brief-frame[data-ratio="9:16"] { aspect-ratio: 9/16; width: min(100%,175px); }
#brief-preview-photo { width: 100%; height: 100%; position: absolute; inset: 0; object-fit: cover; object-position: center; background: white; }
#brief-empty { position: absolute; inset: 0; padding: 12px; display: grid; align-content: center; justify-items: center; gap: 9px; color: var(--muted); text-align: center; font-size: .83rem; }
#brief-empty svg { width: 27px; height: 27px; color: var(--blue-ink); }
.brief-preview figcaption { display: flex; justify-content: space-between; gap: 6px; margin: 9px 3px 0; color: var(--muted); font-size: .76rem; }
.brief-controls { min-width: 0; }
.brief-controls label { display: block; font-weight: 620; font-size: .84rem; margin: 16px 0 6px; }
.brief-controls label:first-child { margin-top: 0; }
.brief-controls select { width: 100%; max-width: 100%; }
.brief-controls textarea { min-height: 80px; }
#brief-upload { margin-top: 7px; font-size: .78rem; min-height: 32px; }
.brief-note { color: var(--ink-soft); font-size: .8rem; line-height: 1.5; margin: 8px 0 0; }
.brief-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; border-top: 1px solid var(--rule); padding-top: 16px; }
.studio-tools, .brief-brand-choice { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.brief-brand-choice { justify-content: space-between; margin: 16px 0 5px; }
.brief-brand-choice label { display: flex; align-items: center; gap: 7px; margin: 0; }
.brief-controls .brief-brand-choice input[type="checkbox"] { accent-color: #0866ff; width: 16px; height: 16px; min-height: 0; flex: none; margin: 0; padding: 0; box-shadow: none; }
.brief-text-button { border: 0; background: transparent; padding: 3px 2px; text-decoration: underline; text-underline-offset: 3px; color: var(--blue-ink); font-size: .79rem; }
.brand-asset { display: flex; align-items: center; gap: 12px; padding: 15px 0; border-bottom: 1px solid var(--rule); }
.brand-mark, .ai-job-symbol { position: relative; flex: 0 0 45px; height: 45px; display: grid; place-items: center; color: var(--blue-ink); background: #ebf3ff; border-radius: 12px; overflow: hidden; }
.brand-mark img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: white; }
.brand-asset-name, .ai-job-info { min-width: 0; flex: 1; }
.brand-asset-name strong, .brand-asset-name span, .ai-job-info strong, .ai-job-info span, .ai-job-info small { display: block; overflow-wrap: anywhere; }
.brand-asset-name span, .ai-job-state, .ai-job-info small { font-size: .79rem; color: var(--ink-soft); margin-top: 2px; }
.brand-file-actions { display: grid; justify-items: end; }
.brand-file-actions .button { min-height: 32px; font-size: .79rem; }
#brand-kit-status:empty, #brief-feedback:empty, #ai-job-feedback:empty { display: none; }
#ai-job-group { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 14px; }
#ai-job-group h3 { font-size: .9rem; margin: 0 0 8px; }
#ai-job-list { max-height: 16rem; overflow-y: auto; }
.ai-job { display: flex; gap: 10px; align-items: center; padding: 8px 2px; }
.ai-job-art { object-fit: cover; width: 45px; height: 45px; border-radius: 10px; }
.ai-job-info strong { white-space: nowrap; text-overflow: ellipsis; overflow: hidden; font-size: .88rem; }
.brief-delete { margin-right: auto; border: 0; background: none; color: #a1323d; text-decoration: underline; text-underline-offset: 3px; }
@media(max-width:650px) {
  .brief-workbench { display: flex; flex-direction: column; gap: 16px; }
  .brief-stage { min-height: 120px; padding: 9px; }
  #brief-frame { width: min(100%,112px); }
  #brief-frame[data-ratio="4:5"] { width: min(100%,95px); }
  #brief-frame[data-ratio="9:16"] { width: min(100%,68px); }
  #brief-empty { font-size: .7rem; gap: 3px; padding: 4px; }
  #brief-empty svg { width: 20px; height: 20px; }
  .brief-dialog .dialog-body { padding: 17px; }
  .brief-actions .button { flex: 1 1 auto; }
  .brand-asset { flex-wrap: wrap; }
  .brand-file-actions { justify-items: start; }
}
