/**
 * tb-todo Frontend-Styles. Nutzt die Theme-Tokens (--tb-*), bringt eigene
 * Kanban-Bausteine mit. Kompakt, professionell, breite Nutzung des Platzes,
 * dezente Animationen, dark-mode-faehig ueber die vererbten Tokens.
 *
 * Die Token-Definition steht auf mehreren Wurzeln (.tbtodo, .tbtodo-gate,
 * .tbtodo-modal, .tbtodo-menu), weil Modal und Menue an <body> haengen und
 * sonst die Variablen nicht erben wuerden.
 */
.tbtodo, .tbtodo-gate, .tbtodo-modal, .tbtodo-menu {
	--tbt-radius: 14px;
	--tbt-gap: 12px;
	--tbt-card: var(--tb-bg-card, #fff);
	--tbt-line: var(--tb-line, #e7e7f2);
	--tbt-ink: var(--tb-ink-900, #0e0e2a);
	--tbt-ink2: var(--tb-ink-500, #5c5c7a);
	--tbt-brand: var(--tb-primary-700, #1919c8);
	--tbt-bg: var(--tb-bg, #fafafe);
	font-family: inherit;
	color: var(--tbt-ink);
}

/* App nutzt die volle Breite (bricht aus dem schmalen Theme-Container aus) */
.tbtodo {
	width: min( 1600px, 96vw );
	margin-left: 50%;
	transform: translateX( -50% );
	font-size: 14px;
}

/* ── Gate (nicht eingeloggt) ───────────────────────────────────────── */
.tbtodo-gate { display: flex; justify-content: center; padding: 28px 0; }
.tbtodo-gate__card {
	max-width: 640px; width: 100%;
	background: radial-gradient( 120% 90% at 100% 0%, color-mix( in srgb, var(--tb-accent-cyan, #22d3ee) 16%, transparent ) 0%, transparent 55% ), var(--tbt-card);
	border: 1px solid var(--tbt-line); border-radius: var(--tbt-radius); padding: 30px 28px;
	box-shadow: 0 18px 50px -24px rgba( 20, 24, 60, .4 );
}
.tbtodo-gate__badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; background: linear-gradient( 90deg, var(--tbt-brand), var(--tb-accent-teal, #14b8a6) ); padding: 5px 12px; border-radius: 999px; margin-bottom: 14px; }
.tbtodo-gate__title { margin: 0 0 10px; font-size: 1.6rem; line-height: 1.15; }
.tbtodo-gate__lead { margin: 0 0 16px; color: var(--tbt-ink2); }
.tbtodo-gate__feats { margin: 0 0 22px; padding: 0; list-style: none; display: grid; gap: 9px; }
.tbtodo-gate__feats li { position: relative; padding-left: 28px; }
.tbtodo-gate__feats li::before { content: ""; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 6px; background: color-mix( in srgb, var(--tb-accent-emerald, #10b981) 22%, transparent ); box-shadow: inset 0 0 0 1.5px var(--tb-accent-emerald, #10b981); }
.tbtodo-gate__feats li::after { content: ""; position: absolute; left: 6px; top: 6px; width: 6px; height: 3px; border-left: 2px solid var(--tb-accent-emerald, #10b981); border-bottom: 2px solid var(--tb-accent-emerald, #10b981); transform: rotate( -45deg ); }
.tbtodo-gate__btns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ── Boot / Lade-Zustand ───────────────────────────────────────────── */
.tbtodo__boot { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 60px 0; color: var(--tbt-ink2); }
.tbtodo__spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid color-mix( in srgb, var(--tbt-brand) 30%, transparent ); border-top-color: var(--tbt-brand); animation: tbt-spin .8s linear infinite; }
.tbtodo__noscript { text-align: center; color: var(--tbt-ink2); padding: 30px; }
@keyframes tbt-spin { to { transform: rotate( 360deg ); } }

/* ── Kopfleiste ────────────────────────────────────────────────────── */
.tbtodo__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.tbtodo__boardsel { display: flex; align-items: center; gap: 8px; }
.tbtodo__boardsel-ic { color: var(--tbt-brand); display: inline-flex; }
.tbtodo__boardsel-sel { font: inherit; font-weight: 700; font-size: 1.25rem; color: var(--tbt-ink); background: transparent; border: 1px solid transparent; border-radius: 10px; padding: 5px 10px; cursor: pointer; max-width: 60vw; }
.tbtodo__boardsel-sel:hover { border-color: var(--tbt-line); }
.tbtodo__actions { display: flex; gap: 7px; flex-wrap: wrap; }

/* ── Werkzeugleiste (Suche / Sortierung / Filter) ──────────────────── */
.tbtodo__tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.tbtodo__search { display: flex; align-items: center; gap: 7px; flex: 1 1 260px; min-width: 200px; background: var(--tbt-card); border: 1px solid var(--tbt-line); border-radius: 10px; padding: 0 11px; color: var(--tbt-ink2); }
.tbtodo__search:focus-within { border-color: var(--tbt-brand); box-shadow: 0 0 0 3px color-mix( in srgb, var(--tbt-brand) 16%, transparent ); }
.tbtodo__search-in { flex: 1 1 auto; border: none; outline: none; background: transparent; font: inherit; color: var(--tbt-ink); padding: 9px 0; }
.tbtodo__selwrap { display: inline-flex; align-items: center; gap: 6px; background: var(--tbt-card); border: 1px solid var(--tbt-line); border-radius: 10px; padding: 0 8px 0 10px; color: var(--tbt-ink2); }
.tbtodo__sel { font: inherit; border: none; outline: none; background: transparent; color: var(--tbt-ink); padding: 9px 2px; cursor: pointer; }
.tbtodo__switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; background: var(--tbt-card); border: 1px solid var(--tbt-line); border-radius: 10px; padding: 7px 11px; font-size: .84rem; font-weight: 600; color: var(--tbt-ink2); user-select: none; }
.tbtodo__switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.tbtodo__switch-box { display: inline-flex; }
.tbtodo__switch:hover { border-color: color-mix( in srgb, var(--tbt-brand) 40%, var(--tbt-line) ); }
.tbtodo__switch.is-on { border-color: var(--tbt-brand); color: var(--tbt-brand); background: color-mix( in srgb, var(--tbt-brand) 8%, var(--tbt-card) ); }

/* ── Buttons ───────────────────────────────────────────────────────── */
.tbt-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; font-size: .86rem; line-height: 1; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--tbt-line); background: var(--tbt-card); color: var(--tbt-ink); cursor: pointer; transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease; }
.tbt-btn:hover { transform: translateY( -1px ); box-shadow: 0 8px 18px -12px rgba( 20, 24, 60, .55 ); }
.tbt-btn:active { transform: translateY( 0 ); }
.tbt-btn--primary { background: linear-gradient( 92deg, var(--tbt-brand), color-mix( in srgb, var(--tbt-brand) 60%, var(--tb-accent-teal, #14b8a6) ) ); border-color: transparent; color: #fff; }
.tbt-btn--ghost { background: color-mix( in srgb, var(--tbt-card) 70%, transparent ); }
.tbt-btn--danger { color: var(--tb-accent-rose, #f43f5e); border-color: color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 40%, var(--tbt-line) ); }
.tbt-btn--danger:hover { background: color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 12%, var(--tbt-card) ); }
.tbt-i { flex: none; }

/* ── Export-Menue ──────────────────────────────────────────────────── */
.tbtodo-menu { z-index: 100000; background: var(--tbt-card); border: 1px solid var(--tbt-line); border-radius: 12px; box-shadow: 0 20px 50px -20px rgba( 10, 12, 40, .5 ); padding: 6px; min-width: 210px; }
.tbtodo-menu__item { display: block; width: 100%; text-align: left; font: inherit; font-size: .9rem; padding: 9px 12px; border: none; background: transparent; color: var(--tbt-ink); border-radius: 8px; cursor: pointer; }
.tbtodo-menu__item:hover { background: color-mix( in srgb, var(--tbt-brand) 10%, transparent ); color: var(--tbt-brand); }

/* ── KI-Leiste ─────────────────────────────────────────────────────── */
.tbtodo__ai { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 13px; background: linear-gradient( 92deg, color-mix( in srgb, var(--tbt-brand) 10%, var(--tbt-card) ), var(--tbt-card) ); border: 1px solid var(--tbt-line); border-radius: 12px; box-shadow: 0 10px 30px -22px rgba( 20, 24, 60, .6 ); }
.tbtodo__ai-badge { margin-bottom: 9px; }
.tbtodo__ai.is-busy { opacity: .7; pointer-events: none; }
.tbtodo__ai-badge { color: var(--tbt-brand); display: inline-flex; animation: tbt-pulse 2.4s ease-in-out infinite; }
@keyframes tbt-pulse { 0%, 100% { opacity: .6; transform: scale( .96 ); } 50% { opacity: 1; transform: scale( 1.06 ); } }
.tbtodo__ai-input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: .95rem; line-height: 1.4; color: var(--tbt-ink); background: transparent; border: none; outline: none; padding: 9px 4px; resize: none; max-height: 96px; overflow-y: auto; box-sizing: border-box; }
.tbtodo__ai-mic, .tbtodo__ai-send { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; border: none; cursor: pointer; border-radius: 9px; padding: 8px 11px; }
.tbtodo__ai-mic { background: transparent; color: var(--tbt-ink2); }
.tbtodo__ai-mic:hover { color: var(--tbt-brand); background: color-mix( in srgb, var(--tbt-brand) 10%, transparent ); }
.tbtodo__ai-mic.is-live { color: #fff; background: var(--tb-accent-rose, #f43f5e); animation: tbt-live 1.1s ease-in-out infinite; }
@keyframes tbt-live { 0%, 100% { box-shadow: 0 0 0 0 color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 60%, transparent ); } 50% { box-shadow: 0 0 0 7px transparent; } }
.tbtodo__ai-send { background: var(--tbt-brand); color: #fff; }
.tbtodo__ai-send:hover { filter: brightness( 1.08 ); }
.tbtodo__ai-send:disabled, .tbtodo__ai-input:disabled { opacity: .6; cursor: default; }

/* Mikrofon-Stille-Countdown (5s) */
.tbtodo__count { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; margin: 8px 2px 0; padding: 7px 12px; background: color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 8%, var(--tbt-card) ); border: 1px solid color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 30%, var(--tbt-line) ); border-radius: 10px; }
.tbtodo__count[hidden] { display: none; }
.tbtodo__count-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--tb-accent-rose, #f43f5e); white-space: nowrap; margin-right: auto; }
.tbtodo__count-track { flex: 1 1 100%; order: 3; height: 7px; border-radius: 999px; background: color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 18%, transparent ); overflow: hidden; }
.tbtodo__count-bar { display: block; height: 100%; width: 100%; transform-origin: left center; border-radius: 999px; background: linear-gradient( 90deg, var(--tb-accent-rose, #f43f5e), var(--tb-accent-amber, #f2c94c) ); }
.tbtodo__count-cancel { flex: none; font: inherit; font-size: .8rem; font-weight: 700; color: var(--tb-accent-rose, #f43f5e); background: var(--tbt-card); border: 1px solid color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 40%, var(--tbt-line) ); border-radius: 999px; padding: 5px 12px; cursor: pointer; white-space: nowrap; }
.tbtodo__count-cancel:hover { background: color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 12%, var(--tbt-card) ); }
@keyframes tbt-count { from { transform: scaleX( 1 ); } to { transform: scaleX( 0 ); } }

.tbtodo__ai-log { display: grid; gap: 6px; margin: 9px 0 2px; max-height: 240px; overflow-y: auto; padding-right: 2px; }
.tbtodo__ai-msg { display: flex; align-items: flex-start; gap: 7px; max-width: 72%; padding: 7px 11px; border-radius: 11px; font-size: .9rem; opacity: 0; transform: translateY( 6px ); transition: opacity .25s ease, transform .25s ease; }
.tbtodo__ai-msg.is-in { opacity: 1; transform: none; }
.tbtodo__ai-msg--me { align-self: flex-end; margin-left: auto; background: color-mix( in srgb, var(--tbt-brand) 14%, var(--tbt-card) ); }
.tbtodo__ai-msg--ai { background: var(--tbt-card); border: 1px solid var(--tbt-line); }
.tbtodo__ai-msg--ai .tbt-i { color: var(--tbt-brand); margin-top: 1px; }
.tbtodo__ai-msg--done { background: color-mix( in srgb, var(--tb-accent-emerald, #10b981) 12%, var(--tbt-card) ); border: 1px solid color-mix( in srgb, var(--tb-accent-emerald, #10b981) 35%, var(--tbt-line) ); max-width: 92%; }
.tbtodo__ai-msg--done .tbt-i { color: var(--tb-accent-emerald, #10b981); margin-top: 1px; }
.tbtodo__ai-msg--err { background: color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 10%, var(--tbt-card) ); border: 1px solid color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 35%, var(--tbt-line) ); max-width: 92%; }
.tbtodo__ai-msg--err .tbt-i { color: var(--tb-accent-rose, #f43f5e); margin-top: 1px; }
.tbtodo__ai-msg--info { background: color-mix( in srgb, var(--tb-accent-amber, #f2c94c) 14%, var(--tbt-card) ); border: 1px solid color-mix( in srgb, var(--tb-accent-amber, #f2c94c) 45%, var(--tbt-line) ); max-width: 92%; }
.tbtodo__ai-msg--info .tbt-i { color: var(--tb-accent-amber, #f2c94c); margin-top: 1px; }
.tbtodo__ai-dots { display: inline-flex; align-items: center; gap: 3px; margin-top: 3px; }
.tbtodo__ai-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--tbt-brand); display: inline-block; animation: tbt-dot 1.1s ease-in-out infinite; }
.tbtodo__ai-dots i:nth-child(2) { animation-delay: .18s; }
.tbtodo__ai-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes tbt-dot { 0%, 100% { opacity: .3; transform: translateY( 0 ); } 50% { opacity: 1; transform: translateY( -3px ); } }

/* ── Board ─────────────────────────────────────────────────────────── */
.tbtodo__board { display: grid; grid-template-columns: repeat( 4, minmax( 0, 1fr ) ); gap: var(--tbt-gap); margin-top: 14px; align-items: start; }
.tbtodo-col { background: color-mix( in srgb, var(--tbt-card) 55%, var(--tbt-bg) ); border: 1px solid var(--tbt-line); border-radius: var(--tbt-radius); padding: 10px; display: flex; flex-direction: column; min-height: 100px; transition: box-shadow .2s ease, border-color .2s ease, background .2s ease; }
.tbtodo-col.is-over { border-color: var(--tbt-brand); background: color-mix( in srgb, var(--tbt-brand) 8%, var(--tbt-card) ); box-shadow: inset 0 0 0 2px color-mix( in srgb, var(--tbt-brand) 30%, transparent ); }
.tbtodo-col__head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; padding: 2px; }
.tbtodo-col__ic { display: inline-flex; width: 26px; height: 26px; align-items: center; justify-content: center; border-radius: 8px; }
.tbtodo-col__ic--backlog { color: var(--tb-accent-amber, #f2c94c); background: color-mix( in srgb, var(--tb-accent-amber, #f2c94c) 16%, transparent ); }
.tbtodo-col__ic--todo    { color: var(--tbt-brand); background: color-mix( in srgb, var(--tbt-brand) 14%, transparent ); }
.tbtodo-col__ic--doing   { color: var(--tb-accent-cyan, #22d3ee); background: color-mix( in srgb, var(--tb-accent-cyan, #22d3ee) 16%, transparent ); }
.tbtodo-col__ic--blocked { color: var(--tb-accent-amber, #f59e0b); background: color-mix( in srgb, var(--tb-accent-amber, #f59e0b) 18%, transparent ); }
.tbtodo-col__ic--done    { color: var(--tb-accent-emerald, #10b981); background: color-mix( in srgb, var(--tb-accent-emerald, #10b981) 16%, transparent ); }
.tbtodo-col__title { font-weight: 700; flex: 1 1 auto; font-size: .95rem; }
.tbtodo-col__count { font-size: .76rem; font-weight: 700; color: var(--tbt-ink2); background: var(--tbt-card); border: 1px solid var(--tbt-line); border-radius: 999px; padding: 2px 8px; text-align: center; }
.tbtodo-col__gear { border: none; background: transparent; color: var(--tbt-ink2); cursor: pointer; padding: 3px; border-radius: 7px; display: inline-flex; }
.tbtodo-col__gear:hover { background: var(--tbt-line); color: var(--tbt-ink); }
.tbtodo-col__hidden { color: var(--tbt-ink2); font-weight: 600; opacity: .9; }
.tbtodo-col__list { display: flex; flex-direction: column; gap: 8px; min-height: 20px; }
.tbtodo-col__add { margin-top: 9px; width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-size: .83rem; font-weight: 600; color: var(--tbt-ink2); background: transparent; border: 1px dashed var(--tbt-line); border-radius: 10px; padding: 8px; cursor: pointer; transition: color .2s ease, border-color .2s ease, background .2s ease; }
.tbtodo-col__add:hover { color: var(--tbt-brand); border-color: var(--tbt-brand); background: color-mix( in srgb, var(--tbt-brand) 7%, transparent ); }
.tbtodo-col__quick { margin-top: 9px; }
.tbtodo-col__quick-in { width: 100%; font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--tbt-brand); background: var(--tbt-card); color: var(--tbt-ink); outline: none; box-shadow: 0 0 0 3px color-mix( in srgb, var(--tbt-brand) 18%, transparent ); }

/* ── Karte ─────────────────────────────────────────────────────────── */
.tbtodo-card { --accent: #4f8cff; position: relative; display: flex; gap: 7px; padding: 9px 9px 9px 8px; background: var(--tbt-card); border: 1px solid var(--tbt-line); border-radius: 11px; cursor: grab; opacity: 0; transform: translateY( 6px ); transition: opacity .25s ease, transform .25s ease, box-shadow .2s ease, border-color .2s ease; box-shadow: 0 1px 5px -4px rgba( 20, 24, 60, .5 ); }
.tbtodo-card::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.tbtodo-card.is-in { opacity: 1; transform: none; }
.tbtodo-card:hover { border-color: color-mix( in srgb, var(--accent) 50%, var(--tbt-line) ); box-shadow: 0 10px 22px -16px rgba( 20, 24, 60, .6 ); transform: translateY( -1px ); }
.tbtodo-card.is-drag { opacity: .5; cursor: grabbing; }
.tbtodo-card__pri { display: flex; flex-direction: column; align-items: center; gap: 1px; padding-left: 3px; }
.tbtodo-card__prbtn { width: 20px; height: 16px; display: inline-flex; align-items: center; justify-content: center; border: none; background: transparent; color: var(--tbt-ink2); cursor: pointer; border-radius: 5px; padding: 0; }
.tbtodo-card__prbtn:hover { color: var(--accent); background: color-mix( in srgb, var(--accent) 14%, transparent ); }
.tbtodo-card__prval { font-weight: 800; font-size: .88rem; color: var(--accent); min-width: 24px; text-align: center; font-variant-numeric: tabular-nums; }
.tbtodo-card__body { flex: 1 1 auto; min-width: 0; }
.tbtodo-card__title { font-weight: 600; font-size: .9rem; line-height: 1.32; word-break: break-word; }
.tbtodo-card__chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tbt-chip { font-size: .7rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; line-height: 1.5; }
.tbt-person { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 600; padding: 2px 8px 2px 6px; border-radius: 999px; line-height: 1.5; border: 1px solid var(--tbt-line); background: var(--tbt-bg); color: var(--tbt-ink); }
.tbt-person__dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.tbtodo-card__meta { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 7px; color: var(--tbt-ink2); font-size: .74rem; align-items: center; }
.tbtodo-card__m { display: inline-flex; align-items: center; gap: 4px; }
.tbtodo-card__m--ai { color: var(--tbt-brand); font-weight: 700; }
.tbtodo-card__m--termin { color: var(--tbt-ink); font-weight: 600; }
.tbtodo-card__m--termin.is-overdue { color: var(--tb-accent-rose, #f43f5e); font-weight: 800; }
.tbtodo-card__ics { display: inline-flex; align-items: center; justify-content: center; margin-left: 3px; padding: 1px; border: 0; background: none; color: inherit; opacity: .45; cursor: pointer; border-radius: 5px; line-height: 0; transition: opacity .15s, color .15s, background .15s; }
.tbtodo-card__ics:hover { opacity: 1; color: var(--tbt-brand); background: rgba(127, 127, 127, .14); }
/* Blockiert: auffälliges Band auf der Karte + dezent gedämpfte Karte. */
.tbtodo-card.is-blocked { background: color-mix( in srgb, var(--tb-accent-amber, #f59e0b) 7%, var(--tbt-card) ); }
.tbtodo-card__block { display: inline-flex; align-items: center; gap: 5px; margin: 6px 0 2px; padding: 3px 9px; border-radius: 999px; font-size: .78rem; font-weight: 700;
	color: var(--tb-accent-amber, #b45309); background: color-mix( in srgb, var(--tb-accent-amber, #f59e0b) 18%, transparent ); }
.tbtodo-card__block svg { flex: none; }
.tbtodo-card__block span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.tbtodo-card__m--date { margin-left: auto; opacity: .8; }
.tbtodo-card__side { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tbtodo-card__grip { color: var(--tb-ink-300, #a6a6bd); display: inline-flex; }
.tbtodo-card__arch { border: none; background: transparent; color: var(--tb-ink-300, #a6a6bd); cursor: pointer; padding: 2px; border-radius: 6px; display: inline-flex; opacity: .5; transition: opacity .15s ease, color .15s ease, background .15s ease; }
.tbtodo-card:hover .tbtodo-card__arch { opacity: 1; }
.tbtodo-card__arch:hover { color: var(--tbt-brand); background: color-mix( in srgb, var(--tbt-brand) 12%, transparent ); }
.tbtodo-card.is-hidden { opacity: .5; }
.tbtodo-card.is-hidden .tbtodo-card__arch { opacity: 1; color: var(--tb-accent-amber, #f2c94c); }

/* Spalten-Footer: Status-Info der Kategorie */
.tbtodo-col__foot { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 9px; padding: 8px 4px 2px; border-top: 1px dashed var(--tbt-line); font-size: .74rem; font-weight: 600; color: var(--tbt-ink2); }
.tbtodo-col__foot span { display: inline-flex; align-items: center; gap: 3px; }
.tbtodo-col__foot .is-over { color: var(--tb-accent-rose, #f43f5e); }

/* ── Modal ─────────────────────────────────────────────────────────── */
.tbtodo-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 18px; font-size: 14px; }
.tbtodo-modal__back { position: absolute; inset: 0; background: rgba( 10, 12, 30, .55 ); backdrop-filter: blur( 3px ); opacity: 0; transition: opacity .2s ease; }
.tbtodo-modal.is-open .tbtodo-modal__back { opacity: 1; }
.tbtodo-modal__win { position: relative; width: min( 580px, 100% ); max-height: 88vh; overflow: auto; background: var(--tbt-card); border: 1px solid var(--tbt-line); border-radius: 16px; box-shadow: 0 30px 80px -30px rgba( 10, 12, 40, .7 ); transform: translateY( 14px ) scale( .98 ); opacity: 0; transition: transform .2s ease, opacity .2s ease; }
.tbtodo-modal.is-open .tbtodo-modal__win { transform: none; opacity: 1; }
.tbtodo-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--tbt-line); position: sticky; top: 0; background: var(--tbt-card); z-index: 1; }
.tbtodo-modal__head h3 { margin: 0; font-size: 1.1rem; }
.tbtodo-modal__head h3 { margin-right: auto; }
.tbtodo-modal__close { border: none; background: transparent; color: var(--tbt-ink2); cursor: pointer; padding: 4px; border-radius: 8px; display: inline-flex; }
.tbtodo-modal__close:hover { background: var(--tbt-line); color: var(--tbt-ink); }
/* Speichern-Icon im Kopf (neben dem X). Hebt sich hervor, sobald es Aenderungen gibt. */
.tbtodo-modal__save { border: 1px solid var(--tbt-line); background: transparent; color: var(--tbt-ink2); cursor: pointer; padding: 4px; border-radius: 8px; display: inline-flex; transition: background .15s ease, color .15s ease, border-color .15s ease; }
.tbtodo-modal__save:hover { background: var(--tbt-line); color: var(--tbt-ink); }
.tbtodo-modal__save.is-dirty { background: var(--tbt-brand, #4f8cff); border-color: var(--tbt-brand, #4f8cff); color: #fff; box-shadow: 0 0 0 4px color-mix( in srgb, var(--tbt-brand, #4f8cff) 22%, transparent ); }
/* Rueckfrage beim Schliessen mit ungespeicherten Aenderungen. */
.tbtodo-confirm { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; padding: 18px; background: color-mix( in srgb, var(--tb-ink-900, #0e0e2a) 55%, transparent ); opacity: 0; transition: opacity .15s ease; }
.tbtodo-confirm.is-open { opacity: 1; }
.tbtodo-confirm__box { width: min( 420px, 100% ); background: var(--tbt-card); border: 1px solid var(--tbt-line); border-radius: 14px; padding: 18px; box-shadow: 0 24px 60px -24px rgba( 10, 12, 40, .7 ); }
.tbtodo-confirm__msg { display: flex; align-items: center; gap: 10px; font-weight: 600; margin-bottom: 16px; }
.tbtodo-confirm__msg svg { color: var(--tb-accent-amber, #f59e0b); flex: none; }
.tbtodo-confirm__btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.tbtodo-modal__body { padding: 18px; }

/* ── Formfelder ────────────────────────────────────────────────────── */
.tbt-field { display: block; margin-bottom: 13px; }
.tbt-field__lbl { display: block; font-size: .76rem; font-weight: 700; color: var(--tbt-ink2); margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em; }
.tbt-input { width: 100%; font: inherit; font-size: .95rem; color: var(--tbt-ink); background: var(--tbt-bg); border: 1px solid var(--tbt-line); border-radius: 10px; padding: 9px 11px; outline: none; transition: border-color .2s ease, box-shadow .2s ease; }
.tbt-input:focus { border-color: var(--tbt-brand); box-shadow: 0 0 0 3px color-mix( in srgb, var(--tbt-brand) 18%, transparent ); }
.tbt-input--area { resize: vertical; min-height: 80px; line-height: 1.45; }
.tbt-input--num { max-width: 110px; }
.tbt-row { display: flex; gap: 12px; flex-wrap: wrap; }
.tbt-row .tbt-field { flex: 1 1 130px; }
.tbt-muted { color: var(--tbt-ink2); font-size: .88rem; }
.tbt-muted code { background: var(--tbt-bg); padding: 1px 5px; border-radius: 5px; }
.tbt-check { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; font-size: .92rem; color: var(--tbt-ink); cursor: pointer; }
.tbt-check input { width: 18px; height: 18px; flex: none; accent-color: var(--tbt-brand); }
.tbt-check .tbt-i { vertical-align: middle; color: var(--tbt-ink2); }
.tbt-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.tbt-chip--pick { cursor: pointer; border: 1.5px solid; background: transparent; transition: transform .1s ease; }
.tbt-chip--pick:hover { transform: translateY( -1px ); }
.tbt-person--pick { cursor: pointer; transition: transform .1s ease; }
.tbt-person--pick:hover { transform: translateY( -1px ); }
.tbt-person--pick.is-on { font-weight: 700; }
.tbt-mepill { font-size: .72rem; font-weight: 700; color: var(--tb-accent-teal, #14b8a6); background: color-mix( in srgb, var(--tb-accent-teal, #14b8a6) 14%, transparent ); border-radius: 999px; padding: 4px 10px; }

/* ── Notizen ───────────────────────────────────────────────────────── */
.tbtodo-notes { margin-top: 4px; }
.tbtodo-note { position: relative; background: var(--tbt-bg); border: 1px solid var(--tbt-line); border-radius: 10px; padding: 9px 32px 9px 11px; margin-bottom: 7px; }
.tbtodo-note--ai { border-left: 3px solid var(--tbt-brand); }
.tbtodo-note__body { white-space: pre-wrap; word-break: break-word; line-height: 1.4; }
.tbtodo-note__meta { margin-top: 5px; font-size: .72rem; color: var(--tbt-ink2); }
.tbtodo-note__del { position: absolute; top: 7px; right: 7px; border: none; background: transparent; color: var(--tbt-ink2); cursor: pointer; border-radius: 7px; padding: 3px; display: inline-flex; }
.tbtodo-note__del:hover { color: var(--tb-accent-rose, #f43f5e); background: color-mix( in srgb, var(--tb-accent-rose, #f43f5e) 12%, transparent ); }
.tbtodo-note__add { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.tbtodo-note__add .tbt-input { flex: 1 1 auto; }
.tbt-input--note { resize: vertical; min-height: 44px; line-height: 1.4; overflow-y: auto; }
.tbtodo-detail__foot { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--tbt-line); }
.tbtodo-detail__info { display: flex; align-items: center; gap: 6px; margin: 2px 0 6px; font-size: .8rem; color: var(--tbt-ink2); }
.tbtodo-detail__info .tbt-i { flex: none; }
.tbt-hint { margin: -6px 0 12px; font-size: .8rem; }

/* ── Tag-/Personen-Verwaltung ──────────────────────────────────────── */
.tbtodo-mgr__row, .tbtodo-mgr__add { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.tbtodo-mgr__row .tbt-input, .tbtodo-mgr__add .tbt-input { flex: 1 1 auto; }
.tbtodo-mgr__color { width: 38px; height: 38px; padding: 2px; border: 1px solid var(--tbt-line); border-radius: 10px; background: var(--tbt-card); cursor: pointer; flex: none; }
.tbtodo-mgr__add { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--tbt-line); }

/* ── API-Token ─────────────────────────────────────────────────────── */
.tbtodo-token__status { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 14px 0; }
.tbtodo-token__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--tb-ink-300, #a6a6bd); }
.tbtodo-token__dot.is-on { background: var(--tb-accent-emerald, #10b981); box-shadow: 0 0 0 4px color-mix( in srgb, var(--tb-accent-emerald, #10b981) 22%, transparent ); }
.tbtodo-token__btns { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tbtodo-token__fresh { background: color-mix( in srgb, var(--tb-accent-emerald, #10b981) 10%, var(--tbt-card) ); border: 1px solid color-mix( in srgb, var(--tb-accent-emerald, #10b981) 40%, var(--tbt-line) ); border-radius: 12px; padding: 12px; margin: 14px 0; }
.tbtodo-token__val { display: block; word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; margin: 6px 0 10px; }
.tbtodo-token__pre { background: var(--tb-ink-900, #0e0e2a); color: #d7e3ff; border-radius: 12px; padding: 14px; overflow: auto; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; line-height: 1.5; white-space: pre; }
.tbtodo-token__board { display: flex; align-items: center; gap: 6px; margin: 10px 0; font-size: .9rem; color: var(--tbt-ink2); }
.tbtodo-token__board code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.tbtodo-token__docs { margin-top: 8px; }
.tbtodo-token__more { margin-top: 12px; font-size: .88rem; color: var(--tbt-ink2); }
.tbtodo-token__more a { color: var(--tbt-brand); font-weight: 600; }

/* ── Teilen (Board/Karte) ───────────────────────────────────────────── */
.tbtodo-share__fresh { background: color-mix( in srgb, var(--tb-accent-emerald, #10b981) 10%, var(--tbt-card) ); border: 1px solid color-mix( in srgb, var(--tb-accent-emerald, #10b981) 40%, var(--tbt-line) ); border-radius: 12px; padding: 12px; margin: 4px 0 16px; }
.tbtodo-share__url { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; padding: 9px 10px; border: 1px solid var(--tbt-line); border-radius: 10px; background: var(--tbt-card); color: var(--tbt-ink); margin: 6px 0 10px; }
.tbtodo-cal { margin: 4px 0 16px; padding-top: 14px; border-top: 1px solid var(--tbt-line); }
.tbtodo-cal__row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.tbtodo-cal__url { flex: 1; min-width: 0; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .8rem; padding: 9px 10px; border: 1px solid var(--tbt-line); border-radius: 10px; background: var(--tbt-card); color: var(--tbt-ink); }
.tbtodo-cal__btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tbtodo-share__token { margin: 8px 0 0; font-size: .82rem; word-break: break-all; }
.tbtodo-share__token code { font-family: ui-monospace, Menlo, Consolas, monospace; }
.tbtodo-share__create { margin: 8px 0 18px; }
.tbtodo-share__crow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.tbtodo-share__crow .tbt-input { flex: 1 1 180px; }
.tbtodo-share__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--tbt-line); }
.tbtodo-share__rowhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tbtodo-share__meta { font-size: .82rem; color: var(--tbt-ink2); }
.tbtodo-share__role { font-size: .78rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.tbtodo-share__role--read { background: color-mix( in srgb, var(--tbt-brand, #4f8cff) 16%, transparent ); color: var(--tbt-brand, #4f8cff); }
.tbtodo-share__role--edit { background: color-mix( in srgb, var(--tb-accent-emerald, #10b981) 18%, transparent ); color: var(--tb-accent-emerald, #10b981); }

/* ── Anhaenge ───────────────────────────────────────────────────────── */
.tbtodo-atts { margin-top: 16px; }
.tbtodo-att { border: 1px solid var(--tbt-line); border-radius: 12px; padding: 10px; margin: 8px 0; background: var(--tbt-card); }
.tbtodo-att__media { margin-bottom: 8px; }
.tbtodo-att__imglink { display: inline-block; }
.tbtodo-att__img { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; }
.tbtodo-att__av { width: 100%; }
video.tbtodo-att__av { max-height: 320px; border-radius: 8px; background: #000; }
.tbtodo-att__row { display: flex; align-items: center; gap: 8px; }
.tbtodo-att__name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: .9rem; }
.tbtodo-att__size { color: var(--tbt-ink2); font-size: .8rem; flex: none; }
.tbtodo-att__acts { display: flex; gap: 6px; flex: none; }
.tbtodo-att__dl { text-decoration: none; }
.tbtodo-att__add { margin-top: 10px; }

/* ── PWA Installieren-Knopf ─────────────────────────────────────────── */
.tbtodo-install {
	position: fixed; z-index: 99998; right: 16px; bottom: 16px;
	display: inline-flex; align-items: center; gap: 8px; font: inherit; font-weight: 700; font-size: .9rem;
	color: #fff; background: linear-gradient( 92deg, var(--tb-primary-700, #1919c8), var(--tb-accent-teal, #14b8a6) );
	border: none; border-radius: 999px; padding: 11px 18px; cursor: pointer;
	box-shadow: 0 12px 30px -10px rgba( 20, 24, 60, .6 ); animation: tbt-install-in .3s ease;
}
.tbtodo-install:hover { filter: brightness( 1.07 ); }
@keyframes tbt-install-in { from { opacity: 0; transform: translateY( 10px ); } to { opacity: 1; transform: none; } }

/* ── Versions-Fusszeile ─────────────────────────────────────────────── */
.tbtodo__ver { text-align: center; margin: 20px 0 6px; font-size: .78rem; color: var(--tbt-ink2); }
.tbtodo__ver strong { color: var(--tbt-ink); font-weight: 700; }
.tbtodo__ver a { color: var(--tbt-brand); font-weight: 600; }
.tbtodo-gate__ver { margin: 16px 0 0; font-size: .78rem; color: var(--tbt-ink2); }

/* ── Responsive ────────────────────────────────────────────────────── */
@media ( max-width: 1000px ) { .tbtodo__board { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); } }
@media ( max-width: 600px ) {
	.tbtodo { width: 94vw; }
	.tbtodo__board { grid-template-columns: 1fr; }
	.tbtodo__ai-send span { display: none; }
	.tbtodo-card__m--date { margin-left: 0; }
	.tbtodo__ai-log { max-height: 150px; }
	.tbtodo-card__arch { opacity: .7; }
}
@media ( hover: none ) { .tbtodo-card__arch { opacity: .7; } }
@media ( prefers-reduced-motion: reduce ) {
	.tbtodo-card, .tbtodo__ai-msg, .tbtodo-modal__win, .tbtodo-modal__back { transition: none; }
	.tbtodo-card { opacity: 1; transform: none; }
	.tbtodo__ai-badge, .tbtodo__ai-mic.is-live, .tbtodo__spin, .tbtodo__ai-dots i { animation: none; }
	.tbtodo__count-bar { animation: none !important; transform: scaleX( 1 ); }
}
