:root {
  --orange:#ff7412;
  --orange-dark:#c95100;
  --ink:#0b1f33;
  --muted:#65717e;
  --paper:#f5f6f7;
  --surface:#ffffff;
  --soft:#fafafa;
  --line:#dde3e7;
  --green:#23633c;
  --green-bg:#eaf5ed;
  --blue:#31598d;
  --blue-bg:#eaf1fb;
  --warm:#fff4eb;
  --radius:18px;
}

* {
  box-sizing:border-box;
}

html {
  background:var(--paper);
}

body {
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:Arial,sans-serif;
  font-size:16px;
  line-height:1.45;
}

button,
input,
textarea {
  font:inherit;
}

h1,
h2,
h3,
p {
  margin-top:0;
}

.bar {
  position:sticky;
  top:0;
  z-index:20;

  display:flex;
  align-items:center;

  min-height:58px;
  padding:0 16px;

  background:rgba(255,255,255,.97);
  border-bottom:1px solid var(--line);

  backdrop-filter:blur(12px);
}

.product {
  display:flex;
  align-items:center;
  gap:9px;
  font-weight:700;
}

.mark {
  width:12px;
  height:12px;

  border-radius:50%;
  background:var(--orange);
}

main {
  width:100%;
  padding:12px;
}

footer {
  display:flex;
  justify-content:space-between;
  gap:16px;

  width:100%;
  padding:6px 16px 28px;

  color:var(--muted);
  font-size:12px;
}

.card {
  margin:0 0 12px;
  padding:18px;

  background:var(--surface);
  border:1px solid var(--line);
  border-radius:var(--radius);
}

.hero {
  padding-top:22px;
  padding-bottom:22px;
}

.hero h1 {
  max-width:760px;
  margin:2px 0 10px;

  font-size:36px;
  line-height:1.03;
  letter-spacing:-.035em;
}

.lede {
  max-width:680px;
  margin-bottom:0;

  color:var(--muted);
  font-size:16px;
  line-height:1.5;
}

.eyebrow {
  margin-bottom:7px;

  color:var(--orange-dark);
  font-size:10px;
  font-weight:700;
  letter-spacing:.11em;
  text-transform:uppercase;
}

.heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.heading h2 {
  margin-bottom:8px;
}

.grid {
  display:grid;
  grid-template-columns:1fr;
  gap:14px;
}

.wide {
  grid-column:auto;
}

label {
  display:block;
  color:var(--ink);
  font-size:13px;
  font-weight:700;
}

.optional {
  margin-left:4px;
  color:var(--muted);
  font-size:11px;
  font-weight:400;
}

input,
textarea {
  display:block;

  width:100%;
  margin-top:7px;
  padding:13px 14px;

  border:1px solid var(--line);
  border-radius:14px;

  background:#fff;
  color:var(--ink);
}

textarea {
  resize:vertical;
}

input:focus,
textarea:focus {
  outline:none;
  border-color:var(--orange);
  box-shadow:0 0 0 3px rgba(255,116,18,.12);
}

.buttons {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:16px;
}

button {
  min-height:42px;
  padding:10px 15px;

  border:0;
  border-radius:12px;

  background:var(--orange);
  color:#fff;

  font-weight:700;
  cursor:pointer;
}

button:hover:not(:disabled) {
  background:var(--orange-dark);
}

button:disabled {
  cursor:not-allowed;
  background:#d9dee2;
  color:#7c858c;
}

button.quiet {
  background:#f0f2f4;
  color:var(--ink);
}

button.small {
  min-height:36px;
  padding:7px 12px;
  font-size:13px;
}

.pill,
.state,
.source {
  display:inline-flex;
  align-items:center;

  min-height:24px;
  padding:4px 8px;

  border-radius:999px;

  font-size:10px;
  font-weight:700;
  line-height:1;
}

.pill {
  background:#edf0f2;
}

.pill.green,
.state.accepted,
.state.edited,
.state.supplied {
  background:var(--green-bg);
  color:var(--green);
}

.state.proposed {
  background:var(--warm);
  color:var(--orange-dark);
}

.source.user {
  background:var(--blue-bg);
  color:var(--blue);
}

.source.derived {
  background:var(--warm);
  color:var(--orange-dark);
}

.guidance {
  margin:0 0 16px;
  padding:12px 14px;

  border-radius:14px;

  background:var(--warm);
  color:#72401d;

  font-size:14px;
  line-height:1.45;
}

.decision-cards {
  display:grid;
  gap:10px;
}

.decision-card {
  padding:15px;

  border:1px solid var(--line);
  border-radius:16px;

  background:var(--surface);
}

.decision-header {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
}

.decision-title-row {
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:7px;
}

.decision-title {
  font-size:16px;
  font-weight:700;
}

