/* Only the requested entry point, contact flows and floating mobile navigation. */
.header-actions { display:flex; align-items:center; gap:8px; }
.header-actions .icon-button { width:36px; height:36px; color:var(--accent); background:#b7cf8310; border-radius:10px; }
.header-actions .square-plus { border:1px solid #b7cf832e; }
.header-actions .icon { width:21px; height:21px; }
.dialog-actions { display:flex; align-items:center; gap:6px; }
.contacts-dialog { padding:24px; }
.contacts-dialog .searchbox { margin:0 0 16px; }
.contacts-dialog .searchbox .icon { width:19px; height:19px; }
.contact-actions { margin-bottom:25px; }
.contact-actions .menu-row { padding:16px 4px; }
.contact-list-heading { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 0 12px; }
.contact-list-heading h3, #contact-search-results h3 { font-size:13px; font-weight:600; margin:0; color:var(--muted); }
#contact-search-results h3 { margin:18px 0 10px; }
.contacts-dialog .chat-entry { padding:12px 5px; min-height:68px; }
.contact-add-button { color:var(--accent); padding:8px; font-size:12px; }
.contact-person { display:flex; align-items:center; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.contact-person .chat-info { min-width:0; }
.contact-person .chat-info strong { white-space:normal; overflow-wrap:anywhere; }
.contact-person .icon-button { width:38px; }
.bottom-sheet { width:440px; max-width:calc(100vw - 24px); border:1px solid var(--line); border-radius:24px; padding:24px; background:var(--panel); max-height:90dvh; }
.bottom-sheet form { gap:16px; }
.bottom-sheet .dialog-head h2 { font-size:22px; }
.bottom-sheet input:not([type=checkbox]):not([type=file]) { font-size:16px; width:100%; background:#0e1c162f; }
.bottom-sheet label { font-size:13px; }
.sheet-handle { width:38px; height:4px; background:#8ea3934a; border-radius:8px; margin:-9px auto 15px; }
.contact-symbol { margin:0 auto 3px; width:64px; height:64px; border-radius:50%; background:#b7cf8312; display:grid; place-items:center; color:var(--accent); }
.contact-symbol .icon { width:32px; height:32px; }
.sync-choice { display:flex!important; flex-direction:row; align-items:center; gap:12px!important; margin-top:2px; cursor:pointer; }
.sync-choice input { width:19px; height:19px; margin:0; accent-color:var(--accent); flex-shrink:0; }
.field-help { color:var(--muted); font-size:12px; line-height:1.5; }
.sync-choice+.field-help { margin-top:-8px; }
.contact-alternatives { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:16px; }
.contact-alternatives button { display:flex; align-items:center; gap:8px; padding:8px 0; font-size:13px!important; }
.contact-alternatives .icon { width:20px; height:20px; }
.bottom-sheet .primary { justify-content:center; width:100%; font-size:14px; min-height:47px; }
#new-contact-status, #qr-status, #contacts-status, #space-status { font-size:13px; color:var(--accent); line-height:1.5; }
#new-contact-status:empty, #qr-status:empty, #contacts-status:empty, #space-status:empty { display:none; }
.linked-account { color:var(--accent); background:#a7bd7a12; padding:9px 12px; border-radius:9px; font-size:13px; }
.vcard-action { display:block; text-align:center; color:var(--accent); font-size:14px; padding:10px; }
#qr-reader { display:grid; gap:18px; }
#qr-video { width:100%; max-height:270px; object-fit:cover; border-radius:14px; background:#000; }
.qr-upload { border:1px dashed #93aa7555; border-radius:12px; padding:17px; text-align:center; cursor:pointer; color:var(--accent); }
.qr-upload input { margin-top:8px; max-width:100%; font-size:12px; }
#qr-mine { text-align:center; }
#qr-mine img { width:244px; max-width:100%; border-radius:14px; }
#qr-mine p { color:var(--muted); font-size:13px; line-height:1.6; margin:18px 0; }
#qr-status { margin-top:14px; }
#space-users { max-height:250px; overflow:auto; }
.space-member { display:flex!important; flex-direction:row; align-items:center; padding:10px 0; gap:12px!important; border-bottom:1px solid var(--line); cursor:pointer; }
.space-member .avatar { width:37px; height:37px; font-size:12px; }
.space-member>span:last-child { flex:1; }
.space-member input { accent-color:var(--accent); width:18px; height:18px; }
.space-member strong { font-size:13px; display:block; }
.space-member small { color:var(--muted); font-size:11px; display:block; margin-top:4px; }
.channel-notice { text-align:center; padding:22px 16px; color:var(--muted); font-size:13px; background:var(--panel); border-top:1px solid var(--line); }
.message-author { font-size:12px; color:var(--accent); font-weight:600; margin:0 0 6px; }
.contact-members { border-top:1px solid var(--line); margin-top:14px; padding-top:13px; color:var(--muted); font-size:12px; line-height:1.7; }
@media(max-width:760px), (max-height:500px) and (pointer:coarse) {
  :root { --device-bottom:env(safe-area-inset-bottom,0px); --dock-gap:max(16px,var(--device-bottom)); }
  .navigation-rail { left:10px; right:10px; bottom:var(--dock-gap); width:calc(100% - 20px); height:70px; padding:5px 8px; border:1px solid #a8bd9122; border-radius:36px; background:var(--panel); box-shadow:0 6px 20px #0005; }
  .rail-item { height:58px; border-radius:26px; min-width:0; padding:5px 1px; }
  .navigation-rail { background:color-mix(in srgb,var(--panel) 72%,transparent); -webkit-backdrop-filter:blur(20px) saturate(115%); backdrop-filter:blur(20px) saturate(115%); }
  @supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
    .navigation-rail { background:var(--panel); }
  }
  .rail-label { font-size:9px; }
  .rail-badge { top:0; }
  .sidebar { height:var(--app-height,100dvh); padding-bottom:calc(84px + var(--dock-gap)); }
  .header-actions { gap:8px; }
  .header-actions .icon-button { width:36px; height:36px; }
  .sidebar-header .wordmark { font-size:24px; gap:6px; }
  .contacts-dialog .dialog-head h2 { margin:0; }
  .contacts-dialog .searchbox { height:46px; }
  .contacts-dialog .menu-row { min-height:56px; font-size:15px; }
  .contact-list-heading h3 { font-size:14px; }
  .contact-person { padding:14px 0; }
  .contact-person .avatar { width:45px; height:45px; }
  .contact-person .chat-info strong { font-size:15px; }
  .contact-person .chat-info p { font-size:13px; }
  .contact-add-button { min-height:44px; }
  .bottom-sheet { position:fixed; inset:auto 0 0; width:100%; max-width:100%; margin:0; max-height:calc(var(--app-height,100dvh) - 16px); border-radius:28px 28px 0 0; padding:20px 24px calc(20px + env(safe-area-inset-bottom,0px)); overflow:auto; overscroll-behavior:contain; }
  .bottom-sheet .dialog-head { margin-bottom:14px; }
  .bottom-sheet .dialog-head h2 { font-size:23px; }
  .bottom-sheet form { gap:14px; }
  .bottom-sheet label { font-size:14px; }
  .bottom-sheet .primary { min-height:49px; }
  .bottom-sheet .field-help { font-size:12px; }
  .contact-symbol { width:56px; height:56px; }
  .contact-symbol .icon { width:29px; height:29px; }
  .contact-alternatives { margin:0; }
  #qr-reader .primary { margin-top:8px; }
  .space-member strong { font-size:14px; }
  .space-member small { font-size:12px; }
}
@media(max-width:760px), (max-height:500px) and (pointer:coarse){
  body{overflow:hidden}
  .workspace{position:fixed;top:var(--visual-top,0px);left:0;right:0;width:100%}
  .screen-dialog,.details-dialog{top:var(--visual-top,0px);bottom:auto}
  .bottom-sheet{bottom:var(--viewport-bottom,0px)}
}
@media(max-width:760px), (max-height:500px) and (pointer:coarse){
  :root{--device-top:env(safe-area-inset-top,0px)}
  .workspace{top:calc(var(--visual-top,0px) + var(--device-top));height:calc(var(--app-height,100dvh) - var(--device-top))}
  .sidebar,.conversation{height:calc(var(--app-height,100dvh) - var(--device-top))}
  .screen-dialog,.details-dialog{top:calc(var(--visual-top,0px) + var(--device-top));height:calc(var(--app-height,100dvh) - var(--device-top));max-height:calc(var(--app-height,100dvh) - var(--device-top))}
  .bottom-sheet{max-height:calc(var(--app-height,100dvh) - var(--device-top) - 16px)}
}

/* v4: legible search, circular multi-select controls and frosted mobile dock. */
.sidebar > .searchbox > span, .contacts-dialog .searchbox > span {
  display:flex; align-items:center; flex:0 0 20px; color:var(--muted);
}
.sidebar > .searchbox .icon, .contacts-dialog .searchbox .icon {
  width:20px; height:20px; stroke-width:2; display:block;
}
.sync-choice input[type=checkbox], .space-member input[type=checkbox] {
  appearance:none; -webkit-appearance:none; box-sizing:border-box;
  width:20px; height:20px; flex:0 0 20px; padding:0; margin:0;
  border:1.5px solid var(--muted); border-radius:50%; background:transparent;
  display:grid; place-content:center; cursor:pointer;
}
.sync-choice input[type=checkbox]::before, .space-member input[type=checkbox]::before {
  content:''; width:10px; height:10px; border-radius:50%; background:var(--accent); transform:scale(0);
}
.sync-choice input[type=checkbox]:checked, .space-member input[type=checkbox]:checked { border-color:var(--accent); }
.sync-choice input[type=checkbox]:checked::before, .space-member input[type=checkbox]:checked::before { transform:scale(1); }
.sync-choice input[type=checkbox]:focus-visible, .space-member input[type=checkbox]:focus-visible {
  outline:2px solid var(--accent); outline-offset:4px;
}
@media(max-width:760px), (max-height:500px) and (pointer:coarse) {
  .sidebar > .searchbox { margin-left:25px; margin-right:25px; gap:11px; }
  .contacts-dialog .searchbox { margin-left:8px; margin-right:8px; gap:11px; }
  .sidebar-header { position:relative; margin-bottom:6px; }
  .sidebar-header::after {
    content:''; position:absolute; left:20px; right:20px; bottom:0; height:3px;
    border-radius:3px; background:color-mix(in srgb,var(--muted) 9%,transparent);
    box-shadow:0 3px 5px #00000020, inset 0 1px 0 #ffffff05;
  }
  .navigation-rail {
    background:color-mix(in srgb,var(--panel) 48%,transparent);
    -webkit-backdrop-filter:blur(24px) saturate(110%); backdrop-filter:blur(24px) saturate(110%);
    border-color:#b9c9ad30; box-shadow:inset 0 1px 0 #ffffff0c,0 6px 20px #00000030;
  }
  .navigation-rail .rail-item.active { background:color-mix(in srgb,var(--accent) 12%,transparent); }
  @supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))) {
    .navigation-rail { background:var(--panel); }
  }
}

.invite-card { padding:16px; margin:12px 0; border:1px solid var(--line); border-radius:16px; background:#b7cf8309; }
.invite-card strong { font-size:15px; }
.invite-card p { margin:8px 0; }
.invite-card input { width:100%; min-width:0; font-size:14px; }
.invite-actions { display:flex; gap:4px 16px; flex-wrap:wrap; margin-top:10px; }
.invite-actions .text-button { min-height:44px; display:inline-flex; align-items:center; font-size:13px; }
.invite-card [role=status]:empty { display:none; }
