/* ========================================================================
   FINAL APPLE / TELEGRAM PASS — 2026
   This file is intentionally last in the cascade. It unifies spacing,
   icon weight, navigation materials and separate iPhone/macOS geometries.
   ======================================================================== */
:root{
  --sp-1:4px;--sp-2:8px;--sp-3:12px;--sp-4:16px;--sp-5:20px;--sp-6:24px;--sp-8:32px;
  --av-xs:28px;--av-sm:36px;--av-md:48px;--av-lg:56px;--av-xl:96px;
  --r-sm:8px;--r-md:12px;--r-lg:18px;--r-xl:24px;
  --mac-sidebar-width:356px;
  --glass-border:rgba(255,255,255,.16);
  --glass-edge:rgba(255,255,255,.34);
  --glass-shadow:0 1px 0 var(--separator);
  --glass-bg:color-mix(in srgb,var(--glass-regular) 92%,var(--background-primary));
}
html[data-theme="light"]{
  --glass-border:rgba(255,255,255,.76);
  --glass-edge:rgba(255,255,255,.92);
  --glass-shadow:0 1px 0 var(--separator);
  --glass-bg:color-mix(in srgb,var(--glass-regular) 94%,var(--background-primary));
}

/* Liquid Glass is restricted to navigation and controls. */
.list-head,.chat-head,.ios-tabbar,#composer,.apple-popover-box,.sheet,.lumo-tools-card,.channel-pinned,#scrollDown,.chat-edit-toolbar{
  background:var(--glass-bg)!important;
  -webkit-backdrop-filter:blur(20px) saturate(135%)!important;
  backdrop-filter:blur(20px) saturate(135%)!important;
  border-color:color-mix(in srgb,var(--separator) 70%,transparent)!important;
  box-shadow:var(--glass-shadow)!important;
}
.list-head::after,.chat-head::after,#composer::after,.ios-tabbar::after{
  content:"";position:absolute;pointer-events:none;z-index:0;
  inset:0;border-radius:inherit;
  background:none;
  mix-blend-mode:normal;opacity:0;
}
.list-head>*,.chat-head>*,.ios-tabbar>*{position:relative;z-index:1}
html.reduce-transparency .list-head,html.reduce-transparency .chat-head,html.reduce-transparency .ios-tabbar,html.reduce-transparency #composer,html.reduce-transparency .apple-popover-box,html.reduce-transparency .sheet,html.reduce-transparency .lumo-tools-card{background:var(--surface-primary)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;box-shadow:none!important}
@media (prefers-reduced-transparency: reduce){
  .list-head,.chat-head,.ios-tabbar,#composer,.apple-popover-box,.sheet,.lumo-tools-card{background:var(--surface-primary)!important;-webkit-backdrop-filter:none!important;backdrop-filter:none!important;box-shadow:none!important}
}

