/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body, #root {
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: #09090f;
  color: #a78bfa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── App shell ── */
.root {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #09090f;
}

/* ── Header ── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 52px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.07);
  flex-shrink: 0;
  background: #0b0b14;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.rimico-link {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: rgba(167, 139, 250, 0.4);
  text-decoration: none;
  text-transform: uppercase;
  transition: color 0.15s;
}
.rimico-link:hover { color: #a78bfa; }

.header-sep {
  font-size: 18px;
  font-weight: 200;
  color: rgba(167, 139, 250, 0.15);
  line-height: 1;
}

.header-title {
  font-size: 16px;
  font-weight: 500;
  color: rgba(167, 139, 250, 0.5);
  letter-spacing: 0.02em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Done toggle button */
.done-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: rgba(167, 139, 250, 0.4);
  background: transparent;
  border: 1px solid rgba(167, 139, 250, 0.12);
  border-radius: 99px;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}
.done-toggle:hover {
  color: rgba(167, 139, 250, 0.75);
  border-color: rgba(167, 139, 250, 0.25);
  background: rgba(167, 139, 250, 0.05);
}
.done-toggle-active {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.08);
}

.attr-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: rgba(167, 139, 250, 0.3);
  text-decoration: none;
  padding: 5px 13px;
  border-radius: 99px;
  border: 1px solid rgba(167, 139, 250, 0.1);
  transition: all 0.15s;
}
.attr-link:hover {
  color: rgba(167, 139, 250, 0.65);
  border-color: rgba(167, 139, 250, 0.22);
}

/* ── Body layout ── */
.body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Main scrollable area ── */
.main {
  flex: 1;
  overflow-y: auto;
  padding: 32px 40px 48px;
  min-width: 0;
}

/* ── List section ── */
.list-section {
  margin-bottom: 44px;
}

.list-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  min-height: 36px;
}

.list-name {
  font-size: 28px;
  font-weight: 600;
  color: rgba(167, 139, 250, 0.75);
  cursor: text;
  letter-spacing: -0.01em;
  line-height: 1.2;
  transition: color 0.15s;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.list-name:hover {
  color: #a78bfa;
  border-bottom-color: rgba(167, 139, 250, 0.25);
}

.list-name-input {
  font-size: 28px;
  font-weight: 600;
  color: #c4b5fd;
  background: transparent;
  border: none;
  border-bottom: 1.5px solid rgba(167, 139, 250, 0.4);
  outline: none;
  font-family: inherit;
  letter-spacing: -0.01em;
  padding-bottom: 1px;
  min-width: 120px;
  width: auto;
}

.list-delete-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  color: rgba(167, 139, 250, 0.2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.12s;
  opacity: 0;
  flex-shrink: 0;
}
.list-header:hover .list-delete-btn { opacity: 1; }
.list-delete-btn:hover {
  color: rgba(255, 100, 100, 0.65);
  background: rgba(255, 80, 80, 0.07);
}

/* ── List items wrapper ── */
.list-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

/* ── Bullet row — the "Left Temporal" pill aesthetic ── */
.bullet-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 5px;
  padding-bottom: 5px;
  padding-right: 14px;
  border-radius: 8px;
  background: rgba(139, 92, 246, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.1);
  transition: background 0.1s, border-color 0.1s;
  cursor: text;
}
.bullet-row:hover {
  background: rgba(139, 92, 246, 0.09);
  border-color: rgba(167, 139, 250, 0.16);
}
.bullet-row:focus-within {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(167, 139, 250, 0.22);
}

/* Indent guide lines */
.indent-guide {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(167, 139, 250, 0.1);
  pointer-events: none;
}

/* ── Checkbox ── */
.checkbox {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(167, 139, 250, 0.32);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  z-index: 1;
}
.checkbox:hover {
  border-color: #a78bfa;
  background: rgba(167, 139, 250, 0.1);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.07);
}
.checkbox-inner { display: none; }

/* ── Task input — 50% bigger than base ── */
.task-input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  font-family: inherit;
  /* 50% bigger: base ~13.5px → 20px */
  font-size: 20px;
  line-height: 1.45;
  color: #c4b5fd;
  caret-color: #a78bfa;
  padding: 2px 0;
  letter-spacing: 0.005em;
}
.task-input::placeholder {
  color: rgba(167, 139, 250, 0.15);
  font-size: 24px;
  line-height: 0.95;
}
.task-input:focus {
  outline: none;
  box-shadow: none;
}

/* ── Add item button ── */
.add-item-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  color: rgba(167, 139, 250, 0.25);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.add-item-btn:hover {
  color: rgba(167, 139, 250, 0.55);
  background: rgba(167, 139, 250, 0.04);
}