.decision-value {
  margin-top:11px;
  line-height:1.5;
  white-space:pre-wrap;
}

.decision-value.list {
  display:grid;
  gap:0;
}

.structured-item {
  padding:12px 0;
  border-top:1px solid var(--line);
}

.structured-item:first-child {
  padding-top:5px;
  border-top:0;
}

.structured-title {
  margin-bottom:3px;
  font-size:14px;
  font-weight:700;
}

.structured-detail {
  color:#253749;
  line-height:1.45;
}

.reason {
  margin-top:10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.4;
}

.reason strong {
  color:var(--ink);
}

.decision-editor {
  min-height:105px;
  margin-top:10px;
}

.decision-footer {
  display:flex;
  justify-content:flex-end;
  gap:7px;
  margin-top:12px;
}

.inherited {
  margin-top:16px;
  padding:16px;

  border:1px solid #d9e7dd;
  border-radius:16px;

  background:#f4f8f5;
}

.inherited-heading {
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:12px;
}

.inherited-heading h3 {
  margin-bottom:0;
  font-size:16px;
}

.inherited-help {
  margin:8px 0 12px;
  color:var(--muted);
  font-size:13px;
}

.inherited-list {
  display:grid;
  gap:8px;
}

.inherited-item {
  display:grid;
  grid-template-columns:18px 1fr;
  gap:7px;

  font-size:14px;
  line-height:1.4;
}

.inherited-item::before {
  content:"ÃƒÂ¢Ã…â€œÃ¢â‚¬Å“";
  color:var(--green);
  font-weight:700;
}

.progress-panel {
  display:grid;
  gap:12px;

  margin-top:18px;
  padding-top:18px;

  border-top:1px solid var(--line);
}

.progress-panel p {
  margin:4px 0 0;
  color:var(--muted);
  font-size:13px;
}

.progress-panel button {
  width:100%;
}

.tabs {
  display:flex;
  gap:7px;
  overflow:auto;
  padding:0 0 12px;
  scrollbar-width:none;
}

.tabs::-webkit-scrollbar {
  display:none;
}

.tabs button {
  flex:0 0 auto;
  min-height:38px;

  background:#fff;
  color:var(--ink);

  border:1px solid var(--line);
}

.tabs button.active {
  background:var(--ink);
  color:#fff;
  border-color:var(--ink);
}

.field {
  padding:13px 0;
  border-top:1px solid var(--line);
}

.field:first-of-type {
  padding-top:0;
  border-top:0;
}

.field-name {
  margin-bottom:5px;
  color:var(--muted);
  font-size:11px;
}

.field-value {
  line-height:1.5;
  white-space:pre-wrap;
}

.unknown {
  color:var(--orange-dark);
}

.knowledge {
  display:grid;
  gap:8px;
}

.knowledge-item {
  padding:12px 13px;
  border-radius:13px;
  background:var(--paper);
  font-size:14px;
  line-height:1.4;
}

.hidden {
  display:none;
}


/* ============================================================
   Larger screens enhance the mobile layout.
   Mobile remains the base implementation.
   ============================================================ */

@media (min-width:720px) {

  main,
  footer {
    max-width:1060px;
    margin-left:auto;
    margin-right:auto;
  }

  main {
    padding:20px;
  }

  footer {
    padding-left:20px;
    padding-right:20px;
  }

  .bar {
    padding-left:28px;
    padding-right:28px;
  }

  .card {
    padding:22px 24px;
  }

  .hero {
    padding-top:28px;
    padding-bottom:28px;
  }

  .hero h1 {
    font-size:48px;
  }

  .grid {
    grid-template-columns:1fr 1fr;
  }

  .wide {
    grid-column:1 / -1;
  }

  .progress-panel {
    grid-template-columns:1fr auto;
    align-items:center;
  }

  .progress-panel button {
    width:auto;
  }
}


@media (min-width:1000px) {

  main,
  footer {
    max-width:1120px;
  }

  .card {
    padding:24px 26px;
  }
}
/* ============================================================
   Workbench compact structured content
   ============================================================ */

.structured-item {
  padding:11px 0;
  border-top:1px solid var(--line);
}

.structured-item:first-child {
  padding-top:3px;
  border-top:0;
}

.structured-title {
  margin-bottom:3px;
  font-size:14px;
  font-weight:700;
  line-height:1.35;
}

.structured-detail {
  color:#263747;
  font-size:14px;
  line-height:1.45;
}

.item-line {
  display:block;
  padding:9px 0;
  border-top:1px solid var(--line);
}

.item-line:first-child {
  border-top:0;
}

.item-line::before {
  content:none !important;
}

.decision-value.list {
  gap:0;
}

.reason {
  padding:0;
  background:transparent;
  border:0;
}

/* ============================================================
   UX CLEANUP V1
   Mobile first. No preserved template indentation.
   ============================================================ */

