:root {
  --black: #050505;
  --ink: #111111;
  --paper: #ffffff;
  --muted: #5f5f5f;
  --line: #d8d8d8;
  --soft: #f4f4f4;
  --focus: #000000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--black);
  font-family: "Space Grotesk", Arial, sans-serif;
}

button,
input {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 24px;
}

.lobby {
  width: min(1680px, 100%);
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  color: var(--paper);
  padding: 6px 0 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #bfbfbf;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.1rem, 5vw, 5.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

h2 {
  font-size: 1rem;
  line-height: 1.2;
}

.status-pill {
  min-width: 132px;
  border: 1px solid #ffffff;
  padding: 10px 14px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--paper);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(230px, 0.65fr) minmax(340px, 1.25fr) minmax(440px, 1.35fr);
  gap: 14px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

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

.panel-header p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.row-header {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.mini-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.progress-track {
  height: 8px;
  margin: 18px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.progress-fill {
  width: 0;
  height: 100%;
  background: var(--black);
  transition: width 180ms ease;
}

.checklist {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 18px 18px;
  list-style: none;
}

.checklist li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 8px;
  align-items: center;
  min-height: 30px;
  color: var(--muted);
  font-size: 0.86rem;
}

.checklist .done {
  color: var(--ink);
}

.check-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  color: var(--paper);
  background: var(--paper);
  font-size: 0.72rem;
  font-weight: 700;
}

.done .check-dot {
  background: var(--ink);
}

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

.field-block {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.wide,
.artist-list {
  grid-column: 1 / -1;
}

label {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
}

input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  color: var(--ink);
  background: var(--paper);
  outline: none;
}

input:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px #00000014;
}

.artist-list {
  display: grid;
  gap: 10px;
}

.repeatable-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfbfb;
}

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

.artist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: end;
}

button {
  min-height: 38px;
  border: 1px solid var(--ink);
  border-radius: 6px;
  padding: 0 13px;
  color: var(--paper);
  background: var(--ink);
  cursor: pointer;
}

button:hover {
  background: #2b2b2b;
}

.icon-button,
.remove-artist {
  width: 40px;
  min-width: 40px;
  padding: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.small-button {
  min-height: 30px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.remove-artist {
  color: var(--ink);
  background: var(--paper);
}

.remove-artist:hover {
  color: var(--paper);
  background: var(--ink);
}

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

.contract-paper {
  margin: 18px;
  min-height: 760px;
  padding: clamp(22px, 4vw, 44px);
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-family: "Times New Roman", Times, serif;
  font-size: 0.98rem;
  line-height: 1.42;
  white-space: pre-wrap;
}

.contract-paper strong,
.contract-title {
  font-weight: 700;
}

.contract-title {
  display: block;
  text-align: center;
}

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

  .checklist-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 14px;
  }

  .topbar,
  .workspace,
  .contract-form {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    align-items: start;
  }

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

  .actions {
    justify-content: start;
  }

  .contract-paper {
    margin: 12px;
    min-height: 600px;
    font-size: 0.9rem;
  }
}

@media print {
  body {
    background: var(--paper);
  }

  .topbar,
  .checklist-panel,
  .editor-panel,
  .preview-panel .panel-header {
    display: none;
  }

  .app-shell {
    padding: 0;
  }

  .workspace,
  .preview-panel {
    display: block;
    border: 0;
  }

  .contract-paper {
    margin: 0;
    border: 0;
    min-height: auto;
  }
}
