:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17212b;
  background: #f3f6f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --green: #157a55;
  --green-dark: #0f6042;
  --line: #dce4e8;
  --muted: #65727c;
  --card: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; }
button, input, textarea { font: inherit; }
button { cursor: pointer; }
.shell { width: min(1440px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 64px; }
.topbar, .section-heading, .button-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.topbar { margin-bottom: 24px; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 1.15rem; letter-spacing: -.015em; }
.eyebrow { margin: 0 0 6px; color: var(--green); font-size: .7rem; font-weight: 800; letter-spacing: .12em; }
.panel { min-width: 0; margin-bottom: 18px; padding: 22px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); box-shadow: 0 8px 28px #1c34400a; }
.panel > p { margin: 12px 0 0; color: var(--muted); line-height: 1.55; }
.login-panel { max-width: 480px; }
.form-grid { display: grid; gap: 14px; margin-top: 20px; }
label { display: grid; gap: 7px; color: #33414b; font-size: .88rem; font-weight: 650; }
input, textarea { width: 100%; padding: 11px 12px; border: 1px solid #cbd6dc; border-radius: 9px; color: #17212b; background: #fff; outline: none; }
input:focus, textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px #157a551a; }
.button { min-height: 40px; padding: 9px 14px; border: 1px solid var(--green); border-radius: 9px; color: white; background: var(--green); font-size: .88rem; font-weight: 700; }
.button:hover { background: var(--green-dark); }
.button-secondary { color: #175e46; background: #eef7f3; border-color: #c4e5d6; }
.button-secondary:hover { background: #e0f1e9; }
.button-quiet { color: #35434c; background: #fff; border-color: var(--line); }
.button-quiet:hover { background: #f5f8f9; }
.button-danger { color: #922e32; background: #fff; border-color: #e4bfc1; }
.button-danger:hover { background: #fff6f6; }
.button-row { justify-content: flex-start; flex-wrap: wrap; margin-top: 16px; }
.notice { padding: 12px 14px; border: 1px solid #d3e5ef; border-radius: 10px; background: #f2f9fc; color: #294451; font-size: .9rem; line-height: 1.45; }
.notice-safe { margin-bottom: 18px; border-color: #d2e8dc; background: #f1f8f4; color: #24563f; }
.error { border-color: #e8c3c3; background: #fff5f5; color: #8e2b2f; }
.muted { color: var(--muted); }
.badge { display: inline-flex; align-items: center; min-height: 28px; padding: 4px 10px; border-radius: 999px; background: #edf1f3; color: #52616c; font-size: .76rem; font-weight: 750; white-space: nowrap; }
.badge.good { background: #e5f5ec; color: #17633f; }
.badge.warn { background: #fff2d8; color: #805b15; }
.badge.bad { background: #fde9e9; color: #8a2b31; }
.workspace { display: grid; grid-template-columns: minmax(300px, .8fr) minmax(0, 1.2fr); align-items: start; gap: 18px; }
.conversation-list { display: grid; gap: 8px; margin-top: 15px; }
.conversation-item { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 11px; text-align: left; background: white; }
.conversation-item:hover, .conversation-item.selected { border-color: #8fc9ac; background: #f5fbf7; }
.conversation-item strong, .conversation-item small, .conversation-item span { display: block; overflow-wrap: anywhere; }
.conversation-item small { margin: 4px 0 8px; color: var(--muted); }
.conversation-item span { color: #33414b; font-size: .86rem; line-height: 1.4; }
.conversation-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.messages { display: flex; flex-direction: column; gap: 10px; min-height: 220px; max-height: 54vh; overflow: auto; margin: 16px 0; padding: 14px; border-radius: 11px; background: #f4f7f8; }
.message { max-width: min(90%, 620px); padding: 10px 12px; border: 1px solid #d8e0e4; border-radius: 12px 12px 12px 4px; background: #fff; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.45; }
.message.out { align-self: flex-end; border-color: #c7e5d4; border-radius: 12px 12px 4px 12px; background: #e9f7ef; }
.message small { display: block; margin-top: 7px; color: var(--muted); font-size: .72rem; }
.reply-form { display: grid; gap: 9px; }
.alerts { display: grid; gap: 8px; margin-top: 14px; }
.alert-item { padding: 10px 12px; border: 1px solid #ecd4a5; border-radius: 9px; background: #fff9ea; color: #694e1d; font-size: .86rem; }
.qr-wrap { display: grid; justify-items: start; gap: 10px; margin-top: 18px; padding: 16px; border: 1px dashed #bdcbd1; border-radius: 12px; }
.qr-wrap img { width: min(280px, 100%); height: auto; image-rendering: pixelated; }
.qr-wrap p { margin: 0; color: var(--muted); font-size: .84rem; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 900px) { .workspace { grid-template-columns: 1fr; } .messages { max-height: 50vh; } }
@media (max-width: 600px) { .shell { width: min(100% - 24px, 1440px); padding-top: 22px; } .panel { padding: 16px; border-radius: 13px; } .button-row .button { flex: 1 1 145px; } .topbar { align-items: flex-start; } }
