:root {
  --bg: #f3f0e8;
  --panel: #fffdf8;
  --text: #1f1e1a;
  --muted: #5a564d;
  --line: #d9d0c0;
  --accent: #1f6f61;
  --accent-soft: #e7f2ef;
  --warn: #a3523a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(160deg, #f5f2ea 0%, #ebe4d6 100%);
  color: var(--text);
  font-family: "IBM Plex Mono", monospace;
}

h1,
h2,
h3,
h4 {
  font-family: "Archivo Expanded", sans-serif;
  margin-top: 0;
}

p {
  line-height: 1.55;
}

a {
  color: var(--accent);
}

.shell {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.25rem;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  align-items: flex-end;
}

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

.title-wrap h1 {
  margin-bottom: 0.2rem;
  font-size: 1.8rem;
}

.title-wrap p {
  margin: 0;
  color: var(--muted);
}

.demo-banner {
  margin-top: 1rem;
  background: var(--accent-soft);
  border: 1px solid #b9d8d1;
  border-radius: 10px;
  padding: 0.85rem 1rem;
}

.demo-banner p {
  margin: 0.25rem 0;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.tab-btn {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
}

.tab-btn.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.content {
  margin-top: 1rem;
}

.view {
  display: none;
  gap: 1rem;
}

.view.is-active {
  display: grid;
}

.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  padding: 1rem;
}

.inline-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.steps-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.step-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  background: #faf7f1;
}

.step-card h3 {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.allow-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.45rem;
}

.section-grid {
  display: grid;
  gap: 0.8rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.section-cell {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  background: #faf7f1;
}

.section-name {
  color: var(--muted);
  font-size: 0.85rem;
}

.section-value {
  font-size: 1.25rem;
  margin-top: 0.4rem;
}

.module-section {
  margin-bottom: 1rem;
}

.accordion-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf7;
  margin-bottom: 0.75rem;
}

.section-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: center;
  text-align: left;
  border: 0;
  border-radius: 8px;
  padding: 0.75rem;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}

.section-toggle.is-open {
  border-bottom: 1px solid var(--line);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.section-panel {
  display: none;
  padding: 0.75rem;
}

.section-panel.is-open {
  display: block;
}

.module-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.75rem;
  background: #fbfaf7;
}

.module-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
}

.module-head h4 {
  margin-bottom: 0.4rem;
  font-size: 1rem;
}

form {
  display: grid;
  gap: 0.45rem;
}

label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.55rem;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.6rem 0.7rem;
  font-family: inherit;
  background: white;
}

textarea {
  min-height: 90px;
}

.primary-btn,
.secondary-btn {
  border-radius: 6px;
  padding: 0.56rem 0.85rem;
  cursor: pointer;
  font-family: inherit;
}

.primary-btn {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: white;
}

.secondary-btn {
  border: 1px solid var(--line);
  background: white;
  color: var(--text);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.form-note {
  margin-bottom: 0;
  min-height: 1.4em;
}

.form-note.is-error {
  color: var(--warn);
}

.form-note.is-ok {
  color: var(--accent);
}

.submission-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.75rem;
  background: #fcfbf8;
}

.submission-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

.submission-head h4 {
  margin-bottom: 0.35rem;
  font-size: 1rem;
}

.vote-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.badge {
  font-size: 0.73rem;
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  border: 1px solid transparent;
}

.badge.pending {
  background: #f4f0e4;
  border-color: #d6c79f;
}

.badge.approved {
  background: #e6f3ef;
  border-color: #a9d2c8;
}

.badge.rejected {
  background: #f8ece8;
  border-color: #e0b7aa;
}

.mini-note {
  color: var(--muted);
  font-size: 0.84rem;
  margin: 0.25rem 0;
}

.empty-state {
  color: var(--muted);
  margin: 0.35rem 0;
}

.link-list {
  margin: 0.35rem 0;
  padding-left: 1.1rem;
}

.credit-table {
  width: 100%;
  border-collapse: collapse;
}

.credit-table th,
.credit-table td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.35rem;
}

.module-status-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}

.module-status-meta {
  display: grid;
  justify-items: end;
  gap: 0.35rem;
}

@media (max-width: 720px) {
  .shell {
    padding: 1rem;
  }

  .title-wrap h1 {
    font-size: 1.35rem;
  }

  .module-status-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .module-status-meta {
    justify-items: start;
  }
}
