/* ==========================================================================
   Format thumbnail (partials/format_thumb.erb)

   A ~90px sketch of an invoice that reflects the format's actual header
   arrangement, table treatment and palette. Replaces two things: the gallery's
   old `pminv` and the saved-template cards' generic grey bars, which made two
   templates on entirely different formats look identical in the library.

   Renders 500+ times on the gallery, so everything here is cheap: no images,
   no gradients, no per-card stylesheet - just flex and two custom properties.
   ========================================================================== */

.fthumb {
  --fa: #333;
  --ft: var(--line-soft);
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 90px;
  padding: 9px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line-soft);
}

.fthumb-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.fthumb-mark {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--fa);
}

.fthumb-brand {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  padding-top: 2px;
}

.fthumb-brand i {
  height: 3px;
  border-radius: 2px;
  background: #d9dde2;
}

.fthumb-brand i:first-child { width: 62%; }
.fthumb-brand i:last-child { width: 40%; }

.fthumb-word {
  flex: none;
  color: var(--fa);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fthumb-rows {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.fthumb-rows i {
  height: 5px;
  border-radius: 1px;
  background: #eef0f3;
}

.fthumb-foot {
  display: flex;
  justify-content: flex-end;
}

.fthumb-total {
  padding: 1px 6px;
  border-radius: 3px;
  color: #fff;
  background: var(--fa);
  font-size: 7px;
  font-weight: 700;
}

/* --- Header arrangement, sketched ------------------------------------- */

.fthumb[data-fthumb-header="right"] .fthumb-head { flex-direction: row-reverse; }

.fthumb[data-fthumb-header="center"] .fthumb-head,
.fthumb[data-fthumb-header="stacked"] .fthumb-head,
.fthumb[data-fthumb-header="left"] .fthumb-head {
  flex-direction: column;
  gap: 4px;
}

.fthumb[data-fthumb-header="center"] .fthumb-head { align-items: center; }
.fthumb[data-fthumb-header="center"] .fthumb-brand { align-items: center; }

/* `band` is the one arrangement with real chrome: the wordmark reverses out of
   a full-bleed accent bar, so the sketch bleeds past the thumbnail padding. */
.fthumb[data-fthumb-header="band"] .fthumb-head {
  align-items: center;
  margin: -9px -10px 0;
  padding: 5px 10px;
  background: var(--fa);
}

.fthumb[data-fthumb-header="band"] .fthumb-word { color: #fff; }
.fthumb[data-fthumb-header="band"] .fthumb-mark { background: rgba(255, 255, 255, 0.55); }
.fthumb[data-fthumb-header="band"] .fthumb-brand i { background: rgba(255, 255, 255, 0.4); }

/* --- Table treatment, sketched ---------------------------------------- */

.fthumb[data-fthumb-table="filled"] .fthumb-rows i:first-child { background: var(--fa); }
.fthumb[data-fthumb-table="striped"] .fthumb-rows i:nth-child(even) { background: var(--ft); }

.fthumb[data-fthumb-table="bordered"] .fthumb-rows i {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--ft);
}

.fthumb[data-fthumb-table="minimal"] .fthumb-rows i {
  height: 3px;
  background: #f1f3f5;
}

.fthumb[data-fthumb-table="underline"] .fthumb-rows i {
  height: 4px;
  border-radius: 0;
  background: transparent;
  box-shadow: inset 0 -1px 0 var(--ft);
}

/* --- The one lock badge (partials/plan_gate_badge.erb) ----------------- */

.plan-gate-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 7px;
  border-radius: 999px;
  color: #6b4708;
  background: #fdf1d6;
  font-size: 10px;
  font-weight: 760;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* The editor's Format row: what this template is on, and the way out to change
   it. Replaces a 133-card gallery that was squeezed into this 360px column. */
.format-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.format-row-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.format-row-name {
  font-size: 14px;
  line-height: 1.3;
}

.format-row-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
}

.format-row-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  text-transform: capitalize;
}

