:root {
  font-family: Montserrat, system-ui, sans-serif;
  color: #ece8df;
  background: #050709;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(circle at 80% 0, #18212a 0, #080b0f 35%, #050709 72%);
}

button,
input,
select,
textarea {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 40px));
  margin: auto;
  padding: 56px 0 80px;
}

header {
  max-width: 780px;
  margin-bottom: 42px;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c49a58;
}

h1 {
  font-size: clamp(2.8rem, 7vw, 5.4rem);
  line-height: 0.98;
  margin: 0.3em 0;
  text-transform: uppercase;
}

header > p:last-child {
  color: #9ca4a5;
  line-height: 1.8;
}

.panel {
  border: 1px solid #28313a;
  background: rgb(10 14 18 / 92%);
  padding: 22px;
}

.auth {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 18px;
}

.auth-copy h2 {
  margin: 8px 0;
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-copy p {
  margin-bottom: 0;
}

.auth-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 220px;
}

.auth-actions > button {
  border: 1px solid #c49a58;
  background: transparent;
  color: #ece8df;
  padding: 11px 14px;
  cursor: pointer;
}

.auth-actions > button:hover {
  background: #c49a58;
  color: #080b0f;
}

.steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.steps article {
  min-height: 210px;
}

.step-number {
  color: #c49a58;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
}

.steps h2,
.output h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 20px 0;
}

.steps input[type="file"] {
  display: block;
  width: 100%;
  margin: 14px 0;
  color: #aab0b1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #aab0b1;
  font-size: 0.82rem;
}

.field:has(textarea) {
  grid-column: 1 / -1;
}

.field input,
.field select,
.field textarea,
#stage-data,
.review-item textarea {
  width: 100%;
  border: 1px solid #34404a;
  background: #030506;
  color: #ece8df;
  padding: 10px 11px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
#stage-data:focus,
.review-item textarea:focus {
  outline: 1px solid #c49a58;
  border-color: #c49a58;
}

.field input[readonly],
.field textarea[readonly] {
  border-color: #55705f;
  background: #07100b;
  color: #ece8df;
  cursor: text;
}

.steps button {
  border: 1px solid #c49a58;
  background: transparent;
  color: #ece8df;
  padding: 11px 14px;
  margin: 6px 8px 6px 0;
  cursor: pointer;
}

.steps button:hover {
  background: #c49a58;
  color: #080b0f;
}

.steps button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.steps button.is-complete,
.steps button.is-complete:disabled {
  border-color: #4e8b67;
  background: #0b1a12;
  color: #82d7a0;
  opacity: 1;
  cursor: default;
}

.review-item {
  margin-top: 14px;
  border-top: 1px solid #28313a;
  padding-top: 14px;
}

.review-list {
  max-height: 900px;
  overflow: auto;
  padding-right: 5px;
}

.review-item h3 {
  font-size: 0.95rem;
  line-height: 1.5;
}

.target-kind,
.decision-state {
  color: #c49a58;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.decision-state.is-complete {
  color: #82d7a0;
}

.decision-state.is-error {
  color: #e88c8c;
}

.review-item blockquote {
  margin-inline: 0;
  border-left: 2px solid #c49a58;
  padding-left: 14px;
  color: #c4cbc8;
  white-space: pre-wrap;
}

.review-item small {
  color: #8d979a;
  overflow-wrap: anywhere;
}

.actions {
  margin-top: 12px;
}

.muted {
  color: #9ca4a5;
  line-height: 1.6;
}

.status-feedback {
  min-height: 1.6em;
  margin: 10px 0 0;
}

.status-feedback.is-error {
  color: #e88c8c;
}

.notice {
  padding: 12px 14px;
  border-left: 2px solid #c49a58;
  background: #0e1317;
  color: #c4cbc8;
  line-height: 1.6;
}

.scope-guardrail {
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid #55705f;
  background: #07100b;
}

.scope-guardrail strong {
  color: #82d7a0;
}

.scope-guardrail p {
  color: #b9cfc0;
  line-height: 1.55;
  margin: 9px 0 0;
}

.consent-check {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  margin: 13px 0;
  color: #c4cbc8;
  font-size: 0.84rem;
  line-height: 1.5;
}

.consent-check input {
  margin-top: 4px;
  accent-color: #c49a58;
}

.drive-scope-fields {
  margin-top: 16px;
}

.safe-aggregate {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid #34404a;
  background: #030506;
}

.safe-aggregate h3 {
  color: #82d7a0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.safe-aggregate dl {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px 14px;
}

.safe-aggregate dt {
  color: #8d979a;
}

.safe-aggregate dd {
  margin: 0;
  color: #ece8df;
  overflow-wrap: anywhere;
}

.case-confirmation {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #4e8b67;
  background: #0b1a12;
  color: #d8f2e1;
}

.case-confirmation strong {
  display: block;
  color: #82d7a0;
  line-height: 1.5;
}

.case-confirmation p {
  margin: 8px 0 12px;
  color: #b9cfc0;
  line-height: 1.5;
}

.case-reference {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}

.case-reference span {
  color: #9fb5a7;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.case-reference code {
  overflow-wrap: anywhere;
  color: #ece8df;
  font-size: 0.82rem;
}

.output {
  margin-top: 18px;
}

.output pre,
#dashboard-out {
  white-space: pre-wrap;
  overflow: auto;
  color: #c4cbc8;
  background: #030506;
  padding: 18px;
  line-height: 1.55;
}

