/* ---- ARIA ------------------------------------------------------------------- */
.aria-scroll { flex: 1; overflow-y: auto; }
.aria-col { max-width: 720px; margin: 0 auto; padding: 24px 24px 12px; }
@media (max-width: 760px) { .aria-col { padding: 16px 14px 8px; } }
.aria-turn { margin-bottom: 26px; }
.aria-user { display: flex; justify-content: flex-end; }
.aria-user .bubble { background: var(--accent); color: #fff; border-color: transparent; max-width: 85%; border-radius: 15px 15px 4px 15px; padding: 11px 15px; font-size: 14.5px; line-height: 1.6; }
.aria-bot { display: flex; gap: 14px; align-items: flex-start; }
.aria-avatar { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center; background: linear-gradient(140deg, var(--text), var(--accent)); color: var(--bg); margin-top: 2px; }
.aria-avatar svg { width: 17px; height: 17px; }
.aria-body { flex: 1; min-width: 0; }
.aria-foot { display: flex; align-items: center; gap: 2px; margin-top: 8px; color: var(--text-3); font-size: 12px; flex-wrap: wrap; }
.aria-status { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13.5px; padding: 4px 0; }
.aria-empty { max-width: 760px; margin: 0 auto; padding: 10vh 24px 24px; }
.aria-empty h1 { font-family: var(--font-display); font-size: 36px; font-weight: 650; letter-spacing: -.01em; line-height: 1.15; }
.suggest { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 26px; }
.suggest button { text-align: left; padding: 14px 16px; border-radius: 13px; border: 1px solid var(--glass-brd); background: var(--glass-2); display: flex; gap: 12px; align-items: flex-start; transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s var(--ease); }
.suggest button:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); }
.suggest svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.suggest b { display: block; font-weight: 500; font-size: 13.5px; }
.suggest span { font-size: 12.5px; color: var(--text-2); }
@media (max-width: 600px) { .suggest { grid-template-columns: 1fr; } }
.aria-composer { max-width: 720px; margin: 0 auto; width: 100%; padding: 0 24px 20px; }
@media (max-width: 760px) { .aria-composer { padding: 0 8px 10px; } }
.aria-composer .composer-box { border-radius: 16px; }
.aria-composer textarea { flex: 1; min-height: 52px; max-height: 280px; padding: 14px 16px 6px; border: none; background: none; resize: none; outline: none; font-size: 14.5px; line-height: 1.55; width: 100%; color: var(--text); }
.aria-tools { display: flex; align-items: center; gap: 6px; padding: 4px 8px 8px; }
.att-chip { display: flex; align-items: center; gap: 9px; padding: 7px 10px 7px 8px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); max-width: 260px; flex-shrink: 0; position: relative; }
.att-chip .fc-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 9px; font-weight: 800; flex-shrink: 0; overflow: hidden; }
.att-chip .fc-icon img { width: 100%; height: 100%; object-fit: cover; }
.att-chip .name { font-size: 12.5px; font-weight: 600; }
.att-chip .meta { font-size: 11px; color: var(--text-3); }
.sources { margin-top: 10px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.sources summary { list-style: none; cursor: pointer; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
.sources summary::-webkit-details-marker { display: none; }
.sources ol { margin: 0; padding: 4px 12px 10px 32px; font-size: 12.5px; }
.sources li { margin: 3px 0; }
.artifact { display: flex; align-items: center; gap: 14px; padding: 16px 18px; margin: 12px 0; border-radius: 13px; border: 1px solid var(--border-strong); background: var(--surface); box-shadow: var(--shadow-sm); }
.artifact-kicker { font-size: 9.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.artifact-title { font-family: var(--font-display); font-weight: 650; font-size: 20px; line-height: 1.25; margin-bottom: 2px; }
.artifact-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.artifact-icon svg { width: 22px; height: 22px; }
.artifact-thumb { width: 128px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; flex-shrink: 0; border: 1px solid var(--border); position: relative; }
@media (max-width: 600px) { .artifact { flex-wrap: wrap; } .artifact-thumb { width: 100%; } }
.event-card { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin: 8px 0; border-radius: var(--r); border: 1px solid var(--border); background: var(--surface); }
.event-card .ev-date { width: 44px; text-align: center; flex-shrink: 0; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); }
.event-card .ev-date .m { background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 0; }
.event-card .ev-date .d { font-size: 17px; font-weight: 700; padding: 2px 0 3px; }

/* ---- Markdown --------------------------------------------------------------- */
.md { font-size: 14.5px; line-height: 1.7; color: var(--text); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h1, .md h2, .md h3, .md h4 { margin: 22px 0 10px; line-height: 1.3; font-weight: 600; }
.md h1, .md h2 { font-family: var(--font-display); font-weight: 650; }
.md h1 { font-size: 25px; } .md h2 { font-size: 21px; } .md h3 { font-size: 16.5px; } .md h4 { font-size: 15px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 24px; }
.md li { margin: 4px 0; }
.md li > p { margin: 0; }
.md blockquote { margin: 0 0 12px; padding: 4px 16px; border-left: 3px solid var(--border-strong); color: var(--text-2); }
.md hr { border: none; height: 1px; background: var(--border); margin: 20px 0; }
.md code { font-family: var(--font-mono); font-size: .86em; padding: 2px 6px; border-radius: 6px; background: var(--surface-3); }
.md a { text-decoration: underline; text-underline-offset: 2px; }
.md table { border-collapse: collapse; width: 100%; margin: 0 0 14px; font-size: 13.5px; display: block; overflow-x: auto; }
.md th, .md td { border: 1px solid var(--border); padding: 7px 11px; text-align: left; vertical-align: top; }
.md th { background: var(--surface-2); font-weight: 600; }
.md img { max-width: 100%; border-radius: 8px; }
.md .task { list-style: none; margin-left: -20px; }
.codeblock { margin: 0 0 14px; border-radius: var(--r); overflow: hidden; background: var(--code-bg); border: 1px solid var(--border); }
.codeblock-head { display: flex; align-items: center; gap: 6px; height: 38px; padding: 0 6px 0 14px; background: rgba(255,255,255,.04); border-bottom: 1px solid rgba(255,255,255,.07); color: #a3acbd; font-size: 12px; font-family: var(--font-mono); }
.codeblock-head .icon-btn, .codeblock-head .btn { color: #a3acbd; }
.codeblock-head .icon-btn:hover, .codeblock-head .btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.codeblock-head .btn { background: none; border-color: rgba(255,255,255,.14); box-shadow: none; }
.codeblock pre { margin: 0; padding: 14px 16px; overflow-x: auto; font-family: var(--font-mono); font-size: 13px; line-height: 1.6; color: var(--code-text); max-height: 520px; }
.codeblock pre code { background: none; padding: 0; font-size: inherit; }

/* highlight.js — one palette that reads on the always-dark code surface */
.hljs-comment, .hljs-quote { color: #7d879b; font-style: italic; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-type, .hljs-meta .hljs-keyword { color: #c792ea; }
.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta .hljs-string { color: #a5d6a7; }
.hljs-number, .hljs-built_in, .hljs-builtin-name, .hljs-symbol, .hljs-bullet, .hljs-link { color: #f7b267; }
.hljs-title, .hljs-section, .hljs-name, .hljs-selector-id, .hljs-selector-class, .hljs-title.function_ { color: #82aaff; }
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-params, .hljs-property { color: #f07178; }
.hljs-tag { color: #89ddff; }
.hljs-deletion { color: #ff8a80; }
.hljs-emphasis { font-style: italic; } .hljs-strong { font-weight: 700; }
/* Which model is answering: information, not a control. */
.model-note { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text-3); white-space: nowrap; cursor: default; }

/* ---- Skills by name: the "/" palette, the Skills menu, voice ------------------- */
.aria-composer .composer-box { position: relative; }
.skill-pal { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 20; padding: 6px; border-radius: 14px;
  background: var(--glass-strong, var(--surface)); border: 1px solid var(--glass-brd, var(--border)); box-shadow: var(--shadow-lg); max-height: 340px; overflow-y: auto;
  animation: menuIn .14s cubic-bezier(.23, 1, .32, 1); transform-origin: bottom left; }
.skill-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: none; border-radius: 9px; background: none; color: var(--text); font-size: 13px; text-align: left; }
.skill-row b { font-family: var(--font-mono); font-weight: 500; font-size: 12.5px; }
.skill-row.on { background: var(--hover); }
.skill-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex-shrink: 0; }
.skills-pop { width: 360px; max-height: 60vh; overflow-y: auto; }
.skills-pop .menu-item b { font-family: var(--font-mono); font-weight: 500; font-size: 12.5px; }
.icon-btn.mic.on { color: #fff; background: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); animation: micPulse 1.4s ease-in-out infinite; }
@keyframes micPulse { 50% { box-shadow: 0 0 0 8px transparent; } }
.aria-user .tag svg { vertical-align: -1px; margin-right: 2px; }
@media (prefers-reduced-motion: reduce) { .icon-btn.mic.on { animation: none; } }

/* A chat in the list: its title takes what's left, the ⋯ button always fits. */
.chat-row { display: flex; align-items: center; gap: 2px; min-width: 0; border-radius: 10px; }
.chat-row > .list-item { flex: 1; min-width: 0; width: auto; }
.chat-row > .chat-more { flex-shrink: 0; }
.pane-side .pane-body { overflow-x: hidden; }
@media (hover: hover) and (pointer: fine) { .chat-row:not(:hover):not(.active) > .chat-more:not([aria-expanded="true"]) { opacity: .45; } }

/* ---- Skills panel ---------------------------------------------------------------------- */
.skill-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.skill-card { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 14px; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; min-width: 0;
  transition: transform 160ms cubic-bezier(.23,1,.32,1), border-color 160ms ease, background-color 160ms ease; }
.skill-card b { font-size: 14px; }
.skill-card:active { transform: scale(.97); }
.skill-card-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
@media (hover: hover) and (pointer: fine) { .skill-card:hover { border-color: var(--accent); background: var(--hover); } }
.cmd-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; }
.cmd-group { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding-top: 6px; }
.cmd-group > .tiny { padding: 0 8px 2px; }
.cmd { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 6px 8px; border-radius: 8px; border: 0; background: transparent; color: var(--text); cursor: pointer; text-align: left; font-size: 13px; }
.cmd b { flex-shrink: 0; }
.cmd .muted { min-width: 0; }
@media (hover: hover) and (pointer: fine) { .cmd:hover { background: var(--hover); } }
@media (max-width: 640px) { .skill-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cmd-list { grid-template-columns: 1fr; } }

/* ---- Prompt library -------------------------------------------------------------------- */
.prompt-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; max-height: min(52vh, 440px); overflow-y: auto; }
.prompt-row { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--border); background: transparent; color: var(--text); text-align: left; width: 100%; min-width: 0; }
.prompt-list .prompt-row:last-child { border-bottom: 0; }
.prompt-empty .prompt-row { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 6px; cursor: pointer; }
.prompt-use { border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; padding: 4px 2px; min-width: 0; }
@media (hover: hover) and (pointer: fine) { .prompt-row:hover { background: var(--hover); } }
.prompt-preview { white-space: pre-wrap; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); max-height: 200px; overflow-y: auto; }
.aria-user .user-save { align-self: flex-end; opacity: 0; transition: opacity 160ms ease; }
.aria-user:hover .user-save, .aria-user .user-save:focus-visible { opacity: 1; }
@media (hover: none) { .aria-user .user-save { opacity: .6; } }
.att-chip .fc-icon.ctx { font-size: 0; }

/* ---- Pictures -------------------------------------------------------------------------- */
.img-results { display: grid; gap: 10px; margin: 4px 0 10px; max-width: 560px; }
.img-results.multi { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 720px; }
.img-result { margin: 0; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: var(--surface); }
.img-frame { display: block; width: 100%; padding: 0; border: 0; background: var(--surface-2); cursor: zoom-in; object-fit: cover; border-radius: 0; }
.img-frame img { object-fit: cover !important; }
.img-result figcaption { display: flex; align-items: center; gap: 8px; padding: 8px 10px; }

/* ---- Rating and memory ----------------------------------------------------------------- */
.aria-foot .rate.on { color: var(--accent); background: var(--accent-soft); }
.learned { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 6px 6px 12px; border-radius: 12px; font-size: 12.5px;
  background: var(--accent-soft); color: var(--text-2); }
.learned > svg { color: var(--accent); flex-shrink: 0; }
.learned i { font-style: normal; color: var(--text); }
.mem-row { display: flex; align-items: center; gap: 6px; padding: 7px 6px; border-bottom: 1px solid var(--border); min-width: 0; }
.mem-row > span.grow { min-width: 0; overflow-wrap: anywhere; }

/* ---- Several skills at once ------------------------------------------------------------ */
.skill-card.on { border-color: var(--accent); background: var(--accent-soft); }
.skill-card.on .skill-card-ic { background: var(--accent); color: var(--bg); }
.skill-grid.tools .skill-card { padding: 12px; }
.skill-grid.tools .skill-card-ic { width: 30px; height: 30px; }
.chip.add-skill { padding: 0 8px; }

/* ---- Files ARIA makes ------------------------------------------------------------------ */
.file-card-ai { align-items: flex-start; }
.file-card-ai.writing { opacity: .85; }
.file-peek { margin-top: 12px; max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface-2); font-size: 13px; }
.file-peek.code { font-family: var(--font-mono); white-space: pre-wrap; margin-bottom: 0; }
.file-peek.table-wrap { padding: 0; }
.file-peek table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.file-peek th, .file-peek td { border-bottom: 1px solid var(--border); padding: 6px 10px; text-align: left; white-space: nowrap; }
.file-peek th { background: var(--surface); font-weight: 600; position: sticky; top: 0; }

/* The chat list: a name and, under it, ARIA's one-line summary. */
.chat-name { display: flex; flex-direction: column; min-width: 0; gap: 1px; font-size: 13.5px; text-align: left; }
.chat-sum { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.list-item.active .chat-sum { color: var(--text-2); }
