:root {
  --brand-red: #7b1e1e;
  --brand-red-dark: #5f1717;
  --brand-light: #f5f1ee;
  --brand-grey: #f3f4f6;
  --brand-text: #1f2937;
}

body {
  background: linear-gradient(135deg, #fbfaf8 0%, #f3f4f6 100%);
  color: var(--brand-text);
  min-height: 100vh;
}

.brand-nav {
  background: linear-gradient(90deg, var(--brand-red-dark), var(--brand-red));
}

.sidebar {
  background: rgba(255,255,255,.78);
  min-height: calc(100vh - 56px);
  border-right: 1px solid #e5e7eb;
}

.list-group-item {
  background: transparent;
  border: 0;
  border-radius: .5rem;
  margin-bottom: .15rem;
}

.list-group-item:hover {
  background: var(--brand-light);
  color: var(--brand-red-dark);
}

.btn-brand {
  --bs-btn-bg: var(--brand-red);
  --bs-btn-border-color: var(--brand-red);
  --bs-btn-hover-bg: var(--brand-red-dark);
  --bs-btn-hover-border-color: var(--brand-red-dark);
  color: #fff;
}

.login-shell {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
}

.login-card {
  width: min(420px, 94vw);
}

.metric-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1rem;
  box-shadow: 0 12px 30px rgba(31,41,55,.06);
}

.metric-card span {
  display: block;
  color: #6b7280;
  font-size: .9rem;
}

.metric-card strong {
  display: block;
  font-size: 2rem;
  color: var(--brand-red);
}

.logo-preview {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 0;
  padding: .4rem .55rem;
}

.logo-preview span {
  color: #6b7280;
  font-size: .78rem;
  white-space: nowrap;
}

.logo-preview img {
  max-height: 28px;
  max-width: 64px;
  object-fit: contain;
}

.logo-preview-sm img {
  max-height: 22px;
  max-width: 32px;
}

.product-image-grid {
  display: grid;
  gap: .75rem;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
}

.product-image-grid figure {
  border: 1px solid #e5e7eb;
  border-radius: .75rem;
  margin: 0;
  padding: .5rem;
}

.product-image-grid img {
  display: block;
  height: 90px;
  object-fit: contain;
  width: 100%;
}

.product-image-grid figcaption {
  color: #6b7280;
  font-size: .72rem;
  margin-top: .35rem;
}

.asset-thumb {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .65rem;
  height: 84px;
  object-fit: contain;
  width: 84px;
}

.review-viewport {
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: .9rem;
  cursor: grab;
  display: flex;
  height: 420px;
  justify-content: center;
  overflow: hidden;
  position: relative;
  touch-action: none;
  user-select: none;
}

.review-viewport.is-dragging {
  cursor: grabbing;
}

.review-viewport img {
  max-height: none;
  max-width: none;
  object-fit: contain;
  transform-origin: center center;
  will-change: transform;
}

.review-placeholder {
  background: rgba(255,255,255,.84);
  border: 1px dashed #9ca3af;
  border-radius: .75rem;
  color: #6b7280;
  padding: 2rem;
  text-align: center;
}

.bg-checkerboard {
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #d1d5db 25%, transparent 25%),
    linear-gradient(-45deg, #d1d5db 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d1d5db 75%),
    linear-gradient(-45deg, transparent 75%, #d1d5db 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

.bg-white { background: #fff; }
.bg-light { background: #e5e7eb; }
.bg-dark { background: #374151; }
.bg-black { background: #000; }

.product-html {
  max-height: 280px;
  overflow: auto;
  white-space: pre-wrap;
}

.product-thumb {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: .5rem;
  height: 52px;
  object-fit: contain;
  width: 70px;
}

.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem;
}

.border-brand {
  border-color: rgba(123, 30, 30, .35);
}

.btn-outline-brand {
  --bs-btn-color: var(--brand-red);
  --bs-btn-border-color: var(--brand-red);
  --bs-btn-hover-bg: var(--brand-red);
  --bs-btn-hover-border-color: var(--brand-red);
  --bs-btn-hover-color: #fff;
}

.source-facts dt {
  color: #6b7280;
  float: left;
  font-weight: 600;
  margin-right: .4rem;
}

.source-facts dd {
  margin-bottom: .45rem;
}

.preview-box {
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
}

.poster-preview-shell {
  aspect-ratio: 1 / 1;
  background: #e5e7eb;
  border: 1px solid #d1d5db;
  border-radius: 1rem;
  overflow: hidden;
  width: min(100%, 640px);
}

.poster-preview-frame {
  border: 0;
  height: 1080px;
  pointer-events: none;
  transform: scale(.5926);
  transform-origin: top left;
  width: 1080px;
}
