
  :root {
    /* ── Tropical palette ── */
    --ocean:       #0077b6;
    --ocean-deep:  #005f8e;
    --lagoon:      #00b4d8;
    --lagoon-faint:rgba(0,180,216,0.10);
    --sand:        #fff8ee;
    --sand-dark:   #ffecd6;
    --sand-mid:    #ffddb5;
    --sand-border: #f5c98a;
    --palm:        #1a6b8a;
    --palm-light:  #00b4d8;
    --hibiscus:    #ff6b35;
    --mango:       #f4a228;
    --mango-faint: rgba(244,162,40,0.12);
    --sunset:      #ff8c42;
    --coral-red:   #e05252;
    --tiki-brown:  #7c4a1e;
    --tiki-wood:   #a0622a;

    /* Semantic mappings — light mode: warm ocean sky */
    --bg-void:      #e8f6fb;        /* soft ocean-sky page bg */
    --bg-surface:   #ffffff;
    --bg-panel:     #f0faff;        /* light ocean tint */
    --bg-raised:    #d6f0f8;
    --bg-hover:     #c0e8f5;
    --border:       #8ecae6;
    --border-bright:#5aa9cc;
    --signal:       #ff6b35;        /* sunset orange — primary accent */
    --signal-dim:   #e05520;
    --signal-glow:  rgba(255,107,53,0.15);
    --signal-faint: rgba(255,107,53,0.07);
    --amber:        #f4a228;
    --red:          #e05252;
    --blue:         #0077b6;
    --text-primary: #02304a;        /* deep ocean */
    --text-secondary:#1a6b8a;
    --text-muted:   #5a9ab5;
    --font-display: 'Pacifico', cursive;
    --font-mono:    'DM Mono', monospace;
    --font-body:    'Nunito', sans-serif;
    --radius:       8px;
    --radius-lg:    16px;
    --transition:   0.15s ease;
    --sidebar-w:    310px;
  }

  /* ── DARK MODE — tropical midnight ── */
  [data-theme="dark"] {
    --sand:        #0a1f2e;
    --sand-dark:   #071522;
    --sand-mid:    #0e2a3d;
    --sand-border: #1a3d52;
    --bg-void:     #060f18;
    --bg-surface:  #0a1f2e;
    --bg-panel:    #0e2a3d;
    --bg-raised:   #133248;
    --bg-hover:    #1a3d55;
    --border:      #1a3d52;
    --border-bright:#2a5570;
    --signal:      #ff8c42;
    --signal-dim:  #ff6b35;
    --signal-glow: rgba(255,140,66,0.2);
    --signal-faint:rgba(255,140,66,0.08);
    --ocean:       #48cae4;
    --lagoon:      #90e0ef;
    --palm-light:  #00b4d8;
    --mango:       #ffb347;
    --tiki-brown:  #ffb347;
    --tiki-wood:   #ffa020;
    --amber:       #ffb347;
    --red:         #ff6b6b;
    --blue:        #48cae4;
    --text-primary: #e0f4ff;        /* soft ocean white */
    --text-secondary:#7ecbe8;
    --text-muted:   #3a6a82;
  }

  /* Dark mode specific background/surface overrides */
  [data-theme="dark"] #screen-onboard,
  [data-theme="dark"] #screen-auth {
    background: url('images/night.png') center center / cover no-repeat;
  }
  [data-theme="dark"] #screen-onboard {
    background: url('images/night.png') center center / cover no-repeat;
  }
  [data-theme="dark"] #screen-onboard::before,
  [data-theme="dark"] #screen-auth::before {
    background: transparent;
  }
  [data-theme="dark"] #screen-onboard::after,
  [data-theme="dark"] #screen-auth::after {
    display: none;
  }
  [data-theme="dark"] .onboard-card {
    background: rgba(12,22,18,0.96);
    border-color: var(--sand-border);
    box-shadow: 0 16px 56px rgba(0,0,0,0.6), 0 2px 0 #2a4433;
  }
  [data-theme="dark"] .logo { color: var(--tiki-brown); }
  [data-theme="dark"] .onboard-title { color: var(--text-primary); }
  [data-theme="dark"] .tab-btn { color: var(--text-muted); }
  [data-theme="dark"] .tab-row { background: var(--sand-dark); border-color: var(--border); }
  [data-theme="dark"] .tab-btn.active { background: var(--signal); color: #fff; }
  [data-theme="dark"] .field input,
  [data-theme="dark"] .field textarea {
    background: var(--sand-dark);
    border-color: var(--border);
    color: var(--text-primary);
  }
  [data-theme="dark"] .field input::placeholder { color: var(--text-muted); }
  [data-theme="dark"] .avatar-preview { background: var(--sand-dark); border-color: var(--signal); }
  [data-theme="dark"] .btn-secondary { background: var(--sand-dark); color: var(--text-primary); border-color: var(--border); }
  [data-theme="dark"] #screen-app {
    background: linear-gradient(180deg, #060f18 0%, #08182a 40%, #060f18 100%);
  }
  [data-theme="dark"] .chat-header {
    background: rgba(8,24,42,0.95);
    border-bottom-color: var(--border);
  }
  [data-theme="dark"] .chat-header-name { color: var(--text-primary); }
  [data-theme="dark"] .messages-wrap {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='1' fill='%231a3d52' opacity='0.5'/%3E%3C/svg%3E");
  }
  [data-theme="dark"] .msg-group:hover { background: rgba(26,42,30,0.8); }
  [data-theme="dark"] .msg-continuation:hover { background: rgba(26,42,30,0.7); border-radius: 10px; }
  [data-theme="dark"] .msg-avatar { background: var(--sand-dark); border-color: var(--border); color: var(--tiki-brown); }
  [data-theme="dark"] .msg-time { color: var(--text-muted); }
  [data-theme="dark"] .day-divider { color: var(--text-muted); }
  [data-theme="dark"] .day-divider::before,
  [data-theme="dark"] .day-divider::after { background: var(--border); }
  [data-theme="dark"] .input-area { background: rgba(17,31,21,0.9); border-top-color: var(--border); }
  [data-theme="dark"] .input-box {
    background: rgba(20,32,24,0.98);
    border-color: var(--border-bright);
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  }
  [data-theme="dark"] .input-box:focus-within {
    border-color: var(--signal);
    box-shadow: 0 0 0 3px var(--signal-faint), 0 2px 8px rgba(0,0,0,0.3);
  }
  [data-theme="dark"] .input-field { color: var(--text-primary); }
  [data-theme="dark"] .input-field::placeholder { color: var(--text-muted); }
  [data-theme="dark"] .input-hint kbd { background: var(--sand-dark); border-color: var(--border); color: var(--text-secondary); }
  [data-theme="dark"] .preview-thumb img { border-color: var(--border-bright); }
  [data-theme="dark"] .msg-image-wrap img { border-color: var(--border); }
  [data-theme="dark"] .modal-overlay { background: rgba(0,0,0,0.78); }
  [data-theme="dark"] .modal {
    background: #111f15;
    border-color: var(--border-bright);
    box-shadow: 0 12px 60px rgba(0,0,0,0.6);
  }
  [data-theme="dark"] .modal-title { color: var(--text-primary); }
  [data-theme="dark"] .modal-sub { color: var(--text-secondary); }
  [data-theme="dark"] .modal-close { color: var(--text-muted); }
  [data-theme="dark"] .modal-close:hover { color: var(--signal); }
  [data-theme="dark"] .invite-code-display { background: var(--sand-dark); border-color: var(--border); }
  [data-theme="dark"] .header-btn { color: var(--text-secondary); }
  [data-theme="dark"] .header-btn:hover { background: var(--signal-faint); color: var(--signal); }
  [data-theme="dark"] .member-count { color: var(--palm-light); }
  [data-theme="dark"] .empty-title { color: #fff; }
  [data-theme="dark"] .empty-sub { color: rgba(255,255,255,0.8); }
  [data-theme="dark"] .lightbox { background: rgba(0,0,0,0.96); }
  [data-theme="dark"] #toast { background: #1f3226; box-shadow: 0 4px 20px rgba(0,0,0,0.5); }
  [data-theme="dark"] .chat-header-desc { color: var(--text-muted); }
  [data-theme="dark"] .chat-header-sep { color: var(--border-bright); }
  [data-theme="dark"] .input-action-btn { color: var(--text-muted); }
  [data-theme="dark"] .input-action-btn:hover { color: var(--signal); background: var(--signal-faint); }

  /* ── DARK TOGGLE BUTTON ── */
  .dark-toggle {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    transition: background var(--transition);
    flex-shrink: 0;
  }
  .dark-toggle:hover { background: rgba(255,255,255,0.22); }

  .onboard-dark-toggle {
    position: absolute;
    top: 16px; right: 16px;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--sand-dark);
    border: 1.5px solid var(--border);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: var(--transition);
    z-index: 2;
  }
  .onboard-dark-toggle:hover { border-color: var(--signal); background: var(--signal-faint); }

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  html {
    height: 100%;
    height: -webkit-fill-available;
  }

  body {
    height: 100%;
    height: 100dvh; /* dynamic viewport height — accounts for mobile browser chrome */
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    overflow: hidden;
    position: fixed; /* prevents rubber-band scroll on iOS */
    width: 100%;
    top: 0; left: 0;
  }

  /* ── SCREENS ── */
  .screen { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; }
  .screen.active { display: flex; }

  /* ── ONBOARDING ── */
  #screen-onboard, #screen-auth {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: url('images/day.png') center center / cover no-repeat;
  }

  /* Decorative tiki scenery — only in dark mode, image handles light mode */
  #screen-onboard::before, #screen-auth::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 180px;
    background: transparent;
    pointer-events: none;
    z-index: 0;
  }
  /* Sun glow — hidden in light mode */
  #screen-onboard::after, #screen-auth::after {
    display: none;
  }

  /* Floating tiki decorations */
  .tiki-deco {
    position: absolute;
    font-size: 64px;
    pointer-events: none;
    user-select: none;
    z-index: 0;
    opacity: 0.85;
  }
  .tiki-palm-l  { bottom: 60px; left: -10px; font-size: 120px; opacity: 0.7; }
  .tiki-palm-r  { bottom: 60px; right: -10px; font-size: 120px; opacity: 0.7; transform: scaleX(-1); }
  .tiki-flower1 { top: 40px; left: 60px; font-size: 40px; animation: sway 4s ease-in-out infinite; }
  .tiki-flower2 { top: 80px; right: 80px; font-size: 32px; animation: sway 5s ease-in-out infinite reverse; }
  .tiki-wave    { bottom: 155px; left: 50%; transform: translateX(-50%); font-size: 48px; opacity: 0.6; }

  @keyframes sway {
    0%,100% { transform: rotate(-8deg); }
    50%      { transform: rotate(8deg); }
  }

  .onboard-card {
    position: relative;
    z-index: 1;
    background: rgba(255,252,245,0.97);
    border: 2px solid var(--sand-border);
    border-radius: 24px;
    padding: 40px 40px 36px;
    width: 430px;
    max-width: 95vw;
    box-shadow: 0 16px 56px rgba(0,0,0,0.28), 0 2px 0 #c5b899;
    animation: cardIn 0.5s cubic-bezier(0.22,1,0.36,1) both;
  }

  @keyframes cardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.96); }
    to   { opacity: 1; transform: none; }
  }

  .logo {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
    color: var(--tiki-brown);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.01em;
  }
  .logo-dot { font-size: 22px; animation: pulse 2.5s ease-in-out infinite; display: inline-block; }
  @keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.25) rotate(15deg); } }

  .onboard-title {
    font-size: 22px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 6px;
    color: var(--tiki-brown);
  }
  .onboard-sub {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 28px;
    line-height: 1.6;
  }

  .tab-row {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--sand-dark);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border);
  }
  .tab-btn {
    flex: 1;
    padding: 9px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
  }
  .tab-btn.active {
    background: var(--signal);
    color: #fff;
    box-shadow: 0 2px 8px rgba(224,92,138,0.3);
  }

  .tab-panel { display: none; }
  .tab-panel.active { display: block; }

  /* Auth screen tabs */
  .auth-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 24px;
    background: var(--sand-dark);
    border-radius: 12px;
    padding: 4px;
    border: 1px solid var(--border);
  }
  .auth-tab-btn {
    flex: 1;
    padding: 9px;
    background: none;
    border: none;
    border-radius: 10px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
  }
  .auth-tab-btn.active {
    background: var(--signal);
    color: #fff;
    box-shadow: 0 2px 8px rgba(224,92,138,0.3);
  }
  .auth-tab-panel { display: none; }
  .auth-tab-panel.active { display: block; }

  /* ── FORM ELEMENTS ── */
  .field { margin-bottom: 16px; }
  .field label {
    display: block;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 7px;
  }
  .field input, .field textarea {
    width: 100%;
    background: var(--sand);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 10px 13px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    resize: none;
  }
  .field input:focus, .field textarea:focus {
    border-color: var(--signal);
    box-shadow: 0 0 0 3px var(--signal-faint);
  }
  .field input::placeholder { color: var(--text-muted); font-weight: 400; }

  .avatar-picker {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
  }
  .avatar-preview {
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--sand-dark);
    border: 3px solid var(--signal);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 800;
    color: var(--signal);
    overflow: hidden;
    flex-shrink: 0;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
  }
  .avatar-preview:hover { box-shadow: 0 0 0 4px var(--signal-glow); }
  .avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
  .avatar-upload-btn {
    font-size: 12px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1.6;
  }
  .avatar-upload-btn span {
    color: var(--signal);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 700;
  }
  #avatar-file-input { display: none; }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
  }
  .btn-primary {
    background: var(--signal);
    color: #fff;
    width: 100%;
    box-shadow: 0 3px 12px rgba(224,92,138,0.35);
  }
  .btn-primary:hover { background: var(--signal-dim); transform: translateY(-1px); box-shadow: 0 5px 18px rgba(224,92,138,0.4); }
  .btn-secondary {
    background: var(--sand-dark);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    width: 100%;
  }
  .btn-secondary:hover { background: var(--sand-mid); }
  .btn-ghost {
    background: none;
    color: var(--text-secondary);
    padding: 6px 10px;
    font-size: 12px;
  }
  .btn-ghost:hover { color: var(--signal); background: var(--signal-faint); border-radius: 8px; }
  .btn-danger { background: var(--red); color: #fff; }
  .btn-danger:hover { filter: brightness(1.1); }

  .divider {
    display: flex; align-items: center; gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 11px;
  }
  .divider::before, .divider::after {
    content: ''; flex: 1; height: 1px; background: var(--border);
  }

  .error-msg {
    color: var(--red);
    font-size: 12px;
    margin-top: 6px;
    font-weight: 600;
    display: none;
  }
  .error-msg.show { display: block; }

  /* ── MAIN APP ── */
  #screen-app {
    flex-direction: row;
    height: 100%;
    background:
      linear-gradient(180deg, #caf0fb 0%, #a8e4f5 40%, #d0f0ff 100%);
  }

  /* ── QUEUE SIDEBAR ── */
  .queue-sidebar {
    width: 420px;
    flex-shrink: 0;
    display: none; /* hidden by default — toggled via .queue-open on screen-app */
    flex-direction: column;
    height: 100%;
    background: var(--bg-surface);
    border-left: 1.5px solid var(--border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    overflow: hidden;
    transition: width 0.25s cubic-bezier(0.22,1,0.36,1);
  }
  #screen-app.queue-open .queue-sidebar { display: flex; }
  #screen-app.queue-open .chat-area { min-width: 0; }

  .queue-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-panel);
  }

  /* ── SIDEBAR ── */
  .sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    position: relative;
    background:
      url('images/sidebar.png') center top / cover no-repeat;
    border-right: 3px solid rgba(0,60,100,0.35);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: width 0.28s cubic-bezier(0.22,1,0.36,1);
  }
  /* Tropical color overlay on top of the wood texture */
  .sidebar::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
      rgba(0,60,110,0.78) 0%,
      rgba(0,80,140,0.72) 40%,
      rgba(0,60,110,0.78) 100%
    );
    pointer-events: none;
    z-index: 0;
  }
  /* All sidebar content needs to sit above the overlay */
  .sidebar > * { position: relative; z-index: 1; }

  [data-theme="dark"] .sidebar {
    background:
      url('images/sidebar.png') center top / cover no-repeat;
    border-right: 3px solid rgba(0,30,60,0.5);
  }
  [data-theme="dark"] .sidebar::before {
    background: linear-gradient(180deg,
      rgba(2,15,35,0.82) 0%,
      rgba(5,25,50,0.78) 40%,
      rgba(8,20,45,0.82) 100%
    );
  }

  /* Collapsed sidebar — narrow rail showing only the hamburger */
  .sidebar.collapsed {
    width: 62px;
  }
  .sidebar.collapsed .sidebar-logo,
  .sidebar.collapsed .sidebar-section,
  .sidebar.collapsed .voice-section,

  .sidebar.collapsed .user-info,
  .sidebar.collapsed .user-status,
  .sidebar.collapsed .dark-toggle,
  .sidebar.collapsed .sidebar-new-btn,
  .sidebar.collapsed .resort-join-wrap,
  .sidebar.collapsed .sidebar-beach-radio,
  .sidebar.collapsed .sidebar-dm-wrap {
    display: none;
  }
  .sidebar.collapsed .resort-list {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    padding: 8px 0 4px;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    gap: 6px;
  }
  .sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 14px 0 10px;
  }
  .sidebar.collapsed .sidebar-user {
    justify-content: center;
    padding: 10px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
  }
  .sidebar.collapsed .user-avatar-sm { margin: 0; }
  }
  .sidebar.collapsed .user-avatar-sm {
    margin: 0;
  }

  /* Hamburger button */
  .hamburger-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    font-size: 18px;
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
    gap: 4px;
    transition: background var(--transition);
    flex-shrink: 0;
    padding: 0;
  }
  .hamburger-btn:hover { background: rgba(255,255,255,0.15); }
  .hamburger-btn span {
    display: block;
    width: 16px; height: 2px;
    background: rgba(255,255,255,0.85);
    border-radius: 2px;
    transition: var(--transition);
  }

  .sidebar-header {
    padding: 18px 16px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
  }
  .sidebar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    min-width: 0;
    overflow: hidden;
  }

  .sidebar-section {
    padding: 14px 12px 6px;
    flex-shrink: 0;
  }
  .sidebar-section-label {
    font-family: var(--font-body);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.18em;
    color: rgba(255,255,255,0.5);
    text-transform: uppercase;
    padding: 0 6px;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .sidebar-section-label button {
    background: none; border: none; color: rgba(255,255,255,0.5);
    cursor: pointer; font-size: 18px; line-height: 1;
    padding: 0; transition: color var(--transition);
    display: flex; align-items: center;
  }
  .sidebar-section-label button:hover { color: var(--mango); }

  /* ── RESORT LIST ── */
  .resort-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0 4px;
  }
  .resort-list::-webkit-scrollbar { width: 3px; }
  .resort-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

  .resort-group {
    margin-bottom: 4px;
  }

  /* Resort avatar (profile pic) */
  .resort-avatar {
    width: 32px; height: 32px;
    border-radius: 10px;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 800;
    color: rgba(255,255,255,0.8);
    flex-shrink: 0;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.15);
    transition: border-color 0.15s;
  }
  .resort-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .resort-avatar.active-resort { border-color: var(--mango); }

  /* Collapsed sidebar — show resort avatars as a rail */
  .sidebar.collapsed .resort-join-wrap { display: none; }
  .sidebar.collapsed .sidebar-logo { display: none; }
  .sidebar.collapsed .resort-list { padding: 8px 0 4px; }
  .sidebar.collapsed .resort-group { margin-bottom: 8px; }
  .sidebar.collapsed .resort-header {
    padding: 4px 0;
    justify-content: center;
    background: none !important;
  }
  .sidebar.collapsed .resort-name,
  .sidebar.collapsed .resort-chevron,
  .sidebar.collapsed .resort-section-label,
  .sidebar.collapsed .cabana-item,
  .sidebar.collapsed .bonfire-item,
  .sidebar.collapsed .bonfire-participants-inline,
  .sidebar.collapsed .resort-voice-indicator { display: none !important; }
  .sidebar.collapsed .resort-body { display: none !important; }
  .sidebar.collapsed .resort-avatar {
    width: 38px; height: 38px;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    display: flex !important;
  }
  .sidebar.collapsed .resort-avatar:hover {
    transform: scale(1.12);
    border-color: rgba(255,255,255,0.5);
  }
  /* Show voice dot on avatar when collapsed */
  .sidebar.collapsed .resort-group.has-voice .resort-avatar {
    border-color: #52b788;
    box-shadow: 0 0 0 2px rgba(82,183,136,0.35);
  }

  /* Resort voice indicator (shown when expanded) */
  .resort-voice-indicator {
    font-size: 13px;
    margin-left: auto;
    animation: pulse-voice 1.5s ease-in-out infinite;
    flex-shrink: 0;
  }
  @keyframes pulse-voice {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.4; }
  }

  .resort-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 4px 12px;
    cursor: pointer;
    user-select: none;
    border-radius: 10px;
    margin: 0 6px;
    transition: background var(--transition);
    background: rgba(180, 90, 0, 0.35);
    border: 1px solid rgba(255, 160, 40, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .resort-header:hover { background: rgba(200, 110, 0, 0.48); border-color: rgba(255,160,40,0.35); }

  .resort-chevron {
    font-size: 9px;
    color: rgba(255,255,255,0.6);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    display: inline-block;
    text-shadow: 0 1px 3px rgba(0,0,0,0.7);
  }
  .resort-chevron.open { transform: rotate(90deg); }

  .resort-name {
    font-size: 13px;
    font-weight: 800;
    color: rgba(255, 220, 160, 0.95);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 1px 6px rgba(0,0,0,0.7), 0 0 12px rgba(0,0,0,0.4);
  }
  .resort-header:hover .resort-name { color: #fff; }

  .resort-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px 4px 22px;
    margin: 4px 6px 2px;
    border-radius: 6px;
    background: rgba(0, 60, 90, 0.3);
    border-left: 2px solid rgba(0, 180, 216, 0.3);
  }
  .resort-section-label span {
    font-size: 11px;
    font-weight: 800;
    color: rgba(140, 210, 240, 0.9);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  }
  .resort-section-add {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
    padding: 0;
    flex-shrink: 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  }
  .resort-section-add:hover { color: #fff; background: rgba(255,255,255,0.12); }

  /* Cabana (text channel) items */
  .cabana-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 20px;
    border-radius: 10px;
    margin: 2px 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    position: relative;
    text-shadow: 0 1px 6px rgba(0,0,0,0.9);
    background: rgba(0,0,0,0.38);
    border: 1px solid rgba(255,255,255,0.08);
  }
  .cabana-item:hover { background: rgba(0,0,0,0.55); border-color: rgba(255,255,255,0.18); }
  .cabana-item.active { background: rgba(0,40,80,0.65); color: #fff; font-weight: 800; border-color: rgba(0,180,216,0.4); }
  .cabana-item.active::before {
    content: '';
    position: absolute;
    left: 0; top: 50%; transform: translateY(-50%);
    width: 3px; height: 60%;
    background: var(--mango);
    border-radius: 0 3px 3px 0;
  }
  .cabana-hash { font-size: 16px; opacity: 0.8; flex-shrink: 0; }
  .cabana-item.active .cabana-hash { opacity: 1; color: #48cae4; }
  .cabana-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Bonfire (voice channel) items */
  .bonfire-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px 8px 20px;
    border-radius: 10px;
    margin: 2px 6px;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
    text-shadow: 0 1px 6px rgba(0,0,0,0.9);
    background: rgba(0,0,0,0.38);
    border: 1px solid rgba(255,255,255,0.08);
  }
  .bonfire-item:hover { background: rgba(0,0,0,0.55); border-color: rgba(255,255,255,0.18); }
  .bonfire-item.in-voice { color: #7de8ff; background: rgba(0,60,100,0.55); border-color: rgba(0,180,216,0.35); }
  .bonfire-item.in-voice:hover { background: rgba(0,80,130,0.65); }
  .bonfire-icon { font-size: 14px; flex-shrink: 0; }
  .bonfire-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Bonfire participants shown inline under the bonfire */
  .bonfire-participants-inline {
    padding-left: 8px;
    padding-right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 4px 6px 6px;
  }
  .bonfire-participant-inline {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 10px;
    transition: color 0.15s, background 0.15s;
    text-shadow: 0 1px 5px rgba(0,0,0,0.8);
    background: rgba(0,0,0,0.32);
    border: 1px solid rgba(255,255,255,0.08);
  }
  .bonfire-participant-inline.speaking {
    color: #7de8ff;
    text-shadow: 0 0 8px rgba(0,180,216,0.5), 0 1px 4px rgba(0,0,0,0.8);
    background: rgba(0,60,100,0.5);
    border-color: rgba(0,180,216,0.3);
  }
  .bonfire-participant-inline.speaking .bp-avatar,
  .bonfire-participant-inline.speaking > div:first-child {
    box-shadow: 0 0 0 2.5px #00b4d8;
  }
  .bp-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800;
    flex-shrink: 0;
    overflow: hidden;
    border: 1.5px solid rgba(255,255,255,0.25);
  }
  .bp-avatar img { width:100%; height:100%; object-fit:cover; }
  .bp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .bp-mic { font-size: 13px; flex-shrink: 0; }

  /* Join/Create resort button */
  .resort-join-btn {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1.5px dashed rgba(255,255,255,0.35);
    border-radius: 10px;
    color: rgba(255,255,255,0.9);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 800;
    padding: 9px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
    text-shadow: 0 1px 5px rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .resort-join-btn:hover { background: rgba(0,0,0,0.48); color: #fff; border-color: rgba(255,255,255,0.55); }

  /* Persistent voice bar at bottom of screen */
  #voice-bar {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    background: linear-gradient(90deg, #021830 0%, #02304a 100%);
    border-top: 2px solid #00b4d8;
    padding: 8px 16px;
    align-items: center;
    gap: 8px;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
    min-height: 52px;
    flex-wrap: nowrap;
    overflow: visible;
  }
  #voice-bar.show { display: flex; }
  .voice-bar-icon { font-size: 20px; flex-shrink: 0; }
  .voice-bar-info { flex: 1; min-width: 0; }
  .voice-bar-name { font-size: 13px; font-weight: 800; color: #48cae4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .voice-bar-resort { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.4); }
  .voice-bar-resort { font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.4); }
  .voice-bar-btn {
    background: rgba(255,255,255,0.1);
    border: none; border-radius: 8px; color: #fff;
    font-size: 15px; width: 34px; height: 34px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.15s; flex-shrink: 0;
  }
  .voice-bar-btn:hover { background: rgba(255,255,255,0.2); }
  .voice-bar-btn.muted { background: rgba(224,82,82,0.35); }
  .voice-bar-leave {
    background: rgba(224,82,82,0.35);
    border: none; border-radius: 8px; color: #fff;
    font-size: 12px; font-weight: 800;
    padding: 7px 14px; cursor: pointer;
    transition: background 0.15s; white-space: nowrap; flex-shrink: 0;
  }
  .voice-bar-leave:hover { background: rgba(224,82,82,0.65); }

  /* Push content up when voice bar is showing */
  body.in-voice .chat-area { padding-bottom: 56px; }
  body.in-voice .sidebar { padding-bottom: 56px; }

  /* ══════════════════════════════════════════════════════════
     DM PANEL
  ══════════════════════════════════════════════════════════ */
  #dm-panel, #dm-convo {
    position: fixed;
    top: 0; right: 0;
    width: 340px;
    height: 100%;
    background: var(--bg-surface);
    border-left: 1.5px solid var(--border);
    z-index: 700;
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0,0,0,0.2);
    animation: dmSlideIn 0.22s cubic-bezier(0.22,1,0.36,1) both;
  }
  @keyframes dmSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: none; opacity: 1; }
  }
  .dm-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .dm-close-btn, .dm-back-btn {
    background: none; border: none;
    color: var(--text-muted); font-size: 20px;
    cursor: pointer; padding: 0 4px;
    transition: color 0.15s;
    font-family: var(--font-body);
    font-weight: 700;
  }
  .dm-close-btn:hover, .dm-back-btn:hover { color: var(--text-primary); }
  .dm-search-wrap {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    position: relative;
  }
  .dm-search-input {
    width: 100%;
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
  }
  .dm-search-input:focus { border-color: var(--signal); }
  .dm-search-results {
    position: absolute;
    top: calc(100% - 10px); left: 12px; right: 12px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
  }
  .dm-search-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
  }
  .dm-search-result:hover { background: var(--signal-faint); }
  .dm-search-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--sand-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800;
    color: var(--tiki-brown);
    flex-shrink: 0; overflow: hidden;
  }
  .dm-search-avatar img { width:100%;height:100%;object-fit:cover; }
  .dm-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .dm-tab {
    flex: 1;
    background: none; border: none;
    padding: 10px 4px;
    font-family: var(--font-body);
    font-size: 12px; font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: color 0.15s, border-color 0.15s;
    position: relative;
  }
  .dm-tab.active { color: var(--signal); border-bottom-color: var(--signal); }
  .dm-tab:hover { color: var(--text-primary); }
  #dm-req-badge {
    background: var(--signal);
    color: #fff;
    font-size: 9px; font-weight: 900;
    border-radius: 100px;
    min-width: 14px; height: 14px;
    line-height: 14px;
    text-align: center;
    padding: 0 3px;
    margin-left: 4px;
    vertical-align: top;
  }
  .dm-tab-content {
    flex: 1;
    overflow-y: auto;
  }
  /* DM list items */
  .dm-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid var(--border);
    position: relative;
  }
  .dm-list-item:hover { background: var(--bg-hover); }
  .dm-list-item.unread { background: var(--signal-faint); }
  .dm-list-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--sand-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 800;
    color: var(--tiki-brown);
    flex-shrink: 0; overflow: hidden;
  }
  .dm-list-avatar img { width:100%;height:100%;object-fit:cover; }
  .dm-list-info { flex: 1; min-width: 0; }
  .dm-list-name { font-size: 14px; font-weight: 700; color: var(--text-primary); }
  .dm-list-preview { font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
  .dm-list-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
  .dm-list-time { font-size: 10px; color: var(--text-muted); }
  .dm-unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--signal); }
  /* Friend request buttons */
  .dm-action-btn {
    font-family: var(--font-body);
    font-size: 11px; font-weight: 800;
    border-radius: 8px; padding: 5px 12px;
    cursor: pointer; border: none;
    transition: background 0.15s;
  }
  .dm-action-btn.accept { background: rgba(0,180,216,0.15); color: #00b4d8; }
  .dm-action-btn.accept:hover { background: rgba(0,180,216,0.3); }
  .dm-action-btn.decline { background: rgba(255,107,53,0.12); color: var(--signal); }
  .dm-action-btn.decline:hover { background: rgba(255,107,53,0.25); }
  .dm-action-btn.add { background: var(--signal-faint); color: var(--signal); }
  .dm-action-btn.add:hover { background: var(--signal-glow); }
  .dm-action-btn.remove { background: rgba(255,100,100,0.1); color: #ff6b6b; }
  .dm-action-btn.remove:hover { background: rgba(255,100,100,0.2); }
  .dm-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px; font-weight: 600;
  }
  .dm-empty-icon { font-size: 36px; margin-bottom: 10px; }
  /* DM conversation */
  .dm-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .dm-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
  }
  .dm-msg.mine { align-self: flex-end; align-items: flex-end; }
  .dm-msg.theirs { align-self: flex-start; align-items: flex-start; }
  .dm-msg-bubble {
    padding: 9px 13px;
    border-radius: 16px;
    font-size: 13px; font-weight: 600;
    line-height: 1.45;
    word-break: break-word;
  }
  .dm-msg.mine .dm-msg-bubble { background: var(--signal); color: #fff; border-bottom-right-radius: 4px; }
  .dm-msg.theirs .dm-msg-bubble { background: var(--bg-raised); color: var(--text-primary); border-bottom-left-radius: 4px; }
  .dm-msg-time { font-size: 10px; color: var(--text-muted); margin-top: 3px; padding: 0 4px; }
  .dm-day-divider { text-align: center; font-size: 11px; font-weight: 700; color: var(--text-muted); padding: 8px 0; }
  .dm-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .dm-input {
    flex: 1;
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: 12px;
    padding: 9px 12px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    resize: none;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.15s;
  }
  .dm-input:focus { border-color: var(--signal); }
  .dm-send-btn {
    background: var(--signal);
    border: none; border-radius: 10px;
    color: #fff; font-size: 16px;
    width: 38px; height: 38px;
    cursor: pointer; flex-shrink: 0;
    transition: background 0.15s;
    display: flex; align-items: center; justify-content: center;
  }
  .dm-send-btn:hover { background: var(--signal-dim); }

  /* Overlay backdrop when DM panel is open */
  #dm-backdrop {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 699;
  }
  #dm-backdrop.show { display: block; }
  /* ── GIF PICKER ── */
  #gif-picker {
    display: none;
    position: fixed;
    z-index: 700;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.18);
    overflow: hidden;
    animation: sbPopIn 0.15s cubic-bezier(0.22,1,0.36,1) both;
    flex-direction: column;
    width: 480px;
    max-height: 520px;
  }
  #gif-picker.show { display: flex; }
  .gif-picker-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .gif-search-input {
    flex: 1;
    background: var(--bg-panel);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 7px 12px;
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.15s;
  }
  .gif-search-input:focus { border-color: var(--signal); }
  .gif-powered {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    flex-shrink: 0;
    letter-spacing: 0.03em;
  }
  .gif-powered span { color: #00b4d8; }
  .gif-close-btn {
    background: none; border: none;
    color: var(--text-muted); font-size: 18px;
    cursor: pointer; padding: 0 2px; line-height: 1;
    flex-shrink: 0;
  }
  .gif-close-btn:hover { color: var(--text-primary); }
  .gif-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    align-items: start;
    gap: 6px;
    padding: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
  }
  .gif-grid::-webkit-scrollbar { width: 4px; }
  .gif-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
  .gif-item {
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-raised);
    transition: transform 0.12s, opacity 0.12s;
  }
  .gif-item:hover { transform: scale(1.04); opacity: 0.9; }
  .gif-item img {
    width: 100%; height: auto;
    display: block;
  }
  .gif-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
  }
  .gif-loading {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
  }
  /* GIF button styling */
  #gif-btn {
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.04em;
    padding: 0 6px;
  }
  #gif-btn.active { color: var(--signal); background: var(--signal-faint); }
  .typing-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 6px;
    min-height: 24px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    font-style: italic;
    flex-shrink: 0;
  }
  .typing-dots {
    display: flex;
    gap: 3px;
    align-items: center;
  }
  .typing-dots span {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.2s ease-in-out infinite;
  }
  .typing-dots span:nth-child(2) { animation-delay: 0.2s; }
  .typing-dots span:nth-child(3) { animation-delay: 0.4s; }
  @keyframes typingBounce {
    0%,60%,100% { transform: translateY(0); opacity: 0.4; }
    30%          { transform: translateY(-4px); opacity: 1; }
  }
  .msg-reactions { display:flex;flex-wrap:wrap;gap:4px;margin-top:6px;margin-bottom:2px; }
  .reaction-pill { display:inline-flex;align-items:center;gap:4px;background:var(--bg-raised);border:1.5px solid var(--border);border-radius:100px;padding:2px 8px;font-size:13px;font-weight:700;color:var(--text-secondary);cursor:pointer;transition:background 0.12s,border-color 0.12s,transform 0.1s;user-select:none; }
  .reaction-pill:hover { background:var(--bg-hover);border-color:var(--border-bright);transform:scale(1.08); }
  .reaction-pill.mine { background:var(--signal-faint);border-color:var(--signal);color:var(--signal); }
  .reaction-pill.mine:hover { background:var(--signal-glow); }
  .reaction-pill-count { font-size:11px;font-weight:800; }
  .reaction-pill img { width:16px;height:16px;object-fit:contain;border-radius:3px; }
  #reaction-picker { display:none;position:fixed;z-index:900;background:var(--bg-surface);border:1.5px solid var(--border);border-radius:16px;box-shadow:0 8px 32px rgba(0,0,0,0.2);width:300px;overflow:hidden;animation:sbPopIn 0.15s cubic-bezier(0.22,1,0.36,1) both; }
  #reaction-picker.show { display:block; }
  .reaction-picker-header { display:flex;align-items:center;justify-content:space-between;padding:10px 12px 8px;border-bottom:1px solid var(--border); }
  .reaction-picker-title { font-size:11px;font-weight:800;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.08em; }
  .reaction-picker-upload { font-family:var(--font-body);font-size:11px;font-weight:800;background:var(--signal-faint);color:var(--signal);border:1px solid var(--signal);border-radius:6px;padding:3px 10px;cursor:pointer;transition:background 0.15s; }
  .reaction-picker-upload:hover { background:var(--signal-glow); }
  .reaction-picker-grid { display:flex;flex-wrap:wrap;gap:2px;padding:10px;max-height:220px;overflow-y:auto; }
  .reaction-emoji-btn { width:36px;height:36px;display:flex;align-items:center;justify-content:center;font-size:20px;border-radius:8px;cursor:pointer;transition:background 0.1s,transform 0.1s;border:none;background:none;position:relative; }
  .reaction-emoji-btn:hover { background:var(--bg-hover);transform:scale(1.2); }
  .reaction-emoji-btn img { width:24px;height:24px;object-fit:contain;border-radius:4px; }
  .reaction-custom-del { display:none;position:absolute;top:-4px;right:-4px;background:#ff6b6b;color:#fff;font-size:9px;font-weight:900;width:14px;height:14px;border-radius:50%;align-items:center;justify-content:center;cursor:pointer;z-index:1; }
  .reaction-emoji-btn:hover .reaction-custom-del { display:flex; }
  .reaction-section-label { width:100%;font-size:10px;font-weight:800;color:var(--text-muted);text-transform:uppercase;letter-spacing:0.08em;padding:4px 2px 2px; }

  .mention-dropdown {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0; right: 0;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-bright);
    border-radius: 14px;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
    overflow: hidden;
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
  }
  .mention-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.12s;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
  }
  .mention-item:hover, .mention-item.selected {
    background: var(--signal-faint);
    color: var(--signal);
  }
  .mention-item-avatar {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--sand-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800;
    color: var(--tiki-brown);
    flex-shrink: 0;
    overflow: hidden;
  }
  .mention-item-avatar img { width:100%;height:100%;object-fit:cover; }
  .mention-item-name { flex: 1; }
  .mention-item-role {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Mention pill in messages */
  .mention-pill {
    display: inline-flex;
    align-items: center;
    background: var(--signal-faint);
    color: var(--signal);
    border-radius: 4px;
    padding: 0 5px;
    font-weight: 800;
    font-size: 0.95em;
    cursor: default;
    transition: background 0.12s;
  }
  .mention-pill:hover { background: var(--signal-glow); }
  .mention-pill.mention-self {
    background: rgba(244,162,40,0.15);
    color: var(--mango);
  }

  /* Message group highlight when it mentions the current user */
  .msg-group.has-mention, .msg-continuation.has-mention {
    background: rgba(244,162,40,0.06);
    border-left: 3px solid var(--mango);
    border-radius: 0 8px 8px 0;
    padding-left: 6px;
    margin-left: -9px;
  }

  /* Numbered unread badge on resort/cabana */
  .unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    background: var(--signal);
    color: #fff;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 900;
    padding: 0 5px;
    margin-left: auto;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  }
  .resort-name.has-unread { font-weight: 900; color: #fff; }
  .cabana-item.has-mention .cabana-name { color: var(--mango); font-weight: 900; }
  .cabana-item.has-mention .cabana-hash { color: var(--mango); opacity: 1; }
  .resort-name.has-unread {
    font-weight: 900;
    color: #fff;
  }
  .unread-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--hibiscus, #e05c8a);
    flex-shrink: 0;
    margin-left: 4px;
    display: inline-block;
  }
  .cabana-item.has-unread .cabana-name {
    font-weight: 900;
    color: #fff;
  }
  .cabana-item.has-unread .cabana-hash {
    color: var(--hibiscus, #e05c8a);
  }
  .cabana-unread-dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--hibiscus, #e05c8a);
    flex-shrink: 0;
    margin-left: auto;
  }

  /* ── SCREEN SHARE ── */
  #stream-panel {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 20;
    background: #0a0f0a;
    flex-direction: column;
  }
  #stream-panel.show { display: flex; }
  .stream-panel-header { display:flex;align-items:center;justify-content:space-between;padding:10px 14px;background:rgba(0,0,0,0.5);border-bottom:1px solid rgba(255,255,255,0.08);flex-shrink:0; }
  .stream-panel-title { font-size:13px;font-weight:800;color:#74c69d; }
  .stream-ctrl-btn { background:rgba(255,255,255,0.08);border:none;border-radius:6px;color:#fff;font-size:13px;padding:4px 8px;cursor:pointer;transition:background 0.15s; }
  .stream-ctrl-btn:hover { background:rgba(255,255,255,0.18); }
  .stream-ctrl-btn.danger { background:rgba(224,82,82,0.3); }
  .stream-ctrl-btn.danger:hover { background:rgba(224,82,82,0.6); }
  .stream-ctrl-btn.active { background:rgba(82,183,136,0.3);color:#74c69d; }
  .stream-vol-slider { width:70px;height:4px;cursor:pointer; }
  .stream-videos-wrap { flex:1;overflow-y:auto;display:flex;flex-direction:column;gap:8px;padding:8px;background:#000; }
  .stream-video-card { position:relative;background:#000;border-radius:10px;overflow:hidden;flex:1;min-height:200px; }
  .stream-video-card video { width:100%;height:100%;object-fit:contain;display:block; }
  .stream-video-label { position:absolute;bottom:8px;left:10px;background:rgba(0,0,0,0.6);color:#fff;font-size:11px;font-weight:700;padding:3px 8px;border-radius:100px; }

  /* Soundboard — always fixed above voice bar */
  /* soundboard popup — defined further below */

  #stream-pip { display:none;position:fixed;bottom:70px;right:16px;width:280px;background:#0a0f0a;border:1.5px solid rgba(82,183,136,0.4);border-radius:12px;z-index:400;box-shadow:0 8px 32px rgba(0,0,0,0.6);overflow:hidden;cursor:move;user-select:none; }
  #stream-pip.show { display:block; }
  .pip-drag-handle { display:flex;align-items:center;justify-content:space-between;padding:6px 10px;background:rgba(0,0,0,0.5);cursor:move; }
  #pip-title { font-size:11px;font-weight:700;color:#74c69d; }
  .pip-btn { background:rgba(255,255,255,0.1);border:none;border-radius:4px;color:#fff;font-size:12px;padding:2px 6px;cursor:pointer; }
  .pip-btn:hover { background:rgba(255,255,255,0.2); }
  .pip-videos { display:flex;flex-direction:column;gap:4px;padding:4px;max-height:200px;overflow-y:auto; }
  .pip-videos video { width:100%;border-radius:6px;background:#000;display:block; }
  @keyframes slideInRight { from{opacity:0;transform:translateX(20px);}to{opacity:1;transform:none;} }
  #voice-bar-screen.sharing { background:rgba(82,183,136,0.35);color:#74c69d; }
  .join-live-btn { display:inline-flex;align-items:center;gap:4px;background:rgba(82,183,136,0.2);border:1px solid rgba(82,183,136,0.5);border-radius:6px;color:#74c69d;font-size:10px;font-weight:800;padding:2px 7px;cursor:pointer;margin-left:4px;flex-shrink:0;transition:background 0.15s;letter-spacing:0.03em;text-transform:uppercase; }
  .join-live-btn:hover { background:rgba(82,183,136,0.35); }
  .live-dot { width:5px;height:5px;border-radius:50%;background:#74c69d;animation:pulse-voice 1.2s ease-in-out infinite;flex-shrink:0; }

  @keyframes livePulse {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.4; }
  }

  /* ── SOUNDBOARD POPUP (corner menu) ── */
  #soundboard {
    display: none;
    position: fixed;
    bottom: 72px;
    right: 16px;
    width: 320px;
    max-height: 380px;
    z-index: 500;
    background: linear-gradient(180deg, #0f2414 0%, #0a1a0d 100%);
    border: 1.5px solid rgba(82,183,136,0.4);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.55);
    overflow: hidden;
    animation: sbPopIn 0.18s cubic-bezier(0.22,1,0.36,1) both;
  }
  @keyframes sbPopIn {
    from { opacity:0; transform: scale(0.92) translateY(10px); transform-origin: bottom right; }
    to   { opacity:1; transform: none; }
  }
  #soundboard.show { display: block; }

  .soundboard-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  /* Top row: title + close */
  .soundboard-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  /* Bottom row: volume + upload */
  .soundboard-header-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .soundboard-title {
    font-size: 11px;
    font-weight: 800;
    color: rgba(255,255,255,0.45);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  .soundboard-upload-btn {
    background: rgba(82,183,136,0.15);
    border: 1.5px solid rgba(82,183,136,0.35);
    border-radius: 8px;
    color: #74c69d;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 12px;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .soundboard-upload-btn:hover { background: rgba(82,183,136,0.28); }

  .soundboard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
    max-height: 260px;
    overflow-y: auto;
  }
  .soundboard-grid::-webkit-scrollbar { width: 3px; }
  .soundboard-grid::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

  .sound-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: rgba(255,255,255,0.85);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s;
    max-width: 130px;
    position: relative;
  }
  .sound-btn:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.25); }
  .sound-btn.playing {
    background: rgba(82,183,136,0.2);
    border-color: #52b788;
    color: #74c69d;
    transform: scale(0.96);
  }
  .sound-btn-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .sound-btn-delete {
    background: none;
    border: none;
    color: rgba(255,100,100,0.5);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
  }
  .sound-btn-delete:hover { color: rgba(255,100,100,0.9); }
  .soundboard-empty {
    font-size: 12px;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
    padding: 4px 0 8px;
  }
  .voice-bar-btn.soundboard-active { background: rgba(82,183,136,0.3); color: #74c69d; }

  /* Deserted Island AFK channel */
  .bonfire-item.is-afk {
    border: 1px dashed rgba(255,200,100,0.4);
    color: rgba(255,200,100,0.85);
  }
  .bonfire-item.is-afk:hover { border-color: rgba(255,200,100,0.7); }
  .bonfire-item.is-afk.in-voice { color: #7de8ff; border-color: rgba(0,180,216,0.4); }

  /* AFK warning overlay on voice bar */
  #afk-warning {
    display: none;
    position: fixed;
    bottom: 60px; left: 50%; transform: translateX(-50%);
    z-index: 600;
    background: linear-gradient(135deg, #7c4a1e, #a0622a);
    border: 2px solid var(--mango);
    border-radius: 16px;
    padding: 14px 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    animation: slideInRight 0.3s cubic-bezier(0.22,1,0.36,1) both;
    min-width: 280px;
  }
  #afk-warning.show { display: block; }
  .afk-warning-title { font-size: 15px; font-weight: 800; color: #fff; margin-bottom: 6px; }
  .afk-warning-sub   { font-size: 13px; color: rgba(255,255,255,0.75); margin-bottom: 12px; }
  .afk-warning-btn   {
    background: var(--mango); border: none; border-radius: 10px;
    color: #fff; font-size: 13px; font-weight: 800;
    padding: 8px 20px; cursor: pointer; transition: background 0.15s;
  }
  .afk-warning-btn:hover { background: #e89020; }

  /* I'm Back button shown in voice bar when in AFK channel */
  .voice-bar-back-btn {
    background: rgba(244,162,40,0.3);
    border: none; border-radius: 8px;
    color: #ffb347; font-size: 12px; font-weight: 800;
    padding: 7px 12px; cursor: pointer; white-space: nowrap; flex-shrink: 0;
    transition: background 0.15s;
  }
  .voice-bar-back-btn:hover { background: rgba(244,162,40,0.55); }
  .resort-drag-handle {
    font-size: 14px;
    color: rgba(255,255,255,0.3);
    cursor: grab;
    flex-shrink: 0;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
    user-select: none;
    text-shadow: none;
  }
  .resort-drag-handle:hover { color: rgba(255,255,255,0.7); }
  .resort-drag-handle:active { cursor: grabbing; }
  .resort-group.dragging { opacity: 0.5; }

  /* Resort voice hover popup */
  .resort-header { position: relative; }
  .resort-voice-popup {
    display: none;
    position: fixed;  /* fixed so overflow:hidden on sidebar can't clip it */
    width: 220px;
    background: var(--bg-surface);
    border: 1.5px solid var(--border-bright);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.04);
    z-index: 9000;
    overflow: hidden;
    pointer-events: none;
    animation: sbPopIn 0.15s cubic-bezier(0.22,1,0.36,1) both;
  }
  .resort-voice-popup.visible { display: block; }
  .resort-voice-popup-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 8px 12px 6px;
    border-bottom: 1px solid var(--border);
  }
  .resort-voice-popup-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--border);
  }
  .resort-voice-popup-row:last-child { border-bottom: none; }
  .resort-voice-popup-av {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--bg-raised);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800;
    color: var(--text-muted);
    flex-shrink: 0;
    overflow: hidden;
    border: 1.5px solid var(--border);
  }
  .resort-voice-popup-info { flex: 1; min-width: 0; }
  .resort-voice-popup-name { font-size: 12px; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .resort-voice-popup-bon  { font-size: 10px; color: var(--text-muted); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  /* Resort right-click menu */
  #resort-ctx-menu {
    position: fixed; z-index: 500;
    background: #fffcf5;
    border: 2px solid var(--sand-border);
    border-radius: 14px; padding: 6px; min-width: 190px;
    box-shadow: 0 8px 32px rgba(107,60,30,0.18);
    display: none;
    animation: ctxIn 0.12s cubic-bezier(0.22,1,0.36,1) both;
  }
  #resort-ctx-menu.open { display: block; }
  [data-theme="dark"] #resort-ctx-menu { background: #1a2a1e; border-color: var(--border-bright); }

  .sidebar-user {
    border-top: 1px solid rgba(0,0,0,0.25);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    cursor: pointer;
    transition: background var(--transition);
    background: rgba(0,0,0,0.28);
  }
  .sidebar-user:hover { background: rgba(0,0,0,0.42); }
  .user-avatar-sm {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: var(--sand-dark);
    border: 2px solid rgba(255,255,255,0.3);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 800;
    color: var(--tiki-brown);
    overflow: hidden;
    flex-shrink: 0;
  }
  .user-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
  .user-info { flex: 1; min-width: 0; }
  .user-name { font-size: 14px; font-weight: 800; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-shadow: 0 1px 5px rgba(0,0,0,0.7); }
  .user-status { font-size: 11px; color: rgba(255,255,255,0.75); font-weight: 600; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }

  /* ── MAIN CHAT AREA ── */
  .chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    background: transparent;
    overflow: hidden;
    position: relative;
  }

  .chat-header {
    padding: 0 24px;
    height: 58px;
    border-bottom: 2px solid var(--sand-border);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.88);
    backdrop-filter: blur(8px);
  }
  .chat-header-hash {
    font-size: 20px;
    color: var(--signal);
  }
  .chat-header-name {
    font-size: 16px;
    font-weight: 800;
    color: var(--tiki-brown);
  }
  .chat-header-sep { color: var(--sand-border); font-size: 18px; }
  .chat-header-desc {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .chat-header-actions { display: flex; gap: 4px; }
  .header-btn {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    transition: var(--transition);
  }
  .header-btn:hover { background: var(--signal-faint); color: var(--signal); }
  .member-count {
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    color: var(--palm);
    display: flex; align-items: center; gap: 5px;
  }
  .member-count .online-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--palm-light); }

  /* ── MESSAGES ── */
  .messages-wrap {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 24px 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    scroll-behavior: smooth;
    background:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='1' fill='%23c8dfc0' opacity='0.4'/%3E%3C/svg%3E");
  }

  .messages-wrap::-webkit-scrollbar { width: 5px; }
  .messages-wrap::-webkit-scrollbar-track { background: transparent; }
  .messages-wrap::-webkit-scrollbar-thumb { background: var(--sand-border); border-radius: 6px; }

  .day-divider {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 0 8px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
  }
  .day-divider::before, .day-divider::after {
    content: ''; flex: 1; height: 1px; background: var(--sand-border);
  }

  .msg-group {
    display: flex;
    gap: 12px;
    padding: 6px 10px;
    border-radius: 12px;
    transition: background var(--transition);
  }
  .msg-group:hover { background: rgba(255,255,255,0.7); }

  .msg-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--sand-dark);
    border: 2px solid var(--sand-border);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 800;
    color: var(--tiki-brown);
    flex-shrink: 0;
    overflow: hidden;
    margin-top: 2px;
    cursor: pointer;
  }
  .msg-avatar img { width: 100%; height: 100%; object-fit: cover; }

  .msg-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .msg-meta {
    display: flex; align-items: baseline; gap: 10px;
    margin-bottom: 3px;
  }
  .msg-author {
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
  }
  .msg-author:hover { text-decoration: underline; }
  .msg-time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
  }
  .msg-text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
    font-weight: 500;
    word-break: break-word;
    white-space: pre-wrap;
  }
  .msg-text a { color: var(--ocean); }

  .msg-continuation {
    padding-left: 0;
    padding-top: 1px;
    padding-bottom: 1px;
  }
  .msg-continuation .msg-text { font-size: 14px; line-height: 1.6; }
  .msg-continuation:hover { background: rgba(255,255,255,0.65); border-radius: 10px; }
  .msg-time-inline {
    font-family: var(--font-mono);
    font-size: 9px;
    color: transparent;
    width: 48px;
    flex-shrink: 0;
    text-align: right;
    padding-right: 8px;
    transition: color var(--transition);
    user-select: none;
    line-height: 1.6;
    margin-top: 2px;
  }
  .msg-continuation:hover .msg-time-inline { color: var(--text-muted); }
  .msg-continuation-inner {
    display: flex;
    align-items: flex-start;
    gap: 0;
  }

  .msg-image-wrap {
    margin-top: 8px;
    max-width: 420px;
    position: relative;
    cursor: pointer;
  }
  .msg-image-wrap img {
    width: 100%;
    max-height: 320px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid var(--sand-border);
    display: block;
    transition: filter var(--transition);
  }
  .msg-image-wrap:hover img { filter: brightness(0.92); }
  .img-copy-btn {
    position: absolute;
    top: 8px; right: 8px;
    background: rgba(107,60,30,0.8);
    border: none;
    border-radius: 8px;
    color: #fff;
    padding: 4px 10px;
    font-size: 11px;
    font-family: var(--font-body);
    font-weight: 700;
    cursor: pointer;
    opacity: 0;
    transition: opacity var(--transition);
  }
  .msg-image-wrap:hover .img-copy-btn { opacity: 1; }

  /* ── INPUT AREA ── */
  .input-area {
    padding: 14px 20px 18px;
    flex-shrink: 0;
    background: rgba(255,255,255,0.6);
    backdrop-filter: blur(6px);
    border-top: 2px solid var(--sand-border);
  }
  .input-box {
    background: rgba(255,252,245,0.97);
    border: 2px solid var(--sand-border);
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    transition: border-color var(--transition), box-shadow var(--transition);
    position: relative;
    box-shadow: 0 2px 8px rgba(107,60,30,0.08);
  }
  .input-box:focus-within {
    border-color: var(--signal);
    box-shadow: 0 0 0 3px var(--signal-faint), 0 2px 8px rgba(107,60,30,0.08);
  }
  .input-image-preview {
    display: none;
    padding: 10px 14px 0;
    gap: 8px;
    flex-wrap: wrap;
  }
  .input-image-preview.has-images { display: flex; }
  .preview-thumb {
    position: relative;
    width: 80px; height: 80px;
  }
  .preview-thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--sand-border);
  }
  .preview-thumb-remove {
    position: absolute;
    top: -5px; right: -5px;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: var(--red);
    border: none;
    color: #fff;
    font-size: 11px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    line-height: 1;
    font-weight: 700;
  }
  .input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 10px 10px 16px;
  }
  .input-field {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    resize: none;
    max-height: 180px;
    line-height: 1.5;
    padding: 4px 0;
  }
  .input-field::placeholder { color: var(--text-muted); font-weight: 400; }
  .input-actions {
    display: flex;
    gap: 4px;
    padding-bottom: 2px;
  }
  .input-action-btn {
    width: 34px; height: 34px;
    border-radius: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px;
    transition: var(--transition);
  }
  .input-action-btn:hover { color: var(--signal); background: var(--signal-faint); }
  .send-btn {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: var(--signal);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    transition: var(--transition);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(224,92,138,0.35);
  }
  .send-btn:hover { background: var(--signal-dim); transform: scale(1.06); box-shadow: 0 4px 14px rgba(224,92,138,0.45); }
  .send-btn:disabled { background: var(--sand-mid); color: var(--text-muted); cursor: not-allowed; box-shadow: none; transform: none; }

  .input-hint {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 14px 10px;
    display: flex; gap: 14px;
  }
  .input-hint kbd {
    font-family: var(--font-mono);
    background: var(--sand-dark);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 9px;
    color: var(--text-secondary);
    margin-right: 3px;
  }

  /* ── PASTE DROP OVERLAY ── */
  .paste-overlay {
    position: absolute;
    inset: 0;
    background: rgba(224,92,138,0.06);
    border: 3px dashed var(--signal);
    border-radius: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 800;
    color: var(--signal);
    z-index: 10;
    pointer-events: none;
  }
  .paste-overlay.show { display: flex; }

  /* ── EMPTY STATE ── */
  .empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    height: 100%;
    text-align: center;
    gap: 10px;
    padding: 0;
    position: relative;
    overflow: hidden;
    background: url('images/Lonely_night_at_the_bus_stop.png') center center / cover no-repeat;
  }
  .empty-state-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      180deg,
      rgba(0,0,0,0.05) 0%,
      rgba(0,0,0,0.1) 50%,
      rgba(0,0,0,0.72) 100%
    );
    pointer-events: none;
  }
  .empty-state-content {
    position: relative;
    z-index: 1;
    padding: 0 32px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
  }
  .empty-icon { font-size: 42px; }
  .empty-title {
    font-size: 18px;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  }
  .empty-sub {
    font-size: 13px;
    line-height: 1.7;
    max-width: 280px;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  }

  /* ── MODALS ── */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(44,26,14,0.55);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
  }
  .modal-overlay.open { display: flex; }
  .modal {
    background: #fffcf5;
    border: 2px solid var(--sand-border);
    border-radius: 22px;
    padding: 32px;
    width: 430px;
    max-width: 95vw;
    box-shadow: 0 12px 60px rgba(107,60,30,0.25);
    animation: cardIn 0.25s cubic-bezier(0.22,1,0.36,1) both;
  }
  .modal-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--tiki-brown);
  }
  .modal-sub {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 22px;
    line-height: 1.6;
  }
  .modal-actions { display: flex; gap: 10px; margin-top: 8px; }
  .modal-actions .btn { flex: 1; }
  .modal-close {
    float: right;
    background: none; border: none;
    color: var(--text-muted); font-size: 22px;
    cursor: pointer; padding: 0; line-height: 1;
    transition: color var(--transition);
  }
  .modal-close:hover { color: var(--signal); }

  .invite-code-display {
    background: var(--sand-dark);
    border: 2px solid var(--sand-border);
    border-radius: 12px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
  }
  .invite-code {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 0.15em;
    color: var(--signal);
  }
  .copy-code-btn {
    background: var(--signal);
    border: none;
    border-radius: 10px;
    padding: 7px 14px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(224,92,138,0.3);
  }
  .copy-code-btn:hover { background: var(--signal-dim); }

  /* ── IMAGE LIGHTBOX ── */
  .lightbox {
    position: fixed;
    inset: 0;
    background: rgba(44,26,14,0.94);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    cursor: zoom-out;
  }
  .lightbox.open { display: flex; }
  .lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 16px;
    box-shadow: 0 0 80px rgba(0,0,0,0.7);
  }
  .lightbox-actions {
    position: fixed;
    top: 20px; right: 20px;
    display: flex; gap: 8px;
  }
  .lightbox-btn {
    background: rgba(255,252,245,0.12);
    border: 1px solid rgba(255,252,245,0.25);
    border-radius: 10px;
    color: #fff;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition);
  }
  .lightbox-btn:hover { background: rgba(255,252,245,0.22); }

  /* ── SCROLLBAR ── */
  .channel-list::-webkit-scrollbar { width: 3px; }
  .channel-list::-webkit-scrollbar-track { background: transparent; }
  .channel-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 4px; }

  /* ── VOICE CHANNEL ── */
  .voice-section {
    padding: 8px 10px 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
  }
  .voice-channel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    color: rgba(255,255,255,0.65);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: background var(--transition);
  }
  .voice-channel-item:hover { background: rgba(255,255,255,0.1); color: #fff; }
  .voice-channel-item.in-voice { background: rgba(82,183,136,0.2); color: #74c69d; }
  .voice-icon { font-size: 15px; }

  /* Who's in voice */
  #voice-participants {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px 10px 0;
  }
  .voice-participant {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 6px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    transition: background 0.15s ease;
  }
  .voice-participant-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
  }
  .voice-participant-avatar img { width: 100%; height: 100%; object-fit: cover; }
  .voice-participant-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .voice-participant-mic { font-size: 11px; flex-shrink: 0; }

  /* Speaking indicator */
  .voice-participant.speaking {
    background: rgba(116,198,157,0.15);
    color: #74c69d;
  }
  .voice-participant.speaking .voice-participant-avatar {
    border-color: #74c69d;
    box-shadow: 0 0 0 3px rgba(116,198,157,0.3);
  }
  .voice-participant.speaking .voice-participant-mic { color: #74c69d; }

  /* Voice controls bar (shown when in voice) */
  #voice-controls {
    display: none;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    margin: 4px 10px 0;
  }
  #voice-controls.show { display: flex; }
  .voice-ctrl-btn {
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
  }
  .voice-ctrl-btn:hover { background: rgba(255,255,255,0.22); }
  .voice-ctrl-btn.muted { background: rgba(224,82,82,0.3); }
  #voice-ctrl-label {
    font-size: 11px;
    font-weight: 700;
    color: rgba(255,255,255,0.6);
    flex: 1;
  }
  .voice-leave-btn {
    background: rgba(224,82,82,0.4);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    padding: 5px 10px;
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
  }
  .voice-leave-btn:hover { background: rgba(224,82,82,0.7); }

  /* Voice settings modal */
  .voice-settings-section {
    margin-bottom: 20px;
  }
  .voice-settings-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 12px;
  }
  .voice-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
  }
  .voice-slider-icon { font-size: 16px; flex-shrink: 0; width: 22px; text-align: center; }
  .voice-slider-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 80px;
    flex-shrink: 0;
  }
  .voice-slider {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--sand-border);
    border-radius: 99px;
    outline: none;
    cursor: pointer;
  }
  .voice-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--signal);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(224,92,138,0.4);
  }
  .voice-slider::-moz-range-thumb {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--signal);
    border: none;
    cursor: pointer;
  }
  .voice-slider-val {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
  }
  .voice-member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
  }
  .voice-member-row:last-child { border-bottom: none; }
  .voice-member-avatar-sm {
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--sand-dark);
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800;
    color: var(--tiki-brown);
    flex-shrink: 0;
    overflow: hidden;
  }
  .voice-member-avatar-sm img { width: 100%; height: 100%; object-fit: cover; }
  .voice-member-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #voice-member-volumes { max-height: 200px; overflow-y: auto; }

  /* Device selector dropdown */
  .voice-device-select {
    width: 100%;
    background: var(--sand);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 9px 12px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
  }
  .voice-device-select:focus { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-faint); }
  [data-theme="dark"] .voice-device-select { background-color: var(--bg-mid); color: var(--text-primary); border-color: var(--border-bright); }

  /* ── NOTIFICATION TOAST ── */
  #toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--tiki-brown);
    border: none;
    border-radius: 30px;
    padding: 10px 22px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
    z-index: 999;
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(107,60,30,0.35);
  }
  #toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  /* ── RESPONSIVE ── */
  /* ══════════════════════════════════════════════════════
     MOBILE — sidebar becomes a full overlay drawer
     ══════════════════════════════════════════════════════ */
  @media (max-width: 768px) {

    /* Body already uses position:fixed — ensure app fills it */
    #screen-app {
      position: fixed !important;
      top: 0; left: 0;
      width: 100% !important;
      height: 100% !important;
      height: 100dvh !important;
      overflow: hidden;
      flex-direction: row;
    }

    /* Queue sidebar on mobile — full-width overlay */
    .queue-sidebar {
      position: fixed !important;
      top: 0; right: 0;
      width: 100vw !important;
      height: 100% !important;
      z-index: 300 !important;
      box-shadow: -4px 0 32px rgba(0,0,0,0.45) !important;
    }

    /* Chat area fills the whole screen */
    .chat-area {
      width: 100% !important;
      min-width: 0 !important;
      flex: 1 !important;
      height: 100% !important;
    }

    /* Sidebar becomes a fixed overlay drawer — hidden off left edge by default */
    .sidebar {
      position: fixed !important;
      top: 0 !important; left: 0 !important;
      height: 100% !important;
      height: 100dvh !important;
      width: 82vw !important;
      max-width: 300px !important;
      z-index: 300 !important;
      transform: translateX(-100%) !important;
      transition: transform 0.28s cubic-bezier(0.22,1,0.36,1) !important;
      box-shadow: none;
      overflow-y: auto;
      overflow-x: hidden;
      flex-shrink: 0 !important;
    }

    /* When drawer is open — slide in over the chat */
    .sidebar.mobile-open {
      transform: translateX(0) !important;
      box-shadow: 4px 0 32px rgba(0,0,0,0.45) !important;
    }

    /* Override desktop collapsed state — irrelevant on mobile */
    .sidebar.collapsed {
      width: 82vw !important;
      transform: translateX(-100%) !important;
    }
    .sidebar.collapsed.mobile-open {
      transform: translateX(0) !important;
    }
    .sidebar.collapsed .sidebar-logo,
    .sidebar.collapsed .sidebar-section,
    .sidebar.collapsed .voice-section,
  
    .sidebar.collapsed .user-info,
    .sidebar.collapsed .user-status,
    .sidebar.collapsed .dark-toggle,
    .sidebar.collapsed .resort-join-wrap {
      display: flex !important;
    }
    .sidebar.collapsed .resort-list {
      display: flex !important;
      flex-direction: column;
      align-items: stretch !important;
      gap: 0 !important;
    }
    .sidebar.collapsed .resort-group { display: block !important; }
    .sidebar.collapsed .resort-header { justify-content: flex-start !important; padding: 6px 8px 4px 12px !important; }
    .sidebar.collapsed .resort-name { display: block !important; }
    .sidebar.collapsed .resort-chevron { display: inline-block !important; }
    .sidebar.collapsed .resort-section-label { display: flex !important; }
    .sidebar.collapsed .cabana-item { display: flex !important; }
    .sidebar.collapsed .bonfire-item { display: flex !important; }
    .sidebar.collapsed .resort-body { display: block !important; }
    .sidebar.collapsed .resort-avatar { width: 28px !important; height: 28px !important; }
    .sidebar.collapsed .sidebar-section { display: block !important; }

    .sidebar.collapsed .resort-join-wrap { display: block !important; }
    .sidebar.collapsed .user-info       { display: block !important; }
    .sidebar.collapsed .sidebar-header  {
      justify-content: space-between !important;
      padding: 18px 16px 14px !important;
    }
    .sidebar.collapsed .sidebar-user { justify-content: flex-start !important; padding: 12px 14px !important; }
    .sidebar.collapsed .user-avatar-sm { margin: 0 !important; }

    /* Semi-transparent overlay behind the open drawer */
    #sidebar-overlay {
      display: none;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.5);
      z-index: 299;
      -webkit-backdrop-filter: blur(2px);
      backdrop-filter: blur(2px);
    }
    #sidebar-overlay.show { display: block; }

    /* Chat header tweaks */
    .chat-header { padding: 0 10px; gap: 6px; height: 52px; }
    .chat-header-desc, .chat-header-sep { display: none; }
    .member-count { display: none; }

    /* Show the in-chat hamburger on mobile */
    #chat-header-hamburger { display: flex !important; }

    /* Input area */
    .input-area { padding: 6px 8px; }
    .input-hint { display: none; }
    .input-box { border-radius: 14px; }

    /* Messages */
    .messages-wrap { padding: 12px 10px; }
    .msg-text { font-size: 14px; }
    .msg-group { gap: 8px; }
    .msg-avatar { width: 30px !important; height: 30px !important; font-size: 10px !important; }

    /* Modals fit on small screens */
    .modal { width: 94vw; max-height: 88vh; overflow-y: auto; padding: 22px 18px; }

    /* Images and embeds don't overflow */
    .msg-image-wrap img { max-width: 100%; border-radius: 10px; }
    .yt-embed-wrap { max-width: 100%; }
    .link-preview-wrap { max-width: 100%; }

    /* Auth card fits on mobile */
    .onboard-card { width: 94vw; padding: 24px 18px; max-height: 92vh; overflow-y: auto; }

    /* Context menus — wider tap targets on mobile */
    .ctx-item { padding: 12px 14px; font-size: 14px; }
  }

  /* Mobile landscape — short viewport, make sidebar scrollable and compact */
  @media (max-width: 900px) and (orientation: landscape) {
    .sidebar {
      overflow-y: auto !important;
      height: 100dvh !important;
    }
    .sidebar-header {
      padding: 8px 14px !important;
    }
    .sidebar-logo img {
      height: 60px !important;
    }
    .resort-join-wrap {
      padding: 3px 10px !important;
    }
    .resort-join-btn {
      padding: 6px 10px !important;
      font-size: 12px !important;
    }
    .resort-list {
      flex: 1;
      overflow-y: auto !important;
      min-height: 0;
    }
    .resort-header {
      padding: 5px 10px !important;
    }
    .cabana-item, .bonfire-item {
      padding: 5px 10px 5px 20px !important;
      font-size: 12px !important;
    }
    .resort-section-label {
      padding: 4px 10px 2px !important;
      font-size: 10px !important;
    }
    .sidebar-user {
      padding: 8px 12px !important;
    }
    .sidebar-beach-radio {
      padding: 4px 10px !important;
    }
  }

  /* Extra small screens (older/smaller phones) */
  @media (max-width: 380px) {
    .sidebar { width: 90vw !important; max-width: 90vw !important; }
    .hero-title { font-size: 13px; }
    .chat-header-name { font-size: 13px; }
  }

  /* ── ROLES & MODERATION ── */
  .role-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
  }
  .role-badge.owner  { background: rgba(244,162,40,0.15); color: #f4a228; border: 1px solid rgba(244,162,40,0.3); }
  .role-badge.host   { background: rgba(82,183,136,0.15); color: #52b788; border: 1px solid rgba(82,183,136,0.3); }
  .role-badge.muted  { background: rgba(180,180,180,0.12); color: #888; border: 1px solid rgba(180,180,180,0.25); }
  .role-badge.banned { background: rgba(224,82,82,0.12); color: #e05252; border: 1px solid rgba(224,82,82,0.25); }

  .member-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px 14px;
    border-radius: 10px;
    transition: background 0.12s;
    border-bottom: 1px solid var(--border);
  }
  .member-row:last-child { border-bottom: none; }
  .member-row:hover { background: var(--signal-faint); }
  .member-row-info { flex: 1; min-width: 0; }
  .member-row-name { font-size: 14px; font-weight: 700; color: var(--text-primary); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .member-row-sub  { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
  .member-actions { display: flex; gap: 4px; flex-shrink: 0; }
  .member-action-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    white-space: nowrap;
  }
  .member-action-btn:hover { background: var(--sand-dark); color: var(--text-primary); }
  .member-action-btn.danger { color: var(--red); border-color: rgba(224,82,82,0.3); }
  .member-action-btn.danger:hover { background: rgba(224,82,82,0.1); border-color: rgba(224,82,82,0.5); }
  .member-action-btn.warn { color: var(--mango); border-color: rgba(244,162,40,0.3); }
  .member-action-btn.warn:hover { background: rgba(244,162,40,0.1); }

  /* Muted input state */
  .input-muted-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(var(--bg-mid-rgb,255,248,238),0.92);
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
    text-align: center;
    padding: 16px;
  }
  .input-muted-overlay.show { display: flex; }
  .input-muted-overlay .muted-icon { font-size: 28px; }
  .input-muted-overlay .muted-text { font-size: 13px; font-weight: 700; color: var(--text-secondary); }

  /* ── CONTEXT MENU ── */
  #ctx-menu, #ctx-menu-other, #ch-ctx-menu {
    position: fixed;
    z-index: 500;
    background: #fffcf5;
    border: 2px solid var(--sand-border);
    border-radius: 14px;
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(107,60,30,0.18), 0 2px 8px rgba(0,0,0,0.08);
    display: none;
    animation: ctxIn 0.12s cubic-bezier(0.22,1,0.36,1) both;
  }
  #ctx-menu.open, #ctx-menu-other.open, #ch-ctx-menu.open { display: block; }
  @keyframes ctxIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: none; }
  }
  .ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
    color: var(--text-primary);
    user-select: none;
  }
  .ctx-item:hover { background: var(--bg-hover); }
  .ctx-item.danger { color: var(--red); }
  .ctx-item.danger:hover { background: rgba(224,82,82,0.1); }
  .ctx-item-icon { font-size: 15px; }
  .ctx-sep {
    height: 1px;
    background: var(--border);
    margin: 4px 6px;
    border-radius: 1px;
  }

  /* Dark mode ctx menu */
  [data-theme="dark"] #ctx-menu,
  [data-theme="dark"] #ctx-menu-other,
  [data-theme="dark"] #ch-ctx-menu {
    background: #1a2a1e;
    border-color: var(--border-bright);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  }
  [data-theme="dark"] .ctx-item { color: var(--text-primary); }
  [data-theme="dark"] .ctx-item:hover { background: rgba(255,255,255,0.07); }
  [data-theme="dark"] .ctx-sep { background: var(--border); }

  /* ── INLINE EDIT ── */
  .msg-edit-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
  }
  .msg-edit-textarea {
    width: 100%;
    background: var(--sand);
    border: 2px solid var(--signal);
    border-radius: 10px;
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    resize: none;
    outline: none;
    line-height: 1.5;
    box-shadow: 0 0 0 3px var(--signal-faint);
  }
  [data-theme="dark"] .msg-edit-textarea {
    background: var(--sand-dark);
    color: var(--text-primary);
  }
  .msg-edit-actions {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .msg-edit-hint {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    flex: 1;
  }
  .msg-edit-hint kbd {
    font-family: var(--font-mono);
    background: var(--sand-dark);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 9px;
    color: var(--text-secondary);
    margin-right: 2px;
  }
  .msg-edit-save {
    background: var(--signal);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
  }
  .msg-edit-save:hover { background: var(--signal-dim); }
  .msg-edit-cancel {
    background: var(--sand-dark);
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 6px 12px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
  }
  .msg-edit-cancel:hover { background: var(--sand-mid); }

  /* Edited badge */
  .msg-edited-badge {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-mono);
    margin-left: 4px;
  }

  /* Deleted message placeholder */
  .msg-deleted {
    font-size: 13px;
    color: var(--text-muted);
    font-style: italic;
    font-weight: 500;
    padding: 2px 0;
  }
  /* ── REPLY BAR (shows above input when replying) ── */
  #reply-bar {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: var(--signal-faint);
    border-top: 2px solid var(--signal);
    border-radius: 14px 14px 0 0;
    margin: 0 0 -4px;
    position: relative;
  }
  #reply-bar.show { display: flex; }
  .reply-bar-icon { font-size: 16px; flex-shrink: 0; color: var(--signal); }
  .reply-bar-content { flex: 1; min-width: 0; }
  .reply-bar-name {
    font-size: 11px;
    font-weight: 800;
    color: var(--signal);
    margin-bottom: 2px;
  }
  .reply-bar-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .reply-bar-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 18px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    transition: color var(--transition);
  }
  .reply-bar-close:hover { color: var(--signal); }

  /* ── REPLY QUOTE (shown inside a message that is a reply) ── */
  .msg-reply-quote {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    margin-bottom: 6px;
    padding: 6px 10px;
    background: var(--signal-faint);
    border-left: 3px solid var(--signal);
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    transition: background var(--transition);
    max-width: 100%;
  }
  .msg-reply-quote:hover { background: var(--signal-glow); }
  .reply-quote-icon { font-size: 12px; color: var(--signal); flex-shrink: 0; margin-top: 1px; }
  .reply-quote-body { min-width: 0; flex: 1; }
  .reply-quote-name {
    font-size: 11px;
    font-weight: 800;
    color: var(--signal);
    margin-bottom: 2px;
  }
  .reply-quote-text {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  [data-theme="dark"] .msg-reply-quote { background: rgba(255,126,179,0.08); }
  [data-theme="dark"] .msg-reply-quote:hover { background: rgba(255,126,179,0.15); }

  /* ── YOUTUBE EMBED ── */
  .yt-embed-wrap {
    margin-top: 8px;
    max-width: 480px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--sand-border);
    background: #000;
    aspect-ratio: 16/9;
  }
  .yt-embed-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
  }
  [data-theme="dark"] .yt-embed-wrap { border-color: var(--border-bright); }

  /* ── LINK PREVIEW ── */
  .link-preview-wrap {
    margin-top: 8px;
    max-width: 420px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: var(--sand-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    text-decoration: none;
    transition: background var(--transition);
  }
  .link-preview-wrap:hover { background: var(--sand-mid); }
  .link-preview-icon { font-size: 20px; flex-shrink: 0; }
  .link-preview-url {
    font-size: 11px;
    color: var(--ocean);
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--font-mono);
  }
  [data-theme="dark"] .link-preview-wrap { background: var(--sand-dark); border-color: var(--border); }
  [data-theme="dark"] .link-preview-wrap:hover { background: var(--sand-mid); }
  .sound-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }
  .sound-toggle-track {
    display: inline-flex;
    align-items: center;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: var(--border);
    padding: 3px;
    transition: background 0.2s ease;
    position: relative;
  }
  .sound-toggle-track.on {
    background: var(--signal);
  }
  .sound-toggle-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.2);
    transition: transform 0.2s cubic-bezier(0.22,1,0.36,1);
    transform: translateX(0);
    display: block;
  }
  .sound-toggle-track.on .sound-toggle-thumb {
    transform: translateX(20px);
  }
  [data-theme="dark"] .sound-toggle-track {
    background: var(--border-bright);
  }
  [data-theme="dark"] .sound-toggle-track.on {
    background: var(--signal);
  }
  /* ── SIDEBAR MUSIC PLAYER ── */
  @keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
  }
    /* ══════════════════════════════════════
     RESORT ARCHITECTURE STYLES
     ══════════════════════════════════════ */

  /* Resort group in sidebar */
  .resort-group {
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding-bottom: 6px;
    margin-bottom: 6px;
  }
  .resort-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px 4px;
    cursor: pointer;
    user-select: none;
  }
  .resort-header:hover .resort-name { color: #fff; }
  .resort-chevron {
    font-size: 10px;
    color: rgba(255,255,255,0.4);
    transition: transform 0.2s ease;
    flex-shrink: 0;
  }
  .resort-chevron.open { transform: rotate(90deg); }
  .resort-name {
    font-size: 13px;
    font-weight: 800;
    color: rgba(255,255,255,0.7);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .resort-add-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.35);
    font-size: 16px;
    cursor: pointer;
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    flex-shrink: 0;
    transition: color 0.15s, background 0.15s;
    padding: 0;
  }
  .resort-add-btn:hover { color: #fff; background: rgba(255,255,255,0.1); }

  /* Section labels inside a resort */
  .resort-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px 2px;
  }
  .resort-section-label span {
    font-size: 10px;
    font-weight: 800;
    color: rgba(255,255,255,0.38);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  .resort-section-add {
    background: none;
    border: none;
    color: rgba(255,255,255,0.3);
    font-size: 15px;
    cursor: pointer;
    width: 18px; height: 18px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 4px;
    transition: color 0.15s;
    padding: 0;
  }
  .resort-section-add:hover { color: rgba(255,255,255,0.9); }

  /* Cabana item */
  .cabana-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 22px;
    border-radius: 8px;
    margin: 1px 6px;
    color: rgba(255,255,255,0.55);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
  }
  .cabana-item:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
  .cabana-item.active { background: rgba(255,255,255,0.15); color: #fff; font-weight: 700; }
  .cabana-hash { font-size: 16px; color: rgba(255,255,255,0.35); flex-shrink: 0; }

  /* Bonfire item */
  .bonfire-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px 5px 22px;
    border-radius: 8px;
    margin: 1px 6px;
    color: rgba(255,255,255,0.55);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
  }
  .bonfire-item:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
  .bonfire-item.in-voice { color: #74c69d; }
  .bonfire-item.in-voice:hover { background: rgba(82,183,136,0.12); }
  .bonfire-icon { font-size: 13px; flex-shrink: 0; }
  .bonfire-participants-inline {
    display: flex;
    flex-direction: column;
    padding-left: 46px;
    gap: 2px;
    margin-bottom: 4px;
  }
  .bonfire-participant-inline {
    font-size: 11px;
    font-weight: 600;
    color: rgba(255,255,255,0.45);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
  }
  .bonfire-participant-inline.speaking { color: #74c69d; }

  /* Persistent voice bar (shows at bottom when in a bonfire) */
  /* Pad content above voice bar when it's visible */
  body.in-voice .chat-area { padding-bottom: 58px; }
  body.in-voice .sidebar  { padding-bottom: 58px; }

  /* Resort ctx menu */
  #resort-ctx-menu {
    position: fixed; z-index: 500;
    background: #fffcf5;
    border: 2px solid var(--sand-border);
    border-radius: 14px;
    padding: 6px;
    min-width: 190px;
    box-shadow: 0 8px 32px rgba(107,60,30,0.18);
    display: none;
    animation: ctxIn 0.12s cubic-bezier(0.22,1,0.36,1) both;
  }
  #resort-ctx-menu.open { display: block; }
  [data-theme="dark"] #resort-ctx-menu {
    background: #1a2a1e;
    border-color: var(--border-bright);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  }

  /* Cabana/bonfire ctx menu */
  #ch-ctx-menu {
    position: fixed; z-index: 500;
    background: #fffcf5;
    border: 2px solid var(--sand-border);
    border-radius: 14px;
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(107,60,30,0.18);
    display: none;
    animation: ctxIn 0.12s cubic-bezier(0.22,1,0.36,1) both;
  }
  #ch-ctx-menu.open { display: block; }
  [data-theme="dark"] #ch-ctx-menu {
    background: #1a2a1e;
    border-color: var(--border-bright);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  }


