/* ─────────────────────────────────────────────────────────────
   Cypress Sol · Project Pipeline
   Round 4 identity (Black Oak Creative, 08/26): warm paper, Fraunces +
   Figtree, marigold actions, forest bands, pill chips, soft hover lift.
   ───────────────────────────────────────────────────────────── */
:root {
  --paper:    #faf8f2;
  --white:    #ffffff;
  --charcoal: #262624;
  --seafoam:  #75a391;
  --palmetto: #cfd98a;
  --marigold: #f2bd4c;
  --coral:    #f56b61;
  --forest:   #36594a;
  --olive:    #838c4b;
  --earth:    #736446;
  --brick:    #91403a;
  --line:     rgba(38, 38, 36, 0.12);
  --line-soft:rgba(38, 38, 36, 0.07);
  --shadow:   0 6px 18px rgba(38, 38, 36, 0.08);
  --display: "Fraunces", Georgia, serif;
  --body:    "Figtree", -apple-system, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--charcoal);
  font-family: var(--body);
  font-size: 14.5px;
  line-height: 1.55;
  min-height: 100vh;
}
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
a { color: var(--forest); text-decoration: none; }
a:hover { color: var(--seafoam); }
[hidden] { display: none !important; }
::selection { background: var(--marigold); color: var(--charcoal); }

.muted { color: var(--earth); opacity: 0.85; }
.small { font-size: 12.5px; }
.right { text-align: right; white-space: nowrap; }
.late  { color: var(--brick); font-weight: 600; }

.eyebrow {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--seafoam);
}

