.brand-identity-panel {
  border: 1px solid #a9d5ca;
  background: linear-gradient(135deg, #f0faf6 0%, #ffffff 72%);
  box-shadow: 0 18px 42px rgba(15, 101, 87, .08);
}

.brand-identity-summary,
.brand-identity-toolbar,
.brand-preview-head,
.brand-preview-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand-identity-intro h3 { margin: 5px 0 6px; }
.brand-identity-intro p { margin: 0; color: var(--muted, #65736f); }
.brand-identity-status {
  display: inline-flex;
  margin-top: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e2f1ec;
  color: #0f6557;
  font: 600 12px/1.2 "IBM Plex Mono", monospace;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.brand-identity-toggle { flex: 0 0 auto; }
.brand-identity-toggle span:last-child { margin-left: 8px; }

.brand-identity-body {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid #cfe3dc;
}
.brand-identity-body[hidden],
.brand-preview-panel[hidden],
.brand-suggestions[hidden] { display: none; }
.brand-identity-toolbar small { display: block; margin-top: 5px; color: var(--muted, #65736f); }

.brand-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.brand-suggestion-item {
  display: grid;
  gap: 3px;
  padding: 12px;
  border: 1px solid #bed9d1;
  border-radius: 12px;
  background: #fff;
  color: #14251f;
  text-align: left;
}
.brand-suggestion-item span { color: #5f706a; }
.brand-suggestion-item button { justify-self: start; margin-top: 6px; }

.brand-identity-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.brand-identity-fields > label,
.brand-asset-card > label:first-child {
  display: grid;
  gap: 7px;
  color: #24332e;
  font-weight: 650;
}
.brand-identity-fields input,
.brand-identity-fields textarea {
  width: 100%;
  box-sizing: border-box;
}
.brand-identity-fields label > small,
.brand-asset-card > small {
  min-height: 16px;
  color: #a44837;
  font-size: 12px;
  font-weight: 500;
}
.brand-field-wide { grid-column: 1 / -1; }
.brand-colour-picker input { width: 100%; min-height: 47px; padding: 5px; }

.brand-assets {
  margin: 12px 0 0;
  padding: 22px;
  border: 1px solid #d3e0dc;
  border-radius: 16px;
}
.brand-assets legend { padding: 0 8px; font-weight: 700; }
.brand-assets > p { margin: 0 0 16px; color: var(--muted, #65736f); }
.brand-asset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.brand-asset-card {
  padding: 16px;
  border: 1px solid #dce5e2;
  border-radius: 14px;
  background: #fff;
}
.brand-asset-card > label:first-child small { color: var(--muted, #65736f); font-weight: 500; }
.brand-asset-current {
  display: grid;
  place-items: center;
  min-height: 96px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 10px;
  background: #f1f5f3;
  color: #6b7773;
  font-size: 13px;
}
.brand-asset-current img { max-width: 100%; max-height: 88px; object-fit: contain; }
.brand-asset-current[data-load-error="true"] {
  padding: 12px;
  box-sizing: border-box;
  background: #fff4ef;
  color: #8b3f2f;
  text-align: center;
}
.brand-preview-image-status {
  box-sizing: border-box;
  margin: 16px 24px;
  padding: 12px;
  border: 1px solid #efc7ba;
  border-radius: 8px;
  background: #fff4ef;
  color: #8b3f2f;
  font: 600 13px/1.4 "DM Sans", sans-serif;
  text-align: center;
}
.brand-asset-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.brand-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.brand-option { display: flex !important; grid-template-columns: auto 1fr; align-items: center; margin-top: 13px; font-size: 13px; }

.brand-preview-actions { justify-content: flex-end; margin-top: 22px; }
.brand-action-message { min-height: 20px; margin: 10px 0 0; text-align: right; }
.brand-preview-panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid #cfe0da;
  border-radius: 16px;
  background: #eef4f2;
}
.brand-preview-head h4 { margin: 4px 0 0; }
.brand-preview-tabs { display: flex; gap: 5px; padding: 4px; border-radius: 999px; background: #dfe9e6; }
.brand-preview-tabs button {
  padding: 8px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #40504b;
  cursor: pointer;
}
.brand-preview-tabs button[aria-selected="true"] { background: #fff; color: #0f6557; box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.brand-preview-frame {
  max-width: 100%;
  min-height: 180px;
  margin: 18px auto 0;
  overflow-x: auto;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 30px rgba(20, 37, 31, .08);
}
.brand-preview-panel[data-viewport="desktop"] .brand-preview-frame { width: 680px; }
.brand-preview-panel[data-viewport="mobile"] .brand-preview-frame { width: 390px; }
.brand-preview-frame.plain { box-sizing: border-box; padding: 24px; white-space: pre-wrap; font-family: "IBM Plex Mono", monospace; font-size: 13px; }

@media (max-width: 900px) {
  .brand-asset-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .brand-identity-summary,
  .brand-identity-toolbar,
  .brand-preview-head,
  .brand-preview-actions { align-items: stretch; flex-direction: column; }
  .brand-identity-toggle { width: 100%; }
  .brand-identity-fields { grid-template-columns: 1fr; }
  .brand-field-wide { grid-column: auto; }
  .brand-suggestions { grid-template-columns: 1fr; }
  .brand-preview-tabs { align-self: flex-start; max-width: 100%; overflow-x: auto; }
  .brand-preview-frame { max-width: 100%; overflow-x: auto; }
}