/* ── SIGNUP EMAIL CONFIRMATION PANEL ── */
.signup-confirm-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 8px 0 4px;
  animation: confirmPanelIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes confirmPanelIn {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.signup-confirm-icon {
  font-size: 56px;
  line-height: 1;
  margin-bottom: 12px;
  animation: confirmBounce 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

@keyframes confirmBounce {
  0%   { transform: scale(0.5) rotate(-8deg); opacity: 0; }
  70%  { transform: scale(1.15) rotate(4deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.signup-confirm-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.signup-confirm-email {
  display: inline-block;
  background: linear-gradient(90deg, rgba(255,106,0,0.12), rgba(0,180,216,0.12));
  border: 1.5px solid rgba(255,106,0,0.3);
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 13px;
  font-weight: 700;
  color: var(--palm);
  margin-bottom: 18px;
  word-break: break-all;
}

.signup-confirm-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.signup-confirm-divider {
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #ff6a00, #00b4d8);
  border-radius: 2px;
  margin: 0 auto 18px;
}

.signup-confirm-hint {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.signup-confirm-retry {
  color: var(--palm-light);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.signup-confirm-retry:hover {
  color: var(--signal);
}

/* ── FORGOT PASSWORD ── */
.forgot-password-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--palm-light);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
.forgot-password-link:hover { color: var(--signal); }

.reset-intro {
  text-align: center;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* ── USER STATUS SYSTEM ───────────────────────────────────── */

/* Sidebar status line — clickable */
#sidebar-user-status {
  transition: color 0.15s;
}
#sidebar-user-status:hover {
  color: var(--palm-light) !important;
}

/* Tiny emoji badge next to username in chat */
.msg-status-badge {
  display: inline-block;
  font-size: 12px;
  margin: 0 3px 0 2px;
  vertical-align: middle;
  line-height: 1;
  cursor: default;
}

/* Status line in members modal */
.member-status-line {
  margin-top: 2px;
}
.status-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 1px 8px;
}

/* ── STATUS PICKER POPUP ──────────────────────────────────── */
#status-picker {
  position: fixed;
  z-index: 1100;
  width: 300px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-bright);
  border-radius: 18px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.35);
  overflow: hidden;
  animation: sbPopIn 0.18s cubic-bezier(0.22,1,0.36,1) both;
}

.status-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.status-picker-close {
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  color: var(--text-muted);
  transition: color 0.12s;
  padding: 0 2px;
}
.status-picker-close:hover { color: var(--signal); }

/* Preset grid — 2 columns */
.status-picker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 10px;
}

