/* NT client hub. Colours follow narrative-twist.com: duck egg blue, charcoal, white, NT blue for accents. */
:root {
  --blue: #E0EDED; --blue-2: #E7F0EF; --line: #B6D1D0; --ink: #1F2326; --head: #2A2A2A; --teal: #24464A; --muted: #5C6468;
  --nt: #019EAE; --edit: #D9A9A3; --ok: #7FB8A6; --white: #FFFFFF;
  --display: "SangBleu Empire", "Newsreader", Georgia, serif;
  --body: "SangBleu Sunrise", "Newsreader", Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; }
a { color: var(--ink); }
a:hover { color: var(--teal); }
button, input, textarea { font-family: var(--body); font-size: 16px; color: var(--ink); }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--nt); outline-offset: 2px; }
img { display: block; max-width: 100%; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.eyebrow { margin: 0; font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.wrap { max-width: 1240px; margin: 0 auto; }
.btn { height: 54px; padding: 0 28px; border: 0; background: var(--ink); color: var(--white); font-weight: 500; }
.btn:hover { background: var(--teal); }
.btn.ghost { border: 1px solid var(--ink); background: var(--white); color: var(--ink); }
.btn.ghost:hover { background: var(--blue-2); }
.btn.soft { border: 1px solid var(--line); background: var(--blue-2); color: var(--ink); }
.btn[disabled] { opacity: .5; cursor: default; }
.link { border: 0; background: transparent; padding: 6px 0; text-decoration: underline; color: var(--ink); font-size: 15px; }
.link.muted { color: var(--muted); }
.field { width: 100%; height: 52px; border: 1px solid var(--line); padding: 0 16px; background: var(--white); }
textarea.field { height: auto; padding: 14px 16px; resize: vertical; line-height: 1.5; }
.stamp { position: absolute; pointer-events: none; opacity: .12; }

/* loading */
.boot { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--blue); }
.boot img { width: 120px; opacity: .9; }

/* sign in */
.signin { min-height: 100vh; background: var(--blue); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 96px; padding: 48px 6%; }
.signin .brand { flex: 1 1 0; max-width: 520px; display: flex; flex-direction: column; gap: 24px; position: relative; }
.signin .brand img { width: 100%; max-width: 440px; height: auto; }
.signin .card { width: 460px; max-width: 100%; flex: none; background: var(--white); box-shadow: 0 30px 60px -30px rgba(31,35,38,.25); padding: 48px 44px; display: flex; flex-direction: column; gap: 20px; position: relative; }
.signin .card .logo { max-width: 150px; max-height: 64px; width: auto; height: auto; }
.signin h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1.08; letter-spacing: -0.01em; color: var(--head); }
.signin .lede { margin: 0; font-size: 16px; color: var(--muted); }
.signin .actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.signin .actions .btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; height: 52px; }
.signin .note { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.signin .err { margin: 0; font-size: 15px; color: var(--teal); background: var(--blue-2); padding: 12px 14px; }
.signin .stamp { right: 40px; bottom: 36px; width: 420px; }
.code-input { letter-spacing: 0.4em; font-size: 22px; text-align: center; }
/* phone tab bar: hidden on wide screens, shown by the @media block below. Base rules always come before their @media overrides (checked by test/css-order.mjs). */
.bottomnav { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--white); box-shadow: 0 -10px 30px -20px rgba(31,35,38,.35); grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); padding: 10px 8px calc(14px + env(safe-area-inset-bottom)); }
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; font-size: 13px; color: var(--muted); }
.bottomnav a[aria-current="page"] { color: var(--ink); font-weight: 500; }
.bottomnav svg { width: 24px; height: 24px; }
.bottomnav .count { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 999px; background: var(--ink); color: var(--white); font-size: 13px; display: flex; align-items: center; justify-content: center; }
@media (max-width: 900px) {
  .signin { flex-direction: column; gap: 32px; padding: 32px 16px; justify-content: flex-start; }
  .signin .brand { align-items: center; }
  .signin .brand img { max-width: 220px; }
  .signin .card { padding: 32px 24px; }
  .signin h1 { font-size: 36px; }
  .signin .stamp { width: 240px; right: -40px; bottom: -20px; }
}

