/* IRPA Loft Manager — pedigree certificate layout (horizontal) */
@font-face {
  font-family: 'Great Vibes';
  src: url('/assets/fonts/GreatVibes-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
.loft-ped-wrap { overflow-x: auto; padding: 0.5rem 0; }
/* Subject LEFT → ancestors expand RIGHT */
.loft-ped-chart {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  min-width: min(100%, 960px);
  direction: ltr;
  text-align: left;
}
.loft-ped-col {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  flex: 1;
  min-width: 140px;
  position: relative;
}
.loft-ped-col:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0;
  top: 8%;
  bottom: 8%;
  width: 1px;
  background: rgba(255,255,255,0.08);
}
.loft-ped-col-gen0 { flex: 1.2; min-width: 160px; }
.loft-ped-import-view {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}
.loft-ped-import-view img {
  max-width: 100%;
  height: auto;
  border: 1px solid #ddd;
}
.loft-ped-import-view iframe,
.loft-ped-import-view embed {
  width: 100%;
  min-height: 480px;
  border: 1px solid #ddd;
}
.loft-ped-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  direction: rtl;
}
.loft-ped-tab {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,0.1);
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
}
.loft-ped-tab.active {
  background: rgba(212,166,58,0.15);
  border-color: rgba(212,166,58,0.4);
  color: #fcd34d;
}
.loft-ped-cell {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 4px;
  min-height: 72px;
}
.loft-ped-box {
  width: 100%;
  border: 1px solid rgba(180, 50, 50, 0.45);
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
  font-size: 9px;
  line-height: 1.35;
  overflow: hidden;
}
.loft-ped-box-empty {
  border-style: dashed;
  border-color: #ccc;
  background: #fafafa;
  min-height: 64px;
  opacity: 0.5;
}
.loft-ped-box-head {
  background: linear-gradient(180deg, #8b2332, #6b1a28);
  color: #fff;
  padding: 4px 6px;
  font-weight: 700;
  font-size: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: monospace;
}
.loft-ped-box-body {
  padding: 5px 6px;
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
}
.loft-ped-box-name {
  font-weight: 800;
  font-size: 9px;
  margin-bottom: 3px;
  text-transform: uppercase;
}
.loft-ped-box-extra {
  color: #444;
  font-size: 8px;
  margin-bottom: 3px;
}
.loft-ped-box-ach {
  list-style: disc;
  margin: 0;
  padding-right: 12px;
  padding-left: 12px;
  color: #333;
  font-size: 7.5px;
}
.loft-ped-subject-head {
  text-align: center;
  margin-bottom: 1rem;
  direction: rtl;
}
.loft-ped-subject-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f5f5f7;
}
.loft-ped-subject-head .ring {
  font-family: monospace;
  color: #d4a63a;
  font-size: 1.1rem;
}

/* ── Compuclub / Thoné Belgian classic pedigree ── */
.cc-ped-page {
  background: #fff;
  color: #000;
  font-family: Arial, Helvetica, sans-serif;
  width: 1123px;
  max-width: 100%;
  height: 980px;
  max-height: 980px;
  min-height: 980px;
  --cc-ped-header-h: 96px;
  --cc-ped-logo-size: 200px;
  --cc-ped-logo-col: 220px;
  margin: 0 auto;
  padding: 14px 18px 12px;
  box-sizing: border-box;
  direction: ltr;
  text-align: left;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid #111;
  box-shadow: inset 0 0 0 1px #666;
}

.cc-ped-page.cc-ped-heights-expanded {
  overflow: visible;
}

.cc-ped-frame {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  border: 1px solid #bbb;
  padding: 8px 10px 8px;
  box-sizing: border-box;
}

