:root { --bg:#212121; --sidebar:#171717; --text:#ececec; --muted:#b4b4b4; --subtle:#909090; --accent:#8fb8ff; --danger:#ff7474; }
* { box-sizing:border-box; }
html,body { height:100%; }
body { margin:0; overflow:hidden; background:var(--bg); color:var(--text); font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif; font-size:15px; }
button,input,textarea { font:inherit; }
button { color:inherit; }
.hidden { display:none!important; }
.auth-screen { height:100%; display:grid; place-items:center; background:radial-gradient(circle at 50% 15%,rgba(100,155,255,.08),transparent 30%),#171717; }
.auth-card { width:min(400px,calc(100% - 40px)); text-align:center; }
.brand-mark { display:flex; align-items:center; justify-content:center; gap:10px; margin-bottom:52px; font-size:20px; font-weight:700; letter-spacing:.5px; }
.brand-spark { width:34px; height:34px; display:grid; place-items:center; border:1px solid #6d91c9; border-radius:50%; color:#aecaef; background:linear-gradient(145deg,#34455f,#1d2633); }
.auth-card h1 { margin:0 0 8px; font-size:30px; }
.auth-subtitle { margin:0 0 28px; color:var(--muted); }
.auth-card form { text-align:left; }
.auth-card label { display:block; margin-bottom:8px; font-size:13px; font-weight:600; }
.auth-card input,#imagePrompt { width:100%; border:1px solid #555; border-radius:10px; background:#252525; color:var(--text); padding:13px 14px; outline:none; }
.auth-card input:focus,#imagePrompt:focus { border-color:var(--accent); }
.email-error { min-height:24px; padding-top:6px; color:var(--danger); font-size:13px; }
.primary-auth { width:100%; border:0; border-radius:10px; background:#ececec; color:#181818; padding:12px 16px; font-weight:700; cursor:pointer; }
.primary-auth:hover { background:#fff; }
.terms { margin-top:18px; color:var(--subtle); font-size:12px; }
.app { height:100%; display:flex; }
.sidebar { width:260px; flex:0 0 260px; display:flex; flex-direction:column; background:var(--sidebar); border-right:1px solid rgba(255,255,255,.025); padding:10px; transition:transform .2s ease; }
.sidebar-head { display:flex; align-items:center; gap:6px; }
.new-chat { height:42px; flex:1; display:flex; align-items:center; gap:12px; border:0; border-radius:8px; background:transparent; padding:0 10px; cursor:pointer; text-align:left; font-weight:600; }
.new-chat:hover { background:#262626; }
.new-chat-icon { width:27px; height:27px; display:grid; place-items:center; border:1px solid #555; border-radius:7px; }
.chat-list { flex:1; overflow-y:auto; padding-top:12px; }
.chat-item { width:100%; height:38px; border:0; border-radius:7px; background:transparent; padding:0 10px; text-align:left; cursor:pointer; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#d5d5d5; }
.chat-item:hover,.chat-item.active { background:#292929; }
.sidebar-footer { border-top:1px solid #303030; padding-top:8px; }
.user-row { width:100%; display:flex; align-items:center; gap:9px; border:0; border-radius:8px; background:transparent; padding:8px; cursor:pointer; text-align:left; }
.user-row:hover { background:#262626; }
.avatar { width:34px; height:34px; display:grid; place-items:center; border-radius:50%; background:#53687d; font-weight:700; }
.user-details { display:flex; flex:1; flex-direction:column; }
.user-details strong { font-size:13px; }
.user-details small { color:var(--subtle); }
.dots { color:var(--subtle); letter-spacing:1px; }
.chat-shell { min-width:0; flex:1; display:flex; flex-direction:column; position:relative; }
.topbar { height:56px; flex:0 0 56px; display:flex; align-items:center; padding:0 20px; }
.model-picker-label { height:40px; display:flex; align-items:center; padding:0 10px; font-size:17px; font-weight:700; }
.top-actions { margin-left:auto; display:flex; gap:8px; }
.top-action { height:36px; display:flex; align-items:center; gap:7px; border:1px solid #4b4b4b; border-radius:8px; background:transparent; padding:0 10px; cursor:pointer; }
.top-action:hover { background:#303030; }
.icon-button { border:0; background:transparent; cursor:pointer; }
.menu-button { display:none; font-size:20px; width:36px; height:36px; }
.conversation { flex:1; min-height:0; overflow-y:auto; }
.welcome { min-height:100%; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:40px 20px 160px; }
.welcome-mark { width:44px; height:44px; display:grid; place-items:center; margin-bottom:10px; border:1px solid #555; border-radius:50%; color:#b7c9df; }
.welcome h1 { margin:8px 0 34px; font-size:29px; }
.suggestion-grid { width:min(670px,100%); display:grid; grid-template-columns:repeat(2,1fr); gap:10px; }
.suggestion { min-height:70px; display:flex; align-items:center; gap:12px; border:1px solid #464646; border-radius:12px; background:transparent; padding:10px 14px; text-align:left; cursor:pointer; }
.suggestion:hover { background:#292929; }
.suggestion-icon { width:38px; height:38px; flex:0 0 38px; display:grid; place-items:center; border-radius:9px; background:#303030; color:#c8d3e2; }
.suggestion span:last-child { display:flex; flex-direction:column; }
.suggestion strong { font-size:14px; }
.suggestion small { margin-top:3px; color:var(--subtle); }
.messages { width:min(760px,calc(100% - 40px)); margin:0 auto; padding:30px 0 120px; }
.message { display:flex; gap:14px; margin-bottom:24px; line-height:1.65; }
.message-avatar { width:30px; height:30px; flex:0 0 30px; display:grid; place-items:center; border-radius:50%; background:#5d7390; font-size:12px; }
.assistant .message-avatar { background:linear-gradient(145deg,#3d4d62,#242e3a); color:#bcd1ec; }
.message-content { min-width:0; flex:1; }
.message-content p { margin:3px 0 10px; white-space:pre-wrap; }
.message-content pre { overflow-x:auto; border:1px solid #484848; border-radius:10px; background:#171717; padding:14px; white-space:pre; }
.message-content code { font-family:Consolas,"Courier New",monospace; }
.generated-image { width:min(520px,100%); display:block; border:1px solid #4a4a4a; border-radius:12px; margin-top:8px; }
.typing { color:var(--subtle); }
.composer-wrap { width:min(760px,calc(100% - 40px)); margin:0 auto; position:absolute; left:50%; bottom:0; transform:translateX(-50%); padding-bottom:8px; background:linear-gradient(transparent,var(--bg) 18px); }
.composer { min-height:58px; border:1px solid #4c4c4c; border-radius:18px; background:#303030; padding:8px 9px 7px 14px; }
.composer:focus-within { border-color:#686868; }
.composer textarea { width:100%; min-height:24px; max-height:180px; resize:none; border:0; background:transparent; color:var(--text); outline:none; padding:3px 0 5px; line-height:20px; }
.composer textarea::placeholder { color:#aaa; }
.composer-tools { display:flex; align-items:center; }
.attach-button,.tools-button { height:30px; border:0; border-radius:7px; background:transparent; cursor:pointer; }
.attach-button { width:30px; font-size:22px; }
.tools-button { display:flex; align-items:center; gap:5px; margin-left:3px; padding:0 8px; }
.attach-button:hover,.tools-button:hover { background:#414141; }
.send-button { width:32px; height:32px; margin-left:auto; border:0; border-radius:50%; background:#ececec; color:#222; cursor:pointer; font-size:18px; }
.send-button:disabled { background:#555; color:#999; cursor:default; }
.disclaimer { margin:7px 0 0; text-align:center; color:var(--subtle); font-size:11px; }
.mode-badge { width:fit-content; display:flex; align-items:center; gap:6px; border:1px solid #555; border-radius:999px; background:#303030; padding:4px 6px 4px 10px; margin:0 0 7px 8px; font-size:12px; }
.mode-badge button { border:0; background:transparent; cursor:pointer; color:var(--subtle); }
.modal-backdrop { position:fixed; z-index:20; inset:0; display:grid; place-items:center; background:rgba(0,0,0,.58); backdrop-filter:blur(3px); }
.modal { width:min(520px,calc(100% - 32px)); max-height:calc(100% - 40px); overflow-y:auto; border:1px solid #4b4b4b; border-radius:15px; background:#242424; box-shadow:0 18px 60px rgba(0,0,0,.45); }
.modal-header { height:58px; display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #3d3d3d; padding:0 18px; }
.modal-header h2 { margin:0; font-size:17px; }
.modal-close { width:34px; height:34px; border:0; border-radius:8px; background:transparent; color:var(--muted); cursor:pointer; font-size:20px; }
.modal-close:hover { background:#353535; }
.settings-section { padding:18px; border-bottom:1px solid #3d3d3d; }
.settings-section h3 { margin:0 0 5px; font-size:15px; }
.settings-section p { margin:0 0 14px; color:var(--muted); }
.style-options { display:flex; flex-direction:column; gap:7px; }
.style-option { display:flex; align-items:flex-start; gap:11px; border:1px solid #444; border-radius:10px; background:transparent; padding:12px; text-align:left; cursor:pointer; }
.style-option:hover { background:#303030; }
.style-option.selected { border-color:#7e9ebc; background:#2d3440; }
.style-option span:last-child { display:flex; flex-direction:column; }
.style-option small { margin-top:3px; color:var(--muted); }
.radio { width:17px; height:17px; flex:0 0 17px; border:1px solid #777; border-radius:50%; margin-top:1px; }
.style-option.selected .radio { border:5px solid #b4c7dd; }
.provider-list { display:flex; flex-direction:column; gap:7px; }
.provider-row { display:flex; align-items:center; justify-content:space-between; border:1px solid #444; border-radius:10px; padding:10px 12px; }
.provider-row>span:first-child { display:flex; flex-direction:column; }
.provider-row small { color:var(--muted); margin-top:2px; }
.provider-status { border-radius:999px; background:#373737; color:#aaa; padding:4px 8px; font-size:11px; }
.provider-status.active { background:#2f513c; color:#bfe8c9; }
.provider-label { display:block; margin:12px 0 6px; font-size:13px; font-weight:600; }
.provider-select { width:100%; height:42px; border:1px solid #555; border-radius:8px; background:#2d2d2d; color:var(--text); padding:0 10px; outline:none; }
.provider-select:focus { border-color:var(--accent); }
.provider-actions { display:flex; align-items:center; justify-content:space-between; margin-top:12px; }
.account-section { display:flex; align-items:center; justify-content:space-between; border-bottom:0; }
.account-section p { margin:0; }
.secondary-button { height:36px; border:1px solid #555; border-radius:8px; background:transparent; padding:0 12px; cursor:pointer; }
.secondary-button:hover { background:#333; }
.tools-modal { width:min(410px,calc(100% - 32px)); padding-bottom:10px; }
.tool-option { width:calc(100% - 20px); height:64px; display:flex; align-items:center; gap:12px; border:0; border-radius:9px; background:transparent; margin:5px 10px 0; padding:8px 12px; text-align:left; cursor:pointer; }
.tool-option:hover { background:#303030; }
.tool-option>span:first-child { width:38px; height:38px; display:grid; place-items:center; border:1px solid #4e4e4e; border-radius:9px; }
.tool-option>span:last-child { display:flex; flex-direction:column; }
.tool-option small { margin-top:3px; color:var(--muted); }
.image-modal { padding-bottom:18px; }
.image-modal>*:not(.modal-header) { width:calc(100% - 36px); margin-left:18px; }
.image-safety { color:var(--muted); margin-top:14px; margin-bottom:8px; }
#imagePrompt { resize:vertical; min-height:100px; }
.image-preview { margin-top:12px; margin-bottom:12px; }
.image-preview svg { width:100%; max-height:360px; border:1px solid #4a4a4a; border-radius:10px; background:#171717; }
.mobile-only { display:none; }
@media(max-width:760px) {
  .sidebar { position:fixed; z-index:10; height:100%; transform:translateX(-100%); box-shadow:12px 0 40px rgba(0,0,0,.35); }
  .sidebar.open { transform:translateX(0); }
  .mobile-only { display:grid; place-items:center; }
  #closeSidebar { width:36px; height:36px; }
  .menu-button { display:block; margin-right:2px; }
  .topbar { padding:0 10px; }
  .action-label { display:none; }
  .top-action { width:36px; justify-content:center; }
  .suggestion-grid { grid-template-columns:1fr; }
  .welcome { justify-content:flex-start; padding-top:11vh; }
  .messages { width:calc(100% - 24px); }
  .composer-wrap { width:calc(100% - 24px); }
}