/* top band */
.band { background: var(--blue); padding: 24px 5% 200px; }
.band.short { padding-bottom: 56px; }
.band .wrap { display: flex; flex-direction: column; gap: 64px; }
.topbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.clientmark { display: flex; align-items: center; min-height: 44px; }
.clientmark img { max-width: 150px; max-height: 56px; width: auto; height: auto; }
.clientmark span { font-family: var(--display); font-size: 26px; color: var(--head); }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; background: var(--white); padding: 5px; border-radius: 999px; box-shadow: 0 14px 30px -18px rgba(31,35,38,.3); }
.tabs a { padding: 10px 18px; border-radius: 999px; text-decoration: none; font-size: 15px; color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--ink); color: var(--white); font-weight: 500; }
.me { display: flex; align-items: center; gap: 14px; position: relative; }
.me .ntlogo { width: 66px; height: auto; }
.avatar { width: 40px; height: 40px; border-radius: 999px; border: 0; background: var(--ink); color: var(--white); font-family: var(--display); font-size: 17px; }
.menu { position: absolute; right: 0; top: 52px; background: var(--white); box-shadow: 0 20px 40px -20px rgba(31,35,38,.4); padding: 16px 18px; min-width: 220px; z-index: 5; display: flex; flex-direction: column; gap: 10px; }
.menu[hidden] { display: none; }
.menu p { margin: 0; font-size: 14px; color: var(--muted); }
.hello { display: flex; flex-direction: column; gap: 18px; max-width: 760px; }
.hello h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 76px; line-height: 0.98; letter-spacing: -0.015em; color: var(--head); padding-bottom: 4px; }
.hello p.sub { margin: 0; font-size: 20px; color: var(--teal); }

/* feature card: a clip that needs the client */
.lift { padding: 0 5%; margin-top: -150px; position: relative; display: flex; flex-direction: column; gap: 48px; }
.feature { max-width: 1240px; width: 100%; margin: 0 auto; background: var(--white); box-shadow: 0 40px 80px -40px rgba(31,35,38,.35); display: flex; flex-wrap: wrap; gap: 56px; padding: 48px; }
.feature .media { flex: 0 0 340px; display: flex; flex-direction: column; gap: 14px; }
.player { position: relative; width: 340px; aspect-ratio: 9 / 16; background: var(--blue-2); overflow: hidden; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.versions { display: flex; flex-wrap: wrap; gap: 6px; }
.versions button { height: 34px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-size: 14px; }
.versions button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--white); }
.feature .body { flex: 999 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 28px; padding-top: 8px; }
.feature h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 46px; line-height: 1.06; letter-spacing: -0.01em; color: var(--head); padding-bottom: 2px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.steps li { display: flex; flex-direction: column; gap: 10px; font-size: 13px; color: var(--muted); }
.steps li i { height: 6px; background: var(--blue); }
.steps li.done i { background: var(--ink); }
.steps li.now i { background: var(--nt); }
.steps li.now { color: var(--ink); font-weight: 500; }
.explain { margin: 0; font-size: 18px; line-height: 1.55; max-width: 620px; }
.decide { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.decide .link { padding: 0 12px; }
.ask { display: flex; flex-direction: column; gap: 10px; background: var(--blue-2); padding: 18px 20px; }
.ask p { margin: 0; font-size: 15px; }
.ask .row { display: flex; flex-wrap: wrap; gap: 10px; }
.status-line { margin: 0; font-size: 15px; color: var(--teal); }
.caption { background: var(--blue-2); padding: 24px 26px; display: flex; flex-direction: column; gap: 12px; }
.caption .head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.caption .links { display: flex; flex-wrap: wrap; gap: 18px; }
.caption .text { margin: 0; font-size: 16px; line-height: 1.55; white-space: pre-wrap; }
.caption .hint { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.caption .vlist { display: flex; flex-direction: column; gap: 8px; }
.caption .vlist button { text-align: left; border: 1px solid var(--line); background: var(--white); padding: 12px 14px; font-size: 15px; }
.caption .vlist button[aria-pressed="true"] { border-color: var(--ink); }
.comments { display: flex; flex-direction: column; gap: 16px; }
.comments .head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; }
.comments h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 26px; color: var(--head); }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.filters input[type="search"] { flex: 1 1 220px; min-width: 0; height: 44px; border: 1px solid var(--line); padding: 0 14px; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-size: 14px; }
.chips button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--white); }
.filters label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; }
.trailbox.open { max-height: 340px; overflow-y: auto; display: flex; flex-direction: column-reverse; border-top: 1px solid var(--blue); border-bottom: 1px solid var(--blue); padding-right: 6px; }
.trail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.trail li { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--blue); }
.trail .dot { flex: none; width: 32px; height: 32px; border-radius: 999px; background: var(--ink); color: var(--white); font-size: 13px; display: flex; align-items: center; justify-content: center; }
.trail .update .dot { background: var(--blue); color: var(--teal); }
.trail .nt .dot { background: var(--nt); }
.trail .meta { margin: 0; font-size: 13px; color: var(--muted); }
.trail .say { margin: 0; font-size: 16px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.trail .update .say { font-size: 15px; color: var(--muted); font-style: italic; }
.trail .more button { border: 0; background: transparent; padding: 0; font-size: 14px; color: var(--teal); }
.compose { display: flex; gap: 10px; }
.compose textarea { flex: 1 1 auto; min-width: 0; resize: vertical; border: 1px solid var(--line); padding: 14px 16px; line-height: 1.5; }
.compose .btn { flex: none; height: auto; min-height: 54px; padding: 0 24px; }

/* sections under the feature cards */
.section { padding: 96px 5% 0; position: relative; }
.section:last-of-type { padding-bottom: 240px; }
.section .wrap { display: flex; flex-direction: column; gap: 36px; position: relative; }
.section .title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; }
.section h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 40px; letter-spacing: -0.01em; color: var(--head); }
.section .title p { margin: 0; font-size: 16px; color: var(--muted); }
.edits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
.editcard { background: var(--blue-2); display: flex; gap: 28px; padding: 28px; min-width: 0; }
.editcard .cover { width: 150px; aspect-ratio: 9 / 16; object-fit: cover; flex: none; background: var(--blue); }
.editcard .info { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.editcard h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 25px; line-height: 1.15; color: var(--head); }
.editcard .note { background: var(--white); padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.editcard .note p { margin: 0; font-size: 15px; }
.editcard .note .eyebrow { font-size: 12px; letter-spacing: 0.12em; }
.editcard .due { margin: 0; font-size: 14px; color: var(--teal); }
.dots { display: none; gap: 8px; justify-content: center; }
.dots span { width: 6px; height: 6px; border-radius: 999px; background: var(--line); }
.dots span.on { width: 22px; background: var(--ink); }
.approved { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 24px; }
.approved article { display: flex; flex-direction: column; gap: 10px; }
.approved img, .approved .blank { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: var(--blue-2); }
.approved h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 18px; line-height: 1.25; color: var(--head); }
.approved p { margin: 0; font-size: 13px; color: var(--muted); }
.empty { background: var(--blue-2); padding: 40px; font-size: 18px; color: var(--teal); max-width: 1240px; margin: 0 auto; width: 100%; }
.stamp.bottom { left: 50%; bottom: 40px; transform: translateX(-50%); width: 300px; }

