html { background: #f1f0ec; color: #262626; font-family: Arial, Helvetica, sans-serif; font-size: 16px; }
body { margin: 0; padding: 24px 14px; }
#widget { max-width: 620px; margin: 0 auto; background: #fff; border: 1px solid #d1d0ca; border-radius: 8px; padding: 24px; }
.header { min-height: 64px; border-bottom: 2px solid #262626; padding-bottom: 18px; margin-bottom: 22px; }
.header img { float: right; width: 96px; height: auto; margin-left: 16px; }
h1 { margin: 2px 0 8px; font-size: 27px; line-height: 1.2; }
h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.3; }
p { margin: 0 0 16px; line-height: 1.6; }
#status { margin: 0; color: #595959; font-size: 14px; }
form { margin-top: 20px; }
label { display: block; font-weight: bold; margin-bottom: 8px; font-size: 15px; }
input, textarea { width: 94%; width: 100%; box-sizing: border-box; padding: 11px; border: 1px solid #93938e; border-radius: 4px; font: inherit; line-height: 1.5; background: #fff; color: #262626; }
textarea { resize: vertical; }
button { display: block; margin-top: 12px; min-height: 44px; padding: 11px 20px; border: 1px solid #262626; border-radius: 4px; background: #262626; color: #fff; font: inherit; font-weight: bold; cursor: pointer; }
button:hover { background: #454545; }
button:disabled { background: #767676; border-color: #767676; cursor: default; }
input:focus, textarea:focus, button:focus { outline: 2px solid #2365aa; outline-offset: 2px; }
#notice { padding: 12px; border-left: 3px solid #9a3434; background: #fff2ef; color: #842626; font-weight: bold; font-size: 14px; }
#notice:empty { display: none; }
#messages { height: 320px; overflow: auto; border: 1px solid #d8d7d1; border-radius: 4px; padding: 14px; background: #faf9f6; }
.message { margin: 0 24px 14px 0; padding: 12px 14px; border: 1px solid #deddd7; border-left: 3px solid #777; border-radius: 4px; background: #fff; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.customer { margin-right: 0; margin-left: 24px; border-color: #cbd7e6; border-left-color: #2365aa; background: #edf3fa; }
.system { margin: 0 0 18px; padding: 0 0 14px; border: 0; border-bottom: 1px solid #deddd7; border-radius: 0; color: #595959; font-size: 14px; background: none; }
.message strong, .message small { display: block; }
.message strong { margin-bottom: 4px; font-size: 14px; }
.message small { margin-top: 7px; color: #626262; font-size: 12px; }
#identity, #typing, .footer { font-size: 14px; }
#history-note { color: #626262; font-size: 13px; }
#identity { padding-bottom: 10px; margin-bottom: 12px; color: #595959; word-wrap: break-word; }
#typing { min-height: 20px; margin: 8px 0 0; color: #626262; }
.footer { margin: 24px 0 0; border-top: 1px solid #deddd7; padding-top: 14px; color: #626262; font-size: 12px; }
@media screen and (max-width: 400px) { body { padding: 0; } #widget { padding: 16px; border: 0; border-radius: 0; } #messages { height: 260px; padding: 10px; } .message { margin-right: 12px; padding: 10px; } .customer { margin-right: 0; margin-left: 12px; } .system { margin-right: 0; } }

/* Browsers without system dark-mode support keep the original light palette. */
html { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  html { background: #121212; color: #e8e8e8; }
  #widget, .message { background: #1e1e1e; border-color: #444; }
  .header { border-bottom-color: #888; }
  #status, #history-note, #identity, #typing, .footer,
  .message small, .system { color: #b0b0b0; }
  input, textarea { background: #292929; color: #e8e8e8; border-color: #666; }
  input:focus, textarea:focus, button:focus { outline-color: #9cc6ff; }
  button { background: #333; border-color: #888; }
  button:hover { background: #454545; }
  button:disabled { background: #444; border-color: #555; color: #bbb; }
  #notice { background: #382222; color: #ffaaaa; border-left-color: #d88; }
  #messages { background: #181818; border-color: #444; }
  .customer { background: #1e2c40; border-color: #3b5578; border-left-color: #9cc6ff; }
  .system { background: transparent; border-bottom-color: #444; }
  .footer { border-top-color: #444; }
}
