:root { --bg:#0b0b0b; --glass:rgba(255,255,255,.035); --line:rgba(255,255,255,.08); --line-strong:rgba(255,255,255,.16);
  --orange:#ff6a00; --orange-2:#ff9a3d; --orange-dim:rgba(255,106,0,.35); --orange-soft:rgba(255,106,0,.10);
  --text:#ededed; --muted:#8a8580; --white:#fff; --red:#ff4d4d; --green:#4ade80; --side: 224px; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 15px/1.45 "Segoe UI", system-ui, sans-serif; }
body { background: radial-gradient(1200px 600px at 50% -200px, rgba(255,106,0,.12), transparent 60%), var(--bg); }
.hidden { display: none !important; }
h1 { font: 600 22px "Segoe UI", sans-serif; letter-spacing: .04em; margin: 0 0 12px; color: var(--white); }
h3 { margin: 0 0 8px; font-size: 14px; color: var(--orange-2); letter-spacing: .04em; text-transform: uppercase; }
.head { display: flex; align-items: center; gap: 12px; }
.head h1 { flex: 1; }
.hint { color: var(--muted); font-size: 13px; }
.mini { font: 500 10px "Consolas", monospace; letter-spacing: .15em; color: var(--muted); text-transform: uppercase; }
.brand { display: flex; align-items: center; gap: 8px; font: 700 15px "Segoe UI", sans-serif; letter-spacing: .18em; }
.brand b { color: var(--orange); }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 14px var(--orange); }
.btn { background: transparent; color: var(--text); border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 14px; font: inherit; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--orange); }
.btn.primary { background: linear-gradient(180deg, var(--orange-2), var(--orange)); color: #0b0b0b; border-color: var(--orange); font-weight: 600; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.icon { background: transparent; border: 1px solid var(--line-strong); color: var(--text); border-radius: 9px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; }
.icon:hover { border-color: var(--orange); color: var(--orange-2); }
.icon.live { background: var(--orange); color: #0b0b0b; }
input, select, textarea { background: rgba(0,0,0,.4); color: var(--text); border: 1px solid var(--line-strong); border-radius: 9px; padding: 9px 12px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--orange); }
input[type=range] { padding: 0; accent-color: var(--orange); flex: 1; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row input:not([type=range]):not([type=date]):not([type=datetime-local]) { flex: 1; min-width: 0; }
.check { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.check input { accent-color: var(--orange); }
code { display: block; background: rgba(0,0,0,.5); border: 1px solid var(--orange-dim); color: var(--orange-2); padding: 10px 12px; border-radius: 9px; font: 14px "Consolas", monospace; word-break: break-all; user-select: all; }
.chip { background: transparent; color: var(--text); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip:hover, .chip.active { border-color: var(--orange); color: var(--orange-2); }
.filters, .quick { margin: 8px 0; flex-wrap: wrap; }
.badge { font: 500 10.5px "Consolas", monospace; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--green); border-color: rgba(74,222,128,.4); }
.badge.bad { color: var(--red); border-color: rgba(255,77,77,.4); }

/* Login */
.login { min-height: 100%; display: grid; place-items: center; padding: 20px; }
.login .card { width: min(420px, 100%); background: var(--glass); border: 1px solid var(--line); border-radius: 16px; padding: 28px 24px; backdrop-filter: blur(14px); }
.login p { color: var(--muted); font-size: 14px; }
.login form { display: grid; gap: 10px; margin-top: 10px; }
.login .err { color: var(--red); min-height: 20px; margin-top: 8px; font-size: 14px; }

/* Layout */
.app { display: grid; grid-template-columns: var(--side) 1fr; height: 100%; }
.side { border-right: 1px solid var(--line); background: rgba(0,0,0,.35); display: flex; flex-direction: column; padding: 16px 12px; gap: 14px; overflow: auto; }
.side nav { display: flex; flex-direction: column; gap: 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px; color: var(--text); cursor: pointer; text-decoration: none; border: 1px solid transparent; font-size: 14px; }
.side nav a i { font-style: normal; width: 22px; text-align: center; }
.side nav a:hover { background: var(--orange-soft); }
.side nav a.active { background: var(--orange-soft); border-color: var(--orange-dim); color: var(--white); }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.store { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.bar { height: 6px; border-radius: 3px; background: var(--line-strong); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--orange-2)); transition: width .4s; }
.bar i.warn { background: var(--red); }
.bar.big { height: 12px; border-radius: 6px; margin: 6px 0 10px; }
.content { overflow: auto; padding: 22px 24px calc(24px + env(safe-area-inset-bottom)); max-width: 1200px; width: 100%; }
.page { animation: fade .18s both; }
@keyframes fade { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.cards, .cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.card2 { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 16px; min-width: 0; }
.card2 p { margin: 4px 0 10px; font-size: 14px; }
.card2.wide2 { grid-column: 1 / -1; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 16px; }
.tile { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.tile:hover { border-color: var(--orange-dim); }
.tile .mini { display: block; margin-bottom: 4px; }
.tile b { font-size: 20px; color: var(--white); font-weight: 600; }
.tile .bar { margin-top: 8px; }
.list { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.list a, .list div.item { padding: 6px 8px; border-radius: 8px; color: var(--text); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.list a:hover, .list div.item:hover { background: var(--orange-soft); }
.list .mini { margin-left: auto; }
.answer { white-space: pre-wrap; font-size: 14px; margin-top: 8px; color: var(--white); }
.qr { margin: 12px 0; }
.qr img, .qr canvas { background: #fff; padding: 8px; border-radius: 8px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 13px; margin: 0; }
.kv dt { color: var(--muted); font-family: "Consolas", monospace; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.kv dd { margin: 0; color: var(--white); overflow-wrap: anywhere; }

/* Dateien */
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 0 8px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--orange-2); text-decoration: none; cursor: pointer; }
.crumbs span::before { content: "›"; margin: 0 4px; }
.toolbar { display: flex; gap: 8px; align-items: center; padding: 6px 0; flex-wrap: wrap; }
.search { flex: 1; min-width: 120px; width: 100%; }
.progress { position: relative; height: 6px; background: var(--line-strong); border-radius: 3px; margin: 4px 0 8px; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--orange), var(--orange-2)); border-radius: 3px; transition: width .2s; }
.progress span { position: absolute; right: 0; top: 8px; font-size: 11px; color: var(--muted); }
.file { display: grid; grid-template-columns: 24px 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 8px; border-bottom: 1px solid var(--line); border-radius: 8px; }
.file:hover { background: var(--orange-soft); }
.file input[type=checkbox] { accent-color: var(--orange); width: 18px; height: 18px; }
.file .ico { font-size: 22px; text-align: center; }
.file .ico img { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; }
.file .name { cursor: pointer; overflow: hidden; }
.file .name b { display: block; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--white); }
.file .name span { font-size: 12px; color: var(--muted); }
.file .act { display: flex; gap: 2px; }
.file .act button { background: transparent; border: 1px solid transparent; color: var(--muted); border-radius: 7px; width: 32px; height: 32px; cursor: pointer; font-size: 15px; }
.file .act button:hover { border-color: var(--orange); color: var(--orange-2); }
.files.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.files.grid-view .file { display: flex; flex-direction: column; align-items: stretch; border: 1px solid var(--line); padding: 10px; gap: 6px; }
.files.grid-view .file .ico { font-size: 40px; height: 90px; display: grid; place-items: center; }
.files.grid-view .file .ico img { width: 100%; height: 90px; }
.files.grid-view .file input[type=checkbox] { align-self: flex-start; }
.files.grid-view .file .act { justify-content: center; }
.empty { color: var(--muted); text-align: center; padding: 50px 10px; }
.drop { position: fixed; inset: 0; display: none; place-items: center; background: rgba(255,106,0,.18); border: 3px dashed var(--orange); font-size: 24px; z-index: 50; pointer-events: none; }
body.dragging .drop { display: grid; }

/* Galerie + Lightbox */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; cursor: pointer; border: 1px solid var(--line); background: #111; }
.grid img:hover { border-color: var(--orange); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 80; display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 84vh; border-radius: 8px; }
.lightbox .lb-close { position: absolute; top: 14px; right: 14px; }
.lightbox .lb-prev { position: absolute; left: 10px; top: 50%; }
.lightbox .lb-next { position: absolute; right: 10px; top: 50%; }
.lightbox .lb-name { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: 13px; }

/* Notizen */
.notes-layout { display: grid; grid-template-columns: 280px 1fr; gap: 16px; min-height: 60vh; }
.notes-list { display: flex; flex-direction: column; gap: 8px; }
.note { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.note:hover, .note.active { background: var(--orange-soft); border-color: var(--orange-dim); }
.note b { display: block; color: var(--white); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note span { font-size: 12px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.note-editor { display: flex; flex-direction: column; gap: 8px; }
.note-editor textarea { flex: 1; min-height: 50vh; resize: vertical; line-height: 1.5; }
.note-editor .row .mini { flex: 1; }
#noteBack { display: none; }

/* Aufgaben / Erinnerungen */
.todo-list { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.todo-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.todo-list li:last-child { border-bottom: 0; }
.todo-list li input[type=checkbox] { accent-color: var(--orange); width: 18px; height: 18px; }
.todo-list li span { flex: 1; }
.todo-list li.done span { text-decoration: line-through; color: var(--muted); }
.todo-list li i { font: 500 11px "Consolas", monospace; color: var(--muted); font-style: normal; white-space: nowrap; }
.todo-list li i.due { color: var(--orange-2); }
.todo-list li i.over { color: var(--red); }
.todo-list li button { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; }
.todo-list li button:hover { border-color: var(--red); color: var(--red); }
.todo-list:empty::after { content: "Nichts offen."; display: block; padding: 14px; color: var(--muted); font-size: 13px; }

/* Gedaechtnis / Gespraeche */
.mem-head { display: flex; align-items: center; gap: 12px; margin: 14px 0 6px; }
.mem-head b { color: var(--white); }
.mem-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 10px; }
.mem-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.mem-list li:last-child { border-bottom: 0; }
.mem-list li span { flex: 1; }
.mem-list li i { font: 500 10px "Consolas", monospace; color: var(--muted); font-style: normal; white-space: nowrap; }
.mem-list li i.learned { color: var(--orange-2); }
.mem-list li button { background: transparent; border: 1px solid var(--line-strong); color: var(--muted); border-radius: 6px; width: 26px; height: 26px; cursor: pointer; }
.mem-list li button:hover { border-color: var(--red); color: var(--red); }
.hist { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.turn { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.turn .q { color: var(--orange-2); font-weight: 500; }
.turn .a { white-space: pre-wrap; margin-top: 4px; font-size: 14px; }
.turn .t { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* Chat */
.chat-page { display: flex; flex-direction: column; height: calc(100vh - 46px); }
.app-page { padding: 0 !important; height: calc(100vh - 46px); }
.app-page iframe { width: 100%; height: 100%; border: 0; display: block; background: #090909; border-radius: 12px; }
.chat-head { display: flex; align-items: center; gap: 10px; }
.chat-head h1 { flex: 1; }
.msgs { flex: 1; overflow: auto; padding: 12px 0; display: flex; flex-direction: column; gap: 10px; }
.m { padding: 10px 12px; border-radius: 12px; max-width: 88%; white-space: pre-wrap; word-break: break-word; font-size: 14.5px; }
.m.me { align-self: flex-end; background: var(--orange); color: #0b0b0b; }
.m.jarvis { align-self: flex-start; background: var(--glass); border: 1px solid var(--line); }
.m.sys { align-self: center; color: var(--muted); font-size: 12.5px; text-align: center; }
.m.tool { align-self: flex-start; color: var(--muted); font: 12px "Consolas", monospace; }
.composer { display: flex; gap: 8px; padding: 10px 0 0; border-top: 1px solid var(--line); }
.composer input { flex: 1; min-width: 0; }

/* PC */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 8px; margin: 8px 0; }
.app-btn { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.app-btn:hover { border-color: var(--orange); }
.app-btn b { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-btn.mine { border-color: var(--orange-dim); }
.shot { margin-top: 10px; }
.shot img { width: 100%; border-radius: 10px; border: 1px solid var(--line); cursor: zoom-in; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 70; display: grid; place-items: center; padding: 16px; }
.modal-card { background: #121212; border: 1px solid var(--line-strong); border-radius: 14px; padding: 18px; width: min(520px, 100%); display: flex; flex-direction: column; gap: 10px; }
.modal-card h3 { margin: 0; }

@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  .side { order: 2; flex-direction: row; align-items: center; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); background: #0e0e0e; gap: 2px; overflow-x: auto; }
  .side .brand, .side-foot span, .side-foot .store { display: none; }
  .side nav { flex: 1; flex-direction: row; gap: 0; }
  .side nav a { flex-direction: column; gap: 2px; padding: 6px 6px; font-size: 10px; min-width: 56px; }
  .side nav a i { font-size: 18px; }
  .side-foot { margin: 0; }
  .content { padding: 16px 14px 90px; }
  .notes-layout { grid-template-columns: 1fr; }
  .notes-layout.editing .notes-list { display: none; }
  #noteBack { display: inline-block; }
  .file { grid-template-columns: 22px 30px 1fr auto; gap: 6px; }
  .chat-page { height: calc(100vh - 120px); }
}

/* ---------- Einheitlicher Stil wie das Dashboard ---------- */
.head { margin-bottom: 4px; align-items: flex-start; }
.head h1 { margin-bottom: 2px; }
.sub { margin: 0 0 10px; color: var(--muted); font-size: 13.5px; }
.chat-head .sub { margin-bottom: 0; }
.card2 .toolbar { padding-top: 0; }
.card2 .crumbs { padding-top: 2px; }
.files .file { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: rgba(0,0,0,.25); }
.files .file:hover { border-color: var(--orange-dim); background: var(--orange-soft); }
.todo-list, .mem-list { border: 0; display: flex; flex-direction: column; gap: 6px; }
.todo-list li, .mem-list li { border: 1px solid var(--line); border-radius: 10px; background: rgba(0,0,0,.25); }
.todo-list li:hover, .mem-list li:hover { border-color: var(--orange-dim); }
.todo-list:empty::after, .mem-list:empty::after { border: 1px dashed var(--line-strong); border-radius: 10px; text-align: center; }
.notes-layout.card2 { padding: 16px; }
.note { background: rgba(0,0,0,.25); }
.turn { background: rgba(0,0,0,.25); }
.turn:hover { border-color: var(--orange-dim); }
.search { background: rgba(0,0,0,.45); }
.tiles .tile .mini { letter-spacing: .18em; }
.grid img { background: rgba(0,0,0,.35); }
.m.jarvis { background: rgba(0,0,0,.3); }
.m.me { box-shadow: 0 6px 20px rgba(255,106,0,.25); }
.msgs { padding: 12px 4px; }
.composer { padding-top: 12px; }
.card2 h3 { display: flex; align-items: center; gap: 8px; }
.card2 h3::before { content: ""; width: 12px; height: 2px; background: var(--orange); box-shadow: 0 0 10px var(--orange); }
@media (max-width: 760px) { .head { flex-direction: column; gap: 4px; } }

.brand .logo { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 14px rgba(255,106,0,.6); }
.login .brand .logo { width: 34px; height: 34px; }


/* Konten */
.tabs { display: flex; gap: 6px; margin: 14px 0 6px; }
.tab { flex: 1; background: transparent; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 9px; padding: 8px; font: inherit; cursor: pointer; }
.tab.active { color: var(--white); border-color: var(--orange); background: var(--orange-soft); }
.who { font-size: 12px; color: var(--muted); padding: 6px 12px; border-top: 1px solid var(--line); }
.who b { display: block; color: var(--white); font-weight: 500; }
body[data-role="user"] .admin-only, body[data-role="user"] #nav a[data-page="pc"], body[data-role="user"] #nav a[data-page="history"] { display: none !important; }
@media (max-width: 760px) { .who { display: none; } }
