/* Brand: Content Approvals. Palette from the brand board; Sprinkle Toast Crumb for display, Poppins for text. */
@font-face {
  font-family: "Sprinkle Toast Crumb";
  src: url("/fonts/sprinkle-toast-crumb.otf") format("opentype");
  font-display: swap;
}
:root {
  color-scheme: light;
  --accent: #EB6593;
  --pink: #EB6593;
  --pink-2: #F6C0D3;
  --blush: #FAECEE;
  --yellow: #F8D863;
  --lav: #DFB9FB;
  --lav-2: #F3E4FD;
  --peri: #BBCAFB;
  --cream: #FFFDF6;
  --orchid: #E16FBD;
  --display: "Sprinkle Toast Crumb", "Poppins", sans-serif;
  --ink: #000000;
  --muted: #737373;
  --line: #dbdbdb;
  --soft: #FFFDF6;
  --bg: #ffffff;
  --ok: #2c3f9e;
  --warn: #6b5200;
  --radius: 14px;
  --font: "Poppins", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--soft);
  -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.4;
}
button { font: inherit; cursor: pointer; }
img, video { display: block; max-width: 100%; }
.ic svg { width: 1em; height: 1em; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  border-left: 1px solid var(--blush);
  border-right: 1px solid var(--blush);
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}

