* {
  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: 600px;
  margin: 0 auto;
  padding: 16px;
}

h1 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  padding: 16px 0 20px;
  color: #2c3e50;
}

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

.form-section h2 {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 12px;
  font-weight: 600;
}

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

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 4px;
}

.form-group input {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid #dde;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus {
  border-color: #5b8dee;
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: #5b8dee;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: #4a7de0;
}

/* フィルター */
.filter-section {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.filter-btn {
  flex: 1;
  padding: 8px 4px;
  background: #fff;
  border: 1.5px solid #dde;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  color: #666;
  transition: all 0.15s;
}

.filter-btn.active {
  background: #5b8dee;
  border-color: #5b8dee;
  color: #fff;
  font-weight: 600;
}

/* 一覧 */
.list-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.item-card {
  background: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border-left: 4px solid #5b8dee;
  transition: opacity 0.2s;
}

.item-card.done {
  border-left-color: #ccc;
  opacity: 0.65;
}

.item-card.overdue {
  border-left-color: #e74c3c;
}

.item-card.overdue .deadline-text {
  color: #e74c3c;
  font-weight: 700;
}

.item-card.today .deadline-text {
  color: #e67e22;
  font-weight: 700;
}

.item-checkbox {
  width: 22px;
  height: 22px;
  min-width: 22px;
  cursor: pointer;
  accent-color: #5b8dee;
  margin-top: 2px;
}

.item-body {
  flex: 1;
  min-width: 0;
}

.item-subject {
  display: inline-block;
  font-size: 0.75rem;
  background: #eef2ff;
  color: #5b8dee;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  margin-bottom: 4px;
}

.item-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #2c3e50;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-card.done .item-title {
  text-decoration: line-through;
  color: #999;
}

.deadline-text {
  font-size: 0.8rem;
  color: #888;
  margin-top: 3px;
}

.delete-btn {
  background: none;
  border: none;
  color: #bbb;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 4px;
  line-height: 1;
  transition: color 0.15s;
}

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

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

.empty-msg.visible {
  display: block;
}

@media (max-width: 375px) {
  h1 { font-size: 1.2rem; }
  .item-title { font-size: 0.88rem; }
}
