/* =============================================================================
   pirxe Adset Maker — design tokens & layout
   Shares the motion-designer / adgrid brand language: white + monochrome
   surfaces, 0.5px hairlines, no border-radius, EB Garamond logo, DM Sans UI.
   ============================================================================= */

:root {
  /* Surfaces */
  --c-black: #0a0a0a;
  --c-white: #ffffff;
  --c-surface: #f5f4f0;
  --c-surface-raised: #f9f9f7;
  --c-surface-panel: #faf9f7;

  /* Borders */
  --c-border-subtle: #e8e7e2;
  --c-border-default: #d0cfc8;
  --c-border-strong: #c8c7c0;

  /* Text */
  --c-text: #0a0a0a;
  --c-text-secondary: #555;
  --c-text-muted: #888;
  --c-text-hint: #aaa;
  --c-text-placeholder: #bbb;

  /* Tag */
  --c-tag-bg: #f1efe8;
  --c-tag-border: #d3d1c7;
  --c-tag-text: #5f5e5a;

  /* Canvas viewport tint */
  --c-canvas-bg: #f0ede6;

  /* Typography */
  --font-ui: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-logo: 'EB Garamond', Georgia, serif;

  color-scheme: light;
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--c-text);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* The [hidden] attribute must win over component display rules below. */
[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  background: var(--c-surface);
  font-family: var(--font-ui);
  color: var(--c-text);
  overflow: hidden;
}

button,
input,
select,
textarea {
  font-family: inherit;
  color: inherit;
}

button,
input,
select,
textarea {
  border-radius: 0;
}

/* =============================================================================
   App shell
   ============================================================================= */
.app {
  display: grid;
  grid-template-rows: 64px 1fr 32px;
  height: 100vh;
  background: var(--c-surface);
  border: 0.5px solid var(--c-border-default);
  overflow: hidden;
}

/* =============================================================================
   Topbar + global tab nav
   ============================================================================= */
.topbar {
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 12px;
  background: var(--c-white);
  border-bottom: 0.5px solid var(--c-border-default);
  flex-shrink: 0;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-right: 10px;
}

.logo-svg {
  height: 32px;
  width: auto;
  display: block;
  shape-rendering: geometricPrecision;
  fill: var(--c-black);
}

.tb-sep {
  width: 0.5px;
  height: 22px;
  background: var(--c-border-default);
  flex-shrink: 0;
}

.tabnav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 8px 16px;
  font-size: 16px;
  font-variant: small-caps;
  letter-spacing: 0.14em;
  color: var(--c-text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: color 100ms linear, border-color 100ms linear;
}

.tab-btn:hover {
  color: var(--c-text);
}

.tab-btn.active {
  color: var(--c-text);
  border-bottom: 2px solid var(--c-black);
}

/* Account / profile (mockup) */
.tb-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 16px;
}

.tb-user-name {
  font-size: 12px;
  font-variant: small-caps;
  letter-spacing: 0.1em;
  color: var(--c-text-secondary);
}

.tb-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-black);
  color: var(--c-white);
  font-family: var(--font-logo);
  font-size: 12px;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* =============================================================================
   Body container (workspace or coming-soon)
   ============================================================================= */
.app-body {
  min-height: 0;
  overflow: hidden;
}

