/* ===== Measurox design system =====
   Brand palette: Royal Violet / Electric Tangerine / Teal Surge /
   Sunburst Yellow / Crimson Edge / Charcoal Black. Existing variable names
   are kept (--purple, --coral, --lime, --mint) to minimise churn across the
   stylesheet - only the values map onto the new palette. */
:root {
  --purple: #743EE4;       /* Royal Violet */
  --purple-dark: #4F2A9B;
  --purple-light: #F6ECFC;
  --tangerine: #FF6A00;    /* Electric Tangerine */
  --coral: #D7263D;        /* Crimson Edge (danger/emphasis) */
  --lime: #FFC400;         /* Sunburst Yellow (CTA/highlight) */
  --mint: #00C2A8;         /* Teal Surge (positive/growth) */
  --navy: #1A1A1A;         /* Charcoal Black */
  --ink: #1A1A1A;          /* Charcoal Black */
  --paper: #FBF8FF;
  --white: #FFFFFF;
  --border: #1A1A1A;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --shadow-block: 8px 8px 0 var(--border);
  --shadow-block-sm: 5px 5px 0 var(--border);
  --shadow-soft: 0 20px 40px rgba(20, 18, 43, 0.12);
  --font-display: "Space Grotesk", "Space Grotesk Fallback", "Inter", "Inter Fallback", sans-serif;
  --font-body: "Inter", "Inter Fallback", sans-serif;
}

/* Metric-matched local fallbacks for the two Google Fonts above, used only
   for the brief window before each webfont finishes loading. Values are
   computed (via fonttools, against Capsize's standard Arial reference
   metrics) from Inter 700 and Space Grotesk 700 - the weights actually used
   on the hero-badges pills that were showing visible layout shift on swap.
   Sizing the fallback's box (and glyphs, via size-adjust) to match the
   real webfont's metrics means the swap no longer reflows the page. */
@font-face {
  font-family: "Inter Fallback";
  src: local("Arial");
  ascent-override: 70.06%;
  descent-override: 17.44%;
  line-gap-override: 0%;
  size-adjust: 138.27%;
}
@font-face {
  font-family: "Space Grotesk Fallback";
  src: local("Arial");
  ascent-override: 80.29%;
  descent-override: 23.82%;
  line-gap-override: 0%;
  size-adjust: 122.56%;
}

/* ===== Icons (inline Phosphor Fill SVGs - see app/icons.py) =====
   Each icon inherits `color` via fill="currentColor", so the same SVG file
   renders black or white depending on which badge-color class its wrapper
   has. Badge-color classes only set background+color; sizing/shape (the
   circle/square itself) is owned by whichever component uses them. */
.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; fill: currentColor; flex-shrink: 0; }

.badge-lime { background: var(--lime); color: var(--ink); }
.badge-tangerine { background: var(--tangerine); color: var(--ink); }
.badge-mint { background: var(--mint); color: var(--ink); }
.badge-coral { background: var(--coral); color: var(--white); }
.badge-charcoal { background: var(--navy); color: var(--white); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.05; margin: 0; }
p { line-height: 1.6; }
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===== Site header (public pages - report/admin pages define their own topbar) ===== */
.site-header {
  padding: 20px 0;
}
.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
}
.site-header-nav { display: flex; align-items: center; gap: 10px; }
.site-header-nav a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  text-decoration: none;
}
.site-header-nav a:hover { color: var(--purple-dark); text-decoration: underline; }
.site-header-nav span { color: var(--border); opacity: 0.4; }
@media (max-width: 560px) {
  .site-header-inner { flex-direction: column; gap: 12px; }
  .site-header-nav { flex-wrap: wrap; justify-content: center; }
}
.site-header-logo {
  height: 34px;
  width: auto;
  border-radius: 8px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 16px 32px;
  border-radius: 999px;
  border: 3px solid var(--border);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: var(--shadow-block);
  background: var(--white);
  color: var(--ink);
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 10px 10px 0 var(--border); }
.btn:active { transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--border); }
.btn-primary { background: var(--lime); }
.btn-accent { background: var(--coral); color: var(--white); }
.btn-dark { background: var(--navy); color: var(--white); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none !important; }

/* ===== Flash messages ===== */
.flash-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
}
.flash {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 3px solid var(--border);
  background: var(--white);
  font-weight: 600;
  box-shadow: var(--shadow-block-sm);
}
.flash-error { background: var(--coral); color: var(--white); }
.flash-success { background: var(--mint); }

