/* CreatorFlow AI — stylesheet
   Palette: deep ink base, warm amber accent (creator/energy), soft indigo for AI replies.
   Layout is written with logical properties (inline-start/end) so it mirrors correctly in RTL Arabic. */

:root{
  --bg:            #14171F;
  --bg-elevated:   #1A1E27;
  --surface:       #1F2430;
  --surface-hover: #272C3A;
  --border:        #2B3140;
  --text:          #ECEEF3;
  --text-muted:    #939AAD;
  --accent:        #F2B134;
  --accent-ink:    #2B1E02;
  --ai-bubble:     #232A42;
  --ai-accent:     #7C93F2;
  --danger:        #E8615C;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --font-latin: 'IBM Plex Sans', system-ui, sans-serif;
  --font-arabic: 'IBM Plex Sans Arabic', 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;
  color-scheme: dark;
}

:root[data-theme="light"]{
  --bg:            #F7F6F3;
  --bg-elevated:   #FFFFFF;
  --surface:       #FFFFFF;
  --surface-hover: #EFEDE7;
  --border:        #E3E0D8;
  --text:          #1B1C1E;
  --text-muted:    #6B6E76;
  --accent:        #B4790A;
  --accent-ink:    #FFF6E2;
  --ai-bubble:     #EEF0FB;
  --ai-accent:     #4C5FD6;
  color-scheme: light;
}

*{ box-sizing: border-box; }

html, body{
  height: 100%;
  margin: 0;
}

body{
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-latin);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

html[lang="ar"] body{ font-family: var(--font-arabic); }

button, input, textarea, select{ font-family: inherit; color: inherit; }

.icon{ width: 20px; height: 20px; display: block; }
.icon-sm{ width: 17px; height: 17px; }

.hidden{ display: none !important; }

/* ---------- App shell ---------- */

