:root {
  color-scheme: light;
  --bg: #fafafa;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #64748b;
  --line: #d8dee6;
  --good: #bbf7d0;
  --normal: #dbeafe;
  --rather-no: #fde68a;
  --unpleasant: #fecaca;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page-header,
main {
  width: min(980px, 100%);
  margin: 0 auto;
  padding-inline: clamp(1rem, 4vw, 2rem);
}

.page-header {
  padding-top: 2rem;
  padding-bottom: 1rem;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.name-panel {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.name-panel label {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.name-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--card);
  padding: 0.85rem 1rem;
  color: var(--text);
  font: inherit;
}

.status {
  min-height: 1.4rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.status[data-tone="success"] {
  color: #15803d;
}

.status[data-tone="warning"] {
  color: #a16207;
}

.status[data-tone="error"] {
  color: #b91c1c;
}

.questionnaire {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding-bottom: 3rem;
}

.category-section {
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: var(--card);
  overflow: hidden;
}

.category-section h2 {
  margin: 0;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.1rem;
}

.item-list {
  display: grid;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(10rem, 1fr) minmax(24rem, 1.5fr);
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.item-row + .item-row {
  border-top: 1px solid var(--line);
}

.item-text {
  font-weight: 650;
  line-height: 1.35;
}

button {
  font: inherit;
}

.segmented-switch {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  overflow: hidden;
  background: var(--card);
}

.segment {
  min-height: 3.25rem;
  cursor: pointer;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  padding: 0.5rem;
  transition: background-color 0.15s ease;
}

.segment:first-child {
  border-left: 0;
}

.segment:hover {
  background: #f1f5f9;
}

.segment-good.selected {
  background: var(--good);
}

.segment-normal.selected {
  background: var(--normal);
}

.segment-rather_no.selected {
  background: var(--rather-no);
}

.segment-unpleasant.selected {
  background: var(--unpleasant);
}

.error-box {
  border: 1px solid #efb2b2;
  border-radius: 1rem;
  background: #fff2f2;
  padding: 1rem;
  color: #8a2525;
}

@media (max-width: 760px) {
  .item-row {
    grid-template-columns: 1fr;
  }

  .segmented-switch {
    grid-template-columns: 1fr;
  }

  .segment {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .segment:first-child {
    border-top: 0;
  }
}
