:root {
  --primary: #1a73e8;
  --primary-dark: #0f52a8;
  --bg: #f5f7fa;
  --card-bg: #ffffff;
  --text: #202124;
  --muted: #5f6368;
  --border: #dadce0;
  --error: #c5221f;
  --success: #188038;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Hiragino Sans", "Yu Gothic", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.app-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  padding: 24px 16px;
  text-align: center;
}
.app-header h1 { margin: 0 0 4px; font-size: 1.5rem; }
.subtitle { margin: 0; font-size: 0.85rem; opacity: 0.9; }

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.card h2 { margin-top: 0; font-size: 1.1rem; }
.card.note { background: #fff8e1; }
.card.note h3 { margin-top: 0; font-size: 0.95rem; }
.card.note p { font-size: 0.85rem; color: var(--muted); margin-bottom: 0; }

.hidden { display: none !important; }

label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.9rem;
  font-weight: 600;
}
input[type="text"], textarea, select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
}
.hint { font-weight: normal; font-size: 0.8rem; color: var(--muted); }

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
}
.btn-primary { background: var(--primary); color: white; width: 100%; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #e8eaed; color: var(--text); width: 100%; margin-top: 12px; }
.btn-primary:disabled { background: #9aa0a6; cursor: not-allowed; }

.error { color: var(--error); font-size: 0.85rem; min-height: 1.2em; }
.loading { color: var(--muted); font-size: 0.85rem; }

.map { height: 320px; border-radius: 8px; margin: 12px 0; }
.ic-map { height: 200px; border-radius: 8px; margin: 8px 0 4px; }

.road-group { margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.road-group:last-child { border-bottom: none; }
.road-group h3 { font-size: 0.95rem; margin: 0 0 8px; }
.candidate-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
}
.candidate-item:hover { background: #f1f3f4; }
.candidate-item.selected { border-color: var(--primary); background: #e8f0fe; }
.candidate-item input { width: auto; margin: 0; }
.candidate-name { font-weight: 600; font-size: 0.9rem; }
.candidate-kind { font-size: 0.75rem; color: var(--muted); }

.result-ok { color: var(--success); font-weight: 700; }
.result-ng { color: var(--error); font-weight: 700; }
.result-summary { font-size: 0.9rem; margin: 8px 0; }
.road-check-list { list-style: none; padding: 0; margin: 8px 0; font-size: 0.85rem; }
.road-check-list li { padding: 4px 0; }

.link-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}
.link-box input {
  flex: 1;
  min-width: 160px;
  font-size: 0.8rem;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #f8f9fa;
}
.link-box button { padding: 8px 14px; font-size: 0.85rem; background: var(--primary); color: white; white-space: nowrap; }
.link-box button[data-action="open"] { background: var(--success); }
.waypoint-list { font-size: 0.85rem; margin: 8px 0; padding-left: 20px; }
#qrcode-forward, #qrcode-return { margin-top: 10px; display: flex; justify-content: center; }
