:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f4f5f7;
  color: #172033;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #f4f5f7;
}

.page-shell {
  width: min(100%, 760px);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.authoring-shell {
  width: min(100%, 980px);
}

.card {
  background: #ffffff;
  border: 1px solid #dde2ea;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 32px rgb(23 32 51 / 8%);
}

.section-card {
  margin-top: 18px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #5a6475;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(1.75rem, 7vw, 2.5rem);
  line-height: 1.12;
}

h2 {
  margin: 0 0 16px;
}

.notice,
.legal-summary,
.warning,
.hypothesis {
  color: #445065;
  line-height: 1.55;
}

.error {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #d97706;
  border-radius: 12px;
  background: #fff7ed;
  color: #7c2d12;
}

.success-notice {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #86efac;
  border-radius: 12px;
  background: #f0fdf4;
  color: #166534;
}

.question {
  margin: 0;
  padding: 24px 0;
  border: 0;
  border-bottom: 1px solid #e6e9ef;
}

.question legend {
  width: 100%;
  margin-bottom: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
}

.required {
  display: inline-block;
  margin-left: 8px;
  color: #7c3aed;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.options {
  display: grid;
  gap: 10px;
}

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

.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  border: 1px solid #d7dce5;
  border-radius: 12px;
  background: #fbfcfe;
  cursor: pointer;
}

.option input {
  width: 20px;
  height: 20px;
  margin: 0;
  flex: 0 0 auto;
}

.text-input {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #cbd2dc;
  border-radius: 10px;
  background: #ffffff;
  color: inherit;
  font: inherit;
}

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

.textarea-small {
  min-height: 88px;
  resize: vertical;
}

.text-input:focus,
.option:focus-within,
.submit-button:focus-visible,
.secondary-link:focus-visible,
.small-button:focus-visible {
  outline: 3px solid rgb(124 58 237 / 25%);
  outline-offset: 2px;
}

.hint {
  margin: 8px 0 0;
  color: #667085;
  font-size: 0.86rem;
}

.legal-summary {
  margin: 24px 0;
  padding: 16px;
  border-radius: 12px;
  background: #f8f7ff;
}

.legal-summary p {
  margin-top: 0;
}

.legal-summary dl,
.submission-meta {
  margin: 0;
}

.legal-summary dl div,
.submission-meta div {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.legal-summary dt,
.submission-meta dt {
  color: #667085;
  font-size: 0.82rem;
}

.legal-summary dd,
.submission-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.88rem;
}

.submit-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: #5b21b6;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.submit-button:hover {
  background: #4c1d95;
}

.success-card p,
.operator-card p {
  line-height: 1.55;
}

.receipt {
  margin: 22px 0;
  padding: 18px;
  border: 2px dashed #7c3aed;
  border-radius: 12px;
  background: #faf5ff;
  overflow-wrap: anywhere;
}

.receipt code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1rem;
  line-height: 1.55;
}

.secondary-link {
  display: inline-block;
  margin-top: 24px;
  color: #5b21b6;
  font-weight: 700;
}

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

.operator-stat {
  display: grid;
  gap: 4px;
  margin: 24px 0;
  padding: 20px;
  border: 1px solid #ddd6fe;
  border-radius: 14px;
  background: #f5f3ff;
}

.operator-stat-value {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.operator-stat-label {
  color: #5a6475;
  font-weight: 600;
}

.operator-meta {
  margin-bottom: 24px;
}

.field-label {
  display: grid;
  gap: 7px;
  margin: 16px 0;
  font-weight: 700;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0;
}

.checkbox-label input {
  width: 20px;
  height: 20px;
}

.authoring-create {
  margin-top: 20px;
}

.authoring-create label {
  display: grid;
  gap: 7px;
  margin: 14px 0;
  font-weight: 700;
}

.editor-questions {
  display: grid;
  gap: 16px;
  margin: 22px 0;
}

.editor-question {
  padding: 18px;
  border: 1px solid #d7dce5;
  border-radius: 14px;
  background: #fbfcfe;
}

.editor-question legend {
  padding: 0 8px;
  font-weight: 700;
}

.editor-question code,
.item-row code,
.success-notice code {
  overflow-wrap: anywhere;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

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

.button-grid .submit-button {
  grid-column: 1 / -1;
}

.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid #c4b5fd;
  border-radius: 10px;
  background: #f5f3ff;
  color: #4c1d95;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.danger-button {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.link-button {
  text-decoration: none;
}

.item-list {
  display: grid;
  gap: 10px;
}

.item-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  padding: 14px;
  border: 1px solid #e3e7ee;
  border-radius: 12px;
}

.item-row p {
  margin: 5px 0 0;
}

.publication-row {
  align-items: flex-start;
}

.section-divider {
  margin: 28px 0;
  border: 0;
  border-top: 1px solid #e3e7ee;
}

.preview-card fieldset[disabled] {
  opacity: 1;
}

.preview-card fieldset[disabled] input,
.preview-card fieldset[disabled] textarea {
  opacity: 0.7;
}

.hypothesis {
  padding: 14px;
  border-left: 4px solid #8b5cf6;
  background: #faf5ff;
}

.warning {
  padding: 12px 14px;
  border-radius: 10px;
  background: #fff7ed;
}

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

  .item-row {
    display: grid;
  }

  .publication-row .button-row {
    align-items: stretch;
  }

  .publication-row .button-row > * {
    width: 100%;
  }
}

.results-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.results-table th,
.results-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.results-table th {
  font-weight: 600;
  color: #374151;
}

.results-table code {
  font-size: 0.85em;
}

.omitted {
  color: #6b7280;
  font-style: italic;
}

.summary-block {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.summary-block h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.summary-list,
.text-answer-list {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.detail-meta {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.detail-meta dt {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0;
}

.detail-meta dd {
  margin: 2px 0 0;
}

.answer-detail-list {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.answer-detail-item h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.answer-full {
  white-space: pre-wrap;
  margin: 8px 0 0;
}

@media (max-width: 520px) {
  .page-shell {
    padding: 12px 10px 32px;
  }

  .card {
    border-radius: 14px;
    padding: 20px 16px;
  }

  .options-inline {
    grid-template-columns: 1fr;
  }
}
