.brandbook-live {
  display: grid;
  gap: 30px;
}

.brandbook-mode .environment-grid {
  grid-template-columns: minmax(0, 1fr);
}

.brandbook-mode .brain-layout {
  grid-template-columns: 190px minmax(0, 1fr);
}

.brandbook-build-badge {
  width: fit-content;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid #d7c9b4;
  border-radius: 8px;
  background: #fffaf1;
  color: #171814;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .02em;
}

.brandbook-live-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-top: 4px;
}

.brandbook-live-head h3 {
  margin: 0;
}

.bb-card {
  border: 1px solid #ddd1bd;
  border-radius: 8px;
  background: #fffaf1;
  box-shadow: 0 8px 18px rgba(24, 25, 20, .04);
}

.bb-preview-frame {
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid #e4dac9;
  border-radius: 8px;
  background:
    linear-gradient(45deg, rgba(0, 0, 0, .035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(0, 0, 0, .035) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(0, 0, 0, .035) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(0, 0, 0, .035) 75%),
    #fff;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  background-size: 16px 16px;
}

.bb-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.brandbook-live-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.brandbook-upload-zone {
  border: 1px dashed #bdb3a4;
  border-radius: 8px;
  background: #fffaf1;
  margin-top: 10px;
  padding: 18px;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease;
}

.brandbook-upload-zone.dragging {
  border-color: #181914;
  background: #fff4dc;
}

.brandbook-upload-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #111;
}

.brandbook-upload-icon svg,
.brandbook-icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brandbook-upload-zone strong {
  display: block;
  font-size: 14px;
}

.brandbook-upload-zone small {
  color: #777166;
  font-size: 11px;
}

.brandbook-upload-controls,
.brandbook-color-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.brandbook-upload-controls label,
.brandbook-color-form label {
  display: grid;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #686256;
}

.brandbook-upload-controls input,
.brandbook-upload-controls select,
.brandbook-color-form input {
  min-height: 42px;
  border: 1px solid #d8cdbb;
  background: #fffaf1;
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}

.brandbook-feedback {
  min-height: 18px;
  font-size: 12px;
  color: #4f6d2a;
}

.brandbook-feedback.error {
  color: #a33d32;
}

.brandbook-guide {
  margin: 2px 0 8px;
  border-radius: 8px;
  background: #070707;
  color: #fff;
  font-family: "Archivo", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  padding: 32px;
}

.brandbook-guide-head {
  align-items: flex-end;
}

.brandbook-guide-title {
  display: block;
  max-width: 620px;
}

.brandbook-guide-title span {
  display: block;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #d7b95c;
}

.brandbook-guide-title h2 {
  margin: 8px 0 0;
  font-size: 40px;
  line-height: 1;
}

.brandbook-guide-copy {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.brandbook-guide-visuals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 34px 20px;
}

.brandbook-showcase {
  min-width: 0;
}

.brandbook-showcase h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 14px;
  padding: 0 0 8px;
  border-bottom: 1px solid #454545;
  font-size: 15px;
  font-weight: 500;
}

.brandbook-showcase h4 span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
}

.brandbook-logo-stage {
  min-height: 280px;
  background: #fff;
  border-radius: 8px;
}

button.brandbook-logo-stage {
  border: 1px solid #ddd1bd;
  cursor: zoom-in;
}

.brandbook-logo-stage img {
  max-width: 86%;
  max-height: 250px;
  object-fit: contain;
  object-position: center;
}

.brandbook-color-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.brandbook-guide .brandbook-color-card {
  min-height: 126px;
  padding: 10px;
  border: 4px solid #050505;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.brandbook-guide .brandbook-color-card strong {
  font-size: 11px;
}

.brandbook-guide .brandbook-color-card small {
  font-size: 8px;
  line-height: 1.4;
  white-space: pre-line;
}

.brandbook-application-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  min-height: 150px;
}

.brandbook-application {
  min-height: 120px;
  padding: 10px;
  border: 1px solid #191919;
  border-radius: 5px;
  background: #111;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: zoom-in;
}

.brandbook-application img {
  width: auto;
  height: auto;
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  object-position: center;
}

.brandbook-application-placeholder {
  grid-column: 1 / -1;
  padding: 18px;
  color: #777;
  font-size: 10px;
  text-align: center;
}

.brandbook-type-preview {
  min-height: 150px;
  padding: 0;
  border-radius: 8px;
  background: transparent;
  display: grid;
  gap: 16px;
}

.brandbook-type-preview .type-sample {
  margin: 4px 0 12px;
  color: #fff;
  font-family: inherit;
  font-size: 48px;
  line-height: 1;
}

.brandbook-type-preview p {
  margin: 0;
  color: #cfcfcf;
  font-size: 10px;
  white-space: pre-line;
}

.brandbook-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}

.brandbook-section-title h4 {
  margin: 0;
  font-size: 15px;
}

.brandbook-assets,
.brandbook-fonts-grid,
.brandbook-color-cards {
  display: grid;
  gap: 16px;
}

.brandbook-assets {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
}

