:root {
  color-scheme: dark;
  --page: #061017;
  --surface: #0b171f;
  --surface-soft: #0b1a22;
  --surface-strong: #10232c;
  --surface-raised: #132832;
  --canvas: #071118;
  --canvas-grid: #17303a;
  --paper-line: #59727b;
  --line: #31505c;
  --line-soft: #1e3741;
  --text: #eef7f8;
  --muted: #93a9b1;
  --active: #4fd1c5;
  --active-soft: rgba(79, 209, 197, 0.12);
  --possible: #f4b860;
  --possible-soft: rgba(244, 184, 96, 0.12);
  --indeterminate: #b69cff;
  --indeterminate-soft: rgba(182, 156, 255, 0.12);
  --blocked: #ff7878;
  --blocked-soft: rgba(255, 120, 120, 0.11);
  --energy: #f6d365;
  --selection: #9cecf0;
  --focus: #85e7df;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.24);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--page);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 75% -10%, rgba(79, 209, 197, 0.08), transparent 34rem),
    var(--page);
  color: var(--text);
}

button,
select,
input {
  font: inherit;
}

button,
select,
label,
canvas {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
select:focus-visible,
input:focus-visible,
canvas:focus-visible,
a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

button {
  color: inherit;
}

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

h1,
h2,
h3,
strong {
  font-weight: 650;
}

h1 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.35rem, 2vw, 1.9rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: 1.05rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 0;
  font-size: 0.88rem;
}

small {
  color: var(--muted);
}

code,
.revision-label,
.project-type {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 0.8rem;
  border-radius: 0.55rem;
  background: var(--text);
  color: var(--page);
  transform: translateY(-180%);
}

.skip-link:focus {
  transform: translateY(0);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-frame {
  min-height: 100vh;
}

.app-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(6, 16, 23, 0.94);
}

.brand-lockup,
.header-state,
.workspace-heading,
.workspace-heading-state,
.overview-heading,
.project-card-topline,
.canvas-toolbar,
.zoom-controls,
.scenario-heading,
.control-group-heading,
.target-card-heading {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 0.75rem;
}

.brand-lockup > div {
  display: grid;
  gap: 0.1rem;
}

.brand-lockup strong {
  letter-spacing: 0.12em;
  font-size: 0.82rem;
}

.brand-lockup span:last-child {
  color: var(--muted);
  font-size: 0.76rem;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(79, 209, 197, 0.58);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(79, 209, 197, 0.2), rgba(79, 209, 197, 0.05));
  color: var(--active);
  font-weight: 750;
}

.header-state {
  justify-content: flex-end;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.session-state {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--line-soft);
}

.session-state > span {
  display: grid;
  gap: 0.12rem;
  text-align: right;
}

.session-state strong {
  font-size: 0.78rem;
}

.session-state small {
  font-size: 0.66rem;
}

.auth-view {
  min-height: calc(100vh - 70px);
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.login-card {
  width: min(100%, 430px);
  display: grid;
  padding: clamp(1.4rem, 4vw, 2.25rem);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(19, 40, 50, 0.94), rgba(11, 23, 31, 0.98));
  box-shadow: var(--shadow);
}

.login-card > p:not(.eyebrow, .login-error) {
  margin-bottom: 1.5rem;
  color: var(--muted);
  line-height: 1.55;
}

.auth-mark {
  margin-bottom: 1.25rem;
}

.text-control {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--canvas);
  color: var(--text);
}

.text-control:focus {
  border-color: var(--active);
}

.login-submit {
  min-height: 44px;
  margin: 1.25rem 0 0.8rem;
}

.login-error {
  margin: 0.8rem 0 0;
  color: #ffaaaa;
  font-size: 0.82rem;
}

.no-projects {
  grid-column: 1 / -1;
  padding: 1.5rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.demo-badge,
.safety-badge,
.status-pill,
.revision-label,
.energy-state,
.selection-status,
.source-token {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  line-height: 1;
}

.demo-badge {
  border: 1px solid rgba(244, 184, 96, 0.42);
  background: var(--possible-soft);
  color: #ffd796;
  letter-spacing: 0.08em;
}

.safety-badge {
  border: 1px solid var(--line);
  color: var(--muted);
}

.button,
.icon-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
  cursor: pointer;
  transition: border-color 140ms ease, background-color 140ms ease, transform 140ms ease;
}