.status-preset-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  background: rgba(255,255,255,0.04);
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  text-align: left;
  font-family: inherit;
}
.status-preset-btn:hover {
  background: rgba(255,106,0,0.1);
  border-color: rgba(255,106,0,0.3);
}
.status-preset-btn.active {
  background: rgba(255,106,0,0.18);
  border-color: rgba(255,106,0,0.6);
}
.status-preset-emoji { font-size: 18px; flex-shrink: 0; }
.status-preset-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Custom status row */
.status-custom-row {
  padding: 0 10px 8px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
  padding-top: 10px;
}
.status-custom-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.status-custom-inputs {
  display: flex;
  gap: 6px;
  align-items: center;
}
.status-custom-emoji-input {
  width: 36px;
  text-align: center;
  font-size: 16px;
  padding: 5px 4px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-primary);
  outline: none;
  flex-shrink: 0;
}
.status-custom-text-input {
  flex: 1;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
}
.status-custom-text-input:focus,
.status-custom-emoji-input:focus {
  border-color: var(--border-bright);
}
.status-custom-save-btn {
  padding: 6px 12px;
  border-radius: 8px;
  border: none;
  background: var(--signal);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.status-custom-save-btn:hover { opacity: 0.85; }

/* Clear button */
.status-clear-btn {
  display: block;
  width: calc(100% - 20px);
  margin: 0 10px 10px;
  padding: 7px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s;
}
.status-clear-btn:hover {
  background: rgba(255,80,80,0.1);
  border-color: rgba(255,80,80,0.3);
  color: #ff8080;
}

/* ── INVITE EXPIRY MODAL ──────────────────────────────────── */
.invite-select {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
.invite-select:focus { border-color: var(--border-bright); }
[data-theme="dark"] .invite-select { background-color: var(--bg-raised); }

/* ── DM IMAGE / GIF ───────────────────────────────────────── */
.dm-media-btn {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.dm-media-btn:hover,
.dm-media-btn.active {
  background: rgba(255,106,0,0.15);
  border-color: rgba(255,106,0,0.5);
  color: var(--signal);
}

/* Image preview strip above DM input */
.dm-image-preview {
  padding: 0 10px;
  min-height: 0;
}
.dm-img-preview-wrap {
  position: relative;
  display: inline-block;
  margin: 6px 0 2px;
}
.dm-img-preview-thumb {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--border-bright);
  display: block;
}
.dm-img-preview-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Inline image inside a DM bubble */
.dm-msg-image {
  display: block;
  max-width: 220px;
  max-height: 280px;
  border-radius: 10px;
  object-fit: cover;
  cursor: pointer;
  transition: opacity 0.15s;
  margin-top: 2px;
}
.dm-msg-image:hover { opacity: 0.88; }

/* ── PROFILE LOCATION & WEATHER ───────────────────────────── */
.profile-section-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 16px 0 10px;
}

.profile-weather-card {
  background: linear-gradient(135deg, rgba(0,180,216,0.1), rgba(255,106,0,0.08));
  border: 1.5px solid rgba(0,180,216,0.25);
  border-radius: 14px;
  padding: 14px 16px;
  margin-top: 10px;
  font-family: var(--font-body);
}

.profile-weather-loading,
.profile-weather-error {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

.pw-location {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.pw-condition {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.pw-temps {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.pw-temp {
  font-size: 28px;
  font-weight: 900;
  color: var(--signal);
  line-height: 1;
}

.pw-temp-c {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-muted);
}

.pw-feels {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.pw-details {
  display: flex;
  gap: 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.pw-powered {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
}

.pw-powered a {
  color: inherit;
  text-decoration: underline;
}

/* ── LOCATION AUTOCOMPLETE ────────────────────────────────── */
.location-search-wrap {
  position: relative;
  margin-bottom: 8px;
}

.location-search-input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.location-search-input:focus { border-color: var(--border-bright); }

.location-autocomplete {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-bright);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  z-index: 2000;
  overflow: hidden;
  max-height: 220px;
  overflow-y: auto;
}

.location-autocomplete-item {
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.location-autocomplete-item:last-child { border-bottom: none; }
.location-autocomplete-item:hover { background: rgba(255,106,0,0.1); }

/* Confirmed location chip */
.profile-location-confirmed {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0,180,216,0.1);
  border: 1.5px solid rgba(0,180,216,0.25);
  border-radius: 10px;
  padding: 8px 12px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.location-clear-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  transition: color 0.12s;
}
.location-clear-btn:hover { color: var(--signal); }

/* ── SEVERE WEATHER ALERT ─────────────────────────────────── */
.severe-weather-alert {
  position: fixed;
  bottom: 80px;
  right: 20px;
  width: 340px;
  background: linear-gradient(135deg, #1a0a00, #2d0800);
  border: 2px solid #ff4400;
  border-radius: 18px;
  box-shadow: 0 0 0 4px rgba(255,68,0,0.2), 0 16px 48px rgba(0,0,0,0.5);
  z-index: 9999;
  overflow: hidden;
  animation: severeSlideIn 0.4s cubic-bezier(0.22,1,0.36,1) both;
  font-family: var(--font-body);
}

@keyframes severeSlideIn {
  from { transform: translateY(20px) scale(0.96); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.swa-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
  background: rgba(255,68,0,0.15);
  border-bottom: 1px solid rgba(255,68,0,0.3);
}

.swa-icon { font-size: 22px; flex-shrink: 0; }

.swa-title {
  flex: 1;
  font-size: 14px;
  font-weight: 900;
  color: #ff8855;
  letter-spacing: 0.02em;
}

.swa-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 20px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.12s;
}
.swa-close:hover { color: #fff; }

.swa-body {
  padding: 10px 16px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255,220,200,0.9);
}

.swa-footer {
  padding: 8px 16px 14px;
  font-size: 11px;
  color: rgba(255,150,100,0.6);
  font-weight: 600;
}

.swa-footer a {
  color: rgba(255,150,100,0.8);
  text-decoration: underline;
}

/* ── WEATHER CARD LOCAL TIME ──────────────────────────────── */
.pw-time {
  font-size: 13px;
  font-weight: 700;
  color: var(--palm-light);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}

/* ── ORANGUBAR SIDEBAR BUTTON ──────────────────────────────── */
.sidebar-orangubar-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 6px 12px 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(244, 162, 40, 0.1);
  border: 1.5px solid rgba(244, 162, 40, 0.35);
  color: rgba(255, 200, 80, 0.9);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s, transform 0.15s, box-shadow 0.18s;
}
.sidebar-orangubar-btn:hover {
  background: rgba(244, 162, 40, 0.22);
  border-color: rgba(244, 162, 40, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 162, 40, 0.25);
  color: #ffcc55;
}
.sidebar-orangubar-btn span:first-child { font-size: 16px; }

/* ── ORANGUBAR RECIPE CARDS IN CHAT ─────────────────────────── */
.recipe-card {
  display: flex;
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 6px;
  max-width: 420px;
  transition: border-color 0.15s;
}
.recipe-card:hover { border-color: var(--border-bright); }
.recipe-card-photo {
  width: 90px;
  min-height: 90px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
}
.recipe-card-photo-placeholder {
  width: 90px;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  background: var(--bg-surface);
  flex-shrink: 0;
}
.recipe-card-body {
  padding: 10px 12px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.recipe-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recipe-card-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.recipe-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 2px 0 4px;
}
.recipe-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  gap: 6px;
}
.recipe-can-make  { font-size: 11px; font-weight: 700; color: #34d399; }
.recipe-cant-make { font-size: 11px; color: var(--text-muted); }
.recipe-view-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--signal-faint);
  color: var(--signal);
  border: 1px solid rgba(255,107,53,0.3);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.recipe-view-btn:hover { background: rgba(255,107,53,0.18); }

/* ── RECIPE PICKER MODAL ─────────────────────────────────────── */
#modal-recipe-picker .modal {
  max-width: 500px;
  width: 95vw;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.recipe-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.recipe-picker-header h3 { font-size: 16px; font-weight: 800; margin: 0; }
.recipe-picker-search {
  width: 100%;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-void);
  color: var(--text-primary);
  font-size: 13px;
  margin-bottom: 8px;
  flex-shrink: 0;
  box-sizing: border-box;
}
.recipe-picker-search:focus { outline: none; border-color: var(--border-bright); }
.recipe-picker-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.recipe-filter-btn {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.recipe-filter-btn.active {
  background: var(--signal-faint);
  border-color: var(--signal);
  color: var(--signal);
}
.recipe-picker-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recipe-picker-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg-raised);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.recipe-picker-item:hover { border-color: var(--border-bright); background: var(--bg-hover); }
.recipe-picker-thumb {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  overflow: hidden;
}
.recipe-picker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.recipe-picker-info { flex: 1; min-width: 0; }
.recipe-picker-name { font-size: 13px; font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recipe-picker-sub  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.cdb-item { cursor: default; align-items: flex-start; }
.cdb-item .recipe-picker-thumb { margin-top: 2px; }
.cdb-actions { display: flex; gap: 6px; margin-top: 6px; }
.cdb-btn {
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 7px; cursor: pointer; transition: all 0.15s;
  border: 1.5px solid var(--border);
}
.cdb-btn.share { background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.4); color: #34d399; }
.cdb-btn.share:hover { background: rgba(52,211,153,0.2); }
.cdb-btn.save  { background: transparent; color: var(--text-muted); }
.cdb-btn.save:hover  { border-color: var(--border-bright); color: var(--text-primary); }
.cdb-btn:disabled { opacity: 0.5; cursor: default; }
.recipe-picker-badge { font-size: 10px; font-weight: 700; color: #34d399; margin-left: 4px; }
.recipe-picker-empty { text-align: center; padding: 30px 20px; color: var(--text-muted); font-size: 13px; }

/* ── RECIPE DETAIL MODAL ─────────────────────────────────────── */
#modal-recipe-detail .modal {
  max-width: 480px;
  width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
}
.recipe-detail-photo {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
  display: block;
}
.recipe-detail-title { font-size: 20px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.recipe-detail-meta  { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.recipe-detail-desc  { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.5; }
.recipe-detail-section-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: 14px 0 8px; }
.recipe-detail-ingredients { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 5px; }
.recipe-detail-ingredients li { font-size: 13px; color: var(--text-primary); display: flex; align-items: center; gap: 6px; }
.recipe-detail-ingredients li::before { content: '🍶'; font-size: 12px; }
.recipe-detail-steps { list-style: none; padding: 0; margin: 0; counter-reset: step; display: flex; flex-direction: column; gap: 8px; }
.recipe-detail-steps li { font-size: 13px; color: var(--text-primary); display: flex; gap: 10px; line-height: 1.5; counter-increment: step; }
.recipe-detail-steps li::before { content: counter(step); font-size: 11px; font-weight: 800; color: var(--signal); background: var(--signal-faint); border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.recipe-detail-can-make { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: #34d399; background: rgba(52,211,153,0.1); border-radius: 20px; padding: 4px 10px; margin-bottom: 12px; }
.recipe-detail-missing { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }

/* ── EVENT DROPS SIDEBAR ─────────────────────────────────────── */
.event-sidebar {
  width: 380px;
  flex-shrink: 0;
  display: none;
  flex-direction: column;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1.5px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  overflow: hidden;
}
#screen-app.event-open .event-sidebar { display: flex; }
#screen-app.event-open .chat-area { min-width: 0; }

.event-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-panel);
}
#events-header-btn { position: relative; }
.event-notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f97316;
  color: #fff;
  font-size: 9px;
  font-weight: 900;
  border-radius: 100px;
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  pointer-events: none;
  animation: livePulse 1.4s ease-in-out infinite;
}

.event-drop-btn {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1.5px solid rgba(52,211,153,0.4);
  background: rgba(52,211,153,0.1);
  color: #34d399;
  cursor: pointer;
  transition: all 0.15s;
}
.event-drop-btn:hover { background: rgba(52,211,153,0.2); }
.event-drop-btn.cancel { border-color: var(--border); background: transparent; color: var(--text-muted); }

/* Create form */
.event-create-form {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}
.event-form-row { display: flex; gap: 8px; }
.event-form-input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  box-sizing: border-box;
  transition: border-color 0.15s;
}
.event-form-input:focus { outline: none; border-color: var(--border-bright); }
.event-form-input.emoji-input { width: 52px; flex-shrink: 0; text-align: center; font-size: 18px; padding: 6px; }
.event-form-submit {
  align-self: flex-end;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 800;
  padding: 8px 18px;
  border-radius: 10px;
  border: none;
  background: var(--signal);
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}
.event-form-submit:hover { opacity: 0.88; }

/* Event list */
.event-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.event-list-section-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 4px 2px 2px;
}
.event-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Event card */
.event-card {
  background: var(--bg-raised);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.15s;
}
.event-card:hover { border-color: var(--border-bright); }
.event-card.past { opacity: 0.55; }
.event-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px 8px;
}
.event-card-emoji {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 1px;
}
.event-card-info { flex: 1; min-width: 0; }
.event-card-title { font-size: 14px; font-weight: 800; color: var(--text-primary); }
.event-card-when  { font-size: 11px; color: var(--signal); font-weight: 700; margin-top: 2px; }
.event-card-desc  { font-size: 12px; color: var(--text-secondary); margin-top: 4px; line-height: 1.4; }
.event-card-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
}
.event-card-delete:hover { opacity: 1; color: var(--red); }