.brandbook-fonts-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.brandbook-color-cards {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.brandbook-asset {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: 172px minmax(64px, auto) 34px;
  gap: 10px;
  min-height: 294px;
  padding: 12px;
  border: 1px solid #ddd1bd;
  border-radius: 8px;
  background: #fffaf1;
  box-shadow: 0 8px 18px rgba(24, 25, 20, .04);
}

.brandbook-thumb {
  grid-column: 1;
  width: 100%;
  height: 172px;
  min-height: 172px;
  padding: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  cursor: default;
}

.brandbook-thumb.is-image {
  cursor: zoom-in;
}

.brandbook-thumb img {
  width: auto;
  height: auto;
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  object-position: center;
}

.brandbook-file-mark {
  font-size: 12px;
  font-weight: 900;
  color: #111;
  text-transform: uppercase;
}

.brandbook-asset strong,
.brandbook-font-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.brandbook-asset-meta,
.brandbook-font-card > div:first-child {
  grid-column: 1;
  min-width: 0;
}

.brandbook-asset small,
.brandbook-font-card small,
.brandbook-color-card small {
  display: block;
  color: #777166;
  font-size: 11px;
  line-height: 1.35;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.brandbook-asset-meta strong {
  font-size: 13px;
  line-height: 1.28;
}

.brandbook-asset-meta small:first-of-type {
  color: #3e3a33;
  font-weight: 750;
}

.brandbook-card-actions {
  grid-column: 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-height: 34px;
}

.brandbook-icon-btn {
  width: 34px;
  height: 30px;
  border: 1px solid #cfc3b0;
  border-radius: 8px;
  background: #fff;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.brandbook-icon-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.brandbook-primary-logo {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: stretch;
}

.brandbook-primary-logo .brandbook-logo-stage {
  min-height: 220px;
  border: 1px solid #ddd1bd;
}

.brandbook-primary-meta {
  padding: 16px;
  border: 1px solid #ddd1bd;
  border-radius: 8px;
  background: #fffaf1;
}

.brandbook-color-card {
  min-height: 184px;
  border: 1px solid #ddd1bd;
  border-radius: 8px;
  background: #fffaf1;
  overflow: hidden;
}

.brandbook-color-cards .brandbook-color-card {
  display: block;
  padding: 0;
  border: 1px solid #ddd1bd;
}

.brandbook-color-swatch {
  min-height: 112px;
  display: flex;
  align-items: flex-end;
  padding: 10px;
  font-size: 18px;
  font-weight: 900;
  border: 0;
  width: 100%;
  cursor: pointer;
}

.brandbook-color-info {
  padding: 10px;
}

.brandbook-color-meta {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  font-size: 11px;
  color: #4d493f;
}

.brandbook-font-card {
  display: grid;
  grid-template-rows: auto minmax(170px, 1fr) auto;
  gap: 14px;
  min-height: 300px;
  padding: 16px;
  border: 1px solid #ddd1bd;
  border-radius: 8px;
  background: #fffaf1;
}

.brandbook-font-head {
  min-width: 0;
}

.brandbook-font-sample {
  min-height: 170px;
  display: grid;
  align-content: center;
  gap: 8px;
  font-size: 24px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.brandbook-font-sample span {
  display: block;
}

.brandbook-font-display {
  font-size: clamp(44px, 6vw, 72px);
  line-height: .95;
}

.brandbook-font-warning {
  color: #8a6a15;
  font-size: 11px;
}

.brandbook-font-guide {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f5f2ea;
}

.brandbook-font-guide .brandbook-font-head strong {
  color: #fff;
  font-size: 11px;
  letter-spacing: .01em;
}

.brandbook-font-guide .brandbook-font-head small {
  color: rgba(255, 255, 255, .52);
  font-size: 9px;
}

.brandbook-font-guide .brandbook-font-sample {
  min-height: 128px;
  padding: 0;
  color: #fff;
  font-size: clamp(11px, 1.05vw, 15px);
  line-height: 1.3;
}

.brandbook-font-guide .brandbook-font-display {
  color: #fff;
  font-size: clamp(34px, 4.2vw, 58px);
}

.brandbook-font-guide .brandbook-font-warning {
  color: #d7b95c;
}

.brandbook-preview-dock {
  position: fixed;
  inset: 0;
  z-index: 3200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(18, 18, 16, .78);
}

.brandbook-preview-dock.open {
  display: flex;
}

.brandbook-preview-panel {
  width: min(1060px, 100%);
  max-height: calc(100vh - 48px);
  background: #f3efe7;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  box-shadow: 0 25px 80px rgba(0, 0, 0, .35);
}

.brandbook-preview-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #171814;
  color: #fff;
}

.brandbook-preview-media {
  min-height: 360px;
  display: grid;
  place-items: center;
  padding: 18px;
  overflow: auto;
}

.brandbook-preview-media img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

#exportBrandbookBtn,
#uploadBrandAssetBtn,
#uploadBrandFontBtn,
#addBrandColorBtn,
#replaceLogoBtn {
  border-radius: 8px;
}

.brandbook-live > section {
  min-width: 0;
}

.brandbook-preview-media img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
}

.brandbook-a4-preview .dna-preview-toolbar strong::before {
  content: "Brandbook Vivo · ";
}

.brandbook-a4-preview.is-loading .dna-preview-shell {
  position: relative;
}

.brandbook-a4-preview.is-loading .dna-preview-shell::after {
  content: "Preparando Brandbook...";
  position: absolute;
  inset: 58px 0 auto;
  z-index: 2;
  margin: 0 auto;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 8px;
  background: #171814;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}

.brandbook-a4-preview #printDnaPreview:disabled {
  opacity: .55;
  cursor: wait;
}

@media (max-width: 980px) {
  .brandbook-assets,
  .brandbook-fonts-grid,
  .brandbook-color-cards,
  .brandbook-guide-copy,
  .brandbook-guide-visuals {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .brandbook-primary-logo {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .brandbook-mode .brain-layout,
  .brandbook-live-head,
  .brandbook-guide-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .brandbook-upload-controls,
  .brandbook-color-form,
  .brandbook-assets,
  .brandbook-fonts-grid,
  .brandbook-color-cards,
  .brandbook-guide-copy,
  .brandbook-guide-visuals {
    grid-template-columns: 1fr;
  }

  .brandbook-guide {
    padding: 20px;
  }

  .brandbook-guide-title h2 {
    font-size: 30px;
  }
}
