/* Brands: the list of brands and the brand dialog. Flat surfaces, one radius per kind, no gradients. */
.bk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-block: 14px 18px;
}
.bk-head h1 { margin: 0 0 6px; overflow-wrap: anywhere; }
.bk-head .lead { margin-bottom: 0; }
.bk-head > .btn { margin-top: 6px; }

.bk-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.bk-toolbar[hidden] { display: none; }
.bk-toolbar .library-filters {
  margin: 0;
  border-block-end: 0;
}
.bk-toolbar .library-filters[hidden],
.bk-toolbar .searchbox[hidden] { display: none; }

/* The brands are a list of full-width blocks, one under another, like every choice in the Studio. */
.bk-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 760px;
}

/* One brand: a block of the logo green. The whole block asks what is next for the brand; one square key at
   its trailing edge holds the rest. No overflow clip, so the menu can open over the next block. */
.bk-card {
  position: relative;
  min-width: 0;
  background: var(--block);
  color: var(--block-ink);
  transition: background .15s;
}
.bk-card.can-open:hover { background: var(--block-hover); }
.bk-card.is-archived { background: var(--surface-1); color: var(--text-1); }
.bk-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-inline-end: 10px;
}
.bk-open {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 72px;
  padding-block: 12px;
  padding-inline: 18px 4px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: start;
}
button.bk-open { cursor: pointer; }
button.bk-open:active { transform: translateY(1px); }
button.bk-open:focus-visible { outline: 2px solid var(--text-1); outline-offset: -2px; }
/* The logo, or a flat initial, sits on the block itself: no tile behind it. */
.bk-mark {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.bk-mark img { width: 100%; height: 100%; object-fit: contain; }
.bk-initial { font-size: 1.75rem; line-height: 1; color: var(--block-line); }
.bk-card.is-archived .bk-initial { color: var(--text-3); }
.bk-words { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bk-name {
  font-size: 1.1875rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[dir="rtl"] .bk-name { font-weight: 600; }
.bk-facts { font-size: .875rem; line-height: 1.4; color: var(--block-line); overflow-wrap: anywhere; }
html[dir="rtl"] .bk-facts { font-size: .9375rem; line-height: 1.5; }
.bk-card.is-archived .bk-facts { color: var(--text-2); }
.bk-key-wrap { position: relative; flex: none; }
.bk-key {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--block-ink) 45%, transparent);
  border-radius: var(--r-ctl) !important;
  background: none;
  color: var(--block-ink);
  cursor: pointer;
}
.bk-key:hover, .bk-key[aria-expanded="true"] { border-color: var(--block-ink); background: color-mix(in srgb, var(--canvas) 22%, transparent); }
.bk-key:focus-visible { outline: 2px solid var(--text-1); outline-offset: 2px; }
.bk-key .ico { width: 22px; height: 22px; }
.bk-key-wrap .menu.context { z-index: 55; }
.bk-card > .bk-note { padding: 0 18px 12px; }
.bk-card:not(.is-archived) > .bk-note { color: var(--block-line); }
.bk-card:not(.is-archived) > .bk-note.bad { color: var(--warn); }

/* A short answer in place: a wait, a receipt or a problem, glyph plus words. */
.bk-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--text-2);
  overflow-wrap: anywhere;
}
.bk-note:empty { display: none; }
.bk-note.bad { color: var(--warn); }
.bk-note .ico { flex: none; margin-top: 2px; }

.bk-loading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 0;
  color: var(--text-2);
}
.bk-empty {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  justify-items: start;
  padding: 8px 0 20px;
  max-width: 560px;
}
.bk-empty h2 { margin: 0; font-size: var(--fs-lg); }
.bk-empty p { margin: 0; }
.bk-empty .notice { width: 100%; }

