/* Influsing design tokens (daylight). Palette, type scale and radii follow the dark
   social-timeline conventions people already know from X; the font is the
   system stack (X's Chirp is proprietary) and all icons are our own. */
:root {
  --bg: #fff;
  --bg-hover: #f7f9f9;
  --bg-elev: #f7f9f9;
  --line: #eff3f4;
  --line-strong: #cfd9de;
  --fg: #0f1419;
  --mute: #536471;
  --dim: #536471;
  --blue: #1d9bf0;
  --blue-hover: #1a8cd8;
  --blue-wash: rgba(29, 155, 240, .1);
  --green: #00ba7c;
  --green-wash: rgba(0, 186, 124, .1);
  --pink: #f91880;
  --pink-wash: rgba(249, 24, 128, .1);
  --amber: #b86e00;
  --red: #f4212e;
  --pill: #0f1419;
  --pill-hover: #272c30;
  --pill-fg: #fff;
  --overlay: rgba(0, 0, 0, .4);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* legacy aliases used by the app */
  --panel: var(--bg);
  --panel-2: var(--bg-elev);
  --accent: var(--blue);
  --accent-2: var(--green);
  --warn: var(--amber);
  --bad: var(--red);
  --radius: 16px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 15px/20px var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a.link, .link { color: var(--blue); }
a.link:hover { text-decoration: underline; }
button, input, textarea, select { font: inherit; color: inherit; }
svg.i { width: 18.75px; height: 18.75px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted, .dim { color: var(--mute); }
.mono { font-family: var(--mono); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 16px; border-radius: 9999px; border: 1px solid var(--line-strong); background: transparent; font-weight: 700; font-size: 15px; cursor: pointer; transition: background-color .2s; white-space: nowrap; }
.btn:hover { background: rgba(15, 20, 25, .1); }
.btn.primary { background: var(--pill); color: var(--pill-fg); border-color: var(--pill); }
.btn.primary:hover { background: var(--pill-hover); }
.btn.blue { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.blue:hover { background: var(--blue-hover); }
.btn.small { min-height: 32px; padding: 0 14px; font-size: 14px; }
.btn.big, .big-btn { min-height: 52px; font-size: 17px; padding: 0 32px; width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }

/* ---------- forms (floating-label style fields) ---------- */
.field { position: relative; border: 1px solid #cfd9de; border-radius: 4px; margin: 12px 0; transition: border-color .15s; }
.field:focus-within { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.field > span { position: absolute; left: 8px; top: 8px; font-size: 13px; line-height: 16px; color: var(--mute); pointer-events: none; }
.field:focus-within > span { color: var(--blue); }
.field input, .field select, .field textarea { width: 100%; border: 0; outline: 0; background: transparent; padding: 28px 8px 8px; font-size: 17px; }
.field select option { background: var(--bg); }
input[type=text], input[type=email], input[type=url], input[type=number], input[type=password], textarea, select {
  width: 100%; background: transparent; border: 1px solid #cfd9de; border-radius: 4px; padding: 12px; outline: none; font-size: 15px;
}
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.field input:focus, .field select:focus, .field textarea:focus { box-shadow: none; }
textarea { resize: vertical; min-height: 96px; }
label { display: block; font-size: 13px; color: var(--mute); margin: 16px 0 6px; }
.hint { font-size: 13px; color: var(--mute); margin-top: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip { margin: 0; display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; min-height: 32px; border: 1px solid var(--line-strong); border-radius: 9999px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--fg); user-select: none; transition: background-color .15s; }
.chip small { color: var(--mute); font-weight: 400; }
.chip:hover { background: rgba(15, 20, 25, .04); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--blue-wash); border-color: var(--blue); color: var(--blue); }
.chip:has(input:checked) small { color: var(--blue); }
.chip:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--fg); font-size: 14px; margin: 16px 0; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--blue); margin: 1px 0 0; flex: none; }

/* ---------- three-column shell ---------- */
.shell { display: flex; justify-content: center; min-height: 100vh; }
.left { width: 275px; flex: none; position: sticky; top: 0; height: 100vh; padding: 4px 12px 16px; display: flex; flex-direction: column; }
.main { width: 600px; flex: none; border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100vh; }
.right { width: 350px; flex: none; padding: 12px 0 64px 30px; }
.right-inner { position: sticky; top: 12px; }

.brand { display: inline-flex; align-items: center; gap: 10px; padding: 12px; border-radius: 9999px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.brand:hover { background: rgba(15, 20, 25, .1); }
.mark { width: 30px; height: 30px; flex: none; }
.lnav { display: flex; flex-direction: column; margin: 4px 0 16px; }
.lnav a { display: inline-flex; align-items: center; gap: 20px; padding: 12px; border-radius: 9999px; font-size: 20px; line-height: 24px; align-self: flex-start; transition: background-color .2s; }
.lnav a:hover { background: rgba(15, 20, 25, .1); }
.lnav a.on { font-weight: 700; }
.lnav svg.i { width: 26px; height: 26px; }
.left .btn.big { width: 90%; }
.left .foot { margin-top: auto; font-size: 13px; color: var(--mute); padding: 12px; }

.topbar { position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, .85); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.topbar .title { padding: 12px 16px 0; font-size: 20px; font-weight: 700; line-height: 24px; }
.topbar .sub { padding: 2px 16px 0; font-size: 13px; color: var(--mute); }
.tabs { display: flex; }
.tab { flex: 1; background: none; border: 0; padding: 0; min-height: 53px; color: var(--mute); font-weight: 500; cursor: pointer; transition: background-color .2s; display: flex; justify-content: center; }
.tab:hover { background: rgba(15, 20, 25, .1); }
.tab span { display: inline-flex; align-items: center; position: relative; }
.tab.on { color: var(--fg); font-weight: 700; }
.tab.on span::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 9999px; background: var(--blue); }

/* ---------- hero ---------- */
.hero { padding: 20px 16px 16px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: 44px; line-height: 48px; letter-spacing: -.035em; font-weight: 800; margin: 0 0 12px; }
.hero h1 em { font-style: normal; color: var(--blue); }
.hero p { font-size: 17px; line-height: 24px; color: var(--fg); margin: 0; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.stats > * { padding: 16px; border-right: 1px solid var(--line); }
.stats > *:last-child { border-right: 0; }
.stats .v { font-size: 23px; line-height: 28px; font-weight: 800; letter-spacing: -.02em; }
.stats .l { font-size: 13px; line-height: 16px; color: var(--mute); margin-top: 2px; }

/* ---------- posts ---------- */
.post { display: flex; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); transition: background-color .2s; cursor: pointer; }
.post:hover { background: var(--bg-hover); }
.post .avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; background: #cfd9de center/cover; display: grid; place-items: center; font-weight: 700; color: var(--fg); }
.post .body { flex: 1; min-width: 0; }
.post .meta { display: flex; gap: 4px; align-items: baseline; white-space: nowrap; overflow: hidden; }
.post .meta b { font-weight: 700; overflow: hidden; text-overflow: ellipsis; }
.post .meta .h { color: var(--mute); overflow: hidden; text-overflow: ellipsis; }
.post .label { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--mute); margin: 2px 0 0; }
.post .label.paid { color: var(--amber); }
.post .label.org { color: var(--green); }
.post .label.pin { font-weight: 700; margin: 0 0 4px 32px; }
.post .text { margin-top: 2px; white-space: pre-wrap; overflow-wrap: anywhere; }
.post .text .more { color: var(--blue); }
.post .media { margin-top: 12px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; aspect-ratio: 16/9; background: var(--bg-elev) center/cover no-repeat; }
.post .acts { display: flex; justify-content: space-between; max-width: 425px; margin: 12px 0 0 -8px; color: var(--mute); font-size: 13px; }
.post .acts span { display: inline-flex; align-items: center; gap: 4px; padding: 0 8px 0 0; }
.post .acts span svg { margin: -8px -4px -8px -8px; padding: 8px; width: 34.75px; height: 34.75px; border-radius: 9999px; transition: background-color .2s, color .2s; }
.post .acts span.v:hover { color: var(--blue); }
.post .acts span.v:hover svg { background: var(--blue-wash); }
.post .acts span.r:hover { color: var(--green); }
.post .acts span.r:hover svg { background: var(--green-wash); }
.post .acts span.l:hover { color: var(--pink); }
.post .acts span.l:hover svg { background: var(--pink-wash); }
.post .insight { margin-top: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; color: var(--fg); background: var(--bg-elev); }
.post .insight b { color: var(--blue); }
.post.lesson .big { font-size: 34px; line-height: 40px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 2px; }
.post.lesson .big small { font-size: 18px; color: var(--mute); }