.cc-ped-header {
  position: relative;
  flex: 0 0 auto;
  height: var(--cc-ped-header-h, 96px);
  min-height: var(--cc-ped-header-h, 96px);
  max-height: var(--cc-ped-header-h, 96px);
  margin-bottom: 2px;
  display: grid;
  grid-template-columns: 1fr minmax(140px, 220px);
  gap: 10px;
  align-items: center;
  padding-bottom: 2px;
  overflow: visible;
  z-index: 4;
}
.cc-ped-header:not(.cc-ped-header-no-logo) {
  padding-left: var(--cc-ped-logo-col, 220px);
}
.cc-ped-header-no-logo {
  grid-template-columns: 1fr minmax(140px, 220px);
  padding-left: 0;
}
.cc-ped-header-no-logo .cc-ped-header-center { grid-column: 1; }
.cc-ped-header-no-logo .cc-ped-header-meta { grid-column: 2; }
.cc-ped-header-logo {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--cc-ped-logo-size, 200px);
  height: var(--cc-ped-logo-size, 200px);
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  flex-shrink: 0;
  pointer-events: none;
}
.cc-ped-header-logo-img {
  width: var(--cc-ped-logo-size, 200px);
  height: var(--cc-ped-logo-size, 200px);
  object-fit: contain;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: #fff;
  padding: 6px;
  box-sizing: border-box;
  image-rendering: auto;
}