/* Home / landing — centered white card over the canvas tint */
.home {
  height: 100%;
  overflow-y: auto;
  background: var(--c-canvas-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
}

.home-card {
  background: var(--c-white);
  border: 0.5px solid var(--c-border-default);
  border-radius: 16px;
  padding: 36px 44px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
  max-width: 460px;
}

.home-title {
  font-size: 24px;
  font-weight: 400;
  font-variant: small-caps;
  letter-spacing: 0.14em;
  color: var(--c-text);
  text-align: center;
}

.home-brand {
  display: block;
  font-weight: 500;
  font-size: 1.5em;
  margin-top: 6px;
}

.home-img {
  width: 100%;
  max-width: 340px;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Embedded tool iframes — fill the body below the shell topbar */
.tool-frames {
  height: 100%;
  background: var(--c-canvas-bg);
}

.tool-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.tool-frame[hidden] {
  display: none;
}

/* =============================================================================
   Branding
   ============================================================================= */
/* A library, not one file (SH-13): the board wraps as many marks as the brand
   has (primary / mono / claim); each adset picks one on the Generate board. */
.brand-logo-board {
  padding: 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}

.brand-logo-card {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 1px solid var(--c-border-default);
  border-radius: 10px;
  background: var(--c-surface-panel);
  max-width: 360px;
}

/* Marks the logo adsets fall back to when they never chose (logoForAdset). */
.brand-logo-default {
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--c-surface-raised);
  color: var(--c-text-muted, #8a8a8a);
}

.brand-logo-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--c-text-muted, #8a8a8a);
  cursor: pointer;
  opacity: 0;
  transition: opacity 100ms linear, background 100ms linear, color 100ms linear;
}

.brand-logo-card:hover .brand-logo-remove,
.brand-logo-remove:focus-visible {
  opacity: 1;
}

.brand-logo-remove:hover {
  background: var(--c-surface-raised);
  color: var(--c-text);
}

.brand-logo-preview {
  max-width: 320px;
  max-height: 200px;
  object-fit: contain;
  background: var(--c-canvas-bg);
  border-radius: 8px;
  padding: 16px;
}

.brand-logo-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-logo-name {
  font-size: 13px;
  color: var(--c-text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-font-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--c-border-default);
  border-radius: 10px;
  background: var(--c-surface-panel);
  max-width: 560px;
}

.brand-font-sample {
  font-size: 40px;
  line-height: 1.2;
  color: var(--c-text);
}

.brand-font-sample-lg {
  font-size: 64px;
}

.brand-font-meta {
  margin-top: 6px;
  font-size: 13px;
  color: var(--c-text-secondary);
}

/* =============================================================================
   Settings (topbar wheel + modal)
   ============================================================================= */
.tb-settings {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: 10px;
  border: 0.5px solid var(--c-border-default);
  border-radius: 8px;
  background: var(--c-surface);
  color: var(--c-text-secondary);
  cursor: pointer;
}

.tb-settings:hover {
  color: var(--c-text);
  border-color: var(--c-border-strong);
}

.tb-settings i {
  font-size: 18px;
}

/* clerk-auth-and-users, phase 1: full-screen sign-in gate. Sits above
   everything else in the shell; app.js hides it once signed in (or
   self-hides if Clerk isn't configured in this environment). Clerk's own
   mounted sign-in widget is the only card — themed via CLERK_APPEARANCE in
   app.js — so it isn't nested inside a second card of ours. */
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: var(--c-canvas-bg);
}

.auth-gate-brand {
  font-family: var(--font-logo);
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--c-text);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(20, 16, 12, 0.35);
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  background: var(--c-surface-panel);
  border: 0.5px solid var(--c-border-default);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 0.5px solid var(--c-border-subtle);
  flex-shrink: 0;
}

.modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--c-text-muted);
  cursor: pointer;
  font-size: 18px;
  display: inline-flex;
}

.modal-close:hover {
  color: var(--c-text);
}

/* Settings modal — fixed size, sized to fit the API tab (the largest
   panel) without scrolling; other tabs just leave the rest blank.
   Vertical tabs on the left, scrollable content pane on the right.
   Widened (660 -> 860) and made a bit taller so the Account tab's inline
   Clerk UserProfile (a two-pane nav+content layout) has enough room to lay
   out without horizontal scrolling — see USER_PROFILE_APPEARANCE in app.js. */
.modal-settings {
  width: min(860px, calc(100vw - 32px));
  height: min(680px, calc(100vh - 64px));
}

.settings-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.settings-tabs {
  display: flex;
  flex-direction: column;
  width: 150px;
  flex-shrink: 0;
  padding: 14px 8px;
  gap: 2px;
  border-right: 0.5px solid var(--c-border-subtle);
  overflow-y: auto;
}

.settings-tab-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  padding: 9px 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-secondary);
  cursor: pointer;
  transition: color 100ms linear, background 100ms linear, border-color 100ms linear;
}

.settings-tab-btn:hover {
  color: var(--c-text);
  background: var(--c-surface-subtle);
}

.settings-tab-btn.active {
  color: var(--c-text);
  border-left-color: var(--c-black);
  background: var(--c-surface-raised);
}

.settings-panel[hidden] {
  display: none;
}

/* Only the settings modal's body gets the fixed-height + scroll treatment —
   .modal-body is shared with other modals (e.g. Add product) that should
   keep sizing to their own content. */
.settings-body .modal-body {
  flex: 1;
  min-height: 0;
}

.modal-body {
  padding: 18px;
  overflow-y: auto;
}

.set-section {
  margin-bottom: 22px;
}

/* clerk-auth-and-users: Clerk's inline UserProfile mount — stretch to the
   full panel width (paired with width:"100%" + boxSizing:"border-box" in
   USER_PROFILE_APPEARANCE, app.js) instead of Clerk sizing itself off
   viewport width, which is what caused the horizontal scrollbar. */
#clerkUserProfile {
  width: 100%;
}

.set-lbl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 6px;
}

/* Placements list (Details panel) */
.placement-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
  color: var(--c-text);
  cursor: pointer;
}

.placement-ratio {
  font-variant-numeric: tabular-nums;
}

.placement-tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--c-text-muted);
}

/* Placement variants modal */
.modal-wide {
  width: min(760px, calc(100vw - 32px));
}

/* Add product — "Load from folder" thumbnail panel + drag/click-to-assign */
.dir-panel {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  max-height: 240px;
  overflow-y: auto;
  background: var(--c-surface-subtle);
  border: 0.5px solid var(--c-border-subtle);
  border-radius: 8px;
}

.dir-panel[hidden] {
  display: none;
}

