/* COMNIO platform. Tokens come from the COMNIO token sheet (paper, ink, rule, the orbit's colors, Schibsted Grotesk).
   The app sits next to the brand, not inside its rules: app controls get app conventions (icons, channel colors, compact headings). */
:root {
  --paper: #FAF9F7; --ink: #111111; --muted: #6E6A64; --rule: #DCD9D4; --card: #FFFFFF;
  --seq-01: #DE2120; --seq-02: #BA5316; --seq-03: #9A6809; --seq-04: #837101; --seq-05: #288233;
  --chip-01: #EC2423; --chip-02: #F26E20; --chip-03: #FBAC17; --chip-04: #FBDA03; --chip-05: #3CB64A;
  --alert: var(--seq-01);
  --font: 'Schibsted Grotesk', Helvetica, Arial, sans-serif;
  --t-name: clamp(30px, 7.6vw, 42px); --t-arg: clamp(22px, 5.4vw, 27px); --t-lead: 18px; --t-nav: 15px; --t-body: 15px; --t-label: 12px;
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --margin: 20px; --content: 840px; --hit: 48px; --tabbar: 60px;
  --focus: 2px solid var(--ink); --dur: 160ms; --ease: cubic-bezier(.2,0,.2,1);
}
@media (min-width: 768px) { :root { --margin: 40px; --t-lead: 20px; } }

/* Channel colors: --c is the bright swatch (always beside a text label); --c-ink is the darker shade for bars and lines,
   which must read on paper by themselves. One set, used by the menu, the timeline, the charts and the contact list. */
.ch-website    { --c: var(--chip-03); --c-ink: var(--seq-03); }
.ch-content    { --c: var(--chip-02); --c-ink: var(--seq-02); }
.ch-reputation { --c: var(--chip-01); --c-ink: var(--seq-01); }
.ch-social     { --c: var(--chip-04); --c-ink: var(--seq-04); }
.ch-email      { --c: var(--chip-05); --c-ink: var(--seq-05); }
.ch-paid       { --c: #BCD530; --c-ink: #5F6B0E; }
.ch-none       { --c: var(--rule); --c-ink: var(--muted); }
.sw { display: inline-block; inline-size: 10px; block-size: 10px; flex: none; background: var(--c, var(--ink)); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; container-type: scroll-state; scroll-padding-top: 120px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--t-body)/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
body.has-tabs { scroll-padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom, 0px)); }
a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
a:hover { border-bottom-color: var(--ink); }
:where(a, code) { overflow-wrap: anywhere; }
:focus-visible { outline: var(--focus); outline-offset: 2px; }
h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; }
h1, h2, h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* ---------- Shell ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 3; --bar: color-mix(in srgb, var(--ink) 5%, var(--paper)); background: var(--paper); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top, 0px); transition: transform 220ms var(--ease); }
/* Scrolling down hides the header (and the channel menu in it); scrolling up brings it back. No script where supported. */
@container scroll-state((scrolled: bottom) and (scrollable: top)) { .top { transform: translateY(-100%); } }
.top.is-hidden:not(:focus-within) { transform: translateY(-100%); }
.top:focus-within { transform: none; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-block-size: 56px; padding: 0 var(--margin); max-inline-size: calc(var(--content) + 2 * var(--margin)); margin: 0 auto; }
.lockup, .client-lockup { display: flex; align-items: center; gap: 10px; border: 0; min-inline-size: 0; min-block-size: 44px; }
.wordmark { font-weight: 600; font-size: 13px; letter-spacing: .18em; }
.client-name { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-inline-size: 0; }
.orbit { inline-size: 22px; block-size: 22px; border-radius: 50%; position: relative; flex: none; display: inline-block;
  background: conic-gradient(#EC2423 0deg,#EC2423 30deg,#EF4D22 66deg,#F26E20 124deg,#FBAC17 164deg,#FBDA03 204deg,#BCD530 246deg,#3CB64A 300deg,#3CB64A 320deg,transparent 320deg,transparent 358deg,#EC2423 358deg); }
.orbit::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--paper); }
.orbit-sm { inline-size: 14px; block-size: 14px; vertical-align: -2px; }
.orbit-sm::after { inset: 3px; }
@media (max-width: 519px) { .top .sample { display: none; } }
.sample { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; padding: 1px 6px; border: 1px solid var(--rule); color: var(--muted); flex: none; }
.ask-btn { flex: none; min-block-size: 44px; padding: 0 var(--s-4); border: 1px solid var(--ink); background: var(--paper); font-weight: 600; display: inline-flex; align-items: center; gap: var(--s-2); }
.ask-btn:hover { background: var(--ink); color: var(--paper); }
.icon { flex: none; }
main { flex: 1; inline-size: 100%; max-inline-size: calc(var(--content) + 2 * var(--margin)); margin: 0 auto; padding: var(--s-5) var(--margin) var(--s-7); }
footer { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-5) var(--margin); color: var(--muted); font-size: var(--t-label); border-top: 1px solid var(--rule); }
body.has-tabs footer { padding-bottom: calc(var(--tabbar) + var(--s-5) + env(safe-area-inset-bottom, 0px)); }