.button {
  padding: 0.48rem 0.8rem;
  font-size: 0.8rem;
}

.icon-button {
  width: 36px;
  padding: 0;
  font-size: 1.25rem;
}

.button:hover,
.icon-button:hover {
  border-color: var(--active);
  background: var(--surface-raised);
}

.button:active,
.icon-button:active {
  transform: translateY(1px);
}

.button-primary {
  border-color: var(--active);
  background: var(--active);
  color: #041315;
}

.button-primary:hover {
  background: #77ded6;
}

.button-secondary {
  background: transparent;
}

.button-quiet {
  min-height: 32px;
  padding: 0.35rem 0.65rem;
  background: transparent;
  color: var(--muted);
}

.project-overview {
  max-width: 1260px;
  margin: 0 auto;
  padding: clamp(1.25rem, 4vw, 3.5rem);
}

.overview-heading {
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 2rem;
}

.overview-heading p:not(.eyebrow) {
  max-width: 66ch;
  margin-bottom: 0;
  color: var(--muted);
}

.eyebrow,
.rail-label,
.target-kicker {
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.project-card {
  min-height: 330px;
  display: flex;
  flex-direction: column;
  padding: clamp(1rem, 2vw, 1.5rem);
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(19, 40, 50, 0.8), rgba(11, 23, 31, 0.94));
  box-shadow: var(--shadow);
}

.project-card-ready {
  border-color: rgba(79, 209, 197, 0.34);
}

.project-card-locked {
  border-color: rgba(255, 120, 120, 0.3);
}

