* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f7fa;
  color: #333;
  min-height: 100vh;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 20px;
  text-align: center;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 12px;
}

/* フォーム */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-group {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: #4b5563;
  margin-bottom: 6px;
}

input[type="text"],
textarea {
  width: 100%;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.95rem;
  color: #333;
  background: #fafafa;
  transition: border-color 0.2s;
  font-family: inherit;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: #3b82f6;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.btn-primary {
  width: 100%;
  background: #3b82f6;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #2563eb;
}

/* 検索 */
.search-section {
  margin-bottom: 12px;
}

.search-section input {
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* カウント */
.count-label {
  font-size: 0.8rem;
  color: #6b7280;
  margin-bottom: 8px;
}

/* マニュアルリスト */
.manual-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.manual-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  overflow: hidden;
}

.manual-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.manual-header:hover {
  background: #f0f7ff;
}

.manual-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e40af;
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: 10px;
}

.step-count {
  font-size: 0.75rem;
  color: #6b7280;
  white-space: nowrap;
}

.toggle-icon {
  font-size: 0.85rem;
  color: #9ca3af;
  transition: transform 0.2s;
}

.manual-card.open .toggle-icon {
  transform: rotate(180deg);
}

.delete-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.15s;
}

.delete-btn:hover {
  background: #fee2e2;
}

.manual-body {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid #f0f0f0;
}

.manual-card.open .manual-body {
  display: block;
}

.steps-list {
  list-style: none;
  padding: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.steps-list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #374151;
}

.step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  background: #3b82f6;
  color: #fff;
  border-radius: 50%;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

.step-text {
  flex: 1;
}

/* 空状態 */
.empty-state {
  text-align: center;
  color: #9ca3af;
  font-size: 0.9rem;
  padding: 40px 0;
}

/* レスポンシブ */
@media (max-width: 480px) {
  h1 {
    font-size: 1.2rem;
  }

  .form-section {
    padding: 16px;
  }
}
