* { box-sizing: border-box; }

body {
  margin: 0;
  background: #14161c;
  color: #d8dce6;
  font-family: "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 22px;
  border-bottom: 1px solid #262a35;
}

.breadcrumb {
  font-size: 13px;
  color: #8fa6c0;
  text-decoration: none;
}
.breadcrumb:hover { color: #6fc3ff; }

header h1 {
  margin: 0;
  font-size: 20px;
  color: #f0f2f7;
}

.tagline {
  font-size: 13px;
  color: #8fa6c0;
}

a { color: #6fc3ff; }

/* --- Layout -------------------------------------------------------------- */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 22px 80px;
}

.disclaimer {
  margin: 0 0 18px;
  padding: 8px 12px;
  font-size: 12px;
  color: #b9a96f;
  background: #211e12;
  border: 1px solid #3c3620;
  border-radius: 6px;
}

.section { margin-bottom: 22px; }
.section > h2 {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa3b5;
}
.section > .sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: #717a8c;
}

/* --- Collapsible detail sections ----------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head-text { min-width: 0; }
.section-head h2 {
  margin: 0 0 4px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa3b5;
}
.section-head .sub { margin: 0; font-size: 13px; color: #717a8c; }
.collapse-btn {
  flex: 0 0 auto;
  padding: 4px 14px;
  background: transparent;
  border: 1px solid #3a4052;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.collapse-btn:hover { background: rgba(255, 255, 255, 0.06); }
.collapsible.is-collapsed { margin-bottom: 14px; }
.collapsible.is-collapsed .section-head { margin-bottom: 0; }
.collapsible.is-collapsed .section-body { display: none; }

/* --- Studio machine grouping + area labels ------------------------------- */
.studio-machine {
  border: 1px solid #313a4d;
  background: #161922;
  border-radius: 12px;
  padding: 16px;
}
.area-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  color: #6f7a8f;
  margin-bottom: 8px;
}
.area--ventures { margin-top: 14px; }

/* --- Rollovers / popup explainers ---------------------------------------- */
.tooltip {
  position: fixed;
  z-index: 200;
  max-width: 270px;
  background: #0d0f14;
  border: 1px solid #3a4658;
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.45;
  color: #d8dce6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  white-space: pre-line;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.tooltip.show { opacity: 1; }
.info {
  display: inline-block;
  width: 14px; height: 14px;
  line-height: 14px;
  text-align: center;
  font-size: 10px;
  font-style: normal;
  border-radius: 50%;
  background: #2a3340;
  color: #9fb4cc;
  cursor: help;
  margin-left: 6px;
  vertical-align: middle;
  font-variant: normal;
}
.info:hover { background: #3a4a5c; color: #cfe2f5; }
.area-label[data-tip], .funnel-stage-label[data-tip] { cursor: help; }

.panel {
  background: #1b1e27;
  border: 1px solid #2e3342;
  border-radius: 8px;
  padding: 16px;
}

/* --- Action bar (full-width header for The Studio Machine) --------------- */
.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.action-bar-left { flex: 1; min-width: 0; }
.action-bar-title {
  margin: 0 0 2px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9aa3b5;
}
.action-bar-sub {
  margin: 0;
  font-size: 13px;
  color: #717a8c;
}
.action-bar-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  flex-shrink: 0;
}
.month-label {
  font-size: 13px;
  color: #9aa3b5;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  padding: 0 4px;
}

/* --- Top row: funding + funnel ------------------------------------------ */
.top-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 18px;
  align-items: stretch;
}
@media (max-width: 820px) {
  .top-grid { grid-template-columns: 1fr; }
}

/* --- Funnel panel -------------------------------------------------------- */
.funnel-panel { display: flex; flex-direction: column; gap: 10px; overflow: hidden; }

.funnel {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  flex: 1;
  min-height: 220px;
  padding-bottom: 0;
}

.funnel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
  height: 100%;
}

.funnel-stage-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin-bottom: 4px;
  flex-shrink: 0;
}
.funnel-stage-id {
  font-size: 10px;
  font-weight: 600;
  color: #9aa3b5;
  letter-spacing: 0.04em;
}
.funnel-stage-name {
  font-size: 9px;
  color: #717a8c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.funnel-stage-count {
  font-size: 9px;
  font-variant-numeric: tabular-nums;
  color: #14161c;
  background: #6fc3ff;
  border-radius: 8px;
  padding: 0 5px;
  margin-top: 1px;
}

