/* ONE-TAP CATEGORY GRID */
.tl-grid-section {
  margin-top: 4px;
}

.tl-grid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.tl-today-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  box-sizing: border-box;
  padding: 0 10px;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 0.76rem;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  user-select: none;
  transition: all 0.2s ease;
}

.tl-today-summary-chip:hover {
  border-color: var(--border-highlight);
  background: var(--bg-card);
}

.tl-today-summary-chip.negative {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

.mini-battery-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
}

.mini-battery-frame {
  width: 32px;
  height: 14px;
  border: 1.5px solid var(--border-strong, #374151);
  border-radius: 4px;
  padding: 1.5px;
  background: rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

.mini-battery-terminal {
  width: 2.5px;
  height: 6px;
  background: var(--border-strong, #374151);
  border-radius: 0 1.5px 1.5px 0;
  flex-shrink: 0;
  margin-left: -0.5px;
}

.mini-battery-liquid-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
}

.mini-battery-liquid-fill.fill-green {
  background: linear-gradient(90deg, #10b981, #059669);
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.mini-battery-liquid-fill.fill-amber {
  background: linear-gradient(90deg, #f59e0b, #d97706);
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.35);
}

.mini-battery-liquid-fill.fill-red {
  background: linear-gradient(90deg, #ef4444, #b91c1c);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
  animation: pulse-battery-red 1.5s infinite alternate;
}

.tl-today-energy-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.78rem;
}

.tl-today-energy-val.text-emerald {
  color: #10b981;
}

.tl-today-energy-val.text-rose {
  color: #ef4444;
}

.tl-today-summary-sep {
  opacity: 0.45;
  font-size: 0.72rem;
}

.tl-today-mins-text {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.tl-today-mins-text strong {
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.tl-grid-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-add-bucket {
  background: var(--accent-emerald-soft);
  border: 1px solid var(--accent-emerald);
  color: var(--accent-emerald);
  padding: 3px 9px;
  border-radius: 16px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-add-bucket:hover {
  background: var(--accent-emerald);
  color: #ffffff;
}

.btn-add-bucket.hidden {
  display: none !important;
}

.tl-grid-subhead {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.tl-fold-hint {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* MAIN TIME LOGGER SPLIT: BUCKETS (LEFT) + TODAY TIMELINE (RIGHT) */
.tl-main-split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 10px;
  align-items: start;
  margin-top: 1.5px;
}

.tl-buckets-column {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tl-buckets-footer {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-top: 6px;
  padding: 2px 2px;
}

.tl-buckets-footer .btn-edit-categories {
  font-size: 0.76rem;
  padding: 4px 10px;
  color: var(--text-muted);
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-buckets-footer .btn-edit-categories:hover {
  color: var(--text-primary);
  border-color: var(--border-highlight);
}

.tl-buckets-footer .btn-edit-categories.active {
  background: var(--accent-indigo);
  color: #fff;
  border-color: var(--accent-indigo);
}

/* SIDE TODAY TIMELINE VIEW */
.tl-side-today-column {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  box-shadow: 0 1px 4px rgba(80, 70, 50, 0.03);
  min-width: 0;
  height: 580px;
  min-height: 580px;
  max-height: 580px;
  box-sizing: border-box;
  overflow: hidden;
}

@media (min-width: 1081px) {
  .tl-side-today-column {
    height: 600px;
    min-height: 600px;
    max-height: 600px;
  }
}

.tl-side-today-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 2px 4px 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--border-subtle);
  flex-wrap: nowrap;
}

.tl-today-mins-group {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.tl-today-mins-text {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.tl-today-mins-text strong {
  font-weight: 800;
  color: var(--accent-indigo, #6366f1);
}

/* 24-Hour Time Inputs */
.time-24h-input {
  font-family: var(--font-mono) !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px;
}

#modal-edit-timelog .modal-card {
  max-width: 540px;
}
@media (max-width: 640px) {
  #modal-edit-timelog .modal-card {
    max-width: calc(100vw - 16px) !important;
    width: 100% !important;
  }
}

.modal-datetime-combo {
  display: flex;
  gap: 6px;
  align-items: center;
}

.modal-datetime-combo .modal-date-input {
  flex: 1.35;
  min-width: 0;
  padding: 6px 8px;
  font-size: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 6px;
  color: var(--text-primary);
}

.modal-datetime-combo .modal-time-input {
  width: 76px;
  min-width: 76px;
  text-align: center;
  padding: 6px 4px;
  font-size: 0.88rem;
  font-weight: 600;
  border-radius: 6px;
}

.tl-side-timeline-container {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
}

.tl-side-timeline-wrap {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 2px;
  gap: 0 !important;
  box-sizing: border-box;
}

.tl-side-timeline-node {
  display: flex;
  align-items: stretch;
  gap: 6px;
  position: relative;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.tl-side-timeline-rail {
  position: relative;
  width: 14px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: stretch;
  margin: 0;
}

.tl-side-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 3px;
  z-index: 2;
  flex-shrink: 0;
}

.tl-side-timeline-track {
  width: 2px;
  position: absolute;
  top: 0;
  bottom: 0;
  left: 6px;
  margin: 0;
  z-index: 1;
}

.tl-side-timeline-node:last-child .tl-side-timeline-track {
  display: block;
}

.tl-side-timeline-card {
  flex: 1;
  min-width: 0;
  background: var(--bg-card-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2px 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  overflow: hidden;
  min-height: 16px;
  height: calc(100% - 2px);
  margin: auto 0;
  z-index: 2;
}

.tl-side-timeline-card:hover {
  transform: translateX(1px);
  border-color: var(--border-highlight);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.tl-side-timeline-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 0.67rem;
  margin-bottom: 1px;
}

.tl-side-timeline-time {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.tl-side-timeline-dur {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.64rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tl-side-timeline-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  font-size: 0.72rem;
}

.tl-side-timeline-act {
  display: flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.tl-side-timeline-act strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-side-energy-pill {
  font-family: var(--font-mono);
  font-size: 0.63rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.tl-side-energy-pill.pos {
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
}

.tl-side-energy-pill.neg {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
}

.tl-side-energy-pill.zero {
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.05);
}

.tl-side-timeline-note {
  margin-top: 2px;
  font-size: 0.64rem;
  color: var(--text-muted);
  background: rgba(0, 0, 0, 0.02);
  border-radius: 3px;
  padding: 1px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Untracked Time in Side Timeline */
.tl-side-timeline-node.is-untracked {
  gap: 6px;
  padding: 0;
  margin: 0;
}

.tl-side-timeline-rail .tl-side-timeline-dot.untracked-dot {
  width: 6px;
  height: 6px;
  left: 4px;
  background: #ffffff;
  border: 1.5px solid #9ca3af;
  border-radius: 50%;
}

.tl-side-timeline-track.gray-track {
  width: 2px !important;
  background: #cbd5e1 !important;
}

.tl-side-untracked-card {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(156, 163, 175, 0.06);
  border: 1px dashed rgba(156, 163, 175, 0.35);
  font-size: 0.63rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  box-sizing: border-box;
  overflow: hidden;
  white-space: nowrap;
  height: calc(100% - 2px);
  margin: 1px 0;
}

.tl-side-untracked-time {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.63rem;
}

.tl-side-untracked-dur {
  font-size: 0.61rem;
  opacity: 0.85;
}

/* Day boundaries (6:00 PM & 12:00 AM Midnight) */
.tl-side-milestone {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 3px 2px;
  width: 100%;
  box-sizing: border-box;
}

.tl-side-milestone-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
  flex-shrink: 0;
}

.tl-side-milestone-text {
  font-size: 0.66rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.tl-side-milestone-line {
  flex: 1;
  height: 1px;
  background: var(--border-subtle, #e2e8f0);
}

.tl-milestone-chip {
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent-indigo, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 10px;
  padding: 1px 7px;
  line-height: 1.2;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.3px;
}

.tl-side-milestone.touches-bubble {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}

.tl-side-milestone.is-end {
  margin-top: auto !important;
  padding-bottom: 2px !important;
}

.structured-tl-item.is-side.touches-6am-line {
  margin-top: -6px !important;
}

.structured-tl-item.is-side.touches-6am-line .structured-tl-spine-col.is-side {
  justify-content: flex-start !important;
}

.structured-tl-item.is-side.touches-6am-line .structured-tl-capsule.is-side {
  margin-top: 0 !important;
}

/* Live Active Node in Side Timeline */
.tl-side-timeline-node.is-live-active .tl-side-timeline-dot.live-pulse {
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35);
  animation: pulse-dot 1s infinite alternate;
}

.tl-side-timeline-card.live-card {
  border-left: 3px solid #10b981 !important;
  background: linear-gradient(135deg, var(--bg-card-elevated), rgba(16, 185, 129, 0.07));
  border-color: rgba(16, 185, 129, 0.4);
  cursor: pointer;
  transition: all 0.15s ease;
}

.tl-side-timeline-card.live-card:hover {
  border-color: #10b981;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.2);
  transform: translateY(-1px);
}

.tl-live-tag {
  color: #10b981 !important;
  font-weight: 700;
}

@media (max-width: 640px) {
  .tl-main-split-layout {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .tl-side-today-column {
    height: auto;
    min-height: 0;
    max-height: none;
  }
}