.dir-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: grab;
  user-select: none;
  transition: opacity 100ms linear, background 100ms linear;
}

.dir-item:hover {
  background: var(--c-white);
}

.dir-item.used {
  opacity: 0.4;
}

.dir-item.dragging {
  opacity: 0.35;
}

.dir-item-thumb {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--c-white);
  border: 0.5px solid var(--c-border-subtle);
  border-radius: 6px;
}

.dir-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.dir-item-thumb i {
  font-size: 20px;
  color: var(--c-text-muted);
  pointer-events: none;
}

.dir-item-name {
  max-width: 72px;
  font-size: 10px;
  line-height: 1.2;
  color: var(--c-text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dir-item-used-badge {
  position: absolute;
  top: 2px;
  right: 8px;
  width: 15px;
  height: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-black);
  color: var(--c-white);
  border-radius: 50%;
  font-size: 9px;
}

/* Packshot / Scan sections double as drop targets while a folder is loaded */
.drop-zone {
  border-radius: 8px;
  transition: background 100ms linear, box-shadow 100ms linear;
}

.drop-zone.drop-active {
  background: var(--c-surface-subtle);
  box-shadow: inset 0 0 0 1.5px var(--c-black);
}

.drop-zone.drop-denied {
  background: #fdf2f1;
  box-shadow: inset 0 0 0 1.5px var(--c-destructive-border);
  cursor: not-allowed;
}

.variant-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.variant-card {
  width: 180px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 0.5px solid var(--c-border-default);
  border-radius: 10px;
  background: var(--c-surface);
}

.variant-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.variant-ratio {
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}

.variant-dim {
  font-size: 11px;
  color: var(--c-text-muted);
  font-variant-numeric: tabular-nums;
}

.variant-thumb {
  position: relative;
  width: 100%;
  height: 220px;
  background: var(--c-canvas-bg);
  border-radius: 6px;
  overflow: hidden;
}

.variant-actions {
  display: flex;
  gap: 8px;
}

.variant-actions .cmd-btn {
  flex: 1;
  justify-content: center;
}

/* =============================================================================
   Coming-soon page
   ============================================================================= */
.coming-soon,
.board-soon {
  height: 100%;
  display: grid;
  place-content: center;
  background: var(--c-canvas-bg);
}

.cs-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 40px 56px;
  background: var(--c-white);
  border: 0.5px solid var(--c-border-default);
}

.cs-card i {
  font-size: 34px;
  color: var(--c-text-placeholder);
}

.cs-title {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: capitalize;
}

.cs-sub {
  font-size: 12px;
  color: var(--c-text-muted);
}

/* =============================================================================
   Workspace grid:  primary-nav | sub-panel | board | customize
   ============================================================================= */
.workspace {
  height: 100%;
  display: grid;
  grid-template-columns: 184px 248px 1fr 296px;
  min-height: 0;
}

/* ---- Primary nav (left column) ---- */
.primary-nav {
  background: var(--c-surface-panel);
  border-right: 0.5px solid var(--c-border-default);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 6px;
  overflow-y: auto;
}

.pnav-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--c-text-secondary);
  background: var(--c-surface-raised);
  border: 0.5px solid var(--c-border-subtle);
  cursor: pointer;
  transition: background 100ms linear, color 100ms linear, border-color 100ms linear;
}

.pnav-btn:hover {
  border-color: var(--c-black);
  background: var(--c-white);
  color: var(--c-text);
}

.pnav-btn.active {
  background: var(--c-white);
  color: var(--c-text);
  font-weight: 500;
  border-color: var(--c-border-strong);
  border-left: 2px solid var(--c-black);
}

/* ---- Sub panel (reuses adgrid panel-left language) ---- */
.panel-left {
  background: var(--c-white);
  border-right: 0.5px solid var(--c-border-default);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.pl-header {
  padding: 12px 8px 10px 16px;
  border-bottom: 0.5px solid var(--c-border-subtle);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pl-header-title {
  flex: 1;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #333;
  font-weight: 500;
}

.pl-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.pl-section {
  padding: 0 16px 14px;
}

.pl-section + .pl-section {
  border-top: 0.5px solid #f0efea;
}

.pl-lbl {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3a3a3a;
  padding-top: 14px;
  margin-bottom: 10px;
}

/* ---- Subnav (steps) ---- */
.subnav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 6px;
}

.subnav-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--c-text-secondary);
  background: transparent;
  border: 0.5px solid transparent;
  cursor: pointer;
  transition: background 100ms linear, color 100ms linear, border-color 100ms linear;
}

.subnav-btn i {
  font-size: 16px;
  color: #999;
  flex-shrink: 0;
}

.subnav-btn:hover {
  background: var(--c-surface-raised);
  color: var(--c-text);
}

.subnav-btn.active {
  background: var(--c-surface-raised);
  color: var(--c-text);
  border-color: var(--c-border-strong);
  border-left: 2px solid var(--c-black);
  font-weight: 500;
}