/* plan */
.planhead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.planhead h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 76px; line-height: 1.05; letter-spacing: -0.015em; color: var(--head); padding-bottom: 4px; }
.planhead .sub { margin: 0; font-size: 18px; color: var(--teal); }
.monthnav { display: flex; gap: 8px; align-items: center; }
.monthnav button { width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--white); font-size: 18px; }
.toggle { display: flex; gap: 4px; background: var(--white); padding: 6px; border-radius: 999px; }
.toggle button { min-height: 44px; padding: 0 24px; border-radius: 999px; border: 0; background: transparent; font-size: 15px; }
.toggle button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.calendar { padding: 48px 3% 120px; }
.calendar .wrap { max-width: 1600px; display: flex; flex-direction: column; gap: 28px; }
.key { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; font-size: 15px; }
.key span { display: flex; align-items: center; gap: 8px; }
.sdot { flex: none; width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.grid7 { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.grid7 .dow { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); padding: 0 2px; }
.day { min-height: 110px; padding: 14px; display: flex; flex-direction: column; gap: 12px; background: #E7F0EF; }
.day.out { background: transparent; }
.day.has { background: var(--white); box-shadow: 0 24px 48px -28px rgba(31,35,38,.4); }
.day .n { font-size: 14px; line-height: 1; color: var(--muted); }
.day.has .n { color: var(--ink); font-weight: 500; }
.day.today .n { color: var(--nt); font-weight: 500; }
.post { display: flex; flex-direction: column; gap: 10px; text-decoration: none; }
.post img, .post .blank { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 45%; background: var(--blue-2); }
.post .st { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--teal); }
.post .t { font-family: var(--display); font-size: 16px; line-height: 1.25; color: var(--head); }
.agenda { display: none; list-style: none; margin: 0; padding: 0; flex-direction: column; gap: 16px; }
.agenda li { display: flex; gap: 16px; background: var(--white); box-shadow: 0 24px 48px -28px rgba(31,35,38,.4); padding: 14px; }
.agenda img, .agenda .blank { width: 96px; aspect-ratio: 3 / 4; object-fit: cover; flex: none; background: var(--blue-2); }
.agenda .d { margin: 0; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.agenda .t { margin: 0; font-family: var(--display); font-size: 18px; line-height: 1.25; color: var(--head); }
.feedgrid { padding: 56px 5% 120px; }
.feedgrid .wrap { max-width: 720px; display: flex; flex-direction: column; gap: 24px; }
.feedgrid .cells { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.feedgrid .cells img, .feedgrid .cells .blank { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: var(--blue-2); }
.feedgrid p { margin: 0; font-size: 16px; color: var(--muted); }

/* results and brand */
.later { padding: 64px 5% 240px; position: relative; }
.later .wrap { max-width: 760px; display: flex; flex-direction: column; gap: 18px; }
.later p { margin: 0; font-size: 18px; color: var(--teal); }

@media (max-width: 1100px) {
  .edits { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .band { padding: 18px 16px 150px; }
  .band.short { padding-bottom: 40px; }
  .band .wrap { gap: 36px; }
  .topbar { flex-wrap: nowrap; }
  .topbar .tabs { display: none; }
  .me .ntlogo { width: 50px; }
  .clientmark img { max-width: 112px; }
  .hello h1, .planhead h1 { font-size: 44px; line-height: 1; }
  .hello p.sub { font-size: 17px; }
  .lift { padding: 0 16px; margin-top: -120px; gap: 32px; }
  .feature { padding: 0; gap: 0; flex-direction: column; flex-wrap: nowrap; }
  .feature .media { flex: none; }
  .player { width: 100%; }

  .feature .body { padding: 22px 20px 24px; gap: 20px; flex: none; }
  .feature h2 { font-size: 30px; }
  .steps li span { display: none; }
  .decide .btn { width: 100%; }
  .decide .link { width: 100%; text-align: center; padding: 10px; }
  .compose { flex-direction: column; }
  .section { padding: 48px 0 0 16px; }
  .section .title { padding-right: 16px; }
  .section h2 { font-size: 30px; }
  .edits { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding-right: 16px; scrollbar-width: none; }
  .edits::-webkit-scrollbar { display: none; }
  .editcard { flex: none; width: 82%; scroll-snap-align: start; flex-direction: column; gap: 12px; padding: 20px; }
  .editcard .cover { width: 100%; aspect-ratio: 4 / 3; object-position: center 30%; }
  .dots { display: flex; padding-right: 16px; }
  .approved { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-right: 16px; gap: 16px; }
  .empty { padding: 28px 20px; }
  .calendar { padding: 32px 16px 160px; }
  .grid7 { display: none; }
  .agenda { display: flex; }
  .feedgrid { padding: 32px 16px 160px; }
  .later { padding: 40px 16px 200px; }
  .bottomnav { display: grid; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn, .tabs a, .chips button { transition: background-color .15s ease, color .15s ease; }
}

/* Instagram Reels view over a clip (ignores clicks so the video still plays) */
.mediabar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.igtoggle { border: 0; background: transparent; padding: 6px 0; font-size: 14px; color: var(--teal); text-decoration: underline; }
.ig { position: absolute; inset: 0; pointer-events: none; color: #fff; font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif; z-index: 2; }
.ig[hidden] { display: none; }
.ig::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: linear-gradient(to top, rgba(0,0,0,.45), rgba(0,0,0,0)); z-index: -1; }
.ig svg { width: 26px; height: 26px; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.ig-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; align-items: center; justify-content: space-between; }
.ig-top b { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; text-shadow: 0 1px 2px rgba(0,0,0,.35); }
.ig-rail { position: absolute; right: 10px; bottom: 18px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.ig-rail > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ig-rail small { font-size: 12px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.ig-audio { width: 28px; height: 28px; border-radius: 6px; border: 2px solid #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--teal); font-style: normal; font-size: 12px; font-weight: 700; }
.ig-audio img, .ig-av img { width: 100%; height: 100%; object-fit: cover; }
.ig-foot { position: absolute; left: 12px; right: 58px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; text-shadow: 0 1px 2px rgba(0,0,0,.45); }
.ig-who { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.ig-av { width: 30px; height: 30px; border-radius: 999px; overflow: hidden; background: var(--teal); display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; font-size: 13px; border: 1px solid rgba(255,255,255,.6); flex: none; }
.ig-who b { font-weight: 600; }
.ig-who em { font-style: normal; font-weight: 600; font-size: 13px; border: 1px solid rgba(255,255,255,.75); border-radius: 8px; padding: 3px 10px; }
.ig-cap { margin: 0; font-size: 13.5px; line-height: 1.35; }
.ig-cap u { text-decoration: none; opacity: .8; }
.ig-song { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 12.5px; }
.ig-song svg { width: 14px; height: 14px; }
@media (max-width: 900px) { .feature .media .mediabar { padding: 12px 20px 0; } }

/* Plan: posts open a pop-up with that clip at its latest stage */
button.post, .agenda-btn, .cells .cell { border: 0; padding: 0; margin: 0; background: transparent; text-align: left; color: inherit; font: inherit; cursor: pointer; width: 100%; }
button.post:hover .t, .agenda-btn:hover .t { text-decoration: underline; }
.agenda li { padding: 0; }
.agenda-btn { display: flex; gap: 16px; padding: 14px; }
.cells .cell { display: block; }
.cells .cell:hover img { opacity: .9; }
.blankplayer { display: flex; align-items: center; justify-content: center; }
.blankplayer p { margin: 0; font-family: var(--display); font-size: 22px; color: var(--teal); }
html.popped { overflow: hidden; }
.pop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.pop-back { position: absolute; inset: 0; background: rgba(31,35,38,.42); }
.pop-panel { position: relative; width: min(1120px, 100%); max-height: calc(100vh - 64px); overflow-y: auto; overscroll-behavior: contain; background: var(--white); box-shadow: 0 40px 90px -30px rgba(31,35,38,.55); transform-origin: center; }
.pop-panel .feature { box-shadow: none; margin: 0; max-width: none; }
.pop-x { position: absolute; top: 14px; right: 14px; z-index: 3; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--blue); color: var(--ink); font-size: 26px; line-height: 1; }
.pop-x:hover { background: var(--line); }
@media (max-width: 900px) {
  .pop { align-items: flex-end; padding: 0; }
  .pop-panel { max-height: 92vh; border-radius: 18px 18px 0 0; }
  .pop-panel { overflow: visible; }
  .pop-panel > .feature { max-height: 92vh; overflow-y: auto; border-radius: 18px 18px 0 0; }
  .pop-x { top: -56px; right: 12px; background: var(--white); }
}

/* test page bar */
.testbar { position: sticky; top: 0; z-index: 40; background: #24464A; color: var(--white); font-size: 14px; padding: 10px 5%; text-align: center; }
.testbar b { font-weight: 500; }

/* carousels and statics: a link card instead of a player */
.linkplayer { display: flex; align-items: center; aspect-ratio: 4 / 5; }
.linkplayer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.linkcard { position: relative; margin: 16px; padding: 22px; background: var(--white); display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 40px -24px rgba(31,35,38,.4); }
.linkcard p { margin: 0; }
.linkcard .btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.steps.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* plan: posts without a date */
.undated { display: flex; flex-direction: column; gap: 14px; margin-top: 24px; }
.undated h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; color: var(--head); }
.undated > p { margin: 0; color: var(--teal); max-width: 640px; }
.undated-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.undated-list .post { background: var(--white); padding: 12px; box-shadow: 0 24px 48px -28px rgba(31,35,38,.4); }
.undated-list .post .t { font-family: var(--display); font-size: 17px; line-height: 1.25; color: var(--head); }

/* analytics */
.an { padding: 44px 5% 140px; }
.an .wrap { display: flex; flex-direction: column; gap: 36px; }
.an-loading { padding: 60px 0; color: var(--muted); }
.an-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 20px 32px; }
.an-title { display: flex; flex-direction: column; gap: 12px; max-width: 720px; }
.an-title h1 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 64px; line-height: 1.05; letter-spacing: -0.015em; color: var(--head); }
.an-title .sub { margin: 0; font-size: 17px; color: var(--teal); }
.an-controls { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.an .seg { display: inline-flex; flex-wrap: wrap; gap: 4px; background: var(--blue-2); padding: 4px; border-radius: 999px; }
.an .seg button { min-height: 40px; padding: 0 16px; border-radius: 999px; border: 0; background: transparent; font-size: 14px; white-space: nowrap; }
.an .seg button[aria-pressed="true"] { background: var(--ink); color: var(--white); }
.an .seg button[disabled] { color: var(--muted); cursor: default; }
.an-note { background: var(--blue-2); padding: 22px 26px; max-width: 860px; }
.an-note p { margin: 0; }
.an-writeup { background: var(--white); box-shadow: 0 40px 80px -40px rgba(31,35,38,.35); padding: 36px 40px; display: flex; flex-direction: column; gap: 16px; max-width: 900px; }
.an-writeup p { margin: 0; font-size: 18px; line-height: 1.6; max-width: 70ch; }
.an-writeup .eyebrow { font-size: 13px; }
.an-writeup .signed { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.an-writeup .hint { font-size: 14px; color: var(--muted); }
.an-writeup.draft { border-left: 4px solid var(--nt); }
.an-writeup .decide { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.an-sec { display: flex; flex-direction: column; gap: 20px; }
.an-sechead { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.an-sechead h2 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 34px; color: var(--head); }
.an-sechead p { margin: 0; color: var(--muted); font-size: 15px; }
.an .kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.an .kpi { background: var(--white); box-shadow: 0 24px 48px -28px rgba(31,35,38,.35); padding: 20px 18px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.an .kpi p { margin: 0; }
.an .kpi .label { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.an .kpi .value { font-family: var(--display); font-size: 38px; line-height: 1.1; color: var(--head); font-variant-numeric: tabular-nums; }
.an .kpi .split { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 2px 12px; }
.an .kpi .delta { font-size: 13px; color: var(--teal); }
.an .kpi .delta.down, .an .kpi .delta.flat { color: var(--muted); }
.pdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.an-charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.an .chartcard { background: var(--white); box-shadow: 0 24px 48px -28px rgba(31,35,38,.35); padding: 20px; min-width: 0; }
.an .chartcard h3, .an-h3, .an-postshead h3 { margin: 0 0 12px; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--head); }
.an .chart svg { display: block; width: 100%; height: auto; }
.an .chart text { font-family: var(--body); fill: var(--muted); font-size: 11px; }
.an .legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--muted); margin-top: 8px; }
.an-postshead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.an-postshead h3 { margin: 0; }
.an-select { font-size: 15px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); background: var(--white); border-radius: 999px; }
.an-posts { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.an-post { position: relative; background: var(--white); box-shadow: 0 24px 48px -28px rgba(31,35,38,.35); display: flex; flex-direction: column; min-width: 0; }
.an-post .img { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--blue-2); overflow: hidden; }
.an-post .img img { width: 100%; height: 100%; object-fit: cover; }
.an-post .img img.fit { object-fit: contain; }
.an-post .badge { position: absolute; left: 10px; top: 10px; font-size: 11px; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.9); color: var(--ink); }
.an-post .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.an-post .t { margin: 0; font-family: var(--display); font-size: 17px; line-height: 1.25; color: var(--head); }
.an-post .when { margin: 0; font-size: 12px; color: var(--muted); }
.an-post dl { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 4px 10px; margin: 6px 0 0; }
.an-post dt { font-size: 11px; color: var(--muted); }
.an-post dd { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.an .tablewrap { overflow-x: auto; background: var(--white); box-shadow: 0 24px 48px -28px rgba(31,35,38,.35); }
.an table.data { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 620px; font-variant-numeric: tabular-nums; }
.an table.data th, .an table.data td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--blue-2); white-space: nowrap; }
.an table.data th:first-child, .an table.data td:first-child { text-align: left; }
.an table.data thead th { font-weight: 500; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--blue-2); white-space: normal; }
.an .empty { padding: 28px; text-align: center; color: var(--muted); background: var(--blue-2); grid-column: 1 / -1; margin: 0; }
.an-method { background: var(--white); box-shadow: 0 24px 48px -28px rgba(31,35,38,.35); }
.an-method summary { cursor: pointer; padding: 18px 22px; font-family: var(--display); font-size: 20px; }
.an-method > div { padding: 0 22px 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; max-width: 80ch; }
.an-method p { margin: 0; }
@media (max-width: 900px) {
  .an { padding: 28px 16px 120px; }
  .an-title h1 { font-size: 44px; }
  .an .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .an .kpi .value { font-size: 30px; }
  .an-charts { grid-template-columns: minmax(0, 1fr); }
  .an-writeup { padding: 24px 20px; }
  .an-writeup p { font-size: 17px; }
  .an-controls { max-width: 100%; }
  .an-posts { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; scrollbar-width: none; }
  .an-posts .an-post { flex: 0 0 72%; scroll-snap-align: start; }
}

/* analytics: Sprout refresh line (Narrative Twist only) */
.an-refresh { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; color: var(--muted); }
.an-refresh p { margin: 0; }

/* analytics: themes (Narrative Twist sets the list and tags posts) */
.an-themes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; color: var(--teal); }
.an-themes p { margin: 0; }
.an-themes b { font-weight: 500; color: var(--ink); }
.an-themes.edit { flex-direction: column; align-items: stretch; gap: 10px; max-width: 560px; }
.an-themes.edit .hint { margin: 0; font-size: 13px; color: var(--muted); }
.an-themes .decide { display: flex; gap: 12px; align-items: center; }
.an-post .theme { margin: 4px 0 0; font-size: 12px; color: var(--teal); }
.an-post .theme-pick select { width: 100%; margin-top: 8px; font-size: 13px; min-height: 36px; padding: 0 10px; border: 1px solid var(--line); background: var(--white); border-radius: 999px; }
.an-post .theme-pick select.untagged { border-color: var(--nt); color: var(--nt); }

/* analytics: trend sparkline in each figure, the 6-12 chart, and the chart tooltip */
.an .kpi.trend { padding-bottom: 14px; }
.an .kpi.trend.open { box-shadow: 0 0 0 2px var(--nt), 0 24px 48px -28px rgba(31,35,38,.35); }
.an .spark { position: relative; margin-top: 10px; height: 44px; }
.an .spark svg { display: block; width: 100%; height: 44px; overflow: visible; }
.an .spark .hit { cursor: pointer; outline: none; }
.an .spark-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--nt); box-shadow: 0 0 0 2px var(--white); pointer-events: none; }
.an .spark-cap { margin: 2px 0 0; font-size: 11px; color: var(--muted); }
.an .kpi-more { align-self: flex-start; margin-top: 6px; padding: 8px 0; border: 0; background: none; font-size: 13px; color: var(--ink); text-decoration: underline; }
.an-detail { background: var(--white); box-shadow: 0 24px 48px -28px rgba(31,35,38,.35); padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.an-detail .dhead { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.an-detail h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--head); }
.an-detail .dhead p { margin: 4px 0 0; font-size: 14px; color: var(--muted); max-width: 70ch; }
.an-detail .chart { overflow-x: auto; }

.an-detail .hit { cursor: pointer; outline: none; }
.an-detail .hit:hover, .an-detail .hit:focus { fill: rgba(1,158,174,.07); }
.an-detail text.vlab { fill: var(--ink); font-size: 12px; font-weight: 500; }
.an-detail text.grp { fill: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.an table.data.cmp td.chg { font-weight: 500; }
.an table.data.cmp td.muted { color: var(--muted); text-align: left; }
.an-tip { position: fixed; z-index: 60; display: none; flex-direction: column; gap: 2px; padding: 8px 10px; background: var(--ink); color: var(--white); font-size: 12px; line-height: 1.35; pointer-events: none; box-shadow: 0 10px 30px -12px rgba(0,0,0,.4); max-width: 240px; }
.an-tip b { font-size: 15px; font-weight: 500; }
.an-detail .sixtwelve { display: flex; gap: 28px; align-items: stretch; }
.an-detail .pane { min-width: 0; }
.an-detail .pane + .pane { border-left: 1px solid var(--blue-2); padding-left: 24px; }
.an-detail .pane svg { display: block; width: 100%; height: auto; min-width: 0; }
.an-detail .pane text { font-family: var(--body); fill: var(--muted); font-size: 11px; }
@media (max-width: 700px) {
  .an-detail .sixtwelve { flex-direction: column; gap: 18px; }
  .an-detail .pane + .pane { border-left: 0; padding-left: 0; border-top: 1px solid var(--blue-2); padding-top: 14px; }
}
.an .chartcard .hit { cursor: pointer; outline: none; }
.an .chartcard .hit:hover, .an .chartcard .hit:focus { fill: rgba(1,158,174,.08); }
