/* Nabgol shared controls v36 — canonical desktop/mobile source */
body:is(.desktop-chat,.mobile-chat) .ghost-btn,
body:is(.desktop-chat,.mobile-chat) .composer-action-btn{
display:inline-flex!important;align-items:center!important;justify-content:center!important;
border:0!important;background:transparent!important;color:#a1a1aa!important;
font-family:inherit;cursor:pointer;transition:.18s!important
}
body:is(.desktop-chat,.mobile-chat) .ghost-btn:hover,
body:is(.desktop-chat,.mobile-chat) .composer-action-btn:hover{
color:#fff!important;background:rgba(255,255,255,.09)!important
}
body:is(.desktop-chat,.mobile-chat) .composer-action-btn{
width:36px!important;height:36px!important;min-width:36px!important;
min-height:36px!important;padding:0!important;border-radius:8px!important
}
body:is(.desktop-chat,.mobile-chat) .composer-action-btn .ico{
width:18px!important;height:18px!important
}
body:is(.desktop-chat,.mobile-chat) .voice-btn.recording{
color:#f87171!important;background:rgba(248,113,113,.12)!important
}
body:is(.desktop-chat,.mobile-chat) .send-btn{
display:inline-flex!important;align-items:center!important;justify-content:center!important;
width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important;
padding:0!important;border:0!important;border-radius:50%!important;
background:#10b981!important;color:#fff!important;
box-shadow:0 4px 15px rgba(16,185,129,.4)!important
}
body:is(.desktop-chat,.mobile-chat) .send-btn .ico{
width:17px!important;height:17px!important
}

/* Shared message footer */
body:is(.desktop-chat,.mobile-chat) .message .message-bubble{
padding-bottom:8px!important
}
body:is(.desktop-chat,.mobile-chat) .message .footer{
display:flex!important;flex-direction:row!important;align-items:center!important;
justify-content:space-between!important;direction:ltr!important;width:100%!important;
min-width:0!important;margin:2px 0 0!important;padding:3px 0 0!important;
gap:6px!important;line-height:1!important;flex-wrap:nowrap!important;
border-top:1px solid rgba(255,255,255,.12)!important
}
body:is(.desktop-chat,.mobile-chat) .message.assistant .footer{
border-top-color:var(--border)!important;color:var(--text-secondary)!important
}
body:is(.desktop-chat,.mobile-chat) .message.user .footer{
border-top-color:rgba(255,255,255,.25)!important;color:rgba(255,255,255,.86)!important
}
body:is(.desktop-chat,.mobile-chat) .message .footer-meta{
display:inline-flex!important;align-items:center!important;direction:ltr!important;
gap:5px!important;flex:0 0 auto!important;font-variant-numeric:tabular-nums
}
body:is(.desktop-chat,.mobile-chat) .message .msg-date,
body:is(.desktop-chat,.mobile-chat) .message .msg-time{
margin:0!important;padding:0!important;font-family:inherit!important;
font-size:10px!important;font-weight:500!important;line-height:1!important;
direction:rtl!important;white-space:nowrap!important;opacity:.72!important
}
body:is(.desktop-chat,.mobile-chat) .message .msg-time{opacity:.58!important}
body:is(.desktop-chat,.mobile-chat) .message .msg-time::before{
content:"·";margin-right:5px;opacity:.45
}
body:is(.desktop-chat,.mobile-chat) .message .time{display:none!important}