/* ---------- right column cards ---------- */
.rcard { border: 1px solid var(--line); border-radius: 16px; margin-bottom: 16px; overflow: hidden; }
.rcard > h2 { font-size: 20px; line-height: 24px; font-weight: 800; margin: 0; padding: 12px 16px 4px; }
.rcard > p { margin: 0; padding: 0 16px; color: var(--mute); }
.rcard .in { padding: 4px 16px 16px; }
.rcard .item { display: block; padding: 12px 16px; transition: background-color .2s; }
.rcard .item:hover { background: rgba(0, 0, 0, .03); }
.rcard .item .k { font-size: 13px; color: var(--mute); }
.rcard .item .t { font-weight: 700; }
.tiers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.tier { margin: 0; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; color: var(--fg); transition: background-color .15s; }
.tier:hover { background: rgba(15, 20, 25, .03); }
.tier b { font-size: 15px; }
.tier span { font-size: 13px; color: var(--mute); }
.tier input { position: absolute; opacity: 0; pointer-events: none; }
.tier:has(input:checked) { border-color: var(--blue); background: var(--blue-wash); box-shadow: 0 0 0 1px var(--blue) inset; }
.tier:has(input:checked) span { color: var(--blue); }
.tier:has(input:focus-visible) { outline: 2px solid var(--blue); outline-offset: 2px; }
.legal { font-size: 13px; color: var(--mute); padding: 0 16px; line-height: 18px; }

