* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: "Hiragino Kaku Gothic ProN", "Meiryo", -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f2f4f7;
  color: #222;
  -webkit-tap-highlight-color: transparent;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #2f6fed;
  color: #fff;
  padding: 12px 16px;
  text-align: center;
  height: 48px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header h1 {
  margin: 0;
  font-size: 18px;
}

.help-btn {
  position: absolute;
  right: 12px;
  top: 8px;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  background: transparent;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-main {
  padding: 12px;
  padding-bottom: 80px;
  max-width: 640px;
  margin: 0 auto;
}

.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid #ddd;
  z-index: 20;
  padding-bottom: env(safe-area-inset-bottom);
}

.tab-btn {
  flex: 1;
  padding: 10px 4px;
  min-height: 56px;
  border: none;
  background: none;
  font-size: 12px;
  color: #666;
  cursor: pointer;
}

.tab-btn.active {
  color: #2f6fed;
  font-weight: bold;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.btn {
  display: inline-block;
  min-height: 44px;
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #2f6fed;
  color: #fff;
  font-size: 14px;
}

.btn.secondary {
  background: #e5e9f0;
  color: #333;
}

.btn.danger {
  background: #e53e3e;
  color: #fff;
}

.btn.small {
  min-height: 36px;
  padding: 6px 10px;
  font-size: 13px;
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #fff;
}

label {
  display: block;
  margin: 10px 0 4px;
  font-size: 13px;
  color: #555;
}

.date-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 12px;
}

.date-nav .date-label-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.date-nav .date-label {
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.date-nav .date-label:hover {
  background: #f0f0f0;
}

.date-nav .date-label-picker {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  border: none;
}

.card {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: #fff;
}

.badge.pickup {
  background: #2f6fed;
}

.badge.dropoff {
  background: #ed8c2f;
}

.card-title {
  font-weight: bold;
  flex: 1;
}

.stop-list {
  margin-top: 10px;
  display: none;
}

.stop-list.open {
  display: block;
}

.stop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid #eee;
  flex-wrap: wrap;
}

.stop-order {
  width: 24px;
  text-align: center;
  color: #999;
  font-size: 13px;
}

.stop-name {
  flex: 1;
  min-width: 100px;
}

.stop-time {
  font-size: 12px;
  color: #888;
}

.stop-plans {
  width: 100%;
  font-size: 12px;
  color: #2f6fed;
}

.stop-time-field {
  width: 110px;
}

.stop-note-field {
  width: 100%;
}

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

.inline-field label {
  margin: 0;
  font-size: 11px;
  color: #888;
}

.inline-field input,
.inline-field textarea {
  min-height: 36px;
  padding: 6px 8px;
  font-size: 13px;
  resize: vertical;
}

.inline-field textarea {
  min-height: 36px;
}

.inline-autosave.saved-flash {
  border-color: #34a853;
  background: #eafaf0;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.status-btn {
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  font-size: 13px;
  color: #fff;
  background: #999;
}

.status-btn.pending { background: #9aa0a6; }
.status-btn.onboard { background: #2f6fed; }
.status-btn.done { background: #34a853; }
.status-btn.absent { background: #e53e3e; }

.absent-btn {
  min-height: 44px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e53e3e;
  color: #e53e3e;
  background: #fff;
  font-size: 13px;
}

.wheelchair-icon {
  color: #2f6fed;
  margin-left: 4px;
}

.search-box {
  margin-bottom: 12px;
}

.user-list-fixed-header {
  position: sticky;
  top: 48px; /* .app-header の height と一致させること */
  z-index: 5;
  background: #f2f4f7;
  padding-top: 2px;
  margin: -2px -12px 0;
  padding-left: 12px;
  padding-right: 12px;
}

.kana-index-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.kana-index-btn {
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border-radius: 16px;
  border: 1px solid #ccd3e0;
  background: #fff;
  color: #333;
  font-size: 13px;
  cursor: pointer;
}

.kana-index-btn.active {
  background: #2f6fed;
  border-color: #2f6fed;
  color: #fff;
}

.user-list-item {
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}

.user-list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.user-inline-edit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.user-list-item .name {
  font-weight: bold;
}

.user-list-item .kana {
  font-size: 12px;
  color: #888;
}

.actions-row {
  display: flex;
  gap: 8px;
}

.empty-msg {
  text-align: center;
  color: #999;
  padding: 24px 0;
}

.section-title {
  font-size: 15px;
  font-weight: bold;
  margin: 16px 0 8px;
}

.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.modal-box {
  background: #fff;
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 16px;
}

.modal-box h2 {
  margin-top: 0;
  font-size: 17px;
}

.modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}

.help-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.help-modal-header h2 {
  margin: 0;
}

.help-modal-close {
  min-height: 36px;
  min-width: 36px;
  border: none;
  background: none;
  font-size: 20px;
  color: #666;
  line-height: 1;
}

.help-section {
  border-bottom: 1px solid #eee;
}

.help-section:last-of-type {
  border-bottom: none;
}

.help-section-header {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: bold;
  color: #222;
  text-align: left;
}

.help-section-icon {
  color: #2f6fed;
  font-size: 12px;
  width: 12px;
  flex-shrink: 0;
}

.help-section-body {
  display: none;
  padding: 0 0 14px;
  font-size: 14px;
  line-height: 1.7;
  color: #333;
}

.help-section-body.open {
  display: block;
}

.help-section-body ul,
.help-section-body ol {
  margin: 0;
  padding-left: 20px;
}

.help-section-body li {
  margin-bottom: 6px;
}

.checkbox-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0;
}

.checkbox-chip {
  border: 1px solid #ccc;
  border-radius: 16px;
  padding: 6px 12px;
  font-size: 13px;
  background: #fff;
}

.checkbox-chip.selected {
  background: #2f6fed;
  color: #fff;
  border-color: #2f6fed;
}

.user-pick-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid #eee;
}

.order-controls {
  display: flex;
  gap: 4px;
}

.order-controls button {
  min-height: 32px;
  min-width: 32px;
  border: 1px solid #ccc;
  background: #fff;
  border-radius: 6px;
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 12px;
}

.settings-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 8px;
}

@media (min-width: 480px) {
  .app-main {
    padding: 16px;
  }
}
