/* Dent Wiki forms — minimal, mobile-friendly */
:root {
  --bg: #fafafa;
  --card: #ffffff;
  --fg: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --error: #dc2626;
  --success: #16a34a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN", sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
}
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
header h1 { margin-bottom: 4px; font-size: 24px; }
header p.muted { color: var(--muted); margin-top: 0; }

.draft-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  margin-top: 8px;
  padding: 6px 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
}
.draft-status { color: var(--muted); }
.draft-status.active { color: var(--success); font-weight: 600; }
.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
  padding: 0;
  text-decoration: underline;
}
.link-btn:hover { color: var(--accent-hover); }

section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  margin: 16px 0;
}
section h2 {
  margin-top: 0;
  font-size: 17px;
  color: #111827;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.field {
  display: block;
  margin-bottom: 14px;
}
.field > span {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.field em {
  color: var(--error);
  font-style: normal;
  font-size: 12px;
  font-weight: normal;
}
.field small {
  color: var(--muted);
  font-size: 12px;
  display: block;
  margin-top: 4px;
}
input[type="text"], select, textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: white;
  color: var(--fg);
}
textarea {
  font-family: ui-monospace, SFMono-Regular, monospace;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

fieldset.field {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 14px;
}
fieldset.field legend {
  font-weight: 600;
  font-size: 14px;
  padding: 0 6px;
}
.targets-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 6px;
}
.targets-row label span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
}

.actions { margin: 20px 0; }
button[type="submit"] {
  background: var(--accent);
  color: white;
  border: none;
  padding: 11px 22px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
button[type="submit"]:hover:not(:disabled) { background: var(--accent-hover); }
button[type="submit"]:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

#result {
  padding: 14px 16px;
  border-radius: 6px;
  margin: 16px 0;
  border: 1px solid var(--border);
}
#result.success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #14532d;
}
#result.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #7f1d1d;
}
#result a {
  color: inherit;
  font-weight: 600;
}

footer {
  margin-top: 24px;
  text-align: center;
  color: var(--muted);
}
footer code {
  background: var(--card);
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
