.brand-assignment { display: grid; margin-top: 18px; padding: 18px; grid-template-columns: minmax(280px,1.2fr) minmax(220px,.8fr) auto; align-items: end; gap: 16px; background: linear-gradient(135deg,#fff 0%,#fbfaff 100%); }
.brand-assignment.has-brand { border-color: rgba(103,87,214,.38); box-shadow: 0 0 0 3px rgba(103,87,214,.07); }
.brand-assignment-intro { display: flex; min-width: 0; align-items: center; gap: 13px; }
.brand-assignment-icon { display: grid; width: 46px; height: 46px; flex: 0 0 46px; place-items: center; border-radius: 14px; background: linear-gradient(145deg,#25243a,#6757d6); color: white; font-size: 15px; font-weight: 800; box-shadow: 0 9px 22px rgba(56,47,132,.2); }
.brand-assignment-intro small { color: var(--primary); font-size: 8px; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.brand-assignment-intro h3 { margin: 3px 0 4px; font-size: 15px; }
.brand-assignment-intro p { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.brand-assignment > button { min-height: 42px; }
.brand-kit-list { display: grid; margin-top: 16px; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.brand-kit-card { position: relative; display: flex; overflow: hidden; min-width: 0; padding: 19px; flex-direction: column; gap: 13px; }
.brand-kit-card::before { position: absolute; top: 0; left: 0; width: 100%; height: 4px; background: linear-gradient(90deg,var(--primary),#a79df0); content: ""; }
.brand-kit-card.brand-archived { opacity: .66; }
.brand-kit-card.brand-archived::before { background: #b9b8c2; }
.brand-kit-card-top { display: flex; min-width: 0; align-items: flex-start; justify-content: space-between; gap: 12px; }
.brand-kit-card h3 { margin: 0; font-size: 15px; }
.brand-kit-card small { display: block; margin-top: 4px; color: var(--muted); font-size: 8px; text-transform: capitalize; }
.brand-swatches { display: flex; flex: 0 0 auto; }
.brand-swatches span { width: 27px; height: 27px; margin-left: -5px; border: 2px solid white; border-radius: 50%; box-shadow: 0 2px 7px rgba(37,36,58,.16); }
.brand-kit-tone { min-height: 43px; margin: 0; color: var(--foreground); font-size: 11px; font-weight: 600; line-height: 1.55; }
.brand-kit-direction { display: -webkit-box; min-height: 48px; margin: 0; overflow: hidden; color: var(--muted); font-size: 10px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.brand-kit-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.brand-kit-meta span { padding: 5px 7px; border: 1px solid #e9e7f2; border-radius: 999px; background: #faf9fe; color: #666579; font-size: 8px; }
.brand-asset-gallery { display: grid; gap: 8px; }
.brand-asset-gallery > header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand-asset-gallery > header strong { font-size: 9px; }
.brand-asset-gallery > header button { min-height: 27px; padding: 4px 7px; font-size: 8px; }
.brand-asset-empty { margin: 0; color: var(--muted); font-size: 8px; }
.brand-asset-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.brand-asset-item { position: relative; min-width: 0; margin: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: #fafafe; }
.brand-asset-item img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; background: white; }
.brand-asset-item figcaption { display: flex; min-width: 0; padding: 7px; flex-direction: column; }
.brand-asset-item figcaption strong,.brand-asset-item figcaption small { overflow: hidden; font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.brand-asset-remove { position: absolute; top: 4px; right: 4px; display: grid; width: 23px; min-height: 23px; padding: 0; place-items: center; border-radius: 8px; background: rgba(37,36,58,.82); color: white; font-size: 14px; }
.brand-asset-rename { position: absolute; top: 4px; right: 31px; display: grid; width: 23px; min-height: 23px; padding: 0; place-items: center; border-radius: 8px; background: rgba(37,36,58,.82); color: white; font-size: 12px; }
/* The @name belongs where the picture is; it wraps rather than ellipsising,
   because half a name is a name that cannot be typed. */
.brand-asset-item figcaption .brand-asset-mention { overflow: visible; color: var(--primary); font-size: 7px; text-overflow: clip; white-space: normal; }
.brand-asset-rename-input { width: 100%; font-size: 9px; }
.brand-kit-card-actions { display: flex; margin-top: auto; align-items: center; gap: 7px; }
.brand-kit-card-actions button { min-height: 34px; padding: 7px 10px; font-size: 9px; }
.brand-kit-card-actions .button-link-muted { margin-left: auto; }
.brand-kit-empty { grid-column: 1/-1; padding: 34px; color: var(--muted); font-size: 12px; text-align: center; }
.brand-kit-form { margin-top: 18px; padding: 24px; scroll-margin-top: 82px; }
.brand-asset-form { margin-top: 18px; padding: 24px; scroll-margin-top: 82px; }
.brand-asset-form > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.brand-asset-form header p:last-child { margin: 0; color: var(--muted); font-size: 10px; }
.brand-asset-fields { display: grid; margin-top: 20px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.brand-asset-fields .wide { grid-column: 1/-1; }
.brand-asset-privacy { margin: 14px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.brand-kit-form > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.brand-kit-form header h3 { margin-bottom: 6px; }
.brand-kit-form header p:last-child { margin: 0; color: var(--muted); font-size: 11px; }
.brand-kit-fields { display: grid; margin-top: 22px; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.brand-kit-fields .wide { grid-column: 1/-1; }
.brand-kit-fields textarea { min-height: 94px; }
.brand-kit-fields .field-help { width: fit-content; min-height: 28px; margin-top: 2px; padding: 4px 7px; background: transparent; color: var(--primary); font-size: 8px; }
.brand-kit-fields .field-help:hover { background: var(--primary-soft); }
.brand-colors { padding: 16px; }
.brand-colors > p { margin: 0; color: var(--muted); font-size: 10px; }
.brand-color-rows { display: grid; margin-top: 3px; gap: 8px; }
.brand-color-row { display: grid; grid-template-columns: 44px minmax(130px,1fr) 116px auto; align-items: center; gap: 8px; }
.brand-color-row input[type=color] { width: 44px; min-height: 42px; padding: 3px; cursor: pointer; }
.brand-color-row .button-link-muted { min-height: 32px; padding: 5px 7px; }
.brand-colors > button { width: fit-content; min-height: 34px; padding: 7px 11px; font-size: 9px; }
.brand-kit-actions { display: flex; margin-top: 19px; align-items: center; justify-content: flex-end; gap: 8px; }
.brand-kit-actions #brandKitCancel { margin-right: auto; }
@media (max-width: 1100px) { .brand-kit-list { grid-template-columns: repeat(2,minmax(0,1fr)); } .brand-assignment { grid-template-columns: 1fr 1fr; } .brand-assignment > button { grid-column: 2; } }
@media (max-width: 760px) {
  .brand-assignment,.brand-kit-fields { grid-template-columns: 1fr; }
  .brand-assignment > button,.brand-kit-fields .wide { grid-column: auto; }
  .brand-kit-list { grid-template-columns: 1fr; }
  .brand-kit-form > header { flex-direction: column; }
  .brand-asset-form > header { flex-direction: column; }
  .brand-asset-fields { grid-template-columns: 1fr; }
  .brand-asset-fields .wide { grid-column: auto; }
  .brand-color-row { grid-template-columns: 42px minmax(0,1fr); }
  .brand-color-row input[data-brand-color-hex] { grid-column: 2; }
  .brand-color-row .button-link-muted { grid-column: 2; justify-self: start; }
}
