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

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

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

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

/* カレンダーナビ */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #4a90d9;
  color: #fff;
  border-radius: 8px 8px 0 0;
  padding: 12px 16px;
}

.calendar-nav button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.calendar-nav button:hover {
  background: rgba(255,255,255,0.2);
}

#currentMonth {
  font-size: 1.1rem;
  font-weight: 700;
}

/* カレンダー */
.calendar {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.calendar-header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: #f0f4f8;
}

.calendar-header span {
  text-align: center;
  padding: 8px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #666;
}

.calendar-header span.sun { color: #e74c3c; }
.calendar-header span.sat { color: #4a90d9; }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.calendar-day {
  border-top: 1px solid #f0f0f0;
  border-left: 1px solid #f0f0f0;
  min-height: 64px;
  padding: 4px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.calendar-day:hover {
  background: #f0f7ff;
}

.calendar-day.empty {
  background: #fafafa;
  cursor: default;
}

.calendar-day.today .day-num {
  background: #4a90d9;
  color: #fff;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.calendar-day.selected {
  background: #e8f3ff;
}

.calendar-day.selected .day-num {
  font-weight: 700;
}

.day-num {
  font-size: 0.82rem;
  font-weight: 500;
  margin-bottom: 2px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.day-sun .day-num { color: #e74c3c; }
.day-sat .day-num { color: #4a90d9; }

.day-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot.Twitter\/X { background: #1da1f2; }
.dot.Instagram { background: #e1306c; }
.dot.Facebook { background: #4267b2; }
.dot.その他 { background: #95a5a6; }

/* 投稿一覧 */
.post-list {
  margin-top: 20px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  padding: 16px;
}

.post-list h2 {
  font-size: 1rem;
  color: #555;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.add-btn {
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.add-btn:hover {
  background: #3a7bc8;
}

.post-item {
  border: 1px solid #e8ecf0;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fafcff;
}

.post-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.post-badge.Twitter\/X { background: #1da1f2; }
.post-badge.Instagram { background: #e1306c; }
.post-badge.Facebook { background: #4267b2; }
.post-badge.その他 { background: #95a5a6; }

.post-content {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #333;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-date-label {
  font-size: 0.75rem;
  color: #999;
  margin-top: 4px;
}

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

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

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

/* モーダル */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.modal h3 {
  font-size: 1.1rem;
  color: #2c3e50;
  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;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.9rem;
  color: #333;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #4a90d9;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.btn-cancel {
  background: #f0f0f0;
  color: #666;
  border: none;
  border-radius: 6px;
  padding: 8px 18px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-cancel:hover {
  background: #e0e0e0;
}

.btn-save {
  background: #4a90d9;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 8px 20px;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s;
}

.btn-save:hover {
  background: #3a7bc8;
}

@media (max-width: 480px) {
  .calendar-day {
    min-height: 50px;
    padding: 2px;
  }
  .day-num {
    font-size: 0.75rem;
  }
  .dot {
    width: 6px;
    height: 6px;
  }
}
