
:root{
  --ink:#211d18;
  --ink-2:#4d4338;
  --muted:#7a6b5d;
  --paper:#f3eadb;
  --surface:#fffaf1;
  --surface-2:#f5ecdd;
  --line:#ded0bc;
  --line-strong:#cbb99f;
  --navy:#244d63;
  --navy-2:#183c4d;
  --teal:#a84d28;
  --teal-dark:#87391d;
  --teal-soft:#f3dfc7;
  --amber:#b07a12;
  --amber-soft:#f6e3ac;
  --danger:#9a3535;
  --danger-soft:#fdecec;
  --success:#68711f;
  --radius-xl:28px;
  --radius-lg:20px;
  --radius-md:14px;
  --radius-sm:10px;
  --shadow-sm:0 2px 0 rgba(52,39,27,.08),0 10px 22px rgba(76,54,30,.07);
  --shadow-md:0 18px 40px rgba(76,54,30,.12);
  --focus:0 0 0 4px rgba(168,77,40,.16);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  color:var(--ink);
  background:
    radial-gradient(circle at 12% -8%,rgba(212,137,24,.16),transparent 26rem),
    radial-gradient(circle at 92% 6%,rgba(36,77,99,.12),transparent 24rem),
    linear-gradient(180deg,#f7efe2 0,#efe4d2 100%);
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}
button,input,textarea,select{font:inherit}
button{cursor:pointer}
button:disabled{cursor:not-allowed;opacity:.48}
.hidden{display:none!important}

.topbar{
  position:sticky;
  top:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px;
  min-height:82px;
  padding:16px clamp(18px,4vw,42px);
  color:#fff;
  background:rgba(34,31,26,.96);
  border-bottom:1px solid rgba(255,255,255,.09);
  box-shadow:0 8px 28px rgba(10,28,44,.16);
  backdrop-filter:blur(16px);
}
.topbar h1{
  margin:2px 0 0;
  font-size:clamp(1.05rem,2vw,1.35rem);
  line-height:1.15;
  letter-spacing:-.02em;
}
.eyebrow{
  margin:0;
  color:var(--teal);
  font-size:.68rem;
  line-height:1.2;
  font-weight:850;
  letter-spacing:.14em;
  text-transform:uppercase;
}
.topbar .eyebrow{color:#8fe0da}
.version-badge{
  display:inline-flex;
  align-items:center;
  margin-top:8px;
  padding:4px 9px;
  border:1px solid rgba(143,224,218,.28);
  border-radius:999px;
  color:#bcefea;
  background:rgba(143,224,218,.10);
  font-size:.68rem;
  font-weight:800;
}
.top-actions,.run-row,.sidebar-actions,.output-actions{
  display:flex;
  align-items:center;
  gap:10px;
}

main{
  width:min(1480px,100%);
  margin:auto;
  padding:clamp(16px,3vw,32px);
}
.panel{
  overflow:hidden;
  background:rgba(255,255,255,.94);
  border:1px solid rgba(204,218,226,.82);
  border-radius:var(--radius-lg);
  box-shadow:var(--shadow-sm);
}
.hero{
  max-width:980px;
  margin:clamp(18px,4vw,40px) auto;
  padding:clamp(28px,6vw,64px);
  background:
    radial-gradient(circle at 88% 16%,#d58b18 0 52px,transparent 53px),
    radial-gradient(circle at 78% 35%,#244d63 0 34px,transparent 35px),
    linear-gradient(145deg,#fff9ef,#f3e6d4);
}
.hero h2{
  max-width:760px;
  margin:10px 0 16px;
  color:var(--navy);
  font-size:clamp(2rem,6vw,4rem);
  line-height:.98;
  letter-spacing:-.055em;
}
.kicker{color:var(--teal);font-weight:850}
.subtle{color:var(--muted);line-height:1.68}

.form-grid,.state-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:16px;
  margin:28px 0;
}
label{
  display:flex;
  flex-direction:column;
  gap:8px;
  color:var(--ink-2);
  font-size:.79rem;
  font-weight:780;
  letter-spacing:.01em;
}
textarea,input,select{
  width:100%;
  min-height:46px;
  padding:12px 14px;
  color:var(--ink);
  background:var(--surface);
  border:1px solid var(--line-strong);
  border-radius:12px;
  box-shadow:inset 0 1px 2px rgba(23,45,70,.03);
  transition:border-color .18s ease,box-shadow .18s ease,background .18s ease;
}
textarea{resize:vertical;line-height:1.55}
textarea:hover,input:hover,select:hover{border-color:#aebfc9}
textarea:focus,input:focus,select:focus{
  outline:none;
  border-color:var(--teal);
  box-shadow:var(--focus);
}
.primary,.ghost{
  min-height:44px;
  padding:10px 16px;
  border-radius:12px;
  font-weight:820;
  transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease;
}
.primary{
  color:#fff;
  background:linear-gradient(180deg,#ba5a2e,#9d431f);
  border:1px solid #8f3c1c;
  box-shadow:0 7px 16px rgba(168,77,40,.20);
}
.primary:hover{transform:translateY(-1px);box-shadow:0 10px 22px rgba(168,77,40,.25)}
.primary:active{transform:translateY(0)}
.ghost{
  color:var(--ink-2);
  background:rgba(255,255,255,.72);
  border:1px solid var(--line-strong);
}
.ghost:hover{background:#fff;border-color:#aabac5}
.topbar .ghost{color:#fff;background:rgba(255,255,255,.04);border-color:rgba(255,255,255,.22)}
.topbar .ghost:hover{background:rgba(255,255,255,.10)}
.large{min-height:50px;padding:13px 22px}
.file-label input{display:none}
.scope-note{
  padding:14px 16px;
  color:#245c5b;
  background:var(--teal-soft);
  border:1px solid #cde9e5;
  border-radius:12px;
}

.workspace-grid{
  display:grid;
  grid-template-columns:minmax(280px,330px) minmax(0,1fr);
  gap:20px;
}
.sidebar{
  position:sticky;
  top:102px;
  height:calc(100vh - 126px);
  overflow:auto;
  padding:22px;
  scrollbar-width:thin;
}
.project-id{
  display:flex;
  gap:13px;
  align-items:flex-start;
}
.project-id h2{
  margin:4px 0 2px;
  color:var(--navy);
  font-size:1.18rem;
  line-height:1.2;
  letter-spacing:-.02em;
}
.status-dot{
  width:10px;
  height:10px;
  flex:0 0 auto;
  margin-top:7px;
  background:var(--teal);
  border-radius:50%;
  box-shadow:0 0 0 5px var(--teal-soft);
}
.stage-summary{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin:20px 0 14px;
  padding:14px 15px;
  color:#fff;
  background:
    linear-gradient(135deg,var(--navy) 0 72%,#d58b18 72% 82%,#9d431f 82% 100%);
  border-radius:14px;
  box-shadow:0 10px 24px rgba(23,45,70,.15);
}
.stage-summary span{
  opacity:.68;
  font-size:.66rem;
  font-weight:800;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.stage-summary strong{font-size:.9rem}
.lifeline{display:flex;flex-direction:column}
.stage-node{
  position:relative;
  display:grid;
  grid-template-columns:32px minmax(0,1fr);
  gap:11px;
  width:100%;
  padding:8px 6px;
  color:var(--muted);
  background:transparent;
  border:0;
  border-radius:12px;
  text-align:left;
  touch-action:manipulation;
}
.stage-node:hover{background:var(--surface-2)}
.stage-node *{pointer-events:none}
.stage-node:before{
  content:"";
  position:absolute;
  left:21px;
  top:38px;
  bottom:-8px;
  width:1.5px;
  background:var(--line);
}
.stage-node:last-child:before{display:none}
.node-num{
  display:grid;
  place-items:center;
  width:32px;
  height:32px;
  color:#6f7c90;
  background:#fff;
  border:1.5px solid var(--line-strong);
  border-radius:50%;
  font-size:.78rem;
  font-weight:850;
}
.stage-node strong{
  display:block;
  margin-top:1px;
  color:var(--ink-2);
  font-size:.84rem;
  line-height:1.25;
}
.stage-node small{font-size:.69rem;line-height:1.25}
.stage-node.complete .node-num{color:#fff;background:var(--navy);border-color:var(--navy)}
.stage-node.current{background:var(--teal-soft)}
.stage-node.current .node-num{
  color:#fff!important;
  background:var(--teal)!important;
  border-color:var(--teal)!important;
  box-shadow:0 0 0 4px rgba(24,141,139,.13);
}
.stage-node.current strong,.stage-node.current small{color:var(--teal-dark)}
.stage-node.blocked,.stage-node.skipped{opacity:.56}
.stage-node.skipped .node-num{background:#f4f6f7;border-style:dashed}
.stage-node.pending-review .node-num{color:#805d18;background:var(--amber-soft);border-color:#d7a84e}

.lifeline-legend{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  margin-top:14px;
  padding:12px;
  color:var(--muted);
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:12px;
  font-size:.67rem;
}
.lifeline-legend span{display:flex;align-items:center;gap:7px}
.legend-dot{
  display:inline-block;
  width:9px;
  height:9px;
  border:1.5px solid var(--line-strong);
  border-radius:50%;
}
.legend-dot.complete{background:var(--navy);border-color:var(--navy)}
.legend-dot.current{background:var(--teal);border-color:var(--teal)}
.legend-dot.skipped{background:#f3f5f7;border-style:dashed}
.legend-dot.available{background:#fff}
.sidebar-actions{flex-direction:column;margin-top:18px}
.sidebar-actions button,#openRecommendedBtn{width:100%}

.content{display:flex;flex-direction:column;gap:15px}
.navigator-card,.tab-panel{padding:clamp(18px,3vw,28px)}
.navigator-card{
  background:
    radial-gradient(circle at 92% 10%,rgba(213,139,24,.14),transparent 12rem),
    linear-gradient(180deg,rgba(255,250,241,.98),rgba(248,239,224,.98));
}
.section-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
  margin-bottom:18px;
}
.section-heading h2{
  margin:4px 0 0;
  color:var(--navy);
  font-size:clamp(1.25rem,2vw,1.65rem);
  letter-spacing:-.03em;
}
.badge{
  display:inline-flex;
  align-items:center;
  min-height:34px;
  padding:7px 11px;
  color:#557085;
  background:#eff4f6;
  border:1px solid #dde7eb;
  border-radius:999px;
  font-size:.72rem;
  font-weight:820;
  white-space:nowrap;
}
.recommendation-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}
.recommendation-grid>div{
  padding:16px;
  background:rgba(248,250,251,.72);
  border:1px solid var(--line);
  border-radius:14px;
}
.recommendation-grid p{margin:6px 0 0;line-height:1.55}
.wide{grid-column:1/-1}
.label{
  color:var(--teal-dark);
  font-size:.66rem;
  font-weight:860;
  letter-spacing:.10em;
  text-transform:uppercase;
}
.warning-box{
  background:var(--amber-soft)!important;
  border-color:#eed7ae!important;
}

.tabs{
  position:sticky;
  top:92px;
  z-index:15;
  display:flex;
  gap:7px;
  padding:7px;
  overflow-x:auto;
  background:rgba(244,247,249,.88);
  border:1px solid rgba(213,224,230,.82);
  border-radius:16px;
  backdrop-filter:blur(14px);
  scrollbar-width:none;
}
.tabs::-webkit-scrollbar{display:none}
.tab{
  flex:0 0 auto;
  min-height:40px;
  padding:8px 14px;
  color:var(--muted);
  background:transparent;
  border:0;
  border-radius:11px;
  font-size:.79rem;
  font-weight:780;
}
.tab:hover{color:var(--ink);background:#fff}
.tab.active{
  color:#fff;
  background:var(--navy);
  box-shadow:0 7px 16px rgba(23,45,70,.16);
}

.status-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
}
.stage-purpose{
  margin:0 0 18px;
  padding:14px 16px;
  color:#245c5b;
  background:var(--teal-soft);
  border:1px solid #cde9e5;
  border-radius:12px;
  line-height:1.6;
}
details{
  margin:16px 0;
  padding:12px 14px;
  background:var(--surface-2);
  border:1px solid var(--line);
  border-radius:12px;
}
summary{cursor:pointer;color:var(--navy);font-size:.82rem;font-weight:780}
details textarea{margin-top:12px}
.run-row{align-items:stretch;margin-top:14px}
.run-row select{flex:1}
.run-row button{min-width:130px}
.run-status{
  margin:14px 0;
  padding:12px 14px;
  color:#245c5b;
  background:var(--teal-soft);
  border:1px solid #cde9e5;
  border-radius:12px;
  font-size:.82rem;
  font-weight:760;
}
.run-status.error{color:var(--danger);background:var(--danger-soft);border-color:#f2cece}
.output{
  min-height:190px;
  margin:14px 0 0;
  padding:19px;
  overflow:auto;
  white-space:pre-wrap;
  color:#dff7f3;
  background:linear-gradient(145deg,#13293f,#0d1d2e);
  border:1px solid #24445f;
  border-radius:14px;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.05);
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;
  font-size:.82rem;
  line-height:1.62;
}
.output-actions{margin-top:12px}
.output-actions button{flex:1;min-width:180px}

.stage8-result-panel,.stage9-result-panel{
  position:relative;
  margin:0 0 18px;
  padding:18px;
  background:linear-gradient(180deg,#f0faf8,#fff);
  border:1px solid #bfe3de;
  border-radius:16px;
  box-shadow:0 10px 26px rgba(24,141,139,.08);
}
.stage8-result-panel::before,.stage9-result-panel::before{
  display:inline-flex;
  margin-bottom:9px;
  padding:5px 9px;
  color:#fff;
  background:var(--navy);
  border-radius:999px;
  font-size:.65rem;
  font-weight:840;
  letter-spacing:.04em;
}
.stage8-result-panel::before{content:"Required before Stage 9"}
.stage9-result-panel::before{content:"Required before Stage 10"}
.stage8-result-panel h3,.stage9-result-panel h3{
  margin:3px 0 7px;
  color:var(--navy);
  font-size:1.1rem;
}
.stage8-result-panel label,.stage9-result-panel label{margin-top:12px}
.stage8-result-panel button,.stage9-result-panel button{width:100%;margin-top:13px}

.brief-content{display:grid;gap:12px}
.brief-point{
  padding:16px 18px;
  background:linear-gradient(90deg,var(--teal-soft),#fff 22%);
  border:1px solid var(--line);
  border-left:4px solid var(--teal);
  border-radius:13px;
}
.brief-point h3{
  margin:0 0 6px;
  color:var(--navy);
  font-size:.96rem;
}
.brief-point p{margin:0;color:var(--ink-2);line-height:1.6}
.table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:14px;
}
table{width:100%;border-collapse:collapse;background:#fff}
th,td{
  padding:12px 14px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
  font-size:.8rem;
}
tr:last-child td{border-bottom:0}
th{
  color:var(--ink-2);
  background:var(--surface-2);
  font-size:.65rem;
  letter-spacing:.08em;
  text-transform:uppercase;
}
td input,td select{min-width:145px}

footer{
  display:flex;
  justify-content:space-between;
  gap:16px;
  padding:18px clamp(18px,4vw,42px);
  color:var(--muted);
  font-size:.72rem;
}

@media(max-width:980px){
  .workspace-grid{grid-template-columns:1fr}
  .sidebar{position:static;height:auto}
  .lifeline{
    display:grid;
    grid-template-columns:repeat(5,minmax(0,1fr));
    gap:8px;
  }
  .stage-node{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:6px;
    min-height:78px;
    padding:9px 6px;
    text-align:center;
    background:var(--surface-2);
    border:1px solid var(--line);
  }
  .stage-node:before{display:none}
  .stage-node strong{font-size:.71rem}
  .stage-node small{font-size:.62rem}
  .lifeline-legend{grid-template-columns:repeat(4,1fr)}
}

@media(max-width:720px){
  .topbar{
    position:relative;
    align-items:flex-start;
    flex-direction:column;
    min-height:auto;
    padding:17px 18px;
  }
  .top-actions{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    width:100%;
  }
  .top-actions .ghost,.top-actions .primary{
    min-height:42px;
    padding:8px;
    font-size:.76rem;
  }
  main{padding:12px}
  .hero{margin:12px auto;padding:24px 20px;border-radius:20px}
  .hero h2{font-size:2.35rem}
  .form-grid,.state-grid,.status-grid,.recommendation-grid{grid-template-columns:1fr}
  .wide{grid-column:auto}
  .workspace-grid{gap:12px}
  .sidebar,.navigator-card,.tab-panel{padding:17px}
  .tabs{
    position:sticky;
    top:8px;
    border-radius:14px;
  }
  .tab{padding:8px 11px;font-size:.72rem}
  .section-heading{align-items:flex-start}
  .badge{white-space:normal;text-align:center}
  .lifeline{grid-template-columns:repeat(2,minmax(0,1fr))}
  .lifeline-legend{grid-template-columns:repeat(2,1fr)}
  .run-row,.output-actions{flex-direction:column}
  .run-row button,.output-actions button{width:100%;min-width:0}
  footer{flex-direction:column;padding:16px 18px}
}

@media(prefers-reduced-motion:reduce){
  *{scroll-behavior:auto!important;transition:none!important}
}


/* Bauhaus / 70s refinement */
body{
  letter-spacing:-.005em;
}
h1,h2,h3,strong,.primary,.ghost,.tab,.stage-node{
  font-family:"Avenir Next","Futura","Trebuchet MS",Inter,ui-sans-serif,system-ui,sans-serif;
}
.topbar{
  border-bottom:3px solid #d58b18;
}
.topbar::after{
  content:"";
  position:absolute;
  right:22px;
  bottom:-8px;
  width:54px;
  height:16px;
  background:#9d431f;
  border-radius:999px;
}
.panel{
  border-width:1.5px;
}
.hero{
  position:relative;
  border:2px solid #2f2a23;
}
.hero::before{
  content:"";
  position:absolute;
  left:24px;
  bottom:24px;
  width:68px;
  height:18px;
  background:#68711f;
  border-radius:999px;
}
.hero::after{
  content:"";
  position:absolute;
  left:102px;
  bottom:20px;
  width:26px;
  height:26px;
  background:#a84d28;
  border-radius:50%;
}
.hero h2{
  max-width:720px;
  text-transform:none;
}
.eyebrow{
  color:#9d431f;
}
.version-badge{
  border-color:rgba(213,139,24,.45);
  color:#f6d791;
  background:rgba(213,139,24,.12);
}
.status-dot{
  background:#d58b18;
  box-shadow:0 0 0 5px #f3dfc7;
}
.stage-node.current{
  background:#f3dfc7;
  outline:2px solid #a84d28;
  outline-offset:-2px;
}
.stage-node.current .node-num{
  background:#a84d28!important;
  border-color:#a84d28!important;
  box-shadow:0 0 0 4px rgba(168,77,40,.13);
}
.stage-node.complete .node-num{
  background:#244d63;
  border-color:#244d63;
}
.recommendation-grid>div,
.brief-point,
.stage8-result-panel,
.stage9-result-panel{
  border-radius:8px;
}
.tabs{
  border-radius:10px;
}
.tab.active{
  background:#244d63;
}
.badge{
  color:#5b4a37;
  background:#efe0c8;
  border-color:#dbc5a5;
}
.output{
  color:#f5ead6;
  background:
    linear-gradient(135deg,#1f2526,#17252e 72%,#4b2f23);
  border-color:#6e5746;
}
.brief-point{
  background:linear-gradient(90deg,#f0d9b8,#fffaf1 28%);
  border-left-color:#a84d28;
}
.stage8-result-panel,.stage9-result-panel{
  background:linear-gradient(180deg,#f8ead8,#fffaf1);
  border-color:#dfbd91;
}
.stage8-result-panel::before,.stage9-result-panel::before{
  background:#244d63;
}
.scope-note,.stage-purpose,.run-status{
  color:#5d4028;
  background:#f2dfc6;
  border-color:#dec09a;
}
.warning-box{
  background:#f4dfaa!important;
  border-color:#d2aa54!important;
}
.primary{
  border-radius:8px;
}
.ghost{
  border-radius:8px;
}
textarea,input,select{
  border-radius:8px;
}
@media(max-width:720px){
  .hero::before,.hero::after{display:none}
  .topbar::after{right:14px}
}


.brand-lockup h1{
  margin:2px 0 3px;
}
.brand-subline{
  display:flex;
  align-items:center;
  gap:10px;
  color:#f1e5cf;
  font-size:.82rem;
  font-weight:760;
}
.brand-subline .version-badge{
  margin-top:0;
}
#recommendedMovement{
  scroll-margin-top:16px;
}
#stageTab{
  scroll-margin-top:16px;
}


.toolkit-card-title{
  margin:3px 0 2px!important;
  color:var(--navy)!important;
  font-size:1.34rem!important;
  line-height:1.08!important;
  letter-spacing:-.035em!important;
}
.project-name-display{
  margin:9px 0 1px;
  color:var(--ink-2);
  font-size:.9rem;
  font-weight:780;
  line-height:1.35;
}


.inline-project-name-label{
  margin-top:10px;
  color:var(--muted);
  font-size:.66rem;
  font-weight:820;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.project-name-inline{
  width:100%;
  min-height:42px;
  margin-top:5px;
  padding:7px 9px;
  color:var(--ink-2);
  background:rgba(255,250,241,.72);
  border:1px dashed transparent;
  border-radius:7px;
  font-size:1rem;
  font-weight:800;
  line-height:1.25;
}
.project-name-inline:hover{
  border-color:var(--line-strong);
  background:#fffaf1;
}
.project-name-inline:focus{
  background:#fffaf1;
  border-color:#a84d28;
  border-style:solid;
  box-shadow:var(--focus);
  outline:none;
}


.stage-finding-panel{margin-top:14px;padding:17px;background:linear-gradient(135deg,#f5e3c8,#fffaf1 72%);border:1px solid #d8b990;border-left:5px solid #a84d28;border-radius:9px}
.finding-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:10px}
.finding-heading h3{margin:3px 0 0;color:var(--navy);font-size:1rem}
.finding-status{display:inline-flex;padding:5px 8px;color:#5a4938;background:#efe0c8;border:1px solid #dbc5a5;border-radius:999px;font-size:.63rem;font-weight:820;white-space:nowrap}
.stage-finding-panel textarea{background:#fffaf1}
.stage-finding-panel button{width:100%;margin-top:10px}


.how-it-works{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin:26px 0 22px;
}
.how-it-works article{
  padding:15px;
  background:rgba(255,250,241,.78);
  border:1px solid var(--line);
  border-radius:9px;
}
.how-it-works article>span{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  margin-bottom:10px;
  color:#fff;
  background:var(--navy);
  border-radius:50%;
  font-weight:850;
}
.how-it-works strong{
  display:block;
  color:var(--navy);
  font-size:.88rem;
}
.how-it-works p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:.75rem;
  line-height:1.5;
}
.stage-guide-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px;
  margin:0 0 18px;
}
.stage-guide-grid article{
  padding:14px;
  background:#f7eddf;
  border:1px solid var(--line);
  border-top:4px solid var(--navy);
  border-radius:8px;
}
.stage-guide-grid article:nth-child(2){border-top-color:#d58b18}
.stage-guide-grid article:nth-child(3){border-top-color:#a84d28}
.stage-guide-grid span{
  color:var(--ink-2);
  font-size:.66rem;
  font-weight:850;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.stage-guide-grid p{
  margin:7px 0 0;
  color:var(--ink-2);
  font-size:.78rem;
  line-height:1.55;
}
.manual-result-panel{
  margin-top:14px;
  background:#f7eddf;
  border-color:#d7c4a9;
}
.manual-result-panel summary{
  color:var(--navy);
  font-weight:850;
}
.manual-result-panel button{
  width:100%;
  margin-top:10px;
}
@media(max-width:900px){
  .how-it-works{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:720px){
  .how-it-works,.stage-guide-grid{grid-template-columns:1fr}
}


.optional-note{
  color:var(--muted);
  font-size:.7rem;
  font-weight:650;
  text-transform:none;
  letter-spacing:0;
}
.primary-start-grid{
  grid-template-columns:1fr;
  margin-bottom:14px;
}
.optional-setup{
  margin:10px 0 18px;
  padding:12px 14px;
  background:rgba(255,250,241,.66);
  border:1px solid var(--line);
  border-radius:9px;
}
.optional-setup summary{
  color:var(--navy);
  font-weight:850;
}
.optional-setup .optional-grid{
  margin:14px 0 0;
}
.hero{
  padding-top:36px;
}
.hero h2{
  max-width:680px;
  font-size:clamp(2.2rem,7vw,4.5rem);
}
@media(max-width:720px){
  .hero{
    padding:24px 18px 20px;
  }
  .hero h2{
    font-size:2.6rem;
  }
}


.portfolio-panel{
  width:min(1120px,100%);
  margin:0 auto;
  padding:clamp(16px,3vw,32px);
}
.portfolio-shell{padding:clamp(20px,4vw,34px)}
.portfolio-summary{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:12px;
  margin:18px 0 22px;
}
.portfolio-summary article{
  padding:16px;
  background:#f7eddf;
  border:1px solid var(--line);
  border-radius:8px;
}
.portfolio-summary span{
  display:block;
  color:var(--muted);
  font-size:.7rem;
  font-weight:800;
  letter-spacing:.06em;
  text-transform:uppercase;
}
.portfolio-summary strong{
  display:block;
  margin-top:5px;
  color:var(--navy);
  font-size:1.7rem;
}
.portfolio-list{display:grid;gap:12px}
.portfolio-card{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:18px;
  background:#fffaf1;
  border:1px solid var(--line);
  border-left:5px solid var(--teal);
  border-radius:9px;
}
.portfolio-card h3{margin:4px 0 5px;color:var(--navy)}
.portfolio-card p{margin:5px 0 0;color:var(--ink-2)}
.portfolio-meta{color:var(--muted)!important;font-size:.78rem;font-weight:750}
.portfolio-card-actions{
  display:flex;
  flex-direction:column;
  gap:8px;
  min-width:110px;
}
.portfolio-empty{
  padding:24px;
  color:var(--muted);
  background:#f7eddf;
  border:1px dashed var(--line-strong);
  border-radius:8px;
  text-align:center;
}
@media(max-width:720px){
  .portfolio-summary{grid-template-columns:1fr}
  .portfolio-card{flex-direction:column}
  .portfolio-card-actions{flex-direction:row}
  .portfolio-card-actions button{flex:1}
}


.portfolio-heading-actions{
  display:flex;
  gap:9px;
  flex-wrap:wrap;
}
.portfolio-manager-card{
  margin:0 0 20px;
  padding:18px;
  background:linear-gradient(135deg,#f3dfc7,#fffaf1 68%);
  border:1px solid #d8b990;
  border-left:5px solid var(--teal);
  border-radius:9px;
}
.portfolio-manager-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  margin-top:12px;
}
.portfolio-manager-grid article{
  padding:13px;
  background:rgba(255,250,241,.84);
  border:1px solid var(--line);
  border-radius:7px;
}
.portfolio-manager-grid span{
  display:block;
  color:var(--muted);
  font-size:.65rem;
  font-weight:850;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.portfolio-manager-grid strong,
.portfolio-manager-grid p{
  display:block;
  margin:5px 0 0;
  color:var(--ink-2);
  line-height:1.45;
}
@media(max-width:720px){
  .portfolio-manager-grid{grid-template-columns:1fr}
  .portfolio-heading-actions{width:100%}
  .portfolio-heading-actions button{flex:1}
}

.analysis-result{margin-top:18px;padding:20px;background:#f4e7d3;border:1px solid #d2b58e;border-left:6px solid #b34d26;border-radius:14px;box-shadow:0 12px 28px rgba(70,44,23,.08)}
.analysis-heading{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-bottom:14px}
.analysis-heading h3{margin:3px 0 0;color:#233d45;font-size:1.45rem}
.analysis-evidence-badge{max-width:190px;padding:8px 10px;border-radius:999px;background:#e8d3b7;color:#70452b;font-size:.68rem;font-weight:850;line-height:1.2;text-align:center;text-transform:uppercase;letter-spacing:.04em}
.analysis-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}
.analysis-card-grid article{min-height:112px;padding:15px;background:#fff9ef;border:1px solid #dcc6a7;border-radius:11px}
.analysis-card-grid span{display:block;margin-bottom:7px;color:#9c4124;font-size:.72rem;font-weight:900;letter-spacing:.06em;text-transform:uppercase}
.analysis-card-grid p{margin:0;color:#302a25;font-size:1rem;line-height:1.5}
.analysis-card-grid .analysis-next{background:#f0c27b;border-color:#c47b2c}
.full-analysis-panel,.advanced-ai-panel{margin-top:14px;padding:0;background:#fff9ef;border:1px solid #d7bea0;border-radius:11px;overflow:hidden}
.full-analysis-panel summary,.advanced-ai-panel summary{padding:15px 16px;color:#285666;font-weight:850;cursor:pointer}
.full-analysis-text{margin:0;padding:17px;max-height:440px;overflow:auto;white-space:pre-wrap;background:#fffaf2;color:#302a25;border:0;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.88rem;line-height:1.55}
.advanced-ai-panel>*:not(summary){margin-left:15px;margin-right:15px}
.advanced-ai-panel textarea{width:calc(100% - 30px)}
.advanced-ai-panel .primary{margin-bottom:15px}
.advanced-actions{display:flex;gap:9px;flex-wrap:wrap}
.output-actions{margin-top:14px;padding:16px;background:#efe1cc;border-radius:12px}
.output-actions .primary{width:100%}
.action-hint{text-align:center;margin:9px 0 0!important}

.constellation-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:16px;margin:20px 0}
.constellation-panel,.constellation-detail{background:#ead8bd;border:1px solid #cda77d;border-radius:16px}
.constellation-panel{padding:16px}
.constellation-toolbar{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:12px}
.constellation-toolbar h3{margin:3px 0 0;color:#243f48;font-size:1.45rem}
.compact{padding:8px 11px!important}
.constellation-viewport{width:100%;overflow:hidden;border-radius:14px;background:#171917}
#portfolioConstellation{display:block;width:100%;min-height:480px;touch-action:manipulation}
.constellation-bg{fill:#171917}
.constellation-line{stroke:#bc8548;stroke-width:2.4;stroke-opacity:.48}
.orb-group{cursor:pointer}
.orb-halo{fill:#d98f39;opacity:.09}
.project-orb:hover .orb-halo,.project-orb:focus .orb-halo{opacity:.22}
.selected-orb{stroke:#fff4c9;stroke-width:6}
.orb-label{fill:#fff7de;font-family:Arial Black,Arial,sans-serif;font-weight:900;letter-spacing:.015em;pointer-events:none}
.core-label{font-size:28px}
.orb-sub-label{fill:#2b2822;font-family:Arial Black,Arial,sans-serif;font-size:20px;font-weight:900}
.project-label{font-size:28px;paint-order:stroke;stroke:#263b40;stroke-width:5px;stroke-linejoin:round}
.orb-stage-label{fill:#fff0c8;font-family:Arial,sans-serif;font-size:15px;font-weight:850;letter-spacing:.08em}
.constellation-empty-label{fill:#e8d6b9;font-size:28px;font-weight:750}
.constellation-help{margin:11px 2px 0;color:#5f5145;font-size:.82rem;line-height:1.45}
.constellation-detail{padding:18px;align-self:stretch}
.constellation-detail h3{margin:5px 0 7px;color:#253f47;font-size:1.65rem}
.constellation-status{color:#8e492d;font-weight:750}
.constellation-facts{display:grid;gap:10px;margin:18px 0}
.constellation-facts div{padding:12px;background:#fff7ea;border:1px solid #d7b991;border-radius:9px}
.constellation-facts span{display:block;color:#8f4a2c;font-size:.67rem;font-weight:900;letter-spacing:.06em;text-transform:uppercase}
.constellation-facts strong,.constellation-facts p{display:block;margin:5px 0 0;color:#302a25;line-height:1.4}
.app-toast{position:fixed;z-index:9999;left:50%;top:18px;transform:translateX(-50%);width:min(92vw,520px);padding:14px 18px;background:#244f59;color:#fff7df;border:2px solid #d89a42;border-radius:999px;box-shadow:0 12px 35px rgba(0,0,0,.25);text-align:center;font-weight:850}
@media(max-width:850px){.constellation-layout{grid-template-columns:1fr}.constellation-detail{min-height:0}}
@media(max-width:650px){.analysis-card-grid{grid-template-columns:1fr}.analysis-card-grid article{min-height:0}.analysis-heading{flex-direction:column}#portfolioConstellation{min-height:420px}.project-label{font-size:31px}.constellation-toolbar{align-items:center}}


/* v1.0.21 — iPhone form zoom prevention */
input,
textarea,
select,
button {
  font-size: 16px;
}

@media (max-width: 720px) {
  input,
  textarea,
  select {
    font-size: 16px !important;
    line-height: 1.45;
  }

  .primary-start-grid input,
  .primary-start-grid textarea,
  .primary-start-grid select,
  #stageInput,
  #promptEditor,
  #manualOutputInput,
  #stageFindingInput,
  #stage8ResultNotes,
  #stage9ResultNotes {
    font-size: 16px !important;
  }
}


/* v1.0.23 — navigable constellation */
#portfolioConstellation.constellation-shift .project-orb,
#portfolioConstellation.constellation-shift .portfolio-core,
#portfolioConstellation.constellation-shift .constellation-line {
  animation: constellation-arrive .42s ease-out both;
}

@keyframes constellation-arrive {
  from {
    opacity: .28;
    transform: scale(.94);
    transform-origin: center;
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.focused-project-orb .orb-halo {
  opacity: .32;
}

.focused-project-label {
  font-size: 38px;
  stroke-width: 7px;
}

.focused-stage-label {
  font-size: 18px;
}

.selected-line {
  stroke: #f0b65a;
  stroke-width: 4;
  stroke-opacity: .82;
}

.constellation-project-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap: 8px;
  align-items: stretch;
}

.constellation-project-actions button {
  min-width: 0;
}

@media(max-width:650px){
  .constellation-project-actions {
    grid-template-columns: 1fr 1fr;
  }

  .constellation-project-actions #openConstellationProjectBtn {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .focused-project-label {
    font-size: 41px;
  }
}
