.chat-button{position:relative;flex-shrink:0}.chat-button svg{width:22px;height:22px}.chat-button .notification-count{min-width:19px;padding:0 4px}
.avatar img,.rail-avatar img,.chat-avatar img{width:100%;height:100%;object-fit:cover;border-radius:inherit;display:block}
.avatar,.rail-avatar{overflow:hidden}.sr-only{position:absolute!important;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
#chat-modal{--chat-blue:#073e76;--chat-line:#e2e9f1;width:min(1100px,calc(100vw - 48px));max-width:1100px;height:min(780px,calc(100dvh - 56px));max-height:calc(100dvh - 56px);padding:0;border:1px solid var(--ui40-border, #d2dce9);border-radius:22px;overflow:hidden;background:var(--ui40-surface, #fff);box-shadow:0 28px 90px #00295540;color:var(--ui40-text, #20354a)}
#chat-modal::backdrop{background:#09203970;backdrop-filter:blur(5px)}#chat-modal [hidden]{display:none!important}
.chat-layout{display:grid;grid-template-columns:326px minmax(0,1fr);height:100%;min-height:0}.chat-list-pane{display:flex;flex-direction:column;min-height:0;min-width:0;border-right:1px solid var(--chat-line);background:var(--ui40-surface, #fff)}
.chat-list-head{display:flex;justify-content:space-between;align-items:center;padding:25px 23px 15px;gap:12px}.chat-list-head h2{font-size:24px;margin:5px 0 0;letter-spacing:-.7px;color:var(--chat-blue)}.chat-list-head .eyebrow{font-size:10px;letter-spacing:1.6px}.chat-list-head>.icon-button{display:inline-flex}
.chat-tabs{display:flex;gap:4px;margin:0 20px 16px;padding:4px;border-radius:11px;background:var(--ui40-raised, #eef3f8)}.chat-tabs button{flex:1;border:0;border-radius:8px;padding:9px 5px;background:transparent;font-family:inherit;font-size:12px;font-weight:600;color:var(--ui40-text, #63758a);cursor:pointer}.chat-tabs button[aria-pressed=true]{background:var(--ui40-surface, #fff);color:var(--chat-blue);box-shadow:0 2px 5px #10375712}
.chat-search{display:flex;align-items:center;gap:8px;background:var(--ui40-raised, #f5f7fa);margin:0 20px 17px;border:1px solid var(--ui40-border, #e4eaf1);border-radius:10px;padding:0 10px;min-height:43px}.chat-search svg{width:18px;height:18px;flex-shrink:0;color:var(--ui40-text, #8391a3)}.chat-search input{min-width:0;width:100%;border:0;background:transparent;box-shadow:none;padding:10px 0;font-size:12px;outline-offset:2px}
.chat-contact-list{overflow:auto;flex:1;min-height:0;overscroll-behavior:contain;padding:0 9px 12px}.chat-contact{display:flex;align-items:center;gap:11px;position:relative;width:100%;min-height:85px;text-align:left;border:0;border-radius:12px;background:transparent;padding:13px 11px;cursor:pointer;font:inherit;color:inherit;transition:background .15s ease}.chat-contact:hover{background:var(--ui40-raised, #f3f7fb)}.chat-contact.is-selected{background:var(--ui40-accent-surface, #eaf2fc)}.chat-contact:disabled{opacity:.8;cursor:default}.chat-contact-copy{display:flex;flex:1;min-width:0;flex-direction:column;gap:4px}.chat-contact-title{display:flex;align-items:center;gap:8px;justify-content:space-between}.chat-contact-title strong{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-contact-title time{font-size:10px;color:var(--ui40-muted, #7b8ba0);flex-shrink:0}.chat-contact-preview{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:12px;color:var(--ui40-muted, #66798c);max-width:100%}.chat-contact-status{font-size:10px;color:var(--ui40-text, #7e8c9d)}.chat-contact-status.is-online{color:var(--ui40-success, #138268)}
.chat-avatar{width:44px;height:44px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;font-size:14px;font-weight:700;color:var(--ui40-text, #16528b);background:var(--ui40-raised, #e3edf9);overflow:hidden}.chat-contact:nth-child(3n) .chat-avatar{background:var(--ui40-success-surface, #e2efed);color:var(--ui40-success, #24796b)}.chat-contact-avatar{position:relative;flex-shrink:0}.chat-presence-dot{position:absolute;right:0;bottom:1px;width:12px;height:12px;border-radius:50%;background:#b4bfce;border:2px solid var(--ui40-border, white)}.chat-presence-dot.is-online{background:#16a179}.chat-unread{background:#0a64aa;color:#fff;border-radius:20px;padding:3px 6px;min-width:23px;text-align:center;font-size:10px;font-weight:700}
.chat-list-foot{display:flex;align-items:center;justify-content:center;gap:7px;padding:15px;font-size:11px;color:var(--ui40-text, #8292a4);border-top:1px solid var(--chat-line)}.chat-list-foot svg{width:14px;height:14px}.chat-list-empty{padding:35px 16px;text-align:center;color:var(--ui40-text, #73869a);display:flex;align-items:center;flex-direction:column;gap:12px;font-size:12px}.chat-list-empty svg{width:32px;height:32px}.chat-list-empty p{margin:0;line-height:1.7}.chat-presence-note{font-size:11px;line-height:1.6;padding:4px 12px 16px;color:var(--ui40-muted, #698096);display:grid;gap:4px}.chat-presence-note strong{color:var(--ui40-text, #214b71)}
.chat-conversation{display:flex;flex-direction:column;min-width:0;min-height:0;position:relative;background:var(--ui40-raised, #f4f7fb)}.chat-conversation-head{display:flex;align-items:center;gap:12px;padding:18px 25px;min-height:86px;border-bottom:1px solid var(--chat-line);background:var(--ui40-surface, white);flex-shrink:0}.chat-conversation-head:empty{display:none}.chat-person{flex:1;min-width:0}.chat-person h3{margin:0 0 5px;font-size:16px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-person>span{font-size:11px;color:var(--ui40-text, #8190a2)}.chat-person .is-online{color:var(--ui40-success, #138268)}.chat-person i{display:inline-block;width:6px;height:6px;border-radius:50%;margin-right:6px;background:currentColor}.chat-back{display:none}.chat-back svg{transform:rotate(180deg)}
.chat-messages{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px 30px;display:flex;align-items:flex-start;flex-direction:column;gap:10px;scrollbar-width:thin}.chat-day{width:100%;text-align:center;margin:9px 0 12px}.chat-day span{display:inline-block;font-size:10px;font-weight:600;letter-spacing:.2px;color:var(--ui40-text, #718399);background:var(--ui40-raised, #e8eef5);border-radius:20px;padding:5px 12px}.chat-message{max-width:82%;min-width:95px;padding:11px 14px 7px;box-shadow:0 2px 3px #17375608;border:1px solid var(--ui40-border, #e3eaf1);border-radius:13px 13px 13px 3px;background:var(--ui40-surface, #fff)}.chat-message.is-mine{align-self:flex-end;background:var(--chat-blue);color:#fff;border-color:var(--chat-blue);border-radius:13px 13px 3px 13px}.chat-message p{margin:0;font-size:13px;line-height:1.65;white-space:pre-wrap;overflow-wrap:anywhere}.chat-message-meta{display:flex;justify-content:flex-end;align-items:center;gap:6px;margin-top:4px;color:var(--ui40-text, #8897a7);font-size:9px}.chat-message.is-mine .chat-message-meta{color:#ccdeef}.chat-receipt{font-size:11px;letter-spacing:-2px}.chat-receipt.is-read{color:#72daff}.chat-older{align-self:center;border:1px solid var(--ui40-border, #dae4ee);border-radius:20px;background:var(--ui40-surface, #fff);color:var(--ui40-text, #365e85);padding:7px 14px;font-size:11px;cursor:pointer}.chat-start-note{align-self:center;font-size:12px;color:var(--ui40-muted, #6e8298);padding:35px 12px;text-align:center;line-height:1.7}
.chat-compose-area{padding:17px 23px 12px;border-top:1px solid var(--chat-line);background:var(--ui40-surface, #fff);flex-shrink:0}.chat-compose-area form{display:flex;align-items:flex-end;gap:11px}.chat-compose-area textarea{flex:1;min-width:0;resize:vertical;min-height:48px;max-height:140px;line-height:1.5;border:1px solid var(--ui40-border, #dce5ee);border-radius:12px;background:var(--ui40-raised, #f8fafc);padding:13px 14px;font:13px/1.5 inherit}.chat-send{width:48px;height:48px;flex-shrink:0;border:0;border-radius:12px;background:var(--chat-blue);color:#fff;display:grid;place-items:center;cursor:pointer;transition:transform .15s,background .15s}.chat-send:hover:not(:disabled){background:#1269a9;transform:translateY(-1px)}.chat-send:disabled{opacity:.45;cursor:default}.chat-send svg{width:21px;height:21px}.chat-send.is-sending svg{animation:chat-pulse 1s ease-in-out infinite}.chat-compose-note{display:flex;gap:8px;justify-content:space-between;font-size:9px;line-height:1.5;color:var(--ui40-muted, #8c9baa);margin:7px 2px 0}.chat-compose-note>span:last-child{white-space:nowrap}.chat-send-error{font-size:12px;color:var(--ui40-danger, #ab342e);margin:9px 0 0}.chat-connection{font-size:11px;line-height:1.6;color:var(--ui40-warning, #8c5a1a);background:var(--ui40-warning-surface, #fff1d7);padding:9px 20px}.chat-new-messages{position:absolute;right:28px;bottom:120px;background:var(--ui40-surface, #fff);color:var(--ui40-text, #075894);border:1px solid var(--ui40-border, #cddfee);border-radius:20px;padding:8px 13px;box-shadow:0 3px 12px #10375720;cursor:pointer;font-size:11px}
.chat-welcome{margin:auto;text-align:center;align-self:center;max-width:380px;display:flex;flex-direction:column;align-items:center;padding:35px 10px;gap:18px}.chat-welcome-icon{width:88px;height:88px;border:1px solid var(--ui40-border, #dbe6f2);background:var(--ui40-surface, linear-gradient(150deg,#fff,#e1ecf8));display:grid;place-items:center;border-radius:27px;box-shadow:0 10px 28px #00387208;margin-bottom:5px;color:var(--ui40-text, #155b99)}.chat-welcome-icon svg{width:39px;height:39px}.chat-welcome .eyebrow{font-size:10px;letter-spacing:1.5px}.chat-welcome h3{font-size:25px;line-height:1.25;letter-spacing:-.7px;color:var(--ui40-text, #123f68);margin:0}.chat-welcome p{font-size:13px;line-height:1.9;color:var(--ui40-text, #73869a);margin:0}.chat-welcome small{font-size:10px;color:var(--ui40-muted, #8c9aac)}.chat-welcome .button{margin:4px 0}
.profile-picture-editor{display:flex;align-items:center;gap:20px;padding:19px;background:var(--ui40-raised, #f4f7fb);border:1px solid var(--ui40-border, #e1e9f1);border-radius:14px;margin-bottom:5px}.profile-picture-preview{width:82px;height:82px;font-size:24px;border:3px solid var(--ui40-border, #fff);box-shadow:0 2px 12px #143a6914}.profile-picture-editor>div{min-width:0}.profile-picture-editor strong{font-size:14px}.profile-picture-editor p{margin:5px 0 10px;font-size:12px;color:var(--ui40-text, #718295)}.profile-picture-editor small{display:block;margin-top:9px;line-height:1.6;color:var(--ui40-muted, #718295);font-size:11px}.profile-picture-select{position:relative;overflow:hidden;cursor:pointer}.profile-picture-select input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}
@keyframes chat-pulse{50%{opacity:.35}}@media(prefers-reduced-motion:reduce){.chat-send.is-sending svg{animation:none}.chat-contact,.chat-send{transition:none}}
@media(min-width:761px){#chat-modal.chat-has-selection .chat-list-head>.icon-button{display:none}}
@media(max-width:1000px){#chat-modal{width:calc(100vw - 28px)}.chat-layout{grid-template-columns:290px minmax(0,1fr)}.chat-messages{padding:18px}.chat-message{max-width:90%}.chat-list-head{padding-left:20px;padding-right:20px}}
@media(max-width:760px){#chat-modal{position:fixed;inset:0;margin:0;width:100%;max-width:100%;top:var(--chat-offset-top,0);height:var(--chat-viewport-height,100dvh);max-height:var(--chat-viewport-height,100dvh);border:0;border-radius:0;box-shadow:none}.chat-layout{grid-template-columns:minmax(0,1fr)}.chat-conversation{display:none}.chat-list-pane{border:0}.chat-list-head{padding-top:calc(20px + env(safe-area-inset-top));padding-bottom:18px}.chat-list-head>.icon-button{display:inline-flex}.chat-contact{min-height:87px}.chat-contact-title strong{font-size:14px}.chat-contact-preview{font-size:13px}.chat-contact-status{font-size:11px}.chat-search input{font-size:16px}.chat-search{min-height:47px}.chat-list-foot{padding-bottom:calc(15px + env(safe-area-inset-bottom))}#chat-modal.chat-has-selection .chat-list-pane{display:none}#chat-modal.chat-has-selection .chat-conversation{display:flex}.chat-back{display:inline-flex;margin-left:-9px}.chat-conversation-head{padding:calc(12px + env(safe-area-inset-top)) 15px 12px;gap:10px;min-height:78px}.chat-conversation-head .chat-avatar{width:38px;height:38px}.chat-person h3{font-size:15px}.chat-person>span{font-size:11px}.chat-messages{padding:16px;gap:9px}.chat-message{max-width:87%;padding:10px 12px 6px}.chat-message p{font-size:14px}.chat-message-meta{font-size:10px}.chat-compose-area{padding:12px 12px calc(8px + env(safe-area-inset-bottom))}.chat-compose-area textarea{font-size:16px;padding:11px 12px;min-height:47px;max-height:100px}.chat-compose-note{font-size:9px}.chat-compose-note>span:first-child{font-size:0}.chat-compose-note>span:first-child:after{content:'Nachrichten bleiben gespeichert.';font-size:9px}.chat-compose-area:has(textarea:disabled) .chat-compose-note>span:first-child{font-size:10px}.chat-compose-area:has(textarea:disabled) .chat-compose-note>span:first-child:after{content:''}.chat-new-messages{bottom:110px;right:18px}.profile-picture-editor{align-items:flex-start;gap:14px;padding:16px}.profile-picture-preview{width:62px;height:62px;font-size:19px}.profile-picture-editor .button{margin-bottom:5px}.topbar .chat-button,.topbar .notification-button{width:38px;height:38px;min-width:38px}}
@media print{#chat-modal,.chat-button{display:none!important}}

.profile-picture-select:focus-within{outline:2px solid var(--ui40-accent, #087dc0);outline-offset:3px}
.chat-attach-tools{display:flex;gap:2px;align-items:center}.chat-file-label{position:relative;cursor:pointer;overflow:hidden;flex-shrink:0}.chat-file-label input{position:absolute;inset:0;opacity:0;width:100%;cursor:pointer}.chat-draft-extras{display:grid;gap:6px}.chat-draft-extras:not(:empty){padding:8px 0}.chat-draft-extras>div{display:flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid var(--ui40-border, #c9deed);background:var(--ui40-raised, #edf6fc);color:var(--ui40-text, #184b71);border-radius:10px;font-size:12px}.chat-draft-extras svg{width:18px;flex-shrink:0}.chat-draft-extras span{flex:1;overflow-wrap:anywhere;min-width:0}.chat-draft-extras button{background:none;border:0;font-size:22px;color:var(--ui40-text, #426c89);min-width:32px;min-height:32px;cursor:pointer}.chat-compose-area{position:relative}.chat-share-picker{position:absolute;bottom:100%;left:10px;right:10px;z-index:5;background:var(--ui40-surface, #fff);border:1px solid var(--ui40-border, #bed5e5);border-radius:15px;padding:16px;box-shadow:0 10px 35px #103b6033;max-height:min(420px,55dvh);overflow:auto;color:var(--ui40-text, #153e5e)}.chat-share-picker .search{margin:10px 0}.chat-share-picker input{min-width:0}.chat-share-picker #chat-vehicle-results{display:grid;gap:4px}.chat-share-picker #chat-vehicle-results>button{display:grid;text-align:left;gap:5px;border:0;background:var(--ui40-raised, #f1f7fb);color:var(--ui40-text, #254e6d);padding:12px;cursor:pointer;border-radius:8px}.chat-share-picker #chat-vehicle-results>button:hover{background:var(--ui40-raised, #e1f0fa)}.chat-vehicle-card{display:flex;text-align:left;align-items:center;gap:14px;border:1px solid var(--ui40-border, #bcd9eb);background:var(--ui40-raised, #f4faff);color:var(--ui40-text, #073b65);padding:14px;border-radius:12px;max-width:100%;width:100%;margin:5px 0;cursor:pointer}.chat-vehicle-card>svg{width:30px;flex-shrink:0}.chat-vehicle-card>span{display:grid;gap:5px;overflow-wrap:anywhere}.chat-vehicle-card small{font-size:11px}.chat-attachment{display:grid;gap:7px;padding:6px 0;max-width:100%;overflow-wrap:anywhere}.chat-attachment img{display:block;max-width:100%;max-height:220px;border-radius:9px;object-fit:contain;background:var(--ui40-surface, #fff)}.chat-attachment strong{font-size:13px}.chat-attachment small{font-size:11px;opacity:.8}.chat-attachment>div{display:flex;gap:14px;flex-wrap:wrap}.chat-attachment a{font-size:12px;text-decoration:underline;color:inherit}.chat-deleted{font-style:italic;opacity:.75}.chat-message-menu{position:relative;margin-right:auto}.chat-message-menu summary{list-style:none;cursor:pointer;min-width:30px;min-height:26px;text-align:center;font-size:17px;line-height:22px}.chat-message-menu summary::-webkit-details-marker{display:none}.chat-message-menu>div{position:absolute;bottom:100%;left:0;z-index:6;display:grid;min-width:170px;background:var(--ui40-surface, #fff);border:1px solid var(--ui40-border, #cbdfed);border-radius:10px;box-shadow:0 6px 22px #163f632d;padding:5px}.chat-message.is-mine .chat-message-menu>div{left:auto;right:0}.chat-message-menu button{white-space:nowrap;min-height:42px;text-align:left;background:none;border:0;padding:10px;color:var(--ui40-text, #254b6a);font:inherit;font-size:12px;cursor:pointer;border-radius:6px}.chat-message-menu button:hover{background:var(--ui40-raised, #edf5fb)}.chat-message-meta{gap:8px}.chat-message-menu:not([open])>div{display:none}
@media(max-width:760px){#chat-compose{gap:5px}.chat-attach-tools{gap:0}.chat-attach-tools .icon-button{width:34px;min-width:34px}.chat-attachment img{max-height:180px}.chat-vehicle-card{padding:10px;gap:8px}.chat-share-picker{left:5px;right:5px}}
