/* ============================================================
   Brand kit panel — review tooling, mounted by assets/js/brand.js
   on every surface. Logical properties only; consumes the same
   semantic tokens as the product so it re-skins with the kit.
   ============================================================ */

/* toolbar button */
.bk-btn.on { background: var(--action-primary); color: var(--text-on-brand); border-color: transparent; }
.icon-btn.bk-btn { width: auto; padding-inline: 16px; }

/* sheet */
.bk-sheet {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(24, 18, 10, .5); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: var(--s-4);
  font-family: var(--font-ui); font-size: 14px; line-height: 1.5;
}
.bk-sheet[hidden] { display: none; }
.bk-sheet__in {
  background: var(--surface-card); color: var(--text-primary);
  border-radius: var(--r-xl); width: min(100%, 760px); max-height: 88dvh;
  overflow-y: auto; box-shadow: var(--shadow-xl); padding: var(--s-5);
  text-align: start;
}
.bk-h { display: flex; align-items: flex-start; gap: var(--s-3); }
.bk-h b { font-family: var(--font-display); font-size: var(--fs-h3); display: block; }
.bk-h p { font-size: var(--fs-caption); color: var(--text-muted); max-width: 60ch; }
.bk-x {
  margin-inline-start: auto; flex: none; width: 36px; height: 36px; border-radius: 50%;
  color: var(--text-muted); font-size: 15px;
}
.bk-x:hover { background: var(--surface-sunken); }

/* sections */
.bk-sec { margin-block-start: var(--s-5); }
.bk-sec h4 {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); margin-block-end: var(--s-3);
}
html[lang="ar"] .bk-sec h4 { text-transform: none; letter-spacing: 0; }
.bk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-4); }
@media (max-width: 640px) { .bk-grid { grid-template-columns: 1fr; } }
.bk-hint { display: block; font-size: 12px; color: var(--text-muted); margin-block-start: var(--s-2); }

/* fields */
.bk-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.bk-f > label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.bk-f small { font-size: 11.5px; color: var(--text-muted); }
.bk-f .bk-err { color: var(--status-error); }
.bk-in {
  height: 40px; width: 100%; padding-inline: var(--s-3);
  border: 1px solid var(--border-default); border-radius: var(--r-sm);
  background: var(--surface-page); color: var(--text-primary);
  transition: border-color .14s var(--ease), box-shadow .14s var(--ease);
}
.bk-in:focus { outline: none; border-color: var(--border-brand); box-shadow: 0 0 0 3px rgba(var(--brand-rgb), .16); }
.bk-in--ro {
  display: flex; align-items: center; text-decoration: none; color: var(--text-link);
  font-family: var(--font-latin); font-size: 13px; background: var(--surface-sunken);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* image drop zones */
.bk-drop {
  display: flex; align-items: center; gap: var(--s-3);
  border: 1.5px dashed var(--border-default); border-radius: var(--r-md);
  padding: var(--s-3); cursor: pointer; background: var(--surface-sunken);
  transition: border-color .14s var(--ease), background .14s var(--ease);
}
.bk-drop:hover, .bk-drop.over { border-color: var(--border-brand); background: var(--surface-brand-soft); }
.bk-drop input { display: none; }
.bk-drop img {
  width: 56px; height: 56px; object-fit: contain; flex: none;
  border-radius: 10px; background: #fff; border: 1px solid var(--border-subtle);
}
.bk-drop--photo img { object-fit: cover; border-radius: 50%; }
.bk-drop > span { font-size: 12px; color: var(--text-muted); line-height: 1.45; min-width: 0; }
.bk-drop > span b { display: block; font-size: 13px; color: var(--text-primary); margin-block-end: 2px; }
.bk-link {
  align-self: flex-start; font-size: 12px; color: var(--text-link);
  text-decoration: underline; padding: 2px 0;
}
.bk-onbrand { display: flex; align-items: center; gap: var(--s-3); margin-block-start: var(--s-3); }
.bk-onbrand small { font-size: 12px; color: var(--text-muted); }
.bk-logo-on {
  width: 56px; height: 56px; border-radius: 14px; flex: none;
  background: var(--c-blue-600); display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .18);
}
.bk-logo-on img { width: 40px; height: 40px; object-fit: contain; }

/* colours */
.bk-color { display: flex; gap: var(--s-2); align-items: center; }
.bk-color input[type="color"] {
  width: 48px; height: 40px; flex: none; padding: 2px;
  border: 1px solid var(--border-default); border-radius: var(--r-sm);
  background: var(--surface-page); cursor: pointer;
}
.bk-ramp { display: grid; grid-template-columns: repeat(11, 1fr); gap: 2px; direction: ltr; margin-block-start: 2px; }
.bk-ramp i { height: 18px; border-radius: 4px; display: block; }
.bk-ck { display: flex; flex-wrap: wrap; gap: 6px; margin-block-start: var(--s-3); }
.bk-ck span {
  font-size: 11.5px; padding: 4px 10px; border-radius: var(--r-full);
  background: var(--surface-sunken); border: 1px solid var(--border-subtle); font-weight: 600;
}
.bk-ck span.ok { color: var(--status-success); }
.bk-ck span.bad { color: var(--status-error); }

/* footer */
.bk-foot {
  display: flex; flex-wrap: wrap; gap: var(--s-2); align-items: center;
  margin-block-start: var(--s-5); padding-block-start: var(--s-4);
  border-block-start: 1px solid var(--border-subtle);
}
.bk-foot .btn { min-height: 40px; cursor: pointer; }
.bk-foot .btn.bk-armed { background: var(--status-warning-soft); color: var(--status-warning); border-color: var(--status-warning); }
.bk-status { font-size: 12px; color: var(--text-muted); margin-inline-start: auto; }
.bk-status.bad { color: var(--status-error); font-weight: 600; }
@media (max-width: 640px) { .bk-status { width: 100%; margin-inline-start: 0; } }
