:root {
  color-scheme: light;
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-soft: #f0f4f8;
  --line: #d7dee8;
  --text: #15202e;
  --muted: #65758b;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-warm: #a16207;
  --accent-blue: #1d4ed8;
  --warn: #a16207;
  --ok: #15803d;
  --danger: #b91c1c;
  --shadow: 0 14px 40px rgba(21, 32, 46, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 32px;
  background: #0b1220;
  color: white;
}

.topbar h1,
.analysis-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
}

.eyebrow {
  margin: 0 0 6px;
  color: #8fb8ff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-pill {
  min-width: 138px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #dbeafe;
  font-size: 0.85rem;
  text-align: center;
  white-space: nowrap;
}

.status-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.status-pill.live {
  border-color: rgba(45, 212, 191, 0.55);
  color: #ccfbf1;
}

.status-pill.subdued {
  min-width: 220px;
  color: #cbd5e1;
}

main {
  padding: 24px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(180px, 1.2fr) repeat(4, minmax(120px, 0.8fr)) auto;
  gap: 12px;
  align-items: end;
  max-width: 1420px;
  margin: 0 auto 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

input,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  background: white;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) 17px,
    calc(100% - 12px) 17px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--accent);
  color: white;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

button.secondary:hover {
  border-color: #93c5fd;
  background: #eff6ff;
  color: var(--accent-blue);
}

button.decision-button {
  min-width: 104px;
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

button.decision-go {
  border-color: #86efac;
  color: #166534;
}

button.decision-go:hover,
button.decision-go.is-active {
  border-color: #15803d;
  background: #15803d;
  color: white;
}

button.decision-no-go {
  border-color: #fecaca;
  color: #991b1b;
}

button.decision-no-go:hover,
button.decision-no-go.is-active {
  border-color: #b91c1c;
  background: #b91c1c;
  color: white;
}

button.decision-clear {
  border-color: #cbd5e1;
  color: #475569;
}

button.decision-clear:hover {
  border-color: #64748b;
  background: #f1f5f9;
  color: #334155;
}

button.decision-clear[hidden] {
  display: none;
}

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  gap: 20px;
  max-width: 1420px;
  margin: 0 auto;
}

.consultant-workspace {
  max-width: 1420px;
  margin: 0 auto 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.consultant-workspace > .dashboard-grid {
  padding: 0 16px 16px;
}

.positioning-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
}

.positioning-band strong {
  font-size: 1rem;
}

