:root {
  --yellow: #EBE717;
  --mist: #DDDFE2;
  --graphite: #3A3C41;
  --ink: #0A0A0A;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Montserrat', -apple-system, sans-serif;
  font-weight: 300;
  color: var(--ink);
  background: #fff;
  font-size: 15px;
  line-height: 1.45;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 80px;
}

/* top bar */
.topbar {
  background: var(--ink);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}
.wordmark {
  color: #fff;
  text-decoration: none;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.5px;
}
.wordmark .hl {
  background: var(--yellow);
  color: var(--ink);
  padding: 1px 6px;
  margin-left: 2px;
}
.topbar nav a {
  color: var(--mist);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  margin-left: 16px;
  padding-bottom: 3px;
}
.topbar nav a.on {
  color: #fff;
  border-bottom: 3px solid var(--yellow);
}

/* page head */
.page-head { margin-bottom: 18px; }
h1 { font-weight: 900; font-size: 26px; }
.sub { color: var(--graphite); font-size: 14px; margin-top: 4px; }
.crumb { font-size: 13px; margin-bottom: 2px; }
.crumb a { color: var(--graphite); font-weight: 600; text-decoration: none; }

/* buckets */
.bucket { margin-top: 24px; }
.bucket-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--graphite);
  margin-bottom: 8px;
}