.subnav-btn.active i {
  color: var(--c-black);
}

/* ---- Fields / buttons (shared language) ---- */
.field-select {
  width: 100%;
  font-size: 12px;
  color: var(--c-text);
  border: 0.5px solid var(--c-border-default);
  background: var(--c-surface-raised);
  padding: 6px 8px;
  outline: none;
  font-family: var(--font-ui);
}

.field-select:focus {
  border-color: var(--c-black);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field-group-lbl {
  font-size: 9px;
  color: var(--c-text-muted);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.field-group-inp {
  width: 100%;
  font-size: 12px;
  color: var(--c-text);
  border: 0.5px solid var(--c-border-default);
  background: var(--c-surface-raised);
  padding: 6px 8px;
  outline: none;
  font-family: var(--font-ui);
}

.field-group-inp:focus {
  border-color: var(--c-black);
}

textarea.field-group-inp {
  resize: vertical;
  min-height: 60px;
  line-height: 1.5;
}

.cmd-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-ui);
  border: 0.5px solid var(--c-border-subtle);
  background: var(--c-surface-raised);
  color: var(--c-text);
  cursor: pointer;
  text-align: left;
  margin-bottom: 4px;
  text-decoration: none;
  transition: background 100ms linear, color 100ms linear, border-color 100ms linear;
}

.cmd-btn:hover {
  border-color: var(--c-black);
  background: var(--c-white);
}

.cmd-btn i {
  font-size: 16px;
  color: #888;
  flex-shrink: 0;
}

.cmd-btn:hover i {
  color: var(--c-black);
}

.hint {
  font-size: 11px;
  color: var(--c-text-hint);
  line-height: 1.5;
  padding: 5px 0 0;
}

.inline-soon {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--c-tag-text);
  background: var(--c-tag-bg);
  border: 0.5px dashed var(--c-tag-border);
}

.inline-soon i {
  font-size: 15px;
}

/* =============================================================================
   Center board — template cards
   ============================================================================= */
.canvas-area {
  background: var(--c-canvas-bg);
  min-height: 0;
  overflow: hidden;
}

.board {
  height: 100%;
  overflow-y: auto;
  padding: 22px 26px;
}

.board-title {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-text-secondary);
  margin-bottom: 16px;
}

/* Overrides .cmd-btn's default width:100% — inside a .board-title row the
   button should sit compact on the right (pushed there by its margin-left:
   auto in the markup), not stretch to fill the whole title row. */
.board-title .cmd-btn {
  width: auto;
  flex-shrink: 0;
  padding: 5px 10px;
  font-size: 11px;
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: normal;
}

.board-title .cmd-btn i {
  font-size: 13px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px 22px;
}

.tcard {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.tcard-thumb {
  aspect-ratio: 1 / 1;
  background: var(--c-white);
  border: 0.5px solid var(--c-border-default);
  display: grid;
  place-content: center;
  position: relative;
  transition: border-color 100ms linear, box-shadow 100ms linear;
}

.tcard-thumb i {
  font-size: 30px;
  color: var(--c-text-placeholder);
}

.tcard:hover .tcard-thumb {
  border-color: var(--c-border-strong);
}

.tcard.selected .tcard-thumb {
  border-color: var(--c-black);
  box-shadow: 0 0 0 1px var(--c-black);
}

.tcard-check {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--c-white);
  border: 0.5px solid var(--c-border-default);
  cursor: pointer;
}

.tcard-check input {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--c-black);
  cursor: pointer;
}

.tcard-thumb img,
.tcard-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Template layout preview (scaled wireframe of the blocks) */
.tprev {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  overflow: hidden;
  container-type: inline-size;
  box-shadow: inset 0 0 0 0.5px var(--c-border-subtle);
}

.tprev-block {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.18);
}

.tprev-text {
  display: block;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  line-height: 1.05;
  white-space: pre-wrap;
  word-break: break-word;
  padding: 0 4cqw;
}

/* More specific than `.tcard-thumb i` (the placeholder-icon rule) so the preview
   glyph keeps its own size/color. */
.tprev-block .tprev-ico {
  font-size: 11cqw;
  color: rgba(0, 0, 0, 0.5);
}

.tcard-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--c-white);
  border: 0.5px solid var(--c-border-default);
  color: var(--c-text-muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 100ms linear, color 100ms linear, border-color 100ms linear;
}

.tcard-remove i {
  font-size: 14px;
}

.tcard:hover .tcard-remove {
  opacity: 1;
}

.tcard-remove:hover {
  color: var(--c-destructive);
  border-color: var(--c-destructive-border);
}

/* Product cards show both the adset checkbox (top-right, existing) and a
   delete button (runtime-created products only) — pin delete to the opposite
   corner so the two controls don't overlap. */
.tcard-remove.tcard-remove-left {
  left: 8px;
  right: auto;
}

.tcard-caption {
  font-size: 13px;
  color: var(--c-text);
}

.tcard-caption .tcard-kind {
  color: var(--c-text-muted);
}