/* ===== Site footer ===== */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.75);
  text-align: center;
  padding: 28px 20px;
  font-size: 0.82rem;
}
.site-footer p { margin: 4px 0; }
.footer-links a { color: var(--white); text-decoration: none; font-weight: 600; }
.footer-links a:hover { text-decoration: underline; }
.footer-links span { margin: 0 8px; opacity: 0.5; }

/* ===================================================================
   SALES PAGE
   =================================================================== */
.hero {
  position: relative;
  padding: 72px 0 40px;
  background: linear-gradient(180deg, var(--purple-light) 0%, var(--paper) 70%);
  overflow: hidden;
}
.hero::before, .hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(0px);
  z-index: 0;
}
.hero::before {
  width: 320px; height: 320px;
  background: var(--lime);
  top: -120px; right: -80px;
  opacity: 0.55;
  animation: float 7s ease-in-out infinite;
}
.hero::after {
  width: 220px; height: 220px;
  background: var(--tangerine);
  bottom: -80px; left: -60px;
  opacity: 0.4;
  animation: float 9s ease-in-out infinite reverse;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-24px) rotate(8deg); }
}
.hero-inner { position: relative; z-index: 1; text-align: center; max-width: 780px; margin: 0 auto; }
.eyebrow {
  display: inline-block;
  background: var(--navy);
  color: var(--lime);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.04em;
  padding: 8px 18px;
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2.4rem, 6vw, 4rem);
  font-weight: 700;
  margin-bottom: 20px;
}
.hero h1 .highlight {
  background: var(--lime);
  padding: 2px 12px;
  border-radius: 10px;
  box-shadow: var(--shadow-block-sm);
  display: inline-block;
}
.hero-sub {
  font-size: 1.2rem;
  color: #4b4768;
  max-width: 620px;
  margin: 0 auto 32px;
}
.hero-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}
.badge-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: var(--shadow-block-sm);
  transition: transform 0.2s ease;
}
.badge-pill:hover { transform: translateY(-4px); }
.badge-pill-icon {
  width: 30px; height: 30px;
  border-radius: 10px;
  border: 2px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
}
.badge-pill-icon .icon { width: 17px; height: 17px; }

/* Linktree-style stacked upload card */
.upload-section { padding: 20px 0 90px; }
.upload-card {
  max-width: 620px;
  margin: 0 auto;
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-block);
  padding: 36px;
}
.upload-card h2 {
  font-size: 1.6rem;
  text-align: center;
  margin-bottom: 6px;
}
.upload-card .sub {
  text-align: center;
  color: #59547a;
  margin-bottom: 28px;
}
.upload-card .sub a { color: var(--purple-dark); font-weight: 700; text-decoration: none; }
.upload-card .sub a:hover { text-decoration: underline; }
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 0.95rem;
}
.field input[type="text"],
.field input[type="email"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 3px solid var(--border);
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--paper);
}
.field input:focus { outline: 3px solid var(--purple); outline-offset: 1px; }

