/* Terra pult · Terra Glass for a phone: brand book colours, Inter, one accent, no embossing. Text sits on calm surfaces only. */
@font-face { font-family: "Inter"; src: url("/fonts/Inter-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #000228; --pane: #0E1136; --pane-2: #1B1E48; --line: rgba(255,255,255,.13);
  --text: #fff; --text-2: rgba(255,255,255,.68); --text-3: rgba(255,255,255,.5);
  --accent: #0DC89A; --on-accent: #000228; --link: #5FE3C0; --marker: rgba(13,200,154,.24); --bar: #0DC89A;
  --plate: url("/img/plate-dark.webp"); --plate-blend: normal; --plate-opacity: .92;
  --top: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px));
  --bottom: max(var(--tg-safe-area-inset-bottom, 0px), env(safe-area-inset-bottom, 0px));
  --gut: 18px;
}
:root[data-theme="light"] {
  --bg: #F4F7FF; --pane: #fff; --pane-2: rgba(32,51,176,.07); --line: rgba(0,2,40,.1);
  --text: #000228; --text-2: #4d4f6b; --text-3: #666780;
  --accent: #0DC89A; --on-accent: #000228; --link: #2033B0; --marker: #CFF4EB; --bar: #2033B0;
  --plate: url("/img/plate-light.webp"); --plate-blend: multiply; --plate-opacity: 1;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
:root[data-theme="light"] { color-scheme: light; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 400 15px/1.45 "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
img, video { display: block; max-width: 100%; }

main { padding: calc(var(--top) + 14px) var(--gut) calc(var(--bottom) + 96px); animation: enter .22s ease-out; }
body.has-bar main { padding-bottom: calc(var(--bottom) + 130px); }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* header */
.art { position: absolute; top: 0; right: 0; width: 100%; height: calc(var(--top) + 250px); pointer-events: none; z-index: 0; background: var(--plate) right top / cover no-repeat;
  mix-blend-mode: var(--plate-blend); opacity: var(--plate-opacity);
  -webkit-mask: linear-gradient(to bottom, #000 45%, transparent), linear-gradient(to right, transparent 25%, #000 85%);
  -webkit-mask-composite: source-in; mask: linear-gradient(to bottom, #000 45%, transparent), linear-gradient(to right, transparent 25%, #000 85%); mask-composite: intersect; }
.art.low { height: calc(var(--top) + 130px); }
.brand { position: relative; z-index: 1; display: block; width: 118px; height: 23px; background: var(--text);
  -webkit-mask: url("/img/logo.png") left center / contain no-repeat; mask: url("/img/logo.png") left center / contain no-repeat; }
.hero { position: relative; z-index: 1; margin-top: 30px; }
.eyebrow { display: flex; align-items: center; gap: 4px; margin: 0 -8px; color: var(--text-2); font-size: 14px; }
.eyebrow span { padding: 0 2px; }
.arrow { width: 36px; height: 36px; display: grid; place-items: center; font-size: 19px; line-height: 1; color: var(--text-2); }
.arrow:disabled { opacity: .3; cursor: default; }
.big { display: flex; align-items: baseline; gap: 10px; margin-top: 6px; }
.big b { font-size: 76px; line-height: 1; letter-spacing: -.045em; font-weight: 700; }
.big em { font-style: normal; font-size: 20px; font-weight: 700; letter-spacing: -.015em; padding: 1px 6px; background: var(--marker); border-radius: 6px; }
.big.calm em { background: none; padding: 0; }
.sub { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.sub button { color: var(--link); font-weight: 700; }

/* platform marks: LinkedIn is a square, Facebook a circle, so they differ without colour too */
.pf { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; color: #fff; font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.pf.li { border-radius: 4px; background: #0A66C2; }
.pf.fb { border-radius: 50%; background: #1877F2; font-size: 12px; }
.who { display: inline-grid; place-items: center; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--text); color: var(--bg); font-size: 10px; font-weight: 700; line-height: 1; }
.ico { display: block; width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* the week's calendar: a lane per day, a tile per post */
.cal { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; margin: 20px -8px 0; }
.cal-day { display: flex; flex-direction: column; gap: 6px; min-height: 148px; padding: 7px 3px 8px; border-radius: 10px; background: var(--pane); box-shadow: inset 0 0 0 1px var(--line); }
.cal-day.today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.cal-head { text-align: center; font-size: 11px; color: var(--text-3); line-height: 1.2; }
.cal-head b { display: block; font-size: 15px; color: var(--text); letter-spacing: -.01em; }
.slot { display: block; width: 100%; min-width: 0; text-align: center; }
.slot-art { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 5; border-radius: 7px; background: var(--pane-2); color: var(--text-2); }
.slot-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 7px; outline: 1px solid var(--line); outline-offset: -1px; }
.slot-art small { font-size: 10px; font-weight: 700; color: var(--text-3); }
.slot-art .pf, .slot-art .who { position: absolute; top: -3px; width: 15px; height: 15px; box-shadow: 0 0 0 1.5px var(--pane); }
.slot-art .pf { left: -2px; }
.slot-art .who { right: -2px; font-size: 9px; }
.slot-at { display: flex; align-items: center; justify-content: center; gap: 3px; margin-top: 3px; font-size: 11px; line-height: 1.2; color: var(--text-2); font-variant-numeric: tabular-nums; }
.slot.s-skipped .slot-art { opacity: .4; }
.slot.s-skipped .slot-at { text-decoration: line-through; }
.slot.maybe .slot-art { background: none; box-shadow: none; outline: 1.5px dashed var(--text-3); outline-offset: -1.5px; color: var(--text-3); }
.slot.maybe .slot-at, .slot.planned .slot-at { color: var(--text-3); }
.dot { display: inline-block; flex: none; width: 7px; height: 7px; border-radius: 50%; }
.dot.s-draft { box-shadow: inset 0 0 0 1.5px var(--text); }
.dot.s-approved { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); box-shadow: inset 0 0 0 1px var(--accent); }
.dot.s-published { background: var(--accent); }
.dot.s-skipped { width: 7px; height: 2px; border-radius: 1px; background: var(--text-3); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; color: var(--text-3); font-size: 12px; }
.legend > span { display: inline-flex; align-items: center; gap: 5px; }
.legend .box { width: 12px; height: 14px; border-radius: 3px; }
.legend .box.maybe { outline: 1.5px dashed var(--text-3); outline-offset: -1.5px; }
.legend .box.planned { background: var(--pane-2); }
.legend .ico { width: 14px; height: 14px; color: var(--text-2); }

/* days and rows */
.day { display: flex; justify-content: space-between; align-items: baseline; margin: 26px 0 2px; font-weight: 700; font-size: 15px; letter-spacing: -.01em; }
.day small { font-weight: 400; font-size: 13px; color: var(--text-3); letter-spacing: 0; }
.day.today small { color: var(--link); font-weight: 700; }
.row { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; width: 100%; padding: 11px 0; border-bottom: 1px solid var(--line); align-items: start; }
.day + .row { border-top: 1px solid var(--line); margin-top: 8px; }
.thumb { width: 56px; height: 70px; object-fit: cover; border-radius: 10px; background: var(--pane-2); }
.thumb.none { display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-3); }
.thumb.none .ico { width: 22px; height: 22px; }
.row-top { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.row.maybe .thumb { background: none; outline: 1.5px dashed var(--text-3); outline-offset: -1.5px; }
.row-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 1px; font-weight: 700; font-size: 15px; line-height: 1.28; letter-spacing: -.01em; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; margin-top: 4px; font-size: 13px; color: var(--text-3); }
.row-note { display: block; margin-top: 3px; font-size: 13px; color: var(--text-2); }

.state { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.state i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.state.s-draft i { box-shadow: inset 0 0 0 2px var(--text-2); }
.state.s-draft { color: var(--text); font-weight: 700; }
.state.s-approved i { background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); box-shadow: inset 0 0 0 1.5px var(--accent); }
.state.s-published i { background: var(--accent); }
.state.s-skipped i { background: var(--text-3); height: 2px; border-radius: 1px; }

/* tabs */
#tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-template-columns: repeat(4, 1fr); padding: 8px 8px calc(var(--bottom) + 8px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%); border-top: 1px solid var(--line); }
#tabs button { padding: 9px 2px; text-align: center; font-size: 13px; color: var(--text-3); border-radius: 10px; }
#tabs button[aria-current="page"] { color: var(--text); font-weight: 700; background: var(--pane-2); }

/* bottom bar outside Telegram (the browser on the Mac) */
#bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; display: flex; gap: 8px; padding: 10px var(--gut) calc(var(--bottom) + 10px);
  background: color-mix(in srgb, var(--bg) 82%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
#bar button { flex: 1; padding: 13px; text-align: center; border-radius: 12px; font-weight: 700; background: var(--pane-2); }
#bar button.main { background: var(--accent); color: var(--on-accent); flex: 1.4; }

/* post */
.back { display: inline-block; padding: 6px 0; color: var(--link); font-weight: 700; font-size: 15px; }
.media { margin: 8px calc(var(--gut) * -1) 0; }
.snap { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 var(--gut); scroll-padding: 0 var(--gut); scrollbar-width: none; }
.snap::-webkit-scrollbar { display: none; }
.snap img { flex: 0 0 100%; width: 100%; scroll-snap-align: center; border-radius: 16px; background: var(--pane-2); aspect-ratio: 4 / 5; object-fit: cover; }
.snap.many img { flex-basis: 88%; width: 88%; }
.player { display: block; width: min(100%, 300px); max-height: 66dvh; margin: 0 auto; aspect-ratio: 9 / 16; border-radius: 16px; background: #000; object-fit: contain; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--text); }
.head { margin-top: 16px; }
.head h1 { font-size: 23px; line-height: 1.18; letter-spacing: -.022em; font-weight: 700; }
.where { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.head .state { margin-top: 8px; font-size: 14px; }
.notice { margin-top: 10px; padding: 9px 12px; border-radius: 10px; background: var(--marker); font-size: 14px; }
.block { margin-top: 20px; padding: 14px 14px 10px; border-radius: 16px; background: var(--pane); border: 1px solid var(--line); }
.block h2 { font-size: 13px; color: var(--text-3); font-weight: 400; }
.block .hint { margin-top: 8px; font-size: 13px; line-height: 1.4; color: var(--text-2); }
.block .body { margin-top: 6px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; }
.tools { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; }
.tool { padding: 7px 0; color: var(--link); font-weight: 700; font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { padding: 3px 8px; border-radius: 7px; background: var(--pane-2); font-size: 12px; color: var(--text-2); }
.list { margin-top: 20px; border-top: 1px solid var(--line); }
.list button { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 13px 2px; border-bottom: 1px solid var(--line); font-size: 15px; }
.list button::after { content: "›"; color: var(--text-3); font-size: 19px; line-height: 1; }
.list button.danger { color: var(--text-2); }
.pager { display: flex; justify-content: space-between; margin-top: 16px; }
.pager button { padding: 8px 2px; color: var(--link); font-weight: 700; font-size: 14px; }

/* sheet */
.shade { position: fixed; top: 0; left: 0; right: 0; height: var(--vvh, 100dvh); z-index: 8; display: flex; align-items: flex-end; background: rgba(0,2,40,.55); animation: fade .16s ease-out; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet { width: 100%; max-height: 92%; overflow: auto; padding: 18px var(--gut) calc(var(--bottom) + 18px); background: var(--bg); border-radius: 20px 20px 0 0; border-top: 1px solid var(--line); animation: slide .2s cubic-bezier(.2,.8,.2,1); }
body.has-bar .sheet { padding-bottom: calc(var(--bottom) + 84px); }
@keyframes slide { from { transform: translateY(24px); } to { transform: none; } }
.sheet h2 { font-size: 19px; letter-spacing: -.015em; }
.sheet p { margin-top: 6px; color: var(--text-2); font-size: 14px; }
.sheet textarea, .sheet input[type="date"], .sheet input[type="time"], .sheet input[type="url"] { display: block; width: 100%; margin-top: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--pane); outline: none; font-size: 16px; }
.sheet textarea { min-height: 112px; resize: vertical; }
.sheet textarea:focus, .sheet input:focus { border-color: var(--accent); }
.sheet .quote { margin-top: 12px; padding: 11px 12px; border-radius: 12px; background: var(--pane); border: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.45; }
.sheet .tool { margin-top: 4px; }
.sheet .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice { display: flex; justify-content: space-between; gap: 12px; width: 100%; margin-top: 8px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--pane); }
.choice[aria-checked="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice span { color: var(--text-2); }
.error { margin-top: 8px; color: var(--text); font-size: 14px; font-weight: 700; }

/* jobs and toast */
#jobs { position: fixed; top: calc(var(--top) + 8px); left: var(--gut); right: var(--gut); z-index: 6; padding: 8px 12px; border-radius: 12px; background: var(--pane-2);
  -webkit-backdrop-filter: blur(18px) saturate(170%); backdrop-filter: blur(18px) saturate(170%); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#jobs::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border-radius: 50%; background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
#toast { position: fixed; left: var(--gut); right: var(--gut); bottom: calc(var(--bottom) + 84px); z-index: 10; padding: 11px 14px; border-radius: 12px; background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px; text-align: center; animation: enter .18s ease-out; }

/* plan */
h1.title { position: relative; z-index: 1; margin-top: 26px; font-size: 30px; letter-spacing: -.028em; line-height: 1.1; font-weight: 700; }
.lead { position: relative; z-index: 1; margin-top: 6px; color: var(--text-2); font-size: 14px; }
.plan-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plan-row b { font-size: 14px; }
.plan-row .topic { font-size: 15px; line-height: 1.32; }
.plan-row .meta { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: 13px; color: var(--text-3); }

/* numbers */
.platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 18px; position: relative; z-index: 1; }
.platform { padding: 12px 14px; border-radius: 16px; background: var(--pane); box-shadow: inset 0 0 0 1px var(--line); }
.platform[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--accent); }
.platform-name { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 700; }
.platform b { display: block; margin-top: 6px; font-size: 32px; line-height: 1.1; letter-spacing: -.03em; }
.platform small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-3); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.tile { padding: 13px 14px; border-radius: 16px; background: var(--pane); border: 1px solid var(--line); }
.tile span { display: block; font-size: 13px; color: var(--text-2); }
.tile b { display: block; margin-top: 2px; font-size: 32px; line-height: 1.1; letter-spacing: -.03em; }
.tile small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-3); }
.chart { position: relative; margin-top: 8px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 11px; }
.chart .value { fill: var(--text); font-size: 12px; font-weight: 700; }
.chart .mark { fill: var(--bar); }
.chart .mark.partial { fill: color-mix(in srgb, var(--bar) 45%, transparent); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit:focus { outline: none; }
.chart .picked { fill: var(--pane-2); }
.tip { position: absolute; top: 0; min-width: 136px; padding: 7px 10px; border-radius: 10px; background: var(--text); color: var(--bg); font-size: 13px; pointer-events: none; transform: translateX(-50%); }
.tip b { display: block; }
details { margin-top: 10px; }
summary { padding: 6px 0; color: var(--link); font-weight: 700; font-size: 14px; cursor: pointer; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th, td { padding: 6px 0; text-align: right; border-bottom: 1px solid var(--line); font-weight: 400; }
th { color: var(--text-3); }
th:first-child, td:first-child { text-align: left; }
.foot { margin-top: 8px; font-size: 13px; color: var(--text-3); }
.recent { padding: 10px 0; border-bottom: 1px solid var(--line); }
.recent p { font-size: 14px; line-height: 1.35; }
.recent small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-3); }

/* rules */
.rule { padding: 12px 0; border-bottom: 1px solid var(--line); }
.rule p { font-size: 15px; line-height: 1.38; }
.rule small { display: flex; flex-wrap: wrap; gap: 2px 8px; margin-top: 4px; font-size: 13px; color: var(--text-3); }
.rule .must { color: var(--text); font-weight: 700; padding: 0 5px; border-radius: 5px; background: var(--marker); }

/* empty, locked, offline */
.empty { margin-top: 26px; padding: 16px; border-radius: 16px; background: var(--pane); border: 1px solid var(--line); color: var(--text-2); }
.lock { display: flex; flex-direction: column; justify-content: center; min-height: 70dvh; }
.lock h1 { margin-top: 22px; font-size: 25px; letter-spacing: -.02em; line-height: 1.2; }
.lock p { margin-top: 8px; color: var(--text-2); }
.lock button { align-self: flex-start; margin-top: 16px; padding: 11px 16px; border-radius: 12px; background: var(--accent); color: var(--on-accent); font-weight: 700; }
.loading { padding-top: 40dvh; text-align: center; color: var(--text-3); }

@media (max-width: 350px) { .slot-at { gap: 2px; font-size: 10px; } .slot-at .dot { width: 5px; height: 5px; } }
@media (min-width: 620px) { main { max-width: 560px; margin: 0 auto; } #tabs { padding-left: calc(50% - 280px); padding-right: calc(50% - 280px); } .art { width: 620px; left: calc(50% - 310px); right: auto; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; } }
