:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #182b42;
  background: #eef3f8;
  --accent: #1d58a3;
  --line: #cfdae6;
  --muted: #4d647d;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body { margin: 0; }

.shell {
  max-width: 760px;
  margin: auto;
  padding: 36px 24px 0;
}

.page-heading { margin-bottom: 22px; }

.workbench-name {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 650;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: clamp(23px, 5vw, 33px);
  line-height: 1.28;
  overflow-wrap: anywhere;
}

h2 { margin-bottom: 16px; font-size: 19px; }

.notice {
  padding: 13px 16px;
  margin-bottom: 18px;
  background: #e3edf9;
  border: 1px solid #c8d9f0;
  border-radius: 10px;
  line-height: 1.55;
}

.notice p { overflow-wrap: anywhere; }
.notice button { margin-top: 10px; }
#return-reason { margin-top: 6px; white-space: pre-wrap; }
#withdrawal-feedback { margin-top: 6px; }
#withdrawal-feedback.error { color: #9a342c; }

.card {
  padding: 21px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.fields .wide { grid-column: 1 / -1; }

.fields label {
  display: grid;
  gap: 6px;
  color: #30465d;
  font-size: 14px;
  font-weight: 550;
}

.required { color: #94440f; font-size: 12px; font-weight: 650; }

input, textarea, select, button { font: inherit; }

.fields input, .fields textarea, .fields select {
  width: 100%;
  min-height: 44px;
  padding: 9px 10px;
  color: #182b42;
  background: #fff;
  border: 1px solid #b9c9da;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 400;
}

textarea { resize: vertical; }

.choices { margin-bottom: 13px; }

.choices + .choices, #capability-groups {
  border-top: 1px solid #e5ebf2;
  padding-top: 13px;
}

legend { padding: 0 0 6px; font-size: 15px; font-weight: 650; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px;
}

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

.choice {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #30465d;
  font-size: 14px;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.choice:has(input:checked) {
  border-color: #659bd9;
  background: #edf5ff;
}

.choice input {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.form-actions {
  position: sticky;
  bottom: 0;
  padding: 11px 0 max(12px, env(safe-area-inset-bottom));
  background: #eef3f8;
  border-top: 1px solid var(--line);
}

.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

#feedback {
  margin-bottom: 8px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

#feedback.error { color: #9a342c; }

button {
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}

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

button.text-button {
  padding: 4px 0;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

button:disabled { opacity: .65; cursor: wait; }

:focus-visible {
  outline: 2px solid #3171b8;
  outline-offset: 2px;
}

@media (max-width: 500px) {
  .shell { padding: 23px 12px 0; }
  .page-heading { margin-bottom: 15px; }
  .card { padding: 14px; }
  .fields { grid-template-columns: minmax(0, 1fr); }
  .choice-grid:not(.radios) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .action-buttons > button { flex: 1; }
}
#file-search-form{display:grid;gap:12px;margin-top:18px}
#file-search-form label{display:grid;gap:8px;font-weight:600}
#file-search-form input{width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;font:inherit;background:#fff;color:inherit}
#file-search-status{margin-top:16px;line-height:1.6;color:var(--muted)}
.file-search-results{list-style:none;padding:0;margin:1rem 0 0}
.file-search-results li{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 0;border-top:1px solid var(--line)}
.file-search-results span{overflow-wrap:anywhere}
.file-search-results button{flex-shrink:0}