/* Shared icon geometry */
.icon-btn,.backBtn,.neo-head-badge,.compose-btn,.list-more-btn{display:grid!important;place-items:center!important;min-width:44px!important;min-height:44px!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;color:var(--accent)!important}
.icon-btn svg,.backBtn svg,.neo-head-badge svg,.compose-btn svg,.list-more-btn svg,.ios-tab svg,.apple-popover-icon svg{fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
button:not(:disabled):active{transform:scale(.97);opacity:.72}


/* Canonical monochrome system iconography. */
.ui-svg-icon,.group-profile-action-icon,.group-info-row-icon,.cm-qic,.mi .ic,.call-action,.channel-mute-btn{display:grid;place-items:center}
.ui-svg-icon svg svg,.group-profile-action-icon svg,.group-info-row-icon svg,.cm-qic svg,.mi .ic svg,.call-action svg,.channel-mute-btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.group-profile-action-icon svg{width:20px;height:20px}.call-action svg{width:22px;height:22px}.channel-mute-btn svg{width:19px;height:19px}

/* ----------------------------- iPhone list ------------------------------ */
.list-edit-btn{display:none}
.list-search-cancel{display:none;border:0;background:none;color:var(--accent);min-height:36px;padding:0 2px;font-size:16px}
.archive-row{width:100%;min-height:64px;display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:10px;padding:6px 12px;border:0;background:var(--background-primary);color:var(--label-primary);text-align:left;position:relative}
.archive-row::after{content:"";position:absolute;left:70px;right:0;bottom:0;height:.5px;background:var(--separator)}
.archive-avatar{width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:color-mix(in srgb,var(--accent) 13%,var(--background-secondary));color:var(--accent)}
.archive-avatar svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.archive-copy{display:flex;flex-direction:column;min-width:0;gap:1px}.archive-copy b{font-size:15px;font-weight:650}.archive-copy small{font-size:12.5px;color:var(--label-secondary)}.archive-count{font-size:12px;color:var(--label-secondary);padding-right:4px}
.row-state-symbol{font-size:13px;color:var(--label-tertiary)}
#chatList .row-item.is-unread .ri-name{font-weight:700!important;color:var(--label-primary)!important}
#chatList .row-item.is-muted .badge{background:var(--label-tertiary)!important}
#chatList .row-item .ri-prev.activity{color:var(--accent)!important}
#chatList .row-item .ri-prev.draft{color:var(--destructive)!important}

@media(max-width:899px){
  body.has-app #listScreen{display:block!important;inset:0!important;background:var(--background-primary)!important}
  body.has-app #listScreen>.list-main{position:absolute!important;inset:0!important;display:flex!important;flex-direction:column!important;padding-bottom:calc(68px + var(--sab))!important;background:var(--background-primary)!important}
  .list-head{position:relative!important;flex:none!important;padding:calc(var(--sat) + 2px) max(12px,var(--sar)) 8px max(12px,var(--sal))!important;border:0!important;box-shadow:0 .5px 0 var(--separator)!important}
  .list-head .lh-row{display:grid!important;grid-template-columns:44px minmax(0,1fr) 44px!important;align-items:center!important;height:48px!important;min-height:48px!important;margin:0!important}
  .list-edit-btn{display:block!important;justify-self:start;border:0;background:transparent;color:var(--accent);font-size:16px;padding:0;min-width:44px;min-height:44px;text-align:left}
  .brand-lockup{justify-self:center!important;margin:0!important;min-width:0!important}.brand-text h1{font-size:17px!important;line-height:22px!important;font-weight:650!important;letter-spacing:-.01em!important}.desktop-brand{display:none!important}.mobile-brand{display:inline!important}.brand-mark{display:none!important}
  .lh-right{justify-self:end!important;display:flex!important;gap:0!important}.list-more-btn{display:none!important}.compose-btn{width:44px!important;height:44px!important;border-radius:50%!important}
  .list-head .search{height:36px!important;min-height:36px!important;margin:2px 0 0!important;padding:0 10px!important;border:0!important;border-radius:11px!important;background:color-mix(in srgb,var(--label-tertiary) 9%,var(--background-secondary))!important;box-shadow:none!important;transition:margin .18s ease,width .18s ease!important}
  .list-head .search svg{width:16px!important;height:16px!important;color:var(--label-tertiary)!important}.list-head .search input{font-size:16px!important;padding:0 4px!important;background:transparent!important}
  .list-head.search-active{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;grid-template-rows:auto auto!important;column-gap:10px!important}.list-head.search-active .lh-row{grid-column:1/-1}.list-head.search-active .search{grid-column:1!important}.list-head.search-active .list-search-cancel{display:block!important;grid-column:2!important;align-self:center!important}.list-head.search-active .list-search-cancel[hidden]{display:block!important}
  .folder-tabs{height:38px!important;min-height:38px!important;padding:0 4px!important;display:flex!important;align-items:stretch!important;gap:0!important;border:0!important;box-shadow:0 .5px 0 var(--separator)!important;background:var(--background-primary)!important;overflow-x:auto!important;scroll-snap-type:x proximity!important}
  .folder-tab{position:relative!important;flex:0 0 auto!important;min-height:38px!important;padding:0 12px!important;border:0!important;border-radius:0!important;background:transparent!important;color:var(--label-secondary)!important;font-size:13px!important;font-weight:500!important;scroll-snap-align:center!important}.folder-tab.on{color:var(--accent)!important;font-weight:600!important}.folder-tab.on::after{content:"";position:absolute;left:12px;right:12px;bottom:0;height:2px;border-radius:2px;background:var(--accent)!important}
  #chatList{padding:0 0 calc(10px + var(--sab))!important;background:var(--background-primary)!important;overflow-y:auto!important}
  #chatList .row-item{min-height:70px!important;padding:7px 12px!important;gap:10px!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important;position:relative!important}
  #chatList .row-item::after{left:76px!important;right:0!important;background:color-mix(in srgb,var(--separator) 76%,transparent)!important}
  #chatList .row-item>.av{width:54px!important;height:54px!important;min-width:54px!important}.ri-mid{gap:1px!important}.ri-name{font-size:15.5px!important;line-height:19px!important}.ri-prev{font-size:14px!important;line-height:18px!important;margin-top:0!important;color:var(--label-secondary)!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}.ri-time{font-size:11.5px!important;color:color-mix(in srgb,var(--label-secondary) 88%,var(--label-primary))!important}.ri-right{min-width:43px!important;gap:5px!important}.badge{min-width:20px!important;height:20px!important;padding:0 6px!important;font-size:11px!important}
  .ios-tab{min-width:0!important;height:54px!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:1px!important;border:0!important;background:transparent!important;color:var(--label-secondary)!important;border-radius:16px!important;font-size:10px!important;font-weight:500!important}.ios-tab svg{width:21px!important;height:21px!important}.ios-tab.active{color:var(--accent)!important}.ios-tab:active{background:color-mix(in srgb,var(--accent) 9%,transparent)!important;transform:scale(.96)!important}
  .chat-edit-toolbar{position:absolute;z-index:45;left:max(10px,var(--sal));right:max(10px,var(--sar));bottom:calc(7px + var(--sab));height:54px;border-radius:18px;display:flex;align-items:center;justify-content:space-around;padding:4px 6px}.chat-edit-toolbar[hidden]{display:none!important}.chat-edit-toolbar button{min-height:44px;border:0;background:transparent;color:var(--accent);font-size:13px;font-weight:600}.chat-edit-mode .ios-tabbar{display:none!important}.chat-edit-mode #chatList .row-item::before{content:"";width:20px;height:20px;border:1.5px solid var(--label-tertiary);border-radius:50%;position:absolute;left:17px;z-index:2}.chat-edit-mode #chatList .row-item>.av{margin-left:30px}.chat-edit-mode #chatList .row-item.edit-selected::before{background:var(--accent);border-color:var(--accent);box-shadow:inset 0 0 0 5px var(--background-primary)}
}

/* ------------------------------ chat ----------------------------------- */
.chat-head{position:relative!important;overflow:hidden!important}.chat-head .ch-info{margin-left:0!important}.chat-head .head-tools{display:flex!important;align-items:center!important;gap:0!important}.chat-head .head-tools .icon-btn,.chat-head .neo-head-badge{width:44px!important;height:44px!important;border-radius:50%!important}.chat-head .neo-head-badge svg{width:18px!important;height:18px!important;fill:currentColor!important;stroke:none!important}
.day span,.sysmsg span{box-shadow:0 2px 8px rgba(0,0,0,.08)!important;border:0!important;background:color-mix(in srgb,var(--glass-regular) 88%,transparent)!important;-webkit-backdrop-filter:blur(14px) saturate(150%);backdrop-filter:blur(14px) saturate(150%)}
.bwrap{max-width:min(78%,680px)!important}.mrow{margin:1px 0!important;align-items:flex-end!important}.mrow.grouped{margin-top:1px!important}
@media(max-width:899px){
  #chatScreen{background:var(--background-secondary)!important}.chat-head{min-height:calc(var(--sat) + 52px)!important;padding:var(--sat) max(5px,var(--sar)) 0 max(5px,var(--sal))!important;border:0!important;box-shadow:0 .5px 0 var(--separator)!important}.chat-head #chatAv{width:34px!important;height:34px!important;min-width:34px!important}.ch-title{font-size:16px!important}.ch-sub{font-size:11px!important}.head-tools .call-btn{display:none!important}.head-tools #chatMenuBtn{display:grid!important}
  #msgs{padding:10px 9px calc(76px + var(--sab))!important;background-color:var(--background-secondary)!important}.bwrap{max-width:82%!important}.mrow.their{padding-left:0!important}.mrow.their>.av,.mrow.their>.aspace{display:none!important}
  
  
  
  
  .recbar.action-bar{left:0!important;right:0!important;bottom:calc(56px + var(--sab))!important;border:0!important;border-top:.5px solid var(--separator)!important}
  .day span{box-shadow:none!important}.day{margin:6px 0!important}
}

/* ------------------------------ macOS ---------------------------------- */
.mac-sidebar-resizer{display:none}
@media(min-width:900px){
  body.has-app{padding:0!important;gap:0!important;background:var(--background-primary)!important;overflow:hidden!important}
  body.has-app #listScreen{position:fixed!important;inset:0!important;display:block!important;width:var(--mac-sidebar-width)!important;height:100vh!important;border:0!important;border-radius:0!important;background:color-mix(in srgb,var(--background-primary) 88%,transparent)!important;box-shadow:none!important;overflow:hidden!important;z-index:3!important}
  body.has-app #listScreen>.list-main{position:absolute!important;inset:0!important;width:auto!important;height:100%!important;display:flex!important;flex-direction:column!important;border:0!important;border-right:.5px solid var(--separator)!important;background:color-mix(in srgb,var(--background-primary) 92%,transparent)!important;-webkit-backdrop-filter:blur(26px) saturate(145%);backdrop-filter:blur(26px) saturate(145%)}
  .list-head{padding:10px 12px 8px!important;border:0!important;box-shadow:0 .5px 0 var(--separator)!important}.list-head .lh-row{height:42px!important;min-height:42px!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important}.list-edit-btn{display:none!important}.brand-lockup{margin:0 0 0 2px!important}.desktop-brand{display:inline!important}.mobile-brand{display:none!important}.brand-text h1{font-size:16px!important;line-height:20px!important;font-weight:650!important}.lh-right{display:flex!important;align-items:center!important;gap:0!important}.compose-btn,.list-more-btn{display:grid!important;width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;border-radius:8px!important}.compose-btn:hover,.list-more-btn:hover{background:var(--hover)!important}.list-head .search{margin-top:5px!important;height:36px!important;min-height:36px!important;border:0!important;border-radius:9px!important;background:color-mix(in srgb,var(--label-tertiary) 8%,var(--background-secondary))!important;box-shadow:none!important}
  .folder-tabs{height:38px!important;min-height:38px!important;padding:0 4px 3px!important;display:flex!important;gap:0!important;overflow-x:auto!important;border:0!important;box-shadow:0 .5px 0 var(--separator)!important;background:transparent!important}.folder-tab{min-height:35px!important;padding:0 10px!important;border:0!important;background:transparent!important;color:var(--label-secondary)!important;border-radius:0!important;font-size:12px!important;white-space:nowrap!important;position:relative!important}.folder-tab.on{color:var(--accent)!important;font-weight:600!important}.folder-tab.on::after{content:"";position:absolute;left:10px;right:10px;bottom:1px;height:2px;border-radius:2px;background:var(--accent)}
  #chatList{flex:1!important;overflow-y:auto!important;padding:2px 6px 8px!important}.archive-row{min-height:56px!important;padding:5px 7px!important;border-radius:7px!important}.archive-row::after{display:none}.archive-avatar{width:40px;height:40px}.archive-copy b{font-size:13.5px}.archive-copy small{font-size:11.5px}
  #chatList .row-item{min-height:58px!important;margin:1px 0!important;padding:5px 7px!important;gap:8px!important;border-radius:7px!important}.row-item::after{display:none!important}#chatList .row-item>.av{width:42px!important;height:42px!important;min-width:42px!important}.ri-name{font-size:13.5px!important;line-height:17px!important}.ri-prev{font-size:12px!important;line-height:15px!important}.ri-time{font-size:10.5px!important}.row-item:hover{background:var(--hover)!important}.row-item.selected{background:color-mix(in srgb,var(--accent) 18%,var(--surface-primary))!important}.row-item:focus-within{outline:2px solid var(--focus);outline-offset:-2px}
  .mac-sidebar-resizer{display:block!important;position:fixed;z-index:50;left:calc(var(--mac-sidebar-width) - 3px);top:0;width:6px;height:100vh;cursor:col-resize;background:transparent}.mac-sidebar-resizer:hover,.resizing-sidebar .mac-sidebar-resizer{background:color-mix(in srgb,var(--accent) 28%,transparent)}
  body.has-app #chatScreen{position:fixed!important;z-index:4!important;inset:0 0 0 var(--mac-sidebar-width)!important;width:auto!important;height:100vh!important;border:0!important;border-radius:0!important;background:var(--background-secondary)!important;box-shadow:none!important;transform:none!important;transition:left .08s linear!important}.chat-head{min-height:54px!important;height:54px!important;padding:0 10px!important;border:0!important;box-shadow:0 .5px 0 var(--separator)!important;background:var(--glass-bg)!important}.chat-head .head-tools{gap:0!important}.chat-head .head-tools .icon-btn,.chat-head .neo-head-badge{width:36px!important;height:36px!important;min-width:36px!important;min-height:36px!important;border-radius:8px!important}.chat-head .head-tools .icon-btn:hover,.chat-head .neo-head-badge:hover{background:var(--hover)!important}.chat-head #chatAv{width:36px!important;height:36px!important;min-width:36px!important}.ch-title{font-size:14px!important}.ch-sub{font-size:10.5px!important}.backBtn{display:none!important}
  body.has-app #chatScreen #msgs{padding:20px clamp(20px,5vw,76px) 18px!important;overflow-y:auto!important}.mrow{margin:1px 0!important}.bwrap{max-width:min(72%,720px)!important}.mrow.their>.av,.mrow.their>.aspace{display:none!important}
  
  
  .ios-tabbar{display:none!important}
}

/* ---------------------------- settings --------------------------------- */

.primary-btn#saveBtn{width:auto!important;min-width:90px!important;min-height:36px!important;margin:12px!important;padding:0 16px!important;border-radius:9px!important}

@media(max-width:899px){
  .primary-btn#saveBtn{width:calc(100% - 24px)!important;margin:12px!important;min-height:44px!important}
}

@media(min-width:900px){
  
  
  
  
  
  
  .primary-btn#saveBtn{display:inline-flex!important;width:auto!important;align-self:flex-end!important}
}

/* Popovers / desktop context presentation */
.apple-popover{position:fixed;inset:0;z-index:10020;background:transparent}.apple-popover-box{position:fixed;width:250px;padding:5px;border:.5px solid var(--glass-border);border-radius:12px;color:var(--label-primary)}.apple-popover-item{width:100%;min-height:38px;display:grid;grid-template-columns:24px minmax(0,1fr);align-items:center;gap:8px;padding:5px 8px;border:0;border-radius:8px;background:transparent;color:inherit;text-align:left;font-size:13px}.apple-popover-item:hover{background:var(--hover)}.apple-popover-item.danger{color:var(--destructive)}.apple-popover-icon{display:grid;place-items:center;color:var(--accent)}.apple-popover-icon svg{width:18px;height:18px}.apple-popover-sep{height:.5px;background:var(--separator);margin:4px -1px}
@media(max-width:899px){.apple-popover{background:rgba(0,0,0,.20);display:flex;align-items:flex-end;padding:0 8px calc(8px + var(--sab))}.apple-popover-box{position:static!important;width:100%!important;border-radius:18px!important;padding:7px!important}.apple-popover-item{min-height:48px;font-size:16px;border-radius:12px}.apple-popover-icon svg{width:21px;height:21px}}
.runtime-dialog{z-index:10050!important}.runtime-dialog-sheet{width:min(420px,calc(100vw - 28px))!important}.runtime-dialog-input{width:100%;min-height:44px;margin:10px 0;padding:9px 11px;border:.5px solid var(--separator);border-radius:10px;background:var(--background-secondary);color:var(--label-primary);outline:none}.runtime-dialog-input:focus{box-shadow:0 0 0 3px var(--focus)}

/* Accessibility states */
html.reduce-motion *{scroll-behavior:auto!important;animation:none!important;transition-duration:.001ms!important}
@media (prefers-reduced-motion: reduce){*{scroll-behavior:auto!important;animation:none!important;transition-duration:.001ms!important}}
html.increase-contrast{--separator:rgba(142,142,147,.72)}
@media(prefers-contrast:more){.ri-time,.ri-prev,.ch-sub{color:var(--label-secondary)!important}.ios-tabbar{box-shadow:0 0 0 1px var(--separator)!important}}


/* ---------- Unified Telegram-Apple cleanup pass ---------- */
.tools-search-wrap{display:flex;align-items:center;gap:8px;min-height:38px;padding:0 12px;border-radius:12px;background:var(--surface-secondary);border:1px solid rgba(127,127,127,.14)}
.tools-search-ico{color:var(--label-secondary);font-size:16px;line-height:1}
.tools-search.telegram-search{border:0!important;background:transparent!important;box-shadow:none!important;padding:10px 0!important;min-height:38px;color:var(--label-primary);font:inherit;outline:none;width:100%}
.tool-screen{display:flex;flex-direction:column;gap:14px}
.tool-sheet-hero{padding:6px 4px 2px}
.tool-sheet-kicker{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--accent)}
.tool-sheet-hero h4{margin:6px 0 4px;font-size:24px;line-height:1.15;color:var(--label-primary)}
.tool-sheet-hero p{margin:0;color:var(--label-secondary);font-size:14px;line-height:1.45}
.tool-actions-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
.tool-action-card{display:flex;gap:10px;align-items:flex-start;padding:12px;border:0;border-radius:16px;background:var(--surface-primary);color:var(--label-primary);text-align:left;box-shadow:inset 0 0 0 1px rgba(127,127,127,.12)}
.tool-action-card:hover{background:var(--surface-secondary)}
.tool-action-card:active{transform:scale(.985)}
.tool-action-icon{width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:rgba(0,122,255,.12);color:var(--accent);flex:0 0 auto}
.tool-action-icon svg,.contact-row-action svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tool-action-copy{display:flex;flex-direction:column;gap:3px;min-width:0}
.tool-action-copy strong{font-size:14px;font-weight:600}
.tool-action-copy small{font-size:12px;color:var(--label-secondary)}
.tool-section-title{padding:10px 4px 6px;font-size:12px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:var(--label-secondary)}
.contacts-picker-list,.tools-list{display:flex;flex-direction:column;gap:2px}
.contact-row,.group-member-row{display:flex;align-items:center;gap:12px;min-height:58px;padding:10px 12px;border:0;border-radius:16px;background:var(--surface-primary);color:var(--label-primary);text-align:left;box-shadow:inset 0 0 0 1px rgba(127,127,127,.10)}
.contact-row:hover,.group-member-row:hover{background:var(--surface-secondary)}
.contact-meta,.group-member-copy{display:flex;flex-direction:column;gap:2px;min-width:0}
.contact-meta b,.group-member-copy strong{font-size:15px;font-weight:600;color:var(--label-primary)}
.contact-meta small,.group-member-copy small{font-size:12px;color:var(--label-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.contact-row-action{margin-left:auto;width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:rgba(0,122,255,.08);color:var(--accent)}
.group-create-search{margin-bottom:4px}.group-members{display:flex;flex-direction:column;gap:8px}.group-member-meta{display:flex;align-items:center;gap:12px;min-width:0;flex:1}.group-member-check{width:18px;height:18px;accent-color:var(--accent)}
.group-info-sheet{gap:12px!important}
.group-info-hero{display:flex;align-items:center;gap:14px;padding:4px 2px 2px}.group-info-meta{display:flex;flex-direction:column;gap:4px;min-width:0}.group-info-meta h4{margin:0;font-size:22px;line-height:1.2;color:var(--label-primary)}.group-info-meta p{margin:0;font-size:13px;color:var(--label-secondary)}
.group-info-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}.group-info-action{display:flex;flex-direction:column;align-items:center;gap:6px;justify-content:center;min-height:72px;padding:10px 8px;border:0;border-radius:16px;background:var(--surface-primary);color:var(--label-primary);box-shadow:inset 0 0 0 1px rgba(127,127,127,.1)}.group-info-action span{font-size:21px;line-height:1}.group-info-action small{font-size:12px;color:var(--label-secondary);text-align:center}.group-members-section{display:flex;flex-direction:column;gap:8px}.group-member-row.is-button{width:100%}.group-role-mini-badge{margin-left:auto}.group-info-footer .mi{justify-content:center}
#lumoTools .lumo-tools-card,#chatMenuWrap .sheet,#fwdWrap .sheet{background:var(--background-grouped)!important;border:1px solid rgba(127,127,127,.12)!important;border-radius:22px!important;box-shadow:0 20px 60px rgba(0,0,0,.16)!important}
#lumoTools .lumo-tools-head{padding:6px 2px 16px!important;align-items:flex-start!important;border-bottom:0!important}.lumo-tools-kicker{display:none!important}.lumo-tools-head h3{font-size:18px!important;line-height:1.2!important;color:var(--label-primary)!important}.lumo-tools-body{padding:0 2px 4px!important}
#chatMenuWrap .sheet{padding:16px!important}










@media (max-width: 899px){
  .tool-actions-grid,.group-info-actions{grid-template-columns:repeat(2,minmax(0,1fr))}
  .contact-row,.group-member-row{border-radius:14px}
}

/* True top-level Contacts/Calls views */
#listScreen>.top-tab-panel{grid-column:1!important;grid-row:1!important;min-width:0;height:100%;overflow:auto;background:var(--background-primary);padding-bottom:calc(72px + var(--sab))}
.top-tab-header{position:sticky;top:0;z-index:4;display:grid;grid-template-columns:64px minmax(0,1fr) 64px;align-items:center;min-height:calc(54px + var(--sat));padding:var(--sat) 12px 0;background:var(--glass-bg);backdrop-filter:saturate(170%) blur(24px);-webkit-backdrop-filter:saturate(170%) blur(24px);border-bottom:.5px solid var(--separator)}
.top-tab-header h2{margin:0;text-align:center;font-size:20px;line-height:1.2}.top-tab-edit,.top-tab-compose{border:0;background:transparent;color:var(--accent);min-width:44px;min-height:44px;font:inherit}.top-tab-edit{text-align:left}.top-tab-compose{justify-self:end;display:grid;place-items:center}.top-tab-compose svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.top-tab-search{display:flex;align-items:center;gap:8px;margin:10px 12px 8px;padding:0 12px;min-height:38px;border-radius:12px;background:var(--surface-secondary);color:var(--label-secondary)}.top-tab-search input{flex:1;border:0;background:transparent;color:var(--label-primary);font:inherit;outline:none;padding:9px 0}.top-tab-search button{border:0;background:transparent;color:var(--accent);font:inherit}
.contacts-top-actions{margin:0 12px 10px;border-radius:14px;overflow:hidden;background:var(--surface-primary)}.contacts-top-action{width:100%;min-height:50px;padding:0 14px;display:grid;grid-template-columns:30px minmax(0,1fr) auto;align-items:center;gap:10px;border:0;border-bottom:.5px solid var(--separator);background:transparent;color:var(--label-primary);text-align:left}.contacts-top-action:last-child{border-bottom:0}.contacts-top-action-icon{color:var(--accent);font-size:19px}.contacts-top-action strong{font-size:15px;font-weight:500}
.contacts-top-list,.calls-top-list{display:flex;flex-direction:column}.contact-list-row{width:100%;min-height:64px;display:grid;grid-template-columns:48px minmax(0,1fr) auto;align-items:center;gap:10px;padding:6px 12px;border:0;background:var(--background-primary);color:var(--label-primary);text-align:left;position:relative}.contact-list-row::after{content:"";position:absolute;left:70px;right:0;bottom:0;height:.5px;background:var(--separator)}.contact-list-row:hover{background:var(--surface-secondary)}.contact-list-meta{display:flex;flex-direction:column;gap:2px;min-width:0}.contact-list-meta strong{font-size:15px}.contact-list-meta small{font-size:13px;color:var(--label-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.contact-list-chev,.call-row-icon{color:var(--label-tertiary)}
@media (min-width:900px){#listScreen>.top-tab-panel{grid-column:1!important;grid-row:1!important;border-right:.5px solid var(--separator);padding-bottom:0}.top-tab-header{padding-top:0;min-height:54px}.top-tab-header h2{text-align:left;font-size:18px}.top-tab-header{grid-template-columns:44px minmax(0,1fr) 44px}.top-tab-edit{font-size:0}.top-tab-edit::after{content:"+";font-size:22px}.contacts-top-actions{margin-top:8px}.contact-list-row{min-height:58px}}

/* Attachment picker + preview */
.attachment-sheet{max-width:420px!important}.attachment-handle{display:none}.attachment-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:8px 0 12px}.attachment-actions button{min-height:86px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;border:0;border-radius:16px;background:var(--surface-primary);color:var(--label-primary);font:inherit;box-shadow:inset 0 0 0 1px rgba(127,127,127,.1)}.attachment-action-icon{font-size:28px}.attachment-cancel{width:100%}.attachment-preview-sheet{width:min(520px,calc(100vw - 28px))!important;display:flex;flex-direction:column;gap:12px;padding:12px!important}.attachment-preview-head{display:grid;grid-template-columns:80px minmax(0,1fr) 80px;align-items:center;text-align:center}.attachment-preview-head button{border:0;background:transparent;color:var(--accent);font:inherit;text-align:left}.attachment-preview-image{width:100%;max-height:58vh;object-fit:contain;border-radius:16px;background:#000}.attachment-caption textarea{width:100%;box-sizing:border-box;border:0;border-radius:14px;background:var(--surface-secondary);color:var(--label-primary);font:inherit;padding:12px;outline:none;resize:none}.attachment-preview-actions{display:flex;justify-content:flex-end}.attachment-preview-actions .composer-primary-btn{position:static!important;display:grid!important}.attachment-preview-actions .composer-primary-btn:disabled{opacity:.45}
@media(max-width:899px){.attachment-overlay,.attachment-preview-overlay{align-items:flex-end!important;padding:0!important}.attachment-sheet,.attachment-preview-sheet{width:100%!important;max-width:none!important;border-radius:22px 22px 0 0!important;padding:14px 14px calc(14px + var(--sab))!important}.attachment-handle{display:block;width:36px;height:5px;border-radius:999px;background:var(--label-tertiary);margin:0 auto 8px}.attachment-preview-image{max-height:52vh}}

/* Reactions / message selection */
.reaction-more-btn{font-size:22px!important;color:var(--accent)!important}.reaction-details-sheet,.reaction-picker-sheet{width:min(420px,calc(100vw - 28px))!important}.reaction-user-list{display:flex;flex-direction:column;gap:4px;max-height:50vh;overflow:auto}.reaction-user-row{display:flex;align-items:center;gap:10px;min-height:50px;padding:6px 8px;border:0;border-radius:12px;background:transparent;color:var(--label-primary);font:inherit;text-align:left}.reaction-user-row:hover{background:var(--surface-secondary)}.reaction-picker-grid{display:grid;grid-template-columns:repeat(8,1fr);gap:4px;max-height:46vh;overflow:auto;padding:4px 0 10px}.reaction-picker-item{aspect-ratio:1;border:0;border-radius:10px;background:transparent;font-size:24px}.reaction-picker-item:hover{background:var(--surface-secondary);transform:scale(1.08)}.msg-menu-info{display:flex;align-items:center;gap:10px;padding:8px 12px;color:var(--label-secondary);font-size:12px}.message-selection-bar{position:absolute;z-index:48;left:12px;right:12px;bottom:calc(8px + var(--sab));display:flex;gap:6px;justify-content:center;align-items:center;min-height:52px;padding:6px;border-radius:18px;background:var(--glass-bg);backdrop-filter:saturate(170%) blur(24px);-webkit-backdrop-filter:saturate(170%) blur(24px);box-shadow:var(--glass-shadow)}.message-selection-bar button{border:0;border-radius:12px;background:transparent;color:var(--accent);font:inherit;padding:9px 12px}.message-selection-bar button:hover{background:var(--surface-secondary)}.message-selection-bar button.danger{color:#ff453a}.message-selection-mode #composer{visibility:hidden;pointer-events:none}
@media(max-width:899px){.reaction-details-overlay{align-items:flex-end!important;padding:0!important}.reaction-details-sheet,.reaction-picker-sheet{width:100%!important;max-width:none!important;border-radius:22px 22px 0 0!important;padding-bottom:calc(14px + var(--sab))!important}.reaction-picker-grid{grid-template-columns:repeat(7,1fr)}}

/* ===== Final v4: group info / desktop inspector / interaction cleanup ===== */
.group-info-screen{position:fixed;z-index:92;background:var(--background-grouped);color:var(--label-primary);visibility:hidden;pointer-events:none;transition:transform .22s cubic-bezier(.2,.8,.2,1),visibility 0s linear .22s}
.group-info-screen.open{visibility:visible;pointer-events:auto;transition:transform .22s cubic-bezier(.2,.8,.2,1),visibility 0s}
.group-info-nav{position:sticky;top:0;z-index:4;display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:center;min-height:54px;padding-top:var(--sat);background:var(--glass-bg);-webkit-backdrop-filter:blur(24px) saturate(180%);backdrop-filter:blur(24px) saturate(180%);border-bottom:.5px solid var(--separator)}
.group-info-nav button{border:0;background:transparent;color:var(--accent);min-width:44px;min-height:44px;font:inherit;font-size:16px}.group-info-nav strong{text-align:center;font-size:16px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-info-scroll{height:100%;overflow-y:auto;padding:16px 14px calc(32px + var(--sab))}
.group-info-profile{display:flex;flex-direction:column;align-items:center;text-align:center;padding:10px 12px 18px}.group-info-profile .av{width:92px!important;height:92px!important;font-size:34px!important}.group-info-profile h2{margin:12px 0 3px;font-size:22px;line-height:1.2}.group-info-profile p{margin:0;color:var(--label-secondary);font-size:13px}
.group-info-quick{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:18px}.group-info-quick button{min-width:0;min-height:70px;padding:8px 4px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;border:0;border-radius:15px;background:var(--surface-primary);color:var(--accent);font:inherit;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--separator) 70%,transparent)}.group-info-quick .gi-icon{font-size:20px;line-height:1}.group-info-quick small{font-size:11.5px;color:var(--label-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.group-info-section{margin:0 0 18px}.group-info-section-title{padding:0 12px 6px;color:var(--label-secondary);font-size:12px;font-weight:650;text-transform:uppercase;letter-spacing:.04em}.group-info-card{overflow:hidden;border-radius:14px;background:var(--surface-primary);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--separator) 65%,transparent)}
.group-info-row{width:100%;min-height:50px;padding:0 14px;display:grid;grid-template-columns:34px minmax(0,1fr) auto;gap:9px;align-items:center;border:0;border-bottom:.5px solid var(--separator);background:transparent;color:var(--label-primary);font:inherit;text-align:left}.group-info-row:last-child{border-bottom:0}.group-info-row:hover{background:var(--surface-secondary)}.group-info-row:disabled{opacity:.52}.group-info-row-icon{width:28px;height:28px;display:grid;place-items:center;color:var(--accent);font-size:18px}.group-info-row-copy{display:flex;flex-direction:column;gap:2px;min-width:0}.group-info-row-copy b{font-size:14px;font-weight:550}.group-info-row-copy small{font-size:12px;color:var(--label-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-info-row-value{font-size:12px;color:var(--label-secondary)}.group-info-row.danger{color:#ff453a}.group-info-row.danger .group-info-row-icon{color:#ff453a}
.group-info-member{grid-template-columns:42px minmax(0,1fr) auto!important}.group-info-member>.av{width:38px!important;height:38px!important}.group-info-member-role{font-size:11px;color:var(--label-secondary);padding:3px 7px;border-radius:999px;background:var(--surface-secondary)}
.group-invite-url{font-size:11px!important;word-break:break-all}.group-invite-actions{display:flex;gap:5px}.group-invite-actions button{border:0;border-radius:8px;background:var(--surface-secondary);color:var(--accent);padding:6px 8px;font-size:12px}
.group-info-empty{padding:18px 14px;color:var(--label-secondary);font-size:13px;text-align:center}
@media(max-width:899px){
  .group-info-screen{inset:0;transform:translateX(100%)}.group-info-screen.open{transform:translateX(0)}
  .group-info-nav{padding-left:var(--sal);padding-right:var(--sar)}
}
@media(min-width:900px){
  .group-info-screen{top:0;right:0;bottom:0;width:370px;border-left:.5px solid var(--separator);box-shadow:-12px 0 34px rgba(0,0,0,.08);transform:translateX(100%)}.group-info-screen.open{transform:translateX(0)}
  .group-info-nav{padding-top:0;grid-template-columns:44px minmax(0,1fr) 44px}.group-info-scroll{padding:14px 14px 30px}.group-info-profile .av{width:80px!important;height:80px!important}
}

/* Roles use the same Apple sheet family instead of the old blue modal. */
.group-roles-overlay{background:rgba(0,0,0,.22)!important;-webkit-backdrop-filter:blur(4px)!important;backdrop-filter:blur(4px)!important}.group-roles-sheet{background:var(--background-grouped)!important;color:var(--label-primary)!important;border:1px solid var(--separator)!important;border-radius:20px!important;box-shadow:0 24px 70px rgba(0,0,0,.24)!important}.group-role-row{background:var(--surface-primary)!important;border:0!important;border-radius:14px!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--separator) 70%,transparent)!important}.group-role-select{background:var(--surface-secondary)!important;color:var(--label-primary)!important;border:0!important;border-radius:10px!important;padding:7px 28px 7px 9px!important}
@media(min-width:900px){.group-roles-overlay{align-items:stretch!important;justify-content:flex-end!important;padding:0!important}.group-roles-sheet{height:100vh!important;width:370px!important;max-height:none!important;border-radius:0!important;border-top:0!important;border-bottom:0!important;border-right:0!important;padding:16px!important}}

/* Edit mode: no compose button and no enabled bulk action before selection. */
body.chat-edit-mode .compose-btn{visibility:hidden!important;pointer-events:none!important}.chat-edit-toolbar button:disabled{opacity:.35!important;pointer-events:none!important}

/* Locked voice recording is a stable control state, not a transient tap recorder. */
body.voice-record-locked #recbar{outline:1px solid color-mix(in srgb,var(--accent) 32%,transparent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 7%,transparent)}
body.voice-record-locked #recbar .rec-hint{color:var(--accent)!important;font-weight:600}

/* Polls are data-backed components; never visually expose their payload text. */
.poll-card{overflow:hidden;border-radius:16px!important;background:var(--surface-primary)!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--separator) 65%,transparent)!important}.poll-kind{font-size:11px!important;color:var(--label-secondary)!important;text-transform:none!important}.poll-opt{position:relative;overflow:hidden}.poll-opt .poll-fill{position:absolute;inset:0 auto 0 0;z-index:0;background:color-mix(in srgb,var(--accent) 10%,transparent);pointer-events:none}.poll-opt>*:not(.poll-fill){position:relative;z-index:1}.poll-opt.correct{box-shadow:inset 0 0 0 1px rgba(52,199,89,.45)!important}.poll-opt.wrong{box-shadow:inset 0 0 0 1px rgba(255,69,58,.38)!important}.poll-details-btn{border:0!important;background:transparent!important;color:var(--accent)!important;font:inherit!important;padding:8px 0!important}

/* Group Info DOM names used by render.js */
.group-profile-hero{display:flex;flex-direction:column;align-items:center;text-align:center;padding:8px 8px 18px}.group-profile-hero .av{width:88px!important;height:88px!important}.group-profile-hero h2{margin:11px 0 3px;font-size:22px;line-height:1.2}.group-profile-hero p{margin:0;color:var(--label-secondary);font-size:13px}
.group-profile-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin-bottom:18px}.group-profile-action{min-height:70px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:6px;padding:8px 4px;border:0;border-radius:15px;background:var(--surface-primary);color:var(--accent);font:inherit;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--separator) 65%,transparent)}.group-profile-action:hover{background:var(--surface-secondary)}.group-profile-action-icon{font-size:20px}.group-profile-action small{font-size:11.5px;color:var(--label-primary);max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-profile-section{margin-bottom:18px}.group-profile-section-title,.group-profile-subhead{padding:0 12px 6px;color:var(--label-secondary);font-size:12px;font-weight:650;text-transform:uppercase;letter-spacing:.04em}.group-profile-section>.group-profile-row,.group-profile-section>.group-profile-member,.group-invite-list{background:var(--surface-primary)}.group-profile-section>.group-profile-row:first-of-type,.group-profile-section>.group-profile-member:first-of-type{border-radius:14px 14px 0 0}.group-profile-section>.group-profile-row:last-child,.group-profile-section>.group-profile-member:last-child{border-radius:0 0 14px 14px}.group-profile-section>.group-profile-row:only-of-type,.group-profile-section>.group-profile-member:only-of-type{border-radius:14px}
.group-profile-row{width:100%;min-height:50px;padding:0 14px;display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center;border:0;border-bottom:.5px solid var(--separator);background:var(--surface-primary);color:var(--label-primary);font:inherit;text-align:left}.group-profile-row:last-child{border-bottom:0}.group-profile-row:hover{background:var(--surface-secondary)}.group-profile-row-label{font-size:14px}.group-profile-row-value{font-size:12px;color:var(--label-secondary)}.group-profile-row-chevron{font-size:19px;color:var(--label-tertiary)}.group-profile-row.danger,.group-profile-row.danger .group-profile-row-label{color:#ff453a}.group-profile-row:disabled{opacity:.55}
.group-profile-member{width:100%;min-height:58px;padding:6px 14px;display:grid;grid-template-columns:44px minmax(0,1fr);align-items:center;gap:10px;border:0;border-bottom:.5px solid var(--separator);background:var(--surface-primary);color:var(--label-primary);font:inherit;text-align:left}.group-profile-member:hover{background:var(--surface-secondary)}.group-profile-member>.av{width:40px!important;height:40px!important}.group-profile-member-meta{display:flex;flex-direction:column;gap:2px;min-width:0}.group-profile-member-meta strong{font-size:14px;font-weight:550;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-profile-member-meta small{font-size:12px;color:var(--label-secondary)}
.group-profile-danger{overflow:hidden;border-radius:14px;background:var(--surface-primary)}
.group-invite-list{overflow:hidden;border-radius:14px;margin:8px 0 12px}.group-invite-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px 12px;border-bottom:.5px solid var(--separator)}.group-invite-row:last-child{border-bottom:0}.group-invite-copy{display:flex;flex-direction:column;gap:3px;min-width:0}.group-invite-copy strong{font-size:13px}.group-invite-copy small{font-size:11px;color:var(--label-secondary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.group-invite-actions{display:flex;gap:5px}.group-invite-actions button{border:0;border-radius:9px;background:var(--surface-secondary);color:var(--accent);font:inherit;font-size:11px;padding:7px 8px}.group-invite-actions button.danger{color:#ff453a}
@media(min-width:900px){.group-profile-hero .av{width:76px!important;height:76px!important}.group-profile-hero h2{font-size:20px}.group-profile-actions{gap:6px}}

/* Group roles / slow mode live inside the native group inspector */
.group-profile-subhead-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;margin:0 0 12px}.group-profile-subhead-row strong{font-size:18px;text-align:center}.group-profile-inline-back{min-height:38px;padding:0 8px;border:0;background:transparent;color:var(--accent);font:inherit;font-size:15px}.group-role-intro{padding-top:4px!important}.group-roles-native-list{display:flex;flex-direction:column;gap:10px}.group-role-native-card{padding:12px;border-radius:15px;background:var(--surface-primary);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--separator) 65%,transparent)}.group-role-native-head{display:flex;align-items:center;gap:10px}.group-role-native-head .group-role-user{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.group-role-native-head .group-role-user span{font-size:12px;color:var(--label-secondary)}.group-role-owner-badge{margin-left:auto;padding:4px 8px;border-radius:999px;background:rgba(0,122,255,.12);color:var(--accent);font-size:11px;font-weight:650}.group-role-native-controls{display:flex;align-items:center;gap:8px;margin-top:10px}.group-role-select{min-height:36px;flex:1;border:.5px solid var(--separator);border-radius:9px;background:var(--background-secondary);color:var(--label-primary);padding:0 10px}.group-role-remove{min-height:36px;border:0;border-radius:9px;padding:0 10px;background:rgba(255,69,58,.10);color:#ff453a;font:inherit}.group-role-native-perms{display:grid;gap:8px;margin-top:12px;padding-top:12px;border-top:.5px solid var(--separator)}.group-role-native-perms label{display:flex;align-items:center;gap:9px;font-size:13px;color:var(--label-primary)}.group-role-native-perms input{accent-color:var(--accent)}.group-slow-options{overflow:hidden;border-radius:14px;background:var(--surface-primary)}.group-slow-options .group-profile-row{border-bottom:.5px solid var(--separator)}.group-slow-options .group-profile-row:last-child{border-bottom:0}.group-slow-options .group-profile-row.selected{color:var(--accent)}

/* System controls use the same monochrome SVG language; user emoji/reactions are unchanged. */
.attachment-action-icon>svg,.attachment-file-preview>span>svg,.ai-head>svg,.ai-ico>svg,#aiBtn>svg{
  width:18px;height:18px;display:block;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto
}
.attachment-file-preview>span>svg{width:24px;height:24px}
.ai-head{display:flex;align-items:center;gap:8px}
#aiBtn>svg{width:20px;height:20px}

/* Desktop empty conversation state: visible only when no chat is open. */
.desktop-chat-empty{display:none}
@media(min-width:900px){
  body.has-app #chatScreen:not(.open)>.desktop-chat-empty{display:flex;position:absolute;inset:0;z-index:2;align-items:center;justify-content:center;flex-direction:column;gap:10px;color:var(--label-secondary);pointer-events:none}
  body.has-app #chatScreen:not(.open)>.desktop-chat-empty .desktop-chat-empty-icon{width:46px;height:46px;display:grid;place-items:center;border-radius:14px;background:var(--surface-primary);border:.5px solid var(--separator)}
  body.has-app #chatScreen:not(.open)>.desktop-chat-empty svg{width:23px;height:23px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
  body.has-app #chatScreen:not(.open)>.desktop-chat-empty span{font-size:13px;font-weight:500}
  body.has-app #chatScreen:not(.open)>.chat-head,
  body.has-app #chatScreen:not(.open)>#msgs,
  body.has-app #chatScreen:not(.open)>#composer,
  body.has-app #chatScreen:not(.open)>#recbar,
  body.has-app #chatScreen:not(.open)>#scrollDown,
  body.has-app #chatScreen:not(.open)>#emojiPanel{visibility:hidden;pointer-events:none}
}

/* Canonical system chevrons use monochrome SVG, never platform glyphs. */
.tg-chevron{display:grid;place-items:center;color:var(--label-tertiary)}
.tg-chevron svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.contact-list-chev svg,.contact-row-action svg,.group-profile-row-chevron svg,.cm-chev svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}





/* ========================================================================
   DESIGN PASS 1 — canonical Telegram/iOS + macOS component geometry
   The legacy NEO layer no longer owns these components. This section is the
   final source of truth for the seven primary surfaces requested in the
   first visual pass: sidebar, tab bar, Settings, bubbles, header/composer
   and chat list.
   ======================================================================== */

/* Shared calm surfaces: no decorative glow/gradient on app chrome. */
body.has-app{background:var(--background-primary)!important}
.list-head,.chat-head,#composer,.ios-tabbar{
  background:color-mix(in srgb,var(--glass-regular) 94%,var(--background-primary))!important;
  box-shadow:none!important;
}
.list-head,.chat-head{border-bottom:.5px solid var(--separator)!important}
#composer{border-top:.5px solid var(--separator)!important}
.list-head::after,.chat-head::after,#composer::after,.ios-tabbar::after,.ios-tabbar::before{display:none!important}

/* Message language: flat Telegram-like surfaces, compact metadata. */
#msgs{background-color:var(--background-secondary)!important;background-image:none!important}
.bwrap{max-width:min(78%,680px)!important}








.mrow.own .meta,.mrow.own .ticks{color:rgba(255,255,255,.74)!important}
.mrow.own .ticks.read{color:#fff!important;filter:none!important}
.mrow.their .meta{color:var(--label-secondary)!important}




/* Header: avatar/name/status + compact actions, no decorative avatar ring. */
.chat-head{gap:9px!important;box-shadow:none!important}
.chat-head #chatAv,.chat-head .av{border:0!important;box-shadow:none!important}
.chat-head .head-tools{margin-left:auto!important;gap:0!important}
.chat-head .head-tools .icon-btn,.chat-head .neo-head-badge{background:transparent!important;border:0!important;box-shadow:none!important;color:var(--label-secondary)!important}
.chat-head .head-tools .icon-btn:hover,.chat-head .neo-head-badge:hover{background:var(--hover)!important;color:var(--accent)!important}
.ch-title{font-weight:650!important;letter-spacing:-.01em!important}.ch-sub{color:var(--label-secondary)!important}

/* Settings groups: one section surface with separators, not one card per row. */








/* ------------------------------ iPhone -------------------------------- */
@media(max-width:899px){
  body.has-app #listScreen>.list-main{padding-bottom:calc(57px + var(--sab))!important}
  .ios-tabbar{
    position:absolute!important;z-index:40!important;
    left:0!important;right:0!important;bottom:0!important;
    width:100%!important;height:calc(57px + var(--sab))!important;
    padding:2px max(6px,var(--sar)) var(--sab) max(6px,var(--sal))!important;
    display:grid!important;grid-template-columns:repeat(4,1fr)!important;align-items:start!important;
    border:0!important;border-top:.5px solid var(--separator)!important;border-radius:0!important;
    background:color-mix(in srgb,var(--glass-regular) 94%,var(--background-primary))!important;
    box-shadow:none!important;overflow:visible!important
  }
  .ios-tab{height:54px!important;min-height:54px!important;gap:1px!important;border-radius:0!important;color:var(--label-tertiary)!important;font-size:10.5px!important;font-weight:500!important}
  .ios-tab svg{width:23px!important;height:23px!important;stroke-width:1.8!important}.ios-tab.active{color:var(--accent)!important}
  #chatList{padding-bottom:calc(8px + var(--sab))!important}
  #chatList .row-item{min-height:68px!important;padding:7px 12px!important;gap:10px!important}
  #chatList .row-item>.av{width:52px!important;height:52px!important;min-width:52px!important}
  #chatList .row-item::after{left:74px!important}.ri-name{font-size:16px!important;line-height:20px!important;font-weight:600!important}.ri-prev{font-size:14px!important;line-height:18px!important}.ri-time{font-size:12px!important}
  
  
  
  
  
  .chat-head{min-height:calc(var(--sat) + 52px)!important;padding:var(--sat) max(6px,var(--sar)) 0 max(6px,var(--sal))!important}
  .chat-head #chatAv{width:38px!important;height:38px!important;min-width:38px!important}.ch-title{font-size:16px!important}.ch-sub{font-size:12px!important}
  
  
  
}

/* ------------------------------ desktop ------------------------------- */
@media(min-width:900px){
  body.has-app{background:var(--background-primary)!important}
  body.has-app #listScreen{width:var(--mac-sidebar-width)!important;background:var(--background-primary)!important}
  body.has-app #listScreen>.list-main{inset:0!important;border-right:.5px solid var(--separator)!important;background:var(--background-primary)!important;backdrop-filter:none!important;-webkit-backdrop-filter:none!important}
  .list-head{margin-left:0!important;padding:8px 10px 7px!important;background:var(--background-primary)!important}
  .list-head .lh-row{height:42px!important;min-height:42px!important}.brand-lockup{margin-left:2px!important}.brand-text h1{font-size:17px!important}
  .list-head .search{height:36px!important;min-height:36px!important;margin-top:5px!important;border-radius:9px!important;background:var(--background-secondary)!important}
  .folder-tabs{background:var(--background-primary)!important}
  #chatList{margin-left:0!important;padding:3px 6px 8px!important;background:var(--background-primary)!important}
  #chatList .row-item{min-height:64px!important;margin:1px 0!important;padding:6px 8px!important;gap:9px!important;border-radius:8px!important;background:transparent!important;box-shadow:none!important}
  #chatList .row-item>.av{width:48px!important;height:48px!important;min-width:48px!important}.ri-name{font-size:14.5px!important;line-height:18px!important;font-weight:600!important}.ri-prev{font-size:13px!important;line-height:16px!important}.ri-time{font-size:11px!important}.row-item.selected{background:var(--selection)!important}.row-item:hover{background:var(--hover)!important}
  body.has-app #chatScreen{background:var(--background-secondary)!important}
  .chat-head{height:56px!important;min-height:56px!important;padding:0 10px!important;background:var(--background-primary)!important}
  .chat-head #chatAv{width:38px!important;height:38px!important;min-width:38px!important}.ch-title{font-size:14.5px!important}.ch-sub{font-size:11px!important}.chat-head .head-tools .icon-btn,.chat-head .neo-head-badge{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;border-radius:8px!important}
  body.has-app #chatScreen #msgs{padding:18px clamp(20px,5vw,72px) 16px!important;background:var(--background-secondary)!important}
  .bwrap{max-width:min(68%,680px)!important}
  
  
  
  
  
  
}

/* Mobile top-level navigation screens: Contacts/Calls replace Chats, never overlay it. */
@media(max-width:899px){
  body.has-app #listScreen>.list-main[hidden]{display:none!important}
  #listScreen>.top-tab-panel[hidden]{display:none!important}
  #listScreen>.top-tab-panel:not([hidden]){
    position:absolute!important;inset:0!important;z-index:8!important;
    display:block!important;width:100%!important;height:100%!important;
    overflow-x:hidden!important;overflow-y:auto!important;
    background:var(--background-primary)!important;
    padding-bottom:calc(58px + var(--sab))!important;
    overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;
  }
}

/* Mobile Settings is a real navigable screen: Back is always actionable. */

