:root{font:15px system-ui,sans-serif;color:#273746;background:#f4f6f5;--brand-ink:#14283f;--line:#d7dfe3;--muted:#526575}*{box-sizing:border-box}body{margin:0;display:grid;grid-template-columns:238px minmax(0,1fr);min-height:100vh}aside{background:#14283f;color:#f4f6f5;padding:28px 18px;display:flex;flex-direction:column;gap:22px}.brand{margin:0 8px}.brand img{display:block;width:100%;max-width:202px;height:auto}.eyebrow,header>div:first-child,.nav-group{display:block;font-size:10px;letter-spacing:.13em;font-weight:750}.nav-group{color:#b0c4d5;margin:17px 9px 5px}.rail nav button{width:100%;text-align:left;color:#e4edf3;background:transparent;border:0;padding:8px 10px}.rail nav button:hover,.rail nav button[aria-current=page]{background:#244058;color:#00f5d4}.local{font-size:12px;color:#00f5d4;margin-top:auto;padding:10px}main{min-width:0}header{min-height:70px;border-bottom:1px solid var(--line);padding:15px 4%;display:flex;justify-content:space-between;align-items:center;gap:12px;background:#fff}header b{margin:0 8px;color:#82998b}.project,.actions{display:flex;gap:8px;flex-wrap:wrap}button,select,input,textarea{font:inherit;border:1px solid var(--line);border-radius:7px;padding:8px 11px;background:white;color:inherit}button{cursor:pointer;font-weight:650}button:hover{border-color:var(--brand-ink)}button:disabled{opacity:.5;cursor:default}.primary{color:white;background:var(--brand-ink);border-color:var(--brand-ink)}#view{padding:30px 4%;max-width:1400px;margin:auto}.hero{background:#14283f;color:#f4f6f5;border-radius:16px;padding:28px;margin-bottom:20px}.eyebrow{color:#526575}.hero .eyebrow{color:#00f5d4}h1{font-size:clamp(26px,4vw,46px);letter-spacing:-.045em;margin:7px 0 10px}h2{font-size:18px;margin:0 0 12px}p{line-height:1.55;margin:7px 0 14px}.cards,.flow{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:12px;margin-bottom:20px}.card,.panel{padding:17px;border:1px solid var(--line);background:white;border-radius:11px}.card strong{display:block;font-size:25px;margin-top:7px}.card span,.muted,small{color:var(--muted)}.flow button{text-align:left;padding:13px}.flow small{display:block;margin-bottom:4px}.panel{margin-bottom:15px;overflow:auto}.section-head{display:flex;justify-content:space-between;gap:12px;align-items:start;margin-bottom:16px}.section-head h2{margin:5px 0}table{width:100%;border-collapse:collapse;text-align:left;font-size:14px}th,td{padding:11px;border-bottom:1px solid var(--line);vertical-align:top}th{color:var(--muted);font-size:12px}.pill{display:inline-block;padding:3px 8px;border-radius:15px;background:#edf4e6;font-size:12px;white-space:nowrap}.pill[data-status=Bloqueado]{background:#fae9de;color:#833913}dialog{border:1px solid var(--line);border-radius:14px;width:min(690px,94vw);padding:20px;max-height:90vh}dialog::backdrop{background:#14283fc0}.dialog-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:13px}#fields{display:grid;grid-template-columns:1fr 1fr;gap:11px}label{display:grid;gap:4px;font-size:13px;font-weight:600}label input,label select,label textarea{width:100%;min-width:0}.wide{grid-column:1/-1}#error{color:#8d3029}a{color:var(--brand-ink)}@media(max-width:760px){body{display:block}aside{padding:12px;gap:5px}.rail nav{display:flex;overflow:auto}.rail nav button{width:auto;white-space:nowrap}.nav-group,.local{display:none}header{flex-wrap:wrap}#view{padding:16px}}

.wave{background:white;border:1px solid var(--line);border-radius:14px;padding:clamp(14px,3vw,30px)}
.wave header{padding:0;border:0;min-height:0}
.wave h1{letter-spacing:-.035em;text-transform:none}
.wave-caption{color:var(--muted);margin:14px 0}
.timeline{display:flex;overflow-x:auto;list-style:none;margin:0 0 24px;padding:0 0 8px}
.timeline li{position:relative;flex:1 0 108px;text-align:center}
.timeline li:not(:last-child)::before{content:"";position:absolute;top:19px;left:50%;width:100%;height:1px;background:var(--line)}
.timeline button{position:relative;display:grid;justify-items:center;align-content:start;gap:6px;width:100%;height:100%;padding:6px;background:transparent;border-color:transparent}
.timeline button:hover,.timeline button:focus-visible{border-color:var(--brand-ink)}
.step-marker{display:grid;place-items:center;width:26px;height:26px;border-radius:7px;background:#f4f6f5;border:1px solid var(--line)}
.timeline [aria-current=step] .step-marker{background:#00f5d4;border-color:var(--brand-ink);color:var(--brand-ink)}
.timeline small{font-size:11px}
.wave-detail{padding:16px;border:1px solid var(--line);border-radius:11px}
.wave-detail h1{font-size:24px}
.wave-actions{display:flex;justify-content:space-between;margin-top:14px}

/* Cabeçalho, trilho de módulos e painel de etapas da VG. */
body{grid-template-columns:80px minmax(0,1fr);grid-template-rows:auto 1fr;background:#f1f4f3}
.topbar{grid-column:1/-1;padding:10px 24px;min-height:64px;background:#f1f4f3;justify-content:flex-start}
.topbar .brand{margin:0;width:82px;flex:none}
.topbar .brand img{border-radius:8px}
.topbar-label{font-weight:650;color:var(--brand-ink)}
.topbar .local{margin:0 0 0 auto;color:var(--muted);padding:0}
.topbar .project{flex-wrap:nowrap;align-items:center;min-width:0}
.project select{max-width:min(42vw,300px)}
#create{width:38px;height:38px;border-radius:50%;font-size:20px;padding:0}
.rail{align-self:start;position:sticky;top:16px;margin:38px 0 0 16px;width:52px;padding:6px;border-radius:16px;box-shadow:0 4px 12px #14283f24}
.rail nav{display:grid;gap:4px}
.rail button{display:grid;place-items:center;width:40px;height:40px;padding:0;border-radius:10px}
.rail button[aria-current=page]{background:#00f5d4;color:var(--brand-ink)}
#view{padding:12px 24px 32px 8px;max-width:1800px}
.breadcrumb{font-size:13px;color:var(--muted);margin:0}
.breadcrumb span{margin:0 5px}
.page-heading h1{font-size:30px;letter-spacing:-.025em}
.wave{padding:clamp(14px,2vw,26px);border-radius:12px}
.wave-summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:14px;background:#f1f4f3;border-radius:8px}
.wave-summary small{display:block;margin-top:4px}
.step-marker{width:20px;height:20px;font-size:11px;border-radius:5px;background:white}
.timeline li:not(:last-child)::before{top:16px}
.timeline button{gap:9px}
.timeline button strong{font-size:13px}
.step-marker[data-done=true]{background:var(--brand-ink);color:white}
.wave-actions button{border:0;border-bottom:2px solid #00f5d4;border-radius:0;padding:6px 0;color:var(--brand-ink)}
#document-upload,#document-search{display:flex;align-items:end;gap:8px;flex-wrap:wrap}
.document-category{border-top:1px solid var(--line);padding:10px 0}
.document-category summary{cursor:pointer}
.document-category[open]>summary{font-weight:650}
@media(max-width:760px){
 .topbar{padding:8px 12px}
 .topbar-label,.topbar .local{display:none}
 .topbar .project{margin-left:auto}
 .rail{position:static;margin:10px 12px;width:auto}
 .rail nav{display:flex}
 .rail button{flex:0 0 40px}
 #view{padding:6px 12px 20px}
 .wave-summary{flex-wrap:wrap}
}

.top-tools{margin-left:auto;display:flex;align-items:center;gap:8px;min-width:0}
.top-tools input{width:clamp(130px,26vw,390px)}
.top-link{border:0;background:transparent;color:var(--muted)}
.round{width:38px;height:38px;flex:none;display:inline-grid;place-items:center;border-radius:50%;padding:0;position:relative}
.avatar{border:2px solid #007d73;overflow:hidden}
.avatar img{width:100%;height:100%;object-fit:cover}
#alert-count{position:absolute;right:-5px;top:-5px;background:#9f202a;color:white;border-radius:12px;min-width:18px;font-size:11px;padding:2px}
#alert-list{list-style:none;padding:0}
#alert-list button{width:100%;text-align:left;margin-bottom:6px}
.portfolio-filters{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;margin-bottom:20px}
.project-card{border-top:1px solid var(--line)}
.project-card>summary{display:grid;grid-template-columns:2fr 1fr 1fr 1fr auto;gap:12px;align-items:center;padding:16px;cursor:pointer;list-style:none}
.project-card>summary::-webkit-details-marker{display:none}
.project-card summary small{display:block;margin-bottom:4px}
.project-card[open]>summary,.project-card>summary:hover{background:var(--soft,#f1f4f3)}
.project-body,.flow-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 16px}
.chevron{display:inline-block;width:9px;height:9px;border-right:2px solid currentColor;border-bottom:2px solid currentColor;transform:rotate(45deg);margin-top:-4px}
.project-card[open] .chevron,[aria-expanded=true]>.chevron{transform:rotate(225deg);margin-top:4px}
.wave-summary>div{margin-right:auto}
.timeline.vertical{display:grid;overflow:visible}
.timeline.vertical li{text-align:left}
.timeline.vertical li:not(:last-child)::before{width:1px;height:100%;left:16px;top:16px}
.timeline.vertical button{grid-template-columns:20px minmax(0,1fr) minmax(0,1fr);justify-items:start;align-items:center;min-height:42px;text-align:left}
[hidden]{display:none!important}
[data-theme=dark]{color-scheme:dark;--line:#34485c;--muted:#a8bac9;--soft:#203448;color:#e9f0f5;background:#101d2a}
[data-theme=dark] body,[data-theme=dark] .topbar{background:#101d2a}
[data-theme=dark] :is(.panel,.card,.wave,dialog,button,select,input,textarea,.step-marker){background:#182a3a;color:#e9f0f5}
[data-theme=dark] :is(.wave-summary,.pill){background:var(--soft)}
[data-theme=dark] :is(.topbar-label,a,.wave-actions button){color:#8bf3e4}
[data-theme=dark] .pill[data-status=Bloqueado]{background:#542d29;color:#ffccc1}
[data-theme=dark] :is(.primary,.rail button[aria-current=page],.timeline [aria-current=step] .step-marker){background:#00f5d4;color:#14283f}
[data-theme=dark] .step-marker[data-done=true]{background:#244d59;color:white}
@media(max-width:760px){
 .topbar .project{margin-left:0}
 .top-tools{order:3;width:100%;margin-left:0}
 .top-tools input{flex:1;width:0}
 .portfolio-filters{grid-template-columns:1fr}
 .project-card>summary{grid-template-columns:minmax(0,1fr) auto}
 .project-card>summary>span:not(:first-child){grid-column:1}
 .project-card>summary>.chevron{grid-column:2;grid-row:1}
}

/* Escala visual da tela de Reprodução usada como referência. */
:root{font-size:15px;--field-height:50px;--action-size:40px}
.topbar{min-height:72px}
.top-link,.topbar-label,.breadcrumb{font-size:14px}
.top-tools input,.topbar select{height:40px;font-size:14px}
.page-heading h1{font-size:30px;line-height:1.2}
.page-heading .muted,.project-card summary small,.timeline small{font-size:13px}
h2,.wave-detail h2{font-size:17px;line-height:1.35}
.portfolio-filters label{font-size:15px;font-weight:500}
.portfolio-filters :is(input,select){min-height:var(--field-height);font-size:15px}
.round,#create,.rail button{width:var(--action-size);height:var(--action-size)}
.project-card>summary{min-height:100px;font-size:15px}
.project-card summary strong,.timeline button strong{font-size:15px;font-weight:600}
.project-body button,.flow-toolbar button,.section-head button,#document-upload button,#document-search button{min-height:var(--action-size);font-size:14px}
.wave-actions button{min-height:var(--action-size);font-size:15px}
@media(max-width:760px){
 .topbar{min-height:64px}
 .page-heading h1{font-size:26px}
}

/* Menu flutuante da referência Fazendo. */
@media(min-width:761px){
 body{grid-template-columns:102px minmax(0,1fr)}
 main{grid-column:2}
 .rail{
  position:fixed;
  z-index:10;
  top:45%;
  left:27px;
  transform:translateY(-50%);
  margin:0;
  width:56px;
  max-height:80vh;
  padding:8px;
  border-radius:18px;
  box-shadow:3px 5px 10px #14283f40,0 1px 3px #14283f29;
 }
 .rail nav{max-height:calc(80vh - 16px);overflow-y:auto;scrollbar-width:thin}
}
.rail button:hover,.rail button:focus-visible{background:#244058;color:#e4edf3}
.rail button[aria-current=page]{background:#00f5d4;color:#14283f}

.project-toolbar{display:flex;justify-content:flex-end;padding:16px 24px 0 8px}
.project-toolbar .project{align-items:center;flex-wrap:nowrap}
.project-toolbar select{min-width:min(210px,65vw);height:40px;font-size:14px}
@media(max-width:760px){
 .project-toolbar{padding:8px 12px 0}
}

/* Densidade compacta e cabeçalho de página do Fazendo, com cores VG. */
:root{font:14px/1.5 system-ui,Arial,sans-serif;--field-height:36px;--action-size:36px;--line:#e6e8e7}
.topbar{position:sticky;top:0;z-index:20;min-height:64px}
.top-link{font-size:13px;font-weight:400}
.page-heading{position:sticky;top:64px;z-index:11;background:#f1f4f3;border-bottom:1px solid var(--line);padding:8px 0;margin-bottom:16px}
.page-heading h1{font-size:28px;line-height:1.3;margin:4px 0}
.page-heading .muted{font-size:11px;line-height:20px;margin:0}
.breadcrumb,.wave-caption,.wave-detail p{font-size:12px}
h2,.wave-detail h2{font-size:18px;font-weight:500;line-height:1.4}
.project-card summary small,.timeline small{font-size:11px;font-weight:400}
.project-card>summary,.project-card summary strong,.timeline button strong{font-size:13px}
.project-card>summary{min-height:78px}
.portfolio-filters{border-bottom:1px solid var(--line);padding-bottom:16px;margin-bottom:16px;grid-template-columns:minmax(0,1fr) minmax(0,240px) minmax(0,260px)}
.portfolio-filters label,.portfolio-filters :is(input,select),.project-toolbar select{font-size:13px}
.project-toolbar select,.topbar :is(input,select){height:var(--field-height)}
.icon-action,.project-body .icon-action,.flow-toolbar .icon-action,.section-head .icon-action,.wave-actions .icon-action,#document-upload .icon-action,#document-search .icon-action{width:var(--action-size);height:var(--action-size);min-height:var(--action-size);padding:0;border:1px solid var(--line);border-radius:50%}
.wave{padding:20px}
.wave-summary{border-radius:0;border-bottom:1px solid var(--line)}
#collapse-flow{width:26px;height:26px;background:#00f5d4;color:#14283f;border:0}
.project-card .chevron{width:7px;height:7px}
[data-theme=dark] .page-heading{background:#101d2a}
@media(max-width:839px){.page-heading{position:static}.portfolio-filters{grid-template-columns:1fr}}
@media(pointer:coarse){:root{--field-height:48px;--action-size:48px}.portfolio-filters :is(input,select),.project-toolbar select{font-size:16px}}

.stage-entry{margin-bottom:0}
.stage-entry h3{font-size:16px;font-weight:500;margin:0 0 12px}
.stage-fields,.review-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.stage-fields :is(input,select,textarea){min-height:var(--field-height);font-size:13px}
.stage-entry .actions{justify-content:flex-end}
.stage-error{color:#a62023}
.stage-error:empty{display:none}
.stage-fields{margin-bottom:12px}
@media(max-width:760px){.stage-fields,.review-fields{grid-template-columns:1fr}}

#documentos{scroll-margin-top:160px}

.training-label,.training-icon{display:inline-flex;align-items:center;gap:6px}
.training-icon{color:#007d73}
[data-theme=dark] .training-icon{color:#8bf3e4}

.brand-signature{color:var(--muted);font-size:13px;line-height:1.3}
@media(max-width:420px){.brand-signature{font-size:11px}}

.map-result:empty{display:none}
.project-map{display:block;width:100%;max-height:460px;margin:8px 0;background:#edf4f5;border:1px solid var(--line);border-radius:8px}
.project-map path,.project-map circle{stroke:#007d73;stroke-width:2;vector-effect:non-scaling-stroke}
.project-map .line{fill:none}
.project-map .area{fill:#007d7333;fill-rule:evenodd}
.project-map circle{fill:#007d73}
[data-theme=dark] .project-map{background:#152536}
[data-theme=dark] .project-map :is(path,circle){stroke:#8bf3e4}


.page-heading{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:16px}
.page-heading>.breadcrumb,.page-heading>.muted{grid-column:1/-1}
.page-heading>h1{grid-column:1;grid-row:2}
.page-heading>.project-toolbar{grid-column:2;grid-row:2;padding:0}
@media(max-width:760px){
 .page-heading{grid-template-columns:minmax(0,1fr)}
 .page-heading>.project-toolbar{grid-column:1;grid-row:4;margin-top:8px}
}

.expand-glyph{display:inline-grid;place-items:center;width:20px;height:20px;flex:none;border-radius:50%;background:#00f5d4;color:#14283f}
#collapse-flow{width:20px;height:20px;padding:0}
.project-card[open] .expand-glyph svg,#collapse-flow[aria-expanded=true] svg{transform:rotate(180deg)}
#flow-direction[aria-pressed=true] svg{transform:rotate(90deg)}
@media(max-width:760px){.project-card>summary>.expand-glyph{grid-column:2;grid-row:1}}

.document-browser{border:1px solid var(--line);border-radius:10px;margin:16px 0;overflow:hidden}
.document-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(110px,180px);gap:12px;padding:14px}
.document-breadcrumb{border-block:1px solid var(--line);padding:10px 14px;font-size:13px}
.document-columns{display:grid;grid-template-columns:minmax(135px,1fr) minmax(0,2.2fr) minmax(0,1.6fr);min-height:270px}
.document-columns h3{margin:0 0 8px;font-size:13px;font-weight:600}
.document-folders,.document-list,.document-preview{padding:12px;min-width:0}
.document-list,.document-preview{border-inline-start:1px solid var(--line)}
.document-list,.document-preview{max-height:450px;overflow:auto}
.document-folders button,.document-list button{display:grid;align-items:center;gap:8px;width:100%;text-align:left;font-size:13px;font-weight:400;padding:9px 7px;border:0;background:transparent}
.document-folders button{grid-template-columns:16px minmax(0,1fr) auto}
.document-list button{grid-template-columns:18px minmax(0,1fr) minmax(0,100px);border-top:1px solid var(--line);border-radius:0}
.document-browser button[aria-pressed=true]{background:#00f5d42a;box-shadow:inset 2px 0 #007d73}
.document-list h3{display:flex;justify-content:space-between}
.document-list small{display:block}
.document-list strong,.document-preview,.document-folders span{overflow-wrap:anywhere}
.document-excerpt{margin-top:12px;white-space:pre-wrap;font-size:12px}
@media(max-width:1050px){.document-columns{grid-template-columns:minmax(135px,1fr) minmax(0,2fr)}.document-preview{grid-column:1/-1;border-inline-start:0;border-top:1px solid var(--line)}}
@media(max-width:600px){.document-columns,.document-filters{grid-template-columns:1fr}.document-list{border-inline-start:0;border-top:1px solid var(--line)}}

:root {
  --folder-hover: #edf5f4;
  --folder-selected: #d4f6f1;
  --folder-accent: #007d73;
  --theme-track: #dce5e2;
  --theme-active: #fff;
  --theme-icon: #435a56;
}
:root[data-theme=dark] {
  --line: #394e61;
  --muted: #bdcbd7;
  --folder-hover: #23394a;
  --folder-selected: #234950;
  --folder-accent: #65e5d5;
  --theme-track: #233747;
  --theme-active: #36546a;
  --theme-icon: #c4d4df;
}
.document-browser :is(.document-folders,.document-list) button {
  color: inherit;
  background: transparent;
}
.document-browser :is(.document-folders,.document-list) button:hover {
  background: var(--folder-hover);
}
.document-browser :is(.document-folders,.document-list) button[aria-pressed=true] {
  background: var(--folder-selected);
  box-shadow: inset 2px 0 var(--folder-accent);
}
.document-folders svg { color: var(--folder-accent); }
.theme-picker {
  display: flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--theme-track);
}
.theme-picker button {
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--theme-icon);
}
.theme-picker button[aria-pressed=true] {
  background: var(--theme-active);
  color: inherit;
  box-shadow: 0 1px 3px #0003;
}
.theme-picker button:focus-visible,.document-browser button:focus-visible {
  outline: 2px solid var(--folder-accent);
  outline-offset: -2px;
}
[data-theme=dark] :is(input,textarea)::placeholder { color: var(--muted); opacity: 1; }
[data-theme=dark] :is(#error,.stage-error) { color: #ffb5aa; }
[data-theme=dark] input::file-selector-button {
  color: inherit;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
}

.wave-summary > .project-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-right: 0;
}
.learning-test {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--folder-selected);
  white-space: normal;
}
.learning-test svg { width: 15px; height: 15px; color: var(--folder-accent); flex: none; }
.project-flow-actions { justify-content: flex-end; padding: 8px 16px 0; }
.flow-toolbar { padding-block: 4px; }
#stage-analysis { scroll-margin-top: 185px; }

.wave-detail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  scroll-margin-top: 185px;
}
#analysis-progress {
  margin-inline-start: auto;
  color: var(--muted);
  font-size: 13px;
}
#analysis-progress:empty { display: none; }

.wave-detail-heading {
  align-items: flex-start;
}
.wave-detail-heading #stage-analysis {
  width: min(100%, 440px);
  margin: 0 0 8px auto;
  padding: 8px 12px;
}
#stage-analysis > p { margin: 0; }
.document-search-status { padding: 6px 14px; font-size: 13px; }
.document-search-status:empty { display: none; }
.document-category-form {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  align-items: end;
  gap: 6px 8px;
  margin-bottom: 10px;
}
.document-category-form small { grid-column: 1/-1; }
.document-category-form small:empty { display: none; }

:root[data-theme=dark] {
  --dark-background: #191a1c;
  --dark-surface: #222426;
  --soft: #2b2e31;
  --line: #3c4044;
  --muted: #b9bec3;
  --folder-hover: #2b3032;
  --folder-selected: #283635;
  --folder-accent: #85c9bf;
  --theme-track: #242628;
  --theme-active: #3a3d41;
  --theme-icon: #c4c9cd;
  background: var(--dark-background);
  color: #edf0f2;
}
[data-theme=dark] :is(body,.topbar,.page-heading) { background: var(--dark-background); }
[data-theme=dark] :is(.panel,.card,.wave,dialog,button,select,input,textarea,.step-marker,.rail) {
  background: var(--dark-surface);
  color: inherit;
}
[data-theme=dark] .wave-summary { background: var(--soft); }
[data-theme=dark] :is(.topbar-label,.wave-actions button) { color: var(--muted); }
[data-theme=dark] a { color: var(--folder-accent); }
[data-theme=dark] :is(.primary,.rail button[aria-current=page],.timeline [aria-current=step] .step-marker,#collapse-flow,.expand-glyph) {
  background: var(--folder-selected);
  color: var(--folder-accent);
}
[data-theme=dark] .timeline [aria-current=step] .step-marker { border-color: var(--folder-accent); }
[data-theme=dark] .step-marker[data-done=true] { background: var(--folder-selected); color: var(--folder-accent); }
[data-theme=dark] .project-map { background: var(--dark-background); }
[data-theme=dark] .topbar .brand img { filter: url(#logo-dark-colors); }

.topbar .brand { width: 56px; }
@media (min-width: 761px) {
  .topbar {
    --card-inset: max(0px, (100% - 1902px) / 2);
    padding-inline: 27px calc(24px + var(--card-inset));
    column-gap: 0;
  }
  .topbar .brand-signature {
    margin-inline: calc(27px + var(--card-inset)) 12px;
  }
}

/* Fixed status card, with the study content in a separate section. */
.wave-detail-heading #stage-analysis {
  flex: 0 1 440px;
  width: 440px;
  max-width: 100%;
  margin: 0 0 8px auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.analysis-status-card {
  --state-bg: #fff8e8;
  --state-accent: #b87917;
  --state-ink: #75480e;
  box-sizing: border-box;
  width: 100%;
  height: 208px;
  padding: 16px 16px 12px;
  border: 1px solid color-mix(in srgb, var(--state-accent) 18%, transparent);
  border-inline-start: 4px solid var(--state-accent);
  border-radius: 12px;
  background: var(--state-bg);
  color: var(--state-ink);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.analysis-status-card[data-state=running] { --state-bg: #eaf8f7; --state-accent: #087f7b; --state-ink: #155b58; }
.analysis-status-card[data-state=review] { --state-bg: #edf3ff; --state-accent: #4b68bc; --state-ink: #32478b; }
.analysis-status-card[data-state=completed] { --state-bg: #edf8ef; --state-accent: #398356; --state-ink: #235c39; }
.analysis-status-card[data-state=failed] { --state-bg: #fff0f1; --state-accent: #bf5363; --state-ink: #8b3440; }
#stage-analysis .analysis-summary {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  flex: 1;
  min-height: 0;
}
.analysis-state-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #ffffffa6;
  color: var(--state-accent);
  display: grid;
  place-items: center;
}
.analysis-state-icon svg { width: 20px; height: 20px; }
.analysis-status-card[data-state=running] .analysis-state-icon svg { animation: analysis-ai 1.8s ease-in-out infinite; }
.analysis-copy { min-width: 0; overflow-y: auto; scrollbar-width: thin; padding-inline-end: 2px; }
.analysis-copy:focus-visible { outline: 2px solid var(--state-accent); outline-offset: 2px; border-radius: 3px; }
#stage-analysis [data-analysis-status] { display: block; font-size: 14px; line-height: 24px; font-weight: 650; }
#stage-analysis .analysis-detail { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: inherit; }
.analysis-version-row { min-height: 32px; display: flex; justify-content: flex-end; align-items: center; }
#stage-analysis .analysis-version { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: inherit; }
#stage-analysis .analysis-version select {
  box-sizing: border-box;
  width: auto;
  min-width: 68px;
  max-width: 112px;
  height: 32px;
  margin: 0;
  padding: 4px 24px 4px 10px;
  border: 1px solid color-mix(in srgb, var(--state-accent) 25%, transparent);
  border-radius: 7px;
  background: #ffffffb3;
  color: inherit;
  font-size: 12px;
}
.analysis-output { margin-top: 12px; }
.analysis-output[hidden] { display: none; }
.analysis-output article { padding: 12px 0; border-bottom: 1px solid var(--line); }
.analysis-output article p { margin: 0 0 6px; }
.analysis-output form { display: grid; gap: 10px; margin-block: 16px; }
.analysis-output form button { justify-self: end; }
.analysis-output details { margin-top: 12px; }
.analysis-output pre { overflow-wrap: anywhere; }
[data-theme=dark] .analysis-status-card { --state-bg: #342d20; --state-accent: #e4b864; --state-ink: #f3dfb8; }
[data-theme=dark] .analysis-status-card[data-state=running] { --state-bg: #203735; --state-accent: #82cfc5; --state-ink: #c5eee7; }
[data-theme=dark] .analysis-status-card[data-state=review] { --state-bg: #29324a; --state-accent: #a7baff; --state-ink: #dce4ff; }
[data-theme=dark] .analysis-status-card[data-state=completed] { --state-bg: #263a2d; --state-accent: #96d5a9; --state-ink: #d3eedb; }
[data-theme=dark] .analysis-status-card[data-state=failed] { --state-bg: #402a30; --state-accent: #eda0b0; --state-ink: #ffd7df; }
[data-theme=dark] .analysis-state-icon,
[data-theme=dark] #stage-analysis .analysis-version select { background: #ffffff0d; }
@keyframes analysis-ai { 0%, 100% { transform: scale(.85) rotate(-8deg); opacity: .65; } 50% { transform: scale(1.08) rotate(8deg); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .analysis-status-card[data-state=running] .analysis-state-icon svg { animation: none; } }
@media (max-width: 520px) { .wave-detail-heading #stage-analysis { flex-basis: 100%; } }

/* Project intake: one surface and one document toolbar. */
.wave-detail.project-intake { padding: 16px 0 0; border: 0; border-radius: 0; }
.project-intake #documentos { padding: 0; border: 0; background: transparent; }
.project-intake .document-browser { margin: 12px 0 0; border: 0; border-radius: 0; }
.document-filters { grid-template-columns: auto minmax(140px,1fr) minmax(120px,170px); align-items: end; padding: 0 0 16px; gap: 14px; }
#document-upload { margin: 0; }
.document-upload-control { position: relative; display: flex; flex-direction: row; gap: 8px; align-items: center; height: 38px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--folder-selected); color: var(--brand-ink); white-space: nowrap; cursor: pointer; }
.document-upload-control input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.document-upload-control:focus-within { outline: 2px solid var(--folder-accent); outline-offset: 3px; }
.document-upload-control:has(input:disabled) { opacity: .6; }
.document-search input,.document-order select { height: 38px; font-weight: 400; }
.project-intake .document-breadcrumb { padding-inline: 0; }
.project-intake .document-folders { padding-inline-start: 0; }
.document-thumbnail { margin: 14px 0; padding: 12px; background: var(--soft,#f4f6f5); border-radius: 8px; text-align: center; }
.document-thumbnail img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.document-thumbnail img[hidden],.document-thumbnail-placeholder[hidden] { display: none; }
.document-thumbnail figcaption { font-size: 11px; color: var(--muted); margin-top: 10px; }
.document-thumbnail-placeholder { display: grid; place-items: center; gap: 12px; min-height: 180px; font-size: 12px; color: var(--muted); }
.document-thumbnail-placeholder svg { width: 40px; height: 40px; }
.document-download { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; text-decoration: none; margin-bottom: 14px; }
.document-metadata,.document-text { font-size: 12px; border-top: 1px solid var(--line); padding-block: 10px; }
.document-metadata summary,.document-text summary { cursor: pointer; }
.document-metadata .document-category-form { margin-top: 10px; }
.document-excerpt { max-height: 200px; overflow: auto; overflow-wrap: anywhere; }
#document-status:not([hidden]) { margin: 0 0 12px; font-size: 12px; color: var(--muted); }
[data-theme=dark] .document-upload-control { color: var(--folder-accent); }
@media (max-width: 600px) {
 .document-filters { grid-template-columns: minmax(0,1fr) minmax(110px,140px); }
 #document-upload { grid-column: 1/-1; }
 .document-folders { max-height: 210px; overflow: auto; }
}

.vg-login-page { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.vg-login-card { width: min(100%,420px); padding: 32px; border: 1px solid var(--line); border-radius: 16px; background: white; }
.vg-login-card img { display: block; margin-bottom: 28px; }
.vg-login-card h1 { font-size: 26px; }
.vg-login-card form { display: grid; gap: 14px; margin-block: 24px; }
.vg-login-card p,.vg-login-card small { color: var(--muted); font-size: 13px; }
.vg-login-card #login-message:empty { display: none; }
.vg-login-card button { width: 100%; }