/* ── controls ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--marigold); color: var(--charcoal);
  padding: 11px 20px; border-radius: 10px;
  font-weight: 600; font-size: 14px; white-space: nowrap;
  transition: transform 160ms, box-shadow 160ms, background 160ms;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:disabled { opacity: 0.55; transform: none; box-shadow: none; cursor: default; }
.btn-block { width: 100%; }
.btn-quiet {
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  font-weight: 600; font-size: 13.5px; background: var(--white);
  transition: transform 160ms, box-shadow 160ms;
}
.btn-quiet:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.link-btn { color: var(--forest); font-weight: 600; font-size: 13px; }
.link-btn:hover { color: var(--seafoam); }

.input {
  width: 100%; background: var(--white);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; font-size: 14px;
  transition: border-color 140ms, box-shadow 140ms;
}
.input:focus { outline: none; border-color: var(--seafoam); box-shadow: 0 0 0 3px rgba(117, 163, 145, 0.22); }
textarea.input { resize: vertical; min-height: 44px; }
.input-sm { padding: 6px 8px; font-size: 13px; width: auto; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 600; color: var(--earth); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }

.pill {
  display: inline-flex; align-items: center; padding: 3px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
/* stage tones */
.pill.tone-earth    { background: rgba(115, 100, 70, 0.13);  color: var(--earth); }
.pill.tone-seafoam  { background: rgba(117, 163, 145, 0.2);  color: #3f6e5c; }
.pill.tone-palmetto { background: rgba(207, 217, 138, 0.45); color: #5d6530; }
.pill.tone-marigold { background: rgba(242, 189, 76, 0.3);   color: #7a5a12; }
.pill.tone-coral    { background: rgba(245, 107, 97, 0.18);  color: var(--brick); }
.pill.tone-forest   { background: var(--forest);             color: var(--paper); }
.pill.tone-muted    { background: rgba(38, 38, 36, 0.07);    color: #6b6b66; }
.dot.tone-earth { background: var(--earth); }     .dot.tone-seafoam { background: var(--seafoam); }
.dot.tone-palmetto { background: #b7c25f; }       .dot.tone-marigold { background: var(--marigold); }
.dot.tone-coral { background: var(--coral); }     .dot.tone-forest { background: var(--forest); }
.dot.tone-muted { background: #b5b3aa; }

/* ── sign in ──────────────────────────────────────────────── */
.login {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px 16px; gap: 28px;
}
.login-card {
  width: 100%; max-width: 400px; background: var(--white);
  border: 1px solid var(--line-soft); border-radius: 14px; box-shadow: var(--shadow);
  padding: 36px 32px 28px; text-align: center;
}
.login-logo { width: 150px; margin: 0 auto 22px; display: block; }
.login-title {
  font-family: var(--display); font-variation-settings: "opsz" 130;
  font-weight: 500; font-size: 36px; margin: 6px 0 22px;
}
.login-card form { text-align: left; }
.login-msg {
  font-size: 13px; padding: 10px 12px; border-radius: 8px; margin-bottom: 14px;
  background: rgba(245, 107, 97, 0.12); color: var(--brick);
}
.login-msg.ok { background: rgba(117, 163, 145, 0.18); color: #3f6e5c; }
.login-alt { margin-top: 16px; font-size: 12.5px; }
.login-tag { font-family: var(--display); font-style: italic; color: var(--earth); font-size: 15px; text-align: center; }

/* ── shell ────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 28px;
  height: 64px; padding: 0 32px;
  background: rgba(250, 248, 242, 0.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--charcoal); }
.brand:hover { color: var(--charcoal); }
.brand img { width: 30px; height: auto; }
.wordmark {
  font-family: var(--display); font-variation-settings: "opsz" 130;
  font-weight: 600; font-size: 21px; white-space: nowrap;
}
.brand-sub {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--seafoam); border-left: 1px solid var(--line); padding-left: 10px;
}
.topnav { display: flex; gap: 22px; font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.topnav a { color: var(--charcoal); padding: 6px 0; border-bottom: 2px solid transparent; }
.topnav a:hover { color: var(--seafoam); }
.topnav a.active { border-bottom-color: var(--marigold); }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 13px; }
.topbar-user .link-btn { white-space: nowrap; }
#user-name { color: var(--earth); white-space: nowrap; }

#view { max-width: 1180px; margin: 0 auto; padding: 40px 32px 80px; min-height: calc(100vh - 64px - 120px); }

.foot {
  background: var(--forest); color: rgba(243, 239, 230, 0.75);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 36px 32px; font-size: 12.5px; letter-spacing: 0.04em;
}
.foot img { width: 150px; height: auto; }

/* ── page heads ───────────────────────────────────────────── */
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.view-title {
  font-family: var(--display); font-variation-settings: "opsz" 130;
  font-weight: 500; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.1; margin-top: 6px;
}
.back { display: inline-block; font-size: 13px; font-weight: 600; margin-bottom: 18px; }
.back::before { content: "\2190\00a0"; }
.head-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 12px; font-size: 13px; }
.head-actions { display: flex; gap: 10px; }
.stage-select { width: auto; padding: 6px 30px 6px 12px; border-radius: 999px; font-weight: 600; font-size: 13px; }

.loading { color: var(--earth); padding: 40px 0; }
.loading::after { content: "..."; }

/* ── pipeline ─────────────────────────────────────────────── */
.stage-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--white); border: 1px solid var(--line);
  transition: transform 140ms, box-shadow 140ms;
}
.chip b { font-weight: 700; color: var(--earth); }
.chip:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.chip.on { background: var(--charcoal); color: var(--paper); border-color: var(--charcoal); }
.chip.on b { color: var(--marigold); }
.toolbar { display: flex; gap: 10px; margin-bottom: 26px; }
.toolbar #q { max-width: 340px; }
.toolbar select { max-width: 260px; }

.group { margin-bottom: 30px; }
.group-head {
  display: flex; align-items: center; gap: 9px; margin-bottom: 12px;
  font-family: var(--display); font-variation-settings: "opsz" 130; font-weight: 500; font-size: 22px;
}
.group-head span { font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--earth); }
.cards { display: flex; flex-direction: column; gap: 10px; }

.card { background: var(--white); border: 1px solid var(--line-soft); border-radius: 12px; }
.project-row {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1.3fr) minmax(0, 1.2fr) 200px;
  gap: 20px; align-items: center; padding: 16px 20px; color: var(--charcoal);
  transition: transform 160ms, box-shadow 160ms, border-color 160ms;
}
.project-row:hover { color: var(--charcoal); transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--line); }
.pr-name { font-family: var(--display); font-variation-settings: "opsz" 130; font-weight: 600; font-size: 18px; line-height: 1.25; }
.pr-sub { font-size: 12.5px; color: var(--earth); margin-top: 3px; }
.pr-next, .pr-ms { font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.label { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--seafoam); margin-bottom: 2px; }
.pr-lead { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.avatar { font-size: 12.5px; font-weight: 600; color: var(--earth); }

.empty-line { color: var(--earth); padding: 18px 0; }
.empty { text-align: center; padding: 70px 16px; }
.empty-mark { width: 84px; opacity: 0.9; margin-bottom: 18px; }
.empty h2 { font-family: var(--display); font-variation-settings: "opsz" 130; font-weight: 500; font-size: 28px; margin-bottom: 8px; }
.empty p { color: var(--earth); margin-bottom: 22px; }
.archived-toggle { margin-top: 6px; }

/* ── project ──────────────────────────────────────────────── */
.project-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel { padding: 22px 24px; }
.panel-title {
  font-family: var(--display); font-variation-settings: "opsz" 130; font-weight: 500; font-size: 21px;
  margin-bottom: 14px; display: flex; align-items: center; gap: 10px;
}
.count { font-family: var(--body); font-size: 12px; font-weight: 700; background: var(--coral); color: var(--white); border-radius: 999px; padding: 1px 9px; }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.facts dt { font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--seafoam); }
.facts dd { font-size: 14.5px; margin-top: 2px; overflow-wrap: anywhere; }
.summary { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line-soft); font-size: 14.5px; }

