/* Console rules for the channel list, the off state, the usage meter and the history settings. Colors come from the tokens in style.css. */

/* Channels with web transcripts off */
.chat .chat-item.off{color:var(--muted)}
.chat .chat-item.off .chat-item-name{color:var(--muted)}
.chat .chat-item-off{font-size:11px;color:var(--muted);background:var(--pill);border-radius:999px;padding:0 7px}
.chat .chat-off-on{margin-top:14px;padding:8px 16px;border:1px solid var(--line);border-radius:8px;background:var(--pill);color:var(--strong);font-size:13px}

/* Account menu: the avatar sits before the name */
.topbar .account-name{display:flex;align-items:center;gap:10px}

/* Usage meter in the composer */
.chat .chat-usage{position:static;flex:none;display:grid;place-items:center}
.chat .chat-usage-button{display:grid;place-items:center;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:none;color:var(--muted)}
.chat .chat-usage-button:hover{background:var(--pill);color:var(--strong)}
.chat .chat-usage-pop{position:absolute;right:0;bottom:calc(100% + 10px);z-index:20;width:260px;padding:14px 16px;border:1px solid var(--line);border-radius:12px;background:var(--surface);box-shadow:0 8px 24px rgb(0 0 0 / .25);color:var(--text);font-size:13px;line-height:1.5;text-align:left}
.chat .chat-usage-plan{margin:0 0 10px;color:var(--strong)}
.chat .chat-usage-row{margin:0 0 12px}
.chat .chat-usage-line{margin:0 0 6px}
.chat .chat-usage-track{height:4px;border-radius:999px;background:var(--pill);overflow:hidden}
.chat .chat-usage-fill{height:100%;background:var(--accent);border-radius:999px}
.chat .chat-usage-fill[data-level=mid]{background:var(--usage-mid)}.chat .chat-usage-fill[data-level=high]{background:var(--usage-high)}
.chat .chat-usage-button[data-level=mid] .chat-usage-arc{stroke:var(--usage-mid)}.chat .chat-usage-button[data-level=high] .chat-usage-arc{stroke:var(--usage-high)}
.chat .chat-usage-note{margin:4px 0 0;font-size:12px;color:var(--muted)}

/* Channels history: the Set note and the import progress */
.chan-window .chan-note{flex-basis:100%;margin:0}
.chan-progress{grid-column:1/-1;margin:4px 0 0}
.chan-progress p{margin:6px 0 0}
.progress{height:4px;border-radius:999px;background:var(--pill);overflow:hidden}
.progress span{display:block;height:100%;background:var(--accent);border-radius:999px}

/* Messages Slopbot did not read: one muted row that expands in place */
.chat .chat-msg.chat-folded{display:none}
.chat .chat-fold{display:block;width:min(760px,100%);margin:14px 0 0;padding:6px 10px;border:0;border-radius:8px;background:none;color:var(--muted);font-size:13px;text-align:left}
.chat .chat-fold:hover{color:var(--text);background:var(--pill)}

/* Settings modal (#settings in web/index.html, openSettings in web/app.js). The chat stays under it. Colors come from the tokens in style.css. */
.settings-dialog{inset:0;width:min(1040px,calc(100% - 48px));height:min(760px,calc(var(--viewport-height) - 48px));max-width:none;max-height:none;margin:auto;padding:0;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--text);overflow:hidden}
.settings-dialog::backdrop{background:rgb(0 0 0 / .5)}
.settings-shell{display:flex;flex-direction:column;height:100%;min-height:0}
.settings-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:none;padding:10px 12px 10px 22px;border-bottom:1px solid var(--line)}
.settings-head h2{margin:0;font:500 18px/1.2 'Source Serif 4',serif;color:var(--strong)}
.settings-close{display:grid;place-items:center;width:36px;height:36px;padding:0;border:0;border-radius:8px;background:none;color:var(--muted)}
.settings-close:hover{background:var(--pill);color:var(--strong)}
.settings-body{display:grid;grid-template-columns:220px minmax(0,1fr);flex:1;min-height:0}
.settings-side{min-width:0;padding:20px 16px;overflow-y:auto;border-right:1px solid var(--line)}
.settings-side nav{display:grid;gap:4px;margin:20px 0}
.settings-side nav button{text-align:left;border:0}
.settings-group>.small{margin:0}
/* Team admin is its own group under the server settings, with a line between them. */
.settings-team{margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.settings-team nav{margin:8px 0 12px}
.settings-main{min-width:0;padding:24px 32px;overflow-y:auto;overscroll-behavior:contain}
.settings-main h1{margin-top:4px}
.base-note{padding:28px 32px}
@media(max-width:760px){
 .settings-dialog{inset:0;width:100%;height:var(--viewport-height);margin:0;border:0;border-radius:0}
 .settings-head{padding:6px 6px 6px 14px}
 .settings-body{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr)}
 .settings-side{padding:10px 12px;overflow:visible;border-right:0;border-bottom:1px solid var(--line)}
 .settings-team{margin-top:10px;padding-top:10px}
 .settings-side nav{display:flex;gap:4px;margin:10px -12px 0;padding:0 12px 2px;overflow-x:auto;scrollbar-width:thin}
 .settings-side nav button{flex:none;white-space:nowrap;min-height:40px}
 .settings-side>.small{display:none}
 .settings-main{padding:18px 12px}
 .base-note{padding:18px 12px}
}