.file-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 3px dashed #cfc7ef;
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 12px;
  background: var(--purple-light);
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.1s ease;
  position: relative;
}
.file-slot:hover { border-color: var(--purple); transform: translateY(-2px); }
.file-slot input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.file-slot .slot-label { font-weight: 700; }
.file-slot .slot-hint { font-size: 0.8rem; color: #6b6690; }
.file-slot .slot-status { font-size: 1.3rem; }
.file-slot.status-ok { border-color: var(--mint); background: #E7FFF7; }
.file-slot.status-ok .slot-status { color: #0f9b6f; }
.file-slot.status-error { border-color: var(--coral); background: #FFE9EC; }
.file-slot.status-error .slot-status { color: var(--coral); }
.file-slot.status-pending { border-color: var(--purple); }

.upload-results { margin: 18px 0; display: none; }
.upload-results.visible { display: block; }
.result-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  margin-bottom: 8px;
  border: 2px solid var(--border);
}
.result-row.ok { background: #E7FFF7; }
.result-row.fail { background: #FFE9EC; }

.email-step { display: none; margin-top: 12px; border-top: 3px dashed #e4defc; padding-top: 22px; }
.email-step.visible { display: block; animation: pop-in 0.3s ease; }
@keyframes pop-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.claim-message { margin-top: 16px; padding: 14px 16px; border-radius: var(--radius-sm); border: 3px solid var(--border); font-weight: 600; display: none; }
.claim-message.visible { display: block; }
.claim-message.ok { background: var(--mint); }
.claim-message.fail { background: var(--coral); color: var(--white); }

.privacy-note { font-size: 0.8rem; color: #6b6690; text-align: center; margin-top: 16px; }
.privacy-note a { color: var(--purple-dark); font-weight: 700; }

/* Sections */
.section { padding: 80px 0; }
.section-alt { background: var(--navy); color: var(--white); }
.section-title { text-align: center; max-width: 640px; margin: 0 auto 48px; }
.section-title h2 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 12px; }
.section-title p { color: #59547a; font-size: 1.05rem; }
.section-alt .section-title p { color: rgba(255,255,255,0.7); }

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 860px) { .value-grid { grid-template-columns: 1fr; } }
.value-card {
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-block);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.value-card:hover { transform: translateY(-8px) rotate(-0.5deg); box-shadow: 12px 12px 0 var(--border); }
.value-card .icon-badge {
  width: 56px; height: 56px;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 18px;
  border: 3px solid var(--border);
}
.value-card .icon-badge .icon { width: 28px; height: 28px; }
.value-card h3 { font-size: 1.3rem; margin-bottom: 10px; }
.value-card p { color: #55507a; }

.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
@media (max-width: 900px) { .steps-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps-grid { grid-template-columns: 1fr; } }
.step-card {
  background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  padding: 24px;
}
.step-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--lime);
  margin-bottom: 8px;
}

.fade-up { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
.fade-up.in-view { opacity: 1; transform: translateY(0); }

/* ===================================================================
   PRIVACY / GENERIC CONTENT PAGES
   =================================================================== */
.content-page { max-width: 760px; margin: 0 auto; padding: 64px 24px 90px; }
.content-page h1 { font-size: 2.2rem; margin-bottom: 8px; }
.content-page .updated { color: #6b6690; margin-bottom: 32px; }
.content-page h2 { font-size: 1.35rem; margin: 36px 0 12px; }
.content-page p, .content-page li { color: #38345a; line-height: 1.7; }
.content-page ul { padding-left: 22px; }
.content-page-img {
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-block-sm);
  margin: 28px 0;
}
.content-page-img img { display: block; width: 100%; }
.stat-feature-box {
  text-align: center;
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-block);
  padding: 36px 28px;
  margin: 32px 0;
}
.stat-feature-icon {
  width: 52px; height: 52px;
  border-radius: 15px;
  border: 3px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.stat-feature-icon .icon { width: 26px; height: 26px; }
.stat-feature-number { font-family: var(--font-display); font-size: 3rem; font-weight: 700; color: var(--purple); line-height: 1; margin-bottom: 12px; }
.stat-feature-box p { color: #4b4768; max-width: 460px; margin: 0 auto; }

/* ===================================================================
   EXPORT GUIDE
   =================================================================== */
.guide-hero { text-align: center; padding: 56px 24px 12px; max-width: 720px; margin: 0 auto; }
.guide-hero h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 14px; }
.guide-hero p { color: #4b4768; font-size: 1.08rem; }

.guide-steps { max-width: 860px; margin: 0 auto; padding: 40px 24px 40px; display: flex; flex-direction: column; gap: 28px; }
.guide-step {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-block-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.guide-step:hover { transform: translateY(-5px); box-shadow: 9px 9px 0 var(--border); }
.guide-step-num {
  flex-shrink: 0;
  width: 46px; height: 46px;
  border-radius: 13px;
  border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
}
.guide-step-body { flex: 1; min-width: 0; }
.guide-step-body h3 { font-size: 1.25rem; margin-bottom: 8px; }
.guide-step-body p { color: #4b4768; line-height: 1.6; margin-bottom: 16px; }
.guide-step-img {
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-block-sm);
  max-width: 460px;
}
.guide-step-img img { display: block; width: 100%; }
@media (max-width: 720px) {
  .guide-step { flex-direction: column; }
  .guide-step-num { margin-bottom: 4px; }
}

.guide-cta { text-align: center; padding: 10px 24px 90px; }
.guide-cta p { color: #4b4768; margin-bottom: 20px; }

/* ===================================================================
   FAQ
   =================================================================== */
.faq-list { max-width: 780px; margin: 0 auto; padding: 40px 24px; display: flex; flex-direction: column; gap: 16px; }
.faq-item {
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-block-sm);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.faq-item:hover { transform: translateY(-3px); box-shadow: 7px 7px 0 var(--border); }
.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item .faq-icon {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 9px;
  border: 2px solid var(--border);
  background: var(--lime);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-item .faq-answer { padding: 0 24px 22px; }
.faq-item .faq-answer p { color: #4b4768; line-height: 1.65; }
.faq-item .faq-answer a { color: var(--purple-dark); font-weight: 700; }
.faq-item .faq-answer code {
  background: var(--purple-light);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
}

/* ===================================================================
   ERROR PAGES
   =================================================================== */
.error-page { min-height: 60vh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; }
.error-page .code { font-family: var(--font-display); font-size: 5rem; font-weight: 700; color: var(--purple); }

/* ===================================================================
   DASHBOARD / REPORT
   =================================================================== */
.report-topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  color: var(--white);
  padding: 14px 0;
  border-bottom: 3px solid var(--border);
}
.report-topbar .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.report-brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; color: var(--white); text-decoration: none; }
.report-brand-logo { height: 30px; width: auto; border-radius: 7px; }
.report-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.report-nav a {
  text-decoration: none;
  color: rgba(255,255,255,0.75);
  font-weight: 600;
  font-size: 0.88rem;
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}
.report-nav a:hover, .report-nav a.active { background: var(--lime); color: var(--navy); }
.report-actions { display: flex; gap: 10px; }
.report-actions .btn { padding: 10px 18px; font-size: 0.85rem; }

.report-header {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: var(--white);
  padding: 48px 0 60px;
}
.report-header .container { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.company-logo {
  width: 92px; height: 92px;
  border-radius: 22px;
  background: var(--white);
  border: 4px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  color: var(--purple);
  overflow: hidden;
  flex-shrink: 0;
}
.company-logo img { width: 100%; height: 100%; object-fit: cover; }
.report-header h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-bottom: 6px; }
.report-header .subtitle { opacity: 0.85; }
.logo-upload-form { margin-top: 10px; }
.logo-upload-form label { font-size: 0.78rem; color: rgba(255,255,255,0.8); cursor: pointer; text-decoration: underline; }
.logo-upload-form input[type=file] { display:none; }

.report-body { padding: 0 0 100px; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}
@media (max-width: 980px) { .summary-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .summary-grid { grid-template-columns: 1fr; } }
.stat-tile {
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  padding: 22px;
  box-shadow: var(--shadow-block-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.stat-tile:hover { transform: translateY(-6px); box-shadow: 8px 8px 0 var(--border); }
.stat-tile .stat-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: #6b6690; margin-bottom: 6px; }
.stat-tile .stat-value { font-family: var(--font-display); font-size: 2.1rem; font-weight: 700; }
.stat-tile .stat-delta { font-size: 0.85rem; font-weight: 700; margin-top: 4px; }
.stat-tile .stat-delta.up { color: #0f9b6f; }
.stat-tile .stat-delta.down { color: var(--coral); }
.stat-value-accent { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; color: var(--mint); }
.percentile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  padding: 3px 11px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: var(--lime);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.percentile-badge .icon { width: 12px; height: 12px; }
.stat-tile:nth-child(1) { border-top: 8px solid var(--lime); }
.stat-tile:nth-child(2) { border-top: 8px solid var(--tangerine); }
.stat-tile:nth-child(3) { border-top: 8px solid var(--mint); }
.stat-tile:nth-child(4) { border-top: 8px solid var(--purple); }

.recommendations-section { padding: 48px 0 12px; }
.recommendations-section h2 { font-size: 1.5rem; margin-bottom: 18px; display: flex; align-items: center; gap: 12px; }
.reco-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .reco-grid { grid-template-columns: 1fr; } }
.reco-card {
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-block-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.reco-card:hover { transform: translateY(-6px); box-shadow: 9px 9px 0 var(--border); }
.reco-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.reco-icon .icon { width: 26px; height: 26px; }
.reco-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.reco-card p { color: #4b4768; font-size: 0.92rem; line-height: 1.55; }

.tip-panel {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-block-sm);
  padding: 28px;
}
.tip-panel-icon {
  flex: 0 0 auto;
  width: 52px; height: 52px;
  border-radius: 14px;
  border: 3px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.tip-panel-icon .icon { width: 26px; height: 26px; }
.tip-panel-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: #6b6690; margin-bottom: 8px; }
.tip-panel h3 { font-size: 1.3rem; margin-bottom: 10px; }
.tip-panel p { color: #4b4768; font-size: 0.95rem; line-height: 1.6; }
@media (max-width: 700px) { .tip-panel { flex-direction: column; } }

.report-section { padding: 70px 0; scroll-margin-top: 90px; border-bottom: 2px solid #ece7fb; }
.report-section:nth-child(odd) { background: var(--white); }
.report-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 10px; }
.report-section-head h2 { font-size: 1.9rem; display: flex; align-items: center; gap: 12px; }
.section-icon-badge {
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 3px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.section-icon-badge .icon { width: 21px; height: 21px; }
.back-to-top { font-size: 0.82rem; font-weight: 700; color: var(--purple-dark); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.back-to-top:hover { text-decoration: underline; }
.back-to-top .icon { width: 0.85em; height: 0.85em; }

.insight-callout {
  background: var(--purple-light);
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 28px;
  font-weight: 600;
}
.insight-callout strong { color: var(--purple-dark); }

.chart-card {
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-block-sm);
  padding: 24px;
  margin-bottom: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.chart-card:hover { transform: translateY(-5px); box-shadow: 8px 8px 0 var(--border); }
.chart-card h3 { font-size: 1.1rem; margin-bottom: 16px; }
.chart-canvas-wrap { position: relative; height: 320px; }
.chart-canvas-wrap.short { height: 240px; }

.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; }
@media (max-width: 900px) { .two-col { grid-template-columns: 1fr; } }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }

.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
  border-bottom: 2px solid #f1eefb;
  border-radius: 8px;
  transition: background 0.15s ease, padding 0.15s ease;
}
.rank-list li:hover { background: var(--purple-light); padding-left: 8px; padding-right: 8px; }
.rank-list .rank-bar-wrap { flex: 1; background: #f1eefb; border-radius: 999px; height: 10px; overflow: hidden; }
.rank-list .rank-bar { height: 100%; border-radius: 999px; background: var(--purple); }
.rank-list .rank-label { width: 160px; font-weight: 600; font-size: 0.88rem; flex-shrink: 0; }
.rank-list .rank-value { width: 60px; text-align: right; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data-table th, table.data-table td { text-align: left; padding: 10px 12px; border-bottom: 2px solid #f1eefb; }
table.data-table th { font-family: var(--font-display); font-size: 0.78rem; text-transform: uppercase; color: #6b6690; }
table.data-table tbody tr { transition: background 0.15s ease; }
table.data-table tbody tr:hover { background: #f6f3fd; }
table.data-table tr.self-row { background: var(--purple-light); font-weight: 700; }
table.data-table tr.self-row:hover { background: #ebe0fb; }
.table-scroll { overflow-x: auto; }

.post-card {
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 14px;
  background: var(--white);
  transition: transform 0.15s ease;
}
.post-card:hover { transform: translateX(4px); }
.post-card .post-title {
  font-weight: 700; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden; color: inherit; text-decoration: none;
}
.post-card .post-title:hover { text-decoration: underline; color: var(--purple-dark); }
.post-title-link-icon { width: 0.75em; height: 0.75em; display: inline-block; vertical-align: -0.05em; fill: currentColor; opacity: 0.6; }
.post-card .post-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.82rem; color: #6b6690; }
.post-card .post-tag { background: var(--purple-light); color: var(--purple-dark); padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 0.72rem; text-transform: uppercase; }
.post-tag-form { display: inline-flex; }
.post-tag-select {
  background: var(--purple-light);
  color: var(--purple-dark);
  border: 2px solid var(--purple-dark);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  cursor: pointer;
  font-family: var(--font-body);
}

.empty-state { text-align: center; padding: 40px 20px; color: #6b6690; border: 3px dashed #d9d3f4; border-radius: var(--radius-md); }

/* ===================================================================
   ADMIN
   =================================================================== */
.admin-shell { min-height: 100vh; background: var(--paper); }
.admin-topbar { background: var(--navy); color: var(--white); padding: 18px 0; }
.admin-topbar .container { display: flex; justify-content: space-between; align-items: center; }
.admin-topbar .brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; }
.admin-main { padding: 40px 24px; max-width: 1000px; margin: 0 auto; }
.admin-login-card {
  max-width: 400px; margin: 90px auto;
  background: var(--white);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-block);
}

/* ===================================================================
   PRINT (PDF export via browser print)
   =================================================================== */
@media print {
  .report-topbar, .site-footer, .flash-stack, .no-print { display: none !important; }
  .report-section { break-inside: avoid; padding: 24px 0; border: none; }
  .stat-tile:hover, .value-card:hover, .post-card:hover, .chart-card:hover, .reco-card:hover { transform: none; }
  body { background: var(--white); }
  .chart-canvas-wrap { height: 260px !important; }
}