.output pre {
  min-height: 180px;
}

@media (max-width: 760px) {
  .auth {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-actions {
    justify-content: flex-start;
    min-width: 0;
  }

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

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

  .field:has(textarea) {
    grid-column: auto;
  }
}

/* OP-LEGAL-02A · synthetic-only strategic triage */
#workspace-strategy {
  grid-column: 1 / -1;
}

.p0-locked {
  padding: 16px;
  border: 1px dashed #55705f;
  background: #07100b;
  color: #b9cfc0;
  line-height: 1.6;
}

.p0-surface[hidden],
.p0-locked[hidden] {
  display: none;
}

.p0-banner {
  margin-bottom: 18px;
  padding: 16px;
  border: 1px solid #55705f;
  background: #07100b;
}

.p0-banner p {
  margin: 10px 0 0;
  color: #b9cfc0;
  line-height: 1.65;
}

.p0-mode,
.p0-review-status {
  color: #82d7a0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.p0-layer {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #34404a;
}

.p0-layer > h3 {
  margin: 0 0 14px;
  color: #ece8df;
  font-size: 1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.p0-card {
  min-width: 0;
  margin-top: 12px;
  padding: 16px;
  border: 1px solid #34404a;
  background: #030506;
}

.p0-card p {
  color: #c4cbc8;
  line-height: 1.6;
}

.p0-card h4 {
  margin: 16px 0 8px;
  color: #c49a58;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.p0-card-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.p0-card-header strong {
  color: #ece8df;
  line-height: 1.45;
}

.p0-definitions {
  display: grid;
  grid-template-columns: minmax(150px, 0.38fr) minmax(0, 1fr);
  gap: 8px 14px;
  margin: 0;
}

.p0-definitions dt {
  color: #8d979a;
  font-size: 0.78rem;
  line-height: 1.5;
}

.p0-definitions dd {
  margin: 0;
  color: #ece8df;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.p0-definitions--meta {
  margin-bottom: 14px;
  padding: 14px;
  background: #0e1317;
}

.p0-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #c4cbc8;
  line-height: 1.55;
}

.p0-list li + li {
  margin-top: 6px;
}

.p0-audit-grid,
.p0-option-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.p0-option-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.p0-option {
  display: flex;
  flex-direction: column;
}

.p0-option-selector {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 10px;
  align-items: start;
  color: #ece8df;
  cursor: pointer;
}

.p0-option-selector input,
.p0-counsel-check input {
  margin-top: 3px;
  accent-color: #c49a58;
}

.p0-option-selector span {
  font-weight: 700;
  line-height: 1.45;
}

.p0-option-selector small {
  grid-column: 2;
  color: #c49a58;
  letter-spacing: 0.06em;
}

.p0-bands {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0;
}

.p0-bands span {
  padding: 5px 7px;
  border: 1px solid #34404a;
  color: #aab0b1;
  font-size: 0.68rem;
}

.p0-counsel-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin: 18px 0 12px;
  color: #c4cbc8;
  line-height: 1.55;
}

.p0-gate {
  padding: 14px 16px;
  border: 1px solid #6f4d4d;
  background: #180b0b;
}

.p0-gate strong {
  color: #e88c8c;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
}

.p0-gate p {
  margin: 7px 0 0;
  color: #d9bcbc;
  line-height: 1.55;
}

.p0-gate.is-candidate {
  border-color: #8a6c3f;
  background: #171208;
}

.p0-gate.is-candidate strong,
.p0-gate.is-candidate p {
  color: #e1bd7d;
}

