/* ==========================================================================
   Author Hub - WHIMSY TO THE FULLEST
   A cute pink journal: gingham, washi tape, ribbons, bows, sparkles.
   Every page uses this file. Numbers stay crisp and readable.
   ========================================================================== */

:root {
  /* paper & ink */
  --paper: #FFFDF8;
  --paper-line: #F9D9E6;
  --gingham-a: #FFE4EF;
  --gingham-b: #FFF2F7;
  --ink: #4A2B3A;          /* primary text: warm plum, AA on paper */
  --ink-soft: #7A5566;     /* secondary text */
  --ink-faint: #A98597;

  /* pinks & friends */
  --pink-50: #FFF2F7;
  --pink-100: #FFE4EF;
  --pink-200: #FBC4DA;
  --pink-300: #F7A1C4;
  --pink-500: #E85D92;
  --pink-700: #C2335F;
  --lavender-100: #EFE6FD;
  --mint-100: #DDF5EE;
  --honey-100: #FFF1D6;

  /* chart series (validated: CVD-safe, fixed order) */
  --series-ebook: #D63D74;
  --series-paperback: #8B66D1;
  --series-ku: #1F9A8F;
  --series-bonus: #D98E1F;
  --series-acx: #2F6FB3;

  --radius: 22px;
  --shadow: 0 6px 0 rgba(214, 61, 116, .12), 0 14px 30px rgba(74, 43, 58, .08);
  --font-head: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
  --font-hand: 'Caveat', 'Segoe Print', cursive;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  /* pink gingham */
  background-color: var(--gingham-b);
  background-image:
    linear-gradient(90deg, rgba(247, 161, 196, .28) 50%, transparent 50%),
    linear-gradient(rgba(247, 161, 196, .28) 50%, transparent 50%);
  background-size: 34px 34px;
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--pink-700); }
.num { font-variant-numeric: tabular-nums; }

/* ---------- the journal ---------- */
.journal {
  position: relative;
  max-width: min(1480px, 94vw);
  margin: 16px auto 24px;
  padding: 16px 24px 18px 60px;
  background:
    repeating-linear-gradient(var(--paper) 0 31px, var(--paper-line) 31px 32px);
  border-radius: 18px 28px 28px 18px;
  box-shadow: var(--shadow);
  border: 2px solid var(--pink-200);
}
/* spiral binding */
.journal::before {
  content: '';
  position: absolute;
  left: 18px; top: 24px; bottom: 24px;
  width: 22px;
  background: radial-gradient(circle at 11px 11px, var(--pink-300) 6px, var(--pink-700) 7px, transparent 8px) 0 0 / 22px 40px repeat-y;
}

/* ---------- header: ribbon banner ---------- */
.masthead { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin-bottom: 4px; }
.ribbon {
  position: relative;
  display: inline-block;
  padding: 6px 26px 8px;
  background: var(--pink-500);
  color: #fff;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: .3px;
  border-radius: 6px;
  box-shadow: 0 4px 0 var(--pink-700);
  text-shadow: 0 2px 0 rgba(194, 51, 95, .5);
}
.ribbon::before, .ribbon::after {
  content: '';
  position: absolute; top: 8px;
  border: 18px solid var(--pink-300);
  z-index: -1;
}
.ribbon::before { left: -22px; border-left-color: transparent; }
.ribbon::after { right: -22px; border-right-color: transparent; }
.masthead .bow { width: 52px; height: 32px; margin-left: -6px; }
.tagline { font-family: var(--font-hand); font-size: 1.4rem; color: var(--ink-soft); }

