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

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

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

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

header h1 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #2c3e50;
}

.subtitle {
  font-size: 0.85rem;
  color: #888;
  margin-top: 4px;
}

/* Form section */
.form-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.form-section h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 16px;
}

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

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

.required {
  color: #e74c3c;
}

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

.form-group input:focus {
  outline: none;
  border-color: #4a90d9;
}

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

.btn-primary:hover {
  background: #357abd;
}

/* List section */
.list-section {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.list-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #555;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.tab {
  padding: 4px 10px;
  border: 1.5px solid #ddd;
  border-radius: 20px;
  background: #fff;
  font-size: 0.78rem;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
}

.tab.active {
  background: #4a90d9;
  border-color: #4a90d9;
  color: #fff;
}

/* Print list */
.print-list {
  list-style: none;
}

.print-item {
  border: 1.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 10px;
  transition: box-shadow 0.2s;
}

.print-item:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 今日が期限 */
.print-item.today {
  border-color: #e74c3c;
  background: #fff5f5;
}

/* 明日が期限 */
.print-item.tomorrow {
  border-color: #e67e22;
  background: #fff8f0;
}

/* 2日以内 */
.print-item.soon {
  border-color: #f0b429;
  background: #fffdf0;
}

/* 完了 */
.print-item.done {
  opacity: 0.55;
  border-color: #ccc;
  background: #fafafa;
}

.item-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.item-check {
  width: 20px;
  height: 20px;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #4a90d9;
}

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

.item-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  word-break: break-word;
}

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

.item-deadline {
  font-size: 0.82rem;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.deadline-label {
  color: #888;
}

.deadline-value {
  font-weight: 600;
}

.print-item.today .deadline-value {
  color: #e74c3c;
}

.print-item.tomorrow .deadline-value {
  color: #e67e22;
}

.print-item.soon .deadline-value {
  color: #d4a017;
}

.badge {
  font-size: 0.72rem;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
}

.badge.today {
  background: #e74c3c;
  color: #fff;
}

.badge.tomorrow {
  background: #e67e22;
  color: #fff;
}

.badge.soon {
  background: #f0b429;
  color: #fff;
}

.item-things {
  font-size: 0.85rem;
  color: #666;
  margin-top: 6px;
  padding: 6px 8px;
  background: #f0f4f8;
  border-radius: 6px;
  word-break: break-word;
}

.item-things::before {
  content: "📦 ";
}

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

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

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

@media (max-width: 480px) {
  .list-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
