* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #1f2937;
  background: #f9fafb;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

header {
  margin-bottom: 28px;
}

h1 {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 700;
}

.tagline {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-inline {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

label {
  font-size: 13px;
  font-weight: 600;
  color: #374151;
}

.field-inline label {
  font-weight: 500;
  color: #1f2937;
  user-select: none;
  cursor: pointer;
}

input[type="text"],
textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: #1f2937;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input[type="text"]:focus,
textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea {
  resize: vertical;
  min-height: 140px;
  font-family: inherit;
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

button {
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

button:hover:not(:disabled) {
  background: #1d4ed8;
}

button:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

#status {
  margin-top: 20px;
  min-height: 22px;
  font-size: 14px;
  color: #6b7280;
}

#status.error {
  color: #dc2626;
}

#status.success {
  color: #059669;
}

#output {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.result-section {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px 18px;
}

.result-section h3 {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #374151;
}

.result-section.warn {
  background: #fffbeb;
  border-color: #fcd34d;
}

.result-section.warn h3 {
  color: #92400e;
}

.result-section.warn p {
  margin: 0 0 8px;
  font-size: 14px;
  color: #78350f;
}

.ordered-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ordered-list li {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 6px 0;
  font-size: 14px;
  word-break: break-word;
  border-bottom: 1px solid #f3f4f6;
}

.ordered-list li:last-child {
  border-bottom: none;
}

.ordered-list .step-num {
  display: inline-block;
  min-width: 22px;
  font-weight: 600;
  color: #2563eb;
  font-variant-numeric: tabular-nums;
}

.ordered-list .return-line {
  color: #6b7280;
  font-style: italic;
}

.ordered-list .return-line .step-num {
  color: #6b7280;
}

.skipped-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.skipped-list li {
  padding: 4px 0;
}

.skipped-list .reason {
  color: #b45309;
  font-size: 13px;
}

.url-block {
  padding: 12px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
  white-space: pre-wrap;
  color: #1f2937;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-secondary {
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-secondary:hover {
  background: #e5e7eb;
}

.copy-confirm {
  font-size: 13px;
  color: #059669;
  font-weight: 500;
}