/* ---------- modal ---------- */
dialog { border: 0; padding: 0; background: var(--bg); color: var(--fg); border-radius: 16px; width: min(600px, 100vw); max-height: 90vh; box-shadow: rgba(101, 119, 134, .2) 0 0 15px, rgba(101, 119, 134, .15) 0 0 3px 1px; }
dialog::backdrop { background: var(--overlay); }
.modal-head { display: flex; align-items: center; gap: 16px; padding: 8px 16px; position: sticky; top: 0; background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px); }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; cursor: pointer; }
.iconbtn:hover { background: rgba(15, 20, 25, .1); }
.modal-body { padding: 0 32px 32px; }
.modal-body h2 { font-size: 31px; line-height: 36px; font-weight: 800; letter-spacing: -.02em; margin: 12px 0 8px; }
.modal-body > p { color: var(--mute); margin: 0 0 12px; }

/* ---------- mobile ---------- */
.mbar { display: none; }
@media (max-width: 1280px) { .left { width: 88px; align-items: center; } .brand span, .lnav a span, .left .foot { display: none; } .left .btn.big { width: 52px; padding: 0; font-size: 0; } .left .btn.big::before { content: "→"; font-size: 20px; } }
@media (max-width: 1020px) { .right { display: none; } .mbar { display: flex; } }
@media (max-width: 700px) {
  .left { display: none; }
  .main { width: 100%; border: 0; padding-bottom: 76px; }
  .hero h1 { font-size: 34px; line-height: 38px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > *:nth-child(2) { border-right: 0; }
  .stats > *:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .row { grid-template-columns: 1fr; }
  .modal-body { padding: 0 16px 24px; }
}
.mbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; gap: 8px; padding: 12px 16px; background: rgba(255, 255, 255, .9); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.mbar .btn { flex: 1; min-height: 44px; }
.main-only { display: none; }
@media (max-width: 1020px) { .main-only { display: block; } }

/* ---------- app (signed-in) ---------- */
.wrap { max-width: 1000px; margin: 0 auto; padding: 0 16px; }
.nav { display: flex; align-items: center; justify-content: space-between; height: 53px; position: sticky; top: 0; z-index: 5; background: rgba(255, 255, 255, .85); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); margin: 0 -16px; padding: 0 16px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.logo .mark { width: 26px; height: 26px; }
.nav-links { display: flex; gap: 12px; align-items: center; }
.panel { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 16px; }
.panel h2, .panel h3 { margin: 0 0 12px; font-size: 20px; font-weight: 800; line-height: 24px; }
.app-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin: 20px 0 16px; flex-wrap: wrap; }
.app-head h1 { margin: 0; font-size: 31px; line-height: 36px; font-weight: 800; letter-spacing: -.02em; }
.list { padding: 0; overflow: hidden; }
.list a.item { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); transition: background-color .2s; }
.list a.item:hover { background: var(--bg-hover); }
.list a.item:last-child { border-bottom: 0; }
.badge { font-size: 13px; padding: 2px 10px; border-radius: 9999px; border: 1px solid var(--line-strong); color: var(--mute); white-space: nowrap; font-weight: 600; }
.badge.ok { color: var(--green); border-color: rgba(0, 186, 124, .5); }
.badge.warn { color: var(--amber); border-color: rgba(184, 110, 0, .4); }
.badge.bad { color: var(--red); border-color: rgba(244, 33, 46, .5); }
.stepper { display: flex; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 0 0 16px; flex-wrap: wrap; }
.stepper .s { flex: 1; min-width: 120px; padding: 12px 14px; font-size: 13px; color: var(--mute); border-right: 1px solid var(--line); position: relative; }
.stepper .s:last-child { border-right: 0; }
.stepper .s b { display: block; font-size: 15px; color: var(--mute); }
.stepper .s.done b { color: var(--green); }
.stepper .s.cur b { color: var(--fg); }
.stepper .s.cur::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 4px; border-radius: 9999px; background: var(--blue); }
.stepper .s a { color: var(--blue); }
.spin { display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(29, 155, 240, .25); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kpi { padding: 14px; border-right: 1px solid var(--line); }
.kpi:last-child { border-right: 0; }
.kpi .v { font-size: 23px; line-height: 28px; font-weight: 800; letter-spacing: -.02em; }
.kpi .l { font-size: 13px; color: var(--mute); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: left; font-weight: 600; color: var(--mute); font-size: 13px; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td a b { color: var(--fg); }
td a:hover b { text-decoration: underline; }
tr.picked td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
td select { padding: 6px 8px; font-size: 13px; border-radius: 9999px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 4px; border-radius: 9999px; background: var(--line); overflow: hidden; min-width: 60px; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--blue); }
.alloc { display: flex; height: 32px; border-radius: 9999px; overflow: hidden; margin: 16px 0 8px; background: var(--bg-elev); }
.alloc > div { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #000; overflow: hidden; white-space: nowrap; border-right: 2px solid var(--bg); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.card { border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; margin-bottom: 12px; }
.card .post { white-space: pre-wrap; margin: 8px 0 12px; padding: 0; border: 0; display: block; cursor: auto; }
.card .post:hover { background: none; }
.card .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 13px; border: 1px solid var(--line); border-radius: 9999px; padding: 4px 12px; color: var(--fg); }
.err { border: 1px solid rgba(244, 33, 46, .5); background: rgba(244, 33, 46, .08); color: #b3121c; padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; }
.note { border: 1px solid rgba(255, 173, 31, .45); background: rgba(255, 212, 0, .12); padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; }
.feed { font-size: 14px; }
.feed div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.feed div:last-child { border-bottom: 0; }
.empty { text-align: center; padding: 48px 20px; color: var(--mute); }
.empty p { font-size: 20px; font-weight: 800; color: var(--fg); margin: 0 0 16px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--blue); color: #fff; padding: 12px 16px; border-radius: 4px; font-size: 15px; box-shadow: rgba(101, 119, 134, .2) 0 0 15px; z-index: 50; }
@media (max-width: 820px) { .grid2, .kpis { grid-template-columns: 1fr; } .kpi { border-right: 0; border-bottom: 1px solid var(--line); } }

/* ---------- locked stat tile ---------- */
.stats .lock { all: unset; box-sizing: border-box; padding: 16px; cursor: pointer; transition: background-color .2s; }
.stats .lock:hover { background: var(--blue-wash); }
.stats .lock:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.stats .lock .l { color: var(--blue); display: flex; align-items: center; gap: 4px; }
.stats .lock .l svg.i { width: 14px; height: 14px; }
.blur { filter: blur(6px); user-select: none; }
dialog.small { width: min(440px, 100vw); }