.project-card-topline {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.project-type {
  color: var(--muted);
  font-size: 0.67rem;
}

.project-card h2 {
  font-size: 1.35rem;
}

.project-card > p {
  color: var(--muted);
  line-height: 1.6;
}

.project-card .button {
  align-self: flex-start;
  margin-top: auto;
}

.project-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.project-facts div {
  padding: 0.75rem;
  border-top: 1px solid var(--line-soft);
}

.project-facts dt,
.project-facts dd {
  margin: 0;
}

.project-facts dt {
  color: var(--muted);
  font-size: 0.68rem;
}

.project-facts dd {
  margin-top: 0.25rem;
  font-size: 0.83rem;
}

.status-pill {
  border: 1px solid var(--line);
  color: var(--muted);
}

.status-pill[data-state="ready"],
.status-guaranteed .target-status,
.status-pill.status-guaranteed {
  border-color: rgba(79, 209, 197, 0.4);
  background: var(--active-soft);
  color: #8be8e0;
}

.status-pill[data-state="blocked"],
.status-not .target-status,
.status-pill.status-not {
  border-color: rgba(255, 120, 120, 0.38);
  background: var(--blocked-soft);
  color: #ffaaaa;
}

.api-status[data-state="online"] {
  border-color: rgba(79, 209, 197, 0.4);
  background: var(--active-soft);
  color: #8be8e0;
}

.api-status[data-state="pending"] {
  border-color: rgba(244, 184, 96, 0.4);
  background: var(--possible-soft);
  color: #ffd696;
}

.api-status[data-state="offline"] {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.status-possible .target-status {
  border-color: rgba(244, 184, 96, 0.42);
  background: var(--possible-soft);
  color: #ffd696;
}

.status-indeterminate .target-status {
  border-color: rgba(182, 156, 255, 0.4);
  background: var(--indeterminate-soft);
  color: #d5c8ff;
}

.workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 340px;
  align-items: start;
  gap: 1px;
  background: var(--line-soft);
}

.workspace[data-project="authorized"] {
  grid-template-columns: 230px minmax(0, 1fr);
}

.project-rail,
.workspace-main,
.scenario-panel {
  min-width: 0;
  background: var(--page);
}

.project-rail {
  min-height: calc(100vh - 108px);
  padding: 1rem 0.8rem;
}

.project-nav {
  display: grid;
  gap: 0.4rem;
}

.project-nav-list {
  display: grid;
  gap: 0.4rem;
}

.project-nav-item {
  width: 100%;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 0.65rem;
  align-items: center;
  padding: 0.7rem;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.project-nav-item:hover {
  background: var(--surface);
}

.project-nav-item[aria-current="page"] {
  border-color: var(--line);
  background: var(--surface-strong);
}

.project-nav-item strong,
.project-nav-item small {
  display: block;
}

.project-nav-item strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-nav-item small {
  margin-top: 0.18rem;
  font-size: 0.66rem;
}

.project-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.project-dot-ready {
  background: var(--active);
  box-shadow: 0 0 0 4px var(--active-soft);
}

.project-dot-blocked {
  background: var(--blocked);
  box-shadow: 0 0 0 4px var(--blocked-soft);
}

.layer-panel,
.rail-legend {
  display: grid;
  gap: 0.35rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.layer-toggle {
  display: grid;
  grid-template-columns: 18px 18px minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.45rem;
  border-radius: 7px;
  color: var(--text);
  font-size: 0.76rem;
  cursor: pointer;
}

.layer-toggle:hover {
  background: var(--surface);
}

.layer-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--active);
}

.layer-toggle small {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.62rem;
}

.layer-swatch {
  width: 16px;
  height: 3px;
  border-radius: 99px;
  background: var(--line);
}

.layer-original {
  background: var(--paper-line);
}

.layer-topology {
  background: var(--line);
}

.layer-active {
  background: var(--active);
}

.layer-energy {
  background: var(--energy);
}

.layer-uncertainty {
  background: var(--possible);
}

.rail-legend span {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.72rem;
}

.legend-line {
  width: 22px;
  height: 3px;
  display: inline-block;
  border-radius: 99px;
}

.legend-guaranteed {
  background: var(--active);
}

.legend-possible {
  background: repeating-linear-gradient(90deg, var(--possible) 0 7px, transparent 7px 11px);
}

.legend-indeterminate {
  background: repeating-linear-gradient(90deg, var(--indeterminate) 0 3px, transparent 3px 7px);
}

.legend-blocked {
  background: repeating-linear-gradient(90deg, var(--blocked) 0 5px, transparent 5px 9px);
}

.workspace-main {
  min-height: calc(100vh - 108px);
  padding: 1rem;
}

.workspace-heading {
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.15rem 0 1rem;
}

.workspace-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.workspace-heading-state {
  justify-content: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.revision-label {
  border: 1px solid var(--line-soft);
  color: var(--muted);
}

.demo-panel {
  min-width: 0;
}

.canvas-toolbar {
  justify-content: space-between;
  gap: 1rem;
  min-height: 50px;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-soft);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
  background: var(--surface);
}

.canvas-toolbar > div:first-child {
  min-width: 0;
  display: grid;
  gap: 0.15rem;
}

.canvas-toolbar strong {
  font-size: 0.82rem;
}

.canvas-toolbar span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zoom-controls {
  flex: 0 0 auto;
  gap: 0.35rem;
}

.canvas-shell {
  position: relative;
  min-height: 560px;
  height: min(65vh, 760px);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  background: var(--canvas);
}

#schemaCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
}

#schemaCanvas.is-panning {
  cursor: grabbing;
}

.canvas-watermark {
  position: absolute;
  top: 1rem;
  right: 1rem;
  pointer-events: none;
  color: rgba(244, 184, 96, 0.14);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: clamp(1.1rem, 3vw, 2.3rem);
  font-weight: 800;
  letter-spacing: 0.12em;
}

.canvas-safety {
  position: absolute;
  left: 0.8rem;
  bottom: 0.8rem;
  max-width: calc(100% - 1.6rem);
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(7, 17, 24, 0.9);
  color: var(--muted);
  font-size: 0.66rem;
  pointer-events: none;
}

.selection-strip {
  display: grid;
  grid-template-columns: minmax(140px, 0.8fr) auto minmax(200px, 1.6fr);
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid var(--line-soft);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--surface);
}

.selection-strip > div {
  display: grid;
}

.selection-strip .eyebrow {
  margin-bottom: 0.15rem;
}

