:root {
  --pc-purple: #383392;
  --pc-purple-dark: #2a2670;
  --pc-teal: #00bbba;
  --pc-teal-dark: #009b9a;
  --pc-bg: #f5f6fa;
  --pc-surface: #ffffff;
  --pc-border: #e1e3ec;
  --pc-text: #1d1f2b;
  --pc-muted: #6b6f80;
  --pc-ok: #1f8a4c;
  --pc-ok-bg: #e6f5ec;
  --pc-warn: #b5651d;
  --pc-warn-bg: #fdf1e3;
  --pc-err: #c0392b;
  --pc-err-bg: #fbeae8;
  --pc-radius: 10px;
  --pc-shadow: 0 1px 3px rgba(29, 31, 43, .08), 0 1px 2px rgba(29, 31, 43, .06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--pc-bg); color: var(--pc-text); line-height: 1.5; }
a { color: var(--pc-purple); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef0f7; padding: .1em .35em; border-radius: 4px; font-size: .9em; }

/* topbar — row 1: brand, initiative context, identity */
.topbar {
  display: flex; align-items: center; gap: 1rem;
  background: var(--pc-purple); color: #fff; padding: .6rem 1.5rem;
}
.brand { color: #fff; font-weight: 700; font-size: 1.05rem; display: flex; align-items: baseline; gap: .4rem; }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--pc-teal); }
.brand-sub { font-weight: 400; opacity: .8; font-size: .8rem; }
.topbar-right { display: flex; align-items: center; gap: .8rem; margin-left: auto; }

.switcher {
  margin: 0 0 0 1rem; display: flex; align-items: center; gap: .5rem;
  background: rgba(0, 0, 0, .18); border-radius: 999px; padding: .2rem .35rem .2rem .8rem;
}
.switcher-label { font-size: .68rem; letter-spacing: .09em; text-transform: uppercase; opacity: .75; }
.switcher select {
  background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px; padding: .3rem 1.8rem .3rem .7rem; font: inherit; font-size: .88rem;
  font-weight: 600; max-width: 20rem; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23fff' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .65rem center;
}
.switcher select:hover { background-color: rgba(255,255,255,.22); }
.switcher select option { color: #111; }
.nav-initiatives {
  color: #fff; opacity: .8; font-size: .84rem;
  border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: .28rem .75rem;
}
.nav-initiatives:hover, .nav-initiatives.is-on { opacity: 1; text-decoration: none; background: rgba(255,255,255,.14); }
.mock-flag { background: var(--pc-teal); color: #003; font-weight: 700; font-size: .7rem; padding: .15rem .5rem; border-radius: 6px; }

/* topbar — row 2: workflow tabs + folded-away utilities */
.subnav { background: var(--pc-surface); border-bottom: 1px solid var(--pc-border); }
.subnav-inner {
  max-width: min(1700px, 97vw); margin: 0 auto; padding: 0 clamp(1rem, 1.6vw, 2rem);
  display: flex; align-items: stretch; gap: 1rem;
}
.tabs { display: flex; gap: .25rem; flex-wrap: wrap; }
.tab {
  display: flex; align-items: center; padding: .7rem .85rem; font-size: .92rem; font-weight: 600;
  color: var(--pc-muted); border-bottom: 2px solid transparent; white-space: nowrap;
}
.tab:hover { color: var(--pc-text); text-decoration: none; border-bottom-color: var(--pc-border); }
.tab.is-on { color: var(--pc-purple); border-bottom-color: var(--pc-teal); }

.subnav-tools { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: .35rem;
  padding: .35rem .7rem; border-radius: 999px;
  font-size: .86rem; font-weight: 600; color: var(--pc-muted);
  border: 1px solid var(--pc-border); background: var(--pc-bg);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::after {
  content: ""; width: .5rem; height: .5rem; margin-left: .1rem;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.menu > summary:hover { color: var(--pc-text); border-color: #c9cddc; }
.menu[open] > summary { color: var(--pc-purple); border-color: var(--pc-purple); background: #fff; }
.menu[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + .45rem); z-index: 40;
  min-width: 15rem; padding: .35rem;
  background: var(--pc-surface); border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius); box-shadow: 0 8px 24px rgba(29, 31, 43, .14);
}
.menu-panel a {
  display: block; padding: .5rem .6rem; border-radius: 7px;
  font-size: .9rem; font-weight: 600; color: var(--pc-text);
}
.menu-panel a span { display: block; font-size: .78rem; font-weight: 400; color: var(--pc-muted); }
.menu-panel a:hover { background: var(--pc-bg); text-decoration: none; }
.menu-panel .menu-danger { color: var(--pc-err); margin-top: .25rem; border-top: 1px solid var(--pc-border); border-radius: 0 0 7px 7px; }
.menu-panel .menu-danger:hover { background: var(--pc-err-bg); }

@media (max-width: 900px) {
  .topbar { flex-wrap: wrap; gap: .6rem; }
  .switcher { margin-left: 0; }
  .subnav-inner { flex-wrap: wrap; }
  .subnav-tools { margin-left: 0; padding-bottom: .5rem; }
}

.content { max-width: min(1700px, 97vw); margin: 1.5rem auto; padding: 0 clamp(1rem, 1.6vw, 2rem); }
.foot { text-align: center; color: var(--pc-muted); font-size: .82rem; padding: 2rem 1rem; }

/* flash */
.flash { display: flex; align-items: center; gap: .5rem; padding: .7rem 1rem; border-radius: var(--pc-radius); margin-bottom: 1rem; font-size: .92rem; transition: opacity .4s ease; }
.flash-ok { background: var(--pc-ok-bg); color: var(--pc-ok); }
.flash-err { background: var(--pc-err-bg); color: var(--pc-err); }
.flash-info { background: #eef0f7; color: var(--pc-purple); }
.flash-icon { font-weight: 700; }
.flash-hide { opacity: 0; }

/* inline save confirmation (brief form) */
.save-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.save-note { font-size: .88rem; font-weight: 600; padding: .35rem .7rem; border-radius: var(--pc-radius); }
.save-note-ok { background: var(--pc-ok-bg); color: var(--pc-ok); }
.save-note-err { background: var(--pc-err-bg); color: var(--pc-err); }

/* hero */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; margin-bottom: 1.5rem; }
.hero h1 { margin: 0 0 .25rem; font-size: 1.6rem; }
.phase { margin: 0; color: var(--pc-muted); }
.hero-stats { display: flex; gap: 1rem; }
.stat { background: var(--pc-surface); border: 1px solid var(--pc-border); border-radius: var(--pc-radius); padding: .7rem 1.1rem; text-align: center; box-shadow: var(--pc-shadow); }
.stat-num { display: block; font-size: 1.5rem; font-weight: 700; color: var(--pc-purple); }
.stat-label { font-size: .72rem; color: var(--pc-muted); text-transform: uppercase; letter-spacing: .04em; }

/* tables */
.grid { width: 100%; border-collapse: collapse; background: var(--pc-surface); border-radius: var(--pc-radius); overflow: hidden; box-shadow: var(--pc-shadow); }
.grid th, .grid td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--pc-border); font-size: .92rem; vertical-align: top; }
.grid th { background: #fafbfe; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pc-muted); }
.grid tr:last-child td { border-bottom: none; }
.stage-title { font-weight: 600; }
.artifacts a { display: inline-block; margin-right: .5rem; font-size: .85rem; }
.muted { color: var(--pc-muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.stage-list { margin-bottom: 1.5rem; }
.stage-list h2 { font-size: 1.05rem; }

/* pills */
.pill { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .74rem; font-weight: 600; text-transform: capitalize; background: var(--pc-ok-bg); color: var(--pc-ok); }
.pill-approved { background: var(--pc-ok-bg); color: var(--pc-ok); }
.pill-draft { background: var(--pc-warn-bg); color: var(--pc-warn); }
.pill-pending { background: #eceef4; color: var(--pc-muted); }
.pill-ok { background: var(--pc-ok-bg); color: var(--pc-ok); }

.gate { font-size: .82rem; font-weight: 600; }
.gate-ok { color: var(--pc-ok); }
.gate-due { color: var(--pc-teal-dark); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.card { background: var(--pc-surface); border: 1px solid var(--pc-border); border-radius: var(--pc-radius); padding: 1.1rem; box-shadow: var(--pc-shadow); }
.card:hover { text-decoration: none; border-color: var(--pc-teal); }
.card h3 { margin: 0 0 .4rem; color: var(--pc-purple); font-size: 1.02rem; }
.card p { margin: 0; color: var(--pc-muted); font-size: .88rem; }

/* two-col + panels */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.5rem; align-items: start; }
.two-col .side { position: sticky; top: 1rem; }
@media (max-width: 960px) { .two-col { grid-template-columns: 1fr; } .two-col .side { position: static; } }
.panel { background: var(--pc-surface); border: 1px solid var(--pc-border); border-radius: var(--pc-radius); padding: 1.1rem; box-shadow: var(--pc-shadow); }
.panel h3 { margin-top: 0; color: var(--pc-purple); }
.panel h4 { margin: 1rem 0 .35rem; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; color: var(--pc-muted); }
.crumbs { color: var(--pc-muted); font-size: .88rem; margin-bottom: .8rem; }

/* approve drawer (per-stage artifact pages) — pops in, hideable, never steals layout width */
.fab {
  position: fixed; right: clamp(1rem, 2vw, 1.75rem); bottom: clamp(1rem, 2vw, 1.75rem);
  z-index: 40; display: inline-flex; align-items: center; gap: .45rem;
  padding: .7rem 1.15rem; border: none; border-radius: 999px;
  background: var(--pc-purple); color: #fff; font: inherit; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 22px rgba(56, 51, 146, .32);
}
.fab:hover { background: var(--pc-purple-dark); }
.fab-badge { background: var(--pc-err); color: #fff; font-size: .72rem; font-weight: 700; line-height: 1; padding: .15rem .45rem; border-radius: 999px; }
body.drawer-open .fab { display: none; }

.drawer-backdrop { position: fixed; inset: 0; background: rgba(20, 18, 40, .28); z-index: 50; border: 0; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(400px, 92vw);
  background: var(--pc-surface); border-left: 1px solid var(--pc-border);
  box-shadow: -10px 0 28px rgba(20, 18, 40, .16);
  transform: translateX(100%); transition: transform .22s ease;
  z-index: 60; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .6rem; padding: 1.05rem 1.2rem; border-bottom: 1px solid var(--pc-border); }
.drawer-head h3 { margin: 0; color: var(--pc-purple); font-size: 1.02rem; line-height: 1.3; }
.drawer-close { background: none; border: none; font-size: 1.6rem; line-height: 1; cursor: pointer; color: var(--pc-muted); padding: 0 .15rem; }
.drawer-close:hover { color: var(--pc-text); }
.drawer-body { padding: 1.1rem 1.2rem 1.6rem; overflow-y: auto; }
.drawer-body h4 { margin: 1.2rem 0 .6rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--pc-muted); font-weight: 700; }
.drawer-body h4:first-child { margin-top: 0; }
.drawer-sep { border: none; border-top: 1px solid var(--pc-border); margin: 1.4rem 0; }

/* on wide screens an open drawer reflows the content instead of covering it */
@media (min-width: 1080px) {
  body.drawer-open .content { max-width: none; margin-right: calc(min(400px, 92vw) + 1.5rem); }
  body.drawer-open .drawer-backdrop { display: none; }
}

/* artifact markdown */
.artifact.md { background: var(--pc-surface); border: 1px solid var(--pc-border); border-radius: var(--pc-radius); padding: 1.4rem 1.8rem; box-shadow: var(--pc-shadow); min-width: 0; }
/* keep prose at a readable measure; tables + code blocks below break out to full width */
.artifact.md > p, .artifact.md > ul, .artifact.md > ol, .artifact.md > blockquote,
.artifact.md > h1, .artifact.md > h2, .artifact.md > h3, .artifact.md > h4 { max-width: 80ch; }
.md h1 { font-size: 1.6rem; margin-top: 0; margin-bottom: .6rem; color: var(--pc-purple); }
.md h2 { font-size: 1.2rem; border-bottom: 2px solid var(--pc-teal); padding-bottom: .5rem; margin-top: 1.3rem; margin-bottom: .8rem; }
.md h3 { font-size: 1rem; margin-top: 1.1rem; margin-bottom: .5rem; color: var(--pc-text); }
.md h4 { font-size: .95rem; margin-top: .9rem; margin-bottom: .4rem; color: var(--pc-muted); text-transform: uppercase; letter-spacing: .03em; }
.md ul, .md ol { margin: .8rem 0; padding-left: 1.8rem; }
.md li { margin-bottom: .4rem; }
.md blockquote { border-left: 4px solid var(--pc-teal); padding-left: 1rem; margin: .8rem 0; color: var(--pc-muted); font-style: italic; }
/* tables use the full column width and scroll horizontally on their own when content is wider */
.md table { display: block; border-collapse: collapse; width: 100%; max-width: 100%; overflow-x: auto; margin: 1rem 0; font-size: .88rem; border-radius: 8px; overflow: hidden; }
.md th, .md td { border: 1px solid var(--pc-border); padding: .5rem .7rem; text-align: left; }
.md th { background: #fafbfe; font-weight: 600; }
.md tr:nth-child(even) { background: #fafbfe; }
.md code { font-size: .85em; background: #f0f1f7; padding: .2em .4em; border-radius: 4px; color: var(--pc-purple); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.md pre { background: #1d1f2b; color: #e8eaf3; padding: 1.1rem; border-radius: 8px; overflow-x: auto; margin: 1rem 0; border: 1px solid #2a2c3e; font-size: .8rem; line-height: 1.5; }
.md pre code { background: none; padding: 0; color: inherit; }

/* validation */
.val { white-space: pre-wrap; font-size: .8rem; padding: .9rem; border-radius: 8px; background: #f3f4f9; border-left: 4px solid #ccc; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; line-height: 1.5; }
.val-ok { border-left-color: var(--pc-ok); background: #f5faf8; }
.val-block { border-left-color: var(--pc-err); background: #fef9f8; }
.val-group { margin-bottom: 1rem; }
.val-group h5 { margin: 0 0 .15rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: #383392; }
.val-group > .muted { margin: 0 0 .5rem; font-size: .78rem; }
.val-group-content { border-left: 3px solid var(--pc-err); padding-left: .7rem; }
.val-group-format { border-left: 3px solid var(--pc-warn); padding-left: .7rem; }
.val-item { font-size: .82rem; background: #f7f8fc; border-radius: 6px; padding: .45rem .6rem; margin-bottom: .35rem; }
.val-item summary { cursor: pointer; line-height: 1.45; }
.val-item p { margin: .45rem 0 0; line-height: 1.5; }
.val-item .val-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .72rem; color: #8a8fa8; }
.val-error summary { color: var(--pc-err); }
.val-warning summary { color: var(--pc-warn); }
.autofix-form { margin-top: .8rem; }
.autofix-form .muted { font-size: .76rem; margin: .35rem 0 0; }
.section-pick { display: block; font-size: .82rem; margin-bottom: .5rem; font-weight: 600; }
.section-pick select { display: block; width: 100%; margin-top: .25rem; padding: .45rem .5rem; border: 1px solid #d8dae6; border-radius: 6px; font: inherit; background: #fff; }
.undo-panel { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.undo-panel p { margin: 0; font-size: .85rem; }
.danger-panel > summary { cursor: pointer; color: var(--pc-err); padding: .2rem 0; }
.danger-panel > summary + p { margin-top: .6rem; }
.btn-danger { background: var(--pc-err); border-color: var(--pc-err); color: #fff; }

/* structured artifact editor */
.mode-switch { display: flex; gap: .35rem; align-items: flex-start; }
.btn-current { background: #383392; color: #fff; border-color: #383392; cursor: default; }
.editor-split { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.1rem; align-items: start; }
@media (max-width: 1100px) { .editor-split { grid-template-columns: 1fr; } }
.editor-blocks { min-width: 0; display: flex; flex-direction: column; gap: .9rem; }
.editor-preview { position: sticky; top: 1rem; max-height: 80vh; overflow: auto; background: #fafbfe; border: 1px solid #e1e3ec; border-radius: 8px; padding: .8rem 1rem; }
.editor-preview h4 { margin: 0 0 .5rem; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--pc-muted); }

.text-block { border: 1px solid #e6e8f0; border-radius: 8px; overflow: hidden; }
.md-toolbar { display: flex; gap: .2rem; padding: .3rem .4rem; background: #f3f4f9; border-bottom: 1px solid #e6e8f0; }
.text-edit { width: 100%; border: 0; padding: .6rem .7rem; font: inherit; font-size: .88rem; line-height: 1.55; resize: vertical; background: #fff; }
.text-edit:focus { outline: 2px solid var(--pc-accent); outline-offset: -2px; }

.tbl-block { border: 1px solid #e6e8f0; border-radius: 8px; overflow: hidden; }
.tbl-head { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .4rem .55rem; background: #f3f4f9; border-bottom: 1px solid #e6e8f0; }
.tbl-label { font-size: .76rem; color: var(--pc-muted); font-weight: 600; }
.tbl-actions { display: flex; gap: .3rem; }
.tbl-scroll { overflow-x: auto; }
.tbl-grid { margin: 0; font-size: .82rem; }
.tbl-grid th, .tbl-grid td { padding: .2rem .25rem; vertical-align: top; }
.tbl-grid th input { width: 100%; min-width: 7rem; font: inherit; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .3rem .35rem; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--pc-ink); }
.tbl-grid th input:focus { background: #fff; outline: 2px solid var(--pc-accent); }
.tbl-grid td textarea { width: 100%; min-width: 7rem; font: inherit; font-size: .82rem; line-height: 1.4; padding: .3rem .35rem; border: 1px solid #e6e8f0; border-radius: 4px; resize: vertical; overflow: hidden; }
.tbl-grid td textarea:focus { outline: 2px solid var(--pc-accent); outline-offset: -1px; }
.tbl-grid .rownum { width: 1.8rem; text-align: right; color: var(--pc-muted); font-size: .72rem; padding-top: .55rem; }
.tbl-grid .rowdel { width: 1.8rem; }
.tbl-hint { margin: 0; padding: .35rem .55rem; font-size: .74rem; border-top: 1px solid #f0f1f7; }
.icon-btn { border: 1px solid #d8dae6; background: #fff; border-radius: 4px; padding: .15rem .4rem; font-size: .78rem; line-height: 1.4; cursor: pointer; color: var(--pc-ink); }
.icon-btn:hover { background: #f0f1f7; }

/* context + clarifying-question wizard */
.ctx-label { display: block; margin-bottom: 1rem; font-weight: 600; font-size: .86rem; }
.ctx-label .muted { display: block; font-weight: 400; font-size: .78rem; margin: .15rem 0 .35rem; }
.ctx-label textarea { width: 100%; font: inherit; font-size: .86rem; line-height: 1.55; padding: .6rem .7rem; border: 1px solid #d8dae6; border-radius: 6px; resize: vertical; }
.q-status { font-size: .85rem; margin: .2rem 0 .7rem; }
.q-list { margin: 1rem 0 0; padding-left: 1.2rem; font-size: .85rem; line-height: 1.6; }
.q-list li { margin-bottom: .45rem; }
.q-list .q-answer { display: block; color: var(--pc-ok); font-size: .82rem; margin-top: .1rem; }
.q-list .q-done .q-text { color: var(--pc-muted); }
.q-list .q-skipped { color: var(--pc-muted); }
.q-compact li { margin-bottom: .25rem; }
.q-remaining h4 { margin: 0; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; color: var(--pc-muted); }

.wizard-progress { display: flex; align-items: center; gap: .8rem; font-size: .78rem; color: var(--pc-muted); margin-bottom: .9rem; }
.wizard-bar { flex: 1; height: 5px; background: #eceef4; border-radius: 99px; overflow: hidden; }
.wizard-bar span { display: block; height: 100%; background: var(--pc-accent); transition: width .25s ease; }
.wizard-q { font-size: 1.12rem; line-height: 1.5; font-weight: 600; color: #383392; margin: 0 0 .9rem; }
.wizard-form textarea { width: 100%; font: inherit; font-size: .92rem; line-height: 1.55; padding: .7rem .8rem; border: 1px solid #d8dae6; border-radius: 6px; resize: vertical; }
.wizard-actions { display: flex; gap: .5rem; align-items: center; margin-top: .7rem; flex-wrap: wrap; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--pc-muted); }
.btn-quiet:hover { border-color: #d8dae6; }
.grounding > summary { cursor: pointer; font-size: .88rem; }
.grounding .md { margin-top: .7rem; border-top: 1px solid #eceef4; padding-top: .7rem; font-size: .85rem; }
.cell-old { color: var(--pc-err); font-size: .8rem; text-decoration: line-through; }
.cell-new { color: var(--pc-ok); font-size: .8rem; }
.warn { color: var(--pc-warn); font-size: .88rem; padding: .5rem .7rem; background: var(--pc-warn-bg); border-radius: 6px; }

/* forms */
.approve-form label, .brief-form label, .upload-form label { display: block; margin-bottom: 1rem; font-size: .85rem; font-weight: 600; color: var(--pc-text); }
.field-hint { display: block; margin-top: .35rem; font-size: .78rem; font-weight: 400; line-height: 1.45; color: var(--pc-muted); }
.approve-form input[type=text], .approve-form textarea,
.brief-form input[type=text], .brief-form textarea,
.upload-form input { width: 100%; margin-top: .35rem; padding: .55rem .65rem; border: 1px solid var(--pc-border); border-radius: 8px; font: inherit; font-weight: 400; transition: border-color .16s, box-shadow .16s; }
.approve-form input[type=text]:focus, .approve-form textarea:focus,
.brief-form input[type=text]:focus, .brief-form textarea:focus,
.upload-form input:focus { outline: none; border-color: var(--pc-teal); box-shadow: 0 0 0 3px rgba(0, 187, 186, .1); }
.approve-form textarea, .brief-form textarea { resize: vertical; min-height: 4.5rem; }
.check { font-weight: 400 !important; }
.check input { width: auto; margin-right: .4rem; }

/* approve form sections */
.approve-form h4 { margin: 0 0 .6rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--pc-muted); }
.approve-form-section { margin-bottom: 1.4rem; }
.approve-form-section:last-child { margin-bottom: 0; }
.blocking-issues { background: var(--pc-err-bg); border: 1px solid #f5d6d2; border-radius: 8px; padding: .8rem; margin-bottom: 1rem; }
.blocking-issues strong { color: var(--pc-err); }

.btn { display: inline-block; padding: .6rem 1.2rem; border-radius: 8px; border: 1px solid var(--pc-border); background: var(--pc-surface); color: var(--pc-text); font: inherit; font-weight: 600; cursor: pointer; transition: all .16s; }
.btn:hover { text-decoration: none; border-color: var(--pc-purple); background: #fafbfe; }
.btn-primary { background: var(--pc-purple); color: #fff; border-color: var(--pc-purple); }
.btn-primary:hover { background: var(--pc-purple-dark); box-shadow: 0 4px 12px rgba(56, 51, 146, .2); }
.btn-danger { background: var(--pc-err); color: #fff; border-color: var(--pc-err); }
.btn-danger:hover { background: #a0322a; }
.btn-small { padding: .35rem .8rem; font-size: .8rem; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* checklist */
.checklist { list-style: none; padding: 0; margin: 0; }
.chk { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; background: var(--pc-surface); border: 1px solid var(--pc-border); border-bottom: none; font-size: .9rem; }
.chk:first-child { border-radius: var(--pc-radius) var(--pc-radius) 0 0; }
.chk:last-child { border-radius: 0 0 var(--pc-radius) var(--pc-radius); border-bottom: 1px solid var(--pc-border); }
.chk-icon { width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 700; flex: none; }
.chk-pass .chk-icon { background: var(--pc-ok); }
.chk-warn .chk-icon { background: var(--pc-warn); }
.chk-fail .chk-icon { background: var(--pc-err); }

/* run bar (generative triggers) */
.run-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem;
  background: var(--pc-surface); border: 1px solid var(--pc-border);
  border-radius: var(--pc-radius); box-shadow: var(--pc-shadow);
  padding: .8rem 1rem; margin: 0 0 1.25rem;
}
.run-bar span { color: var(--pc-muted); font-size: .9rem; margin-right: auto; }
.run-bar input[type="text"],
.run-bar input[type="email"] { width: auto; flex: 1 1 10rem; min-width: 8rem; padding: .45rem .6rem; border: 1px solid var(--pc-border); border-radius: 8px; font: inherit; }

/* one control height across a run bar so inputs, selects and buttons line up */
.run-bar select,
.run-bar input[type="text"],
.run-bar input[type="email"],
.run-bar .btn,
.run-bar span.acting-as { height: 2.5rem; }
.run-bar .btn { display: inline-flex; align-items: center; padding-top: 0; padding-bottom: 0; }
.run-bar span.acting-as { padding: 0 .8rem; margin-bottom: 0; }

/* run bars carrying a labelled field: labels stack, controls stay bottom-aligned */
.run-bar-fields { align-items: flex-end; }
.run-bar-fields .section-pick {
  margin-bottom: 0; flex: 1 1 18rem; min-width: 0;
  font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
  color: var(--pc-muted);
}
.run-bar-fields .section-pick > select,
.run-bar-fields .section-pick > input {
  display: block; margin-top: .3rem; width: 100%; height: 2.5rem;
  font-size: .92rem; font-weight: 400; text-transform: none; letter-spacing: normal;
  color: var(--pc-text);
}
.run-bar-fields > input[type="text"],
.run-bar-fields > input[type="email"] { flex: 2 1 14rem; }

/* stage artifact regeneration form */
.run-bar.regen-form { align-items: flex-start; }
.run-bar.regen-form textarea[name="notes"] {
  flex: 1 1 100%;
  width: 100%;
  min-height: 9rem;
  padding: .55rem .65rem;
  border: 1px solid var(--pc-border);
  border-radius: 8px;
  font: inherit;
  resize: vertical;
}
.run-bar.regen-form textarea[name="notes"]:focus {
  outline: none;
  border-color: var(--pc-teal);
  box-shadow: 0 0 0 3px rgba(0, 187, 186, .1);
}

/* section revision: select on the first row, instruction spans the bar */
.run-bar.revise-form textarea {
  flex: 1 1 100%; width: 100%; padding: .55rem .65rem;
  border: 1px solid var(--pc-border); border-radius: 8px; font: inherit; resize: vertical;
}
.run-bar.revise-form textarea:focus {
  outline: none; border-color: var(--pc-teal); box-shadow: 0 0 0 3px rgba(0, 187, 186, .1);
}

/* run page (live log) */
.run-status { font-weight: 600; color: var(--pc-muted); margin: 0 0 .6rem; }
.run-status.run-done { color: var(--pc-ok); }
.run-log {
  background: #1d1f2b; color: #e8eaf3; border-radius: var(--pc-radius);
  padding: 1rem; min-height: 9rem; max-height: 26rem; overflow: auto;
  white-space: pre-wrap; word-break: break-word; font-size: .85rem; line-height: 1.45;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.run-actions { display: flex; flex-direction: column; gap: .8rem; margin-top: 1rem; }
.next-actions { border-top: 1px solid var(--pc-border); padding-top: 1rem; }
.run-actions-hint { margin: 0 0 .6rem; color: var(--pc-muted); font-size: .9rem; }
.next-actions-buttons { display: flex; flex-wrap: wrap; gap: .6rem; }

/* artifact edit */
.artifact-actions { margin: 0 0 1rem; }
.edit-form { display: flex; flex-direction: column; gap: .8rem; }
.code-edit {
  width: 100%; padding: .8rem; border: 1px solid var(--pc-border); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85rem; line-height: 1.5; resize: vertical;
}
.row { display: flex; gap: .6rem; align-items: center; }

/* inline refine on the prototypes table */
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.inline-run { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.inline-run input[type="text"] { width: auto; padding: .3rem .5rem; border: 1px solid var(--pc-border); border-radius: 6px; font: inherit; font-size: .82rem; }

/* reset / danger */
.card-danger { border-color: var(--pc-err); }
.card-danger h3 { color: var(--pc-err); }
.card-accent { border-color: var(--pc-teal); margin-top: 1.2rem; }
.card-accent h2 { margin-top: 0; }
.danger-form { display: flex; flex-direction: column; gap: .9rem; max-width: 38rem; }
.danger-form label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
.danger-form input[type="text"] { padding: .5rem .6rem; border: 1px solid var(--pc-border); border-radius: 8px; font: inherit; }

/* sign-in / signed-out / auth-error pages (standalone shell, no console chrome) */
.auth-body {
  min-height: 100vh; margin: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1rem;
  background: linear-gradient(160deg, var(--pc-purple) 0%, #211d5c 100%);
}
.auth-card {
  width: min(26rem, 92vw); background: var(--pc-surface);
  border-radius: 14px; box-shadow: 0 18px 48px rgba(15, 12, 48, .35);
  padding: 2.2rem 2rem;
}
.auth-brand {
  display: flex; align-items: baseline; gap: .4rem;
  font-weight: 700; font-size: 1.02rem; color: var(--pc-purple);
  padding-bottom: 1.1rem; margin-bottom: 1.4rem; border-bottom: 1px solid var(--pc-border);
}
.auth-brand .brand-sub { font-weight: 400; font-size: .78rem; color: var(--pc-muted); }
.auth-card h1 { margin: 0 0 .5rem; font-size: 1.4rem; }
.auth-lead { margin: 0 0 1.4rem; font-size: .9rem; line-height: 1.55; color: var(--pc-muted); }
.auth-reason {
  margin: 0 0 1.2rem; padding: .6rem .75rem; font-size: .88rem;
  background: var(--pc-err-bg); color: var(--pc-err); border-radius: 8px;
}
.auth-note { margin: 1rem 0 0; font-size: .8rem; color: var(--pc-muted); }
.auth-sso {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; height: 2.9rem; font-size: .95rem;
}
.auth-sso:hover { text-decoration: none; }
.ms-logo { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; width: 1.05rem; height: 1.05rem; }
.ms-logo span { display: block; }
.ms-logo span:nth-child(1) { background: #f25022; }
.ms-logo span:nth-child(2) { background: #7fba00; }
.ms-logo span:nth-child(3) { background: #00a4ef; }
.ms-logo span:nth-child(4) { background: #ffb900; }
.auth-foot { color: rgba(255, 255, 255, .7); font-size: .78rem; margin: 0; }

/* authenticated identity (SSO) — topbar chip + read-only "acting as" markers */.user-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255, 255, 255, .12); color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 999px; padding: .22rem .7rem; font-size: .84rem; font-weight: 600;
}
.user-icon { color: var(--pc-teal); font-size: .7rem; }
.role-badge {
  font-size: .64rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .1rem .4rem; border-radius: 4px; background: rgba(255, 255, 255, .22);
}
.role-badge.role-admin { background: var(--pc-teal); color: #003; }
.role-badge.role-viewer { background: rgba(255, 255, 255, .16); }
.user-logout { color: #fff; opacity: .85; font-size: .78rem; font-weight: 500; margin-left: .1rem; border-left: 1px solid rgba(255,255,255,.28); padding-left: .5rem; }
.user-logout:hover { opacity: 1; text-decoration: none; }

/* read-only identity shown in place of the old manual name inputs */
.acting-as { margin: 0 0 .2rem; font-size: .84rem; color: var(--pc-muted); font-weight: 400; }
.acting-as strong { color: var(--pc-text); }
span.acting-as {
  display: inline-flex; align-items: center; white-space: nowrap;
  background: #eef0f7; color: var(--pc-purple);
  border-radius: 999px; padding: .28rem .7rem; font-weight: 600;
}
.run-bar span.acting-as, .inline-run span.acting-as { margin-right: 0; }

/* reviewer nomination + review */
.review-banner {
  border: 1px solid var(--pc-border); border-left-width: 4px;
  border-radius: 8px; padding: .8rem 1rem; margin: 1rem 0; background: var(--pc-surface);
}
.review-banner .review-note { margin: .4rem 0 0; font-style: italic; color: var(--pc-text); }
.review-pending { border-left-color: var(--pc-warn); background: var(--pc-warn-bg); }
.review-changes_requested { border-left-color: var(--pc-err); background: var(--pc-err-bg); }
.review-approved { border-left-color: var(--pc-ok); background: var(--pc-ok-bg); }

.review-tag {
  display: inline-block; margin-left: .4rem; padding: .1rem .45rem; border-radius: 99px;
  font-size: .68rem; font-weight: 600; vertical-align: middle;
}
.review-tag.review-pending { background: var(--pc-warn-bg); color: var(--pc-warn); border: 1px solid #ecd3b4; }
.review-tag.review-changes_requested { background: var(--pc-err-bg); color: var(--pc-err); border: 1px solid #f5d6d2; }

.review-decision { background: #f7f8fc; border: 1px solid var(--pc-border); border-radius: 8px; padding: 1rem; }
.review-decision h4 { margin-top: 0; }
.review-actions { display: flex; gap: .6rem; margin-top: .8rem; }
.review-actions .btn { flex: 1; }

.pending-reviews {
  background: var(--pc-warn-bg); border: 1px solid #ecd3b4; border-radius: var(--pc-radius);
  padding: 1rem 1.2rem; margin: 1.2rem 0;
}
.pending-reviews h2 { margin: 0 0 .6rem; font-size: 1.05rem; color: var(--pc-warn); }
.review-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.review-list li { border-bottom: 1px solid rgba(181, 101, 29, .15); padding-bottom: .6rem; }
.review-list li:last-child { border-bottom: none; padding-bottom: 0; }
.review-link { font-weight: 600; }
.review-list .muted { margin-left: .5rem; font-size: .84rem; }
.review-list .review-note { margin: .3rem 0 0; font-style: italic; }
.nominate-section h4 { margin-top: 0; }