.cc-ped-header-center {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cc-ped-header-meta {
  font-size: 8.5px;
  line-height: 1.28;
  color: #222;
  text-align: left;
  padding: 2px 0 0 6px;
  border-left: 1px solid #ddd;
  max-height: calc(var(--cc-ped-header-h, 96px) - 8px);
  overflow: hidden;
}
.cc-ped-meta-row { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-ped-meta-l { color: #666; font-weight: 600; }
.cc-ped-meta-v { color: #111; font-weight: 700; }

.cc-ped-title {
  font-weight: 700;
  font-size: 16px;
  color: #000;
  margin: 0;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.cc-ped-title-ring {
  font-size: 21px;
  font-weight: 800;
  color: #cc0000;
  letter-spacing: 0.02em;
}
.cc-ped-title-center {
  text-align: center;
  width: 100%;
  padding: 8px 8px 2px;
  box-sizing: border-box;
}
.cc-ped-title-nl { font-size: 17px; }
.cc-ped-title-nl .cc-ped-title-ring { font-size: 22px; }
.cc-ped-header-no-logo .cc-ped-title-center { padding-left: 8px; padding-right: 8px; }

.cc-ped-body {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  overflow: visible;
  transform-origin: top center;
  z-index: 1;
}

.cc-ped-chart-wrap,
.pedigree-container {
  width: 100%;
  height: var(--cc-ped-chart-h, 700px);
  max-height: var(--cc-ped-chart-h, 700px);
  margin: 0 auto;
  direction: ltr;
  box-sizing: border-box;
  overflow: visible;
  padding: 0 2px 5px 4px;
}
.cc-ped-chart-wrap.cc-ped-chart-expanded,
.pedigree-container.cc-ped-chart-expanded {
  overflow: visible;
}

.cc-ped-table {
  table-layout: fixed;
  width: 100%;
  height: var(--cc-ped-chart-h, 700px);
  max-height: var(--cc-ped-chart-h, 700px);
  border-collapse: collapse;
  border-spacing: 0;
  box-sizing: border-box;
}
.cc-ped-table.cc-ped-table-expanded {
  overflow: visible;
}
.cc-ped-slot.cc-ped-slot-expanded {
  overflow: visible !important;
  z-index: 2;
}
.cc-ped-box.cc-ped-box-expanded {
  position: relative;
  z-index: 2;
}
.cc-ped-table tr.cc-ped-row {
  height: var(--cc-ped-row-h, 87px);
  max-height: var(--cc-ped-row-h, 87px);
}
.cc-ped-slot {
  padding: 1px 5px;
  vertical-align: middle;
  overflow: hidden;
  box-sizing: border-box;
}
.cc-ped-slot[data-gen="0"] {
  vertical-align: middle;
  padding: 4px 8px;
}
.cc-ped-slot[data-gen="1"] {
  padding: 12px 8px;
}
.cc-ped-slot[data-gen="2"] {
  padding: 8px 6px;
}
.cc-ped-slot[data-gen="3"],
.cc-ped-slot[data-gen="4"],
.cc-ped-slot[data-gen="5"] {
  padding: 5px 5px;
}
.cc-ped-slot[data-gen="0"] .cc-ped-box {
  height: var(--cc-ped-subject-h, 356px) !important;
  max-height: var(--cc-ped-subject-h, 356px) !important;
  min-height: 0 !important;
  flex: 0 0 auto;
}
.cc-ped-slot .cc-ped-box {
  width: 100%;
  min-height: 0;
  overflow: hidden !important;
}

.cc-ped-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
  overflow: visible;
}

/* Compuclub card — white, black border, heavy offset shadow */
.cc-ped-box,
.pedigree-card {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 5px 6px 4px;
  box-sizing: border-box;
  background: #fff;
  color: #111;
  border: 1px solid #000;
  border-radius: 3px;
  box-shadow: 4px 4px 0 0 #000;
  overflow: hidden !important;
  position: relative;
  z-index: 2;
  max-width: 100%;
}
.cc-ped-box-empty {
  min-height: 18px;
  border: 1px dashed #bbb;
  box-shadow: none;
  opacity: 0.2;
  background: #fafafa;
}

.cc-ped-box-ringline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
  margin: 0 0 4px;
  padding: 0 0 4px;
  border-bottom: 1px solid #aaa;
  line-height: 1.1;
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
  max-width: 100%;
}
.cc-ped-ring {
  flex: 1;
  min-width: 0;
  color: #cc0000;
  font-weight: 700;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 10px;
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cc-ped-sex {
  flex-shrink: 0;
  font-weight: 700;
  font-size: 10px;
  font-family: Arial, Helvetica, sans-serif;
  color: #cc0000;
  line-height: 1;
}
.cc-ped-sex-m { color: #cc0000; }
.cc-ped-sex-f { color: #cc0000; }

.cc-ped-box-name {
  font-family: Arial, Helvetica, sans-serif;
  font-weight: 700;
  font-size: 10px;
  color: #000;
  margin: 0 0 5px;
  padding-bottom: 1px;
  line-height: 1.2;
  flex: 0 0 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-height: 1.2em;
  max-width: 100%;
}

.cc-ped-ach-line {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.cc-ped-box-details,
.cc-ped-box-details-edit {
  margin: 2px 0 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 8.5px;
  color: #111;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.14;
  background: transparent;
  border: none;
  flex: 1 1 auto;
  min-height: 0;
  max-width: 100%;
  overflow: hidden !important;
  -webkit-font-smoothing: antialiased;
}

.cc-ped-editing .cc-ped-box-details-edit {
  overflow-y: auto;
  min-height: 0;
  max-height: 100%;
}

.cc-ped-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: 2px;
  padding-top: 4px;
  min-height: 120px;
  color: #000;
  direction: ltr;
}

.cc-ped-footer-signature {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 64%;
  min-height: 108px;
  padding: 4px 8px 4px 0;
}

.cc-ped-signature {
  display: flex;
  flex-direction: column;
  gap: 4px;
  line-height: 1.25;
}
.cc-ped-sig-placeholder {
  font-size: 11px;
  color: #999;
  font-style: italic;
  font-family: 'Source Sans 3', Arial, sans-serif;
  padding-top: 28px;
  border-top: 1px dashed #ccc;
  margin-top: 8px;
}
.cc-ped-sig-name {
  font-family: 'Great Vibes', 'Segoe Script', 'Brush Script MT', cursive;
  font-size: 38px;
  font-weight: 400;
  color: #111;
  line-height: 1.05;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.cc-ped-sig-name-img {
  height: 38px;
  width: auto !important;
  max-width: none !important;
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}
.cc-ped-sig-phone {
  font-family: 'Source Sans 3', Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #111;
  letter-spacing: 0.02em;
}
.cc-ped-sig-addr {
  font-family: 'Source Sans 3', Arial, Helvetica, sans-serif;
  font-size: 16px;
  color: #222;
  line-height: 1.28;
}
.cc-ped-sig-web {
  font-family: 'Source Sans 3', Arial, Helvetica, sans-serif;
  font-size: 16px;
  color: #333;
  direction: ltr;
  unicode-bidi: embed;
}

.cc-ped-footer-meta {
  font-size: 8.5px;
  color: #555;
  text-align: right;
  font-family: Arial, Helvetica, sans-serif;
  white-space: nowrap;
}

.cc-ped-page {
  --cc-ped-font-base: 9px;
}

.cc-ped-box-g0 .cc-ped-ring { font-size: calc(var(--cc-ped-font-base) * 1.22); }
.cc-ped-box-g0 .cc-ped-sex { font-size: calc(var(--cc-ped-font-base) * 1.22); }
.cc-ped-box-g0 .cc-ped-box-name { font-size: calc(var(--cc-ped-font-base) * 1.22); }
.cc-ped-box-g0 .cc-ped-box-details { font-size: var(--cc-ped-font-base); line-height: 1.14; }

.cc-ped-box-g1 .cc-ped-ring { font-size: calc(var(--cc-ped-font-base) * 1.11); }
.cc-ped-box-g1 .cc-ped-sex { font-size: calc(var(--cc-ped-font-base) * 1.11); }
.cc-ped-box-g1 .cc-ped-box-name { font-size: calc(var(--cc-ped-font-base) * 1.11); }
.cc-ped-box-g1 .cc-ped-box-details { font-size: calc(var(--cc-ped-font-base) * 0.944); line-height: 1.13; }

.cc-ped-box-g2 .cc-ped-ring { font-size: var(--cc-ped-font-base); }
.cc-ped-box-g2 .cc-ped-sex { font-size: var(--cc-ped-font-base); }
.cc-ped-box-g2 .cc-ped-box-name { font-size: var(--cc-ped-font-base); }
.cc-ped-box-g2 .cc-ped-box-details { font-size: calc(var(--cc-ped-font-base) * 0.889); line-height: 1.12; }

.cc-ped-box-g3 .cc-ped-ring { font-size: calc(var(--cc-ped-font-base) * 0.889); }
.cc-ped-box-g3 .cc-ped-sex { font-size: calc(var(--cc-ped-font-base) * 0.889); }
.cc-ped-box-g3 .cc-ped-box-name { font-size: calc(var(--cc-ped-font-base) * 0.889); }
.cc-ped-box-g3 .cc-ped-box-details { font-size: calc(var(--cc-ped-font-base) * 0.833); line-height: 1.11; }

/* Last generation — compact Compuclub */
.cc-ped-box-last {
  padding: 3px 5px 2px;
  box-shadow: 2px 2px 0 0 #000;
  border-radius: 2px;
}
.cc-ped-box-last .cc-ped-box-ringline { margin-bottom: 1px; padding-bottom: 2px; }
.cc-ped-box-last .cc-ped-ring { font-size: calc(var(--cc-ped-font-base) * 0.833); }
.cc-ped-box-last .cc-ped-sex { font-size: calc(var(--cc-ped-font-base) * 0.833); }
.cc-ped-box-last .cc-ped-box-name {
  font-size: calc(var(--cc-ped-font-base) * 0.833);
  margin-bottom: 1px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cc-ped-box-last .cc-ped-box-details {
  font-size: calc(var(--cc-ped-font-base) * 0.778);
  line-height: 1.1;
}

.cc-ped-box-g4 .cc-ped-ring { font-size: calc(var(--cc-ped-font-base) * 0.778); }
.cc-ped-box-g4 .cc-ped-box-name { font-size: calc(var(--cc-ped-font-base) * 0.778); }
.cc-ped-box-g4 .cc-ped-box-details { font-size: calc(var(--cc-ped-font-base) * 0.722); }
.cc-ped-box-g4 { padding: 2px 4px; box-shadow: 2px 2px 0 0 #000; }

body.loft-ped-pdf-mode .cc-ped-page,
.cc-ped-page.loft-ped-exporting {
  width: 1123px;
  max-width: 1123px;
  height: 980px;
  max-height: 980px;
  min-height: 980px;
  --cc-ped-header-h: 96px;
  --cc-ped-logo-size: 200px;
  --cc-ped-logo-col: 220px;
  overflow: hidden;
  margin: 0 auto;
  padding: 14px 18px 12px;
  box-sizing: border-box;
}
body.loft-ped-pdf-mode .cc-ped-body,
.loft-ped-exporting .cc-ped-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
body.loft-ped-pdf-mode .cc-ped-chart-wrap,
.loft-ped-exporting .cc-ped-chart-wrap {
  height: var(--cc-ped-chart-h, 780px);
  max-height: var(--cc-ped-chart-h, 780px);
  padding-left: 6px;
}
body.loft-ped-pdf-mode .cc-ped-box-details,
.loft-ped-exporting .cc-ped-box-details,
body.loft-ped-pdf-mode .cc-ped-box-details-edit,
.loft-ped-exporting .cc-ped-box-details-edit {
  overflow: hidden !important;
}
body.loft-ped-pdf-mode .cc-ped-page,
.cc-ped-page.loft-ped-exporting {
  transform: none !important;
  zoom: 1 !important;
}
body.loft-ped-pdf-mode .cc-ped-footer-signature,
.loft-ped-exporting .cc-ped-footer-signature {
  flex: 0 1 auto;
  max-width: 52%;
  overflow: hidden;
}
body.loft-ped-pdf-mode .cc-ped-box-details,
.loft-ped-exporting .cc-ped-box-details,
body.loft-ped-pdf-mode .cc-ped-ach-line,
.loft-ped-exporting .cc-ped-ach-line,
body.loft-ped-pdf-mode .cc-ped-box-name,
.loft-ped-exporting .cc-ped-box-name,
body.loft-ped-pdf-mode .cc-ped-ring,
.loft-ped-exporting .cc-ped-ring {
  font-family: Arial, Helvetica, sans-serif !important;
  -webkit-font-smoothing: antialiased !important;
  text-rendering: geometricPrecision;
}
body.loft-ped-pdf-mode .cc-ped-ach-line,
.loft-ped-exporting .cc-ped-ach-line {
  display: block !important;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#loft-ped-export-mount {
  left: 0 !important;
  top: 0 !important;
}

@media print {
  @page {
    size: 297mm 210mm landscape;
    margin: 5mm;
  }
  body * { visibility: hidden; }
  body { background: #fff !important; }
  #loft-ped-print-root, #loft-ped-print-root * { visibility: visible; }
  #loft-ped-print-root {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
  }
  .cc-ped-page {
    width: 287mm;
    max-width: 287mm;
    height: 200mm;
    max-height: 200mm;
    overflow: hidden;
    page-break-inside: avoid;
    break-inside: avoid;
    box-sizing: border-box;
  }
  .cc-ped-box-details,
  .cc-ped-box-details-edit {
    overflow: hidden !important;
  }
  header:not(.cc-ped-header), body > footer, .loft-no-print { display: none !important; }
  .cc-ped-page .cc-ped-header,
  .cc-ped-page .cc-ped-footer { display: flex !important; visibility: visible !important; }
}

.loft-dl-section {
  font-size: 10px;
  color: #9ca3af;
  padding: 4px 12px 2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cc-ped-box-empty.cc-ped-box-editable {
  opacity: 1;
  border-style: dashed;
  border-color: #bbb;
  background: #fafafa;
  min-height: 48px;
}
.cc-ped-placeholder {
  color: #999 !important;
  font-style: italic;
  font-weight: 400 !important;
}
.cc-ped-box-editable:focus-within .cc-ped-placeholder,
.cc-ped-box-editable [contenteditable]:focus { color: #111 !important; font-style: normal; }

.loft-ped-logo-upload { margin-bottom: 0.5rem; }
.loft-ped-logo-preview {
  display: block;
  max-height: 56px;
  max-width: 100%;
  object-fit: contain;
  margin-bottom: 0.5rem;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
}

.cc-ped-ach-line {
  display: block;
  line-height: 1.12;
}
.cc-ped-ach-gold {
  color: #8b6914;
  font-weight: 700;
}
.cc-ped-box-colored-fill .cc-ped-ring { color: #cc0000; }
.cc-ped-box-colored-fill .cc-ped-sex { color: #cc0000; }
.cc-ped-box-colored-fill .cc-ped-box-name { color: #000; }
.cc-ped-box-colored-fill .cc-ped-box-details { color: #111; }
.cc-ped-box-colored-fill .cc-ped-ach-gold { color: #8b6914; }
.cc-ped-box-dark-fill .cc-ped-ring { color: #ffb4b4; }
.cc-ped-box-dark-fill .cc-ped-sex { color: #ffb4b4; }
.cc-ped-box-dark-fill .cc-ped-box-name { color: #fff; }
.cc-ped-box-dark-fill .cc-ped-box-details { color: #f0f0f0; }
.cc-ped-box-dark-fill .cc-ped-ach-gold { color: #ffd700; }

.cc-ped-footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 88px;
}
.cc-ped-footer-qr-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.cc-ped-footer-qr canvas,
.cc-ped-footer-qr img {
  display: block;
  width: 72px !important;
  height: 72px !important;
}
.cc-ped-qr-placeholder {
  width: 72px;
  height: 72px;
  border: 1px dashed #bbb;
  background: #fafafa;
  box-sizing: border-box;
}
.cc-ped-qr-label {
  font-size: 7.5px;
  color: #666;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Sidebar layout */
.loft-ped-layout {
  display: flex;
  flex-direction: row-reverse;
  gap: 1rem;
  align-items: flex-start;
}
.loft-ped-main-area { flex: 1; min-width: 0; }
.loft-ped-sidebar {
  flex: 0 0 220px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 1rem;
  position: sticky;
  top: 1rem;
}
.loft-ped-sidebar-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fbbf24;
  margin: 0 0 0.75rem;
}
.loft-ped-sidebar-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: #d4d4d8;
  margin-bottom: 0.5rem;
  cursor: pointer;
}
.loft-ped-sidebar-hint {
  font-size: 0.72rem;
  color: #71717a;
  margin: 0.75rem 0 0;
  line-height: 1.45;
}
.loft-ped-sidebar-label {
  display: block;
  font-size: 0.78rem;
  color: #a1a1aa;
  margin-bottom: 0.35rem;
}
.loft-ped-font-row { margin-bottom: 0.75rem; }
.loft-ped-font-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.loft-ped-font-slider {
  flex: 1;
  accent-color: #fbbf24;
  cursor: pointer;
}
.loft-ped-font-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  min-width: 1.4rem;
  text-align: center;
}
.loft-ped-color-mode-row { margin-bottom: 0.35rem; }
.loft-ped-color-mode-btns {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}
.loft-ped-mode-opt {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.78rem;
  color: #d4d4d8;
  cursor: pointer;
}
.loft-ped-sidebar-editing {
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15);
}
.loft-ped-status { color: #a1a1aa; min-height: 1.25rem; }
.loft-ped-status-ok { color: #34d399; }
.loft-ped-status-err { color: #f87171; }
.loft-ped-status-pending { color: #fbbf24; }

/* Inline editor */
.cc-ped-editing .cc-ped-box-editable {
  position: relative;
  cursor: text;
  outline: 1px dashed rgba(251, 191, 36, 0.45);
  outline-offset: 1px;
  padding-bottom: 14px;
}
.cc-ped-box-editable [contenteditable]:focus {
  outline: 2px solid rgba(251, 191, 36, 0.7);
  border-radius: 2px;
}
.cc-ped-color-strip {
  position: absolute;
  bottom: 1px;
  left: 2px;
  right: 2px;
  z-index: 6;
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  justify-content: flex-start;
  pointer-events: auto;
}
.cc-ped-color-strip .cc-ped-color-swatch {
  width: 11px;
  height: 11px;
  min-width: 11px;
  border: 1px solid rgba(0,0,0,0.25);
  border-radius: 2px;
  cursor: pointer;
  font-size: 9px;
  line-height: 9px;
  text-align: center;
  padding: 0;
  flex: 0 0 auto;
}
.cc-ped-color-strip .cc-ped-color-swatch.active {
  outline: 2px solid #1e3a5f;
  outline-offset: 1px;
}
.cc-ped-color-strip .cc-ped-color-clear {
  background: #fff;
  color: #666;
  font-weight: 700;
}
.cc-ped-color-pop {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  min-width: 140px;
}
.cc-ped-color-modes {
  display: flex;
  gap: 4px;
  margin-bottom: 6px;
}
.cc-ped-color-modes button {
  flex: 1;
  font-size: 10px;
  padding: 3px 4px;
  border: 1px solid #ddd;
  background: #f9f9f9;
  border-radius: 4px;
  cursor: pointer;
}
.cc-ped-color-modes button.active {
  background: #1e3a5f;
  color: #fff;
  border-color: #1e3a5f;
}
.cc-ped-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cc-ped-color-swatch {
  width: 22px;
  height: 22px;
  border: 1px solid #999;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  padding: 0;
}
.cc-ped-ac-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  background: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  max-height: 160px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.cc-ped-ac-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 4px 8px;
  border: none;
  background: #fff;
  cursor: pointer;
  font-size: 10px;
}
.cc-ped-ac-item:hover { background: #fef9c3; }
.cc-ped-ac-ring { color: #c00; font-weight: 700; margin-right: 6px; }

body:has(.cc-ped-page) main.max-w-\[1400px\] { max-width: 1400px; }

@media (max-width: 900px) {
  .loft-ped-layout { flex-direction: column; }
  .loft-ped-sidebar { flex: none; width: 100%; position: static; }
}

@media print {
  .loft-ped-sidebar, .cc-ped-color-btn, .cc-ped-color-strip, .cc-ped-ac-menu, .cc-ped-color-pop { display: none !important; }
  .cc-ped-editing .cc-ped-box-editable { outline: none !important; }
}

body:has(.cc-ped-page) main.max-w-\[1280px\] { max-width: 1240px; }

.loft-ac-wrap { position: relative; }
.loft-ac-list {
  position: absolute;
  z-index: 40;
  top: 100%;
  left: 0;
  right: 0;
  background: #18181b;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 0.75rem;
  max-height: 200px;
  overflow-y: auto;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}
.loft-ac-item {
  display: block;
  width: 100%;
  text-align: right;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  border: none;
  background: transparent;
  color: #f5f5f7;
  cursor: pointer;
}
.loft-ac-item:hover { background: rgba(212,166,58,0.15); }

.loft-import-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.75);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
}
.loft-import-modal {
  background: #18181b;
  border: 1px solid rgba(212,166,58,0.25);
  border-radius: 1rem;
  max-width: 720px;
  width: 100%;
  padding: 1.25rem;
  direction: rtl;
}
.loft-import-head h3 { font-weight: 700; color: #fcd34d; margin-bottom: 0.5rem; }
.loft-import-gen-label {
  font-size: 11px;
  color: #d4a63a;
  margin: 0.75rem 0 0.35rem;
  font-weight: 600;
}
.loft-import-slot {
  display: grid;
  grid-template-columns: 72px 1fr 1fr 56px;
  gap: 6px;
  margin-bottom: 6px;
  align-items: start;
}
.loft-import-slot textarea { grid-column: 2 / -1; }
.loft-import-role {
  font-size: 10px;
  color: #9ca3af;
  padding-top: 8px;
}
.loft-import-slots { max-height: 55vh; overflow-y: auto; margin: 1rem 0; }
.loft-import-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .loft-import-slot { grid-template-columns: 1fr 1fr; }
  .loft-import-role { grid-column: 1 / -1; }
}