.note-form { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 16px; }
.feed { list-style: none; display: flex; flex-direction: column; }
.feed li { padding: 11px 0; border-top: 1px solid var(--line-soft); font-size: 13.5px; }
.feed li:first-child { border-top: 0; }
.feed .event { color: #4d4b45; }
.feed .muted { font-size: 12px; margin-left: 4px; }
.feed-who { font-weight: 600; margin-bottom: 3px; }
.feed-body { font-size: 14px; overflow-wrap: anywhere; }

.ms-list, .file-list { list-style: none; }
.ms, .file { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line-soft); }
.ms:first-child, .file:first-child { border-top: 0; }
.ms input[type=checkbox] { margin-top: 4px; width: 16px; height: 16px; accent-color: var(--forest); flex: none; }
.ms-body, .file-body { flex: 1; min-width: 0; }
.ms-title { font-weight: 500; overflow-wrap: anywhere; }
.ms.done .ms-title { text-decoration: line-through; color: var(--earth); }
.ms-meta, .file-meta { font-size: 12px; color: var(--earth); }
.ms.late .ms-meta { color: var(--brick); font-weight: 600; }
.ms-add { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 14px; }
.ms-add [name=title] { grid-column: 1 / -1; }

.drop {
  display: flex; align-items: center; justify-content: center; text-align: center;
  border: 1.5px dashed rgba(54, 89, 74, 0.35); border-radius: 12px; padding: 22px 16px;
  color: var(--earth); font-size: 13.5px; cursor: pointer; margin-bottom: 12px;
  transition: background 140ms, border-color 140ms;
}
.drop:hover, .drop.over { background: rgba(117, 163, 145, 0.1); border-color: var(--seafoam); }
.drop.busy { opacity: 0.7; pointer-events: none; }
.drop u { color: var(--forest); font-weight: 600; }
.file-name { font-weight: 600; color: var(--forest); text-align: left; overflow-wrap: anywhere; }
.file-name:hover { color: var(--seafoam); }

/* ── people ───────────────────────────────────────────────── */
.invite-form { display: grid; grid-template-columns: 1.4fr 1fr 1fr 130px; gap: 0 12px; align-items: start; margin-top: 14px; }
.invite-form select.input { height: 44px; }
.invite-form .check { grid-column: 1 / 3; margin-bottom: 14px; }
.invite-form .btn { grid-column: 3 / 5; margin-bottom: 14px; }
.share-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--earth); padding-top: 14px; border-top: 1px solid var(--line-soft); }
.share-line code { background: var(--paper); border: 1px solid var(--line-soft); border-radius: 6px; padding: 4px 8px; color: var(--charcoal); font-size: 12.5px; }
#view > .panel + .panel { margin-top: 20px; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--seafoam); padding: 0 12px 8px 0; }
.table td { padding: 12px 12px 12px 0; border-top: 1px solid var(--line-soft); vertical-align: middle; }
.table .link-btn + .link-btn { margin-left: 14px; }

/* ── modal + toast ────────────────────────────────────────── */
.modal-veil {
  position: fixed; inset: 0; z-index: 50; background: rgba(38, 38, 36, 0.4);
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; overflow-y: auto;
}
.modal { width: 100%; max-width: 560px; background: var(--paper); border-radius: 14px; padding: 28px; box-shadow: 0 20px 50px rgba(38, 38, 36, 0.25); }
.modal-title { font-family: var(--display); font-variation-settings: "opsz" 130; font-weight: 500; font-size: 26px; margin-bottom: 18px; }
.modal-body { color: #4d4b45; margin-bottom: 8px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--charcoal); color: var(--paper); padding: 12px 18px; border-radius: 10px; font-size: 13.5px; box-shadow: var(--shadow); }

/* ── small screens ────────────────────────────────────────── */
@media (max-width: 900px) {
  .project-row { grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; }
  .pr-next, .pr-ms { grid-column: 1 / -1; }
  .pr-lead { grid-row: 1; grid-column: 2; }
  .project-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .topbar { padding: 0 16px; gap: 14px; height: 58px; }
  .brand-sub, #user-name, #deal-desk { display: none; }
  .wordmark { font-size: 18px; }
  .brand img { width: 26px; }
  .topnav { gap: 14px; }
  #view { padding: 26px 16px 60px; }
  .foot { padding: 28px 16px; }
  .toolbar { flex-direction: column; }
  .toolbar #q, .toolbar select { max-width: none; }
  .panel { padding: 18px 16px; }
  .field-row, .facts { grid-template-columns: 1fr; }
  .ms-add { grid-template-columns: 1fr 1fr; }
  .ms-add .btn { grid-column: 1 / -1; }
  .invite-form { grid-template-columns: 1fr; }
  .invite-form .check, .invite-form .btn { grid-column: auto; }
  .note-form { flex-direction: column; align-items: stretch; }
  .head-actions { width: 100%; }
  .head-actions .btn { flex: 1; }
  .login-card { padding: 30px 20px 24px; }
}