.selection-strip strong {
  font-size: 0.82rem;
}

.selection-strip p {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
}

.selection-status {
  border: 1px solid var(--active);
  background: var(--active-soft);
  color: #8be8e0;
}

.target-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.target-card {
  min-width: 0;
  padding: 0.85rem;
  border: 1px solid var(--line-soft);
  border-top-width: 3px;
  border-radius: 10px;
  background: var(--surface);
}

.target-card.status-guaranteed {
  border-top-color: var(--active);
}

.target-card.status-possible {
  border-top-color: var(--possible);
}

.target-card.status-not {
  border-top-color: var(--blocked);
}

.target-card.status-indeterminate {
  border-top-color: var(--indeterminate);
}

.target-card-heading {
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.target-card-heading h2 {
  margin-bottom: 0;
  font-size: 0.95rem;
}

.target-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  flex: 0 0 auto;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.65rem;
}

.target-card code {
  display: block;
  margin-top: 0.7rem;
  color: var(--muted);
  font-size: 0.64rem;
}

.target-card p {
  min-height: 2.7em;
  margin: 0.45rem 0;
  font-size: 0.75rem;
  line-height: 1.4;
}

.target-card small {
  display: block;
  min-height: 2.8em;
  font-size: 0.65rem;
  line-height: 1.4;
}

.energy-state {
  min-height: 22px;
  margin-top: 0.65rem;
  border: 1px solid var(--line);
  color: var(--muted);
}

.scenario-panel {
  min-height: calc(100vh - 108px);
  padding: 1rem;
}

.scenario-heading {
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.scenario-heading h2 {
  font-size: 1.1rem;
}

.field-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.7rem;
}

.field-label-spaced {
  margin-top: 0.8rem;
}

.select-control {
  width: 100%;
  min-height: 40px;
  padding: 0.48rem 2.2rem 0.48rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
}

.control-group,
.scenario-summary {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}

.control-group-heading {
  justify-content: space-between;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
}

.control-group-heading span {
  color: var(--muted);
  font-size: 0.62rem;
  text-align: right;
}

.control-row {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.42rem 0.15rem;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.control-row > span {
  display: grid;
  gap: 0.12rem;
}

.control-row strong {
  font-size: 0.76rem;
}

.control-row small {
  font-size: 0.64rem;
}

.control-row[data-active="true"] strong {
  color: #8be8e0;
}

input[role="switch"] {
  appearance: none;
  width: 42px;
  height: 23px;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-strong);
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease;
}

input[role="switch"]::after {
  content: "";
  width: 17px;
  height: 17px;
  display: block;
  margin: 2px;
  border-radius: 50%;
  background: var(--muted);
  transition: transform 140ms ease, background-color 140ms ease;
}

input[role="switch"]:checked {
  border-color: var(--active);
  background: var(--active-soft);
}

input[role="switch"]:checked::after {
  background: var(--active);
  transform: translateX(19px);
}

.summary-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.summary-values div {
  min-width: 0;
  padding: 0.55rem;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--surface);
}

.summary-values span,
.summary-values small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.summary-values span {
  font-size: 0.76rem;
  white-space: nowrap;
}

.summary-values small {
  margin-top: 0.2rem;
  font-size: 0.58rem;
}

.capacity-track {
  height: 5px;
  margin-top: 0.7rem;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-soft);
}

.capacity-track span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--active), var(--energy));
  transition: width 180ms ease;
}

.scenario-summary p {
  margin: 0.6rem 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.45;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.source-token {
  min-height: 22px;
  border: 1px solid rgba(79, 209, 197, 0.36);
  background: var(--active-soft);
  color: #8be8e0;
}

.source-token.is-empty {
  border-color: var(--line);
  background: transparent;
  color: var(--muted);
}

.authorized-project-panel {
  min-height: 620px;
  padding: clamp(1.2rem, 4vw, 3rem);
  border: 1px solid rgba(255, 120, 120, 0.24);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(255, 120, 120, 0.035), transparent 45%),
    var(--surface);
}

