:root{font-family:system-ui,Hiragino Sans,Noto Sans JP,sans-serif;color-scheme:light;--accent: #1a5276;--bg: #f0f2f5;--bubble-bg: #fff;--panel-bg: #fff;--text: #333;--shadow: 0 1px 2px rgba(0, 0, 0, .1)}:root[data-theme=dark]{color-scheme:dark;--bg: #1a2235;--bubble-bg: #2d3748;--panel-bg: #1a2235;--text: #e2e8f0;--shadow: 0 1px 2px rgba(0, 0, 0, .4)}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text)}.app{display:flex;flex-direction:column;height:100dvh}header{display:flex;justify-content:space-between;align-items:center;padding:.75rem 1rem;font-weight:600;background:var(--accent);color:#fff}.theme-switch{display:flex;align-items:center;gap:.4rem;font-size:.8rem;font-weight:400;cursor:pointer;-webkit-user-select:none;user-select:none}.theme-switch input{display:none}.theme-switch-track{position:relative;width:2.4rem;height:1.25rem;border-radius:.625rem;background:#ffffff4d;transition:background .2s}.theme-switch-track:after{content:"";position:absolute;top:.15rem;left:.15rem;width:.95rem;height:.95rem;border-radius:50%;background:#fff;transition:transform .2s}.theme-switch input:checked+.theme-switch-track{background:#ffffff8c}.theme-switch input:checked+.theme-switch-track:after{transform:translate(1.15rem)}.body{flex:1;display:flex;min-height:0}.sidebar{width:16rem;flex-shrink:0;display:flex;flex-direction:column;overflow:hidden;background:#1e293b;color:#cbd5e1;border-right:1px solid #0f172a}.chat{flex:1;min-width:0;display:flex;flex-direction:column}.sidebar-header{flex-shrink:0;padding:.875rem .75rem;border-bottom:1px solid #334155}.new-session{width:100%;font:inherit;font-size:.85rem;text-align:left;padding:.5rem .75rem;border:none;border-radius:.5rem;background:#334155;color:#e2e8f0;cursor:pointer}.new-session:hover{background:#475569}.session-list{flex:1;overflow-y:auto;list-style:none;margin:0;padding:.5rem 0}.session-list li{display:flex;align-items:center;gap:.4rem;margin:1px .375rem;border-radius:.375rem}.session-list li:hover,.session-list li.active{background:#334155}.session-open{flex:1;min-width:0;font:inherit;font-size:.82rem;text-align:left;padding:.5rem .75rem;border:none;background:none;color:inherit;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.session-delete{flex-shrink:0;font:inherit;font-size:.8rem;padding:.15rem .5rem .15rem 0;border:none;background:none;color:#64748b;cursor:pointer}.session-delete:hover{color:#ef4444}.messages{flex:1;overflow-y:auto;padding:1rem;display:flex;flex-direction:column;gap:.75rem}.empty{opacity:.6;text-align:center}.msg{padding:.6rem .9rem;border-radius:.75rem;max-width:85%;white-space:pre-wrap;word-break:break-word;line-height:1.6}.msg.user{align-self:flex-end;background:var(--accent);color:#fff}.msg.assistant{align-self:flex-start;background:var(--bubble-bg);box-shadow:var(--shadow)}.msg.pending{opacity:.6}.markdown{white-space:normal}.markdown>:first-child{margin-top:0}.markdown>:last-child{margin-bottom:0}.markdown pre{overflow-x:auto;padding:.6rem .8rem;border-radius:.5rem;background:color-mix(in srgb,currentColor 10%,transparent)}.markdown code{font-family:ui-monospace,monospace;background:color-mix(in srgb,currentColor 10%,transparent);padding:.1rem .3rem;border-radius:.3rem}.markdown pre code{background:none;padding:0}.markdown table{border-collapse:collapse}.markdown th,.markdown td{border:1px solid color-mix(in srgb,currentColor 25%,transparent);padding:.3rem .6rem}.markdown th{background:var(--accent);color:#fff}.tool-calls{display:flex;flex-direction:column;gap:.4rem;margin-bottom:.5rem}.tool-call{font-size:.85rem;border:1px solid color-mix(in srgb,currentColor 20%,transparent);border-radius:.5rem;padding:.3rem .6rem;background:color-mix(in srgb,currentColor 4%,transparent)}.tool-call summary{cursor:pointer;font-family:ui-monospace,monospace;opacity:.85}.tool-call-error{color:#d33}.tool-call-body{margin-top:.4rem}.tool-call-label{opacity:.6;font-size:.75rem;margin-top:.4rem}.tool-call pre{margin:.2rem 0 0;white-space:pre-wrap;word-break:break-word;font-size:.8rem}.error{color:#d33;font-size:.9rem}.composer{display:flex;gap:.5rem;padding:.75rem 1rem 1rem;border-top:1px solid color-mix(in srgb,currentColor 20%,transparent);background:var(--panel-bg)}.composer textarea{flex:1;resize:none;font:inherit;padding:.5rem .75rem;border-radius:.5rem;border:1px solid color-mix(in srgb,currentColor 25%,transparent);background:var(--bubble-bg);color:inherit}.composer button{font:inherit;padding:0 1.25rem;border-radius:.5rem;border:none;background:var(--accent);color:#fff;cursor:pointer}.composer button:disabled{opacity:.4;cursor:default}
