/* ============ Basis ============ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
a { color: var(--green); text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--green-tint); }

.label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.muted { color: var(--text-soft); }
.mono { font-family: var(--mono); }

/* ============ Layout ============ */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  padding: 26px 22px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; }
.brand-text span { font-size: 11.5px; color: var(--text-faint); }

.nav { padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-soft);
  font-weight: 500;
  transition: background .12s, color .12s;
}
.nav a .ico { width: 18px; height: 18px; flex: 0 0 18px; opacity: .8; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.active { background: var(--green-tint); color: var(--green-strong); }
.nav a.active .ico { opacity: 1; }

.side-foot { padding: 14px; border-top: 1px solid var(--border); }

.main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
}
.content { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 30px 34px 80px; }

.page-head { margin-bottom: 26px; }
.page-head h1 { font-size: 25px; }
.page-head p { margin: 6px 0 0; color: var(--text-soft); font-size: 14px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* Mobile-Topbar + Tabbar (nur klein sichtbar) */
.topbar, .tabbar { display: none; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s, transform .04s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-strong); border-color: var(--green-strong); }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-icon {
  width: 32px; height: 32px; padding: 0; justify-content: center;
  border-radius: var(--radius-sm);
}
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; }

/* ============ Formfelder ============ */
.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 14px; font-family: inherit;
  transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--green-bright);
  box-shadow: 0 0 0 3px var(--green-tint);
}
.textarea { resize: vertical; min-height: 70px; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 6px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

/* ============ Karten / Sektionen ============ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-pad { padding: 18px; }
.section { margin-bottom: 26px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.section-head h2 { font-size: 16px; }

.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, 1fr); }
.cols-3 { grid-template-columns: repeat(3, 1fr); }

.empty {
  text-align: center; color: var(--text-faint);
  padding: 30px 16px; font-size: 14px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius);
}
.empty-sm { padding: 14px; font-size: 13px; }

/* ============ Chips / Badges ============ */
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  color: #fff; background: var(--chip, var(--text-soft));
  flex: 0 0 auto;
}
.chip-lg { height: 26px; min-width: 26px; font-size: 12px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--dot, var(--green)); display: inline-block; }

/* ============ Toast ============ */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: var(--text); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-pill);
  font-size: 13.5px; box-shadow: var(--shadow-lg);
  animation: toastin .18s ease;
}
.toast.err { background: var(--c-probleme); }
@keyframes toastin { from { opacity: 0; transform: translateY(8px); } }

