/* ==== DocForge — Brand kit ====
   Loaded after structure.css and before polish.css. polish.css also styles
   .hero, so the kit hero's overrides use a doubled selector (.hero.kit-hero)
   to win on specificity rather than on order. */

/* ---------------------------------------------------------------- layout --*/

.kit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 20px;
  align-items: start;
}
.kit-main > .card + .card { margin-top: 20px; }
.kit-aside {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  max-height: calc(100vh - var(--topbar-h) - 32px);
  overflow: auto;
}

/* Section heads inside .card-head */
.kit-sec-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
  margin: 0;
  min-width: 0;
}
.kit-sec-title .icon-well { width: 28px; height: 28px; flex-basis: 28px; }
.kit-sec-title .icon-well .icon { color: var(--pri); }
.kit-sec-sub { margin: 4px 0 0; font-size: 12.5px; color: var(--txt-muted); }
.kit-sec-count { margin-left: 2px; }
.card-head .kit-sec-text { min-width: 0; }

/* ------------------------------------------------------------------ hero --*/
/* The one big moment: a gradient drawn from the user's own default palette
   (falling back to the app brand), with the default logos on a glass card. */

.hero.kit-hero {
  --kit-g0: var(--pri-deep);
  --kit-g1: var(--pri);
  --kit-g2: var(--pri-2);
  --kit-fg: #fff;
  background:
    radial-gradient(520px 260px at 88% 0%, rgba(255, 255, 255, .16), transparent 60%),
    radial-gradient(420px 320px at 0% 100%, rgba(255, 255, 255, .08), transparent 60%),
    linear-gradient(115deg, var(--kit-g0) 0%, var(--kit-g1) 52%, var(--kit-g2) 100%);
  color: var(--kit-fg);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 28px;
  align-items: center;
  padding: 30px 32px;
  min-height: 196px;
  margin-bottom: 20px;
  transition: --kit-g0 var(--dur-slow), --kit-g1 var(--dur-slow), --kit-g2 var(--dur-slow);
}
/* A light primary needs dark type on the band. */
.hero.kit-hero.is-light { --kit-fg: #14181F; }
.kit-hero .hero-body { padding: 0; max-width: none; }
.kit-hero h1 {
  font-size: 30px;
  line-height: 1.1;
  letter-spacing: -.024em;
  margin: 0 0 8px;
  color: var(--kit-fg);
}
.kit-hero .hero-eyebrow, .kit-hero .hero-sub { color: var(--kit-fg); opacity: .78; }
.kit-hero .hero-sub { margin-bottom: 0; }
.kit-hero .hero-actions { margin-top: 18px; }
.kit-hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.kit-hero.is-light .pill-glass { background: rgba(20, 24, 31, .08); color: inherit; border-color: rgba(20, 24, 31, .16); }
.kit-hero.is-light .btn-glass { background: rgba(20, 24, 31, .08); color: inherit; border-color: rgba(20, 24, 31, .2); }
.kit-hero.is-light .btn-glass:hover:not(:disabled) { background: rgba(20, 24, 31, .14); color: inherit; }

.kit-hero-card {
  background: var(--glass-dark-bg);
  border: 1px solid var(--glass-dark-border);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18), inset 0 1px 0 rgba(255, 255, 255, .25);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.kit-tile {
  position: relative;
  background: #fff;
  border-radius: 10px;
  height: 78px;
  display: grid;
  place-items: center;
  padding: 10px 10px 18px;
  overflow: hidden;
}
/* 78px tile minus 10px top and 18px label padding, with a little air. */
.kit-tile img { max-height: 44px; max-width: 100%; width: auto; height: auto; object-fit: contain; }
.kit-tile-label {
  position: absolute;
  left: 8px;
  bottom: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--txt-faint);
}
.kit-tile.empty {
  background: rgba(255, 255, 255, .08);
  border: 1.5px dashed rgba(255, 255, 255, .45);
  color: rgba(255, 255, 255, .85);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 10px;
  transition: background var(--transition);
}
.kit-tile.empty:hover { background: rgba(255, 255, 255, .14); }
.kit-hero.is-light .kit-tile.empty { color: inherit; border-color: rgba(20, 24, 31, .3); background: rgba(255, 255, 255, .25); }
.kit-swatches {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255, 255, 255, .92);
  font-size: 12.5px;
  font-weight: 600;
  min-width: 0;
}
.kit-hero.is-light .kit-swatches { color: inherit; }
.kit-swatches .kit-swatch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kit-swatch {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 1px 3px rgba(0, 0, 0, .2);
}
.kit-swatches .pill { margin-left: auto; }

