/* Eos UI — cream light system matched to reference recording */
:root {
  --bg: #f4f3ee;
  --bg-soft: #efeee7;
  --card: #ffffff;
  --ink: #21201c;
  --muted: #75736a;
  --faint: #a3a199;
  --border: #e7e5dc;
  --border-strong: #d8d6cb;
  --dark: #1d1c18;
  --dark-hover: #33322c;
  --red: #c74a32;
  --red-bg: #fbeeec;
  --purple: #7a5af5;
  --purple-bg: #f1edfd;
  --yellow-bg: #faf3d9;
  --yellow-ink: #8a6d1f;
  --green: #3d7a4a;
  --green-bg: #ecf3ed;
  --rail: #161613;
  --on-dark: #ffffff;
  --rail-dot: #2c2b27;
  --rail-dot-hi: #3a3934;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --space-xxs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;
  --text-micro: 11px;
  --text-caption: 12px;
  --text-body-sm: 13px;
  --text-body: 14px;
  --text-title: 28px;
  --text-hero: 44px;
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  line-height: 1.5;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--ink); color: var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); border: 3px solid var(--bg); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); }

/* ---------- icon rail ---------- */
.rail {
  width: 44px;
  flex-shrink: 0;
  background: var(--rail);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-sm) 0;
  gap: var(--space-sm);
}
.rail .rail-logo {
  width: 22px; height: 22px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--rail);
  display: grid; place-items: center;
  font-family: var(--font-serif);
  font-size: 15px;
  margin-bottom: var(--space-sm);
}
.rail-dot { width: 16px; height: 16px; border-radius: var(--radius-sm); background: var(--rail-dot); }
.rail-dot:first-of-type { background: var(--rail-dot-hi); }

/* ---------- sidebar ---------- */
.sidebar {
  width: 248px;
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: var(--space-xxs);
  padding: var(--space-md) var(--space-md) var(--space-sm);
}
.brand .wordmark { font-family: var(--font-serif); font-size: 20px; letter-spacing: -0.2px; }
.brand svg { width: 12px; height: 12px; color: var(--faint); }
.nav { padding: 0 var(--space-xs); display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  width: 100%;
  padding: 7px var(--space-xs);
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--ink);
  font-size: var(--text-body);
  font-weight: var(--weight-medium);
  text-align: left;
}
.nav-item svg { width: 15px; height: 15px; color: var(--muted); flex-shrink: 0; }
.nav-item:hover { background: var(--bg-soft); }
.nav-item.active { background: var(--card); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.nav-item .kbd {
  margin-left: auto;
  font-size: var(--text-micro);
  color: var(--faint);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 5px;
  font-family: var(--font-sans);
}
.nav-label {
  padding: var(--space-lg) var(--space-sm) var(--space-xxs);
  font-size: var(--text-micro);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.threads { flex: 1; overflow-y: auto; padding: 0 var(--space-xs); display: flex; flex-direction: column; gap: 1px; }
.thread-row {
  display: block;
  width: 100%;
  padding: 6px var(--space-xs);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: var(--text-body-sm);
  border: none;
  background: none;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thread-row:hover { background: var(--bg-soft); color: var(--ink); }
.thread-row.active { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,0.05); }
.profile-footer {
  margin: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
}
.avatar {
  width: 22px; height: 22px;
  border-radius: var(--radius-pill);
  background: var(--dark);
  color: var(--bg);
  display: grid; place-items: center;
  font-size: var(--text-micro);
}
.profile-footer svg { margin-left: auto; width: 12px; height: 12px; color: var(--faint); }

/* ---------- main / topbar ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--bg); }
.topbar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
}
.topbar .tb-title { font-size: var(--text-body); font-weight: var(--weight-medium); }
.topbar .tb-right { margin-left: auto; display: flex; align-items: center; gap: var(--space-sm); }
.icon-btn {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: none; background: none;
  border-radius: var(--radius-sm);
  color: var(--muted);
}
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }
.icon-btn svg { width: 15px; height: 15px; }
.tb-search {
  display: flex; align-items: center; gap: var(--space-xxs);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px var(--space-xs);
  color: var(--faint);
  font-size: var(--text-body-sm);
  width: 200px;
}
.tb-search input { border: none; background: none; outline: none; flex: 1; font-size: var(--text-body-sm); }
.tb-search .kbd { font-size: var(--text-micro); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.tb-link { border: none; background: none; color: var(--muted); font-size: var(--text-body-sm); font-weight: var(--weight-medium); }
.tb-link:hover { color: var(--ink); }

.view { flex: 1; overflow-y: auto; padding: 0 var(--space-lg) var(--space-lg); display: none; }
.view.active { display: block; }

/* ---------- type helpers ---------- */
.page-title { font-family: var(--font-serif); font-size: var(--text-title); font-weight: var(--weight-regular); letter-spacing: -0.3px; }
.page-sub { color: var(--muted); font-size: var(--text-body-sm); margin-top: 2px; }
.eyebrow {
  font-size: var(--text-micro);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
}
.eyebrow.purple { color: var(--purple); }

/* ---------- buttons ---------- */
.btn-dark {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--dark); color: var(--on-dark);
  border: none; border-radius: var(--radius-pill);
  padding: 7px 14px;
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
}
.btn-dark:hover { background: var(--dark-hover); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--card); color: var(--ink);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 12px;
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
}
.btn-ghost:hover { border-color: var(--border-strong); }
.btn-ghost svg { width: 12px; height: 12px; color: var(--muted); }
.input, .select, .textarea {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px var(--space-sm);
  font-size: var(--text-body-sm);
  outline: none;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.card-pad { padding: var(--space-md); }
.section-label {
  font-size: var(--text-micro);
  font-weight: var(--weight-medium);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--faint);
}

