/* Creator Success Portal — styled after the Markable app: light gray page, white cards, violet accent. */
:root {
  --bg: #f9f9f9;
  --card: #ffffff;
  --ink: #1f1f1f;
  --muted: #6b6b6b;
  --line: #ececec;
  --hover: #f3f3f3;
  --field: #f4f4f4;
  --purple: #a169ec;
  --purple-ink: #7a4cc0;
  --purple-soft: #f6f1fd;
  --purple-tint: #ece3fa;
  --green: #031d1f;  /* the app's near-black teal: dark buttons and tiles */
  --green-hover: #0d3236;
  --green-soft: #e4eee8;
  --red: #b8443a;
  --red-soft: #fbe8e5;
  --serif: "Playfair Display", "Bodoni 72", Didot, Georgia, serif;
  --sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 20px;
  --topbar: 64px;
  --sidebar: 272px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--purple-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--purple); }
img { max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 6px; }

/* ---------- Brand bits ---------- */
.wordmark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
}
.wordmark .dot, .accent { color: var(--purple); }
.wordmark.small { font-size: 17px; }
.eyebrow {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--purple-ink);
}
.rule { width: 120px; height: 3px; background: var(--purple); border: 0; margin: 18px 0 0; }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(28px, 3.4vw, 38px); line-height: 1.12; }
h2 { font-size: 22px; line-height: 1.25; }
h3 { font-size: 18px; line-height: 1.3; }
.lede { color: var(--muted); font-size: 17px; margin: 10px 0 0; max-width: 62ch; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar);
  display: flex; align-items: center; gap: 16px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.menu-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-content: center; gap: 5px;
  background: transparent; border: 1px solid transparent; border-radius: 10px; cursor: pointer;
}
.menu-btn:hover { background: var(--hover); }
.menu-btn span { display: block; width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }
.topbar-label, .portal-name {
  font-family: var(--sans); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
  padding-left: 16px; border-left: 2px solid var(--purple); line-height: 1.1;
}
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.account-email { color: var(--muted); font-size: 13px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.avatar-initial {
  display: grid; place-items: center; background: var(--green); color: #fff; font-weight: 600; font-size: 14px;
}
.link-btn {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: 500 13px var(--sans); color: var(--ink); text-decoration: underline; text-underline-offset: 3px;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed; z-index: 25;
  top: var(--topbar); left: 0; bottom: 0;
  width: var(--sidebar);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 2px;
  background: var(--card);
  border-right: 1px solid var(--line);
  transition: transform 0.22s ease;
  overflow-y: auto;
}
.nav-label {
  margin: 18px 12px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--muted);
}
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14.5px; line-height: 1.3;
}
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item.is-active { background: var(--line); color: var(--ink); }
.nav-item .icon { width: 20px; height: 20px; flex: none; }
.soon {
  margin-left: auto; font-style: normal; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; background: var(--purple-soft); color: var(--purple-ink);
  white-space: nowrap;
}
.nav-item.is-active .soon { background: var(--card); }
.nav-ext { width: 14px; height: 14px; flex: none; margin-left: auto; color: var(--purple-ink); }
.nav-external:hover .nav-ext { color: var(--purple); }
.sidebar-foot {
  margin: auto 12px 4px; padding-top: 24px;
  font-family: var(--serif); font-size: 15px; text-transform: uppercase; letter-spacing: 0.02em; color: var(--muted);
}
.scrim { position: fixed; inset: var(--topbar) 0 0 0; z-index: 20; background: rgba(31, 31, 31, 0.28); }

/* ---------- Main ---------- */
.main {
  margin-left: var(--sidebar);
  padding: 48px clamp(16px, 4vw, 56px) 32px;
  min-height: calc(100vh - var(--topbar));
  display: flex; flex-direction: column;
  transition: margin-left 0.22s ease;
}
.page { width: 100%; max-width: 1040px; }
body.nav-collapsed .sidebar { transform: translateX(-100%); }
body.nav-collapsed .main { margin-left: 0; }
body.nav-collapsed .page { margin-inline: auto; }

.footer {
  margin-top: auto; padding-top: 48px;
  display: flex; flex-wrap: wrap; gap: 8px 24px; align-items: baseline; justify-content: space-between;
  max-width: 1040px; width: 100%;
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted);
}
body.nav-collapsed .footer { margin-inline: auto; }

