:root {
  --stage: #f6f6f4;
  --surface: #ffffff;
  --ink: #292929;
  --muted: #737371;
  --line: #e6e6e2;
  --soft: #f0f0ec;
  --blue: #305dde;
  --blue-soft: #edf1ff;
  --green: #167153;
  --green-soft: #eaf7f1;
  --amber: #95630b;
  --amber-soft: #fff6df;
  --red: #a33b3b;
  --red-soft: #fff0f0;
  --radius: 18px;
  --radius-small: 11px;
  --shadow: 0 16px 40px rgba(40, 40, 35, 0.05);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--stage);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

body {
  min-width: 0;
  margin: 0;
  background: var(--stage);
}

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

button,
select {
  cursor: pointer;
}

a {
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(48, 93, 222, 0.28);
  outline-offset: 3px;
}

.topbar {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1440px;
  padding: 24px 34px;
}

.wordmark {
  align-items: center;
  display: inline-flex;
  font-size: 0.92rem;
  font-weight: 500;
  gap: 9px;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.wordmark-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: white;
  display: inline-flex;
  font-size: 1rem;
  height: 25px;
  justify-content: center;
  line-height: 1;
  width: 25px;
}

.wordmark-slash {
  color: var(--muted);
  margin: 0 2px;
}

.topbar-meta {
  align-items: center;
  display: flex;
  gap: 16px;
}

.eyebrow {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1.2;
  margin: 0;
  text-transform: uppercase;
}

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

.status-pill,
.stage-pill,
.tool-count,
.count-badge {
  border-radius: 999px;
  display: inline-flex;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.status-pill {
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
}

.status-pill::before {
  background: currentColor;
  border-radius: 50%;
  content: "";
  height: 6px;
  width: 6px;
}

.status-checking {
  background: var(--soft);
  color: var(--muted);
}

.status-ready {
  background: var(--green-soft);
  color: var(--green);
}

.status-fallback {
  background: var(--amber-soft);
  color: var(--amber);
}

.status-unavailable {
  background: var(--red-soft);
  color: var(--red);
}

.page-shell {
  margin: 0 auto;
  max-width: 1440px;
  padding: 26px 34px 70px;
}

.hero {
  align-items: end;
  display: flex;
  justify-content: space-between;
  margin-bottom: 42px;
  padding: 22px 0 0;
}

.hero-copy {
  max-width: 740px;
}

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

h1 {
  font-size: clamp(2.8rem, 6.3vw, 5.9rem);
  font-weight: 500;
  letter-spacing: -0.075em;
  line-height: 0.96;
  margin: 17px 0 24px;
}

h1 span {
  color: var(--blue);
}

.hero-lede {
  color: var(--muted);
  font-size: clamp(1rem, 1.7vw, 1.2rem);
  letter-spacing: -0.025em;
  line-height: 1.4;
  margin-bottom: 0;
  max-width: 520px;
}

.hero-note {
  align-items: start;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  max-width: 245px;
  padding-top: 13px;
}

.hero-note p {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
  margin: 0;
}

.hero-note strong {
  color: var(--ink);
  font-weight: 500;
}

.hero-note-dot {
  background: var(--green);
  border-radius: 50%;
  flex: 0 0 auto;
  height: 7px;
  margin-top: 6px;
  width: 7px;
}

.prompt-bar {
  align-items: center;
  background: var(--ink);
  border-radius: var(--radius);
  color: white;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin-bottom: 18px;
  padding: 18px 20px 18px 22px;
}

.prompt-bar .eyebrow {
  color: #aeadab;
}

.prompt-text {
  font-size: 0.89rem;
  letter-spacing: -0.01em;
  line-height: 1.4;
  margin: 7px 0 0;
}

.button {
  border: 0;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 500;
  line-height: 1;
  min-height: 38px;
  padding: 0 15px;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
  white-space: nowrap;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:active:not(:disabled) {
  transform: translateY(0);
}

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

.button-primary {
  background: var(--blue);
  color: white;
}

.button-primary:hover:not(:disabled) {
  background: #2449bb;
}

.button-secondary {
  background: var(--soft);
  color: var(--ink);
}

.prompt-bar .button-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.prompt-bar .button-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.23);
}

.button-quiet {
  background: transparent;
  color: var(--muted);
  padding-left: 9px;
  padding-right: 9px;
}

.button-wide {
  justify-content: center;
  width: 100%;
}

.room-grid {
  align-items: start;
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(220px, 0.78fr) minmax(410px, 1.65fr) minmax(230px, 0.82fr);
}

.panel {
  background: var(--surface);
  border: 1px solid rgba(230, 230, 226, 0.78);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
  padding: 22px;
}

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

h2 {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.05em;
  line-height: 1.1;
  margin: 8px 0 0;
}

h3 {
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  margin: 7px 0 0;
}

