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

body {
  font-family: sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

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

header {
  text-align: center;
  padding: 24px 0 16px;
}

header h1 {
  font-size: 1.6rem;
  color: #333;
  margin-bottom: 4px;
}

.today-label {
  font-size: 0.9rem;
  color: #777;
}

/* 追加フォーム */
.add-section {
  margin-bottom: 16px;
}

#addForm {
  display: flex;
  gap: 8px;
}

#habitInput {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  background: #fff;
}

#habitInput:focus {
  border-color: #4a90d9;
}

#addForm button {
  padding: 10px 20px;
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  white-space: nowrap;
}

#addForm button:hover {
  background: #357abf;
}

/* サマリー */
.summary {
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
}

#progressText {
  font-size: 0.95rem;
  color: #555;
  display: block;
  margin-bottom: 8px;
}

.progress-bar-wrap {
  background: #eee;
  border-radius: 99px;
  height: 8px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: #4a90d9;
  border-radius: 99px;
  width: 0%;
  transition: width 0.3s ease;
}

/* 習慣リスト */
.habits-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.empty-msg {
  text-align: center;
  color: #aaa;
  font-size: 0.95rem;
  padding: 32px 0;
}

/* 習慣カード */
.habit-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background 0.2s;
}

.habit-item.done {
  background: #e8f5e9;
}

.check-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #ccc;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: border-color 0.2s, background 0.2s;
}

.habit-item.done .check-btn {
  background: #4caf50;
  border-color: #4caf50;
  color: #fff;
}

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

.habit-name {
  font-size: 1rem;
  word-break: break-word;
  transition: text-decoration 0.2s;
}

.habit-item.done .habit-name {
  text-decoration: line-through;
  color: #888;
}

.streak {
  font-size: 0.78rem;
  color: #f57c00;
  margin-top: 2px;
}

.delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  flex-shrink: 0;
}

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

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

  #addForm button {
    padding: 10px 14px;
    font-size: 0.95rem;
  }
}