.positioning-band span {
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.demo-flow {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 16px 0;
}

.flow-step {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.flow-step small {
  color: var(--muted);
  line-height: 1.35;
}

.intake-form,
.white-label-form,
.inline-form {
  display: grid;
  gap: 10px;
}

.intake-form {
  grid-template-columns: 1.3fr 1.1fr 0.7fr 0.55fr 1fr 1fr auto;
  align-items: end;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

.white-label-form {
  grid-template-columns: 1fr 120px 1fr auto;
}

.brand-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.brand-preview div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-preview span,
.brand-preview small,
.form-status {
  color: var(--muted);
}

.brand-preview strong,
.brand-preview small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-preview code {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--text);
  font-size: 0.78rem;
}

.form-status {
  min-height: 1.2rem;
  margin: 8px 0 0;
  font-size: 0.82rem;
}

.form-status.is-success {
  color: var(--ok);
}

.form-status.is-error {
  color: var(--danger);
}

.inline-form {
  grid-template-columns: minmax(0, 1fr) 150px auto;
  margin-top: 10px;
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
}

.portfolio-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.portfolio-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.portfolio-grid strong {
  font-size: 1.3rem;
}

.compact-button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 0.8rem;
}

.opportunity-list,
.analysis {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.opportunity-list {
  overflow: hidden;
}

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

#opportunities {
  display: grid;
}

.opportunity-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.opportunity-list-footer button {
  min-height: 34px;
  padding: 0 12px;
}

.opportunity-list-footer button[hidden] {
  display: none;
}

.opp {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: white;
  color: var(--text);
  text-align: left;
}

.opp:hover,
.opp.active {
  background: #eef8f6;
}

.opp strong {
  font-size: 0.95rem;
  line-height: 1.35;
}

.opp-title-line {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.opp-meta,
.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.analysis {
  padding: 20px;
}

.analysis-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.analysis-header .eyebrow {
  color: var(--accent);
}

.analysis-header h2 {
  font-size: clamp(1.3rem, 1.6vw, 1.8rem);
}

.subhead {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.decision-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: 10px;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.decision-status.is-go,
.decision-summary.is-go {
  background: #dcfce7;
  color: #166534;
}

.decision-status.is-no-go,
.decision-summary.is-no-go {
  background: #fee2e2;
  color: #991b1b;
}

.decision-status.is-undecided,
.decision-summary.is-undecided {
  background: #f1f5f9;
  color: #475569;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 230px;
}

.pwin {
  display: grid;
  place-items: center;
  min-width: 96px;
  height: 70px;
  border-radius: 8px;
  background: #e6f4f1;
  color: var(--accent-strong);
  font-size: 1.7rem;
  font-weight: 900;
}

.metric-grid,
.dashboard-grid {
  display: grid;
  gap: 14px;
}

.metric-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 18px;
}

.metric-grid > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.metric-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.help-label {
  cursor: help;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.metric-grid strong {
  font-size: 1.1rem;
}

.profile-band {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.profile-band span {
  display: block;
  margin-bottom: 6px;
  color: #1e40af;
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.profile-band strong {
  display: block;
  line-height: 1.3;
}

.action-band {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.action-band > div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.action-band span,
.readiness-score span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.action-band strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.2rem;
}

.action-band p {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
  line-height: 1.45;
}

.decision-summary {
  margin-top: 12px;
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.4;
}

.action-pursue {
  color: #166534;
}

.action-team {
  color: var(--accent-blue);
}

.action-watch {
  color: var(--accent-warm);
}

.action-skip {
  color: #991b1b;
}

.mini-list {
  display: grid;
  gap: 6px;
}

.mini-list span {
  margin: 0;
  border-radius: 6px;
  padding: 7px 8px;
  background: white;
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: none;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

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

h3 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.stack {
  display: grid;
  gap: 10px;
}

.row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.row-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.row-title strong {
  line-height: 1.3;
}

.score {
  color: var(--accent-strong);
  font-weight: 900;
  white-space: nowrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.fresh {
  background: #dcfce7;
  color: #166534;
}

.badge.ok,
.badge.ready {
  background: #dcfce7;
  color: #166534;
}

.badge.stale,
.badge.degraded,
.badge.failed,
.badge.warning,
.badge.attention,
.badge.needs_review {
  background: #fef3c7;
  color: #92400e;
}

.badge.critical {
  background: #fee2e2;
  color: #991b1b;
}

.badge.info {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.pursue {
  background: #dcfce7;
  color: #166534;
}

.badge.go {
  background: #dcfce7;
  color: #166534;
}

.badge.no-go {
  background: #fee2e2;
  color: #991b1b;
}

.badge.undecided {
  background: #f1f5f9;
  color: #475569;
}

.badge.team {
  background: #dbeafe;
  color: #1d4ed8;
}

.badge.watch {
  background: #fef3c7;
  color: #92400e;
}

.badge.skip {
  background: #fee2e2;
  color: #991b1b;
}

.badge.complete,
.badge.available {
  background: #dcfce7;
  color: #166534;
}

.badge.open,
.badge.locked {
  background: #f1f5f9;
  color: #475569;
}

.badge.near_term_recompete,
.badge.watch_recompete {
  background: #fef3c7;
  color: #92400e;
}

.row.compact {
  padding: 10px;
}

.client-row {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: white;
  color: var(--text);
  text-align: left;
}

.client-row:hover,
.client-row.active-client {
  border-color: #99f6e4;
  background: #eef8f6;
}

.client-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.readiness-score {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
}

.readiness-score strong {
  font-size: 1.3rem;
}

.row-note {
  margin-top: 8px;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
}

.factor .row-meta {
  margin-top: 8px;
  line-height: 1.35;
}

.factor meter {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
}

.factor meter::-webkit-meter-bar {
  border: 0;
  border-radius: 999px;
  background: #e2e8f0;
}

.factor meter::-webkit-meter-optimum-value {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
}

.factor meter::-moz-meter-bar {
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-blue));
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chips span {
  border-radius: 999px;
  padding: 4px 8px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}

.rate-table {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: white;
}

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 0.86rem;
}

th {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.empty {
  padding: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.evidence-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.evidence-card p {
  margin: 8px 0;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.45;
}

.evidence-card a {
  color: var(--accent-blue);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.evidence-card a:hover {
  text-decoration: underline;
}

.proposal-history {
  display: grid;
  gap: 10px;
}

.proposal-job {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: white;
}

.proposal-job-main {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.proposal-job-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.proposal-job-header strong {
  min-width: 0;
  color: var(--text);
  font-size: 0.92rem;
}

.proposal-job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.proposal-job-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.proposal-writer-trigger,
.proposal-generate {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #4f46e5;
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.18);
}

.proposal-writer-trigger:hover,
.proposal-generate:hover {
  background: #4338ca;
}

.proposal-writer-trigger svg,
.proposal-generate svg,
.proposal-kicker svg,
.icon-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.proposal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
}

.proposal-backdrop {
  position: absolute;
  inset: 0;
  min-height: 0;
  width: 100%;
  border-radius: 0;
  padding: 0;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
}

.proposal-backdrop:hover {
  background: rgba(15, 23, 42, 0.48);
}

.proposal-drawer {
  position: fixed;
  inset-block: 0;
  right: 0;
  display: flex;
  width: min(100%, 680px);
  flex-direction: column;
  border-left: 1px solid var(--line);
  background: white;
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.18);
  animation: proposal-slide-in 180ms ease-out;
}

@keyframes proposal-slide-in {
  from {
    transform: translateX(28px);
    opacity: 0.75;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

body.proposal-drawer-open {
  overflow: hidden;
}

.proposal-drawer-header,
.proposal-drawer-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px 24px;
}

.proposal-drawer-header {
  border-bottom: 1px solid var(--line);
}

.proposal-drawer-header h2 {
  margin: 10px 0 6px;
  font-size: 1.45rem;
  letter-spacing: 0;
}

.proposal-drawer-header p,
.proposal-section-title p,
.proposal-output-header p,
.proposal-drawer-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.proposal-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.icon-button {
  display: inline-grid;
  min-width: 38px;
  min-height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  padding: 0;
  background: white;
  color: var(--muted);
}

.icon-button:hover {
  border-color: #c7d2fe;
  background: #eef2ff;
  color: #3730a3;
}

.proposal-drawer-body {
  display: grid;
  flex: 1;
  gap: 18px;
  overflow-y: auto;
  padding: 20px 24px;
}

.proposal-section-title,
.proposal-output-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.proposal-section-title h3,
.proposal-output-header h3 {
  margin: 0 0 5px;
}

#proposal-section-select {
  max-width: 230px;
}

.proposal-section-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.proposal-section-card {
  display: grid;
  gap: 5px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 13px;
  background: white;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.proposal-section-card:hover,
.proposal-section-card.active {
  border-color: #818cf8;
  background: #eef2ff;
}

.proposal-section-card strong {
  font-size: 0.92rem;
}

.proposal-section-card span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.proposal-context-alert {
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 13px 14px;
  background: #eff6ff;
}

.proposal-context-alert strong {
  display: block;
  margin-bottom: 5px;
  color: #1e3a8a;
  font-size: 0.9rem;
}

.proposal-context-alert p {
  margin: 0;
  color: #1e40af;
  font-size: 0.86rem;
  line-height: 1.5;
}

.proposal-output-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: #f8fafc;
}

.proposal-output-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

#proposal-output {
  width: 100%;
  min-height: 350px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: white;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.87rem;
  line-height: 1.55;
  resize: vertical;
}

#proposal-output:focus {
  border-color: #818cf8;
  outline: 3px solid #e0e7ff;
}

.proposal-loading {
  display: grid;
  gap: 12px;
  min-height: 350px;
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: white;
}

.proposal-loading[hidden] {
  display: none;
}

.proposal-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid #c7d2fe;
  border-top-color: #4f46e5;
  border-radius: 999px;
  animation: proposal-spin 700ms linear infinite;
}

@keyframes proposal-spin {
  to {
    transform: rotate(360deg);
  }
}

.proposal-skeleton {
  width: 72%;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e2e8f0, #f8fafc, #e2e8f0);
  background-size: 200% 100%;
  animation: proposal-shimmer 1.2s ease-in-out infinite;
}

.proposal-skeleton.wide {
  width: 100%;
}

.proposal-skeleton.medium {
  width: 84%;
}

.proposal-skeleton.block {
  width: 100%;
  height: 120px;
  border-radius: 10px;
}

@keyframes proposal-shimmer {
  to {
    background-position-x: -200%;
  }
}

.proposal-error {
  margin-top: 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fef2f2;
  color: #991b1b;
  font-size: 0.86rem;
  font-weight: 700;
}

.proposal-drawer-footer {
  align-items: center;
  border-top: 1px solid var(--line);
  background: white;
}

.proposal-drawer-footer p {
  max-width: 420px;
  font-size: 0.8rem;
}

@media (max-width: 960px) {
  .filters,
  .layout,
  .dashboard-grid,
  .dashboard-grid.three,
  .metric-grid,
  .profile-band,
  .portfolio-grid,
  .action-band,
  .demo-flow,
  .intake-form,
  .white-label-form,
  .inline-form,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .positioning-band,
  .analysis-header {
    align-items: flex-start;
    flex-direction: column;
  }

  main {
    padding: 14px;
  }

  .status-pill,
  .pwin {
    align-self: stretch;
  }

  .header-actions,
  .status-group {
    width: 100%;
    justify-content: stretch;
  }

  .header-actions button {
    flex: 1 1 110px;
  }

  .proposal-section-title,
  .proposal-output-header,
  .proposal-job,
  .proposal-drawer-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .proposal-job-actions {
    justify-content: stretch;
  }

  .proposal-job-actions button {
    flex: 1 1 auto;
  }

  #proposal-section-select {
    max-width: none;
  }

  .proposal-section-cards {
    grid-template-columns: 1fr;
  }
}
