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

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

header {
  background: #2c3e50;
  color: white;
  padding: 16px 20px;
  text-align: center;
}

header h1 {
  font-size: 1.4rem;
  font-weight: 700;
}

header .subtitle {
  font-size: 0.8rem;
  color: #bdc3c7;
  margin-top: 4px;
}

main {
  max-width: 1000px;
  margin: 0 auto;
  padding: 16px;
}

/* ---- 入力欄 ---- */
.input-section {
  background: white;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.input-row input {
  flex: 1;
  padding: 10px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-row input:focus {
  border-color: #2c3e50;
}

.input-row button {
  padding: 10px 20px;
  background: #2c3e50;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.2s;
}

.input-row button:hover {
  background: #34495e;
}

.quadrant-select {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quadrant-select label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 20px;
  border: 2px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s;
}

.quadrant-select input[type="radio"] {
  display: none;
}

.quadrant-select input[type="radio"]:checked + span {
  text-decoration: underline;
}

.quadrant-select label:has(input[value="q1"]:checked) { background: #fdecea; border-color: #e74c3c; }
.quadrant-select label:has(input[value="q2"]:checked) { background: #e8f4fd; border-color: #3498db; }
.quadrant-select label:has(input[value="q3"]:checked) { background: #fef9e7; border-color: #f39c12; }
.quadrant-select label:has(input[value="q4"]:checked) { background: #f2f3f4; border-color: #95a5a6; }

.q1-label { color: #c0392b; }
.q2-label { color: #2980b9; }
.q3-label { color: #d68910; }
.q4-label { color: #7f8c8d; }

/* ---- 4象限グリッド ---- */
.matrix-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quadrant {
  background: white;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  border-top: 4px solid;
  min-height: 160px;
}

.q1 { border-top-color: #e74c3c; }
.q2 { border-top-color: #3498db; }
.q3 { border-top-color: #f39c12; }
.q4 { border-top-color: #95a5a6; }

.quadrant-header {
  margin-bottom: 10px;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 4px;
}

.q1 .badge { background: #fdecea; color: #c0392b; }
.q2 .badge { background: #e8f4fd; color: #2980b9; }
.q3 .badge { background: #fef9e7; color: #d68910; }
.q4 .badge { background: #f2f3f4; color: #7f8c8d; }

.quadrant-header h2 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #333;
}

.quadrant-header .hint {
  font-size: 0.75rem;
  color: #888;
  margin-top: 2px;
}

/* ---- タスクリスト ---- */
.task-list {
  list-style: none;
}

.task-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.9rem;
}

.task-list li:last-child {
  border-bottom: none;
}

.task-list li span {
  flex: 1;
  word-break: break-all;
  line-height: 1.4;
}

.task-list li button {
  background: none;
  border: none;
  color: #bbb;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
  transition: color 0.2s;
}

.task-list li button:hover {
  color: #e74c3c;
}

.empty-msg {
  color: #ccc;
  font-size: 0.8rem;
  text-align: center;
  padding: 10px 0;
}

/* ---- フッター ---- */
.footer-actions {
  margin-top: 16px;
  text-align: center;
}

.danger-btn {
  background: none;
  border: 1.5px solid #e74c3c;
  color: #e74c3c;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.danger-btn:hover {
  background: #fdecea;
}

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

  .matrix-grid {
    grid-template-columns: 1fr;
  }

  .quadrant-select {
    flex-direction: column;
    gap: 6px;
  }

  .quadrant-select label {
    width: 100%;
  }

  .input-row button {
    padding: 10px 14px;
  }
}
