:root {
  --ink: #10231e;
  --muted: #5f6f6a;
  --line: #dce6e1;
  --soft-line: #edf2ef;
  --page: #f6f8f5;
  --surface: #ffffff;
  --brand: #006b45;
  --brand-dark: #004f36;
  --amber: #d99017;
  --blue: #226bd1;
  --violet: #6750a4;
  --danger: #b42318;
  --shadow: 0 18px 36px rgba(17, 44, 34, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(0, 107, 69, 0.08), transparent 28%),
    linear-gradient(180deg, #fff, var(--page) 30%);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

textarea {
  min-height: 132px;
  padding: 16px;
  resize: vertical;
  line-height: 1.45;
}

input,
select {
  min-height: 44px;
  padding: 10px 12px;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(34, 107, 209, 0.22);
  outline-offset: 2px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 74px;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 12px;
  min-width: 0;
  color: var(--ink);
  font-size: 19px;
  font-weight: 850;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}

.save-state {
  justify-self: center;
  color: var(--brand-dark);
  font-size: 14px;
  font-weight: 750;
}

.workspace {
  width: min(1500px, calc(100% - 48px));
  margin: 24px auto 44px;
  display: grid;
  grid-template-columns: minmax(240px, 310px) minmax(520px, 1fr) minmax(240px, 310px);
  gap: 14px;
  align-items: start;
}

.rail,
.main-flow {
  display: grid;
  gap: 14px;
}

.panel,
.question-card {
  min-width: 0;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 20px;
}

.kicker {
  position: relative;
  padding-bottom: 17px;
  margin: 0 0 7px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.kicker::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 2px;
  left: 0;
  display: block;
  height: 10px;
  background: repeating-linear-gradient(
      90deg,
      transparent 0 1px,
      rgba(18, 48, 39, 0.35) 1px 10px,
      transparent 10px 12px
    )
    0 4px / 100% 1px no-repeat;
}

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

h1 {
  margin-bottom: 16px;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.02;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 23px;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

p,
li {
  color: var(--muted);
  line-height: 1.45;
}

.template-list,
.step-list,
.notes-grid,
.question-grid {
  display: grid;
  gap: 10px;
}

.template-card {
  width: 100%;
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 14px;
  color: var(--ink);
  background: #fbfdfb;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  text-align: left;
}

.template-card[aria-pressed="true"] {
  border-color: var(--brand);
  box-shadow: inset 4px 0 0 var(--brand);
}

.template-card strong {
  font-size: 16px;
}

.template-card span {
  color: var(--muted);
  font-size: 13px;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 14px;
}

.choice-row,
.action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.choice,
.quiet-button,
.support-button,
.primary-button {
  min-height: 44px;
  border-radius: 8px;
  font-weight: 800;
}

.choice,
.quiet-button,
.support-button {
  color: var(--brand-dark);
  background: #fff;
  border: 1px solid #b9d1c7;
}

.choice {
  padding: 0 13px;
}

.choice.active {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.quiet-button,
.support-button {
  padding: 0 16px;
}

.primary-button {
  padding: 0 18px;
  color: #fff;
  background: var(--brand);
  border: 1px solid var(--brand);
  box-shadow: 0 8px 18px rgba(0, 107, 69, 0.18);
}

#draftStatus,
.support-status,
.support-privacy,
.memory-time,
.heard-back,
.language-comfort {
  color: var(--muted);
  font-size: 14px;
}

.heard-back,
.language-comfort {
  margin: 10px 0 0;
}

.privacy-rights {
  margin: 12px 0;
}

.privacy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.proof-panel .quiet-button {
  margin-top: 6px;
}

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

.context-section {
  display: grid;
  gap: 12px;
  padding: 2px 0;
}

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

.question-card {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.question-card label {
  color: var(--brand-dark);
  font-weight: 850;
}

.unsure-button {
  justify-self: start;
}

.context-grid label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.context-grid span {
  color: var(--brand-dark);
  font-weight: 850;
}

.workflow-panel {
  min-height: 360px;
}

.step-list {
  padding-left: 0;
  list-style: none;
  counter-reset: steps;
}

.step-list li {
  counter-increment: steps;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 58px;
  padding: 12px;
  color: var(--ink);
  background: #fbfdfb;
  border: 1px solid var(--soft-line);
  border-radius: 8px;
}

.step-list li::before {
  content: counter(steps);
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--blue);
  border-radius: 50%;
  font-weight: 850;
}

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

.notes-grid > div {
  min-height: 112px;
  padding: 14px;
  background: #fffaf1;
  border: 1px solid #efd5a4;
  border-radius: 8px;
}

.notes-grid > div + div {
  background: #f6f3ff;
  border-color: #d8cffa;
}

.notes-grid ul,
.privacy-panel ul {
  margin: 0;
  padding-left: 19px;
}

.support-drawer[hidden] {
  display: none;
}

.support-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  justify-items: end;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 35, 30, 0.38);
  border: 0;
}

.drawer-panel {
  position: relative;
  width: min(440px, 100%);
  min-height: 100%;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 24px;
  background: #fff;
  box-shadow: -16px 0 34px rgba(16, 35, 30, 0.2);
}

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

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

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: 1fr auto;
    padding: 10px 16px;
  }

  .save-state {
    grid-column: 1 / -1;
    justify-self: center;
  }

  .workspace {
    width: min(100% - 24px, 1500px);
    margin-top: 14px;
  }

  .rail,
  .question-grid,
  .context-grid,
  .notes-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: grid;
  }
}