/* ============ Modal ============ */
.modal-back {
  position: fixed; inset: 0; background: rgba(22, 28, 22, .38);
  display: grid; place-items: center; z-index: 150; padding: 18px;
  animation: fade .12s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); width: min(440px, 100%);
  padding: 22px; animation: pop .14s ease;
}
.modal.wide { width: min(560px, 100%); }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ============ Dashboard ============ */
.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.stat {
  flex: 1; min-width: 150px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.stat .big small { font-size: 15px; font-weight: 500; color: var(--text-faint); }
.list-rows { display: flex; flex-direction: column; }
.list-rows .lr {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 2px; border-top: 1px solid var(--border);
}
.list-rows .lr:first-child { border-top: none; }

/* ============ Habits ============ */
.seg { display: inline-flex; background: var(--surface-2); border-radius: var(--radius-pill); padding: 3px; gap: 2px; }
.seg button {
  border: none; background: transparent; cursor: pointer;
  padding: 6px 14px; border-radius: var(--radius-pill);
  font-size: 13px; font-weight: 500; color: var(--text-soft);
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.habit-row {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.habit-main { flex: 1; min-width: 0; }
.habit-main .name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.habit-streak { display: flex; align-items: center; gap: 6px; color: var(--text-soft); font-size: 13px; white-space: nowrap; }
.habit-streak b { color: var(--green-strong); font-size: 15px; }
.habit-days { display: flex; gap: 6px; }
.hday {
  width: 30px; height: 30px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
  font-size: 11px; color: var(--text-faint); transition: .12s; user-select: none;
}
.hday small { font-size: 9px; line-height: 1; }
.hday.on { background: var(--green); border-color: var(--green); color: #fff; }
.hday.today { box-shadow: 0 0 0 2px var(--green-tint); }
.hday:hover { border-color: var(--green-bright); }

.month-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.month-grid .mh { text-align: center; font-size: 10px; color: var(--text-faint); padding-bottom: 2px; }
.mcell { aspect-ratio: 1; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-size: 11px; color: var(--text-faint); cursor: pointer; }
.mcell.on { background: var(--green); color: #fff; }
.mcell.empty { background: transparent; cursor: default; }

/* ============ Kalender ============ */
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-grid .cdh { text-align: center; font-size: 11px; color: var(--text-faint); font-weight: 600; padding: 4px 0; }
.ccell {
  min-height: 86px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); padding: 6px; display: flex; flex-direction: column; gap: 3px; overflow: hidden;
}
.ccell.out { background: var(--surface-2); opacity: .55; }
.ccell.today { border-color: var(--green-bright); box-shadow: 0 0 0 2px var(--green-tint); }
.ccell .cn { font-size: 12px; font-weight: 600; color: var(--text-soft); }
.cev { font-size: 11px; background: var(--green-tint); color: var(--green-strong); border-radius: 5px; padding: 2px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-day { margin-bottom: 18px; }
.agenda-day .ad-date { font-size: 12px; font-weight: 700; color: var(--text-soft); margin-bottom: 8px; display: flex; align-items: baseline; gap: 8px; }
.agenda-day .ad-date span { font-weight: 500; color: var(--text-faint); }
.aev { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.aev:first-child { border-top: none; }
.aev .at { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--green-strong); font-weight: 600; min-width: 92px; }
.aev .av { font-size: 14px; }
.aev .av small { display: block; color: var(--text-faint); font-size: 12px; }

/* ============ Themen beim nächsten Mal ============ */
.nt-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 8px;
}
.nt-item.done { opacity: .55; }
.nt-item.done .nt-text { text-decoration: line-through; }
.nt-text { flex: 1; min-width: 0; }
.drag-handle { cursor: grab; color: var(--text-faint); width: 16px; flex: 0 0 16px; touch-action: none; }
.dragging { opacity: .4; }

.check {
  width: 22px; height: 22px; border-radius: 6px; flex: 0 0 22px;
  border: 1.6px solid var(--border-strong); background: var(--surface);
  cursor: pointer; display: grid; place-items: center; transition: .12s;
}
.check.on { background: var(--green); border-color: var(--green); }
.check.on svg { color: #fff; }
.check svg { width: 13px; height: 13px; color: transparent; }

/* ============ Board ============ */
.board-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.linkhint { font-size: 13px; color: var(--green-strong); background: var(--green-tint); padding: 6px 12px; border-radius: var(--radius-pill); display: inline-flex; align-items: center; gap: 8px; }

.board-wrap { position: relative; }
.board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.board-links { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 1; overflow: visible; }
.board-links path { fill: none; stroke-width: 2; pointer-events: stroke; cursor: pointer; transition: opacity .15s, stroke-width .15s; }
.board-links path.dim { opacity: .1; }
.board-links path.active { stroke-width: 3.4; }

.board-col { display: flex; flex-direction: column; gap: 10px; position: relative; z-index: 2; }
.board-col-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 0; }
.board-col-head .cbar { width: 22px; height: 4px; border-radius: 3px; background: var(--col); }
.board-col-head h3 { font-size: 13px; letter-spacing: .01em; }
.board-col-head .cnt { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.board-col-body { display: flex; flex-direction: column; gap: 10px; min-height: 24px; }

.bcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--col);
  border-radius: var(--radius-sm);
  padding: 11px 12px; box-shadow: var(--shadow);
  cursor: pointer; transition: opacity .15s, box-shadow .15s, transform .04s;
  position: relative;
}
.bcard:hover { box-shadow: var(--shadow-lg); }
.bcard.dim { opacity: .25; }
.bcard.active { box-shadow: 0 0 0 2px var(--col), var(--shadow); }
.bcard.linksrc { box-shadow: 0 0 0 2px var(--green-bright), var(--shadow); }
.bcard .bt { font-weight: 600; font-size: 14px; }
.bcard .bd { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; white-space: pre-wrap; }
.bcard .bfoot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.bcard .bfoot .sp { flex: 1; }
.bcard .row-actions { display: none; gap: 4px; }
.bcard:hover .row-actions, .bcard.active .row-actions { display: flex; }
.bcard-add { border: 1px dashed var(--border-strong); background: transparent; color: var(--text-soft); border-radius: var(--radius-sm); padding: 9px; cursor: pointer; font-size: 13px; }
.bcard-add:hover { border-color: var(--green-bright); color: var(--green-strong); background: var(--green-tint-2); }

.bconns { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.bconn-badge { font-size: 11px; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--text-soft); border-left: 3px solid var(--col2); cursor: pointer; }

/* ============ Notizen ============ */
.notes-layout { display: grid; grid-template-columns: 250px 1fr; gap: 18px; align-items: start; }
.topic-list { display: flex; flex-direction: column; gap: 4px; }
.topic-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; color: var(--text-soft); }
.topic-item:hover { background: var(--surface-2); color: var(--text); }
.topic-item.active { background: var(--green-tint); color: var(--green-strong); font-weight: 600; }
.topic-item .ti-ic { width: 18px; text-align: center; }
.entry { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 10px; }
.entry .etxt { white-space: pre-wrap; font-size: 14px; }
.entry .emeta { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; display: flex; gap: 10px; align-items: center; }
.entry .emeta .sp { flex: 1; }

/* ============ Listen ============ */
.lists-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-card-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.list-card-head h3 { font-size: 15px; flex: 1; }
.list-card-head .kind { font-size: 10px; }
.list-body { padding: 8px 12px 12px; }
.li {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-top: 1px solid var(--border);
}
.li:first-child { border-top: none; }
.li.done .li-text { text-decoration: line-through; color: var(--text-faint); }
.li-text { flex: 1; min-width: 0; }
.li-add { display: flex; gap: 8px; padding: 10px 4px 2px; }

/* ============ Responsive ============ */
@media (max-width: 860px) {
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; z-index: 130;
    transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow-lg);
  }
  body.drawer-open .sidebar { transform: none; }
  .backdrop { display: none; position: fixed; inset: 0; background: rgba(20, 28, 20, .42); z-index: 120; }
  body.drawer-open .backdrop { display: block; }
  .topbar {
    display: flex; align-items: center; gap: 10px;
    position: sticky; top: 0; z-index: 50;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 14px;
  }
  .topbar h1 { font-size: 17px; }
  .content { padding: 18px 16px 64px; }
  .dash-grid, .cols-2, .cols-3 { grid-template-columns: 1fr; }
  .board { grid-template-columns: 1fr; overflow-x: visible; }
  .board-links { display: none; }
  .page-head h1 { font-size: 22px; }
}
@media (min-width: 861px) {
  .hamburger, .backdrop { display: none; }
  .bconns { display: none; } /* Linien statt Badges am Desktop */
}