/* =============================================================================
   Customize panel (reuses adgrid panel-right language)
   ============================================================================= */
.panel-right {
  background: var(--c-white);
  border-left: 0.5px solid var(--c-border-default);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.pr-header {
  padding: 10px 16px;
  border-bottom: 0.5px solid var(--c-border-subtle);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.pr-block-name {
  font-size: 16px;
  color: var(--c-text);
  font-weight: 500;
  letter-spacing: -0.01em;
  flex: 1;
}

.pr-block-tag {
  font-size: 10px;
  color: var(--c-tag-text);
  background: var(--c-tag-bg);
  border: 0.5px solid var(--c-tag-border);
  padding: 3px 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.pr-body {
  flex: 1;
  overflow-y: auto;
}

.insp-section {
  border-bottom: 0.5px solid var(--c-border-subtle);
}

.insp-hdr {
  padding: 11px 16px 6px;
}

.insp-hdr-lbl {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #3a3a3a;
}

.insp-body {
  padding: 4px 16px 14px;
}

.link-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  font-size: 12px;
  background: var(--c-surface-raised);
  border: 0.5px solid var(--c-border-subtle);
}

.link-row i {
  font-size: 15px;
  color: #888;
  flex-shrink: 0;
}

.link-row.unlinked {
  color: var(--c-text-muted);
  border-style: dashed;
  background: transparent;
}

.link-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Per-block configuration warnings (Customize panel) — same amber/blue idiom
   as .gen-eval-row.warn/.info on the Generate board, scaled down for the
   narrower right-panel column. */
.block-warn-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  font-size: 11.5px;
  line-height: 1.5;
}

.block-warn-row + .block-warn-row {
  margin-top: 6px;
}

.block-warn-row i {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.block-warn-row.warning {
  color: #8a5a1a;
  background: #faf3e6;
  border: 0.5px solid #e6d3ad;
}

.block-warn-row.warning i {
  color: #b8860b;
}

.block-warn-row.info {
  color: #2c4a66;
  background: #eef3f8;
  border: 0.5px solid #c7d8e6;
}

.block-warn-row.info i {
  color: #3a6a94;
}

.concept-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--c-text-secondary);
}

/* Adsets list */
.adset-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 560px;
}

.adset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--c-white);
  border: 0.5px solid var(--c-border-default);
  cursor: pointer;
  transition: border-color 100ms linear;
}

.adset-row:hover {
  border-color: var(--c-border-strong);
}

.adset-row.current {
  border-color: var(--c-black);
  border-left: 2px solid var(--c-black);
}

.adset-row-name {
  font-size: 14px;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.adset-row-meta {
  font-size: 12px;
  color: var(--c-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Per-row delete (×) — appears on hover. */
.adset-row-del {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-text-muted);
  font-size: 18px;
  line-height: 1;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 100ms linear, background 100ms linear, color 100ms linear;
}
.adset-row:hover .adset-row-del,
.adset-row-del:focus-visible {
  opacity: 1;
}
.adset-row-del:hover {
  background: #fdecec;
  color: #d1272f;
}

/* Downloads — same card as an adset row, but not clickable as a whole: every
   action is its own button, so none of them happens by accident. */
.downloads-status {
  font-size: 13px;
  color: var(--c-text-muted);
  margin: 0 0 12px;
  max-width: 560px;
}
.downloads-status.is-error {
  color: #d1272f;
}

.download-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  background: var(--c-white);
  border: 0.5px solid var(--c-border-default);
}

.download-row-main {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.download-row-name {
  font-size: 14px;
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download-row-input {
  font-size: 14px;
  font-family: var(--font-ui);
  color: var(--c-text);
  padding: 3px 6px;
  margin: -4px 0 -1px -7px;
  border: 0.5px solid var(--c-black);
  background: var(--c-white);
  outline: none;
}

.download-row-meta {
  font-size: 12px;
  color: var(--c-text-muted);
}

.download-row-error {
  font-size: 12px;
  color: #d1272f;
}

.download-row-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.download-act {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-text-muted);
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 100ms linear, color 100ms linear;
}
.download-act:hover {
  background: var(--c-surface);
  color: var(--c-black);
}
.download-act.is-on {
  color: var(--c-black);
}
.download-act.danger:hover {
  background: #fdecec;
  color: #d1272f;
}
.download-act:disabled {
  opacity: 0.4;
  cursor: default;
}
.download-act:disabled:hover {
  background: transparent;
  color: var(--c-text-muted);
}

/* Product files (right panel) */
.packshot-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  font-size: 12px;
}

.packshot-row + .packshot-row {
  border-top: 0.5px solid var(--c-border-subtle);
}

.packshot-slot {
  width: 46px;
  flex-shrink: 0;
  text-transform: capitalize;
  color: var(--c-text-secondary);
}

.packshot-state {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text);
}

.packshot-state.missing {
  color: var(--c-text-placeholder);
}

