  * { box-sizing: border-box; margin: 0; padding: 0; }
  body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #1a1a2e; color: #e0e0e0; min-height: 100vh; }
  header { background: #16213e; padding: 16px 32px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #0f3460; }
  header h1 { font-size: 1.4rem; color: #7289da; }
  header .user { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; }
  header .user a { color: #aaa; text-decoration: none; font-size: 0.85rem; }
  header .user a:hover { color: #fff; }
  .container { max-width: 1100px; margin: 40px auto; padding: 0 24px; }
  .login-box { text-align: center; margin-top: 120px; }
  .login-box h2 { font-size: 1.8rem; margin-bottom: 12px; color: #fff; }
  .login-box p { color: #aaa; margin-bottom: 32px; }
  .btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 24px; border-radius: 8px; font-size: 1rem; font-weight: 600; cursor: pointer; border: none; text-decoration: none; transition: opacity 0.2s; }
  .btn:hover { opacity: 0.85; }
  .btn-discord { background: #5865f2; color: #fff; }
  .btn-primary { background: #5865f2; color: #fff; }
  .btn-danger { background: #ed4245; color: #fff; padding: 6px 14px; font-size: 0.85rem; }
  .btn-secondary { background: #4f545c; color: #fff; padding: 6px 14px; font-size: 0.85rem; }
  .btn-sm { padding: 5px 12px; font-size: 0.82rem; }
  .guild-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
  .guild-card { background: #16213e; border: 1px solid #0f3460; border-radius: 10px; padding: 20px; text-align: center; cursor: pointer; transition: border-color 0.2s, transform 0.1s; }
  .guild-card:hover { border-color: #5865f2; transform: translateY(-2px); }
  .guild-card img { width: 64px; height: 64px; border-radius: 50%; margin-bottom: 10px; }
  .guild-card .no-icon { width: 64px; height: 64px; border-radius: 50%; background: #5865f2; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; margin: 0 auto 10px; }
  .guild-card h3 { font-size: 0.95rem; color: #fff; }
  .section { background: #16213e; border: 1px solid #0f3460; border-radius: 10px; padding: 24px; margin-bottom: 24px; }
  .section h2 { font-size: 1.1rem; color: #7289da; margin-bottom: 16px; display: flex; align-items: center; justify-content: space-between; }
  table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
  th { text-align: left; padding: 8px 12px; color: #aaa; border-bottom: 1px solid #0f3460; font-weight: 500; }
  td { padding: 10px 12px; border-bottom: 1px solid #0f3460; vertical-align: middle; }
  tr:last-child td { border-bottom: none; }
  .tag { display: inline-block; background: #0f3460; border-radius: 4px; padding: 2px 8px; font-size: 0.8rem; color: #7289da; }
  .ch-tag { display: inline-flex; align-items: center; gap: 4px; background: #0f3460; border-radius: 4px; padding: 2px 6px; font-size: 0.8rem; color: #7289da; margin: 2px; }
  .ch-tag .remove { cursor: pointer; color: #666; font-size: 0.75rem; line-height: 1; padding: 0 2px; }
  .ch-tag .remove:hover { color: #ed4245; }
  .modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 100; }
  .modal { background: #16213e; border: 1px solid #0f3460; border-radius: 12px; padding: 28px; width: 500px; max-width: 95vw; max-height: 90vh; overflow-y: auto; }
  .modal h3 { font-size: 1.1rem; margin-bottom: 20px; color: #fff; }
  .form-group { margin-bottom: 16px; min-width: 0; }
  .form-group label { display: block; font-size: 0.85rem; color: #aaa; margin-bottom: 6px; }
  .form-row > .form-group > label, .form-row-3 > .form-group > label { min-height: 2.6em; }
  .form-group input, .form-group select { width: 100%; min-width: 0; max-width: 100%; background: #1a1a2e; border: 1px solid #0f3460; border-radius: 6px; padding: 8px 12px; color: #e0e0e0; font-size: 0.95rem; }
  .form-group input:focus { outline: none; border-color: #5865f2; }
  .form-hint { font-size: 0.78rem; color: #888; margin-top: 4px; }
  .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
  .back-link { color: #7289da; cursor: pointer; font-size: 0.9rem; display: inline-flex; align-items: center; gap: 4px; margin-bottom: 20px; }
  .back-link:hover { color: #fff; }
  .empty { color: #666; font-style: italic; padding: 16px 0; }
  .toast { position: fixed; bottom: 24px; right: 24px; background: #43b581; color: #fff; padding: 12px 20px; border-radius: 8px; font-size: 0.9rem; z-index: 200; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
  .toast.error { background: #ed4245; }
  .toast.show { opacity: 1; }

  /* Channel picker */
  .channel-field { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-height: 36px; background: #1a1a2e; border: 1px solid #0f3460; border-radius: 6px; padding: 4px 8px; }
  .add-ch-btn { background: #0f3460; border: none; border-radius: 4px; color: #7289da; cursor: pointer; font-size: 0.8rem; padding: 2px 8px; display: inline-flex; align-items: center; gap: 4px; }
  .add-ch-btn:hover { background: #5865f2; color: #fff; }
  .channel-picker-popup { position: fixed; width: 300px; background: #2f3136; border: 1px solid #202225; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); z-index: 300; display: flex; flex-direction: column; overflow: hidden; }
  .channel-picker-search { padding: 8px; border-bottom: 1px solid #202225; }
  .channel-picker-search input { width: 100%; background: #202225; border: none; border-radius: 4px; padding: 6px 10px; color: #dcddde; font-size: 0.85rem; outline: none; }
  .channel-picker-search input::placeholder { color: #72767d; }
  .channel-picker-body { max-height: 280px; overflow-y: auto; padding: 4px 0; scrollbar-width: thin; scrollbar-color: #42464d transparent; }
  .channel-picker-body::-webkit-scrollbar { width: 6px; }
  .channel-picker-body::-webkit-scrollbar-thumb { background: #42464d; border-radius: 3px; }
  .channel-cat-label { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #72767d; padding: 8px 12px 4px; }
  .channel-item { display: flex; align-items: center; gap: 8px; padding: 6px 12px; cursor: pointer; font-size: 0.9rem; color: #dcddde; }
  .channel-item:hover { background: #42464d; }
  .channel-item.selected { color: #5865f2; }
  .channel-item .ch-hash { color: #72767d; font-size: 1rem; }
  .channel-item.selected .ch-hash { color: #5865f2; }
  .channel-item .ch-check { margin-left: auto; color: #5865f2; font-size: 0.85rem; }
  .channel-picker-footer { padding: 8px; border-top: 1px solid #202225; display: flex; justify-content: flex-end; }

  /* Emoji picker */
  .emoji-field { display: flex; gap: 8px; align-items: center; }
  .emoji-trigger-btn { flex-shrink: 0; background: #1a1a2e; border: 1px solid #0f3460; border-radius: 6px; padding: 6px 10px; cursor: pointer; font-size: 1.3rem; line-height: 1; color: #aaa; transition: border-color 0.15s; display: flex; align-items: center; justify-content: center; min-width: 40px; height: 36px; }
  .emoji-trigger-btn:hover { border-color: #5865f2; }
  .emoji-clear-btn { flex-shrink: 0; background: transparent; border: none; color: #666; cursor: pointer; font-size: 1rem; padding: 4px 6px; border-radius: 4px; }
  .emoji-clear-btn:hover { color: #ed4245; }
  .emoji-display { flex: 1; background: #1a1a2e; border: 1px solid #0f3460; border-radius: 6px; padding: 8px 12px; color: #e0e0e0; font-size: 0.95rem; min-height: 36px; display: flex; align-items: center; }
  .emoji-display.placeholder { color: #555; font-style: italic; }
  .emoji-picker-popup { position: fixed; width: 352px; background: #2f3136; border: 1px solid #202225; border-radius: 8px; box-shadow: 0 8px 32px rgba(0,0,0,0.6); z-index: 300; display: flex; flex-direction: column; overflow: hidden; }
  .emoji-picker-search { padding: 8px; background: #2f3136; border-bottom: 1px solid #202225; }
  .emoji-picker-search input { width: 100%; background: #202225; border: none; border-radius: 4px; padding: 6px 10px; color: #dcddde; font-size: 0.85rem; outline: none; }
  .emoji-picker-search input::placeholder { color: #72767d; }
  .emoji-picker-cats { display: flex; background: #2f3136; border-bottom: 1px solid #202225; padding: 4px 8px; gap: 2px; }
  .emoji-cat-btn { background: transparent; border: none; cursor: pointer; padding: 4px 6px; border-radius: 4px; font-size: 1rem; color: #72767d; transition: background 0.1s, color 0.1s; flex-shrink: 0; }
  .emoji-cat-btn:hover, .emoji-cat-btn.active { background: #42464d; color: #fff; }
  .emoji-picker-body { height: 260px; overflow-y: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: #42464d transparent; }
  .emoji-picker-body::-webkit-scrollbar { width: 6px; }
  .emoji-picker-body::-webkit-scrollbar-thumb { background: #42464d; border-radius: 3px; }
  .emoji-section-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #72767d; padding: 6px 4px 4px; }
  .emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; margin-bottom: 8px; }
  .emoji-btn { background: transparent; border: none; cursor: pointer; border-radius: 4px; padding: 4px; font-size: 1.35rem; line-height: 1; display: flex; align-items: center; justify-content: center; transition: background 0.1s; aspect-ratio: 1; }
  .emoji-btn:hover { background: #42464d; }
  .emoji-btn img { width: 24px; height: 24px; object-fit: contain; }
  .emoji-picker-footer { padding: 6px 10px; background: #292b2f; border-top: 1px solid #202225; font-size: 0.82rem; color: #72767d; min-height: 32px; display: flex; align-items: center; gap: 8px; }
  .emoji-picker-footer .preview-emoji { font-size: 1.4rem; line-height: 1; }
  .emoji-picker-footer img.preview-emoji { width: 28px; height: 28px; }

  /* Sidebar nav */
  .dashboard-layout { display: flex; gap: 24px; align-items: flex-start; }
  .sidebar { width: 192px; flex-shrink: 0; background: #16213e; border: 1px solid #0f3460; border-radius: 10px; padding: 12px 8px; position: sticky; top: 24px; }
  .sidebar-group-label { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: #4a5568; padding: 12px 10px 4px; }
  .sidebar-group-label:first-child { padding-top: 4px; }
  .sidebar-item { display: block; width: 100%; text-align: left; background: transparent; border: none; border-radius: 6px; padding: 7px 10px; color: #aaa; cursor: pointer; font-size: 0.88rem; font-weight: 500; transition: background 0.12s, color 0.12s; }
  .sidebar-item:hover { background: #0f3460; color: #fff; }
  .sidebar-item.active { background: rgba(88,101,242,0.18); color: #7289da; font-weight: 600; }
  .sidebar-content { flex: 1; min-width: 0; }

  /* Points / leaderboard */
  .lb-avatar { width: 28px; height: 28px; border-radius: 50%; vertical-align: middle; margin-right: 8px; object-fit: cover; }
  .lb-avatar-placeholder { width: 28px; height: 28px; border-radius: 50%; background: #5865f2; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; vertical-align: middle; margin-right: 8px; }
  .source-badge { display: inline-block; background: #0f3460; border-radius: 4px; padding: 1px 7px; font-size: 0.75rem; color: #7289da; }
  .source-badge.vc  { color: #43b581; background: rgba(67,181,129,0.12); }
  .source-badge.contest { color: #faa61a; background: rgba(250,166,26,0.12); }
  .source-badge.admin { color: #ed4245; background: rgba(237,66,69,0.12); }
  .event-amount-pos { color: #43b581; font-weight: 600; }
  .event-amount-neg { color: #ed4245; font-weight: 600; }
  .member-result { display: flex; align-items: center; gap: 8px; padding: 7px 10px; cursor: pointer; border-radius: 6px; font-size: 0.9rem; color: #dcddde; }
  .member-result:hover { background: #0f3460; }
  .member-results-box { border: 1px solid #0f3460; border-radius: 6px; overflow: hidden; margin-top: 4px; max-height: 200px; overflow-y: auto; background: #1a1a2e; }
  .events-scroll { max-height: 380px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #42464d transparent; }
  .events-scroll::-webkit-scrollbar { width: 6px; }
  .events-scroll::-webkit-scrollbar-thumb { background: #42464d; border-radius: 3px; }

  /* Contests */
  .modal-wide { width: 680px; }
  .form-section-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em; color: #5865f2; margin: 20px 0 12px; padding-bottom: 6px; border-bottom: 1px solid #0f3460; }
  .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
  .form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
  .window-input { display: flex; gap: 8px; }
  .window-input input { flex: 1; }
  .window-input select { width: 90px; flex-shrink: 0; }
  .status-badge { display: inline-block; border-radius: 4px; padding: 2px 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
  .status-draft     { background: rgba(79,84,92,0.4);   color: #aaa; }
  .status-live      { background: rgba(88,101,242,0.2); color: #7289da; }
  .status-submitting{ background: rgba(67,181,129,0.2); color: #43b581; }
  .status-voting    { background: rgba(250,166,26,0.2); color: #faa61a; }
  .status-runoff    { background: rgba(250,120,26,0.2); color: #fa781a; }
  .status-closed    { background: rgba(79,84,92,0.3);   color: #666; }
  .status-cancelled { background: rgba(237,66,69,0.15); color: #ed4245; }
  .status-archived  { background: rgba(114,137,218,0.1); color: #555; }
  .contest-card { background: #1a1a2e; border: 1px solid #0f3460; border-radius: 8px; padding: 16px 20px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
  .contest-card:hover { border-color: #3a4460; }
  .contest-card-info { flex: 1; min-width: 0; }
  .contest-card-name { font-size: 1rem; font-weight: 600; color: #fff; margin-bottom: 4px; }
  .contest-card-meta { font-size: 0.82rem; color: #666; }
  .contest-card-actions { display: flex; gap: 8px; flex-shrink: 0; }
  .tally-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid #0f3460; }
  .tally-row:last-child { border-bottom: none; }
  .tally-rank { width: 28px; color: #aaa; font-size: 0.9rem; }
  .tally-score { margin-left: auto; font-weight: 600; color: #7289da; }
  .toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; }
  .toggle-row label { font-size: 0.85rem; color: #aaa; }
  .toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
  .toggle input { opacity: 0; width: 0; height: 0; }
  .toggle-slider { position: absolute; cursor: pointer; inset: 0; background: #4f545c; border-radius: 22px; transition: 0.2s; }
  .toggle-slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
  .toggle input:checked + .toggle-slider { background: #5865f2; }
  .toggle input:checked + .toggle-slider:before { transform: translateX(18px); }

  /* Shop item type badges */
  .shop-type-role   { color: #7289da; background: rgba(114,137,218,0.12); }
  .shop-type-access { color: #43b581; background: rgba(67,181,129,0.12); }
  .shop-type-salary { color: #faa61a; background: rgba(250,166,26,0.12); }
  .shop-type-daily  { color: #5865f2; background: rgba(88,101,242,0.15); }
  
  /* Reaction Roles */
  .rr-panel-row { display:flex; align-items:center; gap:8px; padding:8px 10px; background:#1a1a2e; border:1px solid #0f3460; border-radius:6px; margin-bottom:6px; }
  .rr-panel-row:hover { border-color:#3a4460; }
  .rr-panel-row[draggable="true"] { cursor:default; }
  .rr-drag-handle { cursor:grab; color:#4a5568; font-size:1.1rem; user-select:none; flex-shrink:0; line-height:1; }
  .rr-drag-handle:hover { color:#7289da; }
  .rr-panel-name { font-weight:600; color:#e0e0e0; flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .rr-entry-row { background:#1a1a2e; border:1px solid #0f3460; border-radius:6px; padding:10px 12px; margin-bottom:4px; }
  .rr-role-tags { display:flex; flex-wrap:wrap; gap:4px; min-height:22px; padding:2px 0; }
