* { box-sizing: border-box; }
body { margin: 0; font-family: "Yu Gothic UI", "Meiryo", system-ui, sans-serif; color: #1f2933; background: #f4f6f8; height: 100vh; display: flex; flex-direction: column; }
[hidden] { display: none !important; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: #0b5394; color: #fff; }
.brand { font-weight: 700; font-size: 18px; line-height: 1.3; }
.brand .sub { display: block; font-weight: 400; font-size: 12px; opacity: .85; }
.who { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.who button { background: transparent; color: #fff; border: 1px solid #fff8; border-radius: 4px; padding: 3px 10px; cursor: pointer; }
.center { margin: auto; text-align: center; padding: 24px; }
.muted { color: #6b7785; font-size: 13px; }
button.primary { background: #0b5394; color: #fff; border: 0; border-radius: 6px; padding: 10px 22px; font-size: 15px; cursor: pointer; }
button.primary:disabled { background: #9fb3c8; cursor: default; }
#chat { flex: 1; display: flex; flex-direction: column; min-height: 0; width: 100%; max-width: 900px; margin: 0 auto; padding: 8px 12px 12px; }
.notice { background: #fff8e1; border: 1px solid #f0d98a; border-radius: 6px; padding: 6px 10px; font-size: 12px; margin-bottom: 8px; }
.toolbar { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-bottom: 8px; }
.toolbar select { padding: 4px; }
.toolbar button { margin-left: auto; padding: 4px 10px; cursor: pointer; }
.log { flex: 1; overflow-y: auto; padding: 4px; }
.msg { display: flex; margin: 10px 0; }
.msg.user { justify-content: flex-end; }
.bubble { max-width: 85%; padding: 10px 14px; border-radius: 10px; line-height: 1.7; word-break: break-word; background: #fff; border: 1px solid #dde3ea; }
.msg.user .bubble { background: #d9eafc; border-color: #b8d6f5; white-space: pre-wrap; }
.bubble ol, .bubble ul { margin: 6px 0; padding-left: 22px; }
.bubble p { margin: 6px 0; }
.bubble code { background: #eef1f4; padding: 0 4px; border-radius: 3px; }
.sources { margin-top: 8px; font-size: 12px; color: #52606d; border-top: 1px dashed #cbd2d9; padding-top: 6px; }
.actions { margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.actions button, .actions a { font-size: 12px; padding: 3px 10px; border: 1px solid #cbd2d9; border-radius: 4px; background: #fff; cursor: pointer; color: #1f2933; text-decoration: none; }
.actions button.on { background: #d9eafc; border-color: #0b5394; }
.actions .mail { background: #fff3e0; border-color: #f0b35a; }
.form { display: flex; gap: 8px; margin-top: 8px; }
.form textarea { flex: 1; padding: 8px; font: inherit; border: 1px solid #b6c0cb; border-radius: 6px; resize: vertical; }
.typing { color: #6b7785; font-style: italic; }