/* Boot / states */
.boot, .state { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 70vh; padding: 32px; color: var(--muted); }
.state h2 { color: var(--ink); font-family: var(--display); font-weight: 400; font-size: 24px; margin: 12px 0 6px; }
.state p { margin: 0; max-width: 300px; }
.state .emoji { font-size: 40px; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--blush); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 16px;
  background: rgba(255,253,246,.95); backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid #efefef;
}
.brand { display: flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand img { width: 34px; height: 34px; flex: none; }
.brand span { font-family: var(--display); font-size: 22px; line-height: 1; padding-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sprinkles { flex: none; width: 54px; height: 20px; }

/* Profile */
.profile { padding: 16px 16px 4px; }
.profile-row { display: flex; align-items: center; gap: 24px; }
.avatar-ring { flex: none; width: 86px; height: 86px; border-radius: 50%; padding: 3px; background: #e6e6e6; }
.avatar-ring.has-pending { background: conic-gradient(from 200deg, var(--yellow), var(--pink), var(--orchid), var(--lav), var(--peri), var(--yellow)); }
.avatar-ring .inner { width: 100%; height: 100%; border-radius: 50%; background: #fff; padding: 3px; }
.avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: var(--blush); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--muted); font-size: 26px; overflow: hidden; }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; flex: none; }
.avatar.md { width: 40px; height: 40px; font-size: 15px; flex: none; }
.stats { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.stats b { display: block; font-size: 17px; }
.stats span { font-size: 13px; color: var(--ink); }
.profile .name { font-weight: 600; margin-top: 12px; }
.profile .at { color: var(--muted); font-size: 13px; }
.profile .bio { color: var(--ink); margin-top: 2px; white-space: pre-line; }
.profile .bio .muted { color: var(--muted); }

/* Tabs */
.tabs { position: sticky; top: 52px; z-index: 15; background: #fff; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid #efefef; margin-top: 14px; }
.tab { background: none; border: 0; border-top: 1px solid transparent; margin-top: -1px; padding: 12px 0; color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .6px; text-transform: uppercase; display: flex; align-items: center; justify-content: center; gap: 6px; }
.tab svg { width: 14px; height: 14px; }
.tab[aria-selected="true"] { color: var(--ink); border-top-color: var(--ink); }
.badge { background: var(--accent); color: #000; font-weight: 700; border-radius: 10px; font-size: 11px; padding: 1px 7px; letter-spacing: 0; }

/* Filter chips */
.toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid #efefef; }
.chips { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 500; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.viewtoggle { display: flex; gap: 2px; flex: none; }
.viewtoggle button { border: 0; background: none; padding: 6px; border-radius: 8px; color: var(--muted); }
.viewtoggle button[aria-pressed="true"] { color: var(--ink); background: #f2f2f2; }
.viewtoggle svg { width: 20px; height: 20px; display: block; }

/* Intro note */
.note { margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px; background: var(--blush); border: 1px solid var(--pink-2); font-size: 13px; color: #000; }
.note.ok { background: #f0faf4; border-color: #d4f0df; color: #1d4d33; }

/* Day heading */
.day { padding: 20px 16px 6px; font-family: var(--display); font-size: 21px; color: var(--ink); }

/* Post shared */
.post { border-bottom: 1px solid #efefef; padding-bottom: 12px; background: #fff; scroll-margin-top: 110px; transition: opacity .35s, transform .35s, max-height .45s; }
.post.leaving { opacity: 0; transform: scale(.98); }
.post-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.post-head .who { flex: 1; min-width: 0; }
.post-head .who b { font-weight: 600; font-size: 14px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-head .who small { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 4px; }
.plat { display: inline-flex; align-items: center; gap: 4px; }
.plat svg { width: 12px; height: 12px; }
.pill { flex: none; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 4px 9px; white-space: nowrap; }
.pill.st-review { background: var(--pink); color: #000; }
.pill.st-approved { background: var(--peri); color: #000; }
.pill.st-posted { background: var(--lav-2); color: #000; }
.pill.st-revising { background: var(--yellow); color: #000; }
.pill.st-production { background: var(--blush); color: #5a3a44; }
.post-title { padding: 0 14px; margin-top: 6px; font-size: 12px; color: var(--muted); }

/* Media */
.media { position: relative; background: #efefef; aspect-ratio: 4 / 5; overflow: hidden; }
.track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; height: 100%; scroll-snap-align: center; display: flex; align-items: center; justify-content: center; background: #111; }
.slide { position: relative; }
.slide > .textile { position: absolute; inset: 0; }
.slide img, .slide video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.slide img { object-fit: cover; }
.counter { position: absolute; top: 12px; right: 12px; background: rgba(18,18,18,.72); color: #fff; font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 12px; }
.dots { display: flex; justify-content: center; gap: 4px; padding-top: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #d0d0d0; }
.dots i.on { background: var(--pink); }
.navbtn { position: absolute; top: 50%; transform: translateY(-50%); width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); box-shadow: 0 1px 4px rgba(0,0,0,.2); display: flex; align-items: center; justify-content: center; }
.navbtn.prev { left: 8px; } .navbtn.next { right: 8px; }
.navbtn svg { width: 14px; height: 14px; }
@media (hover: none) { .navbtn { display: none; } }
.textile { width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 32px; color: #000; text-align: left; background: linear-gradient(150deg, var(--pink-2), var(--pink)); }
.textile .big { font-family: var(--display); font-size: 28px; line-height: 1.1; }
.textile .small { margin-top: 14px; font-size: 12px; font-weight: 500; opacity: .75; }
.textile.alt1 { background: linear-gradient(150deg, var(--lav-2), var(--peri)); }
.textile.alt2 { background: linear-gradient(150deg, #fff3c4, var(--yellow)); }
.media.loading::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.5) 50%, transparent 70%); animation: shimmer 1.2s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* IG */
.ig-actions { display: flex; align-items: center; gap: 14px; padding: 8px 14px 4px; }
.ig-actions svg { width: 24px; height: 24px; }
.ig-actions .save { margin-left: auto; }
.caption { padding: 2px 14px 0; white-space: pre-line; word-wrap: break-word; }
.caption b { font-weight: 600; margin-right: 4px; }
.more-inline { background: none; border: 0; padding: 0; color: var(--muted); font-size: inherit; }
.when { padding: 6px 14px 0; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .3px; }

/* Threads */
.threads { display: grid; grid-template-columns: 40px 1fr; gap: 10px; padding: 14px 14px 12px; }
.threads .rail { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.threads .rail::after { content: ""; flex: 1; width: 2px; background: #e5e5e5; border-radius: 2px; min-height: 12px; }
.threads .top { display: flex; align-items: center; gap: 6px; }
.threads > div:last-child { min-width: 0; }
.threads .top b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.threads .top small { color: var(--muted); white-space: nowrap; flex: none; }
.threads .top .pill { margin-left: auto; }
.threads .text { margin-top: 2px; white-space: pre-line; word-wrap: break-word; font-size: 15px; line-height: 1.45; }
.threads .text p { margin: 0 0 10px; }
.threads .reply { color: var(--muted); border-left: 2px solid #eee; padding-left: 10px; margin-top: 6px; }
.threads .icons { display: flex; gap: 16px; margin-top: 10px; color: var(--ink); }
.threads .icons svg { width: 20px; height: 20px; }
.threads .media { aspect-ratio: auto; max-height: 420px; border-radius: 10px; margin-top: 8px; }
.threads .media .track, .threads .media .slide { height: auto; }
.threads .media img, .threads .media video { max-height: 420px; }

/* LinkedIn & generic */
.li { padding-top: 4px; }
.li .post-head .who small { gap: 4px; }
.li .body { padding: 0 14px 8px; white-space: pre-line; word-wrap: break-word; }
.li .media { aspect-ratio: 1 / 1; }
.li-bar { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid #efefef; margin: 8px 14px 0; padding-top: 4px; }
.li-bar span { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 0; color: #5e5e5e; font-weight: 600; font-size: 13px; }
.li-bar svg { width: 18px; height: 18px; }

/* Review controls */
.review { padding: 12px 14px 4px; }
.review-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn { border-radius: 999px; padding: 11px 12px; font-weight: 600; font-size: 14px; border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn svg { width: 16px; height: 16px; }
.btn.primary { background: var(--accent); color: #000; }
.btn.primary:hover { filter: brightness(1.04); }
.btn.secondary { background: var(--blush); color: var(--ink); border-color: var(--pink-2); }
.btn.ghost { background: none; color: var(--muted); }
.btn[disabled] { opacity: .55; cursor: default; }
.revise-form { margin-top: 10px; display: none; }
.revise-form.open { display: block; }
.revise-form label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; }
.revise-form textarea { width: 100%; min-height: 96px; resize: vertical; border: 1px solid var(--pink-2); border-radius: 14px; background: var(--cream); padding: 10px 12px; font: inherit; font-size: 15px; }
.revise-form textarea:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.revise-form .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.review-done { margin: 12px 14px 4px; padding: 12px; border-radius: 10px; text-align: center; font-weight: 600; }
.review-done.ok { background: var(--peri); color: #000; }
.review-done.rev { background: var(--yellow); color: #000; }
.goto { margin: 10px 14px 2px; width: calc(100% - 28px); }

/* Grid */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.cell { position: relative; aspect-ratio: 4 / 5; background: var(--blush); border: 0; padding: 0; overflow: hidden; }
.cell img { width: 100%; height: 100%; object-fit: cover; }
.cell .textile { padding: 10px; }
.cell .textile .big { font-size: 14px; }
.cell .textile .small { display: none; }
.cell .ico { position: absolute; top: 6px; right: 6px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
.cell .ico svg { width: 18px; height: 18px; }
.cell .flag { position: absolute; left: 6px; bottom: 6px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.cell .flag.st-review { background: var(--pink); }
.cell .flag.st-approved, .cell .flag.st-posted { background: var(--peri); }
.cell .flag.st-revising { background: var(--yellow); }
.cell .flag.st-production { background: #fff; }
.cell .flag-label { position: absolute; left: 6px; bottom: 6px; background: #000; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.legend { display: flex; flex-wrap: wrap; gap: 12px; padding: 10px 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }

.empty { padding: 56px 32px; text-align: center; color: var(--muted); }
.empty .emoji { font-size: 40px; }
.empty h3 { color: var(--ink); margin: 10px 0 4px; font-family: var(--display); font-weight: 400; font-size: 26px; }
.empty img { width: 96px; height: 96px; margin: 0 auto; }

.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 28px 16px 8px; }
.footer .brandmark { display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 18px; color: var(--ink); }
.footer .brandmark img { width: 26px; height: 26px; }
.footer a { color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: #000; color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s; max-width: calc(100% - 32px); z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: #b42318; }

.demo-banner { background: #111; color: #fff; font-size: 12px; text-align: center; padding: 8px 12px; }

@media (min-width: 520px) {
  body { padding: 0 0 40px; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