/* ---------- Sections: bottom bar with icons on a phone, inline in the header on wider screens ---------- */
.tabs a { display: flex; align-items: center; justify-content: center; border: 0; color: var(--muted); position: relative; }
.tabs a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabs-bottom { position: fixed; inset: auto 0 0 0; z-index: 3; display: flex; background: var(--paper); border-top: 1px solid var(--rule);
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.tabs-bottom a { flex: 1; flex-direction: column; gap: 2px; min-block-size: var(--tabbar); font-size: 12px; }
/* Current section: a bar above the icon, not color alone. */
.tabs-bottom a[aria-current="page"]::before { content: ""; position: absolute; inset: 0 25% auto; border-top: 3px solid var(--ink); }
.tabs-top { display: none; }
@media (min-width: 768px) {
  .tabs-bottom { display: none; }
  body.has-tabs footer { padding-bottom: var(--s-5); }
  .tabs-top { display: flex; gap: var(--s-1); margin-inline: auto; }
  .tabs-top a { gap: var(--s-2); min-block-size: 56px; padding: 0 var(--s-3); font-size: var(--t-nav); }
  .tabs-top a[aria-current="page"]::after { content: ""; position: absolute; inset: auto var(--s-3) 10px; border-bottom: 2px solid var(--ink); }
  .tabs-top .icon { inline-size: 18px; block-size: 18px; }
}

/* ---------- Channel menu: one row, scrolls sideways, fades at the edges that have more ---------- */
@property --fade-start { syntax: "<length>"; inherits: false; initial-value: 0px; }
@property --fade-end { syntax: "<length>"; inherits: false; initial-value: 0px; }
/* With a channel menu, the header becomes a tab strip: darker tone, the rule drawn as a background line the tabs sit on,
   and the selected tab, in the page's own color with no bottom edge, opens into the content below. */
.top:has(.channels) { border-bottom: 0; background: linear-gradient(var(--rule), var(--rule)) bottom / 100% 1px no-repeat, var(--bar); }
.channels { display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none; padding: var(--s-1) var(--margin) 0;
  max-inline-size: calc(var(--content) + 2 * var(--margin)); margin: 0 auto; scroll-padding-inline: 2rem; scroll-snap-type: inline proximity;
  --fade-size: 2rem;
  mask: linear-gradient(black, black) no-clip subtract,
        linear-gradient(to right, black, transparent) 0 0 / var(--fade-start) 100% no-repeat no-clip,
        linear-gradient(to right, transparent, black) 100% 0 / var(--fade-end) 100% no-repeat no-clip;
  animation: reveal-fade-start linear both, hide-fade-end linear both;
  animation-timeline: scroll(self inline);
  animation-range: 0 var(--fade-size), calc(100% - var(--fade-size)) 100%; }
.channels::-webkit-scrollbar { display: none; }
@keyframes reveal-fade-start { to { --fade-start: var(--fade-size); } }
@keyframes hide-fade-end { from { --fade-end: var(--fade-size); } }
.channels.more-start { --fade-start: var(--fade-size); }
.channels.more-end { --fade-end: var(--fade-size); }
.ch { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: var(--s-2); min-block-size: 40px; padding: 0 var(--s-3);
  border: 1px solid var(--rule); border-top-width: 3px; border-top-color: transparent; background: color-mix(in srgb, #fff 45%, var(--bar)); font-size: 14px; font-weight: 500; white-space: nowrap; position: relative; color: var(--muted); }
@media (pointer: coarse) { .ch { min-block-size: 44px; } }
.ch:hover { color: var(--ink); border-inline-color: var(--muted); border-top-color: color-mix(in srgb, var(--c, var(--ink)) 60%, transparent); }
.ch .sw { background: var(--c); }
/* Selected: an open tab. Ink sides, a 3px top in the channel's color, no bottom edge, the page's background. Shape, not color alone. */
.ch[aria-current="true"] { color: var(--ink); font-weight: 600; background: var(--paper); border-color: var(--ink); border-top-color: var(--c, var(--ink)); border-bottom-color: var(--paper); }
.filter-note { display: flex; align-items: center; gap: var(--s-2); color: var(--muted); }

/* ---------- Type ---------- */
.display { font-size: var(--t-name); line-height: 1.04; letter-spacing: -.02em; font-weight: 500; }
.lead { font-size: var(--t-lead); line-height: 1.35; }
.arg { font-size: var(--t-arg); line-height: 1.18; letter-spacing: -.01em; font-weight: 500; }
.label { font-size: var(--t-label); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: var(--s-2); }
.count { font-size: 11px; letter-spacing: 0; min-inline-size: 20px; padding: 0 6px; background: var(--ink); color: var(--paper); text-align: center; }
.muted { color: var(--muted); }
.period { color: var(--seq-01); }
.num { font-variant-numeric: tabular-nums; font-weight: 600; }
.back { display: inline-flex; align-items: center; min-block-size: 44px; border: 0; }

/* ---------- Blocks ---------- */
.block { padding: var(--s-5) 0; border-top: 1px solid var(--rule); display: grid; gap: var(--s-3); }
.stack > .block:first-child, .block.hero, .block.intro { border-top: 0; padding-top: 0; }
.stack { display: grid; gap: var(--s-4); }
.row { display: flex; justify-content: space-between; gap: var(--s-3); align-items: baseline; }

/* Home: where they came from */
.sources { display: grid; gap: 2px; }
.sources li { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 28%) 2.5ch; gap: var(--s-3); align-items: center; min-block-size: 32px; }
.src-label { display: flex; align-items: center; gap: var(--s-2); min-inline-size: 0; }
.src-bar { block-size: 8px; background: color-mix(in srgb, var(--c) 18%, transparent); }
.src-bar i { display: block; block-size: 100%; background: var(--c); transition: background var(--dur) var(--ease); }
.sources li:hover .src-bar i { background: var(--c-ink); }
.sources .num { text-align: right; }
.pick { display: grid; gap: var(--s-3); padding: var(--s-4); background: var(--card); border: 1px solid var(--rule); border-top: 3px solid var(--c-ink); }
.pick .meta, .tl-card .meta { display: flex; gap: var(--s-2); align-items: center; flex-wrap: wrap; font-size: var(--t-label); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }

/* ---------- Timeline (Plan, What needs you, Reviews) ---------- */
.tl-group { display: grid; gap: var(--s-3); padding-top: var(--s-3); }
/* One rail: through a whole list, and on Plan through every group, so the page reads as a single timeline. */
.tl, .timeline { position: relative; }
.tl::before, .timeline::before { content: ""; position: absolute; inset-block: 9px 18px; inset-inline-start: 5px; border-inline-start: 2px solid var(--rule); }
.timeline .tl::before { content: none; }
.timeline { display: grid; gap: var(--s-2); }
.timeline .tl-group > .label { position: relative; padding-inline-start: 30px; }
/* Group marker on the rail: an ink ring, distinct from the colored item nodes. */
.timeline .tl-group > .label::before { content: ""; position: absolute; inset-inline-start: 0; inline-size: 12px; block-size: 12px; border: 2px solid var(--ink); background: var(--paper); }
.tl-item { position: relative; padding: 0 0 var(--s-5) 30px; }
.tl-item:last-child { padding-bottom: var(--s-3); }
.tl-card > .btn, .tl-card > form > .btn { justify-self: start; }
/* The node: a square in the channel's color. The channel name is in the card's meta line, so color is never the only cue. */
.tl-item::after { content: ""; position: absolute; inset-block-start: 3px; inset-inline-start: 0; inline-size: 12px; block-size: 12px; background: var(--c); outline: 3px solid var(--paper); }
.tl-item.is-done::after { background: var(--paper); border: 2px solid var(--c-ink); }
.tl-card { display: grid; gap: var(--s-2); }
.tl-card h3 { font-size: var(--t-lead); line-height: 1.3; font-weight: 500; }
.is-done .tl-card h3 { color: var(--muted); }
.draft { border-inline-start: 3px solid var(--c, var(--rule)); background: var(--card); padding: var(--s-3) var(--s-4); color: var(--ink); }
.result { color: var(--seq-05); }

/* ---------- Results ---------- */
.contacts { display: grid; }
.contacts li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: var(--s-3); align-items: start; padding: var(--s-3) 0; border-top: 1px solid var(--rule); }
.contacts li:first-child { border-top: 0; }
.contacts .sw { margin-top: 6px; }
.contact-main { display: grid; }
.contacts time { white-space: nowrap; }

/* ---------- Activity ---------- */
.channel > .label .sw { inline-size: 12px; block-size: 12px; }
.metrics { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.metric { display: grid; gap: 2px; align-content: start; }
.metric dd { order: -1; font-size: 28px; line-height: 1.1; font-variant-numeric: normal; }
.metric dt { color: var(--muted); }
.delta { display: block; font-size: 13px; color: var(--ink); }
.tops ol { display: grid; counter-reset: top; }
.tops li { counter-increment: top; display: grid; grid-template-columns: 1.5em minmax(0, 1fr) auto; gap: var(--s-2); padding: 6px 0; border-top: 1px solid var(--rule); }
.tops li::before { content: counter(top); color: var(--muted); font-variant-numeric: tabular-nums; }
.tops li > span:first-child { overflow-wrap: anywhere; }

/* ---------- 12-week column chart ---------- */
.spark { display: grid; gap: var(--s-1); }
.cols { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; align-items: end; block-size: 64px; border-bottom: 1px solid var(--rule); }
.cols span { display: block; block-size: var(--h, 0); background: color-mix(in srgb, var(--c, var(--ink)) 35%, var(--paper)); transition: background var(--dur) var(--ease); }
.cols span.now { background: var(--c, var(--ink)); }
.cols span:hover { background: var(--c-ink, var(--ink)); }
.cols span.none { block-size: 0; }
.axis { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--t-label); color: var(--muted); }
.axis span:last-child { color: var(--ink); font-weight: 600; }

/* ---------- Plan items in the operator queue and Ask us ---------- */
.item { display: grid; gap: var(--s-2); padding: var(--s-4) 0; border-top: 1px solid var(--rule); }
.item:first-child { border-top: 0; }
.item .meta { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; font-size: var(--t-label); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.chip { display: inline-block; inline-size: 10px; block-size: 10px; flex: none; }
.chip-website { background: var(--chip-03); } .chip-content { background: var(--chip-02); } .chip-reputation { background: var(--chip-01); }
.chip-social { background: var(--chip-04); } .chip-email { background: var(--chip-05); } .chip-paid { background: #BCD530; }
.item h3 { font-size: var(--t-lead); line-height: 1.3; font-weight: 500; }
.bars { display: grid; gap: var(--s-2); }
.bar { display: grid; grid-template-columns: 1fr auto; gap: var(--s-3); align-items: center; }
.bar i { display: block; height: 10px; background: var(--ink); }
.bar.prev i { background: var(--rule); }

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-block-size: var(--hit); padding: 0 var(--s-5); border: 1px solid var(--ink); background: var(--paper); color: var(--ink); font-weight: 600; cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); text-decoration: none; }
.btn:hover { background: var(--ink); color: var(--paper); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: #333; }
.btn.small { min-block-size: 44px; padding: 0 var(--s-4); font-size: var(--t-body); }
.btn.full { inline-size: 100%; }
.btn-row { display: flex; gap: var(--s-3); flex-wrap: wrap; }
form.inline { display: contents; }
.field { display: grid; gap: var(--s-1); }
.field label { font-size: var(--t-body); }
.field input, .field textarea, .field select { min-block-size: var(--hit); padding: var(--s-2) var(--s-3); border: 1px solid var(--ink); background: #fff; inline-size: 100%; border-radius: 0; }
.field input[type=number] { max-inline-size: 160px; }
.field textarea { min-block-size: 96px; resize: vertical; }
.hint { font-size: var(--t-label); color: var(--muted); letter-spacing: 0; text-transform: none; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3) var(--s-4); }
.notice { padding: var(--s-3) var(--s-4); border: 1px solid var(--ink); background: #fff; }
.notice.alert { border-color: var(--alert); }
details summary { cursor: pointer; min-block-size: var(--hit); display: flex; align-items: center; list-style: none; }
details summary::-webkit-details-marker { display: none; }

/* ---------- Weekly queue (operator) ---------- */
.queue-card { border: 1px solid var(--rule); background: #fff; padding: var(--s-4); display: grid; gap: var(--s-3); }
table.q { inline-size: 100%; border-collapse: collapse; }
table.q td, table.q th { text-align: left; padding: var(--s-2) 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.q th { font-size: var(--t-label); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
table.q input { inline-size: 88px; min-block-size: 40px; }
.status-done { color: var(--seq-05); } .status-waiting { color: var(--seq-02); }

@media (forced-colors: active) { .sw, .tl-item::after, .cols span { forced-color-adjust: none; } }
@media (prefers-reduced-motion: reduce) { *, .top { transition: none !important; } }
