:root { --bg:#0f1720; --panel:#17212c; --line:#253242; --text:#e6edf3; --muted:#8b9bb0; --accent:#2f81f7; --err:#f85149; }
* { box-sizing: border-box; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--text); font-family: "Segoe UI", system-ui, sans-serif; }
a { color: inherit; }
.bbt-shell { min-height:100%; display:flex; flex-direction:column; }
.bbt-header { height:44px; display:flex; align-items:center; justify-content:space-between; padding:0 16px; background:var(--panel); border-bottom:1px solid var(--line); }
.bbt-brand { font-weight:700; text-decoration:none; font-size:18px; }
.bbt-brand span { color:var(--accent); }
.bbt-brandbox { display:flex; align-items:baseline; gap:8px; min-width:0; }
.bbt-copyright { font-size:11px; color:var(--muted); opacity:.8; white-space:nowrap; }
@media (max-width: 420px) { .bbt-copyright { display:none; } }
.bbt-user { display:flex; gap:12px; align-items:center; color:var(--muted); }
.bbt-user form { margin:0; }
.bbt-main { flex:1; padding:24px; }
h1 { font-size:22px; margin:0 0 12px; }
.bbt-muted { color:var(--muted); font-size:14px; }
.bbt-login { max-width:380px; margin:48px auto; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:28px; display:flex; flex-direction:column; gap:12px; }
.bbt-login form { display:flex; flex-direction:column; gap:12px; }
.bbt-login label { display:flex; flex-direction:column; gap:4px; font-size:14px; color:var(--muted); }
input { background:#0b121a; border:1px solid var(--line); color:var(--text); border-radius:6px; padding:9px 10px; font-size:15px; }
input:focus { outline:2px solid var(--accent); border-color:transparent; }
.bbt-btn { background:var(--accent); color:#fff; border:0; border-radius:6px; padding:9px 16px; font-size:15px; cursor:pointer; }
.bbt-btn:disabled { opacity:.6; cursor:wait; }
.bbt-btn-ghost { background:transparent; border:1px solid var(--line); color:var(--text); padding:5px 12px; font-size:13px; }
.bbt-alert, .validation-message, .bbt-error { color:var(--err); font-size:14px; }
.bbt-status { min-height:20px; font-size:14px; color:var(--muted); }
.bbt-search { width:100%; max-width:360px; margin-bottom:16px; }
.bbt-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(240px, 1fr)); gap:14px; }
.bbt-card { display:flex; flex-direction:column; gap:6px; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:16px; text-decoration:none; transition:border-color .15s; }
.bbt-card:hover { border-color:var(--accent); }
.bbt-card-title { font-weight:600; font-size:16px; }
.bbt-card-host { font-family:Consolas, monospace; font-size:13px; color:var(--muted); }
.bbt-card-action { margin-top:auto; color:var(--accent); font-size:14px; }
/* session page: canvas uses the full window */
.bbt-session { position:fixed; inset:44px 0 0 0; background:#000; }
.bbt-session .bbt-connect { position:relative; top:24px; }
.bbt-toolbar { position:fixed; top:0; right:220px; height:44px; display:flex; align-items:center; gap:8px; z-index:5; }
.bbt-toolbar #bbt-title { color:var(--muted); margin-right:8px; }
.bbt-screen { position:absolute; inset:0; display:flex; align-items:flex-start; justify-content:flex-start; overflow:auto; background:#000; }
/* 1 remote pixel = 1 device pixel (CSS size = backing size / devicePixelRatio, set by bbterminal.js); never smoothed */
#bbt-canvas { display:block; flex:none; outline:none; cursor:default; image-rendering:crisp-edges; image-rendering:pixelated; }
[hidden] { display:none !important; }
#blazor-error-ui { background:#5c1b1b; bottom:0; display:none; left:0; padding:.6rem 1.25rem .7rem 1.25rem; position:fixed; width:100%; z-index:1000; }
#blazor-error-ui .dismiss { cursor:pointer; position:absolute; right:.75rem; top:.5rem; }
/* ---- stage 2: navigation, recovery banner, tiles, admin ---- */
.bbt-recovery { background:#7a1f1f; color:#fff; padding:10px 16px; font-weight:600; border-bottom:2px solid var(--err); }
.bbt-nav { display:flex; gap:4px; margin-left:24px; flex:1; }
.bbt-nav a { text-decoration:none; color:var(--muted); padding:6px 12px; border-radius:6px; font-size:14px; }
.bbt-nav a.active, .bbt-nav a:hover { color:var(--text); background:#0b121a; }
.bbt-tiles { display:grid; grid-template-columns:repeat(auto-fill, minmax(200px, 1fr)); gap:16px; }
.bbt-tile { display:flex; flex-direction:column; align-items:center; text-align:center; gap:8px; background:var(--panel); border:1px solid var(--line); border-radius:12px; padding:20px 14px; text-decoration:none; transition:border-color .15s, transform .15s; }
.bbt-tile:hover { border-color:var(--accent); transform:translateY(-2px); }
.bbt-tile-logo { width:96px; height:96px; display:flex; align-items:center; justify-content:center; font-size:56px; }
.bbt-tile-logo img { max-width:100%; max-height:100%; object-fit:contain; }
.bbt-tile-logo.small { width:64px; height:64px; font-size:36px; }
.bbt-tile-logo.tiny { width:32px; height:32px; font-size:20px; }
.bbt-tile-title { font-weight:600; font-size:16px; }
.bbt-tile-desc { color:var(--muted); font-size:13px; }
.bbt-tile-tags { display:flex; gap:6px; flex-wrap:wrap; justify-content:center; }
.bbt-tag { font-size:11px; padding:2px 8px; border-radius:10px; background:#0b121a; border:1px solid var(--line); color:var(--muted); }
.bbt-tag-ok { color:#3fb950; border-color:#2a5a35; }
.bbt-tabs { display:flex; gap:4px; border-bottom:1px solid var(--line); margin-bottom:16px; }
.bbt-tabs button { background:transparent; color:var(--muted); border:0; border-bottom:2px solid transparent; padding:8px 14px; font-size:14px; cursor:pointer; }
.bbt-tabs button.active { color:var(--text); border-bottom-color:var(--accent); }
.bbt-info { color:#3fb950; font-size:14px; margin-bottom:10px; }
.bbt-editor { background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:20px; max-width:900px; }
.bbt-editor h2 { font-size:18px; margin:0 0 14px; }
.bbt-editor h3 { font-size:15px; margin:22px 0 8px; }
.bbt-form-grid { display:grid; grid-template-columns:1fr 1fr; gap:12px 18px; }
.bbt-form-grid label { display:flex; flex-direction:column; gap:4px; font-size:13px; color:var(--muted); }
.bbt-form-grid .bbt-check { flex-direction:row; align-items:center; gap:8px; }
.bbt-span2 { grid-column:span 2; }
.bbt-logo-row { display:flex; align-items:center; gap:14px; }
.bbt-actions { display:flex; gap:8px; margin:14px 0; }
.bbt-table { width:100%; border-collapse:collapse; font-size:14px; }
.bbt-table th { text-align:left; color:var(--muted); font-weight:500; border-bottom:1px solid var(--line); padding:8px; }
.bbt-table td { border-bottom:1px solid var(--line); padding:8px; vertical-align:middle; }
.bbt-table tr.bbt-disabled td { opacity:.5; }
.bbt-row-actions { white-space:nowrap; text-align:right; }
.bbt-danger { color:var(--err) !important; }
select, textarea { background:#0b121a; border:1px solid var(--line); color:var(--text); border-radius:6px; padding:8px 10px; font-size:14px; font-family:inherit; }
input[type=checkbox] { width:16px; height:16px; }
.bbt-clip { position:fixed; top:52px; right:16px; width:380px; z-index:6; background:var(--panel); border:1px solid var(--line); border-radius:10px; padding:12px; display:flex; flex-direction:column; gap:8px; box-shadow:0 8px 24px rgba(0,0,0,.5); }
.bbt-clip textarea { width:100%; height:140px; resize:vertical; }
.bbt-clip-actions { display:flex; gap:8px; justify-content:flex-end; }
/* ---- sharing / watching ---- */
.bbt-watch-indicator { border-color:var(--err) !important; color:#fff !important; background:#7a1f1f !important; animation:bbt-pulse 1.6s ease-in-out infinite; }
@keyframes bbt-pulse { 50% { box-shadow:0 0 0 4px rgba(248,81,73,.35); } }
.bbt-is-watched .bbt-screen { box-shadow:inset 0 0 0 3px var(--err); }
.bbt-share { width:440px; }
.bbt-share input { width:100%; font-family:Consolas, monospace; font-size:12px; }
.bbt-viewer-list { display:flex; flex-direction:column; gap:6px; }
.bbt-viewer { display:flex; gap:8px; align-items:center; justify-content:space-between; font-size:13px; }
.bbt-viewer span { flex:1; }
.bbt-watching #bbt-canvas { max-width:100%; height:auto !important; }
/* VNC desktop larger than the window (fixed Mac resolution): fit into the window, smooth scaling */
.bbt-fit #bbt-canvas { width:auto !important; height:auto !important; max-width:100%; max-height:100%; image-rendering:auto; } /* watchers: only scaled down if their window is smaller */
.bbt-watching .bbt-toolbar { left:auto; }
.bbt-audit td { font-size:12px; font-family:Consolas, monospace; }
body:has(#bbt-session) .bbt-nav { display:none; }
.bbt-warn { display:block; color:#f0b429; font-size:12px; margin-top:4px; }
/* built-in icons */
.bbt-icon { width:100%; height:100%; color:var(--text); }
.bbt-tile-logo .bbt-icon { width:80%; height:80%; }
.bbt-icon-picker { display:grid; grid-template-columns:repeat(auto-fill, minmax(92px, 1fr)); gap:8px; margin-top:6px; }
.bbt-icon-choice { display:flex; flex-direction:column; align-items:center; gap:4px; padding:8px 4px; background:transparent; border:1px solid rgba(255,255,255,.12); border-radius:8px; color:inherit; cursor:pointer; }
.bbt-icon-choice svg, .bbt-icon-choice span { width:40px; height:40px; font-size:30px; line-height:40px; }
.bbt-icon-choice small { font-size:11px; text-align:center; line-height:1.2; opacity:.85; }
.bbt-icon-choice:hover { border-color:rgba(255,255,255,.35); }
.bbt-icon-choice.selected { border-color:#3b82f6; background:rgba(59,130,246,.15); }
.bbt-check-inline { display:inline-flex; align-items:center; gap:4px; cursor:pointer; }
.bbt-check-inline input { margin:0; }
.bbt-keys-wrap { position:relative; display:inline-block; }
.bbt-keys { position:absolute; top:calc(100% + 4px); right:0; z-index:50; display:flex; flex-direction:column; gap:2px; min-width:250px;
  background:var(--panel, #1c2430); border:1px solid var(--border, #33404f); border-radius:8px; padding:6px; box-shadow:0 8px 24px rgba(0,0,0,.4); }
.bbt-keys .bbt-btn { text-align:left; justify-content:flex-start; }
.bbt-keys-hint { font-size:11px; padding:4px 6px 0; max-width:240px; }
#bbt-session[data-protocol=vnc] .bbt-keys [data-proto=rdp], #bbt-session:not([data-protocol=vnc]) .bbt-keys [data-proto=vnc] { display:none; }

/* ---- Login: Hintergrundbild (nur Anmeldeseite) ---- */
/* eigenes fixiertes Element statt background-attachment:fixed (funktioniert auch auf iOS/Android) */
.bbt-login-bg { position:fixed; inset:0; z-index:0; pointer-events:none;
  background:
    radial-gradient(ellipse at center, rgba(6,12,22,.15) 0%, rgba(6,12,22,.55) 70%, rgba(6,12,22,.75) 100%),
    url("img/login-bg.jpg") center center / cover no-repeat, var(--bg); }
.bbt-login-page { position:relative; min-height:calc(100vh - 44px); min-height:calc(100dvh - 44px); display:flex; align-items:center; justify-content:center; padding:24px 16px; box-sizing:border-box; }
.bbt-login-page .bbt-login { position:relative; z-index:1; width:100%; margin:0 auto; box-sizing:border-box;
  background:rgba(15,23,32,.72); border:1px solid rgba(255,255,255,.12); box-shadow:0 12px 40px rgba(0,0,0,.55);
  -webkit-backdrop-filter:blur(12px) saturate(120%); backdrop-filter:blur(12px) saturate(120%); }
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) { .bbt-login-page .bbt-login { background:rgba(15,23,32,.92); } }
.bbt-login-page .bbt-login input { background:rgba(10,16,24,.75); }
body:has(.bbt-login-page) .bbt-header { position:relative; z-index:2; background:rgba(15,23,32,.7); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px); }
body:has(.bbt-login-page) .bbt-recovery { position:relative; z-index:2; }
body:has(.bbt-login-page) .bbt-main { padding:0; }
@media (max-width:480px) { .bbt-login-page { align-items:flex-start; padding:20px 12px; } .bbt-login-page .bbt-login { padding:20px; } }
