/* DigitAI Projects — Stylesheet (Design-Tokens, Light/Dark, WCAG 2.2 AA) */

:root {
	--bg: #ffffff;
	--bg-2: #f7f7f5;
	--bg-3: #eeeeeb;
	--text: #1f1f1f;
	--text-2: #5f5f5c;
	--text-3: #8f8f8b;
	--border: #e3e3df;
	--border-2: #d0d0cb;
	--accent: #2456c9;
	--accent-hover: #1d49ab;
	--accent-soft: #e9f0fe;
	--danger: #c03535;
	--danger-soft: #fdeaea;
	--ok: #1f7a43;
	--ok-soft: #e5f5ec;
	--warn: #9a5b12;
	--warn-soft: #fdf3e3;
	--radius: 8px;
	--radius-lg: 12px;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.07), 0 6px 24px rgba(0, 0, 0, 0.1);
	--font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
	--topbar-h: 50px;
}

.dark {
	--bg: #191919;
	--bg-2: #212121;
	--bg-3: #2b2b2b;
	--text: #ececec;
	--text-2: #b3b3af;
	--text-3: #8a8a86;
	--border: #343434;
	--border-2: #454545;
	--accent: #7da7ff;
	--accent-hover: #9cbcff;
	--accent-soft: #253654;
	--danger: #ff8080;
	--danger-soft: #442222;
	--ok: #6fd398;
	--ok-soft: #1d3a29;
	--warn: #e8b366;
	--warn-soft: #403014;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 8px 32px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
	font-family: var(--font);
	font-size: 15px;
	line-height: 1.5;
	color: var(--text);
	background: var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
::placeholder { color: var(--text-3); }

.boot-splash { display: flex; align-items: center; justify-content: center; height: 100vh; font-size: 42px; }
.boot-error { padding: 40px; text-align: center; }

/* ---------- Topbar ---------- */
.app { height: 100vh; display: flex; flex-direction: column; }
.topbar {
	height: var(--topbar-h);
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 0 14px;
	border-bottom: 1px solid var(--border);
	background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-right: 10px; white-space: nowrap; }
.brand .logo { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: linear-gradient(135deg, #2f6fed, #7b3fe4); color: #fff; font-size: 12px; font-weight: 800; }
.tabs { display: flex; gap: 2px; }
.tab {
	border: 0; background: none; cursor: pointer;
	padding: 7px 14px; border-radius: var(--radius);
	color: var(--text-2); font-weight: 600;
}
.tab:hover { background: var(--bg-2); color: var(--text); }
.tab.active { background: var(--bg-3); color: var(--text); }
.topbar .spacer { flex: 1; }
.iconbtn {
	border: 0; background: none; cursor: pointer;
	width: 34px; height: 34px; border-radius: var(--radius);
	display: inline-grid; place-items: center; font-size: 16px; color: var(--text-2);
	position: relative;
}
.iconbtn:hover { background: var(--bg-2); color: var(--text); }
.iconbtn .dot {
	position: absolute; top: 4px; right: 4px; min-width: 15px; height: 15px; padding: 0 3px;
	border-radius: 8px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
	display: grid; place-items: center; line-height: 1;
}
.searchbtn {
	display: flex; align-items: center; gap: 8px;
	border: 1px solid var(--border); background: var(--bg-2);
	border-radius: var(--radius); padding: 6px 12px; cursor: pointer;
	color: var(--text-3); min-width: 200px;
}
.searchbtn:hover { border-color: var(--border-2); }
.searchbtn kbd {
	margin-left: auto; font-family: var(--font); font-size: 11px;
	background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; color: var(--text-3);
}
.avatar {
	width: 30px; height: 30px; border-radius: 50%;
	background: var(--accent); color: #fff; font-size: 13px; font-weight: 700;
	display: inline-grid; place-items: center; flex: 0 0 auto;
}

/* ---------- Layout ---------- */
.content { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.view { flex: 1; overflow: auto; }
.container { max-width: 980px; margin: 0 auto; padding: 28px 24px 80px; }

/* ---------- Buttons & Inputs ---------- */
.btn {
	border: 1px solid var(--border-2); background: var(--bg); color: var(--text);
	border-radius: var(--radius); padding: 6px 14px; cursor: pointer; font-weight: 600;
	display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { background: var(--bg-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); }
.btn.ghost { border-color: transparent; background: none; color: var(--text-2); }
.btn.ghost:hover { background: var(--bg-2); color: var(--text); }
.btn.small { padding: 3px 10px; font-size: 13px; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.input, select.input, textarea.input {
	width: 100%; border: 1px solid var(--border-2); background: var(--bg);
	border-radius: var(--radius); padding: 7px 10px; color: var(--text);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
textarea.input { resize: vertical; min-height: 70px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 14px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.checkline { display: flex; align-items: center; gap: 8px; margin: 10px 0; }
.checkline input { width: 16px; height: 16px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0; }

/* ---------- Chips & Badges ---------- */
.badge {
	display: inline-flex; align-items: center; gap: 4px;
	font-size: 12px; font-weight: 600; border-radius: 20px; padding: 1px 9px;
	background: var(--bg-3); color: var(--text-2);
}
.badge.accent { background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.chip {
	display: inline-flex; align-items: center; gap: 4px;
	font-size: 12px; border-radius: 5px; padding: 1px 7px;
	background: var(--bg-3); color: var(--text);
}
.chip .x { cursor: pointer; opacity: 0.6; border: 0; background: none; padding: 0 2px; }
.chip .x:hover { opacity: 1; }

/* ---------- Login / Setup ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--bg-2); padding: 20px; }
.auth-card {
	width: 100%; max-width: 420px; background: var(--bg);
	border: 1px solid var(--border); border-radius: var(--radius-lg);
	padding: 34px 34px 28px; box-shadow: var(--shadow);
}
.auth-card h1 { margin: 4px 0 4px; font-size: 22px; }
.auth-card .sub { color: var(--text-2); margin: 0 0 22px; font-size: 14px; }
.auth-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, #2f6fed, #7b3fe4); color: #fff; font-weight: 800; font-size: 17px; margin-bottom: 14px; }

/* ---------- Heute ---------- */
.today-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.today-head h1 { margin: 0; font-size: 26px; }
.today-head .date { color: var(--text-2); }
.section { margin-bottom: 30px; }
.section-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.section-head h2 { font-size: 15px; margin: 0; color: var(--text-2); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.section-head .count { color: var(--text-3); font-size: 13px; }
.section-head .grow { flex: 1; }
.quickadd { display: flex; gap: 8px; margin: 10px 0 4px; }
.quickadd input { flex: 1; }
.task-row {
	display: flex; align-items: center; gap: 10px;
	padding: 7px 10px; border-radius: var(--radius); cursor: pointer;
}
.task-row:hover { background: var(--bg-2); }
.task-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; flex: 0 0 auto; }
.task-row .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-row.done .title { color: var(--text-3); text-decoration: line-through; }
.task-row .meta { display: flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.prio-1 { color: var(--danger); font-weight: 700; }
.prio-2 { color: var(--warn); font-weight: 700; }
.prio-3, .prio-4 { color: var(--text-3); font-weight: 600; }
.event-row { display: flex; gap: 10px; padding: 7px 10px; border-radius: var(--radius); align-items: baseline; }
.event-row:hover { background: var(--bg-2); }
.event-row .time { font-variant-numeric: tabular-nums; color: var(--text-2); flex: 0 0 auto; font-size: 13px; }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.pcard {
	border: 1px solid var(--border); border-radius: var(--radius-lg);
	padding: 12px 14px; cursor: pointer; background: var(--bg);
	display: flex; flex-direction: column; gap: 6px; min-height: 74px;
}
.pcard:hover { background: var(--bg-2); border-color: var(--border-2); }
.pcard .t { font-weight: 650; display: flex; gap: 7px; align-items: center; }
.pcard .s { color: var(--text-3); font-size: 13px; }
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.week-day { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; min-height: 90px; }
.week-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.week-day .d { font-size: 12px; color: var(--text-2); font-weight: 700; margin-bottom: 6px; }
.week-day .item { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 0; }
.week-day .item.done { color: var(--text-3); text-decoration: line-through; }
.empty { color: var(--text-3); padding: 8px 10px; font-size: 14px; }

/* ---------- Ablage (Explorer) ---------- */
.files { display: flex; height: 100%; overflow: hidden; }
.files-side {
	width: 290px; flex: 0 0 auto; overflow-y: auto;
	border-right: 1px solid var(--border); background: var(--bg-2);
	padding: 12px 8px 40px;
}
.files-main { flex: 1; overflow-y: auto; }
.side-head { display: flex; align-items: center; padding: 2px 8px 8px; gap: 4px; }
.side-head .lbl { font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; flex: 1; }
.tree-sec { margin-top: 14px; }
.tree-sec > .lbl { font-size: 12px; font-weight: 700; color: var(--text-3); padding: 0 8px 4px; display: block; }
.tnode { user-select: none; }
.trow {
	display: flex; align-items: center; gap: 3px;
	padding: 4px 6px; border-radius: 6px; cursor: pointer;
	color: var(--text); min-height: 28px;
}
.trow:hover { background: var(--bg-3); }
.trow.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.trow.selected { background: var(--accent-soft); }
.trow.drag-over { box-shadow: inset 0 0 0 2px var(--accent); }
.trow.drag-above { box-shadow: inset 0 2px 0 var(--accent); }
.trow.drag-below { box-shadow: inset 0 -2px 0 var(--accent); }
.trow .chev {
	width: 20px; height: 20px; flex: 0 0 auto; border: 0; background: none; cursor: pointer;
	display: grid; place-items: center; color: var(--text-3); border-radius: 4px; padding: 0;
	transition: transform 0.12s ease; font-size: 10px;
}
.trow .chev:hover { background: var(--border); color: var(--text); }
.trow .chev.open { transform: rotate(90deg); }
.trow .chev.leaf { visibility: hidden; }
.trow .ticon { width: 20px; text-align: center; flex: 0 0 auto; font-size: 14px; }
.trow .tlabel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.trow .tmore { visibility: hidden; }
.trow:hover .tmore { visibility: visible; }
.tkids { margin-left: 13px; border-left: 1px solid var(--border); padding-left: 4px; }
.breadcrumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); }
.breadcrumbs button { border: 0; background: none; cursor: pointer; color: var(--text-2); padding: 2px 5px; border-radius: 4px; font-size: 13px; }
.breadcrumbs button:hover { background: var(--bg-2); color: var(--text); }
.page-head { padding: 26px 40px 0; max-width: 900px; margin: 0 auto; }
.page-toolbar { display: flex; align-items: center; gap: 4px; padding-bottom: 6px; }
.page-title {
	font-size: 32px; font-weight: 750; border: 0; outline: none; width: 100%;
	background: none; padding: 6px 0; color: var(--text);
}
.folder-list { max-width: 900px; margin: 0 auto; padding: 10px 40px 60px; }
.frow {
	display: flex; align-items: center; gap: 10px; padding: 9px 10px;
	border-radius: var(--radius); cursor: pointer;
}
.frow:hover { background: var(--bg-2); }
.frow .ficon { width: 24px; text-align: center; font-size: 16px; }
.frow .ftitle { flex: 1; font-weight: 550; }
.frow .fmeta { color: var(--text-3); font-size: 13px; }
.selbar {
	position: sticky; bottom: 14px; margin: 14px auto 0; width: fit-content;
	display: flex; gap: 8px; align-items: center;
	background: var(--bg); border: 1px solid var(--border-2); border-radius: 24px;
	padding: 7px 16px; box-shadow: var(--shadow); z-index: 5;
}

/* ---------- Editor ---------- */
.editor { max-width: 900px; margin: 0 auto; padding: 4px 40px 140px; }
.blk { display: flex; gap: 4px; align-items: flex-start; border-radius: 6px; position: relative; }
.blk:hover > .bhandle { opacity: 1; }
.bhandle {
	opacity: 0; flex: 0 0 auto; width: 22px; height: 24px; margin-top: 3px;
	border: 0; background: none; color: var(--text-3); cursor: grab;
	border-radius: 4px; display: grid; place-items: center; font-size: 13px; padding: 0;
}
.bhandle:hover { background: var(--bg-3); color: var(--text); }
.bmain { flex: 1; min-width: 0; display: flex; gap: 8px; align-items: flex-start; padding: 3px 2px; }
.btext { flex: 1; min-width: 0; outline: none; white-space: pre-wrap; word-break: break-word; min-height: 24px; }
.btext:empty::before { content: attr(data-ph); color: var(--text-3); pointer-events: none; }
.blk.h1 .btext { font-size: 27px; font-weight: 750; margin-top: 14px; }
.blk.h2 .btext { font-size: 21px; font-weight: 700; margin-top: 10px; }
.blk.h3 .btext { font-size: 17px; font-weight: 700; margin-top: 6px; }
.blk.todo .bmain input[type="checkbox"] { width: 16px; height: 16px; margin-top: 5px; accent-color: var(--accent); cursor: pointer; }
.blk.todo.done .btext { color: var(--text-3); text-decoration: line-through; }
.blk.bulleted .bmark, .blk.numbered .bmark { flex: 0 0 auto; min-width: 18px; text-align: center; margin-top: 1px; color: var(--text); }
.blk.quote .bmain { border-left: 3px solid var(--text); padding-left: 12px; }
.blk.callout .bmain { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; }
.blk.callout .bicon { cursor: pointer; border: 0; background: none; font-size: 16px; padding: 0 2px; }
.blk.code .bmain { background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; flex-direction: column; gap: 4px; }
.blk.code .btext { font-family: var(--mono); font-size: 13.5px; }
.blk.code .lang { align-self: flex-end; font-size: 11px; color: var(--text-3); border: 0; background: none; cursor: pointer; }
.blk.divider .bmain { padding: 10px 2px; }
.blk.divider hr { border: 0; border-top: 1px solid var(--border-2); width: 100%; margin: 0; }
.blk.toggle .bchev { border: 0; background: none; cursor: pointer; padding: 2px; margin-top: 3px; color: var(--text-2); transition: transform 0.12s; }
.blk.toggle .bchev.open { transform: rotate(90deg); }
.slash-menu, .ctx-menu {
	position: fixed; z-index: 60; min-width: 230px; max-height: 320px; overflow-y: auto;
	background: var(--bg); border: 1px solid var(--border-2); border-radius: var(--radius-lg);
	box-shadow: var(--shadow); padding: 5px;
}
.menu-item {
	display: flex; align-items: center; gap: 10px; width: 100%;
	padding: 7px 10px; border: 0; background: none; border-radius: 6px;
	cursor: pointer; text-align: left; color: var(--text); font-size: 14px;
}
.menu-item:hover, .menu-item.hl { background: var(--bg-2); }
.menu-item.danger { color: var(--danger); }
.menu-item .mi { width: 20px; text-align: center; }
.menu-sep { border-top: 1px solid var(--border); margin: 5px 6px; }
.menu-label { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 6px 10px 2px; text-transform: uppercase; }

/* ---------- Kommentare ---------- */
.page-with-panel { display: flex; gap: 0; }
.page-col { flex: 1; min-width: 0; }
.comments-panel {
	width: 320px; flex: 0 0 auto; border-left: 1px solid var(--border);
	padding: 16px; overflow-y: auto; background: var(--bg-2);
}
.thread { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); padding: 10px 12px; margin-bottom: 12px; }
.thread.resolved { opacity: 0.65; }
.comment { margin-bottom: 8px; }
.comment .who { font-size: 12px; color: var(--text-2); font-weight: 700; }
.comment .when { font-size: 11px; color: var(--text-3); margin-left: 6px; font-weight: 400; }
.comment .txt { font-size: 14px; white-space: pre-wrap; }

/* ---------- Datenbank ---------- */
.db-wrap { max-width: 1200px; margin: 0 auto; padding: 6px 40px 80px; }
.db-toolbar { display: flex; align-items: center; gap: 6px; margin: 10px 0; flex-wrap: wrap; }
.view-tab {
	border: 0; background: none; cursor: pointer; padding: 5px 10px;
	border-radius: 6px; color: var(--text-2); font-weight: 600; font-size: 13.5px;
}
.view-tab.active { background: var(--bg-3); color: var(--text); }
.db-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.db-table th {
	text-align: left; font-weight: 600; color: var(--text-2); font-size: 13px;
	border-bottom: 2px solid var(--border-2); padding: 7px 10px; white-space: nowrap;
}
.db-table th button { border: 0; background: none; cursor: pointer; color: inherit; font: inherit; display: flex; gap: 5px; align-items: center; padding: 0; }
.db-table td { border-bottom: 1px solid var(--border); padding: 5px 10px; vertical-align: middle; min-width: 110px; }
.db-table td.title-cell { font-weight: 600; cursor: pointer; }
.db-table td.title-cell:hover { color: var(--accent); }
.db-table tr:hover td { background: var(--bg-2); }
.cell-input { border: 0; background: none; width: 100%; padding: 3px 4px; border-radius: 4px; color: var(--text); }
.cell-input:focus { outline: 2px solid var(--accent); background: var(--bg); }
.kanban { display: flex; gap: 12px; align-items: flex-start; overflow-x: auto; padding-bottom: 20px; }
.kcol { min-width: 240px; width: 240px; flex: 0 0 auto; background: var(--bg-2); border-radius: var(--radius-lg); padding: 10px; }
.kcol.drag-over { box-shadow: inset 0 0 0 2px var(--accent); }
.kcol .khead { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: 13px; margin-bottom: 8px; padding: 0 2px; }
.kcard {
	background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius);
	padding: 9px 11px; margin-bottom: 8px; cursor: grab; box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.kcard:hover { border-color: var(--border-2); }
.kcard .t { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.kcard .props { display: flex; flex-wrap: wrap; gap: 4px; }

/* ---------- Team ---------- */
.team-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.team-grid .full { grid-column: 1 / -1; }
.member-row { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: var(--radius); }
.member-row:hover { background: var(--bg-2); }
.member-row .info { flex: 1; min-width: 0; }
.member-row .nm { font-weight: 650; }
.member-row .em { color: var(--text-3); font-size: 13px; }
.activity-row { display: flex; gap: 10px; padding: 6px 10px; font-size: 13.5px; align-items: baseline; }
.activity-row .when { color: var(--text-3); font-size: 12px; flex: 0 0 90px; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.audit-table th, .audit-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border); }
.audit-table th { color: var(--text-2); }
code.inline, .token-code {
	font-family: var(--mono); font-size: 13px; background: var(--bg-3);
	padding: 2px 6px; border-radius: 5px; word-break: break-all;
}
.token-box { display: flex; gap: 8px; align-items: center; background: var(--bg-2); border: 1px dashed var(--border-2); border-radius: var(--radius); padding: 10px 12px; margin: 10px 0; }

/* ---------- Overlays ---------- */
.overlay-backdrop {
	position: fixed; inset: 0; background: rgba(15, 15, 15, 0.45);
	display: grid; place-items: center; z-index: 50; padding: 24px;
}
.modal {
	background: var(--bg); border-radius: var(--radius-lg); box-shadow: var(--shadow);
	width: 100%; max-width: 520px; max-height: 86vh; overflow-y: auto; padding: 22px 24px;
	border: 1px solid var(--border);
}
.modal.wide { max-width: 760px; }
.modal h2 { margin: 0 0 16px; font-size: 18px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.palette-backdrop {
	position: fixed; inset: 0; background: rgba(15, 15, 15, 0.35);
	display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; z-index: 55;
}
.palette {
	width: 100%; max-width: 600px; background: var(--bg); border-radius: var(--radius-lg);
	box-shadow: var(--shadow); border: 1px solid var(--border-2); overflow: hidden;
}
.palette input {
	width: 100%; border: 0; outline: none; padding: 15px 18px; font-size: 16px;
	background: var(--bg); color: var(--text); border-bottom: 1px solid var(--border);
}
.palette .results { max-height: 46vh; overflow-y: auto; padding: 6px; }
.palette .hint { padding: 10px 16px; color: var(--text-3); font-size: 13px; }
.result-row { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--radius); cursor: pointer; }
.result-row.hl, .result-row:hover { background: var(--bg-2); }
.result-row .ri { width: 22px; text-align: center; }
.result-row .rt { font-weight: 600; }
.result-row .rs { color: var(--text-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
	background: var(--text); color: var(--bg); border-radius: 8px; padding: 9px 16px;
	font-size: 14px; font-weight: 550; box-shadow: var(--shadow); max-width: 90vw;
}
.toast.error { background: var(--danger); color: #fff; }
.notif-pop {
	position: fixed; top: 52px; right: 60px; width: 380px; max-height: 60vh; overflow-y: auto;
	background: var(--bg); border: 1px solid var(--border-2); border-radius: var(--radius-lg);
	box-shadow: var(--shadow); z-index: 45; padding: 8px;
}
.notif-row { display: flex; gap: 10px; padding: 9px 10px; border-radius: var(--radius); font-size: 13.5px; align-items: baseline; }
.notif-row.unread { background: var(--accent-soft); }
.notif-row .when { color: var(--text-3); font-size: 11.5px; flex: 0 0 auto; }

/* ---------- Responsive & Sonstiges ---------- */
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
@media (max-width: 860px) {
	.files-side { position: absolute; z-index: 20; height: calc(100% - var(--topbar-h)); box-shadow: var(--shadow); display: none; }
	.files-side.open { display: block; }
	.team-grid { grid-template-columns: 1fr; }
	.week-strip { grid-template-columns: repeat(4, 1fr); }
	.editor, .page-head, .folder-list { padding-left: 20px; padding-right: 20px; }
	.comments-panel { display: none; }
	.searchbtn { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; }
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ─── v1.1: Medien-Bloecke ─── */
.media-block { position: relative; flex: 1; }
.upload-drop { display: flex; align-items: center; gap: 10px; width: 100%; padding: 18px; border: 1.5px dashed var(--border-2); border-radius: 10px; background: var(--bg-2); color: var(--text-2); font-size: 14px; cursor: pointer; font-family: inherit; }
.upload-drop:hover, .upload-drop.drag { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.upload-drop .up-icon { font-size: 22px; }
.blk-img { max-width: 100%; border-radius: 8px; display: block; }
.file-card { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-2); text-decoration: none; color: var(--text); }
.file-card:hover { border-color: var(--border-2); background: var(--bg-3); }
.file-card .fc-icon { font-size: 20px; }
.file-card .fc-name { font-weight: 600; }
.media-repl { position: absolute; top: 6px; right: 6px; opacity: 0; }
.media-block:hover .media-repl { opacity: 1; }
.editor.drop-active { outline: 2px dashed var(--accent); outline-offset: -4px; border-radius: 8px; }

/* ─── v1.1: Kalender-Ansicht ─── */
.cal { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.cal-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.cal-head h3 { margin: 0; font-size: 15px; min-width: 150px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow { padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--text-3); text-transform: uppercase; border-bottom: 1px solid var(--border); background: var(--bg-2); }
.cal-day { min-height: 96px; padding: 6px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); vertical-align: top; }
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day.other { background: var(--bg-1); opacity: 0.45; }
.cal-day.today { background: var(--accent-soft); }
.cal-day .dnum { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.cal-day.today .dnum { color: var(--accent); }
.cal-item { display: block; width: 100%; text-align: left; padding: 2px 6px; margin-bottom: 2px; font-size: 12px; border: 0; border-radius: 5px; background: var(--bg-3); color: var(--text); cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: inherit; }
.cal-item:hover { background: var(--accent); color: #fff; }

/* ─── v1.1: Galerie-Ansicht ─── */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.gcard { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; cursor: pointer; background: var(--bg-1); transition: box-shadow .12s, transform .12s; }
.gcard:hover { box-shadow: 0 4px 16px rgba(0,0,0,.12); transform: translateY(-2px); }
.gcard .gcover { height: 110px; background: linear-gradient(135deg, var(--bg-2), var(--bg-3)); display: grid; place-items: center; font-size: 34px; }
.gcard .gbody { padding: 10px 12px; }
.gcard .gtitle { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.gcard .gprops { display: flex; flex-wrap: wrap; gap: 4px; }

/* ─── v1.1: Vorlagen-Galerie ─── */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 14px 0; }
.tpl-card { border: 1px solid var(--border); border-radius: 12px; padding: 18px 14px; text-align: center; cursor: pointer; background: var(--bg-1); font-family: inherit; transition: border-color .12s, transform .12s; }
.tpl-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tpl-card .ticon { font-size: 30px; display: block; margin-bottom: 8px; }
.tpl-card .tname { font-weight: 600; font-size: 13px; }
.tpl-card .tkind { font-size: 11px; color: var(--text-3); }

/* ─── v1.1: Formeln / Relationen ─── */
.formula-preview { font-family: ui-monospace, monospace; font-size: 12px; padding: 8px 10px; border-radius: 6px; background: var(--bg-2); border: 1px solid var(--border); min-height: 20px; }
.formula-preview.ok { border-color: var(--ok); }
.formula-preview.err { border-color: var(--danger); color: var(--danger); }
.formula-help { font-size: 11px; color: var(--text-3); line-height: 1.5; }
.rel-chips { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.rel-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; background: var(--accent-soft); color: var(--accent); font-size: 12px; cursor: pointer; border: 0; font-family: inherit; }
.rel-chip:hover { background: var(--accent); color: #fff; }
.rel-pick-list { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.rel-pick-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 0; border-radius: 7px; background: none; text-align: left; cursor: pointer; font-family: inherit; font-size: 14px; color: var(--text); }
.rel-pick-item:hover { background: var(--bg-2); }
.rel-pick-item.picked { background: var(--accent-soft); color: var(--accent); }
.ro-val { color: var(--text-2); font-size: 14px; }

/* ─── v1.1: Automationen / OIDC / Billing ─── */
.auto-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; }
.auto-row .aicon { font-size: 18px; }
.auto-row .aname { font-weight: 600; flex: 1; }
.auto-row .ameta { font-size: 12px; color: var(--text-3); }
.switch { position: relative; width: 36px; height: 20px; appearance: none; background: var(--bg-3); border-radius: 20px; cursor: pointer; border: 1px solid var(--border); transition: background .15s; }
.switch:checked { background: var(--accent); border-color: var(--accent); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch:checked::after { left: 18px; }
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 10px 0; }
.plan-card { border: 1.5px solid var(--border); border-radius: 10px; padding: 12px; cursor: pointer; text-align: center; background: var(--bg-1); font-family: inherit; color: var(--text); }
.plan-card.active { border-color: var(--accent); background: var(--accent-soft); }
.plan-card .pname { font-weight: 700; text-transform: capitalize; }
.plan-card .plim { font-size: 11px; color: var(--text-3); margin-top: 4px; }
.meter { height: 6px; border-radius: 3px; background: var(--bg-3); overflow: hidden; margin-top: 4px; }
.meter > div { height: 100%; background: var(--accent); }

/* ─── v1.1: MFA ─── */
.mfa-uri { font-family: ui-monospace, monospace; font-size: 11px; word-break: break-all; padding: 10px; background: var(--bg-2); border-radius: 8px; border: 1px solid var(--border); }
.backup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 10px 0; }
.backup-grid code { padding: 6px 10px; background: var(--bg-2); border-radius: 6px; font-size: 13px; text-align: center; border: 1px solid var(--border); }
.oidc-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 10px; margin-top: 10px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg-1); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; font-family: inherit; }
.oidc-btn:hover { background: var(--bg-2); }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 16px 0 4px; color: var(--text-3); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