/* -------------------------------------------------------------- identity --*/

.kit-identity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0 14px;
}
.kit-identity-grid .field { margin-bottom: 15px; }
.kit-type { border-top: 1px solid var(--border); padding-top: 14px; margin-top: 2px; }
.kit-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0 18px;
}
.kit-type-grid .field { margin-bottom: 12px; }
/* The mock takes the brand's default faces where they show: the title and the
   stand-in wordmark in the heading face, the identity lines in the body face. */
.bp-title, .bp-wordmark-text { font-family: var(--bp-font-head, inherit); }
.bp-org, .bp-conf { font-family: var(--bp-font-body, inherit); }

/* ----------------------------------------------------------------- logos --*/

.logo-upload-status:not(:empty) { margin-top: 12px; }
#logo-grid { margin-top: 16px; }
.logo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}
.logo-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.logo-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.logo-tile.has-role { border-color: var(--pri-border); }
.logo-tile.has-role::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-brand);
  z-index: 1;
}
.logo-frame {
  position: relative;
  height: 104px;
  display: grid;
  place-items: center;
  padding: 12px;
  overflow: hidden;
  /* Checkerboard, so a transparent logo reads as transparent rather than
     looking like it has a white box baked in. */
  background-color: var(--surface-2);
  background-image:
    linear-gradient(45deg, #E2E6EA 25%, transparent 25%, transparent 75%, #E2E6EA 75%),
    linear-gradient(45deg, #E2E6EA 25%, transparent 25%, transparent 75%, #E2E6EA 75%);
  background-size: 14px 14px;
  background-position: 0 0, 7px 7px;
  transition: background-color var(--transition);
}
/* Absolute limits, not percentages: inside a grid cell a percentage max-height
   resolves against a track the image itself sizes, so a 658px-tall mark
   rendered at full size and, the frame being positioned, painted over the
   buttons beneath it. */
.logo-frame img { max-height: 80px; max-width: 88%; width: auto; height: auto; object-fit: contain; }
/* The same artwork against a solid dark ground: a mark drawn in navy vanishes
   on the cover's title band, and that is only obvious when you look at it. */
.on-dark .logo-frame {
  background-color: #1B2430;
  background-image:
    linear-gradient(45deg, #26313E 25%, transparent 25%, transparent 75%, #26313E 75%),
    linear-gradient(45deg, #26313E 25%, transparent 25%, transparent 75%, #26313E 75%);
}
.logo-shape {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, .88);
  color: var(--txt-2);
  border: 1px solid rgba(0, 0, 0, .06);
}
.on-dark .logo-shape { background: rgba(0, 0, 0, .45); color: #fff; border-color: rgba(255, 255, 255, .15); }
.logo-body { padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.logo-name { padding: 5px 8px; font-size: 13px; font-weight: 600; }
.logo-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  font-size: 11.5px;
  color: var(--txt-muted);
}
.logo-facts .faint { color: var(--txt-faint); }
.logo-actions { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.logo-actions .spacer { flex: 1; }

/* Two independent single-choice roles: which logo is the default company
   logo, and which is the default product mark. */
.role-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--txt-faint);
  margin-bottom: -4px;
}
.role-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 9px;
}
.role-btn {
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--txt-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  min-width: 0;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}
.role-btn:hover { color: var(--txt); }
.role-btn[aria-pressed="true"] {
  background: var(--surface);
  color: var(--pri);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--pri-border);
}
.role-btn .role-check { display: none; }
.role-btn[aria-pressed="true"] .role-check { display: inline-flex; }
.role-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------------- palettes --*/

.pal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.pal-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.pal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pal-card.is-default { border-color: var(--pri-border); box-shadow: 0 0 0 3px var(--pri-soft), var(--shadow-xs); }
.pal-card.is-editing { border-color: var(--pri); }
/* The strip echoes the cover: primary block, accent identity bar, a white
   title line, and "Aa" as the white-on-primary legibility hint. */
.pal-strip { position: relative; height: 68px; background: var(--p); }
.pal-strip::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 10px;
  background: var(--a);
}
.pal-strip::after {
  content: '';
  position: absolute;
  left: 24px;
  right: 56px;
  bottom: 18px;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .85);
}
.pal-aa {
  position: absolute;
  right: 12px;
  top: 10px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  letter-spacing: -.02em;
}
.pal-body { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pal-name { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.pal-name > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-hexes { display: flex; gap: 10px; font-size: 11.5px; color: var(--txt-muted); font-family: var(--font-mono); }
.pal-hexes i {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  margin-right: 4px;
  vertical-align: -1px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.pal-meta { font-size: 11.5px; color: var(--txt-faint); }
.pal-warn { display: flex; gap: 6px; align-items: flex-start; font-size: 11.5px; color: var(--warn); line-height: 1.4; }
.pal-warn .icon { flex: 0 0 auto; margin-top: 1px; }
.pal-actions { display: flex; gap: 4px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.pal-actions .spacer { flex: 1; }
.pal-new {
  border: 1.5px dashed var(--border-strong);
  background: var(--grad-surface);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 172px;
  color: var(--txt-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font: inherit;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.pal-new:hover { border-color: var(--pri); color: var(--pri); background: linear-gradient(180deg, #fff, var(--pri-soft)); }
.pal-new .icon-well { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }

/* ---- editor ---- */

.pal-editor {
  border: 1px solid var(--pri-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFC 100%);
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
  animation: pal-in 220ms var(--ease-out);
}
@keyframes pal-in { from { opacity: 0; transform: translateY(-6px); } }
.pal-editor-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pal-editor-head h3 { margin: 0; font-size: 14px; flex: 1; min-width: 0; }
.pal-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 16px;
}
.pal-editor-grid .field { margin-bottom: 14px; }
.pal-editor-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.pal-editor-foot .save-state { flex: 1; }
.pal-editor-warnings { display: flex; flex-direction: column; gap: 4px; margin: -4px 0 12px; }
.pal-editor-warnings:empty { display: none; }
.pal-editor .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  cursor: pointer;
}
.pal-editor .check-row input { width: 15px; height: 15px; accent-color: var(--pri); }

/* A colour pair: a painted well with the native picker invisible over it (so
   every browser shows the same chip), a mono hex field, and a contrast chip. */
.color-pair {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.color-well {
  position: relative;
  width: 40px;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 0 2px #fff;
}
.color-well-chip { position: absolute; inset: 0; background: var(--c); }
.color-well input[type="color"] {
  position: absolute;
  inset: -8px;
  width: calc(100% + 16px);
  height: calc(100% + 16px);
  border: 0;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}
.color-well:focus-within { border-color: var(--pri); box-shadow: var(--ring), inset 0 0 0 2px #fff; }
.color-hex { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .02em; }
.contrast-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  background: var(--surface-2);
  color: var(--txt-muted);
}
.contrast-chip[data-level="ok"] { background: var(--ok-soft); color: var(--ok); }
.contrast-chip[data-level="warn"] { background: var(--warn-soft); color: var(--warn); }
.contrast-chip[data-level="fail"] { background: var(--danger-soft); color: var(--danger); }

/* ---- suggested from your logos ---- */

.sug-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 8px; flex-wrap: wrap; }
.sug-head .field-label { font-size: 12.5px; font-weight: 600; color: var(--txt-2); flex: 1; }
.sug-rows { display: flex; flex-direction: column; gap: 8px; }
.sug-row { display: flex; align-items: center; gap: 10px; }
.sug-thumb {
  width: 44px;
  height: 32px;
  flex: 0 0 44px;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  padding: 3px;
  background: var(--surface-2);
}
.sug-thumb img { max-width: 100%; max-height: 24px; width: auto; height: auto; object-fit: contain; }
.sug-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.sug-chip {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, .08);
  background: var(--c);
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 2px #fff;
  transition: transform var(--transition), box-shadow var(--transition);
}
.sug-chip:hover { transform: translateY(-1px) scale(1.04); box-shadow: inset 0 0 0 2px #fff, var(--shadow); }
/* Below 3:1 on white — unusable as a band colour. */
.sug-chip.is-low { outline: 2px dashed var(--danger); outline-offset: 1px; }
.sug-empty, .sug-note { font-size: 12px; color: var(--txt-faint); }
.sug-skel { height: 32px; border-radius: 6px; }

/* --------------------------------------------------------------- notices --*/
/* Canned closing-page text. Cards share the palette card's bones; the editor
   splits into the form and a server-rendered preview of the page block. */

.not-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}
.not-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
.not-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.not-card.is-default { border-color: var(--pri-border); box-shadow: 0 0 0 3px var(--pri-soft), var(--shadow-xs); }
.not-card.is-editing { border-color: var(--pri); }
.not-card::before {
  content: '';
  height: 4px;
  background: var(--grad-brand);
  opacity: .55;
}
.not-body { padding: 12px 12px 10px; display: flex; flex-direction: column; gap: 7px; flex: 1; }
.not-kind-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.not-kind { background: var(--pri-soft); color: var(--pri); }
.not-kind-patent { background: var(--acc-soft); color: var(--acc); }
.not-kind-trademark { background: var(--warn-soft); color: var(--warn); }
.not-kind-custom { background: var(--surface-2); color: var(--txt-2); }
.not-name { font-weight: 650; font-size: 13.5px; }
.not-excerpt {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--txt-muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.not-meta { font-size: 11.5px; color: var(--txt-faint); }
.not-actions { display: flex; gap: 4px; align-items: center; margin-top: 2px; flex-wrap: wrap; }
.not-actions .spacer { flex: 1; }
.not-new {
  border: 1.5px dashed var(--border-strong);
  background: var(--grad-surface);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  min-height: 160px;
  color: var(--txt-muted);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  font: inherit;
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}
.not-new::before { display: none; }
.not-new:hover { border-color: var(--pri); color: var(--pri); background: linear-gradient(180deg, #fff, var(--pri-soft)); }
.not-new .icon-well { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }

.not-editor {
  border: 1px solid var(--pri-border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, #FFFFFF 0%, #F7FAFC 100%);
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
  animation: pal-in 220ms var(--ease-out);
}
.not-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 0 18px;
}
.not-editor-form .field { margin-bottom: 14px; }
.not-editor .check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 14px;
  cursor: pointer;
}
.not-editor .check-row input { width: 15px; height: 15px; accent-color: var(--pri); }
.not-body-input { min-height: 190px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; }
.not-help { line-height: 1.5; }
.not-preview-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--txt-faint);
  margin: 4px 0 8px;
}
/* The rendered block, dressed like the branded closing page in miniature. */
.not-preview {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow-xs);
  padding: 16px 18px 18px;
  min-height: 190px;
  max-height: 420px;
  overflow: auto;
  --df-accent: var(--acc);
  --df-text: #16181D;
  --df-muted: #5A6472;
  --df-font-ui: var(--font);
}
.not-preview-empty { margin: 0; font-size: 12.5px; color: var(--txt-faint); }
.not-preview .notice-title {
  position: relative;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--txt);
  margin: 0 0 12px;
  padding-bottom: 7px;
}
.not-preview .notice-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 3px;
  background: var(--acc);
}
.not-preview .notice-p, .not-preview .notice-list {
  font-size: 12px;
  line-height: 1.5;
  color: var(--txt-muted);
  margin: 0 0 8px;
}
.not-preview .notice-h { font-size: 12.5px; font-weight: 700; color: var(--txt); margin: 12px 0 5px; }
.not-preview .notice-list { padding-left: 18px; }
.not-preview .notice-list li { margin: 0 0 3px; }
.not-preview .notice-list li::marker { color: var(--acc); }
.not-preview .notice strong { color: var(--txt); }
.not-preview .notice em { font-style: italic; }
.not-preview .notice > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------- brand preview --*/
/* A CSS-only miniature of the branded template. Every length is in "mm" via
   --mm, computed from the mock's own width, so it is faithful at any size. */

.brand-mock {
  container-type: inline-size;
  --bp-primary: var(--pri);
  --bp-accent: var(--acc);
  --bp-fg: #fff;
  --bp-bg: #fff;
  --bp-text: #16181D;
  --bp-muted: #5A6472;
}
.bp-page {
  --mm: calc(100cqw / 216);
  position: relative;
  overflow: hidden;
  background: var(--bp-bg);
  border-radius: 4px;
  box-shadow: 0 0 0 1px var(--border), var(--shadow-md);
}
.bp-cover { aspect-ratio: 216 / 279; }
.bp-mast {
  padding: calc(9 * var(--mm)) calc(27 * var(--mm)) calc(4 * var(--mm));
  min-height: calc(10 * var(--mm));
  text-align: left;
  position: relative;
  z-index: 1;
}
.bp-mast img { height: calc(38 * var(--mm)); max-width: calc(145 * var(--mm)); width: auto; display: block; object-fit: contain; }
.bp-wordmark-text {
  display: block;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--bp-text);
  font-size: clamp(9px, calc(6 * var(--mm)), 20px);
  line-height: 1.1;
  padding: calc(6 * var(--mm)) 0;
}
.bp-rule { height: calc(3 * var(--mm)); background: var(--bp-primary); position: relative; z-index: 1; }
.bp-watermark {
  position: absolute;
  top: calc(56 * var(--mm));
  right: calc(-30 * var(--mm));
  width: calc(195 * var(--mm));
  opacity: .08;
  pointer-events: none;
}
.bp-ident {
  position: absolute;
  left: calc(27 * var(--mm));
  right: calc(25 * var(--mm));
  bottom: calc(71 * var(--mm));
  padding: calc(1.5 * var(--mm)) 0;
}
.bp-ident::before {
  content: '';
  position: absolute;
  left: calc(-27 * var(--mm));
  top: 0;
  bottom: 0;
  width: calc(22 * var(--mm));
  background: var(--bp-accent);
}
.bp-org {
  margin: 0 0 calc(2 * var(--mm));
  font-weight: 700;
  color: var(--bp-text);
  font-size: clamp(7px, calc(3.5 * var(--mm)), 12px);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bp-line { height: calc(1.6 * var(--mm)); border-radius: 999px; background: var(--bp-muted); opacity: .45; margin: calc(1.6 * var(--mm)) 0; }
.bp-line.w1 { width: 34%; }
.bp-line.w2 { width: 28%; }
.bp-line.w3 { width: 40%; }
.bp-conf {
  margin: calc(3 * var(--mm)) 0 0;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--bp-accent);
  font-size: clamp(6px, calc(2.6 * var(--mm)), 10px);
}
.bp-band { position: absolute; left: 0; right: 0; bottom: 0; height: calc(46 * var(--mm)); background: var(--bp-primary); }
.bp-title {
  margin: 0;
  padding: calc(18 * var(--mm)) calc(26 * var(--mm)) 0;
  text-align: center;
  font-weight: 700;
  line-height: 1.3;
  color: var(--bp-fg);
  font-size: clamp(9px, calc(5.6 * var(--mm)), 20px);
}
/* Body-page strip: the top of a page (header + first lines), a torn fold,
   the foot of a page (last lines + footer band). */
.bp-strip { margin-top: 12px; }
.bp-slice { position: relative; overflow: hidden; background: var(--bp-bg); }
.bp-slice-top { height: calc(48 * var(--mm)); border-radius: 4px 4px 0 0; }
.bp-slice-bottom { height: calc(30 * var(--mm)); border-radius: 0 0 4px 4px; }
.bp-fold {
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 12px) center / 100% 1px no-repeat;
}
.bp-header {
  position: absolute;
  top: 0;
  left: calc(30 * var(--mm));
  right: calc(30 * var(--mm));
  height: calc(14 * var(--mm));
  border-bottom: max(1px, calc(.3 * var(--mm))) solid var(--bp-primary);
}
.bp-header .bp-mark { position: absolute; left: 0; top: 0; height: calc(9 * var(--mm)); width: auto; }
.bp-header .bp-mark.solo { height: calc(11 * var(--mm)); }
.bp-header .bp-word { position: absolute; right: 0; top: calc(1 * var(--mm)); height: calc(7 * var(--mm)); width: auto; }
.bp-body { position: absolute; left: calc(30 * var(--mm)); right: calc(30 * var(--mm)); top: calc(32 * var(--mm)); }
.bp-slice-bottom .bp-body { top: calc(3 * var(--mm)); }
.bp-body .bp-line { background: var(--bp-text); opacity: .22; height: calc(1.5 * var(--mm)); margin: calc(2.2 * var(--mm)) 0; }
.bp-foot {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(12 * var(--mm));
  background: var(--bp-accent);
  color: var(--bp-fg);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: calc(4 * var(--mm));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: clamp(7px, calc(3 * var(--mm)), 11px);
}
.bp-caption { padding: 12px 2px 0; font-size: 12px; color: var(--txt-muted); line-height: 1.5; }
.bp-caption strong { color: var(--txt-2); font-weight: 600; }
.brand-mock.is-mini { max-width: 260px; margin: 6px 0 4px; }
/* Wide screens have the sticky column; the editor's own mini mock only
   appears once that column has collapsed. */
.pal-editor .brand-mock { display: none; }

/* ------------------------------------------------------------ responsive --*/

@media (max-width: 1100px) {
  .kit-grid { grid-template-columns: minmax(0, 1fr); }
  .kit-aside { position: static; max-height: none; overflow: visible; }
  .pal-editor .brand-mock { display: block; }
}
@media (max-width: 780px) {
  .hero.kit-hero { grid-template-columns: 1fr; padding: 24px 22px; }
  .kit-hero-card { max-width: 380px; }
  .kit-hero h1 { font-size: 26px; }
}
@media (max-width: 900px) {
  .not-editor-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .pal-editor-grid { grid-template-columns: 1fr; }
  .logo-grid, .pal-grid, .not-grid { grid-template-columns: 1fr; }
}
