.cs-panel [hidden],
.cs-hours [hidden],
.cs-launch[hidden] {
  display: none !important;
}

.cs-launch,
.cs-panel,
.cs-panel button,
.cs-panel textarea,
.cs-hours,
.cs-hours button {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.cs-hours {
  background: #9a3412;
  color: #fff;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 750;
  line-height: 1.5;
  padding: 0.7rem 1rem;
}

.cs-hours button {
  margin: 0 0.3rem;
  border: 0;
  border-radius: 6px;
  background: #fff;
  color: #9a3412;
  font-size: 1.15rem;
  font-weight: 750;
  padding: 0.12rem 0.55rem;
  cursor: pointer;
}

.cs-launch {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 40;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.85rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: #1a56db;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(26, 86, 219, 0.28);
}

.cs-launch:hover { background: #1648b8; }

.cs-badge {
  min-width: 1.2rem;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: #fff;
  color: #1a56db;
  font-size: 0.75rem;
  line-height: 1.2rem;
  text-align: center;
}

.cs-panel {
  position: fixed;
  right: 1.25rem;
  bottom: 5rem;
  z-index: 41;
  display: flex;
  flex-direction: column;
  width: min(420px, calc(100vw - 1.5rem));
  height: min(620px, calc(100vh - 7rem));
  background: #fff;
  color: #1c2128;
  border: 1px solid #e2e6eb;
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(28, 33, 40, 0.16);
}

.cs-panel.cs-wide {
  width: min(880px, calc(100vw - 2rem));
  height: min(660px, calc(100vh - 4rem));
  left: 50%;
  right: auto;
  bottom: 2rem;
  transform: translateX(-50%);
}

.cs-panel[hidden] { display: none; }

.cs-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0.9rem 0.7rem;
  border-bottom: 1px solid #e2e6eb;
}

.cs-head strong {
  display: block;
  font-size: 1.25rem;
}

.cs-head p {
  margin: 0.15rem 0 0;
  color: #5b6570;
  font-size: 0.82rem;
}

.cs-id {
  margin: 0.2rem 0 0;
  color: #1c2128;
  font-size: 0.82rem;
  font-weight: 650;
}

.cs-hide {
  flex: none;
  align-self: flex-start;
  padding: 0.4rem 0.75rem;
  border: 1px solid #c5ced8;
  border-radius: 6px;
  background: #fff;
  color: #1c2128;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.cs-hide:hover { background: #f4f6f8; }

.cs-log {
  flex: 1;
  overflow: auto;
  padding: 0.85rem;
}

.cs-empty {
  margin: 1.5rem 0.4rem;
  color: #5b6570;
  font-size: 0.9rem;
}

.cs-msg {
  max-width: 85%;
  margin: 0 0 0.7rem;
}

.cs-msg p {
  margin: 0.15rem 0 0;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.cs-who {
  color: #5b6570;
  font-size: 0.75rem;
}

.cs-msg img {
  display: block;
  max-width: 100%;
  margin-top: 0.15rem;
  border-radius: 8px;
}

.cs-me { margin-left: auto; }
.cs-me p { background: #1a56db; color: #fff; }
.cs-staff p { background: #f4f6f8; border: 1px solid #e2e6eb; }
.cs-staff p a { font-weight: 750; }

.cs-note {
  margin: 0.2rem 0 0;
  color: #9a6700;
  font-size: 0.75rem;
  font-style: normal;
}

.cs-error {
  margin: 0;
  padding: 0.45rem 0.75rem 0;
  color: #9a3412;
  font-size: 0.8rem;
}

.cs-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid #e2e6eb;
}

.cs-file {
  align-self: flex-end;
  padding: 0.5rem 0.7rem;
  border: 1px solid #e2e6eb;
  border-radius: 6px;
  background: #fff;
  color: #1c2128;
  font-size: 0.88rem;
  cursor: pointer;
}

.cs-file input { display: none; }

.cs-picked {
  align-self: flex-end;
  max-width: 5rem;
  overflow: hidden;
  color: #5b6570;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-form textarea {
  flex: 1;
  resize: none;
  padding: 0.5rem 0.6rem;
  border: 1px solid #e2e6eb;
  border-radius: 6px;
  color: #1c2128;
  font-size: 0.92rem;
}

.cs-form button {
  align-self: flex-end;
  padding: 0.5rem 0.8rem;
  border: 0;
  border-radius: 6px;
  background: #1a56db;
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}

.cs-form button:hover { background: #1648b8; }

.cs-top-alert {
  display: inline-block;
  margin-left: 0.45rem;
  padding: 0.05rem 0.5rem;
  border-radius: 999px;
  background: #fff;
  color: #9a3412;
  font-size: 0.9rem;
}

.cs-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.3rem;
}

.cs-actions a,
.cs-mini {
  flex: none;
  align-self: flex-start;
  padding: 0.35rem 0.5rem;
  border: 1px solid #c5ced8;
  border-radius: 6px;
  background: #fff;
  color: #1c2128;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.cs-actions a:hover,
.cs-mini:hover { background: #f4f6f8; }

.cs-tabs {
  display: flex;
  border-bottom: 1px solid #e2e6eb;
}

.cs-tabs button {
  flex: 1;
  padding: 0.55rem 0.4rem;
  border: 0;
  background: #fff;
  color: #5b6570;
  font-weight: 700;
  cursor: pointer;
}

.cs-tabs button.on {
  color: #1a56db;
  box-shadow: inset 0 -2px 0 #1a56db;
}

.cs-chat,
.cs-acct {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cs-chat { flex: 1; }
.cs-acct { flex: 1; overflow: auto; padding: 0.75rem; }
.cs-chat[hidden],
.cs-acct[hidden] { display: none; }

.cs-hint {
  margin: 0.45rem 0.75rem 0;
  color: #5b6570;
  font-size: 0.78rem;
}

.cs-nick,
.cs-bind,
.cs-authbox {
  display: flex;
  gap: 0.4rem;
  padding: 0.45rem 0.75rem 0;
}

.cs-acct .cs-nick,
.cs-acct .cs-bind,
.cs-acct .cs-authbox { padding: 0; margin-bottom: 0.6rem; }

.cs-nick input,
.cs-bind input,
.cs-bind select,
.cs-authbox input {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  border: 1px solid #e2e6eb;
  border-radius: 6px;
  font: inherit;
  font-size: 0.9rem;
}

.cs-older {
  margin: 0.45rem 0.75rem 0;
  padding: 0.25rem 0.5rem;
  border: 0;
  background: transparent;
  color: #1a56db;
  font-size: 0.8rem;
  cursor: pointer;
}

.cs-card,
.cs-box {
  margin: 0 0 0.65rem;
  padding: 0.7rem;
  border: 1px solid #e2e6eb;
  border-radius: 8px;
  background: #fff;
}

.cs-card.soon { border-color: #d97706; }
.cs-card.expired { border-color: #b91c1c; }

.cs-card strong,
.cs-box strong { display: block; }

.cs-card p,
.cs-box p { margin: 0.25rem 0 0; color: #5b6570; font-size: 0.85rem; }

.cs-box input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.4rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid #e2e6eb;
  border-radius: 6px;
  font: inherit;
}

.cs-card .cs-warn { color: #9a3412; font-weight: 700; }

.cs-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.cs-row button,
.cs-box button,
.cs-bind button,
.cs-nick button,
.cs-authbox button {
  padding: 0.4rem 0.65rem;
  border: 0;
  border-radius: 6px;
  background: #1a56db;
  color: #fff;
  font-weight: 650;
  cursor: pointer;
}

.cs-row button.cs-ghost,
.cs-box button.cs-ghost {
  background: #fff;
  color: #1c2128;
  border: 1px solid #c5ced8;
}

.cs-light {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.78);
}

.cs-light[hidden] { display: none; }

.cs-light img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 8px;
}

.cs-me img { margin-left: auto; }

body.cs-standalone { margin: 0; background: #eef2f6; }
body.cs-standalone .cs-launch,
body.cs-standalone .cs-hours { display: none; }

body.cs-standalone .cs-panel,
body.cs-standalone .cs-panel.cs-wide {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  transform: none;
  width: min(960px, 100%);
  height: 100vh;
  margin: 0 auto;
  border-radius: 0;
  box-shadow: none;
}

@media (max-width: 720px) {
  body:not(.cs-standalone) .cs-panel,
  body:not(.cs-standalone) .cs-panel.cs-wide {
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    transform: none;
    border-radius: 0;
  }
}