/* ---------- Cards & tiles ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
}
.card + .card, .section + .section { margin-top: 20px; }
.tool-grid > .card, .two-col > .card { margin-top: 0; }
.card h2 + p, .card h3 + p { margin-top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; margin-top: 28px; }
.tile { border-radius: var(--radius); padding: 18px 20px; background: var(--card); border: 1px solid var(--line); }
.tile.dark { background: var(--green); border-color: var(--green); color: #fff; }
.tile .tile-label { font-size: 13.5px; color: var(--muted); }
.tile.dark .tile-label { color: rgba(255, 255, 255, 0.78); }
.tile .tile-value { font-size: 24px; font-weight: 700; line-height: 1.2; margin-top: 4px; }

.pill {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--green-soft); color: var(--green); white-space: nowrap;
}
.pill.purple { background: var(--purple-soft); color: var(--purple-ink); }
/* Navigation and category tags are neutral gray chips, like the app's; green stays for statuses. */
.intent-foot .pill:not(.purple), .tool-card .pill:not(.purple):not(.dark), .kb-table .pill { background: var(--hover); color: var(--ink); }
.pill.dark { background: var(--green); color: #fff; }

/* ---------- Home ---------- */
.hero { padding-bottom: 8px; }
.hero h1 .accent { font-style: normal; }
.intent-head { margin: 44px 0 14px; display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.intent-head h2 { font-size: 22px; }
.intents { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.intent {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 20px 22px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.intent:hover { color: var(--ink); border-color: var(--purple); transform: translateY(-2px); box-shadow: 0 8px 24px -14px rgba(31, 31, 31, 0.35); }
.intent-pre { font-size: 12.5px; color: var(--muted); }
.intent-text { font-size: 17px; font-weight: 600; line-height: 1.35; }
.intent-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.intent-foot .icon { width: 18px; height: 18px; color: var(--purple); transition: transform 0.15s; }
.intent:hover .intent-foot .icon { transform: translateX(3px); }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--ink); }
.tool-card:hover { color: var(--ink); border-color: var(--purple); }
.tool-card .icon { width: 26px; height: 26px; color: var(--purple); }
.tool-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Coming soon ---------- */
.soon-card { margin-top: 28px; display: grid; gap: 18px; grid-template-columns: 1fr auto; align-items: start; }
.soon-card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; }
.soon-card dt { color: var(--muted); }
.soon-card dd { margin: 0; font-weight: 500; }

/* ---------- Cheat sheet ---------- */
.sheet-head { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-end; }
.sheet-head > div:first-child { flex: 1 1 360px; min-width: 0; }
.sheet-meta { text-align: right; font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); line-height: 1.9; white-space: nowrap; }
.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.toc a {
  font-size: 13px; font-weight: 500; text-decoration: none; color: var(--ink);
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
}
.toc a:hover { border-color: var(--purple); color: var(--purple-ink); }
.section { scroll-margin-top: calc(var(--topbar) + 16px); }
.section > .eyebrow { margin-top: 40px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.two-col > .card + .card { margin-top: 0; }

.rows { margin-top: 10px; }
.row {
  display: grid; grid-template-columns: minmax(160px, 0.8fr) 1.6fr; gap: 6px 28px;
  padding: 14px 0; border-top: 1px solid var(--line);
}
.row:first-child { border-top: 0; }
.row-key { font-weight: 600; }
.row-val { color: #3d3d3d; font-size: 14.5px; }
.row-val p { margin: 0; }
.row-val p + p, .row-val ul { margin-top: 6px; }
.row-val ol.steps { margin: 8px 0 0; padding-left: 20px; }
.row-val ol.steps li + li { margin-top: 4px; }
.card > ol.steps { margin: 10px 0 0; padding-left: 22px; }
.card > ol.steps li + li { margin-top: 6px; }
ul.tight { margin: 6px 0 0; padding-left: 18px; }
ul.tight li + li { margin-top: 3px; }

.table-wrap { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th {
  text-align: left; font-weight: 600; font-size: 13px; background: #f5f5f5;
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: #3d3d3d; }
td:first-child { color: var(--ink); font-weight: 600; }
tr.highlight td { background: var(--purple-soft); }

.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.person { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.person b { display: block; font-size: 15px; }
.person span { font-size: 13px; color: var(--muted); }
.csas { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.csas .label { font-size: 13px; color: var(--muted); margin-right: 4px; }

.rubric { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; margin-top: 12px; }
.rubric div { padding: 12px 14px; border-radius: 12px; background: #f5f5f5; }
.rubric b { display: block; font-size: 14px; }
.rubric span { font-size: 13px; color: var(--muted); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: #f5f5f5; padding: 2px 6px; border-radius: 6px; }

.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; margin-top: 14px; }
.link-card {
  display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: var(--ink);
}
.link-card:hover { border-color: var(--purple); color: var(--ink); }
.link-card b { display: flex; justify-content: space-between; gap: 8px; font-size: 14.5px; }
.link-card b::after { content: "↗"; color: var(--purple); font-weight: 400; }
.link-card span { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------- Knowledge base ---------- */
.page-wide { max-width: 1280px; }
.kb-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.kb-controls {
  position: sticky; top: var(--topbar); z-index: 5;
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px;
  margin-top: 24px; padding: 14px 0; background: var(--bg);
}
.kb-field { display: flex; flex-direction: column; gap: 5px; min-width: 220px; }
.kb-field > span { font-size: 12px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.kb-search { flex: 1 1 320px; }
.kb-field input, .kb-field select {
  font: 15px var(--sans); color: var(--ink); background-color: var(--field);
  border: 1px solid var(--field); border-radius: 12px; padding: 11px 14px; min-height: 44px;
}
.kb-field select {
  appearance: none; -webkit-appearance: none; cursor: pointer;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 16px;
}
.kb-field select:hover { border-color: #dcdcdc; }
.kb-field input:focus, .kb-field select:focus { outline: none; border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-soft); }
.kb-controls .link-btn { align-self: center; margin-top: 18px; }
.kb-wrap { margin-top: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.kb-table { table-layout: fixed; }
.kb-table th { position: static; }
.kb-table th:nth-child(1) { width: 150px; }
.kb-table th:nth-child(2) { width: 22%; }
.kb-table th:nth-child(3) { width: 22%; }
.kb-table tr:last-child td { border-bottom: 0; }
.kb-table td:first-child { font-weight: 400; }
.kb-table .pill { white-space: normal; }
.kb-q { color: var(--ink); font-weight: 600; }
.kb-short { font-weight: 500; }
.kb-answer-text { white-space: pre-line; }
.kb-none { color: var(--muted); font-style: italic; font-size: 13px; }
.kb-copy {
  margin-top: 10px; padding: 5px 12px; border-radius: 999px; cursor: pointer;
  font: 500 12.5px var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line);
}
.kb-copy:hover { border-color: var(--purple); color: var(--purple-ink); }
.kb-copy.is-done { background: var(--green-soft); border-color: var(--green-soft); color: var(--green); }
.kb-table mark { background: var(--purple-soft); color: inherit; border-radius: 3px; padding: 0 1px; }
.kb-empty { margin: 0; padding: 28px; text-align: center; color: var(--muted); }
@media (max-width: 760px) {
  .kb-controls { position: static; }
  .kb-field { min-width: 0; flex: 1 1 100%; }
  .kb-table, .kb-table tbody, .kb-table tr, .kb-table td { display: block; width: 100%; }
  .kb-table thead { display: none; }
  .kb-table tr { padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .kb-table tr:last-child { border-bottom: 0; }
  .kb-table td { border: 0; padding: 4px 0; }
  .kb-table td:not(:first-child)::before {
    content: attr(data-label); display: block; margin-top: 8px;
    font-size: 11px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  }
}

/* ---------- Login ---------- */
body.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login {
  width: 100%; max-width: 980px;
  display: grid; grid-template-columns: 1.4fr 1fr; align-items: center; gap: 48px;
}
.brand-lockup { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }
.login-brand .wordmark { font-size: 34px; }
.login-brand .portal-name { font-size: 30px; padding-left: 18px; }
.login-brand h1 { margin-top: 28px; font-size: clamp(30px, 4.6vw, 52px); text-transform: uppercase; letter-spacing: -0.02em; font-weight: 600; }
.login-panel { border-left: 2px solid var(--line); padding-left: 40px; }
.login-panel h2 { font-size: 22px; }
.login-panel p { color: var(--muted); margin: 8px 0 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px 22px; border-radius: 999px; cursor: pointer;
  font: 600 15px var(--sans); text-decoration: none;
  background: var(--green); color: #fff; border: 1px solid var(--green);
}
.btn:hover { background: var(--green-hover); border-color: var(--green-hover); color: #fff; }
.btn.secondary { background: var(--line); color: var(--ink); border-color: var(--line); margin-top: 10px; }
.btn.secondary:hover { background: #e2e2e2; border-color: #e2e2e2; }
.btn svg { width: 18px; height: 18px; }
.notice { margin-top: 14px; font-size: 13px; color: var(--muted); background: #fff; border: 1px dashed var(--line); padding: 12px 14px; border-radius: 12px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); visibility: hidden; transition: transform 0.22s ease, visibility 0.22s; }
  body.nav-open .sidebar { transform: none; visibility: visible; box-shadow: 12px 0 32px -16px rgba(31, 31, 31, 0.35); }
  body.nav-collapsed .sidebar { transform: translateX(-100%); }
  .main { margin-left: 0; padding-top: 32px; }
  .account-email { display: none; }
  .topbar-label { font-size: 17px; padding-left: 12px; }
  .row { grid-template-columns: 1fr; }
  .sheet-meta { text-align: left; }
  .soon-card { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar-label { display: none; }
}
@media (max-width: 760px) {
  .login { grid-template-columns: 1fr; gap: 32px; }
  .login-panel { border-left: 0; border-top: 2px solid var(--line); padding: 28px 0 0; }
  .login-brand .wordmark { font-size: 28px; }
  .login-brand .portal-name { font-size: 24px; padding-left: 14px; }
}

/* ---------- AIP monthly report ---------- */
.mr-upload { margin-top: 28px; }
.mr-help { color: var(--muted); margin: 8px 0 0; }
.mr-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 18px; }
.mr-slot {
  position: relative; display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; align-items: center;
  padding: 18px 20px; border: 1.5px dashed #d9d9d9; border-radius: 14px; background: #fafafa;
  transition: border-color 0.15s, background 0.15s;
}
.mr-slot:hover, .mr-slot.is-drag { border-color: var(--purple); background: var(--purple-soft); }
.mr-slot:focus-within { outline: 2px solid var(--purple); outline-offset: 2px; }
.mr-slot.has-file { border-style: solid; border-color: var(--green); background: var(--green-soft); }
.mr-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; z-index: 2; }
.mr-step {
  grid-row: span 3; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--green); color: #fff; font-weight: 700; font-size: 14px;
}
.mr-title { font-weight: 700; font-size: 16px; }
.mr-path { font-size: 13px; color: var(--muted); }
.mr-file { font-size: 13.5px; font-weight: 500; color: var(--purple-ink); margin-top: 6px; overflow-wrap: anywhere; }
.mr-slot.has-file .mr-file { color: var(--green); }
.mr-slot.has-file .mr-file::before { content: "✓ "; }
.mr-check { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 14px; cursor: pointer; }
.mr-check input { width: 16px; height: 16px; margin-top: 2px; flex: none; accent-color: var(--purple); }
.mr-check-note { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.mr-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 18px; }
.mr-submit { width: auto; padding-inline: 26px; }
.mr-submit:disabled { opacity: 0.6; cursor: progress; }
.mr-note { font-size: 13px; color: var(--muted); }
.mr-alert, .mr-warn { margin-top: 16px; padding: 14px 16px; border-radius: 12px; font-size: 14px; }
.mr-alert { background: var(--red-soft); color: #6e2620; }
.mr-warn { background: #fdf4dd; color: #5b4510; }
.mr-alert ul, .mr-warn ul { margin-top: 4px; }

.mr-report { margin-top: 44px; scroll-margin-top: calc(var(--topbar) + 16px); }
.mr-h2 { font-size: 30px; }
.mr-sub { margin: 6px 0 0; color: var(--muted); }
.mr-sub span { color: #c4c4c4; margin: 0 6px; }
.mr-tiles { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: 20px; }
.mr-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.mr-table th, .mr-table td { vertical-align: middle; }
.mr-table tr:last-child td { border-bottom: 0; }
.mr-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mr-table th.num .th-info { justify-content: flex-end; }
.mr-rank { width: 44px; color: var(--muted) !important; }
.mr-name { min-width: 220px; color: var(--ink) !important; font-weight: 500; }
.mr-link {
  color: var(--purple-ink); font-weight: 600; text-decoration: underline;
  text-decoration-color: rgba(122, 53, 189, 0.35); text-underline-offset: 3px;
}
.mr-link:hover { color: var(--purple); text-decoration-color: currentColor; }
.mr-ext { width: 13px; height: 13px; margin-left: 5px; vertical-align: -1px; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.mr-gmv { color: var(--ink) !important; font-weight: 600; }
.mr-tbd { color: #bdbdbd; }
.mr-foot { margin: 10px 2px 0; font-size: 12.5px; color: var(--muted); }

.th-info { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.info {
  width: 17px; height: 17px; padding: 0; border-radius: 50%; cursor: help;
  display: inline-grid; place-items: center;
  font: italic 700 11px/1 Georgia, serif; color: var(--purple-ink);
  background: var(--purple-soft); border: 1px solid #e0cff4;
}
.tip {
  display: none; position: absolute; top: calc(100% + 8px); right: -6px; z-index: 10; width: 240px;
  padding: 10px 12px; border-radius: 10px; background: var(--ink); color: #fff;
  font-family: var(--sans); letter-spacing: normal; text-transform: none;
  font-size: 12.5px; font-weight: 400; line-height: 1.45; text-align: left; white-space: normal;
  box-shadow: 0 10px 24px -12px rgba(31, 31, 31, 0.5);
}
.info:hover + .tip, .info:focus + .tip { display: block; }
.mr-table th.num { white-space: normal; vertical-align: bottom; }
.mr-table th.num .th-label { max-width: 96px; text-align: right; line-height: 1.3; }
.mr-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.mr-table { font-size: 13.5px; }
.mr-table th, .mr-table td { padding: 10px 8px; }
.mr-table th:first-child, .mr-table td:first-child { padding-left: 14px; }
.mr-table th:last-child, .mr-table td:last-child { padding-right: 14px; }
.mr-table th.num .th-label { max-width: 80px; }
.mr-rank { width: 36px; }
.mr-name { min-width: 180px; }
.mr-table th { font-size: 12.5px; }
.mr-table th, .mr-table td { padding-inline: 7px; }
.mr-name { min-width: 170px; }
.mr-nowrap { white-space: nowrap; }
.tip-src { display: block; margin-top: 6px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.18); color: rgba(255, 255, 255, 0.72); font-size: 11.5px; }
.tip.tip-start { right: auto; left: -6px; }
.tile.dark .info { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); color: #fff; }
.tile.dark .tip { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.tile.dark .tip-src { color: var(--muted); border-top-color: var(--line); }
.mr-tiles { gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.mr-tiles .tile { padding: 16px 16px 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.mr-tiles .tile-label { white-space: nowrap; font-size: 13px; }
.mr-tiles { display: flex; flex-wrap: wrap; }
.mr-tiles .tile { flex: 1 1 0; min-width: max-content; }
.mr-tracking { white-space: nowrap; font-variant-numeric: tabular-nums; }
.mr-table { font-size: 13px; }
.mr-table th, .mr-table td { padding-inline: 6px; }
.mr-name { min-width: 150px; }
.mr-tracking { font-size: 12px; color: var(--muted) !important; }
/* Table headers: label wraps freely, info button follows the last word; tooltips anchor to the cell. */
.mr-table th { position: relative; white-space: normal; vertical-align: bottom; line-height: 1.3; }
.mr-table th .th-info { position: static; display: inline; }
.mr-table th .th-label { display: inline; max-width: none; }
.mr-table th .info { display: inline-grid; margin-left: 3px; }
.mr-table th .tip { right: 2px; }
.mr-table th .tip.tip-start { right: auto; left: 2px; }
.mr-table th.num { text-align: right; }
/* Info icons sit centered on the line of text they follow, everywhere (labels, headings, table headers). */
.mr-nowrap > .info { margin-left: 5px; vertical-align: middle; position: relative; top: -1px; }
.mr-table th .info { width: 15px; height: 15px; font-size: 10px; margin-left: 3px; }
.mr-name { min-width: 140px; }
.mr-hint { display: block; margin-top: 2px; color: var(--ink); opacity: 0.8; }
.mr-formats { display: block; margin-top: 4px; }
.mr-table .pill { font-size: 11.5px; padding: 2px 8px; }
.pill.status-stopped { background: #efefef; color: #5f5f5f; }
.pill.status-rejected { background: var(--red-soft); color: var(--red); }
.pill.status-pending, .pill.status-in-review { background: #fdf4dd; color: #6b5212; }
/* Launch-month colors, shared by the portfolio bar and the Launched pills (palette from the UX mock):
   0 = report month (palest) … 3 = three or more months earlier (dark green). */
.launch-0 { background: #e9e0fa; color: #5a2a91; }
.launch-1 { background: #c6b0ef; color: #34125a; }
.launch-2 { background: #9db7a6; color: #0f2a21; }
.launch-3 { background: #1f4a3c; color: #fff; }
.launch-unknown { background: #ededed; color: #5f5f5f; }

/* At a Glance */
.mr-glance { display: grid; grid-template-columns: minmax(220px, 0.9fr) 3fr; gap: 12px; margin-top: 20px; }
.mr-glance .tile { padding: 16px 18px 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; }
.mr-glance .tile-label { white-space: nowrap; font-size: 13px; }
.mr-hero { justify-content: flex-end !important; }
.mr-hero .tile-label { font-size: 15px; }
.mr-hero .tile-value { font-size: 34px; letter-spacing: -0.01em; }
.mr-glance-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

.mr-portfolio { margin-top: 12px; }
.mr-portfolio-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.mr-portfolio-head h3 { font-size: 22px; }
.mr-portfolio-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.mr-portfolio-total { text-align: right; }
.mr-portfolio-total b { display: block; font-size: 24px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.mr-portfolio-total span { font-size: 13px; color: var(--muted); }
.mr-bar { display: flex; height: 44px; margin-top: 16px; border-radius: 10px; overflow: hidden; gap: 2px; background: var(--card); }
.mr-seg {
  flex-basis: 0; min-width: 4px; display: grid; place-items: center;
  font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.mr-bar-legend { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13.5px; color: #3d3d3d; }
.mr-bar-legend li { display: inline-flex; align-items: center; gap: 8px; }
.mr-dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.mr-callout { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: #f5f5f5; font-size: 14px; }
.mr-callout b { color: var(--purple-ink); }

.mr-table-head { margin-top: 40px; }
.mr-ranked { margin: 6px 0 12px; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) {
  .mr-glance { grid-template-columns: 1fr; }
  .mr-glance-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mr-glance .tile-label { white-space: normal; }
  .mr-portfolio-total { text-align: left; }
}
.mr-subhead { margin-top: 28px; font-size: 21px; }
.mr-subhead + .mr-glance { margin-top: 12px; }
.mr-table-head { margin-top: 36px; }
.mr-table-head .mr-subhead { margin-top: 0; }
.mr-ranked { margin-top: 4px; }
.brand-link { display: flex; align-items: center; gap: 16px; text-decoration: none; border-radius: 8px; }
.brand-link .wordmark, .brand-link .topbar-label { transition: color 0.15s; }
.brand-link:hover .wordmark, .brand-link:hover .topbar-label { color: var(--purple-ink); }
.mr-slots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mr-slot { align-items: start; align-content: start; }
.mr-step { grid-row: span 4; }
@media (max-width: 760px) { .mr-slots { grid-template-columns: 1fr; } }

/* Month Year Results */
.mr-results-title { font-size: clamp(30px, 3.6vw, 40px); line-height: 1.1; }
.mr-results { margin-top: 18px; }
.mr-results .mr-hero .tile-value { font-size: 44px; }
.tip.tip-wide { width: 300px; }
.mr-addup { margin-top: 12px; }
.mr-addup h3 { font-size: 21px; }
.mr-lines { list-style: none; margin: 12px 0 0; padding: 0; }
.mr-line {
  display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.mr-line:last-child { border-bottom: 0; }
.mr-line .th-info { position: relative; }
.mr-line-label { color: #3d3d3d; }
.mr-line-value { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mr-line.is-sub .mr-line-value { color: var(--muted); }
.mr-line.is-subtotal .mr-line-label, .mr-line.is-subtotal .mr-line-value { color: var(--ink); font-weight: 700; }
.mr-line.is-final {
  margin-top: 8px; padding: 14px 16px; border: 0; border-radius: 12px; background: var(--green);
  font-size: 17px;
}
.mr-line.is-final .mr-line-label, .mr-line.is-final .mr-line-value { color: #fff; font-weight: 700; }
.mr-line.is-final .mr-line-value { font-size: 22px; }
.mr-line.is-final .dot-ring { box-shadow: inset 0 0 0 2px #fff; }
.mr-line.is-final .cf-line-cap { color: rgba(255, 255, 255, 0.75); }
.mr-line.is-final .info { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); color: #fff; }
.mr-line-dot { width: 14px; height: 14px; border-radius: 50%; }
.dot-purple { background: #b48ef0; }
.dot-lavender { background: #d9c6f6; }
.dot-grey { background: #a9a9a6; }
.dot-green { background: var(--green); }
.dot-sage { background: #9db7a6; }
.dot-ring { box-shadow: inset 0 0 0 2px var(--ink); }
.mr-section { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* Bonus achievement */
.mr-bonus { margin-top: 12px; }
.mr-bonus-head { display: flex; justify-content: space-between; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.mr-bonus-head h3 { font-size: 21px; }
.mr-bonus-head h3 .th-info { position: relative; }
.mr-bonus-summary { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; color: #3d3d3d; }
.mr-progress { margin-top: 34px; }
.mr-progress-track { position: relative; height: 18px; border-radius: 999px; background: #efefef; }
.mr-progress-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.mr-progress-fill.is-boosted { background: #b48ef0; }
.mr-progress-fill.is-organic { background: #9db7a6; }
.mr-goal { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: #bdbdbd; }
.mr-goal.is-done { background: var(--green); }
.mr-goal span {
  position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap;
}
.mr-goal.is-done span { color: var(--green); }
.mr-dot-ring { box-shadow: inset 0 0 0 2px var(--ink); }
.mr-progress .mr-bar-legend { margin-top: 22px; gap: 10px 32px; }
.mr-progress .mr-bar-legend li { align-items: flex-start; }
.mr-progress .mr-bar-legend .mr-dot { margin-top: 3px; }
.mr-progress .mr-bar-legend b { display: block; margin-top: 1px; font-size: 15px; }
.mr-bonus .table-wrap { margin-top: 16px; border: 1px solid var(--line); border-radius: 12px; }
.mr-bonus-table { font-size: 13.5px; }
.mr-bonus-table td, .mr-bonus-table th { padding: 9px 12px; vertical-align: middle; }
.mr-bonus-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.mr-bonus-table tr:last-child td { border-bottom: 0; }
.mr-bonus-table tr.is-open td { color: var(--muted); }
.mr-bonus-table .pill { font-size: 11.5px; padding: 2px 8px; }
.pill.reach-organic { background: #dce8e0; color: #1f4a3c; }
.pill.reach-boosted { background: #ece1fb; color: #5a2a91; }
/* Content success (pills, success rate bar) and the content goal donut. */
.pill.success-yes { background: #dce8e0; color: #1f4a3c; }
.pill.success-no { background: #efefef; color: #5f5f5f; }
.success-seg-yes { background: #9db7a6; color: #0f2a21; }
.success-seg-no { background: #e4e4e4; color: #5f5f5f; }
.mr-success { margin-top: 12px; }
.cf-portfolio + .cf-success { margin-top: 12px; }
.mr-by { white-space: nowrap; }
.mr-success-cell { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.mr-success-cell .th-info { position: static; }
.tip.tip-fixed { position: fixed; top: 0; left: 0; right: auto; width: 280px; z-index: 50; }
.mr-goal-card { margin-top: 12px; }
.mr-goal-title { font-size: 21px; }
.mr-goal-title .th-info { position: relative; }
.mr-goal-sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.mr-goal-sub b { color: var(--ink); }
.mr-goal-body { display: flex; align-items: center; gap: 18px 32px; flex-wrap: wrap; margin-top: 14px; }
.mr-donut { width: 170px; height: 170px; flex: none; }
.mr-donut circle { transition: none; }
.mr-donut-num { font-family: var(--sans); font-size: 7px; font-weight: 700; fill: var(--ink); }
.mr-donut-cap { font-family: var(--sans); font-size: 3.2px; fill: var(--muted); }
.goal-seg-creator { stroke: #9db7a6; background: #9db7a6; }
.goal-seg-markable { stroke: #a169ec; background: #a169ec; }
.goal-seg-needed { stroke: #e7e2d8; background: #e7e2d8; }
.mr-goal-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 260px; max-width: 460px; }
.mr-goal-legend li { display: grid; grid-template-columns: 14px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.mr-goal-legend li:last-child { border-bottom: 0; }
.mr-goal-legend .mr-dot { width: 14px; height: 14px; }
.mr-goal-legend b { white-space: nowrap; }
.mr-goal-note { margin-top: 14px; }
.mr-bonus-sum { margin-top: 10px; }
/* Phones: show info blurbs as a panel pinned to the bottom of the screen so they never run off the edge. */
@media (max-width: 760px) {
  .tip, .tip.tip-wide, .tip.tip-start, .mr-table th .tip, .mr-table th .tip.tip-start {
    position: fixed; top: auto; bottom: 16px; left: 16px; right: 16px; width: auto; z-index: 40;
  }
}
.mr-threshold { color: var(--muted); }
.mr-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; font-size: 10.5px; font-weight: 600; background: #ece1fb; color: #5a2a91; vertical-align: 1px; }
.mr-tag.is-organic { background: #dce8e0; color: #1f4a3c; }
.mr-bonus-table tr:has(.mr-tag) td { background: #fafafa; }
.mr-line.is-loss .mr-line-value { color: var(--red); }
.mr-loss-note { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: #fdf4dd; color: #5b4510; font-size: 13.5px; }
.mr-disclaimer { margin: 6px 0 0; max-width: 78ch; font-size: 13px; line-height: 1.5; color: var(--muted); }
.mr-results-head { align-items: flex-start; }
.mr-results-head .sheet-meta { margin: 0; line-height: 1.5; }
@media (max-width: 760px) { .mr-results-head { flex-direction: column-reverse; gap: 6px; } }

/* ---------- Two outputs: creator-facing (PDF) and CS team-internal ---------- */
#outputs { margin-top: 44px; scroll-margin-top: calc(var(--topbar) + 16px); }
#outputs > .mr-warn { margin: 0 0 18px; }
.out-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 14px 24px; flex-wrap: wrap;
  padding: 18px 22px; border-radius: var(--radius); background: var(--purple-soft); border: 1px solid #e0cff4;
}
.out-bar .eyebrow { margin-bottom: 2px; }
.out-bar .mr-h2 { font-size: 28px; }
.out-note { margin: 6px 0 0; max-width: 70ch; font-size: 14px; color: #3d3d3d; }
.cf-download { width: auto; padding-inline: 24px; flex: none; }
.out-next {
  display: block; margin-top: 48px; text-align: center; font-size: 13.5px; font-weight: 600;
  color: var(--purple-ink); text-decoration: none;
}
.out-next:hover { text-decoration: underline; }
.out-bar-internal { background: var(--ink); border-color: var(--ink); color: #fff; }
.out-bar-internal .eyebrow { color: #cdb2f3; }
.out-bar-internal .out-note { color: rgba(255, 255, 255, 0.8); }
.mr-report { margin-top: 24px; }
.mr-report > .out-bar { margin-bottom: 28px; }

/* The creator-facing document. Hidden on screen (only the Download PDF button shows); printed as the PDF. */
@media screen { .cf-doc { display: none; } }
.cf-doc {
  margin-top: 16px; padding: 40px 44px 28px; background: #ffffff; border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 18px 40px -28px rgba(31, 31, 31, 0.45);
}
.cf-brand { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.cf-kicker, .cf-foot { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); }
.cf-head-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; margin-top: 14px; }
.cf-doc h1, .cf-doc h2, .cf-doc h3 { font-family: var(--sans); letter-spacing: -0.015em; }
.cf-title { font-size: clamp(30px, 3.6vw, 42px); }
.cf-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
/* "Amazon only" note under the report title (both reports, creator PDF and internal output). */
.cf-scope { margin: 6px 0 0; font-size: 13px; color: var(--ink); }
.cf-legal { margin: 16px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted); }
.mr-legal { margin: 18px 2px 0; max-width: 110ch; font-size: 12px; line-height: 1.5; color: var(--muted); }
.cf-legal p, .mr-legal p { margin: 0; }
.cf-legal p + p, .mr-legal p + p { margin-top: 4px; }
.cf-legal-title, .mr-legal-title { color: var(--ink); font-weight: 600; }
.cf-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 13px; color: #3d3d3d; }
.cf-section { margin-top: 18px; }
.cf-cap { margin: 6px 0 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.tile.dark .cf-cap { color: rgba(255, 255, 255, 0.75); }
.cf-card { padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); }
.cf-h2 { font-size: 22px; }
.cf-line-cap { display: block; margin-top: 1px; font-size: 12px; font-weight: 400; color: var(--muted); }
.cf-lines { margin-top: 8px; }
.cf-lines .mr-line { padding: 7px 0; }
.cf-lines .mr-line.is-final { padding: 12px 14px; }
.cf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cf-table th { padding: 7px 8px; font-size: 11.5px; background: #f5f5f5; }
.cf-table td { padding: 7px 8px; vertical-align: middle; color: #3d3d3d; }
.cf-table td:first-child { font-weight: 600; color: var(--ink); }
.cf-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cf-table .pill { font-size: 11px; padding: 1px 7px; }
/* Boosted content performance: At a glance (portfolio) + Detailed view (content table) */
.cf-perf { margin-top: 26px; }
.cf-doc .cf-h3, .cf-h3 {
  margin: 18px 0 8px; font-family: var(--sans); font-size: 12px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--purple-ink);
}
.cf-h4 { margin: 0; font-family: var(--sans); font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.cf-content { margin-top: 0; }
.cf-glance { margin-top: 0; }
.cf-glance .cf-cap { margin-top: 2px; }
.cf-glance + .cf-portfolio { margin-top: 12px; }
.cf-content-table { margin-top: 10px; }
.cf-content-table .cf-rank { width: 30px; color: var(--muted); font-weight: 400; }
.cf-content-table .cf-gmv { color: var(--ink); font-weight: 600; }
.cf-content-table .cf-tracking { white-space: nowrap; color: var(--muted); }
/* Content thumbnail to the left of the content name (both outputs). */
.mr-content { display: flex; align-items: center; gap: 10px; }
.mr-thumb {
  flex: none; display: block; width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
  background: var(--field); border: 1px solid var(--line);
}
.mr-name { min-width: 200px; }
.mr-type { white-space: nowrap; font-size: 12.5px; }
.cf-content-table .mr-thumb { width: 34px; height: 34px; border-radius: 6px; }
.cf-content-table .cf-name { min-width: 150px; }
.cf-content-table .cf-type { white-space: nowrap; }
.th-asof { display: block; font-weight: 500; white-space: nowrap; color: var(--muted); }
.mr-table .th-asof { white-space: normal; }
.cf-glossary { margin: 12px 0 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.cf-glossary b { color: #3d3d3d; }
.cf-foot { display: flex; justify-content: space-between; align-items: baseline; margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 760px) {
  .cf-doc { padding: 22px 16px; }
    .cf-meta { align-items: flex-start; }
  .cf-content { overflow-x: auto; }
}

/* Download PDF = print only the creator-facing document (monthly_report.js adds body.print-creator). */
@media print {
  @page { size: letter; margin: 0.45in; }
  body.print-creator { background: #fff; font-size: 12px; }
  body.print-creator * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.print-creator .topbar, body.print-creator .sidebar, body.print-creator .scrim, body.print-creator .footer,
  body.print-creator .page > *:not(#outputs), body.print-creator #outputs > *:not(#creator),
  body.print-creator #creator > .out-bar, body.print-creator #creator > .out-next { display: none !important; }
  body.print-creator .main { margin: 0 !important; padding: 0 !important; min-height: 0; display: block; }
  body.print-creator .page { max-width: none; }
  body.print-creator #outputs { margin: 0; }
  body.print-creator .cf-doc { margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: #fff; }
  /* Sections flow across pages (no gaps): only small pieces stay whole, and headings and captions stay
     with what follows them. */
  body.print-creator .cf-section { break-inside: auto; }
  body.print-creator .cf-doc .cf-h2, body.print-creator .cf-doc .cf-h3, body.print-creator .cf-doc .cf-h4,
  body.print-creator .cf-doc .cf-section > .cf-cap, body.print-creator .mr-bonus-head { break-after: avoid; }
  body.print-creator .cf-doc .tile, body.print-creator .cf-doc .mr-line, body.print-creator .cf-glance,
  body.print-creator .cf-portfolio, body.print-creator .mr-progress, body.print-creator .cf-doc tr { break-inside: avoid; }
  /* Detailed view follows right after the success rate card (no forced new page); its headings stay
     with the first rows of the table. */
  body.print-creator .cf-content { break-inside: auto; overflow: visible; margin-top: 16px; }
  body.print-creator .cf-content > .cf-h3, body.print-creator .cf-content > .cf-h4,
  body.print-creator .cf-content > .cf-cap { break-after: avoid; }
  body.print-creator .cf-content > .cf-h3 { margin-top: 0; }
  body.print-creator .cf-table tr { break-inside: avoid; }
  body.print-creator .cf-table thead { display: table-header-group; }
}
/* Print: compact sizing for the creator PDF. */
@media print {
  body.print-creator .cf-head-row { margin-top: 8px; }
  body.print-creator .cf-title { font-size: 30px; }
  body.print-creator .cf-sub { font-size: 12px; margin-top: 2px; }
  body.print-creator .cf-scope { font-size: 11px; margin-top: 2px; }
  body.print-creator .cf-legal { font-size: 8px; line-height: 1.4; margin-top: 10px; break-inside: avoid; }
  body.print-creator .cf-meta { font-size: 11.5px; gap: 4px; }
  body.print-creator .cf-section { margin-top: 12px; }
  body.print-creator .cf-cap { font-size: 10px; line-height: 1.35; margin-top: 3px; }
  body.print-creator .cf-card { padding: 12px 16px; border-radius: 12px; }
  body.print-creator .cf-h2 { font-size: 17px; }
  body.print-creator .cf-lines { margin-top: 4px; }
  body.print-creator .cf-lines .mr-line { padding: 4px 0; font-size: 12px; gap: 10px; grid-template-columns: 10px 1fr auto; }
  body.print-creator .cf-lines .mr-line-dot { width: 10px; height: 10px; }
  body.print-creator .cf-lines .mr-line.is-final { margin-top: 6px; padding: 8px 12px; font-size: 13.5px; }
  body.print-creator .cf-lines .mr-line.is-final .mr-line-value { font-size: 17px; }
  body.print-creator .cf-line-cap { font-size: 10px; margin-top: 0; }
  body.print-creator .cf-table { font-size: 10.5px; }
  body.print-creator .cf-table th { font-size: 10px; padding: 5px 6px; }
  body.print-creator .cf-table td { padding: 4px 6px; }
  body.print-creator .cf-table .pill { font-size: 9.5px; padding: 1px 6px; }
  body.print-creator .cf-content-table .mr-ext { width: 10px; height: 10px; margin-left: 4px; }
  body.print-creator .cf-content-table .mr-thumb { width: 28px; height: 28px; border-radius: 5px; }
  body.print-creator .cf-content-table .mr-content { gap: 7px; }
  body.print-creator .cf-perf { margin-top: 14px; }
  body.print-creator .cf-h3 { margin: 10px 0 6px; font-size: 10.5px; }
  body.print-creator .cf-h4 { font-size: 15px; }
  body.print-creator .mr-bar { height: 30px; margin-top: 10px; }
  body.print-creator .mr-seg { font-size: 11px; }
  body.print-creator .mr-bar-legend { margin-top: 8px; font-size: 11px; gap: 6px 16px; }
  body.print-creator .mr-callout { margin-top: 10px; padding: 8px 12px; font-size: 11.5px; }
  body.print-creator .cf-glossary { font-size: 9.5px; }
  body.print-creator .cf-foot { margin-top: 14px; font-size: 9px; }
  body.print-creator .cf-glossary { break-inside: avoid; }
  /* Bonus card (shared with output 2) and At a glance tiles, sized down for print */
  body.print-creator .cf-bonus-card.mr-bonus { margin-top: 0; }
  body.print-creator .cf-goal { break-inside: avoid; }
  body.print-creator .cf-success { break-inside: avoid; }
  body.print-creator .mr-goal-body { margin-top: 8px; gap: 12px 24px; flex-wrap: nowrap; }
  body.print-creator .mr-donut { width: 120px; height: 120px; }
  body.print-creator .mr-goal-legend li { padding: 6px 0; font-size: 11.5px; }
  body.print-creator .mr-goal-legend .mr-dot { width: 10px; height: 10px; }
  body.print-creator .mr-goal-note { margin-top: 8px; }
  body.print-creator .cf-portfolio .mr-portfolio-total b { font-size: 17px; }
  body.print-creator .cf-portfolio .mr-portfolio-total span { font-size: 10px; }
  body.print-creator .mr-bonus-head h3 { font-size: 17px; }
  body.print-creator .mr-bonus-summary { font-size: 11.5px; gap: 8px; }
  body.print-creator .mr-bonus .pill { font-size: 9.5px; padding: 1px 6px; }
  body.print-creator .mr-progress { margin-top: 26px; }
  body.print-creator .mr-progress-track { height: 14px; }
  body.print-creator .mr-goal span { font-size: 10px; }
  body.print-creator .mr-progress .mr-bar-legend { margin-top: 16px; }
  body.print-creator .mr-progress .mr-bar-legend b { font-size: 12.5px; }
  body.print-creator .mr-bonus .table-wrap { margin-top: 10px; border-radius: 10px; }
  body.print-creator .mr-bonus-table { font-size: 10.5px; }
  body.print-creator .mr-bonus-table td, body.print-creator .mr-bonus-table th { padding: 4px 8px; }
  body.print-creator .mr-tag { font-size: 9px; padding: 0 6px; }
  body.print-creator .mr-bonus-sum { margin-top: 4px; }
  body.print-creator .mr-bonus-sum .mr-line { padding: 4px 0; font-size: 12px; gap: 10px; grid-template-columns: 10px 1fr auto; }
  body.print-creator .mr-bonus-sum .mr-line-dot { width: 10px; height: 10px; }
  body.print-creator .cf-glance { margin-top: 0; gap: 8px; grid-template-columns: minmax(0, 0.9fr) 3fr; }
  body.print-creator .cf-glance .mr-glance-grid { gap: 8px; }
  body.print-creator .cf-glance .tile { padding: 10px 12px; border-radius: 12px; gap: 2px; }
  body.print-creator .cf-glance .tile-label { font-size: 11px; }
  body.print-creator .cf-glance .tile-value { font-size: 17px; }
  body.print-creator .cf-glance .mr-hero .tile-value { font-size: 24px; }
  body.print-creator .cf-glance + .cf-portfolio { margin-top: 10px; }
  body.print-creator .mr-bonus-table th { font-size: 10px; }
  body.print-creator .mr-bonus-sum .mr-line { padding: 3px 0; }
  body.print-creator .mr-bonus .cf-line-cap { font-size: 9.5px; }
  body.print-creator .cf-glance .tile { padding: 7px 10px; }
  body.print-creator .cf-glance .tile-value { font-size: 15px; }
  body.print-creator .cf-glance .cf-cap { font-size: 9.5px; margin-top: 1px; }
  body.print-creator .cf-glance .mr-hero .tile-value { font-size: 22px; }
  body.print-creator .cf-perf { margin-top: 10px; }
  body.print-creator .cf-perf > .cf-cap { margin-top: 1px; }
  body.print-creator .cf-portfolio .mr-bar { height: 24px; margin-top: 8px; }
  body.print-creator .cf-portfolio .mr-bar-legend { margin-top: 6px; }
  body.print-creator .cf-portfolio .mr-callout { margin-top: 8px; padding: 6px 10px; }
  /* Results tiles at the top of the PDF (same layout as output 2), larger than At a glance */
  body.print-creator .cf-results .mr-glance-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  body.print-creator .cf-glance .mr-glance-grid .tile { justify-content: flex-start; }
  body.print-creator .cf-head-row { flex-wrap: nowrap; }
  body.print-creator .cf-head-row > div:first-child { min-width: 0; }
  body.print-creator .cf-meta { flex: none; }
  body.print-creator .cf-results .tile { padding: 10px 12px; }
  body.print-creator .cf-results .tile-value { font-size: 19px; }
  body.print-creator .cf-results .cf-cap { font-size: 10px; }
  body.print-creator .cf-results .mr-hero .tile-label { font-size: 13px; }
  body.print-creator .cf-results .mr-hero .tile-value { font-size: 34px; }
  body.print-creator .cf-results .mr-hero .cf-cap { font-size: 10.5px; }
}

/* ===== Creator Weekly Flash Report (templates/weekly_flash.html). Reuses the monthly report's creator
   document (cf-*) and its Download PDF print styles. Like the monthly report, it only shows in the PDF. ===== */
.fr-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 18px; margin-top: 12px; }
.fr-stat { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 12px; background: #faf9f7; }
.fr-stat-label { font-size: 12.5px; color: var(--muted); }
.fr-stat b { font-size: 20px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.fr-stat .cf-cap { margin-top: 2px; }
.fr-chart { display: block; width: 100%; height: auto; max-height: 220px; margin-top: 8px; }
.fr-axis { stroke: #d9d9d9; stroke-width: 1; }
.fr-bar { fill: #c7a6f3; }
.fr-bar.is-peak { fill: var(--purple); }
.fr-chart g:hover .fr-bar { fill: var(--purple-ink); }
.fr-bar-label { font-size: 13px; font-weight: 700; fill: var(--ink); font-variant-numeric: tabular-nums; }
.fr-day { font-size: 12px; fill: var(--muted); }
.fr-daily { margin-top: 8px; }
.fr-daily td:first-child { font-weight: 500; }
.fr-top .cf-content-table { margin-top: 10px; }
.fr-new { margin-left: 6px; font-size: 10.5px; padding: 1px 7px; white-space: nowrap; }
.fr-empty { margin: 10px 0 0; color: var(--muted); font-size: 13.5px; }
.fr-insights { margin: 10px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.55; }
.fr-insights li + li { margin-top: 6px; }
.fr-insights li::marker { color: var(--purple); }
.fr-goal-row { display: flex; flex-wrap: wrap; gap: 16px 28px; align-items: flex-start; margin-top: 12px; }
.fr-target { flex: 0 0 210px; }
.fr-content-goal { flex: 1 1 320px; min-width: 0; }
.fr-goal-head { margin: 0; font-size: 14px; }
.fr-content-goal .mr-goal-body { margin-top: 10px; }
@media print {
  body.print-creator .fr-stats { gap: 6px 10px; margin-top: 8px; }
  body.print-creator .fr-stat { padding: 6px 9px; border-radius: 8px; }
  body.print-creator .fr-stat-label { font-size: 10px; }
  body.print-creator .fr-stat b { font-size: 14px; }
  body.print-creator .fr-chart { max-height: 120px; margin-top: 4px; }
  /* The day-by-day card can split across pages 1 and 2 (heading and chart stay together, rows don't split),
     so page 1 doesn't end in a big gap. */
  body.print-creator .fr-daily-card { break-inside: auto; }
  body.print-creator .fr-daily-card > .cf-h4, body.print-creator .fr-daily-card > .cf-cap { break-after: avoid; }
  body.print-creator .fr-chart { break-inside: avoid; break-after: avoid; }
  body.print-creator .fr-daily tr { break-inside: avoid; }
  body.print-creator .fr-stat .cf-cap { font-size: 9px; }
  body.print-creator .fr-daily { margin-top: 4px; }
  /* Each top 10 table fits on one page: keep it whole, with its heading, instead of splitting it. */
  /* Let every section flow across pages (no gaps): keep each heading and caption with what follows, and
     only keep small pieces (table rows, tiles, list items, the goals row) whole. */
  body.print-creator .fr-doc .cf-section { break-inside: auto; }
  body.print-creator .fr-doc .cf-section > h2, body.print-creator .fr-doc .cf-section > .cf-cap,
  body.print-creator .fr-doc .cf-section > div > h2, body.print-creator .fr-doc .cf-section > div > .cf-cap { break-after: avoid; }
  body.print-creator .fr-doc thead { display: table-header-group; }
  body.print-creator .fr-doc .tile, body.print-creator .fr-stat, body.print-creator .fr-insights li,
  body.print-creator .fr-goal-row { break-inside: avoid; }
  body.print-creator .fr-new { font-size: 8.5px; padding: 0 5px; }
  body.print-creator .fr-insights { font-size: 11.5px; line-height: 1.45; margin-top: 6px; }
  body.print-creator .fr-insights li + li { margin-top: 3px; }
  body.print-creator .fr-goal-row { gap: 10px 20px; margin-top: 8px; flex-wrap: nowrap; }
  body.print-creator .fr-target { flex-basis: 170px; padding: 10px 12px; }
  body.print-creator .fr-target .tile-value { font-size: 20px; }
  body.print-creator .fr-goal-head { font-size: 12px; }
}