/* ============================================================= */
/* ============ v2-Komponenten ================================= */
/* ============================================================= */

/* ---- Board v2: Linien oben, Connector-Drag, Upload-Galerie ---- */
.board-links { z-index: 6; }
.board-links path { stroke-opacity: .5; stroke-width: 2.5; }
.board-links path.active { stroke-opacity: 1; stroke-width: 3.6; }
.board-links path.dim { stroke-opacity: .12; }
.board-links path.temp { stroke: var(--green-bright); stroke-opacity: 1; stroke-dasharray: 5 4; }
.bcard .connector {
  position: absolute; right: -8px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; border-radius: 50%; background: var(--col);
  border: 2px solid var(--surface); cursor: crosshair; opacity: 0;
  transition: opacity .12s, transform .1s; z-index: 4; touch-action: none;
}
.bcard:hover .connector, .bcard.active .connector { opacity: 1; }
.bcard .connector:hover { transform: translateY(-50%) scale(1.25); }
.board.linking, .board.linking * { cursor: crosshair !important; }
.bcard.linktarget { box-shadow: 0 0 0 2px var(--green-bright), var(--shadow); }
.bcard .drag-handle { position: absolute; left: 3px; top: 9px; opacity: 0; }
.bcard:hover .drag-handle { opacity: .5; }