.app{
  display: grid;
  grid-template-columns: 272px 1fr;
  height: 100dvh;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.backdrop{
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 15;
}

/* ---------- Sidebar ---------- */

.sidebar{
  background: var(--bg-elevated);
  border-inline-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
  overflow: hidden;
}

.sidebar-top{
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-new-chat{
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.btn-new-chat:hover{ background: var(--surface-hover); }
.btn-new-chat .icon{ color: var(--accent); }

.sidebar-close{ display: none; }

.icon-btn{
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  flex-shrink: 0;
}
.icon-btn:hover{ background: var(--surface-hover); color: var(--text); }

.sidebar-search{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
}
.sidebar-search .icon{ color: var(--text-muted); flex-shrink: 0; }
.sidebar-search input{
  border: none;
  background: transparent;
  outline: none;
  font-size: 13.5px;
  width: 100%;
}

.chat-list{
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -4px;
  padding: 0 4px;
}

.chat-item{
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border-inline-start: 2px solid transparent;
}
.chat-item:hover{ background: var(--surface-hover); }
.chat-item.active{
  background: var(--surface-hover);
  border-inline-start-color: var(--accent);
}
.chat-item .chat-title{
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
}
.chat-item .chat-delete{
  opacity: 0;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.chat-item:hover .chat-delete{ opacity: 1; }
.chat-item .chat-delete:hover{ background: rgba(232,97,92,.15); color: var(--danger); }

.sidebar-bottom{
  border-top: 1px solid var(--border);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-row{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  cursor: pointer;
  text-align: start;
}
.sidebar-row:hover{ background: var(--surface-hover); color: var(--text); }

/* ---------- Main column ---------- */

.main{
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.topbar{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

#sidebarOpenBtn{ display: none; }

.topbar-title{
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.brand-mark{
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    conic-gradient(from 210deg, var(--accent), var(--ai-accent), var(--accent)) border-box;
  background-color: var(--accent);
}

.topbar-text{
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}
.topbar-text strong{ font-size: 14px; }

#modelSelect{
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  padding: 0;
  max-width: 200px;
}

.topbar-actions{ display: flex; gap: 4px; }

#langToggleBtn{ font-size: 12px; font-weight: 600; letter-spacing: .02em; }

.icon-sun, .icon-moon{ display: none; }
:root:not([data-theme="light"]) .icon-sun{ display: block; }
:root[data-theme="light"] .icon-moon{ display: block; }

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

.chat-scroll{
  flex: 1;
  overflow-y: auto;
  scroll-padding-top: env(safe-area-inset-top, 0px);
}

.empty-state{
  max-width: 640px;
  margin: 0 auto;
  padding: 10vh 20px 20px;
  text-align: center;
}

.empty-mark{
  width: 44px;
  height: 44px;
  margin: 0 auto 20px;
  border-radius: 12px;
  background: conic-gradient(from 210deg, var(--accent), var(--ai-accent), var(--accent));
}

.empty-state h1{
  font-size: 26px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.empty-state p{
  color: var(--text-muted);
  font-size: 14.5px;
  margin: 0 0 28px;
}

.suggestion-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  text-align: start;
}
.suggestion-card{
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 13.5px;
  color: var(--text);
}
.suggestion-card:hover{ background: var(--surface-hover); border-color: var(--accent); }
.suggestion-card span{ display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }

.messages{
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.msg{
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.msg.user{ flex-direction: row-reverse; }

.avatar{
  width: 30px;
  height: 30px;
  border-radius: 8px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
}
.msg.user .avatar{ background: var(--accent); }
.msg.assistant .avatar{ background: var(--ai-accent); color: #fff; }

.bubble-col{
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 78%;
}
.msg.user .bubble-col{ align-items: flex-end; }

.bubble{
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user .bubble{
  background: var(--accent);
  color: var(--accent-ink);
  border-end-end-radius: 4px;
}
.msg.assistant .bubble{
  background: var(--ai-bubble);
  border-end-start-radius: 4px;
}
.msg.assistant .bubble.error{
  background: rgba(232,97,92,.12);
  border: 1px solid rgba(232,97,92,.4);
  color: var(--danger);
}

.bubble code{
  font-family: var(--font-mono);
  background: rgba(0,0,0,.25);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 13px;
}
.bubble pre{
  background: rgba(0,0,0,.28);
  padding: 12px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 4px 0;
}
.bubble pre code{ background: none; padding: 0; }

.msg-actions{
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .1s;
}
.msg:hover .msg-actions{ opacity: 1; }
.msg-actions button{
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
}
.msg-actions button:hover{ background: var(--surface-hover); color: var(--text); }

.typing-dots{ display: inline-flex; gap: 4px; padding: 4px 0; }
.typing-dots span{
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-muted);
  animation: blink 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2){ animation-delay: .15s; }
.typing-dots span:nth-child(3){ animation-delay: .3s; }
@keyframes blink{ 0%, 80%, 100%{ opacity: .25; } 40%{ opacity: 1; } }

/* ---------- Composer ---------- */

.composer{
  flex-shrink: 0;
  padding: 10px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.composer-inner{
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 8px 8px 8px 16px;
}
html[dir="rtl"] .composer-inner{ padding: 8px 16px 8px 8px; }

#promptInput{
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  resize: none;
  max-height: 160px;
  font-size: 15px;
  line-height: 1.5;
  padding: 6px 0;
}
#promptInput::placeholder{ color: var(--text-muted); }

.send-btn, .stop-btn{
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  background: var(--accent);
  color: var(--accent-ink);
}
.send-btn:disabled{ opacity: .4; cursor: default; }
.stop-btn{ background: var(--text); color: var(--bg); }

.composer-hint{
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
  margin: 8px 0 0;
}

/* ---------- Settings dialog ---------- */

.settings-dialog{
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 0;
  width: min(440px, 92vw);
}
.settings-dialog::backdrop{ background: rgba(0,0,0,.55); }

.settings-form{ padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.settings-form h2{ margin: 0 0 4px; font-size: 18px; }

.settings-field{
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}
.settings-field input, .settings-field select, .settings-field textarea{
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.settings-field textarea{
  min-height: 112px;
  resize: vertical;
  line-height: 1.55;
}
.settings-field small{
  color: var(--text-muted);
  font-size: 11.5px;
  line-height: 1.45;
}

.settings-note{
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

.settings-actions{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

.btn-primary{
  background: var(--accent);
  color: var(--accent-ink);
  border: none;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}
.btn-ghost{
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13.5px;
}

/* ---------- Mobile ---------- */

@media (max-width: 860px){
  .app{ grid-template-columns: 1fr; }

  .sidebar{
    position: fixed;
    inset-block: 0;
    inset-inline-start: 0;
    width: min(300px, 84vw);
    z-index: 20;
    transform: translateX(-100%);
    transition: transform .22s ease;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
  }
  html[dir="rtl"] .sidebar{ transform: translateX(100%); }
  .app.sidebar-open .sidebar{ transform: translateX(0); }
  .app.sidebar-open .backdrop{ display: block; }

  .sidebar-close{ display: grid; }
  #sidebarOpenBtn{ display: grid; }

  .suggestion-grid{ grid-template-columns: 1fr; }
  .bubble-col{ max-width: 88%; }
  .empty-state{ padding-top: 6vh; }
}

/* Specialist agent selector */
#agentSelect{
  max-width: 190px;
  min-width: 132px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface);
  color: var(--text);
  padding: 7px 28px 7px 10px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
#agentSelect:focus{ border-color: var(--accent); }
@media (max-width: 560px){
  #agentSelect{ max-width: 132px; min-width: 0; font-size: 11px; }
  #modelSelect{ max-width: 112px; font-size: 10px; }
}

@media (hover: none), (pointer: coarse){
  .msg-actions{ opacity: 1; }
}

/* ---------- Local text-file attachments ---------- */
.attach-btn{
  width:34px;height:34px;display:grid;place-items:center;flex-shrink:0;
  border:1px solid var(--border);border-radius:10px;background:transparent;
  color:var(--text-muted);cursor:pointer;
}
.attach-btn:hover{background:var(--surface-hover);color:var(--text);}
.attachment-list{
  max-width:760px;margin:0 auto 8px;display:flex;flex-wrap:wrap;gap:7px;
}
.attachment-list.hidden{display:none;}
.attachment-chip{
  display:flex;align-items:center;gap:8px;max-width:100%;
  padding:5px 8px;border:1px solid var(--border);border-radius:9px;
  background:var(--bg-elevated);font-size:12px;color:var(--text-muted);
}
.attachment-chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:220px;}
.attachment-chip button{
  border:0;background:transparent;color:var(--text-muted);font-size:18px;
  line-height:1;cursor:pointer;padding:0 2px;
}
.attachment-chip button:hover{color:var(--danger);}
@media(max-width:560px){.attachment-chip span{max-width:150px;}}

.projects-head{display:flex;justify-content:space-between;align-items:center;padding:7px 4px 0;color:var(--text-muted);font-size:12px}.project-add{width:28px;height:28px;border:1px solid var(--border);border-radius:7px;background:transparent;color:var(--accent);font-size:20px}.project-select{width:100%;padding:9px;border:1px solid var(--border);border-radius:9px;background:var(--surface);color:var(--text);font:inherit;font-size:13px}


/* Optional live web research toggle */
.research-toggle{
  max-width:760px;margin:0 auto 8px;display:flex;align-items:center;
  gap:8px;color:var(--text-muted);font-size:12px;cursor:pointer;
  user-select:none;
}
.research-toggle input{accent-color:var(--accent);width:15px;height:15px;cursor:pointer;}
.research-toggle span span{vertical-align:middle;}


/* Safe Markdown source links in assistant replies */
.bubble a{color:var(--accent);text-decoration:underline;text-underline-offset:2px;overflow-wrap:anywhere}
.bubble a:hover{opacity:.82}


/* ---------- CreatorFlow dark-blue visual refresh ---------- */
:root{
  --bg:#070A10;
  --bg-elevated:#0D121D;
  --surface:#111A2A;
  --surface-hover:#18263D;
  --border:#202D43;
  --text:#F2F6FF;
  --text-muted:#8D9BB2;
  --accent:#174A91;
  --accent-ink:#FFFFFF;
  --ai-bubble:#111D31;
  --ai-accent:#4D8FEA;
}
:root[data-theme="light"]{
  --bg:#F5F8FD;--bg-elevated:#FFFFFF;--surface:#FFFFFF;--surface-hover:#EAF1FB;
  --border:#D9E3F2;--text:#142033;--text-muted:#687A94;--accent:#174A91;
  --accent-ink:#FFFFFF;--ai-bubble:#EAF1FB;--ai-accent:#286FC4;
}
.btn-new-chat .icon,.chat-item.active,.chat-item.active .chat-title{color:#76AEFF}
.chat-item.active{border-inline-start-color:#286FC4}
.brand-mark,.empty-mark{background:linear-gradient(145deg,#123A70,#2875CB)}
.send-btn,.btn-primary{background:#174A91;color:#fff}
.send-btn:hover,.btn-primary:hover{background:#205EAE}
.stop-btn{background:#253A58;color:#fff}
.composer-inner{background:#0D1523;border-color:#263A57;box-shadow:0 8px 30px rgba(0,0,0,.16)}
#promptInput{color:var(--text)}
.attach-menu-wrap,.account-menu-wrap{position:relative;display:flex;align-items:center}
.attach-btn{width:36px;height:36px;border:0;border-radius:11px;background:#173B70;color:#fff;display:grid;place-items:center;cursor:pointer;flex-shrink:0}
.attach-btn:hover{background:#205A9F}
.attach-menu,.account-menu{position:absolute;z-index:50;background:#101A2A;border:1px solid #2B4263;border-radius:14px;box-shadow:0 18px 45px rgba(0,0,0,.42);padding:7px;min-width:230px}
.attach-menu{inset-block-end:48px;inset-inline-start:0}
.attach-menu-item{display:flex;align-items:center;gap:11px;width:100%;padding:10px;border:0;border-radius:9px;background:transparent;color:#EAF2FF;text-align:start;cursor:pointer;font:inherit;font-size:13px}
.attach-menu-item:hover:not(:disabled){background:#1A2B45}
.attach-menu-item:disabled{opacity:.48;cursor:not-allowed}
.attach-menu-item small{display:block;color:#8EA3C2;font-size:10.5px;margin-top:2px}
.menu-symbol{width:30px;height:30px;border-radius:9px;background:#193B69;display:grid;place-items:center;color:#A9CEFF;font-size:17px}
.topbar-actions{align-items:center}
.account-menu{inset-block-start:46px;inset-inline-end:0;min-width:220px}
.account-menu-head{display:flex;align-items:center;gap:10px;padding:10px;border-bottom:1px solid #263A57;margin-bottom:5px;color:#F1F6FF;font-size:12px}
.account-menu-head small{display:block;color:#91A4C2;font-size:10.5px;margin-top:3px}
.account-avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#174A91;color:white;font-weight:700}
.account-menu-item{display:block;width:100%;padding:10px;border:0;border-radius:8px;background:transparent;color:#DCE8FA;text-align:start;font:inherit;font-size:13px;cursor:pointer}
.account-menu-item:hover{background:#1A2B45}
@media(max-width:560px){.topbar{padding-inline:9px;gap:4px}.topbar-actions{gap:0}.account-menu{inset-inline-end:0}.attach-menu{inset-inline-start:0}}


/* ---------- ChatGPT-like deep navy workspace ---------- */
:root{
  --bg:#05070B;
  --bg-elevated:#090E17;
  --surface:#0D1522;
  --surface-hover:#14243A;
  --border:#1B2B43;
  --text:#F3F7FF;
  --text-muted:#91A0B8;
  --accent:#123D78;
  --accent-ink:#FFFFFF;
  --ai-bubble:#0D192B;
  --ai-accent:#4B91E8;
}
html,body,.app{background:#05070B}
.app{display:block;position:relative;min-height:100dvh}
.main{width:100%;height:100dvh;background:#05070B}
#sidebarOpenBtn{display:grid!important}
.sidebar{
  position:fixed;inset-block:0;inset-inline-start:0;width:min(310px,86vw);
  z-index:30;background:#090E17;border-inline-end:1px solid #1B2B43;
  transform:translateX(-110%);transition:transform .22s ease;
  padding:calc(14px + env(safe-area-inset-top,0px)) 13px calc(14px + env(safe-area-inset-bottom,0px));
  box-shadow:18px 0 50px rgba(0,0,0,.38)
}
html[dir="rtl"] .sidebar{transform:translateX(110%)}
.app.sidebar-open .sidebar{transform:translateX(0)}
.app.sidebar-open .backdrop{display:block;z-index:25;background:rgba(0,0,0,.62);backdrop-filter:blur(2px)}
.sidebar-close{display:grid!important}
.topbar{
  min-height:58px;padding:9px 15px;background:rgba(5,7,11,.94);
  border-bottom:1px solid #152238;gap:12px
}
.topbar-title{justify-content:center}
.brand-mark{width:29px;height:29px;border-radius:9px}
.topbar-text strong{font-size:15px;letter-spacing:.1px}
#modelSelect,#agentSelect{display:none}
.topbar-actions{gap:5px}
.icon-btn{color:#A8B9D2;border-radius:10px}
.icon-btn:hover{background:#10213A;color:#fff}
.chat-scroll{background:#05070B}
.empty-state{padding-top:clamp(90px,17vh,170px);max-width:680px}
.empty-state h1{font-size:clamp(23px,4vw,30px);color:#F5F8FF}
.empty-state p{color:#8798B2;line-height:1.7}
.suggestion-card{background:#0A111D;border-color:#1B2B43;border-radius:14px;padding:15px}
.suggestion-card:hover{background:#10213A;border-color:#28558A}
.messages{max-width:820px;padding:24px 18px 32px}
.msg.user .bubble{background:#123D78;color:#fff;border-radius:18px 18px 5px 18px}
.msg.assistant .bubble{background:#0D192B;border:1px solid #172943;border-radius:5px 18px 18px 18px}
.composer{
  background:linear-gradient(180deg,rgba(5,7,11,0),#05070B 22%);
  padding:14px max(16px,env(safe-area-inset-right,0px)) calc(14px + env(safe-area-inset-bottom,0px));
  border:0
}
.composer-inner{
  max-width:820px;margin:0 auto;min-height:58px;padding:8px 10px;
  border:1px solid #203653;border-radius:22px;background:#0B1422;
  box-shadow:0 10px 36px rgba(0,0,0,.32);gap:10px
}
#promptInput{font-size:15px;line-height:1.55;min-height:38px}
.attach-btn{width:38px;height:38px;border-radius:50%;background:#123D78;color:#fff}
.attach-btn:hover{background:#1B559A}
.send-btn{width:38px;height:38px;border-radius:50%;background:#174A91;color:#fff}
.send-btn:hover{background:#2466B5}
.composer-hint{max-width:820px;margin:8px auto 0;color:#667891;font-size:10.5px}
.research-toggle{max-width:820px}
.sidebar-sections{display:flex;flex-direction:column;gap:3px;padding:5px 0 9px;border-bottom:1px solid #1B2B43}
.sidebar-section-label{padding:10px 9px 5px;color:#61748F;font-size:10px;font-weight:700;letter-spacing:1.2px}
.sidebar-sections .sidebar-row{color:#B4C3D8;padding:10px 11px;border-radius:10px}
.sidebar-sections .sidebar-row:hover{background:#12223A;color:#fff}
.nav-glyph{width:20px;display:inline-grid;place-items:center;color:#75A9E9;font-size:17px}
.projects-head{padding-top:13px}
.project-select{background:#0D1522;border-color:#1B2B43}
.sidebar-bottom{margin-top:auto}
.btn-new-chat{background:#0E1C30;border-color:#23446E;border-radius:12px}
.btn-new-chat:hover{background:#142B49}
.attach-menu,.account-menu{background:#0B1422;border-color:#243B5B}
@media(max-width:860px){
 .app{grid-template-columns:1fr}
 .topbar{padding-inline:10px}
 .empty-state{padding:11vh 18px 22px}
 .suggestion-grid{grid-template-columns:1fr 1fr}
 .bubble-col{max-width:90%}
 .composer{padding-inline:12px}
}
@media(max-width:480px){
 .topbar{min-height:54px}
 .topbar-text strong{font-size:14px}
 .topbar-actions .icon-btn{width:34px;height:34px}
 .empty-state{padding-top:10vh}
 .empty-state h1{font-size:23px}
 .suggestion-grid{grid-template-columns:1fr}
 .composer-inner{border-radius:20px}
 .messages{padding-inline:12px}
}


/* Image attachment previews and message gallery */
.image-attachment-chip{max-width:260px}
.image-attachment-chip img{width:30px;height:30px;object-fit:cover;border-radius:6px;flex-shrink:0}
.message-image-gallery{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.message-image-gallery img{width:min(180px,42vw);max-height:190px;object-fit:cover;border-radius:12px;border:1px solid #27415F;background:#0A111D}
#addImagesBtn:not(:disabled){cursor:pointer}


/* ---------- Refined iPhone-inspired typography and response controls ---------- */
:root{
  --font-latin: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", sans-serif;
  --font-arabic: "SF Arabic", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif;
}
body{font-family:var(--font-latin);letter-spacing:-.012em;text-rendering:optimizeLegibility}
html[lang="ar"] body{font-family:var(--font-arabic);letter-spacing:0;line-height:1.75}
button,input,textarea,select{font-family:inherit}
.bubble{font-size:15.5px;line-height:1.78;letter-spacing:0;text-wrap:pretty}
html[lang="ar"] .bubble{font-size:16px;line-height:1.95;word-spacing:.015em}
.empty-state h1,.topbar-text strong,.sidebar-row,.suggestion-card{letter-spacing:-.018em}
.msg-actions{align-items:center;gap:6px;min-height:34px;opacity:1;flex-wrap:wrap}
.msg-actions button.action-icon-btn{
  width:34px;height:32px;padding:0;display:grid;place-items:center;
  border:1px solid transparent;border-radius:10px;background:transparent;
  color:#91A5C2;font-size:17px;line-height:1;
  transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease;
}
.msg-actions button.action-icon-btn:hover{color:#EAF3FF;background:#14243A;border-color:#263F60;transform:translateY(-1px)}
.msg-actions .action-icon-btn svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.msg-actions .action-icon-btn.is-copied,.msg-actions .action-icon-btn.is-selected{color:#8DBBFF;background:rgba(36,102,181,.17);border-color:rgba(77,143,234,.35)}
.action-divider{height:18px;width:1px;background:#26364D;margin:0 2px}
.feedback-note{min-height:0;max-height:0;overflow:hidden;opacity:0;color:#8FAED4;font-size:12px;line-height:1.5;padding-inline:3px;transition:opacity .2s ease,max-height .25s ease,margin .25s ease}
.feedback-note.is-visible{max-height:44px;opacity:1;margin-top:2px}
.msg.assistant .bubble{box-shadow:0 8px 28px rgba(0,0,0,.12);transition:border-color .2s ease,box-shadow .2s ease}
.msg.assistant:hover .bubble{border-color:#203B5D;box-shadow:0 10px 32px rgba(0,0,0,.2)}
@media (prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;animation-duration:.01ms!important;transition-duration:.01ms!important}}
@media (hover:none),(pointer:coarse){.msg-actions{opacity:1}.msg-actions button.action-icon-btn{width:36px;height:36px}}


/* ---------- Subtle transparent feedback controls ---------- */
.msg-actions{
  display:flex;
  align-items:center;
  gap:7px;
  opacity:.88;
  transition:opacity .18s ease;
}
.msg:hover .msg-actions{opacity:1}
.msg-actions .action-icon-btn{
  width:32px;
  height:32px;
  min-width:32px;
  padding:0;
  display:inline-grid;
  place-items:center;
  border-radius:50%;
  border:1px solid rgba(143,163,192,.22);
  background:rgba(5,10,18,.12);
  color:rgba(235,242,252,.86);
  cursor:pointer;
  transition:background .18s ease,border-color .18s ease,color .18s ease,transform .18s ease,box-shadow .18s ease;
}
.msg-actions .action-icon-btn:hover{
  background:rgba(31,75,132,.18);
  border-color:rgba(105,157,224,.48);
  color:#F4F8FF;
  transform:translateY(-1px);
}
.msg-actions .action-icon-btn:active{transform:scale(.94)}
.msg-actions .action-icon-btn svg{
  width:15px;
  height:15px;
  fill:none;
  stroke:currentColor;
  stroke-width:1.65;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.msg-actions .feedback-btn{
  font-family:inherit;
  font-size:15px;
  line-height:1;
  filter:saturate(.78);
  opacity:.9;
}
.msg-actions .feedback-btn.is-selected{
  background:rgba(33,99,174,.2);
  border-color:rgba(103,166,245,.72);
  box-shadow:0 0 0 2px rgba(65,132,207,.08);
  opacity:1;
  filter:saturate(1);
}
.msg-actions .copy-action.is-copied{
  color:#8FC2FF;
  border-color:rgba(103,166,245,.58);
}
.msg-actions .action-divider{
  width:1px;
  height:17px;
  margin:0 2px;
  background:rgba(143,163,192,.18);
}
.feedback-note{
  color:var(--text-muted);
  font-size:11.5px;
  line-height:1.4;
  opacity:0;
  transform:translateY(-2px);
  transition:opacity .18s ease,transform .18s ease;
}
.feedback-note.is-visible{opacity:.82;transform:translateY(0)}
@media(max-width:560px){
  .msg-actions{opacity:1;gap:6px}
  .msg-actions .action-icon-btn{width:31px;height:31px;min-width:31px}
}


/* Feedback icons match the copy action: minimal, transparent, no circles */
.msg-actions .action-icon-btn,
.msg-actions .action-icon-btn:hover,
.msg-actions .action-icon-btn:active,
.msg-actions .action-icon-btn.is-selected,
.msg-actions .action-icon-btn.is-copied{
  width:28px;
  height:28px;
  min-width:28px;
  padding:0;
  border:0;
  border-radius:6px;
  background:transparent;
  box-shadow:none;
  transform:none;
}
.msg-actions .action-icon-btn{
  color:rgba(220,232,249,.68);
}
.msg-actions .action-icon-btn:hover{
  color:rgba(235,244,255,.96);
  background:rgba(125,160,205,.07);
}
.msg-actions .feedback-btn{
  font-size:15px;
  opacity:.72;
  filter:grayscale(.15);
}
.msg-actions .feedback-btn:hover{
  opacity:1;
  filter:none;
}
.msg-actions .feedback-btn.is-selected{
  color:#79B5FF;
  background:transparent;
  border:0;
  box-shadow:none;
  opacity:1;
  filter:none;
}
.msg-actions .copy-action.is-copied{
  color:#79B5FF;
  background:transparent;
  border:0;
}


/* Final override: keep all message actions flat and icon-sized on desktop and mobile */
.msg-actions button.action-icon-btn,
.msg-actions button.action-icon-btn:hover,
.msg-actions button.action-icon-btn:active,
.msg-actions button.action-icon-btn.is-selected,
.msg-actions button.action-icon-btn.is-copied{
  width:28px !important;
  min-width:28px !important;
  height:28px !important;
  padding:0 !important;
  border:0 !important;
  border-radius:4px !important;
  background:transparent !important;
  box-shadow:none !important;
  transform:none !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
}
.msg-actions button.action-icon-btn:hover{color:#EAF3FF !important}
.msg-actions button.feedback-btn{font-size:15px !important;opacity:.72;filter:grayscale(.12)}
.msg-actions button.feedback-btn.is-selected{color:#79B5FF !important;opacity:1;filter:none}
.msg-actions .action-divider{display:none !important}
@media (hover:none),(pointer:coarse){
  .msg-actions button.action-icon-btn{width:28px !important;height:28px !important;min-width:28px !important}
}


/* CreatorFlow message actions — one consistent icon system */
.msg-actions{
  display:flex!important;
  align-items:center!important;
  justify-content:flex-start!important;
  flex-wrap:nowrap!important;
  gap:10px!important;
  min-height:32px!important;
  opacity:1!important;
}
.msg-actions button.action-icon-btn,
.msg-actions button.action-icon-btn:hover,
.msg-actions button.action-icon-btn:active,
.msg-actions button.action-icon-btn.is-selected,
.msg-actions button.action-icon-btn.is-copied{
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  flex:0 0 32px!important;
  width:32px!important;
  min-width:32px!important;
  max-width:32px!important;
  height:32px!important;
  min-height:32px!important;
  margin:0!important;
  padding:0!important;
  border:0!important;
  border-radius:7px!important;
  background:transparent!important;
  box-shadow:none!important;
  transform:none!important;
  color:#AAB6C8!important;
  opacity:1!important;
  filter:none!important;
  cursor:pointer!important;
}
.msg-actions button.action-icon-btn svg{
  display:block!important;
  width:19px!important;
  height:19px!important;
  flex:0 0 19px!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:1.8!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}
.msg-actions button.action-icon-btn:hover{
  color:#F0F5FC!important;
  background:rgba(145,170,205,.09)!important;
}
.msg-actions button.action-icon-btn.is-selected{
  color:#72AEF8!important;
  background:rgba(54,125,210,.13)!important;
}
.msg-actions button.action-icon-btn.is-copied{color:#72AEF8!important}
.msg-actions .action-divider{display:none!important}
.msg-actions button.action-icon-btn:focus-visible{
  outline:2px solid rgba(114,174,248,.7)!important;
  outline-offset:2px!important;
}
@media(max-width:560px){
  .msg-actions{gap:10px!important}
  .msg-actions button.action-icon-btn,
  .msg-actions button.action-icon-btn:hover,
  .msg-actions button.action-icon-btn.is-selected,
  .msg-actions button.action-icon-btn.is-copied{
    flex-basis:32px!important;width:32px!important;min-width:32px!important;height:32px!important;
  }
}


/* CreatorFlow workspace polish: stable dark theme and wider conversation */
:root{
  color-scheme:dark;
  --bg:#030405;--bg-elevated:#080A0D;--surface:#0A0D12;--surface-hover:#111821;
  --border:#1B2634;--text:#F7F9FC;--text-muted:#9AA8BA;--accent:#123F82;
  --accent-ink:#FFFFFF;--ai-bubble:#080A0D;--ai-accent:#FFFFFF;
}
html,body,.app,.main,.chat-scroll{background:#030405!important;color:#F7F9FC}
.main{width:100%;height:100dvh;min-width:0}
.chat-scroll{width:100%;min-width:0}
.messages{width:100%;max-width:1080px!important;padding-inline:clamp(16px,3vw,34px)!important;margin-inline:auto}
.bubble-col{max-width:88%!important}
.msg.user .bubble{background:#123F82!important;color:#FFF!important;border:1px solid rgba(75,139,225,.22)!important;border-radius:18px 18px 5px 18px!important;box-shadow:0 5px 20px rgba(0,0,0,.22)}
.msg.assistant .bubble{background:#080A0D!important;color:#F7F9FC!important;border:1px solid #141A23!important;border-radius:5px 18px 18px 18px!important;box-shadow:none!important}
.msg.assistant .bubble :is(p,li,span,strong,em,blockquote,code,pre,h1,h2,h3,h4){color:inherit}
.composer{background:linear-gradient(180deg,rgba(3,4,5,0),#030405 24%)!important}
.composer-inner{max-width:1080px!important;background:#090C11!important;border:1px solid #202D40!important}
#promptInput{color:#FFF!important;caret-color:#6EA9FF}
#promptInput::placeholder{color:#8291A7!important}
.composer-hint,.research-toggle{max-width:1080px!important}
.empty-state h1{color:#FFF!important}.empty-state p{color:#9AA8BA!important}
.suggestion-card{background:#090D13!important;border-color:#1B2634!important;color:#F4F7FC!important}
.topbar{background:#030405!important}
@media(max-width:860px){.messages{max-width:100%!important;padding-inline:14px!important}.bubble-col{max-width:92%!important}}

/* Light appearance is readable and never hides/rebuilds the conversation. */
:root[data-theme="light"]{
  color-scheme:light;--bg:#F5F7FB;--bg-elevated:#FFF;--surface:#FFF;--surface-hover:#EAF0F8;
  --border:#D8E1ED;--text:#172235;--text-muted:#68778C;--accent:#174A91;
  --accent-ink:#FFF;--ai-bubble:#FFF;--ai-accent:#286FC4;
}
:root[data-theme="light"] body,:root[data-theme="light"] .app,:root[data-theme="light"] .main,:root[data-theme="light"] .chat-scroll{background:#F5F7FB!important;color:#172235}
:root[data-theme="light"] .topbar,:root[data-theme="light"] .composer{background:#F5F7FB!important}
:root[data-theme="light"] .msg.assistant .bubble{background:#FFF!important;color:#172235!important;border-color:#DCE4EF!important}
:root[data-theme="light"] .composer-inner{background:#FFF!important;border-color:#D8E1ED!important}
:root[data-theme="light"] #promptInput{color:#172235!important}
:root[data-theme="light"] .empty-state h1{color:#172235!important}
:root[data-theme="light"] .empty-state p{color:#68778C!important}
:root[data-theme="light"] .suggestion-card{background:#FFF!important;color:#172235!important;border-color:#D8E1ED!important}


/* ChatGPT-inspired reading layout: compact typography, generous message canvas */
.messages{
  max-width:1240px!important;
  width:100%!important;
  padding:22px clamp(18px,4vw,48px) 34px!important;
  gap:22px!important;
}
.msg{
  width:100%!important;
  gap:10px!important;
}
.msg .bubble-col{
  min-width:0!important;
  max-width:calc(100% - 42px)!important;
}
.msg.assistant .bubble-col{
  width:100%!important;
  max-width:calc(100% - 42px)!important;
}
.msg.assistant .bubble{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  box-sizing:border-box!important;
  padding:14px 18px!important;
  font-size:14px!important;
  line-height:1.72!important;
  letter-spacing:0!important;
}
.msg.user .bubble-col{
  width:auto!important;
  max-width:82%!important;
}
.msg.user .bubble{
  max-width:100%!important;
  padding:10px 15px!important;
  font-size:14px!important;
  line-height:1.65!important;
}
.msg.assistant .bubble :is(p,li,blockquote){
  font-size:14px!important;
  line-height:1.72!important;
}
.msg.assistant .bubble :is(h1,h2,h3,h4){
  line-height:1.35!important;
  margin-block:12px 7px!important;
}
.msg.assistant .bubble pre,
.msg.assistant .bubble table{
  max-width:100%!important;
  overflow-x:auto!important;
}
@media(max-width:860px){
  .messages{padding:18px 14px 28px!important;gap:18px!important}
  .msg.assistant .bubble-col{max-width:calc(100% - 38px)!important}
  .msg.assistant .bubble{padding:12px 14px!important;font-size:13.5px!important}
  .msg.user .bubble-col{max-width:86%!important}
}
@media(max-width:480px){
  .messages{padding-inline:10px!important}
  .msg{gap:8px!important}
  .msg.assistant .bubble-col{max-width:calc(100% - 36px)!important}
  .msg.assistant .bubble{padding:11px 12px!important;font-size:13px!important;line-height:1.7!important}
  .msg.user .bubble{font-size:13px!important}
}


/* Final compact typography + more visible full-width chat canvas */
.messages{
  max-width:100%!important;
  width:100%!important;
  padding:16px clamp(12px,2.2vw,28px) 28px!important;
  gap:18px!important;
}
.msg{width:100%!important}
.msg.assistant .bubble-col{
  width:100%!important;
  max-width:calc(100% - 40px)!important;
}
.msg.assistant .bubble{
  width:100%!important;
  max-width:100%!important;
  padding:11px 15px!important;
  font-size:12.5px!important;
  line-height:1.68!important;
}
.msg.assistant .bubble :is(p,li,blockquote,td,th){
  font-size:12.5px!important;
  line-height:1.68!important;
}
.msg.assistant .bubble :is(h1,h2,h3,h4){
  font-size:1.12em!important;
  line-height:1.3!important;
  margin:10px 0 6px!important;
}
.msg.user .bubble{
  font-size:12.5px!important;
  line-height:1.6!important;
  padding:9px 13px!important;
}
.msg.user .bubble-col{max-width:84%!important}
.chat-scroll{
  width:100%!important;
  max-width:none!important;
}
.main{
  width:100%!important;
  max-width:none!important;
}
@media(max-width:860px){
  .messages{padding:14px 10px 24px!important;gap:16px!important}
  .msg.assistant .bubble-col{max-width:calc(100% - 34px)!important}
  .msg.assistant .bubble{font-size:12px!important;padding:10px 12px!important}
  .msg.assistant .bubble :is(p,li,blockquote,td,th){font-size:12px!important}
  .msg.user .bubble{font-size:12px!important}
}
@media(max-width:480px){
  .messages{padding-inline:8px!important}
  .msg.assistant .bubble-col{max-width:calc(100% - 32px)!important}
  .msg.assistant .bubble{font-size:11.5px!important;padding:9px 10px!important;line-height:1.65!important}
  .msg.assistant .bubble :is(p,li,blockquote,td,th){font-size:11.5px!important;line-height:1.65!important}
  .msg.user .bubble{font-size:11.5px!important}
}


/* Final visual balance: wider canvas, compact controls, refined small typography */
.messages{
  width:100%!important;
  max-width:100%!important;
  padding-inline:clamp(8px,1.6vw,22px)!important;
  gap:16px!important;
}
.msg.assistant .bubble-col{
  max-width:calc(100% - 38px)!important;
}
.msg.assistant .bubble{
  padding:10px 13px!important;
  font-size:12px!important;
  line-height:1.68!important;
}
.msg.assistant .bubble :is(p,li,blockquote,td,th){
  font-size:12px!important;
  line-height:1.68!important;
}
.msg.user .bubble{
  font-size:12px!important;
  line-height:1.58!important;
  padding:8px 12px!important;
}
.msg-actions{
  gap:5px!important;
  min-height:27px!important;
}
.msg-actions button.action-icon-btn,
.msg-actions button.action-icon-btn:hover,
.msg-actions button.action-icon-btn:active,
.msg-actions button.action-icon-btn.is-selected,
.msg-actions button.action-icon-btn.is-copied{
  flex:0 0 27px!important;
  width:27px!important;
  min-width:27px!important;
  max-width:27px!important;
  height:27px!important;
  min-height:27px!important;
  border-radius:6px!important;
}
.msg-actions button.action-icon-btn svg{
  width:16px!important;
  height:16px!important;
  flex-basis:16px!important;
}
@media(max-width:860px){
  .messages{padding-inline:8px!important}
  .msg.assistant .bubble{font-size:11.5px!important;padding:9px 11px!important}
  .msg.assistant .bubble :is(p,li,blockquote,td,th){font-size:11.5px!important}
  .msg.user .bubble{font-size:11.5px!important}
  .msg-actions{gap:4px!important}
}
@media(max-width:480px){
  .messages{padding-inline:6px!important}
  .msg.assistant .bubble-col{max-width:calc(100% - 30px)!important}
  .msg.assistant .bubble{font-size:11px!important;line-height:1.65!important;padding:8px 10px!important}
  .msg.assistant .bubble :is(p,li,blockquote,td,th){font-size:11px!important;line-height:1.65!important}
  .msg.user .bubble{font-size:11px!important;padding:8px 10px!important}
  .msg-actions button.action-icon-btn,
  .msg-actions button.action-icon-btn:hover,
  .msg-actions button.action-icon-btn.is-selected,
  .msg-actions button.action-icon-btn.is-copied{
    flex-basis:26px!important;width:26px!important;min-width:26px!important;height:26px!important;
  }
}


/* Final mobile polish: compact type, aligned feedback icons, lifted composer */
.msg.assistant .bubble,
.msg.assistant .bubble :is(p,li,blockquote,td,th),
.msg.user .bubble{
  font-size:11.5px!important;
}
.msg-actions{
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  min-height:28px!important;
}
.msg-actions button.action-icon-btn,
.msg-actions button.action-icon-btn:hover,
.msg-actions button.action-icon-btn:active,
.msg-actions button.action-icon-btn.is-selected,
.msg-actions button.action-icon-btn.is-copied{
  flex:0 0 28px!important;
  width:28px!important;
  min-width:28px!important;
  max-width:28px!important;
  height:28px!important;
  min-height:28px!important;
  padding:0!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:0!important;
  border-radius:6px!important;
  background:transparent!important;
}
.msg-actions button.action-icon-btn svg{
  width:17px!important;
  height:17px!important;
  flex:0 0 17px!important;
  display:block!important;
  stroke-width:1.8!important;
}
.composer{
  padding-top:10px!important;
  padding-bottom:calc(20px + env(safe-area-inset-bottom,0px))!important;
}
.composer-inner{
  min-height:50px!important;
  padding:6px 8px!important;
  gap:7px!important;
  border-radius:19px!important;
}
#promptInput{
  min-height:32px!important;
  max-height:120px!important;
  padding:4px 0!important;
  font-size:12px!important;
  line-height:1.45!important;
}
.attach-btn,.send-btn,.stop-btn{
  width:31px!important;
  height:31px!important;
  min-width:31px!important;
  border-radius:50%!important;
}
.attach-btn .icon,.send-btn .icon,.stop-btn .icon{
  width:16px!important;
  height:16px!important;
}
.composer-hint{font-size:9.5px!important;margin-top:6px!important}
@media(max-width:560px){
  .messages{padding-inline:5px!important}
  .msg.assistant .bubble,
  .msg.assistant .bubble :is(p,li,blockquote,td,th),
  .msg.user .bubble{font-size:10.5px!important}
  .msg-actions{gap:6px!important}
  .msg-actions button.action-icon-btn,
  .msg-actions button.action-icon-btn:hover,
  .msg-actions button.action-icon-btn.is-selected,
  .msg-actions button.action-icon-btn.is-copied{
    flex-basis:27px!important;width:27px!important;min-width:27px!important;height:27px!important;
  }
  .composer{padding-inline:10px!important;padding-bottom:calc(22px + env(safe-area-inset-bottom,0px))!important}
  .composer-inner{min-height:47px!important;padding:5px 7px!important}
  #promptInput{font-size:11.5px!important;min-height:30px!important}
  .attach-btn,.send-btn,.stop-btn{width:29px!important;height:29px!important;min-width:29px!important}
}


/* Symmetric feedback controls and a slimmer message composer */
.msg-actions{
  align-items:center!important;
  justify-content:flex-start!important;
  gap:6px!important;
}
.msg-actions .action-icon-btn{
  box-sizing:border-box!important;
  vertical-align:middle!important;
  line-height:0!important;
}
.msg-actions .action-icon-btn svg{
  display:block!important;
  margin:auto!important;
  overflow:visible!important;
}
.msg-actions .dislike-action svg{
  transform:rotate(180deg)!important;
  transform-origin:50% 50%!important;
}
.composer{
  padding-top:7px!important;
  padding-bottom:calc(14px + env(safe-area-inset-bottom,0px))!important;
}
.composer-inner{
  min-height:43px!important;
  padding:4px 7px!important;
  gap:5px!important;
  border-radius:16px!important;
}
#promptInput{
  min-height:27px!important;
  max-height:100px!important;
  font-size:11px!important;
  line-height:1.4!important;
  padding:3px 0!important;
}
#promptInput::placeholder{
  font-size:10.5px!important;
  opacity:.72!important;
}
.attach-btn,.send-btn,.stop-btn{
  width:26px!important;
  height:26px!important;
  min-width:26px!important;
  min-height:26px!important;
}
.attach-btn .icon,.send-btn .icon,.stop-btn .icon{
  width:14px!important;
  height:14px!important;
}
.composer-hint{
  font-size:9px!important;
  margin-top:4px!important;
}
@media(max-width:560px){
  .composer{
    padding-top:6px!important;
    padding-bottom:calc(12px + env(safe-area-inset-bottom,0px))!important;
  }
  .composer-inner{min-height:41px!important;padding:4px 6px!important}
  #promptInput{font-size:10.5px!important;min-height:25px!important}
  #promptInput::placeholder{font-size:10px!important}
  .attach-btn,.send-btn,.stop-btn{width:25px!important;height:25px!important;min-width:25px!important;min-height:25px!important}
  .attach-btn .icon,.send-btn .icon,.stop-btn .icon{width:13px!important;height:13px!important}
}


/* Google-only account gate */
.auth-screen{
  min-height:100dvh;display:flex;align-items:center;justify-content:center;
  padding:24px;background:
    radial-gradient(ellipse at 50% 10%,rgba(24,76,145,.22),transparent 48%),
    #030405;color:#F7F9FC;font-family:"IBM Plex Sans","IBM Plex Sans Arabic",sans-serif;
}
.auth-card{
  width:min(100%,420px);padding:38px 30px 30px;border:1px solid #1D2B3E;
  border-radius:22px;background:linear-gradient(160deg,#0B111B,#07090D 68%);
  box-shadow:0 24px 90px rgba(0,0,0,.42);text-align:center;
}
.auth-brand-mark{
  width:54px;height:54px;margin:0 auto 18px;display:grid;place-items:center;
  border-radius:17px;background:linear-gradient(145deg,#1B4E91,#0B2850);
  color:#FFF;font-size:26px;font-weight:700;box-shadow:0 8px 30px rgba(23,82,153,.3);
}
.auth-eyebrow{margin:0 0 10px;color:#7FADE5;font-size:10px;font-weight:700;letter-spacing:2.5px}
.auth-card h1{margin:0;color:#F7F9FC;font-size:25px;line-height:1.3;font-weight:600}
.auth-description{margin:12px auto 25px;max-width:310px;color:#9AA8BA;font-size:13px;line-height:1.7}
.google-signin-btn{
  width:100%;min-height:48px;display:flex;align-items:center;justify-content:center;gap:12px;
  border:1px solid #D5DCE5;border-radius:11px;background:#FFF;color:#202832;
  font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;transition:transform .15s ease,background .15s ease;
}
.google-signin-btn:hover{background:#F1F5F9;transform:translateY(-1px)}
.google-signin-btn:disabled{opacity:.65;cursor:wait;transform:none}
.google-signin-btn svg{width:20px;height:20px;flex:0 0 20px}
.auth-message{min-height:18px;margin:12px 0 0;color:#F49A9A;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.auth-footnote{margin:15px 0 0;color:#718096;font-size:10px;line-height:1.5}
.cloud-status{
  position:relative;z-index:2;margin:6px 18px 0;padding:8px 12px;
  border:1px solid rgba(216,165,76,.25);border-radius:9px;
  background:rgba(118,82,25,.12);color:#E9C98B;font-size:11px;line-height:1.5;
}
.account-menu .sign-out-item{color:#E18C8C}
.account-menu .sign-out-item:hover{background:rgba(200,70,70,.1)}
html[dir="rtl"] .auth-card{direction:rtl}
@media(max-width:480px){.auth-card{padding:30px 22px 24px}.auth-card h1{font-size:22px}}
