:root {
  --pink: #d50073;
  --pink2: #a9005f;
  --navy: #111b2a;
  --ink: #101827;
}

/* Header: keep the logo level and reserve a clear title area. */
.report-hero {
  background: linear-gradient(112deg, #d80078 0%, #c00069 48%, #a7005c 100%);
}

.hero-copy {
  right: 8mm;
  left: 100mm;
  top: 7mm;
  text-align: center;
  z-index: 2;
}

.hero-copy h2 {
  margin: 0 0 1.8mm;
  color: #fff;
  font-size: 25px;
  line-height: 1.25;
  font-weight: 900;
  text-shadow: 0 1px 1px #63003755;
  white-space: nowrap;
}

.hero-copy p {
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 800;
  white-space: nowrap;
}

.logo-bubble {
  left: -3mm;
  top: -24mm;
  width: 94mm;
  height: 62mm;
  padding-bottom: 10mm;
  border-bottom: 2.2mm solid var(--pink);
  transform: none;
}

.logo {
  gap: 2mm;
  transform: none;
}

.logo-symbol {
  width: 33px;
  gap: 3px;
}

.logo-symbol i {
  height: 8px;
  background: linear-gradient(90deg, #b50063, #df087d);
}

.logo b {
  color: var(--navy);
  font-size: 31px;
  line-height: 1;
  letter-spacing: -1.5px;
  transform: none;
}

.logo-bubble small {
  margin-top: 1.5mm;
  color: #c00069;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: .65px;
  transform: none;
}

/* Stronger, clearer typography across the A4 form. */
.client-col p {
  color: #121a26;
  font-size: 9.4px;
  line-height: 1.35;
}

.client-col p > b {
  font-weight: 900;
}

.client-col p > span:not(.platform-icons) {
  font-size: 9px;
  color: #101827;
}

.ribbon,
.block-title {
  background: linear-gradient(100deg, #d70076, #aa005e);
  box-shadow: none;
}

.ribbon {
  font-size: 11px;
  line-height: 1.2;
}

.block-title {
  font-size: 10.5px;
  font-weight: 900;
}

th {
  color: #fff;
  background: linear-gradient(180deg, #db087a, #c00069);
  font-size: 8.3px;
  line-height: 1.25;
  font-weight: 900;
}

th.dark {
  background: linear-gradient(180deg, #172436, #0e1826);
}

td {
  color: #17202d;
  font-size: 8.5px;
  line-height: 1.25;
  font-weight: 600;
  background: #fff;
}

td:first-child {
  font-size: 8.7px;
  font-weight: 800;
}

.overview-block th {
  font-size: 8.5px;
}

.overview-block td {
  height: 6.55mm;
  font-size: 8.5px;
}

.overview-block td:first-child {
  font-size: 8.8px;
}

.small-block th {
  font-size: 7px;
  line-height: 1.15;
}

.small-block td {
  font-size: 7.2px;
  line-height: 1.2;
}

.small-block td:first-child {
  font-size: 7.4px;
  font-weight: 800;
}

.content-side h3 {
  font-size: 8.5px;
  font-weight: 900;
}

.content-side th {
  color: #121a26;
  font-size: 6.3px;
  font-weight: 900;
  background: #fff;
}

.content-side td {
  font-size: 6.6px;
  font-weight: 700;
}

.summary-grid > div {
  color: #242b36;
  font-size: 8px;
  line-height: 1.3;
}

.summary-grid b {
  color: #b00061;
  font-weight: 900;
}

.summary-grid span {
  font-weight: 700;
}

.positive { color: #008b61; }
.negative { color: #bf2944; }

.two-blocks { direction: ltr; }
.two-blocks .small-block { direction: rtl; }

/* Editor readability. */
.editor-title h1 { color: #111827; font-weight: 900; }
.editor-title span { color: #bd0067; }
summary { color: #171f2d; }
.fields label > span,
.cell-editor label > span,
.content-input label > span { color: #555e6e; }

/* Right-side form panel: keep every column inside its card. */
.editor {
  padding: 18px;
  background: #fbfbfd;
}

.editor-title {
  margin-bottom: 16px;
  padding: 15px 16px;
  border: 1px solid #f0cade;
  border-radius: 16px;
  background: linear-gradient(125deg, #ffffff 0%, #ffffff 58%, #fff0f7 100%);
  box-shadow: 0 8px 22px rgba(92, 18, 58, .07);
}

.editor-title h1 {
  margin-top: 5px;
  font-size: 22px;
  line-height: 1.25;
}

.editor-title > b {
  flex: 0 0 auto;
  border: 1px solid #f5c8de;
  background: #fff;
  color: #b60063;
  padding: 7px 10px;
}

.editor details {
  margin-bottom: 13px;
  border: 1px solid #e3e5eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(21, 27, 40, .055);
  overflow: hidden;
}

.editor summary {
  position: relative;
  min-height: 52px;
  padding: 16px 21px 15px 50px;
  display: flex;
  align-items: center;
  color: #131b29;
  background: linear-gradient(90deg, #ffffff 0%, #ffffff 72%, #fff2f8 100%);
  border: 0;
  font-size: 13px;
  font-weight: 900;
}

.editor summary::before {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, #dc087c, #a8005d);
}

.editor summary::after {
  content: "+";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 24px;
  height: 24px;
  margin: 0;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  float: none;
  border-radius: 50%;
  background: #fff0f7;
  color: #bd0067;
  font-size: 16px;
  line-height: 1;
}

.editor details[open] summary {
  border-bottom: 1px solid #eceef2;
}

.editor details[open] summary::after {
  content: "−";
}

.sheet-editor {
  width: 100%;
  padding: 14px 12px 15px;
  overflow: hidden;
}

.editor-head,
.editor-row {
  width: 100%;
  grid-template-columns: minmax(82px, .95fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px;
}

.editor-head {
  margin: 0 0 7px;
  padding: 0 2px;
  color: #8a909c;
  font-size: 8.5px;
  font-weight: 700;
}

.editor-head > *,
.editor-row > * {
  min-width: 0;
}

.editor-row {
  margin-bottom: 8px;
  align-items: stretch;
}

.editor-row:last-child {
  margin-bottom: 0;
}

.editor-row > b {
  padding: 5px 2px;
  display: flex;
  align-items: center;
  color: #202838;
  font-size: 9.5px;
  line-height: 1.35;
  font-weight: 800;
  white-space: normal;
  overflow-wrap: anywhere;
}

.editor-row input {
  display: block;
  width: 100%;
  min-width: 0;
  height: 39px;
  padding: 8px 7px;
  border: 1px solid #d8dbe2;
  border-radius: 9px;
  outline: 0;
  background: #fff;
  color: #151d2b;
  direction: ltr;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.editor-row input:focus {
  border-color: #ce0872;
  box-shadow: 0 0 0 3px rgba(206, 8, 114, .1);
}

.content-editor,
.summary-fields {
  background: #fff;
}

.content-group {
  border-color: #e1e3e8;
  border-radius: 11px;
  background: #fafafd;
}

@media (max-width: 420px) {
  .editor { padding: 12px; }
  .editor-head,
  .editor-row { grid-template-columns: 76px minmax(0, 1fr) minmax(0, 1fr); gap: 5px; }
  .editor-row input { font-size: 11px; padding-inline: 4px; }
}

@media (max-width: 780px) {
  .hero-copy { right: 8mm; left: 100mm; }
}

/* Multi-report toolbar and archive. */
.toolbar {
  min-height: 76px;
  height: auto;
  gap: 16px;
  flex-wrap: wrap;
  padding-block: 12px;
}

.toolbar-actions {
  flex: 1;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.btn {
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:disabled { cursor: wait; opacity: .7; transform: none; }
.btn.secondary { color: #fff; background: #111b2a; }
.btn.share { color: #ae005f; background: #fff0f7; border: 1px solid #f1bfd8; }

.report-library[hidden] { display: none; }
.report-library { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 18px; }
.library-backdrop { position: absolute; inset: 0; width: 100%; border: 0; background: rgba(11, 18, 29, .6); backdrop-filter: blur(4px); }
.library-panel { position: relative; width: min(680px, 100%); max-height: min(720px, 90vh); overflow: auto; border-radius: 22px; background: #fff; box-shadow: 0 28px 80px rgba(7, 12, 22, .3); direction: rtl; }
.library-panel > header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 22px 24px 17px; color: #fff; background: linear-gradient(120deg, #da087a, #a6005b); }
.library-panel header span { font-size: 10px; font-weight: 800; opacity: .8; }
.library-panel h2 { margin: 4px 0 0; font-size: 23px; }
.close-library { width: 38px; height: 38px; border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: #fff; background: rgba(255,255,255,.13); font-size: 25px; cursor: pointer; }
.library-help { margin: 0; padding: 18px 24px 4px; color: #687080; font-size: 12px; }
.saved-reports-list { display: grid; gap: 11px; padding: 16px 24px 26px; }
.saved-report-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 18px; border: 1px solid #e3e5ea; border-radius: 15px; background: #fff; box-shadow: 0 6px 18px rgba(20, 28, 42, .05); }
.saved-report-card.active { border-color: #d20072; box-shadow: 0 0 0 3px rgba(210,0,114,.08); }
.saved-report-card span { color: #bc0067; font-size: 10px; font-weight: 900; }
.saved-report-card h3 { margin: 4px 0; color: #151d2b; font-size: 16px; }
.saved-report-card small { color: #858c98; font-size: 9px; }
.report-card-actions { display: flex; gap: 7px; flex: 0 0 auto; }
.report-card-actions button { border: 0; border-radius: 9px; padding: 9px 12px; font-size: 10px; font-weight: 900; cursor: pointer; }
.open-report { color: #fff; background: #111b2a; }
.delete-report { color: #bd3152; background: #fff0f3; }
.empty-library { display: grid; place-items: center; gap: 7px; min-height: 170px; text-align: center; color: #7b8390; }
.empty-library b { color: #202838; }
.library-open { overflow: hidden; }

/* Cleaner A4 layout after removing the requested rows. */
.overview-block { height: 51mm; }
.overview-block td { height: 6.2mm; }
.small-block { height: 42mm; }
.audience-block table { height: auto; }
.audience-block th { height: 8mm; }
.audience-block td { height: 13mm; }
.notes-block { height: 30mm; }
.notes-panel { height: 100%; padding: 4mm 5mm; color: #202938; background: linear-gradient(135deg, #fff 0%, #fff 72%, #fff6fa 100%); font-size: 8.6px; line-height: 1.8; font-weight: 700; white-space: pre-wrap; overflow: hidden; }
.notes-editor textarea { min-height: 145px; resize: vertical; line-height: 1.7; }

/* Direct PDF export always uses the true A4 size and full brand colors. */
*, *::before, *::after {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

.pdf-exporting body { background: #fff; }
.pdf-exporting .report { width: 210mm !important; height: 297mm !important; margin: 0 !important; transform: none !important; box-shadow: none !important; }

.shared-actions { display: none; }
.shared-mode .toolbar,
.shared-mode .editor,
.shared-mode .preview-note { display: none !important; }
.shared-mode .shared-actions { position: sticky; top: 0; z-index: 60; display: flex; align-items: center; justify-content: space-between; padding: 10px 18px; color: #fff; background: #111b2a; }
.shared-mode .workspace { display: block; min-height: 100vh; }
.shared-mode .preview-area { padding-top: 18px; }

@media (max-width: 780px) {
  .toolbar { align-items: center; }
  .toolbar-actions { width: 100%; }
  .toolbar .saved { display: inline-flex; align-items: center; }
  .toolbar .btn { display: inline-block; padding: 9px 11px; font-size: 10px; }
  .app-brand { width: 100%; }
  .saved-report-card { align-items: flex-start; flex-direction: column; }
  .report-card-actions { width: 100%; }
  .report-card-actions button { flex: 1; }
}

@media print {
  html, body, .workspace, .preview-area, .report { background-color: #fff !important; }
  .report-hero, .ribbon, .block-title, th, th.dark, .content-side h3, .report-footer,
  .logo-symbol i, .mini-mark i { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