/* ── New list button ── */
.new-list-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  font-family: inherit;
  color: rgba(167, 139, 250, 0.3);
  background: transparent;
  border: 1px dashed rgba(167, 139, 250, 0.15);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}
.new-list-btn:hover {
  color: rgba(167, 139, 250, 0.6);
  border-color: rgba(167, 139, 250, 0.3);
  background: rgba(167, 139, 250, 0.04);
}

/* ── Hint bar ── */
.hints {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 28px;
  font-size: 13px;
  color: rgba(167, 139, 250, 0.2);
  border-top: 1px solid rgba(167, 139, 250, 0.05);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}
.hint-sep { color: rgba(167, 139, 250, 0.1); }

/* ── Completed sidebar — initially collapsed ── */
.completed-sidebar {
  width: 0;
  flex-shrink: 0;
  overflow: hidden;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  background: #07070e;
}
.completed-sidebar.open {
  width: 270px;
}

/* Inner wrapper keeps content from squishing during transition */
.completed-inner {
  width: 270px;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid rgba(167, 139, 250, 0.07);
}

.completed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 13px;
  border-bottom: 1px solid rgba(167, 139, 250, 0.06);
  flex-shrink: 0;
}

.completed-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(167, 139, 250, 0.35);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.clear-btn {
  font-size: 13px;
  font-family: inherit;
  color: rgba(167, 139, 250, 0.28);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 4px;
  transition: all 0.15s;
}
.clear-btn:hover {
  color: rgba(255, 100, 100, 0.65);
  background: rgba(255, 80, 80, 0.07);
}

.completed-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
}

.empty-msg {
  font-size: 14px;
  color: rgba(167, 139, 250, 0.15);
  text-align: center;
  padding: 32px 0;
  font-style: italic;
}

.completed-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 7px;
  border-radius: 6px;
  margin-bottom: 2px;
  transition: background 0.1s;
}
.completed-item:hover { background: rgba(167, 139, 250, 0.04); }

.completed-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.12);
  border: 1.5px solid rgba(167, 139, 250, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(167, 139, 250, 0.6);
}

.completed-text {
  flex: 1;
  font-size: 14px;
  color: rgba(167, 139, 250, 0.28);
  text-decoration: line-through;
  text-decoration-color: rgba(167, 139, 250, 0.15);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.restore-btn {
  flex-shrink: 0;
  color: rgba(167, 139, 250, 0.2);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all 0.12s;
}
.completed-item:hover .restore-btn { opacity: 1; }
.restore-btn:hover {
  color: rgba(167, 139, 250, 0.7);
  background: rgba(167, 139, 250, 0.08);
}

/* ── Custom scrollbar ── */
.custom-scrollbar::-webkit-scrollbar { width: 3px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(167, 139, 250, 0.1);
  border-radius: 2px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(167, 139, 250, 0.22);
}

/* ── Graph toggle button ── */
.graph-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: rgba(167, 139, 250, 0.4);
  background: transparent;
  border: 1px solid rgba(167, 139, 250, 0.12);
  border-radius: 99px;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}
.graph-toggle:hover {
  color: rgba(167, 139, 250, 0.75);
  border-color: rgba(167, 139, 250, 0.25);
  background: rgba(167, 139, 250, 0.05);
}
.graph-toggle-active {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.08);
}

/* ── Graph container ── */
.graph-container {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #07070d;
}
.graph-container canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── Graph legend ── */
.graph-legend {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: rgba(9, 7, 20, 0.75);
  border: 1px solid rgba(167, 139, 250, 0.1);
  border-radius: 10px;
  padding: 10px 14px;
  backdrop-filter: blur(6px);
}
.graph-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(167, 139, 250, 0.6);
  white-space: nowrap;
}
.graph-legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Graph hint ── */
.graph-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(167, 139, 250, 0.25);
  letter-spacing: 0.03em;
  white-space: nowrap;
  pointer-events: none;
}

/* ── List section color accent + drag ── */
.list-section {
  border-left: 2.5px solid var(--lc, rgba(167, 139, 250, 0.18));
  padding-left: 16px;
  margin-left: -16px;
  transition: border-color 0.2s, opacity 0.15s;
}
.list-section[data-drag-over="true"] { opacity: 0.45; }

/* ── Drag handle ── */
.drag-handle {
  opacity: 0;
  cursor: grab;
  color: rgba(167, 139, 250, 0.28);
  transition: opacity 0.12s;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding: 2px 3px;
  border-radius: 4px;
}
.list-header:hover .drag-handle { opacity: 1; }
.drag-handle:hover { color: rgba(167, 139, 250, 0.6); }