/* RSVP row */
.event-card-rsvp {
  display: flex;
  gap: 6px;
  padding: 0 12px 10px;
}
.event-rsvp-btn {
  flex: 1;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 6px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  white-space: nowrap;
}
.event-rsvp-btn:hover { border-color: var(--border-bright); color: var(--text-primary); }
.event-rsvp-btn.going.active  { background: rgba(52,211,153,0.15); border-color: #34d399; color: #34d399; }
.event-rsvp-btn.maybe.active  { background: rgba(244,162,40,0.15); border-color: #f4a228; color: #f4a228; }
.event-rsvp-btn.cant.active   { background: rgba(224,82,82,0.12);  border-color: #e05252; color: #e05252; }
.event-rsvp-btn .rsvp-count   { font-size: 10px; opacity: 0.85; margin-left: 3px; }

/* ── FULL CALENDAR VIEW ───────────────────────────────────── */
.cal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
}
.cal-container {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%; max-width: 1100px;
  height: 90vh; max-height: 820px;
  display: flex; flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
}
.cal-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  flex-shrink: 0;
}
.cal-nav { display: flex; align-items: center; gap: 8px; }
.cal-nav-btn {
  background: none; border: 1px solid var(--border); color: var(--text-primary);
  font-size: 22px; line-height: 1; width: 32px; height: 32px; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.cal-nav-btn:hover { background: var(--bg-active); }
.cal-month-title { font-size: 18px; font-weight: 800; color: var(--text-primary); min-width: 180px; }
.cal-today-btn {
  font-family: var(--font-body); font-size: 11px; font-weight: 700;
  padding: 5px 12px; border-radius: 8px;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-muted); cursor: pointer; transition: all 0.15s;
}
.cal-today-btn:hover { border-color: #34d399; color: #34d399; }
#cal-weather-btn:disabled { opacity: 0.5; cursor: default; }
.cal-legend { display: flex; gap: 12px; align-items: center; margin-left: auto; }
.cal-legend-item { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-muted); }
.cal-leg-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.cal-leg-dot.going  { background: #34d399; }
.cal-leg-dot.maybe  { background: #f4a228; }
.cal-leg-dot.cant   { background: #e05252; }
.cal-leg-dot.none   { background: var(--border-bright); }
.cal-close-btn {
  background: none; border: none; color: var(--text-muted); font-size: 20px;
  cursor: pointer; padding: 0 4px; line-height: 1; transition: color 0.15s;
}
.cal-close-btn:hover { color: var(--text-primary); }
.cal-dow-row {
  display: grid; grid-template-columns: repeat(7,1fr);
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cal-dow-row > div {
  text-align: center; padding: 7px 4px; font-size: 11px;
  font-weight: 700; color: var(--text-muted); letter-spacing: 0.04em;
}
.cal-grid {
  display: grid; grid-template-columns: repeat(7,1fr);
  grid-template-rows: repeat(6,1fr);
  flex: 1; overflow: hidden;
}
.cal-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 6px 7px;
  display: flex; flex-direction: column; gap: 2px;
  overflow: hidden; cursor: default;
  transition: background 0.1s;
  min-height: 0;
}
.cal-cell:hover { background: var(--bg-active); }
.cal-cell:nth-child(7n) { border-right: none; }
.cal-cell-other { opacity: 0.35; }
.cal-cell-today { background: rgba(52,211,153,0.06); }
.cal-cell-today .cal-date-num {
  background: #34d399; color: #0a2418;
  border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
}
.cal-cell-top { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.cal-date-num { font-size: 12px; font-weight: 700; color: var(--text-primary); line-height: 1; }
.cal-moon { font-size: 11px; line-height: 1; cursor: help; }
.cal-holiday {
  font-size: 9px; font-weight: 700; color: #f4a228;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  flex-shrink: 0;
}
.cal-events { display: flex; flex-direction: column; gap: 2px; overflow: hidden; flex: 1; min-height: 0; }
.cal-event-pill {
  font-size: 10px; font-weight: 600; padding: 2px 5px; border-radius: 4px;
  background: rgba(255,255,255,0.07); border-left: 3px solid var(--border-bright);
  color: var(--text-secondary); cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; transition: opacity 0.1s;
  flex-shrink: 0;
}
.cal-event-pill:hover { opacity: 0.8; }
.cal-event-pill.going  { border-left-color: #34d399; background: rgba(52,211,153,0.1);  color: #34d399; }
.cal-event-pill.maybe  { border-left-color: #f4a228; background: rgba(244,162,40,0.1);  color: #f4a228; }
.cal-event-pill.cant   { border-left-color: #e05252; background: rgba(224,82,82,0.08);  color: #e05252; }
.cal-weather {
  font-size: 10px; color: var(--text-muted); margin-top: auto;
  white-space: nowrap; flex-shrink: 0;
}
/* Event popup card */
.cal-event-popup {
  position: absolute; z-index: 20;
  background: var(--bg-panel); border: 1px solid var(--border-bright);
  border-radius: 12px; padding: 14px 16px; width: 260px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.45); display: none;
}
.cal-popup-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px;
}
.cal-popup-close {
  background: none; border: none; color: var(--text-muted); font-size: 16px;
  cursor: pointer; padding: 0; line-height: 1; flex-shrink: 0;
}
.cal-popup-when { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.cal-popup-desc { font-size: 11px; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.5; }
.cal-popup-rsvp { display: flex; gap: 6px; flex-wrap: wrap; }
.cal-popup-rsvp .event-rsvp-btn { flex: 1; font-size: 11px; padding: 5px 6px; }
@media (max-width: 680px) {
  .cal-container { border-radius: 0; height: 100vh; max-height: none; }
  .cal-overlay { padding: 0; }
  .cal-cell { padding: 3px 4px; }
  .cal-legend { display: none; }
  .cal-month-title { font-size: 15px; min-width: 0; }
}