/* The brand dialog. */
.bk-modal-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
}
.bk-modal-tabs button {
  min-height: 40px;
  min-width: 0;
  padding: 6px 8px;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.bk-gap { gap: 22px; }
.bk-grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.bk-field { display: grid; gap: 8px; min-width: 0; }
.bk-field-title {
  margin: 0;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--text-2);
}
.bk-fit { width: fit-content; }

.bk-logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.bk-logo-box {
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
}

/* Colours: three swatches, each a colour picker, named for what the colour does. */
.bk-colours {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
}
.bk-colour {
  display: grid;
  gap: 6px;
  justify-items: start;
  width: 88px;
}
.bk-swatch-pick {
  display: grid;
  gap: 6px;
  justify-items: start;
  cursor: pointer;
  font-size: var(--fs-sm);
  color: var(--text-1);
}
.bk-swatch-pick input[type=color] {
  -webkit-appearance: none;
  appearance: none;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-ctl);
  background: none;
  cursor: pointer;
}
.bk-swatch-pick input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.bk-swatch-pick input[type=color]::-webkit-color-swatch { border: 0; border-radius: calc(var(--r-ctl) - 1px); }
.bk-swatch-pick input[type=color]::-moz-color-swatch { border: 0; border-radius: calc(var(--r-ctl) - 1px); }
.bk-colour input[type=text] {
  width: 88px;
  padding: 6px 8px;
  font-size: var(--fs-sm);
}
.bk-colour input[hidden] { display: none; }
.bk-linkbtn {
  justify-self: start;
  min-height: 36px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 600;
  cursor: pointer;
}

.bk-say-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.bk-say-row .field { flex: 1 1 220px; }
.bk-lex-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

/* What we can say: plain lines, each with its own remove control. */
.bk-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bk-list:empty { display: none; }
.bk-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.bk-list li > span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bk-x { border-color: transparent; }
.bk-add-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bk-add-row input { flex: 1; min-width: 0; }

