.page--surveys {
  width: min(1280px, calc(100% - 36px));
}

.status-stack {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.status-stack .banner {
  margin-bottom: 0;
}

.survey-layout {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  margin-top: 20px;
}

.survey-panel {
  min-width: 0;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
  padding: 22px;
}

.survey-panel--form {
  position: sticky;
  top: 86px;
}

.survey-panel--print {
  width: min(620px, 100%);
  margin-top: 20px;
}

.survey-panel--error {
  width: min(520px, 100%);
}

.survey-panel--error h1 {
  font-size: 34px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h2,
.panel-head .eyebrow {
  margin-bottom: 0;
}

.panel-head--split {
  align-items: center;
}

.survey-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 1px solid #b9d7c4;
  border-radius: 8px;
  background: #effaf3;
  color: #1f6b39;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 800;
}

.stat-pill--muted {
  border-color: var(--gray-200);
  background: #eef2f7;
  color: var(--gray-500);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.search-form {
  display: grid;
  grid-template-columns: minmax(160px, 250px) auto;
  gap: 8px;
  align-items: center;
}

.input--search {
  min-height: 40px;
}

.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  cursor: pointer;
  padding: 9px 13px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
  white-space: nowrap;
}

.secondary-button {
  border: 1px solid #9eb7d3;
  background: #f7fbff;
  color: var(--blue-800);
}

.secondary-button:hover {
  border-color: var(--blue-600);
  background: var(--blue-050);
}

.secondary-button--compact {
  min-height: 36px;
  padding: 8px 11px;
}

.danger-button {
  border: 1px solid #e3a2ab;
  background: #fff2f3;
  color: #8f1d2c;
}

.danger-button:hover {
  border-color: #c65364;
  background: #ffe7ea;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-700);
  font-size: 14px;
  font-weight: 800;
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--blue-700);
}

.check-row--form {
  align-self: end;
  min-height: 46px;
}

.survey-print-form {
  max-width: 520px;
}

.survey-list {
  display: grid;
  gap: 0;
}

.survey-card {
  display: grid;
  gap: 12px;
  border-top: 1px solid var(--gray-200);
  padding: 16px 0;
}

.survey-card:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.survey-card:last-child {
  padding-bottom: 0;
}

.survey-card__summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.survey-card h3 {
  margin: 0 0 6px;
  color: var(--blue-900);
  font-size: 18px;
  line-height: 1.25;
}

.survey-card p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  color: var(--gray-500);
  font-size: 14px;
  line-height: 1.45;
}

.survey-card__meta,
.survey-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.survey-card__meta {
  justify-content: flex-end;
}

.survey-card__actions {
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.pill--ok {
  background: #effaf3;
  color: #1f6b39;
}

.pill--muted {
  background: #eef2f7;
  color: var(--gray-500);
}

.empty-note {
  margin: 0;
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.5;
}

.edit-details {
  width: 100%;
}

.edit-details summary {
  width: max-content;
  margin-left: auto;
  list-style: none;
}

.edit-details summary::-webkit-details-marker {
  display: none;
}

.edit-form {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: #f8fafc;
  padding: 14px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.pager__status {
  color: var(--gray-500);
  font-size: 13px;
  font-weight: 800;
}

.is-disabled {
  opacity: 0.48;
  pointer-events: none;
}

code {
  border-radius: 6px;
  background: #f2f6fb;
  color: #28425f;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono',
    monospace;
  font-size: 0.94em;
}

@media (max-width: 1040px) {
  .survey-layout {
    grid-template-columns: 1fr;
  }

  .survey-panel--form {
    position: static;
  }
}

@media (max-width: 760px) {
  .page--surveys {
    width: min(100% - 28px, 1280px);
  }

  .survey-panel {
    padding: 18px;
  }

  .panel-head,
  .panel-head--split,
  .survey-card__summary,
  .pager {
    align-items: flex-start;
    flex-direction: column;
  }

  .field-grid,
  .search-form {
    grid-template-columns: 1fr;
  }

  .survey-card__meta,
  .survey-card__actions {
    justify-content: flex-start;
  }

  .secondary-button,
  .danger-button,
  .edit-details summary {
    width: auto;
    max-width: 100%;
  }
}