.packshot-add {
  flex-shrink: 0;
  background: var(--c-surface-raised);
  border: 0.5px solid var(--c-border-default);
  color: var(--c-text-secondary);
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
  font-family: var(--font-ui);
}

.packshot-add:hover {
  border-color: var(--c-black);
  color: var(--c-text);
}

/* Generation summary */
/* Center the Generate-adset board content horizontally (top-aligned) */
.board[data-board="generation-settings"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.board[data-board="generation-settings"] .board-title {
  width: 100%;
  max-width: 600px;
  margin-bottom: 0;
}

.gen-summary {
  width: 100%;
  max-width: 600px;
}

.gen-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.gen-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 12px;
  background: var(--c-white);
  border: 0.5px solid var(--c-border-default);
}

.gen-stat-lbl {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-secondary);
}

.gen-stat-val {
  font-size: 30px;
  line-height: 1;
  color: var(--c-text);
}

.gen-stat-val.gen-strong {
  font-weight: 600;
}

/* "10 / 15" style shortfall — the Total stat turns amber when fewer creatives
   are actually achievable than the selection would imply. */
.gen-stat-val.gen-stat-reduced {
  color: #b8860b;
}

.gen-warn {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 11px 14px;
  font-size: 12px;
  color: #8a5a1a;
  background: #faf3e6;
  border: 0.5px solid #e6d3ad;
}

.gen-warn i {
  font-size: 16px;
}

.gen-actions {
  margin-top: 16px;
}

.gen-section-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--c-text-secondary);
  margin: 0 0 8px;
}

.gen-stats + .gen-eval .gen-section-title,
.gen-eval {
  margin-top: 18px;
}

.gen-eval-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 11px 14px;
  background: var(--c-white);
  border: 0.5px solid var(--c-border-default);
}

.gen-eval-row + .gen-eval-row {
  border-top: none;
}

.gen-eval-row i {
  font-size: 17px;
  flex-shrink: 0;
  margin-top: 1px;
}

.gen-eval-row.ok {
  border-color: #bcd9bd;
  background: #f1f8f1;
}

.gen-eval-row.ok i {
  color: #2f7d32;
}

.gen-eval-row.warn {
  border-color: #e6d3ad;
  background: #faf3e6;
}

.gen-eval-row.warn i {
  color: #b8860b;
}

/* Informational (non-alarming) variant — e.g. "no motion path attached, using
   the default sequence" — worth naming but not something to alarm over. */
.gen-eval-row.info {
  border-color: #c7d8e6;
  background: #eef3f8;
}

.gen-eval-row.info i {
  color: #3a6a94;
}

.gen-eval-body {
  min-width: 0;
}

.gen-eval-label {
  font-size: 13px;
  color: var(--c-text);
}

.gen-eval-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--c-text-secondary);
  margin-top: 4px;
}

/* =============================================================================
   Status bar
   ============================================================================= */
.statusbar {
  background: var(--c-surface-panel);
  border-top: 0.5px solid var(--c-border-default);
  display: flex;
  align-items: center;
  padding: 0 16px;
  flex-shrink: 0;
}

.status-txt {
  font-size: 11px;
  color: var(--c-text-secondary);
  letter-spacing: 0.04em;
}

/* Scrollbars — match adgrid */
.pl-body::-webkit-scrollbar,
.board::-webkit-scrollbar,
.pr-body::-webkit-scrollbar,
.primary-nav::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.pl-body::-webkit-scrollbar-thumb,
.board::-webkit-scrollbar-thumb,
.pr-body::-webkit-scrollbar-thumb,
.primary-nav::-webkit-scrollbar-thumb {
  background: #d8d6cd;
  border: 3px solid transparent;
  background-clip: padding-box;
}

.pl-body::-webkit-scrollbar-track,
.board::-webkit-scrollbar-track,
.pr-body::-webkit-scrollbar-track,
.primary-nav::-webkit-scrollbar-track {
  background: transparent;
}

/* Continuous spinner for loader icons (e.g. the Generate button while working). */
@keyframes mb-spin {
  to {
    transform: rotate(360deg);
  }
}
.spin {
  display: inline-block;
  animation: mb-spin 0.7s linear infinite;
}

