/* Dashboard shell: header + sidebar + main */

.shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  grid-template-rows: 56px 1fr;
  grid-template-areas:
    "sidebar header"
    "sidebar main";
  height: 100vh;
}

.header {
  grid-area: header;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.header .title { font-weight: 600; font-size: 15px; letter-spacing: 0.2px; }
.header .user  { color: var(--muted); font-size: 13px; }
.header .actions { display: flex; gap: 8px; align-items: center; }
.header .nav-toggle { display: none; }

.sidebar {
  grid-area: sidebar;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  overflow-y: auto;
}

.sidebar .brand {
  font-weight: 700;
  padding: 4px 10px 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  font-size: 15px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--text);
  font-size: 14px;
}
.sidebar nav a:hover { background: var(--surface-hover); text-decoration: none; }
.sidebar nav a.active {
  background: var(--surface-hover);
  color: var(--accent);
  font-weight: 600;
}
.sidebar nav a.disabled {
  color: var(--muted);
  cursor: not-allowed;
  pointer-events: none;
}

.main {
  grid-area: main;
  overflow-y: auto;
  padding: 28px 32px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 22px;
  margin-bottom: 16px;
}

.muted  { color: var(--muted); font-size: 13px; }
.stack  { display: flex; flex-direction: column; gap: 10px; }
.row    { display: flex; gap: 10px; align-items: center; }
.badge  {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: var(--surface-hover);
  color: var(--muted);
}
.badge.ok { color: var(--success); }
.badge.err { color: var(--danger); }

/* Login page */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 28px 26px;
}
.login-card h1 { margin: 0 0 18px; font-size: 18px; }
.login-card .error {
  color: var(--danger);
  font-size: 13px;
  min-height: 1.2em;
  margin: 8px 0 4px;
}
.login-card label {
  font-size: 12px;
  color: var(--muted);
  display: block;
  margin: 12px 0 4px;
}
.login-card button { width: 100%; margin-top: 16px; }

/* Overview */
.overview-stack { display: flex; flex-direction: column; gap: 14px; }
.overview-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 14px 14px;
}
.overview-section > summary {
  list-style: none;
  cursor: pointer;
  font-size: 16px; font-weight: 600;
  padding: 10px 4px;
  display: flex; align-items: center; gap: 10px;
  user-select: none;
}
.overview-section > summary::-webkit-details-marker { display: none; }
.overview-section > summary::after {
  content: "▾"; margin-left: auto;
  color: var(--muted); transition: transform 0.15s;
}
.overview-section:not([open]) > summary::after { transform: rotate(-90deg); }
.overview-section .sec-icon { font-size: 18px; }
.overview-section .sec-badge { color: var(--muted); font-weight: 400; font-size: 13px; }

.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 6px;
}
.overview-grid .panel-wide { grid-column: 1 / -1; }

