body
{
   background-color: #FFFFFF;
   color: #000000;
   font-family: Arial;
   font-weight: normal;
   font-size: 13px;
   line-height: 1.1875;
   margin: 0;
   padding: 0;
}
    * { box-sizing: border-box; }
    html, body { height: 100%; }
    body {
      margin: 0;
      font-family: Arial, sans-serif;
      background: linear-gradient(135deg, #0f172a, #1e293b);
      color: #e5e7eb;
      min-height: 100vh;
    }

    .app-shell {
      width: 100%;
      min-height: 100vh;
      padding: 18px;
      display: flex;
      justify-content: center;
      align-items: stretch;
    }

    .chat-app {
      width: min(1400px, 100%);
      min-height: calc(100vh - 36px);
      background: rgba(15, 23, 42, 0.95);
      border: 1px solid rgba(255,255,255,0.08);
      border-radius: 20px;
      overflow: hidden;
      display: grid;
      grid-template-columns: 280px 1fr 320px;
      box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    }

    .sidebar, .rightbar {
      background: rgba(255,255,255,0.04);
      padding: 16px;
      display: flex;
      flex-direction: column;
      gap: 14px;
      overflow-y: auto;
    }

    .sidebar { border-right: 1px solid rgba(255,255,255,0.08); }
    .rightbar { border-left: 1px solid rgba(255,255,255,0.08); }

    .brand {
      font-size: 22px;
      font-weight: bold;
      color: #60a5fa;
    }

    .panel {
      background: rgba(255,255,255,0.04);
      border-radius: 14px;
      padding: 14px;
    }

    .panel-title {
      font-size: 14px;
      opacity: 0.85;
      margin-bottom: 10px;
      font-weight: bold;
    }

    .hint {
      font-size: 12px;
      line-height: 1.45;
      color: #cbd5e1;
    }

    .notice {
      padding: 10px 12px;
      border-radius: 10px;
      font-size: 12px;
      line-height: 1.45;
      background: rgba(250, 204, 21, 0.12);
      border: 1px solid rgba(250, 204, 21, 0.24);
      color: #fde68a;
    }

    .notice.error {
      background: rgba(239, 68, 68, 0.12);
      border-color: rgba(239, 68, 68, 0.24);
      color: #fecaca;
    }

    .notice.ok {
      background: rgba(34, 197, 94, 0.12);
      border-color: rgba(34, 197, 94, 0.24);
      color: #dcfce7;
    }

    input, textarea, button { font: inherit; }

    .input, .textarea {
      width: 100%;
      padding: 11px 12px;
      border-radius: 10px;
      border: 1px solid rgba(255,255,255,0.1);
      background: rgba(0,0,0,0.2);
      color: white;
      outline: none;
    }

    .textarea {
      min-height: 74px;
      resize: vertical;
    }

    .stack {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .row {
      display: flex;
      gap: 8px;
      align-items: center;
    }

    .row-wrap {
      display: flex;
      gap: 8px;
      flex-wrap: wrap;
    }

    .btn {
      padding: 10px 14px;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      color: white;
      background: #2563eb;
      font-weight: bold;
    }

    .btn.secondary {
      background: rgba(255,255,255,0.12);
      color: #e5e7eb;
    }

    .btn.green { background: #16a34a; }
    .btn.red { background: #dc2626; }

    .btn.small {
      padding: 8px 10px;
      font-size: 12px;
    }

    .btn:disabled {
      opacity: 0.6;
      cursor: not-allowed;
    }

    .room-btn, .user-btn, .mode-btn {
      width: 100%;
      margin-top: 8px;
      padding: 10px 12px;
      border: none;
      border-radius: 10px;
      background: rgba(96,165,250,0.15);
      color: #dbeafe;
      cursor: pointer;
      text-align: left;
      transition: 0.2s;
    }

    .room-btn:hover, .room-btn.active,
    .user-btn:hover, .user-btn.active,
    .mode-btn:hover, .mode-btn.active {
      background: #2563eb;
      color: white;
    }

    .main {
      display: flex;
      flex-direction: column;
      min-width: 0;
      min-height: 0;
    }

    .chat-header {
      padding: 18px 20px;
      border-bottom: 1px solid rgba(255,255,255,0.08);
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: rgba(255,255,255,0.02);
      gap: 16px;
    }

    .chat-header h2 {
      margin: 0;
      font-size: 20px;
    }

    .status {
      font-size: 13px;
      color: #93c5fd;
    }

    .status.error { color: #fca5a5; }

    .messages {
      flex: 1;
      min-height: 0;
      padding: 20px;
      overflow-y: auto;
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .message {
      max-width: 78%;
      padding: 12px 14px;
      border-radius: 16px;
      line-height: 1.4;
      word-wrap: break-word;
      box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    }

    .message .meta {
      font-size: 12px;
      opacity: 0.75;
      margin-bottom: 6px;
      display: flex;
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    .message.self {
      align-self: flex-end;
      background: #2563eb;
      color: white;
      border-bottom-right-radius: 6px;
    }

    .message.other {
      align-self: flex-start;
      background: rgba(255,255,255,0.08);
      color: #f8fafc;
      border-bottom-left-radius: 6px;
    }

    .message.system {
      align-self: center;
      background: rgba(34,197,94,0.12);
      border: 1px solid rgba(34,197,94,0.25);
      color: #dcfce7;
      max-width: 90%;
      text-align: center;
    }

    .chat-form {
      display: flex;
      gap: 10px;
      padding: 16px;
      border-top: 1px solid rgba(255,255,255,0.08);
      background: rgba(255,255,255,0.02);
    }

    .message-input { flex: 1; }

    .avatar {
      width: 42px;
      height: 42px;
      border-radius: 50%;
      object-fit: cover;
      background: rgba(255,255,255,0.08);
      border: 1px solid rgba(255,255,255,0.1);
      flex: 0 0 auto;
    }

    .avatar.large {
      width: 74px;
      height: 74px;
    }

    .avatar.tiny {
      width: 20px;
      height: 20px;
    }

    .profile-card {
      display: flex;
      gap: 10px;
      align-items: center;
    }

    .mini-text {
      font-size: 12px;
      opacity: 0.85;
    }

    .hidden { display: none !important; }

    .divider {
      height: 1px;
      background: rgba(255,255,255,0.08);
      margin: 6px 0;
    }

    code.inline {
      background: rgba(255,255,255,0.08);
      padding: 1px 6px;
      border-radius: 6px;
      font-size: 12px;
    }

    @media (max-width: 1100px) {
      .chat-app { grid-template-columns: 260px 1fr; }
      .rightbar { display: none; }
    }

    @media (max-width: 760px) {
      .app-shell { padding: 0; }
      .chat-app {
        min-height: 100vh;
        border-radius: 0;
        grid-template-columns: 1fr;
      }
      .sidebar, .rightbar { display: none; }
      .message { max-width: 90%; }
    }
  