* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; background: #0d1117; height: 100vh; color: #c9d1d9; }
.app { display: flex; flex-direction: column; height: 100vh; max-width: 900px; margin: 0 auto; background: #161b22; border-left: 1px solid #30363d; border-right: 1px solid #30363d; }
header { display: flex; justify-content: space-between; align-items: center; padding: 16px 24px; background: #0d1117; border-bottom: 1px solid #30363d; }
header h1 { font-size: 20px; font-weight: 600; color: #58a6ff; }
.status { font-size: 12px; color: #8b949e; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.new-session-btn { padding: 6px 14px; background: #21262d; color: #c9d1d9; border: 1px solid #30363d; border-radius: 6px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.new-session-btn:hover { background: #30363d; border-color: #484f58; }
.new-session-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.msg { max-width: 75%; padding: 12px 16px; border-radius: 8px; line-height: 1.6; font-size: 14px; word-wrap: break-word; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: #1f6feb; color: #fff; }
.msg.assistant { align-self: flex-start; background: #21262d; color: #c9d1d9; border: 1px solid #30363d; }
.msg.tool { align-self: flex-start; background: #1c1e24; color: #7ee787; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12px; border: 1px solid #238636; }
.msg.tool-call { align-self: flex-start; background: #1f1a2b; color: #d2a8ff; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12px; border: 1px dashed #a371f7; }
.msg.system { align-self: flex-start; background: #1c1e24; color: #8b949e; max-width: 90%; font-size: 12px; }
.msg.summary { align-self: flex-start; background: #161b22; color: #8b949e; border: 1px dotted #484f58; font-size: 12px; max-width: 90%; }
.msg.summary details > summary { color: #8b949e; font-size: 12px; }
.msg .markdown { white-space: normal; }
.msg .markdown p { margin: 0 0 10px; }
.msg .markdown p:last-child { margin-bottom: 0; }
.msg .markdown h1, .msg .markdown h2, .msg .markdown h3, .msg .markdown h4, .msg .markdown h5, .msg .markdown h6 { margin: 14px 0 8px; font-weight: 600; color: #f0f6fc; line-height: 1.3; }
.msg .markdown h1:first-child, .msg .markdown h2:first-child, .msg .markdown h3:first-child { margin-top: 0; }
.msg .markdown h1 { font-size: 20px; border-bottom: 1px solid #30363d; padding-bottom: 6px; }
.msg .markdown h2 { font-size: 17px; border-bottom: 1px solid #30363d; padding-bottom: 4px; }
.msg .markdown h3 { font-size: 15px; }
.msg .markdown h4, .msg .markdown h5, .msg .markdown h6 { font-size: 14px; }
.msg .markdown ul, .msg .markdown ol { margin: 0 0 10px; padding-left: 24px; }
.msg .markdown li { margin: 3px 0; }
.msg .markdown li > ul, .msg .markdown li > ol { margin-bottom: 0; }
.msg .markdown a { color: #58a6ff; text-decoration: none; }
.msg .markdown a:hover { text-decoration: underline; }
.msg .markdown blockquote { border-left: 3px solid #30363d; padding-left: 12px; color: #8b949e; margin: 0 0 10px; }
.msg .markdown code { background: rgba(110, 118, 129, 0.4); padding: 2px 5px; border-radius: 4px; font-family: 'SFMono-Regular', Consolas, monospace; font-size: 12px; }
.msg .markdown pre { background: #0d1117; border: 1px solid #30363d; border-radius: 6px; padding: 12px; margin: 0 0 10px; overflow-x: auto; }
.msg .markdown pre code { background: none; padding: 0; font-size: 12px; }
.msg .markdown hr { border: none; border-top: 1px solid #30363d; margin: 12px 0; }
.msg .markdown img { max-width: 100%; border-radius: 6px; }
.msg .markdown table { border-collapse: collapse; margin: 0 0 10px; font-size: 13px; display: block; overflow-x: auto; }
.msg .markdown th, .msg .markdown td { border: 1px solid #30363d; padding: 6px 10px; }
.msg .markdown th { background: #21262d; font-weight: 600; }
.msg .markdown .task-list-item input { margin-right: 6px; }
.msg.user .markdown a { color: #d7e5ff; }
.msg.user .markdown code { background: rgba(255, 255, 255, 0.18); }
.msg.user .markdown pre { background: rgba(0, 0, 0, 0.25); border-color: rgba(255, 255, 255, 0.2); }
.msg.user .markdown h1, .msg.user .markdown h2 { border-bottom-color: rgba(255, 255, 255, 0.25); }
.msg.user .markdown blockquote { border-left-color: rgba(255, 255, 255, 0.4); color: #e6edf7; }
.msg.user .markdown th, .msg.user .markdown td { border-color: rgba(255, 255, 255, 0.25); }
.msg.user .markdown th { background: rgba(255, 255, 255, 0.12); }
.msg details > summary { cursor: pointer; list-style: none; font-weight: 600; user-select: none; }
.msg details > summary::-webkit-details-marker { display: none; }
.msg details > summary::before { content: "\25B8 "; }
.msg details[open] > summary::before { content: "\25BE "; }
.msg.tool-call details > summary { color: #d2a8ff; }
.msg.tool details > summary { color: #7ee787; }
.msg details[open] > summary { margin-bottom: 8px; }
.context-size { font-size: 11px; color: #484f58; text-align: right; padding: 2px 4px 0; }
.input-bar { display: flex; gap: 10px; padding: 16px 20px; background: #0d1117; border-top: 1px solid #30363d; align-items: flex-end; }
.input-bar textarea { flex: 1; resize: none; border: 1px solid #30363d; border-radius: 8px; padding: 10px 14px; background: #0d1117; color: #c9d1d9; font-size: 14px; font-family: inherit; min-height: 42px; max-height: 120px; outline: none; }
.input-bar textarea:focus { border-color: #58a6ff; }
.send-btn { display: inline-block; padding: 10px 24px; background: #238636; color: #fff; border: 1px solid #2ea043; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.send-btn:hover { background: #2ea043; }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.welcome { text-align: center; padding: 80px 20px; color: #8b949e; }
.welcome h2 { color: #58a6ff; margin-bottom: 8px; font-size: 24px; }
.welcome p { font-size: 14px; }
.welcome .send-btn { margin-top: 12px; }
