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

h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid #3498db;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 12px;
}

/* フォームセクション */
.form-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
}

.form-group label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
}

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

.form-group input:focus {
  outline: none;
  border-color: #3498db;
}

#taskName {
  min-width: 150px;
}

#duration {
  max-width: 100px;
}

.btn-add {
  padding: 8px 20px;
  background: #3498db;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  align-self: flex-end;
}

.btn-add:hover {
  background: #2980b9;
}

.error-msg {
  color: #e74c3c;
  font-size: 0.85rem;
  margin-top: 8px;
}

/* チャートセクション */
.chart-section {
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.btn-clear {
  padding: 6px 14px;
  background: #fff;
  color: #e74c3c;
  border: 1.5px solid #e74c3c;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-clear:hover {
  background: #e74c3c;
  color: #fff;
}

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

/* ガントチャート本体 */
.chart-container {
  overflow-x: auto;
}

.gantt-wrapper {
  min-width: 600px;
}

/* ヘッダー行（日付ラベル） */
.gantt-header {
  display: grid;
  align-items: center;
}

.gantt-header-label {
  font-size: 0.78rem;
  color: #888;
  padding: 4px 6px;
  text-align: center;
  border-left: 1px solid #eee;
  white-space: nowrap;
  overflow: hidden;
  background: #f8f9fa;
}

.gantt-header-label.today-header {
  background: #fef9e7;
  color: #e67e22;
  font-weight: 700;
}

.gantt-header-name {
  font-size: 0.8rem;
  color: #555;
  font-weight: 600;
  padding: 4px 8px;
  background: #f8f9fa;
}

/* 各作業行 */
.gantt-row {
  display: grid;
  align-items: center;
  border-top: 1px solid #eee;
}

.gantt-row:last-child {
  border-bottom: 1px solid #eee;
}

.gantt-task-name {
  font-size: 0.85rem;
  padding: 6px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.gantt-cell {
  height: 36px;
  border-left: 1px solid #f0f0f0;
  position: relative;
}

.gantt-cell.today-col {
  background: rgba(230, 126, 34, 0.05);
  border-left: 1px solid rgba(230, 126, 34, 0.3);
}

/* ガントバー */
.gantt-bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding: 0 6px;
  font-size: 0.78rem;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: default;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

/* 削除ボタン */
.btn-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  font-size: 1rem;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
  flex-shrink: 0;
}

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

/* 今日ライン */
.today-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e67e22;
  z-index: 10;
  pointer-events: none;
}

/* レスポンシブ */
@media (max-width: 600px) {
  .form-row {
    flex-direction: column;
  }

  .form-group {
    width: 100%;
    min-width: unset;
  }

  #duration {
    max-width: 100%;
  }

  .btn-add {
    width: 100%;
    padding: 10px;
  }
}
