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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #fdf6ec;
  color: #333;
  min-height: 100vh;
  padding: 16px;
}

.container {
  max-width: 600px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  font-size: 1.6rem;
  color: #c0392b;
  margin-bottom: 20px;
  padding-top: 8px;
}

h2 {
  font-size: 1rem;
  color: #7f8c8d;
  margin-bottom: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* フォームセクション */
.add-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.2s;
  outline: none;
}

input[type="text"]:focus {
  border-color: #e67e22;
}

.time-row label {
  white-space: nowrap;
  color: #555;
  font-size: 0.9rem;
}

.time-row span {
  color: #555;
  font-size: 0.9rem;
}

input[type="number"] {
  width: 60px;
  padding: 8px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  text-align: center;
  outline: none;
  transition: border-color 0.2s;
}

input[type="number"]:focus {
  border-color: #e67e22;
}

/* ボタン */
.btn {
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 20px;
  transition: background 0.2s, transform 0.1s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-add {
  background: #e67e22;
  color: #fff;
  width: 100%;
}

.btn-add:hover {
  background: #d35400;
}

/* 工程リスト */
.steps-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.steps-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.steps-header h2 {
  margin-bottom: 0;
}

.btn-clear {
  background: #ecf0f1;
  color: #7f8c8d;
  font-size: 0.8rem;
  padding: 6px 12px;
}

.btn-clear:hover {
  background: #bdc3c7;
  color: #2c3e50;
}

.step-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-msg {
  text-align: center;
  color: #bdc3c7;
  padding: 24px 0;
  font-size: 0.9rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  background: #fafafa;
  transition: border-color 0.2s, background 0.2s;
}

.step-item.active {
  border-color: #e67e22;
  background: #fff5eb;
}

.step-item.done {
  border-color: #2ecc71;
  background: #f0fff4;
  opacity: 0.7;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e67e22;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.step-item.done .step-num {
  background: #2ecc71;
}

.step-info {
  flex: 1;
  min-width: 0;
}

.step-name {
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.step-time {
  font-size: 0.8rem;
  color: #999;
  margin-top: 2px;
}

.btn-delete {
  background: none;
  border: none;
  color: #ccc;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.btn-delete:hover {
  color: #e74c3c;
}

/* タイマーセクション */
.timer-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  text-align: center;
}

.current-step-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: #e67e22;
  margin-bottom: 12px;
  min-height: 1.5em;
}

.timer-display {
  font-size: 4rem;
  font-weight: 700;
  color: #2c3e50;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

.step-progress {
  font-size: 0.85rem;
  color: #999;
  margin-bottom: 20px;
  min-height: 1.2em;
}

.timer-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-start {
  background: #27ae60;
  color: #fff;
  min-width: 120px;
}

.btn-start:hover {
  background: #219a52;
}

.btn-pause {
  background: #f39c12;
  color: #fff;
  min-width: 120px;
}

.btn-pause:hover {
  background: #d68910;
}

.btn-reset {
  background: #ecf0f1;
  color: #555;
}

.btn-reset:hover {
  background: #bdc3c7;
}

/* 完了メッセージ */
.finish-msg {
  background: #d5f5e3;
  border: 2px solid #2ecc71;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1a8a45;
}

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

  .timer-display {
    font-size: 3rem;
  }

  input[type="number"] {
    width: 52px;
  }
}