/* ---------- chat home ---------- */
#view-home.active { display: flex; flex-direction: column; overflow-y: auto; }
.home-wrap { max-width: 720px; margin: 0 auto; width: 100%; padding-top: 12vh; display: flex; flex-direction: column; flex: 1; }
.home-wrap .composer-dock { margin-top: auto; padding-top: var(--space-xl); }
.home-hero { font-family: var(--font-serif); font-size: var(--text-hero); font-weight: var(--weight-regular); letter-spacing: -0.5px; line-height: 1.1; }
.home-sub { color: var(--muted); font-size: var(--text-body); margin-top: var(--space-sm); }
.attention-card {
  margin-top: var(--space-xl);
  display: flex; align-items: center; gap: var(--space-sm);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  text-align: left;
  width: 100%;
}
.attention-card:hover { border-color: var(--border-strong); }
.attention-card .ic {
  width: 30px; height: 30px;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  display: grid; place-items: center;
  color: var(--muted);
  flex-shrink: 0;
}
.attention-card .ic svg { width: 15px; height: 15px; }
.attention-card b { display: block; font-size: var(--text-body); font-weight: var(--weight-semibold); }
.attention-card span { font-size: var(--text-body-sm); color: var(--muted); }

/* ---------- composer ---------- */
.composer-dock { padding: var(--space-md) 0 var(--space-sm); }
.composer {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: 0 4px 16px rgba(0,0,0,0.05);
  padding: var(--space-sm) var(--space-md) var(--space-xs);
}
.composer:focus-within { border-color: var(--border-strong); }
.composer textarea {
  width: 100%;
  border: none; background: none; outline: none; resize: none;
  font-size: var(--text-body);
  height: 24px;
}
.composer textarea::placeholder { color: var(--faint); }
.composer-row { display: flex; align-items: center; margin-top: var(--space-xs); }
.composer-row .spacer { flex: 1; }
.round-btn {
  width: 28px; height: 28px;
  border-radius: var(--radius-pill);
  border: none;
  display: grid; place-items: center;
  background: none; color: var(--muted);
}
.round-btn:hover { background: var(--bg-soft); }
.round-btn.send { background: var(--bg-soft); color: var(--faint); }
.round-btn.send.ready { background: var(--dark); color: var(--on-dark); }
.round-btn svg { width: 14px; height: 14px; }
.skill-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--purple-bg); color: var(--purple);
  border-radius: var(--radius-pill);
  padding: 3px 10px;
  font-size: var(--text-caption);
  font-weight: var(--weight-medium);
  margin-bottom: var(--space-xxs);
}
.skill-chip button { border: none; background: none; color: var(--purple); padding: 0 2px; }
.slash-popup {
  position: fixed;
  bottom: 120px;
  width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  overflow: hidden;
  z-index: 20;
}
.slash-item {
  display: flex; gap: var(--space-xs); align-items: baseline;
  width: 100%; padding: var(--space-xs) var(--space-md);
  background: none; border: none;
  text-align: left;
}
.slash-item:hover, .slash-item.sel { background: var(--bg-soft); }
.slash-item .cmd { font-size: var(--text-body); font-weight: var(--weight-medium); }
.slash-item .desc { font-size: var(--text-caption); color: var(--muted); }

