:root {
  --paper: #f7f6f3;
  --card: #ffffff;
  --ink: #1c1e21;
  --ink-soft: #5b6068;
  --line: #e4e2dc;
  --accent: #2f5d62;
  --accent-soft: #eaf1f1;
  --danger: #a33d3d;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 -apple-system, "Segoe UI", system-ui, sans-serif;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 56px 28px 120px;
}

header.site {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 64px;
}

header.site h1 { font-size: 22px; margin: 0; letter-spacing: -0.01em; }
header.site h1 a { color: inherit; text-decoration: none; }
header.site .sub { color: var(--ink-soft); font-size: 14px; }

h2 {
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 72px 0 20px;
  font-weight: 600;
}
h2:first-of-type { margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 28px;
}

/* ---- buttons & forms ---- */

button, .btn {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
button.primary:hover { background: #254d51; }
button.subtle {
  border: none;
  background: none;
  color: var(--ink-soft);
  padding: 4px 8px;
  font-size: 13px;
}
button.subtle:hover { color: var(--danger); }
button:disabled { opacity: 0.5; cursor: default; }

input, select, textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 12px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
}
textarea { resize: vertical; min-height: 180px; }
label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.field { margin-bottom: 20px; }
.row { display: flex; gap: 16px; }
.row > * { flex: 1; }

/* ---- client list ---- */

.client-card {
  display: block;
  text-decoration: none;
  color: inherit;
  margin-bottom: 16px;
  transition: border-color 0.15s;
}
.client-card:hover { border-color: var(--accent); }
.client-card .name { font-size: 18px; font-weight: 600; }
.client-card .meta { color: var(--ink-soft); font-size: 14px; margin-top: 6px; }

.chip {
  display: inline-block;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-left: 10px;
  vertical-align: middle;
}

/* ---- observations ---- */

.obs { padding: 20px 28px; margin-bottom: 12px; }
.obs .statement { font-size: 16px; }
.obs .obs-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--ink-soft);
}

.tier {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 9px;
  border-radius: 99px;
}
.tier.fact       { background: #e4efe6; color: #2c5f38; }
.tier.behavior   { background: #e5ecf5; color: #2f4f76; }
.tier.pattern    { background: #ece7f3; color: #54417a; }
.tier.hypothesis { background: #f6eedd; color: #7d5f1f; border: 1px dashed #cbb373; }

.confbar {
  width: 90px;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.confbar i { display: block; height: 100%; background: var(--accent); }

.evidence-list { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 16px; }
.evidence-list blockquote {
  margin: 0 0 14px;
  padding: 10px 16px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  font-size: 14px;
}
.evidence-list .src { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 6px; font-style: normal; }
.evidence-list blockquote.contradicts { border-left-color: var(--danger); background: #f7ecec; }

/* ---- commitments ---- */

.commit { display: flex; align-items: flex-start; gap: 14px; padding: 16px 28px; margin-bottom: 10px; }
.commit .who {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  padding: 3px 8px; border-radius: 6px; margin-top: 3px; white-space: nowrap;
}
.commit .who.us     { background: var(--accent-soft); color: var(--accent); }
.commit .who.client { background: #f0e9dc; color: #6e5a2e; }
.commit .desc { flex: 1; }
.commit .due { font-size: 13px; color: var(--ink-soft); }
.commit .due.overdue { color: var(--danger); font-weight: 600; }
.commit.done { opacity: 0.55; }
.commit.done .desc { text-decoration: line-through; }
.commit .actions { display: flex; gap: 6px; }

/* ---- timeline ---- */

.timeline-item { padding: 18px 28px; margin-bottom: 10px; }
.timeline-item .tmeta { font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 99px; margin-right: 6px; }
.status-dot.done { background: #3a7d4a; }
.status-dot.pending, .status-dot.processing { background: #c9a23f; }
.status-dot.failed { background: var(--danger); }

/* ---- actions ---- */

.action {
  padding: 20px 28px;
  margin-bottom: 12px;
  border-left: 3px solid var(--accent);
}
.action.urgency-now { border-left-color: #c25a2b; }
.action.resolved { opacity: 0.55; border-left-color: var(--line); }
.action .action-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.action .action-title { font-weight: 600; font-size: 16px; }
.atype {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent);
}
.atype.site_revision { background: #f3e9dd; color: #85552a; }
.atype.crm_stage_move { background: #e4efe6; color: #2c5f38; }
.action .rationale { color: var(--ink-soft); font-size: 14px; margin-top: 8px; }
.action .draft {
  margin-top: 14px; background: var(--paper); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 16px; font-size: 14.5px; white-space: pre-wrap;
}
.action .draft textarea { min-height: 150px; background: #fff; white-space: pre-wrap; }
.action .draft .subject { font-weight: 600; margin-bottom: 8px; }
.action .action-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; }
.stage-move { font-size: 15px; margin-top: 10px; }
.stage-move b { color: var(--accent); }
.badge-auto {
  font-size: 11px; padding: 2px 8px; border-radius: 99px;
  background: #f6eedd; color: #7d5f1f; border: 1px dashed #cbb373;
}

/* ---- brief ---- */

.brief-md { font-size: 15.5px; }
.brief-md h2 {
  text-transform: none; letter-spacing: 0;
  font-size: 17px; color: var(--ink); margin: 28px 0 10px;
}
.brief-md h2:first-child { margin-top: 0; }
.brief-md ul { padding-left: 22px; margin: 8px 0; }
.brief-md li { margin-bottom: 6px; }

.notice {
  padding: 14px 20px;
  border-radius: var(--radius);
  background: #f6eedd;
  border: 1px solid #e3d3a8;
  color: #6e5a2e;
  font-size: 14px;
  margin-bottom: 32px;
}
.notice.error { background: #f7ecec; border-color: #dbb6b6; color: var(--danger); }

.empty { color: var(--ink-soft); font-size: 14px; padding: 8px 0; }
.spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 99px; animation: spin 0.8s linear infinite;
  vertical-align: -2px; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