/* Today · pulse row */
.pulse-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.pulse {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.pulse-icon { font-size: 22px; line-height: 1; }
.pulse-body { min-width: 0; flex: 1; }
.pulse-label { font-size: 11px; color: var(--muted); }
.pulse-value { font-size: 18px; font-weight: 600; line-height: 1.1; }
.pulse-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Tasks · counter row */
.counter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.counter {
  text-align: center;
  padding: 8px 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.counter-value { font-size: 24px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.counter-label { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* Tasks · per-board */
.board-line {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 8px;
  align-items: center;
  padding: 4px 0;
}
.board-line .dot {
  grid-row: 1 / 3;
  width: 10px; height: 10px; border-radius: 50%;
}
.board-line .board-name { color: var(--text); }
.board-line .board-meta { font-size: 12px; }
.board-line .bar { grid-column: 2 / 4; height: 4px; }

/* Tasks · due row */
.due-row {
  display: block;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--text);
}
.due-row:hover { background: var(--surface-hover); text-decoration: none; }
.due-title {
  font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Finance · top categories */
.cat-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 4px 0;
}
.cat-name { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-amt { font-size: 12px; font-variant-numeric: tabular-nums; }

/* Habits */
.habit-row { padding: 4px 0; }
.habit-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.habit-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  transition: border-color 0.15s;
}
.habit-card.done   { border-color: var(--success); }
.habit-card.missed { border-color: var(--danger); }
.habit-card-title { font-size: 14px; font-weight: 500; }
.hab-btn {
  font-size: 12px; padding: 4px 10px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer;
}
.hab-btn:hover { background: var(--surface-hover); }
.hab-btn.active-ok  { background: var(--success); color: #0d1117; border-color: var(--success); }
.hab-btn.active-err { background: var(--danger);  color: #0d1117; border-color: var(--danger); }

.ring-wrap {
  display: flex; justify-content: center; align-items: center;
  padding: 6px 0 4px;
}
.ring { width: 160px; height: 160px; }

.top-row {
  display: grid;
  grid-template-columns: 1fr 140px 48px;
  gap: 10px;
  align-items: center;
}
.top-label { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-pct { text-align: right; font-variant-numeric: tabular-nums; }

.bar {
  position: relative; height: 8px; background: var(--bg);
  border-radius: 999px; overflow: hidden; border: 1px solid var(--border);
}
.bar > span {
  display: block; height: 100%;
  border-radius: 999px;
  transition: width 0.25s;
}

.ghost-row {
  display: flex; justify-content: space-between;
  padding: 6px 8px; border-radius: 6px; color: var(--text);
}
.ghost-row:hover { background: var(--surface-hover); text-decoration: none; }

/* Goals section */
.goals-toolbar {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
#status-filter {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 8px; font: inherit;
}

.chip {
  padding: 5px 10px; font-size: 12px;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer;
}
.chip:hover { background: var(--surface-hover); }
.chip.active {
  background: var(--accent); color: #0d1117;
  border-color: var(--accent);
}

.level-group { margin-top: 18px; }
.level-title {
  margin: 0 0 10px; font-size: 14px;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600;
}
.goal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.goal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color 0.15s, transform 0.05s;
}
.goal-card:hover { border-color: var(--accent); }
.goal-card:active { transform: translateY(1px); }
.card-title { font-weight: 500; }
.ghost-mark { margin-left: 4px; }

.empty {
  text-align: center; padding: 40px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 40; padding: 40px 20px; overflow-y: auto;
  animation: fade 0.15s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
  width: 100%; max-width: 640px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.35);
}
.modal h2 { margin: 0 0 6px; font-size: 18px; }
.modal-close {
  position: absolute; right: 10px; top: 10px;
  background: transparent; border: none; color: var(--muted);
  font-size: 22px; line-height: 1; padding: 4px 10px; border-radius: 6px;
}
.modal-close:hover { background: var(--surface-hover); color: var(--text); }
.slider-block {
  margin: 16px 0; padding: 14px; background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px;
}
.block { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.block-title { font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.block ul { margin: 0; padding-left: 18px; }
.block ul.history li { margin: 2px 0; font-size: 13px; }

/* Generic section tabs (goals/sleep/tasks/nutrition/habits analytics tab) */
.section-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.section-tab {
  padding: 6px 12px; font-size: 13px;
  color: var(--muted);
  border-radius: 6px;
}
.section-tab:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.section-tab.active { background: var(--accent); color: #0d1117; }
.section-tab.active:hover { filter: brightness(1.05); }

/* Analytics page common */
.analytics-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 10px 12px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.analytics-toolbar label { font-size: 12px; color: var(--muted); }
.analytics-toolbar select, .analytics-toolbar button {
  font-size: 13px; padding: 4px 10px;
}
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}
.analytics-grid .panel-wide { grid-column: 1 / -1; }
.kpi-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.kpi {
  text-align: center; padding: 10px 8px;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}
.kpi-value { font-size: 26px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* Velocity heatmap */
.velocity-grid { width: 100%; border-collapse: collapse; font-size: 11px; }
.velocity-grid th, .velocity-grid td {
  padding: 3px 4px; text-align: center;
  border: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.velocity-grid th { color: var(--muted); font-weight: 400; }
.velocity-grid .vg-title {
  text-align: left; max-width: 200px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.velocity-cell {
  width: 22px; height: 22px;
}

/* Year-style heatmap (habits) */
.year-heatmap {
  display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column;
  grid-auto-columns: 12px; gap: 2px;
  overflow-x: auto;
}
.year-heatmap > div {
  width: 12px; height: 12px; border-radius: 2px; background: var(--bg);
  border: 1px solid var(--border);
}

/* Finance section */
.fin-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.fin-tab {
  padding: 6px 12px; font-size: 13px;
  color: var(--muted);
  border-radius: 6px;
}
.fin-tab:hover { background: var(--surface-hover); color: var(--text); text-decoration: none; }
.fin-tab.active {
  background: var(--accent); color: #0d1117;
}
.fin-tab.active:hover { filter: brightness(1.05); }

.fab {
  position: fixed; right: 24px; bottom: 24px;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #0d1117;
  font-size: 24px; font-weight: 600;
  border: none; z-index: 30;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
  cursor: pointer;
}
.fab:hover { filter: brightness(1.1); }

.kpi {
  font-size: 28px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 4px;
}

.tx-row {
  display: flex; gap: 12px; align-items: center;
  padding: 8px 12px;
  border-radius: 6px;
}
.tx-row:hover { background: var(--surface-hover); }
.tx-row .muted { font-size: 12px; }

.seg-switch {
  display: flex; gap: 4px; margin-top: 6px;
}
.seg-switch .seg {
  flex: 1;
  padding: 8px 10px; font-size: 13px;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 6px;
}
.seg-switch .seg.active {
  background: var(--accent); color: #0d1117;
  border-color: var(--accent);
}

.hot-cats { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

.csv-preview {
  width: 100%; border-collapse: collapse; font-size: 12px;
}
.csv-preview th, .csv-preview td {
  padding: 4px 8px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.csv-preview tr.err td { background: rgba(248,81,73,0.08); }

/* Nutrition */
.kpi-row {
  display: grid;
  grid-template-columns: 90px 1fr 120px;
  gap: 8px;
  align-items: center;
  padding: 4px 0;
  font-size: 13px;
}
.picker-row {
  display: flex; justify-content: space-between;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
}
.picker-row:hover { background: var(--surface-hover); }
.picker-row.active { background: var(--accent); color: #0d1117; }

/* Tasks — kanban */
.boards-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 6px 0 14px;
}
.board-tab {
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  font: inherit;
}
.board-tab:hover { background: var(--surface-hover); text-decoration: none; }
.board-tab.active { font-weight: 600; }
.board-tab.add {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--muted);
}

.board-toolbar { margin: 6px 0 14px; }

.kanban-scroll {
  display: flex; gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  min-height: 60vh;
}

.kanban-col {
  flex: 0 0 280px;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: 8px;
  border-top: 2px solid var(--col-accent, var(--border));
  max-height: 80vh;
}
.kanban-col .col-header {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.col-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--col-accent); }
.col-name { flex: 1; font-weight: 600; }
.col-count {
  font-size: 12px; color: var(--muted);
  padding: 2px 6px; background: var(--bg); border-radius: 4px;
}
.col-add, .col-menu {
  background: transparent; border: none; color: var(--muted);
  width: 24px; height: 24px; border-radius: 4px;
  font-size: 14px; cursor: pointer; padding: 0;
}
.col-add:hover, .col-menu:hover { background: var(--surface-hover); color: var(--text); }
.col-body {
  flex: 1; padding: 10px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 60px;
}
.col-empty {
  color: var(--muted); font-size: 12px; text-align: center;
  padding: 24px 8px;
  border: 1px dashed var(--border); border-radius: 6px;
}

.task-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--left-color, transparent);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.task-card:hover { border-color: var(--accent); }
.task-card.done .task-title {
  text-decoration: line-through;
  color: var(--muted);
}
.task-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.task-check {
  flex-shrink: 0;
  width: 20px; height: 20px;
  border-radius: 4px;
  border: 1.5px solid var(--muted);
  background: transparent;
  color: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  margin-top: 1px;
}
.task-check:hover { border-color: var(--accent); }
.task-check.checked {
  background: var(--success);
  border-color: var(--success);
  color: #0d1117;
}
.sub-row.done a { text-decoration: line-through; color: var(--muted); }
.sub-del {
  width: 22px; height: 22px; padding: 0;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); border-radius: 4px;
  font-size: 14px; line-height: 1; cursor: pointer;
  flex: 0 0 auto;
}
.sub-del:hover { color: var(--danger); border-color: var(--danger); }
.task-title { font-size: 14px; font-weight: 500; word-wrap: break-word; flex: 1; min-width: 0; }
.task-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  line-height: 1.4;
}
.tag.muted-tag { background: var(--surface-hover); color: var(--muted); }
.tag.tag-danger { background: rgba(248,81,73,0.15); color: var(--danger); }

.nest-zone {
  position: absolute;
  left: 10%; right: 10%;
  top: 35%; height: 30%;
  border: 2px dashed transparent;
  border-radius: 6px;
  pointer-events: none;
  transition: border-color 0.1s, background 0.1s;
}
.nest-zone.active {
  border-color: var(--accent);
  background: rgba(88,166,255,0.08);
}

.sortable-ghost { opacity: 0.35; }
.sortable-chosen { cursor: grabbing; }
.sortable-drag { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); }

.chip-check { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.chip-check input { display: none; }
.chip-check .tag { opacity: 0.4; }
.chip-check input:checked + .tag { opacity: 1; outline: 2px solid var(--accent); }

.popover {
  position: fixed;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px;
  display: flex; flex-direction: column;
  min-width: 160px;
  z-index: 100;
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
}
.popover button {
  text-align: left;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
}
.popover button:hover { background: var(--surface-hover); }
.popover button.danger { color: var(--danger); }

/* Workouts */
.wk-row {
  display: flex; align-items: stretch; gap: 12px;
  padding: 10px 12px;
  color: var(--text);
}
.wk-row:hover { text-decoration: none; background: var(--surface-hover); }

.banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap;
}
.banner.stale {
  border-color: var(--warning);
  background: rgba(210, 153, 34, 0.08);
}

.heatmap { display: block; }

/* Today-strip on overview */
.strip-wrap {
  position: relative;
  margin-top: 10px;
  height: 24px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
.strip-track { position: absolute; inset: 0; }
.strip-seg {
  position: absolute; top: 0; bottom: 0;
  border-right: 1px solid rgba(0,0,0,0.25);
}
.strip-seg.is-now {
  outline: 2px solid var(--text);
  outline-offset: -2px;
  z-index: 2;
}
.strip-now {
  position: absolute; top: -4px; bottom: -4px;
  width: 2px; background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
  z-index: 3;
}

/* Schedule — block-type colors */
:root {
  --bt-deep_work:    #2ea5ff;
  --bt-shallow_work: #79c0ff;
  --bt-meeting:      #a371f7;
  --bt-break:        #3fb950;
  --bt-meal:         #f0883e;
  --bt-exercise:     #f85149;
  --bt-personal:     #d29922;
  --bt-commute:      #8b949e;
  --bt-sleep:        #1f6feb;
  --bt-other:        #6e7781;
}

/* Schedule layout */
.schedule-toolbar {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  align-items: center;
}
.schedule-toolbar input[type="date"] {
  background: var(--bg); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; padding: 6px 8px; font: inherit;
}

.view-switcher { display: none; gap: 4px; margin: 8px 0; }
.view-switcher .seg {
  padding: 6px 14px; font-size: 13px;
  background: var(--surface); color: var(--muted);
  border: 1px solid var(--border); border-radius: 999px;
}
.view-switcher .seg.active {
  background: var(--accent); color: #0d1117; border-color: var(--accent);
}

.schedule-board {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 12px;
}
.schedule-board[data-view="plan"] .timeline-col:nth-child(2),
.schedule-board[data-view="fact"] .timeline-col:nth-child(1) {
  display: none;
}

.timeline-col { display: flex; flex-direction: column; }
.col-title { margin: 0 0 8px; font-size: 14px; color: var(--muted); letter-spacing: 0.3px; }
.timeline {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: visible;
  padding: 8px 8px 8px 58px;
}
.hour-grid { position: absolute; inset: 8px 8px 8px 58px; pointer-events: none; }
.hour-line {
  position: absolute; left: -50px; right: 0; height: 1px;
  background: var(--border);
  opacity: 0.5;
}
.hour-line > span {
  position: absolute; left: 0; top: -8px;
  font-size: 11px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.now-marker {
  position: absolute; left: -8px; right: 0; height: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  z-index: 3;
}
.now-marker::before {
  content: ""; position: absolute; left: -6px; top: -4px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
}

.block {
  position: absolute; left: 58px; right: 8px;
  border-radius: 6px;
  padding: 6px 10px;
  border: 1px solid transparent;
  color: #0d1117;
  font-size: 12px;
  cursor: pointer;
  overflow: hidden;
  z-index: 2;
  transition: transform 0.05s, filter 0.1s;
}
.block:hover { filter: brightness(1.1); }
.block:active { transform: translateX(1px); }
.block .block-head { display: flex; justify-content: space-between; align-items: center; }
.block .block-time { font-weight: 500; opacity: 0.9; }
.block .block-title { margin-top: 2px; font-weight: 500; }
.block .lock-icon { font-size: 12px; }

/* Per-type colors */
.block.bt-deep_work    { background: var(--bt-deep_work); }
.block.bt-shallow_work { background: var(--bt-shallow_work); }
.block.bt-meeting      { background: var(--bt-meeting); color: #fff; }
.block.bt-break        { background: var(--bt-break); }
.block.bt-meal         { background: var(--bt-meal); }
.block.bt-exercise     { background: var(--bt-exercise); color: #fff; }
.block.bt-personal     { background: var(--bt-personal); }
.block.bt-commute      { background: var(--bt-commute); color: #fff; }
.block.bt-sleep        { background: var(--bt-sleep); color: #fff; }
.block.bt-other        { background: var(--bt-other); color: #fff; }

/* Locked blocks — diagonal hatch + dashed outline */
.block.locked {
  background-image:
    repeating-linear-gradient(
      45deg,
      rgba(0,0,0,0.12) 0 6px,
      transparent 6px 12px
    ),
    linear-gradient(var(--bt-meeting), var(--bt-meeting));
  border: 1.5px dashed rgba(255,255,255,0.7);
  cursor: default;
}
.block.locked:hover { filter: none; }

/* Select & textarea — align with existing inputs */
select, textarea {
  font: inherit;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  padding: 8px 10px; width: 100%;
}
select:focus, textarea:focus { outline: none; border-color: var(--accent); }

button.danger {
  background: transparent; color: var(--danger);
  border: 1px solid var(--danger);
}
button.danger:hover { background: rgba(248,81,73,0.08); }

/* Mobile */
@media (max-width: 768px) {
  .shell {
    grid-template-columns: 1fr;
    grid-template-rows: 56px 1fr;
    grid-template-areas:
      "header"
      "main";
  }
  .header .nav-toggle { display: inline-flex; }
  .sidebar {
    position: fixed;
    inset: 56px 0 0 0;
    width: 260px;
    max-width: 80vw;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    z-index: 20;
  }
  #nav-state:checked ~ .shell .sidebar {
    transform: translateX(0);
  }
  .main { padding: 18px; }

  /* Schedule: single column + plan/fact switcher */
  .view-switcher { display: flex; }
  .schedule-board { grid-template-columns: 1fr; }
  .schedule-board[data-view="both"] .timeline-col:nth-child(2) { margin-top: 12px; }
}
