:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #e7eaf2;
  background: #11141b;
  font-synthesis: none;
  --muted: #99a4b9;
  --edge: #293140;
  --mint: #a8f0d1;
}
* { box-sizing: border-box; }
[v-cloak] { display: none !important; }
body { margin: 0; }
button, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
button:focus-visible, textarea:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
#app { display: grid; grid-template-columns: auto minmax(0, 1fr); height: 100dvh; }
#app > main { grid-column: 2; }
.sidebar { display: flex; flex-direction: column; width: 258px; min-height: 0; padding: 22px 16px; background: #171c25; border-right: 1px solid var(--edge); }
.sidebar-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .02em; margin: 0 6px 28px; }
.sidebar .brand { margin: 0 0 16px; }
.project-picker { flex: none; min-width: 0; margin: 0 0 14px; padding-bottom: 11px; border-bottom: 1px solid var(--edge); }
.project-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 5px 4px 8px; color: var(--muted); font-size: .76rem; font-weight: 650; }
.project-add { width: 28px; height: 28px; padding: 0; font-size: 1rem; }
.project-list { display: grid; gap: 2px; max-height: min(24dvh, 240px); overflow: auto; }
.project-choice { display: flex; align-items: center; width: 100%; min-width: 0; gap: 10px; padding: 8px; color: inherit; background: transparent; border: 1px solid transparent; border-radius: 8px; text-align: left; font-size: .86rem; }
.project-choice > span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.project-choice:hover { background: #252f3d; }
.project-choice[aria-pressed="true"] { color: var(--mint); border-color: #365247; background: #20372f; }
.project-icon { position: relative; flex: none; width: 15px; height: 11px; border: 1px solid currentColor; border-radius: 2px; }
.project-icon-folder::before { content: ""; position: absolute; top: -4px; left: -1px; width: 7px; height: 3px; border: 1px solid currentColor; border-bottom: 0; border-radius: 2px 2px 0 0; }
.project-icon-chat::after { content: ""; position: absolute; bottom: -3px; left: 2px; width: 3px; height: 4px; border-left: 1px solid currentColor; transform: skew(-22deg); }
.mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--mint); background: #20372f; font: 700 15px ui-monospace, monospace; }
.new, .thread, .quiet, .connection, .suggestions button { color: inherit; background: transparent; border: 1px solid transparent; border-radius: 9px; }
.new { text-align: left; padding: 10px 12px; border-color: var(--edge); background: #202735; }
.new:hover, .suggestions button:hover, .connection:hover { border-color: #64748a; }
.side-label { color: var(--muted); padding: 15px 8px 7px; font-size: .8rem; }
nav { overflow-y: auto; flex: 1; min-height: 0; }
nav p { padding: 0 8px; }
.thread { display: block; text-align: left; width: 100%; padding: 9px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .88rem; }
.thread:hover, .thread[aria-current] { background: #252f3d; }
.thread-row { display: flex; align-items: center; min-width: 0; gap: 3px; }
.thread-row .thread { flex: 1; min-width: 0; }
.thread-rename, .thread-delete, .attach-button { flex: none; color: var(--muted); background: transparent; border: 1px solid var(--edge); border-radius: 8px; padding: 6px 8px; line-height: 1.15; }
.thread-rename, .thread-delete { border-color: transparent; }
.thread-rename:hover:not(:disabled) { color: var(--mint); background: #20372f; }
.thread-delete:hover:not(:disabled) { color: #ffb5aa; background: #412c33; }
.attach-button:hover:not(:disabled) { color: var(--mint); border-color: var(--mint); }
.workspace { color: var(--muted); font: .72rem ui-monospace, monospace; padding: 15px 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
main { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; min-height: 0; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--edge); padding: 16px 24px; font-size: .9rem; }
.top-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.top-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-context { flex: none; max-width: 144px; overflow: hidden; padding: 3px 7px; border-radius: 6px; background: #252038; color: #d9cafb; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.menu-toggle { display: grid; place-items: center; flex: none; width: 34px; height: 34px; padding: 0; font-size: 1rem; color: inherit; background: #202838; border: 1px solid var(--edge); border-radius: 8px; }
.menu-toggle:hover { border-color: #64748a; }
.top-actions { display: flex; gap: 6px; align-items: center; flex: none; }
.connection { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 9px; color: var(--muted); font-size: .8rem; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: #d8ac70; }
.connection i.live { background: var(--mint); }
.conversation { min-height: 0; overflow: auto; }
.empty { max-width: 760px; padding: 36px 20px; min-height: 100%; margin: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.hero { width: 66px; height: 66px; border-radius: 20px; font-size: 26px; border: 1px solid #3d6c58; }
h1 { font-size: clamp(1.7rem, 4vw, 3rem); letter-spacing: -.045em; margin: 20px 0 0; }
.empty p { color: var(--muted); line-height: 1.6; max-width: 420px; }
.suggestions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.suggestions button { padding: 9px 12px; border-color: var(--edge); background: #181e28; font-size: .84rem; }
.suggestions span { color: var(--mint); margin-left: 5px; }
.transcript, .composer-wrap { max-width: 860px; margin: 0 auto; padding: 20px 24px; }
.transcript { display: flex; flex-direction: column; gap: 20px; }
.message { align-self: stretch; min-width: 0; padding: 12px 0; }
.message.user { align-self: flex-end; max-width: min(100%, 680px); min-width: min(190px, 100%); padding: 12px 16px; border: 1px solid var(--edge); border-radius: 14px; background: #1b2330; }
.message-head { display: flex; justify-content: space-between; gap: 16px; min-height: 28px; align-items: center; color: var(--mint); font-size: .8rem; font-weight: 650; }
.message-text { line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-link { color: var(--mint); text-decoration-thickness: 1px; text-underline-offset: .18em; }
.message-link:hover { color: #fff; }
.message-images, .message-files, .attachments { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.message-file { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; max-width: 100%; gap: 3px; margin: 4px 0; }
.message-images img, .message-files img, .message-file img { display: block; width: auto; max-width: 100%; max-height: 280px; object-fit: contain; border: 1px solid var(--edge); border-radius: 10px; }
.save-file { padding-inline: 0; align-self: flex-start; }
.attachment-name { display: block; max-width: 160px; padding: 8px 24px 8px 8px; overflow-wrap: anywhere; }
.image-link { min-width: 0; color: var(--mint); overflow-wrap: anywhere; }
.image-link span { display: block; margin-top: 4px; }
.attachment { position: relative; width: 70px; height: 60px; }
.attachment img { width: 100%; height: 100%; object-fit: cover; border: 1px solid var(--edge); border-radius: 8px; }
.attachment button { position: absolute; top: 3px; right: 3px; border: 0; border-radius: 50%; color: #fff; background: #11141be6; width: 24px; height: 24px; padding: 0; }
.quiet { color: var(--muted); padding: 4px 6px; font-size: .75rem; }
.quiet:hover { color: #fff; background: #253043; }
.older { align-self: center; }
.message pre { background: #0c1016; border: 1px solid var(--edge); border-radius: 9px; padding: 12px; overflow-x: auto; line-height: 1.5; }
.muted { color: var(--muted); font-size: .84rem; }
.composer-wrap { padding-top: 8px; }
.composer { padding: 12px; background: #1a212d; border: 1px solid #384457; border-radius: 16px; }
textarea { display: block; width: 100%; padding: 5px 7px; background: transparent; border: 0; color: inherit; resize: vertical; max-height: 30dvh; }
textarea::placeholder { color: var(--muted); }
.composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; }
.composer-actions > span { color: var(--muted); font-size: .75rem; padding-left: 7px; }
.model-select { flex: 0 1 220px; min-width: 0; }
.effort-select { flex-basis: 150px; }
.model-select select { width: 100%; min-width: 0; padding: 7px 9px; border: 1px solid #384457; border-radius: 8px; color: inherit; background: #202838; font: inherit; font-size: .82rem; text-overflow: ellipsis; }
.model-select select:focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }
.model-select select:disabled { opacity: .65; }
.send, .stop { margin-left: auto; flex: none; border: 0; border-radius: 9px; padding: 8px 12px; color: #0e261b; background: var(--mint); font-size: .85rem; font-weight: 650; }
.send span { padding-left: 6px; }
.stop { background: #ffd0b5; color: #3b2019; }
.notice { color: #ffd1ac; font-size: .86rem; line-height: 1.5; overflow-wrap: anywhere; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-panel { width: min(100%, 380px); display: block; padding: 24px; border: 1px solid var(--edge); border-radius: 16px; background: #171c25; }
.login-panel .brand { margin: 0 0 20px; }
.login-panel h1 { margin: 0 0 20px; font-size: 1.65rem; }
.login-panel form { display: grid; gap: 10px; }
.login-panel label { font-size: .86rem; color: var(--muted); }
.login-panel input { min-width: 0; margin-bottom: 6px; padding: 10px; font: inherit; color: inherit; background: #11141b; border: 1px solid #384457; border-radius: 8px; }
.login-panel input:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.login-panel .send { margin: 6px 0 0; padding: 10px; }
.limits-trigger { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 8px; border: 1px solid #365247; color: var(--mint); background: #20372f; font-size: .8rem; white-space: nowrap; }
.limits-trigger:hover { border-color: var(--mint); }
.limits-trigger:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.limits-icon { position: relative; flex: none; width: 15px; height: 15px; border: 1.5px solid currentColor; border-bottom-color: transparent; border-radius: 50%; }
.limits-icon::after { content: ""; position: absolute; top: 6px; left: 6px; width: 5px; height: 1.5px; border-radius: 2px; background: currentColor; transform: rotate(-49deg); transform-origin: left center; }
.limits-preview { display: grid; grid-template-columns: auto auto auto; gap: 2px 6px; font-size: .72rem; line-height: 1.2; font-variant-numeric: tabular-nums; text-align: left; }
.limits-preview-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
.limits-reset { color: var(--muted); }
.limits-dialog { width: min(440px, calc(100% - 24px)); max-height: 85dvh; padding: 22px; color: inherit; background: #171c25; border: 1px solid var(--edge); border-radius: 16px; }
.limits-dialog::backdrop { background: #080b11aa; }
.limits-header, .limit-summary { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.limits-header h2 { margin: 0; font-size: 1.2rem; }
.limits-bucket { border-top: 1px solid var(--edge); margin-top: 16px; padding-top: 12px; }
.limits-bucket h3 { margin: 0 0 8px; font-size: .95rem; }
.limit-window { display: grid; gap: 6px; padding: 5px 0 9px; font-size: .84rem; }
.limit-window progress { width: 100%; height: 8px; accent-color: var(--mint); }
.limits-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.limits-refresh { margin-left: auto; }
.delete-message { overflow-wrap: anywhere; line-height: 1.55; }
.delete-actions { display: flex; justify-content: flex-end; gap: 10px; }
.name-form { display: grid; gap: 10px; margin-top: 16px; }
.name-form input { min-width: 0; padding: 8px 10px; font: inherit; color: inherit; background: #11141b; border: 1px solid var(--edge); border-radius: 8px; }
.name-form > p { margin: 0; }
.name-submit { margin-left: 0; }
.delete-confirm { border: 0; border-radius: 8px; padding: 8px 12px; color: #321812; background: #ffb5aa; font-size: .85rem; font-weight: 650; }
@media (max-width: 650px) {
  #app { grid-template-columns: minmax(0, 1fr); }
  #app > main { grid-column: 1; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 3; width: min(300px, 86vw); padding: 12px; }
  .sidebar-heading { margin-bottom: 12px; }
  .sidebar .brand { margin: 0; }
  .sidebar .side-label { padding-top: 15px; }
  .sidebar .workspace { display: none; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 2; background: #080b11aa; }
  .top { min-height: 43px; padding: 4px 8px; gap: 6px; font-size: .82rem; }
  .top-heading, .top-actions { gap: 5px; }
  .top-context { display: none; }
  .top .menu-toggle { width: 32px; height: 32px; }
  .top .connection { position: relative; display: grid; place-items: center; width: 22px; height: 32px; padding: 0; }
  .top .connection-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .top .limits-trigger { min-height: 32px; padding: 3px 5px; }
  .top .limits-icon { display: none; }
  .top .limits-preview { gap: 1px 4px; font-size: .65rem; }
  .top .quiet { min-height: 32px; padding: 3px; font-size: .7rem; }
  .transcript { padding-inline: 12px; }
  .composer-wrap { padding: 5px 8px max(8px, env(safe-area-inset-bottom)); }
  .composer { padding: 7px; border-radius: 12px; }
  .composer textarea { padding: 3px 5px; }
  .composer-actions { gap: 4px; margin-top: 5px; }
  .composer-actions > span { display: none; }
  .composer-actions :is(.attach-button, .send, .stop, select) { min-height: 32px; padding: 4px 6px; font-size: .72rem; }
  .composer-actions .send span { padding-left: 3px; }
}