/* task rows */
.task-list { list-style: none; }
.task {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--mist);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #fff;
}
.task.blocked { background: #fafafa; }
.check-form { margin-top: 2px; }
.check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--graphite);
  background: #fff;
  cursor: pointer;
}
.check:hover { background: var(--yellow); border-color: var(--ink); }
.check.checked { background: var(--ink); border-color: var(--ink); }
.task-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: 15px; }
.task-title .hl-mark {
  background: var(--yellow);
  padding: 1px 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.struck { text-decoration: line-through; color: var(--graphite); font-weight: 400; }
.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 5px;
  font-size: 12px;
}
.chip {
  border: 1px solid var(--mist);
  border-radius: 999px;
  padding: 1px 8px;
  font-weight: 600;
  color: var(--graphite);
  text-decoration: none;
  font-size: 11px;
}
.chip.p1 { background: var(--yellow); border-color: var(--yellow); color: var(--ink); }
.chip.warn { background: var(--ink); border-color: var(--ink); color: #fff; }
.client-chip { border-color: var(--graphite); color: var(--ink); }
.client-chip:hover { background: var(--ink); color: #fff; }
.due { color: var(--graphite); font-weight: 600; }
.due.over { color: var(--ink); background: var(--yellow); padding: 0 5px; font-weight: 700; }
.notes { color: var(--graphite); text-decoration: underline dotted; cursor: help; }

/* task actions */
.task-actions { display: flex; gap: 6px; align-items: flex-start; }
.mini {
  border: 1px solid var(--mist);
  background: #fff;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 600;
  font-size: 11px;
  color: var(--graphite);
  padding: 3px 8px;
  cursor: pointer;
  list-style: none;
}
.mini:hover { border-color: var(--ink); color: var(--ink); }
.mini.danger:hover { background: var(--ink); color: #fff; }
details.editor { position: relative; }
details.editor summary { display: inline-block; }
details.editor summary::-webkit-details-marker { display: none; }
.editor-pop {
  position: absolute;
  right: 0;
  top: 28px;
  z-index: 5;
  background: #fff;
  border: 1px solid var(--graphite);
  border-radius: 10px;
  padding: 12px;
  width: 220px;
  box-shadow: 0 6px 20px rgba(10,10,10,0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* forms */
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 110px; }
input[type="text"], input[type="date"], select {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--mist);
  border-radius: 8px;
  width: 100%;
  background: #fff;
}
input:focus, select:focus { outline: 2px solid var(--yellow); border-color: var(--ink); }
label { font-size: 12px; font-weight: 600; color: var(--graphite); display: flex; flex-direction: column; gap: 4px; }

.btn {
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  background: var(--ink);
  color: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 9px 16px;
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
  list-style: none;
  text-align: center;
}
.btn:hover { background: var(--yellow); color: var(--ink); }
.btn.done { background: var(--yellow); color: var(--ink); }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.ghost:hover { background: var(--yellow); }
.btn.small { padding: 6px 12px; font-size: 13px; }
summary.btn::-webkit-details-marker, summary.btn::marker { display: none; content: ""; }
.add-task { margin: 14px 0; }
.add-task > form { margin-top: 10px; }

.card {
  border: 1px solid var(--mist);
  border-radius: 12px;
  padding: 14px;
  background: #fff;
}

/* clients */
.client-list { list-style: none; }
.client-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--mist);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--ink);
}
.client-row:hover { border-color: var(--ink); }
.client-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.client-name { font-weight: 800; font-size: 15px; }
.client-thesis {
  font-size: 12px;
  color: var(--graphite);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.client-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.count { font-size: 12px; font-weight: 700; }

/* client detail */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.settings { margin-bottom: 6px; }
.settings summary { cursor: pointer; }
.settings > form { margin-top: 10px; }
.quiet { color: var(--graphite); font-size: 13px; }
.empty { margin-top: 24px; text-align: center; color: var(--graphite); }

/* phase 2: signals, approvals, connections */
.badge {
  background: var(--yellow);
  color: var(--ink);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  padding: 0 6px;
  margin-left: 4px;
}
.sweep-line {
  font-size: 12px;
  color: var(--graphite);
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.inline-form { display: inline; }
.src {
  font-size: 10px;
  font-weight: 700;
  color: var(--graphite);
  border: 1px solid var(--mist);
  border-radius: 4px;
  padding: 2px 5px;
  margin-top: 3px;
  letter-spacing: 0.04em;
}
.step { font-size: 13px; color: var(--graphite); margin-top: 3px; }
.step::before { content: "next: "; font-weight: 700; color: var(--ink); }
.sender { color: var(--graphite); }
.why {
  font-size: 11px;
  color: var(--ink);
  background: #f4f4ee;
  border-radius: 4px;
  padding: 1px 6px;
  font-weight: 600;
}
.mini.strong { border-color: var(--ink); background: var(--ink); color: #fff; }
.mini.strong:hover { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.assign-row { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.assign-row select { max-width: 220px; padding: 5px 8px; font-size: 13px; }
.filter-link { font-size: 12px; font-weight: 600; color: var(--graphite); }
.dim { opacity: 0.75; }
.conn { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.conn strong { font-weight: 800; font-size: 14px; }
.conn .quiet { margin-top: 3px; }
.run-log { list-style: none; margin-top: 12px; font-size: 12px; color: var(--graphite); }
.run-log li { padding: 3px 0; }
.channel-chips { display: flex; gap: 6px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.channel-chips .chip { font-size: 12px; padding: 3px 10px; }
.channel-chips .quiet { font-size: 12px; }
.brand-row { margin-left: 24px; margin-top: -4px; border-style: dashed; }
.brand-row .client-name { font-weight: 600; }

/* phase 2.2-2.4: meetings, suggestions, drafts */
.meeting { margin-bottom: 10px; }
.meeting.sync { background: #fafafa; }
.meeting-head { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: flex-start; }
.meeting-time { font-weight: 800; font-size: 13px; margin-right: 8px; }
.meeting-title { font-weight: 600; font-size: 15px; }
.meeting-chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.attendee-line { font-size: 12px; color: var(--graphite); margin: 6px 0 8px; }
.prep summary { cursor: pointer; }
.prep-body { margin-top: 10px; border: 1px solid var(--mist); border-radius: 10px; padding: 12px; }
.prep-summary { font-size: 14px; font-weight: 600; }
.prep-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em;
  color: var(--graphite); margin: 10px 0 4px;
}
.prep-body ul { margin-left: 18px; font-size: 13px; }
.prep-body li { margin-bottom: 3px; }
.cal-list { list-style: none; margin-top: 10px; }
.cal-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; flex-wrap: wrap; }
.cal-name { font-size: 13px; font-weight: 600; }
.suggestion { border-style: dashed; border-color: var(--graphite); }
.draft-body pre {
  white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.55;
}

@media (max-width: 480px) {
  .task-actions { flex-direction: column; align-items: flex-end; }
  .client-side { align-items: flex-end; }
}
