:root {
  color-scheme: light;
  --bg: #f4efe4;
  --surface: rgba(255, 252, 245, 0.9);
  --surface-strong: #fffdf7;
  --text: #1e1a16;
  --muted: #6d6257;
  --brand: #1e6b52;
  --brand-strong: #124836;
  --line: rgba(30, 26, 22, 0.12);
  --shadow: 0 30px 80px rgba(33, 23, 11, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "PingFang SC", "Helvetica Neue", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(241, 200, 133, 0.4), transparent 28%),
    radial-gradient(circle at bottom right, rgba(64, 139, 111, 0.28), transparent 30%),
    linear-gradient(135deg, #f7f0e4 0%, #efe6d6 100%);
  min-height: 100vh;
}

button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 48px 20px 72px;
}

.shell-wide {
  width: min(100%, 980px);
}

.hero-card {
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 32px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero-card-compact {
  padding-top: 28px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  margin: 0 0 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
  line-height: 0.98;
}

.lede {
  margin: 18px 0 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
  max-width: 60ch;
}

.info-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(30, 107, 82, 0.08);
  color: var(--brand-strong);
  font-weight: 700;
}

.auth-stack,
.form-grid,
.stats-grid,
.dashboard-grid {
  margin-top: 30px;
}

.auth-card,
.dashboard-grid {
  display: grid;
  gap: 18px;
}

.auth-card {
  align-self: start;
}

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

.panel-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.62);
}

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

.panel-header h2 {
  margin: 0;
  font-size: 1.18rem;
}

.auth-subheader {
  margin-top: 4px;
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.text-link,
.muted-copy {
  color: var(--muted);
  text-decoration: none;
}

.text-link:hover {
  color: var(--brand);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 0.94rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

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

.stat-card {
  padding: 20px 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.stat-label,
.stat-subtle {
  display: block;
  color: var(--muted);
}

.stat-value {
  display: block;
  margin-top: 10px;
  font-size: clamp(1.5rem, 4vw, 2.3rem);
}

.submission-panel {
  margin-top: 18px;
}

.notes-list {
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.7;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 10px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
}

textarea {
  resize: vertical;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  background: var(--brand);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--brand-strong);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 700;
  text-decoration: none;
}

.ghost-button:hover {
  color: white;
}

.ghost-button {
  color: var(--brand);
  background: rgba(30, 107, 82, 0.08);
}

.header-row {
  display: flex;
  gap: 16px;
  align-items: start;
  justify-content: space-between;
}

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

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 30px;
}

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

.project-tile {
  display: grid;
  gap: 12px;
  min-height: 180px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text);
  text-decoration: none;
}

.project-tile strong {
  font-size: 1.2rem;
}

.project-tile span:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.project-kicker {
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 700;
}

.project-tile-disabled {
  opacity: 0.62;
}

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

.action-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.message {
  min-height: 1.5em;
  margin: 0;
  color: var(--brand-strong);
}

.af3-validation-panel {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
}

.af3-validation-panel h3 {
  margin: 0;
}

.af3-json-preview {
  max-height: 360px;
}

.af3-workbench {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 252, 245, 0.9)),
    var(--surface);
}

.af3-entity-form {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.af3-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.compact-form {
  max-width: 560px;
}

.entity-row {
  display: grid;
  grid-template-columns: 28px minmax(150px, 0.34fr) minmax(96px, 0.18fr) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid rgba(30, 26, 22, 0.14);
  border-radius: 20px;
  background: #fbfaf6;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.entity-grip {
  padding-top: 14px;
  color: rgba(30, 26, 22, 0.32);
  font-weight: 800;
  line-height: 0.8;
  text-align: center;
}

.entity-type {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(30, 107, 82, 0.1);
  color: var(--brand-strong);
  font-weight: 800;
}

.entity-type-select select {
  min-height: 48px;
  font-weight: 700;
}

.entity-copies input {
  text-align: center;
}

.entity-sequence textarea {
  min-height: 132px;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  line-height: 1.45;
}

.entity-remove-button {
  align-self: end;
  padding: 12px 16px;
}

.hidden {
  display: none;
}

.ops-app {
  margin-top: 24px;
}

.ops-workspace-grid {
  margin-top: 18px;
}

.ops-block + .ops-block {
  margin-top: 18px;
}

.ops-pre {
  margin: 10px 0 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: #f8f4eb;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
}

.ops-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.ops-list-item {
  text-align: left;
  border-radius: 18px;
  background: rgba(30, 107, 82, 0.08);
  color: var(--brand-strong);
}

.ops-list-item.active {
  background: var(--brand);
  color: white;
}

.ops-editor {
  min-height: 360px;
  font-family: "SFMono-Regular", "Menlo", "Monaco", monospace;
  line-height: 1.5;
}

.ops-editor-short {
  min-height: 180px;
}

.ops-table-browser {
  margin-top: 16px;
  overflow: auto;
}

.ops-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.ops-table th,
.ops-table td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ops-table th {
  background: rgba(30, 107, 82, 0.08);
}

.ops-table-actions {
  min-width: 132px;
  white-space: nowrap;
}

.ops-table-actions button + button {
  margin-left: 8px;
}

.ops-row-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
}

.ops-row-form h3 {
  grid-column: 1 / -1;
  margin: 0;
}

.ops-row-form label:has(textarea) {
  grid-column: 1 / -1;
}

.danger-button {
  background: #9f342f;
}

.danger-button:hover {
  background: #7e251f;
}

@media (max-width: 720px) {
  .shell,
  .shell-wide {
    padding: 24px 14px 42px;
  }

  .hero-card {
    border-radius: 24px;
    padding: 22px;
  }

  .hero-grid,
    .form-grid,
    .af3-meta-grid,
    .project-grid,
    .project-grid-two,
    .ops-row-form,
    .dashboard-grid,
    .stats-grid,
    .entity-row {
    grid-template-columns: 1fr;
  }

  .action-row,
  .header-row,
  .panel-header {
    flex-direction: column;
    align-items: stretch;
  }
}
