* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, sans-serif; background: #f4f5f7; color: #111; }
header.top { background: #111827; color: #fff; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; }
header.top a { color: #93c5fd; margin-right: 12px; }
main { max-width: 900px; margin: 20px auto; padding: 0 16px; }
.card { background: #fff; border-radius: 10px; padding: 18px; margin-bottom: 16px; box-shadow: 0 1px 4px #0001; }
h2 { margin-top: 0; font-size: 18px; }
label { display: block; font-size: 13px; margin-bottom: 10px; }
input, textarea, select { display: block; width: 100%; padding: 8px 10px; margin-top: 4px; border: 1px solid #ccc; border-radius: 6px; font: inherit; }
input[type=color] { height: 40px; padding: 2px; }
button { padding: 8px 14px; border: 0; border-radius: 6px; background: #2563eb; color: #fff; cursor: pointer; font: inherit; }
button.danger { background: #dc2626; }
button.ghost { background: #e5e7eb; color: #111; }
.item { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.login { max-width: 340px; margin: 80px auto; }
[hidden] { display: none !important; }
.desk { display: grid; grid-template-columns: 300px 1fr; gap: 12px; padding: 12px; height: calc(100vh - 62px); }
.desk .card { margin: 0; overflow-y: auto; }
.ticket { cursor: pointer; }
.ticket.selected { border-color: #2563eb; background: #eff6ff; }
.chat { display: flex; flex-direction: column; }
#log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 10px 0; }
.msg { max-width: 75%; padding: 8px 12px; border-radius: 10px; background: #f1f5f9; align-self: flex-start; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.agent { background: #dbeafe; align-self: flex-end; }
.msg.system { background: none; align-self: center; color: #666; font-size: 12px; }
.msg small { display: block; color: #666; font-size: 11px; }
#reply { display: flex; gap: 8px; } #reply input { margin: 0; }
@media (max-width: 700px) { .desk { grid-template-columns: 1fr; height: auto; } .chat { min-height: 70vh; } }
