/* Full-screen chat shell (layered over the original styles) */
body.shell .container { height: 100dvh; max-height: 100dvh; }
body.shell .container > .sidebar { display: none !important; }
body.shell .main-content { flex: 1; width: 100%; min-width: 0; display: flex; flex-direction: column; height: 100dvh; padding: 0 !important; margin: 0 !important; }
body.shell .chat-container { flex: 1; min-height: 0; max-width: 860px; width: 100%; margin: 0 auto; height: auto !important; padding: 0 16px 8px !important; }
body.shell .footer { font-size: 11px; opacity: .55; padding: 4px 0 2px; }

.shell-bar { position: relative; z-index: 50; display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid color-mix(in srgb, var(--border-color) 50%, transparent); background: var(--primary-bg); }
.shell-left, .shell-right { display: flex; align-items: center; gap: 6px; min-width: 0; }
.shell-icon { flex-shrink: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--text-color); cursor: pointer; }
.shell-icon:hover, .shell-model-btn:hover { background: var(--hover-color); }
.shell-model-btn { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 8px 12px; border-radius: 10px; border: 0; background: transparent; color: var(--text-color); font-size: 17px; font-weight: 600; cursor: pointer; }
.shell-model-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shell-account { flex-shrink: 0; padding: 8px 16px; border-radius: 999px; border: 0; background: var(--accent-color); color: var(--primary-bg); font-weight: 600; cursor: pointer; }
.shell-avatar { flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent-color); color: var(--primary-bg); font-weight: 700; cursor: pointer; }

.shell-model-menu { position: absolute; top: calc(100% + 4px); left: 56px; width: min(340px, calc(100vw - 24px)); max-height: 70dvh; overflow-y: auto; padding: 8px; border-radius: 14px; background: var(--sidebar-bg); border: 1px solid var(--border-color); box-shadow: 0 16px 40px rgba(0,0,0,.4); }
.shell-model-menu.hidden { display: none; }
.shell-model-menu .model-selector { margin: 0 !important; padding: 0 !important; background: transparent !important; border: 0 !important; }

.shell-scrim { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.5); }
.shell-scrim.hidden { display: none; }
.shell-drawer { position: fixed; inset: 0 auto 0 0; z-index: 100; width: min(300px, 86vw); display: flex; flex-direction: column; gap: 8px; padding: 12px; background: var(--sidebar-bg); color: var(--text-color); transform: translateX(-100%); transition: transform .22s ease; }
.shell-drawer.open { transform: none; }
.shell-drawer-head { display: flex; align-items: center; justify-content: space-between; }
.shell-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; }
.shell-brand img, .shell-auth-logo { border-radius: 8px; }
.shell-new { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-color); background: transparent; color: var(--text-color); cursor: pointer; font-size: 15px; }
.shell-new:hover { background: var(--hover-color); }
.shell-section-title { margin-top: 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; opacity: .6; padding: 0 4px; }
.shell-history { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.shell-history-item { text-align: left; padding: 9px 10px; border-radius: 8px; border: 0; background: transparent; color: var(--text-color); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.shell-history-item:hover { background: var(--hover-color); }
.shell-muted { opacity: .65; font-size: 14px; padding: 4px; }
.shell-link-btn { align-self: flex-start; margin: 4px; padding: 6px 12px; border-radius: 999px; border: 0; background: var(--accent-color); color: var(--primary-bg); font-weight: 600; cursor: pointer; }
.shell-nav { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--border-color); padding-top: 8px; }
.shell-nav a, .shell-nav button { text-align: left; padding: 10px; border-radius: 8px; border: 0; background: transparent; color: var(--text-color); text-decoration: none; font-size: 14px; cursor: pointer; }
.shell-nav a:hover, .shell-nav button:hover { background: var(--hover-color); }
.shell-nav small { display: block; opacity: .6; font-size: 12px; }

.shell-auth-card { position: relative; max-width: 400px !important; text-align: center; padding: 28px !important; }
.shell-auth-card .close-modal { position: absolute; top: 10px; right: 14px; }
.shell-auth-card h2 { margin: 12px 0 4px; }
.shell-auth-card ul { text-align: left; margin: 12px 0 20px; padding-left: 18px; line-height: 1.6; }
.shell-primary, .shell-secondary { display: block; padding: 12px; border-radius: 12px; text-decoration: none; font-weight: 600; margin-top: 8px; }
.shell-primary { background: var(--accent-color); color: var(--primary-bg); }
.shell-secondary { color: var(--text-color); border: 1px solid var(--border-color); }

@media (max-width: 768px) {
  body.shell .chat-container { padding: 0 8px 4px !important; }
  body.shell .footer { display: none; }
  body.shell .web-search-toggle { margin-bottom: 4px; }
  .shell-bar { padding: 6px 8px; }
  .shell-model-menu { left: 8px; }
}

/* Compact composer so the chat gets the space */
body.shell .input-container { margin-top: 4px !important; padding: 6px 0 0 !important; border-top: 0 !important; }
body.shell .input-options { margin: 2px 0 0 !important; padding: 0 !important; min-height: 0 !important; }
body.shell .toggle-label { white-space: nowrap; }
body.shell .web-search-toggle { margin: 0 0 6px !important; }