.funnel-silhouette {
  width: 100%;
  background: #1e2230;
  border: 1px solid #2e3342;
  border-radius: 4px 4px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 2px;
  padding: 4px 2px;
  overflow: hidden;
  position: relative;
  /* height is set inline per column */
}

.funnel-chip {
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  text-align: center;
  line-height: 1.4;
}
.funnel-chip--idea {
  background: #1e2d3a;
  border: 1px solid #2e4a5a;
  color: #8cc8e8;
}
.funnel-chip--active {
  background: #1e2e1a;
  border: 1px solid #3c7a52;
  color: #8fd18f;
}
.funnel-chip--stalled {
  background: #2a2410;
  border: 1px solid #6a5820;
  color: #c8a83c;
}

.funnel-spinout-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 6px;
  flex-shrink: 0;
  width: 52px;
}
.funnel-spinout-icon {
  font-size: 20px;
  color: #3c7a6a;
  line-height: 1;
}
.funnel-spinout-count {
  font-size: 9px;
  color: #717a8c;
  text-align: center;
  white-space: nowrap;
}

.funnel-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
}
.funnel-killed { color: #b96f6f; }
.funnel-caption { color: #717a8c; font-style: italic; }

/* --- Spun-out strip (full width, below the top grid) -------------------- */
.spunout-strip {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}
.spunout-empty {
  font-size: 13px;
  color: #717a8c;
  padding: 12px 18px;
  border: 1px dashed #2e3342;
  border-radius: 8px;
  margin: 0;
  width: 100%;
  text-align: center;
}
.spunout-card {
  background: #161d22;
  border: 1px solid #2f4a55;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 160px;
}
.spunout-name {
  font-size: 13px;
  font-weight: 600;
  color: #9fe0ff;
}
.spunout-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.spunout-profit { color: #8fd18f; }
.spunout-sep { color: #4a5266; }
.spunout-cost { color: #b96f6f; }

/* Funding tank */
.tank-row { display: flex; gap: 16px; align-items: stretch; }
.tank {
  position: relative;
  width: 96px;
  flex: 0 0 96px;
  border: 1px solid #3a4052;
  border-radius: 8px;
  background: #14161c;
  overflow: hidden;
  min-height: 200px;
}
.tank-fill {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg, #3c7a6a, #2d5a4d);
  transition: height 0.5s ease;
}
.tank-pct {
  position: absolute;
  left: 0; right: 0; top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: #f0f2f7;
  text-shadow: 0 1px 3px #000;
}
.tank-cap, .tank-base {
  position: absolute; left: 0; right: 0;
  text-align: center; font-size: 10px; color: #717a8c; padding: 2px 0;
}
.tank-cap { top: 0; }
.tank-base { bottom: 0; }

/* Drain cue when a month is advanced — the slice of fund that just left. */
.tank-drain {
  position: absolute;
  left: 0; right: 0;
  background: rgba(214, 138, 60, 0.55);
  pointer-events: none;
  animation: drainFade 1.1s ease forwards;
}
@keyframes drainFade { 0% { opacity: 0.9; } 100% { opacity: 0; } }
.tank-drain-label {
  position: absolute;
  left: 0; right: 0; top: 28%;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: #f0c07a;
  text-shadow: 0 1px 3px #000;
  pointer-events: none;
  animation: drainLabel 1.2s ease forwards;
}
@keyframes drainLabel {
  0% { opacity: 0; transform: translateY(6px); }
  25% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-12px); }
}

.stats { flex: 1; }
.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
  border-bottom: 1px solid #262a35;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: #9aa3b5; }
.stat-val { color: #f0f2f7; font-variant-numeric: tabular-nums; }
.raise-input {
  width: 110px;
  padding: 2px 6px;
  background: #14161c;
  color: #f0f2f7;
  border: 1px solid #3c6a7a;
  border-radius: 4px;
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.raise-input:focus { outline: none; border-color: #6fc3ff; }
.locked-tag { font-size: 11px; opacity: 0.8; }
.fund-filled-note {
  margin: 10px 0 0;
  padding: 6px 10px;
  font-size: 12px;
  color: #8fd18f;
  background: #16241a;
  border: 1px solid #2d5a3d;
  border-radius: 6px;
}
.status-pill {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 1px 8px;
  border-radius: 10px;
  border: 1px solid #3a4052;
  color: #9aa3b5;
}
.status-pill.active { color: #8fd18f; border-color: #3c7a52; }
.status-pill.complete { color: #6fc3ff; border-color: #3c6a7a; }

/* buttons */
.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
button {
  padding: 8px 12px;
  background: #2a2f3d;
  color: #d8dce6;
  border: 1px solid #3a4052;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
}
button:hover { background: #343a4b; }
button:disabled { opacity: 0.4; cursor: not-allowed; }
button.primary { background: #2d5a3d; border-color: #3c7a52; }
button.primary:hover:not(:disabled) { background: #356c49; }
button.danger { background: #5a2d2d; border-color: #7a3c3c; }
button.danger:hover:not(:disabled) { background: #6c3535; }
button.tiny { padding: 4px 9px; font-size: 12px; }

/* --- Machine note -------------------------------------------------------- */
.machine-note { font-size: 12px; color: #717a8c; margin-top: 12px; }

/* --- Venture pipeline ---------------------------------------------------- */
.pipeline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.venture {
  background: #1b1e27;
  border: 1px solid #2e3342;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.venture.killed { opacity: 0.5; }
.venture.eligible { border-color: #3c7a52; box-shadow: 0 0 0 1px #2d5a3d33; }
.venture.spun_out { border-color: #3c6a7a; }
.venture-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.venture-head h3 { margin: 0; font-size: 16px; color: #f0f2f7; }
.stage-tag {
  font-size: 11px;
  color: #c8b06f;
  font-variant-numeric: tabular-nums;
}
.venture-body { display: flex; gap: 12px; }
.pie-wrap { flex: 0 0 120px; text-align: center; }
.pie-wrap svg { display: block; }
.pie-caption { font-size: 10px; color: #717a8c; margin-top: 2px; }

.metrics { flex: 1; font-size: 12px; }
.metrics .m { display: flex; justify-content: space-between; padding: 2px 0; }
.metrics .m .k { color: #9aa3b5; }
.metrics .m .v { color: #f0f2f7; font-variant-numeric: tabular-nums; }

.own-legend { font-size: 11px; display: flex; flex-wrap: wrap; gap: 8px; }
.own-legend .li { display: flex; align-items: center; gap: 4px; color: #9aa3b5; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }

.venture-foot { display: flex; gap: 8px; align-items: center; }
.elig-text { font-size: 11px; color: #717a8c; flex: 1; }
.elig-text.yes { color: #8fd18f; }
.kill-reason { font-size: 11px; color: #b96f6f; font-style: italic; }

/* progress bar of stages */
.stage-bar { display: flex; gap: 2px; height: 6px; }
.stage-seg { flex: 1; border-radius: 1px; background: #2a2f3d; }
.stage-seg.done { background: #3c7a6a; }
.stage-seg.active { background: #c8a83c; }

/* --- Spinouts ------------------------------------------------------------ */
.spinout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.llc {
  background: #161d22;
  border: 1px solid #2f4a55;
  border-radius: 8px;
  padding: 14px;
}
.llc h3 { margin: 0 0 2px; font-size: 16px; color: #9fe0ff; }
.llc .src { font-size: 11px; color: #717a8c; margin-bottom: 10px; }
.llc table { width: 100%; border-collapse: collapse; font-size: 12px; }
.llc table td { padding: 3px 0; border-bottom: 1px solid #21333a; }
.llc table td.v { text-align: right; font-variant-numeric: tabular-nums; color: #f0f2f7; }
.llc .own-table { margin-top: 8px; }
.llc .own-table th { text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: #717a8c; padding-bottom: 3px; }

.empty {
  font-size: 13px;
  color: #717a8c;
  padding: 18px;
  border: 1px dashed #2e3342;
  border-radius: 8px;
  text-align: center;
}

/* --- Cap table ----------------------------------------------------------- */
.ct-h3 {
  margin: 0 0 10px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #9aa3b5;
}
.ct-scroll { overflow-x: auto; }
table.captable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.captable th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #717a8c;
  padding: 4px 10px 6px 0;
  border-bottom: 1px solid #2e3342;
  white-space: nowrap;
}
table.captable td {
  padding: 7px 10px 7px 0;
  border-bottom: 1px solid #21242e;
  vertical-align: top;
  color: #d8dce6;
}
table.captable td.r, table.captable th.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.captable td.strong { color: #8fd18f; font-weight: 600; }
tr.ct-total td {
  border-top: 1px solid #2e3342;
  border-bottom: none;
  color: #9aa3b5;
  font-size: 12px;
  padding-top: 9px;
}
.ct-hold {
  display: inline-block;
  background: #232a36;
  border: 1px solid #2e3a48;
  border-radius: 4px;
  padding: 1px 7px;
  margin: 0 4px 4px 0;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: #c2c8d4;
}
.ct-hold.spun { border-color: #2f4a55; color: #9fe0ff; }
.ct-note { font-size: 11px; color: #717a8c; }
.tag-spun { color: #9fe0ff; font-size: 11px; }
.ct-fundline {
  font-size: 12px;
  color: #9aa3b5;
  margin: -2px 0 10px;
}
.ct-fundline b { font-variant-numeric: tabular-nums; }
tr.ct-subhead td {
  padding: 10px 0 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #8fa6c0;
  border-bottom: 1px solid #2e3342;
}

/* --- Edit-names modal ---------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 9, 13, 0.7);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 60px 16px;
  z-index: 50;
  overflow-y: auto;
}
.modal {
  background: #1b1e27;
  border: 1px solid #2e3342;
  border-radius: 10px;
  padding: 20px 22px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.modal h2 { margin: 0 0 4px; font-size: 18px; color: #f0f2f7; }
.modal-sub { margin: 0 0 14px; font-size: 13px; color: #9aa3b5; }
.modal-group {
  margin: 14px 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #717a8c;
  border-bottom: 1px solid #262a35;
  padding-bottom: 4px;
}
.modal-field { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.modal-flabel {
  flex: 0 0 92px;
  font-size: 12px;
  color: #8fa6c0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.modal-input {
  flex: 1;
  padding: 7px 9px;
  background: #14161c;
  color: #d8dce6;
  border: 1px solid #3a4052;
  border-radius: 5px;
  font-size: 13px;
}
.modal-input:focus { outline: none; border-color: #3c6a7a; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.modal-actions button { flex: 0 0 auto; }

.modal-wide { max-width: 720px; }
.modal-row { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.modal-row .modal-input { flex: 1; min-width: 0; }
.modal-row .modal-role { flex: 0 0 130px; }
.modal-row .modal-pct { flex: 0 0 58px; text-align: right; }
.modal-row .modal-amt { flex: 0 0 92px; text-align: right; }
.modal-pctsign { color: #717a8c; font-size: 13px; width: 8px; }
.modal-row button.tiny.danger { flex: 0 0 auto; padding: 4px 8px; }
.modal-delbtn { flex: 0 0 auto; }
.modal-delsp { flex: 0 0 24px; }
.modal-add { margin: 2px 0 4px; }
.modal-chead { margin-bottom: 4px; }
.modal-colh {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #717a8c;
  border: none !important;
  background: none !important;
  padding: 0 2px;
}
.modal-pct.modal-colh, .modal-amt.modal-colh { text-align: right; }
.modal-total {
  margin: 16px 0 0;
  padding-top: 10px;
  border-top: 1px solid #262a35;
  font-size: 13px;
}
.modal-total b { font-variant-numeric: tabular-nums; }

/* --- CSV import / export toolbar inside the Edit Participants modal ------- */
.csv-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.csv-import-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  background: #2a2f3d;
  color: #d8dce6;
  border: 1px solid #3a4052;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.csv-import-label:hover { background: #343a4b; }
.csv-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* --- Explanation copy ---------------------------------------------------- */
.explain {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.explain .card {
  background: #1b1e27;
  border: 1px solid #2e3342;
  border-radius: 8px;
  padding: 14px;
}
.explain .card h3 { margin: 0 0 6px; font-size: 14px; color: #6fc3ff; }
.explain .card p { margin: 0; font-size: 13px; color: #b6bdcb; }
