body { font-family: "Segoe UI", sans-serif; margin: 0; padding: 0 16px 40px; background: #f6f7f9; color: #222; }
header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid #ddd; }
.auth-banner {
  flex: 1 1 100%;
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #92400e;
  font-size: 0.9rem;
  line-height: 1.45;
}
.auth-banner.hidden { display: none !important; }
.auth-banner.err { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.auth-banner.ok { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }
h1 { font-size: 1.25rem; margin: 0; }
.site-header-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.site-title { letter-spacing: -0.02em; }
.chat-launch-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px 9px 14px;
  border-radius: 999px;
  background: linear-gradient(145deg, #12d17a 0%, #06c755 45%, #00a84a 100%);
  color: #fff;
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1;
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow:
    0 2px 10px rgba(6, 199, 85, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.chat-launch-btn:hover {
  color: #fff;
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow:
    0 6px 18px rgba(6, 199, 85, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.chat-launch-btn:active {
  transform: translateY(0);
  filter: brightness(0.98);
}
.chat-launch-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.12);
}
.chat-launch-img {
  display: block;
  width: 26px;
  height: 26px;
  object-fit: contain;
}
.chat-launch-arrow {
  font-size: 1rem;
  opacity: 0.9;
  margin-left: -2px;
}
a.chat-link { font-size: 0.85rem; font-weight: normal; margin-left: 10px; }
#authBox { display: flex; gap: 8px; align-items: center; }
#apiKey { width: 220px; padding: 6px; }
.tabs { display: flex; gap: 4px; margin: 12px 0; flex-wrap: wrap; }
.tabs button { padding: 8px 14px; border: 1px solid #ccc; background: #fff; cursor: pointer; border-radius: 6px; }
.tabs button.active { background: #2563eb; color: #fff; border-color: #2563eb; }
.panel { display: none; background: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.panel.active { display: block; }
label { display: block; margin: 8px 0; font-size: 0.9rem; }
input, select, textarea { margin-top: 4px; padding: 6px; max-width: 100%; box-sizing: border-box; }
button { margin-top: 8px; padding: 8px 16px; cursor: pointer; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 0.9rem; }
th, td { border-bottom: 1px solid #eee; padding: 8px; text-align: left; }
.mono-mid { font-family: Consolas, "Courier New", monospace; font-size: 0.78rem; word-break: break-all; }
.acc-active-star { color: #2563eb; font-weight: 700; margin-left: 2px; }
.acc-actions { white-space: nowrap; }
.acc-actions button { margin: 2px 4px 2px 0; padding: 4px 10px; font-size: 0.8rem; }
.mono { font-family: Consolas, monospace; font-size: 0.85rem; white-space: pre-wrap; background: #f0f0f0; padding: 10px; border-radius: 6px; max-height: 360px; overflow: auto; }
.pin { font-size: 1.8rem; letter-spacing: 0.2em; color: #0a0; font-weight: bold; }
.hint { color: #666; font-size: 0.85rem; }
details { margin: 12px 0; padding: 8px; border: 1px solid #eee; border-radius: 6px; }
#jobList { list-style: none; padding: 0; }
#jobList li { padding: 8px; border-bottom: 1px solid #eee; cursor: pointer; }
#jobList li:hover { background: #f5f5ff; }
header label.inline { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; margin: 0; }
#activeAccount { min-width: 160px; margin-top: 0; }
.hidden { display: none !important; }
.join-form { margin-top: 12px; padding: 12px; border: 1px solid #dbeafe; background: #f8fafc; border-radius: 8px; }
.question-label { font-weight: 600; color: #1e40af; white-space: pre-wrap; }
.chat-list { max-height: 320px; overflow: auto; border: 1px solid #eee; border-radius: 6px; padding: 8px; margin: 8px 0; }
.chat-list label { display: flex; align-items: flex-start; gap: 8px; padding: 6px 28px 6px 4px; border-bottom: 1px solid #f0f0f0; cursor: pointer; position: relative; }
.unread-badge { display: inline-block; min-width: 1.1em; padding: 1px 6px; margin-left: 4px; border-radius: 999px; background: #ef4444; color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 1.3; }
.chat-list .unread-badge { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); margin-left: 0; }
.chat-list label:hover { background: #fafafa; }
.chat-list label.chat-admin {
  background: linear-gradient(90deg, #fffbeb 0%, #fff 28%);
  border-left: 4px solid #d97706;
  padding-left: 8px;
}
.chat-list label.chat-admin-co {
  border-left-color: #2563eb;
  background: linear-gradient(90deg, #eff6ff 0%, #fff 28%);
}
.role-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
}
.role-badge.admin { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.role-badge.co_admin { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.join-pending-badge { color: #b45309; font-size: 0.8rem; font-weight: 600; margin-left: 4px; }
.admin-panel {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  background: #fffbeb;
}
.join-request-list { margin-top: 10px; }
.join-request-list table { font-size: 0.85rem; }
.join-request-list .btn-sm { padding: 4px 10px; margin: 0 4px 0 0; font-size: 0.8rem; }
.jr-toolbar, .jr-pager { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; align-items: center; }
.jr-search-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; margin: 0; }
.jr-search { min-width: 200px; max-width: 280px; padding: 6px 8px; margin: 0; border: 1px solid #cbd5e1; border-radius: 6px; }
.jr-search:focus { outline: 2px solid #2563eb; border-color: #2563eb; }
.btn-primary-sm { background: #06c755; color: #fff; border: none; border-radius: 6px; cursor: pointer; }
.btn-primary-sm:hover { background: #05a847; }
.jr-th-check { width: 2.2rem; text-align: center; }
.jr-wrap table { width: 100%; font-size: 0.85rem; }
.chat-list .mid { font-size: 0.75rem; color: #888; font-family: Consolas, monospace; }
.err { color: #b91c1c; }
.msg-feed { margin-top: 10px; max-height: 420px; overflow: auto; border: 1px solid #e5e7eb; border-radius: 8px; background: #fafafa; }
.msg-feed table { width: 100%; font-size: 0.85rem; margin: 0; }
.msg-feed td, .msg-feed th { padding: 6px 8px; vertical-align: top; }
.msg-out { background: #ecfdf5; }
.msg-in { background: #fff; }
.msg-read { color: #047857; font-weight: 600; white-space: nowrap; }
label.inline { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; }