/* ---------- tab nav (journal tabs) ---------- */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0; }
.masthead .tabs { margin-left: 8px; }
.tab {
  font-family: var(--font-head);
  text-decoration: none;
  color: var(--ink);
  background: var(--pink-100);
  border: 2px solid var(--pink-200);
  padding: 4px 13px 6px;
  font-size: .95rem;
  border-radius: 14px 14px 6px 6px;
  transition: transform .15s ease;
}
.tab:hover { transform: translateY(-2px) rotate(-1deg); }
.tab[aria-current='page'] { background: var(--pink-500); color: #fff; border-color: var(--pink-700); }
.tab { display: inline-flex; align-items: center; gap: 5px; }
.tab-icon { width: 20px; height: 20px; flex: none; transition: transform .25s cubic-bezier(.34, 1.56, .64, 1); }
.tab:hover .tab-icon, .tab[aria-current='page'] .tab-icon { transform: scale(1.2) rotate(-8deg); }
.tab.lavender { background: var(--lavender-100); }
.tab.mint { background: var(--mint-100); }

.whoami { margin-left: auto; font-size: .85rem; color: var(--ink-soft); display: flex; gap: 6px; align-items: center; }
@media (max-width: 1440px) { .whoami-email { display: none; } }   /* still in the tooltip */
@media (max-width: 1520px) { .tagline { display: none; } }
.whoami form { margin: 0; }
.link-button { background: none; border: none; color: var(--pink-700); text-decoration: underline; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; font: inherit; padding: 0; }

/* ---------- cards with washi tape ---------- */
.card {
  position: relative;
  background: #fff;
  border: 2px solid var(--pink-200);
  border-radius: var(--radius);
  padding: 18px 20px 14px;
  margin: 20px 0;
  box-shadow: var(--shadow);
}
.card > h2 {
  font-family: var(--font-head);
  font-weight: 600;
  margin: 0 0 4px;
  font-size: 1.3rem;
  display: flex; align-items: center; gap: 8px;
}
.card > .sub { margin: 0 0 14px; color: var(--ink-soft); font-size: .92rem; }
.card::before {           /* washi tape */
  content: '';
  position: absolute;
  top: -13px; left: 28px;
  width: 110px; height: 26px;
  background: repeating-linear-gradient(45deg, rgba(247,161,196,.85) 0 8px, rgba(255,228,239,.85) 8px 16px);
  transform: rotate(-4deg);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(74,43,58,.12);
}
.card.tape-lavender::before { background: repeating-linear-gradient(45deg, rgba(201,167,242,.85) 0 8px, rgba(239,230,253,.85) 8px 16px); left: auto; right: 34px; transform: rotate(3deg); }
.card.tape-mint::before { background: repeating-linear-gradient(45deg, rgba(143,215,196,.85) 0 8px, rgba(221,245,238,.85) 8px 16px); }

.doodle { width: 44px; height: 44px; flex: none; }
.doodle.sm { width: 28px; height: 28px; }
.doodle.lg { width: 84px; height: 84px; }
.corner-doodle { position: absolute; right: 14px; top: -26px; width: 64px; height: 64px; transform: rotate(8deg); }

/* ---------- filter chips ---------- */
.filters { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip-group .label { font-family: var(--font-hand); font-size: 1.35rem; color: var(--ink-soft); margin-right: 4px; }
.chip {
  text-decoration: none; color: var(--ink);
  background: #fff;
  border: 2px dashed var(--pink-300);
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 700; font-size: .92rem;
}
.chip[aria-current='true'] { background: var(--pink-500); border-style: solid; border-color: var(--pink-700); color: #fff; }

/* ---------- stickers (KPI tiles) ---------- */
.stickers { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 16px 0 4px; }
.sticker {
  position: relative;
  background: #fff;
  border: 3px solid #fff;
  outline: 2px solid var(--pink-200);
  border-radius: 22px;
  padding: 10px 16px 10px;
  box-shadow: var(--shadow);
  transform: rotate(var(--tilt, -1deg));
}
.sticker:nth-child(2) { --tilt: 1.2deg; background: var(--lavender-100); }
.sticker:nth-child(3) { --tilt: -0.6deg; background: var(--mint-100); }
.sticker:nth-child(4) { --tilt: 1deg; background: var(--honey-100); }
.sticker .label { font-weight: 700; color: var(--ink-soft); font-size: .88rem; }
.sticker .value { font-family: var(--font-head); font-size: 1.7rem; font-weight: 600; line-height: 1.15; margin: 1px 0; }
.sticker .note { font-size: .82rem; color: var(--ink-soft); }
.sticker .doodle { position: absolute; right: 10px; top: -18px; width: 40px; height: 40px; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: .75rem; font-weight: 800; padding: 1px 9px; border-radius: 999px; border: 1.5px solid; white-space: nowrap; }
.badge.final { color: #1F6F55; border-color: #8FD7C4; background: var(--mint-100); }
.badge.est { color: #8A5A0E; border-color: #F3C77A; background: var(--honey-100); }
.badge.pen { color: var(--pink-700); border-color: var(--pink-300); background: var(--pink-50); }
.badge.pen.ar { color: #5B3FA6; border-color: #C9A7F2; background: var(--lavender-100); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.cute { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .95rem; }
table.cute th {
  text-align: left; font-family: var(--font-head); font-weight: 500;
  background: var(--pink-100); color: var(--ink);
  padding: 8px 10px; border-bottom: 2px solid var(--pink-200);
}
table.cute th:first-child { border-top-left-radius: 12px; }
table.cute th:last-child { border-top-right-radius: 12px; }
table.cute td { padding: 8px 10px; border-bottom: 1px dashed var(--pink-200); vertical-align: top; }
table.cute tr:hover td { background: var(--pink-50); }
table.cute .r { text-align: right; }
table.cute .title { font-weight: 700; }
table.cute .muted { color: var(--ink-soft); font-size: .85rem; }

/* ---------- chart ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 4px 0 10px; font-size: .9rem; color: var(--ink); }
.legend .key { display: inline-flex; align-items: center; gap: 6px; }
.legend .swatch { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: #fff; border: 2px solid var(--pink-300); border-radius: 14px;
  padding: 8px 12px; font-size: .85rem; box-shadow: var(--shadow); min-width: 190px;
  opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.chart .tooltip.show { opacity: 1; transform: none; }
.chart .tooltip .t-head { font-family: var(--font-head); font-weight: 600; margin-bottom: 4px; }
.chart .tooltip .t-row { display: flex; justify-content: space-between; gap: 12px; }
.chart .tooltip .t-row span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.chart .tooltip .t-total { border-top: 1px dashed var(--pink-200); margin-top: 4px; padding-top: 4px; font-weight: 800; }
details.table-view summary { cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; font-weight: 700; color: var(--pink-700); margin-top: 10px; }

/* ---------- messages ---------- */
.messages { list-style: none; padding: 0; margin: 10px 0; }
.messages li { padding: 10px 14px; border-radius: 14px; margin-bottom: 8px; border: 2px solid; font-weight: 700; }
.messages .success { background: var(--mint-100); border-color: #8FD7C4; }
.messages .error { background: #FFE6E6; border-color: #F2A0A0; }

/* ---------- buttons & forms ---------- */
.btn {
  font-family: var(--font-head); font-size: 1.05rem;
  background: var(--pink-500); color: #fff; border: none;
  padding: 10px 22px; border-radius: 999px; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer;
  box-shadow: 0 4px 0 var(--pink-700);
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--pink-700); }
.dropzone {
  display: block; text-align: center;
  border: 3px dashed var(--pink-300); border-radius: var(--radius);
  background: var(--pink-50); padding: 26px; margin: 10px 0 16px; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer;
}
.dropzone input { margin-top: 10px; }

/* ---------- sign-in: allauth's provider list becomes a big cute button ---------- */
.signin ul { list-style: none; padding: 0; margin: 18px 0 6px; }
.signin ul a {
  display: inline-block; text-decoration: none;
  font-family: var(--font-head); font-size: 1.15rem;
  background: var(--pink-500); color: #fff;
  padding: 12px 28px; border-radius: 999px; box-shadow: 0 4px 0 var(--pink-700);
}
.signin ul a::before { content: '♡ Sign in with '; }
.signin h1 { font-family: var(--font-head); font-weight: 600; margin: 6px 0 0; }

/* ---------- compact layouts (no long scrolling) ---------- */
.card.compact { padding: 14px 18px; margin: 18px 0; }
.grid-2 { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 22px; align-items: start; margin-top: 22px; }
.stack { display: grid; gap: 18px; }
.ig-card .unit { font-family: var(--font-body); font-size: .95rem; font-weight: 700; color: var(--ink-soft); }
.mini-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; font-size: .85rem; color: var(--ink-soft); }
.mini-stats b { color: var(--ink); }
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-top: 20px; }
.post-card { background: #fff; border: 2px solid var(--pink-200); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; }
.post-card .post-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .82rem; }
.post-card .caption { margin: 0; font-size: .9rem; flex: 1; }
.post-card .post-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px 8px; font-size: .88rem; font-weight: 700; }
.post-card a { font-size: .82rem; }
@media (max-width: 800px) { .grid-2 { grid-template-columns: 1fr; } }

/* Earnings dashboard: chart and book ranking side by side; long lists scroll inside their card */
.dash-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(320px, 2fr); gap: 20px; align-items: stretch; margin-top: 18px; }
.dash-grid > .card { margin: 0; display: flex; flex-direction: column; min-height: 0; }
/* grows with taller screens (iMac) but keeps the page itself from scrolling */
.scroll-panel { overflow: auto; max-height: clamp(318px, calc(100vh - 450px), 620px); flex: 1; border-radius: 12px; }
.scroll-panel thead th { position: sticky; top: 0; z-index: 1; }
table.cute.tight { font-size: .88rem; }
table.cute.tight td, table.cute.tight th { padding: 6px 8px; }
.card .sub.small { font-size: .82rem; margin-bottom: 8px; }
.info { cursor: help; color: var(--pink-700); font-weight: 800; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } .scroll-panel { max-height: 420px; } }

/* ---------- empty states ---------- */
.empty { text-align: center; padding: 24px; }
.empty p { font-family: var(--font-hand); font-size: 1.7rem; color: var(--ink-soft); margin: 8px 0; }

/* ---------- sparkles ---------- */
.sparkles { position: absolute; inset: 0; pointer-events: none; overflow: hidden; border-radius: inherit; }
.sparkles svg { position: absolute; width: 16px; height: 16px; color: #F7C948; animation: twinkle 2.6s ease-in-out infinite; }
.sparkles svg:nth-child(2) { color: var(--pink-300); animation-delay: .7s; }
.sparkles svg:nth-child(3) { color: #C9A7F2; animation-delay: 1.4s; }
.sparkles svg:nth-child(4) { color: #8FD7C4; animation-delay: 2s; }
@keyframes twinkle { 0%, 100% { transform: scale(.4) rotate(0); opacity: .2; } 50% { transform: scale(1) rotate(25deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sparkles svg { animation: none; opacity: .8; } .tab:hover { transform: none; } }

.footer-note { text-align: center; font-family: var(--font-hand); font-size: 1.35rem; color: var(--ink-faint); margin-top: 18px; }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .journal { margin: 0; border-radius: 0; padding: 12px 10px 20px 34px; border-left: none; border-right: none; max-width: none; }
  .journal::before { left: 6px; width: 18px; }
  .ribbon { font-size: 1.05rem; padding: 5px 18px 7px; }
  .masthead .bow { width: 40px; height: 26px; }
  .masthead .tabs { margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; }
  .tab { font-size: .85rem; padding: 3px 10px 5px; white-space: nowrap; }
  .whoami { position: absolute; top: 14px; right: 12px; margin: 0; }
  .card.compact { padding: 10px 12px; margin: 12px 0; }
  .filters { gap: 8px; }
  .chip-group { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .chip-group .label { font-size: 1.1rem; white-space: nowrap; }
  .chip { white-space: nowrap; font-size: .82rem; padding: 3px 11px; }
  /* totals as a 2 x 2 grid of small stickers */
  .stickers { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
  .sticker { padding: 8px 10px; border-radius: 18px; }
  .sticker .label { font-size: .75rem; }
  .sticker .value { font-size: 1.25rem; }
  .sticker .value[style] { font-size: .95rem !important; }
  .sticker .note { font-size: .7rem; }
  .sticker .doodle { width: 28px; height: 28px; top: -12px; }
  .card { padding: 14px 12px 12px; }
  .corner-doodle { width: 46px; height: 46px; top: -20px; }
}

/* ==========================================================================
   MORE WHIMSY: particles, floating friends, pop-ins, wiggles, snail loader
   ========================================================================== */
.whimsy-layer { position: fixed; inset: 0; pointer-events: none; z-index: 9999; overflow: hidden; }
.whimsy-particle {
  position: absolute; transform: translate(-50%, -50%); font-weight: 800; line-height: 1;
  text-shadow: 0 1px 0 rgba(255,255,255,.8);
  animation: whimsy-fly ease-out forwards;
}
@keyframes whimsy-fly {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(.4) rotate(0); }
  20%  { opacity: 1; transform: translate(calc(-50% + var(--dx) * .2), calc(-50% + var(--dy) * .2)) scale(1.1) rotate(calc(var(--rot) * .2)); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.7) rotate(var(--rot)); }
}

/* drifting friends in the page background */
.floaties { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.floaties span { position: absolute; bottom: -40px; font-size: 18px; opacity: .55; animation: float-up linear infinite; }
.floaties span:nth-child(1) { left: 4%;  animation-duration: 19s; color: #F7A1C4; }
.floaties span:nth-child(2) { left: 14%; animation-duration: 24s; animation-delay: -6s; color: #C9A7F2; }
.floaties span:nth-child(3) { left: 88%; animation-duration: 21s; animation-delay: -3s; color: #8FD7C4; }
.floaties span:nth-child(4) { left: 95%; animation-duration: 27s; animation-delay: -12s; color: #FFD84D; }
.floaties span:nth-child(5) { left: 2%;  animation-duration: 30s; animation-delay: -18s; color: #E85D92; }
.floaties span:nth-child(6) { left: 92%; animation-duration: 17s; animation-delay: -9s; color: #F7A1C4; }
@keyframes float-up {
  0%   { transform: translateY(0) rotate(0) scale(.8); opacity: 0; }
  10%  { opacity: .6; }
  50%  { transform: translateY(-55vh) translateX(18px) rotate(160deg) scale(1); }
  100% { transform: translateY(-110vh) translateX(-12px) rotate(340deg) scale(.8); opacity: 0; }
}
.journal { z-index: 1; }

/* cards & stickers pop in, stickers wiggle when hovered */
.card, .sticker, .post-card, .book-spine { animation: pop-in .5s cubic-bezier(.34, 1.56, .64, 1) both; }
.stickers .sticker:nth-child(2) { animation-delay: .06s; }
.stickers .sticker:nth-child(3) { animation-delay: .12s; }
.stickers .sticker:nth-child(4) { animation-delay: .18s; }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
/* (no hover wiggle: cards stay put) */
@keyframes wiggle { 0%,100% { transform: rotate(var(--tilt, -1deg)); } 25% { transform: rotate(calc(var(--tilt, -1deg) - 2.5deg)) scale(1.02); } 75% { transform: rotate(calc(var(--tilt, -1deg) + 2.5deg)) scale(1.02); } }
.corner-doodle, .sticker .doodle { transition: transform .3s cubic-bezier(.34, 1.56, .64, 1); }
.card:hover .corner-doodle { transform: rotate(-6deg) scale(1.15) translateY(-4px); }
.sticker:hover .doodle { transform: scale(1.25) rotate(12deg); }
.doodle.bob, .bob { animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.masthead .bow { animation: bow-sway 4s ease-in-out infinite; transform-origin: 50% 40%; }
@keyframes bow-sway { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
.btn:hover, .chip:hover, .tab:hover { filter: brightness(1.05); }
.chip { transition: transform .15s ease; }
.chip:hover { transform: translateY(-2px) scale(1.04); }

/* glitter shimmer on the ribbon */
.ribbon { overflow: hidden; }
.ribbon .glint { position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.55) 45%, transparent 60%); transform: translateX(-120%); animation: glint 5s ease-in-out infinite; }
@keyframes glint { 0%, 70% { transform: translateX(-120%); } 100% { transform: translateX(120%); } }

/* snail loader */
#snail-loader { position: fixed; inset: 0; z-index: 9998; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 10px; background: rgba(255, 242, 247, .78); backdrop-filter: blur(2px); }
#snail-loader.show { display: flex; }
#snail-loader .track { width: 220px; height: 60px; position: relative; border-bottom: 3px dotted var(--pink-300); }
#snail-loader svg { width: 70px; height: 54px; position: absolute; bottom: 2px; animation: crawl 2.2s ease-in-out infinite; }
@keyframes crawl { 0% { left: 0; transform: scaleX(1); } 48% { left: 150px; transform: scaleX(1); } 50% { left: 150px; transform: scaleX(-1); } 98% { left: 0; transform: scaleX(-1); } 100% { left: 0; transform: scaleX(1); } }
#snail-loader .loader-text { font-family: var(--font-hand); font-size: 1.6rem; color: var(--ink-soft); }

@media (prefers-reduced-motion: reduce) {
  .floaties, .ribbon .glint { display: none; }
  .card, .sticker, .post-card, .book-spine, .sticker:hover, .bob, .masthead .bow, #snail-loader svg { animation: none !important; }
}

/* ==========================================================================
   APP-STYLE LAYOUT: on computers every page is exactly the window's height;
   only inner panels scroll. Phones keep normal page scrolling.
   ========================================================================== */
.page { display: flex; flex-direction: column; min-height: 0; }
@media (min-width: 900px) and (min-height: 560px) {
  body.app-shell { height: 100vh; overflow: hidden; }
  body.app-shell .journal { height: calc(100vh - 24px); margin: 12px auto; display: flex; flex-direction: column; }
  body.app-shell .page { flex: 1; overflow: auto; padding-right: 4px; }
  body.app-shell .page.fit { overflow: hidden; }
  body.app-shell .fill { flex: 1; min-height: 0; }
  body.app-shell .footer-note.page-end { display: none; }
  body.app-shell .dash-grid { margin-top: 14px; }
  body.app-shell .dash-grid > .card { height: 100%; }
  body.app-shell .scroll-panel { max-height: none; }
  body.app-shell .chart.grow { flex: 1; min-height: 160px; }
  body.app-shell .stickers { margin-top: 12px; }
  body.app-shell .card.compact { margin: 10px 0 0; }
}
.last-import { margin-left: auto; font-size: .82rem; color: var(--ink-soft); }
.dash-grid > .card { min-height: 0; }
@media (min-width: 1000px) and (min-height: 560px) {
  body.app-shell .dash-grid.fill { grid-template-rows: minmax(0, 1fr); }
  body.app-shell .dash-grid.fill > .card { overflow: hidden; }
  body.app-shell .dash-grid.fill .scroll-panel { min-height: 0; }
}

/* ---------- Instagram page ---------- */
.ig-stickers { grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); position: relative; }
.ig-row { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; }
.ig-row .value { font-size: 1.6rem; }
.mini { display: flex; flex-direction: column; line-height: 1.15; font-size: .78rem; color: var(--ink-soft); }
.mini b { font-size: 1.05rem; color: var(--ink); font-family: var(--font-head); font-weight: 600; }
.mini i, .note b.up, .note b.down { font-style: normal; font-weight: 800; font-size: .74rem; }
.up { color: #1F7A5A; } .down { color: #B23A5B; }
.period-note { position: absolute; right: 6px; bottom: -18px; font-family: var(--font-hand); font-size: 1.05rem; color: var(--ink-faint); }
.chip.small { font-size: .78rem; padding: 2px 10px; }
.metric-chips { margin: 2px 0 6px; }
.chart-marker text { transition: transform .2s; transform-box: fill-box; transform-origin: center; }
.chart-marker:hover text, .chart-marker:focus text { transform: scale(1.5); }
.top-list { list-style: none; margin: 0; padding: 0; }
.top-list li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 8px 6px; border-bottom: 1px dashed var(--pink-200); cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; border-radius: 12px; transition: background .15s, transform .15s; }
.top-list li:hover, .top-list li:focus { background: var(--pink-50); transform: translateX(3px); outline: none; }
.top-list .rank { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-head); font-weight: 600; background: var(--pink-100); color: var(--pink-700); }
.top-list li:nth-child(1) .rank { background: #FFE7A8; color: #8A5A0E; }
.top-list li:nth-child(2) .rank { background: #EFE6FD; color: #5B3FA6; }
.top-list li:nth-child(3) .rank { background: #DDF5EE; color: #1F6F55; }
.top-list .what { display: flex; flex-direction: column; min-width: 0; }
.top-list .cap { font-weight: 700; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-list .muted, .muted { font-size: .78rem; color: var(--ink-soft); }
.top-list .score { text-align: right; display: flex; flex-direction: column; font-size: .75rem; color: var(--ink-soft); }
.top-list .score b { font-size: 1.05rem; color: var(--ink); font-family: var(--font-head); }
.post-scroll { margin-top: 12px; max-height: none; }
.post-card { cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s; }
.post-card:hover, .post-card:focus { transform: translateY(-3px) rotate(-.6deg); outline: none; box-shadow: 0 8px 0 rgba(214,61,116,.14), 0 18px 30px rgba(74,43,58,.1); }

/* ---------- slide-in drawer ---------- */
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(460px, 92vw); background: var(--paper); z-index: 9000;
  border-left: 3px solid var(--pink-200); box-shadow: -10px 0 30px rgba(74,43,58,.15); transform: translateX(105%);
  transition: transform .35s cubic-bezier(.34, 1.2, .64, 1); display: flex; flex-direction: column; border-radius: 24px 0 0 24px; }
.drawer.open { transform: none; }
.drawer-body { overflow: auto; padding: 22px 22px 30px; }
.drawer-close { position: absolute; top: 12px; right: 14px; border: none; background: var(--pink-100); color: var(--pink-700); width: 34px; height: 34px; border-radius: 50%; font-size: 1rem; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; z-index: 2; }
.drawer-scrim { position: fixed; inset: 0; background: rgba(74,43,58,.18); opacity: 0; pointer-events: none; transition: opacity .3s; z-index: 8999; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer-head { display: flex; gap: 8px; align-items: center; margin: 4px 40px 8px 0; }
.drawer-caption { font-size: .92rem; white-space: pre-line; max-height: 160px; overflow: auto; background: #fff; border: 2px dashed var(--pink-200); border-radius: 14px; padding: 10px 12px; }
.drawer-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.drawer-stats div { background: #fff; border: 2px solid var(--pink-100); border-radius: 14px; padding: 6px 4px; text-align: center; display: flex; flex-direction: column; }
.drawer-stats b { font-family: var(--font-head); font-size: 1.1rem; }
.drawer-stats span { font-size: .7rem; color: var(--ink-soft); }
.drawer-sub { font-family: var(--font-head); font-weight: 600; display: flex; align-items: center; gap: 6px; margin: 16px 0 6px; }
.comment-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.comment-list li { background: #fff; border: 2px solid var(--pink-100); border-radius: 16px 16px 16px 4px; padding: 8px 12px; position: relative; }
.comment-list .who { font-weight: 800; font-size: .78rem; color: var(--pink-700); }
.comment-list .when { font-size: .72rem; color: var(--ink-faint); }
.comment-list p { margin: 2px 0 0; font-size: .9rem; }
.comment-list .likes { position: absolute; right: 10px; top: 8px; font-size: .75rem; color: var(--pink-500); font-weight: 800; }
.chart-marker .marker-line { opacity: 0; transition: opacity .15s; }
.chart-marker:hover .marker-line, .chart-marker:focus .marker-line { opacity: .6; }
.chart-marker text { opacity: .75; }

/* ---------- Social x Sales ---------- */
.insight-strip { display: flex; gap: 14px; overflow-x: auto; padding: 14px 4px 6px; scroll-snap-type: x mandatory; flex: none; }
.insight-note { flex: 0 0 min(300px, 80vw); scroll-snap-align: start; position: relative; border-radius: 6px 22px 22px 22px; padding: 12px 14px 10px 14px; border: 2px solid var(--pink-200); background: #fff; box-shadow: var(--shadow); animation: pop-in .5s cubic-bezier(.34,1.56,.64,1) both; transform: rotate(-.6deg); }
.insight-note:nth-child(even) { transform: rotate(.7deg); }
.insight-note[data-post] { cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; }
/* (no hover wiggle) */
.insight-note h3 { margin: 0 32px 4px 0; font-family: var(--font-head); font-weight: 600; font-size: 1rem; }
.insight-note p { margin: 0; font-size: .86rem; }
.insight-note .doodle { position: absolute; right: 8px; top: -14px; width: 36px; height: 36px; }
.insight-note.tone-pink { background: var(--pink-50); }
.insight-note.tone-mint { background: var(--mint-100); border-color: #8FD7C4; }
.insight-note.tone-lavender { background: var(--lavender-100); border-color: #C9A7F2; }
.insight-note.tone-honey { background: var(--honey-100); border-color: #F3C77A; }
.twin-charts { flex: 1; min-height: 0; display: grid; grid-template-rows: 1fr 1fr; gap: 6px; }
.twin-charts .chart { min-height: 120px; }
.lift-list .rank.lift { font-size: .8rem; }
.up-bg { background: var(--mint-100) !important; color: #1F6F55 !important; }
.down-bg { background: #FFE6E6 !important; color: #B23A5B !important; }
.cute-select { font: inherit; font-weight: 700; font-size: .85rem; border: 2px dashed var(--pink-300); border-radius: 999px; padding: 3px 12px; background: #fff; color: var(--ink); max-width: 260px; }
.twin-charts { grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); }
.twin-charts .chart { min-height: 0; overflow: visible; }
.insight-note p { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.insight-note:hover p, .insight-note:focus p { -webkit-line-clamp: unset; }
/* growing charts: the box decides the size; the drawing never pushes the layout taller */
.chart.grow { min-height: 220px; }
.chart.grow > svg { position: absolute; top: 0; left: 0; }
@media (min-width: 900px) and (min-height: 560px) {
  body.app-shell .twin-charts .chart.grow { min-height: 0; }
}

/* ---------- Bookshelf ---------- */
.shelf-intro { display: flex; align-items: center; gap: 10px; }
.shelf-intro p { margin: 0; font-size: .92rem; }
.shelf-pen { margin: 18px 0 4px; }
.shelf-title { font-family: var(--font-head); font-weight: 600; display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 1.1rem; }
.shelf-row { margin: 6px 0 18px; }
.shelf-label { font-family: var(--font-hand); font-size: 1.45rem; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.shelf { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; padding: 14px 18px 0; position: relative;
  border-bottom: 14px solid #F3C9A8; border-radius: 0 0 8px 8px;
  background: linear-gradient(to bottom, transparent calc(100% - 4px), rgba(194,51,95,.12) 100%); box-shadow: 0 6px 0 #E2A57C; }
.book-spine { position: relative; width: 116px; height: 170px; border: 0; padding: 0; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; font: inherit; border-radius: 6px 12px 12px 6px;
  box-shadow: inset 6px 0 0 rgba(0,0,0,.08), 0 4px 10px rgba(74,43,58,.18); background: var(--pink-200); overflow: visible;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1); transform-origin: bottom center; }
.book-spine:hover, .book-spine:focus { transform: translateY(-10px) rotate(-3deg) scale(1.04); outline: none; z-index: 2; }
.book-spine img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px 12px 12px 6px; display: block; }
.book-spine .placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px; text-align: center; border-radius: inherit;
  background-image: radial-gradient(rgba(255,255,255,.55) 1.2px, transparent 1.4px); background-size: 12px 12px; }
.book-spine .ph-title { font-family: var(--font-head); font-weight: 600; font-size: .92rem; line-height: 1.15; color: var(--ink); }
.book-spine .placeholder .doodle { width: 46px; height: 46px; }
.book-spine.tone-pink { background-color: #FBC4DA; } .book-spine.tone-lavender { background-color: #DCCBF7; }
.book-spine.tone-mint { background-color: #BDEBDD; } .book-spine.tone-honey { background-color: #FFE0A3; }
.book-spine.tone-sky { background-color: #C9E2FA; } .book-spine.tone-peach { background-color: #FFD2BF; }
.ribbon-num { position: absolute; top: -6px; right: 10px; background: var(--pink-500); color: #fff; font-family: var(--font-head); font-size: .78rem; padding: 6px 6px 10px; clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 78%, 0 100%); }
.kind-tag { position: absolute; left: -6px; top: 14px; background: #fff; border: 1.5px solid var(--pink-300); color: var(--pink-700); font-size: .68rem; font-weight: 800; padding: 1px 7px; border-radius: 999px; transform: rotate(-8deg); }
.book-meta { position: absolute; left: 50%; bottom: -46px; transform: translateX(-50%); width: 150px; text-align: center; font-size: .72rem; color: var(--ink-soft); line-height: 1.2; opacity: 0; transition: opacity .2s; pointer-events: none; }
.book-meta .bm-title { display: block; font-weight: 800; color: var(--ink); }
.book-spine:hover .book-meta, .book-spine:focus .book-meta { opacity: 1; }
.drawer-title { font-family: var(--font-head); font-weight: 600; margin: 4px 0 10px; }
.cute-form .field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.cute-form label { display: flex; flex-direction: column; gap: 3px; font-weight: 700; font-size: .8rem; color: var(--ink-soft); }
.cute-form input[type=text], .cute-form input[type=number], .cute-form input[type=date], .cute-form select {
  font: inherit; font-size: .92rem; color: var(--ink); border: 2px solid var(--pink-200); border-radius: 12px; padding: 6px 10px; background: #fff; }
.cute-form input:focus, .cute-form select:focus { outline: none; border-color: var(--pink-500); box-shadow: 0 0 0 3px var(--pink-100); }
.cute-form .check { flex-direction: row; align-items: center; }
.cover-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 3px dashed var(--pink-300); border-radius: 18px; padding: 12px; background: var(--pink-50); cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; transition: background .15s; }
.cover-drop.over { background: var(--pink-100); border-color: var(--pink-500); }
.cover-drop img { max-height: 180px; border-radius: 8px; box-shadow: 0 4px 12px rgba(74,43,58,.2); }
.cover-drop input[type=file] { font-size: .75rem; max-width: 100%; }
.edition-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: .85rem; }
.edition-list code { background: var(--pink-50); padding: 1px 5px; border-radius: 6px; }
.errorlist { color: #B23A5B; font-weight: 700; font-size: .8rem; list-style: none; padding: 0; margin: 4px 0; }
/* active tab always pink, whatever its resting color */
.tabs .tab[aria-current='page'] { background: var(--pink-500); color: #fff; border-color: var(--pink-700); }
/* several series side by side on one shelf line (less scrolling) */
.shelf-pen { display: flex; flex-wrap: wrap; gap: 4px 28px; align-items: flex-end; }
.shelf-pen > .shelf-title { flex: 1 0 100%; }
.shelf-row { flex: 0 1 auto; margin: 4px 0 12px; }
.shelf { gap: 12px; padding: 12px 14px 0; flex-wrap: nowrap; }
.book-spine { width: 100px; height: 146px; }
.book-spine .placeholder .doodle { width: 38px; height: 38px; }
.book-spine .ph-title { font-size: .82rem; }
.shelf-label { font-size: 1.3rem; }
.cute-form .field-grid > label { min-width: 0; }
.cute-form input[type=text], .cute-form input[type=number], .cute-form input[type=date], .cute-form select { width: 100%; min-width: 0; box-sizing: border-box; }
@media (max-width: 640px) {
  .ig-stickers { grid-template-columns: minmax(0, 1fr); }
  .ig-row { gap: 12px; }
  .period-note { position: static; text-align: right; }
  .shelf-row { max-width: 100%; }
  .shelf { overflow-x: auto; max-width: calc(100vw - 60px); padding-bottom: 4px; }
  .book-spine { flex: 0 0 auto; width: 88px; height: 128px; }
  .drawer { width: 100vw; border-radius: 0; }
  .cute-form .field-grid { grid-template-columns: 1fr; }
  .insight-note { flex-basis: 78vw; }
}
@media (max-width: 640px) {
  .shelf-row { flex: 1 1 100%; min-width: 0; }
  .shelf { max-width: 100%; }
}

/* ---------- Chart / Table view switch ---------- */
.view-switch { position: absolute; top: 14px; right: 64px; display: inline-flex; background: var(--pink-50); border: 2px solid var(--pink-200); border-radius: 999px; padding: 2px; gap: 2px; z-index: 2; }
.view-switch button { border: 0; background: none; font: inherit; font-weight: 800; font-size: .78rem; color: var(--ink-soft); padding: 3px 12px; border-radius: 999px; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; transition: background .2s, color .2s, transform .2s; }
.view-switch button[aria-selected='true'] { background: var(--pink-500); color: #fff; transform: scale(1.04); }
.view-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.view-panel[hidden] { display: none; }

/* ---------- page-flip carousel ---------- */
.pager { position: relative; display: flex; flex-direction: column; min-height: 0; }
.pager-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; flex: 1; min-height: 0; overscroll-behavior-x: contain; }
.pager-track::-webkit-scrollbar { display: none; }
.pager-page { flex: 0 0 100%; scroll-snap-align: start; min-width: 0; box-sizing: border-box; }
.pager-nav { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 6px 0 2px; }
.pager-arrow { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--pink-300); background: #fff; color: var(--pink-700); font-size: 1.3rem; line-height: 1; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; transition: transform .2s; }
.pager-arrow:hover:not(:disabled) { transform: scale(1.12) rotate(-6deg); background: var(--pink-50); }
.pager-arrow:disabled { opacity: .35; cursor: default; }
.pager-dots { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pager-dot { width: 10px; height: 10px; border-radius: 50%; border: 0; padding: 0; background: var(--pink-200); cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; transition: transform .2s, background .2s; }
.pager-dot[aria-current='true'] { background: var(--pink-500); transform: scale(1.4); }
.pager-dot:hover { transform: scale(1.3); }

/* ---------- cute dropdown ---------- */
.cute-dd { position: relative; display: inline-block; }
.cute-dd-btn { display: inline-flex; align-items: center; gap: 10px; font: inherit; font-weight: 800; font-size: .88rem; color: var(--ink);
  background: linear-gradient(#fff, var(--pink-50)); border: 2px dashed var(--pink-300); border-radius: 999px; padding: 5px 14px 5px 16px; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer;
  min-width: 190px; justify-content: space-between; transition: transform .2s, border-color .2s, box-shadow .2s; }
.cute-dd-btn:hover, .cute-dd.open .cute-dd-btn { border-style: solid; border-color: var(--pink-500); box-shadow: 0 0 0 4px var(--pink-100); transform: translateY(-1px); }
.dd-caret { color: var(--pink-500); transition: transform .3s cubic-bezier(.34,1.56,.64,1); }
.cute-dd.open .dd-caret { transform: rotate(180deg) scale(1.3); }
.cute-dd-pop { position: absolute; z-index: 500; top: calc(100% + 8px); left: 0; min-width: 260px; max-width: 340px; background: #fff;
  border: 2px solid var(--pink-200); border-radius: 20px; box-shadow: 0 14px 34px rgba(74,43,58,.18); padding: 8px; animation: pop-in .3s cubic-bezier(.34,1.56,.64,1); }
.cute-dd-pop::before { content: ''; position: absolute; top: -9px; left: 34px; width: 14px; height: 14px; background: #fff; border-left: 2px solid var(--pink-200); border-top: 2px solid var(--pink-200); transform: rotate(45deg); }
.cute-dd-search { width: 100%; box-sizing: border-box; font: inherit; font-size: .85rem; border: 2px solid var(--pink-100); border-radius: 12px; padding: 6px 10px; margin-bottom: 6px; }
.cute-dd-search:focus { outline: none; border-color: var(--pink-300); }
.cute-dd-pop ul { list-style: none; margin: 0; padding: 0; max-height: 320px; overflow: auto; }
.cute-dd-pop li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 12px; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; font-size: .9rem; font-weight: 700; transition: background .12s, transform .12s; }
.cute-dd-pop li:hover, .cute-dd-pop li:focus { background: var(--pink-50); outline: none; transform: translateX(3px); }
.cute-dd-pop li[aria-selected='true'] { background: var(--pink-100); color: var(--pink-700); }
.cute-dd-pop li[aria-selected='true']::after { content: '✓'; margin-left: auto; font-weight: 800; }
.dd-icon { width: 22px; height: 22px; flex: none; }
.cute-dd-pop li .dd-icon[aria-hidden] { color: var(--pink-500); }

/* ---------- insight moods ---------- */
.insight-note { padding-top: 26px; }
.mood-badge { position: absolute; top: -11px; left: 12px; font-size: .72rem; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: #fff; border: 2px solid var(--pink-200); color: var(--ink-soft); white-space: nowrap; }
/* celebrate: gold glitter frame, bouncing badge, falling confetti */
.insight-note.mood-celebrate { background: linear-gradient(135deg, #FFF7D6, #FFE4EF 55%, #F2E8FF); border: 3px solid transparent;
  background-clip: padding-box; box-shadow: 0 0 0 3px #F6C445, 0 0 18px rgba(246,196,69,.55), var(--shadow); overflow: hidden; }
.mood-celebrate .mood-badge { background: #F6C445; border-color: #E2A21A; color: #5A3B00; animation: bob 1.6s ease-in-out infinite; }
.mood-celebrate h3 { color: #A6345E; }
.confetti-bits { position: absolute; inset: 0; pointer-events: none; }
.confetti-bits i { position: absolute; top: -10px; width: 6px; height: 10px; border-radius: 2px; animation: confetti-fall 3.2s linear infinite; }
.confetti-bits i:nth-child(1) { left: 8%;  background: #E85D92; animation-delay: 0s; }
.confetti-bits i:nth-child(2) { left: 22%; background: #F6C445; animation-delay: .6s; }
.confetti-bits i:nth-child(3) { left: 38%; background: #8B66D1; animation-delay: 1.2s; }
.confetti-bits i:nth-child(4) { left: 52%; background: #1F9A8F; animation-delay: .3s; }
.confetti-bits i:nth-child(5) { left: 66%; background: #F7A1C4; animation-delay: 1.8s; }
.confetti-bits i:nth-child(6) { left: 78%; background: #F6C445; animation-delay: .9s; }
.confetti-bits i:nth-child(7) { left: 88%; background: #E85D92; animation-delay: 2.4s; }
.confetti-bits i:nth-child(8) { left: 95%; background: #8FD7C4; animation-delay: 1.5s; }
@keyframes confetti-fall { 0% { transform: translateY(0) rotate(0); opacity: 0; } 10% { opacity: 1; } 100% { transform: translateY(190px) rotate(540deg); opacity: 0; } }
/* good news */
.mood-good .mood-badge { background: var(--mint-100); border-color: #8FD7C4; color: #1F6F55; }
/* needs love: soft rose-amber, dashed frame, gentle pulse on the badge */
.insight-note.mood-warn { background: repeating-linear-gradient(-45deg, #FFF4E5 0 14px, #FFEFE0 14px 28px); border: 2px dashed #E7A05A; }
.mood-warn .mood-badge { background: #FFE1C2; border-color: #E7A05A; color: #8A4A0E; animation: warn-pulse 2s ease-in-out infinite; }
.mood-warn h3 { color: #8A4A0E; }
@keyframes warn-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(231,160,90,.5); } 50% { box-shadow: 0 0 0 6px rgba(231,160,90,0); } }
.mood-info .mood-badge { background: var(--lavender-100); border-color: #C9A7F2; color: #5B3FA6; }
@media (prefers-reduced-motion: reduce) { .confetti-bits { display: none; } .mood-badge { animation: none !important; } }
.ig-stickers.with-combined { grid-template-columns: minmax(220px, .8fr) repeat(auto-fit, minmax(330px, 1fr)); }
.combined-card { background: linear-gradient(135deg, var(--pink-50), var(--lavender-100)); }
.combined-card .doodle { color: var(--pink-500); }
.combined-card .ig-row { margin-top: 4px; }
@media (max-width: 640px) { .ig-stickers.with-combined { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Add reports ---------- */
.upload-grid { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(380px, 1.3fr); gap: 20px; margin-top: 16px; align-items: stretch; }
.upload-grid > .card { margin: 0; display: flex; flex-direction: column; min-height: 0; }
.compact-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; margin: 6px 0 12px; transition: background .15s, border-color .15s, transform .2s; }
.compact-drop.over { background: var(--pink-100); border-color: var(--pink-500); transform: scale(1.02); }
.compact-drop.has-files { border-style: solid; border-color: #8FD7C4; background: var(--mint-100); }
.compact-drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.compact-drop { position: relative; }
.upload-form .btn { align-self: flex-start; }
.recent-card .pager { flex: 1; }
.upload-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.upload-list li { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; background: #fff; border: 2px solid var(--pink-100); border-radius: 16px; padding: 8px 12px; transition: transform .2s; }
.upload-list li:hover { transform: translateX(4px) rotate(-.4deg); border-color: var(--pink-300); }
.ul-main, .ul-months { display: flex; flex-direction: column; min-width: 0; }
.ul-main b { font-size: .9rem; }
.ul-months { align-items: flex-end; text-align: right; gap: 2px; }
@media (max-width: 900px) { .upload-grid { grid-template-columns: 1fr; } .ul-months { align-items: flex-start; text-align: left; } .upload-list li { grid-template-columns: 30px 1fr; } .ul-months { grid-column: 2; } }
/* filter bars (with dropdowns) always float above the content below them */
.card.compact { position: relative; z-index: 30; }
/* badges sit just inside the card (the celebration card clips its edges to keep its confetti) */
.insight-note { padding-top: 36px; }
.mood-badge { top: 9px; left: 12px; }
.insight-note .doodle { top: 6px; right: 8px; }
.mood-celebrate h3::before { content: '🎉 '; }
.mood-warn h3::before { content: '💌 '; }

/* ---- hover fix: entrance animations only run BEFORE the element settles (fill: backwards), and hover
   effects use transitions, so leaving a card never restarts its pop-in (cards no longer vanish) ---- */
.card, .sticker, .post-card, .book-spine, .insight-note { animation-fill-mode: backwards !important; }

.sticker { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), box-shadow .2s; }

.insight-note { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }


/* ---- chart tooltips: compact numbers; post peeks are small and only on hearts ---- */
.chart .tooltip { max-width: 300px; }
.chart .tooltip.peek { max-width: 280px; font-size: .8rem; }
.tooltip .peek-line { padding: 2px 0; border-bottom: 1px dashed var(--pink-100); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.tooltip .peek-hint { margin-top: 4px; font-weight: 800; color: var(--pink-700); font-size: .72rem; }
.tooltip .t-posts { margin-top: 4px; padding-top: 4px; border-top: 1px dashed var(--pink-200); font-size: .78rem; color: var(--pink-700); font-weight: 700; }
.chart-marker { cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; outline: none; }
.chart-marker:focus text { transform: scale(1.5); }
/* twin charts never overflow their half */
.twin-charts .chart { overflow: hidden; }
/* dropdown list: wrap long titles, never scroll sideways */
.cute-dd-pop ul { overflow-x: hidden; overflow-y: auto; }
.cute-dd-pop li { white-space: normal; }
.cute-dd-pop li:hover, .cute-dd-pop li:focus { transform: none; padding-left: 14px; }
/* insight cards: pages of 4 */
.insight-pager { flex: none; margin-top: 10px; }
.insight-page { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 10px 6px 4px; align-items: stretch; }
.insight-page .insight-note { flex: none; min-width: 0; }
.insight-pager .pager-nav { padding-top: 2px; }
@media (max-width: 1100px) { .insight-page { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .insight-page { grid-template-columns: minmax(0, 1fr); } }
/* earnings: book rows are clickable filters */
tr.book-row { cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; transition: background .15s; }
tr.book-row:hover td { background: var(--pink-50); }
tr.book-row.selected td { background: var(--pink-100); }
tr.book-row.selected td:first-child { box-shadow: inset 4px 0 0 var(--pink-500); }
.book-chip { margin-left: 6px; vertical-align: middle; }
/* insight cards stay ONE row; on narrower screens the row swipes sideways instead of wrapping */
@media (max-width: 1100px) {
  .insight-page { grid-template-columns: repeat(4, minmax(230px, 1fr)); overflow-x: auto; }
}
/* never squash charts: give them a floor, and let a too-small window scroll instead of hiding things */
body.app-shell .page.fit { overflow: auto; }
body.app-shell .twin-charts { min-height: 300px; }
body.app-shell .dash-grid.fill { min-height: 340px; }

/* ---- Social x Sales: compact insight cards so everything fits without page scroll ---- */
.insight-page { padding: 6px 6px 2px; gap: 14px; }
.insight-page .insight-note { padding: 30px 12px 8px; }
.insight-page .insight-note h3 { font-size: .9rem; margin-bottom: 2px; }
.insight-page .insight-note p { font-size: .8rem; line-height: 1.35; -webkit-line-clamp: 3; }
.insight-page .mood-badge { top: 6px; font-size: .66rem; padding: 1px 8px; }
.insight-page .insight-note .doodle { width: 28px; height: 28px; top: 4px; }
.insight-pager .pager-nav { padding: 0; }
.insight-pager .pager-arrow { width: 26px; height: 26px; font-size: 1.05rem; }
body.app-shell .twin-charts { min-height: 220px; }
body.app-shell .dash-grid.fill { min-height: 260px; }
.twin-charts .chart { min-height: 100px; }

/* earnings: multi-pick lists */
.pick-table .pick-heart { width: 20px; color: var(--pink-500); font-size: 1rem; text-align: center; }
.pick-table tr.selected .pick-heart { animation: bob 1.4s ease-in-out infinite; }
.pick-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 2px 0 4px; }
.card > .view-switch + .view-switch { top: 48px; }
body.app-shell .twin-charts { min-height: 190px; }
.twin-charts .chart { min-height: 90px; }

/* ---- calm cards: hovering never moves, tilts or fades a card; clickable ones just glow softly ---- */
.sticker, .insight-note, .post-card { transition: box-shadow .25s ease, border-color .25s ease; }
.post-card:hover, .post-card:focus { transform: none; }
.sticker:hover, .post-card:hover, .post-card:focus, .insight-note[data-post]:hover { box-shadow: 0 0 0 3px var(--pink-100), var(--shadow); }
.insight-note:hover { transform: rotate(-.6deg); }
.insight-note:nth-child(even):hover { transform: rotate(.7deg); }

/* ---- insight cards always show their whole message ---- */
.insight-note p, .insight-page .insight-note p { display: block; -webkit-line-clamp: unset; overflow: visible; }

/* ---- upload cards: every detail shows in full, long names wrap instead of trailing off ---- */
.upload-list li:hover { transform: none; }
.upload-list .ul-main { min-width: 0; }
.upload-list .ul-main .muted { display: block; overflow-wrap: anywhere; line-height: 1.3; }
.upload-list .ul-months { min-width: 0; max-width: 46%; }
.upload-list .ul-months .muted { overflow-wrap: anywhere; line-height: 1.3; }
.upload-list { gap: 6px; }
.upload-list li { padding: 6px 12px; gap: 4px 10px; }
.upload-list .ul-main b { line-height: 1.2; }
.upload-list .muted { font-size: .76rem; }
.upload-list .ul-months .badge { font-size: .72rem; padding: 1px 8px; }
.upload-list { gap: 4px; }
.upload-list li { padding: 4px 12px; }
.upload-pager .pager-page, .upload-list { scrollbar-width: thin; }
.pager-page:has(> .upload-list) { overflow-y: auto; }

/* ---- Posts that moved sales: headline, book + date, then the numbers; nothing truncated, no sideways scroll ---- */
.lift-list li { align-items: start; padding: 7px 6px; }
.lift-list li:hover, .lift-list li:focus { transform: none; }
.lift-list .rank.lift { margin-top: 2px; }
.lift-headline { font-weight: 700; font-size: .86rem; line-height: 1.3; overflow-wrap: anywhere; }
.lift-meta { font-size: .76rem; color: var(--ink-soft); line-height: 1.35; }
.lift-book { font-weight: 800; color: var(--pink-700); }
.lift-stats { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: .72rem; color: var(--ink-soft); margin-top: 2px; }
.lift-stats span { white-space: nowrap; }
.lift-list .score { padding-top: 2px; white-space: nowrap; }
.scroll-panel:has(> .lift-list) { overflow-x: hidden; }

/* ---- bunny cursor everywhere in the app; a bunny with a heart over anything clickable ---- */
body { cursor: url("cursors/bunny.2ae55008d6be.svg") 3 2, auto; }
a, button, select, summary, label, [role='button'], [data-post], [data-href], [data-toggle], .chip, .tab, .btn, .book-spine, .pager-dot, .pager-arrow, .cute-dd-btn, .cute-dd-pop li, .chart-marker, .tone-dot, .doodle-pick {
  cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; }
input:not([type='checkbox']):not([type='radio']):not([type='file']), textarea { cursor: text; }
.info { cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, help; }

/* ---- clicking pops a little doodle (strawberry, bow, cake, ...) ---- */
.click-pop { position: fixed; width: 30px; height: 30px; margin: -15px 0 0 -15px; pointer-events: none; z-index: 9999;
  animation: click-pop .85s cubic-bezier(.34, 1.56, .64, 1) forwards; }
@keyframes click-pop {
  0% { opacity: 0; transform: scale(.2) rotate(0deg); }
  25% { opacity: 1; transform: scale(1.15) rotate(calc(var(--r) * .4)); }
  100% { opacity: 0; transform: translateY(-38px) scale(.85) rotate(var(--r)); }
}
@media (prefers-reduced-motion: reduce) { .click-pop { display: none; } }

/* ---- strawberry milk scrollbars (only where a panel truly needs one) ---- */
/* Safari / Chrome / Edge: custom drawing (scrollbar-width/color would switch it off in Chrome, so reset them) */
@supports selector(::-webkit-scrollbar) {
  * { scrollbar-width: auto !important; scrollbar-color: auto !important; }
  ::-webkit-scrollbar { width: 11px; height: 11px; }
  ::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
  ::-webkit-scrollbar-track { background: #FFF3F7; border-radius: 999px; box-shadow: inset 0 0 0 1px #FBD9E6; }
  ::-webkit-scrollbar-thumb {
    border-radius: 999px; border: 2px solid #FFF3F7;
    background:
      radial-gradient(circle at 30% 25%, #FFF6C9 0 1px, transparent 1.5px) 0 0 / 7px 9px,
      linear-gradient(180deg, #FBC4DA, #F49AC0);
  }
  ::-webkit-scrollbar-thumb:hover { background:
      radial-gradient(circle at 30% 25%, #FFF6C9 0 1px, transparent 1.5px) 0 0 / 7px 9px,
      linear-gradient(180deg, #F7A1C4, #E85D92); }
  ::-webkit-scrollbar-corner { background: transparent; }
}
/* Firefox: colors only */
@supports not selector(::-webkit-scrollbar) {
  * { scrollbar-color: #F49AC0 #FFF3F7; scrollbar-width: thin; }
}
@media (max-height: 760px) { body.app-shell .dash-grid.fill { min-height: 220px; } }
@media (max-height: 800px) { body.app-shell .twin-charts { min-height: 150px; } body.app-shell .dash-grid.fill { min-height: 200px; } }
@media (max-height: 800px) { body.app-shell .twin-charts .chart { min-height: 70px; } }
/* insight cards: four share the width on any desktop size (no sideways scrolling); phones stack */
@media (min-width: 641px) { .insight-page { grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; } }

/* card header row: title on the left, a view switch on the right, wrapping instead of overlapping */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; margin-right: 44px; }
.card-head h2 { margin: 0; }
.card-head .view-switch { position: static; }

/* Instagram account cards: always one row on desktop (they share the width, contents wrap inside) */
@media (min-width: 900px) {
  .ig-stickers.with-combined { grid-template-columns: minmax(0, .8fr) repeat(2, minmax(0, 1fr)); }
  .ig-stickers:not(.with-combined) { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); }
  .ig-row { gap: 6px 14px; }
}

/* ---- Strawberry: notes and replies as chat bubbles ---- */
.btn.ghost { background: #fff; color: var(--pink-700); box-shadow: 0 0 0 2px var(--pink-200) inset; }
.strawberry-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.chat-card, .connect-card { display: flex; flex-direction: column; min-height: 0; }
.chat-thread { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 6px 4px 10px; overflow-x: hidden; }
.bubble { max-width: 78%; padding: 9px 13px 7px; border-radius: 18px; box-shadow: var(--shadow); overflow-wrap: anywhere; }
.bubble.her { align-self: flex-end; background: linear-gradient(135deg, #FFE4EF, #FFD3E4); border-bottom-right-radius: 6px; }
.bubble.strawberry { align-self: flex-start; background: linear-gradient(135deg, #F4EDFF, #EAF6F1); border: 2px solid #E3D6FA; border-bottom-left-radius: 6px; }
.bubble-text { font-size: .92rem; line-height: 1.4; }
.bubble-meta { font-size: .7rem; color: var(--ink-soft); margin-top: 4px; text-align: right; }
.bubble.strawberry .bubble-meta { text-align: left; }
.chat-empty { margin: auto; text-align: center; color: var(--ink-soft); }
.composer { display: flex; gap: 8px; align-items: flex-end; padding-top: 8px; border-top: 2px dashed var(--pink-100); }
.composer textarea { flex: 1; resize: none; font: inherit; font-size: .92rem; border: 2px solid var(--pink-200); border-radius: 16px;
  padding: 8px 12px; background: #fff; color: var(--ink); min-height: 44px; max-height: 140px; }
.composer textarea:focus { outline: none; border-color: var(--pink-500); box-shadow: 0 0 0 4px var(--pink-100); }
.connect-status { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; font-size: .86rem; font-weight: 700; }
.connect-status .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #E9C6D4; margin-right: 8px; vertical-align: middle; }
.connect-status .dot.on { background: #5CC9A7; box-shadow: 0 0 0 3px #DDF5EE; }
.connect-card h3 { font-size: .95rem; margin: 10px 0 4px; }
.connect-steps { padding-left: 20px; margin: 0; display: grid; gap: 8px; font-size: .84rem; line-height: 1.4; }
code.copy { display: inline-block; margin-top: 4px; padding: 3px 9px; border-radius: 10px; background: var(--pink-50); border: 1.5px dashed var(--pink-300);
  font-size: .8rem; overflow-wrap: anywhere; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, copy; }
code.copy.copied::after { content: ' ✓ copied'; color: #1F6F55; font-weight: 800; }
.consent-card { max-width: 620px; margin: 30px auto; }
.consent-list { display: grid; gap: 6px; padding-left: 4px; list-style: none; }
.consent-actions { display: flex; gap: 10px; margin-top: 14px; }
@media (max-width: 1000px) { .strawberry-grid { grid-template-columns: minmax(0, 1fr); } }

/* phone tab bar: only shown by mobile.css */
.bottom-nav { display: none; }

/* eight tabs still fit beside the ribbon on one row (desktop) */
@media (min-width: 900px) {
  .masthead .tabs { gap: 4px; margin-left: 4px; }
  .masthead .tab { padding: 4px 9px 6px; font-size: .9rem; gap: 4px; }
  .masthead .tab-icon { width: 18px; height: 18px; }
}
.connect-happy { font-weight: 800; color: #1F6F55; background: var(--mint-100); border-radius: 14px; padding: 8px 12px; margin: 4px 0 10px; }
.connect-setup > summary { font-weight: 800; color: var(--pink-700); margin: 6px 0; list-style: none; }
.connect-setup > summary::-webkit-details-marker { display: none; }
.connect-setup > summary::before { content: '✿ '; }
.connect-setup[open] > summary { color: var(--ink); }

/* "Hey Annah!" greeting, stacked above sign out so the tab row keeps its width */
.who-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.hey { font-family: var(--font-hand); font-size: 1.2rem; line-height: 1; color: var(--pink-700); white-space: nowrap; }
.who-text .link-button { line-height: 1.1; }
.hey-phone { display: none; }

/* upload cards, tidier: name + months on top, file name small, then when + who */
.upload-list li { grid-template-columns: 30px minmax(0, 1fr); align-items: start; padding: 8px 14px; }
.upload-list li .doodle { margin-top: 2px; }
.ul-top { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; }
.ul-top b { font-size: .92rem; }
.ul-top .badge { font-size: .72rem; }
.upload-list .ul-file { display: block; font-size: .74rem; color: var(--ink-soft); opacity: .8; overflow-wrap: anywhere; line-height: 1.3; margin-top: 1px; }
.upload-list .ul-meta { display: block; font-size: .76rem; color: var(--ink-soft); margin-top: 2px; }

/* small round buttons beside the greeting: Add reports, the Bunny Burrow */
.round-btn { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid var(--pink-200);
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1), background .2s; flex: none; }
.round-btn svg { width: 24px; height: 24px; }
.round-btn:hover { transform: translateY(-2px) rotate(-6deg); background: var(--pink-50); }
.round-btn.on { background: var(--pink-500); border-color: var(--pink-700); }

/* color dots (shared: bookshelf, calendar editor, Bunny Burrow) */
.tone-dot { width: 24px; height: 24px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--pink-200); cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; padding: 0; transition: transform .2s; }
.tone-dot.on { box-shadow: 0 0 0 3px var(--pink-500); transform: scale(1.15); }
.tone-dot.tone-pink { background: #FBC4DA; } .tone-dot.tone-lavender { background: #DCCBF7; } .tone-dot.tone-mint { background: #BDEBDD; }
.tone-dot.tone-honey { background: #FFE0A3; } .tone-dot.tone-sky { background: #C9E2FA; } .tone-dot.tone-peach { background: #FFD2BF; }
.doodle-pick { width: 34px; height: 34px; border-radius: 12px; border: 2px solid transparent; background: #fff; cursor: url("cursors/bunny-heart.cbdcba3d527c.svg") 3 2, pointer; padding: 3px; transition: transform .2s; }

/* Kindle deals, wherever posts are shown */
.deal-tag { display: inline-block; padding: 0 7px; border-radius: 999px; background: #FFF6D9; color: #7A5E10; font-weight: 800; font-size: .74rem; }
.deal-note { padding: 8px 10px; border-radius: 12px; background: #FFF6D9; border: 2px solid #FFE7A3; font-size: .84rem; font-weight: 700; margin: 8px 0; }

/* chart labels never wrap: the tooltip grows to fit instead (post peeks are sentences, so those may wrap) */
.chart .tooltip:not(.peek) { max-width: none; white-space: nowrap; }
.chart .tooltip .t-row span { white-space: nowrap; }
.br-legend span, .legend .key { white-space: nowrap; }

/* Ledger: Dreamscape half-year blocks + audiobook advances */
.ds-blocks { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-size: .78rem; }
.ds-label { font-weight: 800; color: var(--ink-soft); }
.ds-block { padding: 3px 10px; border-radius: 999px; background: #EAF2FB; border: 2px solid #BFD6EE; color: #22548A; font-weight: 700; white-space: nowrap; }
.ds-row td { background: #F5F9FD; }
.adv-h { font-size: .9rem; margin: 4px 0 8px; }
.adv-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.adv-list li { display: grid; gap: 3px; }
.adv-top { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; }
.adv-top span { white-space: nowrap; font-weight: 800; }
.adv-bar { height: 8px; border-radius: 6px; background: #EAF2FB; overflow: hidden; }
.adv-bar i { display: block; height: 100%; background: linear-gradient(90deg, #7FA9D8, #2F6FB3); border-radius: 6px; }
.adv-list li.done .adv-bar i { background: linear-gradient(90deg, #8CC9A0, #4E9A6A); }
.adv-list small { color: var(--ink-soft); font-weight: 700; font-size: .74rem; }

/* Ledger: three list tabs sit under the title instead of over it */
.ledger-list > .view-switch { position: static; display: inline-flex; width: fit-content; margin: 0 0 6px; }
