/* ============================================================
   Attention Optimizer — MLC style sheet
   Dark theme, yellow accent, Inter typography, mobile-first.
   Inspired by pitch.mauriziolacava.com
   ============================================================ */

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: #0A0A0A;
  color: #FAFAFA;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: "ss01", "cv11";
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 1rem; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.9em; background: rgba(244,196,48,0.12); color: #F4C430; padding: 2px 6px; border-radius: 4px; }

:root {
  --bg: #0A0A0A;
  --bg-2: #0F0F11;
  --bg-card: #16161a;
  --bg-elev: #1c1c21;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.14);
  --text: #FAFAFA;
  --text-2: #a1a1aa;
  --text-3: #71717a;
  --accent: #F4C430;
  --accent-2: #FFDA63;
  --accent-3: #E8B520;
  --danger: #FF5A5F;
  --warn: #F4C430;
  --ok: #28C840;
  --max: 1180px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-glow: 0 0 0 1px rgba(244,196,48,0.18), 0 14px 60px -20px rgba(244,196,48,0.45);
}

/* ---------- Layout helpers ---------- */
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(244,196,48,0.10);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(244,196,48,0.25);
}
.section-title {
  font-size: clamp(1.7rem, 4.5vw, 2.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.hl { color: var(--accent); }
.under { border-bottom: 2px solid var(--accent); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.005em;
  transition: transform 120ms ease, background 200ms ease, color 200ms ease, box-shadow 200ms ease;
  white-space: nowrap;
  text-align: center;
  border: 1.5px solid transparent;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #0A0A0A; }
.btn-primary:hover { background: var(--accent-2); box-shadow: var(--shadow-glow); }
.btn-primary[disabled],
.btn-primary.is-processing {
  opacity: 0.7;
  cursor: progress;
  pointer-events: none;
  position: relative;
  background: linear-gradient(110deg, var(--accent-3) 0%, var(--accent) 50%, var(--accent-3) 100%);
  background-size: 200% 100%;
  animation: btnShine 1.6s linear infinite;
}
@keyframes btnShine {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost-sm {
  padding: 9px 14px;
  font-size: 0.85rem;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-2);
}
.btn-ghost-sm:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- NAV ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(10,10,10,0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -0.022em; font-size: 1rem; text-decoration: none; }
.brand-logo {
  display: inline-flex;
  align-items: center;
  color: #FAFAFA;
  flex-shrink: 0;
}
.brand-logo svg { display: block; }
.brand-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 14px rgba(244,196,48,0.7);
  flex-shrink: 0;
}
.brand-stack { display: flex; flex-direction: column; gap: 2px; line-height: 1; }
.brand-eyebrow {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-3);
  opacity: 0.85;
}
.brand-name { color: var(--text); display: inline-flex; align-items: baseline; gap: 4px; font-size: 1.05rem; }
.brand-w1 { color: #FAFAFA; font-weight: 800; }
.brand-sep { color: #52525b; font-weight: 600; font-size: 0.92em; }
.brand-accent {
  font-weight: 800;
  background: linear-gradient(135deg, #F4C430 0%, #FFDA63 60%, #F4C430 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 8px rgba(244,196,48,0.18));
  letter-spacing: -0.018em;
}
.nav-links { display: none; align-items: center; gap: 22px; }
.nav-links a { color: var(--text-2); font-weight: 500; font-size: 0.92rem; }
.nav-links a:hover { color: var(--text); }
.nav-cta {
  background: var(--accent);
  color: #0A0A0A !important;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 700;
}
.nav-cta:hover { background: var(--accent-2); }

@media (min-width: 760px) {
  .nav { padding: 18px 32px; }
  .nav-links { display: inline-flex; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  padding: 56px 20px 80px;
  overflow: hidden;
  background:
    radial-gradient(60% 80% at 80% -10%, rgba(244,196,48,0.16), transparent 60%),
    radial-gradient(40% 60% at 0% 0%, rgba(244,196,48,0.08), transparent 60%),
    var(--bg);
}
.hero-inner { max-width: var(--max); margin: 0 auto; position: relative; z-index: 2; }
.hero-title {
  font-size: clamp(2.2rem, 9vw, 5.5rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.035em;
  margin: 18px 0 18px;
}
.hero-sub {
  color: var(--text-2);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  max-width: 640px;
  margin: 0 0 28px;
}
.hero-sub strong { color: var(--text); }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-strip {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.hero-strip-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-3);
  opacity: 0.75;
}
.logos {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  align-items: center;
}
.logo-item {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: rgba(255, 255, 255, 0.32);
  font-family: 'Inter', system-ui, sans-serif;
  transition: color 200ms ease, opacity 200ms ease;
  white-space: nowrap;
  user-select: none;
}
.logo-item:hover { color: rgba(255, 255, 255, 0.55); }

/* Subtle brand-flavoured typographic touches, all in delicate grey */
.logo-jnj { font-family: Georgia, 'Times New Roman', serif; font-style: italic; font-weight: 400; letter-spacing: 0.005em; }
.logo-jnj .amp { margin: 0 1px; font-weight: 700; }
.logo-ferrero { font-family: Georgia, 'Times New Roman', serif; font-weight: 600; letter-spacing: 0.04em; }
.logo-accenture { font-weight: 700; letter-spacing: -0.01em; }
.logo-accenture .acc-dot { color: rgba(244, 196, 48, 0.32); margin-left: 1px; font-weight: 800; transform: translateY(-1px); display: inline-block; }
.logo-unicredit { font-weight: 700; letter-spacing: -0.01em; }
.logo-unicredit::first-letter { color: rgba(255, 255, 255, 0.32); }

@media (max-width: 600px) {
  .logo-item { font-size: 0.95rem; }
  .logos { gap: 8px 18px; }
}
.hero-curve {
  position: absolute;
  inset: auto 0 0 0;
  height: 220px;
  opacity: 0.35;
  z-index: 1;
  pointer-events: none;
}
.hero-curve svg { width: 100%; height: 100%; }

@media (min-width: 760px) {
  .hero { padding: 80px 32px 120px; }
  .hero-curve { opacity: 0.45; }
}

/* ---------- HOW IT WORKS ---------- */
.how {
  padding: 64px 20px;
  max-width: var(--max);
  margin: 0 auto;
  border-top: 1px solid var(--line);
}
.how .section-title { margin-bottom: 32px; }
.how-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.how-card {
  position: relative;
  padding: 28px 22px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 180ms ease, transform 180ms ease;
}
.how-card:hover { border-color: rgba(244,196,48,0.45); transform: translateY(-2px); }
.how-num {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.how-card h3 { margin: 0 0 8px; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }
.how-card p { margin: 0; color: var(--text-2); font-size: 0.95rem; }
.how-card code { font-size: 0.85em; }

@media (min-width: 760px) {
  .how { padding: 96px 32px; }
  .how-grid { grid-template-columns: repeat(3, 1fr); gap: 20px; }
}

/* ---------- APP CORE ---------- */
.app {
  padding: 40px 20px 80px;
  max-width: var(--max);
  margin: 0 auto;
  border-top: 1px solid var(--line);
}

/* Stepper */
.stepper {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0;
  margin: 0 0 28px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-3);
}
.step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-elev);
  color: var(--text-3);
  font-weight: 800;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.step.is-current {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(244,196,48,0.08);
}
.step.is-current span { background: var(--accent); color: #0A0A0A; }
.step.is-done span { background: var(--accent); color: #0A0A0A; }
.step.is-done { color: var(--text-2); }

/* Panel */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 22px;
  animation: slideIn 280ms ease;
}
.panel-active { display: block; }
.panel-title {
  font-size: clamp(1.5rem, 4.5vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.panel-sub { color: var(--text-2); margin: 0 0 24px; font-size: 0.98rem; }

@keyframes slideIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Mode toggle (Video / PPTX) */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
.mode-btn {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--line-strong);
  background: var(--bg-elev);
  border-radius: var(--radius);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}
.mode-btn:hover { border-color: var(--text-2); }
.mode-btn.is-on {
  border-color: var(--accent);
  background: rgba(244,196,48,0.08);
  box-shadow: 0 0 0 1px rgba(244,196,48,0.15);
}
.mode-icon {
  width: 36px; height: 36px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  font-size: 0.95rem;
  color: var(--accent);
  font-weight: 800;
}
.mode-btn.is-on .mode-icon { background: var(--accent); color: #0A0A0A; border-color: var(--accent); }
.mode-label { display: flex; flex-direction: column; gap: 2px; }
.mode-label strong { font-size: 0.98rem; letter-spacing: -0.01em; }
.mode-label em { font-style: normal; font-size: 0.82rem; color: var(--text-3); }

@media (min-width: 600px) {
  .mode-toggle { grid-template-columns: 1fr 1fr; gap: 12px; }
}

/* Processing */
.processing {
  margin-top: 18px;
  padding: 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.proc-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.proc-label { flex: 1; color: var(--text); font-weight: 600; font-size: 0.95rem; }
.proc-pct { color: var(--accent); font-weight: 800; font-variant-numeric: tabular-nums; }
.proc-spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(244,196,48,0.25);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }
.proc-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.proc-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 600ms ease;
  position: relative;
}
.proc-fill::after {
  /* Heartbeat shimmer that runs even when width is static */
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.45) 50%, transparent 100%);
  background-size: 60% 100%;
  background-repeat: no-repeat;
  animation: procShimmer 1.4s linear infinite;
  pointer-events: none;
}
.processing.is-busy .proc-spinner {
  /* keep spinner running, already animated by spin keyframes */
}
@keyframes procShimmer {
  0% { background-position: -60% 0; }
  100% { background-position: 160% 0; }
}
.proc-hint { margin: 10px 0 0; color: var(--text-3); font-size: 0.82rem; }

/* Dropzone */
.dropzone {
  display: block;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 36px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 180ms ease;
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(244,196,48,0.05), transparent 70%),
    var(--bg-2);
}
.dropzone:hover, .dropzone.is-drag {
  border-color: var(--accent);
  background:
    radial-gradient(60% 80% at 50% 0%, rgba(244,196,48,0.18), transparent 70%),
    var(--bg-2);
}
.dropzone-icon { width: 48px; height: 48px; color: var(--accent); margin: 0 auto 14px; }
.dropzone-headline { margin: 0 0 6px; font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.dropzone-sub { margin: 0; color: var(--text-2); font-size: 0.92rem; }
.dropzone-hint { margin: 10px 0 0; color: var(--text-3, #8a8a8a); font-size: 0.82rem; opacity: 0.85; }
.dropzone-sub .muted { color: var(--text-3, #8a8a8a); opacity: 0.7; }

/* Upload status */
.upload-status {
  margin-top: 18px;
  padding: 16px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.us-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.us-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex-shrink: 0; box-shadow: 0 0 10px var(--ok); }
.us-name { font-weight: 600; word-break: break-all; }
.us-meta { color: var(--text-3); font-size: 0.85rem; margin-left: auto; }
.us-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

@media (min-width: 600px) {
  .us-actions { justify-content: flex-end; }
}

/* Upload error */
.upload-error {
  margin-top: 18px;
  padding: 14px 18px;
  background: rgba(255,90,95,0.08);
  border: 1px solid rgba(255,90,95,0.4);
  color: #ffb1b3;
  border-radius: var(--radius);
  font-size: 0.92rem;
}

/* Trust strip */
.trust {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-3);
  font-size: 0.83rem;
}
.trust-dot { width: 6px; height: 6px; background: var(--ok); border-radius: 50%; box-shadow: 0 0 8px var(--ok); }

/* Context form */
.context-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-2);
  letter-spacing: 0.005em;
}
.field select {
  appearance: none;
  -webkit-appearance: none;
  background:
    var(--bg-elev)
    url("data:image/svg+xml,%3Csvg viewBox='0 0 12 8' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23F4C430' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E")
    no-repeat right 16px center / 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 14px 44px 14px 16px;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}
.field select:focus { outline: none; border-color: var(--accent); background-color: var(--bg-card); }
.field select:invalid { color: var(--text-3); }

.form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin-top: 8px;
  flex-wrap: wrap;
}

@media (min-width: 720px) {
  .context-form { grid-template-columns: 1fr 1fr; gap: 18px 22px; }
}

/* PDF companion CTA banner */
.pdf-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background:
    linear-gradient(135deg, rgba(244,196,48,0.08) 0%, rgba(244,196,48,0.02) 60%, transparent 100%),
    var(--bg-card);
  border: 1px solid rgba(244,196,48,0.35);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.pdf-cta-text {
  flex: 1;
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.55;
  min-width: 220px;
}
.pdf-cta-text strong { color: var(--text); font-weight: 700; }
.pdf-cta-text .pdf-cta-hint {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-3);
  font-style: italic;
}
.pdf-cta-btn {
  cursor: pointer;
  flex-shrink: 0;
}
.pdf-cta-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}
.pdf-cta-cloud {
  cursor: pointer;
  flex-shrink: 0;
}
.pdf-cta.is-loading { opacity: 0.7; pointer-events: none; }
.pdf-cta.is-success {
  border-color: rgba(40,200,64,0.4);
  border-left-color: var(--ok);
  background: rgba(40,200,64,0.05);
}
.pdf-cta.is-success .pdf-cta-text strong { color: var(--ok); }

/* ---------- REPORT ---------- */
.report-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.report-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (min-width: 760px) {
  .report-head { flex-direction: row; justify-content: space-between; align-items: flex-end; }
}

/* KPIs */
.kpis {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 32px;
}
.kpi {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kpi-label { color: var(--text-3); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.kpi-value { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.kpi-hint { font-size: 0.82rem; color: var(--text-2); }
.kpi-value.is-ok { color: var(--ok); }
.kpi-value.is-warn { color: var(--accent); }
.kpi-value.is-danger { color: var(--danger); }

@media (min-width: 720px) {
  .kpis { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}

/* Curve */
.curve-section, .hotspots-section, .slides-section {
  margin-bottom: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.curve-head h3 { margin: 0 0 6px; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; display: flex; align-items: center; gap: 10px; }
.curve-head p { margin: 0 0 18px; color: var(--text-2); font-size: 0.93rem; }

/* Info button (i) */
.info-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: rgba(244,196,48,0.10);
  color: var(--accent);
  font-family: 'Times New Roman', Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 160ms ease, transform 160ms ease;
  flex-shrink: 0;
  padding: 0;
}
.info-btn:hover { background: var(--accent); color: #0A0A0A; transform: scale(1.08); }
.info-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 200ms ease;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  max-width: 720px;
  width: 100%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7), 0 0 0 1px rgba(244,196,48,0.10);
  animation: slideInUp 240ms ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-head h3 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0;
}
.modal-close:hover { color: var(--text); border-color: var(--accent); }

.modal-body {
  padding: 18px 22px 22px;
  overflow-y: auto;
  color: var(--text-2);
  font-size: 0.93rem;
  line-height: 1.6;
}
.modal-body h4 {
  margin: 18px 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
}
.modal-body h4:first-child { margin-top: 0; }
.modal-body p { margin: 0 0 12px; }
.modal-body strong { color: var(--text); }
.modal-body ul { margin: 8px 0 14px; padding-left: 20px; }
.modal-body ul li { margin-bottom: 6px; }
.modal-body code {
  font-size: 0.86em;
  background: rgba(244,196,48,0.10);
  border: 1px solid rgba(244,196,48,0.18);
  color: var(--accent);
  padding: 1px 6px;
  border-radius: 4px;
}
.modal-body .formula-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px 14px;
  margin: 10px 0 16px;
  padding: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.modal-body .formula-row b {
  color: var(--accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.modal-body .lim-note {
  margin-top: 18px;
  padding: 12px 14px;
  background: rgba(255,90,95,0.06);
  border: 1px dashed rgba(255,90,95,0.4);
  border-radius: 8px;
  color: var(--text-2);
  font-size: 0.88rem;
}

.curve-wrap {
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 60px),
    var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 12px 8px;
  position: relative;
}
#curveSvg { width: 100%; height: clamp(220px, 38vw, 360px); cursor: crosshair; }
.curve-hint { margin: 6px 4px 0; font-size: 0.8rem; color: var(--text-3); font-style: italic; }

/* Curve tooltip — fixed slot below the chart, never covers the data point */
.curve-tooltip-slot {
  margin-top: 14px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 96px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: border-color 200ms ease, background 200ms ease;
}
.curve-tooltip-slot[data-empty="1"] {
  justify-content: center;
  border-style: dashed;
  background: transparent;
}
.curve-tooltip-slot[data-empty="1"] > .ct-empty { display: block; }
.curve-tooltip-slot:not([data-empty="1"]) > .ct-empty { display: none; }
.curve-tooltip-slot.is-low { border-color: rgba(255,90,95,0.35); }
.curve-tooltip-slot.is-mid { border-color: rgba(244,196,48,0.35); }
.curve-tooltip-slot.is-high { border-color: rgba(40,200,64,0.35); }

.ct-empty {
  color: var(--text-3);
  font-size: 0.88rem;
  font-style: italic;
  text-align: center;
}

.curve-tooltip-slot .ct-thumb-wrap {
  width: 180px;
  flex-shrink: 0;
}
.curve-tooltip-slot .ct-info { flex: 1; min-width: 0; }
.curve-tooltip-slot .ct-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1f;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  border: 1px solid var(--line);
}
.curve-tooltip-slot .ct-thumb img,
.curve-tooltip-slot .ct-thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.curve-tooltip-slot .ct-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.curve-tooltip-slot .ct-num {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--accent);
  background: rgba(244,196,48,0.12);
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.curve-tooltip-slot .ct-att {
  margin-left: auto;
  font-weight: 800;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.curve-tooltip-slot .ct-att.is-low { color: var(--danger); }
.curve-tooltip-slot .ct-att.is-mid { color: var(--accent); }
.curve-tooltip-slot .ct-att.is-high { color: var(--ok); }
.curve-tooltip-slot .ct-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.curve-tooltip-slot .ct-step {
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 8px;
  font-weight: 700;
}
.curve-tooltip-slot .ct-tip {
  font-size: 0.8rem;
  color: var(--text-2);
  line-height: 1.45;
  padding: 8px 10px;
  background: var(--bg-elev);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
}
.curve-tooltip-slot .ct-tip.is-danger { border-left-color: var(--danger); }
.curve-tooltip-slot .ct-tip.is-peak { border-left-color: var(--ok); }
.curve-tooltip-slot .ct-tip strong { color: var(--text); }
.curve-axis {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-3);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 6px 4px 0;
}
.curve-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--text-2);
  padding-top: 14px;
}
.lg { display: inline-block; vertical-align: middle; margin-right: 6px; }
.lg-line { width: 18px; height: 3px; background: var(--accent); border-radius: 2px; }
.lg-zone { width: 14px; height: 10px; background: rgba(255,90,95,0.25); border: 1px solid rgba(255,90,95,0.5); border-radius: 2px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #0A0A0A; box-shadow: 0 0 0 1px var(--accent); }
.lg-peak { width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid #0A0A0A; box-shadow: 0 0 0 1px var(--ok); }

/* Hotspots — accordion UX with thematic groups */
.hotspots {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.hotspots-counter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 0 0 18px;
  padding: 14px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-2);
  align-items: center;
}
.hotspots-counter b { color: var(--text); font-weight: 800; font-variant-numeric: tabular-nums; margin-right: 4px; }
.hotspots-counter .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.hotspots-counter .c-drop .dot { background: var(--accent); }
.hotspots-counter .c-peak .dot { background: var(--ok); }
.hotspots-counter .c-story .dot { background: #f06292; }
.hotspots-counter .hint { margin-left: auto; color: var(--text-3); font-style: italic; font-size: 0.8rem; }

.hotspots-group { margin-bottom: 18px; }
.hotspots-group:last-child { margin-bottom: 0; }
.hotspots-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  margin: 0 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--line);
}
.hg-icon { color: var(--accent); font-size: 1.1rem; }
.hg-count {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 0.72rem;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  margin-left: auto;
}
.hotspots-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hotspot {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}
.hotspot.is-peak { border-left-color: var(--ok); }
.hotspot.is-cadence { border-left-color: #66c0ff; }
.hotspot.is-story { border-left-color: #f06292; }
.hotspot.is-memory { border-left-color: #80deea; }
.hotspot.is-hook { border-left-color: var(--accent); border-left-width: 5px; }
.hotspot-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  margin: 0;
  transition: background 160ms ease;
}
.hotspot-head::-webkit-details-marker { display: none; }
.hotspot[open] .hotspot-head { background: rgba(244,196,48,0.04); border-bottom: 1px solid var(--line); }
.hotspot:hover .hotspot-head { background: rgba(244,196,48,0.04); }
.hotspot-summary-title {
  flex: 1 0 100%;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  letter-spacing: -0.005em;
  margin-top: 2px;
  order: 10;
}
.hotspot-toggle {
  margin-left: auto;
  font-size: 0.95rem;
  color: var(--text-3);
  transition: transform 200ms ease;
}
.hotspot[open] .hotspot-toggle { transform: rotate(180deg); }

.hotspot-content {
  padding: 4px 16px 18px;
  animation: fadeIn 200ms ease;
}

@media (min-width: 720px) {
  .hotspot-summary-title { flex: 1; order: 0; margin-top: 0; }
}

.hotspot-tag {
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: rgba(244,196,48,0.12);
  border: 1px solid rgba(244,196,48,0.32);
  padding: 3px 10px;
  border-radius: 999px;
}
.hotspot.is-peak .hotspot-tag { color: var(--ok); background: rgba(40,200,64,0.12); border-color: rgba(40,200,64,0.35); }
.hotspot.is-cadence .hotspot-tag { color: #66c0ff; background: rgba(102,192,255,0.12); border-color: rgba(102,192,255,0.32); }
.hotspot.is-story .hotspot-tag { color: #f48fb1; background: rgba(240,98,146,0.12); border-color: rgba(240,98,146,0.35); }
.hotspot.is-memory .hotspot-tag { color: #80deea; background: rgba(128,222,234,0.12); border-color: rgba(128,222,234,0.35); }
.hotspot-loc { font-weight: 700; color: var(--text); font-size: 0.92rem; }
.hotspot-time { color: var(--text-3); font-size: 0.82rem; margin-left: auto; }
.hotspot-title { margin: 6px 0 4px; font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.hotspot-diag { color: var(--text-2); margin: 0 0 12px; font-size: 0.94rem; }
.hotspot-diag strong { color: var(--text); }
.hotspot-tactic {
  background: rgba(244,196,48,0.06);
  border: 1px dashed rgba(244,196,48,0.35);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 0.93rem;
  color: var(--text);
}
.hotspot.is-peak .hotspot-tactic { background: rgba(40,200,64,0.06); border-color: rgba(40,200,64,0.4); }
.hotspot.is-cadence .hotspot-tactic { background: rgba(102,192,255,0.06); border-color: rgba(102,192,255,0.4); }
.hotspot.is-story .hotspot-tactic { background: rgba(240,98,146,0.06); border-color: rgba(240,98,146,0.4); }
.hotspot.is-memory .hotspot-tactic { background: rgba(128,222,234,0.06); border-color: rgba(128,222,234,0.4); }
.hotspot-tactic strong { color: var(--accent); }
.hotspot.is-peak .hotspot-tactic strong { color: var(--ok); }
.hotspot.is-cadence .hotspot-tactic strong { color: #66c0ff; }
.hotspot.is-story .hotspot-tactic strong { color: #f48fb1; }
.hotspot.is-memory .hotspot-tactic strong { color: #80deea; }
.hotspot-tactic ul { margin: 8px 0 0; padding-left: 20px; }
.hotspot-tactic li { margin-bottom: 4px; }

/* Filter chips */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-2);
  background: transparent;
  transition: all 160ms ease;
}
.chip:hover { color: var(--text); border-color: var(--text-2); }
.chip.is-on { background: var(--accent); color: #0A0A0A; border-color: var(--accent); }

/* Slide cards — single column, horizontal layout (thumb + info) */
.slides-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  min-width: 0;
}
.slides-counter {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--text-2);
  margin: 4px 0 14px;
}
.slides-counter b { color: var(--text); font-variant-numeric: tabular-nums; margin-right: 4px; }
.slides-counter .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: 1px; }
.slides-counter .d-crit { background: var(--danger); }
.slides-counter .d-warn { background: var(--accent); }
.slides-counter .d-ok { background: var(--ok); }

.slide-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
}
.slide-card.is-critical { border-color: rgba(255,90,95,0.4); }
.slide-card.is-warn { border-color: rgba(244,196,48,0.4); }
.slide-card.is-ok { border-color: rgba(40,200,64,0.3); }

.slide-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #0d0d10;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}
.slide-thumb.is-pending {
  border-color: rgba(244,196,48,0.35);
  box-shadow: 0 0 0 0 rgba(244,196,48,0.4);
  animation: thumbPulse 1.6s ease-in-out infinite;
}
.slide-thumb.is-failed {
  border-color: rgba(255,90,95,0.35);
}
@keyframes thumbPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,196,48,0.0); }
  50% { box-shadow: 0 0 0 3px rgba(244,196,48,0.15); }
}
.slide-thumb-loading {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--accent);
  background: rgba(0,0,0,0.7);
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  animation: thumbBlink 1.2s ease-in-out infinite;
}
@keyframes thumbBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.slide-thumb img,
.slide-thumb svg { width: 100%; height: 100%; display: block; object-fit: cover; }
.slide-thumb-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #0A0A0A;
  background: var(--accent);
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
}

.slide-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; flex: 1; }
.slide-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}
.slide-num {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--bg-card);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--accent);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.slide-title-block { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.slide-title {
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  line-height: 1.3;
}
.slide-step {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}
.slide-score {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 800;
  font-size: 0.78rem;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.slide-card.is-critical .slide-score { color: var(--danger); border-color: rgba(255,90,95,0.4); background: rgba(255,90,95,0.08); }
.slide-card.is-warn .slide-score { color: var(--accent); border-color: rgba(244,196,48,0.4); background: rgba(244,196,48,0.08); }
.slide-card.is-ok .slide-score { color: var(--ok); border-color: rgba(40,200,64,0.4); background: rgba(40,200,64,0.08); }

.slide-meta {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-3);
}
.slide-meta span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.slide-meta b { color: var(--text-2); font-weight: 700; }

.slide-tips { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.slide-tips li {
  font-size: 0.88rem;
  color: var(--text-2);
  padding-left: 18px;
  position: relative;
  word-break: break-word;
  line-height: 1.45;
}
.slide-tips li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 800;
  font-size: 1rem;
  line-height: 1.45;
}
.slide-tips li strong { color: var(--text); margin-right: 4px; }
.slide-tips li.is-danger::before { content: "✗"; color: var(--danger); }
.slide-tips li.is-warn::before { content: "→"; color: var(--accent); }
.slide-tips li.is-ok::before { content: "✓"; color: var(--ok); }

/* Horizontal layout from tablet up: thumb left, body right */
@media (min-width: 600px) {
  .slide-card {
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 14px 16px;
  }
  .slide-thumb { width: 200px; aspect-ratio: 16 / 9; }
}
@media (min-width: 1040px) {
  .slide-card { grid-template-columns: 240px 1fr; }
  .slide-thumb { width: 240px; }
}

/* Accordion stays single column for clean reading */

/* ---------- METHOD ---------- */
.method {
  padding: 80px 20px;
  border-top: 1px solid var(--line);
  background:
    radial-gradient(80% 60% at 50% 0%, rgba(244,196,48,0.10), transparent 60%),
    var(--bg);
}
.method-inner { max-width: 820px; margin: 0 auto; text-align: center; }
.method-lead {
  margin: 16px auto 28px;
  color: var(--text-2);
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  max-width: 640px;
}
.principles {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  text-align: left;
}
.principles li {
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 0.96rem;
}
.principles li strong { color: var(--text); display: block; margin-bottom: 4px; }
.method-credit {
  margin-top: 32px;
  font-size: 0.88rem;
  color: var(--text-3);
}

@media (min-width: 720px) {
  .principles { grid-template-columns: 1fr 1fr; gap: 14px; }
}

/* ---------- FOOTER ---------- */
.footer {
  padding: 48px 20px 56px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.footer-brand { font-weight: 800; font-size: 1.05rem; display: inline-flex; align-items: center; gap: 10px; }
.footer-tag { color: var(--text-2); margin: 0; max-width: 520px; font-size: 0.9rem; }
.footer-meta { color: var(--text-3); margin: 4px 0 0; font-size: 0.82rem; }
.footer-meta a { color: var(--accent); }

/* ---------- PRINT-ONLY ONE-PAGER ---------- */
.print-summary { display: none; }

@media print {
  @page { size: A4 portrait; margin: 0; }
  html, body {
    background: white !important;
    color: #0A0A0A !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  body { font-size: 9.5pt; font-family: 'Inter', system-ui, sans-serif; }
  .print-summary { padding: 12mm; box-sizing: border-box; }

  /* Hide EVERYTHING except the one-pager */
  body > * { display: none !important; }
  body > main { display: block !important; }
  main > section { display: none !important; }
  main > #start { display: block !important; max-width: none !important; padding: 0 !important; border: 0 !important; }
  #start > .stepper, #start > #panel-upload, #start > #panel-context { display: none !important; }
  #start > #panel-analysis { display: block !important; background: white !important; border: 0 !important; padding: 0 !important; }
  #panel-analysis > * { display: none !important; }
  #panel-analysis > .print-summary { display: block !important; }

  .print-summary {
    display: block;
    page-break-after: avoid;
    width: 100%;
  }
}

/* ============== Infographic-style PDF report ============== */
.print-summary {
  font-family: 'Inter', system-ui, sans-serif;
  color: #0A0A0A;
}

/* HERO HEADER with gradient */
.ps-hero {
  position: relative;
  background: linear-gradient(135deg, #0A0A0A 0%, #1a1a1f 60%, #2a2a30 100%);
  color: #FAFAFA;
  margin: -12mm -12mm 6mm -12mm;
  padding: 10mm 12mm 8mm;
  overflow: hidden;
}
.ps-hero-bg {
  position: absolute;
  top: -20mm; right: -20mm;
  width: 100mm; height: 100mm;
  background: radial-gradient(circle, rgba(244,196,48,0.55) 0%, rgba(244,196,48,0.0) 60%);
  pointer-events: none;
}
.ps-hero-content { position: relative; z-index: 2; }
.ps-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6mm;
}
.ps-brand {
  display: flex;
  align-items: center;
  gap: 8pt;
  font-weight: 800;
  font-size: 13pt;
  letter-spacing: -0.01em;
}
.ps-brand-dot {
  width: 10pt; height: 10pt;
  background: #F4C430;
  border-radius: 50%;
  box-shadow: 0 0 0 2pt rgba(244,196,48,0.25);
}
.ps-brand-name { color: #FAFAFA; }
.ps-brand-name b { color: #F4C430; }
.ps-hero-meta {
  font-size: 8pt;
  color: #a1a1aa;
  text-align: right;
  line-height: 1.5;
}
.ps-hero-meta div:first-child { color: #FAFAFA; font-weight: 600; }
.ps-hero-source { color: #a1a1aa; }

.ps-hero-title {
  font-size: 32pt;
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 2mm;
  color: #FAFAFA;
}
.ps-hero-title b { color: #F4C430; }
.ps-hero-subtitle {
  font-size: 9.5pt;
  color: #d4d4d8;
  font-weight: 400;
  margin: 0 0 4mm;
  max-width: 130mm;
  line-height: 1.5;
}
.ps-hero-subtitle em { color: #F4C430; font-style: normal; font-weight: 600; }
.ps-hero-file {
  display: inline-block;
  font-size: 8.5pt;
  font-style: italic;
  color: #FAFAFA;
  background: rgba(255,255,255,0.08);
  border: 0.7pt solid rgba(255,255,255,0.18);
  padding: 1.2mm 3mm;
  border-radius: 99pt;
  letter-spacing: 0.02em;
}

/* Section titles with bullet */
.ps-section-title {
  font-size: 11pt;
  font-weight: 800;
  margin: 0 0 1.5mm;
  letter-spacing: -0.005em;
  display: flex;
  align-items: center;
  gap: 2mm;
  text-transform: uppercase;
  color: #0A0A0A;
}
.ps-section-bullet {
  display: inline-block;
  width: 6pt;
  height: 6pt;
  background: #F4C430;
  border-radius: 50%;
  flex-shrink: 0;
}
.ps-section-sub {
  font-size: 8.5pt;
  color: #555;
  margin: 0 0 3mm;
  font-style: italic;
}

/* KPI HERO ROW */
.ps-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3mm;
  margin-bottom: 7mm;
}
.ps-kpi {
  position: relative;
  background: linear-gradient(180deg, #fffdf6 0%, #ffffff 100%);
  border: 1pt solid #f0e8c8;
  border-radius: 3mm;
  padding: 4mm 3mm;
  text-align: center;
  overflow: hidden;
}
.ps-kpi::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3pt;
  background: #F4C430;
}
.ps-kpi.is-ok { background: linear-gradient(180deg, #f3fbf5 0%, #ffffff 100%); border-color: #cfe9d4; }
.ps-kpi.is-ok::before { background: #1f8b3a; }
.ps-kpi.is-danger { background: linear-gradient(180deg, #fdf3f3 0%, #ffffff 100%); border-color: #f1cdcf; }
.ps-kpi.is-danger::before { background: #c8232a; }
.ps-kpi.is-warn { background: linear-gradient(180deg, #fffaeb 0%, #ffffff 100%); border-color: #f0e8c8; }
.ps-kpi.is-warn::before { background: #c89a00; }

.ps-kpi-icon {
  font-size: 14pt;
  margin-bottom: 1mm;
  filter: grayscale(0.2);
}
.ps-kpi-value {
  font-size: 24pt;
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 1;
  margin-bottom: 1mm;
  color: #E8B520;
}
.ps-kpi.is-ok .ps-kpi-value { color: #1f8b3a; }
.ps-kpi.is-danger .ps-kpi-value { color: #c8232a; }
.ps-kpi.is-warn .ps-kpi-value { color: #c89a00; }
.ps-kpi-label {
  font-size: 7pt;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #555;
  margin-bottom: 1mm;
}
.ps-kpi-hint { font-size: 7.5pt; color: #777; line-height: 1.3; }

/* CURVE SECTION — large hero chart */
.ps-curve-section { margin-bottom: 7mm; page-break-inside: avoid; }
.ps-curve-frame {
  background: linear-gradient(180deg, #fffdf6 0%, #fafafa 100%);
  border: 1pt solid #e8d8a0;
  border-radius: 3mm;
  padding: 3mm 4mm;
  height: 60mm;
  position: relative;
}
.ps-curve-frame svg { width: 100%; height: 100%; display: block; }
.ps-curve-axis {
  display: flex;
  justify-content: space-between;
  font-size: 7pt;
  color: #888;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 1.5mm 4mm 0;
}

/* STRATEGIC FIXES — 3 column cards */
.ps-fixes { margin-bottom: 7mm; page-break-inside: avoid; }
.ps-fixes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3mm;
}
.ps-fix {
  background: #fff;
  border: 1pt solid #e8e8e8;
  border-top: 3pt solid #F4C430;
  border-radius: 3mm;
  padding: 3mm 3mm;
  page-break-inside: avoid;
  display: flex;
  flex-direction: column;
}
.ps-fix.is-peak { border-top-color: #1f8b3a; }
.ps-fix.is-drop { border-top-color: #c8232a; }
.ps-fix.is-hook { border-top-color: #F4C430; }
.ps-fix.is-mem { border-top-color: #4dd0e1; }

.ps-fix-tag {
  display: inline-block;
  font-size: 6.5pt;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: #fffaeb;
  color: #b88a00;
  padding: 0.8mm 2.5mm;
  border-radius: 99pt;
  margin-bottom: 2mm;
  width: fit-content;
}
.ps-fix.is-peak .ps-fix-tag { background: #e8f7eb; color: #1f8b3a; }
.ps-fix.is-drop .ps-fix-tag { background: #fdf3f3; color: #c8232a; }
.ps-fix.is-mem .ps-fix-tag { background: #e0f7fa; color: #006064; }

.ps-fix-loc {
  font-size: 7pt;
  color: #888;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 1mm;
}
.ps-fix-title {
  margin: 0 0 1.5mm;
  font-size: 9pt;
  font-weight: 800;
  color: #0A0A0A;
  letter-spacing: -0.005em;
  line-height: 1.25;
}
.ps-fix-why {
  font-size: 7.5pt;
  color: #555;
  line-height: 1.45;
  margin: 0 0 2mm;
  flex: 1;
}
.ps-fix-action {
  font-size: 8pt;
  color: #0A0A0A;
  background: #fffdf6;
  border-left: 2pt solid #F4C430;
  padding: 1.5mm 2mm;
  border-radius: 0 1mm 1mm 0;
  line-height: 1.4;
  margin-top: auto;
}
.ps-fix-action strong { color: #E8B520; margin-right: 1mm; }
.ps-fix.is-peak .ps-fix-action { border-left-color: #1f8b3a; }
.ps-fix.is-peak .ps-fix-action strong { color: #1f8b3a; }
.ps-fix.is-drop .ps-fix-action { border-left-color: #c8232a; }
.ps-fix.is-drop .ps-fix-action strong { color: #c8232a; }
.ps-fix.is-mem .ps-fix-action { border-left-color: #4dd0e1; }
.ps-fix.is-mem .ps-fix-action strong { color: #006064; }

/* TOP CRITICAL SLIDES — 2x3 grid with rank badges and screenshots */
.ps-previews { margin-bottom: 7mm; }
.ps-prev-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3mm;
}
.ps-prev {
  position: relative;
  background: #fff;
  border: 1pt solid #e8e8e8;
  border-radius: 3mm;
  padding: 0;
  overflow: hidden;
  page-break-inside: avoid;
  display: flex;
  flex-direction: column;
}
.ps-prev.is-crit { border-color: #f1cdcf; }
.ps-prev.is-warn { border-color: #f0e8c8; }
.ps-prev.is-ok { border-color: #cfe9d4; }

.ps-prev-rank {
  position: absolute;
  top: 2mm; left: 2mm;
  width: 6mm; height: 6mm;
  border-radius: 50%;
  background: #0A0A0A;
  color: #F4C430;
  font-size: 9pt;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  box-shadow: 0 0.5pt 2pt rgba(0,0,0,0.2);
}
.ps-prev-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1f;
  overflow: hidden;
  border-bottom: 0.5pt solid #e0e0e0;
}
.ps-prev-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ps-prev-ph {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #16161a 0%, #2a2a30 100%);
  color: #FAFAFA;
  font-family: 'Inter', sans-serif;
  gap: 1mm;
}
.ps-ph-rank {
  font-size: 7pt;
  font-weight: 700;
  color: #F4C430;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.ps-ph-num {
  font-size: 12pt;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.ps-prev-body {
  padding: 2.5mm 3mm 3mm;
  display: flex;
  flex-direction: column;
  gap: 1mm;
  flex: 1;
}
.ps-prev-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 1mm;
}
.ps-prev-num {
  font-size: 6.5pt;
  font-weight: 800;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.ps-prev-score {
  font-size: 11pt;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #444;
  letter-spacing: -0.02em;
}
.ps-prev-score small { font-size: 7pt; color: #888; font-weight: 700; }
.ps-prev.is-crit .ps-prev-score { color: #c8232a; }
.ps-prev.is-warn .ps-prev-score { color: #c89a00; }
.ps-prev.is-ok .ps-prev-score { color: #1f8b3a; }

.ps-prev-title {
  font-size: 8.5pt;
  font-weight: 800;
  color: #0A0A0A;
  line-height: 1.25;
  margin-bottom: 1mm;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ps-prev-tip {
  font-size: 7.5pt;
  color: #555;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* FOOTER CTA — bold call-to-action */
.ps-cta {
  margin: 0 -12mm -12mm;
  padding: 6mm 12mm 8mm;
  background: linear-gradient(135deg, #F4C430 0%, #FFDA63 100%);
  color: #0A0A0A;
  page-break-inside: avoid;
}
.ps-cta-content {
  display: flex;
  align-items: center;
  gap: 4mm;
  margin-bottom: 4mm;
}
.ps-cta-icon {
  font-size: 22pt;
  flex-shrink: 0;
}
.ps-cta-text { flex: 1; }
.ps-cta-title {
  font-size: 13pt;
  font-weight: 900;
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin-bottom: 1mm;
}
.ps-cta-sub {
  font-size: 9pt;
  color: #1a1a1f;
  line-height: 1.4;
}
.ps-cta-sub b { font-weight: 800; }
.ps-cta-brand {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1pt solid rgba(10,10,10,0.2);
  padding-top: 2.5mm;
  font-size: 7.5pt;
  color: #1a1a1f;
}
.ps-cta-brand-name {
  font-size: 10pt;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.ps-cta-brand-name b { color: #1a1a1f; }
.ps-cta-brand-credit { font-style: italic; }

@media print {
  .print-summary {
    padding: 7mm !important;
    height: 297mm;
    overflow: hidden;
  }

  .ps-hero {
    margin: -7mm -7mm 3mm -7mm;
    padding: 5mm 7mm 5mm;
  }
  .ps-hero-bg { width: 70mm; height: 70mm; top: -18mm; right: -18mm; }
  .ps-hero-top { margin-bottom: 3mm; }
  .ps-brand { font-size: 10pt; gap: 5pt; }
  .ps-brand-dot { width: 7pt; height: 7pt; }
  .ps-hero-meta { font-size: 6.5pt; line-height: 1.25; max-width: 72mm; }
  .ps-hero-title { font-size: 23pt; margin-bottom: 1mm; }
  .ps-hero-subtitle { font-size: 7pt; line-height: 1.25; margin-bottom: 2mm; max-width: 138mm; }
  .ps-hero-file { font-size: 6.5pt; padding: 0.8mm 2mm; max-width: 170mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  .ps-section-title { font-size: 8pt; margin-bottom: 0.8mm; gap: 1.2mm; }
  .ps-section-bullet { width: 4.5pt; height: 4.5pt; }
  .ps-section-sub { font-size: 6.5pt; margin-bottom: 1.5mm; }

  .ps-kpis { gap: 2mm; margin-bottom: 3mm; }
  .ps-kpi { padding: 2mm 2mm 1.8mm; border-radius: 2mm; }
  .ps-kpi-icon { display: none; }
  .ps-kpi-value { font-size: 17pt; margin-bottom: 0.6mm; }
  .ps-kpi-label { font-size: 5.8pt; margin-bottom: 0.4mm; }
  .ps-kpi-hint { font-size: 6pt; line-height: 1.15; }

  .ps-curve-section { margin-bottom: 3mm; }
  .ps-curve-frame { height: 42mm; padding: 1.5mm 2mm; border-radius: 2mm; }
  .ps-curve-axis { font-size: 5.8pt; padding: 0.8mm 2mm 0; }

  .ps-fixes { margin-bottom: 3mm; }
  .ps-fixes-grid { gap: 2mm; }
  .ps-fix { padding: 2mm; border-radius: 2mm; border-top-width: 2pt; max-height: 34mm; overflow: hidden; }
  .ps-fix-tag { font-size: 5.5pt; padding: 0.5mm 1.8mm; margin-bottom: 1mm; }
  .ps-fix-loc { font-size: 5.8pt; margin-bottom: 0.5mm; }
  .ps-fix-title {
    font-size: 7pt;
    line-height: 1.15;
    margin-bottom: 1mm;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .ps-fix-why { display: none; }
  .ps-fix-action {
    font-size: 6pt;
    line-height: 1.25;
    padding: 1mm 1.3mm;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .ps-previews { margin-bottom: 3mm; }
  .ps-prev-grid { gap: 2mm; }
  .ps-prev { border-radius: 2mm; max-height: 39mm; }
  .ps-prev-rank { width: 4.8mm; height: 4.8mm; font-size: 7pt; top: 1.3mm; left: 1.3mm; }
  .ps-prev-body { padding: 1.5mm 2mm 1.8mm; gap: 0.4mm; }
  .ps-prev-head { margin-bottom: 0.3mm; }
  .ps-prev-num { font-size: 5.4pt; }
  .ps-prev-score { font-size: 8pt; }
  .ps-prev-score small { font-size: 5.2pt; }
  .ps-prev-title {
    font-size: 6.6pt;
    line-height: 1.15;
    margin-bottom: 0;
    -webkit-line-clamp: 2;
  }
  .ps-prev-tip { display: none; }

  .ps-cta {
    margin: 0 -7mm -7mm;
    padding: 3mm 7mm 3.5mm;
  }
  .ps-cta-content { gap: 2mm; margin-bottom: 1.5mm; }
  .ps-cta-icon { display: none; }
  .ps-cta-title { font-size: 9pt; margin-bottom: 0.5mm; }
  .ps-cta-sub { font-size: 6.5pt; line-height: 1.2; }
  .ps-cta-brand { padding-top: 1.5mm; font-size: 5.8pt; }
  .ps-cta-brand-name { font-size: 7.5pt; }
}

/* === Tool switcher tabs in main nav (Attention Curve · Cognitive Heatmap) === */
.nav-tools { display: flex; gap: 4px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 999px; padding: 4px; margin-left: auto; }
.nav-tool { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2, #aaa); text-decoration: none; transition: color .15s, background .15s; white-space: nowrap; }
.nav-tool:hover { color: var(--text, #fff); }
.nav-tool.is-on { background: var(--accent, #F4C430); color: #0A0A0A; }
@media (max-width: 720px) {
  .nav-tools { padding: 3px; gap: 2px; }
  .nav-tool { padding: 5px 10px; font-size: 12px; }
}
