:root{
  --bg:#FAF7F1;--panel:#ffffff;--ink:#18140F;--muted:#5B5549;--line:rgba(24,20,15,0.10);
  --soft:#F3EEE4;--dark:#18140F;--ok:#7FA693;--danger:#C2685F;
  --violet:#8C86C7;--gold:#D8A857;
}
*{box-sizing:border-box}
html,body{height:100%;overflow:hidden}
body{margin:0;font-family:'Instrument Sans',-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;background:var(--bg);color:var(--ink)}
.mono{font-family:'JetBrains Mono',monospace}
button,textarea{font:inherit}
.app-shell{height:100vh;height:100dvh;display:grid;grid-template-columns:245px 1fr}
.app-shell.sidebar-collapsed{grid-template-columns:0 1fr}
.sidebar{transition:width .15s ease,padding .15s ease,opacity .15s ease}
.app-shell.sidebar-collapsed .sidebar{width:0;min-width:0;padding:0;border-width:0;opacity:0;overflow:hidden;pointer-events:none}
.sidebar-toggle-btn{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;margin-bottom:10px;border:1px solid var(--line);background:#fff;border-radius:8px;cursor:pointer;font-size:14px;color:var(--muted)}
.sidebar{padding:24px 18px;display:flex;flex-direction:column;border-right:1px solid var(--line);background:#efede8;overflow-y:auto}.brand{display:flex;align-items:center;gap:12px;padding:0 8px 26px}.brand strong{display:block;font-size:16px;letter-spacing:-.02em}.brand small{display:block;color:var(--muted);font-size:11px;margin-top:3px}
.brand-mark{width:26px;height:auto;display:flex;align-items:center;justify-content:center}
.brand-mark img{width:100%;height:auto;display:block}
nav{display:flex;flex-direction:column;gap:7px}.nav-item{border:0;background:transparent;text-align:left;padding:11px 12px;border-radius:10px;color:var(--muted);cursor:pointer;display:flex;gap:10px}.nav-item.active,.nav-item:hover{background:#fff;color:#111}.agent-card{margin-top:auto;background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px;display:grid;grid-template-columns:38px 1fr 8px;gap:10px;align-items:center}.avatar,.hero-icon,.msg-avatar{display:grid;place-items:center;background:var(--dark);color:white;border-radius:50%;font-weight:650}.avatar{width:38px;height:38px}.agent-card strong{font-size:13px;display:block}.agent-card span{font-size:11px;color:var(--muted);font-family:'JetBrains Mono',monospace}.agent-card i{width:8px;height:8px;border-radius:50%;background:#bbb}.agent-card i.ok{background:var(--ok)}
.main{min-width:0;height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden}.topbar{flex:0 0 auto;padding:27px 42px 18px;display:flex;align-items:flex-start;justify-content:space-between;border-bottom:1px solid var(--line)}
body:has(#agentsView.active) .topbar{
  border-bottom-color:transparent;
  padding-bottom:0;
}.eyebrow{font-family:'JetBrains Mono',monospace;font-size:10px;letter-spacing:.15em;color:var(--muted);margin:0 0 6px}.topbar h1{font-size:27px;letter-spacing:-.04em;margin:0}.secondary{border:1px solid var(--line);background:#fff;border-radius:10px;padding:9px 13px;cursor:pointer}.secondary:hover{background:var(--soft)}
.view{display:none;max-width:1050px;width:100%;margin:0 auto;padding:34px 44px 28px;flex:1;min-height:0;overflow-y:auto}.view.active{display:flex;flex-direction:column}
#chatView.active{overflow:hidden;padding-bottom:0}
.hero{flex:0 0 auto;display:flex;gap:18px;align-items:center;padding:24px 0 26px;border-bottom:1px solid var(--line)}.hero-icon{width:52px;height:52px;flex:0 0 52px}.hero h2{font-size:20px;margin:0 0 7px;letter-spacing:-.02em}.hero p{margin:0;color:var(--muted);line-height:1.5;max-width:680px;font-size:14px}
.messages{flex:1;min-height:0;overflow-y:auto;padding:28px 0 18px;display:flex;flex-direction:column;gap:20px}.message{display:flex;gap:12px;align-items:flex-start}.message.user{justify-content:flex-end}.msg-avatar{width:30px;height:30px;font-size:12px;flex:0 0 30px}.bubble{max-width:720px;background:#fff;border:1px solid var(--line);padding:13px 15px;border-radius:4px 15px 15px 15px;line-height:1.55;font-size:14px;white-space:pre-wrap}.message.user .bubble{background:var(--dark);border-color:var(--dark);color:white;border-radius:15px 4px 15px 15px}.message.loading .bubble{color:var(--muted)}

/* Markdown-Darstellung in Archies Antworten */
.bubble p{margin:0 0 10px}.bubble p:last-child{margin-bottom:0}
.bubble ul{margin:0 0 10px;padding-left:20px}.bubble ul:last-child{margin-bottom:0}
.bubble li{margin:2px 0}
.bubble strong{font-weight:650}
.bubble em{font-style:italic}
.bubble code{background:rgba(0,0,0,.06);border-radius:4px;padding:1px 5px;font-size:.9em;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}
.message.user .bubble code{background:rgba(255,255,255,.15)}

.quick-actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}.quick-actions button{border:1px solid var(--line);background:transparent;border-radius:999px;padding:7px 11px;font-size:12px;color:var(--muted);cursor:pointer}.quick-actions button:hover{background:white}
.composer{display:flex;flex-direction:row;align-items:flex-end;gap:10px;background:#fff;border:1px solid #cfcac3;border-radius:16px;padding:10px 10px 10px 14px;box-shadow:0 8px 24px rgba(0,0,0,.035)}
.composer textarea{flex:1 1 auto;min-width:0;resize:none;border:0;outline:0;min-height:42px;max-height:170px;padding:10px 3px;background:transparent}
.hint{text-align:right;font-size:10px;color:#9a958e;margin:7px 3px 0}
.section-head{display:flex;justify-content:space-between;align-items:flex-start;border-bottom:1px solid var(--line);padding-bottom:20px;margin-bottom:18px}.section-head h2{margin:0 0 5px;font-size:21px}.section-head p{margin:0;color:var(--muted);font-size:13px}.activity-list{display:flex;flex-direction:column}.activity{display:grid;grid-template-columns:150px 160px 1fr;gap:14px;padding:14px 5px;border-bottom:1px solid var(--line);font-size:13px}.activity .time{color:var(--muted);font-family:'JetBrains Mono',monospace}.activity .action{font-weight:650}.activity .detail{color:var(--muted);overflow-wrap:anywhere}.empty{padding:50px 0;text-align:center;color:var(--muted)}.status-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.status-card{background:white;border:1px solid var(--line);border-radius:14px;padding:18px}.status-card small{display:block;color:var(--muted);margin-bottom:7px;font-family:'JetBrains Mono',monospace}.status-card strong{font-size:15px}.good{color:var(--ok)}.bad{color:var(--danger)}

/* Chat Dateianhang */
.attach-btn{flex:0 0 42px;width:42px;height:42px;border-radius:50%;font-size:24px;line-height:1;display:grid;place-items:center;border:0;background:var(--soft);cursor:pointer;align-self:flex-end}
#sendBtn{flex:0 0 42px;width:42px;height:42px;border:0;background:var(--dark);color:white;border-radius:12px;cursor:pointer;align-self:flex-end;font-size:20px}
#sendBtn:disabled{opacity:.45;cursor:not-allowed}
.chat-attachment{margin-top:8px;min-height:20px;font-size:13px;opacity:.7}

/* Mobile Navigation: ersetzt die versteckte Sidebar unterhalb von 800px */
.mobile-nav{display:none}

@media(max-width:800px){
  .app-shell{grid-template-columns:1fr}
  .sidebar{display:none}
  .sidebar-toggle-btn{display:none}
  .topbar{height:auto;padding:20px}
  .view{padding:24px 18px 90px}
  #chatView.active{padding-bottom:0}
  #chatView .composer{margin-bottom:calc(24px + env(safe-area-inset-bottom))}
  .hero{align-items:flex-start}
  .status-grid{grid-template-columns:1fr}
  .activity{grid-template-columns:1fr;gap:4px}
  .bubble{max-width:86vw}
  .quick-actions{overflow:auto;flex-wrap:nowrap;padding-bottom:3px}
  .quick-actions button{white-space:nowrap}

  .mobile-nav{
    display:flex;justify-content:space-around;align-items:center;
    position:fixed;bottom:0;left:0;right:0;z-index:20;
    background:#fff;border-top:1px solid var(--line);
    padding:8px 6px calc(8px + env(safe-area-inset-bottom));
  }
  .mobile-nav .nav-item{
    flex:1;flex-direction:column;align-items:center;gap:3px;
    padding:6px 4px;border-radius:10px;background:transparent;font-size:10px;color:var(--muted);
  }
  .mobile-nav .nav-item span{font-size:17px}
  .mobile-nav .nav-item.active,.mobile-nav .nav-item:hover{background:var(--soft);color:#111}
}

/* ---------- Login-Bildschirm ---------- */
.login-screen{
  position:fixed; inset:0; z-index:200;
  background:var(--bg);
  display:flex; align-items:center; justify-content:center;
  opacity:0;
  animation:loginFadeIn .5s ease forwards;
}
@keyframes loginFadeIn{
  from{opacity:0}
  to{opacity:1}
}
.login-card{
  width:100%; max-width:340px;
  display:flex; flex-direction:column; align-items:center;
  padding:0 24px; text-align:center;
}
.login-mark{ width:64px; margin-bottom:20px; }
.login-mark img{ width:100%; height:auto; display:block; }
.login-card h1{ font-size:20px; margin:0 0 4px; letter-spacing:-.02em; }
.login-sub{ margin:0 0 28px; color:var(--muted); font-size:13px; }
.login-card input{
  width:100%; padding:12px 14px; margin-bottom:10px;
  border:1px solid var(--line); border-radius:10px;
  font:inherit; background:#fff;
}
.login-card button[type="submit"]{
  width:100%; padding:12px; margin-top:6px;
  border:0; border-radius:10px;
  background:var(--dark); color:#fff; font-weight:600;
  cursor:pointer;
}
.login-card button[type="submit"]:hover{ opacity:.92; }
.login-error{
  min-height:18px; margin:12px 0 0; font-size:13px; color:var(--danger);
}
.login-message{
  min-height:18px; margin:12px 0 0; font-size:13px; color:var(--muted); line-height:1.45;
}
.login-message.error{ color:var(--danger); }
.login-link{
  background:none; border:0; color:inherit; text-decoration:underline;
  cursor:pointer; margin-top:10px; padding:2px; font-size:.9em;
}

/* ---------- Sichtbarkeits-Hilfsklasse ---------- */
.hidden{ display:none !important; }

#backToMeBtn,
#maiReply {
  display: none;
}

.me-seat-1{left:351px;top:66px}
.me-seat-2{left:483px;top:-66px}
.me-seat-3{left:351px;top:336px}
.me-seat-4{left:615px;top:66px}
.me-seat-5{left:483px;top:457.8px}
.me-seat-6{left:615px;top:336px}

.email-verification-banner{
  margin:0 0 18px; padding:16px 18px; border:1px solid #e4c86c;
  border-radius:14px; background:#fff8db; display:flex; align-items:center;
  gap:18px; flex-wrap:wrap;
}
.email-verification-banner strong{display:block;margin-bottom:3px}
.email-verification-banner p{margin:0;color:var(--muted);font-size:13px}
.email-verification-banner form{display:flex;gap:8px;flex:1;min-width:280px}
.email-verification-banner input{flex:1;min-width:180px;border:1px solid var(--line);border-radius:10px;padding:10px 12px;font:inherit;background:#fff}
.email-verification-banner button{border:0;border-radius:10px;padding:10px 14px;background:var(--dark);color:#fff;font-weight:600;cursor:pointer}
.email-verification-banner .email-verification-message{flex-basis:100%}
.email-verification-banner .email-verification-message.error{color:var(--danger)}
@media(max-width:700px){.email-verification-banner form{flex-basis:100%;flex-direction:column}}

/* ---------- Nutzeranzeige / Abmelden ---------- */
.account-connection-card{
  margin-top:auto;padding:14px 12px;border-radius:14px;
  background:rgba(255,255,255,.48);border:1px solid rgba(0,0,0,.045);
  display:flex;flex-direction:column;gap:12px;min-width:0;
}
.account-connection-card>strong{font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.account-connection-status{display:flex;gap:8px;align-items:flex-start}
.account-connection-status i{flex:0 0 8px;width:8px;height:8px;margin-top:5px;border-radius:50%;background:#aaa}
.account-connection-status span{display:block;font-size:11px;line-height:1.55;color:var(--muted);overflow-wrap:anywhere}
.account-connection-card[data-state="connected"] i{background:var(--ok)}
.account-connection-card[data-state="offline"] i{background:var(--danger)}
.account-connection-card[data-state="unreachable"] i,.account-connection-card[data-state="expired"] i{background:var(--gold)}
.account-connection-card .secondary{align-self:flex-start;padding:6px 10px;font-size:12px}

.user-card{
  margin-top:10px;
  display:flex; align-items:center; justify-content:space-between;
  gap:8px; padding:0 4px;
}
.user-card span{
  font-family:'JetBrains Mono',monospace; font-size:11px; color:var(--muted);
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.user-card .secondary{
  padding:6px 10px; font-size:12px; flex:0 0 auto;
}

/* Sprachumschalter DE / EN */

.topbar-actions{
  display:flex;
  align-items:center;
  gap:12px;
}

.language-switch{
  display:flex;
  align-items:center;
  gap:6px;
  font-family:'JetBrains Mono',monospace;
  font-size:11px;
  color:var(--muted);
}

.lang-btn{
  border:0;
  background:transparent;
  padding:4px 3px;
  color:var(--muted);
  cursor:pointer;
  font:inherit;
  letter-spacing:.05em;
}

.lang-btn:hover{
  color:#111;
}

.lang-btn.active{
  color:#111;
  font-weight:650;
}

@media(max-width:800px){
  .topbar-actions{
    gap:8px;
  }

  .language-switch{
    font-size:10px;
  }

  .secondary{
    padding:8px 10px;
  }
}

/* Attachment-Karte im Chat */

.chat-attachment{
  margin-top:10px;
  min-height:0;
}

.attachment-card{
  display:inline-flex;
  align-items:center;
  gap:10px;
  max-width:420px;
  padding:10px 12px;
  background:#f7f5f1;
  border:1px solid var(--line);
  border-radius:12px;
}

.attachment-icon{
  width:30px;
  height:30px;
  flex:0 0 30px;
  display:grid;
  place-items:center;
  border-radius:9px;
  background:#fff;
  border:1px solid var(--line);
  font-size:14px;
}

.attachment-info{
  display:flex;
  flex-direction:column;
  min-width:0;
}

.attachment-info strong{
  font-size:12px;
  font-weight:650;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.attachment-info span{
  margin-top:2px;
  font-size:10px;
  color:var(--muted);
  font-family:'JetBrains Mono',monospace;
}

.attachment-remove{
  width:26px;
  height:26px;
  flex:0 0 26px;
  display:grid;
  place-items:center;
  border:0;
  border-radius:50%;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-size:18px;
}

.attachment-remove:hover{
  background:#fff;
  color:#111;
}

/* --------------------------------------------------------------------------
   Owner-Dateiverwaltung
   -------------------------------------------------------------------------- */

.admin-files-toolbar{
  display:flex;
  align-items:center;
  gap:12px;
  margin:18px 0;
  flex-wrap:wrap;
}

.admin-files-toolbar select{
  min-width:220px;
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  font:inherit;
  color:inherit;
}

.admin-breadcrumb{
  margin:10px 0 12px;
  padding:9px 12px;
  border-radius:10px;
  background:rgba(0,0,0,.035);
  color:var(--muted);
  font-size:13px;
  overflow-wrap:anywhere;
}

.admin-files-list{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.admin-file-row{
  width:100%;
  min-height:52px;
  display:grid;
  grid-template-columns:32px minmax(0,1fr) 90px auto;
  align-items:center;
  gap:10px;
  padding:9px 12px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  color:inherit;
  text-align:left;
}

.admin-file-row.clickable{
  cursor:pointer;
}

.admin-file-row.clickable:hover{
  background:rgba(0,0,0,.025);
}

.admin-file-icon{
  display:grid;
  place-items:center;
  color:var(--muted);
  font-size:18px;
}
.admin-folder .admin-file-icon{
  display:none;
}

.admin-file-name{
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-weight:600;
}

.admin-file-type{
  color:var(--muted);
  font-size:12px;
}

.admin-trash-item-btn,
.restore-btn{
  white-space:nowrap;
}

.trash-row{
  grid-template-columns:32px minmax(0,1fr) 90px auto;
}

@media (max-width:700px){
  .admin-file-row,
  .trash-row{
    grid-template-columns:28px minmax(0,1fr) auto;
  }

  .admin-file-type{
    display:none;
  }

  .admin-trash-item-btn,
  .restore-btn{
    font-size:12px;
    padding:7px 9px;
  }
}

/* Drag & Drop im Archie-Chat */

#chatView{
  position:relative;
}

.chat-drop-overlay{
  position:absolute;
  inset:0;
  z-index:50;
  display:none;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(247,245,241,.92);
  backdrop-filter:blur(3px);
}

.chat-drop-overlay.active{
  display:flex;
}

.chat-drop-overlay-inner{
  width:min(520px, 90%);
  padding:32px;
  border:1px dashed #b8b2aa;
  border-radius:18px;
  background:#fff;
  text-align:center;
  box-shadow:0 16px 40px rgba(0,0,0,.06);
}

.chat-drop-overlay-inner strong{
  display:block;
  margin-bottom:7px;
  font-size:18px;
}

.chat-drop-overlay-inner span{
  color:var(--muted);
  font-size:13px;
}


/* MMAi User Data Sidebar Group */
.nav-group {
  margin-top: 2px;
}

.nav-group-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px 5px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.nav-subitem {
  padding-left: 30px !important;
  font-size: 13px;
}

.nav-subitem span {
  opacity: .65;
}

/* MMAi User Data Collapsible Navigation */

.nav-group-label {
  width: 100%;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  font-family: inherit;
}

.nav-group-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-chevron {
  margin-left: auto;
  font-size: 16px;
  line-height: 1;
  opacity: .65;
}

.nav-subitems {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 260px;
  opacity: 1;
  transition:
    max-height .18s ease,
    opacity .15s ease;
}

.nav-subitems.collapsed {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.nav-subitems .nav-subitem {
  width: 100%;
}

/* MMAi Vault File Actions */

.admin-file-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-file-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.admin-folder .admin-file-main {
  cursor: pointer;
}

.vault-file-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.vault-action-btn {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 7px;
  padding: 6px 9px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.vault-action-btn:hover {
  background: rgba(0, 0, 0, .05);
}

.vault-action-delete:hover {
  background: rgba(150, 0, 0, .08);
}

@media (max-width: 760px) {
  .admin-file-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .vault-file-actions {
    width: 100%;
    padding-left: 28px;
  }
}

/* MMAi Trash View */

.trash-file-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 3px;
}

.trash-original-path {
  display: block;
  font-size: 11px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vault-action-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* MMAi File Preview */

.admin-file-clickable {
  cursor: pointer;
}

.admin-file-clickable:hover .admin-file-name {
  text-decoration: underline;
}

.file-preview {
  width: 100%;
  min-width: 0;
}

.file-preview-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
}

.file-preview-back {
  flex-shrink: 0;
}

.file-preview-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.file-preview-title strong {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-title span {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-preview-body {
  width: 100%;
  min-height: 300px;
}

.file-preview-pdf {
  display: block;
  width: 100%;
  height: 72vh;
  min-height: 600px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.file-preview-image-box {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 100%;
  min-height: 300px;
  padding: 20px;
  box-sizing: border-box;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  overflow: auto;
}

.file-preview-image {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.file-preview-text {
  margin: 0;
  width: 100%;
  max-height: 72vh;
  overflow: auto;
  box-sizing: border-box;

  padding: 20px;

  border: 1px solid var(--line);
  border-radius: 12px;

  background: white;

  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    monospace;

  font-size: 13px;
  line-height: 1.55;

  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.file-preview-unsupported {
  padding: 36px 24px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}

.file-preview-unsupported strong {
  display: block;
  margin-bottom: 8px;
  color: inherit;
}

@media (max-width: 760px) {
  .file-preview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .file-preview-pdf {
    min-height: 500px;
    height: 65vh;
  }

  .file-preview-image {
    max-height: 65vh;
  }

  .file-preview-text {
    max-height: 65vh;
  }
}

/* MMAi Sidebar Navigation Separator */
.nav-separator {
  height: 14px;
  flex-shrink: 0;
}

/* MMAi Visual Refresh 2026-08-24 */

:root {
  --surface-soft: rgba(255, 255, 255, .56);
  --surface-strong: rgba(255, 255, 255, .82);
  --surface-hover: rgba(255, 255, 255, .72);
  --shadow-soft: 0 8px 28px rgba(0, 0, 0, .045);
  --shadow-card: 0 3px 14px rgba(0, 0, 0, .04);
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* ==========================================================
   SIDEBAR
   ========================================================== */

.sidebar {
  padding: 22px 16px 18px;
  border-right: 1px solid rgba(0, 0, 0, .07);
  box-shadow: 8px 0 30px rgba(0, 0, 0, .025);
}

.brand {
  padding: 2px 8px 24px;
}

.brand strong {
  font-size: 17px;
  letter-spacing: -.025em;
}

.brand small {
  font-size: 11px;
  opacity: .72;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item,
.nav-group-label {
  border-radius: 10px;
  transition:
    background .14s ease,
    transform .14s ease,
    box-shadow .14s ease;
}

.nav-item {
  min-height: 40px;
}

.nav-item:hover,
.nav-group-label:hover {
  background: rgba(255, 255, 255, .5);
}

.nav-item:active,
.nav-group-label:active {
  transform: scale(.992);
}

.nav-item.active {
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .8),
              0 3px 12px rgba(0, 0, 0, .04);
}

.nav-subitem {
  min-height: 36px;
  margin-left: 8px;
}

.nav-group-label {
  min-height: 40px;
}

.nav-separator {
  height: 12px;
}

/* ==========================================================
   ACCOUNT / AGENT CARD
   ========================================================== */

.agent-card,
.user-card {
  border-radius: var(--radius-md);
}

.agent-card {
  padding: 12px;
  background: rgba(255, 255, 255, .48);
  border: 1px solid rgba(0, 0, 0, .045);
}

.user-card {
  margin-top: 8px;
  padding: 10px 12px;
}

/* ==========================================================
   MAIN CONTENT
   ========================================================== */

.main {
  background:
    radial-gradient(
      circle at top right,
      rgba(255, 255, 255, .9),
      rgba(255, 255, 255, 0) 35%
    );
}

.topbar {
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.section-head {
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: 24px;
  letter-spacing: -.035em;
}

.section-head p {
  margin-top: 5px;
  line-height: 1.45;
}

/* ==========================================================
   HERO / CHAT
   ========================================================== */

.hero {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, .055);
  background: var(--surface-soft);
  box-shadow: var(--shadow-soft);
}

.hero-icon {
  box-shadow: 0 5px 16px rgba(0, 0, 0, .06);
}

.message .bubble {
  border-radius: 15px;
}

.message.assistant .bubble {
  box-shadow: 0 2px 10px rgba(0, 0, 0, .025);
}

.composer {
  border-radius: 16px;
  box-shadow: 0 5px 24px rgba(0, 0, 0, .045);
}

.quick-actions button {
  border-radius: 10px;
  transition:
    background .14s ease,
    transform .14s ease;
}

.quick-actions button:hover {
  background: rgba(255, 255, 255, .68);
}

.quick-actions button:active {
  transform: translateY(1px);
}

/* ==========================================================
   STATUS CARDS
   ========================================================== */

.status-card {
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid rgba(0, 0, 0, .055);
  box-shadow: var(--shadow-card);
  transition:
    transform .14s ease,
    box-shadow .14s ease;
}

.status-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .055);
}

/* ==========================================================
   FILE BROWSER
   ========================================================== */

.admin-breadcrumb {
  margin-bottom: 12px;
  padding: 8px 2px;
  font-size: 12px;
  opacity: .72;
}

.admin-files-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.admin-files-list.ki-memory-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.ki-memory-list .admin-file-row {
  min-height: 108px;
  align-items: flex-start;
  padding: 16px;
}

.ki-memory-list .admin-file-main {
  align-content: flex-start;
  min-height: 66px;
}

.admin-file-row {
  min-height: 48px;
  padding: 9px 10px 9px 12px;
  border: 1px solid rgba(0, 0, 0, .05);
  border-radius: 11px;
  background: rgba(255, 255, 255, .42);
  transition:
    background .13s ease,
    border-color .13s ease,
    box-shadow .13s ease,
    transform .13s ease;
}

.admin-file-row:hover {
  background: var(--surface-hover);
  border-color: rgba(0, 0, 0, .075);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .035);
  transform: translateY(-1px);
}

.admin-file-main {
  min-width: 0;
}

.admin-file-icon {
  width: 22px;
  text-align: center;
  opacity: .7;
}

.admin-file-name {
  font-weight: 520;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-file-type {
  opacity: .55;
  font-size: 11px;
}

.user-data-access-note {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(43, 78, 128, .16);
  border-radius: 11px;
  background: rgba(232, 239, 248, .62);
  color: #3d4b5f;
  font-size: 12px;
  line-height: 1.55;
}

.user-data-file-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
}

.user-data-file-toolbar[hidden] {
  display: none;
}

.file-move-modal {
  width: min(520px, calc(100vw - 32px));
}

.file-move-source {
  margin: 0 0 14px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.file-move-area-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 650;
}

.file-move-modal select {
  width: 100%;
  margin-bottom: 10px;
}

.file-move-folder-list {
  max-height: min(42vh, 360px);
  overflow-y: auto;
}

.file-move-folder-list .admin-file-row {
  width: 100%;
  text-align: left;
}

.file-move-folder-list .admin-file-row:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.admin-file-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-left: 8px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(43, 78, 128, .09);
  color: #47617f;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .01em;
}

.admin-file-row.agent-data-readonly .admin-file-main {
  flex-wrap: wrap;
  row-gap: 6px;
}

.admin-file-row.agent-data-readonly .admin-file-name {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ==========================================================
   FILE ACTION BUTTONS
   ========================================================== */

.vault-file-actions {
  gap: 7px;
}

.vault-action-btn {
  border-radius: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(0, 0, 0, .075);
  background: rgba(255, 255, 255, .68);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .025);
  transition:
    background .13s ease,
    border-color .13s ease,
    transform .13s ease,
    box-shadow .13s ease;
}

.vault-action-btn:hover {
  background: rgba(255, 255, 255, .98);
  border-color: rgba(0, 0, 0, .12);
  box-shadow: 0 3px 9px rgba(0, 0, 0, .045);
}

.vault-action-btn:active {
  transform: translateY(1px);
}

.vault-action-delete {
  opacity: .82;
}

.vault-action-delete:hover {
  background: rgba(150, 0, 0, .06);
  border-color: rgba(150, 0, 0, .13);
}

/* ==========================================================
   FILE PREVIEW
   ========================================================== */

.file-preview-head {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.file-preview-pdf,
.file-preview-image-box,
.file-preview-text,
.file-preview-unsupported {
  border-radius: var(--radius-lg);
  border-color: rgba(0, 0, 0, .06);
  box-shadow: var(--shadow-soft);
}

.file-preview-text {
  line-height: 1.6;
}

/* ==========================================================
   ACTIVITY
   ========================================================== */

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.activity-list > * {
  border-radius: 10px;
}

/* ==========================================================
   GENERIC BUTTONS
   ========================================================== */

button.secondary {
  border-radius: 9px;
  transition:
    background .13s ease,
    transform .13s ease;
}

button.secondary:hover {
  background: rgba(255, 255, 255, .72);
}

button.secondary:active {
  transform: translateY(1px);
}

/* ==========================================================
   MOBILE
   ========================================================== */

@media (max-width: 760px) {

  .section-head h2 {
    font-size: 21px;
  }

  .admin-file-row {
    padding: 10px;
    gap: 8px;
  }

  .vault-file-actions {
    padding-left: 30px;
    gap: 5px;
    flex-wrap: wrap;
  }

  .vault-action-btn {
    padding: 6px 9px;
  }
}


/* MMAi Nav Clean Typography 2026-08-24 */

/*
 * Ruhigere, modernere Typografie.
 * Keine externe Font-Abhängigkeit – verwendet vorhandene Systemfonts.
 */
body,
button,
input,
textarea,
select {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    "Helvetica Neue",
    Arial,
    sans-serif;
}

/* Navigation etwas prägnanter */
.sidebar .nav-item,
.sidebar .nav-group-label {
  font-weight: 500;
  letter-spacing: -0.015em;
}

/* Hauptpunkte */
.sidebar .nav-item:not(.nav-subitem),
.sidebar .nav-group-label {
  font-size: 15px;
}

/* Unterpunkte bewusst etwas dezenter */
.sidebar .nav-subitem {
  font-size: 13px;
  font-weight: 450;
}

/*
 * Die bisherigen Symbole vor den Navigationsnamen entfernen.
 * Der Chevron von MMAi-User-Data bleibt erhalten.
 */
.sidebar .nav-item > span:first-child {
  display: none;
}

.sidebar .nav-group-main > span:first-child {
  display: none;
}

/* Nach Entfernen der Icons Abstände korrigieren */
.sidebar .nav-item {
  gap: 0;
}

.sidebar .nav-group-main {
  gap: 0;
}

/* Unterpunkte sauber einrücken */
.sidebar .nav-subitem {
  padding-left: 18px;
}

/* MMAi-User-Data etwas stärker wie eine Bereichsüberschrift */
.sidebar .nav-group-label {
  font-weight: 600;
}

/* Aktiver Navigationspunkt etwas klarer */
.sidebar .nav-item.active {
  font-weight: 550;
}

/* Überschriften näher am Branding */
h1,
h2,
h3,
#pageTitle {
  font-family:
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-weight: 700;
  letter-spacing: -0.035em;
}

/* Dateinamen ebenfalls etwas moderner */
.admin-file-name {
  font-weight: 600;
  letter-spacing: -0.015em;
}


/* MMAi Responsive Layout 2026-08-24 */

/*
 * Desktop bleibt unverändert.
 * Unter 800px wird die vorhandene Sidebar zum Off-Canvas-Menü.
 */

html {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

body {
  width: 100%;
  min-height: 100%;
  overflow-x: hidden;
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
}

/* ----------------------------------------------------------
   Mobile Menü
   ---------------------------------------------------------- */

.mobile-menu-btn {
  display: none;
}

.mobile-nav-backdrop {
  display: none;
}

/* ----------------------------------------------------------
   Tablet / Smartphone
   ---------------------------------------------------------- */

@media (max-width: 800px) {

  html,
  body {
    min-width: 0;
  }

  body.mobile-nav-open {
    overflow: hidden;
  }

  .app-shell {
    display: block;
    width: 100%;
    min-width: 0;
  }

  /* ----------------------------------------
     Sidebar als seitliches Menü
     ---------------------------------------- */

  .sidebar {
    display: flex !important;

    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;

    width: min(82vw, 310px);
    height: 100dvh;

    z-index: 100;

    transform: translateX(-105%);
    transition: transform .22s ease;

    box-sizing: border-box;

    padding-top:
      calc(22px + env(safe-area-inset-top));

    padding-left:
      calc(18px + env(safe-area-inset-left));

    padding-bottom:
      calc(18px + env(safe-area-inset-bottom));

    overflow-y: auto;
    overscroll-behavior: contain;

    box-shadow:
      18px 0 50px rgba(0,0,0,.12);
  }

  body.mobile-nav-open .sidebar {
    transform: translateX(0);
  }

  .mobile-nav-backdrop {
    display: block;

    position: fixed;
    inset: 0;

    z-index: 90;

    background: rgba(20,20,20,.28);

    opacity: 0;
    pointer-events: none;

    transition: opacity .2s ease;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  /* Alte Bottom-Navigation nicht verwenden */

  .mobile-nav {
    display: none !important;
  }

  /* ----------------------------------------
     Menü-Button
     ---------------------------------------- */

  .mobile-menu-btn {
    display: flex;

    position: fixed;

    top:
      calc(12px + env(safe-area-inset-top));

    left:
      calc(12px + env(safe-area-inset-left));

    z-index: 80;

    width: 42px;
    height: 42px;

    padding: 0;

    align-items: center;
    justify-content: center;
    flex-direction: column;

    gap: 4px;

    border: 1px solid var(--line);
    border-radius: 12px;

    background: rgba(255,255,255,.94);

    box-shadow:
      0 4px 16px rgba(0,0,0,.06);

    cursor: pointer;

    -webkit-tap-highlight-color: transparent;
  }

  .mobile-menu-btn span {
    display: block;

    width: 17px;
    height: 1.5px;

    background: #222;

    border-radius: 2px;
  }

  /* ----------------------------------------
     Hauptbereich
     ---------------------------------------- */

  main,
  .main {
    width: 100%;
    min-width: 0;
  }

  .topbar {
    min-height: 64px;
    height: auto;

    padding:
      calc(15px + env(safe-area-inset-top))
      calc(16px + env(safe-area-inset-right))
      15px
      calc(66px + env(safe-area-inset-left));

    box-sizing: border-box;
  }

  #pageTitle {
    max-width: 100%;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .view {
    width: 100%;
    min-width: 0;

    box-sizing: border-box;

    padding:
      22px
      calc(16px + env(safe-area-inset-right))
      calc(24px + env(safe-area-inset-bottom))
      calc(16px + env(safe-area-inset-left));
  }

  /* ----------------------------------------
     Chat
     ---------------------------------------- */

  #chatView.active {
    padding-bottom:
      calc(12px + env(safe-area-inset-bottom));
  }

  .hero {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .hero h2 {
    font-size: clamp(25px, 7vw, 34px);
    line-height: 1.08;
  }

  .messages {
    width: 100%;
    min-width: 0;
  }

  .bubble {
    max-width: 88%;
    overflow-wrap: anywhere;
  }

  .composer {
    width: 100%;
    min-width: 0;

    box-sizing: border-box;

    gap: 8px;

    padding: 8px 8px 8px 12px;

    border-radius: 15px;
  }

  .composer textarea {
    min-width: 0;
    width: 100%;

    font-size: 16px;

    padding: 9px 2px;
  }

  .attach-btn,
  #sendBtn {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;

    touch-action: manipulation;
  }

  .hint {
    display: none;
  }

  /* ----------------------------------------
     Überschriften
     ---------------------------------------- */

  .section-head {
    gap: 14px;
    flex-wrap: wrap;
  }

  .section-head > * {
    min-width: 0;
  }

  /* ----------------------------------------
     Statuskarten
     ---------------------------------------- */

  .status-grid {
    grid-template-columns: 1fr;
  }

  .status-card {
    min-width: 0;
  }

  /* ----------------------------------------
     Aktivitäten
     ---------------------------------------- */

  .activity {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  /* ----------------------------------------
     Dateibrowser
     ---------------------------------------- */

  .admin-file-row {
    width: 100%;
    min-width: 0;

    box-sizing: border-box;

    align-items: flex-start;

    padding: 11px 8px;
  }

  .admin-file-name,
  .trash-original-path {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .admin-file-row.agent-data-readonly .admin-file-name {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .admin-file-row.agent-data-readonly .admin-file-badge {
    margin-left: 0;
  }

  .vault-file-actions {
    width: 100%;

    box-sizing: border-box;

    padding-left: 0;
    padding-top: 7px;

    display: flex;
    flex-wrap: wrap;

    gap: 6px;
  }

  .vault-action-btn {
    min-height: 36px;

    padding: 7px 11px;

    touch-action: manipulation;
  }

  /* ----------------------------------------
     Breadcrumb
     ---------------------------------------- */

  .admin-breadcrumb,
  .breadcrumb {
    max-width: 100%;

    overflow-x: auto;
    overflow-y: hidden;

    white-space: nowrap;

    -webkit-overflow-scrolling: touch;
  }

  /* ----------------------------------------
     Datei-Vorschau
     ---------------------------------------- */

  .file-preview {
    width: 100%;
    min-width: 0;
  }

  .file-preview-head {
    width: 100%;
    min-width: 0;

    flex-direction: column;
    align-items: flex-start;

    gap: 10px;
  }

  .file-preview-title {
    width: 100%;
    min-width: 0;
  }

  .file-preview-pdf {
    width: 100%;

    height: 68dvh;
    min-height: 360px;

    border-radius: 10px;
  }

  .file-preview-image-box {
    min-height: 180px;
    padding: 10px;
  }

  .file-preview-image {
    max-width: 100%;
    max-height: 68dvh;
  }

  .file-preview-text {
    max-width: 100%;
    max-height: 68dvh;

    padding: 14px;

    font-size: 12px;

    overflow-x: auto;
  }

  /* ----------------------------------------
     Login
     ---------------------------------------- */

  .login-card {
    width: min(100%, 380px);

    box-sizing: border-box;

    padding-left:
      calc(22px + env(safe-area-inset-left));

    padding-right:
      calc(22px + env(safe-area-inset-right));
  }

  .login-card input {
    box-sizing: border-box;

    font-size: 16px;
  }

}

/* ----------------------------------------------------------
   Sehr kleine Smartphones
   ---------------------------------------------------------- */

@media (max-width: 420px) {

  .topbar {
    padding-right: 12px;
  }

  .view {
    padding-left:
      calc(12px + env(safe-area-inset-left));

    padding-right:
      calc(12px + env(safe-area-inset-right));
  }

  .bubble {
    max-width: 92%;
  }

  .section-head h2 {
    font-size: 20px;
  }

  .vault-action-btn {
    font-size: 12px;
  }

}

/* ----------------------------------------------------------
   Touch-Geräte
   ---------------------------------------------------------- */

@media (hover: none) and (pointer: coarse) {

  button,
  .nav-item,
  .vault-action-btn {
    min-height: 40px;
  }

}

/* ----------------------------------------------------------
   Reduced Motion
   ---------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {

  .sidebar,
  .mobile-nav-backdrop {
    transition: none !important;
  }

}

/* MMAi Attachment Menu 2026-08-24 */

.composer {
  position: relative;
}

.attach-menu {
  position: absolute;

  left: 8px;
  bottom: calc(100% + 8px);

  z-index: 50;

  width: 210px;

  padding: 6px;

  box-sizing: border-box;

  background: rgba(255,255,255,.98);

  border: 1px solid var(--line);
  border-radius: 12px;

  box-shadow:
    0 12px 35px rgba(0,0,0,.11);

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.attach-menu[hidden] {
  display: none !important;
}

.attach-menu-item {
  display: block;

  width: 100%;
  min-height: 42px;

  padding: 10px 12px;

  border: 0;
  border-radius: 8px;

  background: transparent;

  text-align: left;

  font: inherit;
  font-size: 13px;
  font-weight: 500;

  cursor: pointer;

  transition: background .12s ease;
}

.attach-menu-item:hover {
  background: var(--soft);
}

.attach-menu-item:active {
  background: rgba(0,0,0,.07);
}

@media (max-width: 800px) {

  .attach-menu {
    width: min(230px, calc(100vw - 32px));

    left: 0;

    bottom: calc(100% + 10px);
  }

  .attach-menu-item {
    min-height: 48px;
    font-size: 14px;
  }
}

/* Archie Kurzanleitung */

.help-content{
  max-width:850px;
  line-height:1.65;
  font-size:14px;
  max-height:60vh;
  overflow-y:auto;
}

.help-content h1{
  font-size:26px;
  margin:6px 0 24px;
  letter-spacing:-.03em;
}

.help-content h2{
  font-size:19px;
  margin:30px 0 10px;
  letter-spacing:-.02em;
}

.help-content h3{
  font-size:16px;
  margin:22px 0 8px;
}

.help-content p{
  margin:0 0 12px;
}

.help-content ul{
  margin:0 0 16px;
  padding-left:22px;
}

.help-content li{
  margin:5px 0;
}

.help-content code{
  background:rgba(0,0,0,.06);
  border-radius:4px;
  padding:1px 5px;
  font-size:.9em;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
}

.help-content strong{
  font-weight:650;
}

/* Owner-Benutzerverwaltung */

.user-admin-form{
  display:grid;
  grid-template-columns:1fr 1fr 180px auto;
  gap:12px;
  align-items:end;
  margin-bottom:18px;
}

.user-admin-field{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.user-admin-field label{
  font-size:12px;
  color:var(--muted);
}

.user-admin-field input,
.user-admin-field select{
  width:100%;
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:10px 12px;
  font:inherit;
  color:var(--ink);
}

.user-admin-message{
  min-height:22px;
  margin:4px 0 12px;
  font-size:13px;
}

.user-admin-message.success{
  color:var(--ok);
}

.user-admin-message.error{
  color:var(--danger);
}

.users-list{
  border-top:1px solid var(--line);
}

.user-admin-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:20px;
  padding:14px 4px;
  border-bottom:1px solid var(--line);
}

.user-admin-row strong{
  font-size:14px;
}

.user-admin-row span{
  color:var(--muted);
  font-size:13px;
}

@media(max-width:800px){
  .user-admin-form{
    grid-template-columns:1fr;
  }
}

.user-admin-main{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}

.user-status{
  font-size:12px;
  padding:3px 8px;
  border-radius:999px;
  background:var(--soft);
}

.user-status.active{
  color:var(--ok);
}

.user-status.inactive{
  color:var(--danger);
}

.user-quota{
  font-size:12px;
  padding:3px 8px;
  border-radius:999px;
  background:var(--soft);
  color:var(--muted);
}

.user-active-toggle:disabled{
  opacity:.45;
  cursor:not-allowed;
}

.user-admin-actions{
  display:flex;
  align-items:center;
  gap:8px;
  margin-left:auto;
}

.user-password-form{
  flex:1 0 100%;
  display:flex;
  justify-content:flex-end;
  gap:8px;
  padding-top:10px;
}

.user-password-form[hidden]{
  display:none;
}

.user-password-input{
  min-width:260px;
  border:1px solid var(--line);
  background:#fff;
  border-radius:10px;
  padding:9px 11px;
  font:inherit;
}

@media(max-width:800px){
  .user-admin-row{
    flex-wrap:wrap;
  }

  .user-admin-actions{
    width:100%;
    margin-left:0;
  }

  .user-password-form{
    justify-content:flex-start;
    flex-wrap:wrap;
  }

  .user-password-input{
    min-width:0;
    width:100%;
  }
}

.user-role-select{
  border:1px solid var(--line);
  background:#fff;
  border-radius:8px;
  padding:6px 9px;
  font:inherit;
  font-size:13px;
  color:var(--ink);
}

/* Connector V1 */
.connector-card{border:1px solid var(--line);border-radius:14px;padding:18px;margin-bottom:20px;background:#fff}.connector-card h3{margin-top:0}.connector-hint{color:var(--muted);font-size:13px}.connector-form{display:grid;grid-template-columns:1fr 1fr;gap:12px}.connector-form label{display:flex;flex-direction:column;gap:6px;font-size:12px;color:var(--muted)}.connector-form label[hidden]{display:none}.connector-form input{border:1px solid var(--line);border-radius:10px;padding:10px 12px;font:inherit;color:var(--ink)}.connector-actions{grid-column:1/-1;display:flex;gap:8px}@media(max-width:800px){.connector-form{grid-template-columns:1fr}}
.connector-guide-row{display:flex;justify-content:flex-start;margin:0 0 10px}.connector-guide-button{display:inline-flex;align-items:center;text-decoration:none;padding:8px 13px;border-radius:10px}

/* Feedback/Idee Buttons + Modal */
.feedback-actions{
  display:flex;
  gap:8px;
  margin-top:6px;
}

.feedback-btn{
  border:1px solid var(--line);
  background:#fff;
  border-radius:999px;
  padding:4px 12px;
  font:inherit;
  font-size:12px;
  color:var(--muted);
  cursor:pointer;
}

.feedback-btn:hover{
  background:var(--soft);
  color:var(--ink);
}

.feedback-btn.active{
  background:var(--ink);
  border-color:var(--ink);
  color:#fff;
}

.feedback-btn.active:hover{
  background:var(--ink);
  color:#fff;
}

.feedback-btn[aria-label]{
  position:relative;
}

.feedback-btn[aria-label]:hover::after{
  content:attr(aria-label);
  position:absolute;
  top:100%;
  left:0;
  margin-top:6px;
  padding:4px 10px;
  background:var(--ink);
  color:#fff;
  font-size:11px;
  white-space:nowrap;
  border-radius:6px;
  z-index:30;
  pointer-events:none;
}

.modal-overlay{
  position:fixed;
  inset:0;
  z-index:100;
  background:rgba(0,0,0,.35);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  box-sizing:border-box;
}

.modal-overlay[hidden]{
  display:none !important;
}

.modal-box{
  width:100%;
  max-width:420px;
  background:#fff;
  border-radius:14px;
  padding:20px;
  box-sizing:border-box;
  box-shadow:0 20px 60px rgba(0,0,0,.25);
}

.modal-box h3{
  margin:0 0 12px;
}

.modal-box textarea{
  width:100%;
  min-height:120px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px 12px;
  font:inherit;
  box-sizing:border-box;
  resize:vertical;
}

.modal-status{
  min-height:18px;
  font-size:12px;
  color:var(--muted);
  margin-top:8px;
}

.modal-status.error{
  color:var(--danger);
}

.modal-status.ok{
  color:var(--ok);
}

.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:12px;
}

@media(max-width:800px){
  .feedback-actions{
    flex-wrap:wrap;
  }
}

/* Sidebar Datei-Zaehler */
.nav-badge{
  margin-left:auto;
  background:var(--ink);
  color:#fff;
  font-size:11px;
  line-height:1;
  padding:2px 7px;
  border-radius:999px;
  min-width:18px;
  text-align:center;
}

.nav-badge[hidden]{
  display:none !important;
}

/* "Me"-Uebersicht */
.me-stage{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:30px;
  padding:20px 0 10px;
  min-height:100%;
}
.me-sys{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  width:100%;
  max-width:420px;
}
.me-sys-eyebrow{
  font-family:'JetBrains Mono',monospace;
  font-size:10px;
  letter-spacing:.15em;
  color:var(--muted);
  text-transform:none;
}
.me-sys-greeting{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  text-align:center;
}
.me-sys-greeting-line{
  margin:0;
  font-size:14px;
  color:var(--muted);
}
.me-sys-greeting-name{
  margin:0;
  font-size:22px;
  font-weight:700;
  color:var(--gold);
  letter-spacing:-.01em;
}
.me-sys-input{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  background:#fff;
  border:1px solid #cfcac3;
  border-radius:16px;
  padding:10px 10px 10px 16px;
  box-shadow:0 8px 24px rgba(0,0,0,.035);
}
.me-sys-input span{
  flex:1 1 auto;
  font-size:13px;
  color:var(--muted);
  font-style:italic;
}
.me-sys-input-field{
  flex:1 1 auto;
  font-size:13px;
  color:var(--ink);
  font-family:inherit;
  border:0;
  outline:0;
  background:transparent;
  padding:0;
}
.me-sys-input-field::placeholder{
  color:var(--muted);
  font-style:italic;
}
.me-sys-reply{
  width:100%;
  background:#fff;
  border:1px solid #cfcac3;
  border-radius:16px;
  padding:12px 16px;
  font-size:13px;
  color:var(--ink);
  white-space:pre-wrap;
  box-shadow:0 8px 24px rgba(0,0,0,.035);
}
.me-sys-reply-toggle{
  display:inline-flex;
  align-items:center;
  gap:4px;
  border:0;
  background:transparent;
  padding:2px 4px;
  font-size:11px;
  color:var(--muted);
  cursor:pointer;
  font-family:inherit;
}
.me-sys-reply-toggle:hover{
  color:var(--ink);
}
.me-sys-reply-toggle-icon{
  display:inline-block;
  font-size:9px;
  transition:transform .15s ease;
}
.me-sys-reply-toggle.collapsed .me-sys-reply-toggle-icon{
  transform:rotate(-90deg);
}
.me-sys-mic{
  border:0;
  padding:0;
  width:34px;
  height:34px;
  border-radius:50%;
  background:var(--soft);
  display:grid;
  place-items:center;
  flex:0 0 34px;
  color:var(--ink);
  cursor:pointer;
  transition:background .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease;
}
.carmen-voice-orb{
  width:44px;
  height:44px;
  flex-basis:44px;
  color:#fff;
  background:linear-gradient(145deg,#3f9cff 0%,#1676ee 55%,#075fd1 100%);
  box-shadow:0 8px 20px rgba(22,118,238,.28),inset 0 1px 0 rgba(255,255,255,.28);
}
.carmen-voice-orb:hover{
  box-shadow:0 10px 24px rgba(22,118,238,.34),inset 0 1px 0 rgba(255,255,255,.3);
}
.me-sys-mic:hover{
  transform:translateY(-1px);
}
.me-sys-mic:focus-visible{
  outline:2px solid var(--ink);
  outline-offset:2px;
}
.me-sys-mic.is-listening{
  background:linear-gradient(145deg,#3096ff,#0868df);
  color:#fff;
  box-shadow:0 0 0 5px rgba(22,118,238,.16);
  animation:carmen-mic-pulse 1.35s ease-in-out infinite;
}
.me-sys-mic.is-speaking{
  background:linear-gradient(145deg,#25a6ff,#156fe9);
  color:#fff;
  box-shadow:0 0 0 5px rgba(22,118,238,.16);
}
.me-sys-mic:disabled{
  cursor:not-allowed;
  opacity:.45;
  transform:none;
}
@keyframes carmen-mic-pulse{
  0%,100%{box-shadow:0 0 0 4px rgba(22,118,238,.12),0 8px 20px rgba(22,118,238,.24)}
  50%{box-shadow:0 0 0 9px rgba(22,118,238,.2),0 8px 22px rgba(22,118,238,.3)}
}
.carmen-learning-controls{
  width:100%;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}
.carmen-mode-label{
  font-size:11px;
  color:var(--muted);
}
.carmen-mode-select,
.carmen-start-lesson{
  min-height:34px;
  border:1px solid #cfcac3;
  border-radius:10px;
  background:#fff;
  color:var(--ink);
  font:inherit;
  font-size:12px;
}
.carmen-mode-select{
  flex:1 1 170px;
  padding:0 30px 0 10px;
}
.carmen-start-lesson{
  padding:0 12px;
  cursor:pointer;
  font-weight:600;
}
.carmen-start-lesson:hover{
  background:var(--soft);
}
.carmen-start-lesson:disabled{
  cursor:wait;
  opacity:.55;
}
.carmen-voice-meta{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  flex-wrap:wrap;
  gap:12px;
}
.carmen-voice-status{
  flex:1 0 100%;
  width:100%;
  min-height:18px;
  font-size:11px;
  line-height:1.45;
  color:var(--muted);
}
.carmen-voice-status.is-active{
  color:#315f52;
  font-weight:600;
}
.carmen-voice-status.is-error{
  color:#9e332b;
}
.carmen-ai-voice{
  flex:0 0 auto;
  font-size:10px;
  color:var(--muted);
  padding-left:15px;
  position:relative;
}
.carmen-ai-voice::before{
  content:'';
  position:absolute;
  left:0;
  top:50%;
  width:7px;
  height:7px;
  margin-top:-3.5px;
  border-radius:50%;
  background:#1676ee;
}
@media (max-width:600px){
  .carmen-learning-controls{align-items:stretch}
  .carmen-mode-label{width:100%}
  .carmen-mode-select,.carmen-start-lesson{flex:1 1 100%}
  .carmen-voice-meta{align-items:flex-start;flex-direction:column;gap:2px}
}
.me-table{
  position:relative;
  width:1050px;
  height:480px;
  flex:0 0 auto;
  margin-top:56px;
  transform:scale(0.8);
  transform-origin:top center;
}
.me-seat{
  position:absolute;
  width:84px;
  height:84px;
  border-radius:50%;
  background:#fff;
  border:1.5px dashed var(--line);
  display:grid;
  place-items:center;
  color:var(--muted);
}
.me-logo-dot-label{
  appearance:none;
  width:50px;
  height:50px;
  padding:0;
  border:0;
  border-radius:50%;
  background:transparent;
  font-family:inherit;
  display:grid;
  place-items:center;
  position:absolute;
  left:524.55px;
  top:115.84px;
  transform:translate(-50%,-50%);
  font-size:16px;
  font-weight:600;
  color:#1a1a1a;
  z-index:1;
  pointer-events:auto;
  cursor:pointer;
  line-height:1;
}
.me-logo-dot-label:focus-visible{
  outline:2px solid var(--accent);
  outline-offset:3px;
}
.mmai-hover-tip{
  position:fixed;
  left:0;
  top:0;
  transform:translate(-50%,0);
  background:#1a1a1a;
  color:#fff;
  font-size:12px;
  font-weight:400;
  white-space:nowrap;
  padding:5px 9px;
  border-radius:6px;
  pointer-events:none;
  opacity:0;
  z-index:9999;
  transition:opacity .1s ease;
}
.mmai-hover-tip-visible{
  opacity:1;
}
.me-node{
  position:absolute;
  left:474.5px;
  top:175.07px;
  width:101px;
  height:101px;
  border-radius:50%;
  background:var(--dark);
  display:grid;
  place-items:center;
  box-shadow:0 0 0 3px var(--gold),0 14px 34px rgba(24,20,15,.18);
  cursor:pointer;
  border:0;
  padding:0;
}
.me-node span{
  color:#fff;
  font-size:16px;
  letter-spacing:-.01em;
  font-weight:600;
}
.me-node-label{
  position:absolute;
  left:0;
  top:302.5px;
  width:100%;
  text-align:center;
  font-family:'JetBrains Mono',monospace;
  font-size:11.25px;
  letter-spacing:.1em;
  color:var(--muted);
  text-transform:none;
}
.me-agents-btn{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:-16.56px;
  background:var(--dark);
  color:#fff;
  border-radius:999px;
  padding:12px 20px;
  border:0;
  cursor:pointer;
  font-size:13px;
  font-weight:600;
  font-family:inherit;
}
.agents-modal-box{
  max-width:480px;
}
.agents-modal-list{
  display:flex;
  flex-direction:column;
  gap:14px;
  margin:14px 0 4px;
  max-height:60vh;
  overflow-y:auto;
}
.agents-modal-item{
  display:flex;
  align-items:flex-start;
  gap:12px;
}
.agents-modal-item .avatar{
  flex:0 0 38px;
}
.agents-modal-item-text{
  display:flex;
  flex-direction:column;
  gap:3px;
  min-width:0;
}
.agents-modal-item-text strong{
  font-size:14px;
}
.agents-modal-item-text span{
  font-size:12px;
  color:var(--muted);
  line-height:1.5;
}

.agents-page-list{
  display:flex;
  flex-direction:column;
  gap:16px;
  max-width:640px;
}
.agents-page-item{
  display:flex;
  align-items:flex-start;
  gap:14px;
  padding:16px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
}
.agents-page-item .avatar{
  flex:0 0 38px;
}
.agents-page-item-text{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}
.agents-page-item-text strong{
  font-size:15px;
}
.agents-page-item-text span{
  font-size:13px;
  color:var(--muted);
  line-height:1.55;
}

.agents-stage{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:14px;
  min-height:100%;
  width:100%;
}
.agents-page-head{
  text-align:center;
  border-bottom:0;
  padding-bottom:0;
  margin-bottom:0;
}
.agents-page-head > div{
  display:flex;
  flex-direction:column;
  align-items:center;
}


@media(max-width:800px){
  .me-table{
    transform:scale(0.9);
    transform-origin:top center;
    margin-top:56px;
  }
  .me-agents-btn{
    margin-top:14px;
  }
}

.me-seat{
  cursor:pointer;
  transition:border-color .15s ease, background .15s ease;
}
.me-seat:hover{
  border-color:var(--dark);
}
.me-seat.me-seat-occupied{
  cursor:default;
  border-style:solid;
}
.me-seat.me-seat-occupied:hover{
  border-color:var(--line);
}
.me-seat .avatar{
  flex:0 0 72px;
  width:72px;
  height:72px;
  font-size:24px;
}
.me-seat-leave-btn{
  position:absolute;
  top:50%;
  right:-39px;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  min-width:30px;
  min-height:30px;
  border-radius:50%;
  background:#fff;
  border:1.5px solid var(--line);
  color:var(--muted);
  font-size:21px;
  line-height:1;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding:0;
  font-family:inherit;
  -webkit-appearance:none;
  appearance:none;
}
.me-seat-leave-btn:hover{
  border-color:var(--dark);
  color:var(--dark);
}
.me-seat-right .me-seat-leave-btn{
  left:-39px;
  right:auto;
}
.me-table>div:nth-of-type(2) .me-seat-leave-btn{
  top:auto;
  bottom:-39px;
  right:auto;
  left:50%;
  transform:translateX(-50%);
}
.me-table>div:nth-of-type(5) .me-seat-leave-btn{
  top:-39px;
  bottom:auto;
  right:auto;
  left:50%;
  transform:translateX(-50%);
}
.me-table>div:nth-of-type(5) .me-seat-name{
  bottom:auto;
  top:100%;
}
.me-seat-name{
  position:absolute;
  bottom:100%;
  left:50%;
  transform:translateX(-50%);
  margin-bottom:0;
  width:max-content;
  max-width:130px;
  text-align:center;
  font-family:'JetBrains Mono',monospace;
  font-size:16.5px;
  font-weight:600;
  letter-spacing:.02em;
  color:var(--ink);
  pointer-events:auto;
  white-space:nowrap;
}
.agents-modal-item{
  align-items:center;
}
.seat-picker-sit-btn{
  flex:0 0 auto;
  background:var(--dark);
  color:#fff;
  border:0;
  border-radius:999px;
  padding:8px 14px;
  font-size:12px;
  font-weight:600;
  font-family:inherit;
  cursor:pointer;
}
.seat-picker-sit-btn:disabled{
  opacity:.6;
  cursor:default;
}

.idea-reply-box{
  margin-top:18px;
  padding-top:16px;
  border-top:1px solid var(--line);
  display:flex;
  flex-direction:column;
  gap:8px;
  max-width:640px;
}
.idea-reply-box label{
  font-size:12px;
  font-weight:600;
  color:var(--muted);
}
.idea-reply-box textarea{
  font-family:inherit;
  font-size:14px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  resize:vertical;
}
.idea-reply-box button{
  align-self:flex-start;
  background:var(--dark);
  color:#fff;
  border:0;
  border-radius:999px;
  padding:9px 18px;
  font-size:13px;
  font-weight:600;
  font-family:inherit;
  cursor:pointer;
}
.idea-reply-box button:disabled{
  opacity:.6;
  cursor:default;
}
.idea-reply-status{
  margin:0;
  font-size:12px;
  color:var(--muted);
}

.chat-inbox-row{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin:0 0 8px;
}

.me-logo-bg{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  height:502px;
  width:auto;
  max-width:none;
  opacity:0.1;
  pointer-events:none;
  z-index:0;
}


/* Owner: API-Tokenverbrauch pro Nutzer */
.user-api-usage{
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
  width:100%;
}
.user-api-usage span{
  display:inline-flex;
  align-items:baseline;
  gap:4px;
  padding:4px 8px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface-soft, var(--soft));
  font-size:11px;
}
.user-api-usage b{
  color:var(--text, #111);
  font-family:'JetBrains Mono',monospace;
  font-size:12px;
}


/* Owner: wöchentliches API-Tokenlimit */
.user-token-limit{width:100%;max-width:560px;display:flex;flex-direction:column;gap:6px}
.user-token-limit-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.user-token-limit-head select{max-width:190px}
.user-token-progress{height:7px;overflow:hidden;border-radius:999px;background:var(--line)}
.user-token-progress i{display:block;height:100%;border-radius:inherit;background:var(--ok);transition:width .2s ease}
.user-token-limit.warning .user-token-progress i{background:#d59b22}
.user-token-limit.critical .user-token-progress i,.user-token-limit.blocked .user-token-progress i{background:var(--danger)}
.user-token-limit small{color:var(--muted);font-size:11px}
@media(max-width:800px){.user-token-limit-head{align-items:flex-start;flex-direction:column}.user-token-limit-head select{max-width:100%;width:100%}}


/* System: persönlicher API-Tokenverbrauch */
.personal-token-status{grid-column:1/-1;display:flex;flex-direction:column;gap:8px}
.personal-token-status strong{font-size:18px;color:var(--text, #111)}
.personal-token-status span{color:var(--muted);font-size:12px}
.personal-token-progress{height:9px;overflow:hidden;border-radius:999px;background:var(--line)}
.personal-token-progress i{display:block;height:100%;border-radius:inherit;background:var(--ok);transition:width .2s ease}
.personal-token-status.warning .personal-token-progress i{background:#d59b22}
.personal-token-status.critical .personal-token-progress i,.personal-token-status.blocked .personal-token-progress i{background:var(--danger)}


/* Saul Goodman: eigenes Paragraphen-Icon */
.avatar.saul-icon{
  font-family:Georgia,'Times New Roman',serif;
  font-size:22px;
  font-weight:700;
  line-height:1;
  letter-spacing:-.03em;
}


/* BuFi: Büffel-Markenicon aus dem System-Vault */
.avatar.bufi-icon{
  overflow:hidden;
  padding:0;
  background:#171818;
}
.avatar.bufi-icon img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:50%;
}


/* Eigene reduzierte Symbole der Fachagenten */
.avatar.agent-symbol-icon svg{
  width:22px;
  height:22px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.avatar.agent-symbol-icon[aria-label="Flugzeug"] svg{
  fill:currentColor;
  stroke:none;
}


/* Fachagenten-Symbole: besser lesbare Groessen */
.avatar.agent-symbol-icon svg{
  width:27px;
  height:27px;
}
.me-table .me-seat-occupied .avatar.agent-symbol-icon svg{
  width:40px;
  height:40px;
  stroke-width:1.65;
}
.avatar.saul-icon{
  font-size:27px;
}
.me-table .me-seat-occupied .avatar.saul-icon{
  font-size:40px;
}


/* MMAi Community Pool */
.community-pool-panel{margin:0 0 18px}
.community-pool-card{padding:22px;border:1px solid rgba(0,0,0,.055);border-radius:var(--radius-md);background:var(--surface-soft);box-shadow:var(--shadow-card)}
.community-pool-title{margin:0 0 14px;color:var(--ink);font-size:17px;line-height:1.3}
.community-pool-balance-label{margin-bottom:5px;color:var(--muted);font-size:13px}
.community-pool-card>strong{display:block;font-size:30px;line-height:1.1;color:var(--ok)}
.community-pool-card>span{display:block;margin-top:8px;color:var(--muted);font-size:12px}
.community-pool-cost-heading{margin:20px 0 0;padding-top:18px;border-top:1px solid var(--line);color:var(--ink);font-size:17px;line-height:1.3}
.community-pool-costs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin-top:12px}
.community-pool-cost-item{padding:15px;border:1px solid var(--line);border-radius:11px;background:#fff}
.community-pool-cost-item small{display:block;color:var(--muted);font-size:12px}
.community-pool-cost-item strong{display:block;margin-top:5px;color:var(--ink);font-size:18px;line-height:1.25}
.community-pool-cost-item span{display:block;margin-top:7px;color:var(--muted);font-size:11px;line-height:1.45}
.community-pool-cost-note{margin:9px 0 0;color:var(--muted);font-size:10px}
.community-pool-support{margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}
.community-pool-support h3{margin:0 0 12px;color:var(--ink);font-size:17px;line-height:1.3}
.community-pool-support details{max-width:720px}
.community-pool-support summary{display:inline-flex;min-height:40px;align-items:center;padding:8px 13px;border:1px solid var(--line);border-radius:9px;background:#fff;cursor:pointer;font-weight:600;list-style:none}
.community-pool-support summary::-webkit-details-marker{display:none}
.community-pool-bank-details{display:grid;gap:10px;margin-top:12px;padding:15px;border:1px solid var(--line);border-radius:11px;background:#fff}
.community-pool-bank-details>div{display:grid;grid-template-columns:minmax(110px,150px) minmax(0,1fr) auto;gap:10px;align-items:center}
.community-pool-bank-details span{color:var(--muted);font-size:11px}
.community-pool-bank-details strong{font-size:13px;overflow-wrap:anywhere}
.community-pool-bank-details button{min-height:34px;padding:6px 10px}
.community-pool-iban{font-family:'JetBrains Mono',monospace;font-weight:600}
.community-pool-support details>p{margin:10px 0 0;color:var(--muted);font-size:11px;line-height:1.45}
.community-pool-copy-message{display:block;min-height:16px;margin-top:5px;color:var(--ok);font-size:11px}
.community-pool-owner{max-width:520px;margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}
.community-pool-owner label{display:block;margin-bottom:7px;color:var(--muted);font-size:12px}
.community-pool-owner>div{display:flex;gap:8px;align-items:center}
.community-pool-owner input{width:170px;min-height:40px;padding:8px 11px;border:1px solid var(--line);border-radius:9px;background:#fff;font:inherit}
.community-pool-owner button{min-height:40px;padding:8px 13px;border:1px solid var(--line);background:#fff;cursor:pointer}
.community-pool-owner p{min-height:18px;margin:7px 0 0;color:var(--muted);font-size:12px}
@media(max-width:760px){.community-pool-costs{grid-template-columns:1fr}.community-pool-bank-details>div{grid-template-columns:1fr}.community-pool-bank-details button{justify-self:start}.community-pool-owner>div{align-items:stretch;flex-direction:column}.community-pool-owner input{width:100%}}
.community-pool-transactions{margin-top:20px;padding-top:18px;border-top:1px solid var(--line)}
.community-pool-tx-heading{margin:0 0 10px;color:var(--ink);font-size:15px;line-height:1.3}
.community-pool-tx-heading:not(:first-child){margin-top:18px}
.community-pool-tx-list{display:flex;flex-direction:column;margin:0;padding:0;list-style:none;border:1px solid var(--line);border-radius:11px;overflow:hidden;background:#fff}
.community-pool-tx-row{display:flex;align-items:center;gap:10px;padding:10px 13px;border-top:1px solid var(--line)}
.community-pool-tx-row:first-child{border-top:none}
.community-pool-tx-dot{width:7px;height:7px;border-radius:50%;background:var(--ok);flex:none}
.community-pool-tx-dot--out{background:var(--muted)}
.community-pool-tx-main{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}
.community-pool-tx-label{color:var(--ink);font-size:12.5px;overflow-wrap:anywhere}
.community-pool-tx-date{color:var(--muted);font-size:11px}
.community-pool-tx-amount{font-family:'JetBrains Mono',monospace;font-weight:600;font-size:13px;white-space:nowrap}
.community-pool-tx-amount--in{color:var(--ok)}
.community-pool-tx-amount--out{color:var(--ink)}
.community-pool-tx-empty{margin:0;color:var(--muted);font-size:12px}
.uploads-upload-bar{display:flex;align-items:center;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.uploads-upload-status{color:var(--muted);font-size:12px}


/* MMAi 2FA confirmation clarity 2026-09-06 */
.two-factor-code-instruction{
  margin:14px 0 8px;
  font-weight:600;
}
.two-factor-confirm-form{
  display:grid;
  grid-template-columns:minmax(160px,220px) auto;
  gap:7px 10px;
  align-items:end;
  max-width:520px;
}
.two-factor-code-label{
  grid-column:1 / -1;
  font-weight:650;
}
.two-factor-code-input{
  box-sizing:border-box;
  width:100%;
  min-height:44px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius:10px;
  background:#fff;
  color:#111;
  font-size:18px;
  letter-spacing:.18em;
}
.two-factor-code-input:focus{
  outline:3px solid rgba(0,122,255,.2);
  border-color:#007aff;
}
.two-factor-code-help{
  grid-column:1 / -1;
  color:var(--muted);
  line-height:1.35;
}
#twoFactorConfirmForm .two-factor-confirm-button,
#twoFactorEmailConfirmForm .two-factor-confirm-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:auto;
  min-width:150px;
  min-height:44px;
  padding:10px 15px;
  color:#111;
  font-size:15px;
  font-weight:650;
  line-height:1.2;
  white-space:nowrap;
}
@media(max-width:600px){
  .two-factor-confirm-form{
    grid-template-columns:1fr;
    align-items:stretch;
  }
  .two-factor-code-label,
  .two-factor-code-help{
    grid-column:1;
  }
  #twoFactorConfirmForm .two-factor-confirm-button,
  #twoFactorEmailConfirmForm .two-factor-confirm-button{
    width:100%;
    margin-top:4px;
  }
}
.encryption-setup .encryption-recovery-box{border:2px solid #d59b22;background:#fdf6e8}
.encryption-setup .encryption-recovery-code{font-family:'JetBrains Mono',monospace;font-size:16px;letter-spacing:.05em;background:#fff;border:1px solid var(--line);border-radius:8px;padding:10px 12px;margin:10px 0;word-break:break-all}
.encryption-setup .encryption-recovery-confirm{display:flex;align-items:flex-start;gap:8px;margin-top:10px;font-size:13px}

/* Helfried: reduzierte Gesundheitsansicht */
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}
#helfriedView{
  max-width:1180px;
}
.helfried-workspace{
  display:flex;
  flex-direction:column;
  gap:18px;
  width:100%;
}
.helfried-local-nav{
  display:flex;
  align-items:center;
  gap:6px;
  overflow-x:auto;
  padding-bottom:2px;
  color:var(--muted);
  font-size:12px;
}
.helfried-local-nav > *{
  flex:0 0 auto;
  border:0;
  border-radius:999px;
  background:transparent;
  color:inherit;
  padding:7px 11px;
  font:inherit;
}
.helfried-local-nav button{
  cursor:pointer;
}
.helfried-local-nav button:hover{
  background:#fff;
  color:var(--ink);
}
.helfried-local-nav small{
  margin-left:4px;
  opacity:.7;
}
.helfried-local-nav-active{
  background:var(--dark);
  color:#fff;
}
.helfried-local-nav-later{
  opacity:.58;
}
.helfried-today{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:28px;
  padding:20px 22px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(255,255,255,.62);
}
.helfried-kicker{
  margin:0 0 5px;
  color:var(--muted);
  font-family:'JetBrains Mono',monospace;
  font-size:10px;
  letter-spacing:.12em;
  text-transform:uppercase;
}
.helfried-today h2{
  margin:0 0 6px;
  font-size:24px;
  line-height:1.15;
}
.helfried-today p:not(.helfried-kicker){
  max-width:680px;
  margin:0;
  color:var(--muted);
  font-size:13px;
  line-height:1.5;
}
.helfried-primary-action{
  flex:0 0 auto;
  min-height:40px;
  border:0;
  border-radius:11px;
  background:var(--dark);
  color:#fff;
  padding:10px 15px;
  font:inherit;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
}
.helfried-primary-action:hover{
  opacity:.9;
}
.helfried-checkin-actions{ display:flex; flex:0 0 auto; flex-direction:column; align-items:center; gap:10px; }
.helfried-checkin-note{ display:block; margin-top:10px; color:var(--muted); font-size:11px; }

.helfried-dashboard-grid{
  display:grid;
  grid-template-columns:minmax(0,1.55fr) minmax(260px,.85fr);
  gap:16px;
  align-items:start;
}
.helfried-panel{
  min-width:0;
  border:1px solid var(--line);
  border-radius:16px;
  background:#fff;
  box-shadow:0 8px 24px rgba(0,0,0,.025);
}
.helfried-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.helfried-panel-head h3{
  margin:0;
  font-size:17px;
  letter-spacing:-.025em;
}
.helfried-chat-panel{
  display:flex;
  flex-direction:column;
  min-height:520px;
  padding:18px;
}
.helfried-text-action{
  border:0;
  background:transparent;
  color:var(--muted);
  padding:3px;
  font:inherit;
  font-size:12px;
  cursor:pointer;
}
.helfried-text-action:hover{
  color:var(--ink);
}
.helfried-messages{
  flex:1 1 auto;
  min-height:280px;
  max-height:480px;
  overflow-y:auto;
  display:flex;
  flex-direction:column;
  gap:14px;
  margin:16px -4px 12px 0;
  padding:2px 8px 2px 0;
}
.helfried-message{
  display:flex;
  align-items:flex-start;
  gap:9px;
}
.helfried-message.user{
  justify-content:flex-end;
}
.helfried-message-avatar{
  display:grid;
  place-items:center;
  flex:0 0 28px;
  width:28px;
  height:28px;
  border-radius:50%;
  background:#847f75;
  color:#fff;
  font-size:11px;
  font-weight:650;
}
.helfried-bubble{
  max-width:82%;
  border:1px solid var(--line);
  border-radius:4px 13px 13px 13px;
  background:var(--bg);
  padding:10px 12px;
  color:var(--ink);
  font-size:13px;
  line-height:1.55;
  overflow-wrap:anywhere;
}
.helfried-message.user .helfried-bubble{
  border-color:var(--dark);
  border-radius:13px 4px 13px 13px;
  background:var(--dark);
  color:#fff;
  white-space:pre-wrap;
}
.helfried-message.loading .helfried-bubble{
  color:var(--muted);
  font-style:italic;
}
.helfried-message.error .helfried-bubble{
  border-color:rgba(194,104,95,.3);
  background:rgba(194,104,95,.08);
}
.helfried-bubble p{
  margin:0 0 8px;
}
.helfried-bubble p:last-child{
  margin-bottom:0;
}
.helfried-bubble ul{
  margin:0;
  padding-left:18px;
}
.helfried-chat-status{
  min-height:17px;
  margin:0 2px 7px;
  color:var(--muted);
  font-size:11px;
}
.helfried-chat-status.error{
  color:var(--danger);
}
.helfried-composer{
  display:flex;
  align-items:flex-end;
  gap:8px;
  border:1px solid #cfcac3;
  border-radius:14px;
  background:#fff;
  padding:8px;
}
.helfried-composer textarea{
  flex:1 1 auto;
  min-width:0;
  min-height:40px;
  max-height:130px;
  resize:vertical;
  border:0;
  outline:0;
  background:transparent;
  color:var(--ink);
  padding:8px 7px;
  font:inherit;
  font-size:14px;
}
.helfried-composer textarea::placeholder{
  color:var(--muted);
}
.helfried-composer button{
  display:grid;
  place-items:center;
  flex:0 0 40px;
  width:40px;
  height:40px;
  border:0;
  border-radius:11px;
  background:var(--dark);
  color:#fff;
  font-size:19px;
  cursor:pointer;
}
.helfried-composer button:disabled{
  cursor:not-allowed;
  opacity:.45;
}
.helfried-composer .helfried-mic-btn{
  border:1px solid #d8d3cc;
  background:var(--soft);
  color:var(--ink);
  transition:background .18s ease,color .18s ease,box-shadow .18s ease,transform .18s ease;
}
.helfried-composer .helfried-mic-btn:hover:not(:disabled){
  transform:translateY(-1px);
  background:#e9e5df;
}
.helfried-composer .helfried-mic-btn:focus-visible,
.helfried-composer #helfriedSendBtn:focus-visible{
  outline:2px solid var(--ink);
  outline-offset:2px;
}
.helfried-composer .helfried-mic-btn.is-listening{
  border-color:#1976df;
  background:linear-gradient(145deg,#3096ff,#0868df);
  color:#fff;
  box-shadow:0 0 0 5px rgba(22,118,238,.16);
  animation:helfried-mic-pulse 1.35s ease-in-out infinite;
}
@keyframes helfried-mic-pulse{
  0%,100%{box-shadow:0 0 0 4px rgba(22,118,238,.12)}
  50%{box-shadow:0 0 0 9px rgba(22,118,238,.2)}
}
.helfried-voice-status{
  min-height:17px;
  margin:7px 2px 0;
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
}
.helfried-voice-status.is-active{
  color:#1468c7;
}
.helfried-voice-status.is-error{
  color:var(--danger);
}
.helfried-voice-note{
  margin:1px 2px 0;
  color:var(--muted);
  font-size:10px;
  line-height:1.45;
}
.helfried-side-column{
  display:flex;
  flex-direction:column;
  gap:16px;
}
.helfried-compact-panel{
  padding:17px;
}
.helfried-readonly-badge,
.helfried-unavailable-badge,
.helfried-memory-badge{
  flex:0 0 auto;
  border-radius:999px;
  padding:4px 7px;
  background:var(--soft);
  color:var(--muted);
  font-size:10px;
  font-weight:600;
}
.helfried-memory-badge{
  color:#315f50;
  background:#edf7f3;
  border-color:#cce5da;
}
.helfried-picture-source{
  margin:13px 0 10px;
  color:var(--muted);
  font-size:11px;
  line-height:1.45;
}
.helfried-picture-source code{
  color:var(--ink);
  font-family:'JetBrains Mono',monospace;
  font-size:10px;
}
.helfried-picture-loading,
.helfried-picture-error{
  padding:18px 0;
  color:var(--muted);
  font-size:12px;
  line-height:1.5;
}
.helfried-picture-error{
  color:var(--danger);
}
.helfried-picture-summary{
  margin:0 0 10px;
  color:var(--muted);
  font-size:12px;
  line-height:1.45;
}
.helfried-picture-list{
  display:flex;
  flex-direction:column;
  border-top:1px solid var(--line);
}
.helfried-picture-row{
  display:grid;
  grid-template-columns:14px minmax(0,1fr);
  gap:7px;
  padding:9px 0;
  border-bottom:1px solid var(--line);
}
.helfried-picture-marker{
  padding-top:2px;
  color:var(--muted);
  font-size:9px;
}
.helfried-picture-row.known .helfried-picture-marker{
  color:var(--ok);
}
.helfried-picture-row strong{
  display:block;
  font-size:12px;
  line-height:1.35;
}
.helfried-picture-row p{
  margin:2px 0 0;
  color:var(--muted);
  font-size:11px;
  line-height:1.4;
}
.helfried-picture-row small{
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-family:'JetBrains Mono',monospace;
  font-size:9px;
  line-height:1.35;
  overflow-wrap:anywhere;
}
.helfried-picture-note{
  margin:10px 0 0;
  color:var(--muted);
  font-size:10px;
  line-height:1.45;
}
.helfried-memory{
  display:grid;
  gap:12px;
}
.helfried-memory-section{
  display:grid;
  gap:9px;
}
.helfried-memory-section h4{
  margin:0;
  color:#39453f;
  font-size:.84rem;
  letter-spacing:.01em;
}
.helfried-memory-item{
  display:grid;
  gap:8px;
  padding:11px;
  border:1px solid #e2e8e4;
  border-radius:12px;
  background:#fbfcfb;
}
.helfried-memory-item.proposal{
  border-color:#eadfbd;
  background:#fffdf7;
}
.helfried-memory-meta{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.helfried-memory-meta span{
  padding:3px 7px;
  border-radius:999px;
  background:#eef2ef;
  color:#526058;
  font-size:.68rem;
  font-weight:700;
}
.helfried-memory-item.proposal .helfried-memory-meta span:first-child{
  background:#f7edd3;
  color:#755d25;
}
.helfried-memory-statement{
  width:100%;
  box-sizing:border-box;
  resize:vertical;
  min-height:58px;
  padding:8px 9px;
  border:1px solid #dce3de;
  border-radius:9px;
  color:#26312b;
  background:#fff;
  font:inherit;
  font-size:.81rem;
  line-height:1.45;
}
.helfried-memory-statement:focus{
  outline:2px solid rgba(67,112,92,.2);
  border-color:#779b8b;
}
.helfried-memory-source{
  color:#748078;
  font-size:.7rem;
  line-height:1.4;
  overflow-wrap:anywhere;
}
.helfried-memory-actions{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
}
.helfried-memory-actions button{
  border:1px solid #456c5b;
  border-radius:8px;
  padding:6px 9px;
  background:#456c5b;
  color:#fff;
  font:inherit;
  font-size:.72rem;
  font-weight:700;
  cursor:pointer;
}
.helfried-memory-actions button.secondary{
  background:#fff;
  color:#536159;
  border-color:#d2dad5;
}
.helfried-memory-actions button.danger{
  background:#fff;
  color:#8b4949;
  border-color:#e4caca;
}
.helfried-memory-empty{
  padding:12px;
  border:1px dashed #d7ded9;
  border-radius:10px;
  color:#69756e;
  font-size:.78rem;
  line-height:1.5;
  background:#fafcfa;
}
.helfried-trend-empty{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:10px;
  margin-top:10px;
  padding:9px 0 0;
  color:var(--muted);
  font-size:10px;
}
.helfried-trend-empty strong{
  color:var(--ink);
  font-size:11px;
}
.helfried-action-state{
  margin-top:14px;
  padding-top:13px;
  border-top:1px solid var(--line);
}
.helfried-action-state strong{
  font-size:12px;
}
.helfried-action-state p{
  margin:5px 0 0;
  color:var(--muted);
  font-size:11px;
  line-height:1.5;
}
@media(max-width:900px){
  .helfried-dashboard-grid{
    grid-template-columns:1fr;
  }
  .helfried-side-column{
    display:grid;
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}
@media(max-width:650px){
  .helfried-today{
    align-items:flex-start;
    flex-direction:column;
    gap:15px;
    padding:17px;
  }
  .helfried-today h2{
    font-size:21px;
  }
  .helfried-primary-action{
    width:100%;
  }
  .helfried-side-column{
    display:flex;
  }
  .helfried-chat-panel{
    min-height:500px;
    padding:15px;
  }
  .helfried-messages{
    min-height:250px;
  }
  .helfried-bubble{
    max-width:88%;
  }
  .helfried-local-nav-later,
  .helfried-local-nav small{
    display:none;
  }
}

.contact-search{display:flex;flex-direction:column;gap:7px;max-width:460px;margin:18px 0 0;font-size:13px;color:var(--muted)}
.contact-search input{width:100%;box-sizing:border-box;border:1px solid var(--line);border-radius:12px;background:#fff;padding:12px 14px;color:var(--ink);font:inherit}
.contact-count{color:var(--muted);font-size:12px;margin:12px 0}
.contact-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,270px),1fr));gap:14px;width:100%}
.contact-card{display:flex;align-items:flex-start;gap:14px;padding:20px;min-height:120px;border:1px solid var(--line);border-radius:16px;background:#fff;text-align:left;color:var(--ink);font:inherit;cursor:pointer;transition:border-color .15s,box-shadow .15s}
.contact-card:hover{border-color:var(--muted);box-shadow:0 4px 18px rgba(0,0,0,.05)}
.contact-card:focus-visible,.contact-close:focus-visible,.contact-search input:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.contact-avatar{display:grid;place-items:center;width:44px;height:44px;flex:0 0 44px;border-radius:13px;background:#f2efe9;font-size:14px;font-weight:600}
.contact-card-text{display:flex;flex-direction:column;gap:5px;min-width:0;overflow-wrap:anywhere;font-size:13px;color:var(--muted)}
.contact-card-text strong{font-size:16px;color:var(--ink);line-height:1.4}
.contact-role{font-size:12px;color:#45624d;background:#edf3ed;padding:4px 8px;border-radius:7px;align-self:flex-start;width:fit-content;margin:5px 0 0}
.contact-dialog{box-sizing:border-box;border:1px solid var(--line);border-radius:22px;padding:28px;width:min(560px,calc(100vw - 28px));max-height:calc(100dvh - 40px);overflow:auto;color:var(--ink);background:#fff;box-shadow:0 20px 90px rgba(0,0,0,.18)}
.contact-dialog::backdrop{background:rgba(25,22,18,.4)}
.contact-close{display:block;margin:0 0 16px auto;padding:7px 0 7px 10px;background:none;border:0;color:var(--muted);font:inherit;font-size:13px;cursor:pointer}
.contact-kicker{font-size:11px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);margin:0 0 8px}
.contact-dialog h2{margin:0;font-size:27px;letter-spacing:-.025em;overflow-wrap:anywhere}
.contact-details{margin:24px 0 0}
.contact-details>div{padding:13px 0;border-top:1px solid var(--line)}
.contact-details dt{font-size:12px;color:var(--muted);margin-bottom:6px}
.contact-details dd{margin:0;font-size:15px;line-height:1.5;white-space:pre-line;overflow-wrap:anywhere}
.contact-details a{color:inherit;text-underline-offset:3px}
@media(max-width:480px){.contact-dialog{padding:20px}.contact-dialog h2{font-size:23px}}

/* Personal account dashboard */
.account-grid{display:grid;align-items:start;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;padding-bottom:24px}
.account-card{min-width:0;padding:0;background:#fff;border:1px solid var(--line);border-radius:16px}
.account-card h3{margin:0;font-size:17px;letter-spacing:-.02em}
.account-card p{font-size:13px;line-height:1.6;color:var(--muted);overflow-wrap:anywhere}
.account-facts{margin:0;display:grid;gap:18px}
.account-facts dt{font-size:12px;color:var(--muted);margin-bottom:5px}
.account-facts dd{margin:0;font-size:15px;overflow-wrap:anywhere}
.account-form{display:flex;flex-direction:column;gap:9px;min-width:0}
.account-form label{font-size:13px}
.account-form input:not([type="checkbox"]){width:100%;min-width:0;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--soft);font:inherit}
.account-form button{align-self:flex-start;margin-top:5px}
.account-form .account-check{display:flex;gap:9px;align-items:flex-start;line-height:1.5;margin-top:8px}
.account-check input{flex:0 0 auto;margin-top:4px}
.account-card .status-card{border:0;padding:0;background:transparent}
.account-card .two-factor-setup,.account-card .encryption-setup{margin:0}
.account-card summary{cursor:pointer;font-size:13px;font-weight:600;margin-top:22px}
.account-card meter{width:100%;height:14px}
.account-card button:disabled{opacity:.55;cursor:wait}
.account-card-toggle{width:100%;display:flex;align-items:center;justify-content:space-between;gap:18px;padding:24px;border:0;border-radius:16px;background:transparent;color:inherit;font:inherit;text-align:left;cursor:pointer}
.account-card-toggle:hover{background:var(--soft)}
.account-card-toggle:focus-visible{outline:2px solid var(--dark);outline-offset:3px}
.account-card-title{display:block;font-size:17px;font-weight:650;line-height:1.35}
.account-card-hint{display:block;margin-top:6px;font-size:12px;font-weight:400;line-height:1.5;color:var(--muted)}
.account-card-chevron{font-size:21px;flex:0 0 auto;transition:transform .15s}
.account-card.is-open .account-card-chevron{transform:rotate(180deg)}
.account-card-panel{padding:0 24px 24px}
.account-card-panel[hidden]{display:none}
@media(max-width:760px){.account-grid{grid-template-columns:1fr}.account-card-toggle{padding:18px}.account-card-panel{padding:0 18px 18px}}

/* Bill: a shared entrance for learning and Carmen's Spanish lessons. */
#billView [data-bill-panel][hidden]{display:none!important}
.bill-nav{display:flex;flex-direction:row;flex-wrap:wrap;gap:8px;padding-bottom:22px;border-bottom:1px solid var(--line);margin-bottom:28px;flex-shrink:0}
.bill-nav button,.bill-prompts button{font:inherit;font-size:13px;border:1px solid var(--line);background:transparent;color:var(--ink);border-radius:999px;padding:10px 15px;cursor:pointer}
.bill-nav button[aria-current],.bill-nav button:hover,.bill-prompts button:hover{background:var(--panel)}
.bill-nav button[aria-current]{border-color:var(--ink)}
.bill-intro{max-width:680px;margin:8px 0 30px}
.bill-kicker{font-family:'JetBrains Mono',monospace;font-size:10px;letter-spacing:.14em;color:var(--muted)}
.bill-intro h2{font-size:clamp(25px,4vw,36px);letter-spacing:-.04em;line-height:1.15;margin:12px 0}
.bill-intro>p:last-child{color:var(--muted);font-size:15px;line-height:1.7}
.bill-offers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.bill-offer{background:var(--panel);border:1px solid var(--line);border-radius:18px;padding:24px;display:flex;flex-direction:column;align-items:flex-start;gap:12px;min-width:0}
.bill-offer-primary{background:#eef2e7;border-color:#d4dfc5}
.bill-offer-icon{width:38px;height:38px;display:grid;place-items:center;background:rgba(24,20,15,.06);border-radius:11px;font-size:20px}
.bill-offer h3{font-size:18px;margin:5px 0 0;letter-spacing:-.025em}
.bill-offer p{margin:0 0 10px;color:var(--muted);font-size:14px;line-height:1.65}
.bill-offer button{margin-top:auto;width:100%;display:flex;justify-content:space-between;gap:8px;border:0;border-top:1px solid var(--line);padding:15px 0 0;background:transparent;color:var(--ink);font:inherit;font-size:13px;font-weight:600;text-align:left;cursor:pointer}
.bill-coming{display:inline-block;border-radius:999px;background:#f1ece1;color:#6c5b37;padding:5px 10px;font-size:11px}
.bill-starting-points{margin:32px 0 12px}.bill-starting-points h3{font-size:14px;font-weight:500;color:var(--muted)}
.bill-prompts{display:flex;gap:8px;flex-wrap:wrap}
.bill-tutorial-preview{border:1px solid var(--line);border-radius:16px;padding:26px;background:var(--panel);max-width:720px;font-size:14px;line-height:1.7}
.bill-tutorial-preview p,.bill-tutorial-preview li{color:var(--muted)}
.bill-tutorial-preview li{margin:8px 0}
#billCarmenPanel .agents-stage{min-height:0;padding-top:24px}
.bill-messages{display:flex;flex-direction:column;gap:16px;max-height:45vh;overflow-y:auto;padding:6px 0 20px}
.bill-message{border:1px solid var(--line);border-radius:14px;padding:16px 18px;background:var(--panel);max-width:90%;line-height:1.65;font-size:14px;overflow-wrap:anywhere}
.bill-message>strong{font-size:11px;letter-spacing:.04em;display:block;margin-bottom:6px;color:var(--muted)}
.bill-message-user{align-self:flex-end;background:#eef2e7;white-space:pre-wrap}
.bill-message-assistant{align-self:flex-start}.bill-message p:first-child{margin-top:0}.bill-message p:last-child{margin-bottom:0}.bill-message pre{overflow:auto;max-width:100%}
.bill-chat-form{margin-top:18px}.bill-chat-form label{display:block;font-size:13px;margin-bottom:9px}
.bill-compose{display:flex;gap:10px;align-items:flex-end}.bill-compose textarea{flex:1;min-width:0;resize:vertical;border:1px solid var(--line);border-radius:12px;padding:14px;background:var(--panel);color:var(--ink);font:inherit;font-size:14px}
.bill-compose button{border:0;border-radius:12px;padding:13px 18px;background:var(--dark);color:white;font:inherit;font-size:13px;cursor:pointer}
.bill-chat-status{font-size:13px;color:var(--muted);min-height:20px;line-height:1.5}
#billView button:disabled{opacity:.55;cursor:wait}#billView button:focus-visible,#billInput:focus-visible{outline:2px solid #71884b;outline-offset:3px}
@media(max-width:1000px){.bill-offers{grid-template-columns:1fr}.bill-offer{padding:20px}.bill-offer p{margin-bottom:0}.bill-intro h2{font-size:28px}}
@media(max-width:600px){.bill-nav{gap:6px;margin-bottom:20px}.bill-nav button{padding:9px 12px;font-size:12px}.bill-compose{align-items:stretch;flex-direction:column}.bill-message{max-width:100%}.bill-messages{max-height:43vh}#billView .section-head{gap:12px;flex-wrap:wrap}.bill-intro{margin-top:0}}


/* Carmen: voice controls stay reachable while only the transcript scrolls. */
#billCarmenPanel{flex:0 0 auto;min-width:0;overflow-anchor:none}
#billCarmenPanel .agents-stage{justify-content:flex-start;min-height:0}
#billCarmenPanel .me-sys{align-items:stretch;min-width:0;max-width:560px}
#billCarmenPanel .me-sys-input{box-sizing:border-box;min-width:0}
#carmenInput{min-width:0;width:100%}
.carmen-control-bar{position:sticky;top:0;z-index:5;display:flex;flex-direction:column;gap:8px;flex:0 0 auto;width:100%;box-sizing:border-box;padding:8px 0 12px;background:var(--bg);border-bottom:1px solid var(--line)}
.carmen-stop-btn{width:100%;min-height:44px;border:1px solid #983e35;border-radius:12px;background:#a64238;color:#fff;font:inherit;font-size:14px;font-weight:600;padding:11px 16px;cursor:pointer}
.carmen-stop-btn:hover{background:#87362f}.carmen-stop-btn[hidden]{display:none}
#billCarmenPanel .carmen-learning-controls{width:100%;box-sizing:border-box}
#billCarmenPanel .carmen-mode-select,#billCarmenPanel .carmen-start-lesson{min-width:0;max-width:100%;box-sizing:border-box}
#billCarmenPanel .carmen-voice-meta{min-width:0;flex-wrap:wrap;overflow-wrap:anywhere}
#carmenReplyToggleBtn{align-self:center;min-height:44px;padding:8px 12px}
#carmenReply{box-sizing:border-box;min-width:0;max-width:100%;max-height:min(36vh,320px);max-height:min(36dvh,320px);overflow-y:auto;overflow-x:hidden;overflow-wrap:anywhere;overscroll-behavior-y:contain;overflow-anchor:none;flex-shrink:0;-webkit-overflow-scrolling:touch}
#carmenReply pre{max-width:100%;overflow-x:auto;white-space:pre-wrap}#carmenReply:focus-visible{outline:2px solid #71884b;outline-offset:2px}
@media(max-width:600px){#carmenInput{font-size:16px}#billCarmenPanel .carmen-voice-status{font-size:12px;line-height:1.4}.carmen-control-bar{padding-top:6px}#billCarmenPanel .me-sys-greeting-line{font-size:13px}}

/* Helfried: transient photo attachment */
.helfried-photo-controls{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
.helfried-photo-controls button,.helfried-photo-preview button{border:1px solid #d8d3cc;border-radius:9px;background:var(--soft);color:var(--ink);padding:9px 12px;font:inherit;font-size:13px;cursor:pointer}
.helfried-photo-controls button:disabled,.helfried-photo-preview button:disabled{opacity:.45;cursor:not-allowed}
.helfried-photo-controls button:focus-visible,.helfried-photo-preview button:focus-visible{outline:2px solid var(--ink);outline-offset:2px}
.helfried-photo-preview{display:flex;align-items:center;gap:10px;padding:10px;border:1px solid #d8d3cc;border-radius:12px;margin:8px 0}
.helfried-photo-preview[hidden]{display:none}
.helfried-photo-preview img{width:76px;height:76px;object-fit:contain;border-radius:6px;background:#fff}
.helfried-photo-preview span{flex:1;min-width:0;overflow-wrap:anywhere;font-size:12px}
.helfried-photo-note{font-size:11px;line-height:1.5;color:var(--muted);margin:6px 2px 9px}

/* Helfried: separate topic pages, with the existing chat kept mounted. */
#helfriedView .helfried-topic-workspace{display:grid;grid-template-columns:154px minmax(0,1fr);gap:24px;align-items:start}
#helfriedView .helfried-topic-nav{display:flex;flex-direction:column;gap:8px;position:sticky;top:0;padding:4px 0}
#helfriedView .helfried-topic-nav button{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:12px 14px;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.65);color:var(--muted);font:inherit;font-size:13px;text-align:left;cursor:pointer}
#helfriedView .helfried-topic-nav button>span:first-child{font-size:18px;width:20px;text-align:center}
#helfriedView .helfried-topic-nav button:hover{background:#fff;border-color:#a49c90}
#helfriedView .helfried-topic-nav button[aria-current="page"]{background:var(--ink);border-color:var(--ink);color:#fff;font-weight:600}
#helfriedView .helfried-topic-nav button:focus-visible,#helfriedView .helfried-topic-card button:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
#helfriedView .helfried-topic-content{min-width:0}
#helfriedView .helfried-topic-page{display:flex;flex-direction:column;gap:18px;min-width:0}
#helfriedView .helfried-topic-page[hidden]{display:none!important}
#helfriedView .helfried-topic-header{padding:20px 4px 8px}
#helfriedView .helfried-topic-header h2{margin:8px 0;font-size:30px;letter-spacing:-.035em}
#helfriedView .helfried-topic-header p:not(.helfried-kicker){color:var(--muted);font-size:14px;line-height:1.6;max-width:620px}
#helfriedView .helfried-topic-actions{display:flex;gap:16px;flex-wrap:wrap;margin-top:18px}
#helfriedView .helfried-topic-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
#helfriedView .helfried-topic-card{display:flex;flex-direction:column;align-items:flex-start;gap:12px;padding:24px}
#helfriedView .helfried-topic-card:first-child{grid-column:1/-1;background:#f0f3ec}
#helfried-topic-nutrition .helfried-topic-card:first-child{background:#f8f0e5}
#helfriedView .helfried-topic-card h3{margin:0;font-size:19px;letter-spacing:-.02em}
#helfriedView .helfried-topic-card p{margin:0 0 8px;color:var(--muted);font-size:14px;line-height:1.65}
#helfriedView .helfried-topic-card button{margin-top:auto;text-align:left}
@media(max-width:900px){
  #helfriedView .helfried-topic-workspace{grid-template-columns:1fr;gap:14px}
  #helfriedView .helfried-topic-nav{position:static;flex-direction:row;overflow-x:auto;padding:2px 2px 8px;gap:6px}
  #helfriedView .helfried-topic-nav button{flex:0 0 auto;width:auto;min-height:42px;padding:10px 12px;white-space:nowrap}
}
@media(max-width:650px){
  #helfriedView .helfried-topic-cards{grid-template-columns:1fr}
  #helfriedView .helfried-topic-card{padding:20px}
  #helfriedView .helfried-topic-header h2{font-size:26px}
}

/* Bill: sidebar navigation matching Helfried and Vera. */
#billView{max-width:1180px}
#billView .bill-topic-workspace{width:100%;flex-shrink:0}
#billView .bill-topic-workspace{display:grid;grid-template-columns:154px minmax(0,1fr);gap:24px;align-items:start}
#billView .bill-nav{display:flex;flex-direction:column;gap:8px;position:sticky;top:0;padding:4px 0;flex-wrap:nowrap;border-bottom:0;margin-bottom:0}
#billView .bill-nav button{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:12px 14px;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.65);color:var(--muted);font:inherit;font-size:13px;text-align:left;cursor:pointer}
#billView .bill-nav button>span:first-child{font-size:18px;width:20px;text-align:center}
#billView .bill-nav button:hover{background:#fff;border-color:#a49c90}
#billView .bill-nav button[aria-current="page"]{background:var(--ink);border-color:var(--ink);color:#fff;font-weight:600}
#billView .bill-nav button:focus-visible,#billView .bill-topic-card button:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
#billView .bill-topic-content{min-width:0}

@media(max-width:900px){
  #billView .bill-topic-workspace{grid-template-columns:1fr;gap:14px}
  #billView .bill-nav{position:static;flex-direction:row;overflow-x:auto;padding:2px 2px 8px;gap:6px}
  #billView .bill-nav button{flex:0 0 auto;width:auto;min-height:42px;padding:10px 12px;white-space:nowrap}
}

/* Personal workspace: Archie folders and ME account/data navigation. */
.personal-workspace{display:grid;grid-template-columns:154px minmax(0,1fr);grid-template-rows:minmax(0,1fr);gap:24px;flex:1;min-height:0;width:100%;max-width:1180px;margin:0 auto;padding:34px 44px 28px;overflow:hidden}
.personal-workspace[hidden],.personal-workspace [hidden]{display:none!important}
.personal-content{display:flex;min-width:0;min-height:0;overflow:hidden}
.personal-content>.view{padding:0;margin:0;max-width:none;min-width:0}
.personal-nav{display:flex;flex-direction:column;gap:8px;align-self:start;max-height:100%;overflow-y:auto;padding:4px 0}
.personal-nav .nav-item{display:flex;align-items:center;gap:10px;width:100%;min-height:48px;padding:12px 14px;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.65);color:var(--muted);font:inherit;font-size:13px;text-align:left;cursor:pointer;flex-shrink:0}
.personal-nav .nav-item>span:first-child{font-size:18px;width:20px;text-align:center;flex-shrink:0}
.personal-nav .nav-item:hover{background:#fff;border-color:#a49c90}
.personal-nav .nav-item[aria-current="page"]{background:var(--ink);border-color:var(--ink);color:#fff;font-weight:600}
.personal-nav .nav-item:focus-visible,.personal-data-links .nav-item:focus-visible{outline:2px solid var(--ink);outline-offset:3px}
.personal-nav .nav-item:disabled,.personal-data-links .nav-item:disabled{opacity:.5;cursor:not-allowed}
.personal-data-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.personal-data-links .nav-item{display:flex;align-items:center;gap:12px;min-height:84px;padding:20px;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--ink);font-size:15px;margin:0}
.personal-data-links .nav-item:hover{background:var(--soft)}
.personal-data-links .nav-item>span:first-child{font-size:22px}
.personal-content #chatView .hero{padding-top:0}
@media(max-width:900px){
  .personal-workspace{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:14px;padding:22px 16px calc(24px + env(safe-area-inset-bottom))}
  .personal-nav{flex-direction:row;overflow-x:auto;overflow-y:hidden;padding:2px 2px 8px;gap:6px;max-width:100%}
  .personal-nav .nav-item{flex:0 0 auto;width:auto;min-height:42px;padding:10px 12px;white-space:nowrap}
}
@media(max-width:600px){.personal-data-links{grid-template-columns:1fr}.personal-data-links .nav-item{min-height:64px;padding:16px}.personal-content #chatView.active{padding-bottom:0}}
@media(max-width:420px){.personal-workspace{padding-left:calc(12px + env(safe-area-inset-left));padding-right:calc(12px + env(safe-area-inset-right))}}