/* Shared message buttons */
body:is(.desktop-chat,.mobile-chat) .message .message-actions{
display:inline-flex!important;align-items:center!important;flex-wrap:nowrap!important;
gap:2px!important;margin:0!important;padding:0!important;background:transparent!important;
border:0!important;box-shadow:none!important;opacity:1!important;overflow:visible!important
}
body:is(.desktop-chat,.mobile-chat) .message .action-chip,
body:is(.desktop-chat,.mobile-chat) .message .message-actions button{
position:relative!important;display:inline-flex!important;align-items:center!important;
justify-content:center!important;flex:0 0 28px!important;width:28px!important;
height:28px!important;min-width:28px!important;min-height:28px!important;
max-width:28px!important;margin:0!important;padding:0!important;
border:1px solid rgba(255,255,255,.14)!important;border-radius:8px!important;
background:rgba(255,255,255,.06)!important;color:rgba(255,255,255,.88)!important;
font-size:0!important;font-family:inherit!important;cursor:pointer;overflow:visible!important;
transition:.15s!important
}
body:is(.desktop-chat,.mobile-chat) .message.user .action-chip,
body:is(.desktop-chat,.mobile-chat) .message.user .message-actions button{
border-color:rgba(255,255,255,.2)!important;
background:rgba(0,0,0,.12)!important;color:#fff!important
}
body:is(.desktop-chat,.mobile-chat) .message .action-chip .ico,
body:is(.desktop-chat,.mobile-chat) .message .message-actions button .ico{
width:13px!important;height:13px!important;margin:0!important
}
body:is(.desktop-chat,.mobile-chat) .message .action-chip:hover{
transform:scale(1.06)!important;background:rgba(255,255,255,.12)!important
}
body:is(.desktop-chat,.mobile-chat) .message .copy-btn:hover{
color:#bfdbfe!important;border-color:rgba(147,197,253,.45)!important
}
body:is(.desktop-chat,.mobile-chat) .message .regenerate-btn:hover{
color:#bbf7d0!important;border-color:rgba(134,239,172,.45)!important
}
body:is(.desktop-chat,.mobile-chat) .message .split-btn:hover{
color:#ddd6fe!important;border-color:rgba(196,181,253,.45)!important
}
body:is(.desktop-chat,.mobile-chat) .message .pin-btn:hover{
color:#fde68a!important;border-color:rgba(252,211,77,.45)!important
}
body:is(.desktop-chat,.mobile-chat) .message .tts-btn:hover{
color:#99f6e4!important;border-color:rgba(94,234,212,.45)!important
}
body:is(.desktop-chat,.mobile-chat) .message .delete-btn:hover{
color:#fecaca!important;border-color:rgba(248,113,113,.55)!important;
background:rgba(248,113,113,.12)!important
}
body:is(.desktop-chat,.mobile-chat) .message .action-label{
display:block!important;position:absolute!important;bottom:calc(100% + 6px)!important;
left:50%!important;width:max-content!important;padding:3px 7px!important;
border:1px solid rgba(255,255,255,.12)!important;border-radius:6px!important;
background:rgba(15,17,23,.96)!important;color:#fff!important;
font-size:10px!important;font-weight:600!important;line-height:1.2!important;
white-space:nowrap!important;opacity:0!important;visibility:hidden!important;
pointer-events:none!important;transform:translateX(-50%)!important;z-index:40!important
}
body:is(.desktop-chat,.mobile-chat) .message .action-chip:hover .action-label,
body:is(.desktop-chat,.mobile-chat) .message .action-chip:focus-visible .action-label,
body:is(.desktop-chat,.mobile-chat) .message .action-chip.copied .action-label{
opacity:1!important;visibility:visible!important
}

/* Shared previous/next buttons */
body:is(.desktop-chat,.mobile-chat) .version-controls{
display:none;direction:ltr!important;flex-direction:row!important;
align-items:center!important;width:100%!important;gap:8px!important;margin-top:5px!important
}
body:is(.desktop-chat,.mobile-chat) .version-controls.show{display:flex!important}
body:is(.desktop-chat,.mobile-chat) .version-controls button{
display:inline-flex!important;align-items:center!important;justify-content:center!important;
height:30px!important;min-height:30px!important;padding:0 10px!important;
border:1px solid rgba(255,255,255,.12)!important;border-radius:8px!important;
background:rgba(255,255,255,.06)!important;color:var(--text-secondary)!important;
font-family:inherit!important;font-size:11px!important;cursor:pointer
}
body:is(.desktop-chat,.mobile-chat) .version-controls button:hover{
color:#fff!important;border-color:rgba(34,197,94,.45)!important;
background:rgba(34,197,94,.12)!important
}
body:is(.desktop-chat,.mobile-chat) .version-controls .next-version{order:1!important}
body:is(.desktop-chat,.mobile-chat) .version-controls .version-badge{
order:2!important;flex:1!important;text-align:center!important;
font-size:11px!important;color:var(--text-secondary)!important
}
body:is(.desktop-chat,.mobile-chat) .version-controls .prev-version{order:3!important}

