:root {
  color-scheme: light;
  --paper: #fbf8f2;
  --surface: #fffdf8;
  --surface-strong: #ffffff;
  --ink: #2f2a25;
  --muted: #776f66;
  --line: #e5dccf;
  --sage: #637765;
  --sage-dark: #405545;
  --clay: #a85f4a;
  --gold: #c79b4b;
  --rose: #f3dfd7;
  --shadow: 0 20px 50px rgba(68, 52, 34, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(145deg, rgba(243, 223, 215, 0.72), rgba(255, 255, 255, 0) 34rem),
    linear-gradient(315deg, rgba(99, 119, 101, 0.16), rgba(255, 255, 255, 0) 28rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

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

.welcome {
  padding: 48px 0;
}

.welcome-hero {
  max-width: 820px;
  padding: 56px 0 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--sage-dark);
  background: var(--surface);
  font-weight: 800;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--clay);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(2.4rem, 6vw, 5.5rem);
  line-height: 0.96;
  letter-spacing: 0;
  max-width: 860px;
}

.hero-copy {
  color: var(--muted);
  max-width: 680px;
  font-size: 1.16rem;
  line-height: 1.65;
}

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

.entry-card,
.session-card,
.partner-panel,
.exercise-card {
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.entry-card {
  border-radius: 8px;
  padding: 24px;
}

.entry-card h2 {
  margin-bottom: 22px;
  font-size: 1.35rem;
}

label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 750;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--surface-strong);
  outline: none;
}

textarea {
  resize: vertical;
  line-height: 1.5;
  font-weight: 400;
}

textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
  opacity: 1;
}

input:focus,
textarea:focus {
  border-color: var(--sage);
  box-shadow: 0 0 0 4px rgba(99, 119, 101, 0.14);
}

.entry-card label + label,
.entry-card label + button {
  margin-top: 16px;
}

.primary,
.secondary,
.icon-button {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  font-weight: 800;
}

.primary {
  padding: 0 18px;
  color: #fff;
  background: var(--sage-dark);
}

.primary:hover {
  background: #34473a;
}

.secondary {
  padding: 0 18px;
  color: var(--sage-dark);
  background: #e8eee4;
}

.secondary:hover {
  background: #dce6d8;
}

.session-tools {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.reset-actions {
  margin-top: 14px;
}

.reset-button {
  padding: 8px 0;
  border: 0;
  min-height: 44px;
  color: #8b3f30;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reset-dialog {
  width: min(480px, calc(100% - 32px));
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
}

.reset-dialog::backdrop {
  background: rgba(30, 30, 30, 0.4);
}

.reset-dialog h2 {
  font-size: 1.35rem;
}

.reset-dialog p {
  color: var(--muted);
  line-height: 1.5;
}

.danger {
  border: 0;
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 18px;
  color: white;
  background: #8b3f30;
  font-weight: 800;
}

.notice {
  margin: 0 0 18px;
  border-radius: 8px;
  padding: 13px 16px;
  font-weight: 750;
}

.notice.message {
  border: 1px solid #cad8c7;
  color: var(--sage-dark);
  background: #eef5eb;
}

.notice.error {
  border: 1px solid #ecc9bd;
  color: #8b3f30;
  background: #fff1ec;
}

.shell {
  padding: 26px 0 44px;
}

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

.topbar h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.session-card {
  display: grid;
  grid-template-columns: auto auto auto;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 12px 14px;
}

.session-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.session-card strong {
  color: var(--sage-dark);
  font-size: 1.25rem;
}

.icon-button {
  width: 40px;
  color: var(--sage-dark);
  background: #edf2e8;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.sidebar {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 18px;
}

.partner-panel {
  border-radius: 8px;
  padding: 18px;
}

.partner-panel h2 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.person {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}

.avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--surface);
  background: var(--clay);
  font-weight: 850;
}

.person strong,
.person small {
  display: block;
}

.person small,
.waiting,
.exercise-tab small,
.intro,
.reveal-heading p,
.locked-panel p {
  color: var(--muted);
}

.waiting {
  margin: 8px 0 0;
  line-height: 1.45;
}

.exercise-list {
  display: grid;
  gap: 8px;
}

.exercise-tab {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  background: rgba(255, 253, 248, 0.84);
}

.exercise-tab.selected {
  border-color: rgba(64, 85, 69, 0.55);
  background: #eef4eb;
}

.exercise-tab strong,
.exercise-tab small {
  display: block;
}

.exercise-tab strong {
  margin-bottom: 2px;
  line-height: 1.2;
}

.exercise-number {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--sage-dark);
  background: #f1eadc;
  font-weight: 850;
}

.exercise-card {
  border-radius: 8px;
  padding: clamp(20px, 4vw, 34px);
}

.exercise-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.exercise-header h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.05;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid #d9c8b7;
  border-radius: 999px;
  padding: 8px 12px;
  color: #744535;
  background: #f8eee6;
  font-size: 0.88rem;
  font-weight: 800;
}

.intro {
  max-width: 760px;
  line-height: 1.65;
  font-size: 1.02rem;
}

.prompts {
  display: grid;
  gap: 18px;
  margin-top: 24px;
}

.prompts label span,
.discussion label {
  line-height: 1.35;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.locked-panel {
  margin-top: 22px;
  border: 1px solid #d9c8b7;
  border-radius: 8px;
  padding: 18px;
  background: #fff6ef;
}

.locked-panel.quiet {
  background: #f8f3ea;
}

.locked-panel h3 {
  margin-bottom: 4px;
  font-size: 1.08rem;
}

.locked-panel p {
  margin-bottom: 0;
  line-height: 1.5;
}

.reveal {
  margin-top: 30px;
  border-top: 1px solid var(--line);
  padding-top: 28px;
}

.reveal-heading h3 {
  margin-bottom: 6px;
  font-size: 1.45rem;
}

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

.answer-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fffaf3;
}

.answer-card h4 {
  margin-bottom: 16px;
  font-size: 1.18rem;
}

.answer-block + .answer-block {
  margin-top: 16px;
}

.answer-block strong {
  display: block;
  margin-bottom: 6px;
  line-height: 1.35;
}

.answer-block p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.discussion {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.discussion button {
  justify-self: end;
}

@media (max-width: 860px) {
  .welcome,
  .shell {
    width: min(100% - 24px, 680px);
  }

  .welcome {
    padding-top: 28px;
  }

  .welcome-hero {
    padding-top: 30px;
  }

  .entry-grid,
  .workspace,
  .answer-grid {
    grid-template-columns: 1fr;
  }

  .topbar,
  .exercise-header {
    display: grid;
  }

  .session-card {
    justify-self: start;
  }

  .sidebar {
    position: static;
  }

  .exercise-list {
    grid-template-columns: 1fr;
    max-height: none;
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 2.35rem;
  }

  .entry-card,
  .exercise-card {
    padding: 18px;
  }

  .session-card {
    width: 100%;
    grid-template-columns: 1fr auto auto;
  }

  .actions,
  .discussion button {
    display: grid;
    width: 100%;
  }

  .actions button,
  .discussion button {
    width: 100%;
  }

  .status-pill {
    width: max-content;
  }
}