/* ---------- chat thread ---------- */
#view-chat.active { display: flex; flex-direction: column; overflow: hidden; }
#view-chat .thread-wrap { flex: 1; overflow-y: auto; }
#view-chat .composer-dock { flex-shrink: 0; }
.thread-wrap { max-width: 760px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: var(--space-lg); padding-top: var(--space-md); }
.msg-user {
  align-self: flex-end;
  background: var(--bg-soft);
  border-radius: var(--radius-lg);
  padding: var(--space-xs) var(--space-md);
  max-width: 70%;
  font-size: var(--text-body);
}
.msg-ai { align-self: stretch; font-size: var(--text-body); line-height: 1.6; white-space: pre-wrap; }
.run-status {
  display: flex; align-items: center; gap: var(--space-xs);
  font-size: var(--text-caption); color: var(--faint);
  margin-bottom: var(--space-xs);
}
.run-status .sep { color: var(--border-strong); }
.step-row {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px var(--space-xs);
  cursor: pointer;
  display: inline-block;
  margin: 2px 4px 2px 0;
}
.step-detail {
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--muted);
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: var(--space-xs);
  white-space: pre-wrap;
  word-break: break-word;
  margin-top: var(--space-xxs);
}
.msg-ai b { font-weight: var(--weight-semibold); }
.msg-ai hr { border: none; border-top: 1px solid var(--border); margin: var(--space-sm) 0; }

/* ---------- meetings ---------- */
.record-banner {
  display: flex; align-items: center; gap: var(--space-sm);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-md) 0 var(--space-lg);
}
.rec-dot { width: 22px; height: 22px; border-radius: var(--radius-pill); background: var(--dark); display: grid; place-items: center; flex-shrink: 0; }
.rec-dot::after { content: ""; width: 8px; height: 8px; border-radius: 2px; background: #ffffff; }
.rec-dot.live { background: var(--red); animation: pulse 1.2s infinite; }
.rec-dot.live::after { border-radius: var(--radius-pill); }
@keyframes pulse { 50% { opacity: 0.5; } }
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 0; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card); overflow: hidden; }
.split-left { border-right: 1px solid var(--border); padding: var(--space-md); min-height: 420px; }
.split-right { padding: var(--space-md); }
.split-head { display: flex; align-items: center; gap: var(--space-xs); margin-bottom: var(--space-sm); }
.split-head h3 { font-size: var(--text-body); font-weight: var(--weight-semibold); }
.count-badge { font-size: var(--text-micro); color: var(--muted); background: var(--bg-soft); border-radius: var(--radius-pill); padding: 1px 7px; }
.meeting-row {
  width: 100%; text-align: left;
  border: none; background: none;
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  border-bottom: 1px solid var(--border);
}
.meeting-row:last-child { border-bottom: none; }
.meeting-row:hover, .meeting-row.sel { background: var(--bg-soft); }
.meeting-row b { display: block; font-size: var(--text-body); font-weight: var(--weight-semibold); }
.meeting-row .meta { font-size: var(--text-caption); color: var(--muted); margin-top: 1px; }
.badge {
  display: inline-block;
  font-size: var(--text-micro);
  font-weight: var(--weight-medium);
  border-radius: var(--radius-pill);
  padding: 1px 8px;
  background: var(--bg-soft);
  color: var(--muted);
}
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.purple { background: var(--purple-bg); color: var(--purple); }
.attention-block { border-left: 3px solid var(--red); padding-left: var(--space-sm); margin-top: var(--space-md); }
.attention-block .at-title { color: var(--red); font-size: var(--text-body-sm); font-weight: var(--weight-semibold); }
.attention-block p { font-size: var(--text-body-sm); color: var(--muted); margin-top: var(--space-xxs); }
.link-btn { border: none; background: none; color: var(--ink); font-size: var(--text-body-sm); text-decoration: underline; padding: 0; margin-top: var(--space-xxs); }

