:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --line: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #1d4ed8;
  --accent-soft: #eff4ff;
  --danger: #dc2626;
  --ok: #16a34a;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 4px 12px rgba(15, 23, 42, .05);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }

.boot-splash { padding: 80px 0; text-align: center; color: var(--muted); }

/* ---- topbar ---- */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 58px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.brand { font-weight: 800; font-size: 17px; letter-spacing: -.2px; white-space: nowrap; }
.brand .chapter { font-weight: 500; color: var(--muted); margin-left: 8px; font-size: 14px; }
.nav { display: flex; gap: 4px; flex: 1; min-width: 0; overflow-x: auto; }
.nav a {
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.nav a.active { background: var(--accent-soft); color: var(--accent); }
.nav a:hover { color: var(--accent); }
.topbar .me { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.btn-newevent {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 14px; font-weight: 700; font-size: 14px; white-space: nowrap;
}
.btn-newevent:hover { background: #1e40af; }

/* ---- layout ---- */
.main { max-width: 1240px; margin: 0 auto; padding: 22px 20px 60px; }
.page-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 20px; margin: 0; letter-spacing: -.2px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; }
.page-head .head-actions { margin-left: auto; display: inline-flex; gap: 6px; align-self: center; }
a.btn { text-decoration: none; color: inherit; display: inline-block; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card .card-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  font-size: 13.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.card .card-body { padding: 14px 16px; }

/* ---- generic controls ---- */
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid #bfd3ff; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 70px; }
.btn {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 7px 13px; font-weight: 600; font-size: 13.5px;
}
.btn:hover { border-color: #c6d0de; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #1e40af; }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: #fef2f2; }

.avatar {
  width: 26px; height: 26px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex: none;
  object-fit: cover; background: #cbd5e1;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 2px 9px;
  white-space: nowrap;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.overdue { color: var(--danger); font-weight: 700; }

/* ---- dashboard ---- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .n { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.tile .l { color: var(--muted); font-size: 12.5px; font-weight: 600; }
.goal-bar { height: 8px; border-radius: 999px; background: #e6ebf3; overflow: hidden; margin-top: 8px; }
.goal-bar > div { height: 100%; background: var(--ok); border-radius: 999px; }
.dash-grid { display: grid; grid-template-columns: 1fr 1fr 340px; gap: 14px; align-items: start; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.list-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 16px;
  border-bottom: 1px solid #f1f5f9; cursor: pointer;
}
.list-row:last-child { border-bottom: 0; }
.list-row:hover { background: #f8fafc; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.date-block { text-align: center; min-width: 44px; background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 4px 6px; flex: none; }
.date-block .d { font-size: 17px; font-weight: 800; line-height: 1.1; }
.date-block .m { font-size: 10.5px; font-weight: 700; text-transform: uppercase; }
.feed-row { display: flex; gap: 10px; padding: 9px 16px; border-bottom: 1px solid #f1f5f9; font-size: 13.5px; }
.feed-row:last-child { border-bottom: 0; }
.feed-row .when { color: var(--muted); font-size: 12px; }
.empty { padding: 22px 16px; color: var(--muted); text-align: center; font-size: 13.5px; }
/* gone quiet: filing the follow-up, and the settled state once it exists */
.quiet-btn { padding: 4px 11px; font-size: 12.5px; flex: none; }
.quiet-open { flex: none; font-weight: 600; }

/* ---- this week ---- */
.wk-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; align-items: start; }
.wk-col .card-head { padding: 11px 16px; }
.wk-who { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-who .avatar { width: 22px; height: 22px; font-size: 10px; }
.wk-col .card-head .gcount { color: #94a3b8; font-weight: 800; flex: none; }
.wk-col .task-group-head { padding: 12px 16px 2px; }
.wk-col .date-block { min-width: 40px; }
.wk-fold { padding: 8px 16px 0; }
/* Rows with nothing to open must not pretend to be clickable. */
.list-row.flat { cursor: default; }
.list-row.flat:hover { background: none; }

/* ---- board ---- */
.board { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 16px; }
.col { background: #eaeef5; border-radius: 12px; min-width: 248px; width: 248px; flex: none; }
.col-head {
  padding: 10px 12px 6px; font-weight: 800; font-size: 13px;
  display: flex; align-items: center; gap: 8px; text-transform: uppercase; letter-spacing: .03em;
}
.col-head .count { color: var(--muted); font-weight: 700; }
.col-head .stage-dot { width: 9px; height: 9px; border-radius: 50%; }
.col-head .add { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 18px; line-height: 1; padding: 2px 6px; border-radius: 6px; }
.col-head .add:hover { background: #dde4ee; color: var(--accent); }
.col-cards { padding: 6px 8px 10px; min-height: 60px; display: flex; flex-direction: column; gap: 8px; }
.col.drag-over { outline: 2px dashed var(--accent); outline-offset: -4px; }
.ecard {
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer;
}
.ecard.dragging { opacity: .4; }
.ecard .t { font-weight: 700; font-size: 14px; line-height: 1.3; margin-bottom: 6px; }
.ecard .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.ecard .badges { display: flex; gap: 8px; margin-top: 8px; align-items: center; font-size: 12px; color: var(--muted); }
.ecard .lead-ava { display: inline-flex; margin-left: auto; }
.ecard .lead-ava .avatar { width: 18px; height: 18px; font-size: 8.5px; }
.dropped-tray { margin-top: 14px; }
.dropped-tray summary { cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.dropped-list { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.dropped-list .ecard { width: 248px; opacity: .75; }

/* ---- calendar ---- */
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cal-month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.cal-month.current { border-color: var(--accent); }
.cal-month .mh { padding: 9px 14px; border-bottom: 1px solid var(--line); font-weight: 800; font-size: 13.5px; display: flex; justify-content: space-between; }
.cal-month .mh .yr { color: var(--muted); font-weight: 600; }
.cal-events { padding: 8px; display: flex; flex-direction: column; gap: 6px; min-height: 44px; }
.cal-ev {
  display: flex; align-items: center; gap: 8px; padding: 6px 9px;
  border-radius: 8px; background: #f8fafc; border-left: 3px solid var(--muted);
  cursor: pointer; font-size: 13px;
}
.cal-ev:hover { background: #f1f5f9; }
.cal-ev .day { font-weight: 800; min-width: 26px; text-align: center; }
.cal-ev .t { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-none { color: #b6c2d2; font-size: 12.5px; text-align: center; padding: 10px 0 6px; }

/* ---- tasks ---- */
.task-filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.task-filters button {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 14px; font-weight: 600; font-size: 13px; color: var(--muted);
}
.task-filters button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.task-group-head { padding: 10px 16px 4px; font-weight: 800; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.owner-head { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--text); }
.owner-head .avatar { width: 22px; height: 22px; font-size: 10px; }
.dlead-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.dlead-row .dlead-label { flex: 1; display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; }
.dlead-row .dlead-label .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dlead-row select { width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; background: #fff; }
.task-row { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid #f1f5f9; }
.task-row:last-child { border-bottom: 0; }
.task-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--ok); flex: none; }
.task-row .t { flex: 1; min-width: 0; }
.task-row.done .t { text-decoration: line-through; color: var(--muted); }
.task-row .del { border: 0; background: none; color: #c3ccd8; font-size: 15px; padding: 2px 6px; border-radius: 6px; }
.task-row .del:hover { color: var(--danger); background: #fef2f2; }
.task-add { display: grid; grid-template-columns: 2fr 1.2fr 1fr 1fr auto; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.task-add input, .task-add select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
@media (max-width: 800px) { .task-add { grid-template-columns: 1fr 1fr; } }

/* ---- task toolbar + condensed rows ---- */
.task-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.task-toolbar .task-filters { margin-bottom: 0; }
.task-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.sortlabel { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.sortlabel select { border: 1px solid var(--line); border-radius: 8px; padding: 6px 9px; background: #fff; }
.task-group-head .gcount { color: #94a3b8; font-weight: 700; }
.task-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row .t-ev {
  flex: none; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted); font-size: 12px; background: #f1f5f9; border-radius: 999px; padding: 2px 9px;
}
.task-row .t-due { flex: none; width: 58px; text-align: right; font-size: 12.5px; }
.task-row.locked { opacity: .62; }
.task-row.locked .t { cursor: default; }
.pickrow { display: flex; flex-direction: column; gap: 10px; }
.pick {
  display: flex; gap: 13px; align-items: center; text-align: left; width: 100%;
  border: 1px solid var(--line); background: #fff; border-radius: 11px; padding: 15px 16px;
}
.pick:hover { border-color: var(--accent); background: var(--accent-soft); }
.pick-i { font-size: 22px; flex: none; }

/* ---- communities ---- */
.cfilter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.cf {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 5px 13px; font-size: 12.5px; font-weight: 600; color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px;
}
.cf:hover { border-color: #c6d0de; }
.cf.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.cf-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cf.on .cf-dot { background: rgba(255,255,255,.85) !important; }
/* ---- owner (lane) filter: a sibling of the community bar ---- */
.ofilter { align-items: center; }
.cf-label {
  font-size: 11px; font-weight: 800; color: var(--muted);
  text-transform: uppercase; letter-spacing: .06em; margin-right: 2px;
}
.ofilter .cf .avatar { width: 17px; height: 17px; font-size: 8px; }
.filter-note { margin: -6px 0 14px; }

.cdots { display: inline-flex; gap: 3px; align-items: center; }
.cdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.pickchips { display: flex; gap: 6px; flex-wrap: wrap; }
.pchip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 4px 11px; font-size: 12.5px; font-weight: 600; color: var(--muted);
}
.pchip:hover { border-color: var(--accent); color: var(--accent); }
.pchip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.clist { display: flex; flex-direction: column; gap: 4px; }
.crow { display: flex; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; }
.crow:last-child { border-bottom: 0; }
.crow .cname { flex: 1; font-weight: 600; font-size: 14px; }
.daychair-chip { background: #fef3c7; color: #b45309; font-size: 10.5px; padding: 1px 7px; vertical-align: middle; }

/* ---- surveys ---- */
.survey-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-top: 10px; }
.survey-box .srow { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.linklist { margin-top: 10px; max-height: 230px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.linkrow { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid #f1f5f9; }
.linkrow:last-child { border-bottom: 0; }
.lr-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.results { margin-top: 12px; }
.rq { margin-top: 14px; }
.rq-l { font-weight: 650; font-size: 13.5px; margin-bottom: 6px; }
.rq-bars { display: flex; gap: 5px; align-items: flex-end; height: 60px; }
.rq-bar {
  flex: 1; background: #eef2f7; border-radius: 5px; position: relative; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.rq-fill { background: var(--accent); border-radius: 5px; min-height: 2px; }
.rq-bar span { position: absolute; bottom: -17px; left: 0; right: 0; text-align: center; font-size: 10.5px; color: var(--muted); font-weight: 700; }
.rq-bars + * { margin-top: 22px; }
.quote {
  background: #f8fafc; border-left: 3px solid var(--line); border-radius: 0 8px 8px 0;
  padding: 7px 11px; margin-bottom: 6px; font-size: 13px;
}

/* ---- team ---- */
.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.member { display: flex; gap: 12px; align-items: center; padding: 14px 16px; }
.member .avatar { width: 38px; height: 38px; font-size: 14px; }
.member .who { flex: 1; min-width: 0; }
.member .who .n { font-weight: 700; }
.member .who .r { color: var(--muted); font-size: 12.5px; }
.member .rm { border: 0; background: none; color: #c3ccd8; padding: 4px 6px; border-radius: 6px; }
.member .rm:hover { color: var(--danger); background: #fef2f2; }
.member-actions { display: flex; align-items: center; gap: 4px; flex: none; }
.member .lnk {
  border: 0; background: none; color: var(--muted); font-size: 12px;
  font-weight: 600; padding: 4px 6px; border-radius: 6px; white-space: nowrap;
}
.member .lnk:hover { color: var(--accent); background: var(--accent-soft); }
.admin-chip { background: #e0e7ff; color: #4338ca; font-size: 10.5px; padding: 1px 7px; vertical-align: middle; }

/* pending access requests */
.pending-card { border-color: #c7d7fe; }
.req-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #f1f5f9; }
.req-row:last-child { border-bottom: 0; }
.req-row .avatar { width: 34px; height: 34px; font-size: 13px; }
.req-row .who { flex: 1; min-width: 0; }
.req-row .who .n { font-weight: 700; }
.req-row .who .r { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.req-actions { display: flex; gap: 6px; flex: none; }
.pill {
  display: inline-block; background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 800; padding: 1px 7px; margin-left: 6px; vertical-align: middle;
}
.nav a.active .pill { background: var(--accent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
a.list-row { color: inherit; text-decoration: none; }

.share-note { background: var(--accent-soft); border: 1px solid #d6e2ff; border-radius: var(--radius); padding: 14px 16px; font-size: 13.5px; margin-top: 14px; }
.share-note code { background: #fff; border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; font-size: 12.5px; }

/* ---- program view ---- */
.prog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .prog-grid { grid-template-columns: 1fr; } }
.warn-note {
  background: #fef2f2; border: 1px solid #fecaca; color: #991b1b;
  border-radius: var(--radius); padding: 11px 15px; font-size: 13.5px; font-weight: 600; margin-bottom: 14px;
}
.mix-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.mix-label { width: 132px; font-size: 12.5px; color: var(--muted); font-weight: 600; flex: none; }
.mix-bar { flex: 1; height: 16px; background: #f1f5f9; border-radius: 5px; overflow: hidden; }
.mix-bar > div { height: 100%; border-radius: 5px; min-width: 0; }
.mix-n { width: 18px; text-align: right; font-weight: 800; font-size: 12.5px; flex: none; }
/* spend by owner reuses the mix bar, with room for money instead of a count */
.own-label { display: flex; align-items: center; gap: 7px; color: var(--text); }
.own-label .avatar { width: 20px; height: 20px; font-size: 9px; }
.own-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.own-amt { width: 148px; text-align: right; font-weight: 800; font-size: 13px; flex: none; }
.own-sub { display: block; font-weight: 600; font-size: 11.5px; color: var(--muted); }
.mix-bar > div.bar-none { background: var(--muted); opacity: .35; }
.spacing { display: flex; gap: 4px; align-items: flex-end; }
.sp-col { flex: 1; text-align: center; }
.sp-bars { display: flex; flex-direction: column-reverse; gap: 2px; justify-content: flex-start; min-height: 46px; }
.sp-bars span { display: block; height: 13px; background: var(--accent); border-radius: 3px; }
.sp-m { font-size: 10.5px; font-weight: 700; color: var(--muted); margin-top: 5px; }
.sp-m.empty { color: #cbd5e1; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); padding: 8px 16px; border-bottom: 1px solid var(--line); font-weight: 700;
}
.tbl td { padding: 9px 16px; border-bottom: 1px solid #f1f5f9; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .r, .tbl th.r { text-align: right; }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:hover { background: #f8fafc; }
.tbl td.over { color: var(--danger); font-weight: 700; }
.stars { color: #f59e0b; letter-spacing: 1px; white-space: nowrap; }
.stars .dim { color: #e2e8f0; }

/* ---- directory ---- */
.dir-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.dir-card { display: flex; flex-direction: column; }
.dir-head { display: flex; gap: 10px; align-items: flex-start; padding: 13px 16px 8px; }
.dir-head > div:first-child { flex: 1; min-width: 0; }
.dir-name { font-weight: 800; font-size: 15px; }
.dir-sub { color: var(--muted); font-size: 12.5px; }
.dir-rating { white-space: nowrap; flex: none; }
.dir-rating .star { color: #e2e8f0; cursor: pointer; font-size: 15px; }
.dir-rating .star.on { color: #f59e0b; }
.dir-rating .star:hover { color: #fbbf24; }
.dir-body { padding: 0 16px 10px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.dir-body .k { color: var(--muted); font-weight: 700; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; margin-right: 5px; }
.dir-notes { background: #f8fafc; border-radius: 8px; padding: 7px 10px; margin: 3px 0; }
.dir-foot { border-top: 1px solid #f1f5f9; padding: 8px 12px; display: flex; gap: 4px; }
.lnk { border: 0; background: none; color: var(--muted); font-size: 12.5px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
.lnk:hover { color: var(--accent); background: var(--accent-soft); }
.lnk.danger:hover { color: var(--danger); background: #fef2f2; }

/* ---- rsvp ---- */
.rsvp-summary { display: flex; gap: 6px; flex-wrap: wrap; }
.rs-chip { font-size: 11.5px; font-weight: 700; border-radius: 999px; padding: 3px 10px; }
.rs-chip.yes { background: #dcfce7; color: #15803d; }
.rs-chip.maybe { background: #fef3c7; color: #b45309; }
.rs-chip.no { background: #fee2e2; color: #b91c1c; }
.rs-chip.none { background: #f1f5f9; color: var(--muted); }
.rs-chip.came { background: #dbeafe; color: #1d4ed8; }
.rsvp-list { margin-top: 10px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.rsvp-row { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid #f1f5f9; }
.rsvp-row:last-child { border-bottom: 0; }
.rsvp-name { flex: 1; min-width: 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rsvp-btns { display: flex; gap: 3px; flex: none; }
.rsvp-b {
  width: 26px; height: 24px; border: 1px solid var(--line); background: #fff;
  border-radius: 6px; font-size: 11px; font-weight: 800; color: var(--muted); padding: 0;
}
.rsvp-b:hover { border-color: #c6d0de; }
.rsvp-b.yes.on { background: #16a34a; border-color: #16a34a; color: #fff; }
.rsvp-b.maybe.on { background: #d97706; border-color: #d97706; color: #fff; }
.rsvp-b.no.on { background: #dc2626; border-color: #dc2626; color: #fff; }
.rsvp-b.attended.on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }

/* ---- checklist template editor ---- */
.tpl-tbl { width: 100%; border-collapse: collapse; }
.tpl-tbl th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--muted); padding: 4px 6px; font-weight: 700; }
.tpl-tbl td { padding: 2px 6px 2px 0; }
.tpl-tbl input { width: 100%; border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; }
.tpl-tbl input:focus { outline: 2px solid #bfd3ff; border-color: var(--accent); }
.tpl-tbl .del { border: 0; background: none; color: #c3ccd8; padding: 4px 6px; border-radius: 6px; }
.tpl-tbl .del:hover { color: var(--danger); background: #fef2f2; }

/* ---- connect ---- */
.copyrow { display: flex; gap: 6px; }
.copyrow input {
  flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; background: #f8fafc; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px;
}
.src-row { display: flex; gap: 11px; padding: 12px 16px; border-bottom: 1px solid #f1f5f9; align-items: flex-start; }
.src-row:last-of-type { border-bottom: 0; }
.src-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; margin-top: 6px; }
.src-dot.ok { background: var(--ok); }
.src-dot.bad { background: var(--danger); }
.src-dot.idle { background: #cbd5e1; }
.src-dot.off { background: #e2e8f0; border: 1px solid #cbd5e1; }
.src-main { flex: 1; min-width: 0; }
.src-name { font-weight: 700; font-size: 14px; }
.src-kind { background: #e0e7ff; color: #4338ca; font-size: 10.5px; }
.src-url {
  color: var(--muted); font-size: 12px; font-family: ui-monospace, Menlo, Consolas, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 2px 0;
}
.src-actions { display: flex; gap: 2px; flex: none; }
.testresult { margin-top: 10px; border-radius: 8px; padding: 9px 12px; font-size: 13px; font-weight: 600; }
.testresult.ok { background: #f0fdf4; border: 1px solid #bbf7d0; color: #15803d; }
.testresult.bad { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.codeblock {
  background: #0f172a; color: #e2e8f0; border-radius: 8px; padding: 12px 14px;
  font-size: 12px; line-height: 1.5; overflow-x: auto; margin: 10px 0;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.import-box { background: #f8fafc; border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.import-box textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; resize: vertical;
}

/* ---- drawer ---- */
.backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 96vw);
  background: var(--surface); z-index: 61; box-shadow: -8px 0 30px rgba(15, 23, 42, .18);
  display: flex; flex-direction: column;
}
.drawer-head { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 10px; }
.drawer-head input.title {
  border: 0; font-size: 17px; font-weight: 800; flex: 1; min-width: 0; padding: 2px 4px; border-radius: 6px;
}
.drawer-head input.title:focus { outline: 2px solid #bfd3ff; }
.drawer-head .close { border: 0; background: none; font-size: 20px; color: var(--muted); padding: 2px 8px; border-radius: 6px; }
.drawer-head .close:hover { background: #f1f5f9; }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.drawer h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 20px 0 8px; }
.drawer .task-row { padding: 6px 0; }
.inline-add { display: flex; gap: 6px; margin-top: 8px; }
.inline-add input[type="text"] { flex: 1; border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; min-width: 0; }
.inline-add input[type="date"], .inline-add select { border: 1px solid var(--line); border-radius: 8px; padding: 7px 6px; }
.comment { display: flex; gap: 10px; margin-bottom: 12px; }
.comment .body { background: #f6f8fb; border-radius: 10px; padding: 8px 12px; flex: 1; font-size: 13.5px; }
.comment .body .who { font-weight: 700; font-size: 12.5px; margin-bottom: 2px; }
.comment .body .when { color: var(--muted); font-weight: 400; font-size: 11.5px; margin-left: 6px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 12px 18px; display: flex; gap: 8px; justify-content: space-between; }

/* ---- modal ---- */
.modal-wrap { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-start; justify-content: center; padding: 7vh 16px; background: rgba(15, 23, 42, .35); overflow-y: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 560px; max-width: 100%; box-shadow: 0 20px 60px rgba(15, 23, 42, .3); }
.modal .modal-head { padding: 16px 20px 0; font-size: 17px; font-weight: 800; }
.modal .modal-body { padding: 14px 20px 4px; }
.modal .modal-foot { padding: 12px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; }

/* ---- login ---- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 400px; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 28px; }
.login-card h1 { margin: 0 0 2px; font-size: 22px; letter-spacing: -.3px; }
.login-card .sub { color: var(--muted); margin-bottom: 20px; font-size: 14px; }
.login-users { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.login-user {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: left; width: 100%;
}
.login-user:hover { border-color: var(--accent); }
.login-user.sel { border-color: var(--accent); background: var(--accent-soft); }
.login-user .n { font-weight: 700; }
.login-user .r { color: var(--muted); font-size: 12.5px; }

/* ---- about page ---- */
.about {
  --ok: #14764c;
  --guard: #a55a06;
  --guard-soft: #fbf0e0;
  max-width: 1000px;
}
.about p, .about li { max-width: 68ch; }
.ab-top { border-bottom: 1px solid var(--line); padding-bottom: 26px; margin-bottom: 34px; }
.ab-eyebrow, .ab-kicker {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.ab-kicker { color: var(--accent); }
.ab-h1 {
  font-size: clamp(26px, 4vw, 36px); line-height: 1.12; letter-spacing: -.02em;
  font-weight: 800; margin: 0 0 14px; text-wrap: balance;
}
.ab-lede { font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 64ch; margin: 0; }
.ab-facts {
  display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 22px;
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; color: var(--muted);
}
.ab-facts b { color: var(--text); font-weight: 700; }
.ab-sec { margin-bottom: 54px; }
.ab-h2 {
  font-size: clamp(20px, 2.6vw, 25px); line-height: 1.2; letter-spacing: -.015em;
  font-weight: 750; margin: 0 0 10px; text-wrap: balance;
}
.ab-h3 { font-size: 16px; font-weight: 700; margin: 28px 0 8px; }
.about p { margin: 0 0 14px; line-height: 1.62; }
.about code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .87em;
  background: #f1f5f9; border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}
.ab-fig { margin: 24px 0 28px; }
.ab-figbox {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 20px 18px 12px; overflow-x: auto; box-shadow: var(--shadow);
}
.ab-figbox svg { display: block; width: 100%; height: auto; min-width: 620px; color: var(--text); }
.ab-fig figcaption {
  font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 11px; max-width: 74ch;
}
.ab-fig figcaption b { color: var(--text); font-weight: 650; }

/* svg primitives, shared by every about diagram */
.about .d-box { fill: #f1f5f9; stroke: currentColor; stroke-opacity: .22; }
.about .d-box-plain { fill: none; stroke: currentColor; stroke-opacity: .22; }
.about .d-t { fill: var(--text); font-family: inherit; font-size: 13px; font-weight: 640; }
.about .d-s { fill: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10.5px; }
.about .d-n { fill: #94a3b8; }
.about .d-line { stroke: currentColor; stroke-opacity: .42; fill: none; stroke-width: 1.4; }
.about .d-dash { stroke-dasharray: 5 4; }
.about .acc { stroke: var(--accent); stroke-opacity: .95; }
.about .t-acc { fill: var(--accent); }
.about .grd { stroke: var(--guard); stroke-opacity: .95; }
.about .t-grd { fill: var(--guard); }
.about .ok { stroke: var(--ok); stroke-opacity: .95; }
.about .t-ok { fill: var(--ok); }
.about .stop { stroke: var(--danger); stroke-opacity: .95; }
.about .t-stop { fill: var(--danger); }
.about .fill-acc { fill: var(--accent-soft); stroke: var(--accent); stroke-opacity: .5; }
.about .fill-grd { fill: var(--guard-soft); stroke: var(--guard); stroke-opacity: .45; }

.ab-tablewrap {
  overflow-x: auto; margin: 22px 0 26px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--surface); box-shadow: var(--shadow);
}
.ab-table { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 580px; }
.ab-table th, .ab-table td { text-align: left; padding: 10px 15px; border-bottom: 1px solid #f1f5f9; }
.ab-table thead th {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  font-weight: 600; border-bottom: 1px solid var(--line);
}
.ab-table tbody tr:last-child td { border-bottom: 0; }
.ab-table .rh { font-weight: 640; }
.ab-table .y { color: var(--ok); font-weight: 650; }
.ab-table .nn { color: #94a3b8; }
.ab-table .sc { color: var(--guard); font-weight: 650; }
.ab-table .num { font-variant-numeric: tabular-nums; }
.ab-note {
  border-left: 3px solid var(--guard); background: var(--guard-soft);
  border-radius: 0 10px 10px 0; padding: 13px 17px; margin: 22px 0; max-width: 68ch; font-size: 14.5px;
}
.ab-note p { margin: 0; }
.ab-note-l {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 10.5px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--guard);
  display: block; margin-bottom: 5px; font-weight: 700;
}
.ab-foot { color: var(--muted); font-size: 13.5px; border-top: 1px solid var(--line); padding-top: 16px; margin-top: 26px; }
.about-chip { background: #dbeafe; color: #1d4ed8; font-size: 10.5px; padding: 1px 7px; vertical-align: middle; }

/* ---- toasts ---- */
#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: #0f172a; color: #fff; border-radius: 10px; padding: 10px 18px;
  font-size: 13.5px; font-weight: 600; box-shadow: 0 10px 30px rgba(15, 23, 42, .35);
  animation: toast-in .18s ease-out;
}
.toast.err { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