.panel-glyph {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 10px;
  color: var(--blue);
  display: inline-flex;
  font-size: 0.9rem;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.panel-intro {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.45;
  margin: 16px 0 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.field > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.field em {
  color: #a4a4a0;
  font-size: 0.64rem;
  font-style: normal;
  font-weight: 400;
  margin-left: 3px;
}

input,
select,
textarea {
  background: #fbfbf9;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  min-width: 0;
  padding: 10px 11px;
}

input,
select {
  height: 40px;
}

textarea {
  min-height: 76px;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #cfcfca;
}

small {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
}

.field-row {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

.field-row .field {
  min-width: 0;
}

.form-status {
  color: var(--muted);
  font-size: 0.7rem;
  min-height: 18px;
  margin: 9px 0 0;
}

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

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

.stage-pill {
  align-items: center;
  padding: 8px 10px;
}

.stage-empty {
  background: var(--soft);
  color: var(--muted);
}

.stage-draft {
  background: var(--amber-soft);
  color: var(--amber);
}

.stage-approved {
  background: var(--green-soft);
  color: var(--green);
}

.stage-committed {
  background: var(--blue-soft);
  color: var(--blue);
}

.room-summary {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 20px 0 17px;
  padding-bottom: 14px;
}

.summary-label {
  font-size: 0.82rem;
  font-weight: 500;
}

.summary-detail {
  color: var(--muted);
  font-size: 0.68rem;
  text-align: right;
}

.compare-box {
  align-items: end;
  background: var(--stage);
  border-radius: var(--radius-small);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px;
}

.compare-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
}

.compare-copy {
  min-width: 0;
}

.field-inline {
  align-items: center;
  flex-direction: row;
  gap: 12px;
  margin: 8px 0 0;
}

.field-inline > span {
  color: var(--ink);
  flex: 0 0 auto;
}

.field-inline input {
  background: var(--surface);
  height: 36px;
  max-width: 220px;
  padding: 7px 9px;
}

.comparison-section {
  margin-top: 17px;
}

.empty-state {
  align-items: center;
  border: 1px dashed #d9d9d4;
  border-radius: var(--radius-small);
  color: var(--muted);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 190px;
  padding: 25px;
  text-align: center;
}

.empty-state p {
  color: var(--ink);
  font-size: 0.82rem;
  margin: 10px 0 4px;
}

.empty-state small {
  max-width: 300px;
}

.empty-state-small {
  min-height: 120px;
}

.empty-icon {
  align-items: center;
  background: var(--blue-soft);
  border-radius: 10px;
  color: var(--blue);
  display: inline-flex;
  font-size: 1.25rem;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.data-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.66rem;
  gap: 7px;
  justify-content: space-between;
  margin-bottom: 10px;
}

.data-source {
  align-items: center;
  display: inline-flex;
  gap: 6px;
}

.data-source::before {
  background: var(--green);
  border-radius: 50%;
  content: "";
  height: 6px;
  width: 6px;
}

.data-source.is-snapshot::before {
  background: var(--amber);
}

.comparison-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  margin-bottom: 10px;
  overflow: hidden;
}

.stock-row {
  align-items: center;
  display: flex;
  gap: 11px;
  justify-content: space-between;
  padding: 13px 14px 10px;
}

.stock-identity {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.stock-initial {
  align-items: center;
  background: var(--ink);
  border-radius: 9px;
  color: white;
  display: inline-flex;
  flex: 0 0 auto;
  font-size: 0.66rem;
  font-weight: 500;
  height: 31px;
  justify-content: center;
  width: 31px;
}

.stock-name {
  min-width: 0;
}

.stock-name strong,
.metric-value strong {
  font-size: 0.82rem;
  font-weight: 500;
}

.stock-name small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-score {
  align-items: end;
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
}

.stock-score strong {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.04em;
}

.stock-score small {
  font-size: 0.62rem;
}

.metric-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 14px 13px;
}

.metric {
  min-width: 0;
}

.metric-label {
  color: var(--muted);
  display: block;
  font-size: 0.6rem;
  margin-bottom: 4px;
}

.metric-bar {
  background: var(--soft);
  border-radius: 999px;
  height: 4px;
  overflow: hidden;
}

.metric-bar span {
  background: var(--blue);
  border-radius: inherit;
  display: block;
  height: 100%;
}

.metric-value {
  color: var(--muted);
  display: flex;
  font-size: 0.65rem;
  justify-content: space-between;
  margin-top: 4px;
}

.consequence {
  background: var(--stage);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
  padding: 9px 14px;
}

.consequence strong {
  color: var(--ink);
  font-weight: 500;
}

.section-divider {
  align-items: end;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  margin: 23px 0 14px;
  padding-bottom: 12px;
}

.proposal-card {
  background: var(--stage);
  border-radius: var(--radius-small);
  padding: 14px;
}

.proposal-card.approved {
  background: var(--green-soft);
}

.proposal-card.committed {
  background: var(--blue-soft);
}

.proposal-header {
  align-items: start;
  display: flex;
  justify-content: space-between;
}

.proposal-header small {
  display: block;
  margin-top: 3px;
}

.proposal-form {
  margin-top: 13px;
}

.proposal-form .field {
  margin-bottom: 10px;
}

.proposal-form textarea {
  background: var(--surface);
  min-height: 68px;
}

.proposal-form input {
  background: var(--surface);
}

.evidence-list {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.4;
  margin: 8px 0 14px;
  padding-left: 16px;
}

.proposal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.proposal-note {
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
  margin: 12px 0 0;
}

.tool-count {
  background: var(--blue-soft);
  color: var(--blue);
  padding: 8px 10px;
}

.activity-panel .panel-intro {
  margin-bottom: 16px;
}

.activity-list {
  border-top: 1px solid var(--line);
}

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

.activity-topline {
  align-items: center;
  display: flex;
  gap: 7px;
  justify-content: space-between;
}

.activity-name {
  font-size: 0.7rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-time {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 0.6rem;
}

.activity-detail {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.4;
  margin: 3px 0 0;
}

.activity-dot {
  background: var(--blue);
  border-radius: 50%;
  display: inline-block;
  height: 6px;
  width: 6px;
}

.activity-dot.success {
  background: var(--green);
}

.activity-dot.error {
  background: var(--red);
}

.activity-empty {
  color: var(--muted);
  font-size: 0.68rem;
  padding: 13px 0;
}

.watchlist-block {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 18px;
}

.mini-heading {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.count-badge {
  align-items: center;
  background: var(--soft);
  color: var(--muted);
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 7px;
}

.watchlist-item {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
}

.watchlist-item strong {
  font-size: 0.76rem;
  font-weight: 500;
}

.watchlist-item small {
  display: block;
}

.watchlist-alert {
  color: var(--blue);
  font-size: 0.65rem;
}

.principles {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 35px;
  grid-template-columns: minmax(220px, 0.72fr) minmax(500px, 1.7fr);
  margin-top: 66px;
  padding-top: 24px;
}

.principles h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  margin-top: 13px;
}

.principle-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, 1fr);
}