/* ---------- workspace ---------- */
.tabs {
  display: inline-flex; gap: 2px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  margin: var(--space-md) 0;
}
.tab {
  display: inline-flex; align-items: center; gap: 6px;
  border: none; background: none;
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: var(--text-body-sm);
  font-weight: var(--weight-medium);
  color: var(--muted);
}
.tab svg { width: 13px; height: 13px; }
.tab.active { background: var(--dark); color: var(--on-dark); }
.tab.active svg { color: var(--on-dark); }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-sm); margin-bottom: var(--space-md); }
.stat-card { border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-sm) var(--space-md); background: var(--card); }
.stat-card .section-label { margin-bottom: 2px; }
.stat-card .num { font-size: 22px; font-weight: var(--weight-semibold); font-variant-numeric: tabular-nums; }
.stat-card.red { background: var(--red-bg); border-color: transparent; }
.stat-card.red .section-label, .stat-card.red .num { color: var(--red); }
.filter-row { display: flex; align-items: center; gap: var(--space-xs); margin-bottom: var(--space-md); flex-wrap: wrap; }
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  font-size: var(--text-body-sm);
  color: var(--muted);
}
.filter-pill b { color: var(--ink); font-weight: var(--weight-medium); }
.filter-pill.active { border-color: var(--ink); color: var(--ink); }
.task-row {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
}
.task-row:last-child { border-bottom: none; }
.task-row .radio {
  width: 16px; height: 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-strong);
  flex-shrink: 0;
  background: none;
  padding: 0;
}
.task-row .radio:hover { border-color: var(--ink); }
.task-row.done .radio { background: var(--dark); border-color: var(--dark); }
.task-row .t-text { flex: 1; font-size: var(--text-body); }
.task-row.done .t-text { color: var(--faint); text-decoration: line-through; }
.task-row .due { font-size: var(--text-caption); color: var(--red); }
.task-row .due.ok { color: var(--muted); }
.list-footer { padding: var(--space-sm) var(--space-md); font-size: var(--text-caption); color: var(--faint); }
.contact-row { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) var(--space-md); border-bottom: 1px solid var(--border); }
.contact-row:last-child { border-bottom: none; }
.contact-row b { font-size: var(--text-body); font-weight: var(--weight-semibold); display: block; }
.contact-row .meta { font-size: var(--text-caption); color: var(--muted); }
.contact-row .del { margin-left: auto; border: none; background: none; color: var(--faint); }
.contact-row .del:hover { color: var(--red); }

/* ---------- calendar ---------- */
.cal-toolbar { display: flex; align-items: center; gap: var(--space-xs); margin: var(--space-md) 0; flex-wrap: wrap; }
.cal-toolbar .month-name { font-size: var(--text-body-sm); font-weight: var(--weight-semibold); margin: 0 var(--space-xs); }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 2px; margin-left: auto; }
.seg button { border: none; background: none; border-radius: 4px; padding: 3px 10px; font-size: var(--text-caption); color: var(--muted); }
.seg button.active { background: var(--bg-soft); color: var(--ink); font-weight: var(--weight-medium); }
.notice {
  background: var(--yellow-bg); color: var(--yellow-ink);
  border-radius: var(--radius-sm);
  font-size: var(--text-caption);
  padding: var(--space-xs) var(--space-sm);
  margin-bottom: var(--space-sm);
}
.cal-layout { display: grid; grid-template-columns: 1fr 280px; gap: var(--space-md); align-items: start; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; background: var(--card); }
.cal-dow { padding: var(--space-xxs); font-size: var(--text-micro); font-weight: var(--weight-medium); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); text-align: center; border-bottom: 1px solid var(--border); }
.cal-cell { min-height: 76px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: var(--space-xxs); cursor: pointer; }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell:hover { background: var(--bg-soft); }
.cal-cell.other { color: var(--faint); }
.cal-cell.selected { background: var(--bg-soft); }
.cal-daynum { font-size: var(--text-caption); color: var(--muted); width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--radius-pill); font-variant-numeric: tabular-nums; }
.cal-cell.today .cal-daynum { background: var(--dark); color: var(--on-dark); }
.cal-event { font-size: var(--text-micro); border-radius: var(--radius-sm); padding: 0 4px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-event.event { background: var(--purple-bg); color: var(--purple); }
.cal-event.meeting { background: var(--green-bg); color: var(--green); }
.cal-event.todo { background: var(--red-bg); color: var(--red); }
.cal-event.note { background: var(--bg-soft); color: var(--muted); }
.cal-legend { display: flex; gap: var(--space-md); padding: var(--space-xs) var(--space-xxs); font-size: var(--text-caption); color: var(--faint); }
.cal-legend i { font-style: normal; }
.side-card { margin-bottom: var(--space-md); }
.side-card .sc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-sm); }
.side-card h4 { font-size: var(--text-body); font-weight: var(--weight-semibold); }
.up-row { display: flex; gap: var(--space-xs); padding: var(--space-xxs) 0; font-size: var(--text-body-sm); }
.up-row .when { font-family: var(--font-mono); font-size: var(--text-caption); color: var(--faint); width: 74px; flex-shrink: 0; }