main {
  padding-top:10px;
}

.card {
  padding:16px;
}

.hero {
  padding-top:18px;
  padding-bottom:18px;
}

.hero h1 {
  margin-bottom:8px;
}

.guidance {
  margin-bottom:12px;
}

.decision-cards {
  gap:8px;
}

.decision-card {
  padding:14px 15px;
}

.decision-header {
  margin-bottom:0;
}

.decision-title-row {
  gap:6px;
}

.decision-title {
  font-size:16px;
}

.decision-value {
  margin-top:8px;
  padding:0;

  white-space:normal;

  line-height:1.45;
  text-align:left;
}

.decision-value.list {
  display:block;
}

.structured-item {
  margin:0;
  padding:9px 0;

  border-top:1px solid var(--line);

  text-align:left;
}

.structured-item:first-child {
  padding-top:4px;
  border-top:0;
}

.structured-title {
  margin:0 0 2px;
  padding:0;

  font-size:14px;
  line-height:1.35;
}

.structured-detail {
  margin:0;
  padding:0;

  color:#344554;

  font-size:14px;
  line-height:1.45;

  text-align:left;
}

.item-line {
  margin:0;
  padding:8px 0;

  border-top:1px solid var(--line);

  text-align:left;
}

.item-line:first-child {
  border-top:0;
}

.item-line::before {
  display:none !important;
  content:none !important;
}

.reason {
  margin-top:8px;
  padding:0;

  border:0;
  background:transparent;

  color:var(--muted);

  font-size:12px;
  line-height:1.35;
}

.reason strong {
  font-weight:700;
}

.decision-footer {
  margin-top:10px;
}

.inherited {
  margin-top:14px;
  padding:14px 15px;

  border:1px solid var(--line);
  border-radius:15px;

  background:#fafbfb;
}

.inherited-heading {
  align-items:center;
}

.inherited-heading .eyebrow {
  margin-bottom:3px;
}

.inherited-heading h3 {
  margin:0;
  font-size:15px;
}

.inherited-help {
  display:none;
}

.inherited-list {
  margin-top:10px;
  gap:0;
}

.inherited-item {
  display:block;

  margin:0;
  padding:7px 0;

  border-top:1px solid var(--line);

  font-size:13px;
  line-height:1.4;

  text-align:left;
}

.inherited-item:first-child {
  border-top:0;
}

.inherited-item::before {
  display:none !important;
  content:none !important;
}

.progress-panel {
  margin-top:14px;
  padding-top:14px;
}

.progress-panel p {
  margin-top:2px;
}

.field-value {
  white-space:normal;
  text-align:left;
}

.knowledge-item {
  text-align:left;
}

@media (min-width:720px) {

  main {
    max-width:1000px;
    padding-top:16px;
  }

  footer {
    max-width:1000px;
  }

  .card {
    padding:18px 20px;
  }

  .decision-card {
    padding:15px 18px;
  }
}

/* ============================================================
   PROJECT BRIEF FINAL CLEANUP
   ============================================================ */

.original-idea {
  margin-top:10px;
}

.original-idea summary {
  cursor:pointer;
  color:var(--muted);
  font-size:12px;
  font-weight:700;
}

.original-idea-text {
  margin-top:8px;
  padding:10px 12px;

  border-radius:12px;

  background:var(--paper);

  color:#344554;

  font-size:13px;
  line-height:1.45;

  white-space:normal;
}

.progress-panel button[hidden] {
  display:none;
}

.decision-header .source {
  margin-left:0;
}


.entry-actions {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.existing-picker {
  margin-top:16px;
  padding-top:16px;
  border-top:1px solid var(--line);
}

.existing-picker select {
  display:block;
  width:100%;
  margin-top:7px;
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--surface);
  color:var(--ink);
  font:inherit;
}

.existing-sections {
  display:grid;
  gap:22px;
  margin-top:22px;
}

.knowledge-item {
  padding:14px 0;
  border-top:1px solid var(--line);
}

.knowledge-item:first-child {
  border-top:0;
}

.knowledge-item p {
  margin:7px 0 0;
  color:var(--muted);
}

.knowledge-title-row {
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}


