:root {
  color-scheme: light;
  --beacon: #ff6a2c;
  --beacon-dark: #cf4610;
  --ink: #10131a;
  --ink-soft: #252b36;
  --paper: #ffffff;
  --canvas: #f5f7fa;
  --line: #dde3ea;
  --line-strong: #c8d0da;
  --muted: #667180;
  --quiet: #eef2f6;
  --blue: #1269d3;
  --green: #08795f;
  --yellow: #9a6700;
  --red: #a4193d;
  --blue-bg: #eaf2ff;
  --green-bg: #e8f6f1;
  --yellow-bg: #fff7db;
  --red-bg: #fdebf0;
  --shadow: 0 10px 30px rgba(25, 32, 44, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-width: 0;
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

svg {
  display: block;
}

button,
input,
select,
textarea {
  max-width: 100%;
  font: inherit;
}

button,
.button-link {
  display: inline-flex;
  min-height: 38px;
  max-width: 100%;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

button.secondary,
.button-link.secondary {
  border-color: var(--line-strong);
  background: var(--paper);
  color: var(--ink);
}

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

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
}

input[type="file"] {
  min-height: 42px;
  padding: 8px;
  overflow: hidden;
}

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

label {
  display: block;
  margin: 12px 0 5px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
}

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

h1,
h2,
h3,
.wordmark {
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.08;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
}

h3 {
  font-size: 14px;
  line-height: 1.2;
}

pre,
code,
.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
}

pre {
  width: 100%;
  max-width: 100%;
  max-height: 360px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

details {
  min-width: 0;
}

summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 800;
}

.slipway-shell {
  min-width: 0;
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(170px, auto) minmax(0, 1fr) minmax(280px, auto);
  gap: 18px;
  align-items: center;
  padding: 12px clamp(14px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
  background: rgba(245, 247, 250, 0.96);
  backdrop-filter: blur(14px);
}

.topbar > * {
  min-width: 0;
}

.brand-lockup {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.slipway-mark {
  width: 42px;
  height: 28px;
  flex: 0 0 auto;
}

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

.wordmark {
  font-size: 23px;
  font-weight: 850;
  line-height: 1;
}

.dot {
  color: var(--beacon);
}

.product-tag {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.top-nav {
  display: flex;
  min-width: 0;
  justify-content: flex-end;
  gap: 4px;
}

.top-nav a {
  min-width: 0;
  padding: 7px 9px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.top-nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.global-session {
  display: grid;
  grid-template-columns: minmax(120px, 190px) auto auto auto;
  gap: 6px;
  align-items: center;
  justify-content: end;
  min-width: 0;
}

.global-session select {
  min-height: 34px;
  padding-block: 5px;
}

.global-session button {
  min-height: 34px;
  padding: 6px 10px;
}

.global-session-state {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--quiet);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.state-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: var(--line);
}

.state-cell {
  min-width: 0;
  padding: 9px clamp(12px, 3vw, 28px);
  background: var(--paper);
}

.state-cell span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.state-cell strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page {
  width: min(100%, 1180px);
  max-width: 100vw;
  margin: 0 auto;
  padding: 24px clamp(14px, 3vw, 28px) 52px;
}

.page-titlebar {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(280px, 560px);
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
}

.login-gate {
  display: grid;
  min-height: calc(100vh - 210px);
  align-items: start;
  padding-top: clamp(20px, 8vh, 76px);
}

.login-gate[hidden],
#authenticated-app[hidden] {
  display: none;
}

.login-surface {
  width: min(100%, 560px);
  margin: 0 auto;
}

.login-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  margin-top: 18px;
}

.login-actions select {
  min-width: 0;
}

.page-kicker,
.section-kicker {
  margin-bottom: 5px;
  color: var(--beacon-dark);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-lead {
  max-width: 100%;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.overview-grid,
.activity-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: 14px;
}

.application-workspace,
.launch-workspace,
.operations-workspace {
  display: grid;
  grid-template-columns: minmax(260px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.surface {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.span-2 {
  grid-column: 1 / -1;
}

.section-titlebar {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-titlebar > div {
  min-width: 0;
}

.session-actions {
  align-items: flex-start;
}

.muted {
  margin-top: 8px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.action-row,
.button-group {
  display: flex;
  max-width: 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.action-row {
  margin-top: 14px;
}

.align-end {
  justify-content: flex-end;
}

.button-group {
  justify-content: flex-end;
}

.status-line {
  min-height: 22px;
  margin-top: 10px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status-line.ok {
  color: var(--green);
}

.status-line.warn {
  color: var(--yellow);
}

.status-line.bad {
  color: var(--red);
}

.status-badge,
.pill {
  display: inline-flex;
  min-height: 24px;
  max-width: 100%;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--quiet);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.pill {
  justify-self: end;
  white-space: nowrap;
}

.pill.proposed {
  background: var(--blue-bg);
  color: var(--blue);
}

.pill.submitted {
  background: #fff0e7;
  color: var(--beacon-dark);
}

.pill.observed {
  background: var(--green-bg);
  color: var(--green);
}

.pill.expired {
  background: var(--yellow-bg);
  color: var(--yellow);
}

.pill.failed {
  background: var(--red-bg);
  color: var(--red);
}

.pill.blocked {
  background: var(--red-bg);
  color: var(--red);
}

.pill.draft {
  background: var(--blue-bg);
  color: var(--blue);
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.metric-row.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 6px;
  font-family: "Space Grotesk", Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 26px;
  line-height: 1;
}

.kv-list {
  display: grid;
  grid-template-columns: minmax(120px, 190px) minmax(0, 1fr);
  gap: 7px 12px;
  min-width: 0;
  overflow-wrap: anywhere;
}

.kv-list.compact {
  margin-top: 12px;
  grid-template-columns: minmax(90px, 130px) minmax(0, 1fr);
}

.kv-list dt {
  color: var(--muted);
  font-weight: 750;
}

.kv-list dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.proposal-list,
.application-list,
.compact-list,
.lifecycle-grid {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.lifecycle-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-top: 14px;
}

.lifecycle-item {
  display: grid;
  min-width: 0;
  gap: 8px;
  align-content: start;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.lifecycle-item > span:first-child {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
}

.list-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  width: 100%;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

a.list-item {
  color: inherit;
  text-decoration: none;
}

.list-item.actionable {
  cursor: pointer;
}

.list-item.actionable[aria-pressed="true"],
.list-item.actionable:hover {
  border-color: var(--ink);
  background: var(--quiet);
}

.list-title {
  min-width: 0;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.list-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.empty {
  min-width: 0;
  padding: 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 7px;
  background: #fbfcfd;
  color: var(--muted);
  overflow-wrap: anywhere;
}

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

.policy-import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;
  margin-top: 10px;
}

.policy-json-editor {
  min-height: 260px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.policy-import-results {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.policy-import-results > section {
  min-width: 0;
}

.policy-import-results > section:last-child {
  grid-column: 1 / -1;
}

.diagnostic-list {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin-top: 10px;
}

.diagnostic {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.diagnostic.warning {
  border-color: #e7ca73;
  background: var(--yellow-bg);
}

.diagnostic.error {
  border-color: #efb8c6;
  background: var(--red-bg);
}

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

.details-block {
  margin-top: 12px;
}

.details-block summary {
  margin-bottom: 8px;
}

.activity-table {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.activity-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.25fr) minmax(95px, 0.7fr) minmax(90px, 0.65fr) minmax(120px, 0.8fr) auto;
  gap: 10px;
  align-items: start;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fbfcfd;
}

.activity-row.header {
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  box-shadow: none;
}

.activity-row > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

.operations-controls .action-row button {
  width: auto;
}

@media (max-width: 920px) {
  .topbar,
  .page-titlebar,
  .overview-grid,
  .activity-workspace,
  .application-workspace,
  .launch-workspace,
  .operations-workspace {
    grid-template-columns: 1fr;
  }

  .global-session {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    justify-content: stretch;
  }

  .top-nav {
    justify-content: flex-start;
  }

  .page-titlebar {
    align-items: start;
  }

  .page-lead {
    max-width: 680px;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 13px;
  }

  .topbar {
    gap: 10px;
    padding: 11px 12px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .slipway-mark {
    width: 36px;
    height: 24px;
  }

  .wordmark {
    font-size: 20px;
  }

  .top-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    width: 100%;
    max-width: calc(100vw - 24px);
  }

  .top-nav a {
    display: flex;
    min-height: 32px;
    align-items: center;
    flex: 0 0 68px;
    justify-content: center;
    padding: 5px 4px;
    overflow: hidden;
    font-size: 10px;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .global-session {
    grid-template-columns: 1fr 1fr;
    width: 100%;
    max-width: calc(100vw - 24px);
  }

  .global-session select,
  .global-session-state {
    grid-column: 1 / -1;
  }

  .login-gate {
    min-height: auto;
    padding-top: 18px;
  }

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

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

  .state-cell {
    padding: 8px 12px;
  }

  .page {
    width: 100vw;
    max-width: 100vw;
    padding: 18px 12px 38px;
  }

  .page-titlebar,
  .overview-grid,
  .activity-workspace,
  .application-workspace,
  .launch-workspace,
  .operations-workspace {
    width: 100%;
    max-width: calc(100vw - 24px);
  }

  .page-lead,
  .muted {
    width: 38ch;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  h1 {
    font-size: 26px;
  }

  .surface {
    padding: 12px;
  }

  .page-titlebar > *,
  .surface > * {
    min-width: 0;
  }

  .section-titlebar,
  .session-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .button-group,
  .align-end {
    justify-content: stretch;
  }

  .button-group button,
  .action-row button,
  .button-link {
    flex: 1 1 100%;
    width: 100%;
  }

  .metric-row,
  .metric-row.four,
  .lifecycle-grid,
  .form-grid,
  .policy-import-grid,
  .policy-import-results,
  .kv-list,
  .kv-list.compact {
    grid-template-columns: 1fr;
  }

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

  .pill {
    justify-self: start;
  }

  .activity-row,
  .activity-row.header {
    grid-template-columns: 1fr;
  }

  .activity-row.header {
    display: none;
  }
}