.lock-symbol {
  width: 68px;
  height: 68px;
  display: grid;
  place-items: center;
  margin-bottom: 1rem;
  border: 1px solid var(--blocked);
  border-radius: 16px;
  background: var(--blocked-soft);
  color: #ffaaaa;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.72rem;
}

.authorized-project-panel > h2 {
  max-width: 760px;
  font-size: clamp(1.25rem, 2.6vw, 2rem);
}

.authorized-project-panel > p:not(.eyebrow):not(.authorized-project-source) {
  max-width: 780px;
  color: var(--muted);
  line-height: 1.6;
}

.authorized-project-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  max-width: 860px;
  margin: 1.5rem 0;
}

.authorized-project-facts div {
  padding: 0.9rem;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: var(--surface-soft);
}

.authorized-project-facts dt,
.authorized-project-facts dd {
  display: block;
}

.authorized-project-facts dd {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.05rem;
}

.authorized-project-facts dt {
  order: 2;
  margin-top: 0.25rem;
  font-size: 0.65rem;
}

.authorized-project-review {
  max-width: 860px;
  padding: 1rem;
  border-left: 3px solid var(--blocked);
  background: var(--blocked-soft);
}

.authorized-project-review ul {
  margin: 0.7rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.7;
}

.authorized-project-source {
  margin-top: 1.3rem;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
}

.app-footer {
  min-height: 38px;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  border-top: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 0.63rem;
}

@media (max-width: 1280px) {
  .workspace {
    grid-template-columns: 210px minmax(0, 1fr) 320px;
  }

  .workspace[data-project="authorized"] {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .canvas-shell {
    min-height: 520px;
  }
}

@media (max-width: 1080px) {
  .workspace {
    grid-template-columns: 210px minmax(0, 1fr);
  }

  .scenario-panel {
    grid-column: 2;
    min-height: auto;
    border-top: 1px solid var(--line-soft);
  }

  .scenario-panel > .control-group,
  .scenario-panel > .scenario-summary {
    display: inline-block;
    width: calc(50% - 0.35rem);
    vertical-align: top;
  }

  .scenario-panel > .control-group:nth-of-type(even),
  .scenario-panel > .scenario-summary {
    margin-left: 0.35rem;
  }
}

@media (max-width: 780px) {
  .app-header,
  .overview-heading,
  .workspace-heading,
  .canvas-toolbar,
  .app-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-state,
  .workspace-heading-state {
    justify-content: flex-start;
  }

  .project-grid,
  .target-grid {
    grid-template-columns: 1fr;
  }

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

  .workspace,
  .workspace[data-project="authorized"] {
    grid-template-columns: 1fr;
  }

  .project-rail {
    min-height: auto;
  }

  .project-nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layer-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .layer-panel .rail-label {
    grid-column: 1 / -1;
  }

  .rail-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .rail-legend .rail-label {
    width: 100%;
  }

  .scenario-panel,
  .workspace-main {
    grid-column: 1;
    min-height: auto;
  }

  .scenario-panel > .control-group,
  .scenario-panel > .scenario-summary {
    display: block;
    width: auto;
    margin-left: 0 !important;
  }

  .canvas-toolbar {
    gap: 0.6rem;
  }

  .canvas-toolbar > div:first-child {
    width: 100%;
  }

  .canvas-toolbar span {
    white-space: normal;
  }

  .canvas-shell {
    min-height: 460px;
    height: 62vh;
  }

  .selection-strip {
    grid-template-columns: 1fr auto;
  }

  .selection-strip p {
    grid-column: 1 / -1;
  }

  .authorized-project-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .app-header,
  .workspace-main,
  .project-rail,
  .scenario-panel {
    padding-left: 0.7rem;
    padding-right: 0.7rem;
  }

  .header-state {
    width: 100%;
  }

  .project-nav-list {
    grid-template-columns: 1fr;
  }

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

  .canvas-shell {
    min-height: 410px;
  }

  .summary-values,
  .authorized-project-facts {
    grid-template-columns: 1fr;
  }

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

  .selection-strip p {
    grid-column: 1;
  }

  .canvas-watermark {
    display: none;
  }

  .app-footer {
    align-items: stretch;
  }
}

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