/* Generation progress bar (creatives composited so far). */
.gen-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  /* The run's phase and the pairing rows (SH-09) are full-width flex items, so
     they wrap onto their own lines under the track; the track + label row
     stays as it was. */
  flex-wrap: wrap;
}
.gen-progress-track {
  position: relative;
  flex: 1;
  height: 8px;
  border-radius: 999px;
  background: var(--c-border-subtle, #e6e3de);
  overflow: hidden;
}
/* Indeterminate shimmer — a band slides across so the bar shows life even while a
   slow first step runs and no creatives have completed yet (0/N). */
.gen-progress-track.working::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(0, 0, 0, 0.14) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: mb-shimmer 1.15s ease-in-out infinite;
}
@keyframes mb-shimmer {
  to {
    transform: translateX(100%);
  }
}
.gen-progress-fill {
  position: relative;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background-color: var(--c-black, #111);
  transition: width 0.3s ease;
}
/* Moving barber-pole stripes on the completed portion. */
.gen-progress-track.working .gen-progress-fill {
  background-image: repeating-linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.16) 0 8px,
    transparent 8px 16px
  );
  background-size: 22px 22px;
  animation: mb-barber 0.6s linear infinite;
}
@keyframes mb-barber {
  to {
    background-position: 22px 0;
  }
}
.gen-progress-label {
  font-size: 12px;
  color: var(--c-text-muted, #666);
}
/* The count is nowrap + tabular so the digits do not shift as they tick. The
   hint is NOT nowrap: it is a whole sentence, and forcing it onto one line is
   what made the row jump sideways the moment it appeared. */
.gen-progress-count {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.gen-progress-hint {
  white-space: normal;
}

/* What the run is doing (SH-09): its phase, then one row per product ×
   template pairing. A run can go many minutes between two creative counts —
   these rows are what shows it is moving. */
.gen-progress-stage,
.gen-progress-rows {
  flex: 0 0 100%;
}
.gen-progress-stage:not(:empty) {
  margin-top: 6px;
  font-size: 12px;
  color: var(--c-text-muted, #666);
}
.gen-progress-rows:not(:empty) {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Ten products are ten rows: cap the height and scroll rather than push the
     rest of the board down the page. */
  max-height: 168px;
  overflow-y: auto;
}
.gen-progress-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--c-text-muted, #666);
}
.gen-progress-row .ti {
  flex: 0 0 auto;
  align-self: center;
  font-size: 13px;
}
.gen-progress-row.done { color: var(--c-text-muted, #666); opacity: 0.75; }
.gen-progress-row.queued { opacity: 0.55; }
.gen-progress-row.failed { color: var(--c-danger, #b42318); }
.gen-progress-row.skipped { opacity: 0.7; }
.gen-row-label {
  flex: 0 0 auto;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--c-text, #111);
}
.gen-progress-row.done .gen-row-label,
.gen-progress-row.queued .gen-row-label { color: inherit; }
.gen-row-stage {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* =============================================================================
   AI concepts — coverage map, brief cards, diversity gate
   (docs/creative-ideation.md)
   ============================================================================= */

/* =============================================================================
   Creative diversity section (Generate board) — docs/creative-ideation.md §4.
   Matches the Summary/Evaluation/Settings section idiom (no card chrome).
   ============================================================================= */
.div-panel {
  width: 100%;
  max-width: 600px;
  margin-top: 22px;
}

.div-panel .hint {
  margin-bottom: 2px;
}

.div-panel .gen-actions {
  margin-top: 10px;
  margin-bottom: 14px;
}

.div-verdict {
  margin-top: 4px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  border: 0.5px solid var(--c-border-default);
}

.div-verdict i {
  font-size: 16px;
  margin-top: 1px;
}

.div-verdict.bad {
  background: #fdf2f1;
  border-color: #e5b5b1;
}

.div-verdict.bad i {
  color: #b3261e;
}

.div-verdict.good {
  background: #f2f7f2;
  border-color: #bcd4bc;
}

.div-verdict.good i {
  color: #2e7d32;
}

.div-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}

.div-row {
  padding: 10px 2px;
  border-top: 0.5px solid var(--c-border-subtle);
}

.div-row-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.div-chip {
  flex-shrink: 0;
  padding: 2px 8px;
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border: 0.5px solid var(--c-border-strong);
  color: var(--c-text-secondary);
  background: var(--c-surface-raised);
}

.div-chip.dup {
  background: #b3261e;
  border-color: #b3261e;
  color: var(--c-white);
}

.div-chip.rel {
  background: #f4e9c9;
  border-color: #d8c98f;
  color: #6b5b1e;
}

.div-chip.ok {
  background: #eef4ee;
  border-color: #bcd4bc;
  color: #2e5b30;
}

.div-name {
  font-size: 13px;
  font-weight: 600;
}

.div-score {
  font-size: 11px;
  color: var(--c-text-muted);
  margin-left: auto;
}

.div-reason {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--c-text-secondary);
  line-height: 1.55;
}

/* Smart-cropping toggle on the Generate board */
.gen-focus-toggle {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  max-width: 560px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--c-text-secondary);
  line-height: 1.5;
  cursor: pointer;
}

.gen-focus-toggle input {
  margin-top: 2px;
  accent-color: var(--c-black);
}

.gen-settings {
  margin-top: 22px;
}

.gen-settings .gen-focus-toggle {
  margin: 10px 0 0;
}

/* Disabled command buttons (Generate / Check diversity) read as inactive. */
.cmd-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.cmd-btn:disabled:hover {
  border-color: var(--c-border-subtle);
  background: var(--c-surface-raised);
}

.cmd-btn:disabled:hover i {
  color: #888;
}

/* Mixed-value stat tiles (e.g. Formats "1v · 2s") — slightly smaller value. */
.gen-stat-val.gen-stat-mix {
  font-size: 20px;
  letter-spacing: 0;
}

/* =============================================================================
   Skipped-combination detail list (Generate board) — per product×template
   pairing that produces nothing, with its reason. Replaces the old
   aggregate-only "N skipped — missing scan" line.
   ============================================================================= */
.gen-skip-list {
  width: 100%;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
}

.gen-skip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 2px;
  font-size: 12px;
  border-top: 0.5px solid var(--c-border-subtle);
}

.gen-skip-combo {
  color: var(--c-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gen-skip-reason {
  flex-shrink: 0;
  color: var(--c-text-muted);
}

/* =============================================================================
   Post-generation report (Generate board) — real per-item results for the run
   that just finished: successes, structural warnings, skipped pairings, and
   failures, each with the actual reason instead of only a count.
   ============================================================================= */
.gen-report {
  width: 100%;
  max-width: 600px;
  margin-top: 22px;
}

.gen-report-headline {
  font-size: 13px;
  color: var(--c-text);
  margin-bottom: 4px;
}

.gen-report-section {
  margin-top: 14px;
}

.gen-report-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--c-text-muted);
  margin-bottom: 6px;
}

.gen-report-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px 12px;
  font-size: 12px;
  border: 0.5px solid var(--c-border-default);
}

.gen-report-row + .gen-report-row {
  border-top: none;
}

.gen-report-row i {
  font-size: 15px;
  flex-shrink: 0;
  margin-top: 1px;
}

.gen-report-row strong {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--c-text);
}

.gen-report-row p {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--c-text-secondary);
}
/* The provider's own answer behind a failed pairing (SH-10, as moonbase). */
.gen-report-detail { margin-top: 4px; font-size: 11px; }
.gen-report-detail summary { cursor: pointer; opacity: 0.7; }
.gen-report-detail pre { margin: 4px 0 0; padding: 6px 8px; background: rgba(0,0,0,0.05); border-radius: 6px; white-space: pre-wrap; word-break: break-word; max-height: 140px; overflow-y: auto; }