/* Faces: the main character open, other characters folded under their names. */
.bk-people { display: grid; gap: 0; }
.bk-person {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
details.bk-person { padding-block: 12px; border-bottom: 0; }
details.bk-person:not([open]) { gap: 0; }
.bk-people > .btn { margin-top: 12px; }
.bk-person h3 { margin: 0; font-size: var(--fs-base); }
.bk-person > summary {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.bk-person-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.bk-sheet-slot:empty { display: none; }
.bk-sheet-thumb {
  width: 148px;
  height: 148px;
  border-radius: var(--r-ctl);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-2);
}
.bk-sheet-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* The footer: a save problem next to Save, then the unsaved note. */
.bk-dialog .dialog-foot > .row:first-child { flex: 1 1 240px; min-width: 0; }
.bk-save-error:empty { display: none; }
.bk-save-error { flex: 1 1 100%; }
.bk-save-error .notice { margin: 0; }

@media (max-width: 560px) {
  .bk-modal-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .bk-grid2 { grid-template-columns: minmax(0, 1fr); }
  .bk-lex-row { grid-template-columns: minmax(0, 1fr) auto; }
  .bk-lex-row input:first-child { grid-column: 1 / -1; }
}

/* Our clients above the Studio's own brands: the same blocks, with the client small over the brand. */
.bk-section { display: grid; gap: 10px; margin-bottom: 26px; max-width: 760px; }
.bk-section[hidden], .bk-section-title[hidden] { display: none; }
.bk-section-title { margin: 0 0 10px; font-size: var(--fs-base); color: var(--text-2); }
.bk-section > .bk-section-title { margin: 0; }
.bk-client {
  font-size: .8125rem;
  line-height: 1.3;
  color: var(--block-line);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html[dir="rtl"] .bk-client { font-size: .875rem; }
.bk-ag-state { display: grid; gap: 10px; justify-items: start; padding: 4px 0 6px; }
.bk-ag-state p { margin: 0; color: var(--text-1); }
.bk-ag-state .notice { width: 100%; margin: 0; }
/* A client brand whose look came across: its colours as three flat squares under the name. */
.bk-swatches { display: flex; gap: 4px; margin: 3px 0 2px; }
.bk-swatches i { width: 14px; height: 14px; outline: 1px solid rgba(242, 239, 231, .22); outline-offset: -1px; }
/* A client brand not in the Studio yet: one quiet line saying what a tap does. */
.bk-bring { font-size: .8125rem; line-height: 1.3; color: var(--accent-text); }
html[dir="rtl"] .bk-bring { font-size: .875rem; }

/* A linked brand in its dialog: one quiet line and the way to read Elll again. */
.bk-from {
  display: flex;
  align-items: center;
  gap: 4px 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.bk-from-line { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.bk-from .bk-linkbtn { display: inline-flex; align-items: center; gap: 6px; }
.bk-from .bk-note { flex: 1 1 100%; }

/* How videos look: full-width picture blocks, one under another, the chosen one in cream. */
.bk-look-list { display: flex; flex-direction: column; gap: 6px; }
.bk-look-block {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 72px;
  padding: 8px 14px 8px 8px;
  border: 0;
  border-radius: 0;
  background: var(--block);
  color: var(--block-ink);
  font: inherit;
  text-align: start;
  cursor: pointer;
}
html[dir="rtl"] .bk-look-block { padding: 8px 8px 8px 14px; }
.bk-look-block:hover { background: var(--block-hover); }
.bk-look-block:focus-visible { outline: 2px solid var(--text-1); outline-offset: -2px; }
.bk-look-block:disabled { cursor: progress; }
.bk-look-block.on { background: var(--paper); color: var(--ink); }
.bk-look-block.on .bk-facts, .bk-look-block.on .bk-client { color: color-mix(in srgb, var(--ink) 70%, transparent); }
.bk-look-block > .bk-words { flex: 1 1 auto; }
.bk-look-block > .ico { flex: none; width: 20px; height: 20px; }
.bk-look-pic {
  flex: none;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--canvas);
}
.bk-look-pic img { width: 56px; height: 56px; display: block; object-fit: cover; }
.bk-look-pic.is-caption img { object-position: 50% 82%; }
.bk-look-swatches { display: flex; width: 100%; height: 100%; }
.bk-look-swatches i { flex: 1; }
.bk-look-cuts { display: flex; gap: 3px; width: 44px; height: 30px; }
.bk-look-cuts i { flex: 1; background: var(--block-line); }
.bk-look-eq { display: flex; align-items: flex-end; gap: 4px; width: 40px; height: 32px; }
.bk-look-eq i { flex: 1; background: var(--block-line); min-height: 2px; }
.bk-look-block.on .bk-look-cuts i, .bk-look-block.on .bk-look-eq i { background: var(--paper); }
.bk-look-head { display: flex; align-items: center; gap: 12px; }
.bk-look-head h3 { margin: 0; font-size: var(--fs-lg); }
.bk-look-back { border-color: var(--border-strong); color: var(--text-1); }
.bk-look .bk-note:not(:empty) { margin: 4px 0; }
.bk-look-block .bk-name { white-space: normal; overflow-wrap: anywhere; }
.bk-dialog.bk-on-look .dialog-foot { display: none; }

/* Four or five tabs (How videos look shows once the brand is saved and the editor answers): always one row;
   never break Arabic or English words mid-letter on a phone, scroll cleanly along the tab strip instead. */
.bk-modal-tabs { display: flex; flex-wrap: nowrap; }
.bk-modal-tabs button { flex: 1 1 0; overflow-wrap: normal; word-break: normal; }
@media (max-width: 560px) {
  .bk-modal-tabs { overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 4px; }
  .bk-modal-tabs::-webkit-scrollbar { display: none; }
  .bk-modal-tabs button { flex: 0 0 auto; white-space: nowrap; padding: 8px 10px; font-size: 13px; }
}