.board-files { margin-top: 28px; }
.bf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.bf-card { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); position: relative; box-shadow: var(--shadow); }
.bf-card a { display: block; }
.bf-card img { width: 100%; height: 130px; object-fit: cover; display: block; }
.bf-pdf { height: 130px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--c-probleme); background: var(--surface-2); }
.bf-name { font-size: 11px; padding: 6px 8px; color: var(--text-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bf-del { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.92); }

/* ---- Habits v2: Heatmap + Challenge ---- */
.heatmap { display: grid; grid-auto-flow: column; grid-template-rows: repeat(7, 1fr); gap: 3px; }
.hm-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--surface-2); cursor: pointer; }
.hm-cell.on { background: var(--green); }
.hm-cell.due { box-shadow: inset 0 0 0 1.5px var(--green-bright); }
.hm-cell.future { opacity: .25; cursor: default; }
.hm-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-faint); margin-top: 6px; }
.habit-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.habit-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.habit-top .name { font-weight: 600; font-size: 15px; }
.habit-meta { font-size: 12px; color: var(--text-faint); }
.streak-pill { display: inline-flex; align-items: center; gap: 5px; background: var(--green-tint); color: var(--green-strong); border-radius: var(--radius-pill); padding: 3px 10px; font-size: 13px; font-weight: 600; }
.streak-pill svg { width: 14px; height: 14px; }
.person-track { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.person-track .who { display: flex; align-items: center; gap: 6px; min-width: 90px; font-size: 13px; color: var(--text-soft); }
.challenge-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.challenge-row:first-child { border-top: none; }
.challenge-bar { flex: 1; height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.challenge-bar > span { display: block; height: 100%; border-radius: 6px; }

/* ---- Notizen v2: 3-Pane + Editor ---- */
.notes3 { display: grid; grid-template-columns: 210px 250px 1fr; gap: 14px; align-items: stretch; min-height: 64vh; }
.np { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; overflow: hidden; }
.np-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.np-head h2 { font-size: 14px; flex: 1; }
.np-body { padding: 8px; overflow-y: auto; flex: 1; }
.np-back { display: none; }
.note-li { padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.note-li:hover { background: var(--surface-2); }
.note-li.active { background: var(--green-tint); }
.note-li .nt { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-li .nx { font-size: 12px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 7px 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.editor-area { padding: 16px 18px; outline: none; line-height: 1.6; font-size: 15px; overflow-y: auto; flex: 1; }
.editor-area:empty::before { content: attr(data-placeholder); color: var(--text-faint); }
.editor-area img { max-width: 100%; border-radius: 8px; margin: 6px 0; }
.editor-area h1 { font-size: 22px; margin: 10px 0 6px; }
.editor-area h2 { font-size: 18px; margin: 10px 0 6px; }
.editor-area ul, .editor-area ol { padding-left: 22px; }
.note-title-input { border: none; font-size: 18px; font-weight: 700; outline: none; width: 100%; background: transparent; color: var(--text); padding: 12px 16px 0; }

/* ---- Outliner (Listen) ---- */
.outline-item { display: flex; align-items: center; gap: 8px; padding: 7px 4px; border-radius: 6px; }
.outline-item:hover { background: var(--surface-2); }
.outline-item:hover .oi-actions { opacity: 1; }
.oi-actions { display: flex; gap: 2px; opacity: 0; transition: opacity .12s; }
.oi-text { flex: 1; min-width: 0; }
.oi-text.done { text-decoration: line-through; color: var(--text-faint); }

/* ---- Date-Ideen ---- */
.idea-item { display: flex; align-items: flex-start; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 8px; }
.idea-item.done { opacity: .8; }
.idea-item .it-main { flex: 1; min-width: 0; }
.idea-item .it-main .tt.done { text-decoration: line-through; }
.idea-item .it-note { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; }
.idea-date { font-size: 12px; color: var(--green-strong); white-space: nowrap; font-weight: 600; }

/* ---- Time-Tracker ---- */
.tt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.tt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); position: relative; }
.tt-card.future { border-color: var(--c-ansaetze); }
.tt-card .tt-label { font-size: 13px; color: var(--text-soft); display: flex; align-items: center; gap: 6px; }
.tt-card .tt-big { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; color: var(--green-strong); }
.tt-card.future .tt-big { color: var(--c-ansaetze); }
.tt-card .tt-sub { font-size: 13px; color: var(--text-faint); margin-top: 2px; }
.tt-card .tt-actions { position: absolute; top: 12px; right: 10px; display: none; gap: 2px; }
.tt-card:hover .tt-actions { display: flex; }

/* ---- Album-Kachel ---- */
.album-tile { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.album-ic { width: 46px; height: 46px; border-radius: 12px; background: var(--green-tint); color: var(--green-strong); display: grid; place-items: center; flex: 0 0 46px; }

/* ---- Mobile-Anpassungen v2 ---- */
@media (max-width: 860px) {
  .notes3 { grid-template-columns: 1fr; min-height: 0; }
  .np-back { display: inline-flex; }
  .tt-card .tt-actions { display: flex; }
  .oi-actions { opacity: 1; }
  .bcard .drag-handle { opacity: .5; }
}

/* ---- Habits v3: Tage-Streifen + Monatskalender ---- */
.day-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px; }
.ds-day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ds-day small { font-size: 10px; color: var(--text-faint); }
.ds-circle { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-size: 13px; cursor: pointer; transition: .12s; color: var(--text-soft); background: var(--surface); }
.ds-circle:hover { border-color: var(--green-bright); }
.ds-circle.on { background: var(--green); border-color: var(--green); color: #fff; }
.ds-circle.due:not(.on) { border-style: dashed; border-color: var(--green-bright); }
.ds-day.today .ds-circle { box-shadow: 0 0 0 2px var(--green-tint); border-color: var(--green-bright); }

.hcal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.hcal-grid .cdh { text-align: center; font-size: 11px; color: var(--text-faint); font-weight: 600; }
.hcal-cell { aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-size: 13px; cursor: pointer; border: 1.5px solid transparent; color: var(--text-soft); }
.hcal-cell:hover:not(.out) { border-color: var(--green-bright); }
.hcal-cell.on { background: var(--green); color: #fff; }
.hcal-cell.today { border-color: var(--green-bright); }
.hcal-cell.due:not(.on) { border-style: dashed; border-color: var(--green-bright); }
.hcal-cell.out { opacity: .25; cursor: default; }

/* ---- Etappe 0: Swatches + Settings ---- */
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); cursor: pointer; padding: 0; display: grid; place-items: center; color: #fff; transition: transform .1s; }
.swatch.sel { box-shadow: 0 0 0 2px var(--green-bright); transform: scale(1.1); }
.swatch.none { background: var(--surface-2); color: var(--text-faint); }
.swatch svg { width: 14px; height: 14px; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; background: var(--surface-2); padding: 5px 10px; border-radius: var(--radius-pill); cursor: pointer; }
.color-dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-strong); cursor: pointer; padding: 0; display: grid; place-items: center; flex: 0 0 22px; }
.color-dot.empty { background: var(--surface-2); color: var(--text-faint); }
.color-dot svg { width: 13px; height: 13px; }
.swatch-pop { position: fixed; z-index: 160; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 10px; max-width: 210px; }

/* ---- Etappe 1: Notiz-Editor-Extras ---- */
.editor-area ul.b-dash, .editor-area ul.b-arrow { list-style: none; padding-left: 18px; }
.editor-area ul.b-dash > li::before { content: '\2013\00a0'; color: var(--text-soft); }
.editor-area ul.b-arrow > li::before { content: '\2192\00a0'; color: var(--text-soft); }
.editor-area ul.b-dot { list-style: disc; }
.tb-sep { width: 1px; height: 20px; background: var(--border); margin: 0 3px; flex: 0 0 1px; }
.hl-swatch { width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border-strong); cursor: pointer; padding: 0; }
.editor-toolbar .btn-icon { font-size: 15px; }

/* ---- Etappe 1: Zeit-Hero ---- */
.tt-hero { padding: 28px 30px; position: relative; }
.tt-hero-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-soft); }
.tt-hero-num { font-size: 58px; font-weight: 700; letter-spacing: -.03em; color: var(--green-strong); line-height: 1.05; margin-top: 4px; }
.tt-hero-num span { font-size: 22px; font-weight: 500; color: var(--text-faint); }
.tt-hero-sub { font-size: 15px; color: var(--text-soft); margin-top: 6px; }
.tt-hero.future .tt-hero-num { color: var(--c-ansaetze); }
.tt-hero .tt-actions { position: absolute; top: 16px; right: 16px; display: none; gap: 2px; }
.tt-hero:hover .tt-actions { display: flex; }