/* Shared autoplay switch */
body:is(.desktop-chat,.mobile-chat) .autoplay-toggle .ui-toggle{
position:relative;width:38px;height:22px;flex:0 0 38px;border-radius:999px;
border:1px solid rgba(255,255,255,.12);background:rgba(255,255,255,.18);transition:.2s
}
body:is(.desktop-chat,.mobile-chat) .autoplay-toggle.is-on .ui-toggle{
background:#10b981;border-color:rgba(16,185,129,.5)
}
body:is(.desktop-chat,.mobile-chat) .autoplay-toggle .ui-toggle-thumb{
position:absolute;top:2px;inset-inline-start:2px;width:16px;height:16px;
border-radius:50%;background:#fff;transition:transform .2s
}
[dir=rtl] body:is(.desktop-chat,.mobile-chat)
.autoplay-toggle.is-on .ui-toggle-thumb{transform:translateX(-16px)}

/* Shared TTS player */
body:is(.desktop-chat,.mobile-chat) .tts-player-row{
display:flex!important;align-items:center!important;width:100%!important;
gap:14px!important;flex-wrap:wrap!important
}
body:is(.desktop-chat,.mobile-chat) .tts-controls{
display:flex!important;align-items:center!important;gap:4px!important
}
body:is(.desktop-chat,.mobile-chat) .tts-ctrl-btn{
display:inline-flex!important;align-items:center!important;justify-content:center!important;
width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;
padding:0!important;border:0!important;border-radius:8px!important;
background:transparent!important;color:#a1a1aa!important;font-size:0!important;cursor:pointer
}
body:is(.desktop-chat,.mobile-chat) .tts-ctrl-btn:hover{
color:#fff!important;background:rgba(255,255,255,.08)!important
}
body:is(.desktop-chat,.mobile-chat) .tts-ctrl-btn .ico{
width:17px!important;height:17px!important
}
body:is(.desktop-chat,.mobile-chat) .tts-play-main{
width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important;
border-radius:50%!important;background:#10b981!important;color:#fff!important;
box-shadow:0 4px 16px rgba(16,185,129,.45)!important
}
body:is(.desktop-chat,.mobile-chat) .tts-play-main .ico{
width:20px!important;height:20px!important
}
body:is(.desktop-chat,.mobile-chat) .tts-track-area{
display:flex!important;flex:1 1 160px!important;min-width:160px!important;
flex-direction:column!important;gap:6px!important
}
body:is(.desktop-chat,.mobile-chat) .tts-progress{
position:relative!important;width:100%!important;height:4px!important;
border-radius:999px!important;background:rgba(255,255,255,.12)!important;cursor:pointer
}
body:is(.desktop-chat,.mobile-chat) .tts-progress-bar{
position:relative!important;height:100%!important;border-radius:999px!important;
background:linear-gradient(90deg,#10b981,#22c55e)!important
}
body:is(.desktop-chat,.mobile-chat) .tts-progress-bar::after{
content:"";position:absolute;top:50%;right:0;width:12px;height:12px;
border-radius:50%;background:#fff;box-shadow:0 0 8px rgba(16,185,129,.55);
transform:translate(50%,-50%)
}
body:is(.desktop-chat,.mobile-chat) .tts-voice-select{
min-height:34px!important;padding:5px 8px!important;
border:1px solid rgba(255,255,255,.08)!important;border-radius:8px!important;
background:rgba(255,255,255,.06)!important;color:#e4e4e7!important;
font-family:inherit!important;font-size:11px!important
}
body:is(.desktop-chat,.mobile-chat) .tts-time,
body:is(.desktop-chat,.mobile-chat) .tts-status,
body:is(.desktop-chat,.mobile-chat) .tts-speed-display{
color:#a1a1aa!important;font-size:11px!important;white-space:nowrap!important
}
body:is(.desktop-chat,.mobile-chat) .tts-speed-btn .speed-emoji{
font-size:18px!important
}
body:is(.desktop-chat,.mobile-chat) .tts-close-btn,
body:is(.desktop-chat,.mobile-chat) .tts-minimize-btn{
position:absolute!important;width:32px!important;height:32px!important;padding:0!important;
border:0!important;border-radius:8px!important;background:transparent!important;
color:#71717a!important
}
body.desktop-chat .tts-player.tts-player-dock.show{
position:relative!important;display:flex!important;flex-direction:column!important;
direction:ltr!important;width:100%!important;max-width:none!important;margin:0!important;
padding:14px 56px 12px 20px!important;border:0!important;
border-top:1px solid rgba(255,255,255,.05)!important;border-radius:0!important;
background:rgba(20,20,25,.85)!important;backdrop-filter:blur(12px)!important;
box-shadow:0 -8px 32px rgba(0,0,0,.28)!important
}

/* Mobile header controls — + مکالمه جدید همیشه در هدر دیده شود */
body.mobile-chat .header-actions>button.new-chat-header-btn,
body.mobile-chat .header-actions>button[onclick="newChat()"]{display:inline-flex!important}
body.mobile-chat .mobile-primary-controls{
display:flex!important;align-items:center!important;flex:0 0 auto!important;gap:2px!important
}
body.mobile-chat .mobile-primary-controls .ghost-btn{
width:38px!important;height:38px!important;min-width:38px!important;
min-height:38px!important;padding:0!important;border-radius:50%!important
}
body.mobile-chat .mobile-primary-controls .btn-label{display:none!important}
body.mobile-chat .mobile-primary-controls .theme-icon-wrap,
body.mobile-chat .mobile-primary-controls .theme-icon-wrap .ico{
display:block!important;width:19px!important;height:19px!important
}
body.mobile-chat .mobile-primary-controls .autoplay-toggle{
width:44px!important;min-width:44px!important
}
body.mobile-chat .mobile-control-toast{
position:fixed!important;top:calc(66px + env(safe-area-inset-top,0px))!important;
left:50%!important;z-index:1000!important;min-width:86px;padding:7px 13px!important;
border:1px solid rgba(255,255,255,.1)!important;border-radius:999px!important;
background:rgba(15,17,23,.94)!important;color:#fff!important;
box-shadow:0 5px 20px rgba(0,0,0,.3)!important;font-size:12px!important;
font-weight:600!important;text-align:center!important;opacity:0;pointer-events:none;
transform:translate(-50%,-6px);transition:.16s
}
body.mobile-chat .mobile-control-toast.show{
opacity:1;transform:translate(-50%,0)
}
body.mobile-chat .message .message-actions{
flex:0 1 auto!important;max-width:calc(100% - 72px)!important;
overflow-x:auto!important;scrollbar-width:none
}
body.mobile-chat .message .message-actions::-webkit-scrollbar{display:none}

/* Mobile TTS */
body.mobile-chat .tts-player.tts-player-dock.show{
position:fixed!important;right:8px!important;
bottom:calc(70px + env(safe-area-inset-bottom,0px))!important;left:8px!important;
z-index:250!important;display:flex!important;flex-direction:column!important;
direction:ltr!important;width:auto!important;max-width:none!important;
max-height:46dvh!important;margin:0!important;padding:10px 44px 10px 10px!important;
border:1px solid rgba(255,255,255,.07)!important;border-radius:15px!important;
background:rgba(20,20,25,.94)!important;backdrop-filter:blur(14px)!important;
box-shadow:0 10px 34px rgba(0,0,0,.44)!important;overflow:visible!important
}
body.mobile-chat .tts-player-row{gap:8px!important}
body.mobile-chat .tts-controls{
flex:1 1 auto!important;justify-content:flex-start!important
}
body.mobile-chat .tts-track-area{
order:2;flex-basis:100%!important;min-width:100%!important
}
body.mobile-chat .tts-voice-select{
order:3;width:126px!important;max-width:126px!important
}
body.mobile-chat .tts-download{order:4}
body.mobile-chat .tts-status{order:5}
body.mobile-chat .tts-player .tts-subtitle{display:none!important}
body.mobile-chat .tts-player .tts-close-btn{
top:10px!important;right:8px!important;transform:none!important
}
body.mobile-chat .tts-player .tts-minimize-btn{
top:44px!important;right:8px!important;transform:none!important
}

/* NABGOL V38 REAL */
body:is(.desktop-chat,.mobile-chat) .message .message-actions{
direction:rtl!important;flex-direction:row!important;justify-content:flex-start!important;
unicode-bidi:plaintext!important
}
body:is(.desktop-chat,.mobile-chat) .message .msg-date,
body:is(.desktop-chat,.mobile-chat) .message .msg-time{
font-family:'Vazirmatn',system-ui,sans-serif!important;font-size:11px!important;
font-weight:550!important;line-height:1.25!important;opacity:1!important
}
body:is(.desktop-chat,.mobile-chat) .message.assistant .footer-meta{color:rgba(203,213,225,.88)!important}
body:is(.desktop-chat,.mobile-chat) .message.user .footer-meta{color:rgba(220,252,231,.95)!important}
.action-feedback-toast{
position:fixed!important;right:50%!important;
bottom:calc(88px + env(safe-area-inset-bottom,0px))!important;z-index:1200!important;
min-width:88px!important;max-width:calc(100vw - 32px)!important;padding:8px 14px!important;
border:1px solid rgba(255,255,255,.1)!important;border-radius:999px!important;
background:rgba(15,17,23,.95)!important;color:#fff!important;
box-shadow:0 8px 24px rgba(0,0,0,.34)!important;
font-family:'Vazirmatn',system-ui,sans-serif!important;font-size:12px!important;
font-weight:650!important;text-align:center!important;white-space:nowrap!important;
opacity:0;pointer-events:none!important;transform:translate(50%,8px)!important;
transition:opacity .16s,transform .16s!important
}
.action-feedback-toast.show{opacity:1!important;transform:translate(50%,0)!important}
body.mobile-chat .sidebar-header.robot-brand{
position:relative!important;display:block!important;
padding:calc(14px + env(safe-area-inset-top,0px)) 12px 10px!important;
min-height:124px!important;box-sizing:border-box!important
}
body.mobile-chat .sidebar-header .brand-mark{
display:flex!important;align-items:flex-start!important;gap:10px!important;
min-height:54px!important;padding-left:46px!important;padding-right:6px!important;margin-bottom:6px!important
}
body.mobile-chat .sidebar-close-mobile{
position:absolute!important;top:calc(14px + env(safe-area-inset-top,0px))!important;
left:10px!important;width:36px!important;height:36px!important;min-width:36px!important;
min-height:36px!important;z-index:6!important;margin:0!important
}
body.mobile-chat .sidebar-section-title{
display:block!important;margin:0 2px 0!important;padding-top:10px!important;
border-top:1px solid rgba(255,255,255,.06)!important;font-size:12px!important;
line-height:1.5!important;clear:both!important;position:relative!important;z-index:1!important
}
body.mobile-chat #chatList{display:flex!important;flex-direction:column!important;gap:7px!important;padding:4px 10px 12px!important;box-sizing:border-box!important}
body.mobile-chat .chat-item.history-item{display:flex!important;align-items:center!important;gap:8px!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important;min-height:58px!important;padding:8px 9px!important;border:1px solid rgba(255,255,255,.06)!important;border-radius:12px!important;background:rgba(255,255,255,.025)!important}
body.mobile-chat .chat-item.history-item.active{border-color:rgba(34,197,94,.55)!important;background:rgba(34,197,94,.08)!important}
body.mobile-chat .chat-item-content{flex:1!important;min-width:0!important;display:flex!important;flex-direction:column!important;gap:3px!important;cursor:pointer}
body.mobile-chat .chat-name{font-size:13px!important;font-weight:650!important;line-height:1.35!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important;color:var(--text)!important}
body.mobile-chat .chat-date{font-size:10px!important;line-height:1.25!important;direction:rtl!important;color:var(--text-secondary)!important;opacity:.84!important}
body.mobile-chat .chat-item-actions{display:flex!important;align-items:center!important;gap:2px!important;flex:0 0 auto!important}
body.mobile-chat .chat-edit,body.mobile-chat .chat-delete{width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;padding:0!important;border:0!important;border-radius:9px!important;background:transparent!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;color:var(--text-secondary)!important}
body.mobile-chat .chat-edit:hover{background:rgba(34,197,94,.12)!important;color:#4ade80!important}
body.mobile-chat .chat-delete:hover{background:rgba(248,113,113,.12)!important;color:#f87171!important}
body.mobile-chat .chat-edit .ico,body.mobile-chat .chat-delete .ico{width:16px!important;height:16px!important}
body.mobile-chat .chat-title-input{width:100%!important;height:36px!important;padding:5px 8px!important;border:1px solid #22c55e!important;border-radius:8px!important;background:var(--bg-input)!important;color:var(--text)!important;font-family:inherit!important;font-size:13px!important;box-sizing:border-box!important}
body.mobile-chat .new-chat-sidebar{display:flex!important;align-items:center!important;justify-content:center!important;width:calc(100% - 24px)!important;max-width:calc(100% - 24px)!important;margin:8px 12px 14px!important;padding:0 12px!important;min-height:46px!important;box-sizing:border-box!important;border-radius:12px!important}
body.mobile-chat .tts-player.tts-player-dock.show{position:fixed!important;right:8px!important;left:8px!important;bottom:calc(72px + env(safe-area-inset-bottom,0px))!important;display:block!important;width:auto!important;min-height:172px!important;margin:0!important;padding:46px 12px 12px!important;border:1px solid rgba(255,255,255,.08)!important;border-radius:18px!important;background:rgba(17,24,32,.97)!important;box-shadow:0 16px 46px rgba(0,0,0,.52)!important;backdrop-filter:blur(18px)!important;overflow:hidden!important;z-index:500!important;max-height:none!important;flex-direction:unset!important;direction:rtl!important}
body.mobile-chat .tts-player.tts-player-dock.show::before{content:"پخش صوتی";position:absolute;top:14px;right:50%;transform:translateX(50%);font-size:12px;font-weight:650;color:#d4d4d8;line-height:20px;pointer-events:none}
body.mobile-chat .tts-player .tts-player-row{display:grid!important;width:100%!important;grid-template-columns:minmax(0,1fr) auto 38px!important;grid-template-areas:"controls controls controls" "track track track" "voice status download"!important;gap:8px!important;align-items:center!important}
body.mobile-chat .tts-player .tts-controls{grid-area:controls!important;display:flex!important;justify-content:center!important;align-items:center!important;gap:6px!important;width:100%!important;flex-wrap:nowrap!important}
body.mobile-chat .tts-player .tts-ctrl-btn{width:38px!important;height:38px!important;min-width:38px!important;min-height:38px!important;border-radius:50%!important}
body.mobile-chat .tts-player .tts-play-main{width:46px!important;height:46px!important;min-width:46px!important;min-height:46px!important}
body.mobile-chat .tts-player .tts-track-area{grid-area:track!important;display:grid!important;grid-template-columns:auto minmax(0,1fr)!important;align-items:center!important;gap:8px!important;width:100%!important;min-width:0!important;order:unset!important;flex-basis:auto!important}
body.mobile-chat .tts-player .tts-time{font-size:10px!important;direction:ltr!important;font-variant-numeric:tabular-nums!important}
body.mobile-chat .tts-player .tts-progress{height:6px!important;margin:0!important;cursor:pointer}
body.mobile-chat .tts-player .tts-voice-select{grid-area:voice!important;width:100%!important;height:36px!important;direction:rtl!important;order:unset!important;max-width:none!important}
body.mobile-chat .tts-player .tts-status{grid-area:status!important;font-size:10px!important;text-align:center!important;max-width:88px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important;order:unset!important}
body.mobile-chat .tts-player .tts-download{grid-area:download!important;width:36px!important;height:36px!important;order:unset!important}
body.mobile-chat .tts-player .tts-close-btn{position:absolute!important;top:8px!important;left:8px!important;right:auto!important;transform:none!important;width:34px!important;height:34px!important}
body.mobile-chat .tts-player .tts-minimize-btn{position:absolute!important;top:8px!important;right:8px!important;left:auto!important;transform:none!important;width:34px!important;height:34px!important}
body.mobile-chat .tts-player .tts-subtitle{display:none!important}