/* Same tokens as public/b/b.css, so the app matches the dashboard mock on /b/. */
:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --line: #ececec;
  --soft: #f2f2f2;
  --side: #fafaf8;
  --accent: #1f6f5c;
  --warm: #fbf3e4;
  --bad: #b3261e;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.02em; }

/* Layout */
.shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; padding: 18px 12px; border-right: 1px solid var(--line); background: var(--side); font-size: 14px; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 8px; margin: 0 8px; font-weight: 700; font-size: 17px; }
.project { margin: 4px 8px 0; color: var(--faint); font-size: 12px; }
.side nav { margin-top: 10px; }
.side-h { margin: 16px 8px 6px; font-size: 11px; color: var(--faint); }
.side-i { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; border-radius: 8px; color: #444; text-decoration: none; }
.side-i:hover { background: var(--soft); }
.side-i.on { background: #ebebe8; color: var(--ink); font-weight: 500; }
.side-i.off { color: var(--faint); cursor: default; }
.side-i.off:hover { background: none; }
.side-i em { font-style: normal; font-size: 11px; }
.badge { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 11px; text-align: center; }
.who { margin: auto 8px 0; color: var(--faint); font-size: 12px; overflow-wrap: anywhere; }
.main { padding: 28px 32px 48px; max-width: 880px; width: 100%; }
.head h1 { font-size: 22px; }
.sub { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.list-h { margin: 28px 0 10px; font-size: 14px; }
.hint, .empty { color: var(--faint); font-size: 13px; }
.empty { padding: 14px; border: 1px dashed var(--line); border-radius: 12px; }
.error { margin-top: 20px; padding: 12px 14px; border-radius: 12px; background: #fdecea; color: var(--bad); font-size: 14px; }

/* Numbers */
.kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.kpi { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.kpi p { margin: 0; }
.kpi-k { font-size: 12px; color: var(--accent); font-weight: 500; }
.kpi-v { margin-top: 6px !important; font-size: 22px; font-weight: 500; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.kpi-d { margin-top: 2px !important; font-size: 12px; color: var(--faint); line-height: 1.4; }

/* Cards */
.card { padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 10px; font-size: 14px; }
.card-top { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; color: var(--muted); font-size: 13px; }
.card-top b { color: var(--ink); font-weight: 600; }
.card-top time { margin-left: auto; color: var(--faint); font-size: 12px; }
.quote { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.parent { margin: 8px 0 0; padding-left: 10px; border-left: 2px solid var(--line); color: var(--faint); font-size: 13px; }
.draft { display: block; margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: var(--soft); }
.draft-k { display: block; margin-bottom: 2px; font-size: 12px; color: var(--muted); font-weight: 500; }
.draft textarea { display: block; width: 100%; min-height: 64px; padding: 0; border: 0; background: none; font: inherit; color: inherit; resize: vertical; }
.draft textarea:focus { outline: none; }
.draft:focus-within { box-shadow: 0 0 0 2px var(--ink); }
.act-error { margin: 8px 0 0; color: var(--bad); font-size: 13px; }
.done-line { color: var(--muted); font-size: 14px; background: var(--side); }
.note { margin: 6px 0 0; color: var(--faint); font-size: 12px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--soft); color: #444; white-space: nowrap; }
.tag.hot { background: var(--warm); color: #8a5a00; }
.tag.ok { background: #e6f2ee; color: var(--accent); }
.tag.bad { background: #fdecea; color: var(--bad); }

/* Posts */
.post { display: grid; grid-template-columns: 64px 1fr; gap: 14px; align-items: start; }
.thumb { width: 64px; aspect-ratio: 4 / 5; border-radius: 8px; object-fit: cover; background: var(--soft); }
.thumb.reel { aspect-ratio: 9 / 16; }
.thumb.text { display: grid; place-items: center; font-size: 22px; }
.post-h { margin: 4px 0 0; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: #fff; font: 500 13px/1.2 inherit; font-family: inherit; color: var(--ink); text-decoration: none; cursor: pointer; }
.pill:hover { background: var(--soft); }
.pill.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill.dark:hover { background: #333; }
.pill.ghost { border-color: transparent; color: var(--muted); }
.pill:disabled { opacity: .45; cursor: default; }
details.caption { margin-top: 8px; font-size: 13px; color: var(--muted); }
details.caption summary { cursor: pointer; }
details.caption p { margin: 6px 0 0; white-space: pre-wrap; color: var(--ink); }

/* Schedule */
.day { margin: 24px 0 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.day.today { color: var(--ink); }
.row { display: grid; grid-template-columns: 48px 40px 1fr auto; gap: 12px; align-items: center; padding: 8px 4px; border-top: 1px solid #f2f2f2; font-size: 14px; }
.row .thumb { width: 40px; }
.row-t { font-variant-numeric: tabular-nums; color: var(--muted); }
.row-h { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-h small { display: block; color: var(--faint); font-size: 12px; }
.row.past { opacity: .6; }

/* Leads */
#leads { margin-top: 18px; }
.lead-c { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); }
.lead-c a { color: var(--accent); }

/* Calendar (calendar.js): the month as tiles; the day opens in a panel on the right. */
.main.wide { max-width: none; }
.cal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { min-width: 170px; text-align: center; font-size: 17px; text-transform: capitalize; }
.cal-icon { width: 32px; height: 32px; flex: none; border: 1px solid var(--line); border-radius: 50%; background: #fff; font: 18px/1 inherit; font-family: inherit; color: var(--ink); cursor: pointer; }
.cal-icon:hover { background: var(--soft); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 0 auto; padding: 0; list-style: none; font-size: 12px; color: var(--muted); }
.cal-legend li { display: flex; align-items: center; gap: 6px; }
.cal-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: #b9b9b4; }
.cal-dot.ok { background: var(--accent); }
.cal-dot.hot { background: #c98a00; }
.cal-dot.bad { background: var(--bad); }
.cal-dot.skipped { background: transparent; box-shadow: inset 0 0 0 1.5px #b9b9b4; }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cal-weekdays { margin-top: 20px; }
.cal-weekdays span { padding: 0 10px 6px; font-size: 12px; font-weight: 500; color: var(--faint); }
.cal-weekdays span:nth-child(n+6) { color: #c08080; }
.cal-grid { grid-auto-rows: minmax(124px, auto); }
.cal-day { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fff; text-align: left; color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.cal-day:hover { border-color: #d6d6d2; box-shadow: 0 6px 18px -10px rgba(0,0,0,.25); }
.cal-day:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cal-day.out { border-style: dashed; background: transparent; cursor: default; box-shadow: none; }
.cal-day.out .cal-num { color: #cfcfca; }
.cal-day.past:not(.today) { background: var(--side); }
.cal-day.past:not(.today) .cal-num { color: var(--faint); }
.cal-day.selected { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.cal-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.cal-num { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.today .cal-num { display: grid; place-items: center; width: 26px; height: 26px; margin: -3px 0 -3px -2px; border-radius: 50%; background: var(--ink); color: #fff; }
.cal-badge { padding: 1px 7px; border-radius: 999px; background: #e6f2ee; color: var(--accent); font-size: 11px; font-weight: 500; white-space: nowrap; }
.cal-chips { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-chip { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; color: #333; }
.cal-chip time { flex: none; color: var(--faint); font-variant-numeric: tabular-nums; }
.cal-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.skipped span { text-decoration: line-through; color: var(--faint); }
.cal-more { font-size: 11px; color: var(--faint); }
.cal-thumbs { display: flex; gap: 4px; margin-top: auto; }
.cal-thumbs img { width: 26px; height: 34px; border-radius: 5px; object-fit: cover; background: var(--soft); }
.tag.skipped { text-decoration: line-through; }

.cal-scrim { position: fixed; inset: 0; z-index: 5; background: rgba(17,17,17,.18); animation: cal-fade .2s ease; }
.cal-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 6; width: min(440px, 100%); display: flex; flex-direction: column; background: #fff; box-shadow: -20px 0 50px -20px rgba(0,0,0,.25); animation: cal-slide .22s cubic-bezier(.2,.8,.2,1); }
@keyframes cal-slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes cal-fade { from { opacity: 0; } }
.cal-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 14px; border-bottom: 1px solid var(--line); }
.cal-panel-k { margin: 0 0 2px; font-size: 12px; color: var(--muted); }
.cal-panel-k::first-letter { text-transform: uppercase; }
.cal-panel-head h2 { font-size: 22px; }
.cal-panel-body { flex: 1; overflow-y: auto; padding: 0 20px 28px; }
.cal-item { display: grid; grid-template-columns: 96px 1fr; gap: 14px; padding: 14px 0; border-top: 1px solid #f2f2f2; font-size: 14px; }
.cal-media { width: 96px; aspect-ratio: 9 / 16; border-radius: 10px; overflow: hidden; background: var(--soft); }
.cal-media.carousel { aspect-ratio: 4 / 5; }
.cal-media img, .cal-media video { width: 100%; height: 100%; object-fit: cover; }
.cal-media.text { display: grid; place-items: center; aspect-ratio: 1; font-size: 28px; }
.cal-req { display: flex; align-items: baseline; gap: 8px; padding: 8px 0; border-top: 1px solid #f2f2f2; font-size: 14px; }
.cal-req time { color: var(--faint); font-size: 12px; font-variant-numeric: tabular-nums; }
.cal-req em { font-style: normal; color: var(--muted); font-size: 13px; }

/* Home (/app/): sign in, projects, a new project */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }
.home-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 36px; }
.home-top .brand { text-decoration: none; margin: 0; }
.home h1 { font-size: 26px; }
.home-card { padding: 40px 28px; border: 1px solid var(--line); border-radius: 18px; text-align: center; }
.home-card .sub { max-width: 460px; margin: 10px auto 24px; }
.pill.big { padding: 12px 22px; font-size: 15px; }
.banner { margin: 16px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--warm); color: #6b4a00; font-size: 14px; }
.banner a { font-weight: 600; }
.project-list { display: grid; gap: 10px; margin-top: 18px; }
.project-card { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; text-decoration: none; margin: 0; transition: border-color .15s; }
.project-card:hover { border-color: #d6d6d2; }
.project-card b { font-size: 16px; font-weight: 600; }
.project-card span:not(.tag) { grid-column: 1; color: var(--muted); font-size: 13px; }
.project-card .tag { grid-column: 2; grid-row: 1 / 3; }
.form { display: grid; gap: 12px; max-width: 520px; }
.form label { display: grid; gap: 4px; font-size: 13px; font-weight: 500; color: var(--muted); }
.form input, .invite { width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; font: 400 15px/1.3 inherit; font-family: inherit; color: var(--ink); background: #fff; }
.form input:focus, .invite:focus { outline: 2px solid var(--ink); outline-offset: -1px; }
.form .pill { justify-self: start; }
.invite { flex: 1; min-width: 0; font-size: 13px; color: var(--muted); }
.member { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.member span:not(.tag) { color: var(--muted); font-size: 13px; }
.switch select { width: 100%; margin-top: 12px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: 500 14px/1.3 inherit; font-family: inherit; color: var(--ink); }
.who a { color: var(--muted); }
.side .brand { text-decoration: none; }

@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .side { position: sticky; z-index: 2; height: auto; padding: 10px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .project, .side .who, .side-h, .side-i.off { display: none; }
  .side { display: grid; grid-template-columns: auto 1fr; gap: 0 12px; align-items: center; }
  .side nav { grid-column: 1 / -1; }
  .switch select { margin-top: 0; }
  .brand { margin: 0; }
  .side nav { display: flex; gap: 2px; margin: 8px -4px 0; overflow-x: auto; scrollbar-width: none; }
  .side-i { flex: none; gap: 6px; border-radius: 8px 8px 0 0; padding: 8px 7px; }
  .side-i.on { background: none; box-shadow: inset 0 -2px 0 var(--ink); }
  .main { padding: 20px 16px 40px; }
  .kpis { gap: 6px; margin-top: 14px; }
  .kpi { padding: 10px; }
  .kpi-v { font-size: 18px; }
  .kpi-d { font-size: 11px; }
  .row { grid-template-columns: 44px 32px 1fr; }
  .row .thumb { width: 32px; }
  .row .tag { grid-column: 3; justify-self: start; }
  .cal-legend { margin-left: 0; }
  .cal-nav h2 { min-width: 0; }
  .cal-weekdays, .cal-grid { gap: 4px; }
  .cal-weekdays span { padding: 0 0 4px; text-align: center; }
  .cal-grid { grid-auto-rows: minmax(60px, auto); }
  .cal-day { align-items: center; gap: 4px; padding: 6px 2px; border-radius: 10px; }
  .cal-top { flex-direction: column; gap: 2px; }
  .today .cal-num { width: 24px; height: 24px; margin: 0; font-size: 13px; }
  .cal-num { font-size: 13px; }
  .cal-chips { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .cal-chip time, .cal-chip span, .cal-more, .cal-thumbs { display: none; }
  .cal-badge { padding: 0 4px; font-size: 9px; }
}