/* ---------- pipeline ---------- */
.board { display: flex; gap: var(--space-sm); align-items: flex-start; width: max-content; min-width: 100%; padding-bottom: var(--space-xs); }
#view-pipeline.active { overflow-x: auto; }
.col { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-sm); width: 216px; flex-shrink: 0; }
.col-head { display: flex; justify-content: space-between; font-size: var(--text-micro); font-weight: var(--weight-medium); letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); margin-bottom: var(--space-xs); }
.kcard { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-xs) var(--space-sm); margin-bottom: var(--space-xxs); cursor: grab; }
.kcard:hover { border-color: var(--border-strong); }
.kcard b { display: block; font-size: var(--text-body-sm); font-weight: var(--weight-medium); }
.kcard .val { color: var(--green); font-size: var(--text-caption); font-weight: var(--weight-medium); font-variant-numeric: tabular-nums; }
.kcard .who { color: var(--faint); font-size: var(--text-caption); }
.dragover { outline: 2px dashed var(--ink); outline-offset: 2px; }

/* ---------- flowtype ---------- */
.empty-card { display: flex; flex-direction: column; align-items: center; gap: var(--space-xxs); padding: var(--space-xl); text-align: center; }
.empty-card .ic { width: 40px; height: 40px; border-radius: var(--radius-md); background: var(--purple-bg); color: var(--purple); display: grid; place-items: center; margin-bottom: var(--space-xxs); }
.empty-card .ic svg { width: 18px; height: 18px; }
.empty-card b { font-size: var(--text-body); font-weight: var(--weight-semibold); }
.empty-card span { font-size: var(--text-body-sm); color: var(--muted); }
.transcript-box { font-size: var(--text-body-sm); line-height: 1.6; min-height: 140px; width: 100%; resize: vertical; }
.progress-note { font-size: var(--text-caption); color: var(--faint); }

/* ---------- forms ---------- */
.frm { display: flex; flex-direction: column; gap: var(--space-sm); }
.frm-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-sm); }
.frm label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: var(--text-micro);
  font-weight: var(--weight-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}
