.habits-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
}

.habits-plus-column {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.segment-tone-morning {
  background: linear-gradient(180deg, #fbfefc 0%, #f7fcf8 100%);
  border: 1px solid #edf7ef;
}

.segment-tone-day {
  background: linear-gradient(180deg, #f8fdf9 0%, #f1faf3 100%);
  border: 1px solid #e7f3ea;
}

.segment-tone-evening {
  background: linear-gradient(180deg, #f6fcf7 0%, #eef8f0 100%);
  border: 1px solid #e1efe5;
}

.segment-tone-general {
  background: linear-gradient(180deg, #f3fbf5 0%, #ebf7ee 100%);
  border: 1px solid #dceee2;
}

.segment-tone-minus {
  background: linear-gradient(180deg, #fff1f4 0%, #ffe8ec 100%);
  border: 1px solid #efc7d0;
}

.habit-segment-card,
.add-habit-form {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.habit-segment-title {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
}

.habit-segment-list {
  min-height: 58px;
  border: 1px dashed transparent;
  border-radius: 12px;
}

.habit-segment-list.drag-over {
  border-color: var(--blue);
  background: rgba(37,99,235,.04);
}

.habit-manage-empty {
  font-size: 14px;
  padding: 12px 0;
}

.habit-manage-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  background: rgba(255,255,255,.72);
  border-radius: 12px;
  margin-bottom: 10px;
  position: relative;
  width: 100%;
  border: 1px solid rgba(229,231,235,.8);
}

.habit-manage-item.dragging {
  opacity: .45;
}

.habit-drag-handle {
  width: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 18px;
  flex-shrink: 0;
}

.habit-type-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 8px;
}

.habit-type-dot.plus { background: var(--green); }
.habit-type-dot.minus { background: var(--red); }

.habit-manage-main {
  flex: 1;
  min-width: 0;
}

.habit-manage-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.habit-manage-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.habit-manage-controls {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 0;
}

.habit-manage-inline-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.habit-mobile-actions {
  display: none;
  width: 100%;
  margin-top: 8px;
  gap: 4px;
  flex-wrap: nowrap;
  overflow: hidden;
  align-items: center;
  min-width: 0;
}

.habit-mobile-actions button {
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  flex: 1 1 0;
  min-width: 0;
}

.habit-manage-weight {
  width: 58px;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  background: white;
  flex-shrink: 0;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: white;
  cursor: pointer;
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.add-habit-form {
  background: linear-gradient(180deg, #fffdf8 0%, #fffaf0 100%);
  border: 1px solid #f2e5c4;
}

.add-habit-form h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 16px;
}

.type-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.type-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}

.type-btn.plus.active { background: var(--green-light); border-color: var(--green); color: #14532d; }
.type-btn.minus.active { background: var(--red-light); border-color: var(--red); color: #7f1d1d; }
