:root {
  color-scheme: light;
  --brand-50:#eff4fa;
  --brand-100:#dde7f3;
  --brand-200:#c3d4e9;
  --brand-300:#9db8d9;
  --brand-400:#6589bd;
  --brand-600:#1d4378;
  --brand-700:#16335f;
  --ink:#16142e;
  --text:#1a1a1a;
  --muted:#777873;
  --line:rgba(0,0,0,.075);
  --cream:#fafaf8;
  --sidebar:#f6f6f3;
  --white:#fff;
  --shadow:0 2px 16px rgba(0,0,0,.06);
}
* { box-sizing:border-box; }
html,body { width:100%; height:100%; margin:0; overflow:hidden; }
body { background:var(--cream); color:var(--text); font-family:'DM Sans',system-ui,sans-serif; font-size:15px; -webkit-font-smoothing:antialiased; }
button,input,textarea { font:inherit; }
button { color:inherit; }
svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.app-shell { position:fixed; inset:0; display:grid; grid-template-columns:266px minmax(0,1fr); grid-template-rows:minmax(0,1fr); min-width:0; min-height:0; overflow:hidden; }

/* The quiet utility rail mirrors NILAI's existing workspace. */
.sidebar { display:flex; flex-direction:column; min-width:0; min-height:0; overflow:hidden; padding:18px 14px 12px; background:var(--sidebar); border-right:1px solid var(--line); }
.sidebar-brand { height:40px; display:flex; align-items:center; gap:9px; padding:0 7px; white-space:nowrap; }
.nilai-mark { width:28px; height:28px; border-radius:7px; display:flex; align-items:center; justify-content:center; gap:1px; flex:none; background:var(--brand-600); }
.nilai-mark span { width:2px; height:12px; border-radius:2px; background:white; }
.nilai-mark span:nth-child(2) { height:13px; transform:rotate(-38deg); }
.brand-word { color:var(--brand-700); font-family:'Raleway',sans-serif; font-size:14px; font-weight:800; letter-spacing:.025em; }
.brand-context { color:#81827f; font-size:11px; margin-left:1px; }
.new-chat-button { display:flex; align-items:center; justify-content:flex-start; gap:10px; height:42px; width:100%; margin:21px 0 12px; padding:0 12px; border:1px solid rgba(29,67,120,.18); border-radius:9px; color:var(--brand-700); background:#fff; font-size:13px; font-weight:600; cursor:pointer; transition:background .15s,border-color .15s,box-shadow .15s; }
.new-chat-button svg { width:16px; height:16px; }
.new-chat-button:hover { background:var(--brand-50); border-color:var(--brand-300); box-shadow:0 2px 8px rgba(22,51,95,.07); }
.history-search { display:flex; height:37px; align-items:center; gap:9px; padding:0 10px; border:1px solid transparent; border-radius:8px; color:#8b8c89; background:#ededeb; transition:border .15s,background .15s; }
.history-search:focus-within { background:#fff; border-color:var(--brand-300); }
.history-search svg { width:15px; height:15px; flex:none; }
.history-search input { width:100%; min-width:0; padding:0; border:0; outline:0; color:#333; background:transparent; font-size:12px; }
.history-search input::placeholder { color:#969792; }
.history-heading { padding:23px 9px 8px; color:#969792; font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; }
.conversation-list { flex:1; min-height:0; overflow:auto; display:flex; flex-direction:column; gap:2px; padding-bottom:14px; }
.conversation-list:empty::after { content:'Your conversations will appear here.'; padding:9px; color:#aaa; font-size:12px; line-height:1.5; }
.history-item { display:flex; align-items:center; gap:8px; width:100%; min-height:35px; padding:7px 9px; border:0; border-radius:7px; background:transparent; color:#555651; text-align:left; font-size:12px; cursor:pointer; }
.history-item:hover { background:rgba(0,0,0,.045); color:#222; }
.history-item.active { background:#e9edf1; color:var(--brand-700); font-weight:600; }
.history-item span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; flex:1; }
.history-item svg { width:14px; height:14px; color:#999; flex:none; }
.sidebar-bottom { padding:10px 7px 2px; border-top:1px solid var(--line); }
.source-coverage { display:flex; align-items:center; gap:6px; padding:5px 2px 10px; color:#73746f; font-size:10px; }
.coverage-dot,.context-indicator { width:6px; height:6px; border-radius:50%; background:#5d9474; flex:none; }
.coverage-separator { color:#b5b5b1; }
.privacy-toggle { width:100%; display:flex; justify-content:space-between; padding:7px 2px; border:0; background:none; color:#858681; font-size:11px; cursor:pointer; text-align:left; }
.privacy-toggle:hover { color:var(--brand-700); }
.privacy-toggle span { font-size:17px; line-height:10px; }
.privacy-note { padding:2px 3px 8px; color:#858681; font-size:10px; line-height:1.55; }

/* Conversation surface. */
.main-panel { position:relative; display:grid; grid-template-rows:52px minmax(0,1fr) auto; width:100%; min-width:0; min-height:0; overflow:hidden; background:var(--cream); }
.topbar { height:52px; flex:none; display:flex; align-items:center; gap:10px; padding:0 27px; border-bottom:1px solid rgba(0,0,0,.055); }
.topbar-title { color:#62635f; font-size:11px; font-weight:600; letter-spacing:.08em; text-transform:uppercase; }
.topbar-spacer,.composer-spacer { flex:1; }
.icon-button { width:34px; height:34px; display:grid; place-items:center; padding:0; border:1px solid transparent; border-radius:8px; background:transparent; color:#777873; cursor:pointer; transition:background .15s,color .15s,border .15s; }
.icon-button svg { width:17px; height:17px; }
.icon-button:hover { border-color:var(--line); background:#fff; color:var(--brand-700); }
.conversation { min-width:0; min-height:0; position:relative; overflow-x:hidden; overflow-y:auto; overscroll-behavior-y:contain; -webkit-overflow-scrolling:touch; scrollbar-color:rgba(0,0,0,.24) transparent; scrollbar-width:thin; }
.welcome { width:min(100% - 48px,690px); min-height:100%; display:flex; flex-direction:column; justify-content:center; margin:0 auto; padding:28px 0 76px; }
.welcome-eyebrow { display:flex; align-items:center; gap:8px; color:#797a75; font-size:10px; font-weight:700; letter-spacing:.13em; text-transform:uppercase; }
.welcome-eyebrow span { width:7px; height:7px; border-radius:50%; background:var(--brand-600); }
.welcome-eyebrow b { color:#c6c6c1; font-weight:500; }
.welcome h1 { margin:17px 0 11px; color:var(--ink); font-family:'Raleway',sans-serif; font-size:clamp(35px,5vw,49px); font-weight:700; line-height:1.13; letter-spacing:-.045em; }
.welcome h1 em { color:var(--brand-600); font-style:normal; }
.welcome>p { width:100%; max-width:470px; margin:0; color:#747570; font-size:15px; line-height:1.65; overflow-wrap:anywhere; }
.starter-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:9px; margin-top:30px; }
.starter-card { min-width:0; min-height:56px; display:flex; align-items:center; gap:10px; padding:10px 12px; border:1px solid rgba(0,0,0,.09); border-radius:9px; background:#fff; color:#42433f; font-size:12px; text-align:left; cursor:pointer; transition:transform .15s,border-color .15s,box-shadow .15s,background .15s; }
.starter-card:hover { transform:translateY(-2px); border-color:var(--brand-300); background:var(--brand-50); box-shadow:0 3px 12px rgba(22,51,95,.07); }
.starter-icon { color:var(--brand-600); font-family:'Raleway',sans-serif; font-size:10px; font-weight:800; }
.starter-card svg { width:14px; height:14px; margin-left:auto; color:#8d9eb0; flex:none; }
.messages { display:none; width:min(100% - 48px,840px); min-height:100%; flex-direction:column; gap:29px; margin:0 auto; padding:37px 0 32px; }
.conversation.has-messages .welcome { display:none; }
.conversation.has-messages .messages { display:flex; }
.message { width:100%; display:flex; }
.message.user { justify-content:flex-end; }
.user-bubble { max-width:min(78%,650px); padding:11px 16px; border:1px solid rgba(0,0,0,.09); border-radius:14px; background:#fff; box-shadow:0 1px 4px rgba(0,0,0,.04); color:#1a1a1a; font-size:15px; line-height:1.7; overflow-wrap:anywhere; white-space:pre-wrap; }
.assistant-wrap { width:100%; display:grid; grid-template-columns:29px minmax(0,1fr); gap:12px; align-items:start; }
.assistant-mark { width:26px; height:26px; display:flex; align-items:center; justify-content:center; gap:1px; margin-top:2px; border-radius:7px; background:var(--brand-600); }
.assistant-mark span { width:2px; height:10px; border-radius:2px; background:#fff; }
.assistant-mark span:nth-child(2) { height:11px; transform:rotate(-38deg); }
.assistant-content { min-width:0; padding-top:1px; }
.assistant-name { margin:0 0 8px; color:var(--brand-700); font-family:'Raleway',sans-serif; font-size:11px; font-weight:800; letter-spacing:.045em; }
.assistant-body { color:#1c1c1e; font-size:15px; line-height:1.78; overflow-wrap:anywhere; }
.assistant-body.streaming-text { white-space:pre-wrap; }
.assistant-body p { margin:0 0 12px; }
.assistant-body p:last-child { margin-bottom:0; }
.assistant-body h2,.assistant-body h3 { color:#16142e; font-family:'Raleway',sans-serif; line-height:1.35; }
.assistant-body h2 { margin:17px 0 7px; font-size:19px; }
.assistant-body h3 { margin:14px 0 6px; font-size:16px; }
.assistant-body ul,.assistant-body ol { margin:7px 0 12px; padding-left:22px; }
.assistant-body ol ul { margin:3px 0 8px; padding-left:22px; }
.assistant-body li { padding-left:3px; margin:0 0 5px; }
.assistant-body strong { color:#111; font-weight:700; }
.assistant-body code { padding:1px 5px; border:1px solid #e4e4e7; border-radius:4px; background:#f4f4f5; font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.88em; }
.assistant-body a { color:var(--brand-600); text-decoration:underline; text-underline-offset:2px; }
.inline-citation { display:inline; padding:1px 5px; border-radius:4px; background:var(--brand-50); color:var(--brand-700); font-size:.9em; white-space:nowrap; }
.inline-citation.source-page-missing { background:#fff0e8; color:#8a421e; text-decoration:underline wavy rgba(138,66,30,.55); text-underline-offset:3px; }
.answer-tools { display:flex; align-items:center; gap:10px; margin-top:14px; }
.citation-note { color:#8b8c89; font-size:10px; }
.sources-toggle { display:inline-flex; align-items:center; gap:6px; padding:5px 8px; border:1px solid rgba(29,67,120,.15); border-radius:6px; background:#fff; color:var(--brand-600); font-size:11px; cursor:pointer; }
.sources-toggle:hover { background:var(--brand-50); border-color:var(--brand-300); }
.sources-toggle svg { width:13px; height:13px; }
.source-list { display:none; margin-top:11px; }
.source-list.open { display:grid; gap:8px; }
.source-card { padding:11px 12px; border:1px solid rgba(0,0,0,.085); border-radius:9px; background:#fff; }
.source-card-head { display:flex; flex-wrap:wrap; align-items:center; gap:6px; margin-bottom:7px; color:var(--brand-700); font-size:11px; font-weight:700; }
.source-card-head .source-clause { color:#82837d; font-size:10px; font-weight:500; }
.source-card-title { margin:0 0 6px; color:#666761; font-size:11px; }
.source-card-text { color:#464741; font-size:12px; line-height:1.65; white-space:pre-wrap; overflow-wrap:anywhere; }
.loading-row { display:flex; align-items:center; gap:6px; min-height:30px; padding:3px 1px; }
.loading-row span { width:7px; height:7px; border-radius:50%; background:#9aa9ba; animation:dot-bounce 1s ease-in-out infinite; }
.loading-row span:nth-child(2) { animation-delay:.15s; }
.loading-row span:nth-child(3) { animation-delay:.3s; }
@keyframes dot-bounce { 0%,60%,100% { transform:translateY(0); opacity:.45; } 30% { transform:translateY(-4px); opacity:1; } }
.composer-area { position:relative; z-index:4; min-width:0; padding:14px 24px 10px; background:var(--cream); }
.composer { width:min(100%,840px); margin:0 auto; padding:8px 9px 8px 15px; border:1px solid rgba(0,0,0,.13); border-radius:14px; background:#fff; box-shadow:var(--shadow); transition:border-color .15s,box-shadow .15s; }
.composer:focus-within { border-color:rgba(29,67,120,.35); box-shadow:0 3px 18px rgba(0,0,0,.09); }
.composer textarea { display:block; width:100%; min-height:28px; max-height:150px; resize:none; padding:7px 1px 5px; border:0; outline:0; background:transparent; color:#1a1a1a; font-size:14px; line-height:1.55; }
.composer textarea::placeholder { color:#aaa; }
.composer-actions { display:flex; align-items:center; min-height:34px; gap:8px; }
.composer-context { display:flex; align-items:center; gap:6px; color:#898a84; font-size:10px; }
.composer-context .context-indicator { width:5px; height:5px; }
.send-button { width:32px; height:32px; display:grid; place-items:center; border:0; border-radius:8px; background:var(--brand-600); color:white; cursor:pointer; transition:background .15s,transform .12s; }
.send-button:hover { background:var(--brand-700); }
.send-button:active { transform:scale(.96); }
.send-button:disabled { background:#c4c7ca; cursor:default; }
.send-button svg { width:16px; height:16px; }
.send-button .stop-icon { display:none; }
.send-button.generating .send-icon { display:none; }
.send-button.generating .stop-icon { display:block; }
.composer-note { width:min(100%,840px); margin:8px auto 0; color:#aaa; font-size:10px; text-align:center; }
.empty-state .composer-area { padding-bottom:13px; }
.empty-state .welcome { padding-bottom:150px; }
.empty-state .composer-note { margin-top:8px; }
.mobile-scrim { display:none; }

@media (max-width:820px) {
  .app-shell { display:flex; }
  .sidebar { position:fixed; z-index:30; inset:0 auto 0 0; width:min(290px,86vw); transform:translateX(-102%); transition:transform .2s ease; box-shadow:8px 0 30px rgba(0,0,0,.08); }
  .main-panel { flex:1 1 0%; width:0; }
  .sidebar.open { transform:translateX(0); }
  .mobile-scrim.open { display:block; position:fixed; z-index:29; inset:0; background:rgba(20,25,32,.18); }
  .main-panel { grid-template-rows:49px minmax(0,1fr) auto; }
  .topbar { height:49px; padding:0 13px; }
  .messages { width:calc(100% - 32px); padding-top:24px; gap:24px; }
  .welcome { width:calc(100% - 36px); padding-top:30px; }
  .welcome h1 { max-width:100%; font-size:33px; overflow-wrap:anywhere; }
  .welcome>p { max-width:100%; font-size:14px; }
  .starter-grid { grid-template-columns:1fr; gap:7px; margin-top:22px; }
  .starter-card { min-height:48px; }
  .composer-area { box-sizing:border-box; width:100%; padding:10px 12px 9px; }
  .composer { width:100%; }
  .empty-state .welcome { padding-bottom:130px; }
  .user-bubble { max-width:88%; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto!important; animation-duration:.01ms!important; animation-iteration-count:1!important; transition-duration:.01ms!important; }
}