.frm .input { font-size: var(--text-body); padding: 8px 12px; }
.frm-actions { display: flex; align-items: center; gap: var(--space-xs); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .sidebar { width: 224px; }
  .nav-item .kbd { display: none; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .split-left { border-right: none; border-bottom: 1px solid var(--border); }
  .cal-layout { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 44px; z-index: 50;
    box-shadow: 0 12px 32px rgba(0,0,0,0.14);
  }
  .tb-search { width: 150px; }
}
@media (max-width: 720px) {
  .view { padding: 0 var(--space-md) var(--space-md); }
  .home-wrap { padding-top: 6vh; }
  .home-hero { font-size: 32px; }
  .tb-search { display: none; }
  .page-title { font-size: 24px; }
  .msg-user { max-width: 85%; }
  .thread-wrap { gap: var(--space-md); }
  .cal-cell { min-height: 52px; }
  .frm-row { grid-template-columns: 1fr; }
  .skill-chip { display: none; }
  .composer-dock { padding: var(--space-sm) 0; }
}
@media (max-width: 480px) {
  .rail { width: 40px; }
  .stat-row { grid-template-columns: 1fr; }
  .split-left, .split-right { padding: var(--space-sm); }
  .record-banner { flex-wrap: wrap; }
  .brand .wordmark { font-size: 18px; }
}

/* ---------- splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 100;
  background: var(--rail);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 480ms ease, visibility 480ms ease;
}
#splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.splash-inner { display: flex; flex-direction: column; align-items: center; gap: var(--space-md); }
.splash-eyebrow {
  font-size: var(--text-micro); font-weight: var(--weight-medium);
  letter-spacing: 0.22em; text-transform: uppercase;
  color: #6f6d64;
  animation: splashRise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.splash-word {
  font-family: var(--font-serif);
  font-size: 96px; line-height: 1; letter-spacing: -2px;
  color: var(--bg);
  display: flex;
}
.splash-word span { animation: splashRise 700ms cubic-bezier(0.2, 0.7, 0.2, 1) both; }
.splash-word span:nth-child(1) { animation-delay: 120ms; }
.splash-word span:nth-child(2) { animation-delay: 240ms; }
.splash-word span:nth-child(3) { animation-delay: 360ms; }
.splash-tag {
  font-size: var(--text-body-sm); color: #8a887e;
  animation: splashRise 700ms 480ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.splash-bar {
  width: 148px; height: 2px; border-radius: var(--radius-pill);
  background: #2c2b27; overflow: hidden; margin-top: var(--space-sm);
  animation: splashRise 700ms 560ms both;
}
.splash-bar i {
  display: block; height: 100%; width: 40%;
  border-radius: var(--radius-pill);
  background: var(--bg);
  animation: splashSlide 1100ms 600ms ease-in-out infinite;
}
.splash-foot {
  position: absolute; bottom: var(--space-lg);
  display: flex; align-items: center; gap: var(--space-xxs);
  font-size: var(--text-caption); color: #6f6d64;
  animation: splashRise 700ms 700ms both;
}
.splash-foot b { color: #a3a199; font-weight: var(--weight-medium); }
.splash-dot { width: 6px; height: 6px; border-radius: var(--radius-pill); background: #5e6ad2; display: inline-block; }
@keyframes splashRise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes splashSlide { 0% { transform: translateX(-120%); } 100% { transform: translateX(380%); } }
@media (prefers-reduced-motion: reduce) {
  .splash-eyebrow, .splash-word span, .splash-tag, .splash-bar, .splash-foot { animation: none; }
  .splash-bar i { animation: none; width: 100%; }
}

/* ---------- markdown in chat ---------- */
.msg-ai { white-space: normal; }
.msg-ai p { margin: 0 0 var(--space-xxs); }
.msg-ai p:last-child { margin-bottom: 0; }
.msg-ai ul, .msg-ai ol { margin: var(--space-xxs) 0 var(--space-xxs) var(--space-lg); display: flex; flex-direction: column; gap: 2px; }
.msg-ai h4 { font-size: var(--text-body); font-weight: var(--weight-semibold); margin: var(--space-xs) 0 var(--space-xxs); }
.msg-ai code { font-family: var(--font-mono); font-size: var(--text-caption); background: var(--bg-soft); border-radius: var(--radius-sm); padding: 1px 5px; }
.msg-ai a { color: var(--ink); text-decoration: underline; }

/* ---------- search dropdown ---------- */
.tb-search-wrap { position: relative; }
.search-pop {
  position: absolute; top: calc(100% + 6px); right: 0;
  width: 320px; max-height: 380px; overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  z-index: 40;
  padding: var(--space-xxs);
}
.search-result {
  display: flex; align-items: center; gap: var(--space-xs);
  width: 100%; text-align: left;
  border: none; background: none;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  font-size: var(--text-body-sm);
}
.search-result:hover { background: var(--bg-soft); }
.search-result .sr-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-empty { padding: var(--space-sm); font-size: var(--text-caption); color: var(--faint); text-align: center; }

/* ---------- collapsible sidebar ---------- */
.sidebar { transition: margin-left 220ms ease; }
body.sb-collapsed .sidebar { margin-left: -249px; }
