:root {
  --bg: #f7f6f2;
  --surface: #ffffff;
  --surface-alt: #f1efe9;
  --text: #24231f;
  --muted: #66635d;
  --border: #d9d4c8;
  --primary: #0f6a6f;
  --primary-dark: #0a4f53;
  --danger: #b23b3b;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(20, 25, 25, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}

.page {
  max-width: 1160px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.hero {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2 {
  line-height: 1.15;
}

h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

h2 {
  margin: 0 0 14px;
  font-size: 1.5rem;
}

.lead,
.section-text,
.message,
.hint {
  color: var(--muted);
}

.lead,
.section-text {
  width: 90%;
  max-width: min(90%, 256ch);
}

.section-text {
  margin: 0 0 22px;
  font-size: 1rem;
}

.survey {
  display: grid;
  gap: 24px;
}

.card {
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  gap: 24px;
}

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

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

.question-block {
  margin-bottom: 8px;
}

.question-block-wide {
  margin-top: 6px;
}

.question-title {
  display: block;
  margin: 0 0 12px;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.45;
}

.answer-block {
  margin-top: 8px;
}

label {
  display: block;
}

input,
select,
textarea {
  width: 100%;
  padding: 13px 14px;
  font: inherit;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}

textarea {
  resize: vertical;
  min-height: 128px;
}

input:focus,
select:focus,
textarea:focus,
.sortable li:focus {
  outline: 2px solid rgba(15, 106, 111, 0.22);
  outline-offset: 1px;
  border-color: var(--primary);
}

.checklist {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.checklist.compact {
  margin-top: 0;
}

.checklist label,
.checkbox-inline {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.checklist input,
.checkbox-inline input {
  width: auto;
  margin-top: 3px;
  flex: 0 0 auto;
}

.sortable-header {
  margin-bottom: 12px;
}

.hint {
  margin: 6px 0 0;
  font-size: 0.95rem;
}

.sortable {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sortable li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: grab;
}

.sortable li.dragging {
  opacity: 0.65;
}

.sortable-text {
  flex: 1;
  font-weight: 600;
}

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

.sortable li button {
  padding: 7px 11px;
  font: inherit;
  cursor: pointer;
  background: #fff;
  border: none;
  border-radius: 8px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  margin: 16px 0 0;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.button {
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: none;
  border-radius: 12px;
}

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

.button.primary:hover {
  background: var(--primary-dark);
}

.button.secondary {
  color: var(--text);
  background: var(--surface-alt);
}

.preview-card pre {
  overflow: auto;
  min-height: 180px;
  padding: 18px;
  color: #d7f5f0;
  background: #101313;
  border-radius: 14px;
}

.error {
  border-color: var(--danger) !important;
}

.checkbox-inline.error,
.group-error {
  padding: 14px;
  border: 1px solid var(--danger);
  border-radius: 12px;
}

@media (max-width: 900px) {
  .grid.two,
  .grid.three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .page {
    padding: 20px 14px 48px;
  }

  .card {
    padding: 22px 18px;
  }

  .grid {
    gap: 20px;
  }

  .question-title {
    margin-bottom: 10px;
  }

  .sortable li {
    flex-direction: column;
    align-items: flex-start;
  }

  .item-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .profile-box {
    margin-top: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: var(--shadow);
    overflow: hidden;
  }

  .profile-box summary {
    padding: 16px 18px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
  }

  .profile-box summary::-webkit-details-marker {
    display: none;
  }

  .profile-box summary::after {
    content: "＋";
    float: right;
    color: var(--primary);
    font-weight: 700;
  }

  .profile-box[open] summary::after {
    content: "−";
  }

  .profile-content {
    padding: 0 18px 18px;
    border-top: 1px solid var(--border);
  }

  .profile-content p {
    margin: 14px 0;
  }

  .profile-links {
    margin: 12px 0 0;
    padding-left: 18px;
  }

  .profile-links li {
    margin-bottom: 8px;
  }
}