:root {
  --ink: #20332f;
  --muted: #60706b;
  --green: #19644d;
  --green-dark: #104d3b;
  --mint: #e9f3ed;
  --paper: #f5f7f3;
  --white: #fff;
  --line: #d8e1d9;
  --red: #a12b35;
  --red-bg: #fff1f0;
  --amber: #7b5215;
  --amber-bg: #fff6df;
  --badge-bg: #eaf0eb;
  --badge-ink: #48604f;
  --radius: 14px;
  --shadow: 0 4px 20px #223b2c06;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
  line-height: 1.55;
}

.brand-prometheus {
  --green: #c74625;
  --green-dark: #a9351c;
  --mint: #fff0eb;
  --paper: #fffaf8;
  --line: #ead6ce;
  --shadow: 0 4px 20px #4b1b100a;
  --badge-bg: #fff0eb;
  --badge-ink: #c74625;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--green);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--green-dark);
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: .58;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex="-1"]:focus-visible {
  outline: 3px solid #357fb4;
  outline-offset: 4px;
}

h1,
h2,
h3 {
  line-height: 1.22;
  letter-spacing: -.025em;
  margin: 0 0 .65em;
}

h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.8rem);
  font-weight: 650;
}

h2 {
  font-size: 1.35rem;
  font-weight: 650;
}

h3 {
  font-size: 1.08rem;
}

p {
  margin: 0 0 1rem;
}

ul,
ol {
  padding-left: 1.4rem;
}

li + li {
  margin-top: .4rem;
}

[hidden] {
  display: none !important;
}

.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;
}

.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  padding: .8rem;
  background: white;
  z-index: 100;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  min-height: 84px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem clamp(1.2rem, 4vw, 4rem);
  background: #ffffffb3;
}

.site-header > a:not(.brand) {
  font-size: .9rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: 1.12rem;
  font-weight: 650;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--green);
  color: white;
  border-radius: 9px;
  font-size: 1.5rem;
  line-height: 1;
}

.brand-prometheus .brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 0;
  background: url("/assets/prometheus-logo.svg") center / contain no-repeat;
  color: transparent;
}

.brand-suffix {
  font-size: .95rem;
  font-weight: 400;
  color: var(--muted);
}

.header-caption {
  font-size: .85rem;
  color: var(--muted);
}

main {
  flex: 1;
  width: 100%;
}

.narrow {
  max-width: 760px;
  margin: auto;
  padding: 3.5rem 1.5rem;
}

.welcome {
  padding-top: clamp(3rem, 7vw, 6rem);
}

.eyebrow {
  text-transform: uppercase;
  font-size: .74rem;
  letter-spacing: .12em;
  color: var(--green);
  font-weight: 750;
  margin-bottom: 1rem;
}

.lede {
  font-size: 1.1rem;
  color: var(--muted);
  line-height: 1.75;
}

.card {
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
  margin: 1.5rem 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.inline-note {
  display: flex;
  gap: 1.2rem;
  margin: 2.3rem 0;
}

.inline-note h2 {
  font-size: 1.1rem;
}

.inline-note p {
  color: var(--muted);
}

.note-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
  font-size: 1.4rem;
}

.site-footer {
  color: var(--muted);
  text-align: center;
  font-size: .78rem;
  padding: 2rem 1.25rem;
}

.button,
button {
  border: 1px solid transparent;
  border-radius: 8px;
  padding: .7rem 1.1rem;
  font-weight: 600;
  background: var(--green);
  color: white;
  line-height: 1.4;
  min-height: 44px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}

.button:hover,
button:hover {
  background: var(--green-dark);
  color: white;
}

.secondary {
  background: white;
  border-color: var(--line);
  color: var(--ink);
}

.secondary:hover {
  background: var(--mint);
  color: var(--green-dark);
  border-color: #abc4b4;
}

.quiet {
  background: transparent;
  color: var(--green);
  border-color: transparent;
}

.quiet:hover {
  background: var(--mint);
  color: var(--green-dark);
}

.danger {
  background: white;
  color: var(--red);
  border-color: #e4c6c7;
}

.danger:hover {
  background: var(--red-bg);
  color: var(--red);
}

.small {
  padding: .45rem .75rem;
  font-size: .85rem;
  min-height: 38px;
}

.actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .7rem;
}

.actions.spread {
  justify-content: space-between;
}

.muted,
.help {
  color: var(--muted);
}

.help {
  font-size: .85rem;
  line-height: 1.55;
  margin: .4rem 0 .9rem;
}

.tiny {
  font-size: .75rem;
}

.divider {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 1.6rem 0;
}