.p0-gate.is-ready {
  border-color: #4e8b67;
  background: #0b1a12;
}

.p0-gate.is-ready strong,
.p0-gate.is-ready p {
  color: #82d7a0;
}

@media (max-width: 900px) {
  .p0-audit-grid,
  .p0-option-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .p0-definitions {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .p0-definitions dd + dt {
    margin-top: 8px;
  }

  .p0-card-header {
    flex-direction: column;
  }
}
:root .legal-preparation { max-width: 76ch; padding: 1rem; }
.legal-preparation blockquote { border-left: 3px solid currentColor; padding-left: 1rem; white-space: pre-wrap; }
.legal-preparation textarea, .legal-preparation select { display: block; width: 100%; margin: .5rem 0; }
.legal-preparation button { margin: .25rem; }
#preparation-pdf { width: 100%; height: 70vh; border: 1px solid currentColor; }

.p0-journey { background: rgb(10 14 18 / 92%); color: #ece8df; border: 1px solid #28313a; padding: clamp(16px, 3vw, 32px); margin-top: 18px; }
.p0-journey h2, .p0-journey h3, .p0-journey h4, .p0-journey p, .p0-journey label, .p0-journey small, .p0-journey strong { color: #ece8df; }
.p0-journey h3 { margin-top: 24px; }
.p0-journey blockquote { margin: 16px 0; padding: 12px 18px; background: #030506; border-left: 4px solid #c49a58; white-space: pre-wrap; overflow-wrap: anywhere; }
.p0-journey .p0-field { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; font-weight: 600; }
.p0-journey input, .p0-journey select, .p0-journey textarea { width: 100%; box-sizing: border-box; background: #030506; color: #ece8df; border: 1px solid #34404a; padding: 10px; font: inherit; color-scheme: dark; }
.p0-journey textarea { min-height: 100px; resize: vertical; }
.p0-journey button { background: transparent; color: #ece8df; border: 1px solid #c49a58; padding: 10px 14px; margin: 6px 8px 6px 0; cursor: pointer; }
.p0-journey button:hover { background: #c49a58; color: #080b0f; }
.p0-journey button:disabled { opacity: .55; cursor: wait; }
.p0-journey :focus-visible { outline: 3px solid #c49a58; outline-offset: 3px; }
.p0-journey .p0-progress { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); list-style: none; gap: 8px; padding: 0; }
.p0-journey .p0-progress li { padding: 10px; border: 1px solid #28313a; }
.p0-journey iframe { width: 100%; height: 65vh; margin-top: 20px; border: 1px solid #34404a; background: white; }
.p0-journey [role="status"] { font-weight: 600; }
.p0-journey [hidden] { display: none !important; }
@media (max-width: 600px) { .p0-journey .p0-progress { grid-template-columns: 1fr; } }

.first-reading-panel { margin: 0 0 18px; }
.first-reading-panel > select { max-width: 100%; padding: 10px; background: #030506; color: #ece8df; border: 1px solid #34404a; color-scheme: dark; }
.first-reading-panel button { background: transparent; color: #ece8df; border: 1px solid #c49a58; padding: 10px 14px; margin: 6px 8px 6px 0; cursor: pointer; }
.first-reading-panel button:hover { background: #c49a58; color: #080b0f; }
.first-reading-panel button:disabled { opacity: .55; cursor: default; }
.first-reading-panel :focus-visible { outline: 3px solid #c49a58; outline-offset: 3px; }
.first-reading { line-height: 1.6; overflow-wrap: anywhere; }
.first-stage-progress { display: block; width: 100%; height: 5px; margin: 8px 0 10px; accent-color: #c49a58; }
.first-stage-activity { margin: 0 0 14px; color: #aab0b1; font-size: .86rem; font-variant-numeric: tabular-nums; }
.first-reading h2 { font-family: Georgia, serif; font-weight: 500; }
.first-reading h3 { margin-top: 28px; }
.first-reading details { border-top: 1px solid #28313a; padding: 14px 0; }
.first-reading summary { cursor: pointer; color: #ece8df; }
.first-reading blockquote { white-space: pre-wrap; margin: 16px 0; padding: 12px 18px; border-left: 3px solid #c49a58; background: #030506; }
.first-reading pre { white-space: pre-wrap; overflow-wrap: anywhere; padding: 16px; background: #030506; }
.first-reading iframe { width: 100%; height: 65vh; border: 1px solid #34404a; background: white; }
.first-reading [hidden] { display: none !important; }
#workspace-details > summary { padding: 18px 0; color: #c49a58; cursor: pointer; }
