:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#e5e7eb;
  --primary:#0ea5e9;
  --primary2:#0284c7;
  --warn:#b91c1c;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
}
*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family:var(--sans);
  overflow-x:hidden;
}
.app{
  max-width:1120px;
  margin:0 auto;
  padding:16px;
}
@media (max-width:900px){ .app{ padding:12px; } }

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:12px 14px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
  margin-bottom:14px;
}
.brand{ display:flex; align-items:center; gap:10px; min-width:220px; }
.brand-logo{ width:54px; height:auto; display:block; }
.brand-title{ font-weight:950; font-size:18px; line-height:1.1; }
.brand-sub{ font-weight:800; font-size:12px; color:var(--muted); margin-top:2px; }
.header-actions{ display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end; }

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:16px;
  padding:14px;
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
  margin-bottom:14px;
}
.card.subtle{ background:#fafafa; }
.card-title{
  font-weight:950;
  margin-bottom:10px;
  font-size:15px;
}
.page{ page-break-after: always; }

.grid-2{ display:grid; grid-template-columns: 1fr 1fr; gap:14px; }
.grid-2.tight{ gap:10px; }
@media (max-width: 900px){ .grid-2{ grid-template-columns:1fr; } }

.lbl{ display:block; font-size:12px; color:var(--muted); font-weight:900; margin:10px 0 6px 2px; }
.inp{
  width:100%;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  font-size:14px;
  outline:none;
  background:#fff;
}
.inp.full{ width:100%; }
.file{ width:100%; }
.muted{ color:var(--muted); }
.small{ font-size:12px; }
.note{ margin-top:6px; }

.row{ display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:10px; }
.pill{
  padding:8px 10px;
  border:1px solid var(--line);
  border-radius:999px;
  background:#fff;
  font-weight:850;
  font-size:12px;
}
.warn{ color:var(--warn); margin-top:8px; font-size:12px; }

.btn{
  border:1px solid var(--line);
  background:#fff;
  padding:9px 12px;
  border-radius:12px;
  font-weight:900;
  cursor:pointer;
}
.btn:hover{ border-color:#cbd5e1; }
.btn:disabled{ opacity:.55; cursor:not-allowed; }
.btn.primary{
  background:var(--primary);
  border-color:var(--primary);
  color:#fff;
}
.btn.primary:hover{ background:var(--primary2); border-color:var(--primary2); }
.btn.ghost{ background:#fff; }

.checks{ margin-top:10px; }
.chk{ display:flex; align-items:center; gap:8px; font-weight:800; font-size:13px; margin:8px 0; }
.chk input{ transform: scale(1.05); }

.logo-row{ display:flex; gap:10px; align-items:center; margin-top:10px; }
.logo-preview{
  width:64px; height:64px;
  border:1px dashed var(--line);
  border-radius:14px;
  padding:6px;
  background:#fff;
  display:block;
  object-fit:contain;
}
.cover{ display:flex; flex-direction:column; align-items:center; text-align:center; padding:18px 12px; }
.cover-logo{ width:120px; height:120px; object-fit:contain; border:1px solid var(--line); border-radius:18px; padding:10px; background:#fff; }
.cover-title{ font-weight:950; font-size:28px; margin-top:12px; }
.cover-sub{ color:var(--muted); font-weight:900; margin-top:6px; }
.cover-meta{ width:100%; max-width:520px; margin-top:18px; border-top:1px solid var(--line); padding-top:12px; }
.cover-row{ display:flex; justify-content:space-between; padding:8px 0; border-bottom:1px dashed var(--line); gap:14px; }
.cover-foot{ margin-top:16px; color:var(--muted); font-size:12px; font-weight:850; }

.snapshot{ display:grid; grid-template-columns: repeat(4, 1fr); gap:10px; margin-top:10px; }
@media (max-width: 900px){ .snapshot{ grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px){ .snapshot{ grid-template-columns: 1fr; } }
.snap{ border:1px solid var(--line); border-radius:14px; padding:10px 12px; background:#fff; }
.snap-label{ color:var(--muted); font-weight:900; font-size:11px; letter-spacing:.4px; }
.snap-value{ font-weight:950; margin-top:4px; }

.subgrid{ display:grid; grid-template-columns: 1.2fr 1fr 1fr; gap:12px; margin-top:12px; }
@media (max-width: 980px){ .subgrid{ grid-template-columns:1fr; } }
.box{ border:1px solid var(--line); border-radius:14px; padding:12px; background:#fff; }
.box-title{ font-weight:950; margin-bottom:8px; }
ul{ margin:8px 0 0 18px; }
li{ margin:7px 0; line-height:1.35; }

.table-block{ margin-top:14px; }
.table-title{ font-weight:950; margin-bottom:8px; }
.tbl{ width:100%; border-collapse:collapse; border:1px solid var(--line); border-radius:14px; overflow:hidden; background:#fff; }
.tbl th, .tbl td{ padding:10px 10px; border-bottom:1px solid var(--line); text-align:left; font-size:13px; }
.tbl th{ background:#f8fafc; font-weight:950; }
.tbl tr:last-child td{ border-bottom:none; }

.mono{ font-family: var(--mono); }
.pre{ white-space:pre-wrap; line-height:1.4; background:#0b1220; color:#e2e8f0; border-radius:14px; padding:12px; border:1px solid #111827; margin-top:10px; }

.modal{ position:fixed; inset:0; display:flex; align-items:center; justify-content:center; background: rgba(15,23,42,.55); padding:16px; }
.modal[aria-hidden="true"]{ display:none; }
.modal-inner{ width:min(760px, 100%); background:#fff; border:1px solid var(--line); border-radius:18px; overflow:hidden; }
.modal-head{ display:flex; justify-content:space-between; align-items:center; padding:12px 14px; border-bottom:1px solid var(--line); }
.modal-title{ font-weight:950; }
.modal-body{ padding:14px; max-height: 70vh; overflow:auto; }
.help-content h2{ margin:0 0 10px 0; font-weight:950; }
.help-content h3{ margin:14px 0 8px 0; font-weight:950; }
.help-content li{ margin:7px 0; }

.toast{ position:fixed; left:50%; bottom:18px; transform:translateX(-50%); padding:10px 12px; background:#0b1220; color:#fff; border-radius:12px; border:1px solid #111827; box-shadow: 0 10px 30px rgba(0,0,0,.18); }
.toast[aria-hidden="true"]{ display:none; }

.print-only{ display:none; }
@media print{
  body{ background:#fff; }
  .app{ max-width:none; padding:0; }
  .no-print{ display:none !important; }
  .card{ border:none; box-shadow:none; }
  .pre{ background:#fff; color:#000; border:1px solid #000; }
  .print-only{ display:block; white-space:pre-wrap; }
}

/* Tendencies collapse */
.card-title-row{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:10px; }
.btn.sm{ padding:7px 10px; border-radius:10px; font-size:13px; }
#tendenciesSection.is-collapsed #tendenciesBody{ display:none; }

/* Professional report header (no cover page) */
.report-head{ padding:16px; }
.report-head-row{display:flex;align-items:center;justify-content:space-between;gap:14px;}
.report-logo{width:70px;height:70px;object-fit:contain;border:1px solid var(--line);border-radius:16px;padding:8px;background:#fff;flex:0 0 auto;}
.report-head-text{flex:1;min-width:220px;}
.report-team{font-weight:950;font-size:20px;line-height:1.1;}
.report-staff{color:var(--muted);font-weight:900;margin-top:4px;}
.report-meta{margin-top:8px;font-weight:850;font-size:12px;color:#334155;}
.report-mini{display:grid;grid-template-columns:1fr;gap:8px;min-width:170px;}
.mini-item{border:1px solid var(--line);border-radius:14px;padding:10px 12px;background:#fff;}
.mini-lbl{color:var(--muted);font-weight:900;font-size:11px;letter-spacing:.4px;}
.mini-val{font-weight:950;margin-top:4px;}
@media (max-width:860px){.report-head-row{flex-direction:column;align-items:stretch;}.report-mini{grid-template-columns:repeat(3,1fr);min-width:0;}}
@media (max-width:520px){.report-mini{grid-template-columns:1fr;}}


/* --- Cloudflare safety overrides (prevents host-site CSS from blowing up header text) --- */
.app .report-team{ font-size:20px !important; font-weight:950 !important; line-height:1.1 !important; }
.app .report-staff{ font-size:14px !important; font-weight:900 !important; color: var(--muted) !important; }
.app .report-meta{ font-size:12px !important; font-weight:850 !important; color:#334155 !important; }
.app .report-logo{ width:70px !important; height:70px !important; }