/* ── List color swatch ── */
.list-color-btn {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  opacity: 0;
  transition: opacity 0.12s, transform 0.15s, box-shadow 0.15s;
}
.list-header:hover .list-color-btn { opacity: 1; }
.list-color-btn:hover {
  transform: scale(1.3);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.18);
}

/* ── Task area (wraps main + completed sidebar) ── */
.task-area {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Study Timer panel ── */
.timer-panel {
  width: 300px;
  flex-shrink: 0;
  border-right: 1px solid rgba(167, 139, 250, 0.07);
  background: #09090f;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.timer-panel.expanded {
  width: 100%;
  border-right: none;
}
.timer-close-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 14px 0;
  flex-shrink: 0;
}
.timer-phase-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(167, 139, 250, 0.4);
}
.timer-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: rgba(167, 139, 250, 0.32);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.timer-icon-btn:hover {
  color: rgba(167, 139, 250, 0.7);
  background: rgba(167, 139, 250, 0.07);
}
.timer-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 20px 28px;
  gap: 22px;
  overflow-y: auto;
}
/* Ring */
.timer-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.timer-ring-svg { transform: rotate(-90deg); }
.timer-ring-bg  { fill: none; stroke: rgba(167, 139, 250, 0.08); }
.timer-ring-fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s linear, stroke 0.4s;
}
.timer-display {
  position: absolute;
  font-size: 38px;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: #c4b5fd;
  font-variant-numeric: tabular-nums;
}
/* Inputs */
.timer-input-row {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: center;
}
.timer-mins-input {
  width: 68px;
  text-align: center;
  background: rgba(167, 139, 250, 0.05);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 8px;
  color: #c4b5fd;
  font-size: 15px;
  font-family: inherit;
  padding: 6px 8px;
  outline: none;
  transition: border-color 0.15s;
}
.timer-mins-input:focus { border-color: rgba(167, 139, 250, 0.4); }
.timer-mins-input:disabled { opacity: 0.45; }
.timer-mins-label { font-size: 13px; color: rgba(167, 139, 250, 0.38); }
.timer-set-btn {
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  color: rgba(167, 139, 250, 0.5);
  background: rgba(167, 139, 250, 0.06);
  border: 1px solid rgba(167, 139, 250, 0.14);
  border-radius: 7px;
  padding: 6px 13px;
  cursor: pointer;
  transition: all 0.15s;
}
.timer-set-btn:hover { color: #a78bfa; border-color: rgba(167, 139, 250, 0.3); }
/* Controls */
.timer-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}
.timer-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.03em;
  border-radius: 99px;
  padding: 8px 18px;
  cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid;
}
.timer-ctrl-btn.primary {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.38);
  background: rgba(167, 139, 250, 0.09);
}
.timer-ctrl-btn.primary:hover { background: rgba(167, 139, 250, 0.17); border-color: #a78bfa; }
.timer-ctrl-btn.primary:disabled { opacity: 0.35; cursor: not-allowed; }
.timer-ctrl-btn.secondary {
  color: rgba(167, 139, 250, 0.38);
  border-color: rgba(167, 139, 250, 0.11);
  background: transparent;
}
.timer-ctrl-btn.secondary:hover { color: rgba(167, 139, 250, 0.68); border-color: rgba(167, 139, 250, 0.24); }
/* Break suggestion box */
.timer-break-box {
  background: rgba(167, 139, 250, 0.04);
  border: 1px solid rgba(167, 139, 250, 0.11);
  border-radius: 12px;
  padding: 18px 20px;
  text-align: center;
  max-width: 230px;
}
.timer-break-title {
  font-size: 16px;
  font-weight: 600;
  color: #c4b5fd;
  margin-bottom: 6px;
}
.timer-break-sub {
  font-size: 13px;
  color: rgba(167, 139, 250, 0.42);
  margin-bottom: 14px;
  line-height: 1.55;
}
/* Timer header toggle */
.timer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  color: rgba(167, 139, 250, 0.4);
  background: transparent;
  border: 1px solid rgba(167, 139, 250, 0.12);
  border-radius: 99px;
  padding: 5px 14px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.01em;
}
.timer-toggle:hover {
  color: rgba(167, 139, 250, 0.75);
  border-color: rgba(167, 139, 250, 0.25);
  background: rgba(167, 139, 250, 0.05);
}
.timer-toggle-active {
  color: #a78bfa;
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.08);
}

/* ── Global focus reset ── */
*:focus { outline: none; box-shadow: none; }