.principle-grid article {
  border-left: 1px solid var(--line);
  padding-left: 15px;
}

.principle-number {
  color: var(--blue);
  font-size: 0.67rem;
  font-weight: 500;
}

.principle-grid h3 {
  margin-top: 25px;
}

.principle-grid p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
  margin: 8px 0 0;
  max-width: 190px;
}

.footer {
  align-items: start;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 24px;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 1440px;
  padding: 18px 34px 28px;
}

.footer p,
.footer a {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.45;
  margin: 0;
}

.footer p {
  max-width: 650px;
}

.footer a {
  color: var(--ink);
  flex: 0 0 auto;
  text-decoration: none;
}

.footer a:hover {
  color: var(--blue);
}

.noscript {
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 0.8rem;
  padding: 15px;
  text-align: center;
}

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (max-width: 1050px) {
  .room-grid {
    grid-template-columns: minmax(220px, 0.8fr) minmax(400px, 1.4fr);
  }

  .activity-panel {
    grid-column: 1 / -1;
  }

  .activity-list {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(3, 1fr);
  }

  .activity-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-small);
    padding: 10px;
  }
}

@media (max-width: 760px) {
  .topbar,
  .page-shell,
  .footer {
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar {
    align-items: start;
    gap: 15px;
  }

  .topbar-meta {
    align-items: end;
    flex-direction: column-reverse;
    gap: 8px;
  }

  .hero {
    align-items: start;
    flex-direction: column;
    gap: 28px;
    margin-bottom: 31px;
  }

  h1 {
    font-size: clamp(2.8rem, 15vw, 5rem);
  }

  .hero-note {
    max-width: 100%;
    width: 100%;
  }

  .prompt-bar {
    align-items: start;
    flex-direction: column;
    gap: 15px;
  }

  .prompt-bar .button {
    width: 100%;
  }

  .compare-actions {
    width: 100%;
  }

  .compare-actions .button {
    flex: 1;
  }

  .room-grid {
    display: flex;
    flex-direction: column;
  }

  .panel {
    padding: 18px;
    width: 100%;
  }

  .activity-panel {
    order: 3;
  }

  .activity-list {
    display: block;
  }

  .activity-item {
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    padding: 11px 0;
  }

  .principles {
    display: block;
    margin-top: 45px;
  }

  .principle-grid {
    gap: 22px;
    grid-template-columns: 1fr;
    margin-top: 29px;
  }

  .principle-grid article {
    min-height: 82px;
  }

  .principle-grid h3 {
    margin-top: 7px;
  }

  .footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
