:root {
  color-scheme: light;
  --ink: #16201b;
  --muted: #65746d;
  --line: #d9e2dd;
  --panel: #ffffff;
  --wash: #f2f6f3;
  --accent: #0d7f5f;
  --accent-dark: #095f49;
  --charcoal: #1f2b26;
  --gold: #c99324;
  --danger: #a13a3a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(13, 127, 95, 0.08), transparent 360px),
    linear-gradient(135deg, #f7fbf8 0%, #edf5f0 45%, #fff7e8 100%);
  color: var(--ink);
}

button,
input,
textarea {
  font: inherit;
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

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

button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.primary-link {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.subtle {
  background: rgba(255, 255, 255, 0.72);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
}

input {
  min-height: 48px;
  padding: 0 14px;
}

textarea {
  min-height: 156px;
  resize: vertical;
  padding: 14px;
  line-height: 1.5;
}

label,
.eyebrow,
.stat span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.top-actions,
.result-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.topbar h1 {
  margin: 4px 0 0;
  max-width: 860px;
  font-size: clamp(2.3rem, 7vw, 5.9rem);
  line-height: 0.9;
}

.eyebrow {
  margin: 0;
  color: var(--accent-dark);
}

.lede {
  max-width: 620px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
}

.round-hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid #cfdad4;
  border-radius: 8px;
  background: #cfdad4;
  margin-bottom: 16px;
  box-shadow: 0 20px 60px rgba(23, 40, 32, 0.08);
}

.round-hero > div {
  padding: 20px;
  background: rgba(255, 255, 255, 0.84);
}

.round-hero strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: clamp(1.45rem, 4vw, 2.4rem);
  line-height: 1;
}

.grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 16px;
  align-items: start;
}

.panel,
.activity,
.next-steps {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 50px rgba(23, 40, 32, 0.08);
}

.status-panel {
  display: grid;
}

.stat {
  display: grid;
  gap: 8px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.stat:last-child {
  border-bottom: 0;
}

.stat strong {
  overflow-wrap: anywhere;
  font-size: 1.05rem;
}

.workspace {
  padding: 20px;
}

.contract-tools {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(246, 250, 247, 0.8);
  padding: 14px;
  margin-bottom: 16px;
}

.contract-tools summary {
  cursor: pointer;
  font-weight: 800;
}

.contract-tools label {
  display: block;
  margin-top: 14px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 8px;
}

.share-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
}

.deploy-grid {
  grid-template-columns: 340px 1fr;
}

.deploy-form {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.deploy-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.result-box {
  margin-top: 18px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.result-box h2 {
  margin: 6px 0 14px;
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.members {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.progress-track {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5ece8;
  margin-top: 14px;
}

#progressFill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease;
}

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

.section-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.section-head span {
  display: inline-grid;
  min-width: 34px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: #e6f3ed;
  color: var(--accent-dark);
  font-weight: 800;
}

#membersList,
#activityLog {
  padding: 0;
  margin: 14px 0 0;
  list-style: none;
}

#membersList li,
#activityLog li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

#membersList li:first-child,
#activityLog li:first-child {
  border-top: 0;
}

#membersList li.member-row {
  align-items: center;
}

.member-row > span {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.member-row small {
  color: var(--muted);
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

.member-row.current-wallet {
  background: #edf8f2;
  margin: 0 -10px;
  padding-left: 10px;
  padding-right: 10px;
  border-radius: 8px;
}

.member-badges {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.recipient-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: #fff4d8;
  color: #8f620d;
  font-weight: 900;
}

.paid-badge,
.waiting-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.82rem;
}

.paid-badge {
  background: #e6f3ed;
  color: var(--accent-dark);
}

.waiting-badge {
  background: #f7eee3;
  color: #8a5b12;
}

.activity {
  margin-top: 16px;
  padding: 18px;
}

.next-steps {
  margin-top: 16px;
  padding: 18px;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.step {
  min-height: 116px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfb;
  padding: 16px;
}

.step strong {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 999px;
  background: var(--charcoal);
  color: #fff;
}

.step p {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

#activityLog li {
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 820px) {
  .topbar,
  .grid,
  .round-hero,
  .step-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: stretch;
  }

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

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

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

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding: 16px 0;
  }

  .input-row,
  .share-row,
  .actions {
    grid-template-columns: 1fr;
  }
}
