:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: #f5f7fb;
  color: #1b2330;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: #f5f7fb;
  color: #1b2330;
}

.hidden { display: none !important; }

h1, h2, h3 { margin: 0 0 12px; }
p { margin: 0; }

.app {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.app__header {
  text-align: center;
  margin-bottom: 32px;
}

.app__subtitle {
  margin-top: 8px;
  color: #4b5a6b;
}

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

.card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(28, 40, 58, 0.08);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.status {
  font-size: 0.9rem;
  color: #5f6c7b;
}

.form {
  display: grid;
  gap: 16px;
}

.form__row {
  display: grid;
  gap: 8px;
}

.form__row--split {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  align-items: end;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
}

input, select {
  width: 100%;
  border: 1px solid #d1d9e2;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
  color: inherit;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
}

.checkbox input {
  width: 18px;
  height: 18px;
}

.primary, .ghost {
  border: none;
  padding: 12px 18px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.primary {
  background: #2d6ef8;
  color: #fff;
  box-shadow: 0 6px 18px rgba(45, 110, 248, 0.35);
}

.primary:disabled {
  background: #c7d3ea;
  box-shadow: none;
  cursor: not-allowed;
}

.ghost {
  background: #f1f4f8;
  color: #1b2330;
}

.primary:hover:not(:disabled),
.ghost:hover:not(:disabled) {
  transform: translateY(-1px);
}

.step-actions {
  margin-top: 12px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

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

.stimuli__item {
  border: 1px solid #e2e7ef;
  border-radius: 12px;
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.stimuli__item h3 {
  margin: 0;
  font-size: 1rem;
}

.stimuli__item p {
  margin: 0;
  color: #5c6a7a;
  font-size: 0.9rem;
}

.stimuli__item button {
  justify-self: start;
}

.session {
  background: #f6f9ff;
  border-radius: 12px;
  padding: 16px;
  color: #334154;
  min-height: 90px;
}

.session__meta {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.stimulus-timer {
  font-size: 2.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  color: #1b2330;
  line-height: 1;
  margin-bottom: 8px;
}

.stimulus-info {
  display: flex;
  gap: 16px;
  align-items: baseline;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.session__actions {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 720px) {
  .card { padding: 18px; }
  .session__actions { flex-direction: column; }
}

/* Hide helper (если у тебя его ещё нет) */
.hidden {
  display: none !important;
}

/* ── Stimulus list badges ─────────────────────────────── */
.stimuli__badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  background: #e8eef8;
  color: #3a5080;
}

.badge--type {
  background: #edf5ec;
  color: #2d6b3e;
}

/* ── Stimulus catalog (details/summary) ──────────────── */
.catalog-details {
  margin-top: 24px;
}

.catalog-details summary {
  font-weight: 600;
  cursor: pointer;
  color: #2d6ef8;
  font-size: 0.95rem;
  user-select: none;
  padding: 4px 0;
}

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

.catalog-card {
  border: 1px solid #e2e7ef;
  border-radius: 12px;
  padding: 12px 16px;
  display: grid;
  gap: 4px;
}

.catalog-card__header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalog-card__header h4 {
  margin: 0;
  font-size: 0.95rem;
}

.catalog-card p {
  margin: 0;
  font-size: 0.85rem;
  color: #5c6a7a;
}

.catalog-card--unavailable {
  opacity: 0.55;
}

/* ── Feedback form ───────────────────────────────────── */
.feedback-question {
  display: grid;
  gap: 8px;
}

.rating-row {
  display: flex;
  gap: 8px;
}

.rating-btn {
  width: 42px;
  height: 42px;
  border: 2px solid #d1d9e2;
  border-radius: 10px;
  background: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  color: #4b5a6b;
}

.rating-btn:hover {
  border-color: #2d6ef8;
  color: #2d6ef8;
}

.rating-btn.active {
  background: #2d6ef8;
  border-color: #2d6ef8;
  color: #fff;
}

textarea {
  width: 100%;
  border: 1px solid #d1d9e2;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
  color: inherit;
  resize: vertical;
  font-family: inherit;
}

/* Stimulus host should have enough room */
#stimulus-host {
  margin-top: 12px;
  height: min(75vh, 760px);
}

/* Let stimulus wrapper fill the host */
#stimulus-host > div {
  height: 100% !important;
}