/* Command palette (web/palette.js): a search dialog with filter pills, sections and a footer of key hints. Colors come from the tokens in style.css. */
.palette-dialog{margin:10vh auto auto;width:min(680px,calc(100% - 32px));max-height:80vh;padding:0;border:1px solid var(--line);border-radius:16px;background:var(--surface);color:var(--text);overflow:hidden;box-shadow:0 16px 48px rgb(0 0 0 / .35);font:14px/1.5 Inter,sans-serif}
.palette-dialog::backdrop{background:rgb(0 0 0 / .5)}
.palette-shell{display:flex;flex-direction:column;max-height:inherit;min-height:0}
.palette-head{display:flex;align-items:center;gap:8px;flex:none;padding:14px 12px 4px 20px}
.palette .palette-input,input.palette-input:not([type=checkbox]):not([type=radio]){flex:1 1 auto;min-width:0;margin:0;padding:8px 0;border:0;border-radius:0;background:transparent;color:var(--strong);font-size:18px;outline:none}
.palette-input::placeholder{color:var(--muted)}
.palette-close{flex:none;display:grid;place-items:center;width:34px;height:34px;padding:0;border:0;border-radius:8px;background:none;color:var(--muted)}
.palette-close:hover{background:var(--pill);color:var(--strong)}
.palette-filters{display:flex;gap:6px;flex:none;padding:6px 16px 14px 20px;overflow-x:auto;scrollbar-width:none}
.palette-filters::-webkit-scrollbar{display:none}
.palette-filter{flex:none;min-height:34px;padding:6px 12px;border:0;border-radius:6px;font-size:15px;background:none;color:var(--muted)}
.palette-filter:hover{color:var(--strong)}
.palette-filter[aria-pressed=true]{background:var(--pill);color:var(--strong)}
.palette-divider{flex:none;height:1px;background:var(--line)}
.palette-list{flex:1 1 auto;min-height:0;list-style:none;margin:0;padding:6px 8px 8px;overflow-y:auto;overscroll-behavior:contain}
.palette-group{padding:12px 12px 4px;font-size:12px;color:var(--muted)}
.palette-item{display:flex;align-items:center;gap:12px;min-height:44px;padding:8px 12px;border-radius:10px;color:var(--text);cursor:pointer}
.palette-item[aria-selected=true]{background:var(--pill);color:var(--strong)}
.palette-icon{flex:none;display:grid;place-items:center;width:18px;height:18px;color:var(--muted)}
.palette-item[aria-selected=true] .palette-icon{color:var(--strong)}
.palette-main{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}
.palette-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.palette-meta{flex:none;font-size:12px;color:var(--muted);white-space:nowrap}
.palette-return{flex:none;display:grid;place-items:center;visibility:hidden;color:var(--muted)}
.palette-item[aria-selected=true] .palette-return{visibility:visible}
.palette-empty{margin:0;padding:16px;color:var(--muted)}
.palette-status{padding:8px 12px;font-size:13px;color:var(--muted)}
.palette-hit{align-items:flex-start;padding-top:10px;padding-bottom:10px}
.palette-hit .palette-icon{margin-top:2px}
.palette-hit-meta{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;color:var(--muted)}
.palette-hit-text{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;font-size:14px;color:var(--text);overflow-wrap:anywhere}
.palette-hit-text p{margin:0}
.palette-hit-text mark{background:none;color:var(--strong);font-weight:600;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.palette-foot{display:flex;flex:none;flex-wrap:wrap;gap:6px 18px;padding:10px 16px;border-top:1px solid var(--line);font-size:12px;color:var(--muted)}
.palette-foot span{display:inline-flex;align-items:center;gap:6px}
.palette-foot kbd{display:inline-grid;place-items:center;min-width:22px;height:20px;padding:0 5px;border:1px solid var(--line);border-bottom-width:2px;border-radius:6px;background:var(--bg);color:var(--text);font:500 11px/1 Inter,sans-serif}
@media(max-width:760px){
  .palette-dialog{margin:0 auto auto;width:100%;max-width:100%;max-height:100dvh;border:0;border-radius:0 0 16px 16px}
  .palette-shell{padding:env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left)}
  .palette-head{padding-left:14px}.palette-filters{padding-left:14px;padding-right:14px}
  .palette-item{min-height:44px}
  .palette-foot{display:none}
}

