/* XYZ Create – im Stil von XYZ Development */

:root {
  --bg-void: #05070d;
  --bg-base: #070b14;
  --bg-alt: #0a0f1c;
  --bg-panel: #0c1220;
  --bg-raised: #111a2c;
  --border: rgba(148, 178, 220, .14);
  --border-strong: rgba(148, 178, 220, .28);
  --text-primary: #eaf1fb;
  --text-secondary: #9fb0c9;
  --text-muted: #6b7994;
  --cyan: #22d3ee;
  --blue: #3b82f6;
  --violet: #7c6cf0;
  --danger: #f87171;
  --success: #4ade80;
  --glow-cyan: rgba(34, 211, 238, .35);
  --glow-blue: rgba(59, 130, 246, .28);
  --font-head: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --radius: 6px;
  --radius-lg: 10px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --shadow: 0 24px 60px -20px rgba(0, 0, 0, .7), 0 0 0 1px var(--border);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.is-app { overflow: hidden; }
#root { min-height: 100%; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; letter-spacing: -.01em; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
b { font-weight: 600; }
.muted { color: var(--text-secondary); }
.fine { color: var(--text-muted); font-size: 12px; }
.danger-text { color: var(--danger) !important; }

.ic { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ic svg { width: 100%; height: 100%; }

.spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--cyan);
  animation: spin .8s linear infinite; display: inline-block; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot { height: 100vh; display: grid; place-items: center; }
.boot .spinner { width: 28px; height: 28px; }

/* ---------- Buttons & Inputs ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: .62rem 1rem; font-weight: 600; font-size: .9rem; line-height: 1.1;
  transition: filter .15s var(--ease), background .15s var(--ease), border-color .15s var(--ease), opacity .15s;
  white-space: nowrap;
}
.btn .ic { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--cyan); color: #04101a; }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 0 0 3px var(--glow-cyan); }
.btn-ghost { background: transparent; border-color: var(--border-strong); color: var(--text-primary); }
.btn-ghost:hover:not(:disabled) { border-color: var(--cyan); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(1.1); }
.btn-sm { padding: .42rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; }
.btn.is-busy { position: relative; }

.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none;
  background: transparent; border: 1px solid transparent; border-radius: var(--radius);
  color: var(--text-secondary); transition: background .12s, color .12s, border-color .12s;
}
.icon-btn:hover:not(:disabled) { background: rgba(148, 178, 220, .08); color: var(--text-primary); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.danger:hover { color: var(--danger); background: rgba(248, 113, 113, .1); }

.link-btn { background: none; border: none; padding: 0; color: var(--cyan); font-size: .85rem; font-weight: 500; }
.link-btn:hover:not(:disabled) { text-decoration: underline; }
.link-btn:disabled { color: var(--text-muted); cursor: default; }
.link-btn.right { align-self: flex-end; margin-top: -.4rem; }

.field { display: flex; flex-direction: column; gap: .4rem; }
.field-label { font-size: .8rem; color: var(--text-secondary); font-weight: 500; }
.field-hint { font-size: .76rem; color: var(--text-muted); }
.field input, .field textarea, .search-input, .inline-input, .todo-input, .todo-time, .todo-notes {
  width: 100%; background: var(--bg-alt); border: 1px solid var(--border-strong); border-radius: var(--radius);
  padding: .66rem .8rem; font-size: .93rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .search-input:focus, .inline-input:focus, .todo-input:focus, .todo-time:focus, .todo-notes:focus {
  border-color: var(--cyan); box-shadow: 0 0 0 3px var(--glow-cyan);
}
input::placeholder, textarea::placeholder { color: var(--text-muted); }
.code-input {
  font-family: var(--font-mono) !important; font-size: 1.7rem !important; letter-spacing: .55em; text-align: center;
  padding: .7rem .5rem .7rem 1.1rem !important; font-weight: 600; color: var(--cyan);
}
.form-error {
  background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .35); color: #fca5a5;
  font-size: .85rem; border-radius: var(--radius); padding: .6rem .8rem;
}

/* ---------- Anmeldung ---------- */

.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero {
  position: relative; overflow: hidden; padding: 2.2rem 3rem; display: flex; flex-direction: column; gap: 2rem;
  border-right: 1px solid var(--border);
  background:
    radial-gradient(ellipse 55% 60% at 15% 10%, rgba(59, 130, 246, .16), transparent 65%),
    radial-gradient(ellipse 45% 50% at 85% 85%, rgba(34, 211, 238, .12), transparent 60%),
    var(--bg-void);
}
.auth-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(148, 178, 220, .13) 1px, transparent 1px);
  background-size: 24px 24px; mask-image: linear-gradient(180deg, #000 30%, transparent 100%);
}
.auth-hero > * { position: relative; }
.auth-hero-copy { margin-top: auto; max-width: 520px; }
.eyebrow { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.auth-hero h1 { font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.05; margin: .8rem 0 1rem; font-weight: 800; }
.accent { color: var(--cyan); }
.lead { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.6; margin: 0; }
.hero-art { max-width: 540px; margin-bottom: auto; }
.hero-art svg { width: 100%; height: auto; }
.hero-cursor { animation: drift 6s ease-in-out infinite; }
.hero-cursor.c2 { animation-duration: 7.5s; animation-direction: reverse; }
@keyframes drift { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-28px, 14px); } }
.auth-foot { color: var(--text-muted); font-size: .8rem; }
.auth-side { display: grid; place-items: center; padding: 2rem 1.25rem; background: var(--bg-base); }
.auth-card {
  width: 100%; max-width: 410px; background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 1.6rem 1.8rem 1.9rem; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .7);
}
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: var(--bg-alt); padding: 4px; border-radius: 8px; margin-bottom: 1.5rem; border: 1px solid var(--border); }
.auth-tabs button { background: none; border: none; padding: .55rem; border-radius: 6px; color: var(--text-secondary); font-weight: 600; font-size: .88rem; }
.auth-tabs button.active { background: var(--bg-raised); color: var(--text-primary); box-shadow: 0 0 0 1px var(--border-strong); }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form h2 { font-size: 1.45rem; }
.auth-form > p.muted { margin: -.6rem 0 .2rem; font-size: .9rem; }
.auth-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: rgba(34, 211, 238, .1); color: var(--cyan); border: 1px solid rgba(34, 211, 238, .3); }
.auth-icon .ic { width: 22px; height: 22px; }
.auth-row { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.auth-form .fine { margin: 0; text-align: center; }
.fatal { height: 100vh; display: grid; place-content: center; gap: 1rem; text-align: center; justify-items: center; }

/* ---------- Brand ---------- */

.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.brand-logo { height: 26px; width: auto; }
.brand-text b { color: var(--cyan); font-weight: 700; }

/* ---------- App-Layout ---------- */

.app { height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: none; display: flex; align-items: center; gap: 1.2rem; padding: 0 .9rem 0 1.1rem;
  border-bottom: 1px solid var(--border); background: rgba(7, 11, 20, .92); backdrop-filter: blur(10px); position: relative; z-index: 20;
}
.tabs { display: flex; gap: 4px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 9px; padding: 3px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex; align-items: center; gap: .45rem; padding: .38rem .8rem; border-radius: 6px;
  border: none; background: none; color: var(--text-secondary); font-weight: 600; font-size: .84rem; white-space: nowrap;
}
.tab .ic { width: 16px; height: 16px; }
.tab:hover { color: var(--text-primary); }
.tab.active { background: var(--bg-raised); color: var(--text-primary); box-shadow: 0 0 0 1px var(--border-strong); }
.tab.active .ic { color: var(--cyan); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.presence { display: flex; align-items: center; gap: .5rem; }
.presence-label { font-family: var(--font-mono); font-size: .7rem; color: var(--success); text-transform: uppercase; letter-spacing: .1em; display: inline-flex; align-items: center; gap: .35rem; }
.presence-label::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 8px var(--success); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { margin-left: -6px; border: 2px solid var(--bg-base); }
.avatar-stack .avatar:first-child { margin-left: 0; }
.avatar {
  display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none;
  color: #05070d; font-weight: 700; background: #334155; user-select: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.more { width: 30px; height: 30px; background: var(--bg-raised); color: var(--text-secondary); font-size: 11px; }
.bell { position: relative; }
.badge {
  position: absolute; top: 2px; right: 1px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: #ef4444; color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg-base);
}
.me-btn { background: none; border: none; padding: 0; border-radius: 50%; display: flex; }
.me-btn:hover .avatar { box-shadow: 0 0 0 2px var(--cyan); }
.conn-banner {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; gap: .6rem; background: #3b2a0b; border: 1px solid #a16207; color: #fde68a;
  padding: .5rem .9rem; border-radius: 8px; font-size: .85rem; box-shadow: var(--shadow);
}
.workspace { flex: 1; display: flex; min-height: 0; position: relative; }
.stage { flex: 1; position: relative; min-width: 0; }

/* ---------- Board ---------- */

.board { position: absolute; inset: 0; overflow: hidden; background: var(--bg-void); }
.board-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; user-select: none; -webkit-user-select: none; }
.board[data-tool="select"] .board-svg { cursor: default; }
.board[data-tool="hand"] .board-svg, .board.panning .board-svg { cursor: grab; }
.board.panning:active .board-svg { cursor: grabbing; }
.board[data-tool="rect"] .board-svg, .board[data-tool="ellipse"] .board-svg, .board[data-tool="diamond"] .board-svg,
.board[data-tool="triangle"] .board-svg, .board[data-tool="sticky"] .board-svg, .board[data-tool="connector"] .board-svg,
.board[data-tool="pen"] .board-svg { cursor: crosshair; }
.board[data-tool="text"] .board-svg { cursor: text; }
.board.dragging .board-svg { cursor: move; }
.board[data-tool="select"] .el { cursor: move; }

.el foreignObject { overflow: visible; pointer-events: none; }
.lbl {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 8px 10px; overflow: hidden; font-family: var(--font-body); line-height: 1.3; pointer-events: none;
}
.lbl .t { max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; outline: none; min-width: 2px; min-height: 1.3em; }
.lbl.a-left { justify-content: flex-start; text-align: left; }
.lbl.a-left .t { width: 100%; }
.lbl-sticky { align-items: flex-start; padding: 16px 18px; }
.lbl-text { align-items: flex-start; padding: 2px; overflow: visible; }
.lbl-text .t { width: 100%; }
.lbl-connector { padding: 0; }
.lbl-connector .t:not(:empty), .el-connector.editing .lbl-connector .t {
  background: var(--bg-panel); padding: 3px 8px; border-radius: 6px; border: 1px solid var(--border-strong);
}
.el.editing .lbl, .el.editing .t { pointer-events: auto; cursor: text; user-select: text; -webkit-user-select: text; }
.el.editing .t { caret-color: var(--cyan); }
.el-text.editing .t, .el-connector.editing .t { box-shadow: 0 0 0 1px rgba(34, 211, 238, .4); border-radius: 3px; }

.sel-box { fill: none; stroke: var(--cyan); pointer-events: none; }
.sel-each { fill: none; stroke: rgba(34, 211, 238, .55); pointer-events: none; }
.marquee { fill: rgba(34, 211, 238, .08); stroke: var(--cyan); pointer-events: none; }
.hover-target { fill: rgba(34, 211, 238, .06); stroke: var(--cyan); stroke-dasharray: 4 3; pointer-events: none; }
.handle { fill: #fff; stroke: var(--cyan); }
.handle-nw, .handle-se { cursor: nwse-resize; }
.handle-ne, .handle-sw { cursor: nesw-resize; }
.handle-n, .handle-s { cursor: ns-resize; }
.handle-e, .handle-w { cursor: ew-resize; }
.handle-end { cursor: grab; fill: var(--cyan); stroke: #fff; }
.knob { cursor: crosshair; opacity: .75; transition: opacity .12s; }
.knob:hover { opacity: 1; }
.knob circle { fill: var(--bg-panel); stroke: var(--cyan); }
.knob path { stroke: var(--cyan); }
.knob:hover circle { fill: var(--cyan); }
.knob:hover path { stroke: #04101a; }

.cursor-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 3; }
.rcursor { position: absolute; left: 0; top: 0; transition: transform 90ms linear; will-change: transform; }
.rcursor svg { display: block; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.rcursor svg path { fill: var(--c); stroke: #05070d; stroke-width: 1.2; stroke-linejoin: round; }
.rcursor-name {
  position: absolute; left: 16px; top: 18px; background: var(--c); color: #05070d; font-size: 11.5px; font-weight: 600;
  padding: 2px 7px; border-radius: 5px; white-space: nowrap; box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}

.board-empty {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); text-align: center; pointer-events: none;
  max-width: 420px; padding: 0 1rem; z-index: 2;
}
.board-empty-title { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; margin-bottom: .4rem; }
.board-empty-text { color: var(--text-secondary); margin-bottom: 1rem; }
.board-empty-keys { display: flex; flex-wrap: wrap; gap: .5rem .9rem; justify-content: center; color: var(--text-muted); font-size: .82rem; }
.board-empty-keys span { display: inline-flex; align-items: center; gap: .35rem; }
kbd {
  font-family: var(--font-mono); font-size: .72rem; min-width: 20px; padding: 1px 5px; border-radius: 4px; text-align: center;
  background: var(--bg-raised); border: 1px solid var(--border-strong); border-bottom-width: 2px; color: var(--text-primary);
}
.board-loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: .7rem; color: var(--text-secondary); z-index: 5; }

.toolbar, .zoombar, .props {
  position: absolute; z-index: 4; background: rgba(12, 18, 32, .94); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .7); backdrop-filter: blur(10px);
}
.toolbar { left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 5px; }
.tool {
  width: 40px; height: 40px; display: grid; place-items: center; border-radius: 8px; border: none; background: none; color: var(--text-secondary);
  transition: background .12s, color .12s;
}
.tool .ic { width: 20px; height: 20px; }
.tool:hover { background: rgba(148, 178, 220, .08); color: var(--text-primary); }
.tool.active { background: var(--cyan); color: #04101a; box-shadow: 0 0 16px -2px var(--glow-cyan); }
.toolbar-sep { width: 1px; height: 22px; background: var(--border-strong); margin: 0 4px; flex: none; }
.zoombar { right: 16px; bottom: 18px; display: flex; align-items: center; gap: 1px; padding: 4px; }
.zoombar .icon-btn { width: 32px; height: 32px; }
.zoombar .icon-btn .ic { width: 16px; height: 16px; }
.zoom-label { background: none; border: none; font-family: var(--font-mono); font-size: .78rem; color: var(--text-secondary); min-width: 50px; padding: .3rem; border-radius: 6px; }
.zoom-label:hover { color: var(--text-primary); background: rgba(148, 178, 220, .08); }

.props { right: 16px; top: 16px; width: 236px; padding: .7rem; display: flex; flex-direction: column; gap: .8rem; max-height: calc(100% - 100px); overflow-y: auto; }
.props-title { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: .45rem; }
.props-sec { display: flex; flex-direction: column; }
.props-sec > * + * { margin-top: .45rem; }
.swatches { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.swatch {
  aspect-ratio: 1; border-radius: 6px; border: 1px solid rgba(255, 255, 255, .14); padding: 0; position: relative;
  transition: transform .1s;
}
.swatch:hover { transform: scale(1.08); }
.swatch.active { box-shadow: 0 0 0 2px var(--bg-panel), 0 0 0 4px var(--cyan); }
.swatch-none { background: linear-gradient(135deg, transparent 45%, var(--danger) 45% 55%, transparent 55%), var(--bg-alt) !important; }
.seg { display: flex; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 7px; padding: 2px; gap: 2px; flex: 1; }
.seg-row { display: flex; gap: 6px; }
.seg-btn {
  flex: 1; border: none; background: none; color: var(--text-secondary); padding: .32rem .2rem; border-radius: 5px; font-size: .78rem; font-weight: 600;
  display: grid; place-items: center; min-height: 28px;
}
.seg-btn .ic { width: 16px; height: 16px; }
.seg-btn:hover { color: var(--text-primary); }
.seg-btn.active { background: var(--bg-raised); color: var(--cyan); box-shadow: 0 0 0 1px var(--border-strong); }
.seg-btn.solo { flex: none; width: 36px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 7px; }
.seg-btn.solo.active { border-color: rgba(34, 211, 238, .5); }
.props-actions { display: flex; justify-content: space-between; border-top: 1px solid var(--border); padding-top: .6rem; }

/* ---------- Seitenleiste ---------- */

.side {
  width: 320px; flex: none; border-right: 1px solid var(--border); background: var(--bg-base); display: flex; flex-direction: column; min-height: 0;
  transition: width .2s var(--ease); position: relative; z-index: 6;
}
.side.collapsed { width: 52px; }
.side.collapsed > :not(.side-rail) { display: none; }
.side:not(.collapsed) .side-rail { display: none; }
.side-rail { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0; }
.side-rail .live { color: var(--success); background: rgba(74, 222, 128, .1); }
.side-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 14px 12px 8px 16px; gap: .5rem; }
.side-kicker { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--cyan); }
.side-team-name { font-family: var(--font-head); font-weight: 700; font-size: 1.12rem; overflow-wrap: anywhere; }
.side-members { display: flex; align-items: center; padding: 0 16px 12px; border-bottom: 1px solid var(--border); }
.side-members .avatar { margin-right: -5px; border: 2px solid var(--bg-base); }
.side-members-count { margin-left: 14px; color: var(--text-muted); font-size: .8rem; }
.side-scroll { overflow-y: auto; flex: 1; min-height: 0; }
.side-sec { padding: 14px 14px 16px; border-bottom: 1px solid var(--border); }
.side-sec-title { display: flex; align-items: center; gap: .5rem; font-family: var(--font-mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-secondary); margin-bottom: .8rem; }
.side-sec-title .ic { width: 15px; height: 15px; color: var(--cyan); }

.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .4rem; }
.cal-head .icon-btn { width: 28px; height: 28px; }
.cal-head .icon-btn .ic { width: 15px; height: 15px; }
.cal-title { background: none; border: none; font-family: var(--font-head); font-weight: 700; font-size: .98rem; padding: .2rem .5rem; border-radius: 6px; }
.cal-title:hover { background: rgba(148, 178, 220, .08); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: .68rem; color: var(--text-muted); padding: .25rem 0; font-weight: 600; }
.cal-day {
  aspect-ratio: 1; background: none; border: 1px solid transparent; border-radius: 7px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: .8rem; color: var(--text-primary); padding: 0; position: relative;
}
.cal-day:hover { background: rgba(148, 178, 220, .07); }
.cal-day.out { color: var(--text-muted); opacity: .55; }
.cal-day.today .cal-num { color: var(--cyan); font-weight: 700; }
.cal-day.today { border-color: rgba(34, 211, 238, .35); }
.cal-day.sel { background: var(--cyan); border-color: var(--cyan); }
.cal-day.sel .cal-num { color: #04101a; font-weight: 700; }
.cal-dots { display: flex; gap: 2px; height: 5px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal-dots i.done { opacity: .35; }
.cal-day.sel .cal-dots i { box-shadow: 0 0 0 1px #04101a; }

.day { margin-top: .9rem; }
.day-head { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; margin-bottom: .5rem; }
.day-count { font-size: .75rem; color: var(--text-muted); font-weight: 500; }
.todo-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: .6rem; }
.todo-empty { color: var(--text-muted); font-size: .84rem; padding: .5rem 0; }
.todo { display: flex; align-items: center; gap: .55rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 8px; padding: .4rem .35rem .4rem .55rem; }
.todo:hover { border-color: var(--border-strong); }
.todo-check {
  width: 20px; height: 20px; flex: none; border-radius: 6px; border: 2px solid var(--c); background: none; padding: 0; display: grid; place-items: center; color: transparent;
}
.todo-check .ic { width: 13px; height: 13px; }
.todo-check.on { background: var(--c); color: #04101a; }
.todo-main { flex: 1; min-width: 0; background: none; border: none; text-align: left; padding: 0; display: flex; flex-direction: column; }
.todo-title { overflow-wrap: anywhere; font-size: .88rem; }
.todo.done .todo-title { text-decoration: line-through; color: var(--text-muted); }
.todo-meta { display: flex; gap: .4rem; align-items: center; color: var(--text-muted); font-size: .72rem; }
.todo-chip { font-family: var(--font-mono); color: var(--text-secondary); }
.todo-del { width: 28px; height: 28px; opacity: 0; }
.todo-del .ic { width: 15px; height: 15px; }
.todo:hover .todo-del { opacity: 1; }
.todo-del:hover { color: var(--danger); }
.todo-edit { flex-direction: column; align-items: stretch; gap: .45rem; padding: .55rem; border-color: rgba(34, 211, 238, .4); }
.todo-add { display: flex; flex-direction: column; gap: .45rem; }
.todo-add-row { display: flex; gap: .4rem; align-items: center; }
.todo-add-row.end { justify-content: flex-end; }
.todo-input { padding: .55rem .7rem; font-size: .86rem; }
.todo-time { padding: .4rem .5rem; font-size: .8rem; width: auto; flex: 1; min-width: 0; color-scheme: dark; }
.todo-notes { min-height: 60px; resize: vertical; font-size: .84rem; padding: .5rem .7rem; }
.todo-add > .btn { width: 100%; }
.todo-add .todo-time { flex: 0 0 104px; }
.color-pick { display: flex; gap: 4px; flex: none; }
.color-dot { width: 16px; height: 16px; border-radius: 50%; border: none; padding: 0; opacity: .55; }
.color-dot.active { opacity: 1; box-shadow: 0 0 0 2px var(--bg-base), 0 0 0 3.5px currentColor; color: var(--text-primary); }
.todo-add .todo-add-row .color-pick { flex: 1; justify-content: flex-end; }

.vc { background: var(--bg-alt); border: 1px solid var(--border); border-radius: 10px; padding: .7rem; display: flex; flex-direction: column; gap: .6rem; }
.vc.joined { border-color: rgba(74, 222, 128, .45); box-shadow: 0 0 0 3px rgba(74, 222, 128, .08); }
.vc-head { display: flex; align-items: center; gap: .5rem; }
.vc-head .ic { color: var(--text-secondary); }
.vc.joined .vc-head .ic { color: var(--success); }
.vc-name { font-weight: 600; flex: 1; }
.vc-count { font-size: .75rem; color: var(--text-muted); }
.vc-list { display: flex; flex-direction: column; gap: 2px; }
.vc-user { display: flex; align-items: center; gap: .55rem; padding: .3rem .35rem; border-radius: 7px; }
.vc-user .vc-av { transition: box-shadow .12s; }
.vc-user.speaking .vc-av { box-shadow: 0 0 0 2px var(--bg-alt), 0 0 0 4px var(--success); }
.vc-uname { flex: 1; font-size: .86rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-state { font-size: .7rem; color: #fbbf24; }
.vc-muted { color: var(--danger); width: 16px; height: 16px; }
.vc-controls { display: flex; gap: 6px; }
.vc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; height: 36px; min-width: 40px; padding: 0 .7rem;
  border-radius: 8px; border: 1px solid var(--border-strong); background: var(--bg-raised); color: var(--text-primary); font-weight: 600; font-size: .82rem;
}
.vc-btn .ic { width: 17px; height: 17px; }
.vc-btn:hover { border-color: var(--cyan); }
.vc-btn.off { background: rgba(248, 113, 113, .14); border-color: rgba(248, 113, 113, .5); color: var(--danger); }
.vc-btn.leave { margin-left: auto; background: #dc2626; border-color: #dc2626; color: #fff; }
.vc-btn.leave:hover { filter: brightness(1.1); }

/* ---------- Popover, Menü, Benachrichtigungen ---------- */

.popover {
  position: fixed; z-index: 60; background: var(--bg-panel); border-radius: 12px; box-shadow: var(--shadow), 0 0 0 1px var(--border-strong);
  min-width: 260px; max-width: 360px; opacity: 0; transform: translateY(-4px); transition: opacity .14s, transform .14s var(--ease);
}
.popover.in { opacity: 1; transform: none; }
.pop-title { font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); padding: .8rem .95rem .45rem; }
.notif { width: 340px; max-width: calc(100vw - 16px); padding-bottom: .35rem; }
.notif-empty { display: flex; align-items: center; gap: .6rem; color: var(--text-muted); padding: .7rem .95rem 1rem; }
.notif-item { display: flex; gap: .7rem; padding: .7rem .95rem; border-top: 1px solid var(--border); }
.notif-body { flex: 1; font-size: .87rem; }
.notif-time { color: var(--text-muted); font-size: .74rem; margin: .15rem 0 .55rem; }
.notif-actions { display: flex; gap: .45rem; }
.menu { padding: .4rem; min-width: 240px; }
.menu-user { display: flex; gap: .7rem; align-items: center; padding: .55rem .55rem .75rem; border-bottom: 1px solid var(--border); margin-bottom: .3rem; }
.menu-user > div { display: flex; flex-direction: column; min-width: 0; }
.menu-user span { color: var(--text-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.menu-item { width: 100%; display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border-radius: 7px; border: none; background: none; text-align: left; color: var(--text-primary); }
.menu-item:hover { background: rgba(148, 178, 220, .08); }
.menu-item .ic { color: var(--text-secondary); }

/* ---------- Toasts ---------- */

.toasts { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: .5rem; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  pointer-events: auto; max-width: 380px; background: var(--bg-raised); border: 1px solid var(--border-strong); border-left: 3px solid var(--cyan);
  padding: .7rem .9rem; border-radius: 8px; box-shadow: var(--shadow); font-size: .87rem; opacity: 0; transform: translateY(-8px);
  transition: opacity .2s, transform .25s var(--ease);
}
.toast.in { opacity: 1; transform: none; }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-action { margin-left: .6rem; background: none; border: none; color: var(--cyan); font-weight: 600; padding: 0; }
body.is-auth .toasts { top: 16px; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(2, 4, 9, .72); backdrop-filter: blur(4px);
  display: grid; place-items: center; padding: 1rem; opacity: 0; transition: opacity .18s;
}
.modal-backdrop.in { opacity: 1; }
.modal {
  width: 100%; max-width: 440px; max-height: calc(100vh - 2rem); overflow: auto; background: var(--bg-panel); border-radius: 14px;
  box-shadow: var(--shadow), 0 0 0 1px var(--border-strong); transform: translateY(8px) scale(.98); transition: transform .22s var(--ease);
}
.modal-backdrop.in .modal { transform: none; }
.modal-wide { max-width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.2rem 1.3rem .4rem; }
.modal-head h2 { font-size: 1.25rem; }
.modal-sub { color: var(--text-secondary); margin: .3rem 0 0; font-size: .87rem; }
.modal-body { padding: .8rem 1.3rem 1.3rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: 1.2rem; }

.invite-target { display: flex; align-items: center; gap: .55rem; background: rgba(34, 211, 238, .07); border: 1px solid rgba(34, 211, 238, .25); border-radius: 8px; padding: .55rem .75rem; font-size: .86rem; margin-bottom: .9rem; color: var(--text-secondary); }
.invite-target .ic { color: var(--cyan); }
.invite-target b { color: var(--text-primary); }
.search-results { margin-top: .6rem; display: flex; flex-direction: column; gap: 4px; min-height: 60px; }
.search-hint { color: var(--text-muted); font-size: .84rem; padding: .6rem .2rem; }
.person { display: flex; align-items: center; gap: .75rem; padding: .5rem .55rem; border-radius: 9px; }
.person:hover { background: rgba(148, 178, 220, .05); }
.person-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.person-text span { color: var(--text-muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; }
.pill { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; padding: .2rem .5rem; border-radius: 99px; background: rgba(124, 108, 240, .16); color: #b4abff; border: 1px solid rgba(124, 108, 240, .35); }
.divider { height: 1px; background: var(--border); margin: 1.1rem 0; }
.members-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; flex-wrap: wrap; }
.members-head h3 { font-size: 1rem; }
.rename { display: flex; gap: .4rem; }
.inline-input { padding: .4rem .6rem; font-size: .85rem; width: 200px; }

.settings { display: grid; grid-template-columns: 170px 1fr; min-height: 380px; border-top: 1px solid var(--border); margin-top: .6rem; }
.settings-nav { display: flex; flex-direction: column; gap: 2px; padding: .8rem .5rem; border-right: 1px solid var(--border); }
.settings-tab { display: flex; align-items: center; gap: .55rem; padding: .55rem .65rem; border-radius: 7px; border: none; background: none; text-align: left; color: var(--text-secondary); font-weight: 500; font-size: .87rem; }
.settings-tab .ic { width: 16px; height: 16px; }
.settings-tab:hover { color: var(--text-primary); background: rgba(148, 178, 220, .06); }
.settings-tab.active { background: var(--bg-raised); color: var(--text-primary); box-shadow: 0 0 0 1px var(--border-strong); }
.settings-pane { padding: 1.1rem 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .9rem; min-width: 0; }
.settings-pane h3 { font-size: 1.05rem; }
.settings-pane > p { margin: 0; }
.settings-form { display: flex; flex-direction: column; gap: .9rem; align-items: flex-start; }
.settings-form .field { width: 100%; }
.pic-row { display: flex; align-items: center; gap: 1.1rem; }
.pic .avatar { box-shadow: 0 0 0 3px var(--bg-panel), 0 0 0 4px var(--border-strong); }
.pic-actions { display: flex; flex-direction: column; gap: .5rem; }
.row-gap { display: flex; gap: .5rem; flex-wrap: wrap; }
.danger-box { background: rgba(248, 113, 113, .07); border: 1px solid rgba(248, 113, 113, .3); border-radius: 9px; padding: .3rem .9rem; font-size: .86rem; color: var(--text-secondary); }

/* ---------- Projekte ---------- */

.tool-project { width: auto; padding: 0 .75rem 0 .6rem; gap: .4rem; display: inline-flex; align-items: center; color: var(--text-primary); font-weight: 600; font-size: .82rem; }
.tool-project .ic { color: var(--cyan); }
.tool-label { white-space: nowrap; }
.popover-top { transform: translateY(4px); }
.project-menu { width: 300px; }
.project-menu .pop-title { padding: .5rem .5rem .35rem; }
.menu-item-2 { align-items: flex-start; padding: .6rem; }
.menu-ic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: rgba(34, 211, 238, .1); color: var(--cyan); border: 1px solid rgba(34, 211, 238, .25); flex: none; }
.menu-item-2:nth-of-type(2) .menu-ic { background: rgba(251, 146, 60, .1); color: #fb923c; border-color: rgba(251, 146, 60, .3); }
.menu-ic .ic { color: inherit !important; }
.menu-texts { display: flex; flex-direction: column; gap: 1px; }
.menu-texts span { color: var(--text-muted); font-size: .78rem; }
.menu-hint { color: var(--text-muted); font-size: .76rem; padding: .55rem .6rem .35rem; border-top: 1px solid var(--border); margin-top: .3rem; line-height: 1.45; }

.drop-hint { position: absolute; inset: 10px; z-index: 30; border: 2px dashed var(--cyan); border-radius: 14px; background: rgba(34, 211, 238, .06); display: grid; place-items: center; pointer-events: none; }
.drop-hint-box { display: flex; flex-direction: column; align-items: center; gap: .35rem; background: var(--bg-panel); padding: 1.2rem 1.6rem; border-radius: 12px; box-shadow: var(--shadow); }
.drop-hint-box .ic { width: 30px; height: 30px; color: var(--cyan); }
.drop-hint-box span { color: var(--text-secondary); font-size: .85rem; }

.pcard { width: 100%; height: 100%; padding: 14px 14px 12px; display: flex; flex-direction: column; justify-content: space-between; font-family: var(--font-body); color: var(--text-primary); pointer-events: none; }
.pcard-top { display: flex; gap: 11px; align-items: flex-start; min-width: 0; }
.pcard-ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; flex: none; background: rgba(34, 211, 238, .12); color: var(--cyan); border: 1px solid rgba(34, 211, 238, .3); }
.pcard-html .pcard-ic { background: rgba(251, 146, 60, .12); color: #fb923c; border-color: rgba(251, 146, 60, .35); }
.pcard-ic .ic { width: 21px; height: 21px; }
.pcard-text { min-width: 0; flex: 1; }
.pcard-name { font-weight: 600; font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard-meta { color: var(--text-secondary); font-size: 12.5px; margin-top: 2px; }
.pcard-bottom { display: flex; gap: 6px; align-items: center; }
.pcard-btn {
  pointer-events: auto; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 11px;
  border-radius: 7px; border: 1px solid var(--cyan); background: var(--cyan); color: #04101a; font: 600 12.5px var(--font-body);
}
.pcard-btn .ic { width: 15px; height: 15px; }
.pcard-btn.ghost { background: transparent; color: var(--text-primary); border-color: var(--border-strong); }
.pcard-btn:hover { filter: brightness(1.1); }
.pcard-btn.ghost:hover { border-color: var(--cyan); }
.pbar { flex: 1; height: 6px; border-radius: 3px; background: var(--bg-alt); overflow: hidden; }
.pbar i { display: block; height: 100%; background: var(--cyan); border-radius: 3px; transition: width .3s; }
.pcard-pct { font: 500 12px var(--font-mono); color: var(--text-secondary); min-width: 40px; text-align: right; }
.pcard-err { color: var(--danger); font-size: 12.5px; font-weight: 600; }
.props-proj { display: flex; flex-direction: column; gap: 2px; }
.props-proj b { overflow-wrap: anywhere; }
.props-proj span { color: var(--text-muted); font-size: .8rem; }
.props-btns { display: flex; flex-direction: column; gap: 6px; }

.viewer {
  position: absolute; inset: 10px; z-index: 25; display: flex; flex-direction: column; background: var(--bg-panel);
  border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .8); overflow: hidden;
  opacity: 0; transform: scale(.985); transition: opacity .16s, transform .2s var(--ease);
}
.viewer.in { opacity: 1; transform: none; }
.viewer-head { display: flex; align-items: center; gap: .7rem; padding: .55rem .6rem .55rem .8rem; border-bottom: 1px solid var(--border); background: var(--bg-base); }
.viewer-ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: rgba(34, 211, 238, .12); color: var(--cyan); flex: none; }
.viewer-ic.html { background: rgba(251, 146, 60, .12); color: #fb923c; }
.viewer-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.viewer-title b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-path { font: 12px var(--font-mono); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; align-items: center; gap: 4px; }
.viewer-actions .icon-btn.active { color: var(--cyan); }
.viewer-dev { flex: none; margin-right: 6px; }
.viewer-dev .seg-btn { width: 36px; }
.viewer-body { flex: 1; display: flex; min-height: 0; }
.viewer-tree { width: 250px; flex: none; border-right: 1px solid var(--border); overflow: auto; padding: .4rem .35rem; background: var(--bg-base); }
.tree-head { font: 11px var(--font-mono); color: var(--text-muted); padding: .35rem .5rem .55rem; }
.tree-row { width: 100%; display: flex; align-items: center; gap: .45rem; padding: .3rem .5rem; border: none; background: none; border-radius: 6px; text-align: left; color: var(--text-secondary); font-size: .84rem; }
.tree-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-row .ic { width: 16px; height: 16px; }
.tree-row:hover { background: rgba(148, 178, 220, .07); color: var(--text-primary); }
.tree-row.dir { color: var(--text-primary); }
.tree-row.dir .ic { color: var(--cyan); }
.tree-row.html .ic { color: #fb923c; }
.tree-row.active { background: rgba(34, 211, 238, .12); color: var(--text-primary); }
.viewer-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg-void); }
.viewer-stage { flex: 1; min-height: 0; display: flex; justify-content: center; overflow: auto; }
.viewer-stage.center { align-items: center; padding: 1.5rem; }
.viewer-stage.checker { background: repeating-conic-gradient(#0c1220 0% 25%, #0a0f1c 0% 50%) 0 0 / 20px 20px; }
.viewer-frame { height: 100%; width: 100%; transition: width .25s var(--ease); background: #fff; }
.viewer-frame.framed { margin: 14px 0; height: calc(100% - 28px); border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 1px var(--border-strong), 0 20px 50px -15px rgba(0, 0, 0, .8); }
.viewer-frame iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.viewer-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.viewer-code { margin: 0; padding: 1rem 1.2rem; width: 100%; font: 12.5px/1.6 var(--font-mono); color: var(--text-primary); white-space: pre; tab-size: 2; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem .8rem; border-top: 1px solid var(--border); font: 12px var(--font-mono); color: var(--text-muted); }
.viewer-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .45rem; color: var(--text-secondary); text-align: center; padding: 2rem; }
.viewer-empty > .ic { width: 40px; height: 40px; color: var(--cyan); margin-bottom: .3rem; }

/* ---------- Responsiv ---------- */

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-hero { border-right: none; border-bottom: 1px solid var(--border); padding: 1.4rem 1.25rem 1.6rem; gap: 1rem; }
  .hero-art, .auth-foot { display: none; }
  .auth-hero-copy { margin-top: .5rem; }
  .auth-hero h1 { font-size: 1.9rem; }
  .side { position: absolute; left: 0; top: 0; bottom: 0; box-shadow: 20px 0 40px -20px rgba(0, 0, 0, .7); }
  .side.collapsed { position: relative; box-shadow: none; }
  .hide-sm { display: none; }
  .topbar { gap: .6rem; }
  .brand-text { display: none; }
  .props { top: auto; bottom: 76px; right: 8px; width: 210px; max-height: 45%; }
  .settings { grid-template-columns: 1fr; }
  .settings-nav { flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid var(--border); }
}
@media (max-width: 560px) {
  .toolbar { left: 8px; right: 8px; transform: none; overflow-x: auto; justify-content: flex-start; bottom: 64px; }
  .zoombar { right: 8px; bottom: 10px; }
  .tool { width: 36px; height: 36px; flex: none; }
  .tool-project { width: auto; }
  .viewer-tree { width: 180px; }
}