.message {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin: 1rem 0;
  background: var(--mint);
  overflow-wrap: anywhere;
}

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

.message.warning {
  color: var(--amber);
  border-color: #ebd9ae;
  background: var(--amber-bg);
}

.message p:last-child {
  margin: 0;
}

.message .actions {
  margin-top: .7rem;
}

.loading-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  min-height: 260px;
  color: var(--muted);
}

.loading-card p {
  margin: 0;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--line);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation: none;
  }
}

label,
.field-label {
  display: block;
  font-weight: 600;
  font-size: .92rem;
  margin: 0 0 .45rem;
}

input:not([type=checkbox]):not([type=radio]),
select,
textarea {
  display: block;
  width: 100%;
  border: 1px solid #b9c9bf;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: .7rem .8rem;
  min-height: 44px;
}

input[type=file] {
  font-size: .85rem;
}

input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

textarea {
  resize: vertical;
  line-height: 1.55;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f0f3f0;
  color: var(--muted);
}

.field {
  margin-bottom: 1.25rem;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.2rem;
}

.checkbox-label {
  display: flex;
  gap: .6rem;
  align-items: center;
  font-weight: 400;
}

.mono,
code,
pre {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .85rem;
}

pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  padding: 1.1rem;
  background: #f2f5f1;
  border-radius: 8px;
  max-height: 550px;
  overflow: auto;
}

code {
  overflow-wrap: anywhere;
}

details > summary {
  cursor: pointer;
  padding: .6rem 0;
  font-weight: 600;
}

details > p {
  margin-top: .5rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 5px;
  padding: .2rem .55rem;
  font-size: .74rem;
  font-weight: 650;
  background: var(--badge-bg);
  color: var(--badge-ink);
  white-space: nowrap;
}

.badge.open {
  background: #e1f1e7;
  color: #19613c;
}

.badge.paused,
.badge.pilot {
  background: var(--amber-bg);
  color: var(--amber);
}

.badge.closed {
  background: #edf0f0;
  color: #536262;
}

.section-heading {
  display: flex;
  gap: 1rem;
  align-items: start;
  justify-content: space-between;
  margin: 1.5rem 0 1rem;
}

.section-heading h1,
.section-heading h2 {
  margin-bottom: .3rem;
}

.section-heading p {
  margin: 0;
}

.empty {
  padding: 2.5rem 1.3rem;
  text-align: center;
  border: 1px dashed #bdcfc2;
  border-radius: 12px;
  color: var(--muted);
}

.participant-shell {
  max-width: 850px;
  margin: auto;
  padding: 2.5rem 1.5rem;
}

.instructions {
  white-space: pre-wrap;
}

.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 1rem;
  counter-reset: step;
  margin: 1.4rem 0;
}

.steps li {
  display: flex;
  gap: .8rem;
  align-items: start;
  margin: 0;
}

.steps li:before {
  counter-increment: step;
  content: counter(step);
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--mint);
  color: var(--green);
  width: 26px;
  height: 26px;
  text-align: center;
  font-size: .85rem;
  line-height: 26px;
  font-weight: 700;
}

.progress-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .8rem;
  margin-bottom: .5rem;
}

.progress-track {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 10px;
  background: var(--line);
  overflow: hidden;
  margin-bottom: 2rem;
}

.progress-track::-webkit-progress-bar {
  background: var(--line);
  border-radius: 10px;
}

.progress-track::-webkit-progress-value {
  background: var(--green);
  border-radius: 10px;
}

.progress-track::-moz-progress-bar {
  background: var(--green);
  border-radius: 10px;
}

.task-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem;
  margin-bottom: 1.4rem;
}

.task-card h1 {
  font-size: 1.35rem;
  line-height: 1.55;
  margin: 0;
  letter-spacing: -.01em;
}

.task-card .eyebrow {
  margin-bottom: .5rem;
}

.task-prompt {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tree-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
}

.tree-toolbar {
  padding: .65rem .9rem;
  display: flex;
  gap: .5rem;
  border-bottom: 1px solid var(--line);
  background: #f8faf7;
  align-items: center;
}