/* ---- Etappe 4/5: Masonry-Wände, Bilder, Kommentare, Album ---- */
.date-wall, .recipe-wall { columns: 230px 4; column-gap: 14px; }
.dwall-tile, .rtile { break-inside: avoid; margin-bottom: 14px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; background: var(--surface); transition: box-shadow .12s; }
.dwall-tile:hover, .rtile:hover { box-shadow: var(--shadow-lg); }
.dwall-tile img, .rtile img { width: 100%; display: block; }
.dwall-tile.color, .rtile.color { padding: 18px 16px; }
.dwall-cap { padding: 10px 12px; }
.dwall-title, .rtile-title { font-weight: 600; font-size: 14px; line-height: 1.35; }
.dwall-date { font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.rtile-body { padding: 10px 12px; }
.rtile-foot { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--text-faint); }
.rtile-foot .icon { width: 14px; height: 14px; }
.img-preview { max-width: 100%; max-height: 180px; border-radius: 8px; margin-top: 8px; display: block; }
.cmt { display: flex; gap: 8px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.album-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }

/* ---- Board v4: Mindmap-Canvas ---- */
.board-toolbar2 { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-soft); }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.canvas-wrap { position: relative; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); height: 64vh; min-height: 420px; background: var(--surface); cursor: grab; }
.canvas-wrap.linking { cursor: crosshair; }
.canvas { position: relative; }
.canvas-bg { position: absolute; inset: 0; background-image: radial-gradient(var(--border-strong) 1px, transparent 1px); background-size: 24px 24px; opacity: .45; pointer-events: none; }
.canvas-links { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none; overflow: visible; }
.canvas-links path { fill: none; stroke-width: 2.5; stroke-opacity: .55; pointer-events: stroke; cursor: pointer; transition: stroke-opacity .15s, stroke-width .15s; }
.canvas-links path.active { stroke-opacity: 1; stroke-width: 3.4; }
.canvas-links path.dim { stroke-opacity: .12; }
.canvas-links path.temp { stroke: var(--green-bright); stroke-dasharray: 5 4; stroke-opacity: 1; }
.canvas-overlay { position: absolute; top: 0; left: 0; z-index: 5; pointer-events: none; }
.conn-del { position: absolute; transform: translate(-50%, -50%); width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--border-strong); color: var(--c-probleme); display: grid; place-items: center; cursor: pointer; pointer-events: auto; box-shadow: var(--shadow); }
.conn-del svg { width: 12px; height: 12px; }
.cnode { position: absolute; width: 190px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--col); border-radius: var(--radius-sm); padding: 10px 12px; box-shadow: var(--shadow); cursor: grab; z-index: 2; user-select: none; touch-action: none; }
.cnode:active { cursor: grabbing; }
.cnode.active { box-shadow: 0 0 0 2px var(--col), var(--shadow-lg); z-index: 4; }
.cnode.dim { opacity: .3; }
.cnode .cn-title { font-weight: 600; font-size: 14px; }
.cnode .cn-desc { font-size: 12.5px; color: var(--text-soft); margin-top: 3px; white-space: pre-wrap; }
.cnode .cn-foot { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.cnode .cn-actions { display: none; gap: 2px; }
.cnode:hover .cn-actions, .cnode.active .cn-actions { display: flex; }
.cnode .connector { position: absolute; right: -9px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; background: var(--col); border: 2px solid var(--surface); cursor: crosshair; opacity: 0; z-index: 3; touch-action: none; transition: opacity .12s; }
.cnode:hover .connector, .cnode.active .connector { opacity: 1; }
.cnode.linktarget { box-shadow: 0 0 0 2px var(--green-bright), var(--shadow); }

/* ---- Board v5: Swimlanes (Mindmap + 4 Spalten) ---- */
.lanes { position: absolute; inset: 0; z-index: 0; display: flex; }
.lane-band { flex: 0 0 280px; width: 280px; border-right: 1px solid var(--border); }
.lane-band:last-child { border-right: none; }
.lane-heads { position: sticky; top: 0; z-index: 6; display: flex; height: 42px; width: max-content; }
.lane-head { flex: 0 0 280px; width: 280px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--surface); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.lane-head:last-child { border-right: none; }
.lane-head .cbar { width: 20px; height: 4px; border-radius: 3px; }
.lane-head h3 { font-size: 13px; white-space: nowrap; }
.lane-head .cnt { margin-left: auto; font-size: 12px; color: var(--text-faint); }