.gen-report-row.warn {
  border-color: #e6d3ad;
  background: #faf3e6;
}

.gen-report-row.warn i {
  color: #b8860b;
}

.gen-report-row.bad {
  border-color: #e5b5b1;
  background: #fdf2f1;
}

.gen-report-row.bad i {
  color: #b3261e;
}

.tutorial-dim {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(20, 16, 12, 0.55);
  pointer-events: none;
}

.tutorial-bar {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 160;
  width: min(480px, calc(100vw - 48px));
  padding: 16px 18px;
  border-radius: 10px;
  border: 0.5px solid var(--c-border-default);
  background: var(--c-surface-raised);
  box-shadow: 0 12px 32px rgba(10, 10, 10, 0.22);
}

.tutorial-bar-progress {
  font-size: 11px;
  color: var(--c-text-hint);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tutorial-bar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  margin-top: 4px;
}

.tutorial-bar-body {
  font-size: 13px;
  color: var(--c-text-secondary);
  line-height: 1.5;
  margin-top: 6px;
}

.tutorial-bar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.tutorial-btn {
  padding: 8px 14px;
  font-size: 13px;
  font-family: var(--font-ui);
  border-radius: 6px;
  cursor: pointer;
  transition: background 100ms linear, color 100ms linear, border-color 100ms linear;
}

.tutorial-btn-ghost {
  border: 0.5px solid var(--c-border-default);
  background: transparent;
  color: var(--c-text-secondary);
}

.tutorial-btn-ghost:hover {
  border-color: var(--c-black);
  color: var(--c-text);
}

.tutorial-btn-primary {
  border: 0.5px solid var(--c-black);
  background: var(--c-black);
  color: var(--c-white);
}

.tutorial-btn-primary:disabled {
  border-color: var(--c-border-default);
  background: var(--c-border-subtle);
  color: var(--c-text-hint);
  cursor: not-allowed;
}

.tutorial-spotlight-target {
  position: relative;
  z-index: 155;
  box-shadow: 0 0 0 9999px rgba(20, 16, 12, 0.55);
}

/* Hover-and-hold tooltip bubble (SH-12; the AdGrid treatment, AG-34). One
   engine at the end of app.js, copy in SHELL_TOOLTIP_COPY. Fixed-position so
   it escapes every scroll container and overflow clip. */
.ui-tip {
  position: fixed;
  z-index: 9999;
  max-width: 260px;
  padding: 6px 9px;
  background: rgba(28, 26, 22, 0.96);
  color: #f5f2ea;
  font-size: 11.5px;
  line-height: 1.45;
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s ease;
}

.ui-tip.visible {
  opacity: 1;
}

/* SH-05: the note above the Templates grid when the library is incomplete. */
.catalog-banner {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(179, 38, 30, 0.06);
}
.catalog-banner .cmd-btn {
  margin-left: 6px;
}