/* Contextual candidate review — deliberately subordinate to governed Decision. */
.contextual-review-cards { display:grid; gap:14px; margin:18px 0; }
.contextual-tile { border:1px solid var(--line); border-radius:16px; padding:18px; background:var(--surface); }
.contextual-tile > p { margin:9px 0; overflow-wrap:anywhere; }
.contextual-tile .buttons { flex-wrap:wrap; margin-top:12px; }
.contextual-suggestion { margin-top:14px; border-left:3px solid var(--orange-dark,#d95b00); padding:12px 16px; background:var(--surface); }
.contextual-suggestion p { margin:7px 0; }
@media(max-width:600px) { .contextual-tile { padding:14px; } }

/* Optional context remains available without crowding mobile idea entry. */
.idea-extra{margin:12px 0;border:1px solid var(--line);border-radius:14px;padding:12px 14px}
.idea-extra summary{cursor:pointer;font-weight:700;min-height:28px}
.idea-extra summary:focus-visible{outline:3px solid var(--orange);outline-offset:3px}
.idea-extra[open] summary{margin-bottom:12px}
.idea-extra-help{color:var(--muted);font-size:14px;margin:0 0 12px}
.idea-extra .grid{gap:12px}

/* Existing-product conversation first: engineering remains available on demand. */
#existingProductState .conversation-first{
  margin:16px 0;
  padding:18px;
  border-radius:18px;
  background:var(--surface);
  border:1px solid var(--line);
}
#existingProductState .conversation-first h3{font-size:19px;margin:0 0 12px}
#existingProductState .conversation-first textarea{min-height:100px;font-size:16px}
#existingProductState .conversation-first .guidance:empty{display:none}
#existingProductState .agreed-requirement{
  margin:0;
  padding:12px 0;
  border-bottom:1px solid var(--line);
  font-size:15px;
  line-height:1.45;
}
#existingProductState .agreed-requirement:last-child{border-bottom:0}
#existingProductState .existing-product-details{
  margin:16px 0;
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px 16px;
  overflow-wrap:anywhere;
}
#existingProductState .existing-product-details>summary{
  cursor:pointer;
  font-weight:700;
  padding:6px 0;
  min-height:38px;
}
#existingProductState .existing-product-details>summary:focus-visible{
  outline:3px solid var(--orange);
  outline-offset:4px;
}
#existingProductState .stage-grid{display:flex;flex-wrap:wrap;gap:8px}
#existingProductState .stage-item{min-width:100px;flex:1 1 auto}
#existingProductState .existing-sections{gap:18px;margin-top:12px}
#existingProductState .knowledge{overflow-wrap:anywhere}
#existingProductState .knowledge-title-row{flex-wrap:wrap}
@media(max-width:600px){
 #existingProductState .conversation-first{padding:14px;margin:12px 0}
 #existingProductState .existing-product-details{padding:12px}
 #existingProductState h2{font-size:clamp(26px,7vw,34px)}
 #existingProductState .lede{font-size:15px;line-height:1.5}
}

/* Keep the chosen product and its conversation visible on narrow screens. */
body.working-on-existing .hero{display:none}
body.working-on-existing #entrySection{padding:12px 16px}
body.working-on-existing #entrySection .heading,body.working-on-existing #entrySection>.guidance{display:none}
body.working-on-existing #entrySection .entry-actions button{min-height:36px;padding:7px 11px;font-size:14px}
body.working-on-existing #entrySection .existing-picker{margin-top:9px;padding-top:9px}
@media(max-width:600px){body.working-on-existing #entrySection{margin-bottom:8px}body.working-on-existing #existingProductState{padding:14px}}

/* Owner-facing requirement previews show governed wording on demand. */
#existingAcceptedRequirements .agreed-item{
  border-bottom:1px solid var(--line);
  padding:8px 0;
}
#existingAcceptedRequirements .agreed-item summary{
  cursor:pointer;
  padding:8px 3px;
  color:var(--ink);
  line-height:1.4;
  font-size:15px;
  font-weight:600;
  overflow-wrap:anywhere;
}
#existingAcceptedRequirements .agreed-item summary:focus-visible{
  outline:3px solid var(--orange);
  outline-offset:3px;
}
#existingAcceptedRequirements .agreed-item p{
  margin:4px 0 10px;
  padding:10px 12px;
  border-radius:12px;
  background:var(--paper);
  font-size:14px;
  line-height:1.5;
  overflow-wrap:anywhere;
}

/* Phone-first access to existing governed applications. Brand colours are
   inherited from the existing tokens; no alternate theme is introduced. */
.operations-nav{
  display:flex;
  gap:8px;
  overflow-x:auto;
  overscroll-behavior-x:contain;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
  padding:10px 12px;
  background:var(--surface);
  border-bottom:1px solid var(--line);
}
.operations-nav a{
  display:inline-flex;
  flex:0 0 auto;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:10px 15px;
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--ink);
  background:var(--surface);
  font-size:14px;
  font-weight:600;
  text-decoration:none;
  white-space:nowrap;
}
.operations-nav a[aria-current="page"]{
  border-color:var(--orange);
  color:var(--ink);
  font-weight:700;
}
.operations-nav a:focus-visible{
  outline:3px solid var(--orange);
  outline-offset:2px;
}
@media(max-width:600px){
  .operations-nav{padding-inline:12px}
  .operations-nav a{min-height:48px}
}