.breadcrumbs {
  padding: .7rem 1.1rem;
  border-bottom: 1px solid var(--line);
  font-size: .85rem;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumbs li {
  display: flex;
  gap: .25rem;
  align-items: center;
  margin: 0;
}

.breadcrumbs li + li:before {
  content: "/";
  color: #86988d;
}

.breadcrumbs button {
  font-size: .85rem;
  min-height: 36px;
  padding: .3rem .4rem;
}

.breadcrumbs span {
  padding: .3rem .4rem;
  overflow-wrap: anywhere;
}

.tree-location {
  padding: 1.1rem 1.3rem .4rem;
}

.tree-location h2 {
  font-size: 1.05rem;
  margin: 0;
}

.tree-location p {
  margin: .4rem 0;
}

.tree-list {
  list-style: none;
  padding: 0 .8rem .8rem;
  margin: 0;
}

.tree-list li {
  margin: .35rem 0 0;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: .65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .7rem;
  min-height: 64px;
}

.tree-row:hover {
  background: #fafcf9;
}

.tree-row.is-selected {
  background: var(--mint);
  border-color: var(--green);
}

.node-icon {
  color: var(--muted);
  width: 24px;
  flex-shrink: 0;
  font-size: 1.15rem;
  text-align: center;
}

.node-info {
  flex: 1;
  min-width: 0;
}

.node-label {
  font-size: .95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.node-meta {
  display: block;
  color: var(--muted);
  font-size: .75rem;
}

.node-actions {
  display: flex;
  gap: .35rem;
  flex-shrink: 0;
}

.node-actions button {
  font-size: .85rem;
  padding: .45rem .7rem;
  min-height: 40px;
}

.current-page {
  margin: .6rem 1rem 1rem;
  background: #f4f8f3;
  border-radius: 8px;
  padding: .85rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.current-page p {
  margin: 0;
}

.selection-card {
  margin: 1rem 0;
  padding: 1.15rem;
  border: 1px solid #9fc2ac;
  background: var(--mint);
  border-radius: 10px;
}

.selection-card p {
  margin-bottom: .7rem;
}

.selection-path {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.task-exits {
  margin-top: 1rem;
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.save-status {
  font-size: .75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-left: auto;
}

.save-status:before {
  content: "";
  width: 6px;
  height: 6px;
  background: #87a491;
  border-radius: 50%;
}

.completion {
  max-width: 620px;
  margin: 2rem auto;
  text-align: center;
}

.completion-symbol {
  font-size: 2rem;
  border-radius: 50%;
  width: 72px;
  height: 72px;
  background: var(--mint);
  color: var(--green);
  display: grid;
  place-items: center;
  margin: 0 auto 1.5rem;
}

.practice-banner {
  padding: .75rem 1rem;
  border-radius: 9px;
  background: var(--amber-bg);
  color: var(--amber);
  font-size: .85rem;
  margin-bottom: 1.25rem;
}

.admin-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 2rem clamp(1rem, 3vw, 3rem);
}

.login-card {
  max-width: 440px;
  margin: 2rem auto;
}

.workspace-nav {
  display: flex;
  gap: .4rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: .7rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
}

.workspace-nav button {
  background: transparent;
  color: var(--muted);
  font-weight: 550;
}

.workspace-nav button[aria-current=page] {
  background: var(--mint);
  color: var(--green);
  font-weight: 700;
}

.workspace-nav button:hover {
  background: #eaf0e9;
  color: var(--green);
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.editor-section {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  min-width: 0;
}

.editor-section + .editor-section {
  margin-top: 1.25rem;
}

.editor-textarea {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: .82rem;
  tab-size: 2;
  min-height: 360px;
}

.file-tabs {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin: .8rem 0;
}

.file-tabs button {
  font-size: .78rem;
  min-height: 36px;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.file-tabs button[aria-pressed=true] {
  background: var(--green);
  color: white;
}

.preview-tree {
  list-style: none;
  padding-left: 1rem;
  margin: .3rem 0;
  border-left: 1px solid var(--line);
}

.preview-tree li {
  margin: .35rem 0;
}

.preview-tree > li > span {
  font-size: .86rem;
  overflow-wrap: anywhere;
}

.preview-tree code {
  font-size: .72rem;
  margin-left: .4rem;
  color: var(--muted);
}

.preview-tree .badge {
  margin-left: .4rem;
  font-size: .64rem;
}

.mapping-card {
  padding: .8rem 0;
  border-top: 1px solid var(--line);
}

.mapping-card p {
  margin: .3rem 0;
  font-size: .9rem;
}

.mapping-card ul {
  font-size: .82rem;
}

.list-card {
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  margin: .7rem 0;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.list-card h3 {
  margin: 0 0 .2rem;
}

.list-card p {
  margin: 0;
  font-size: .82rem;
  color: var(--muted);
}

.list-card .actions {
  justify-content: flex-end;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.3rem 0;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  padding: 1.15rem;
}

.metric dt {
  font-size: .8rem;
  color: var(--muted);
}

.metric dd {
  font-size: 1.85rem;
  font-weight: 650;
  margin: .25rem 0 0;
  letter-spacing: -.03em;
}

.metric dd.timestamp {
  font-size: .9rem;
  letter-spacing: 0;
  margin-top: .6rem;
}

.table-wrap {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  margin: 1rem 0;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  text-align: right;
  border-bottom: 1px solid var(--line);
  padding: .75rem .85rem;
  white-space: nowrap;
}

th {
  font-size: .73rem;
  color: var(--muted);
  font-weight: 650;
  background: #f2f6f0;
}

th:first-child,
td:first-child {
  text-align: left;
}

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

caption {
  text-align: left;
  padding: .85rem;
  font-weight: 650;
  font-size: .95rem;
  background: white;
}

.filter-bar {
  display: flex;
  gap: 1rem;
  align-items: end;
  flex-wrap: wrap;
  margin: 1rem 0;
}

.filter-bar .field {
  margin: 0;
  min-width: 160px;
}

.status-strip {
  display: flex;
  gap: .7rem;
  align-items: center;
  flex-wrap: wrap;
}

.definition-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
}

.definition-grid p {
  font-size: .85rem;
  margin: 0;
}

.definition-grid strong {
  display: block;
}

.private-section {
  border-left: 3px solid #c29749;
  padding-left: 1rem;
  margin: 1.5rem 0;
}

.download-links {
  display: flex;
  gap: .6rem;
  flex-wrap: wrap;
}

.dirty-indicator {
  font-size: .78rem;
  color: var(--amber);
}

.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: #f5f7f3f5;
  border-top: 1px solid var(--line);
  padding: 1rem 0;
  margin-top: 1.5rem;
  backdrop-filter: blur(10px);
}

dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.7rem;
  max-width: 520px;
  width: calc(100% - 2rem);
  color: var(--ink);
  box-shadow: 0 20px 100px #14352233;
}

dialog::backdrop {
  background: #142a2359;
}

dialog h2 {
  margin-bottom: .8rem;
}

dialog .actions {
  justify-content: flex-end;
  margin-top: 1.3rem;
}

.word-break {
  overflow-wrap: anywhere;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
}

.readout {
  white-space: pre-wrap;
}

.subtle-link {
  font-size: .85rem;
}

.identity-name {
  margin: 0;
}

.created-at {
  margin-top: .5rem !important;
}

.invite-link {
  margin-top: .8rem;
  display: grid;
  gap: .45rem;
}

.retention-overdue {
  color: var(--red) !important;
  font-weight: 650;
}

@media (max-width: 760px) {
  .site-header {
    min-height: 72px;
    padding: 1rem;
  }

  .brand-suffix {
    display: none;
  }

  .participant-shell {
    padding: 1.6rem 1rem;
  }

  .admin-shell {
    padding: 1.4rem 1rem;
  }

  .editor-grid,
  .two-col,
  .definition-grid {
    grid-template-columns: 1fr;
  }

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

  .list-card {
    align-items: start;
    flex-direction: column;
  }

  .list-card .actions {
    justify-content: flex-start;
  }

  .section-heading {
    flex-direction: column;
  }

  .card {
    padding: 1.25rem;
  }

  .task-card {
    padding: 1.15rem;
  }

  .header-caption {
    font-size: .75rem;
  }

  .save-status {
    font-size: .68rem;
  }

  .node-actions button {
    padding: .45rem .55rem;
  }

  .tree-row {
    gap: .4rem;
    padding: .6rem .5rem;
  }

  .node-icon {
    display: none;
  }

  .tree-toolbar {
    padding: .5rem;
  }

  .tree-toolbar button {
    padding: .45rem .6rem;
  }

  .current-page {
    align-items: start;
    flex-direction: column;
  }

  .sticky-actions .actions {
    gap: .5rem;
  }

  .sticky-actions button {
    padding: .6rem .8rem;
  }

  .site-footer {
    padding: 1.5rem 1rem;
  }

  .filter-bar .field {
    flex: 1;
  }

  .welcome {
    padding-top: 2.5rem;
  }
}

@media (max-width: 430px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .node-actions {
    flex-direction: column;
  }

  .node-actions button {
    min-width: 72px;
    min-height: 36px;
  }

  .brand {
    font-size: 1rem;
  }

  .header-caption {
    max-width: 100px;
    text-align: right;
  }

  .metric {
    padding: .9rem;
  }

  .metric dd {
    font-size: 1.5rem;
  }

  .tree-toolbar {
    flex-wrap: wrap;
  }

  .save-status {
    width: 100%;
    margin-left: .5rem;
  }

  .site-header .actions {
    gap: .35rem;
  }

  .site-header .badge {
    display: none;
  }
}
