/* GENRIX shared design system: quiet colour, readable type, real Lucide icons. */
:root{--bg:#edf0fa;--surface:#fbfcff;--sidebar:#f0f3fc;--text:#252a40;--muted:#727b98;--line:#e5e9f3;--border:#dfe5f2;--soft:#f1f4fb;--tint:#e9eeff;--blue:#5d72ee;--blueDeep:#4c60d4;--shadow:0 14px 48px #35487818}
.dark{--bg:#0e121c;--surface:#171c2a;--sidebar:#141b2b;--text:#edf0fa;--muted:#a0abc3;--line:#293249;--border:#35405b;--soft:#1e2638;--tint:#253451;--blue:#a9b6ff;--blueDeep:#7389f4;--shadow:0 16px 55px #0005}
.app{height:var(--app-height,100dvh);padding:14px;gap:14px}
.app>main{background:linear-gradient(155deg,var(--surface) 35%,var(--soft) 160%);border-color:var(--border);box-shadow:0 10px 50px #2b386507}
aside{width:275px;background:linear-gradient(165deg,#f3f5fc 15%,#edf1fc 80%,#e8edfd);border:1px solid #e0e6f6;padding:22px 16px 17px;box-shadow:inset 0 1px 0 #fff9}
.dark aside{background:linear-gradient(170deg,#151b2a 10%,#172238);border-color:var(--line)}
.sideBrandRow{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 5px 25px}
.sideBrandRow .brand{padding:0;gap:11px;letter-spacing:-1px;font-size:25px}
.brandSymbol{width:35px;height:35px;object-fit:contain;flex-shrink:0;filter:drop-shadow(0 4px 6px #6273dd28)}
.brandAI{font-size:10px;letter-spacing:.07em;margin-left:6px;top:5px}
#closeSidebar{display:none}
.newChat{padding:14px 15px;gap:11px;min-height:49px;border-radius:13px;font-size:13px;font-weight:600;background:linear-gradient(110deg,#667cf5,#5970e9);box-shadow:0 7px 16px #526cea1f,inset 0 1px 0 #ffffff30}
.newChat svg{width:19px;height:19px}.newChat kbd{font-size:9px}
.search{padding:14px 12px;background:#fff6;border:0;border-radius:12px;box-shadow:none;margin:11px 0 24px;gap:10px}
.search:focus-within{background:var(--surface);box-shadow:0 0 0 2px #748afa33}.search input{font-size:12px}.search svg{width:18px;height:18px;color:var(--muted)}
.dark .search{background:#ffffff04}.dark .search:focus-within{background:var(--soft)}
.historyHeading{font-size:10px;letter-spacing:1.2px;margin:0 12px 10px;font-weight:600}.historyHeading>span:last-child{background:none;border:1px solid var(--border);padding:3px 6px;border-radius:6px;font-size:10px}
.historyGroup{font-size:11px;letter-spacing:0;margin:15px 12px 8px;color:var(--muted)}
.historyRow{min-height:47px;padding:0 6px 0 12px;gap:9px;border-radius:12px;border:1px solid transparent;margin:4px 0}
.historyRow.active{background:linear-gradient(120deg,#e4eaff,#ecf0ff);border-color:#d5def5;box-shadow:0 3px 10px #54678c05}
.dark .historyRow.active{background:linear-gradient(110deg,#273650,#243049);border-color:#354363}
.historyRow>svg{width:18px;height:18px;color:var(--muted)}.historyItem{font-size:12px;padding:13px 0;font-weight:500}
.historyMore{display:flex;align-items:center;justify-content:center;min-width:34px;min-height:34px;border-radius:8px;color:var(--muted)}.historyMore svg{width:18px;height:18px}
.historyMore:hover:not(:disabled),.historyMore[aria-expanded=true]{color:var(--text);background:var(--surface)}
.emptyHistory{max-width:none;padding:15px 12px;color:var(--muted);font-size:12px;line-height:1.75}
.sideBottom{border-top:1px solid var(--line);padding-top:14px;margin-top:14px}
.sideUtilities{display:flex;gap:8px;margin:0 7px 7px}.sideUtilities button{display:flex;align-items:center;justify-content:center;gap:7px;padding:8px 9px;border:1px solid var(--border);border-radius:9px;font-size:10px;min-height:33px;color:var(--muted)}.sideUtilities svg{width:14px;height:14px}.sideUtilities button:first-child{flex:1}.sideUtilities #languageToggle{letter-spacing:.01em}.sideUtilities #languageToggle span{color:var(--text)}
.sideLink{padding:11px 10px;border-radius:11px;font-size:12px;gap:10px}.sideLink svg{color:var(--muted);width:18px;height:18px}.sideLink:hover:not(:disabled){background:var(--tint)}
.guestProfile{padding:13px 11px;border:1px solid var(--border);border-radius:14px;background:linear-gradient(120deg,var(--surface),var(--soft));gap:11px;box-shadow:none;margin-top:8px}.guestProfile strong{font-size:12px}.guestProfile small{font-size:10px;line-height:1.4}.guestProfile svg{width:18px;height:18px}.guestProfile .avatar{width:35px;height:35px;border-radius:12px;font-size:13px;background:linear-gradient(140deg,#dfe3ff,#e8ecf9)}
.dark .avatar,.dark .guestProfile .avatar{background:linear-gradient(140deg,#4c4b76,#304665);color:#f0efff}
.sideLegal{font-size:10px;gap:13px;margin-top:15px}.credit{font-size:10px;margin-top:9px;letter-spacing:0}.credit strong{font-weight:500;color:var(--muted)}
.topbar{padding:16px 25px;min-height:68px;background:var(--surface);border-bottom:1px solid var(--line)}
.topbar .iconButton{border:0;box-shadow:none;background:var(--soft);color:var(--muted);height:38px;width:38px;border-radius:11px}
.modeButton{font-size:14px;font-weight:600;gap:8px;padding:9px;border-radius:10px;letter-spacing:-.3px}
.modeButton>span:first-child svg{width:17px;height:17px;color:var(--blue)}
.modeButton>span:last-child svg{display:block!important;width:14px!important;height:14px!important;margin-left:2px;color:var(--muted)}
.modeButton[aria-expanded=true]>span:last-child svg{transform:rotate(180deg)}
.saveStatus{display:flex;align-items:center;gap:6px;color:var(--muted);font-size:10px;line-height:1.45;letter-spacing:0;max-width:185px}.saveStatus svg{width:14px;height:14px;color:#7c92a7;flex-shrink:0}.dark .saveStatus svg{color:#a2b7cf}
.dropdown{border-radius:17px;padding:7px;box-shadow:0 16px 40px #20274623;border:1px solid var(--border)}
.optionsMenu{position:fixed;right:auto;z-index:200;min-width:210px}.optionsMenu button{font-size:12px;padding:12px 11px;border-radius:10px;min-height:42px}.optionsMenu svg{width:18px;height:18px;color:var(--muted)}.optionsMenu .danger svg{color:var(--danger)}.menuDivider{height:1px;margin:5px 10px;background:var(--line)}
.modeMenu{top:63px}.modeOption{gap:12px;padding:11px 9px}.modeOption strong{font-size:13px}.modeOption small{font-size:11px;line-height:1.5}.modeOption .modeIcon{border:0;background:var(--soft);border-radius:10px}.modeOption .check svg{width:15px;height:15px}
#welcome{padding:33px 28px 28px;max-width:810px}.heroDescription{font-size:13px;line-height:1.75;color:var(--muted);margin-bottom:28px}.eyebrow{font-size:9px;letter-spacing:1.7px;color:var(--muted)}
.suggestions{gap:12px;max-width:650px}.suggestions button{padding:17px 18px 18px;min-height:133px;border-radius:17px;border:1px solid var(--border);background:linear-gradient(135deg,var(--surface),#f0f3fc);box-shadow:0 3px 10px #3c497005}
.suggestions button:hover:not(:disabled){box-shadow:0 9px 24px #5c70be14;background:var(--surface)}
.suggestions small{font-size:10px;margin:2px 0 6px;font-weight:500;letter-spacing:.01em}.suggestions strong{font-size:13px;line-height:1.55;font-weight:600;max-width:235px;margin:0;letter-spacing:-.15px}.suggestionIcon{width:29px;height:29px;border-radius:9px;margin-bottom:8px}.suggestionIcon svg{width:17px;height:17px}.suggestionArrow{top:20px;right:16px}.suggestionArrow svg{width:14px;height:14px}
.dark .suggestions button{background:linear-gradient(140deg,#1c2335,#202b3e);border-color:#2b364e}.dark .suggestionIcon{background:#2c3853}
.composerArea{padding:12px 33px 15px;background:linear-gradient(transparent,var(--surface) 25%);max-width:915px}
.composer{padding:16px 15px 10px;border-radius:21px;border:1px solid #d7deef;background:var(--surface);box-shadow:0 5px 24px #57639813,0 0 0 4px #edf0f866}
.composer textarea{font-size:16px;line-height:1.6;letter-spacing:0;max-height:145px}.composerTools{margin-top:9px}#hint{font-size:10px;color:var(--muted)}.composer .iconButton{min-height:38px;min-width:34px}.sendButton{width:38px;height:38px;border-radius:13px}.sendButton svg{height:20px;width:20px}.belowComposer{font-size:9px;letter-spacing:0;color:var(--muted)}
.dark .composer{box-shadow:0 5px 28px #0002,0 0 0 4px #20293b80;border-color:#3b4661}.dark .composer:focus-within{box-shadow:0 5px 28px #0002,0 0 0 4px #4c608428;border-color:#8799dd}
#notice{font-size:12px;color:var(--text);background:var(--tint);padding:10px 12px;border-radius:12px}#notice .noticeRetry{margin-left:auto;font-size:11px;font-weight:600;white-space:nowrap;border:1px solid var(--border);border-radius:8px;padding:7px 10px;color:var(--blue)}#notice #dismissNotice{margin-left:0}
#announcement{background:var(--soft);border:1px solid var(--border);border-radius:11px;padding:9px 12px;margin-bottom:10px;color:var(--muted);font-size:11px;line-height:1.65}
#messages{max-width:810px;padding:14px 30px 30px}.message{margin:22px 0 32px}.replyBody{font-size:16px;line-height:1.73;letter-spacing:0}.replyBody p{margin:12px 0}.replyBody h1{font-size:24px}.replyBody h2{font-size:21px}.replyBody h3{font-size:18px}.replyBody ul,.replyBody ol{padding-left:23px}.replyBody li{padding:3px 0}.userBubble{font-size:16px;line-height:1.65;padding:12px 17px;background:linear-gradient(115deg,var(--tint),var(--soft));border:1px solid var(--line)}
.messageHeader{font-size:14px;gap:9px;margin-bottom:14px}.messageLogo{width:27px;height:27px;border-radius:10px}.messageLogo svg{width:17px;height:17px}.modeBadge{font-size:10px!important;font-weight:500!important;border:1px solid var(--line)}
.messageActions{gap:3px;flex-wrap:wrap}.messageActions button{font-size:11px;padding:8px;min-height:35px;color:var(--muted)}.messageActions svg{width:15px;height:15px}.errorBody{font-size:15px;line-height:1.75;padding:12px 15px;background:color-mix(in srgb,var(--danger) 7%,transparent);border:1px solid color-mix(in srgb,var(--danger) 18%,transparent);border-radius:12px}
.codeToolbar{padding:10px 13px;font-size:11px;letter-spacing:0;background:var(--soft);border-bottom:1px solid var(--line)}.codeToolbar button{font-size:11px;min-height:26px;gap:6px}.codeToolbar svg{width:14px;height:14px}.codeLanguage{text-transform:lowercase;font-family:ui-monospace,monospace}.replyBody .codeBlock{border-radius:13px;border:1px solid var(--border);background:var(--surface)}.replyBody pre{padding:15px;line-height:1.65;font-size:13px}.replyBody code,.replyBody pre code{font-size:13px;line-height:1.65}
.hljs-keyword,.hljs-selector-tag,.hljs-literal{color:#7653b5}.hljs-string,.hljs-regexp,.hljs-attr{color:#267b69}.hljs-number,.hljs-symbol{color:#b35e40}.hljs-title,.hljs-title.function_,.hljs-built_in{color:#376fb9}.hljs-comment,.hljs-quote{color:#8793a3;font-style:italic}.hljs-type,.hljs-params{color:#6555aa}.hljs-variable,.hljs-template-variable{color:#9a5173}
.dark .hljs-keyword,.dark .hljs-literal{color:#c5a8f9}.dark .hljs-string,.dark .hljs-attr{color:#8fd6b5}.dark .hljs-number,.dark .hljs-symbol{color:#f5bb8e}.dark .hljs-title,.dark .hljs-built_in{color:#9ecbfa}.dark .hljs-comment{color:#92a1b8}.dark .hljs-type,.dark .hljs-params{color:#b4aff0}.dark .hljs-variable{color:#e8a2be}
.sources{margin:19px 0 0 35px;border-top:1px solid var(--line);padding-top:15px}.sourcesHeading{display:flex;align-items:center;gap:7px;color:var(--muted);font-size:11px;margin-bottom:10px}.sourcesHeading svg{width:15px;height:15px}.sourcesHeading strong{font-weight:500}.sourcesHeading small{margin-left:auto;font-size:10px}.sourceGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.sourceCard{display:flex;align-items:center;gap:8px;padding:11px;background:var(--soft);border:1px solid var(--line);border-radius:10px;min-width:0}.sourceCard>span:nth-child(2){min-width:0;flex:1}.sourceCard strong{font-size:11px;font-weight:500;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.sourceCard small{display:block;font-size:9px;color:var(--muted);margin-top:3px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sourceCard svg{width:12px;height:12px;color:var(--muted)}.sourceNumber{font-size:10px;width:20px;height:20px;display:grid;place-items:center;border-radius:6px;background:var(--tint);color:var(--blue);flex-shrink:0}.citation{font-size:.8em;font-weight:600;text-decoration:none!important;background:var(--tint);border-radius:4px;padding:1px 3px}
.adminDiagnostics{font-size:10px;line-height:1.5;color:var(--muted);margin:10px 0 0 35px;padding:8px 10px;background:var(--soft);border-radius:8px;overflow-wrap:anywhere}
.settingsGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px}.settingsIntro{margin-bottom:18px!important}.settingsField>span{font-size:12px;font-weight:500}.settingsField input,.settingsField select{font-size:14px;min-height:44px}.settingsField small{font-size:11px}.settingsExtras,.exportChoices{display:flex;flex-wrap:wrap;gap:9px;margin-top:20px}.privacyModeRow{display:flex;align-items:center;justify-content:space-between;gap:15px;border-top:1px solid var(--line);padding-top:18px;margin-top:18px}.privacyModeRow strong{display:block;font-size:12px}.privacyModeRow small{display:block;font-size:11px;line-height:1.6;color:var(--muted);margin-top:4px}.privacyModeRow button{font-size:10px;flex-shrink:0}.primaryButton,.secondaryButton{font-size:12px;min-height:39px}.usageCard{font-size:12px;line-height:1.8;background:var(--tint);border:1px solid var(--border);border-radius:14px}#dialogContent{font-size:13px}#dialogContent h3{font-size:16px}.referenceText{font-size:14px;line-height:1.65}
@media(max-width:1100px){aside{width:250px}.sideBrandRow .brand{font-size:23px}.newChat kbd{display:none}}
@media(max-width:760px){
  .app{position:fixed;inset:auto 0 auto 0;top:var(--viewport-top,0);padding:0;height:var(--app-height,100dvh);gap:0}
  .app>main{border:0;border-radius:0}.topbar{padding:10px 13px;min-height:61px}.headerLeft{gap:4px}.modeButton{font-size:14px;gap:4px;padding:9px 5px}.modeButton>span:first-child{display:none}.saveStatus{font-size:9px;max-width:112px;gap:5px}.saveStatus svg{width:13px;height:13px}.topbar .iconButton{min-width:36px;width:36px;height:36px;border-radius:10px}
  aside{width:min(315px,87vw);padding:23px 17px 17px;border-radius:0 22px 22px 0;top:var(--viewport-top,0);bottom:auto;height:var(--app-height,100dvh)}#closeSidebar{display:inline-flex}.sideBrandRow{margin-bottom:25px}.sideBrandRow .brand{font-size:25px}.brandSymbol{width:33px;height:33px}.newChat{font-size:13px;min-height:48px}.search input{font-size:13px}.historyItem{font-size:13px}.historyGroup{font-size:11px}.sideLink{font-size:13px}.guestProfile strong{font-size:13px}.sideUtilities button{font-size:10px}
  #welcome{padding:20px 19px 24px}.heroOrb{width:126px;height:139px;margin:8px auto 20px}.eyebrow{font-size:8px;letter-spacing:1.2px}h1{font-size:33px;letter-spacing:-1.4px;line-height:1.2}.heroDescription{font-size:12px;line-height:1.7;margin:16px auto 24px;max-width:285px}.suggestions{gap:10px}.suggestions button{padding:14px;min-height:147px;border-radius:15px}.suggestions strong{font-size:12px;line-height:1.5;max-width:none}.suggestions small{font-size:9px;line-height:1.5;margin-bottom:6px}.suggestionArrow{right:12px;top:17px}.suggestionArrow svg{width:12px;height:12px}.suggestionIcon{width:27px;height:27px;margin-bottom:7px}
  .composerArea{padding:10px 15px max(10px,env(safe-area-inset-bottom));}.composer{padding:14px 12px 8px;border-radius:20px}.composer textarea{font-size:16px;line-height:1.5;max-height:120px}.composerTools{gap:4px;margin-top:8px}#hint{font-size:8px;letter-spacing:0}.composer .iconButton{width:32px;min-width:32px;min-height:36px}.sendButton{height:36px;width:36px;border-radius:12px}.belowComposer{margin-top:9px;font-size:8px;line-height:1.6}
  #messages{padding:15px 17px 24px}.replyBody{font-size:16px;line-height:1.7;padding-left:0}.replyBody h1{font-size:22px}.replyBody h2{font-size:20px}.replyBody h3{font-size:18px}.userBubble{font-size:16px;line-height:1.6}.replyBody table{font-size:13px;line-height:1.65}.replyBody th,.replyBody td{padding:9px 10px}.messageHeader{font-size:14px}.messageActions{margin-left:0;gap:2px}.messageActions button{font-size:10px;padding:7px}.messageActions svg{width:14px;height:14px}.sources,.adminDiagnostics{margin-left:0}.sourceGrid{gap:7px}.sourceCard{padding:9px;gap:6px}.sourceCard strong{font-size:10px}.sourceCard svg{display:none}.sourceNumber{width:18px;height:18px;font-size:9px}.optionsMenu button{font-size:13px}.modeMenu{top:55px}.replyBody pre code{font-size:13px}
  .keyboardOpen .belowComposer{display:none}.keyboardOpen .composerArea{padding-bottom:8px}.keyboardOpen #welcome{padding-top:8px}.keyboardOpen .heroOrb{height:100px;width:96px;margin-bottom:10px}.keyboardOpen .composer textarea{max-height:90px}
  #dialog{padding:23px 20px;max-height:calc(var(--app-height,100dvh) - 28px)}.settingsGrid{gap:0 10px}.settingsField input,.settingsField select{font-size:16px}.privacyModeRow{flex-wrap:wrap}.referenceText{font-size:16px;min-height:150px}
}
@media(max-width:360px){.saveStatus{max-width:95px;font-size:8px}.modeButton{font-size:13px}#welcome{padding-left:15px;padding-right:15px}.suggestions button{padding:12px}.suggestions strong{font-size:11px}.sourceGrid{grid-template-columns:1fr}.settingsGrid{grid-template-columns:1fr}}
@media(max-height:650px) and (max-width:760px){#welcome .heroOrb{width:95px;height:108px}#welcome{padding-top:8px}#welcome h1{font-size:28px}.heroDescription{margin-bottom:17px}.suggestions button{min-height:130px}.sideBottom{padding-top:8px;margin-top:8px}.sideBrandRow{margin-bottom:15px}.search{margin-bottom:15px}.sideLegal{margin-top:11px}.credit{margin-top:7px}}
