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

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

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

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

.date {
  font-size: 0.9rem;
  color: #888;
  margin-bottom: 20px;
}

/* 登録フォーム */
.add-section {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.add-section h2 {
  font-size: 1rem;
  color: #555;
  margin-bottom: 10px;
}

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

.form-row input[type="text"] {
  flex: 1;
  min-width: 120px;
  padding: 10px 12px;
  border: 1.5px solid #d0e8e8;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-row input[type="text"]:focus {
  border-color: #2a7a7a;
}

.form-row select {
  padding: 10px 8px;
  border: 1.5px solid #d0e8e8;
  border-radius: 8px;
  font-size: 0.95rem;
  background: #fff;
  cursor: pointer;
  outline: none;
}

.form-row select:focus {
  border-color: #2a7a7a;
}

.form-row button {
  padding: 10px 18px;
  background: #2a7a7a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.form-row button:hover {
  background: #1f5f5f;
}

/* タイミングブロック */
.check-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timing-block {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

.timing-block h2 {
  font-size: 1rem;
  color: #2a7a7a;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #e8f4f4;
}

.med-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.med-list:empty + .empty-msg {
  display: block;
}

.empty-msg {
  display: none;
  font-size: 0.85rem;
  color: #bbb;
  text-align: center;
  padding: 4px 0;
}

/* 薬アイテム */
.med-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f8fcfc;
  border-radius: 8px;
  border: 1.5px solid #e0f0f0;
  transition: background 0.2s, border-color 0.2s;
}

.med-item.checked {
  background: #f0f0f0;
  border-color: #ddd;
}

.med-item.checked .med-name {
  text-decoration: line-through;
  color: #aaa;
}

.check-box {
  width: 22px;
  height: 22px;
  border: 2px solid #2a7a7a;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.check-box.checked {
  background: #2a7a7a;
  border-color: #2a7a7a;
}

.check-box.checked::after {
  content: "✓";
  color: #fff;
  font-size: 0.85rem;
  font-weight: bold;
}

.med-name {
  flex: 1;
  font-size: 0.95rem;
}

.delete-btn {
  background: none;
  border: none;
  color: #ccc;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s;
  flex-shrink: 0;
}

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

/* リセットボタン */
.reset-area {
  margin-top: 24px;
  text-align: center;
}

#reset-today-btn {
  padding: 10px 24px;
  background: #fff;
  color: #888;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

#reset-today-btn:hover {
  background: #fef0f0;
  border-color: #e74c3c;
  color: #e74c3c;
}

@media (max-width: 400px) {
  h1 {
    font-size: 1.4rem;
  }

  .form-row input[type="text"],
  .form-row select,
  .form-row button {
    font-size: 0.9rem;
    padding: 9px 10px;
  }
}
