:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", sans-serif;
  font-size: 14px;
  color: #202b32;
  background: #e9eff1;
  --muted: #61717a;
  --line: #8299a52b;
  --accent: #1965b9;
  --green: #1965b9;
  --soft: #edf5fc;
  --glass: #ffffffa8;
  --shadow: 0 16px 48px #263e4b0d, inset 0 1px 0 #ffffffed;
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; min-height: 100dvh; background: linear-gradient(125deg, #e1eeee 0%, #e9eff1 43%, #f1e6e2 100%); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { outline-offset: 3px; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #247cc4; }
button { transition: background .18s, box-shadow .18s, transform .18s; }
button:hover { background-color: #ffffffd9; }
button:active:not(:disabled) { transform: scale(.97); }
button:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 26px; font-weight: 650; }
h2 { font-size: 20px; font-weight: 650; }
.muted { color: var(--muted); line-height: 1.65; }
.error { color: #a23234; line-height: 1.65; font-size: 13px; overflow-wrap: anywhere; }
.error:empty { display: none; }
svg.lucide { width: 19px; height: 19px; flex: none; stroke-width: 1.8; }
.icon-button { border: 1px solid transparent; background: transparent; width: 44px; height: 44px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.icon-button:hover { background: #ffffff9e; border-color: #ffffff; box-shadow: 0 3px 12px #29455409; }
.plain { background: transparent; border: 0; border-radius: 8px; padding: 9px 11px; color: var(--accent); min-height: 40px; }
.primary { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 46px; border: 1px solid #ffffff30; border-radius: 14px; padding: 11px 20px; background: #1965b9; color: white; font-weight: 600; box-shadow: 0 4px 12px #1959921f, inset 0 1px 0 #ffffff30; }
.primary:hover { background: #125ba9; }
.primary.destructive { background: #ab333c; }
label { font-size: 13px; }
input:not([type=checkbox]), textarea, select { width: 100%; min-width: 0; border: 1px solid #bdcbd48c; border-radius: 12px; background: #ffffff8c; padding: 12px 14px; font-size: 16px; }
input::placeholder, textarea::placeholder { color: #73848c; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
select { cursor: pointer; }
.app { height: 100dvh; display: grid; grid-template-columns: 306px minmax(0, 1fr); overflow: hidden; }
aside { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid #ffffffb8; background: #edf4f473; backdrop-filter: blur(32px) saturate(1.5); -webkit-backdrop-filter: blur(32px) saturate(1.5); padding: 24px 16px 0; box-shadow: inset -1px 0 0 #728c9a12; }
.sidebar-head, .sidebar-foot, .workspace-actions, .connection-line, .list-heading, .compose-bottom, .compose-actions, .picker-head, .picker-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sidebar-head { margin-bottom: 22px; gap: 8px; }
.wordmark { display: flex; align-items: center; gap: 12px; font-size: 21px; font-weight: 650; }
.wordmark>img { width: 27px; height: 27px; flex: none; }
.wordmark span { display: block; color: var(--muted); font-size: 10px; font-weight: 450; margin-top: 3px; }
.workspace-actions { gap: 8px; }
.new-chat { display: flex; align-items: center; justify-content: center; gap: 6px; flex: none; padding: 0 10px; white-space: nowrap; font-size: 12px; min-height: 44px; background: #ffffff99; border: 1px solid #fff; border-radius: 14px; font-weight: 600; box-shadow: 0 4px 14px #30424c08; }
.new-chat svg { width: 17px; height: 17px; }
.sidebar-tools { display: flex; align-items: center; gap: 2px; }
.sidebar-tools .enabled { color: #187953; background: #e1f5eb; }
.connection-line { flex: 1; min-width: 0; flex-direction: column; align-items: flex-end; gap: 0; margin: 0; font-size: 10px; color: #39705d; text-align: right; overflow-wrap: anywhere; }
.connection-line .plain { font-size: 10px; padding: 2px 0; min-height: 26px; }
.search-wrap { position: relative; flex: 1; min-width: 0; }
.search-wrap>svg { position: absolute; left: 13px; top: 13px; color: #71838d; width: 17px; height: 17px; }
.search-wrap input { padding-left: 39px; font-size: 13px; min-height: 44px; background: #d4e0e24a; border-color: #ffffff70; }
.list-heading { margin: 18px 4px 8px; gap: 6px; }
.list-heading h2 { margin: 0; font-size: 12px; color: #5d717c; font-weight: 600; }
.archive { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.list-filters { display: flex; align-items: center; gap: 6px; }
.list-filters select { width: auto; min-height: 36px; padding: 5px 2px; font-size: 11px; color: var(--muted); background: transparent; border: 0; }
.sessions { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 3px 0 12px; }
.session { display: block; width: 100%; text-align: left; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 15px 12px; margin: 0 0 5px; }
.session:hover { background: #ffffff7a; }
.session.selected { background: #ffffffc4; border-color: #fff; box-shadow: 0 4px 16px #304e6008; }
.session strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 550; }
.session.selected strong { color: #20548a; }
.session small { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; font-size: 10px; color: var(--muted); }
.session-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
.session-heading strong { flex: 1; min-width: 0; }
.session { -webkit-touch-callout: none; user-select: none; touch-action: pan-y; }
.session-pin { flex: none; font-size: 10px; color: var(--accent); }
.session-actions > button { display: block; width: 100%; min-height: 48px; text-align: left; }
.session-actions > p { overflow-wrap: anywhere; }
.session-indicator { display: block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #2476bb; }
.session-indicator.running { width: 13px; height: 13px; background: transparent; border: 2px solid #2476bb40; border-top-color: #2476bb; animation: session-spin 1s linear infinite; }
@keyframes session-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .session-indicator.running { animation: none; } }
.session small span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session time { flex: none; }
.project-group>summary { padding: 12px 10px; cursor: pointer; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.project-group .session { padding-left: 20px; }
.host-errors { padding: 0 6px; font-size: 12px; white-space: pre-wrap; }
.sidebar-foot { padding: 12px 4px max(16px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sidebar-foot>span { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); }
.sidebar-foot svg { width: 16px; height: 16px; }
main { position: relative; min-width: 0; min-height: 0; background: #ffffff25; }
.welcome { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center; padding: 28px; }
.welcome h1 { font-size: 25px; margin: 26px 0 12px; }
.welcome .primary { margin-top: 14px; }
.app-icon { width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; border-radius: 24px; background: linear-gradient(140deg, #ffffffeb, #ffffff57); border: 1px solid #fff; box-shadow: 0 12px 28px #4c657414, inset 0 1px 2px #fff; backdrop-filter: blur(20px); }
.app-icon svg { width: 35px; height: 35px; stroke-width: 1.5; }
.chat { position: relative; height: 100%; display: flex; flex-direction: column; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 16px; min-height: 89px; padding: 18px 36px; border-bottom: 1px solid #ffffffb3; background: #ffffff48; backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); flex: none; }
#back { display: none; }
.chat-info { flex: 1; min-width: 0; }
.chat-info h1 { font-size: 17px; margin: 0 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-info .muted { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { font-size: 11px; border: 1px solid #ffffffc7; color: #206245; background: #e2f4eab3; border-radius: 20px; padding: 7px 11px; white-space: nowrap; flex: none; }
.status.offline { color: #685e42; background: #f4eed8a8; }
.notice { display: flex; gap: 10px; align-items: center; padding: 10px 26px; background: #fff4dc8c; color: #765d22; font-size: 12px; flex: none; }
.notice span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.notice button { flex: none; font-size: 12px; }
.timeline { flex: 1; min-height: 0; overflow: auto; padding: 32px max(28px, calc((100% - 820px)/2)); overflow-anchor: none; overscroll-behavior: contain; scrollbar-gutter: stable; }
.timeline-row { margin-bottom: 14px; }
.message { font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.message.user { margin-left: 6%; border: 1px solid #ffffffb3; border-radius: 8px; background: #ffffff94; padding: 10px 12px; box-shadow: 0 3px 12px #3c546006; }
.who { display: block; color: #6b7c87; font-size: 10px; font-weight: 650; margin-bottom: 9px; }
.assistant-avatar { display: block; width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: #fff; border: 1px solid var(--line); margin-bottom: 6px; }
.activity-group { color: #62737e; font-size: 12px; border-bottom: 1px solid var(--line); }
.activity-group > summary { cursor: pointer; min-height: 44px; padding: 12px 0; line-height: 20px; }
.activity-label { display: inline-block; max-width: calc(100% - 52px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; }
.activity-spinner { display: inline-block; width: 13px; height: 13px; margin-left: 10px; vertical-align: middle; border-radius: 50%; border: 2px solid #62737e40; border-top-color: #62737e; animation: session-spin 1s linear infinite; }
.activity-spinner[hidden] { display: none; }
.activity-items { padding-left: 16px; }
.activity-items > .activity { margin-bottom: 0; }
.activity-items > .activity:last-child { border-bottom: 0; }
@media (prefers-reduced-motion: reduce) { .activity-spinner { animation: none; } }
.message-body { min-width: 0; white-space: pre-wrap; }
.message.error { color: #a23234; }
.activity { color: #62737e; font-size: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.activity summary { cursor: pointer; overflow-wrap: anywhere; line-height: 1.65; }
.activity-body { max-height: 55dvh; overflow: auto; padding: 14px; background: #ffffff73; border-radius: 8px; line-height: 1.7; white-space: pre-wrap; }
.activity:not([open]) .activity-body, .activity:not([open]) .detail-more { display: none; }
.detail-more { display: block; margin-top: 8px; font-size: 12px; }
.history { display: block; margin: 0 auto 20px; font-size: 12px; }
.newer { position: absolute; bottom: 228px; align-self: center; z-index: 2; border: 1px solid #fff; border-radius: 24px; background: #ffffffe6; backdrop-filter: blur(16px); box-shadow: 0 4px 18px #203e511a; color: var(--accent); padding: 10px 18px; font-size: 12px; }
.working { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; padding: 12px 0; }
.working i { width: 7px; height: 7px; background: #509277; border-radius: 50%; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.composer { flex: none; margin: 0 max(22px, calc((100% - 860px)/2)) max(18px, env(safe-area-inset-bottom)); padding: 13px 17px 9px; border-radius: 24px; border: 1px solid #ffffffed; background: #ffffffa8; box-shadow: var(--shadow), 0 1px 3px #314e6710; backdrop-filter: blur(32px) saturate(1.5); -webkit-backdrop-filter: blur(32px) saturate(1.5); }
.composer-tools { display: flex; align-items: center; justify-content: flex-end; gap: 3px; flex: 1; min-width: 0; }
.composer-tools .tool-button { padding: 5px 7px; min-width: 0; }
.composer-tools #model-button { flex: 0 1 auto; max-width: 150px; text-overflow: ellipsis; }
.composer-tools #skills-button { flex: none; }
.composer-tools .attach-button { width: 30px; height: 34px; min-width: 30px; }
.tool-button { background: #edf2f598; border: 1px solid #ffffffc9; border-radius: 20px; padding: 7px 11px; min-height: 32px; color: #546b7c; font-size: 11px; max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.skill-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-pill { border: 0; border-radius: 16px; color: #246a52; background: #dcefe6; padding: 6px 9px; margin-top: 8px; font-size: 11px; }
.composer textarea { min-height: 44px; max-height: none; border: 0; background: transparent; padding: 8px 1px 6px; resize: none; font-size: 15px; line-height: 1.6; }
.composer-resize { display: flex; align-items: center; justify-content: center; width: 100%; height: 24px; margin: -9px 0 2px; cursor: ns-resize; touch-action: none; user-select: none; border-radius: 8px; }
.composer-resize::after { content: ''; width: 38px; height: 4px; border-radius: 4px; background: #73848c70; }
.composer-resize:hover::after, .composer-resize:focus-visible::after { background: var(--accent); }
.composer-resize:focus-visible { outline: 3px solid #247cc4; outline-offset: 1px; }
.compose-bottom { gap: 4px; }
.compose-bottom select { width: 60px; flex: none; padding: 7px 2px; border: 0; background-color: transparent; color: var(--muted); font-size: 12px; }
.compose-actions { gap: 4px; flex: none; }
.send-button { padding: 0; width: 40px; height: 40px; min-height: 40px; border-radius: 50%; }
.stop { background: #f4e7e5; color: #a63b3b; }
.stop svg { width: 15px; height: 15px; }
.approval { background: #f9faf6d9; border: 1px solid #e4d4ac; border-radius: 8px; padding: 20px; margin: 20px 0; box-shadow: 0 5px 16px #75643f08; }
.approval h3 { margin: 0 0 12px; font-size: 16px; color: #715b29; }
.approval p { font-size: 13px; line-height: 1.7; }
.approval pre { white-space: pre-wrap; word-break: break-word; font-size: 12px; line-height: 1.65; }
.approval label { display: block; margin: 15px 0; line-height: 1.7; }
.approval select, .approval textarea { margin-top: 9px; max-width: 100%; display: block; }
.approval .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.approval button { min-height: 44px; }
.queue-card { border-left: 2px solid #7495ae; padding: 12px 16px; margin: 18px 0; background: #f2f7f98c; }
.queue-card strong { font-size: 12px; }
.queue-card p { font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0; }
.picker { width: min(calc(100% - 32px), 480px); max-height: calc(100dvh - 48px); margin: auto; padding: 25px; border: 1px solid #fffffff2; border-radius: 24px; color: inherit; background: #f6f9faf0; box-shadow: 0 30px 100px #182d4240, inset 0 1px 1px white; backdrop-filter: blur(40px) saturate(1.4); -webkit-backdrop-filter: blur(40px) saturate(1.4); overflow: auto; }
.picker::backdrop { background: #233c4b38; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.picker-head { margin-bottom: 18px; }
.picker-head h2 { margin: 0; font-size: 20px; }
.picker-head .icon-button { background: #d7e1e84f; width: 36px; height: 36px; }
.picker label { display: block; margin: 18px 0; font-weight: 500; }
.picker label input, .picker label select { margin-top: 8px; }
.picker p { font-size: 13px; line-height: 1.65; }
.picker .primary { width: 100%; }
.picker-actions { margin-top: 18px; }
.picker-actions .plain { flex: none; }
.eyebrow { display: block; color: var(--muted); font-size: 10px; margin-bottom: 7px; }
.skill-list { max-height: 45dvh; overflow: auto; margin-top: 15px; }
.skill-option { display: flex !important; gap: 12px; padding: 14px 8px; margin: 0 !important; border-bottom: 1px solid var(--line); cursor: pointer; }
.skill-option input { flex: none; margin: 3px 0 0; }
.skill-option strong, .skill-option small { display: block; overflow-wrap: anywhere; }
.skill-option strong { font-size: 13px; }
.skill-option small { color: var(--muted); font-size: 11px; line-height: 1.65; margin-top: 5px; }
.device-summary { display: flex; align-items: center; color: #28634f; padding: 10px 14px; background: #e6f1ed; border-radius: 8px; }
.device-list { max-height: 43dvh; overflow: auto; margin-bottom: 20px; }
.device-row { display: flex; align-items: center; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.device-row>div { flex: 1; min-width: 0; }
.device-row strong, .device-row small, .device-row span { display: block; overflow-wrap: anywhere; }
.device-row strong { font-size: 13px; margin-bottom: 4px; }
.device-row small { font-size: 11px; line-height: 1.8; color: var(--muted); }
.device-row span { font-size: 11px; margin-bottom: 4px; }
.device-row button { flex: none; min-height: 44px; font-size: 12px; }
.danger { color: #a43b3b; }
#qr-panel { text-align: center; margin-top: 20px; }
#login-qr { display: block; width: min(100%, 256px); height: auto; aspect-ratio: 1; margin: 0 auto; border-radius: 8px; }
#qr-expiry { margin: 12px 0 5px; }
#notification-body { overflow-wrap: anywhere; }
.toast { position: fixed; z-index: 30; bottom: max(26px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); max-width: min(92%, 520px); padding: 13px 20px; border: 1px solid #ffffffb8; border-radius: 18px; background: #21313fe8; color: white; backdrop-filter: blur(20px); box-shadow: 0 6px 26px #18364d26; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; padding: 30px 22px; }
.login-brand { display: flex; align-items: center; gap: 10px; align-self: flex-start; font-weight: 600; font-size: 15px; }
.login-card { width: min(100%, 388px); margin: auto 0; padding: 42px 0; }
.login-card .app-icon { margin-bottom: 26px; }
.login h1 { font-size: 27px; line-height: 1.4; margin-bottom: 12px; }
.login form { margin-top: 30px; }
.login label { display: block; margin: 18px 0; color: #435865; }
.login label input { margin-top: 9px; background: #ffffff9e; border-color: #ffffffdb; box-shadow: inset 0 1px 2px #4a657509; min-height: 50px; }
.login .primary { width: 100%; justify-content: space-between; margin-top: 14px; min-height: 50px; }
.login-foot { display: flex; gap: 7px; align-items: center; color: var(--muted); font-size: 11px; padding-bottom: env(safe-area-inset-bottom); }
.login-foot svg { width: 13px; height: 13px; }

.artifact-image { display: block; width: 100%; height: clamp(72px, 18dvh, 150px); object-fit: contain; border-radius: 6px; margin: 0; background: #ffffff70; }
.artifact-preview { display: block; min-width: 0; color: var(--accent); }
.artifact-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin: 6px 0; }
.artifact-gallery figure { margin: 0; min-width: 0; }
.artifact-gallery .artifact-picture { width: 100%; margin: 0; }
.artifact-gallery figcaption { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.image-unavailable { display: block; padding: 18px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; }
.artifact-browser { display: block; height: auto; min-height: 100dvh; padding: 28px; max-width: 1280px; margin: auto; }
.artifact-tile { min-width: 0; color: var(--accent); padding: 12px; border: 1px solid var(--line); border-radius: 8px; overflow-wrap: anywhere; }
.artifact-tile img { display: block; width: 100%; height: 320px; object-fit: contain; margin-bottom: 10px; }
.attachment-list { margin-top: 6px; }
.artifact-picture { display: inline-block; vertical-align: top; width: calc(50% - 4px); min-width: 0; margin: 3px 4px 3px 0; }.image-download { display: inline-flex; align-items: center; font-size: 11px; text-decoration: none; min-height: 28px; padding: 2px 4px; }.image-download-all { display: inline-flex; align-items: center; margin-top: 6px; min-height: 32px; background: #ffffffa8; border: 1px solid var(--line); text-decoration: none; }.artifact-tile>a { overflow-wrap: anywhere; }
.artifact-preview { cursor: zoom-in; }
.image-viewer { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 0; border: 0; border-radius: 0; background: #111; overflow: hidden; cursor: zoom-out; }
.image-viewer::backdrop { background: #111; }
.image-viewer img { display: block; width: 100%; height: 100%; object-fit: contain; }
.image-viewer-close { position: absolute; right: max(16px, env(safe-area-inset-right)); top: max(16px, env(safe-area-inset-top)); color: #fff; background: #242424cc; border: 1px solid #ffffff60; padding: 8px 14px; min-height: 40px; }
.attach-button { width: 34px; height: 34px; color: var(--accent); }
.upload-list { display: flex; gap: 8px; overflow-x: auto; max-height: 150px; }
.upload-list:not(:empty) { padding: 10px 0; }
.upload-item { display: flex; align-items: center; flex: 0 0 220px; min-width: 0; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: #ffffff9c; }
.upload-item>img { width: 44px; height: 44px; object-fit: cover; border-radius: 4px; }
.upload-preview { display: block; flex: none; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: #ffffffa8; }
.upload-preview img { display: block; width: 100%; height: 100%; object-fit: cover; }
.upload-info { min-width: 0; flex: 1; }.upload-info strong,.upload-info small { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.upload-info small { margin-top: 4px; }.upload-info progress { width: 100%; height: 4px; accent-color: var(--accent); }.upload-item .icon-button { width: 30px; height: 36px; }
.markdown-body { white-space: normal; overflow-wrap: anywhere; min-width: 0; container-type: inline-size; }
@container (min-width: 560px) { .artifact-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }.artifact-picture { width: calc(33.333% - 4px); }.artifact-gallery .artifact-picture { width: 100%; } }
.markdown-body>:first-child { margin-top: 0; }.markdown-body>:last-child { margin-bottom: 0; }
.markdown-body p, .markdown-body ul, .markdown-body ol, .markdown-body blockquote, .markdown-body pre, .markdown-table { margin: 0 0 8px; }
.markdown-body h1, .markdown-body h2, .markdown-body h3, .markdown-body h4, .markdown-body h5, .markdown-body h6 { margin: 16px 0 8px; font-weight: 650; line-height: 1.4; }
.markdown-body h1 { font-size: 24px; }.markdown-body h2 { font-size: 21px; }.markdown-body h3 { font-size: 18px; }.markdown-body h4, .markdown-body h5, .markdown-body h6 { font-size: 15px; }
.markdown-body ul, .markdown-body ol { padding-left: 24px; }.markdown-body li { margin: 5px 0; }.markdown-body li>ul, .markdown-body li>ol { margin: 6px 0; }.markdown-body li>p { margin: 6px 0; }
.markdown-body blockquote { border-left: 3px solid #8eafbd; padding: 3px 0 3px 14px; margin-left: 0; margin-right: 0; color: #586f7a; }.markdown-body blockquote>:last-child { margin-bottom: 0; }
.markdown-body hr { border: 0; border-top: 1px solid var(--line); margin: 22px 0; }
.markdown-body code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; background: #e1eaf073; border-radius: 4px; padding: 2px 5px; }
.markdown-body pre { max-width: 100%; line-height: 1.65; word-break: normal; overflow-wrap: normal; overflow: auto; background: #ffffff85; border: 1px solid #ffffffb3; border-radius: 8px; padding: 15px; }.markdown-body pre code { font-size: inherit; background: none; padding: 0; border-radius: 0; }
.markdown-table { max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.markdown-body table { border-collapse: collapse; width: 100%; font-size: 13px; line-height: 1.65; word-break: normal; overflow-wrap: normal; }
.markdown-body th, .markdown-body td { padding: 10px 12px; min-width: 100px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.markdown-body th { background: #e5eef3a8; font-weight: 600; }.markdown-body tr:last-child td { border-bottom: 0; }
.markdown-body .align-left { text-align: left; }.markdown-body .align-center { text-align: center; }.markdown-body .align-right { text-align: right; }
.math-display { display: block; max-width: 100%; overflow-x: auto; overflow-y: hidden; margin: 16px 0; white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.math-display .katex-display { margin: 0; padding: 6px 0; text-align: left; }.math-display .katex-display>.katex { text-align: left; }
.markdown-body .katex { font-size: 1.1em; }.math-number { display: inline-block; margin-left: 16px; color: var(--muted); }

@media (max-width: 760px) {
  .app { display: block; }
  aside { height: 100dvh; border: 0; padding: max(22px, env(safe-area-inset-top)) 19px 0; }
  .sidebar-head { margin-bottom: 22px; }
  main { display: none; height: 100dvh; }
  .app.chat-open aside { display: none; }.app.chat-open main { display: block; }
  #back { display: inline-flex; margin-left: -8px; }
  .chat-head { padding: max(12px, env(safe-area-inset-top)) 16px 12px; min-height: 75px; gap: 8px; }
  .chat-info h1 { font-size: 15px; }.chat-info .muted { font-size: 10px; }
  .status { max-width: 86px; overflow: hidden; text-overflow: ellipsis; padding: 6px 9px; font-size: 10px; }
  .timeline { padding: 14px 15px; scrollbar-gutter: auto; }
  .message.user { margin-left: 4%; padding: 9px 11px; }
  .composer { margin: 0 10px max(10px, env(safe-area-inset-bottom)); border-radius: 23px; padding: 12px 13px 9px; }
  .composer textarea { font-size: 16px; }
  .newer { bottom: 225px; font-size: 11px; }
  .notice { padding: 9px 15px; gap: 7px; font-size: 11px; }.notice>svg { display: none; }.notice .plain { padding: 5px; }
  .session { padding: 18px 13px; }.session strong { font-size: 14px; }.session small { font-size: 11px; }
  .picker { padding: 22px; width: calc(100% - 24px); max-height: calc(100dvh - 30px); }
  .approval { padding: 17px; }.approval .primary { flex: 1; }
  .login-brand { align-self: center; }.login h1 { font-size: 26px; }
}
@media (max-width: 360px) { .chat-info h1 { font-size: 14px; }.picker { padding: 18px; }.device-row { gap: 6px; }.device-row .plain { padding: 8px 4px; }.login h1 { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
@media (prefers-reduced-transparency: reduce) { aside, .composer, .chat-head, .picker { background: #f2f6f8; backdrop-filter: none; -webkit-backdrop-filter: none; } }
@supports not (backdrop-filter: blur(1px)) { aside, .composer, .chat-head, .picker { background: #f2f6f8; } }

/* BDUAN_USER_ALIGNMENT_START */
.message.user { width: fit-content; max-width: 85%; box-sizing: border-box; margin-left: auto; margin-right: 0; text-align: left; border-radius: 16px; }
/* Inline-size containment hides the text's intrinsic width from the shrink-to-fit bubble. */
.message.user .markdown-body { container-type: normal; }
@media (max-width: 760px) { .message.user { max-width: 90%; margin-left: auto; } }
/* BDUAN_USER_ALIGNMENT_END */