/* The search field is part of the dialog header: no box and no focus ring. */
.palette .palette-input:focus,.palette .palette-input:focus-visible{outline:none;border:0;box-shadow:none}

/* Admin system prompt: Write and Preview tabs, a monospace field and a character count. */
.prompt-tabs{display:flex;gap:4px;margin:0 0 8px}
.prompt-tab{min-height:34px;padding:6px 12px;border:0;border-radius:6px;background:none;color:var(--muted)}
.prompt-tab:hover{color:var(--strong)}
.prompt-tab[aria-pressed=true]{background:var(--pill);color:var(--strong)}
.prompt-field{display:block;box-sizing:border-box;width:100%;min-width:0;min-height:320px;margin:0;padding:10px 12px;border:1px solid var(--line);border-radius:6px;background:var(--bg);color:var(--text);font-size:14px;line-height:1.5}
textarea.prompt-field{font-family:'JetBrains Mono',monospace;resize:vertical}
.prompt-preview{overflow:auto;overflow-wrap:anywhere;font-family:Inter,sans-serif}
.prompt-preview p{margin:0 0 .8em}
.prompt-preview p:last-child{margin-bottom:0}
.prompt-preview ul,.prompt-preview ol{margin:.4em 0 .8em;padding-left:1.4em}
.prompt-preview li{margin:.2em 0}
.prompt-preview h3,.prompt-preview h4,.prompt-preview h5{margin:.8em 0 .4em;font-size:15px;font-weight:600;color:var(--strong)}
.prompt-preview blockquote{margin:.6em 0;padding:0 0 0 14px;border-left:2px solid var(--line);color:var(--muted)}
.prompt-preview a{color:var(--accent);text-decoration:none}
.prompt-preview a:hover{text-decoration:underline}
.prompt-preview code{font-family:'JetBrains Mono',monospace;font-size:.88em;background:var(--pill);border-radius:6px;padding:.1em .35em}
.prompt-preview .md-code{margin:.6em 0;border:1px solid var(--line);border-radius:10px;background:var(--surface);overflow:hidden}
.prompt-preview .md-code-lang{display:block;padding:6px 12px 0;font-size:12px;color:var(--muted)}
.prompt-preview .md-code pre{margin:0;padding:8px 12px 12px;overflow-x:auto;white-space:pre;font:13px/1.55 'JetBrains Mono',monospace;color:var(--text)}
.prompt-preview .md-code code{padding:0;background:none;font-size:inherit}
.prompt-preview .md-sub{display:block;color:var(--muted);font-size:12px}
.prompt-preview .md-mention{color:var(--accent);background:var(--pill);border-radius:4px;padding:0 .25em}
.prompt-preview .md-spoiler{background:var(--pill);color:transparent;border-radius:4px;padding:0 .2em;cursor:pointer;user-select:none}
.prompt-preview .md-spoiler.revealed{color:inherit;user-select:auto}
.prompt-count{margin:6px 0 0;font-size:12px;color:var(--muted)}
.prompt-count[data-over=true]{color:var(--usage-high);font-weight:500}
.prompt-actions{display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-start;margin-top:14px}
.prompt-actions>button{display:inline-flex;align-items:center;justify-content:center;height:40px;min-height:40px;margin:0;padding:0 14px;box-sizing:border-box;line-height:1}
.prompt-actions>.primary{margin:0}
@media(max-width:760px){textarea.prompt-field{font-size:16px}}
/* Manage users: the table of all users (rows open the user dialog), its pager, the page size select and the user dialog (#user-dialog). Colors come from the tokens in style.css. */
.users-table{min-width:640px}.users-table th,.users-table td{white-space:nowrap}.users-table .admin-person{white-space:nowrap}
.users-table .progress{max-width:140px;margin-top:4px}
.user-row{cursor:pointer}
.user-row:hover{background:var(--pill)}
.user-open{display:block;width:100%;min-height:0;margin:0;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left}
.admin-search .user-size{flex:0 0 auto}
.admin-search .user-size select{width:auto;min-width:80px}
.users-pager{margin:12px 0 0}
.user-dialog{width:min(760px,calc(100% - 32px));max-height:calc(var(--viewport-height) - 32px);padding:0;border:1px solid var(--line);border-radius:14px;background:var(--surface);color:var(--text);overflow:hidden}
.user-dialog::backdrop{background:rgb(0 0 0 / .5)}
.user-shell{display:flex;flex-direction:column;max-height:inherit;min-height:0}
.user-shell .settings-head{flex:none}
.user-body{flex:1 1 auto;min-height:0;padding:18px 22px 22px;overflow-y:auto;overscroll-behavior:contain}
.user-profile{margin:0 0 8px}
.user-body>.chips{margin:0}
.user-section{margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}
.user-section h3{margin:0 0 6px;font-size:15px;color:var(--strong)}
.user-section>.scope{margin:0 0 12px}
.user-window{min-width:0;padding:14px;border:1px solid var(--line);border-radius:10px;background:var(--bg)}
.user-window h4{margin:0 0 6px;font-size:14px;color:var(--strong)}
.user-window p{margin:0 0 6px}
.user-window .progress{margin:8px 0}
.user-form .row{margin-bottom:12px}
@media(max-width:760px){.user-dialog{width:100%;max-width:100%;max-height:var(--viewport-height);border:0;border-radius:0}}
.admin-server{display:flex;align-items:center;gap:12px;min-width:0}.admin-server .server-icon{width:32px;height:32px;display:grid;place-items:center;font-size:13px}
/* Model prices and usage totals: cells never wrap, so the table scrolls sideways in its card. Numbers are right-aligned with tabular digits. */
.price-table th,.price-table td,.usage-totals th,.usage-totals td{white-space:nowrap}
.price-table input{width:120px;padding:6px 8px}.price-table input[data-price-new="model"]{width:200px}
.price-table s{color:var(--muted)}
.usage-totals .num{text-align:right;font-variant-numeric:tabular-nums}
.price-table .chan-actions{flex-wrap:nowrap;gap:6px;justify-content:flex-start}.price-table .chan-actions button{min-height:30px;padding:4px 10px}.price-table td{vertical-align:middle}

/* Web search keys (Bot admin): the key tables do not wrap, the add form is one column, and the off notice is a quiet box. */
.web-key-group h3,.web-key-form h3{margin:16px 0 6px;font-size:15px;color:var(--strong)}
.web-key-table th,.web-key-table td{white-space:nowrap}
.web-key-table td .chip{margin-left:6px}
.web-key-error{margin-top:2px;font-size:12px;color:var(--muted);white-space:normal;max-width:36ch}
.web-key-error.bad{color:var(--usage-high)}
.web-key-off{margin:0 0 12px;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:var(--pill);color:var(--strong);font-size:13px}
.web-key-form{margin-top:8px;padding-top:4px;border-top:1px solid var(--line)}
.web-key-form .primary{margin-top:10px}
.web-key-form .small{margin:6px 0 0}

/* Slopbot build line at the bottom of the settings side column. The sha links to its commit. */
.version-line{margin:16px 0 0;font-size:12px;color:var(--muted)}
.version-line a{color:inherit}
